code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
import copy
import ipaddress
import json
import logging
from tests.common.errors import RunAnsibleModuleFail
from tests.common.devices.sonic import SonicHost
from tests.common.devices.sonic_asic import SonicAsic
from tests.common.helpers.assertions import pytest_assert
from tests.common.helpers.constants import DEFAUL... | [
"logging.getLogger",
"tests.common.devices.sonic_asic.SonicAsic",
"copy.deepcopy",
"tests.common.devices.sonic.SonicHost"
] | [((359, 386), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (376, 386), False, 'import logging\n'), ((1162, 1196), 'tests.common.devices.sonic.SonicHost', 'SonicHost', (['ansible_adhoc', 'hostname'], {}), '(ansible_adhoc, hostname)\n', (1171, 1196), False, 'from tests.common.devices.soni... |
#
# Copyright 2014 Hewlett-Packard Development Company, L.P.
#
# SPDX-License-Identifier: Apache-2.0
import ast
import re
import bandit
from bandit.core import cwemap
from bandit.core import test_properties as test
# yuck, regex: starts with a windows drive letter (eg C:)
# or one of our path delimeter characters (/... | [
"re.compile",
"bandit.core.test_properties.checks",
"bandit.core.test_properties.test_id",
"bandit.core.test_properties.takes_config",
"bandit.Issue"
] | [((346, 393), 're.compile', 're.compile', (['"""^(?:[A-Za-z](?=\\\\:)|[\\\\\\\\\\\\/\\\\.])"""'], {}), "('^(?:[A-Za-z](?=\\\\:)|[\\\\\\\\\\\\/\\\\.])')\n", (356, 393), False, 'import re\n'), ((2919, 2955), 'bandit.core.test_properties.takes_config', 'test.takes_config', (['"""shell_injection"""'], {}), "('shell_injecti... |
import requests
import argparse
# Initialize the PyTorch REST API endpoint URL.
PyTorch_REST_API_URL = 'http://127.0.0.1:5000/predict'
def predict_result(image_path):
# Initialize image path
image = open(image_path, 'rb').read()
payload = {'image': image}
# Submit the request.
r = requests.post(... | [
"requests.post",
"argparse.ArgumentParser"
] | [((418, 476), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Classification demo"""'}), "(description='Classification demo')\n", (441, 476), False, 'import argparse\n'), ((306, 356), 'requests.post', 'requests.post', (['PyTorch_REST_API_URL'], {'files': 'payload'}), '(PyTorch_REST_API_UR... |
"""datenerfassung URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.2/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-base... | [
"django.contrib.auth.models.Permission.objects.all",
"django.conf.urls.url",
"rest_framework.routers.DefaultRouter",
"django.contrib.auth.models.Group.objects.all",
"django.contrib.auth.models.ContentType.objects.all",
"django.contrib.auth.views.LogoutView.as_view",
"guardian.models.GroupObjectPermissio... | [((5656, 5679), 'rest_framework.routers.DefaultRouter', 'routers.DefaultRouter', ([], {}), '()\n', (5677, 5679), False, 'from rest_framework import routers, serializers, viewsets\n'), ((1194, 1290), 'rest_framework.serializers.HyperlinkedIdentityField', 'serializers.HyperlinkedIdentityField', ([], {'view_name': '"""per... |
# Copyright 2019 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",
"tensorflow.keras.layers.Input",
"tensorflow.keras.initializers.RandomNormal",
"official.nlp.modeling.models.xlnet.XLNetSpanLabeler.from_config",
"absl.testing.parameterized.parameters",
"tensorflow.test.main",
"numpy.random.randint",
"official.nlp.modeling.models.xlnet.XL... | [((3133, 3163), 'absl.testing.parameterized.parameters', 'parameterized.parameters', (['(1)', '(2)'], {}), '(1, 2)\n', (3157, 3163), False, 'from absl.testing import parameterized\n'), ((5357, 5387), 'absl.testing.parameterized.parameters', 'parameterized.parameters', (['(1)', '(2)'], {}), '(1, 2)\n', (5381, 5387), Fal... |
import h5py
import torch
import torch.utils.data as Data
class MyDataSet(Data.Dataset):
def __init__(self, h5py_path):
data_file = h5py.File(h5py_path, 'r')
self.data = torch.from_numpy(data_file['data'].value)
self.nSamples = self.data.size(0)
self.label = torch.ones((self.nSample... | [
"torch.ones",
"torch.from_numpy",
"h5py.File"
] | [((145, 170), 'h5py.File', 'h5py.File', (['h5py_path', '"""r"""'], {}), "(h5py_path, 'r')\n", (154, 170), False, 'import h5py\n'), ((191, 232), 'torch.from_numpy', 'torch.from_numpy', (["data_file['data'].value"], {}), "(data_file['data'].value)\n", (207, 232), False, 'import torch\n'), ((296, 326), 'torch.ones', 'torc... |
# Copyright 2020, <NAME>, mailto:<EMAIL>
#
# Part of "Nuitka", an optimizing Python compiler that is compatible and
# integrates with CPython, but also works on its own.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the Lice... | [
"nuitka.Options.shallMakeModule"
] | [((3922, 3947), 'nuitka.Options.shallMakeModule', 'Options.shallMakeModule', ([], {}), '()\n', (3945, 3947), False, 'from nuitka import Options\n'), ((4085, 4110), 'nuitka.Options.shallMakeModule', 'Options.shallMakeModule', ([], {}), '()\n', (4108, 4110), False, 'from nuitka import Options\n'), ((4503, 4528), 'nuitka.... |
from . import AbstractPlayer
import vlc
class VLCPlayer(AbstractPlayer):
def __init__(self):
self.player = vlc.MediaPlayer()
self.program = None
def open(self, program):
self.player.set_mrl(program.media.path)
def play(self):
self.player.play()
def stop(self):
... | [
"vlc.MediaPlayer"
] | [((120, 137), 'vlc.MediaPlayer', 'vlc.MediaPlayer', ([], {}), '()\n', (135, 137), False, 'import vlc\n')] |
# -*- coding: utf-8 -*-
# Copyright (c) 2016-2020 by University of Kassel and Fraunhofer Institute for Energy Economics
# and Energy System Technology (IEE), Kassel. All rights reserved.
import numpy as np
import pytest
import pandapower as pp
import pandapower.shortcircuit as sc
@pytest.fixture
def w... | [
"pandapower.create_sgen",
"numpy.isclose",
"numpy.sqrt",
"pandapower.create_ext_grid",
"pandapower.create_empty_network",
"pandapower.create_line_from_parameters",
"pandapower.shortcircuit.calc_sc",
"pytest.main",
"numpy.array",
"pandapower.create_line",
"pandapower.create_bus"
] | [((351, 376), 'pandapower.create_empty_network', 'pp.create_empty_network', ([], {}), '()\n', (374, 376), True, 'import pandapower as pp\n'), ((387, 427), 'pandapower.create_bus', 'pp.create_bus', (['net'], {'vn_kv': '(110.0)', 'index': '(1)'}), '(net, vn_kv=110.0, index=1)\n', (400, 427), True, 'import pandapower as p... |
from typing import Dict, Generator, Tuple, Optional, Union
import pandas as pd
import torch
import torchtext
from .torch_data import toTensor, TorchDataSet, TorchDataSetProvider
class TorchtextDataSetFromDataFrame(torchtext.data.Dataset):
"""
A specialisation of torchtext.data.Dataset, where the ... | [
"torchtext.data.Example"
] | [((1214, 1238), 'torchtext.data.Example', 'torchtext.data.Example', ([], {}), '()\n', (1236, 1238), False, 'import torchtext\n')] |
# Copyright (c) Microsoft. All rights reserved.
# Licensed under the MIT license. See LICENSE file in the project root for
# full license information.
import pytest
import msrest
from timeouts import timeouts
from horton_settings import settings
import limitations
pytestmark = pytest.mark.asyncio
@pytest.mark.descr... | [
"pytest.mark.describe",
"limitations.skip_if_no_system_control",
"pytest.param",
"pytest.raises",
"pytest.mark.timeout",
"pytest.mark.it"
] | [((303, 358), 'pytest.mark.describe', 'pytest.mark.describe', (['"""Network Disconnection Mechanism"""'], {}), "('Network Disconnection Mechanism')\n", (323, 358), False, 'import pytest\n'), ((493, 543), 'pytest.mark.timeout', 'pytest.mark.timeout', (['timeouts.generic_test_timeout'], {}), '(timeouts.generic_test_timeo... |
import numpy as np
import os
from PIL import Image, ImageDraw
from tqdm import tqdm
from Detection.AdvancedEAST import cfg
from Detection.AdvancedEAST.preprocess import preprocess_single_image,preprocess_no_cfg
def point_inside_of_quad(px, py, quad_xy_list, p_min, p_max):
if (p_min[0] <= px <= p_max[0]) and (p_min... | [
"numpy.abs",
"numpy.copy",
"numpy.reshape",
"numpy.amin",
"numpy.minimum",
"numpy.sin",
"os.path.join",
"numpy.square",
"numpy.zeros",
"PIL.ImageDraw.Draw",
"numpy.sign",
"numpy.concatenate",
"numpy.cos",
"numpy.maximum",
"Detection.AdvancedEAST.preprocess.preprocess_no_cfg",
"numpy.am... | [((1814, 1857), 'numpy.concatenate', 'np.concatenate', (['(diff_1to3, diff_4)'], {'axis': '(0)'}), '((diff_1to3, diff_4), axis=0)\n', (1828, 1857), True, 'import numpy as np\n'), ((2186, 2198), 'numpy.abs', 'np.abs', (['diff'], {}), '(diff)\n', (2192, 2198), True, 'import numpy as np\n'), ((2245, 2287), 'numpy.arctan',... |
from pandac.PandaModules import *
from direct.showbase.PythonUtil import weightedChoice, randFloat, lerp
from direct.showbase.PythonUtil import contains, list2dict, clampScalar
from direct.directnotify import DirectNotifyGlobal
from direct.distributed import DistributedSmoothNodeAI
from direct.distributed import Distri... | [
"toontown.ai.ServerEventBuffer.ServerEventMultiAccumulator",
"PetMoverAI.PetMoverAI",
"toontown.pets.PetObserve.getEventName",
"toontown.pets.PetLookerAI.PetLookerAI.__init__",
"toontown.pets.PetTraits.PetTraits",
"toontown.pets.PetBrain.PetBrain",
"direct.distributed.DistributedSmoothNodeAI.Distributed... | [((1142, 1205), 'direct.directnotify.DirectNotifyGlobal.directNotify.newCategory', 'DirectNotifyGlobal.directNotify.newCategory', (['"""DistributedPetAI"""'], {}), "('DistributedPetAI')\n", (1185, 1205), False, 'from direct.directnotify import DirectNotifyGlobal\n'), ((1602, 1669), 'direct.distributed.DistributedSmooth... |
# Copyright 2020 Cortex Labs, 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 wri... | [
"yaml.safe_load",
"yaml.dump",
"copy.deepcopy"
] | [((3960, 3987), 'copy.deepcopy', 'deepcopy', (['default_nodegroup'], {}), '(default_nodegroup)\n', (3968, 3987), False, 'from copy import deepcopy\n'), ((4342, 4369), 'copy.deepcopy', 'deepcopy', (['default_nodegroup'], {}), '(default_nodegroup)\n', (4350, 4369), False, 'from copy import deepcopy\n'), ((3916, 3933), 'y... |
from django import template
from django.utils.http import urlquote
from endpoint_monitor.models import EndpointTest
from linda_app.lists import CATEGORIES
from linda_app.models import Vocabulary, VocabularyClass, VocabularyProperty, get_configuration, \
datasource_from_endpoint
register = template.Library()
# Loa... | [
"linda_app.models.get_configuration",
"django.utils.http.urlquote",
"linda_app.models.datasource_from_endpoint",
"django.template.Library",
"endpoint_monitor.models.EndpointTest.objects.filter"
] | [((295, 313), 'django.template.Library', 'template.Library', ([], {}), '()\n', (311, 313), False, 'from django import template\n'), ((358, 377), 'linda_app.models.get_configuration', 'get_configuration', ([], {}), '()\n', (375, 377), False, 'from linda_app.models import Vocabulary, VocabularyClass, VocabularyProperty, ... |
import shlex
def split(s):
if '"' not in s:
return s.split(' ')
try:
return list(shlex.split(s))
except ValueError:
pass | [
"shlex.split"
] | [((106, 120), 'shlex.split', 'shlex.split', (['s'], {}), '(s)\n', (117, 120), False, 'import shlex\n')] |
from django.urls import path
from .import views
from django.conf import settings
from django.conf.urls.static import static
urlpatterns = [
path('login_user/', views.login_user, name ='login'),
path('', views.home, name='home'),
path('logout/', views.logoutUser, name='logout' ),
path('new/project', ... | [
"django.conf.urls.static.static",
"django.urls.path"
] | [((147, 198), 'django.urls.path', 'path', (['"""login_user/"""', 'views.login_user'], {'name': '"""login"""'}), "('login_user/', views.login_user, name='login')\n", (151, 198), False, 'from django.urls import path\n'), ((206, 239), 'django.urls.path', 'path', (['""""""', 'views.home'], {'name': '"""home"""'}), "('', vi... |
# Generated by Django 3.2.6 on 2021-08-07 15:05
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUT... | [
"django.db.models.FloatField",
"django.db.models.UniqueConstraint",
"django.db.models.IntegerField",
"django.db.models.ForeignKey",
"django.db.models.BooleanField",
"django.db.models.AutoField",
"django.db.models.DateTimeField",
"django.db.migrations.swappable_dependency",
"django.db.models.CharFiel... | [((276, 333), 'django.db.migrations.swappable_dependency', 'migrations.swappable_dependency', (['settings.AUTH_USER_MODEL'], {}), '(settings.AUTH_USER_MODEL)\n', (307, 333), False, 'from django.db import migrations, models\n'), ((4581, 4656), 'django.db.models.UniqueConstraint', 'models.UniqueConstraint', ([], {'fields... |
import os
from django.test import TestCase
from cyder.base.eav.models import Attribute
from cyder.base.utils import copy_tree, remove_dir_contents
from cyder.base.vcs import GitRepo, GitRepoManager, SanityCheckFailure
from cyder.core.ctnr.models import Ctnr
from cyder.core.system.models import System
from cyder.cydh... | [
"cyder.base.vcs.GitRepoManager",
"cyder.cydhcp.build.builder.DHCPBuilder",
"cyder.base.eav.models.Attribute.objects.get",
"os.makedirs",
"cyder.base.utils.remove_dir_contents",
"cyder.cydhcp.network.models.Network.objects.get",
"cyder.core.system.models.System.objects.get",
"cyder.cydhcp.interface.dyn... | [((1432, 1474), 'cyder.base.utils.remove_dir_contents', 'remove_dir_contents', (["DHCPBUILD['prod_dir']"], {}), "(DHCPBUILD['prod_dir'])\n", (1451, 1474), False, 'from cyder.base.utils import copy_tree, remove_dir_contents\n'), ((1572, 1608), 'cyder.base.utils.remove_dir_contents', 'remove_dir_contents', (['PROD_ORIGIN... |
import os
NAME='xslt'
CFLAGS = os.popen('xslt-config --cflags').read().rstrip().split()
LDFLAGS = []
LIBS = os.popen('xslt-config --libs').read().rstrip().split()
GCC_LIST = ['xslt']
| [
"os.popen"
] | [((32, 64), 'os.popen', 'os.popen', (['"""xslt-config --cflags"""'], {}), "('xslt-config --cflags')\n", (40, 64), False, 'import os\n'), ((109, 139), 'os.popen', 'os.popen', (['"""xslt-config --libs"""'], {}), "('xslt-config --libs')\n", (117, 139), False, 'import os\n')] |
#!/usr/bin/python3 -B
# Copyright 2018-2020 <NAME>. 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 requir... | [
"subprocess.check_output",
"os.path.exists",
"subprocess.check_call",
"pathlib.Path",
"os.getuid",
"time.strftime",
"os.chmod",
"shutil.copy"
] | [((1029, 1065), 'time.strftime', 'time.strftime', (['""".orig-%Y%m%d-%H%M%S"""'], {}), "('.orig-%Y%m%d-%H%M%S')\n", (1042, 1065), False, 'import time\n'), ((1127, 1177), 'subprocess.check_call', 'subprocess.check_call', (['*args'], {'shell': '(True)'}), '(*args, shell=True, **kwargs)\n', (1148, 1177), False, 'import su... |
'''
========
pdfutils
========
- identification (is valid pdf, number of pages),
- manipulation (barcode stamp)
- conversion (to PDF/A, to text)
- creation (from html)
'''
import os
import subprocess, logging
from binascii import hexlify
from tempfile import TemporaryFile, NamedTemporaryFile
from django.conf import ... | [
"logging.getLogger",
"django.utils.encoding.smart_bytes",
"subprocess.check_call",
"subprocess.Popen",
"subprocess.CalledProcessError",
"os.path.join",
"tempfile.NamedTemporaryFile",
"tempfile.TemporaryFile",
"ecs.users.utils.get_current_user",
"django.template.loader.render_to_string"
] | [((421, 448), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (438, 448), False, 'import subprocess, logging\n'), ((2381, 2396), 'tempfile.TemporaryFile', 'TemporaryFile', ([], {}), '()\n', (2394, 2396), False, 'from tempfile import TemporaryFile, NamedTemporaryFile\n'), ((2409, 2524), 'su... |
# -*- coding: utf-8 -*-
#
# <NAME> <<EMAIL>>
# parasim
# (c) 1998-2022 all rights reserved
#
# the package
import hello
# declaration
class Greet(hello.command, family='hello.cli.greet'):
"""
This is the base class for command that greet my friends
N.B.: This command is not directly usable since it doe... | [
"hello.ext.libhello.alec",
"hello.ext.libhello.mac",
"hello.ext.libhello.mat",
"hello.export",
"hello.ext.libhello.ally"
] | [((409, 439), 'hello.export', 'hello.export', ([], {'tip': '"""greet Alec"""'}), "(tip='greet Alec')\n", (421, 439), False, 'import hello\n'), ((711, 741), 'hello.export', 'hello.export', ([], {'tip': '"""greet Ally"""'}), "(tip='greet Ally')\n", (723, 741), False, 'import hello\n'), ((1013, 1042), 'hello.export', 'hel... |
# imports - module imports
from ccapi.model import Model, BooleanModel, InternalComponent
def test_boolean_model(client):
model = Model(client = client, name = 'Cortical Area Development')
bool_ = BooleanModel()
Coup_fti = InternalComponent('Coup_fti')
Sp8 = InternalComponent('Sp8')
... | [
"ccapi.model.BooleanModel",
"ccapi.model.InternalComponent",
"ccapi.model.Model"
] | [((138, 192), 'ccapi.model.Model', 'Model', ([], {'client': 'client', 'name': '"""Cortical Area Development"""'}), "(client=client, name='Cortical Area Development')\n", (143, 192), False, 'from ccapi.model import Model, BooleanModel, InternalComponent\n'), ((212, 226), 'ccapi.model.BooleanModel', 'BooleanModel', ([], ... |
# python3
# coding=<UTF-8>
import os
import re
from lxml.etree import parse, HTMLParser
from urllib.request import quote
from ..params_container import Container
from ..target import Target
from ..exceptions import EmptyPageException
__author__ = 'akv17'
__doc__ = \
"""
National Corpus of Russian
=====... | [
"lxml.etree.HTMLParser",
"urllib.request.quote",
"time.sleep"
] | [((8861, 8889), 'lxml.etree.HTMLParser', 'HTMLParser', ([], {'encoding': '"""utf-8"""'}), "(encoding='utf-8')\n", (8871, 8889), False, 'from lxml.etree import parse, HTMLParser\n'), ((8291, 8308), 'urllib.request.quote', 'quote', (['self.query'], {}), '(self.query)\n', (8296, 8308), False, 'from urllib.request import q... |
# Generated by Django 3.0.5 on 2020-04-30 20:59
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('abstracts', '0050_auto_20200430_1655'),
]
operations = [
migrations.AlterField(
model_name='conference',
name='url',... | [
"django.db.models.URLField"
] | [((339, 481), 'django.db.models.URLField', 'models.URLField', ([], {'blank': '(True)', 'help_text': '"""Public URL for the conference and/or conference program"""', 'max_length': '(500)', 'verbose_name': '"""URL"""'}), "(blank=True, help_text=\n 'Public URL for the conference and/or conference program', max_length=\... |
'''custom colormaps for use with matplotlib scatter and imshow'''
import matplotlib.colors as co
import numpy as np
def name2color(name):
'''
Return the 3-element RGB array of a given color name.
'''
return co.hex2color(co.cnames[name])
def one2another(bottom='white', top='red', alphabottom=1.0, alphatop=1.0, N=2... | [
"numpy.random.normal",
"matplotlib.pyplot.colorbar",
"numpy.linspace",
"numpy.vstack",
"matplotlib.pyplot.scatter",
"matplotlib.colors.hex2color",
"numpy.arange",
"matplotlib.pyplot.show"
] | [((212, 241), 'matplotlib.colors.hex2color', 'co.hex2color', (['co.cnames[name]'], {}), '(co.cnames[name])\n', (224, 241), True, 'import matplotlib.colors as co\n'), ((476, 517), 'numpy.linspace', 'np.linspace', (['rgb_bottom[0]', 'rgb_top[0]', 'N'], {}), '(rgb_bottom[0], rgb_top[0], N)\n', (487, 517), True, 'import nu... |
import datetime as dt
import json
import sys
from get_previous_date import prev_date_getter
def getdates():
dates = [str(dt.datetime.today()).split()[0]]
for i in range(6):
dates.append(prev_date_getter(dates[-1]))
return dates
def get_percent(num, denom):
return (num * 100)//denom
def spi... | [
"json.load",
"datetime.datetime.today",
"get_previous_date.prev_date_getter",
"json.dump"
] | [((780, 797), 'json.load', 'json.load', (['rchart'], {}), '(rchart)\n', (789, 797), False, 'import json\n'), ((896, 929), 'json.dump', 'json.dump', (['data', 'wchart'], {'indent': '(4)'}), '(data, wchart, indent=4)\n', (905, 929), False, 'import json\n'), ((204, 231), 'get_previous_date.prev_date_getter', 'prev_date_ge... |
# -*- coding: utf-8 -*-
# Copyright 2018-2020 Streamlit 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 applicabl... | [
"concurrent.futures.ThreadPoolExecutor",
"time.sleep",
"streamlit.watcher.util.calc_md5_with_blocking_retries",
"os.stat",
"streamlit.logger.get_logger"
] | [((810, 830), 'streamlit.logger.get_logger', 'get_logger', (['__name__'], {}), '(__name__)\n', (820, 830), False, 'from streamlit.logger import get_logger\n'), ((989, 1033), 'concurrent.futures.ThreadPoolExecutor', 'ThreadPoolExecutor', ([], {'max_workers': '_MAX_WORKERS'}), '(max_workers=_MAX_WORKERS)\n', (1007, 1033)... |
from data_load import load_vocab
from hyperparams import Hyperparams as hp
from networks import TextEnc, AudioEnc, AudioDec, Attention, SSRN
import tensorflow as tf
class Graph:
def __init__(self, num=1, mode="train"):
'''
Args:
num: Either 1 or 2. 1 for Text2Mel 2 for SSRN.
m... | [
"tensorflow.variable_scope",
"tensorflow.Variable",
"networks.Attention",
"tensorflow.placeholder",
"networks.SSRN",
"tensorflow.zeros_like",
"networks.TextEnc",
"networks.AudioDec",
"data_load.load_vocab",
"networks.AudioEnc"
] | [((434, 446), 'data_load.load_vocab', 'load_vocab', ([], {}), '()\n', (444, 446), False, 'from data_load import load_vocab\n'), ((732, 776), 'tensorflow.placeholder', 'tf.placeholder', (['tf.int32'], {'shape': '(None, None)'}), '(tf.int32, shape=(None, None))\n', (746, 776), True, 'import tensorflow as tf\n'), ((797, 8... |
from Eucild import Eucild
print(Eucild(120,3))
print(Eucild(3,120))
print(Eucild(0,0))
print(Eucild(-2,-3))
print(Eucild("hello","world")) | [
"Eucild.Eucild"
] | [((35, 49), 'Eucild.Eucild', 'Eucild', (['(120)', '(3)'], {}), '(120, 3)\n', (41, 49), False, 'from Eucild import Eucild\n'), ((57, 71), 'Eucild.Eucild', 'Eucild', (['(3)', '(120)'], {}), '(3, 120)\n', (63, 71), False, 'from Eucild import Eucild\n'), ((79, 91), 'Eucild.Eucild', 'Eucild', (['(0)', '(0)'], {}), '(0, 0)\n... |
from matplotlib.finance import candlestick2_ohlc
import matplotlib.pyplot as plt
import matplotlib.ticker as ticker
import datetime as datetime
import numpy as np
import pandas
rows = 100
ipdata = pandas.read_csv("data/bitcoin_price.csv", parse_dates=['Date'], index_col = 'Date')
ipdata = ipdata[:(rows+1)]
ipdata =... | [
"matplotlib.ticker.FuncFormatter",
"pandas.read_csv",
"matplotlib.ticker.MaxNLocator",
"matplotlib.finance.candlestick2_ohlc",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.show"
] | [((200, 286), 'pandas.read_csv', 'pandas.read_csv', (['"""data/bitcoin_price.csv"""'], {'parse_dates': "['Date']", 'index_col': '"""Date"""'}), "('data/bitcoin_price.csv', parse_dates=['Date'], index_col=\n 'Date')\n", (215, 286), False, 'import pandas\n'), ((345, 359), 'matplotlib.pyplot.subplots', 'plt.subplots', ... |
#!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... | [
"logging.getLogger",
"useradmin.conf.DEFAULT_USER_GROUP.get",
"django.db.models.TextField",
"desktop.monkey_patches.monkey_patch_username_validator",
"django.contrib.auth.models.User.objects.filter",
"desktop.lib.connectors.models._get_installed_connectors",
"django.contrib.auth.models.User.objects.get"... | [((3173, 3199), 'desktop.conf.ENABLE_ORGANIZATIONS.get', 'ENABLE_ORGANIZATIONS.get', ([], {}), '()\n', (3197, 3199), False, 'from desktop.conf import ENABLE_ORGANIZATIONS, ENABLE_CONNECTORS\n'), ((3539, 3566), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (3556, 3566), False, 'import log... |
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | [
"logging.getLogger",
"thrift.transport.TTransport.TTransportException",
"socket.socket",
"thrift.transport.TSocket.TSocket.__init__",
"ssl.SSLContext",
"os.access",
"ssl.wrap_socket",
"thrift.transport.TSocket.TServerSocket.__init__",
"warnings.warn",
"thrift.transport.TSocket.TSocket",
"warning... | [((1032, 1059), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1049, 1059), False, 'import logging\n'), ((1060, 1145), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""default"""'], {'category': 'DeprecationWarning', 'module': '__name__'}), "('default', category=DeprecationWar... |
from os.path import join
import argparse
import numpy as np
import torch
import torch.nn.functional as F
from torch.autograd import Variable
from pt.common.settings import results_path, TRAIN, VAL
from pt.common.utils import (
safe_makedirs, append_log, setup_log)
from pt.common.optimizers import get_optimizer, ... | [
"pt.common.utils.safe_makedirs",
"torch.autograd.Variable",
"argparse.ArgumentParser",
"torch.nn.functional.nll_loss",
"torch.load",
"os.path.join",
"pt.recog.data.factory.get_data_loader",
"torch.cuda.is_available",
"pt.common.utils.setup_log",
"pt.common.utils.append_log",
"numpy.genfromtxt",
... | [((625, 667), 'os.path.join', 'join', (['results_path', 'namespace', 'TRAIN_MODEL'], {}), '(results_path, namespace, TRAIN_MODEL)\n', (629, 667), False, 'from os.path import join\n'), ((690, 726), 'os.path.join', 'join', (['train_model_path', '"""best_model"""'], {}), "(train_model_path, 'best_model')\n", (694, 726), F... |
from sys import argv
import requests
from bs4 import BeautifulSoup
import time
from tqdm import tqdm
def get_title(soup):
title = soup.find('div', {'id': 'News_Body_Title'})
return ''.join(title.strings)
def get_qa_pairs(soup):
news_body = soup.find('div', {'class': 'content'})
body = ''.join(news_b... | [
"bs4.BeautifulSoup",
"tqdm.tqdm",
"time.sleep",
"requests.get"
] | [((596, 614), 'requests.get', 'requests.get', (['page'], {}), '(page)\n', (608, 614), False, 'import requests\n'), ((626, 665), 'bs4.BeautifulSoup', 'BeautifulSoup', (['r.content', '"""html.parser"""'], {}), "(r.content, 'html.parser')\n", (639, 665), False, 'from bs4 import BeautifulSoup\n'), ((1073, 1088), 'tqdm.tqdm... |
"""
SYS-611: Buffon's Needle Experiment Example with Antithetic Variables.
This example performs a Monte Carlo simulation of Buffon's Needle Experiment
to estimate the probability of a needle of certain length crossing lines
on a floor with certain spacing. This probability is proportional to the
mathematical constant... | [
"numpy.random.rand",
"matplotlib.pyplot.ylabel",
"numpy.average",
"matplotlib.pyplot.xlabel",
"scipy.stats.norm.ppf",
"matplotlib.pyplot.figure",
"numpy.random.seed",
"scipy.stats.sem",
"numpy.sin",
"matplotlib.pyplot.legend"
] | [((1920, 1937), 'numpy.random.seed', 'np.random.seed', (['(0)'], {}), '(0)\n', (1934, 1937), True, 'import numpy as np\n'), ((2111, 2151), 'scipy.stats.norm.ppf', 'stats.norm.ppf', (['(1 - confidence_level / 2)'], {}), '(1 - confidence_level / 2)\n', (2125, 2151), True, 'import scipy.stats as stats\n'), ((2681, 2693), ... |
from __future__ import print_function
import argparse
from elasticsearch import Elasticsearch
import elasticsearch.helpers
from solr_to_es.solrSource import SlowSolrDocs
import pysolr
DEFAULT_ES_MAX_RETRIES = 15
DEFAULT_ES_INITIAL_BACKOFF = 3
class SolrEsWrapperIter:
def __init__(self, solr_itr, es_index, es_typ... | [
"solr_to_es.solrSource.SlowSolrDocs",
"elasticsearch.Elasticsearch",
"argparse.ArgumentParser"
] | [((837, 862), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (860, 862), False, 'import argparse\n'), ((3465, 3580), 'solr_to_es.solrSource.SlowSolrDocs', 'SlowSolrDocs', (["args['solr_url']", "args['solr_query']"], {'rows': "args['rows_per_page']", 'fl': 'solr_fields', 'fq': 'solr_filter'}), "... |
##########################################################################################
# Machine Environment Config
DEBUG_MODE = False
USE_CUDA = not DEBUG_MODE
CUDA_DEVICE_NUM = 0
##########################################################################################
# Path Config
import os
import sys... | [
"logging.getLogger",
"utils.utils.create_logger",
"sys.path.insert",
"utils.utils.copy_all_src",
"MOTSPTrainer_3obj.TSPTrainer",
"os.path.abspath"
] | [((378, 402), 'sys.path.insert', 'sys.path.insert', (['(0)', '""".."""'], {}), "(0, '..')\n", (393, 402), False, 'import sys\n'), ((423, 450), 'sys.path.insert', 'sys.path.insert', (['(0)', '"""../.."""'], {}), "(0, '../..')\n", (438, 450), False, 'import sys\n'), ((2412, 2442), 'utils.utils.create_logger', 'create_log... |
# -----------------------------------------------------------------------------
# Copyright (c) 2014--, The Qiita Development Team.
#
# Distributed under the terms of the BSD 3-clause License.
#
# The full license is in the file LICENSE, distributed with this software.
# ------------------------------------------------... | [
"qiita_db.study.Study",
"qiita_pet.handlers.util.to_int"
] | [((811, 827), 'qiita_pet.handlers.util.to_int', 'to_int', (['study_id'], {}), '(study_id)\n', (817, 827), False, 'from qiita_pet.handlers.util import to_int\n'), ((874, 889), 'qiita_db.study.Study', 'Study', (['study_id'], {}), '(study_id)\n', (879, 889), False, 'from qiita_db.study import Study\n')] |
import logging
import aws_lambda_logging
from os import getenv
logger = logging.getLogger()
def setup_logging(event, context):
aws_lambda_logging.setup(
level="DEBUG",
boto_level="CRITICAL",
aws_request_id=context.aws_request_id,
)
logger.debug({"event": event, "context": context.... | [
"logging.getLogger",
"aws_lambda_logging.setup",
"os.getenv"
] | [((73, 92), 'logging.getLogger', 'logging.getLogger', ([], {}), '()\n', (90, 92), False, 'import logging\n'), ((134, 239), 'aws_lambda_logging.setup', 'aws_lambda_logging.setup', ([], {'level': '"""DEBUG"""', 'boto_level': '"""CRITICAL"""', 'aws_request_id': 'context.aws_request_id'}), "(level='DEBUG', boto_level='CRIT... |
import subprocess, re, os, sys, getopt
def delete_created_files(mediapath, slices):
for i in range(slices):
try:
os.remove(name_file(mediapath, i))
except FileNotFoundError as e:
continue
def name_file(mediapath, number):
base, ext = os.path.splitext(mediapath)
nu... | [
"os.path.exists",
"getopt.getopt",
"re.compile",
"subprocess.Popen",
"os.path.splitext",
"sys.exit",
"os.path.abspath"
] | [((286, 313), 'os.path.splitext', 'os.path.splitext', (['mediapath'], {}), '(mediapath)\n', (302, 313), False, 'import subprocess, re, os, sys, getopt\n'), ((475, 512), 're.compile', 're.compile', (['"""([0-9]{2,})x([0-9]{2,})"""'], {}), "('([0-9]{2,})x([0-9]{2,})')\n", (485, 512), False, 'import subprocess, re, os, sy... |
import numpy as np
import scipy.spatial.transform
from moveit_commander.conversions import list_to_pose_stamped
class Rotation(scipy.spatial.transform.Rotation):
@classmethod
def identity(cls):
return cls.from_quat([0.0, 0.0, 0.0, 1.0])
class Transform(object):
def __init__(self, rotation, trans... | [
"numpy.array",
"numpy.zeros",
"numpy.asarray"
] | [((389, 423), 'numpy.asarray', 'np.asarray', (['translation', 'np.double'], {}), '(translation, np.double)\n', (399, 423), True, 'import numpy as np\n'), ((1445, 1470), 'numpy.array', 'np.array', (['[0.0, 0.0, 0.0]'], {}), '([0.0, 0.0, 0.0])\n', (1453, 1470), True, 'import numpy as np\n'), ((1724, 1735), 'numpy.zeros',... |
"""Tests for abstract.py."""
import unittest
from pytype import abstract
from pytype import config
from pytype import errors
from pytype import exceptions
from pytype import function
from pytype import vm
from pytype.pytd import cfg
from pytype.pytd import pytd
import unittest
class FakeFrame(object):
def __in... | [
"pytype.abstract.Union",
"pytype.pytd.pytd.NothingType",
"pytype.abstract.InterpreterClass",
"pytype.pytd.cfg.Program",
"pytype.abstract.PyTDSignature",
"unittest.main",
"pytype.pytd.pytd.ClassType",
"pytype.abstract.get_atomic_value",
"pytype.abstract.Dict",
"pytype.abstract.SimpleAbstractValue",... | [((5258, 5314), 'unittest.skip', 'unittest.skip', (['"""update() does not update the parameters"""'], {}), "('update() does not update the parameters')\n", (5271, 5314), False, 'import unittest\n'), ((22090, 22105), 'unittest.main', 'unittest.main', ([], {}), '()\n', (22103, 22105), False, 'import unittest\n'), ((522, ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
""":Mod: forms
:Synopsis:
:Author:
servilla
:Created:
1/6/19
"""
from flask_wtf import FlaskForm
from wtforms import BooleanField
from wtforms import DateField
from wtforms import SelectField
from wtforms import StringField
from wtforms.validators import DataReq... | [
"wtforms.BooleanField",
"webapp.reports.upload_report_stats.get_scopes",
"wtforms.validators.Optional",
"wtforms.SelectField",
"wtforms.validators.DataRequired"
] | [((632, 644), 'webapp.reports.upload_report_stats.get_scopes', 'get_scopes', ([], {}), '()\n', (642, 644), False, 'from webapp.reports.upload_report_stats import get_scopes\n'), ((743, 800), 'wtforms.SelectField', 'SelectField', (['"""Site Scope"""'], {'choices': 'choices', 'default': '"""edi"""'}), "('Site Scope', cho... |
#!/usr/bin/env python3
# load needed modules
import numpy as np
from keras.models import Sequential
from keras.layers import Dense, Activation, Flatten, Dropout, GRU , BatchNormalization
from sklearn.model_selection import train_test_split
from sklearn.metrics import confusion_matrix
import pandas as pd
imp... | [
"keras.layers.Flatten",
"sklearn.model_selection.train_test_split",
"numpy.asarray",
"keras.models.Sequential",
"numpy.array",
"numpy.around",
"keras.layers.Dense",
"keras.layers.BatchNormalization",
"numpy.load",
"keras.layers.Dropout"
] | [((423, 447), 'numpy.load', 'np.load', (['"""X_egemaps.npy"""'], {}), "('X_egemaps.npy')\n", (430, 447), True, 'import numpy as np\n'), ((452, 476), 'numpy.load', 'np.load', (['"""y_egemaps.npy"""'], {}), "('y_egemaps.npy')\n", (459, 476), True, 'import numpy as np\n'), ((777, 804), 'numpy.array', 'np.array', (['norm_a... |
from boa3.exception import CompilerError, CompilerWarning
from boa3.neo.vm.opcode.Opcode import Opcode
from boa3.neo.vm.type.Integer import Integer
from boa3.neo.vm.type.String import String
from boa3_test.tests.boa_test import BoaTest
from boa3_test.tests.test_classes.testengine import TestEngine
class TestTyping(Bo... | [
"boa3.neo.vm.type.Integer.Integer",
"boa3.neo.vm.type.String.String",
"boa3_test.tests.test_classes.testengine.TestEngine"
] | [((4241, 4253), 'boa3_test.tests.test_classes.testengine.TestEngine', 'TestEngine', ([], {}), '()\n', (4251, 4253), False, 'from boa3_test.tests.test_classes.testengine import TestEngine\n'), ((3243, 3260), 'boa3.neo.vm.type.String.String', 'String', (['"""example"""'], {}), "('example')\n", (3249, 3260), False, 'from ... |
# -*- coding: utf-8 -*-
# --------------------------
# Copyright © 2014 - Qentinel Group.
#
# 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/LIC... | [
"os.getuid"
] | [((877, 888), 'os.getuid', 'os.getuid', ([], {}), '()\n', (886, 888), False, 'import os\n')] |
import numbers
import warnings
import weakref
from enum import Enum
from types import DynamicClassAttribute
from typing import TYPE_CHECKING, Any, Callable, Dict, Iterable, Iterator, List, Optional, Union
from torch.utils.data import DataLoader
from ignite.engine.utils import _check_signature
if TYPE_CHECKING:
f... | [
"ignite.engine.utils._check_signature",
"weakref.ref"
] | [((15747, 15767), 'weakref.ref', 'weakref.ref', (['handler'], {}), '(handler)\n', (15758, 15767), False, 'import weakref\n'), ((15790, 15809), 'weakref.ref', 'weakref.ref', (['engine'], {}), '(engine)\n', (15801, 15809), False, 'import weakref\n'), ((3766, 3831), 'ignite.engine.utils._check_signature', '_check_signatur... |
#!/usr/bin/env python
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "... | [
"random.uniform",
"argparse.ArgumentParser",
"fcntl.flock",
"json.dumps",
"json.load",
"time.time",
"json.dump"
] | [((3960, 3971), 'time.time', 'time.time', ([], {}), '()\n', (3969, 3971), False, 'import time\n'), ((7991, 8019), 'json.dump', 'json.dump', (['state', 'state_file'], {}), '(state, state_file)\n', (8000, 8019), False, 'import json\n'), ((8104, 8129), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n'... |
# Copyright 2021 eprbell
#
# 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, soft... | [
"rp2.logger.create_logger",
"pathlib.Path",
"rp2.computed_data.ComputedData.type_check",
"os.path.dirname",
"typing.cast",
"rp2.rp2_error.RP2TypeError"
] | [((1106, 1136), 'rp2.logger.create_logger', 'create_logger', (['"""tax_report_us"""'], {}), "('tax_report_us')\n", (1119, 1136), False, 'from rp2.logger import create_logger\n'), ((3091, 3196), 'rp2.rp2_error.RP2TypeError', 'RP2TypeError', (['f"""Parameter \'asset_to_computed_data\' has non-Dict value {asset_to_compute... |
# author: leisurexi
# date: 2021-01-16 22:16
import sys
sys.path.append("..")
from proto.mat import Matrix
from utils.mat_mul import mat_mul
a = Matrix([[1, 2], [3, 4]])
b = Matrix([[5, 6], [7, 8]])
print(mat_mul(a, b).data)
| [
"utils.mat_mul.mat_mul",
"proto.mat.Matrix",
"sys.path.append"
] | [((56, 77), 'sys.path.append', 'sys.path.append', (['""".."""'], {}), "('..')\n", (71, 77), False, 'import sys\n'), ((146, 170), 'proto.mat.Matrix', 'Matrix', (['[[1, 2], [3, 4]]'], {}), '([[1, 2], [3, 4]])\n', (152, 170), False, 'from proto.mat import Matrix\n'), ((175, 199), 'proto.mat.Matrix', 'Matrix', (['[[5, 6], ... |
#
# known_testers.py
#
# This source file is part of the FoundationDB open source project
#
# Copyright 2013-2018 Apple Inc. and the FoundationDB project authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy... | [
"os.path.realpath"
] | [((1863, 1889), 'os.path.realpath', 'os.path.realpath', (['__file__'], {}), '(__file__)\n', (1879, 1889), False, 'import os\n')] |
import sys
from collections import OrderedDict
from functools import partial
import torch.nn as nn
from modules import IdentityResidualBlock, GlobalAvgPool2d
from .util import try_index
class ResNeXt(nn.Module):
def __init__(self,
structure,
groups=64,
norm_act... | [
"collections.OrderedDict",
"torch.nn.Conv2d",
"torch.nn.MaxPool2d",
"functools.partial",
"modules.IdentityResidualBlock",
"torch.nn.Linear",
"modules.GlobalAvgPool2d"
] | [((4937, 4963), 'functools.partial', 'partial', (['ResNeXt'], {}), '(ResNeXt, **params)\n', (4944, 4963), False, 'from functools import partial\n'), ((2726, 2745), 'collections.OrderedDict', 'OrderedDict', (['layers'], {}), '(layers)\n', (2737, 2745), False, 'from collections import OrderedDict\n'), ((2123, 2175), 'tor... |
from django.forms.models import ModelForm
from add_blog.models import Blog
from django import forms
class Update_form(ModelForm):
content = forms.CharField(widget=forms.Textarea)
class Meta:
model = Blog
fields = [
"title",
"sub_title",
"... | [
"django.forms.CharField"
] | [((154, 192), 'django.forms.CharField', 'forms.CharField', ([], {'widget': 'forms.Textarea'}), '(widget=forms.Textarea)\n', (169, 192), False, 'from django import forms\n')] |
# ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distrib... | [
"bpy.props.IntProperty",
"bpy.props.BoolProperty",
"bpy.ops.object.particle_system_add",
"bpy.ops.particle.new_target",
"mathutils.Vector",
"bpy.data.pointclouds.new",
"bpy.ops.object.modifier_add",
"bpy.props.FloatProperty",
"bpy.data.objects.new",
"bpy.data.materials.new",
"bpy.props.EnumPrope... | [((1767, 1903), 'bpy.props.EnumProperty', 'EnumProperty', ([], {'name': '"""Fur Density"""', 'items': "(('LIGHT', 'Light', ''), ('MEDIUM', 'Medium', ''), ('HEAVY', 'Heavy', ''))", 'default': '"""MEDIUM"""'}), "(name='Fur Density', items=(('LIGHT', 'Light', ''), ('MEDIUM',\n 'Medium', ''), ('HEAVY', 'Heavy', '')), de... |
"""
MIT License
Copyright (c) 2017 <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, distri... | [
"pyslowloris.SlowLorisAttack",
"pyslowloris.HostAddress.from_url",
"argparse.ArgumentParser",
"sys.exit"
] | [((1194, 1307), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'add_help': '(True)', 'description': '"""Asynchronous Python implementation of SlowLoris attack"""'}), "(add_help=True, description=\n 'Asynchronous Python implementation of SlowLoris attack')\n", (1217, 1307), False, 'import argparse\n'), (... |
import sqlalchemy as sa
from sqlalchemy.ext.compiler import compiles
from sqlalchemy.sql import expression
from sqlalchemy.sql.expression import (
_literal_as_text,
ClauseElement,
Executable
)
class explain(Executable, ClauseElement):
"""
Define EXPLAIN element.
http://www.postgresql.org/docs... | [
"sqlalchemy.sql.expression._literal_as_text",
"sqlalchemy.ext.compiler.compiles"
] | [((969, 1000), 'sqlalchemy.ext.compiler.compiles', 'compiles', (['explain', '"""postgresql"""'], {}), "(explain, 'postgresql')\n", (977, 1000), False, 'from sqlalchemy.ext.compiler import compiles\n'), ((1684, 1703), 'sqlalchemy.ext.compiler.compiles', 'compiles', (['array_get'], {}), '(array_get)\n', (1692, 1703), Fal... |
# --------------
# Importing header files
import numpy as np
# Path of the file has been stored in variable called 'path'
data_file='path' # path for the file
data = np.genfromtxt(path, delimiter=",", skip_header=1,dtype=str)
print("\nData: \n\n", data)
print("\nType of data: \n\n", type(data))
#New re... | [
"numpy.mean",
"numpy.std",
"numpy.asarray",
"numpy.max",
"numpy.concatenate",
"numpy.min",
"numpy.genfromtxt"
] | [((174, 234), 'numpy.genfromtxt', 'np.genfromtxt', (['path'], {'delimiter': '""","""', 'skip_header': '(1)', 'dtype': 'str'}), "(path, delimiter=',', skip_header=1, dtype=str)\n", (187, 234), True, 'import numpy as np\n'), ((418, 460), 'numpy.concatenate', 'np.concatenate', (['(new_record, data)'], {'axis': '(0)'}), '(... |
#! /usr/bin/env python3
from fear_and_greed import cnn
import datetime
import pytz
import unittest.mock
import freezegun
from absl.testing import absltest
from absl.testing import parameterized
# Template for the HTML code used in the unit tests.
html = """<ul><li>Fear & Greed Now: {} ({})</li>....<div id="need... | [
"pytz.timezone",
"freezegun.freeze_time",
"fear_and_greed.cnn.get",
"absl.testing.absltest.main"
] | [((3559, 3594), 'freezegun.freeze_time', 'freezegun.freeze_time', (['"""2020-11-28"""'], {}), "('2020-11-28')\n", (3580, 3594), False, 'import freezegun\n'), ((3780, 3795), 'absl.testing.absltest.main', 'absltest.main', ([], {}), '()\n', (3793, 3795), False, 'from absl.testing import absltest\n'), ((3681, 3710), 'fear_... |
# Walking engine for Starkit Kondo OpenMV
# Copyright STARKIT Soccer team of MIPT
import math
import sys
import time
import numpy as np
class Alpha(object):
def compute_alpha_v3(self, xt,yt,zt,x,y,z,w, sizes, limAlpha):
from math import sqrt,cos,sin,asin,fabs,tan,atan
#t1_start =time.perf_coun... | [
"math.tan",
"numpy.random.choice",
"math.asin",
"math.sqrt",
"math.degrees",
"time.sleep",
"math.radians",
"math.cos",
"numpy.random.randint",
"math.fabs",
"math.atan2",
"numpy.random.uniform",
"math.sin",
"sys.path.append",
"math.atan"
] | [((506, 522), 'math.cos', 'math.cos', (['alpha5'], {}), '(alpha5)\n', (514, 522), False, 'import math\n'), ((538, 554), 'math.sin', 'math.sin', (['alpha5'], {}), '(alpha5)\n', (546, 554), False, 'import math\n'), ((569, 601), 'math.sqrt', 'math.sqrt', (['(x * x + y * y + z * z)'], {}), '(x * x + y * y + z * z)\n', (578... |
import textwrap
from discord.ext import commands, menus
import discord
import orjson
class CryptoMenu(menus.ListPageSource):
def __init__(self, data):
super().__init__(data, per_page=99)
async def format_page(self, menu, entries):
return discord.Embed(
color=discord.Color.blurple... | [
"textwrap.dedent",
"discord.Color.blurple",
"discord.ext.commands.group",
"discord.Colour.blurple",
"orjson.loads"
] | [((545, 577), 'discord.ext.commands.group', 'commands.group', ([], {'aliases': "['coin']"}), "(aliases=['coin'])\n", (559, 577), False, 'from discord.ext import commands, menus\n'), ((1622, 2113), 'textwrap.dedent', 'textwrap.dedent', (['f"""\n ```diff\n Price:\n ${crypto[\'... |
# =============================================================================
# PROJECT CHRONO - http:#projectchrono.org
#
# Copyright (c) 2014 projectchrono.org
# All rights reserved.
#
# Use of this source code is governed by a BSD-style license that can be found
# in the LICENSE file at the top level of the distri... | [
"pychrono.core.ChLinkMotorRotationSpeed",
"pychrono.core.ChLinkMotorLinearPosition",
"pychrono.core.ChColorAsset",
"pychrono.core.Q_from_AngAxis",
"pychrono.core.ChShaftsPlanetary",
"pychrono.irrlicht.SColorf",
"pychrono.core.ChBodyEasyBox",
"pychrono.irrlicht.dimension2du",
"pychrono.core.ChLinkMot... | [((2956, 2976), 'pychrono.core.ChSystemNSC', 'chrono.ChSystemNSC', ([], {}), '()\n', (2974, 2976), True, 'import pychrono.core as chrono\n'), ((3033, 3062), 'pychrono.core.ChMaterialSurfaceNSC', 'chrono.ChMaterialSurfaceNSC', ([], {}), '()\n', (3060, 3062), True, 'import pychrono.core as chrono\n'), ((3163, 3222), 'pyc... |
import FWCore.ParameterSet.Config as cms
process = cms.Process("L1SKIM")
process.load("FWCore.MessageService.MessageLogger_cfi")
process.MessageLogger.cerr.FwkReport.reportEvery = 100000
process.options = cms.untracked.PSet(
wantSummary = cms.untracked.bool(True)
)
#process.load(INPUTFILELIST)
process.source = ... | [
"FWCore.ParameterSet.Config.string",
"FWCore.ParameterSet.Config.double",
"FWCore.ParameterSet.Config.InputTag",
"FWCore.ParameterSet.Config.untracked.int32",
"FWCore.ParameterSet.Config.Process",
"FWCore.ParameterSet.Config.uint32",
"FWCore.ParameterSet.Config.untracked.vstring",
"FWCore.ParameterSet... | [((52, 73), 'FWCore.ParameterSet.Config.Process', 'cms.Process', (['"""L1SKIM"""'], {}), "('L1SKIM')\n", (63, 73), True, 'import FWCore.ParameterSet.Config as cms\n'), ((2880, 2948), 'FWCore.ParameterSet.Config.Path', 'cms.Path', (['(process.primaryVertexFilter * process.isolatedGenParticles)'], {}), '(process.primaryV... |
#!/usr/bin/env python
# -*- coding:utf-8 -*-
# Author: <NAME>(<EMAIL>)
# Class for the Pose Data Loader.
from torch.utils import data
import lib.data.pil_aug_transforms as pil_aug_trans
import lib.data.cv2_aug_transforms as cv2_aug_trans
import lib.data.transforms as trans
from lib.data.collate import collate
from l... | [
"lib.data.transforms.ToTensor",
"lib.data.cv2_aug_transforms.CV2AugCompose",
"lib.data.pil_aug_transforms.PILAugCompose"
] | [((707, 764), 'lib.data.pil_aug_transforms.PILAugCompose', 'pil_aug_trans.PILAugCompose', (['self.configer'], {'split': '"""train"""'}), "(self.configer, split='train')\n", (734, 764), True, 'import lib.data.pil_aug_transforms as pil_aug_trans\n'), ((1158, 1213), 'lib.data.pil_aug_transforms.PILAugCompose', 'pil_aug_tr... |
from flask import Flask, render_template, redirect, url_for, request, send_from_directory, make_response, session, \
jsonify
import pymysql, io, os, time, json
app = Flask(__name__)
app.secret_key = "tracking system"
def graph_data():
db = pymysql.connect("localhost", "pmauser", "aritraroot", "tracker")
... | [
"flask.render_template",
"time.append",
"flask.Flask",
"flask.request.get_data",
"pymysql.connect",
"flask.url_for",
"flask.session.pop",
"flask.jsonify"
] | [((171, 186), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (176, 186), False, 'from flask import Flask, render_template, redirect, url_for, request, send_from_directory, make_response, session, jsonify\n'), ((251, 315), 'pymysql.connect', 'pymysql.connect', (['"""localhost"""', '"""pmauser"""', '"""aritr... |
import re
import pytest
from faker.providers.bank import Provider as BankProvider
from faker.providers.bank.de_CH import Provider as DeChBankProvider
from faker.providers.bank.el_GR import Provider as ElGrBankProvider
from faker.providers.bank.en_GB import Provider as EnGbBankProvider
from faker.providers.bank.en_IE ... | [
"re.fullmatch",
"faker.providers.bank.Provider.ALPHA.get",
"pytest.raises",
"re.compile"
] | [((6038, 6089), 're.compile', 're.compile', (['"""[A-Z]{4}PH[A-Z0-9]{2}(?:[A-Z0-9]{3})?"""'], {}), "('[A-Z]{4}PH[A-Z0-9]{2}(?:[A-Z0-9]{3})?')\n", (6048, 6089), False, 'import re\n'), ((1938, 1977), 're.fullmatch', 're.fullmatch', (['"""\\\\d{2}\\\\d{11}"""', 'iban[2:]'], {}), "('\\\\d{2}\\\\d{11}', iban[2:])\n", (1950,... |
import asyncio
import logging
import logging.config
import signal
import sys
from .config import ReceptorConfig
logger = logging.getLogger(__name__)
def main(args=None):
try:
config = ReceptorConfig(args)
except Exception as e:
logger.error("An error occured while validating the configurati... | [
"logging.getLogger",
"signal.signal",
"logging.config.dictConfig",
"asyncio.Task.all_tasks",
"sys.exit"
] | [((123, 150), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (140, 150), False, 'import logging\n'), ((375, 769), 'logging.config.dictConfig', 'logging.config.dictConfig', (["{'version': 1, 'disable_existing_loggers': False, 'formatters': {'verbose':\n {'format': '{levelname} {asctime}... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('editor', '0013_auto_20150406_1121'),
... | [
"django.db.migrations.swappable_dependency",
"django.db.models.ForeignKey"
] | [((210, 267), 'django.db.migrations.swappable_dependency', 'migrations.swappable_dependency', (['settings.AUTH_USER_MODEL'], {}), '(settings.AUTH_USER_MODEL)\n', (241, 267), False, 'from django.db import models, migrations\n'), ((453, 603), 'django.db.models.ForeignKey', 'models.ForeignKey', ([], {'related_name': '"""c... |
from __future__ import print_function, absolute_import, division
from future.builtins import *
from future import standard_library
standard_library.install_aliases()
import future.utils
from functools import reduce
import fractions
import operator
import os
import re
import sys
import tempfile
from html.parser import... | [
"os.path.exists",
"re.compile",
"os.access",
"os.environ.get",
"os.path.join",
"fractions.Fraction",
"future.standard_library.install_aliases",
"os.path.dirname",
"numpy.zeros",
"os.path.isdir",
"functools.partial",
"tempfile.NamedTemporaryFile",
"sys.stdout.flush",
"os.path.normcase"
] | [((131, 165), 'future.standard_library.install_aliases', 'standard_library.install_aliases', ([], {}), '()\n', (163, 165), False, 'from future import standard_library\n'), ((9231, 9273), 're.compile', 're.compile', (['"""-?\\\\d+(\\\\.\\\\d+)?(e[-+]?\\\\d+)"""'], {}), "('-?\\\\d+(\\\\.\\\\d+)?(e[-+]?\\\\d+)')\n", (9241... |
from buycoins_client import Auth
from buycoins_client import Orders
import unittest
from unittest.mock import patch
class MockResponse:
def __init__(self, json_data, status_code):
self.json_data = json_data
self.status_code = status_code
def json(self):
return self.json_data
class Tes... | [
"buycoins_client.Orders.list_my_orders",
"buycoins_client.Orders.list_market_orders",
"buycoins_client.Auth.setup",
"buycoins_client.Orders.post_limit_order",
"unittest.main",
"buycoins_client.Orders.post_market_order",
"unittest.mock.patch"
] | [((4454, 4499), 'unittest.mock.patch', 'patch', (['"""buycoins_client.Orders.requests.post"""'], {}), "('buycoins_client.Orders.requests.post')\n", (4459, 4499), False, 'from unittest.mock import patch\n'), ((5304, 5349), 'unittest.mock.patch', 'patch', (['"""buycoins_client.Orders.requests.post"""'], {}), "('buycoins_... |
#!/usr/bin/env python3
# Copyright (c) 2017 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test logic for setting nMinimumChainWork on command line.
Nodes don't consider themselves out of "initial b... | [
"test_framework.util.connect_nodes",
"time.sleep"
] | [((2889, 2902), 'time.sleep', 'time.sleep', (['(3)'], {}), '(3)\n', (2899, 2902), False, 'import time\n'), ((1680, 1727), 'test_framework.util.connect_nodes', 'connect_nodes', (['self.nodes[i + 1]', 'self.nodes[i]'], {}), '(self.nodes[i + 1], self.nodes[i])\n', (1693, 1727), False, 'from test_framework.util import asse... |
from selenium import webdriver
import time
driver = webdriver.Firefox()
driver.get("http://localhost:8088/#/index/lexical-analysis")
print(driver.title)
res1 = ['T','=']
res2 = ['a' for i in range(1201)]
texts = driver.find_elements_by_tag_name("textarea")
#text = driver.find_element_by_tag_name("textarea")
texts[0].c... | [
"selenium.webdriver.Firefox",
"time.sleep"
] | [((53, 72), 'selenium.webdriver.Firefox', 'webdriver.Firefox', ([], {}), '()\n', (70, 72), False, 'from selenium import webdriver\n'), ((357, 370), 'time.sleep', 'time.sleep', (['(3)'], {}), '(3)\n', (367, 370), False, 'import time\n')] |
# This file is part of the Data Cleaning Library (openclean).
#
# Copyright (C) 2018-2021 New York University.
#
# openclean is released under the Revised BSD License. See file LICENSE for
# full license details.
"""Collection of string similarity functions."""
from typing import Callable
import jellyfish
from open... | [
"jellyfish.match_rating_comparison"
] | [((5253, 5300), 'jellyfish.match_rating_comparison', 'jellyfish.match_rating_comparison', (['val_1', 'val_2'], {}), '(val_1, val_2)\n', (5286, 5300), False, 'import jellyfish\n')] |
# Copyright 2018 the GPflow authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... | [
"gpflow.config.Config",
"numpy.ones",
"gpflow.utilities.set_trainable",
"tensorflow.ones",
"gpflow.likelihoods.Gaussian",
"gpflow.kernels.SquaredExponential",
"gpflow.utilities.traversal.leaf_components",
"gpflow.Parameter",
"pytest.mark.parametrize",
"numpy.zeros",
"tensorflow.keras.layers.Dens... | [((868, 892), 'numpy.random.RandomState', 'np.random.RandomState', (['(0)'], {}), '(0)\n', (889, 892), True, 'import numpy as np\n'), ((12138, 12196), 'pytest.fixture', 'pytest.fixture', ([], {'params': '[A, B, create_kernel, create_model]'}), '(params=[A, B, create_kernel, create_model])\n', (12152, 12196), False, 'im... |
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/ads/googleads_v3/proto/resources/landing_page_view.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 i... | [
"google.protobuf.symbol_database.Default",
"google.protobuf.descriptor.FieldDescriptor"
] | [((511, 537), 'google.protobuf.symbol_database.Default', '_symbol_database.Default', ([], {}), '()\n', (535, 537), True, 'from google.protobuf import symbol_database as _symbol_database\n'), ((2907, 3305), 'google.protobuf.descriptor.FieldDescriptor', '_descriptor.FieldDescriptor', ([], {'name': '"""unexpanded_final_ur... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
##################################################################################
# jlr_copy_deformer_weights_UI.py - Python Script
##################################################################################
# Description:
# This tool was created to copy the weight... | [
"PySide2.QtWidgets.QListWidgetItem",
"pymel.core.objExists",
"PySide2.QtWidgets.QTreeWidget",
"PySide2.QtWidgets.QGroupBox",
"pymel.core.selected",
"PySide2.QtWidgets.QProgressBar",
"PySide2.QtWidgets.QHBoxLayout",
"PySide2.QtCore.QSize",
"maya.OpenMayaUI.MQtUtil.mainWindow",
"pymel.core.deleteUI"... | [((1039, 1058), 'PySide2.QtWidgets.QDialog', 'QtWidgets.QDialog', ([], {}), '()\n', (1056, 1058), False, 'from PySide2 import QtCore, QtWidgets\n'), ((1186, 1217), 'maya.OpenMayaUI.MQtUtil.mainWindow', 'OpenMayaUI.MQtUtil.mainWindow', ([], {}), '()\n', (1215, 1217), False, 'from maya import OpenMayaUI\n'), ((1612, 1646... |
from fabric import task
from patchwork.transfers import rsync
import os
import os.path as osp
from pathlib import Path
import json
## START EDIT: Edit these values to your profiles
# name of the bimhaw profile used in the bootstrapping process
PHASE1_PROFILE = "scooter"
# name of the bimhaw profile that is the end ... | [
"os.path.expandvars",
"patchwork.transfers.rsync",
"os.getcwd",
"fabric.task"
] | [((2284, 2290), 'fabric.task', 'task', ([], {}), '()\n', (2288, 2290), False, 'from fabric import task\n'), ((2617, 2640), 'os.path.expandvars', 'osp.expandvars', (['"""$HOME"""'], {}), "('$HOME')\n", (2631, 2640), True, 'import os.path as osp\n'), ((2645, 2720), 'patchwork.transfers.rsync', 'rsync', (['cx', 'f"""{home... |
'''
Created on Mon Nov 19 15:17:34 2018
@author: <NAME>
Play audio file or beep from speeker to signal that the script is finished.
'''
import wave
import pyaudio
import pyttsx3
import winsound
def text_to_speech(text):
'''
Tryinng to get text to speech to work
Arguments
text(str): The text we ... | [
"pyttsx3.init",
"wave.open",
"pyaudio.PyAudio",
"winsound.Beep"
] | [((380, 394), 'pyttsx3.init', 'pyttsx3.init', ([], {}), '()\n', (392, 394), False, 'import pyttsx3\n'), ((737, 758), 'wave.open', 'wave.open', (['file', '"""rb"""'], {}), "(file, 'rb')\n", (746, 758), False, 'import wave\n'), ((783, 800), 'pyaudio.PyAudio', 'pyaudio.PyAudio', ([], {}), '()\n', (798, 800), False, 'impor... |
# coding: utf-8
from datetime import datetime
from pyspark import SparkContext, SparkConf
from collections import defaultdict, Counter
from itertools import count
from operator import add
import string
import math
import json
import re
import sys
def timer(start_time=None):
"""Counting processing time
:parame... | [
"re.escape",
"json.loads",
"pyspark.SparkConf",
"math.log",
"datetime.datetime.now",
"itertools.count",
"collections.defaultdict",
"pyspark.SparkContext",
"json.dump"
] | [((1770, 1786), 'collections.defaultdict', 'defaultdict', (['int'], {}), '(int)\n', (1781, 1786), False, 'from collections import defaultdict, Counter\n'), ((3918, 3941), 'pyspark.SparkContext', 'SparkContext', ([], {'conf': 'conf'}), '(conf=conf)\n', (3930, 3941), False, 'from pyspark import SparkContext, SparkConf\n'... |
# unit tests for each of the 3 main modules within berrl
import os
#testing pipegeohash
os.chdir('pipegeohash_test')
execfile('test_pipegeohash.py')
os.chdir('..')
# testing pipegeojson
os.chdir('pipegeojson_test')
execfile('test_pipegeojson.py')
os.chdir('..')
| [
"os.chdir"
] | [((89, 117), 'os.chdir', 'os.chdir', (['"""pipegeohash_test"""'], {}), "('pipegeohash_test')\n", (97, 117), False, 'import os\n'), ((150, 164), 'os.chdir', 'os.chdir', (['""".."""'], {}), "('..')\n", (158, 164), False, 'import os\n'), ((188, 216), 'os.chdir', 'os.chdir', (['"""pipegeojson_test"""'], {}), "('pipegeojson... |
# Copyright 2021 DAI Foundation
#
# 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,... | [
"connectors.sf._write_to_table",
"connectors.sf.sf.execute",
"os.path.join",
"connectors.sf._write_to_stage",
"connectors.sf._clear_stage",
"os.path.realpath",
"os.path.dirname",
"json.load",
"sys.path.append"
] | [((609, 641), 'sys.path.append', 'sys.path.append', (['"""/opt/airflow/"""'], {}), "('/opt/airflow/')\n", (624, 641), False, 'import os, sys\n'), ((938, 965), 'os.path.dirname', 'os.path.dirname', (['currentdir'], {}), '(currentdir)\n', (953, 965), False, 'import os, sys\n'), ((985, 1011), 'os.path.dirname', 'os.path.d... |
from dataclasses import dataclass, field
from datetime import datetime
from typing import (
List,
Optional,
Dict
)
@dataclass(frozen=True)
class Ids:
image_id: Optional[str] = field(default_factory=str)
instance_id: Optional[str] = field(default_factory=str)
reservation_id: Optional[str] = fie... | [
"dataclasses.dataclass",
"dataclasses.field"
] | [((130, 152), 'dataclasses.dataclass', 'dataclass', ([], {'frozen': '(True)'}), '(frozen=True)\n', (139, 152), False, 'from dataclasses import dataclass, field\n'), ((347, 369), 'dataclasses.dataclass', 'dataclass', ([], {'frozen': '(True)'}), '(frozen=True)\n', (356, 369), False, 'from dataclasses import dataclass, fi... |
import random
print("Monty Hall Problem")
print("By <NAME>")
print("AP CSP")
def spotDoor():
#door1
spotChosen = random.randint(0, 2)
doors[0] = spots[spotChosen]
spots.pop(spotChosen)
#door2
spotChosen = random.randint(0,1)
doors[1] = spots[spotChosen]
spots.pop(spotChosen)
#door3
... | [
"random.randint"
] | [((122, 142), 'random.randint', 'random.randint', (['(0)', '(2)'], {}), '(0, 2)\n', (136, 142), False, 'import random\n'), ((230, 250), 'random.randint', 'random.randint', (['(0)', '(1)'], {}), '(0, 1)\n', (244, 250), False, 'import random\n'), ((948, 968), 'random.randint', 'random.randint', (['(0)', '(2)'], {}), '(0,... |
import os
import types
import cherrypy
import jinja2
import config
from .model.sqlitehandler import SiteHandler
site_db = SiteHandler()
class TemplateTool(cherrypy.Tool):
_engine = None
"""jinja environment instance"""
def __init__(self):
# print(config.path)
viewloader = jinja2.File... | [
"cherrypy.session.get",
"jinja2.Environment",
"os.path.join",
"cherrypy.config.update",
"cherrypy.request.config.get",
"cherrypy.Tool.__call__",
"cherrypy.Tool.__init__",
"cherrypy.HTTPRedirect"
] | [((4018, 4055), 'cherrypy.config.update', 'cherrypy.config.update', (['config.config'], {}), '(config.config)\n', (4040, 4055), False, 'import cherrypy\n'), ((406, 443), 'jinja2.Environment', 'jinja2.Environment', ([], {'loader': 'viewloader'}), '(loader=viewloader)\n', (424, 443), False, 'import jinja2\n'), ((453, 512... |
# -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community
Edition) available.
Copyright (C) 2017-2019 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in co... | [
"itertools.product",
"django.utils.translation.ugettext_lazy",
"djcelery.setup_loader"
] | [((1366, 1376), 'django.utils.translation.ugettext_lazy', '_', (['u"""标准运维"""'], {}), "(u'标准运维')\n", (1367, 1376), True, 'from django.utils.translation import ugettext_lazy as _\n'), ((4988, 5011), 'djcelery.setup_loader', 'djcelery.setup_loader', ([], {}), '()\n', (5009, 5011), False, 'import djcelery\n'), ((6705, 674... |
# uncompyle6 version 3.7.4
# Python bytecode 3.7 (3394)
# Decompiled from: Python 3.7.9 (tags/v3.7.9:13c94747c7, Aug 17 2020, 18:58:18) [MSC v.1900 64 bit (AMD64)]
# Embedded file name: T:\InGame\Gameplay\Scripts\Server\situations\visiting\ungreeted_player_visiting_npc_situation.py
# Compiled at: 2016-09-08 04:20:41
# ... | [
"build_buy.unregister_build_buy_exit_callback",
"sims4.tuning.instances.lock_instance_tunables",
"build_buy.unregister_build_buy_enter_callback",
"build_buy.register_build_buy_enter_callback",
"build_buy.register_build_buy_exit_callback",
"situations.situation_complex.SituationStateData",
"situations.ba... | [((3952, 4175), 'sims4.tuning.instances.lock_instance_tunables', 'lock_instance_tunables', (['UngreetedPlayerVisitingNPCSituation'], {'exclusivity': 'situations.bouncer.bouncer_types.BouncerExclusivityCategory.UNGREETED', 'creation_ui_option': 'SituationCreationUIOption.NOT_AVAILABLE', 'duration': '(0)'}), '(UngreetedP... |
"""
This module is used to call Quantum Espresso simulation and parse its output
The user need to supply a complete input script with single-point scf
calculation, CELL_PARAMETERS, ATOMIC_POSITIONS, nat, ATOMIC_SPECIES
arguments. It is case sensitive. and the nat line should be the first
argument of the line it appear... | [
"flare.struc.get_unique_species",
"numpy.array",
"subprocess.call",
"flare.struc.Structure",
"numpy.shape",
"numpy.fromstring",
"os.remove"
] | [((1834, 1856), 'os.remove', 'os.remove', (['newfilename'], {}), '(newfilename)\n', (1843, 1856), False, 'import os\n'), ((3069, 3097), 'subprocess.call', 'call', (['qe_command'], {'shell': '(True)'}), '(qe_command, shell=True)\n', (3073, 3097), False, 'from subprocess import call\n'), ((4437, 4451), 'numpy.array', 'np... |
import pgzrun
import random
TITLE = "Stella Rossa"
FONT_COLOR = (255,255,255)
WIDTH = 800
HEIGHT = 600
CENTRO_X = WIDTH / 2
CENTRO_Y = HEIGHT / 2
CENTRO = (CENTRO_X, CENTRO_Y)
LIVELLO_FINALE = 8
VEL_INIZIALE = 10
COLORI_STELLA = ["blu","verde","arancione","porpora","gialla"]
game_over = False
game_completato = False... | [
"random.choice",
"random.shuffle",
"pgzrun.go"
] | [((4762, 4773), 'pgzrun.go', 'pgzrun.go', ([], {}), '()\n', (4771, 4773), False, 'import pgzrun\n'), ((2689, 2723), 'random.shuffle', 'random.shuffle', (['stelle_da_mostrare'], {}), '(stelle_da_mostrare)\n', (2703, 2723), False, 'import random\n'), ((1835, 1863), 'random.choice', 'random.choice', (['COLORI_STELLA'], {}... |
# Generated by Django 3.2.7 on 2021-10-03 15:25
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('supplies_request', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='suppliesrequest',
name='prov... | [
"django.db.models.CharField"
] | [((345, 403), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(255)', 'verbose_name': '"""Proveedor"""'}), "(max_length=255, verbose_name='Proveedor')\n", (361, 403), False, 'from django.db import migrations, models\n')] |
import numpy as np
import random
from collections import defaultdict
class Agent:
def __init__(self, nA=6 ):
""" Initialize agent.
Params
======
- nA: number of actions available to the agent
"""
self.nA = nA
self.Q = defaultdict(lambda: np.zeros(self.nA))
... | [
"random.uniform",
"numpy.ones",
"numpy.random.choice",
"numpy.argmax",
"numpy.max",
"numpy.dot",
"numpy.zeros"
] | [((1831, 1866), 'numpy.dot', 'np.dot', (['self.Q[next_state]', 'p_probs'], {}), '(self.Q[next_state], p_probs)\n', (1837, 1866), True, 'import numpy as np\n'), ((907, 931), 'numpy.argmax', 'np.argmax', (['self.Q[state]'], {}), '(self.Q[state])\n', (916, 931), True, 'import numpy as np\n'), ((967, 992), 'numpy.random.ch... |
"""
Tests for Series cumulative operations.
See also
--------
tests.frame.test_cumulative
"""
from itertools import product
import numpy as np
import pytest
import pandas as pd
from pandas import _is_numpy_dev
import pandas._testing as tm
def _check_accum_op(name, series, check_dtype=True):
f... | [
"pandas.Series",
"pandas._testing.assert_series_equal",
"pandas.to_timedelta",
"pytest.mark.xfail",
"itertools.product",
"pytest.mark.parametrize",
"pandas._testing.assert_numpy_array_equal",
"numpy.array",
"pandas.to_datetime"
] | [((621, 692), 'pandas._testing.assert_numpy_array_equal', 'tm.assert_numpy_array_equal', (['result.values', 'expected'], {'check_dtype': '(False)'}), '(result.values, expected, check_dtype=False)\n', (648, 692), True, 'import pandas._testing as tm\n'), ((935, 1046), 'pytest.mark.xfail', 'pytest.mark.xfail', (['_is_nump... |
# !/usr/bin/python
# -*- coding: utf-8 -*-
# @time : 2020/5/12 22:46
# @author : Mo
# @function: DGCNN(Dilate Gated Convolutional Neural Network, 即"膨胀门卷积神经网络", IDCNN + CRF)
# @url : Multi-Scale Context Aggregation by Dilated Convolutions(https://arxiv.org/abs/1511.07122)
from bert4keras.layers import Conditio... | [
"bert4keras.layers.ConditionalRandomField",
"macadam.L.Dense",
"macadam.L.Concatenate",
"macadam.M.Model",
"macadam.L.GRU",
"macadam.K.eval",
"macadam.L.Dropout"
] | [((3634, 3663), 'macadam.M.Model', 'M.Model', (['inputs', 'self.outputs'], {}), '(inputs, self.outputs)\n', (3641, 3663), False, 'from macadam import keras, K, O, C, L, M\n'), ((2510, 2532), 'macadam.L.Concatenate', 'L.Concatenate', ([], {'axis': '(-1)'}), '(axis=-1)\n', (2523, 2532), False, 'from macadam import keras,... |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | [
"io.BytesIO",
"numpy.array",
"pyarrow.feather.write_feather",
"pandas.date_range",
"pandas.util.testing.assert_frame_equal",
"os.remove",
"os.path.exists",
"numpy.arange",
"pytest.mark.xfail",
"pyarrow.lib.FeatherWriter",
"pandas.Categorical",
"numpy.random.seed",
"pytest.mark.skipif",
"pa... | [((11435, 11508), 'pytest.mark.xfail', 'pytest.mark.xfail', ([], {'reason': '"""not supported ATM"""', 'raises': 'NotImplementedError'}), "(reason='not supported ATM', raises=NotImplementedError)\n", (11452, 11508), False, 'import pytest\n'), ((12366, 12471), 'pytest.mark.skipif', 'pytest.mark.skipif', (['(not os.path.... |
import symbl
file = "<file_path>"
''' like this you can pass the parameter
params = {
'name': "Meeting",
'enableSpeakerDiarization': "true",
"diarizationSpeakerCount": "2",
"channelMetadata": [
{
"channel": 1,
"speaker": {
"name": "<NAME>"... | [
"symbl.Audio.process_file"
] | [((686, 726), 'symbl.Audio.process_file', 'symbl.Audio.process_file', ([], {'file_path': 'file'}), '(file_path=file)\n', (710, 726), False, 'import symbl\n')] |
"""Templates for PLynx Resources and utils."""
from collections import namedtuple
from typing import Dict
from plynx.constants import NodeResources
PreviewObject = namedtuple('PreviewObject', ['fp', 'resource_id'])
def _force_decode(byte_array):
try:
return byte_array.decode("utf-8")
except UnicodeD... | [
"collections.namedtuple"
] | [((166, 216), 'collections.namedtuple', 'namedtuple', (['"""PreviewObject"""', "['fp', 'resource_id']"], {}), "('PreviewObject', ['fp', 'resource_id'])\n", (176, 216), False, 'from collections import namedtuple\n')] |
#!/usr/bin/env python3
# Copyright (c) 2014-2020 The Ludirium Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test descendant package tracking carve-out allowing one final transaction in
an otherwise-full pack... | [
"test_framework.util.chain_transaction",
"decimal.Decimal",
"test_framework.util.assert_raises_rpc_error"
] | [((1205, 1222), 'decimal.Decimal', 'Decimal', (['"""0.0002"""'], {}), "('0.0002')\n", (1212, 1222), False, 'from decimal import Decimal\n'), ((1782, 1884), 'test_framework.util.chain_transaction', 'chain_transaction', (['self.nodes[0]', "[utxo[1]['txid']]", "[utxo[1]['vout']]", "utxo[1]['amount']", 'fee', '(1)'], {}), ... |
# coding: utf-8
from __future__ import unicode_literals, print_function, division, absolute_import
import os
import unittest
from django.core.urlresolvers import reverse
from onadata.apps.main.views import clone_xlsform
from onadata.apps.logger.models import XForm
from .test_base import TestBase
class TestFormGalle... | [
"onadata.apps.logger.models.XForm.objects.count",
"os.path.join",
"django.core.urlresolvers.reverse"
] | [((486, 549), 'django.core.urlresolvers.reverse', 'reverse', (['clone_xlsform'], {'kwargs': "{'username': self.user.username}"}), "(clone_xlsform, kwargs={'username': self.user.username})\n", (493, 549), False, 'from django.core.urlresolvers import reverse\n'), ((637, 658), 'onadata.apps.logger.models.XForm.objects.cou... |
# Generated by Django 2.2.3 on 2019-07-05 14:54
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('user', '0003_auto_20190704_1547'),
]
operations = [
migrations.RenameField(
model_name='user',
old_name='birth_mohth... | [
"django.db.migrations.RenameField",
"django.db.models.CharField",
"django.db.models.IntegerField"
] | [((232, 326), 'django.db.migrations.RenameField', 'migrations.RenameField', ([], {'model_name': '"""user"""', 'old_name': '"""birth_mohth"""', 'new_name': '"""birth_month"""'}), "(model_name='user', old_name='birth_mohth', new_name=\n 'birth_month')\n", (254, 326), False, 'from django.db import migrations, models\n'... |
# Copyright 2018-2021 Xanadu Quantum Technologies Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or... | [
"functools.lru_cache",
"pennylane.math.shape",
"pennylane.PauliRot",
"pennylane.tape.QuantumTape"
] | [((791, 812), 'functools.lru_cache', 'functools.lru_cache', ([], {}), '()\n', (810, 812), False, 'import functools\n'), ((2786, 2809), 'pennylane.math.shape', 'qml.math.shape', (['weights'], {}), '(weights)\n', (2800, 2809), True, 'import pennylane as qml\n'), ((3169, 3191), 'pennylane.tape.QuantumTape', 'qml.tape.Quan... |