code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
import pickle
import re
from pathlib import Path
import pytest
from more_termcolor import colored, bold, dark, ita, brightgreen, ul
from more_termcolor.tests.common import print_and_compare, codes_perm
@print_and_compare
class TestMerge:
def test__merge_open_codes_if_no_text__different_reset(self):
expe... | [
"more_termcolor.bold",
"more_termcolor.tests.common.codes_perm",
"re.compile",
"more_termcolor.brightgreen",
"pathlib.Path",
"pickle.load",
"more_termcolor.ul",
"more_termcolor.dark",
"more_termcolor.colored"
] | [((364, 386), 'more_termcolor.colored', 'colored', (['"""Red """', '"""red"""'], {}), "('Red ', 'red')\n", (371, 386), False, 'from more_termcolor import colored, bold, dark, ita, brightgreen, ul\n'), ((740, 761), 'more_termcolor.colored', 'colored', (['"""Red"""', '"""red"""'], {}), "('Red', 'red')\n", (747, 761), Fal... |
import sublime
import sublime_lib.flags as flags
from sublime_lib.vendor.python.enum import IntFlag
from functools import reduce
from unittest import TestCase
class TestFlags(TestCase):
def _test_enum(self, enum, prefix=''):
for item in enum:
self.assertEqual(item, getattr(sublime, prefix +... | [
"functools.reduce",
"sublime_lib.flags.RegionOption"
] | [((1219, 1270), 'sublime_lib.flags.RegionOption', 'flags.RegionOption', (['"""DRAW_EMPTY"""', '"""HIDE_ON_MINIMAP"""'], {}), "('DRAW_EMPTY', 'HIDE_ON_MINIMAP')\n", (1237, 1270), True, 'import sublime_lib.flags as flags\n'), ((1439, 1459), 'sublime_lib.flags.RegionOption', 'flags.RegionOption', ([], {}), '()\n', (1457, ... |
# In[]
import cv2
import numpy as np
import os
from operator import eq
import random
import matplotlib.pyplot as plt
BasePath = "D:/[Data]/[Cardiomegaly]/1_ChestPA_Labeled_Baeksongyi/[PNG]_2_Generated_Data(2k)/Generated_Data_20180410_191400_Seg_Base_Expand_20pixel_Cropped_Detected"
ImgPath = BasePath + '/Imgs/te... | [
"matplotlib.pyplot.imshow",
"cv2.rectangle",
"os.listdir",
"numpy.bitwise_or",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.Axes",
"numpy.asarray",
"os.path.isfile",
"matplotlib.pyplot.figure",
"numpy.zeros",
"cv2.imread",
"matplotlib.pyplot.show"
] | [((554, 573), 'os.listdir', 'os.listdir', (['ImgPath'], {}), '(ImgPath)\n', (564, 573), False, 'import os\n'), ((587, 619), 'cv2.imread', 'cv2.imread', (["(ImgPath + '/' + file)"], {}), "(ImgPath + '/' + file)\n", (597, 619), False, 'import cv2\n'), ((630, 660), 'numpy.asarray', 'np.asarray', (['img'], {'dtype': '"""ui... |
import time
import compas
import compas_rhino
from compas.datastructures import Mesh
from compas.geometry import Point
from compas_ui.app import App
compas_rhino.clear()
app = App(name='UITest')
app.scene.clear()
mesh = Mesh.from_obj(compas.get('tubemesh.obj'))
mesh.name = 'TubeMesh'
obj = app.scene.add(mesh)
app.... | [
"compas.get",
"compas.geometry.Point",
"time.sleep",
"compas_ui.app.App",
"compas_rhino.clear"
] | [((151, 171), 'compas_rhino.clear', 'compas_rhino.clear', ([], {}), '()\n', (169, 171), False, 'import compas_rhino\n'), ((179, 197), 'compas_ui.app.App', 'App', ([], {'name': '"""UITest"""'}), "(name='UITest')\n", (182, 197), False, 'from compas_ui.app import App\n'), ((349, 362), 'time.sleep', 'time.sleep', (['(1)'],... |
#
# Copyright (c) 2018 cTuning foundation.
# See CK COPYRIGHT.txt for copyright details.
#
# See CK LICENSE for licensing details.
# See CK COPYRIGHT for copyright details.
#
import os
from shutil import copy2
def set_up_intel_cpu_for_server_or_singlestream_scenario(i):
env = i['env']
scenario = ... | [
"os.path.abspath",
"os.system",
"os.path.join",
"shutil.copy2"
] | [((2527, 2558), 'os.path.abspath', 'os.path.abspath', (['os.path.curdir'], {}), '(os.path.curdir)\n', (2542, 2558), False, 'import os\n'), ((4730, 4792), 'os.path.join', 'os.path.join', (['inferencepath', '"""speech_recognition/rnnt/pytorch"""'], {}), "(inferencepath, 'speech_recognition/rnnt/pytorch')\n", (4742, 4792)... |
from __future__ import unicode_literals
import frappe
base_template_path = "templates/www/robots.txt"
def get_context(context):
robots_txt = (
frappe.db.get_single_value('Website Settings', 'robots_txt') or
(frappe.local.conf.robots_txt and frappe.read_file(frappe.local.conf.robots_txt)) or '')
return { 'robot... | [
"frappe.db.get_single_value",
"frappe.read_file"
] | [((148, 208), 'frappe.db.get_single_value', 'frappe.db.get_single_value', (['"""Website Settings"""', '"""robots_txt"""'], {}), "('Website Settings', 'robots_txt')\n", (174, 208), False, 'import frappe\n'), ((248, 294), 'frappe.read_file', 'frappe.read_file', (['frappe.local.conf.robots_txt'], {}), '(frappe.local.conf.... |
# (C) 2022 GoodData Corporation
from __future__ import annotations
import time
import urllib3.exceptions as urllib3_ex
import gooddata_metadata_client.apis as metadata_apis
import gooddata_metadata_client.exceptions as metadata_ex
from gooddata_sdk.client import GoodDataApiClient
class SupportService:
def __in... | [
"time.time",
"gooddata_metadata_client.apis.EntitiesApi",
"time.sleep"
] | [((400, 453), 'gooddata_metadata_client.apis.EntitiesApi', 'metadata_apis.EntitiesApi', (['api_client.metadata_client'], {}), '(api_client.metadata_client)\n', (425, 453), True, 'import gooddata_metadata_client.apis as metadata_apis\n'), ((1875, 1886), 'time.time', 'time.time', ([], {}), '()\n', (1884, 1886), False, 'i... |
from django.conf.urls import patterns, url, include
from rest_framework.urlpatterns import format_suffix_patterns
from .views import PlaylistList, PlaylistDetail
from .views import SongList, SongDetail
from .views import CreatePlaylistFromYoutube
from .views import UserList, UserCreate, UserDetail, CurrentUser
user_ur... | [
"django.conf.urls.include",
"django.conf.urls.url",
"rest_framework.urlpatterns.format_suffix_patterns"
] | [((1274, 1309), 'rest_framework.urlpatterns.format_suffix_patterns', 'format_suffix_patterns', (['urlpatterns'], {}), '(urlpatterns)\n', (1296, 1309), False, 'from rest_framework.urlpatterns import format_suffix_patterns\n'), ((467, 515), 'django.conf.urls.url', 'url', (['"""^/me/$"""', 'CurrentUser'], {'name': '"""use... |
#!/usr/bin/env python
import chainer
from teras import training
from teras.app import App, arg
from teras.utils import git, logging
from tqdm import tqdm
import dataset
import eval as eval_module
import models
import parsers
import utils
chainer.Variable.__int__ = lambda self: int(self.data)
chainer.Variable.__floa... | [
"parsers.CkyParser",
"models.gold.GoldModel",
"teras.utils.logging.AppLogger.configure",
"utils.Saver.load_context",
"models.CoordSolverBuilder",
"teras.utils.logging.captureWarnings",
"teras.app.App.run",
"teras.training.report",
"utils.set_random_seed",
"chainer.cuda.to_cpu",
"teras.app.arg",
... | [((356, 385), 'teras.utils.logging.captureWarnings', 'logging.captureWarnings', (['(True)'], {}), '(True)\n', (379, 385), False, 'from teras.utils import git, logging\n'), ((909, 928), 'teras.utils.logging.getLogger', 'logging.getLogger', ([], {}), '()\n', (926, 928), False, 'from teras.utils import git, logging\n'), (... |
from .UtilsModule import *
from .FieldsModule import *
import json
class PhysicalProperties(object):
def __init__(self, grid, folderName):
self.folderName = folderName
self.getFluidProps()
self.getSolidProps(grid)
def getFluidProps(self):
fluid = getJsonData(self.folderName + "fluid.json")
self.rho_f = fl... | [
"json.load"
] | [((2054, 2073), 'json.load', 'json.load', (['jsonFile'], {}), '(jsonFile)\n', (2063, 2073), False, 'import json\n')] |
# Copyright 2020 Novo Nordisk Foundation Center for Biosustainability,
# Technical University of Denmark.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licens... | [
"logging.getLogger",
"json.loads",
"urllib.parse.urlsplit",
"urllib.parse.urlunsplit",
"urllib.parse.urljoin",
"urllib.parse.urlencode"
] | [((970, 997), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (987, 997), False, 'import logging\n'), ((3768, 3786), 'urllib.parse.urlsplit', 'urlsplit', (['base_url'], {}), '(base_url)\n', (3776, 3786), False, 'from urllib.parse import urlencode, urljoin, urlsplit, urlunsplit\n'), ((2807,... |
# Copyright 2018, <NAME> LLC
# License: Apache License Version 2.0 + Commons Clause
# --------------------------------------------------------------------------
# __init__.py - common code for all view subclasses and a few top level
# view routes, which we want to minimize
# --------------------------------------... | [
"vespene.manager.permissions.PermissionsManager",
"django.http.HttpResponse",
"vespene.manager.webhooks.Webhooks",
"vespene.views.view_helpers.generic_new",
"vespene.views.view_helpers.generic_detail",
"urllib.parse.parse_qs",
"traceback.print_exc",
"django.shortcuts.redirect",
"vespene.views.view_h... | [((896, 904), 'vespene.common.logger.Logger', 'Logger', ([], {}), '()\n', (902, 904), False, 'from vespene.common.logger import Logger\n'), ((919, 939), 'vespene.manager.permissions.PermissionsManager', 'PermissionsManager', ([], {}), '()\n', (937, 939), False, 'from vespene.manager.permissions import PermissionsManage... |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** 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
from ... import _utilities, _tables
from... | [
"pulumi.get",
"pulumi.getter",
"pulumi.set",
"pulumi.InvokeOptions",
"pulumi.runtime.invoke"
] | [((4052, 4082), 'pulumi.getter', 'pulumi.getter', ([], {'name': '"""ipPrefix"""'}), "(name='ipPrefix')\n", (4065, 4082), False, 'import pulumi\n'), ((4244, 4272), 'pulumi.getter', 'pulumi.getter', ([], {'name': '"""ipTags"""'}), "(name='ipTags')\n", (4257, 4272), False, 'import pulumi\n'), ((4493, 4550), 'pulumi.getter... |
import pretty_midi as pyd
import music21 as m21
import os
track_statistics={}
midi = 'results/presentation sample/Nottingham - 3.mid'
midi_data = pyd.PrettyMIDI(midi)
print(midi_data.instruments[1].notes) | [
"pretty_midi.PrettyMIDI"
] | [((149, 169), 'pretty_midi.PrettyMIDI', 'pyd.PrettyMIDI', (['midi'], {}), '(midi)\n', (163, 169), True, 'import pretty_midi as pyd\n')] |
import tensorflow as tf
import numpy as np
import time
def constfn(val):
def f(frac):
return val * frac
return f
class Model(object):
def __init__(self, env, world, policies, ncommtime=20, nminibatches=4, noptepochs=4):
self.env = env
self.world = world
self.policies = poli... | [
"numpy.mean",
"numpy.hstack",
"numpy.where",
"numpy.array",
"tensorflow.constant",
"numpy.nonzero",
"numpy.std",
"numpy.arange",
"numpy.random.shuffle"
] | [((1313, 1339), 'numpy.hstack', 'np.hstack', (['actions_n[:n_a]'], {}), '(actions_n[:n_a])\n', (1322, 1339), True, 'import numpy as np\n'), ((2586, 2603), 'numpy.arange', 'np.arange', (['nbatch'], {}), '(nbatch)\n', (2595, 2603), True, 'import numpy as np\n'), ((3141, 3168), 'numpy.mean', 'np.mean', (['mblossvals'], {'... |
import random
import time
import pygame
import ppb.events as events
import ppb.flags as flags
default_resolution = 800, 600
class System(events.EventMixin):
def __init__(self, **_):
pass
def __enter__(self):
pass
def __exit__(self, exc_type, exc_val, exc_tb):
pass
from ppb.... | [
"pygame.init",
"pygame.quit",
"pygame.Surface",
"pygame.display.set_mode",
"time.monotonic",
"pygame.transform.smoothscale",
"ppb.events.Update",
"pygame.transform.rotate",
"ppb.events.Render",
"pygame.display.set_caption",
"ppb.events.PreRender",
"pygame.display.update",
"random.randint"
] | [((959, 972), 'pygame.init', 'pygame.init', ([], {}), '()\n', (970, 972), False, 'import pygame\n'), ((995, 1035), 'pygame.display.set_mode', 'pygame.display.set_mode', (['self.resolution'], {}), '(self.resolution)\n', (1018, 1035), False, 'import pygame\n'), ((1044, 1089), 'pygame.display.set_caption', 'pygame.display... |
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: extentMessages.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as... | [
"google.protobuf.symbol_database.Default",
"google.protobuf.descriptor.FieldDescriptor"
] | [((487, 513), 'google.protobuf.symbol_database.Default', '_symbol_database.Default', ([], {}), '()\n', (511, 513), True, 'from google.protobuf import symbol_database as _symbol_database\n'), ((1532, 1822), 'google.protobuf.descriptor.FieldDescriptor', '_descriptor.FieldDescriptor', ([], {'name': '"""epsg"""', 'full_nam... |
# -*- coding: utf-8 -*-
'''
专门为web程序准备的初始化入口
'''
from application import app
from common.components.helper.StaticPluginsHelper import StaticPluginsHelper
from common.components.helper.UtilHelper import UtilHelper
from common.services.GlobalUrlService import GlobalUrlService
from common.services.CommonConstant import Co... | [
"application.app.add_template_global"
] | [((459, 520), 'application.app.add_template_global', 'app.add_template_global', (['GlobalUrlService', '"""GlobalUrlService"""'], {}), "(GlobalUrlService, 'GlobalUrlService')\n", (482, 520), False, 'from application import app\n'), ((521, 588), 'application.app.add_template_global', 'app.add_template_global', (['StaticP... |
from logging import getLogger
from typing import Tuple, Union
import torch
from torch import nn
from torch.nn.utils import spectral_norm
from ..modules import init_xavier_uniform
from ..modules.lightweight import SimpleDecoderBlock
logger = getLogger(__name__)
logger.debug('スクリプトを読み込みました。')
class SimpleDecoder(nn.M... | [
"logging.getLogger",
"torch.nn.Sigmoid",
"torch.nn.LeakyReLU",
"torch.nn.Conv2d",
"torch.nn.Linear",
"torch.nn.Embedding"
] | [((243, 262), 'logging.getLogger', 'getLogger', (['__name__'], {}), '(__name__)\n', (252, 262), False, 'from logging import getLogger\n'), ((2169, 2186), 'torch.nn.Linear', 'nn.Linear', (['(256)', '(1)'], {}), '(256, 1)\n', (2178, 2186), False, 'from torch import nn\n'), ((767, 779), 'torch.nn.Sigmoid', 'nn.Sigmoid', (... |
# 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.InvokeOptions",
"pulumi.set",
"pulumi.runtime.invoke",
"pulumi.get"
] | [((689, 719), 'pulumi.set', 'pulumi.set', (['__self__', '"""id"""', 'id'], {}), "(__self__, 'id', id)\n", (699, 719), False, 'import pulumi\n'), ((842, 874), 'pulumi.set', 'pulumi.set', (['__self__', '"""ids"""', 'ids'], {}), "(__self__, 'ids', ids)\n", (852, 874), False, 'import pulumi\n'), ((1040, 1062), 'pulumi.get'... |
# Copyright (c) 2021 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... | [
"paddlespeech.s2t.modules.mask.subsequent_mask",
"paddlespeech.s2t.frontend.utility.load_cmvn",
"paddlespeech.s2t.modules.initializer.DefaultInitializerContext",
"paddle.arange",
"paddlespeech.s2t.decoders.scorers.ctc.CTCPrefixScorer",
"sys.exit",
"paddlespeech.s2t.utils.layer_tools.summary",
"paddle.... | [((28695, 28711), 'paddle.no_grad', 'paddle.no_grad', ([], {}), '()\n', (28709, 28711), False, 'import paddle\n'), ((2494, 2507), 'paddlespeech.s2t.utils.log.Log', 'Log', (['__name__'], {}), '(__name__)\n', (2497, 2507), False, 'from paddlespeech.s2t.utils.log import Log\n'), ((3068, 3091), 'paddle.nn.Layer.__init__', ... |
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
import ... | [
"sphinx_gallery.sorting.ExplicitOrder",
"logging.warning",
"os.path.join",
"os.popen",
"os.path.abspath"
] | [((687, 709), 'os.path.abspath', 'os.path.abspath', (['"""../"""'], {}), "('../')\n", (702, 709), False, 'import os\n'), ((6002, 6406), 'sphinx_gallery.sorting.ExplicitOrder', 'ExplicitOrder', (["['../core/basic', '../core/intermediate', '../core/advanced',\n '../core/remote_flyte', '../case_studies/pima_diabetes',\... |
# -*- coding: utf8 -*-fr
# pylint: disable=too-many-instance-attributes,invalid-name, too-many-statements
"""
ItopapiWebServer is an abstraction of WebServer representation on iTop
"""
from itopapi.model.prototype import ItopapiPrototype, ItopapiUnimplementedMethod
from itopapi.model.softwareInstance import ItopapiSof... | [
"itopapi.model.prototype.ItopapiPrototype.find_by_name",
"itopapi.model.prototype.ItopapiPrototype.find",
"itopapi.model.prototype.ItopapiPrototype.find_all",
"itopapi.model.softwareInstance.ItopapiSoftwareInstance.register"
] | [((3834, 3884), 'itopapi.model.softwareInstance.ItopapiSoftwareInstance.register', 'ItopapiSoftwareInstance.register', (['ItopapiWebServer'], {}), '(ItopapiWebServer)\n', (3866, 3884), False, 'from itopapi.model.softwareInstance import ItopapiSoftwareInstance\n'), ((1581, 1625), 'itopapi.model.prototype.ItopapiPrototyp... |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.utils import time_diff_in_seconds, now, now_datetime, DATETIME_FORMAT
from dateutil.relativedelta import relativedelta
from six import string_types
@fr... | [
"frappe.publish_realtime",
"frappe._dict",
"dateutil.relativedelta.relativedelta",
"frappe.get_list",
"frappe.get_user",
"frappe.whitelist",
"frappe.clear_messages",
"frappe.utils.time_diff_in_seconds",
"frappe.get_attr",
"frappe.db.sql",
"frappe.get_doc",
"frappe.cache",
"frappe.get_meta_mo... | [((318, 336), 'frappe.whitelist', 'frappe.whitelist', ([], {}), '()\n', (334, 336), False, 'import frappe\n'), ((7215, 7233), 'frappe.whitelist', 'frappe.whitelist', ([], {}), '()\n', (7231, 7233), False, 'import frappe\n'), ((522, 536), 'frappe.cache', 'frappe.cache', ([], {}), '()\n', (534, 536), False, 'import frapp... |
'''https://leetcode.com/problems/design-a-file-sharing-system/
1500. Design a File Sharing System
Medium
32
77
Add to List
Share
We will use a file-sharing system to share a very large file which consists of m small chunks with IDs from 1 to m.
When users join the system, the system should assign a unique ID to t... | [
"heapq.heappop",
"heapq.heappush",
"collections.defaultdict"
] | [((4825, 4864), 'heapq.heappush', 'heapq.heappush', (['self.__min_heap', 'userID'], {}), '(self.__min_heap, userID)\n', (4839, 4864), False, 'import heapq\n'), ((5780, 5808), 'collections.defaultdict', 'collections.defaultdict', (['set'], {}), '(set)\n', (5803, 5808), False, 'import collections\n'), ((6630, 6669), 'hea... |
# -*- coding: utf-8 -*-
"""
Created on Sun Apr 4 18:48:31 2021
@author: ktopo
"""
import requests
from PIL import Image
import matplotlib.pyplot as plt
import base64
import json
import io
# %% SETUP
BUCKET_NAME = 'ktopolovbucket'
stage_url = 'https://dy0duracgd.execute-api.us-east-1.amazonaws.com/dev'
# Local files... | [
"matplotlib.pyplot.imshow",
"json.loads",
"base64.b64encode",
"json.dumps",
"io.BytesIO",
"base64.b64decode",
"requests.get",
"matplotlib.pyplot.figure",
"requests.put",
"matplotlib.pyplot.title",
"matplotlib.pyplot.subplot"
] | [((1060, 1081), 'json.dumps', 'json.dumps', (['http_body'], {}), '(http_body)\n', (1070, 1081), False, 'import json\n'), ((1229, 1275), 'json.loads', 'json.loads', (["share_image_response['dynamoMeta']"], {}), "(share_image_response['dynamoMeta'])\n", (1239, 1275), False, 'import json\n'), ((2037, 2069), 'base64.b64dec... |
from bootstrapvz.base import Task
from .. import phases
import apt
from ..tools import log_check_call
class AddManifestPackages(Task):
description = 'Adding packages from the manifest'
phase = phases.preparation
predecessors = [apt.AddManifestSources, apt.AddDefaultSources, apt.AddBackports]
@classme... | [
"logging.getLogger",
"re.compile",
"os.statvfs",
"os.path.join",
"os.environ.copy",
"os.path.basename",
"shutil.copy",
"os.remove"
] | [((384, 436), 're.compile', 're.compile', (['"""^(?P<name>[^/]+)(/(?P<target>[^/]+))?$"""'], {}), "('^(?P<name>[^/]+)(/(?P<target>[^/]+))?$')\n", (394, 436), False, 'import re\n'), ((3756, 3773), 'os.environ.copy', 'os.environ.copy', ([], {}), '()\n', (3771, 3773), False, 'import os\n'), ((1625, 1642), 'os.environ.copy... |
# KNN으로 기술적분석 지표들과 변동성을 Feature로 향후 20일 동안
# 목표 수익률을 달성할 가능성이 있는지를 추정한다.
#
# 2018.08.20, 아마추어퀀트 (조성현)
# --------------------------------------------------------
import tensorflow as tf
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from MyUtil import YahooData, TaFeatureSet
stocks = {'005380':'... | [
"tensorflow.reset_default_graph",
"pandas.read_csv",
"matplotlib.pyplot.ylabel",
"numpy.where",
"matplotlib.pyplot.legend",
"tensorflow.placeholder",
"tensorflow.Session",
"matplotlib.pyplot.xlabel",
"MyUtil.TaFeatureSet.getTaFeatureSet",
"tensorflow.negative",
"numpy.array",
"matplotlib.pyplo... | [((1701, 1741), 'pandas.read_csv', 'pd.read_csv', (['"""dataset/3-6.TaDataset.csv"""'], {}), "('dataset/3-6.TaDataset.csv')\n", (1712, 1741), True, 'import pandas as pd\n'), ((1956, 1990), 'numpy.array', 'np.array', (['ds.iloc[0:trainLen, 0:6]'], {}), '(ds.iloc[0:trainLen, 0:6])\n', (1964, 1990), True, 'import numpy as... |
import datetime
import argparse
import botocore
import boto3
import json
if __name__ == '__main__':
parser = argparse.ArgumentParser(description='Calculate Amazon CloudFront AOS using Cost Explorer API.')
parser.add_argument('--month', help='specify month')
parser.add_argument('--year', help='specify year'... | [
"datetime.datetime",
"boto3.session.Session",
"argparse.ArgumentParser",
"json.dumps",
"datetime.datetime.today",
"datetime.timedelta"
] | [((114, 214), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Calculate Amazon CloudFront AOS using Cost Explorer API."""'}), "(description=\n 'Calculate Amazon CloudFront AOS using Cost Explorer API.')\n", (137, 214), False, 'import argparse\n'), ((513, 538), 'datetime.datetime.today'... |
# Generated by Django 3.0.8 on 2020-07-12 12:54
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('leads', '0002_auto_20200711_1333'),
]
operations = [
migrations.AlterField(
model_name='lead',
name='title',
... | [
"django.db.models.CharField"
] | [((331, 394), 'django.db.models.CharField', 'models.CharField', ([], {'blank': '(True)', 'max_length': '(255)', 'verbose_name': '"""职称"""'}), "(blank=True, max_length=255, verbose_name='职称')\n", (347, 394), False, 'from django.db import migrations, models\n')] |
# Copyright 2019–2020 CEA
#
# Author: <NAME> <<EMAIL>>
#
# Licensed under the Apache Licence, Version 2.0 (the "Licence");
# you may not use this file except in compliance with the Licence.
# You may obtain a copy of the Licence at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | [
"pytest.fixture",
"hbp_spatial_backend.api_v1._get_transform_graph"
] | [((822, 850), 'pytest.fixture', 'pytest.fixture', ([], {'autouse': '(True)'}), '(autouse=True)\n', (836, 850), False, 'import pytest\n'), ((1499, 1528), 'hbp_spatial_backend.api_v1._get_transform_graph', 'api_v1._get_transform_graph', ([], {}), '()\n', (1526, 1528), False, 'from hbp_spatial_backend import api_v1\n'), (... |
#!/use/bin/env python3
#-*- coding:utf-8 -*-
# child.py
# A sample child process for receiving messages over a channel
import sys,os
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
import channel
ch = channel.Channel(sys.stdout, sys.stdin)
while True:
try:
item = ch.recv()
ch.send(("c... | [
"os.path.abspath",
"channel.Channel"
] | [((216, 254), 'channel.Channel', 'channel.Channel', (['sys.stdout', 'sys.stdin'], {}), '(sys.stdout, sys.stdin)\n', (231, 254), False, 'import channel\n'), ((166, 191), 'os.path.abspath', 'os.path.abspath', (['__file__'], {}), '(__file__)\n', (181, 191), False, 'import sys, os\n')] |
from copy import deepcopy
def get_median(values):
"""
Given an unsorted list of numeric values, return median value (as a float).
Note that in the case of even-length lists of values, we apply the value to
the left of the center to be the median (such that the median can only be
a value from the list of valu... | [
"copy.deepcopy"
] | [((482, 498), 'copy.deepcopy', 'deepcopy', (['values'], {}), '(values)\n', (490, 498), False, 'from copy import deepcopy\n')] |
# -*- coding: UTF-8 -*-
from urllib import request, error
if __name__ == '__main__':
# 一个不存在的链接
url = 'http://www.iloveyou.com/'
response = request.urlopen(url)
try:
html = response.read().decode('utf-8')
print(html)
except error.URLError as e:
if hasattr(e, 'code'):
... | [
"urllib.request.urlopen"
] | [((154, 174), 'urllib.request.urlopen', 'request.urlopen', (['url'], {}), '(url)\n', (169, 174), False, 'from urllib import request, error\n')] |
""" Benchmark processing in Dask
This mimics the overall structure and workload of our processing.
<NAME> 8 November 2017
<EMAIL>
"""
import csv
import numpy
from dask import delayed
from distributed import Client, wait, LocalCluster
# Make some randomly located points on 2D plane
def sparse(n, margin=0.1):
num... | [
"csv.DictWriter",
"time.sleep",
"dask.bag.from_sequence",
"copy.deepcopy",
"distributed.LocalCluster",
"argparse.ArgumentParser",
"seqfile.findNextFile",
"numpy.fft.fft",
"numpy.max",
"numpy.random.seed",
"pprint.PrettyPrinter",
"distributed.Client",
"socket.gethostname",
"numpy.round",
... | [((317, 343), 'numpy.random.seed', 'numpy.random.seed', (['(8753193)'], {}), '(8753193)\n', (334, 343), False, 'import numpy\n'), ((594, 629), 'numpy.zeros', 'numpy.zeros', (['shape'], {'dtype': '"""complex"""'}), "(shape, dtype='complex')\n", (605, 629), False, 'import numpy\n'), ((855, 876), 'copy.deepcopy', 'copy.de... |
import sys
sys.path.append("C:/Users/David/Desktop/programacion/python/Anime Battle Online/server")
import pygame.time
import settings
import Globals
from functions.ShortFunctions import *
def tCalcAndSend(PowerUps, MurosRects, Ranking):
reloj = pygame.time.Clock()
while True:
calcPosOfEverything(Power... | [
"sys.path.append"
] | [((12, 105), 'sys.path.append', 'sys.path.append', (['"""C:/Users/David/Desktop/programacion/python/Anime Battle Online/server"""'], {}), "(\n 'C:/Users/David/Desktop/programacion/python/Anime Battle Online/server')\n", (27, 105), False, 'import sys\n')] |
"""
Augmenter that apply mask operation to audio.
"""
from nlpaug.augmenter.audio import AudioAugmenter
import nlpaug.model.audio as nma
from nlpaug.util import Action, WarningMessage
class MaskAug(AudioAugmenter):
"""
:param int sampling_rate: Sampling rate of input audio. Mandatory if duration is provi... | [
"nlpaug.model.audio.Mask"
] | [((1717, 1727), 'nlpaug.model.audio.Mask', 'nma.Mask', ([], {}), '()\n', (1725, 1727), True, 'import nlpaug.model.audio as nma\n')] |
# Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... | [
"logging.getLogger",
"argparse.ArgumentParser",
"apache_beam.options.pipeline_options.PipelineOptions",
"os.path.join",
"os.path.realpath",
"apache_beam.io.BigQuerySink",
"apache_beam.pvalue.AsDict",
"apache_beam.io.gcp.bigquery.parse_table_schema_from_json",
"apache_beam.io.BigQuerySource",
"apac... | [((6843, 6868), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (6866, 6868), False, 'import argparse\n'), ((7694, 7757), 'apache_beam.io.gcp.bigquery.parse_table_schema_from_json', 'parse_table_schema_from_json', (['data_lake_to_data_mart.schema_str'], {}), '(data_lake_to_data_mart.schema_str)\... |
# pylint:disable=unused-variable
# pylint:disable=unused-argument
# pylint:disable=redefined-outer-name
import asyncio
import logging
from typing import AsyncIterator, Dict, Iterator, List
import aiopg.sa
import pytest
import sqlalchemy as sa
import tenacity
from sqlalchemy.orm import sessionmaker
from ten... | [
"logging.getLogger",
"sqlalchemy.orm.sessionmaker",
"tenacity.wait.wait_fixed",
"sqlalchemy.create_engine",
"tenacity.stop.stop_after_attempt",
"tenacity.before_sleep.before_sleep_log",
"pytest.fixture",
"asyncio.get_event_loop_policy"
] | [((584, 611), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (601, 611), False, 'import logging\n'), ((2763, 2793), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""module"""'}), "(scope='module')\n", (2777, 2793), False, 'import pytest\n'), ((2915, 2945), 'pytest.fixture', 'pytest.... |
import os
from selenium.common.exceptions import StaleElementReferenceException, TimeoutException
import datetime
import time
from selenium.webdriver.common.by import By
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.support import expected_conditions as ec
from HQSmokeTests.UserInput... | [
"datetime.datetime.fromtimestamp",
"selenium.webdriver.support.wait.WebDriverWait",
"time.sleep",
"os.getcwd",
"os.chdir",
"datetime.datetime.now",
"selenium.webdriver.support.expected_conditions.visibility_of_element_located",
"selenium.webdriver.support.expected_conditions.presence_of_element_locate... | [((482, 520), 'os.chdir', 'os.chdir', (['UserInputsData.download_path'], {}), '(UserInputsData.download_path)\n', (490, 520), False, 'import os\n'), ((6017, 6052), 'selenium.webdriver.support.expected_conditions.element_to_be_clickable', 'ec.element_to_be_clickable', (['locator'], {}), '(locator)\n', (6043, 6052), True... |
# Copyright 2021 Google LLC. 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 law or a... | [
"docstring_parser.parse",
"inspect.Signature",
"inspect.signature",
"kfp.components.load_component_from_text",
"inspect.Parameter",
"inspect.isclass",
"inspect.isfunction",
"inspect.getdoc"
] | [((2677, 2704), 'inspect.isclass', 'inspect.isclass', (['annotation'], {}), '(annotation)\n', (2692, 2704), False, 'import inspect\n'), ((3993, 4021), 'inspect.isclass', 'inspect.isclass', (['mb_sdk_type'], {}), '(mb_sdk_type)\n', (4008, 4021), False, 'import inspect\n'), ((6099, 6127), 'inspect.isclass', 'inspect.iscl... |
# (c) Copyright 2014-2016 Hewlett-Packard Development Company, L.P.
#
# 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 ap... | [
"logging.getLogger",
"freezerclient.exceptions.ApiClientException",
"freezerclient.utils.doc_from_json_file",
"freezerclient.utils.prepare_search"
] | [((786, 813), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (803, 813), False, 'import logging\n'), ((3322, 3362), 'freezerclient.utils.prepare_search', 'utils.prepare_search', (['parsed_args.search'], {}), '(parsed_args.search)\n', (3342, 3362), False, 'from freezerclient import utils\n... |
# ---------------------------------------------------------------------
# Cisco.IOS profile
# ---------------------------------------------------------------------
# Copyright (C) 2007-2020 The NOC Project
# See LICENSE for details
# ---------------------------------------------------------------------
# Python module... | [
"re.compile"
] | [((1406, 1500), 're.compile', 're.compile', (['"""Cable\\\\s*(?P<pr_if>\\\\d+/\\\\d+) U(pstream)?\\\\s*(?P<sub_if>\\\\d+)"""', 're.IGNORECASE'], {}), "('Cable\\\\s*(?P<pr_if>\\\\d+/\\\\d+) U(pstream)?\\\\s*(?P<sub_if>\\\\d+)',\n re.IGNORECASE)\n", (1416, 1500), False, 'import re\n'), ((2038, 2089), 're.compile', 're... |
# This example scans for any BLE advertisements and prints one advertisement and one scan response
# from every device found. This scan is more detailed than the simple test because it includes
# specialty advertising types.
from adafruit_ble import BLERadio
from adafruit_ble.advertising import Advertisement
from ada... | [
"adafruit_ble.BLERadio"
] | [((394, 404), 'adafruit_ble.BLERadio', 'BLERadio', ([], {}), '()\n', (402, 404), False, 'from adafruit_ble import BLERadio\n')] |
# Copyright 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... | [
"cache.JSON.flush",
"cache.MESSAGES.flush_local",
"cache.MESSAGES.keys",
"medium_test_case.MediumTestCase.setUp",
"model.Message.all",
"google.appengine.ext.db.delete",
"model.Message",
"cache.MESSAGES.flush",
"google.appengine.api.memcache.get"
] | [((867, 893), 'medium_test_case.MediumTestCase.setUp', 'MediumTestCase.setUp', (['self'], {}), '(self)\n', (887, 893), False, 'from medium_test_case import MediumTestCase\n'), ((902, 920), 'cache.JSON.flush', 'cache.JSON.flush', ([], {}), '()\n', (918, 920), False, 'import cache\n'), ((954, 972), 'cache.JSON.flush', 'c... |
# -*- coding: utf8 -*-
from __future__ import unicode_literals
from pyramid.config import Configurator
from pyramid.compat import (
ascii_native_,
string_types
)
import json
from webtest import TestApp
try:
import unittest2 as unittest
except ImportError: # pragma NO COVER
import unittest # noqa... | [
"pyramid.config.Configurator",
"webtest.TestApp",
"pyramid.compat.ascii_native_"
] | [((511, 542), 'pyramid.config.Configurator', 'Configurator', ([], {'settings': 'settings'}), '(settings=settings)\n', (523, 542), False, 'from pyramid.config import Configurator\n'), ((855, 867), 'webtest.TestApp', 'TestApp', (['app'], {}), '(app)\n', (862, 867), False, 'from webtest import TestApp\n'), ((1101, 1124), ... |
from flask import Flask, render_template, request, jsonify
import database.database as database
import milk.milk as milk
from threading import Thread
app = Flask(__name__)
@app.route("/milk", methods=["GET", "POST"])
def milk_index():
if request.method == "POST":
if "get_num" in request.form:
... | [
"flask.render_template",
"milk.milk.StrOfSize",
"database.database.MilkDatabase",
"flask.Flask",
"threading.Thread",
"flask.jsonify"
] | [((157, 172), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (162, 172), False, 'from flask import Flask, render_template, request, jsonify\n'), ((1963, 1987), 'threading.Thread', 'Thread', ([], {'target': 'milk.scan'}), '(target=milk.scan)\n', (1969, 1987), False, 'from threading import Thread\n'), ((1645... |
from django.db import migrations
try:
from django.contrib.postgres.fields import CIEmailField
except ImportError:
CIEmailField = None
else:
from django.contrib.postgres.operations import CITextExtension
def _operations():
if CIEmailField:
yield CITextExtension()
yield migrations.Alter... | [
"django.contrib.postgres.fields.CIEmailField",
"django.contrib.postgres.operations.CITextExtension",
"django.db.migrations.RunSQL"
] | [((272, 289), 'django.contrib.postgres.operations.CITextExtension', 'CITextExtension', ([], {}), '()\n', (287, 289), False, 'from django.contrib.postgres.operations import CITextExtension\n'), ((559, 771), 'django.db.migrations.RunSQL', 'migrations.RunSQL', ([], {'sql': '(\'CREATE UNIQUE INDEX mailauth_user_emailuser_e... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = 'ipetrash'
# pip install nltk
import nltk
# pip install pymorphy2
import pymorphy2
# TODO: объединить функции is_ADJS_sing_* и is_VERB_sing_*,
# а проверку пола вынести в отдельую функцию
def is_ADJS_sing_femn(parsed: pymorphy2.analyzer.Parse) ->... | [
"json.load",
"nltk.sent_tokenize",
"pymorphy2.MorphAnalyzer",
"nltk.word_tokenize"
] | [((1293, 1318), 'pymorphy2.MorphAnalyzer', 'pymorphy2.MorphAnalyzer', ([], {}), '()\n', (1316, 1318), False, 'import pymorphy2\n'), ((1493, 1537), 'nltk.sent_tokenize', 'nltk.sent_tokenize', (['line'], {'language': '"""russian"""'}), "(line, language='russian')\n", (1511, 1537), False, 'import nltk\n'), ((2976, 2988), ... |
# -*- coding: utf-8 -*-
'''
:codeauthor: :email:`<NAME> (<EMAIL>)`
tests.unit.modules.parted_test
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
'''
# Import Python libs
from __future__ import absolute_import
# Import Salt Testing libs
from tests.support.mixins import LoaderModuleMockMixin
from tests.support.unit imp... | [
"salt.modules.parted.list_",
"tests.support.mock.patch",
"salt.modules.parted.probe",
"tests.support.mock.MagicMock",
"salt.modules.parted.__virtual__",
"tests.support.unit.skipIf"
] | [((524, 555), 'tests.support.unit.skipIf', 'skipIf', (['NO_MOCK', 'NO_MOCK_REASON'], {}), '(NO_MOCK, NO_MOCK_REASON)\n', (530, 555), False, 'from tests.support.unit import skipIf, TestCase\n'), ((670, 681), 'tests.support.mock.MagicMock', 'MagicMock', ([], {}), '()\n', (679, 681), False, 'from tests.support.mock import... |
import pandas as pd
from scipy.io import wavfile
import numpy as np
import argparse
def stock_to_wav(filename):
prices = pd.read_csv(f"{filename}.csv").Close.values
prices = np.diff(prices)
scale = (2**15) * 0.8 / max(map(abs, [prices.max(), prices.min()]))
prices = (prices * scale)
mx, mn = price... | [
"scipy.io.wavfile.write",
"numpy.diff",
"argparse.ArgumentParser",
"pandas.read_csv"
] | [((184, 199), 'numpy.diff', 'np.diff', (['prices'], {}), '(prices)\n', (191, 199), True, 'import numpy as np\n'), ((459, 505), 'scipy.io.wavfile.write', 'wavfile.write', (['f"""{filename}.wav"""', '(2000)', 'prices'], {}), "(f'{filename}.wav', 2000, prices)\n", (472, 505), False, 'from scipy.io import wavfile\n'), ((54... |
import github3
from github3 import gists
from tests.utils import (BaseCase, load)
class TestGist(BaseCase):
def __init__(self, methodName='runTest'):
super(TestGist, self).__init__(methodName)
self.gist = gists.Gist(load('gist'))
self.api = 'https://api.github.com/gists/3813862'
def s... | [
"tests.utils.load"
] | [((238, 250), 'tests.utils.load', 'load', (['"""gist"""'], {}), "('gist')\n", (242, 250), False, 'from tests.utils import BaseCase, load\n'), ((4778, 4790), 'tests.utils.load', 'load', (['"""gist"""'], {}), "('gist')\n", (4782, 4790), False, 'from tests.utils import BaseCase, load\n'), ((5060, 5080), 'tests.utils.load'... |
import json
import os
from concurrent import futures
import numpy as np
from elf.io import open_file
from tqdm import tqdm
from ..metadata import read_dataset_metadata
def compute_contrast_limits(
source_prefix, dataset_folder, lower_percentile, upper_percentile, n_threads, cache_path=None
):
if cache_path i... | [
"os.path.exists",
"numpy.median",
"elf.io.open_file",
"concurrent.futures.ThreadPoolExecutor",
"os.path.join",
"json.load",
"numpy.percentile",
"json.dump"
] | [((1239, 1277), 'numpy.median', 'np.median', (['[res[0] for res in results]'], {}), '([res[0] for res in results])\n', (1248, 1277), True, 'import numpy as np\n'), ((1289, 1327), 'numpy.median', 'np.median', (['[res[1] for res in results]'], {}), '([res[1] for res in results])\n', (1298, 1327), True, 'import numpy as n... |
import json
import uuid
from typing import Any, Dict, List
from benedict import benedict
from .formatters import _repr_granule_html
class CustomDict(benedict):
_basic_umm_fields_: List = []
_basic_meta_fields_: List = []
def __init__(
self,
collection: Dict[str, Any],
fields: Li... | [
"json.dumps",
"uuid.uuid4"
] | [((2512, 2591), 'json.dumps', 'json.dumps', (['self.render_dict'], {'sort_keys': '(False)', 'indent': '(2)', 'separators': "(',', ': ')"}), "(self.render_dict, sort_keys=False, indent=2, separators=(',', ': '))\n", (2522, 2591), False, 'import json\n'), ((481, 493), 'uuid.uuid4', 'uuid.uuid4', ([], {}), '()\n', (491, 4... |
import os
from flask import Flask
from flask_sqlalchemy import SQLAlchemy # ORM
from flask_bcrypt import Bcrypt
from flask_login import LoginManager
from flask_mail import Mail
from flaskblog.config import Config
mail = Mail()
db = SQLAlchemy() # db instance
bcrypt = Bcrypt() # for hashing passwords
login_manager ... | [
"flask_mail.Mail",
"flask_login.LoginManager",
"flask.Flask",
"flask_bcrypt.Bcrypt",
"flask_sqlalchemy.SQLAlchemy"
] | [((223, 229), 'flask_mail.Mail', 'Mail', ([], {}), '()\n', (227, 229), False, 'from flask_mail import Mail\n'), ((235, 247), 'flask_sqlalchemy.SQLAlchemy', 'SQLAlchemy', ([], {}), '()\n', (245, 247), False, 'from flask_sqlalchemy import SQLAlchemy\n'), ((272, 280), 'flask_bcrypt.Bcrypt', 'Bcrypt', ([], {}), '()\n', (27... |
import cv2
imagem = cv2.imread("saida.jpg")
(b,g,r) = imagem[0,0] #Veja que a ordem BGR e não RGB
print('O pixel (0,0) tem as seguintes cores: ')
print('Vermelho:',r, 'Verde: ',g, 'Azul: ', b)
cv2.imshow("aee", imagem)
cv2.waitKey(0) | [
"cv2.waitKey",
"cv2.imread",
"cv2.imshow"
] | [((21, 44), 'cv2.imread', 'cv2.imread', (['"""saida.jpg"""'], {}), "('saida.jpg')\n", (31, 44), False, 'import cv2\n'), ((198, 223), 'cv2.imshow', 'cv2.imshow', (['"""aee"""', 'imagem'], {}), "('aee', imagem)\n", (208, 223), False, 'import cv2\n'), ((224, 238), 'cv2.waitKey', 'cv2.waitKey', (['(0)'], {}), '(0)\n', (235... |
import urllib2
import gzip
import sys
import StringIO
from astropy.io import fits
__all__ = ['chunk_report','chunk_read']
def chunk_report(bytes_so_far, chunk_size, total_size):
if total_size > 0:
percent = float(bytes_so_far) / total_size
percent = round(percent*100, 2)
sys.stdout.write(u... | [
"StringIO.StringIO",
"gzip.GzipFile",
"astropy.io.fits.open",
"urllib2.build_opener",
"sys.stdout.write"
] | [((1539, 1565), 'StringIO.StringIO', 'StringIO.StringIO', (['results'], {}), '(results)\n', (1556, 1565), False, 'import StringIO\n'), ((302, 436), 'sys.stdout.write', 'sys.stdout.write', (["(u'Downloaded %12.2g of %12.2g Mb (%6.2f%%)\\r' % (bytes_so_far / 1024.0 ** \n 2, total_size / 1024.0 ** 2, percent))"], {}), ... |
##########################################################################
#
# Copyright (c) 2015, 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... | [
"GafferImageTest.ImageTestCase.tearDown",
"unittest.main",
"Gaffer.Context",
"GafferImage.ImageWriter",
"GafferImage.OpenImageIOReader.supportedExtensions",
"imath.V2i",
"GafferImage.ImagePlug",
"GafferImage.Format",
"GafferImage.OpenImageIOReader",
"GafferImageTest.ImageTestCase.setUp",
"Gaffer... | [((2023, 2099), 'os.path.expandvars', 'os.path.expandvars', (['"""$GAFFER_ROOT/python/GafferImageTest/images/circles.exr"""'], {}), "('$GAFFER_ROOT/python/GafferImageTest/images/circles.exr')\n", (2041, 2099), False, 'import os\n'), ((2124, 2215), 'os.path.expandvars', 'os.path.expandvars', (['"""$GAFFER_ROOT/python/Ga... |
# Copyright (C) 2014 eNovance SAS <<EMAIL>>
#
# 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... | [
"redmine.exceptions.ResourceNotFoundError",
"mock.patch",
"pysflib.sfredmine.RedmineUtils"
] | [((836, 859), 'redmine.exceptions.ResourceNotFoundError', 'ResourceNotFoundError', ([], {}), '()\n', (857, 859), False, 'from redmine.exceptions import ResourceNotFoundError\n'), ((1230, 1284), 'pysflib.sfredmine.RedmineUtils', 'sfredmine.RedmineUtils', (['"""http://fake.fake"""'], {'key': '"""1234"""'}), "('http://fak... |
#/usr/bin/env python
"""
Input/Output classes that are used by 3D-DAOSTORM, sCMOS, Spliner
and Multiplane analysis.
Hazen 09/17
"""
import numpy
import os
import sys
from xml.etree import ElementTree
import storm_analysis.sa_library.datareader as datareader
import storm_analysis.sa_library.parameters as params
impor... | [
"numpy.ones_like",
"os.path.exists",
"storm_analysis.sa_library.datareader.inferReader",
"storm_analysis.sa_library.sa_h5py.SAH5Py",
"xml.etree.ElementTree.tostring",
"numpy.max",
"numpy.sum",
"storm_analysis.sa_library.static_background.StaticBGEstimator",
"storm_analysis.sa_library.writeinsight3.I... | [((772, 811), 'numpy.load', 'numpy.load', (['filename'], {'allow_pickle': '(True)'}), '(filename, allow_pickle=True)\n', (782, 811), False, 'import numpy\n'), ((1416, 1455), 'numpy.load', 'numpy.load', (['filename'], {'allow_pickle': '(True)'}), '(filename, allow_pickle=True)\n', (1426, 1455), False, 'import numpy\n'),... |
from slims.output import file_value
from slims.slims import Slims
from slims.step import Step, file_output
def execute():
# Make sure the path to the file exists
return file_value('C:/Users/User/Downloads/file.txt')
slims = Slims("slims", url="http://127.0.0.1:9999/", token="<PASSWORD>", local_host="0.0.0.0... | [
"slims.step.file_output",
"slims.slims.Slims",
"slims.output.file_value"
] | [((236, 344), 'slims.slims.Slims', 'Slims', (['"""slims"""'], {'url': '"""http://127.0.0.1:9999/"""', 'token': '"""<PASSWORD>"""', 'local_host': '"""0.0.0.0"""', 'local_port': '(5000)'}), "('slims', url='http://127.0.0.1:9999/', token='<PASSWORD>', local_host\n ='0.0.0.0', local_port=5000)\n", (241, 344), False, 'fr... |
"""Helper for updating a projectum's log_url
Log_urls are the google doc links to a projectum's Projectum Agenda Log
"""
from regolith.helpers.basehelper import DbHelperBase
from regolith.fsclient import _id_key
from regolith.tools import all_docs_from_collection, fragment_retrieval
TARGET_COLL = "projecta"
def s... | [
"regolith.tools.fragment_retrieval",
"regolith.tools.all_docs_from_collection"
] | [((1767, 1811), 'regolith.tools.all_docs_from_collection', 'all_docs_from_collection', (['rc.client', 'rc.coll'], {}), '(rc.client, rc.coll)\n', (1791, 1811), False, 'from regolith.tools import all_docs_from_collection, fragment_retrieval\n'), ((2484, 2550), 'regolith.tools.fragment_retrieval', 'fragment_retrieval', ([... |
#!/usr/bin/python
# -*- encoding: utf-8 -*-
import torch
import torch.cuda.amp as amp
import torch.nn as nn
import torch.nn.functional as F
##
# version 1: use pytorch autograd
class HSwishV1(nn.Module):
def __init__(self):
super(HSwishV1, self).__init__()
def forward(self, feat):
return f... | [
"torch.cuda.amp.custom_fwd",
"torch.nn.BatchNorm2d",
"torch.ones_like",
"torch.abs",
"torch.nn.CrossEntropyLoss",
"torch.mean",
"torch.nn.Conv2d",
"torch.nn.functional.relu6",
"torch.eq",
"torch.randint",
"swish_cpp.hswish_forward",
"swish_cpp.hswish_backward",
"torch.nn.Linear",
"torch.ze... | [((475, 516), 'torch.cuda.amp.custom_fwd', 'amp.custom_fwd', ([], {'cast_inputs': 'torch.float32'}), '(cast_inputs=torch.float32)\n', (489, 516), True, 'import torch.cuda.amp as amp\n'), ((1396, 1437), 'torch.cuda.amp.custom_fwd', 'amp.custom_fwd', ([], {'cast_inputs': 'torch.float32'}), '(cast_inputs=torch.float32)\n'... |
import argparse
import parsl
from parsl.app.app import App
from parsl.tests.configs.local_threads import config
parsl.clear()
parsl.load(config)
@App('python')
def app_double(x):
return x * 2
@App('python')
def app_sum(inputs=[]):
return sum(inputs)
@App('python')
def slow_app_double(x, sleep_dur=0.05):... | [
"argparse.ArgumentParser",
"time.sleep",
"parsl.app.app.App",
"parsl.load",
"parsl.set_stream_logger",
"parsl.clear"
] | [((114, 127), 'parsl.clear', 'parsl.clear', ([], {}), '()\n', (125, 127), False, 'import parsl\n'), ((128, 146), 'parsl.load', 'parsl.load', (['config'], {}), '(config)\n', (138, 146), False, 'import parsl\n'), ((150, 163), 'parsl.app.app.App', 'App', (['"""python"""'], {}), "('python')\n", (153, 163), False, 'from par... |
import logging
import sys
from logging.handlers import TimedRotatingFileHandler
import os
import setting
FORMATTER = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s — %(funcName)s:%(lineno)d - %(message)s')
LOG_FILE = os.path.join(setting.data_dir_interim, setting.log_filename)
LOGGER_NAME = "nyc_data"
def... | [
"logging.getLogger",
"logging.StreamHandler",
"logging.Formatter",
"os.path.join",
"logging.handlers.TimedRotatingFileHandler"
] | [((118, 227), 'logging.Formatter', 'logging.Formatter', (['"""%(asctime)s - %(name)s - %(levelname)s — %(funcName)s:%(lineno)d - %(message)s"""'], {}), "(\n '%(asctime)s - %(name)s - %(levelname)s — %(funcName)s:%(lineno)d - %(message)s'\n )\n", (135, 227), False, 'import logging\n'), ((229, 289), 'os.path.join',... |
import httpx
def isVMPonline(client):
'''
Check if vinmonopolet is available for queries.
On days with product releases at Vinmonopolet you will be redirected to a queue, hence it will not be possible to fetch data.
Arguments:
arg1 obj: httpx Client instance
Returns:
... | [
"httpx.get"
] | [((1186, 1217), 'httpx.get', 'httpx.get', (['URL'], {'headers': 'HEADERS'}), '(URL, headers=HEADERS)\n', (1195, 1217), False, 'import httpx\n')] |
"""
Credits:
Copyright (c) 2017-2022 <NAME>, <NAME>, <NAME>, <NAME>, <NAME> (Sinergise)
Copyright (c) 2017-2022 <NAME>, <NAME>, <NAME>, <NAME>, <NAME> (Sinergise)
Copyright (c) 2019-2020 <NAME>, <NAME> (Sinergise)
Copyright (c) 2017-2019 <NAME>, <NAME>, <NAME> (Sinergise)
This source code is licensed under the MIT lic... | [
"eolearn.mask.SnowMaskTask",
"pytest.mark.parametrize",
"numpy.sum",
"pytest.raises",
"eolearn.mask.TheiaSnowMaskTask"
] | [((529, 649), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""params"""', "[{'dem_params': (100, 100, 100)}, {'red_params': 45}, {'ndsi_params': (0.2, 3)}\n ]"], {}), "('params', [{'dem_params': (100, 100, 100)}, {\n 'red_params': 45}, {'ndsi_params': (0.2, 3)}])\n", (552, 649), False, 'import pytest\... |
# -*- coding: utf-8 -*-
# Copyright 2010 Google 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 require... | [
"logging.getLogger",
"glob.iglob",
"re.compile",
"os.path.islink",
"gslib.bucket_listing_ref.BucketListingBucket",
"os.path.splitdrive",
"gslib.storage_url.StorageUrlFromString",
"gslib.storage_url.WILDCARD_REGEX.search",
"os.path.isdir",
"gslib.bucket_listing_ref.BucketListingObject",
"os.path.... | [((1887, 1935), 're.compile', 're.compile', (['"""(?P<before>.*?)\\\\*\\\\*(?P<after>.*)"""'], {}), "('(?P<before>.*?)\\\\*\\\\*(?P<after>.*)')\n", (1897, 1935), False, 'import re\n'), ((34498, 34527), 'gslib.storage_url.StorageUrlFromString', 'StorageUrlFromString', (['url_str'], {}), '(url_str)\n', (34518, 34527), Fa... |
# coding: UTF-8
"""
フォトリフレクタのON/OFF入力(ループ版)
「電子情報通信設計製図」新潟大学工学部工学科電子情報通信プログラム
参考サイト
https://gpiozero.readthedocs.io/en/stable/index.html
"""
import gpiozero
from gpiozero import Button, LED
from time import sleep
def main():
""" メイン関数 """
# 接続ピン
PIN_LD = 23
PIN_PR = [ 10, 9, 11, 8 ]
# フォトリフレクタ検出状態
PR_STATE = ... | [
"gpiozero.Button",
"time.sleep",
"gpiozero.LED"
] | [((361, 372), 'gpiozero.LED', 'LED', (['PIN_LD'], {}), '(PIN_LD)\n', (364, 372), False, 'from gpiozero import Button, LED\n'), ((414, 466), 'gpiozero.Button', 'Button', (['PIN_PR[idx]'], {'active_state': '(True)', 'pull_up': 'None'}), '(PIN_PR[idx], active_state=True, pull_up=None)\n', (420, 466), False, 'from gpiozero... |
import unittest
import mock
import json
import io
from pycoin.serialize import b2h
from mock import patch, mock_open
from cert_issuer.certificate_handlers import CertificateWebV2Handler, CertificateV2Handler, CertificateBatchHandler, CertificateHandler, CertificateBatchWebHandler
from cert_issuer.merkle_tree_generato... | [
"mock.patch",
"cert_issuer.certificate_handlers.CertificateV2Handler",
"cert_issuer.certificate_handlers.CertificateWebV2Handler",
"mock.Mock",
"mock.mock_open.assert_any_call",
"mock.patch.object",
"pycoin.serialize.b2h",
"unittest.main",
"mock.MagicMock",
"cert_issuer.merkle_tree_generator.Merkl... | [((8330, 8370), 'mock.patch', 'mock.patch', (['"""builtins.open"""'], {'create': '(True)'}), "('builtins.open', create=True)\n", (8340, 8370), False, 'import mock\n'), ((9920, 9935), 'unittest.main', 'unittest.main', ([], {}), '()\n', (9933, 9935), False, 'import unittest\n'), ((2706, 2722), 'mock.MagicMock', 'mock.Mag... |
import cv2
import pytesseract
#pytesseract.pytesseract.tesseract_cmd = r'C:\\Program Files\\Tesseract-OCR\\tesseract.exe'
#pytesseract.pytesseract.tesseract_cmd = 'C:\\Program Files (x86)\\Tesseract-OCR\\tesseract.exe'
pytesseract.pytesseract.tesseract_cmd = r'C:\Users\User\AppData\Local\Tesseract-OCR\tesseract.exe... | [
"cv2.imread",
"pytesseract.image_to_string"
] | [((331, 363), 'cv2.imread', 'cv2.imread', (['"""./BreakingNews.png"""'], {}), "('./BreakingNews.png')\n", (341, 363), False, 'import cv2\n'), ((372, 404), 'pytesseract.image_to_string', 'pytesseract.image_to_string', (['img'], {}), '(img)\n', (399, 404), False, 'import pytesseract\n'), ((427, 455), 'cv2.imread', 'cv2.i... |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** 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
from ... import _utilities, _tables
from... | [
"pulumi.get",
"pulumi.set",
"warnings.warn",
"pulumi.log.warn",
"pulumi.runtime.invoke",
"pulumi.InvokeOptions"
] | [((512, 718), 'warnings.warn', 'warnings.warn', (['"""The \'latest\' version is deprecated. Please migrate to the function in the top-level module: \'azure-nextgen:authorization:getManagementLockAtSubscriptionLevel\'."""', 'DeprecationWarning'], {}), '(\n "The \'latest\' version is deprecated. Please migrate to the ... |
# Copyright 2021 The TensorFlow 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 applica... | [
"tensorflow.random.uniform",
"python_fuzzing.FuzzingHelper",
"atheris.Setup",
"atheris.Fuzz",
"atheris.instrument_imports"
] | [((780, 808), 'atheris.instrument_imports', 'atheris.instrument_imports', ([], {}), '()\n', (806, 808), False, 'import atheris\n'), ((1040, 1066), 'python_fuzzing.FuzzingHelper', 'FuzzingHelper', (['input_bytes'], {}), '(input_bytes)\n', (1053, 1066), False, 'from python_fuzzing import FuzzingHelper\n'), ((1750, 1816),... |
#<NAME>
#!/usr/bin/env python
import unittest
from PointT import*
from Board import*
from Ships import*
from BattleShip import*
# <NAME>
#April 1 the work being submitted is your own individual work
class Test_BattleShip(unittest.TestCase):
#pointT tests###########################################################... | [
"unittest.main"
] | [((6368, 6383), 'unittest.main', 'unittest.main', ([], {}), '()\n', (6381, 6383), False, 'import unittest\n')] |
import dash
dash.register_page(
__name__,
title="Forward Outlook",
description="This is the forward outlook", # should accept callable too
path="/forward-outlook",
image="birds.jpeg",
)
def layout():
return "Forward outlook"
| [
"dash.register_page"
] | [((13, 159), 'dash.register_page', 'dash.register_page', (['__name__'], {'title': '"""Forward Outlook"""', 'description': '"""This is the forward outlook"""', 'path': '"""/forward-outlook"""', 'image': '"""birds.jpeg"""'}), "(__name__, title='Forward Outlook', description=\n 'This is the forward outlook', path='/for... |
# (C) Datadog, Inc. 2018-present
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)
from io import open
from os import path
from setuptools import setup
HERE = path.dirname(path.abspath(__file__))
with open(path.join(HERE, 'datadog_checks', 'dev', '__about__.py'), 'r', encoding='utf-8'... | [
"os.path.abspath",
"setuptools.setup",
"os.path.join"
] | [((990, 2433), 'setuptools.setup', 'setup', ([], {'name': '"""datadog_checks_dev"""', 'version': 'VERSION', 'description': '"""The Datadog Checks Developer Tools"""', 'long_description': 'README', 'long_description_content_type': '"""text/markdown"""', 'keywords': '"""datadog agent checks dev tools tests"""', 'url': '"... |
"""
MS COCO object detection dataset.
"""
import os
import cv2
import logging
import mxnet as mx
import numpy as np
from PIL import Image
import torch.utils.data as data
from .dataset_metainfo import DatasetMetaInfo
__all__ = ['CocoDetMetaInfo']
class CocoDetDataset(data.Dataset):
"""
MS COCO detection datas... | [
"numpy.clip",
"mxnet.Context",
"numpy.hstack",
"numpy.array_split",
"numpy.array",
"numpy.sin",
"os.path.exists",
"pycocotools.coco.COCO",
"numpy.asarray",
"numpy.stack",
"numpy.dot",
"mxnet.nd.array",
"numpy.maximum",
"os.path.expanduser",
"mxnet.nd.stack",
"cv2.warpAffine",
"numpy.... | [((23766, 23822), 'numpy.array', 'np.array', (['[orig_w / 2.0, orig_h / 2.0]'], {'dtype': 'np.float32'}), '([orig_w / 2.0, orig_h / 2.0], dtype=np.float32)\n', (23774, 23822), True, 'import numpy as np\n'), ((2537, 2561), 'os.path.expanduser', 'os.path.expanduser', (['root'], {}), '(root)\n', (2555, 2561), False, 'impo... |
# ref: https://github.com/Cysu/open-reid/blob/master/reid/evaluation_metrics/ranking.py
from collections import defaultdict
from .utils import *
import numpy as np
from sklearn.metrics import average_precision_score
def _unique_sample(ids_dict, num):
mask = np.zeros(num, dtype=np.bool)
for _, indices in ids_... | [
"numpy.mean",
"numpy.ones",
"numpy.random.choice",
"sklearn.metrics.average_precision_score",
"numpy.where",
"numpy.asarray",
"numpy.any",
"numpy.argsort",
"numpy.zeros",
"collections.defaultdict",
"numpy.nonzero",
"numpy.arange"
] | [((265, 293), 'numpy.zeros', 'np.zeros', (['num'], {'dtype': 'np.bool'}), '(num, dtype=np.bool)\n', (273, 293), True, 'import numpy as np\n'), ((1028, 1049), 'numpy.asarray', 'np.asarray', (['query_ids'], {}), '(query_ids)\n', (1038, 1049), True, 'import numpy as np\n'), ((1068, 1091), 'numpy.asarray', 'np.asarray', ([... |
from guillotina.db.transaction import Transaction
from guillotina.tests import mocks
from guillotina.tests import utils
from guillotina.transactions import managed_transaction
async def test_no_tid_created_for_reads(dummy_request, loop):
dummy_request._db_write_enabled = False
tm = mocks.MockTransactionManage... | [
"guillotina.db.transaction.Transaction",
"guillotina.tests.utils.get_mocked_request",
"guillotina.tests.utils.get_root",
"guillotina.transactions.managed_transaction",
"guillotina.tests.mocks.MockTransactionManager"
] | [((293, 323), 'guillotina.tests.mocks.MockTransactionManager', 'mocks.MockTransactionManager', ([], {}), '()\n', (321, 323), False, 'from guillotina.tests import mocks\n'), ((335, 376), 'guillotina.db.transaction.Transaction', 'Transaction', (['tm', 'dummy_request'], {'loop': 'loop'}), '(tm, dummy_request, loop=loop)\n... |
from pyspark.sql import functions as F
from optimus.helpers.filters import dict_filter
from optimus.helpers.constants import RELATIVE_ERROR
class MAD:
"""
Handle outliers using mad
"""
def __init__(self, df, col_name, threshold, relative_error=RELATIVE_ERROR):
"""
:param df:
... | [
"pyspark.sql.functions.col"
] | [((1094, 1109), 'pyspark.sql.functions.col', 'F.col', (['col_name'], {}), '(col_name)\n', (1099, 1109), True, 'from pyspark.sql import functions as F\n'), ((1128, 1143), 'pyspark.sql.functions.col', 'F.col', (['col_name'], {}), '(col_name)\n', (1133, 1143), True, 'from pyspark.sql import functions as F\n'), ((1444, 145... |
__all__ = ['BaseController']
import json
from pyramid.renderers import render
from pyramid.view import view_config
from horus.views import BaseController
@view_config(http_cache=(0, {'must-revalidate': True}),
renderer='templates/embed.txt', route_name='embed')
def embed(request, standalone=True):
... | [
"pyramid.view.view_config"
] | [((160, 271), 'pyramid.view.view_config', 'view_config', ([], {'http_cache': "(0, {'must-revalidate': True})", 'renderer': '"""templates/embed.txt"""', 'route_name': '"""embed"""'}), "(http_cache=(0, {'must-revalidate': True}), renderer=\n 'templates/embed.txt', route_name='embed')\n", (171, 271), False, 'from pyram... |
from django.contrib import admin
from django.shortcuts import redirect
from django.urls import path, register_converter
from guardian.admin import GuardedModelAdmin
from thaliedje.converters import PlayerConverter
from thaliedje.admin_views import (
SpofityAuthorizeView,
SpotifyTokenView,
SpotifyAuthorizeS... | [
"thaliedje.admin_views.SpotifyTokenView.as_view",
"thaliedje.admin_views.SpotifyAuthorizeSucceededView.as_view",
"django.contrib.admin.register",
"django.shortcuts.redirect",
"django.urls.register_converter",
"thaliedje.admin_views.SpofityAuthorizeView.as_view"
] | [((401, 423), 'django.contrib.admin.register', 'admin.register', (['Player'], {}), '(Player)\n', (415, 423), False, 'from django.contrib import admin\n'), ((1260, 1287), 'django.shortcuts.redirect', 'redirect', (['"""admin:authorize"""'], {}), "('admin:authorize')\n", (1268, 1287), False, 'from django.shortcuts import ... |
from __future__ import print_function, absolute_import
from timeit import default_timer as time
import numpy as np
import numpy.core.umath_tests as ut
from numba import void, float32, float64
from numba import guvectorize
from numba import cuda
from numba import unittest_support as unittest
from numba.cuda.testing i... | [
"numba.unittest_support.main",
"numba.cuda.device_array",
"numpy.tile",
"numpy.allclose",
"timeit.default_timer",
"numpy.testing.assert_allclose",
"numpy.zeros_like",
"numba.cuda.stream",
"numba.cuda.to_device",
"numba.void",
"numpy.core.umath_tests.matrix_multiply",
"numba.cuda.testing.skip_o... | [((393, 450), 'numba.cuda.testing.skip_on_cudasim', 'skip_on_cudasim', (['"""ufunc API unsupported in the simulator"""'], {}), "('ufunc API unsupported in the simulator')\n", (408, 450), False, 'from numba.cuda.testing import skip_on_cudasim\n'), ((10766, 10781), 'numba.unittest_support.main', 'unittest.main', ([], {})... |
#!/usr/bin/env python
"""
Usage:
$ python rebuild-deploy-branch.py icds-staging [-v] [--no-push] [fetch] [sync] [rebuild]
See docs/commcare-cloud/deploy-branches.md
"""
from __future__ import print_function
from gevent import monkey
monkey.patch_all()
import os
import re
from contextlib2 import ExitStack
import gev... | [
"contextlib2.ExitStack",
"gevent.joinall",
"gitutils.get_git",
"os.path.exists",
"sh_verbose.ShVerbose",
"gitutils.has_merge_conflict",
"gevent.monkey.patch_all",
"argparse.ArgumentParser",
"gitutils.OriginalBranch",
"sh.mv",
"gitutils.print_merge_details",
"re.match",
"uuid.uuid4",
"sh.te... | [((235, 253), 'gevent.monkey.patch_all', 'monkey.patch_all', ([], {}), '()\n', (251, 253), False, 'from gevent import monkey\n'), ((571, 598), 'jsonobject.StringProperty', 'jsonobject.StringProperty', ([], {}), '()\n', (596, 598), False, 'import jsonobject\n'), ((610, 637), 'jsonobject.StringProperty', 'jsonobject.Stri... |
"""
This module provides the Scan Op
See scan.py for details on scan
"""
from __future__ import print_function
__docformat__ = 'restructedtext en'
__authors__ = ("<NAME> "
"<NAME> "
"<NAME> "
"<NAME> ")
__copyright__ = "(c) 2010, Universite de Montreal"
__contact__ = "<NAM... | [
"logging.getLogger",
"numpy.int8",
"theano.shared",
"numpy.int64",
"theano.function",
"theano.tensor.opt.Shape_i",
"theano.compile.profilemode.ProfileMode",
"numpy.asarray",
"theano.compile.mode.get_mode",
"theano.gof.Apply",
"six.moves.xrange",
"theano.compat.izip",
"theano.gof.graph.is_sam... | [((686, 733), 'logging.getLogger', 'logging.getLogger', (['"""theano.scan_module.scan_op"""'], {}), "('theano.scan_module.scan_op')\n", (703, 733), False, 'import logging\n'), ((1729, 1761), 'theano.compile.mode.get_mode', 'compile.mode.get_mode', (['self.mode'], {}), '(self.mode)\n', (1750, 1761), False, 'from theano ... |
import os
import sys
from setuptools import setup, find_packages
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
requirements = ['boto3', 'botocore', 'Pillow==9.0.1', 'PyPDF2==1.26.0']
if sys.argv[-1] == 'publish-test':
os.system(f"cd {os.path.dirname(__file__)}")
os... | [
"os.path.dirname",
"os.system",
"setuptools.find_packages",
"sys.exit"
] | [((318, 405), 'os.system', 'os.system', (['"""rm -rf dist/ build/ amazon_textract_pipeline_pagedimensions.egg-info/"""'], {}), "(\n 'rm -rf dist/ build/ amazon_textract_pipeline_pagedimensions.egg-info/')\n", (327, 405), False, 'import os\n'), ((405, 451), 'os.system', 'os.system', (['"""python setup.py sdist bdist_... |
"""
A viewlet is not allowed to define its own render method and have a template
associated with it at the same time.
>>> grok.testing.grok(__name__)
Traceback (most recent call last):
...
zope.configuration.config.ConfigurationExecutionError: martian.error.GrokError: Multiple possible ways to render viewlet... | [
"grok.context",
"grok.viewletmanager",
"grok.name"
] | [((569, 585), 'grok.name', 'grok.name', (['"""foo"""'], {}), "('foo')\n", (578, 585), False, 'import grok\n'), ((590, 613), 'grok.context', 'grok.context', (['Interface'], {}), '(Interface)\n', (602, 613), False, 'import grok\n'), ((649, 684), 'grok.viewletmanager', 'grok.viewletmanager', (['ViewletManager'], {}), '(Vi... |
# Copyright 2020 The Oppia 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 ... | [
"os.listdir",
"core.utils.open_file",
"re.compile",
"os.path.join",
"core.utils.compute_list_difference",
"os.getcwd",
"re.search"
] | [((1322, 1333), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (1331, 1333), False, 'import os\n'), ((1470, 1481), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (1479, 1481), False, 'import os\n'), ((1961, 1998), 're.compile', 're.compile', (['"""--suite="([a-zA-Z_-]*)\\""""'], {}), '(\'--suite="([a-zA-Z_-]*)"\')\n', (1971,... |
#
# Hello World client in Python
# Connects REQ socket to tcp://localhost:5555
# Sends "Hello" to server, expects "World" back
#
import zmq
import cv2
import json
import numpy as np
from zeromq.SerializingContext import SerializingContext
print("Connecting to hello world server…")
context = SerializingContext()... | [
"cv2.flip",
"numpy.ascontiguousarray",
"cv2.VideoCapture",
"cv2.cvtColor",
"cv2.resize",
"cv2.waitKey",
"zeromq.SerializingContext.SerializingContext"
] | [((300, 320), 'zeromq.SerializingContext.SerializingContext', 'SerializingContext', ([], {}), '()\n', (318, 320), False, 'from zeromq.SerializingContext import SerializingContext\n'), ((756, 775), 'cv2.VideoCapture', 'cv2.VideoCapture', (['(0)'], {}), '(0)\n', (772, 775), False, 'import cv2\n'), ((841, 879), 'cv2.cvtCo... |
import os
from userlixo.config import langs
from userlixo.database import Config
from pyrogram import Client, filters
# Getting the language to use
@Client.on_callback_query(group=-2)
async def deflang(c, cq):
cq._lang = langs.get_language(os.getenv('LANGUAGE')) | [
"pyrogram.Client.on_callback_query",
"os.getenv"
] | [((150, 184), 'pyrogram.Client.on_callback_query', 'Client.on_callback_query', ([], {'group': '(-2)'}), '(group=-2)\n', (174, 184), False, 'from pyrogram import Client, filters\n'), ((245, 266), 'os.getenv', 'os.getenv', (['"""LANGUAGE"""'], {}), "('LANGUAGE')\n", (254, 266), False, 'import os\n')] |
from __future__ import print_function, division
import sys,os
qspin_path = os.path.join(os.getcwd(),"../")
sys.path.insert(0,qspin_path)
from quspin.basis import spinless_fermion_basis_1d
from quspin.basis import spinless_fermion_basis_general
import numpy as np
from itertools import product
def check_ME(b1,b2,opstr... | [
"sys.path.insert",
"quspin.basis.spinless_fermion_basis_1d",
"numpy.testing.assert_allclose",
"itertools.product",
"os.getcwd",
"quspin.basis.spinless_fermion_basis_general"
] | [((108, 138), 'sys.path.insert', 'sys.path.insert', (['(0)', 'qspin_path'], {}), '(0, qspin_path)\n', (123, 138), False, 'import sys, os\n'), ((89, 100), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (98, 100), False, 'import sys, os\n'), ((1373, 1403), 'itertools.product', 'product', (['Nfs', 'kblocks', 'pblocks'], {}),... |
"""
Mask, padding and batching.
"""
import numpy as np
def pad_batch_data(insts,
pad_idx=0,
return_pos=False,
return_input_mask=False,
return_max_len=False,
return_num_token=False,
return_seq_lens=False)... | [
"numpy.expand_dims"
] | [((1371, 1411), 'numpy.expand_dims', 'np.expand_dims', (['input_mask_data'], {'axis': '(-1)'}), '(input_mask_data, axis=-1)\n', (1385, 1411), True, 'import numpy as np\n')] |
#!/usr/bin/env python
"""Tests for grr.lib.bigquery."""
import json
import os
import tempfile
import time
from googleapiclient import errors
import mock
from grr import config
from grr.lib import flags
from grr.lib import rdfvalue
from grr.server import bigquery
from grr.test_lib import test_lib
class BigQueryCli... | [
"grr.lib.flags.StartMain",
"grr.server.bigquery.GetBigQueryClient",
"grr.test_lib.test_lib.main",
"mock.Mock",
"grr.lib.rdfvalue.RDFDatetime.Now",
"os.path.join",
"grr.server.bigquery.BigQueryClient",
"mock.patch.object",
"googleapiclient.errors.HttpError",
"tempfile.NamedTemporaryFile",
"mock.c... | [((472, 528), 'mock.patch.object', 'mock.patch.object', (['bigquery', '"""ServiceAccountCredentials"""'], {}), "(bigquery, 'ServiceAccountCredentials')\n", (489, 528), False, 'import mock\n'), ((532, 578), 'mock.patch.object', 'mock.patch.object', (['bigquery.discovery', '"""build"""'], {}), "(bigquery.discovery, 'buil... |
# Copyright 2021 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | [
"absl.app.UsageError",
"numpy.sqrt",
"absl.flags.DEFINE_float",
"sklearn.datasets.load_boston",
"absl.app.run",
"numpy.dot",
"jax.numpy.dot",
"jaxopt.proximal_gradient2.ProximalGradient",
"sklearn.preprocessing.Normalizer",
"numpy.abs",
"numpy.vdot",
"numpy.sign",
"time.time",
"absl.flags.... | [((1023, 1095), 'absl.flags.DEFINE_string', 'flags.DEFINE_string', (['"""dataset"""'], {'default': '"""boston"""', 'help': '"""Dataset to use."""'}), "('dataset', default='boston', help='Dataset to use.')\n", (1042, 1095), False, 'from absl import flags\n'), ((1098, 1174), 'absl.flags.DEFINE_bool', 'flags.DEFINE_bool',... |
# coding=utf-8
# Copyright (c) 2020, NVIDIA CORPORATION. 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 re... | [
"torch.nn.Dropout",
"apex.transformer.parallel_state.get_pipeline_model_parallel_world_size",
"math.sqrt",
"apex.transformer.tensor_parallel.ColumnParallelLinear",
"nemo.collections.nlp.modules.common.megatron.fused_bias_gelu.fused_bias_gelu",
"nemo.collections.nlp.modules.common.megatron.fused_bias_dropo... | [((2526, 2713), 'apex.transformer.tensor_parallel.ColumnParallelLinear', 'tensor_parallel.ColumnParallelLinear', (['hidden_size', 'ffn_hidden_size'], {'gather_output': '(False)', 'init_method': 'init_method', 'skip_bias_add': '(True)', 'use_cpu_initialization': 'use_cpu_initialization'}), '(hidden_size, ffn_hidden_size... |
"""Unit test for KNX 2 and 4 byte float objects."""
import math
import struct
from unittest.mock import patch
import pytest
from xknx.dpt import (
DPT2ByteFloat,
DPT4ByteFloat,
DPTElectricCurrent,
DPTElectricPotential,
DPTEnthalpy,
DPTFrequency,
DPTHumidity,
DPTLux,
DPTPartsPerMill... | [
"xknx.dpt.DPTLux.to_knx",
"struct.error",
"xknx.dpt.DPT2ByteFloat.to_knx",
"xknx.dpt.DPTTemperature.from_knx",
"xknx.dpt.DPTTemperature.to_knx",
"xknx.dpt.DPT4ByteFloat.from_knx",
"xknx.dpt.DPTHumidity.to_knx",
"pytest.raises",
"unittest.mock.patch",
"xknx.dpt.DPT4ByteFloat.to_knx",
"xknx.dpt.DP... | [((784, 811), 'xknx.dpt.DPT2ByteFloat.to_knx', 'DPT2ByteFloat.to_knx', (['(-30.0)'], {}), '(-30.0)\n', (804, 811), False, 'from xknx.dpt import DPT2ByteFloat, DPT4ByteFloat, DPTElectricCurrent, DPTElectricPotential, DPTEnthalpy, DPTFrequency, DPTHumidity, DPTLux, DPTPartsPerMillion, DPTPhaseAngleDeg, DPTPower, DPTTempe... |
# coding=utf-8
# Copyright 2019 Google LLC.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed ... | [
"tensorflow.gfile.Open",
"task_adaptation.data.base.make_get_tensors_fn",
"task_adaptation.registry.Registry.register",
"tensorflow.constant",
"tensorflow.contrib.lookup.index_table_from_tensor",
"json.load",
"tensorflow_datasets.builder"
] | [((1163, 1207), 'task_adaptation.registry.Registry.register', 'Registry.register', (['"""data.imagenet"""', '"""object"""'], {}), "('data.imagenet', 'object')\n", (1180, 1207), False, 'from task_adaptation.registry import Registry\n'), ((2905, 2961), 'task_adaptation.registry.Registry.register', 'Registry.register', ([... |
import boto3
import json
import os
def parse_rule_violations(rule_violations):
rule_violations_text = ''
for rule in rule_violations:
bot_message = rule.get('Bot message')
del rule['Bot message']
rule_violations_text = ''.join([rule_violations_text,json.dumps(rule).replace('"', '').rep... | [
"json.dumps",
"boto3.client",
"os.getenv"
] | [((604, 632), 'os.getenv', 'os.getenv', (['"""OUTPUT_TYPE"""', '""""""'], {}), "('OUTPUT_TYPE', '')\n", (613, 632), False, 'import os\n'), ((725, 744), 'boto3.client', 'boto3.client', (['"""sns"""'], {}), "('sns')\n", (737, 744), False, 'import boto3\n'), ((900, 923), 'json.dumps', 'json.dumps', (['text_output'], {}), ... |
# Generated by Django 3.2.4 on 2021-07-07 21:06
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('simpleApi', '0004_alter_gradeable_submission_datetime'),
]
operations = [
migrations.AlterField(
model_name='gradeable',
... | [
"django.db.models.DateTimeField"
] | [((368, 411), 'django.db.models.DateTimeField', 'models.DateTimeField', ([], {'blank': '(True)', 'null': '(True)'}), '(blank=True, null=True)\n', (388, 411), False, 'from django.db import migrations, models\n')] |
# -*- coding: utf-8 -*-
# mypy: ignore-errors
import jax.numpy as jnp
import numpy as np
import tinygp
def check_noise_model(noise, dense_rep):
random = np.random.default_rng(6675)
np.testing.assert_allclose(noise.diagonal(), jnp.diag(dense_rep))
np.testing.assert_allclose(noise + np.zeros_like(dense_r... | [
"tinygp.noise.Diagonal",
"numpy.random.default_rng",
"tinygp.noise.Dense",
"numpy.triu_indices",
"numpy.testing.assert_allclose",
"numpy.zeros_like",
"numpy.diag",
"numpy.zeros",
"tinygp.noise.Banded",
"numpy.tril_indices",
"numpy.arange",
"jax.numpy.diag"
] | [((161, 188), 'numpy.random.default_rng', 'np.random.default_rng', (['(6675)'], {}), '(6675)\n', (182, 188), True, 'import numpy as np\n'), ((386, 440), 'numpy.testing.assert_allclose', 'np.testing.assert_allclose', (['(noise + y1)', '(dense_rep + y1)'], {}), '(noise + y1, dense_rep + y1)\n', (412, 440), True, 'import ... |