code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
from django import template
register = template.Library()
@register.simple_tag(name='round')
def roundValue(value, arg, key=None):
if isinstance(value, float):
return round(value, arg)
elif isinstance(value, dict) and key == "speed":
point = 0
for x in (value[key]):
point ... | [
"django.template.Library"
] | [((40, 58), 'django.template.Library', 'template.Library', ([], {}), '()\n', (56, 58), False, 'from django import template\n')] |
from flask import Flask, send_file, request
import os
app = Flask(__name__)
@app.route("/downloads")
def baixar_arquivo():
arquivo = request.args.get('arquivo')
caminho = os.path.join(app.root_path, 'arquivos', arquivo)
print(f"Abrindo o arquivo {caminho}.")
try:
return send_file(caminho)
... | [
"flask.request.args.get",
"flask.send_file",
"os.path.join",
"flask.Flask"
] | [((61, 76), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (66, 76), False, 'from flask import Flask, send_file, request\n'), ((139, 166), 'flask.request.args.get', 'request.args.get', (['"""arquivo"""'], {}), "('arquivo')\n", (155, 166), False, 'from flask import Flask, send_file, request\n'), ((181, 229)... |
from django.shortcuts import get_object_or_404
from django.views.generic import RedirectView
from common.models import Allegation, AllegationCategory
from common.utils.mobile_url_hash_util import MobileUrlHashUtil
from share.models import Session
from url_mediator.services.session_builder import Builder, AllegationCri... | [
"url_mediator.services.session_builder.AllegationCrid",
"share.models.Session",
"django.shortcuts.get_object_or_404",
"common.utils.mobile_url_hash_util.MobileUrlHashUtil",
"url_mediator.services.session_builder.AllegationType"
] | [((487, 527), 'django.shortcuts.get_object_or_404', 'get_object_or_404', (['Allegation'], {'crid': 'crid'}), '(Allegation, crid=crid)\n', (504, 527), False, 'from django.shortcuts import get_object_or_404\n'), ((601, 649), 'django.shortcuts.get_object_or_404', 'get_object_or_404', (['AllegationCategory'], {'pk': 'cat_i... |
# -*- coding: utf-8 -*-
"""
Created on Thu Mar 28 09:29:03 2019
@author: Philip
"""
from GNewsAnalysis.utils import editionMap, topicMap, langMap, orderMap
import requests
from tqdm import tqdm
from bs4 import BeautifulSoup
import pandas as pd
from newspaper import Article
import matplotlib.pyplot as plt
... | [
"matplotlib.pyplot.imshow",
"matplotlib.pyplot.title",
"tqdm.tqdm",
"os.path.join",
"requests.get",
"os.path.split",
"bs4.BeautifulSoup",
"wordcloud.WordCloud",
"matplotlib.pyplot.figure",
"jieba.set_dictionary",
"newspaper.Article",
"pandas.DataFrame",
"matplotlib.pyplot.axis",
"jieba.ana... | [((1541, 1564), 'os.path.split', 'os.path.split', (['__file__'], {}), '(__file__)\n', (1554, 1564), False, 'import os\n'), ((1590, 1677), 'os.path.join', 'os.path.join', (['this_dir', '"""font"""', '"""NotoSerifCJKtc-hinted"""', '"""NotoSerifCJKtc-Black.otf"""'], {}), "(this_dir, 'font', 'NotoSerifCJKtc-hinted',\n '... |
# Generated by Django 2.2 on 2019-06-07 18:05
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
opera... | [
"django.db.models.TextField",
"django.db.models.IntegerField",
"django.db.models.ForeignKey",
"django.db.models.ManyToManyField",
"django.db.models.AutoField",
"django.db.migrations.swappable_dependency",
"django.db.models.CharField"
] | [((245, 302), 'django.db.migrations.swappable_dependency', 'migrations.swappable_dependency', (['settings.AUTH_USER_MODEL'], {}), '(settings.AUTH_USER_MODEL)\n', (276, 302), False, 'from django.db import migrations, models\n'), ((437, 530), 'django.db.models.AutoField', 'models.AutoField', ([], {'auto_created': '(True)... |
__classification__ = 'UNCLASSIFIED'
__author__ = "<NAME>"
import os
def get_schema_path(the_urn):
"""
Gets the path to the proper schema file for the given urn.
Parameters
----------
the_urn : str
Returns
-------
str
"""
the_directory = os.path.split(__file__)[0]
if the... | [
"os.path.join",
"os.path.split"
] | [((283, 306), 'os.path.split', 'os.path.split', (['__file__'], {}), '(__file__)\n', (296, 306), False, 'import os\n'), ((361, 437), 'os.path.join', 'os.path.join', (['the_directory', '"""version1"""', '"""SIDD_schema_V1.0.0_2011_08_31.xsd"""'], {}), "(the_directory, 'version1', 'SIDD_schema_V1.0.0_2011_08_31.xsd')\n", ... |
import os
import json
import shutil
import threading
from datetime import datetime, timedelta
from mnc.common import LWATime, synchronize_time
from mnc.mcs import MonitorPoint, CommandCallbackBase, Client
from reductions import *
from filewriter import DRXWriter, HDF5Writer, MeasurementSetWriter
__all__ = ['PowerBea... | [
"mnc.common.synchronize_time",
"mnc.common.LWATime.now",
"os.path.join",
"threading.Event",
"mnc.common.LWATime",
"os.path.isdir",
"os.unlink",
"shutil.rmtree",
"os.path.getmtime",
"datetime.timedelta",
"mnc.mcs.CommandCallbackBase",
"mnc.mcs.Client"
] | [((1321, 1365), 'mnc.mcs.CommandCallbackBase', 'CommandCallbackBase', (['processor.client.client'], {}), '(processor.client.client)\n', (1340, 1365), False, 'from mnc.mcs import MonitorPoint, CommandCallbackBase, Client\n'), ((4874, 4898), 'mnc.common.synchronize_time', 'synchronize_time', (['server'], {}), '(server)\n... |
from time import sleep
class Usuario:
"""Essa classe tenta representar um simples perfil de usuário."""
def __init__(
self, p_nome: str, u_nome: str, nome_de_usuario: str,
email: str, localidade: str, idade: int, sexo: str):
"""
-> Inicializa os atributos da classe con... | [
"time.sleep"
] | [((3083, 3091), 'time.sleep', 'sleep', (['(2)'], {}), '(2)\n', (3088, 3091), False, 'from time import sleep\n'), ((3307, 3315), 'time.sleep', 'sleep', (['(2)'], {}), '(2)\n', (3312, 3315), False, 'from time import sleep\n'), ((3389, 3397), 'time.sleep', 'sleep', (['(2)'], {}), '(2)\n', (3394, 3397), False, 'from time i... |
from gym.envs.registration import register
register(
id="Pusher-v1",
entry_point="micoenv.mico_robot_env:MicoEnv",
kwargs={
"randomize_arm": True,
"randomize_camera": True,
"randomize_textures": True,
"randomize_objects": True,
"normal_textures": True,
"done_a... | [
"gym.envs.registration.register"
] | [((43, 395), 'gym.envs.registration.register', 'register', ([], {'id': '"""Pusher-v1"""', 'entry_point': '"""micoenv.mico_robot_env:MicoEnv"""', 'kwargs': "{'randomize_arm': True, 'randomize_camera': True, 'randomize_textures': \n True, 'randomize_objects': True, 'normal_textures': True, 'done_after':\n 300, 'tar... |
from setuptools import setup, find_packages
import os, sys
with open("README.md", "r") as fh:
long_description = fh.read()
setup(
name='antiope',
version=os.popen('{} antiope/_version.py'.format(sys.executable)).read().rstrip(),
author='<NAME>',
author_email='<EMAIL>',
license="Apache License 2.0",
li... | [
"setuptools.find_packages"
] | [((537, 552), 'setuptools.find_packages', 'find_packages', ([], {}), '()\n', (550, 552), False, 'from setuptools import setup, find_packages\n')] |
from django.contrib import admin
from .models import Address, Book, Author, Country
class BookAdmin(admin.ModelAdmin):
prepopulated_fields = {"slug": ("title",)}
list_filter = ("author", "is_bestseller", "rating")
list_display = ("title", "author", "is_bestseller", "rating")
class AuthorAdmin(admin.Mode... | [
"django.contrib.admin.site.register"
] | [((377, 413), 'django.contrib.admin.site.register', 'admin.site.register', (['Book', 'BookAdmin'], {}), '(Book, BookAdmin)\n', (396, 413), False, 'from django.contrib import admin\n'), ((414, 454), 'django.contrib.admin.site.register', 'admin.site.register', (['Author', 'AuthorAdmin'], {}), '(Author, AuthorAdmin)\n', (... |
import numpy as np
import sys, os, json, argparse, glob, itertools, pickle
from typing import List
from dataclasses import dataclass
import matplotlib.pyplot as plt
import matplotlib.cm as cm
from mpl_toolkits.axes_grid1 import make_axes_locatable
from scipy.interpolate import griddata
from scipy.interpolate import I... | [
"numpy.log10",
"scipy.interpolate.interp1d",
"os.path.exists",
"os.listdir",
"argparse.ArgumentParser",
"matplotlib.pyplot.close",
"os.path.isdir",
"mpl_toolkits.axes_grid1.make_axes_locatable",
"matplotlib.pyplot.gca",
"pickle.load",
"h5py.File",
"os.path.isfile",
"matplotlib.pyplot.cm.get_... | [((1018, 1027), 'matplotlib.pyplot.gca', 'plt.gca', ([], {}), '()\n', (1025, 1027), True, 'import matplotlib.pyplot as plt\n'), ((1804, 1849), 'numpy.loadtxt', 'np.loadtxt', (['inputf'], {'delimiter': '""","""', 'skiprows': '(1)'}), "(inputf, delimiter=',', skiprows=1)\n", (1814, 1849), True, 'import numpy as np\n'), (... |
import unittest
import wamptest
from autobahn.wamp.exception import ApplicationError
class MainLifecycleTests(unittest.TestCase):
class ExampleTestCase(wamptest.TestCase):
_setup_class_count = 0
_setup_count = 0
_teardown_count = 0
_teardown_class_count = 0
# TEST OVERRI... | [
"wamptest.main",
"autobahn.wamp.exception.ApplicationError"
] | [((1245, 1371), 'wamptest.main', 'wamptest.main', ([], {'test_cases': '[self.ExampleTestCase, self.ExampleTestCase]', 'url': 'u"""test"""', 'realm': 'u"""test"""', 'quiet': '(True)', 'test': '(True)'}), "(test_cases=[self.ExampleTestCase, self.ExampleTestCase], url=\n u'test', realm=u'test', quiet=True, test=True)\n... |
#!/usr/bin/env python3
# Copyright (c) 2017 <NAME>. All rights reserved
# coding=utf-8
# -*- coding: utf8 -*-
"""
SpectrumClass is a class to store the spectrum information, i.e. the ralation between
wavelength and intensity.
The constructor of this calss includes two necessities and one option
... | [
"pandas.Series",
"Help.myNumericalIntegration.myNumericalIntegration",
"os.path.dirname",
"numpy.array",
"doctest.testmod",
"os.path.abspath",
"numpy.transpose",
"sys.path.append"
] | [((3750, 3779), 'os.path.dirname', 'os.path.dirname', (['MaterialPath'], {}), '(MaterialPath)\n', (3765, 3779), False, 'import os\n'), ((3712, 3737), 'os.path.abspath', 'os.path.abspath', (['__file__'], {}), '(__file__)\n', (3727, 3737), False, 'import os\n'), ((3814, 3838), 'sys.path.append', 'sys.path.append', (['src... |
#-------------------------------------------------------------------------------
# SokolShader.py
#
# Fips code-generator script for invoking sokol-shdc during the build.
#
# Use the cmake macro 'sokol_shader([glsl-file] [shader-dialects])' inside a
# fips target (fips_begin_* / fips_end_*) to hook the code-gen... | [
"platform.system",
"subprocess.call",
"genutil.isDirty",
"os.path.abspath",
"os.uname"
] | [((1335, 1376), 'genutil.isDirty', 'util.isDirty', (['Version', '[input]', '[out_hdr]'], {}), '(Version, [input], [out_hdr])\n', (1347, 1376), True, 'import genutil as util\n'), ((667, 692), 'os.path.abspath', 'os.path.abspath', (['__file__'], {}), '(__file__)\n', (682, 692), False, 'import os, platform, subprocess\n')... |
# -*- coding: utf-8 -*-
#------------------------------------------------------------------------------
# file: $Id$
# lib: templatealchemy_driver.file
# auth: <NAME> <<EMAIL>>
# date: 2013/07/03
# copy: (C) Copyright 2013 Cadit Health Inc., All Rights Reserved.
#-------------------------------------------------------... | [
"os.path.dirname",
"os.listdir",
"os.path.join",
"os.path.split"
] | [((955, 979), 'os.path.split', 'os.path.split', (['self.spec'], {}), '(self.spec)\n', (968, 979), False, 'import os\n'), ((1048, 1064), 'os.listdir', 'os.listdir', (['path'], {}), '(path)\n', (1058, 1064), False, 'import os\n'), ((1569, 1595), 'os.path.dirname', 'os.path.dirname', (['self.spec'], {}), '(self.spec)\n', ... |
import time
initial = time.time()
#print(initial)
k = 0
while(k<10):
print("This is sandy program")
k+=1
print("while loop execution time: ", time.time() - initial, "Seconds")
initial2 = time.time()
for i in range(1000000):
print("T")
print("for loop execution time: ", time.time() - initial2, "Seconds")
... | [
"time.time"
] | [((23, 34), 'time.time', 'time.time', ([], {}), '()\n', (32, 34), False, 'import time\n'), ((197, 208), 'time.time', 'time.time', ([], {}), '()\n', (206, 208), False, 'import time\n'), ((151, 162), 'time.time', 'time.time', ([], {}), '()\n', (160, 162), False, 'import time\n'), ((284, 295), 'time.time', 'time.time', ([... |
from magic_repr import make_repr
from .side import Side
from ermaket.utils.xml import XMLObject
__all__ = ['Relation']
class Relation(XMLObject):
def __init__(self, name, sides):
self.name = name
self.sides = sides
@property
def _tag_name(self):
return 'relation'
@classmeth... | [
"magic_repr.make_repr"
] | [((982, 1008), 'magic_repr.make_repr', 'make_repr', (['"""name"""', '"""sides"""'], {}), "('name', 'sides')\n", (991, 1008), False, 'from magic_repr import make_repr\n')] |
from PyQt5.QtWidgets import (QDialog, QVBoxLayout, QListWidget,
QDialogButtonBox, QLabel)
class PickChannels(QDialog):
def __init__(self, parent, channels, selected=[]):
super().__init__(parent)
self.parent = parent
self.setWindowTitle('Pick Channels')
... | [
"PyQt5.QtWidgets.QVBoxLayout",
"PyQt5.QtWidgets.QDialogButtonBox",
"PyQt5.QtWidgets.QLabel",
"PyQt5.QtWidgets.QListWidget"
] | [((376, 393), 'PyQt5.QtWidgets.QVBoxLayout', 'QVBoxLayout', (['self'], {}), '(self)\n', (387, 393), False, 'from PyQt5.QtWidgets import QDialog, QVBoxLayout, QListWidget, QDialogButtonBox, QLabel\n'), ((892, 955), 'PyQt5.QtWidgets.QDialogButtonBox', 'QDialogButtonBox', (['(QDialogButtonBox.Ok | QDialogButtonBox.Cancel)... |
from __future__ import print_function, absolute_import, division
import KratosMultiphysics
import KratosMultiphysics.KratosUnittest as KratosUnittest
import KratosMultiphysics.kratos_utilities as KratosUtils
import math
structural_mechanics_is_available = KratosUtils.CheckIfApplicationsAvailable("StructuralMechanicsAp... | [
"KratosMultiphysics.ResidualBasedNewtonRaphsonStrategy",
"KratosMultiphysics.KratosUnittest.skipUnless",
"math.sqrt",
"KratosMultiphysics.ResidualBasedBossakDisplacementScheme",
"KratosMultiphysics.LinearMasterSlaveConstraint",
"KratosMultiphysics.VariableUtils",
"KratosMultiphysics.ResidualCriteria",
... | [((257, 331), 'KratosMultiphysics.kratos_utilities.CheckIfApplicationsAvailable', 'KratosUtils.CheckIfApplicationsAvailable', (['"""StructuralMechanicsApplication"""'], {}), "('StructuralMechanicsApplication')\n", (297, 331), True, 'import KratosMultiphysics.kratos_utilities as KratosUtils\n'), ((13595, 13710), 'Kratos... |
from docopt import docopt
from abbr import __main__
from abbr.core import main
_mocked_html = """
<html>
<table class="no-margin">
<tbody>
<tr>
<dir>
<span class="sf" />
<span class="sf" />
</dir>
<p class="desc">term1</p>
<td... | [
"abbr.core.main"
] | [((1326, 1336), 'abbr.core.main', 'main', (['args'], {}), '(args)\n', (1330, 1336), False, 'from abbr.core import main\n')] |
# torch libs
import torch
from torch.utils.data.dataset import Dataset
from torch.utils.data import DataLoader
from torch.utils.data.sampler import *
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torch.nn.parallel.data_parallel import data_parallel
from torch.nn.utils.rnn impo... | [
"torch.cuda.manual_seed_all",
"torch.manual_seed"
] | [((353, 376), 'torch.manual_seed', 'torch.manual_seed', (['seed'], {}), '(seed)\n', (370, 376), False, 'import torch\n'), ((381, 413), 'torch.cuda.manual_seed_all', 'torch.cuda.manual_seed_all', (['seed'], {}), '(seed)\n', (407, 413), False, 'import torch\n')] |
import dash_html_components as html
import dash_bootstrap_components as dbc
import pandas as pd
def create_deck(df: pd.DataFrame, city: str) -> html.Div:
"""
Create a deck of tweets
:param df: dataframe to get tweets of
:param city: string of city to filter on
:return: list of child elements
"... | [
"dash_html_components.Div",
"dash_html_components.Img"
] | [((977, 1069), 'dash_html_components.Img', 'html.Img', ([], {'src': '"""/assets/images/Twitter_Logo_Blue.png"""', 'className': '"""tweetcard__icon__logo"""'}), "(src='/assets/images/Twitter_Logo_Blue.png', className=\n 'tweetcard__icon__logo')\n", (985, 1069), True, 'import dash_html_components as html\n'), ((1558, ... |
"""Check invalid value returned by __hash__ """
# pylint: disable=too-few-public-methods,missing-docstring,no-self-use,import-error, useless-object-inheritance
import six
from missing import Missing
class FirstGoodHash(object):
"""__hash__ returns <type 'int'>"""
def __hash__(self):
return 1
clas... | [
"six.add_metaclass"
] | [((500, 532), 'six.add_metaclass', 'six.add_metaclass', (['HashMetaclass'], {}), '(HashMetaclass)\n', (517, 532), False, 'import six\n')] |
import numpy as np
PI = np.pi
DEG = 180./PI
INF = np.inf
def eig(M, sort_type=1):
"""
Calculates eigenvalues and eigenvectors of matrix
"""
if sort_type not in [1,2,3,4]:
raise ValueError
lam,V = np.linalg.eigh(M)
# sorting of eigenvalues
# 1: highest to lowest, algebraic: lam1... | [
"numpy.abs",
"numpy.arccos",
"numpy.sin",
"numpy.column_stack",
"numpy.linalg.det",
"numpy.argsort",
"numpy.array",
"numpy.dot",
"numpy.linspace",
"numpy.arctan2",
"numpy.cos",
"numpy.linalg.norm",
"numpy.linalg.eigh"
] | [((229, 246), 'numpy.linalg.eigh', 'np.linalg.eigh', (['M'], {}), '(M)\n', (243, 246), True, 'import numpy as np\n'), ((1293, 1311), 'numpy.cos', 'np.cos', (['(xdeg / DEG)'], {}), '(xdeg / DEG)\n', (1299, 1311), True, 'import numpy as np\n'), ((1323, 1341), 'numpy.sin', 'np.sin', (['(xdeg / DEG)'], {}), '(xdeg / DEG)\n... |
# Copyright 2018 Brocade Communications Systems 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 also obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless require... | [
"pyfos.pyfos_rest_util.rest_attribute"
] | [((14259, 14367), 'pyfos.pyfos_rest_util.rest_attribute', 'pyfos_rest_util.rest_attribute', (['"""port-id"""', 'pyfos_type.type_str', 'None', 'pyfos_rest_util.REST_ATTRIBUTE_KEY'], {}), "('port-id', pyfos_type.type_str, None,\n pyfos_rest_util.REST_ATTRIBUTE_KEY)\n", (14289, 14367), False, 'from pyfos import pyfos_r... |
import os
import json
from decouple import config, Csv
from django.shortcuts import render, redirect, get_object_or_404
from django.conf import settings
from django.templatetags.static import static
from django.http import HttpResponse, Http404, JsonResponse, HttpResponseRedirect
from django.core.exceptions import Ob... | [
"django.shortcuts.render",
"django.http.HttpResponseRedirect",
"rest_framework.response.Response",
"django.shortcuts.redirect",
"django.contrib.auth.decorators.login_required",
"django.contrib.auth.models.User.objects.get"
] | [((2018, 2062), 'django.contrib.auth.decorators.login_required', 'login_required', ([], {'login_url': '"""/accounts/login/"""'}), "(login_url='/accounts/login/')\n", (2032, 2062), False, 'from django.contrib.auth.decorators import login_required\n'), ((2514, 2558), 'django.contrib.auth.decorators.login_required', 'logi... |
#!/usr/bin/python
##########################################################################
# Copyright (c) 2015, Salesforce.com, Inc.
# All rights reserved.
#
# Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# Redistributions in binary... | [
"collectd.register_write",
"collectd.info",
"collectd.Values",
"collectd.register_config",
"time.time",
"collectd.warning",
"re.match",
"platform.system",
"collectd.register_shutdown",
"collectd.debug",
"collectd.register_init",
"re.findall",
"socket.gethostname",
"collectd.register_read"
... | [((4079, 4096), 'platform.system', 'platform.system', ([], {}), '()\n', (4094, 4096), False, 'import platform\n'), ((6773, 6851), 'collectd.info', 'collectd.info', (["('diskstats get_default_dev_list: dev_list: --- %s\\n' % dev_list)"], {}), "('diskstats get_default_dev_list: dev_list: --- %s\\n' % dev_list)\n", (6786,... |
from pubnub.endpoints.file_operations.file_based_endpoint import FileOperationEndpoint
from pubnub.enums import HttpMethod, PNOperationType
from pubnub.crypto import PubNubFileCrypto
from pubnub.models.consumer.file import PNDownloadFileResult
from pubnub.request_handlers.requests_handler import RequestsRequestHandler
... | [
"pubnub.crypto.PubNubFileCrypto",
"pubnub.endpoints.file_operations.get_file_url.GetFileDownloadUrl",
"pubnub.request_handlers.requests_handler.RequestsRequestHandler",
"pubnub.models.consumer.file.PNDownloadFileResult",
"pubnub.endpoints.file_operations.file_based_endpoint.FileOperationEndpoint.__init__"
] | [((488, 532), 'pubnub.endpoints.file_operations.file_based_endpoint.FileOperationEndpoint.__init__', 'FileOperationEndpoint.__init__', (['self', 'pubnub'], {}), '(self, pubnub)\n', (518, 532), False, 'from pubnub.endpoints.file_operations.file_based_endpoint import FileOperationEndpoint\n'), ((1780, 1818), 'pubnub.mode... |
from tensorcross.version import __version__
from setuptools import find_packages
from setuptools import setup
CLASSIFIERS = """\
License :: OSI Approved :: MIT License
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Topic :: Software Development
Opera... | [
"setuptools.find_packages",
"setuptools.setup"
] | [((971, 1026), 'setuptools.find_packages', 'find_packages', ([], {'include': "['tensorcross', 'tensorcross.*']"}), "(include=['tensorcross', 'tensorcross.*'])\n", (984, 1026), False, 'from setuptools import find_packages\n'), ((1384, 1401), 'setuptools.setup', 'setup', ([], {}), '(**metadata)\n', (1389, 1401), False, '... |
from helpers import message_to_embed
from typing import Generator, Optional
from discord.channel import TextChannel
from discord.ext import commands
from database import is_admin, db
import discord
class BridgeCog(commands.Cog):
def __init__(self, bot):
self.bot = bot
@commands.command()
@commands... | [
"discord.ext.commands.Cog.listener",
"helpers.message_to_embed",
"discord.ext.commands.check",
"database.db.channel",
"discord.ext.commands.command"
] | [((288, 306), 'discord.ext.commands.command', 'commands.command', ([], {}), '()\n', (304, 306), False, 'from discord.ext import commands\n'), ((312, 336), 'discord.ext.commands.check', 'commands.check', (['is_admin'], {}), '(is_admin)\n', (326, 336), False, 'from discord.ext import commands\n'), ((892, 915), 'discord.e... |
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | [
"azure.cli.core.commands.CliCommandType"
] | [((559, 692), 'azure.cli.core.commands.CliCommandType', 'CliCommandType', ([], {'operations_tmpl': '"""azure.mgmt.apimanagement.operations#ProductApiOperations.{}"""', 'client_factory': 'cf_product_api'}), "(operations_tmpl=\n 'azure.mgmt.apimanagement.operations#ProductApiOperations.{}',\n client_factory=cf_prod... |
#!/usr/bin/env python3.4
# Author: <NAME> <<EMAIL>>
# Description: Implementation of the 'absolute' algorithm.
import statistics
import sys
# Custom libs
import lib.functions
def mod_accept(flags, counting, pkts, bts, srcip, dstip):
"""Modulus accept to allow a bit of variance in flows.
When a flow is dou... | [
"statistics.mean"
] | [((3476, 3578), 'statistics.mean', 'statistics.mean', (["[src_dict[srcip]['targets'][dstip][key], dst_dict[srcip]['targets'][dstip][key]\n ]"], {}), "([src_dict[srcip]['targets'][dstip][key], dst_dict[srcip][\n 'targets'][dstip][key]])\n", (3491, 3578), False, 'import statistics\n')] |
# -*- coding: utf-8 -*-
import boto3
from boto3 import Session as BaseSession
class Session(BaseSession):
def __init__(self, expiration=None, **kwargs):
super().__init__(**kwargs)
self.expiration = expiration
@classmethod
def from_profile_name(cls, profile_name):
return cls(profil... | [
"botouk.sts.STS.from_access_key"
] | [((1166, 1227), 'botouk.sts.STS.from_access_key', 'STS.from_access_key', (['aws_access_key_id', 'aws_secret_access_key'], {}), '(aws_access_key_id, aws_secret_access_key)\n', (1185, 1227), False, 'from botouk.sts import STS\n')] |
import numpy as np
from scipy import sparse as sps
from src.models.QuantumSLIM.ItemSelectors.ItemSelectorInterface import ItemSelectorInterface
class ItemSelectorByPopularity(ItemSelectorInterface):
"""
Item selector that selects the items to be kept by item popularity. The higher popular items are kept.
... | [
"numpy.argsort"
] | [((465, 485), 'numpy.argsort', 'np.argsort', (['item_pop'], {}), '(item_pop)\n', (475, 485), True, 'import numpy as np\n'), ((748, 768), 'numpy.argsort', 'np.argsort', (['item_pop'], {}), '(item_pop)\n', (758, 768), True, 'import numpy as np\n')] |
#!/usr/bin/env python
# coding: utf-8
"""
Created on 2017-08
@author: Liang
"""
from math import log
import operator
#
def calcShannonEnt(dataset):
"""
计算数据集的熵
输入:数据集
输出:熵
"""
numEntris = len(dataset)
labelCounts = {}
for featVec in dataset:
currentLabel = featVec[-1] #每行数据中的最后一个... | [
"operator.itemgetter",
"math.log"
] | [((640, 652), 'math.log', 'log', (['prob', '(2)'], {}), '(prob, 2)\n', (643, 652), False, 'from math import log\n'), ((2440, 2462), 'operator.itemgetter', 'operator.itemgetter', (['(1)'], {}), '(1)\n', (2459, 2462), False, 'import operator\n')] |
import unittest
import io
from sievelib.factory import FiltersSet
from .. import parser
class FactoryTestCase(unittest.TestCase):
def setUp(self):
self.fs = FiltersSet("test")
def test_get_filter_conditions(self):
"""Test get_filter_conditions method."""
orig_conditions = [('Sender'... | [
"unittest.main",
"sievelib.factory.FiltersSet",
"io.StringIO"
] | [((12310, 12325), 'unittest.main', 'unittest.main', ([], {}), '()\n', (12323, 12325), False, 'import unittest\n'), ((173, 191), 'sievelib.factory.FiltersSet', 'FiltersSet', (['"""test"""'], {}), "('test')\n", (183, 191), False, 'from sievelib.factory import FiltersSet\n'), ((3199, 3228), 'sievelib.factory.FiltersSet', ... |
from django.shortcuts import render, get_object_or_404
from django.http import HttpResponse, HttpResponseRedirect, Http404
from django.views import View
from .models import URL
from .forms import SubmitUrlForm
from analytics.models import ClickEvent
class HomeView(View):
def get(self, request, *args, **kwargs):
... | [
"django.shortcuts.render",
"analytics.models.ClickEvent.objects.create_event",
"django.http.HttpResponseRedirect"
] | [((500, 547), 'django.shortcuts.render', 'render', (['request', '"""shortener/home.html"""', 'context'], {}), "(request, 'shortener/home.html', context)\n", (506, 547), False, 'from django.shortcuts import render, get_object_or_404\n'), ((1396, 1430), 'django.shortcuts.render', 'render', (['request', 'template', 'conte... |
import setuptools
setuptools.setup(
name='cothermo_socket',
version='1.0.0',
description='cape-open thermo python package.',
license="MIT Licence",
author="bshao",
author_email="<EMAIL>",
packages=setuptools.find_packages(),
classifiers=['Programming Language :: Python :: 3'],
inclu... | [
"setuptools.find_packages"
] | [((226, 252), 'setuptools.find_packages', 'setuptools.find_packages', ([], {}), '()\n', (250, 252), False, 'import setuptools\n')] |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('products', '0002_product_value'),
('orders', '0003_auto_20141225_2344'),
]
operations = [
migrations.CreateModel(
... | [
"django.db.migrations.CreateModel"
] | [((294, 481), 'django.db.migrations.CreateModel', 'migrations.CreateModel', ([], {'name': '"""OrderItemProxy"""', 'fields': '[]', 'options': "{'verbose_name': 'Order Item', 'proxy': True, 'verbose_name_plural':\n 'Order Items'}", 'bases': "('products.product',)"}), "(name='OrderItemProxy', fields=[], options={\n ... |
#! /usr/bin/env python3
import json
from argparse import ArgumentParser
import random
# python noc_hetero_vc_gen.py -f test.json -m json
VC_COUNT = 'vc_count'
BUFFER_DEPTH = 'buffer_depth'
NOC_X = 'noc_x'
NOC_Y = 'noc_y'
NUM_ROUTERS = 'num_routers'
AVAILABLE_PORTS = 'available_ports'
MODE_GEN_MAP = 'json'
MODE_GEN_... | [
"json.dumps",
"argparse.ArgumentParser"
] | [((6011, 6027), 'argparse.ArgumentParser', 'ArgumentParser', ([], {}), '()\n', (6025, 6027), False, 'from argparse import ArgumentParser\n'), ((5235, 5263), 'json.dumps', 'json.dumps', (['vc_map'], {'indent': '(4)'}), '(vc_map, indent=4)\n', (5245, 5263), False, 'import json\n')] |
import functools
import struct
def compressed_unimplemented_instruction(word, **kwargs):
return {
'cmd': 'Undefined',
'word': word,
'size': 2,
}
def uncompressed_unimplemented_instruction(word, **kwargs):
return {
'cmd': 'Undefined',
'word': word,
'size': 4,
... | [
"struct.Struct"
] | [((15824, 15843), 'struct.Struct', 'struct.Struct', (['"""<Q"""'], {}), "('<Q')\n", (15837, 15843), False, 'import struct\n'), ((16566, 16585), 'struct.Struct', 'struct.Struct', (['"""<Q"""'], {}), "('<Q')\n", (16579, 16585), False, 'import struct\n'), ((29290, 29309), 'struct.Struct', 'struct.Struct', (['"""<H"""'], {... |
from src.database import db
from src.models.people_model import People
from src.models.test_result_model import TestResultModel
from src.models.met_person_model import MetPerson
from src.models.meeting_model import Meeting
def create_new_person(data):
Name = data.get('Name')
Contact = data.get('Contact')
... | [
"src.models.met_person_model.MetPerson",
"src.database.db.session.commit",
"src.models.people_model.People",
"src.models.meeting_model.Meeting",
"src.models.meeting_model.Meeting.id.desc",
"src.database.db.session.add",
"src.database.db.session.flush",
"src.models.test_result_model.TestResultModel"
] | [((329, 350), 'src.models.people_model.People', 'People', (['Name', 'Contact'], {}), '(Name, Contact)\n', (335, 350), False, 'from src.models.people_model import People\n'), ((355, 377), 'src.database.db.session.add', 'db.session.add', (['people'], {}), '(people)\n', (369, 377), False, 'from src.database import db\n'),... |
import config
import classification
import config
import disassembly
import trace
import utils
memory = config.memory
jsr_hooks = {}
def add_jsr_hook(addr, hook):
assert addr not in jsr_hooks
jsr_hooks[addr] = hook
def hook_subroutine(addr, name, hook):
trace.add_entry(addr, name)
add_jsr_hook(addr, ... | [
"classification.get_address16",
"config.set_disassemble_instruction",
"utils.get_u16",
"config.formatter",
"trace.add_entry",
"utils.force_case",
"disassembly.add_classification",
"classification.get_constant8",
"classification.get_address8",
"disassembly.is_classified",
"utils.isprint"
] | [((12412, 12471), 'config.set_disassemble_instruction', 'config.set_disassemble_instruction', (['disassemble_instruction'], {}), '(disassemble_instruction)\n', (12446, 12471), False, 'import config\n'), ((269, 296), 'trace.add_entry', 'trace.add_entry', (['addr', 'name'], {}), '(addr, name)\n', (284, 296), False, 'impo... |
#!/usr/bin/env python3
from migen import *
from migen.fhdl.decorators import ResetInserter
from ..test.common import BaseUsbTestCase
import unittest
@ResetInserter()
class RxShifter(Module):
"""RX Shifter
A shifter is responsible for shifting in serial bits and presenting them
as parallel data. The shi... | [
"migen.fhdl.decorators.ResetInserter"
] | [((153, 168), 'migen.fhdl.decorators.ResetInserter', 'ResetInserter', ([], {}), '()\n', (166, 168), False, 'from migen.fhdl.decorators import ResetInserter\n')] |
# Third Party
import pytest
# First Party
from portchecker.port_checker import is_address_valid
from tests import constants
class TestValidIPAddress:
def test_valid_public_ipv4(self):
assert is_address_valid(constants.VALID_PUBLIC_IPV4) is True
def test_valid_public_ipv6(self):
assert is_add... | [
"portchecker.port_checker.is_address_valid",
"pytest.raises"
] | [((206, 251), 'portchecker.port_checker.is_address_valid', 'is_address_valid', (['constants.VALID_PUBLIC_IPV4'], {}), '(constants.VALID_PUBLIC_IPV4)\n', (222, 251), False, 'from portchecker.port_checker import is_address_valid\n'), ((314, 359), 'portchecker.port_checker.is_address_valid', 'is_address_valid', (['constan... |
# -*- coding: utf-8 -*-
# Copyright (c) 2018, VHRS and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
import json
from frappe.model.document import Document
from frappe.utils.global_search import search
class AllocateChecks(Document):
pass
@... | [
"json.loads",
"frappe.db.get_value",
"frappe.get_list",
"frappe.whitelist",
"frappe.utils.nowdate",
"frappe.errprint",
"frappe.get_doc",
"frappe.db.commit",
"frappe.get_all",
"frappe.db.get_list"
] | [((320, 338), 'frappe.whitelist', 'frappe.whitelist', ([], {}), '()\n', (336, 338), False, 'import frappe\n'), ((480, 498), 'frappe.whitelist', 'frappe.whitelist', ([], {}), '()\n', (496, 498), False, 'import frappe\n'), ((656, 674), 'frappe.whitelist', 'frappe.whitelist', ([], {}), '()\n', (672, 674), False, 'import f... |
from sqlalchemy import Column
from sqlalchemy import Integer
from sqlalchemy import String
from sqlalchemy.orm import declarative_base
from sqlalchemy.orm import registry
reg: registry = registry()
Base = declarative_base()
class SomeAbstract(Base):
__abstract__ = True
class HasUpdatedAt:
updated_at = Co... | [
"sqlalchemy.orm.declarative_base",
"sqlalchemy.Column",
"sqlalchemy.orm.registry",
"sqlalchemy.Integer"
] | [((189, 199), 'sqlalchemy.orm.registry', 'registry', ([], {}), '()\n', (197, 199), False, 'from sqlalchemy.orm import registry\n'), ((208, 226), 'sqlalchemy.orm.declarative_base', 'declarative_base', ([], {}), '()\n', (224, 226), False, 'from sqlalchemy.orm import declarative_base\n'), ((318, 333), 'sqlalchemy.Column',... |
from django.shortcuts import render
from django.utils.translation import gettext as _
from rest_framework.views import APIView
from rest_framework.authtoken.models import Token
from rest_framework import permissions
from rest_framework.response import Response
from rest_framework import status
from rest_framework impor... | [
"apps.portfolio.services.edit_portfolio",
"apps.portfolio.services.create",
"apps.portfolio.services.getPortfolio",
"django.utils.translation.gettext",
"rest_framework.response.Response",
"apps.portfolio.serializers.PortfolioSerializers",
"apps.portfolio.services.delete_portfolio"
] | [((1241, 1288), 'rest_framework.response.Response', 'Response', (['serializer'], {'status': 'status.HTTP_200_OK'}), '(serializer, status=status.HTTP_200_OK)\n', (1249, 1288), False, 'from rest_framework.response import Response\n'), ((1831, 1883), 'rest_framework.response.Response', 'Response', (['serializer'], {'statu... |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.16 on 2018-12-11 19:18
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('travelling', '0006_auto_20181128_1524'),
]
operations = [
migrations.Alter... | [
"django.db.models.CharField"
] | [((419, 668), 'django.db.models.CharField', 'models.CharField', ([], {'choices': "[('SO', 'Self Organized'), ('CA', 'Camping'), ('CO', 'Simple Cottage'), (\n 'HH', 'Holiday Home'), ('LO', 'Lodge'), ('HC', 'Hunting Chalet'), ('HO',\n 'Hotel')]", 'max_length': '(2)', 'null': '(True)', 'verbose_name': '"""Accommodat... |
# Generated by Django 3.1.7 on 2021-06-09 14:48
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('main', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='quiz',
field... | [
"django.db.models.AutoField",
"django.db.models.TextField",
"django.db.models.BooleanField",
"django.db.models.ForeignKey"
] | [((347, 440), 'django.db.models.AutoField', 'models.AutoField', ([], {'auto_created': '(True)', 'primary_key': '(True)', 'serialize': '(False)', 'verbose_name': '"""ID"""'}), "(auto_created=True, primary_key=True, serialize=False,\n verbose_name='ID')\n", (363, 440), False, 'from django.db import migrations, models\... |
from pbge.plots import Plot
from pbge.dialogue import Offer, ContextTag
from game import teams, services, ghdialogue
from game.ghdialogue import context
import gears
import pbge
from .dd_main import DZDRoadMapExit,RoadNode
import random
from game.content import gharchitecture,ghwaypoints,plotutility,ghterrain,backstory... | [
"game.teams.Team",
"game.content.gharchitecture.HumanScaleGreenzone",
"game.content.gharchitecture.ResidentialBuilding",
"game.content.gharchitecture.FortressBuilding",
"game.content.backstory.Backstory",
"gears.selector.EARTH_NAMES.gen_word",
"game.content.ghwaypoints.MechaPoster",
"game.content.plot... | [((746, 776), 'game.teams.Team', 'teams.Team', ([], {'name': '"""Player Team"""'}), "(name='Player Team')\n", (756, 776), False, 'from game import teams, services, ghdialogue\n'), ((793, 860), 'game.teams.Team', 'teams.Team', ([], {'name': '"""Civilian Team"""', 'allies': '(team1,)', 'faction': 'town_fac'}), "(name='Ci... |
from pathlib import Path
import traceback
from datetime import datetime
from time import time
import fnmatch
from typing import List, Dict
from abc import ABCMeta, abstractmethod
from maggma.core import Store
from maggma.core.drone import Drone, RecordIdentifier, Document
from maggma.utils import Timeout
class Direc... | [
"traceback.format_exc",
"maggma.utils.Timeout",
"pathlib.Path",
"maggma.core.drone.Document",
"datetime.datetime.now",
"fnmatch.fnmatch",
"time.time"
] | [((4525, 4531), 'time.time', 'time', ([], {}), '()\n', (4529, 4531), False, 'from time import time\n'), ((4879, 4885), 'time.time', 'time', ([], {}), '()\n', (4883, 4885), False, 'from time import time\n'), ((3203, 3213), 'pathlib.Path', 'Path', (['path'], {}), '(path)\n', (3207, 3213), False, 'from pathlib import Path... |
from tests.base import DBTestCase
from tests.example_app.tables import Manager
class TestToDict(DBTestCase):
def test_to_dict(self):
"""
Make sure that `to_dict` works correctly.
"""
self.insert_row()
instance = Manager.objects().first().run_sync()
dictionary = ins... | [
"tests.example_app.tables.Manager.name.as_alias",
"tests.example_app.tables.Manager.objects"
] | [((994, 1024), 'tests.example_app.tables.Manager.name.as_alias', 'Manager.name.as_alias', (['"""title"""'], {}), "('title')\n", (1015, 1024), False, 'from tests.example_app.tables import Manager\n'), ((259, 276), 'tests.example_app.tables.Manager.objects', 'Manager.objects', ([], {}), '()\n', (274, 276), False, 'from t... |
import requests
import regex as re
CLIENT_ID = 'T9wY5Ulq8tLW6w'
SECRET_KEY ='L7eznyEuLAotFRL_HADO0m9t6mg6WA'
auth = requests.auth.HTTPBasicAuth(CLIENT_ID, SECRET_KEY)
data = {
'grant_type': 'password',
'username': 'GnarlyCharley6',
'password': '<PASSWORD>',
}
headers = {'User-Agent': 'My... | [
"requests.post",
"requests.auth.HTTPBasicAuth",
"regex.sub",
"requests.get"
] | [((116, 166), 'requests.auth.HTTPBasicAuth', 'requests.auth.HTTPBasicAuth', (['CLIENT_ID', 'SECRET_KEY'], {}), '(CLIENT_ID, SECRET_KEY)\n', (143, 166), False, 'import requests\n'), ((338, 441), 'requests.post', 'requests.post', (['"""https://www.reddit.com/api/v1/access_token"""'], {'auth': 'auth', 'data': 'data', 'hea... |
#Crie um algoritmo que leia um número e mostre o seu dobro, triplo e raiz quadrada.
import math
while True:
try:
svalue = input('Digite um número: ')
ivalue = int(svalue)
except:
print('Dado inválido!')
else:
break
print(f'Dobro de {ivalue} = {ivalue*2}')
print(f'Triplo de ... | [
"math.sqrt"
] | [((381, 398), 'math.sqrt', 'math.sqrt', (['ivalue'], {}), '(ivalue)\n', (390, 398), False, 'import math\n')] |
import logging
import argparse
from satellite import start
from coloredlogs import ColoredFormatter
import sys
if sys.version_info[0] < 3:
raise RuntimeError('Python3 required')
def main(app, network_type, augment_data, is_training, is_predicting):
"""
"""
if app == 'satellite':
start.main(n... | [
"logging.getLogger",
"logging.basicConfig",
"logging.StreamHandler",
"argparse.ArgumentParser",
"logging.Formatter",
"logging.FileHandler",
"satellite.start.main",
"coloredlogs.ColoredFormatter"
] | [((1005, 1147), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Integrate some of the main Deep Learning models for remote sensing image analysis and mapping"""'}), "(description=\n 'Integrate some of the main Deep Learning models for remote sensing image analysis and mapping'\n )\n... |
import random
import re
import math
import numpy as np
from src import constants
from src.multi_agent.elements.camera import Camera, CameraRepresentation
from src.my_utils import constant_class
from src.my_utils.my_math.bound import bound_angle_btw_minus_pi_plus_pi, bound
from src.my_utils.my_math.line import distance... | [
"src.my_utils.my_math.line.Line",
"src.constants.get_time",
"random.uniform",
"src.my_utils.my_math.bound.bound_angle_btw_minus_pi_plus_pi",
"src.multi_agent.elements.camera.CameraRepresentation.__init__",
"src.my_utils.my_math.line.distance_btw_two_point",
"math.degrees",
"math.radians",
"src.multi... | [((1391, 1476), 'src.multi_agent.elements.camera.CameraRepresentation.__init__', 'CameraRepresentation.__init__', (['self', 'id', 'xc', 'yc', 'alpha', 'beta', 'field_depth', 'color'], {}), '(self, id, xc, yc, alpha, beta, field_depth, color\n )\n', (1420, 1476), False, 'from src.multi_agent.elements.camera import Ca... |
# -*- coding: utf-8 -*-
"""
Created on Thu Jul 29 19:35:40 2021
@author: Arnab
"""
import cv2
#loading the cascades
face_cascade = cv2.CascadeClassifier('haarcascade_frontalface_default.xml')
eye_cascade = cv2.CascadeClassifier('haarcascade_eye.xml')
smile_cascade = cv2.CascadeClassifier('haarcascade_smile.xml')
#... | [
"cv2.rectangle",
"cv2.imshow",
"cv2.destroyAllWindows",
"cv2.VideoCapture",
"cv2.cvtColor",
"cv2.CascadeClassifier",
"cv2.waitKey"
] | [((134, 194), 'cv2.CascadeClassifier', 'cv2.CascadeClassifier', (['"""haarcascade_frontalface_default.xml"""'], {}), "('haarcascade_frontalface_default.xml')\n", (155, 194), False, 'import cv2\n'), ((209, 253), 'cv2.CascadeClassifier', 'cv2.CascadeClassifier', (['"""haarcascade_eye.xml"""'], {}), "('haarcascade_eye.xml... |
#!/usr/bin/env python3
#
# Connect to this server with: rpcsh localhost 5000 --http --http-basic-user testuser
#
import sys
import json
from functools import wraps
from flask import Flask, request, Response
sys.path.append('..')
import reflectrpc
import reflectrpc.simpleserver
import rpcexample
app = Flask(__name... | [
"flask.Flask",
"flask.request.get_data",
"json.dumps",
"functools.wraps",
"rpcexample.build_example_rpcservice",
"flask.Response",
"sys.path.append"
] | [((210, 231), 'sys.path.append', 'sys.path.append', (['""".."""'], {}), "('..')\n", (225, 231), False, 'import sys\n'), ((308, 323), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (313, 323), False, 'from flask import Flask, request, Response\n'), ((335, 372), 'rpcexample.build_example_rpcservice', 'rpcexa... |
#
# python_grabber
#
# Authors:
# <NAME> <<EMAIL>>
#
# Copyright (C) 2019 <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 rig... | [
"ctypes.POINTER"
] | [((1365, 1382), 'ctypes.POINTER', 'POINTER', (['IUnknown'], {}), '(IUnknown)\n', (1372, 1382), False, 'from ctypes import POINTER, HRESULT\n'), ((1406, 1420), 'ctypes.POINTER', 'POINTER', (['CLSID'], {}), '(CLSID)\n', (1413, 1420), False, 'from ctypes import POINTER, HRESULT\n'), ((1750, 1768), 'ctypes.POINTER', 'POINT... |
import os
c.ArgModelPara.arg_composition_layer_sizes = 600, 300, 300
c.ArgModelPara.event_composition_layer_sizes = 400, 200, 200
c.Basic.model_name = os.path.basename(__file__).replace('.py', '')
| [
"os.path.basename"
] | [((153, 179), 'os.path.basename', 'os.path.basename', (['__file__'], {}), '(__file__)\n', (169, 179), False, 'import os\n')] |
import random
import time
import unittest
from insertion_sort import insertion_sort
class TestInsertionSort(unittest.TestCase):
def setUp(self):
self.start_time = time.time()
def tearDown(self):
t = time.time() - self.start_time
print('{:.3f}'.format(t))
def test_insertion_sort(s... | [
"unittest.main",
"time.time",
"random.randint",
"insertion_sort.insertion_sort"
] | [((773, 788), 'unittest.main', 'unittest.main', ([], {}), '()\n', (786, 788), False, 'import unittest\n'), ((177, 188), 'time.time', 'time.time', ([], {}), '()\n', (186, 188), False, 'import time\n'), ((226, 237), 'time.time', 'time.time', ([], {}), '()\n', (235, 237), False, 'import time\n'), ((378, 403), 'insertion_s... |
import base64
import json
import os
import os.path
import pathlib
import secrets
import subprocess
import sys
import appdirs
import waitress
from cryptography.hazmat.primitives.hashes import SHA256
from cryptography.hazmat.primitives.kdf.pbkdf2 import PBKDF2HMAC
from flask import Flask
from flask_login import LoginMan... | [
"flask_login.LoginManager",
"os.path.exists",
"os.makedirs",
"flask.Flask",
"pathlib.Path",
"flask_migrate.upgrade",
"appdirs.user_config_dir",
"os.path.join",
"secrets.token_urlsafe",
"waitress.serve",
"os.path.isdir",
"flask_migrate.Migrate",
"cryptography.hazmat.primitives.kdf.pbkdf2.PBKD... | [((622, 656), 'appdirs.user_config_dir', 'appdirs.user_config_dir', (['"""cactool"""'], {}), "('cactool')\n", (645, 656), False, 'import appdirs\n'), ((674, 714), 'os.path.join', 'os.path.join', (['ROOT', '"""cactool/migrations"""'], {}), "(ROOT, 'cactool/migrations')\n", (686, 714), False, 'import os\n'), ((742, 792),... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Code accompanying the manuscript:
"Reinterpreting the relationship between number of species and
number of links connects community structure and stability"
-------
v1.0.0 (First release)
-------
For any question or comment, please contact:
<NAME>(1), <EMAIL>
(1)... | [
"numpy.mean",
"collections.namedtuple",
"numpy.repeat",
"numpy.ones",
"numpy.full_like",
"numpy.where",
"numpy.log",
"numpy.exp",
"numpy.array",
"numpy.sum",
"numpy.zeros",
"numpy.tril",
"numpy.arange",
"numpy.random.permutation"
] | [((2145, 2162), 'numpy.tril', 'np.tril', (['(mat != 0)'], {}), '(mat != 0)\n', (2152, 2162), True, 'import numpy as np\n'), ((2929, 2953), 'numpy.array', 'np.array', (['(nbsimu * [mat])'], {}), '(nbsimu * [mat])\n', (2937, 2953), True, 'import numpy as np\n'), ((3045, 3065), 'numpy.ones', 'np.ones', (['(nbsimu, S)'], {... |
# -*- coding: utf-8 -*-
# Generated by Django 1.10 on 2017-08-22 15:26
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('subcounty', '0001_initial'),
]
operations = [
... | [
"django.db.models.ForeignKey"
] | [((426, 545), 'django.db.models.ForeignKey', 'models.ForeignKey', ([], {'on_delete': 'django.db.models.deletion.CASCADE', 'related_name': '"""subcounties"""', 'to': '"""counties.Counties"""'}), "(on_delete=django.db.models.deletion.CASCADE, related_name\n ='subcounties', to='counties.Counties')\n", (443, 545), False... |
from uapi import App
def make_generic_subapp() -> App:
app = App()
@app.get("/subapp")
def subapp() -> str:
return "subapp"
return app
| [
"uapi.App"
] | [((67, 72), 'uapi.App', 'App', ([], {}), '()\n', (70, 72), False, 'from uapi import App\n')] |
from countryinfo import countries
import json
from urllib.parse import quote,unquote
import requests
from time import sleep
from bs4 import BeautifulSoup
import re
def recode_countryinfo():
"""some entres are utf-encoded - to clean that you can use this code...
Result is stored in data.json, so you can copy d... | [
"re.compile",
"urllib.parse.quote",
"requests.get",
"time.sleep",
"bs4.BeautifulSoup",
"urllib.parse.unquote",
"json.dump"
] | [((3697, 3736), 're.compile', 're.compile', (['"""[0-9 \\\\,]+"""', 're.IGNORECASE'], {}), "('[0-9 \\\\,]+', re.IGNORECASE)\n", (3707, 3736), False, 'import re\n'), ((738, 791), 'json.dump', 'json.dump', (['res', 'outfile'], {'ensure_ascii': '(False)', 'indent': '(4)'}), '(res, outfile, ensure_ascii=False, indent=4)\n'... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Uniform re module
"""
# pylint: disable-all
import os
import logging
log = logging.getLogger(__name__).log
REGEX_ENABLED = False
if os.environ.get('REBULK_REGEX_ENABLED') in ["1", "true", "True", "Y"]:
try:
import regex as re
REGEX_ENABLED = True
... | [
"logging.getLogger",
"os.environ.get"
] | [((126, 153), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (143, 153), False, 'import logging\n'), ((184, 222), 'os.environ.get', 'os.environ.get', (['"""REBULK_REGEX_ENABLED"""'], {}), "('REBULK_REGEX_ENABLED')\n", (198, 222), False, 'import os\n')] |
from flask import request
from flask_restx import Resource, fields, Namespace
import jwt
import datetime
import functools
from models import Users, Admins
import subprocess
import os
from os.path import join, dirname
from dotenv import load_dotenv
from conf import const
load_dotenv(verbose=True)
dotenv_path = join(dir... | [
"jwt.decode",
"datetime.datetime.utcnow",
"flask_restx.Namespace",
"subprocess.Popen",
"os.environ.get",
"functools.wraps",
"dotenv.load_dotenv",
"models.Admins.select",
"os.path.dirname",
"flask_restx.fields.String",
"models.Users.select",
"datetime.timedelta",
"flask.request.headers.get",
... | [((272, 297), 'dotenv.load_dotenv', 'load_dotenv', ([], {'verbose': '(True)'}), '(verbose=True)\n', (283, 297), False, 'from dotenv import load_dotenv\n'), ((344, 368), 'dotenv.load_dotenv', 'load_dotenv', (['dotenv_path'], {}), '(dotenv_path)\n', (355, 368), False, 'from dotenv import load_dotenv\n'), ((383, 411), 'os... |
#!/usr/bin/env python
import sys
import os
import glob
from six import print_
def scopes_from_wdl(scope, wdl):
"""
Return a dictionary of top-level scopes contained in a .wdl file.
A scope is either a task or workflow, and associated block
"""
D = dict()
with open(wdl, "r") as wdl_file:
... | [
"os.path.splitext",
"os.path.join",
"os.path.isdir",
"six.print_",
"glob.glob"
] | [((4626, 4699), 'six.print_', 'print_', (['"""sync_tasks.py -- Sync tasks from task folders into a workflow\n"""'], {}), "('sync_tasks.py -- Sync tasks from task folders into a workflow\\n')\n", (4632, 4699), False, 'from six import print_\n'), ((4704, 4801), 'six.print_', 'print_', (['"""You can pass in WDLs and folde... |
import torch
import torch.nn as nn
import torch.nn.functional as F
import math
import pdb, time
from torch.autograd import Variable
torch.manual_seed(12)
SIGMA = 1
EPSILON = 1e-5
class GatedConv1d(nn.Module):
def __init__(self, input_channels, output_channels,
kernel_size, stride, pad... | [
"torch.manual_seed",
"torch.nn.Sigmoid",
"torch.nn.ReLU",
"torch.nn.ConvTranspose1d",
"torch.nn.LeakyReLU",
"torch.nn.init.xavier_uniform_",
"torch.nn.Softmax",
"torch.Tensor",
"torch.nn.functional.dropout",
"torch.mm",
"torch.nn.BatchNorm1d",
"torch.matmul",
"torch.nn.Linear",
"torch.zero... | [((138, 159), 'torch.manual_seed', 'torch.manual_seed', (['(12)'], {}), '(12)\n', (155, 159), False, 'import torch\n'), ((467, 479), 'torch.nn.Sigmoid', 'nn.Sigmoid', ([], {}), '()\n', (477, 479), True, 'import torch.nn as nn\n'), ((508, 594), 'torch.nn.Conv1d', 'nn.Conv1d', (['input_channels', 'output_channels', 'kern... |
# Generated by Django 3.0.5 on 2020-05-03 05:58
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('Counselor', '0002_link'),
]
operations = [
migrations.AddField(
model_name='link',
name='title',
field=m... | [
"django.db.models.CharField"
] | [((319, 362), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(500)', 'null': '(True)'}), '(max_length=500, null=True)\n', (335, 362), False, 'from django.db import migrations, models\n')] |
# coding: utf-8
import numpy as np
import librosa
import argparse
import time
def main():
parser = argparse.ArgumentParser(
prog = 'The Noise Reduction (Spectral Subtraction)',
usage = 'シンプルなスペクトルサブトラクションで, ノイズを軽減します.',
description = 'python3 NoiseReduction.py -i [Input Filena... | [
"librosa.istft",
"librosa.db_to_power",
"argparse.ArgumentParser",
"numpy.average",
"librosa.output.write_wav",
"librosa.power_to_db",
"librosa.stft",
"time.time",
"librosa.util.normalize",
"librosa.load"
] | [((115, 419), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'prog': '"""The Noise Reduction (Spectral Subtraction)"""', 'usage': '"""シンプルなスペクトルサブトラクションで, ノイズを軽減します."""', 'description': '"""python3 NoiseReduction.py -i [Input Filename] -o [Output Filename] -s [Noise start time(sec)] -f [Noise finish time(s... |
from sqlalchemy import MetaData, Table, Column, Integer, ForeignKey
meta = MetaData()
def upgrade(migrate_engine):
meta = MetaData(bind=migrate_engine)
f = Table("field", meta, autoload=True)
f.c.study_id.drop()
def downgrade(migrate_engine):
meta = MetaData(bind=migrate_engine)
s = Table("st... | [
"sqlalchemy.MetaData",
"sqlalchemy.ForeignKey",
"sqlalchemy.Table"
] | [((76, 86), 'sqlalchemy.MetaData', 'MetaData', ([], {}), '()\n', (84, 86), False, 'from sqlalchemy import MetaData, Table, Column, Integer, ForeignKey\n'), ((129, 158), 'sqlalchemy.MetaData', 'MetaData', ([], {'bind': 'migrate_engine'}), '(bind=migrate_engine)\n', (137, 158), False, 'from sqlalchemy import MetaData, Ta... |
from django.contrib import admin
from reversion_compare.admin import CompareVersionAdmin
from .models import Source, Pledge, BulkPayment, Contribution
class PledgeModelAdmin(CompareVersionAdmin):
class Meta:
model = Pledge
class BulkPaymentModelAdmin(CompareVersionAdmin):
class Meta:
model ... | [
"django.contrib.admin.site.register"
] | [((434, 461), 'django.contrib.admin.site.register', 'admin.site.register', (['Source'], {}), '(Source)\n', (453, 461), False, 'from django.contrib import admin\n'), ((462, 517), 'django.contrib.admin.site.register', 'admin.site.register', (['BulkPayment', 'BulkPaymentModelAdmin'], {}), '(BulkPayment, BulkPaymentModelAd... |
#! /usr/bin/env python3
from helper import get_all_volumes
from config import REGIONS
import boto3
import crayons
def scan():
for region in REGIONS:
client = boto3.client("ec2", region_name=region)
response = client.describe_volumes()
if "Volumes" in response and len(response["Volumes"]) >... | [
"boto3.client"
] | [((172, 211), 'boto3.client', 'boto3.client', (['"""ec2"""'], {'region_name': 'region'}), "('ec2', region_name=region)\n", (184, 211), False, 'import boto3\n')] |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""Tests for the timezone Windows Registry plugin."""
import unittest
from plaso.dfwinreg import definitions as dfwinreg_definitions
from plaso.dfwinreg import fake as dfwinreg_fake
from plaso.formatters import winreg as _ # pylint: disable=unused-import
from plaso.lib impor... | [
"plaso.lib.timelib.Timestamp.CopyFromString",
"plaso.dfwinreg.fake.Filetime",
"plaso.dfwinreg.fake.FakeWinRegistryKey",
"plaso.parsers.winreg_plugins.timezone.WinRegTimezonePlugin",
"plaso.dfwinreg.fake.FakeWinRegistryValue",
"unittest.main"
] | [((6629, 6644), 'unittest.main', 'unittest.main', ([], {}), '()\n', (6642, 6644), False, 'import unittest\n'), ((676, 714), 'plaso.parsers.winreg_plugins.timezone.WinRegTimezonePlugin', 'winreg_timezone.WinRegTimezonePlugin', ([], {}), '()\n', (712, 714), True, 'from plaso.parsers.winreg_plugins import timezone as winr... |
from sklearn.model_selection import StratifiedKFold
from scipy import sparse
from skml.datasets import sample_down_label_space
# liac-arff
import arff
import random
random.seed(2018)
def load_from_arff(filename, labelcount, endian="big",
input_feature_type='float', encode_nominal=True, load_sparse=False,
ret... | [
"scipy.sparse.csr_matrix",
"random.seed"
] | [((166, 183), 'random.seed', 'random.seed', (['(2018)'], {}), '(2018)\n', (177, 183), False, 'import random\n'), ((1987, 2050), 'scipy.sparse.csr_matrix', 'sparse.csr_matrix', (["arff_frame['data']"], {'dtype': 'input_feature_type'}), "(arff_frame['data'], dtype=input_feature_type)\n", (2004, 2050), False, 'from scipy ... |
import re
from .git2_types import Git2Type
from .git2_type_common import (
Git2TypeConstObject,
Git2TypeOutObject,
PAT1_STR,
PAT2_STR,
PAT3_STR,
)
class Git2TypeConstRebaseOptions(Git2TypeConstObject):
PAT = re.compile(PAT1_STR + "(?P<obj_name>rebase_options)" + PAT2_STR)
class Git2TypeOutRe... | [
"re.compile"
] | [((234, 298), 're.compile', 're.compile', (["(PAT1_STR + '(?P<obj_name>rebase_options)' + PAT2_STR)"], {}), "(PAT1_STR + '(?P<obj_name>rebase_options)' + PAT2_STR)\n", (244, 298), False, 'import re\n'), ((362, 426), 're.compile', 're.compile', (["(PAT1_STR + '(?P<obj_name>rebase_options)' + PAT3_STR)"], {}), "(PAT1_STR... |
# This Python file uses the following encoding: utf-8
"""autogenerated by genpy from zzz_perception_msgs/TrackingBox.msg. Do not edit."""
import sys
python3 = True if sys.hexversion > 0x03000000 else False
import genpy
import struct
import zzz_perception_msgs.msg
import geometry_msgs.msg
class TrackingBox(genpy.Messa... | [
"struct.Struct",
"genpy.DeserializationError",
"struct.pack"
] | [((23212, 23232), 'struct.Struct', 'struct.Struct', (['"""<6d"""'], {}), "('<6d')\n", (23225, 23232), False, 'import struct\n'), ((23375, 23397), 'struct.Struct', 'struct.Struct', (['"""<Hf7d"""'], {}), "('<Hf7d')\n", (23388, 23397), False, 'import struct\n'), ((23537, 23558), 'struct.Struct', 'struct.Struct', (['"""<3... |
# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import Client
# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "<KEY>"
auth_token = "<PASSWORD>"
client = Client(account_sid, auth_token)
queue = client.queues("QU32a3c49700934481addd5ce1659f04d2") \
... | [
"twilio.rest.Client"
] | [((225, 256), 'twilio.rest.Client', 'Client', (['account_sid', 'auth_token'], {}), '(account_sid, auth_token)\n', (231, 256), False, 'from twilio.rest import Client\n')] |
import platform
from setuptools import setup, Extension, find_packages
if platform.system().lower() == 'linux':
dependencies = ['uvloop', 'ujson', 'pendulum']
else:
dependencies = ['pendulum']
setup(
name="vibora",
version='0.0.6',
description='Fast, asynchronous and sexy Python web framework',
... | [
"setuptools.Extension",
"platform.system",
"setuptools.find_packages"
] | [((3667, 3682), 'setuptools.find_packages', 'find_packages', ([], {}), '()\n', (3680, 3682), False, 'from setuptools import setup, Extension, find_packages\n'), ((75, 92), 'platform.system', 'platform.system', ([], {}), '()\n', (90, 92), False, 'import platform\n'), ((755, 938), 'setuptools.Extension', 'Extension', (['... |
from django.conf.urls import patterns, url
from django.conf import settings
from customer_subsystem import views
urlpatterns = patterns('',
url(r'^$', views.index, name = "index"),
url(r'^search/$', views.search, name = "search"),
)
| [
"django.conf.urls.url"
] | [((164, 200), 'django.conf.urls.url', 'url', (['"""^$"""', 'views.index'], {'name': '"""index"""'}), "('^$', views.index, name='index')\n", (167, 200), False, 'from django.conf.urls import patterns, url\n'), ((228, 273), 'django.conf.urls.url', 'url', (['"""^search/$"""', 'views.search'], {'name': '"""search"""'}), "('... |
from data import question_data
from question_model import Question
from quiz_brain import QuizBrain
question_bank = []
for dic in question_data:
question_bank.append(Question(dic['question'], dic['correct_answer']))
quiz = QuizBrain(question_bank)
while quiz.still_has_question():
quiz.next_question()
print('... | [
"question_model.Question",
"quiz_brain.QuizBrain"
] | [((229, 253), 'quiz_brain.QuizBrain', 'QuizBrain', (['question_bank'], {}), '(question_bank)\n', (238, 253), False, 'from quiz_brain import QuizBrain\n'), ((171, 219), 'question_model.Question', 'Question', (["dic['question']", "dic['correct_answer']"], {}), "(dic['question'], dic['correct_answer'])\n", (179, 219), Fal... |
# -*- coding: utf-8 -*-
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from matplotlib.ticker import FormatStrFormatter
def main():
df = pd.read_csv('test1.txt', delim_whitespace=Tr... | [
"matplotlib.pyplot.close",
"matplotlib.ticker.FormatStrFormatter",
"matplotlib.pyplot.subplots",
"pandas.read_csv"
] | [((276, 333), 'pandas.read_csv', 'pd.read_csv', (['"""test1.txt"""'], {'delim_whitespace': '(True)', 'header': '(0)'}), "('test1.txt', delim_whitespace=True, header=0)\n", (287, 333), True, 'import pandas as pd\n'), ((519, 570), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {'figsize': '(8, 8)', 'nrows': '(2)', 's... |
import json
import re
import ast
import numpy as np
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
from sklearn.model_selection import train_test_split, GridSearchCV, StratifiedKFold, cross_val_score
from sklearn.metrics import accuracy_score, precision_score, recall_score, f1_score, log_los... | [
"pandas.read_csv",
"sklearn.model_selection.StratifiedKFold",
"sklearn.metrics.log_loss",
"sklearn.metrics.r2_score",
"numpy.mean",
"json.dumps",
"numpy.asarray",
"pandas.DataFrame",
"sklearn.metrics.confusion_matrix",
"sklearn.model_selection.cross_val_score",
"json.loads",
"matplotlib.pyplot... | [((494, 569), 'pandas.read_csv', 'pd.read_csv', (['"""../data/processed/people_transformation/people_cast_list.csv"""'], {}), "('../data/processed/people_transformation/people_cast_list.csv')\n", (505, 569), True, 'import pandas as pd\n'), ((2605, 2642), 'sklearn.metrics.confusion_matrix', 'confusion_matrix', (['y_test... |
#!/usr/bin/env python
import sys
if __name__ == '__main__':
floor = 0
counter = 0
with open('input', 'r') as f:
for line in f:
for char in line:
counter = counter + 1
if char == '(':
floor = floor + 1
if char == ')':
... | [
"sys.exit"
] | [((489, 500), 'sys.exit', 'sys.exit', (['(0)'], {}), '(0)\n', (497, 500), False, 'import sys\n')] |
from subprocess import call
import os
PAIRWISE_THRESHOLD = 1.e-1
FEATURE_DIFF_THRESHOLD = 1.e-6
class LibSvmFormatter:
def processQueryDocFeatureVector(self,docClickInfo,trainingFile):
'''Expects as input a sorted by queries list or generator that provides the context
for each query in a... | [
"os.path.isfile",
"subprocess.call"
] | [((6078, 6109), 'os.path.isfile', 'os.path.isfile', (['libraryLocation'], {}), '(libraryLocation)\n', (6092, 6109), False, 'import os\n'), ((6120, 6199), 'subprocess.call', 'call', (['[libraryLocation, libraryOptions, trainingFileName, trainedModelFileName]'], {}), '([libraryLocation, libraryOptions, trainingFileName, ... |
from flask import render_template, session, redirect, url_for
from ..models import Destination
from . import main
from .forms import ParameterForm
@main.route('/', methods=['GET', 'POST'])
def index():
form = ParameterForm()
if form.validate_on_submit():
#print(dir(form))
#{'iata_code': 'TLV',... | [
"flask.render_template",
"flask.redirect"
] | [((1468, 1508), 'flask.render_template', 'render_template', (['"""index.html"""'], {'form': 'form'}), "('index.html', form=form)\n", (1483, 1508), False, 'from flask import render_template, session, redirect, url_for\n'), ((1434, 1456), 'flask.redirect', 'redirect', (['redirect_url'], {}), '(redirect_url)\n', (1442, 14... |
# GENERATED BY KOMAND SDK - DO NOT EDIT
import komand
import json
class Component:
DESCRIPTION = "List available modules"
class Input:
pass
class Output:
MODULES = "modules"
class ListAvailableModulesInput(komand.Input):
schema = json.loads("""
{}
""")
def __init__(self):
... | [
"json.loads"
] | [((257, 284), 'json.loads', 'json.loads', (['"""\n {}\n """'], {}), "('\\n {}\\n ')\n", (267, 284), False, 'import json\n'), ((434, 1196), 'json.loads', 'json.loads', (['"""\n {\n "type": "object",\n "title": "Variables",\n "properties": {\n "modules": {\n "type": "array",\n "title": "Availa... |
import traceback
import services # pylint: disable=import-error
from interactions.base.immediate_interaction import ImmediateSuperInteraction # pylint: disable=import-error,no-name-in-module
from singletons import DEFAULT # pylint: disable=import-error
from event_testing.results import TestResult # pylint: disab... | [
"traceback.format_exc",
"services.get_roommate_service",
"services.get_first_client",
"control_any_sim.util.logger.Logger.log",
"control_any_sim.services.selection_group.SelectionGroupService.get",
"services.sim_info_manager",
"services.active_household_id",
"event_testing.results.TestResult"
] | [((2164, 2216), 'control_any_sim.util.logger.Logger.log', 'Logger.log', (['"""running make selectable interaction..."""'], {}), "('running make selectable interaction...')\n", (2174, 2216), False, 'from control_any_sim.util.logger import Logger\n'), ((4559, 4615), 'control_any_sim.util.logger.Logger.log', 'Logger.log',... |
from django.http import HttpResponse
from django.contrib.auth.decorators import login_required
@login_required
def changeProfileIndex(request, tab='company_profile'):
return HttpResponse('Not implemented yet, please come back later!')
@login_required
def profile(request, tab='profile'):
return HttpResponse('Not imp... | [
"django.http.HttpResponse"
] | [((176, 236), 'django.http.HttpResponse', 'HttpResponse', (['"""Not implemented yet, please come back later!"""'], {}), "('Not implemented yet, please come back later!')\n", (188, 236), False, 'from django.http import HttpResponse\n'), ((299, 359), 'django.http.HttpResponse', 'HttpResponse', (['"""Not implemented yet, ... |
import sqlite3
import os
def do_migration(db_dir):
db_path = os.path.join(db_dir, "lbrynet.sqlite")
connection = sqlite3.connect(db_path)
cursor = connection.cursor()
cursor.executescript(
"""
create table reflected_stream (
sd_hash text not null,
reflector_add... | [
"os.path.join",
"sqlite3.connect"
] | [((67, 105), 'os.path.join', 'os.path.join', (['db_dir', '"""lbrynet.sqlite"""'], {}), "(db_dir, 'lbrynet.sqlite')\n", (79, 105), False, 'import os\n'), ((123, 147), 'sqlite3.connect', 'sqlite3.connect', (['db_path'], {}), '(db_path)\n', (138, 147), False, 'import sqlite3\n')] |
import asyncio
from pyppeteer import launch
import aiohttp
import pymongo
import jieba
import jieba.analyse as analyse
import collections
import time
from textrank4zh import TextRank4Keyword, TextRank4Sentence
import re
search_url = 'https://www.zhihu.com/search?range=1w&type=content&q='
get_answers_by_id_url = 'https... | [
"aiohttp.ClientSession",
"asyncio.gather",
"time.sleep",
"textrank4zh.TextRank4Keyword",
"pymongo.MongoClient",
"textrank4zh.TextRank4Sentence",
"asyncio.sleep",
"re.sub",
"asyncio.get_event_loop",
"pyppeteer.launch"
] | [((762, 811), 'pymongo.MongoClient', 'pymongo.MongoClient', (['"""mongodb://localhost:27017/"""'], {}), "('mongodb://localhost:27017/')\n", (781, 811), False, 'import pymongo\n'), ((1425, 1457), 're.sub', 're.sub', (['"""</?\\\\w+[^>]*>"""', '""""""', 'txt'], {}), "('</?\\\\w+[^>]*>', '', txt)\n", (1431, 1457), False, ... |
# This file is part of the airslate.
#
# Copyright (c) 2021 airSlate, Inc.
#
# For the full copyright and license information, please view
# the LICENSE file that was distributed with this source code.
import pickle
import pytest
from airslate.entities.base import filter_included, BaseEntity
from airslate.exceptions... | [
"pickle.dumps",
"airslate.entities.base.BaseEntity.from_collection",
"airslate.entities.base.filter_included",
"airslate.entities.base.BaseEntity.from_one",
"pytest.raises",
"pickle.loads"
] | [((613, 653), 'airslate.entities.base.filter_included', 'filter_included', (['relationships', 'includes'], {}), '(relationships, includes)\n', (628, 653), False, 'from airslate.entities.base import filter_included, BaseEntity\n'), ((826, 855), 'airslate.entities.base.filter_included', 'filter_included', (['{}', 'includ... |
import os,glob
filenames = [os.path.splitext(os.path.basename(f))[0] for f in glob.glob(os.path.dirname(__file__)+"/*.py")]
filenames.remove('__init__')
__all__ = filenames | [
"os.path.dirname",
"os.path.basename"
] | [((46, 65), 'os.path.basename', 'os.path.basename', (['f'], {}), '(f)\n', (62, 65), False, 'import os, glob\n'), ((89, 114), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (104, 114), False, 'import os, glob\n')] |
import time
from AHKManager import AHKManager
class Crafter:
def __init__(self, AHKObj):
""" This loop will run the expected sequence of actions required
to craft based on requested parameters"""
# Parameters for system
self.user_inturrupt = False
self.script = AHKObj
... | [
"AHKManager.AHKManager",
"time.perf_counter",
"time.sleep"
] | [((6247, 6306), 'AHKManager.AHKManager', 'AHKManager', (['"""C:\\\\Program Files\\\\AutoHotkey\\\\AutoHotkey.exe"""'], {}), "('C:\\\\Program Files\\\\AutoHotkey\\\\AutoHotkey.exe')\n", (6257, 6306), False, 'from AHKManager import AHKManager\n'), ((2851, 2870), 'time.perf_counter', 'time.perf_counter', ([], {}), '()\n',... |
import pytest
# Source Code:
def from_roman(roman: str) -> int:
V_number = 0
I_number = 0
if 'V' in roman:
V_indices = roman.index('V')
if V_indices == 1:
V_number = 4
elif V_indices == 0:
V_number = 5
I_after_V = roman.count('I', V_indices)
I_number = I_after_V
else: ... | [
"pytest.mark.parametrize"
] | [((559, 607), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (["['num', 'roman']", 'cases'], {}), "(['num', 'roman'], cases)\n", (582, 607), False, 'import pytest\n'), ((1387, 1436), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (["['num', 'roman']", 'cases2'], {}), "(['num', 'roman'], cases2)\n", (1410,... |
# Copyright 2019 DeepMind Technologies Limited
#
# 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 agr... | [
"open_spiel.python.games.dynamic_routing_utils.Network",
"open_spiel.python.games.dynamic_routing_utils.OriginDestinationDemand",
"open_spiel.python.games.dynamic_routing_utils.Vehicle"
] | [((996, 1099), 'open_spiel.python.games.dynamic_routing_utils.Network', 'dynamic_routing_utils.Network', (["{'bef_O': 'O', 'O': ['A'], 'A': ['D'], 'D': ['aft_D'], 'aft_D': []}"], {}), "({'bef_O': 'O', 'O': ['A'], 'A': ['D'], 'D': [\n 'aft_D'], 'aft_D': []})\n", (1025, 1099), False, 'from open_spiel.python.games impo... |