code stringlengths 20 1.04M | apis list | extract_api stringlengths 75 9.94M |
|---|---|---|
import pygame
import sys
import random
# TODO: Create a Ball class.
# TODO: Member variables: screen, color, x, y, radius, speed_x, speed_y
# TODO: Methods __init__, draw, move
class Ball:
def __init__ (self,screen,color,x,y,radius,speed_x,speed_y):
# variable set up
self.screen = screen
s... | [
"pygame.draw.circle",
"random.randint",
"pygame.event.get",
"pygame.display.set_mode",
"pygame.Color",
"pygame.init",
"pygame.display.update",
"pygame.display.set_caption",
"pygame.time.Clock",
"pygame.key.get_pressed",
"sys.exit"
] | [((1106, 1119), 'pygame.init', 'pygame.init', ([], {}), '()\n', (1117, 1119), False, 'import pygame\n'), ((1133, 1170), 'pygame.display.set_mode', 'pygame.display.set_mode', (['(2550, 1350)'], {}), '((2550, 1350))\n', (1156, 1170), False, 'import pygame\n'), ((1175, 1218), 'pygame.display.set_caption', 'pygame.display.... |
import subprocess
#subprocess.call("node-gyp --directory=route rebuild --msvs_version=2015",shell=True)
#subprocess.call("node route.js")
subprocess.call("node-gyp --directory=fs rebuild --msvs_version=2015",shell=True)
subprocess.call("node fs.js") | [
"subprocess.call"
] | [((140, 226), 'subprocess.call', 'subprocess.call', (['"""node-gyp --directory=fs rebuild --msvs_version=2015"""'], {'shell': '(True)'}), "('node-gyp --directory=fs rebuild --msvs_version=2015',\n shell=True)\n", (155, 226), False, 'import subprocess\n'), ((222, 251), 'subprocess.call', 'subprocess.call', (['"""node... |
from flask import redirect, url_for, render_template, make_response, jsonify
from xolon.blueprints.meta import meta_bp
from xolon.library.jsonrpc import daemon
from xolon.library.cache import cache
from xolon.library.db import Database
from xolon.library.docker import Docker
from xolon.library.helpers import on_mainten... | [
"xolon.library.db.Database",
"xolon.library.cache.cache.redis.ping",
"xolon.library.cache.cache.get_coin_info",
"xolon.blueprints.meta.meta_bp.route",
"xolon.library.jsonrpc.daemon.info",
"flask.url_for",
"flask.render_template",
"xolon.library.docker.Docker",
"xolon.library.helpers.on_maintenance"
... | [((328, 346), 'xolon.blueprints.meta.meta_bp.route', 'meta_bp.route', (['"""/"""'], {}), "('/')\n", (341, 346), False, 'from xolon.blueprints.meta import meta_bp\n'), ((457, 478), 'xolon.blueprints.meta.meta_bp.route', 'meta_bp.route', (['"""/faq"""'], {}), "('/faq')\n", (470, 478), False, 'from xolon.blueprints.meta i... |
# -*- coding: utf-8 -*-
"""
@author: <NAME> <<EMAIL>>
"""
import unittest
from cornac.eval_methods import CrossValidation
from cornac.data import Reader
import numpy as np
class TestCrossValidation(unittest.TestCase):
def setUp(self):
self.data = Reader().read('./tests/data.txt')
self.n_folds =... | [
"unittest.main",
"cornac.eval_methods.CrossValidation",
"numpy.testing.assert_array_equal",
"numpy.unique",
"cornac.data.Reader"
] | [((1350, 1365), 'unittest.main', 'unittest.main', ([], {}), '()\n', (1363, 1365), False, 'import unittest\n'), ((341, 394), 'cornac.eval_methods.CrossValidation', 'CrossValidation', ([], {'data': 'self.data', 'n_folds': 'self.n_folds'}), '(data=self.data, n_folds=self.n_folds)\n', (356, 394), False, 'from cornac.eval_m... |
# -*- coding: utf-8 -*-
"""
Created on Fri Aug 4 19:11:08 2017
@author: colditzjb
A command line tool for sub-sampling parsed RITHM data.
"""
import sys, re
import parselogic
###
# The "subsample" class is used to systematically subsample RITHM output
# as TSV files from a defined system directory.
###
class subsam... | [
"math.sqrt",
"random.sample",
"parselogic.reformat",
"parselogic.criteria_match",
"parselogic.match",
"parselogic.othlist",
"parselogic.cmdvars",
"parselogic.t_col",
"parselogic.filelist",
"parselogic.kwslist",
"re.sub",
"operator.itemgetter"
] | [((639, 657), 'parselogic.t_col', 'parselogic.t_col', ([], {}), '()\n', (655, 657), False, 'import parselogic\n'), ((17716, 17736), 'parselogic.cmdvars', 'parselogic.cmdvars', ([], {}), '()\n', (17734, 17736), False, 'import parselogic\n'), ((18582, 18619), 'parselogic.kwslist', 'parselogic.kwslist', (['dir_in_kws', 'f... |
# Authors: <NAME> <<EMAIL>>
#
# License: BSD (3-clause)
from qtpy.QtWidgets import QDialog, QVBoxLayout, QListWidget, QDialogButtonBox
from qtpy.QtCore import Slot
class PickChannelsDialog(QDialog):
def __init__(self, parent, channels, selected=None, title="Pick channels"):
super().__init__(parent)
... | [
"qtpy.QtCore.Slot",
"qtpy.QtWidgets.QDialogButtonBox",
"qtpy.QtWidgets.QListWidget",
"qtpy.QtWidgets.QVBoxLayout"
] | [((1248, 1254), 'qtpy.QtCore.Slot', 'Slot', ([], {}), '()\n', (1252, 1254), False, 'from qtpy.QtCore import Slot\n'), ((462, 479), 'qtpy.QtWidgets.QVBoxLayout', 'QVBoxLayout', (['self'], {}), '(self)\n', (473, 479), False, 'from qtpy.QtWidgets import QDialog, QVBoxLayout, QListWidget, QDialogButtonBox\n'), ((504, 517),... |
from fosspay.config import _cfg
class Currency:
def __init__(self, symbol, position):
self.symbol = symbol
self.position = position
def amount(self, amount):
if self.position == "right":
return amount + self.symbol
else:
return self.symbol + amount
... | [
"fosspay.config._cfg"
] | [((474, 490), 'fosspay.config._cfg', '_cfg', (['"""currency"""'], {}), "('currency')\n", (478, 490), False, 'from fosspay.config import _cfg\n')] |
import unittest
from fs.tempfs import TempFS
from fs.memoryfs import MemoryFS
from fs import utils
from six import b
class TestUtils(unittest.TestCase):
def _make_fs(self, fs):
fs.setcontents("f1", b("file 1"))
fs.setcontents("f2", b("file 2"))
fs.setcontents("f3", b("file 3"))
... | [
"fs.memoryfs.MemoryFS",
"fs.utils.movedir",
"fs.utils.copydir",
"fs.tempfs.TempFS",
"fs.utils.remove_all",
"six.b"
] | [((1031, 1041), 'fs.memoryfs.MemoryFS', 'MemoryFS', ([], {}), '()\n', (1039, 1041), False, 'from fs.memoryfs import MemoryFS\n'), ((1091, 1101), 'fs.memoryfs.MemoryFS', 'MemoryFS', ([], {}), '()\n', (1099, 1101), False, 'from fs.memoryfs import MemoryFS\n'), ((1110, 1133), 'fs.utils.copydir', 'utils.copydir', (['fs1', ... |
# first load the pipeline
from talos.examples.pipelines import iris_pipeline
def test_scan_object():
print("Running Scan object test...")
# the create the test based on it
scan_object = iris_pipeline()
keras_model = scan_object.best_model()
scan_object.evaluate_models(x_val=scan_object.x,
... | [
"talos.examples.pipelines.iris_pipeline"
] | [((202, 217), 'talos.examples.pipelines.iris_pipeline', 'iris_pipeline', ([], {}), '()\n', (215, 217), False, 'from talos.examples.pipelines import iris_pipeline\n')] |
from functools import wraps
def coroutine(func):
@wraps(func)
def wrapper(*args, **kwargs):
generator = func(*args, **kwargs)
next(generator)
return generator
return wrapper
| [
"functools.wraps"
] | [((54, 65), 'functools.wraps', 'wraps', (['func'], {}), '(func)\n', (59, 65), False, 'from functools import wraps\n')] |
"""
defines GuiQtCommon
This file defines functions related to the result updating that are VTK specific
"""
# coding: utf-8
# pylint: disable=C0111
import sys
from copy import deepcopy
from collections import namedtuple
import numpy as np
from numpy import issubdtype
from numpy.linalg import norm # type: ignore
im... | [
"numpy.sin",
"numpy.linalg.norm",
"vtk.vtkLabeledDataMapper",
"pyNastran.bdf.cards.aero.utils.points_elements_from_quad_points",
"vtk.vtkPolyDataMapper",
"numpy.multiply",
"numpy.copy",
"vtk.vtkStripper",
"pyNastran.gui.gui_objects.names_storage.NamesStorage",
"pyNastran.gui.gui_objects.alt_geomet... | [((962, 1166), 'collections.namedtuple', 'namedtuple', (['"""FringeData"""', '"""icase, result_type, location, min_value, max_value, norm_value,data_format, scale, methods,subcase_id, subtitle, label,nlabels, labelsize, ncolors, colormap,imin, imax"""'], {}), "('FringeData',\n 'icase, result_type, location, min_valu... |
from aiocache import caches, cached as raw_cached
from nonebot import get_bot
def init() -> None:
"""
Initialize the cache module.
"""
bot = get_bot()
caches.set_config({
'default': {
'cache': "aiocache.SimpleMemoryCache",
'serializer': {
'class': "aiocache.seri... | [
"nonebot.get_bot",
"aiocache.cached",
"aiocache.caches.set_config"
] | [((159, 168), 'nonebot.get_bot', 'get_bot', ([], {}), '()\n', (166, 168), False, 'from nonebot import get_bot\n'), ((173, 314), 'aiocache.caches.set_config', 'caches.set_config', (["{'default': {'cache': 'aiocache.SimpleMemoryCache', 'serializer': {'class':\n 'aiocache.serializers.StringSerializer'}}}"], {}), "({'de... |
import os
import torch
import trimesh
import argparse
import torchvision.utils as vis
from scipy.spatial.transform import Rotation as R
from renderer.rasterer import Rasterer
from grid import Grid3D
import deepsdf.workspace as dsdf_ws
def render_model(model_path, primitives, precision, output_dir='renderer/output'):... | [
"grid.Grid3D",
"trimesh.load",
"torch.eye",
"argparse.ArgumentParser",
"os.makedirs",
"torch.Tensor",
"os.path.splitext",
"renderer.rasterer.Rasterer",
"os.path.join",
"scipy.spatial.transform.Rotation.from_euler",
"deepsdf.workspace.setup_dsdf"
] | [((700, 736), 'scipy.spatial.transform.Rotation.from_euler', 'R.from_euler', (['"""x"""', 'rot'], {'degrees': '(True)'}), "('x', rot, degrees=True)\n", (712, 736), True, 'from scipy.spatial.transform import Rotation as R\n'), ((1817, 1855), 'os.makedirs', 'os.makedirs', (['output_dir'], {'exist_ok': '(True)'}), '(outpu... |
"""
Sample TestCase.
Remove the leading underscore character from the file name
"""
import unittest
from pythonboilerplate.app import run
class TestSample(unittest.TestCase):
"""Sample test"""
def setUp(self):
"""Set up test fixtures, if any"""
def tearDown(self):
"""Tear down... | [
"pythonboilerplate.app.run"
] | [((563, 587), 'pythonboilerplate.app.run', 'run', (['"""from test_app_run"""'], {}), "('from test_app_run')\n", (566, 587), False, 'from pythonboilerplate.app import run\n'), ((534, 539), 'pythonboilerplate.app.run', 'run', ([], {}), '()\n', (537, 539), False, 'from pythonboilerplate.app import run\n')] |
# import unittest
import pytest
import os
import re
import sys
sys.path.append(os.path.join(os.path.dirname(__file__), ".."))
import utils.utils as utils
DIRPATH = os.path.join(os.path.dirname(__file__), "..", "..", "outputs", "ieee")
LIST_FOLDERS = os.listdir(DIRPATH)
exp_matches = []
# create match pattern from fold... | [
"os.path.basename",
"utils.utils.gzip_footer",
"os.path.dirname",
"re.match",
"pytest.mark.parametrize",
"os.path.join",
"os.listdir"
] | [((251, 270), 'os.listdir', 'os.listdir', (['DIRPATH'], {}), '(DIRPATH)\n', (261, 270), False, 'import os\n'), ((2597, 2701), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""dataset_name,subject_id"""', "[('ds000256', 'CTS201'), ('ds000256', 'CTS201')]"], {}), "('dataset_name,subject_id', [('ds000256', 'CTS... |
# Copyright (C) 2011, 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:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the... | [
"webkitpy.layout_tests.port.factory.all_port_names",
"webkitpy.layout_tests.port.factory.get"
] | [((2212, 2241), 'webkitpy.layout_tests.port.factory.all_port_names', 'port_factory.all_port_names', ([], {}), '()\n', (2239, 2241), True, 'from webkitpy.layout_tests.port import factory as port_factory\n'), ((2258, 2285), 'webkitpy.layout_tests.port.factory.get', 'port_factory.get', (['port_name'], {}), '(port_name)\n'... |
import pathlib
path = pathlib.Path().absolute()
dat = open('{0}/predavanje10/MojaDatoteka.txt'.format(path) )
#print(dat.read())
print(dat.readline())
print(dat.readline())
print(dat.readline())
print(dat.readline())
dat = open('{0}/predavanje10/MojaDatoteka.txt'.format(path), 'r' )
print(dat.readlines())
print(dat... | [
"pathlib.Path"
] | [((22, 36), 'pathlib.Path', 'pathlib.Path', ([], {}), '()\n', (34, 36), False, 'import pathlib\n')] |
""" Python app to complete the device code flow after user has done authentication.
This module acts in tandem with fill_device_code_flow.py
"""
import json
import msal
with open("app-secrets.json", "r", encoding="utf-8") as app_settings_file:
app_settings = json.load(app_settings_file)
# Create a preferably... | [
"msal.PublicClientApplication",
"json.load",
"json.dumps"
] | [((382, 479), 'msal.PublicClientApplication', 'msal.PublicClientApplication', (["app_settings['client_id']"], {'authority': "app_settings['authority']"}), "(app_settings['client_id'], authority=\n app_settings['authority'])\n", (410, 479), False, 'import msal\n'), ((269, 297), 'json.load', 'json.load', (['app_settin... |
#! /usr/bin/env python3
from datetime import date
from suntime import Sun, SunTimeException
import location
def get_sun():
lat, long = location.get_location()
# Suntime
sun = Sun(lat, long)
return sun
def rise_print():
# SUNRISE
date = get_date()
sun = get_sun()
time = sun.get_loc... | [
"suntime.Sun",
"location.get_location",
"datetime.date.today"
] | [((144, 167), 'location.get_location', 'location.get_location', ([], {}), '()\n', (165, 167), False, 'import location\n'), ((193, 207), 'suntime.Sun', 'Sun', (['lat', 'long'], {}), '(lat, long)\n', (196, 207), False, 'from suntime import Sun, SunTimeException\n'), ((620, 632), 'datetime.date.today', 'date.today', ([], ... |
# MIT License
# Copyright (c) 2018 <NAME>
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish... | [
"tensorflow.contrib.layers.xavier_initializer",
"numpy.argmax",
"tensorflow.reset_default_graph",
"tensorflow.layers.max_pooling2d",
"tensorflow.layers.batch_normalization",
"tensorflow.nn.relu",
"tensorflow.placeholder",
"tensorflow.squeeze",
"tensorflow.train.Saver",
"tensorflow.global_variables... | [((11698, 11722), 'tensorflow.reset_default_graph', 'tf.reset_default_graph', ([], {}), '()\n', (11720, 11722), True, 'import tensorflow as tf\n'), ((11738, 11817), 'tensorflow.placeholder', 'tf.placeholder', (['tf.float32'], {'shape': '(None, 299, 299, 3)', 'name': '"""input_placeholder"""'}), "(tf.float32, shape=(Non... |
try:
import tensorflow.compat.v1 as tf
except Exception:
import tensorflow as tf
import numpy as np
import os
try:
xavier_initializer = tf.contrib.layers.xavier_initializer()
except Exception:
xavier_initializer = None
def disable_gpu():
os.environ["CUDA_VISIBLE_DEVICES"] = '-1'
return
def var_shape(x)... | [
"tensorflow.contrib.layers.xavier_initializer",
"numpy.log",
"tensorflow.log",
"tensorflow.maximum",
"tensorflow.reshape",
"tensorflow.reduce_mean",
"tensorflow.minimum",
"tensorflow.placeholder",
"tensorflow.shape",
"tensorflow.group",
"tensorflow.square",
"tensorflow.gradients",
"numpy.pro... | [((143, 181), 'tensorflow.contrib.layers.xavier_initializer', 'tf.contrib.layers.xavier_initializer', ([], {}), '()\n', (179, 181), True, 'import tensorflow as tf\n'), ((629, 666), 'tensorflow.gradients', 'tf.gradients', (['loss', 'var_list', 'grad_ys'], {}), '(loss, var_list, grad_ys)\n', (641, 666), True, 'import ten... |
import tempfile
import shutil
from payment_test.settings import MEDIA_ROOT
def handle_uploaded_file(source):
fd, filepath = tempfile.mkstemp(prefix=source.name, dir=MEDIA_ROOT)
with open(filepath, 'wb') as dest:
shutil.copyfileobj(source, dest)
return filepath | [
"shutil.copyfileobj",
"tempfile.mkstemp"
] | [((129, 181), 'tempfile.mkstemp', 'tempfile.mkstemp', ([], {'prefix': 'source.name', 'dir': 'MEDIA_ROOT'}), '(prefix=source.name, dir=MEDIA_ROOT)\n', (145, 181), False, 'import tempfile\n'), ((229, 261), 'shutil.copyfileobj', 'shutil.copyfileobj', (['source', 'dest'], {}), '(source, dest)\n', (247, 261), False, 'import... |
from typing import Any, Dict, List, NewType, Optional, Set, Tuple, Union
from pydantic import BaseModel, BaseSettings
from labfunctions import defaults
ExtraField = NewType("ExtraField", Dict[str, Any])
class SSHKey(BaseModel):
"""
It represents a SSHKey configuration,
it will have the paths to public ... | [
"typing.NewType"
] | [((168, 205), 'typing.NewType', 'NewType', (['"""ExtraField"""', 'Dict[str, Any]'], {}), "('ExtraField', Dict[str, Any])\n", (175, 205), False, 'from typing import Any, Dict, List, NewType, Optional, Set, Tuple, Union\n')] |
import pathlib
import setuptools
setuptools.setup(
name='lektor-simplemde',
use_scm_version=True,
setup_requires=[
'setuptools_scm',
],
author='<NAME>',
author_email='<EMAIL>',
maintainer='spherical.pm',
maintainer_email='<EMAIL>',
description='Plugin integrating Simple... | [
"pathlib.Path",
"setuptools.find_packages"
] | [((558, 584), 'setuptools.find_packages', 'setuptools.find_packages', ([], {}), '()\n', (582, 584), False, 'import setuptools\n'), ((454, 479), 'pathlib.Path', 'pathlib.Path', (['"""README.md"""'], {}), "('README.md')\n", (466, 479), False, 'import pathlib\n')] |
"""
본 로직은 나도코딩 연산자 파트를 따라서 작성함을 알립니다.
https://www.youtube.com/watch?v=kWiCuklohdY
"""
# [연산자]
# 연산기호(덧셈, 뺄셈, 곱셈, 나눗셈)
print(1 + 1) # 2
print(3 - 2) # 1
print(5 * 2) # 10
print(6 / 3) # 2
# **(제곱), %(나머지), //(몫)
print(2 ** 3) # 제곱 2^3= 8
print(5 % 3) # 나머지 2
print(10 % 3) # 나머지1
print(5 // 3) # 몫 1
print(10 /... | [
"random.randrange",
"math.floor",
"math.sqrt",
"math.ceil"
] | [((1456, 1467), 'math.floor', 'floor', (['(4.99)'], {}), '(4.99)\n', (1461, 1467), False, 'from math import floor, ceil, sqrt\n'), ((1489, 1499), 'math.ceil', 'ceil', (['(3.14)'], {}), '(3.14)\n', (1493, 1499), False, 'from math import floor, ceil, sqrt\n'), ((1521, 1529), 'math.sqrt', 'sqrt', (['(16)'], {}), '(16)\n',... |
import sys
import pathlib
import numpy
import scipy.integrate
import scipy.optimize
import scipy.interpolate
def large_arch(fc=60, Qb=100, Qt=49, L=30, nsegs=25):
"""
http://en.wikipedia.org/wiki/Jefferson_National_Expansion_Memorial
fc = maximum height of centroid (in feet) = 625.0925
Qb = maximum c... | [
"numpy.zeros",
"numpy.arccosh",
"pathlib.Path",
"numpy.array",
"numpy.linalg.norm",
"numpy.cosh",
"numpy.sinh",
"numpy.sqrt"
] | [((594, 616), 'numpy.arccosh', 'numpy.arccosh', (['(Qb / Qt)'], {}), '(Qb / Qt)\n', (607, 616), False, 'import numpy\n'), ((1841, 1868), 'numpy.zeros', 'numpy.zeros', (['(nsegs * 8, 3)'], {}), '((nsegs * 8, 3))\n', (1852, 1868), False, 'import numpy\n'), ((2115, 2139), 'numpy.array', 'numpy.array', (['[-dydx0, 1]'], {}... |
#This script is for produsing groups of selectors for statstiscs
import re
#prefix = '<tr><td>open</td><td>'
#suffix = '</td><td></td></tr><tr><td>waitForPageToLoad</td><td></td><td>3000</td></tr>'
with open('CSSDB.txt','r') as f:
newlines = []
for line in f.readlines():
line=re.sub(r'^\s*', '', line... | [
"re.findall",
"re.sub"
] | [((296, 321), 're.sub', 're.sub', (['"""^\\\\s*"""', '""""""', 'line'], {}), "('^\\\\s*', '', line)\n", (302, 321), False, 'import re\n'), ((806, 851), 're.findall', 're.findall', (['""":nth-[a-z\\\\-]+\\\\([^)]+\\\\)"""', 'line'], {}), "(':nth-[a-z\\\\-]+\\\\([^)]+\\\\)', line)\n", (816, 851), False, 'import re\n'), (... |
# Copyright 2019 Nexenta Systems, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless req... | [
"oslo_log.log.getLogger",
"cinder.volume.volume_utils.paginate_entries_list",
"cinder.volume.volume_utils.extract_id_from_snapshot_name",
"os.path.join",
"cinder.volume.drivers.nexenta.ns5.jsonrpc.NefException",
"cinder.volume.drivers.nexenta.ns5.jsonrpc.NefProxy",
"uuid.UUID",
"cinder.i18n._",
"has... | [((1141, 1168), 'oslo_log.log.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1158, 1168), True, 'from oslo_log import log as logging\n'), ((18265, 18309), 'cinder.coordination.synchronized', 'coordination.synchronized', (['"""{self.nef.lock}"""'], {}), "('{self.nef.lock}')\n", (18290, 18309), Fal... |
import asyncio
import discord
import math
import shlex
from utils.watora import get_str
ARROW_RIGHT = '▶'
ARROW_LEFT = '◀'
ARROW_TOP = '🔼'
ARROW_BOTTOM = '🔽'
ARROW_TOPTOP = '⏫'
ARROW_BOTBOT = '⏬'
ARROW_LEFTLEFT = '⬅'
ARROW_RIGHTRIGHT = '➡'
STOP = '⏹'
RESET = '⏺'
REPLAY = '🔁'
REPLAY_ONE = '🔂'
PAUSE = '⏸'
SHUFFLE =... | [
"utils.watora.get_str",
"discord.Embed",
"shlex.shlex"
] | [((2181, 2199), 'shlex.shlex', 'shlex.shlex', (['value'], {}), '(value)\n', (2192, 2199), False, 'import shlex\n'), ((3068, 3117), 'discord.Embed', 'discord.Embed', ([], {'color': 'self.color', 'description': 'desc'}), '(color=self.color, description=desc)\n', (3081, 3117), False, 'import discord\n'), ((6746, 6795), 'd... |
from PyQt5 import QtWidgets
from PyQt5.QtWidgets import QApplication, QMainWindow
import sys
def window():
app = QApplication(sys.argv)
win = QMainWindow()
win.setGeometry(200,200,300,300)
win.setWindowTitle("Test GUI")
win.show()
print('Check')
sys.exit(app.exec_())
window()
| [
"PyQt5.QtWidgets.QApplication",
"PyQt5.QtWidgets.QMainWindow"
] | [((118, 140), 'PyQt5.QtWidgets.QApplication', 'QApplication', (['sys.argv'], {}), '(sys.argv)\n', (130, 140), False, 'from PyQt5.QtWidgets import QApplication, QMainWindow\n'), ((151, 164), 'PyQt5.QtWidgets.QMainWindow', 'QMainWindow', ([], {}), '()\n', (162, 164), False, 'from PyQt5.QtWidgets import QApplication, QMai... |
from aleph.core import archive
from aleph.authz import Authz
from aleph.logic.util import archive_url
from aleph.tests.util import TestCase
class ArchiveApiTestCase(TestCase):
def setUp(self):
super(ArchiveApiTestCase, self).setUp()
self.fixture = self.get_fixture_path("samples/website.html")
... | [
"aleph.logic.util.archive_url",
"aleph.core.archive.archive_file",
"aleph.authz.Authz.from_role"
] | [((344, 378), 'aleph.core.archive.archive_file', 'archive.archive_file', (['self.fixture'], {}), '(self.fixture)\n', (364, 378), False, 'from aleph.core import archive\n'), ((687, 708), 'aleph.authz.Authz.from_role', 'Authz.from_role', (['None'], {}), '(None)\n', (702, 708), False, 'from aleph.authz import Authz\n'), (... |
from .settings import *
import pymysql
pymysql.install_as_MySQLdb()
DEBUG = True
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'mes',
'USER': 'usr',
'PASSWORD': '<PASSWORD>',
'HOST': '192.168.2.3',
'PORT': '3306',
'OPTIONS': {
'sql_mode': 'traditional',
}
}
#'def... | [
"pymysql.install_as_MySQLdb"
] | [((39, 67), 'pymysql.install_as_MySQLdb', 'pymysql.install_as_MySQLdb', ([], {}), '()\n', (65, 67), False, 'import pymysql\n')] |
# ===========================================================================
# This software is subject to the provisions of the Zope Public License,
# Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCL... | [
"System.UInt32",
"System.Single",
"System.UInt64",
"six.u",
"Python.Test.ISpam",
"unittest.makeSuite",
"Python.Test.Spam",
"System.Int16",
"System.Decimal.Parse",
"System.SByte",
"System.Int32",
"System.Double",
"six.b",
"System.Byte",
"System.Decimal",
"unittest.TextTestRunner",
"si... | [((25870, 25905), 'unittest.makeSuite', 'unittest.makeSuite', (['ConversionTests'], {}), '(ConversionTests)\n', (25888, 25905), False, 'import sys, os, string, unittest, types\n'), ((880, 896), 'Python.Test.ConversionTest', 'ConversionTest', ([], {}), '()\n', (894, 896), False, 'from Python.Test import ConversionTest\n... |
# Copyright 2013 - 2017 Mirantis, 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 ... | [
"cookiecutter.generate.generate_files",
"yaml.dump",
"reclass_tools.helpers.json_read",
"reclass_tools.helpers.yaml_read",
"reclass_tools.helpers.merge_nested_objects",
"sys.exit"
] | [((1479, 1532), 'yaml.dump', 'yaml.dump', (['value'], {'default_flow_style': '(False)', 'width': '(255)'}), '(value, default_flow_style=False, width=255)\n', (1488, 1532), False, 'import yaml\n'), ((2099, 2152), 'reclass_tools.helpers.merge_nested_objects', 'helpers.merge_nested_objects', (['merged_context', 'context']... |
from pytest import raises
from ..exceptions import InvalidConfigurationValue
from ..config import Config
from ..settings import Setting
from ..resolver import Resolver
from ..backupscheme import GenConfig
import socket
def test_validate_empty():
config = Config()
assert config.validate({}) == defaultAnd()
d... | [
"pytest.raises",
"socket.getaddrinfo"
] | [((697, 730), 'pytest.raises', 'raises', (['InvalidConfigurationValue'], {}), '(InvalidConfigurationValue)\n', (703, 730), False, 'from pytest import raises\n'), ((1169, 1202), 'pytest.raises', 'raises', (['InvalidConfigurationValue'], {}), '(InvalidConfigurationValue)\n', (1175, 1202), False, 'from pytest import raise... |
import ssl
from unittest import TestCase
from clickhouse_driver import Client
from clickhouse_driver.compression.lz4 import Compressor as LZ4Compressor
from clickhouse_driver.compression.lz4hc import Compressor as LZHC4Compressor
from clickhouse_driver.compression.zstd import Compressor as ZSTDCompressor
from clickhou... | [
"clickhouse_driver.Client.from_url"
] | [((613, 649), 'clickhouse_driver.Client.from_url', 'Client.from_url', (['"""clickhouse://host"""'], {}), "('clickhouse://host')\n", (628, 649), False, 'from clickhouse_driver import Client\n'), ((774, 813), 'clickhouse_driver.Client.from_url', 'Client.from_url', (['"""clickhouse://host/db"""'], {}), "('clickhouse://hos... |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'TechnologyTag'
db.create_table('tags_technologytag', (
('id', self.gf('django.db... | [
"south.db.db.delete_table",
"south.db.db.send_create_signal"
] | [((567, 615), 'south.db.db.send_create_signal', 'db.send_create_signal', (['"""tags"""', "['TechnologyTag']"], {}), "('tags', ['TechnologyTag'])\n", (588, 615), False, 'from south.db import db\n'), ((1250, 1305), 'south.db.db.send_create_signal', 'db.send_create_signal', (['"""tags"""', "['TechnologyTaggedItem']"], {})... |
import ray
from ray import workflow
import requests
@ray.remote
def compute_large_fib(M: int, n: int = 1, fib: int = 1):
next_fib = requests.post(
"https://nemo.api.stdlib.com/fibonacci@0.0.1/", data={"nth": n}
).json()
if next_fib > M:
return fib
else:
return workflow.continua... | [
"requests.post"
] | [((138, 216), 'requests.post', 'requests.post', (['"""https://nemo.api.stdlib.com/fibonacci@0.0.1/"""'], {'data': "{'nth': n}"}), "('https://nemo.api.stdlib.com/fibonacci@0.0.1/', data={'nth': n})\n", (151, 216), False, 'import requests\n')] |
# Help plugin by Apis
# Credits By Ultroid
from telethon.tl.types import ChannelParticipantAdmin as admin
from telethon.tl.types import ChannelParticipantCreator as owner
from telethon.tl.types import UserStatusOffline as off
from telethon.tl.types import UserStatusOnline as onn
from telethon.tl.types import UserStatu... | [
"telethon.utils.get_display_name",
"userbot.CMD_HELP.update",
"userbot.events.register"
] | [((450, 558), 'userbot.events.register', 'register', ([], {'outgoing': '(True)', 'pattern': '"""^\\\\.tags(on|off|all|bots|rec|admins|owner)?(.*)"""', 'disable_errors': '(True)'}), "(outgoing=True, pattern=\n '^\\\\.tags(on|off|all|bots|rec|admins|owner)?(.*)', disable_errors=True)\n", (458, 558), False, 'from userb... |
# File: S (Python 2.4)
from direct.fsm.StatePush import AttrSetter, FunctionCall, StateVar
from pirates.pvp import PVPGlobals
class ShipRepairSpotMgrBase:
def __init__(self):
self._state = DestructiveScratchPad(health = StateVar(0), speed = StateVar(0), armor = StateVar(0), modelClass = StateVar(0), ... | [
"direct.fsm.StatePush.FunctionCall",
"direct.fsm.StatePush.StateVar"
] | [((239, 250), 'direct.fsm.StatePush.StateVar', 'StateVar', (['(0)'], {}), '(0)\n', (247, 250), False, 'from direct.fsm.StatePush import AttrSetter, FunctionCall, StateVar\n'), ((260, 271), 'direct.fsm.StatePush.StateVar', 'StateVar', (['(0)'], {}), '(0)\n', (268, 271), False, 'from direct.fsm.StatePush import AttrSette... |
import tensorflow.compat.v1 as tf
from t3f import initializers
from t3f import shapes
class _ShapesTest():
def testLazyShapeOverflow(self):
large_shape = [10] * 20
tensor = initializers.random_matrix_batch([large_shape, large_shape],
batch_size=5, dtype=self.dtype)
self.assertAllEqual(... | [
"tensorflow.compat.v1.test.main",
"t3f.shapes.lazy_shape",
"t3f.initializers.random_matrix_batch"
] | [((561, 575), 'tensorflow.compat.v1.test.main', 'tf.test.main', ([], {}), '()\n', (573, 575), True, 'import tensorflow.compat.v1 as tf\n'), ((187, 283), 't3f.initializers.random_matrix_batch', 'initializers.random_matrix_batch', (['[large_shape, large_shape]'], {'batch_size': '(5)', 'dtype': 'self.dtype'}), '([large_sh... |
# Generated by Django 3.1.7 on 2021-04-06 04:15
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('companies', '0003_auto_20210406_0610'),
]
operations = [
migrations.AlterField(
model_name='company',
name='from_ema... | [
"django.db.models.CharField"
] | [((343, 435), 'django.db.models.CharField', 'models.CharField', ([], {'default': '"""<NAME> <<EMAIL>>"""', 'max_length': '(255)', 'verbose_name': '"""From email"""'}), "(default='<NAME> <<EMAIL>>', max_length=255, verbose_name=\n 'From email')\n", (359, 435), False, 'from django.db import migrations, models\n')] |
# Copyright 2017 University of Maryland.
#
# This file is part of Sesame. It is subject to the license terms in the file
# LICENSE.rst found in the top-level directory of this distribution.
import numpy as np
from .observables import *
from .defects import defectsF
def getF(sys, v, efn, efp, veq):
###############... | [
"numpy.zeros",
"numpy.array",
"numpy.exp",
"numpy.tile",
"numpy.arange",
"numpy.repeat"
] | [((958, 987), 'numpy.zeros', 'np.zeros', (['(3 * Nx * Ny * Nz,)'], {}), '((3 * Nx * Ny * Nz,))\n', (966, 987), True, 'import numpy as np\n'), ((6392, 6432), 'numpy.tile', 'np.tile', (['sys.dx[1:]', '((Ny - 2) * (Nz - 2))'], {}), '(sys.dx[1:], (Ny - 2) * (Nz - 2))\n', (6399, 6432), True, 'import numpy as np\n'), ((6436,... |
"""
Author: <NAME>
Date: 9/21/21
File: ./neonify/db.py
Description: Initialize the database connection
Notes: Code adapted from the flask tutorial [found at https://flask.palletsprojects.com/en/2.0.x/tutorial/]
"""
import sqlite3
import click
from flask import current_app, g
from flask.cli import with_appcontext
de... | [
"flask.current_app.open_resource",
"flask.g.pop",
"click.echo",
"click.command",
"sqlite3.connect"
] | [((783, 807), 'click.command', 'click.command', (['"""init-db"""'], {}), "('init-db')\n", (796, 807), False, 'import click\n'), ((578, 595), 'flask.g.pop', 'g.pop', (['"""db"""', 'None'], {}), "('db', None)\n", (583, 595), False, 'from flask import current_app, g\n'), ((923, 962), 'click.echo', 'click.echo', (['"""Init... |
import sys
import os.path
from sklearn.externals.joblib import Memory
from sklearn.datasets import load_svmlight_file
import petsc4py
petsc4py.init(sys.argv)
from petsc4py import PETSc
mem = Memory("./mycache")
@mem.cache
def get_data(file_libsvm):
data = load_svmlight_file(file_libsvm)
return data[0], dat... | [
"petsc4py.PETSc.Mat",
"petsc4py.PETSc.Viewer",
"petsc4py.init",
"petsc4py.PETSc.Vec",
"sklearn.externals.joblib.Memory",
"sklearn.datasets.load_svmlight_file"
] | [((136, 159), 'petsc4py.init', 'petsc4py.init', (['sys.argv'], {}), '(sys.argv)\n', (149, 159), False, 'import petsc4py\n'), ((195, 214), 'sklearn.externals.joblib.Memory', 'Memory', (['"""./mycache"""'], {}), "('./mycache')\n", (201, 214), False, 'from sklearn.externals.joblib import Memory\n'), ((265, 296), 'sklearn.... |
from pynwb.form.build import GroupBuilder, DatasetBuilder, LinkBuilder, RegionBuilder
from pynwb.ecephys import * # noqa: F403
from . import base
class TestElectrodeGroupIO(base.TestMapRoundTrip):
def setUpContainer(self):
self.dev1 = Device('dev1', 'a test source') # noqa: F405
return Electr... | [
"pynwb.form.build.GroupBuilder",
"pynwb.form.build.RegionBuilder",
"pynwb.form.build.DatasetBuilder",
"pynwb.form.build.LinkBuilder"
] | [((602, 764), 'pynwb.form.build.GroupBuilder', 'GroupBuilder', (['"""dev1"""'], {'attributes': "{'neurodata_type': 'Device', 'namespace': 'core', 'help':\n 'A recording device e.g. amplifier', 'source': 'a test source'}"}), "('dev1', attributes={'neurodata_type': 'Device', 'namespace':\n 'core', 'help': 'A record... |
"""This script creates a dataset to train an object detector in COCO format, so that it can be used with Detectron2"""
from argparse import ArgumentParser
from pathlib import Path
import json
from datetime import date
from tqdm import tqdm
parser = ArgumentParser()
parser.add_argument('path_to_annotations', ... | [
"json.dump",
"tqdm.tqdm",
"datetime.date.today",
"argparse.ArgumentParser"
] | [((259, 275), 'argparse.ArgumentParser', 'ArgumentParser', ([], {}), '()\n', (273, 275), False, 'from argparse import ArgumentParser\n'), ((1129, 1156), 'tqdm.tqdm', 'tqdm', (["labels['annotations']"], {}), "(labels['annotations'])\n", (1133, 1156), False, 'from tqdm import tqdm\n'), ((2367, 2397), 'json.dump', 'json.d... |
# Copyright (c) 2020 fortiss GmbH
#
# This software is released under the MIT License.
# https://opensource.org/licenses/MIT
from bark.world.agent import Agent
from bark.models.behavior import BehaviorStaticTrajectory, BehaviorMobil
from bark.models.dynamic import StateDefinition
from bark.world.goal_definition import... | [
"bark.geometry.Polygon2d",
"modules.runtime.scenario.scenario_generation.model_json_conversion.ModelJsonConversion",
"com_github_interaction_dataset_interaction_dataset.python.utils.dict_utils.get_item_iterator",
"bark.geometry.Point2d",
"bark.geometry.Norm0To2PI",
"bark.world.goal_definition.GoalDefiniti... | [((1129, 1154), 'bark.geometry.Norm0To2PI', 'Norm0To2PI', (['state.psi_rad'], {}), '(state.psi_rad)\n', (1139, 1154), False, 'from bark.geometry import Point2d, Polygon2d, Norm0To2PI\n'), ((2256, 2279), 'bark.geometry.Polygon2d', 'Polygon2d', (['pose', 'points'], {}), '(pose, points)\n', (2265, 2279), False, 'from bark... |
# -*- coding: utf-8 -*-
from datetime import datetime, date, time
from django.core.management.base import NoArgsCommand
from refeicao.models import Solicitacao, HorarioSolicitacao
class Command(NoArgsCommand):
help = "Limpar registros de solicitação bolsa refeição"
def handle_noargs(self, **options):
h... | [
"datetime.datetime.now",
"datetime.datetime.today",
"refeicao.models.Solicitacao.objects.filter"
] | [((490, 506), 'datetime.datetime.today', 'datetime.today', ([], {}), '()\n', (504, 506), False, 'from datetime import datetime, date, time\n'), ((537, 589), 'refeicao.models.Solicitacao.objects.filter', 'Solicitacao.objects.filter', ([], {'data__lt': 'datahora_inicio'}), '(data__lt=datahora_inicio)\n', (563, 589), Fals... |
from django.shortcuts import render
from .models import Album, Photos
def library_view(request):
albums = Album.objects.filter(published='public').all()
return render(request, 'library.html', context={'albums': albums})
def album_view(request, album_id=0):
try:
album = Album.objects.get(id=album... | [
"django.shortcuts.render"
] | [((170, 229), 'django.shortcuts.render', 'render', (['request', '"""library.html"""'], {'context': "{'albums': albums}"}), "(request, 'library.html', context={'albums': albums})\n", (176, 229), False, 'from django.shortcuts import render\n'), ((554, 609), 'django.shortcuts.render', 'render', (['request', '"""album.html... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
class DefaultSettings(object):
"""
Default settings for Shop Wspay.
"""
def _setting(self, name, default=None):
from django.conf import settings
return getattr(settings, name, default)
@property
d... | [
"django.core.exceptions.ImproperlyConfigured"
] | [((553, 615), 'django.core.exceptions.ImproperlyConfigured', 'ImproperlyConfigured', (['"""SHOP_WSPAY_SHOP_ID setting must be set"""'], {}), "('SHOP_WSPAY_SHOP_ID setting must be set')\n", (573, 615), False, 'from django.core.exceptions import ImproperlyConfigured\n'), ((896, 961), 'django.core.exceptions.ImproperlyCon... |
##############################################################################
#
# Copyright (c) 2004 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOF... | [
"zope.component.adapter",
"zope.location.interfaces.ILocation.providedBy"
] | [((1042, 1116), 'zope.component.adapter', 'component.adapter', (['interfaces.IQuerySchemaSearch', 'IPluggableAuthentication'], {}), '(interfaces.IQuerySchemaSearch, IPluggableAuthentication)\n', (1059, 1116), False, 'from zope import component\n'), ((1568, 1600), 'zope.location.interfaces.ILocation.providedBy', 'ILocat... |
# Simple Node
import sys
import random
import numpy as np
import pygame
from data import *
from gbls import *
sys.path.append("../common/")
from NodeBase import NodeBase
class Node(NodeBase):
def __init__(self, x, y, ss):
# pass parameters to parent
NodeBase.__init__(self, x, y, ss)
# h... | [
"sys.path.append",
"pygame.draw.circle",
"numpy.array",
"NodeBase.NodeBase.__init__",
"numpy.int64"
] | [((112, 141), 'sys.path.append', 'sys.path.append', (['"""../common/"""'], {}), "('../common/')\n", (127, 141), False, 'import sys\n'), ((274, 307), 'NodeBase.NodeBase.__init__', 'NodeBase.__init__', (['self', 'x', 'y', 'ss'], {}), '(self, x, y, ss)\n', (291, 307), False, 'from NodeBase import NodeBase\n'), ((3198, 321... |
"""
Checks loading of some real world tools and workflows found in the wild (e.g. dockstore)
run individually as py.test -k tests/test_real_cwl.py
"""
from typing import Any, Dict, Union
import pytest # type: ignore
from schema_salad.avro.schema import Names, SchemaParseException
from schema_salad.exceptions impor... | [
"pytest.raises",
"schema_salad.schema.load_and_validate",
"schema_salad.schema.load_schema"
] | [((1037, 1054), 'schema_salad.schema.load_schema', 'load_schema', (['path'], {}), '(path)\n', (1048, 1054), False, 'from schema_salad.schema import load_and_validate, load_schema\n'), ((1226, 1260), 'pytest.raises', 'pytest.raises', (['ValidationException'], {}), '(ValidationException)\n', (1239, 1260), False, 'import ... |
##########################################################################
#
# Copyright (c) 2014, Image Engine Design 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:
#
# * Redistrib... | [
"Gaffer.readOnly",
"IECore.curry",
"GafferUI.PlugValueWidget.popupMenuSignal",
"Gaffer.Metadata.registerNode"
] | [((2025, 2638), 'Gaffer.Metadata.registerNode', 'Gaffer.Metadata.registerNode', (['GafferScene.DeleteGlobals', '"""description"""', '"""\n\tA node which removes named items from the globals.\n\tTo delete outputs or options specifically, prefer\n\tthe DeleteOutputs and DeleteOptions nodes respectively,\n\tas they provid... |
import numpy as np
"""
Dot product
The dot product multiplies two vectors and results in a scalar. This is also
why it is called the scalar product.
- The dot product is the sum of the products of the corresponding elements.
- When we have a dot product we always multiply a row vector by a column vector
"""
# Scalar ... | [
"numpy.dot",
"numpy.array"
] | [((341, 352), 'numpy.array', 'np.array', (['(3)'], {}), '(3)\n', (349, 352), True, 'import numpy as np\n'), ((358, 369), 'numpy.array', 'np.array', (['(6)'], {}), '(6)\n', (366, 369), True, 'import numpy as np\n'), ((376, 390), 'numpy.dot', 'np.dot', (['s1', 's2'], {}), '(s1, s2)\n', (382, 390), True, 'import numpy as ... |
import csv
import os
from datetime import datetime
from typing import Tuple, Generator, List, Callable, Dict
import torch
from torch import Tensor, nn
from torchtext import data
from torch.utils.tensorboard import SummaryWriter
import torch.optim as optim
import pandas as pd
from torchtext.data import TabularDataset, ... | [
"csv.reader",
"csv.writer",
"src.utils.tokenize_english_text",
"pandas.read_csv",
"torch.LongTensor",
"torch.load",
"src.utils.train_val_test_split",
"torchtext.data.LabelField",
"torch.cuda.is_available",
"src.config.CBOWConfig",
"torchtext.data.TabularDataset.splits",
"os.path.join",
"torc... | [((840, 867), 'torchtext.data.LabelField', 'data.LabelField', ([], {'lower': '(True)'}), '(lower=True)\n', (855, 867), False, 'from torchtext import data\n'), ((885, 907), 'torchtext.data.Field', 'data.Field', ([], {'lower': '(True)'}), '(lower=True)\n', (895, 907), False, 'from torchtext import data\n'), ((1006, 1159)... |
#!/usr/bin/python
# Copyright (C) 2003-2017 <NAME> <<EMAIL>>
#
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# n... | [
"sys.stdout.write",
"re.sub",
"sys.exit"
] | [((4737, 4771), 're.sub', 're.sub', (['""".*[\\\\/]"""', '""""""', 'sys.argv[0]'], {}), "('.*[\\\\/]', '', sys.argv[0])\n", (4743, 4771), False, 'import re, sys\n'), ((5320, 5360), 're.sub', 're.sub', (['"""\\\\.[a-z0-9]+$"""', '""""""', 'sys.argv[2]'], {}), "('\\\\.[a-z0-9]+$', '', sys.argv[2])\n", (5326, 5360), False... |
import nltk
from collections import defaultdict
# requirements for nltk
nltk.download('punkt')
nltk.download('averaged_perceptron_tagger')
def tokenize_file(file_path):
file = open(file_path)
raw_text = file.read()
words = nltk.word_tokenize(raw_text)
return nltk.pos_tag(words)
def count_adverbs(wo... | [
"nltk.pos_tag",
"nltk.download",
"collections.defaultdict",
"nltk.word_tokenize"
] | [((73, 95), 'nltk.download', 'nltk.download', (['"""punkt"""'], {}), "('punkt')\n", (86, 95), False, 'import nltk\n'), ((96, 139), 'nltk.download', 'nltk.download', (['"""averaged_perceptron_tagger"""'], {}), "('averaged_perceptron_tagger')\n", (109, 139), False, 'import nltk\n'), ((238, 266), 'nltk.word_tokenize', 'nl... |
import json
import jinja2
import logging
class ObjectDefinition:
def __init__(self, name):
self._atomic_fields = {}
self._nonatomic_fields = {}
self._array_fields = {}
self._name = name
def addAtomicField(self, name, type, omit=False):
self._atomic_fields[name] = {
... | [
"jinja2.Environment",
"logging.error",
"json.load"
] | [((10846, 10858), 'json.load', 'json.load', (['f'], {}), '(f)\n', (10855, 10858), False, 'import json\n'), ((4838, 4886), 'logging.error', 'logging.error', (['("Item %s is not \'$ref\'" % recType)'], {}), '("Item %s is not \'$ref\'" % recType)\n', (4851, 4886), False, 'import logging\n'), ((10672, 10692), 'jinja2.Envir... |
'''
Created on 10.12.2014
@author: Iris
'''
from Component import Component
class Container(Component):
'''
Container for Components
'''
def __init__(self, children = []):
Component.__init__(self)
self.children = children
self.children = []
self.tags = {}
self... | [
"Component.Component.add",
"Component.Component.remove",
"Component.Component.__init__"
] | [((200, 224), 'Component.Component.__init__', 'Component.__init__', (['self'], {}), '(self)\n', (218, 224), False, 'from Component import Component\n'), ((377, 403), 'Component.Component.add', 'Component.add', (['self', 'child'], {}), '(self, child)\n', (390, 403), False, 'from Component import Component\n'), ((608, 63... |
# -*- coding: utf-8 -*-
from percy.connection import Connection
from percy.environment import Environment
from percy.config import Config
from percy import utils
__all__ = ['Client']
class Client(object):
def __init__(self, connection=None, config=None, environment=None):
self._environment = environmen... | [
"percy.connection.Connection",
"percy.environment.Environment",
"percy.config.Config",
"percy.utils.base64encode",
"percy.utils.sha256hash"
] | [((3896, 3921), 'percy.utils.sha256hash', 'utils.sha256hash', (['content'], {}), '(content)\n', (3912, 3921), False, 'from percy import utils\n'), ((342, 355), 'percy.environment.Environment', 'Environment', ([], {}), '()\n', (353, 355), False, 'from percy.environment import Environment\n'), ((401, 409), 'percy.config.... |
# Copyright 2019 Lorna Authors. All Rights Reserved.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | [
"torch.flatten",
"torch.nn.Dropout",
"torch.nn.ReLU",
"torch.nn.init.kaiming_normal_",
"torch.nn.Sequential",
"torch.nn.Conv2d",
"torch.nn.BatchNorm2d",
"torch.nn.init.constant_",
"torch.nn.init.normal_",
"torch.nn.Linear",
"torch.nn.MaxPool2d",
"torch.nn.AvgPool2d"
] | [((2424, 2446), 'torch.nn.Sequential', 'nn.Sequential', (['*layers'], {}), '(*layers)\n', (2437, 2446), True, 'import torch.nn as nn\n'), ((1002, 1039), 'torch.nn.MaxPool2d', 'nn.MaxPool2d', ([], {'kernel_size': '(2)', 'stride': '(2)'}), '(kernel_size=2, stride=2)\n', (1014, 1039), True, 'import torch.nn as nn\n'), ((1... |
# Copyright 2016 ZTE Corporation.
#
# 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 ... | [
"lcm.ns_sfcs.views.views.SfcInstanceView.as_view",
"lcm.ns_sfcs.views.views.PortChainView.as_view",
"rest_framework.urlpatterns.format_suffix_patterns",
"lcm.ns_sfcs.views.views.PortPairGpView.as_view",
"lcm.ns_sfcs.views.detail_views.SfcDetailView.as_view",
"lcm.ns_sfcs.views.views.FlowClaView.as_view",
... | [((1326, 1361), 'rest_framework.urlpatterns.format_suffix_patterns', 'format_suffix_patterns', (['urlpatterns'], {}), '(urlpatterns)\n', (1348, 1361), False, 'from rest_framework.urlpatterns import format_suffix_patterns\n'), ((894, 911), 'lcm.ns_sfcs.views.views.SfcView.as_view', 'SfcView.as_view', ([], {}), '()\n', (... |
from math import ceil
from moviepy.editor import VideoFileClip, concatenate_videoclips
from moviepy.video.fx.all import speedx
from moviepy.audio.fx.all import volumex
import numpy as np
class Clip:
def __init__(self, clip_path):
self.clip = VideoFileClip(clip_path)
self.audio = Audio(self.clip.a... | [
"numpy.absolute",
"moviepy.editor.VideoFileClip",
"moviepy.video.fx.all.speedx",
"numpy.max",
"numpy.min",
"moviepy.editor.concatenate_videoclips"
] | [((257, 281), 'moviepy.editor.VideoFileClip', 'VideoFileClip', (['clip_path'], {}), '(clip_path)\n', (270, 281), False, 'from moviepy.editor import VideoFileClip, concatenate_videoclips\n'), ((2491, 2515), 'numpy.absolute', 'np.absolute', (['self.signal'], {}), '(self.signal)\n', (2502, 2515), True, 'import numpy as np... |
from django.utils.translation import ugettext
from ....cart.signals import cart_quantity_change_check
def max_stock_level_to_cart(sender, instance=None,
variant=None, old_quantity=None, new_quantity=None, result=None, **kwargs):
try:
stock_level = variant.stock_level
except AttributeError:
... | [
"django.utils.translation.ugettext"
] | [((472, 513), 'django.utils.translation.ugettext', 'ugettext', (['"""There is no more %s in stock."""'], {}), "('There is no more %s in stock.')\n", (480, 513), False, 'from django.utils.translation import ugettext\n'), ((551, 620), 'django.utils.translation.ugettext', 'ugettext', (['"""You have ordered more %s than we... |
from abc import ABC
import scrapy
import json
from ..items import StockIndex
'''
StockHoldSpider arguments:
mode: 0/1, 0 means crawl all, 1 means crawl specific
fundcode: fund code
command example: scrapy crawl stockhold -a mode=1 -a fundcode=000001
'''
class StockHoldSpider(scrapy.Spider, ABC):
name = 'stock_i... | [
"json.loads",
"scrapy.Request"
] | [((925, 950), 'json.loads', 'json.loads', (['response.text'], {}), '(response.text)\n', (935, 950), False, 'import json\n'), ((493, 822), 'scrapy.Request', 'scrapy.Request', (['"""https://push2.eastmoney.com/api/qt/stock/get?secid=1.000300&ut=bd1d9ddb04089700cf9c27f6f7426281&fields=f118,f107,f57,f58,f59,f152,f43,f169,f... |
from elasticsearch import Elasticsearch
def get_elastic_client(hosts, user, password, verify_certs=True):
es = Elasticsearch(
hosts=hosts,
http_auth=(user, password),
verify_certs=verify_certs
)
return es
| [
"elasticsearch.Elasticsearch"
] | [((117, 203), 'elasticsearch.Elasticsearch', 'Elasticsearch', ([], {'hosts': 'hosts', 'http_auth': '(user, password)', 'verify_certs': 'verify_certs'}), '(hosts=hosts, http_auth=(user, password), verify_certs=\n verify_certs)\n', (130, 203), False, 'from elasticsearch import Elasticsearch\n')] |
#!/usr/bin/env python
import sys
import copy
import rospy
# Testing
import rostest
import unittest
# Utils
import numpy as np
import baldor as br
import criutils as cu
# HandEye Calibration service
from handeye.benchmark import generate_noisy_samples
from handeye.srv import CalibrateHandEye, CalibrateHandEyeRequest
NO... | [
"copy.deepcopy",
"baldor.transform.inverse",
"rostest.run",
"criutils.conversions.to_pose",
"rospy.ServiceProxy",
"baldor.transform.random",
"rospy.init_node",
"numpy.dot",
"handeye.srv.CalibrateHandEyeRequest"
] | [((481, 506), 'rospy.init_node', 'rospy.init_node', (['NODENAME'], {}), '(NODENAME)\n', (496, 506), False, 'import rospy\n'), ((522, 581), 'rospy.ServiceProxy', 'rospy.ServiceProxy', (['"""handeye_calibration"""', 'CalibrateHandEye'], {}), "('handeye_calibration', CalibrateHandEye)\n", (540, 581), False, 'import rospy\... |
# panel.py
# Copyright 2007 <NAME>
# Licence: See LICENCE (BSD licence)
"""Provide base classes for pages in notebook style user interfaces.
The classes are written to work with the classes provided in the frame
module.
The *Grid* classes assume the solentware_grid.datagrid classes are available,
and behaviour is un... | [
"tkinter.Entry",
"tkinter.Label",
"tkinter.Frame"
] | [((7093, 7125), 'tkinter.Frame', 'tkinter.Frame', ([], {'master': 'self.panel'}), '(master=self.panel)\n', (7106, 7125), False, 'import tkinter\n'), ((21914, 21949), 'tkinter.Frame', 'tkinter.Frame', ([], {'master': 'self.gridpane'}), '(master=self.gridpane)\n', (21927, 21949), False, 'import tkinter\n'), ((21970, 2199... |
import pytest
from histolab.masks import BiggestTissueBoxMask, TissueMask
from histolab.slide import Slide
from histolab.util import random_choice_true_mask2d
from ..fixtures import SVS, TIFF
@pytest.mark.parametrize(
"fixture_slide, binary_mask",
[
(TIFF.KIDNEY_48_5, BiggestTissueBoxMask()),
... | [
"histolab.masks.BiggestTissueBoxMask",
"histolab.slide.Slide",
"histolab.util.random_choice_true_mask2d",
"histolab.masks.TissueMask"
] | [((580, 604), 'histolab.slide.Slide', 'Slide', (['fixture_slide', '""""""'], {}), "(fixture_slide, '')\n", (585, 604), False, 'from histolab.slide import Slide\n'), ((647, 678), 'histolab.util.random_choice_true_mask2d', 'random_choice_true_mask2d', (['bbox'], {}), '(bbox)\n', (672, 678), False, 'from histolab.util imp... |
from gpiozero import DigitalInputDevice
from pisces.control import ClosedLoopBase
from pisces.sensors import WaterLevelSensor
class WaterControl(ClosedLoopBase):
def __init__(self, pisces_core, **kwargs):
kwargs.update({'name': 'water_control',
'output_name': 'pump'})
super(... | [
"pisces.sensors.WaterLevelSensor"
] | [((378, 404), 'pisces.sensors.WaterLevelSensor', 'WaterLevelSensor', ([], {}), '(**kwargs)\n', (394, 404), False, 'from pisces.sensors import WaterLevelSensor\n')] |
import json
import typing
from collections import namedtuple
from urllib.parse import urlparse
from lightsocks.core.password import (InvalidPasswordError, dumpsPassword,
loadsPassword)
Config = namedtuple('Config',
'serverAddr serverPort localAddr localPort pa... | [
"json.load",
"json.loads",
"lightsocks.core.password.loadsPassword",
"lightsocks.core.password.dumpsPassword",
"collections.namedtuple",
"urllib.parse.urlparse"
] | [((234, 308), 'collections.namedtuple', 'namedtuple', (['"""Config"""', '"""serverAddr serverPort localAddr localPort password"""'], {}), "('Config', 'serverAddr serverPort localAddr localPort password')\n", (244, 308), False, 'from collections import namedtuple\n'), ((489, 502), 'urllib.parse.urlparse', 'urlparse', ([... |
from io import TextIOBase
import os.path
import operator
from itertools import combinations, permutations
from functools import reduce, partial
from math import isfinite, prod
from collections import Counter
import re
INPUT=os.path.join(os.path.dirname(__file__), "input.txt")
with open(INPUT) as f:
data = f.read()... | [
"re.search"
] | [((905, 933), 're.search', 're.search', (['line_parser', 'line'], {}), '(line_parser, line)\n', (914, 933), False, 'import re\n')] |
import asyncio
import json
import sys
import traceback
from bspider.core import BaseManager
from bspider.http import Response, ERROR_RESPONSE
from bspider.config.default_settings import EXCHANGE_NAME
from .parser_monitor import ParserMonitor
def run_parser(unique_sign, coro_num=3):
dm = ParserManager(unique_sig... | [
"asyncio.sleep",
"traceback.format_exception",
"json.loads",
"sys.exc_info"
] | [((2531, 2545), 'sys.exc_info', 'sys.exc_info', ([], {}), '()\n', (2543, 2545), False, 'import sys\n'), ((2574, 2613), 'traceback.format_exception', 'traceback.format_exception', (['tp', 'msg', 'tb'], {}), '(tp, msg, tb)\n', (2600, 2613), False, 'import traceback\n'), ((700, 716), 'asyncio.sleep', 'asyncio.sleep', (['(... |
from torch.utils.data import DataLoader
from torchvision import transforms
from PIL import Image
import importlib
import torch
from torch.utils.data.sampler import WeightedRandomSampler, Sampler
import numpy as np
import random
from munch import Munch
# =================================================================... | [
"munch.Munch",
"numpy.isin",
"numpy.sum",
"random.randint",
"numpy.argmax",
"torchvision.transforms.Normalize",
"torchvision.transforms.Compose",
"numpy.where",
"numpy.array",
"torch.cuda.is_available",
"numpy.random.choice",
"numpy.bincount",
"torchvision.transforms.Resize",
"numpy.concat... | [((3202, 3222), 'numpy.bincount', 'np.bincount', (['_labels'], {}), '(_labels)\n', (3213, 3222), True, 'import numpy as np\n'), ((3601, 3627), 'torchvision.transforms.Compose', 'transforms.Compose', (['common'], {}), '(common)\n', (3619, 3627), False, 'from torchvision import transforms\n'), ((4020, 4108), 'munch.Munch... |
import numpy as np
import skimage.filters as skf
import skimage.color as skc
import skimage.morphology as skm
from skimage.measure import label
from .task import Task
class Back(Task):
"""
Two algorithms are used together to separate background and foreground.
One consider as background all pixel whose c... | [
"skimage.filters.scharr",
"numpy.zeros_like",
"numpy.count_nonzero",
"skimage.morphology.opening",
"numpy.square",
"numpy.zeros",
"skimage.morphology.skeletonize",
"skimage.measure.label",
"skimage.color.rgb2grey",
"skimage.color.rgb2lab"
] | [((1331, 1350), 'numpy.count_nonzero', 'np.count_nonzero', (['g'], {}), '(g)\n', (1347, 1350), True, 'import numpy as np\n'), ((1364, 1383), 'numpy.count_nonzero', 'np.count_nonzero', (['f'], {}), '(f)\n', (1380, 1383), True, 'import numpy as np\n'), ((1600, 1616), 'numpy.zeros_like', 'np.zeros_like', (['m'], {}), '(m)... |
import os
from tulips import Tulips
class Viewer:
def __init__(self, name, password):
self.tulips = Tulips(name, password)
self.tulips.login()
def borrow(self):
info = self.tulips.borrow()
if len(info) == 0:
print("現在借りている本はありません。")
return
for i ... | [
"tulips.Tulips"
] | [((113, 135), 'tulips.Tulips', 'Tulips', (['name', 'password'], {}), '(name, password)\n', (119, 135), False, 'from tulips import Tulips\n')] |
import unittest
from mock import MagicMock, patch, sentinel
from geopy.exc import GeocoderQuotaExceeded, GeocoderServiceError
from geopy.extra.rate_limiter import RateLimiter
try:
from contextlib import ExitStack
except ImportError:
# python 2
from contextlib2 import ExitStack
class RateLimiterTestCase... | [
"contextlib2.ExitStack",
"mock.patch.object",
"mock.MagicMock",
"geopy.extra.rate_limiter.RateLimiter"
] | [((385, 396), 'contextlib2.ExitStack', 'ExitStack', ([], {}), '()\n', (394, 396), False, 'from contextlib2 import ExitStack\n'), ((626, 637), 'mock.MagicMock', 'MagicMock', ([], {}), '()\n', (635, 637), False, 'from mock import MagicMock, patch, sentinel\n'), ((802, 858), 'geopy.extra.rate_limiter.RateLimiter', 'RateLi... |
import json
from schema import Schema, SchemaError
post_booking_schema = Schema(
{
"bookingid": int,
"booking": {
"firstname": str,
"lastname": str,
"totalprice": int,
"depositpaid": bool,
"bookingdates": {
"checkin": str,... | [
"json.dumps",
"schema.Schema"
] | [((75, 272), 'schema.Schema', 'Schema', (["{'bookingid': int, 'booking': {'firstname': str, 'lastname': str,\n 'totalprice': int, 'depositpaid': bool, 'bookingdates': {'checkin': str,\n 'checkout': str}, 'additionalneeds': str}}"], {}), "({'bookingid': int, 'booking': {'firstname': str, 'lastname': str,\n 'tot... |
import asyncio
import ipaddress
import socket
import sys
from typing import AsyncGenerator, Callable, Optional, cast
from ..quic.configuration import QuicConfiguration
from ..quic.connection import QuicConnection
from ..tls import SessionTicketHandler
from .compat import asynccontextmanager
from .protocol import QuicC... | [
"typing.cast",
"asyncio.get_event_loop",
"ipaddress.ip_address"
] | [((1971, 1995), 'asyncio.get_event_loop', 'asyncio.get_event_loop', ([], {}), '()\n', (1993, 1995), False, 'import asyncio\n'), ((3207, 3245), 'typing.cast', 'cast', (['QuicConnectionProtocol', 'protocol'], {}), '(QuicConnectionProtocol, protocol)\n', (3211, 3245), False, 'from typing import AsyncGenerator, Callable, O... |
"""
Unit tests for the cell tracking to make sure that the results remain
consistent despite code changes.
Todo: Implement testing for LIF files directly?
"""
import unittest
import keras
from cell_track.tools.track_image import track_tiff_folder
from cell_track.tools import get_session, safe_load_model
import tempfil... | [
"unittest.main",
"xml.etree.ElementTree.parse",
"tempfile.TemporaryDirectory",
"cell_track.tools.get_session",
"os.path.dirname",
"cell_track.tools.initialize.init",
"cell_track.tools.trackmate.Track",
"cell_track.tools.safe_load_model",
"os.path.join",
"cell_track.tools.track_image.track_tiff_fol... | [((1986, 2001), 'unittest.main', 'unittest.main', ([], {}), '()\n', (1999, 2001), False, 'import unittest\n'), ((559, 572), 'cell_track.tools.get_session', 'get_session', ([], {}), '()\n', (570, 572), False, 'from cell_track.tools import get_session, safe_load_model\n'), ((729, 735), 'cell_track.tools.initialize.init',... |
# Copyright (c) 2019-2020 <NAME>
# SPDX-License-Identifier: BSD-3-Clause
from .BaseBlock import *
from . import Utility
import Pothos
import numpy
import os
class FileSourceBaseBlock(BaseBlock):
def __init__(self, blockPath, filepath, extension, repeat):
if not os.path.exists(filepath):
rai... | [
"numpy.load",
"os.path.exists",
"os.path.splitext"
] | [((3666, 3691), 'numpy.load', 'numpy.load', (['filepath', '"""r"""'], {}), "(filepath, 'r')\n", (3676, 3691), False, 'import numpy\n'), ((4573, 4598), 'numpy.load', 'numpy.load', (['filepath', '"""r"""'], {}), "(filepath, 'r')\n", (4583, 4598), False, 'import numpy\n'), ((279, 303), 'os.path.exists', 'os.path.exists', ... |
"""
see degrees as example
extract info from classutil for 2020 ranking of classes
"""
from bs4 import BeautifulSoup
import requests
import re
# https://stackoverflow.com/questions/18297791/consecutive-uppercase-letters-regex
def regexp_find(s):
res = re.findall("(?<![A-Z])[A-Z]{4}(?![A-Z])", s)
return r... | [
"bs4.BeautifulSoup",
"re.findall",
"requests.get"
] | [((423, 451), 'requests.get', 'requests.get', (['url'], {'timeout': '(5)'}), '(url, timeout=5)\n', (435, 451), False, 'import requests\n'), ((462, 508), 'bs4.BeautifulSoup', 'BeautifulSoup', (['response.content', '"""html.parser"""'], {}), "(response.content, 'html.parser')\n", (475, 508), False, 'from bs4 import Beaut... |
#!/usr/bin/env python3
""" Copyright © 2020 <NAME>
Functions for cell detecting and ROI extraction.
Functions for embrane detection and membrane regions extraction with hysteresis filter.
Optimysed for widefield neuron image.
"""
import os
import logging
import numpy as np
import numpy.ma as ma
from skimage.exter... | [
"numpy.copy",
"numpy.ma.masked_where",
"numpy.std",
"numpy.clip",
"logging.info",
"numpy.max",
"numpy.mean",
"scipy.ndimage.label",
"numpy.arange",
"skimage.filters.gaussian"
] | [((1696, 1730), 'skimage.filters.gaussian', 'filters.gaussian', (['img'], {'sigma': 'sigma'}), '(img, sigma=sigma)\n', (1712, 1730), False, 'from skimage import filters\n'), ((3069, 3108), 'logging.info', 'logging.info', (['f"""Derivate sigma={sigma}"""'], {}), "(f'Derivate sigma={sigma}')\n", (3081, 3108), False, 'imp... |
from dataclasses import dataclass
from multiprocessing import connection
import re
import os
import sqlite3
import zlib
from typing import List, Mapping, Tuple, Iterable, Type
import numpy as np
from pyteomics import proforma
from mzlib import annotation
from mzlib.analyte import FIRST_ANALYTE_KEY, FIRST_INTERPRETA... | [
"numpy.frombuffer",
"mzlib.attributes.AttributeManager",
"pyteomics.proforma.ProForma.parse",
"sqlite3.connect",
"zlib.decompress",
"pyteomics.proforma.MassModification"
] | [((1036, 1081), 'pyteomics.proforma.ProForma.parse', 'proforma.ProForma.parse', (["row['peptideModSeq']"], {}), "(row['peptideModSeq'])\n", (1059, 1081), False, 'from pyteomics import proforma\n'), ((3078, 3103), 'sqlite3.connect', 'sqlite3.connect', (['filename'], {}), '(filename)\n', (3093, 3103), False, 'import sqli... |
# -*- coding: utf-8 -*-
# Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Main builder code for Chromium OS.
Used by Chromium OS buildbot configuration for all Chromium OS builds including
full an... | [
"chromite.cbuildbot.topology.FetchTopology",
"os.remove",
"chromite.lib.gob_util.GetTipOfTrunkRevision",
"chromite.lib.cidb.CIDBConnectionFactory.SetupNoCidb",
"chromite.lib.cros_build_lib.CmdToStr",
"chromite.lib.parallel.Manager",
"chromite.lib.osutils.GetGlobalTempDir",
"pickle.load",
"chromite.l... | [((2032, 2056), 'os.path.exists', 'os.path.exists', (['log_file'], {}), '(log_file)\n', (2046, 2056), False, 'import os\n'), ((27300, 27399), 'chromite.lib.commandline.FilteringParser.FilterArgs', 'commandline.FilteringParser.FilterArgs', (['options.parsed_args', '(lambda x: x.opt_inst.pass_through)'], {}), '(options.p... |
#!/usr/bin/env python3
EVOMASTER_VERSION = "1.0.1"
import os
import shutil
import platform
from shutil import copy
from shutil import copytree
from subprocess import run
from os.path import expanduser
HOME = expanduser("~")
SCRIPT_LOCATION = os.path.dirname(os.path.realpath(__file__))
PROJ_LOCATION = os.path.abspat... | [
"subprocess.run",
"os.mkdir",
"os.remove",
"os.path.join",
"shutil.make_archive",
"shutil.copytree",
"os.environ.copy",
"os.path.realpath",
"os.path.exists",
"os.environ.get",
"platform.system",
"shutil.rmtree",
"os.path.expanduser",
"shutil.copy"
] | [((212, 227), 'os.path.expanduser', 'expanduser', (['"""~"""'], {}), "('~')\n", (222, 227), False, 'from os.path import expanduser\n'), ((380, 413), 'os.environ.get', 'os.environ.get', (['"""JAVA_HOME_8"""', '""""""'], {}), "('JAVA_HOME_8', '')\n", (394, 413), False, 'import os\n'), ((534, 568), 'os.environ.get', 'os.e... |
#!/usr/bin/env python
import rospy
from my_pkg._subscriber import _sub
if __name__ =="__main__":
sub=_sub()
sub._subscriber()
| [
"my_pkg._subscriber._sub"
] | [((104, 110), 'my_pkg._subscriber._sub', '_sub', ([], {}), '()\n', (108, 110), False, 'from my_pkg._subscriber import _sub\n')] |
from datetime import datetime, timezone
from random import randint
from factory import (
BUILD_STRATEGY,
Faker,
LazyAttribute,
make_factory,
post_generation,
SelfAttribute,
Sequence,
SubFactory,
)
from factory.alchemy import SQLAlchemyModelFactory
from factory.fuzzy import FuzzyDateTime,... | [
"factory.fuzzy.FuzzyInteger",
"factory.Faker",
"random.randint",
"factory.SubFactory",
"datetime.datetime",
"factory.Sequence",
"factory.SelfAttribute",
"lemonade_soapbox.models.Revision",
"factory.LazyAttribute"
] | [((658, 688), 'factory.Sequence', 'Sequence', (["(lambda n: f'tag {n}')"], {}), "(lambda n: f'tag {n}')\n", (666, 688), False, 'from factory import BUILD_STRATEGY, Faker, LazyAttribute, make_factory, post_generation, SelfAttribute, Sequence, SubFactory\n'), ((777, 807), 'factory.Faker', 'Faker', (['"""text"""'], {'max_... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from kivymd.uix.menu import MDDropdownMenu
from kivy.metrics import dp
from controllers.excpetions.RootException import InterfaceException
from routes.routes import Routes
class DropDownMenu(MDDropdownMenu):
'''
description: dropdow generic for widgets
args: a... | [
"controllers.excpetions.RootException.InterfaceException",
"kivy.metrics.dp"
] | [((766, 772), 'kivy.metrics.dp', 'dp', (['(46)'], {}), '(46)\n', (768, 772), False, 'from kivy.metrics import dp\n'), ((1128, 1149), 'controllers.excpetions.RootException.InterfaceException', 'InterfaceException', (['e'], {}), '(e)\n', (1146, 1149), False, 'from controllers.excpetions.RootException import InterfaceExce... |
from app import db
#table schema for airplain infomations
class AirInfo(db.Model):
flightNumber = db.Column(db.Integer,primary_key=True)
airline = db.Column(db.String(80),unique=False)
departureCity = db.Column(db.String(120),unique=False)
departureTime = db.Column(db.String(120),unique=False)
arriv... | [
"app.db.String",
"app.db.Column"
] | [((102, 141), 'app.db.Column', 'db.Column', (['db.Integer'], {'primary_key': '(True)'}), '(db.Integer, primary_key=True)\n', (111, 141), False, 'from app import db\n'), ((165, 178), 'app.db.String', 'db.String', (['(80)'], {}), '(80)\n', (174, 178), False, 'from app import db\n'), ((223, 237), 'app.db.String', 'db.Stri... |
from __future__ import print_function
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import astropy.io
import scipy.interpolate
import os
import crosscorr
from . import stats_help
from . import utils
from . import spec_help
from . import rotbroad_help
from . import target
DIRNAME = os.path.dirna... | [
"crosscorr.mask.Mask",
"numpy.nanmedian",
"numpy.median",
"numpy.nanmax",
"os.path.dirname",
"numpy.genfromtxt",
"numpy.isfinite",
"matplotlib.pyplot.subplots",
"numpy.nanmin",
"crosscorr.calculate_ccf_for_hpf_orders",
"numpy.array",
"numpy.linspace",
"os.path.join",
"numpy.polynomial.cheb... | [((307, 332), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (322, 332), False, 'import os\n'), ((354, 430), 'os.path.join', 'os.path.join', (['DIRNAME', '"""data/hpf/flats/alphabright_fcu_sept18_deblazed.fits"""'], {}), "(DIRNAME, 'data/hpf/flats/alphabright_fcu_sept18_deblazed.fits')\n", (3... |
import argparse
import json
from argparse import RawTextHelpFormatter
parser = argparse.ArgumentParser(description=' a Python client for Baidu Pan.', formatter_class=RawTextHelpFormatter)
parser.add_argument('action', choices=['list', 'download', 'upload', 'sync', 'logout'], metavar='action',
defau... | [
"json.load",
"argparse.ArgumentParser"
] | [((80, 192), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '""" a Python client for Baidu Pan."""', 'formatter_class': 'RawTextHelpFormatter'}), "(description=' a Python client for Baidu Pan.',\n formatter_class=RawTextHelpFormatter)\n", (103, 192), False, 'import argparse\n'), ((2636, 2... |
from __future__ import unicode_literals
import pytest
from eth_utils.hexidecimal import (
add_0x_prefix,
remove_0x_prefix,
)
@pytest.mark.parametrize(
'value,expected',
(
('', '0x'),
(b'', b'0x'),
(b'0x', b'0x'),
('0x', '0x'),
('0x12345', '0x12345'),
(... | [
"pytest.mark.parametrize",
"eth_utils.hexidecimal.add_0x_prefix",
"eth_utils.hexidecimal.remove_0x_prefix"
] | [((138, 287), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""value,expected"""', "(('', '0x'), (b'', b'0x'), (b'0x', b'0x'), ('0x', '0x'), ('0x12345',\n '0x12345'), ('12345', '0x12345'))"], {}), "('value,expected', (('', '0x'), (b'', b'0x'), (b'0x',\n b'0x'), ('0x', '0x'), ('0x12345', '0x12345'), ('1... |
from __future__ import absolute_import, division, print_function
import csv
import datetime
import functools
import time
import requests
from panoptes_client.panoptes import (
PanoptesAPIException,
Talk,
)
TALK_EXPORT_TYPES = (
'talk_comments',
'talk_tags',
)
talk = Talk()
class Exportable(objec... | [
"time.sleep",
"panoptes_client.panoptes.Talk",
"datetime.timedelta",
"requests.get",
"datetime.datetime.now"
] | [((289, 295), 'panoptes_client.panoptes.Talk', 'Talk', ([], {}), '()\n', (293, 295), False, 'from panoptes_client.panoptes import PanoptesAPIException, Talk\n'), ((2557, 2593), 'requests.get', 'requests.get', (['media_url'], {'stream': '(True)'}), '(media_url, stream=True)\n', (2569, 2593), False, 'import requests\n'),... |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | [
"azure.core.async_paging.AsyncList",
"azure.core.exceptions.HttpResponseError",
"azure.core.exceptions.map_error",
"typing.TypeVar",
"azure.core.async_paging.AsyncItemPaged"
] | [((980, 992), 'typing.TypeVar', 'TypeVar', (['"""T"""'], {}), "('T')\n", (987, 992), False, 'from typing import Any, AsyncIterable, Callable, Dict, Generic, List, Optional, TypeVar, Union\n'), ((6805, 6843), 'azure.core.async_paging.AsyncItemPaged', 'AsyncItemPaged', (['get_next', 'extract_data'], {}), '(get_next, extr... |
#!/usr/bin/env python
# Copyright (c) 2015-2019 by Farsight Security, 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 require... | [
"unittest.TextTestRunner",
"os.unlink",
"subprocess.check_output",
"distutils.command.clean.clean.run",
"os.path.isfile",
"unittest.TestLoader"
] | [((1800, 1864), 'subprocess.check_output', 'subprocess.check_output', (['pkg_config_cmd'], {'universal_newlines': '(True)'}), '(pkg_config_cmd, universal_newlines=True)\n', (1823, 1864), False, 'import subprocess\n'), ((1331, 1346), 'distutils.command.clean.clean.run', 'clean.run', (['self'], {}), '(self)\n', (1340, 13... |
import tensorflow as tf
import scipy.misc
import argparse
import os
import numpy as np
from glob import glob
from model_inpaint_test import ModelInpaintTest as ModelInpaint
parser = argparse.ArgumentParser()
parser.add_argument('--model_file', type=str, help="Pretrained GAN model")
parser.add_argument('--lr', type=fl... | [
"os.mkdir",
"argparse.ArgumentParser",
"os.path.exists",
"numpy.ones",
"numpy.random.random",
"glob.glob",
"os.path.join",
"model_inpaint_test.ModelInpaintTest"
] | [((184, 209), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (207, 209), False, 'import argparse\n'), ((3055, 3075), 'numpy.ones', 'np.ones', (['image_shape'], {}), '(image_shape)\n', (3062, 3075), True, 'import numpy as np\n'), ((3169, 3204), 'model_inpaint_test.ModelInpaintTest', 'ModelInpain... |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Thu Jan 18 07:55:46 2018
Description: Support methods for initializing and updating the covariance matrix.
Additional routines associated with Cholesky Decomposition.
@author: prmiles
"""
# import required packages
import numpy as np
import math
class C... | [
"numpy.abs",
"numpy.copy",
"numpy.diagflat",
"math.sqrt",
"numpy.ix_",
"numpy.isinf",
"numpy.isnan",
"numpy.eye",
"numpy.sqrt",
"numpy.linalg.cholesky",
"numpy.atleast_2d"
] | [((5116, 5138), 'numpy.atleast_2d', 'np.atleast_2d', (['qcov[:]'], {}), '(qcov[:])\n', (5129, 5138), True, 'import numpy as np\n'), ((5872, 5891), 'numpy.copy', 'np.copy', (['self._qcov'], {}), '(self._qcov)\n', (5879, 5891), True, 'import numpy as np\n'), ((5907, 5924), 'numpy.diagflat', 'np.diagflat', (['qcov'], {}),... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.