code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
# -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-08-13 22:43
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('brewery', '0019_auto_20170813_1114'),
]
operations = [
migrations.AddField(... | [
"django.db.models.CharField"
] | [((419, 546), 'django.db.models.CharField', 'models.CharField', ([], {'choices': "[('0', 'pounds'), ('1', 'ounces'), ('2', 'grams'), ('3', 'kilograms')]", 'default': '"""1"""', 'max_length': '(1)'}), "(choices=[('0', 'pounds'), ('1', 'ounces'), ('2', 'grams'),\n ('3', 'kilograms')], default='1', max_length=1)\n", (4... |
from django.shortcuts import render
from django.http import HttpResponse, JsonResponse
from rest_framework.parsers import JSONParser
from django.views.decorators.http import require_POST,require_GET
from django.views.decorators.csrf import csrf_exempt
import datetime
import pandas as pd
from transactions.models import... | [
"transactions.models.transactions.objects.get",
"pandas.DataFrame",
"django.http.JsonResponse",
"datetime.datetime.strptime",
"django.http.HttpResponse",
"transactions.models.transactions.objects.all",
"transactions.serializers.TransactionSerializer",
"rest_framework.parsers.JSONParser",
"transactio... | [((7968, 7994), 'transactions.models.transactions.objects.all', 'transactions.objects.all', ([], {}), '()\n', (7992, 7994), False, 'from transactions.models import transactions\n'), ((8038, 8078), 'django.http.HttpResponse', 'HttpResponse', (['"""All transactions deleted"""'], {}), "('All transactions deleted')\n", (80... |
"""
.. module:: lidar_tour
:platform: Windows
:synopsis: Example starting in west_coast_usa with a vehicle that has a
Lidar attached and drives around the environment using the
builtin AI. Lidar data is displayed using the OpenGL-based
Lidar visualiser.
.. moduleaut... | [
"beamngpy.BeamNGpy",
"beamngpy.setup_logging",
"beamngpy.sensors.Lidar",
"beamngpy.Vehicle",
"beamngpy.Scenario",
"beamngpy.visualiser.LidarVisualiser"
] | [((1002, 1017), 'beamngpy.setup_logging', 'setup_logging', ([], {}), '()\n', (1015, 1017), False, 'from beamngpy import BeamNGpy, Scenario, Vehicle, setup_logging\n'), ((1032, 1123), 'beamngpy.BeamNGpy', 'BeamNGpy', (['"""localhost"""', '(64256)'], {'home': '"""C:/Users/merie/Documents/BeamNG.research.v1.7.0.1"""'}), "... |
from django.conf import settings
from django.contrib.auth.models import AbstractUser
from django.db import models
from django.db.models import F
from django.utils import timezone
from djurls.shorty.utils import encode_custom_base
class User(AbstractUser):
pass
class ShortURL(models.Model):
url = models.URL... | [
"django.db.models.IntegerField",
"django.db.models.ForeignKey",
"django.db.models.F",
"django.db.models.DateTimeField",
"django.utils.timezone.now",
"djurls.shorty.utils.encode_custom_base",
"django.db.models.URLField"
] | [((310, 341), 'django.db.models.URLField', 'models.URLField', ([], {'max_length': '(512)'}), '(max_length=512)\n', (325, 341), False, 'from django.db import models\n'), ((355, 452), 'django.db.models.ForeignKey', 'models.ForeignKey', (['settings.AUTH_USER_MODEL'], {'on_delete': 'models.CASCADE', 'blank': '(True)', 'nul... |
import pytest
from crypto_address_validator.validators import aion_validator as aionv
@pytest.mark.valid
@pytest.mark.address
@pytest.mark.aion
@pytest.mark.parametrize(
'address',
[
# mainnet
'0xa0c24fbbecf42184d1ca8e9401ddaa2a99f69f3560e3d6c673de3c8a0be2a8eb',
'<KEY>',
'0xa00... | [
"pytest.mark.parametrize",
"crypto_address_validator.validators.aion_validator.is_valid_address"
] | [((147, 598), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""address"""', "['0xa0c24fbbecf42184d1ca8e9401ddaa2a99f69f3560e3d6c673de3c8a0be2a8eb',\n '<KEY>',\n '0xa00983f07c11ee9160a64dd3ba3dc3d1f88332a2869f25725f56cbd0be32ef7a',\n '<KEY>', '<KEY>', '<KEY>',\n '0xa0178543726d2018431e51e68815c441... |
# Utility to handle importing the global stylesheet for PyDM widgets
import os
import logging
from qtpy.QtWidgets import QApplication
logger = logging.getLogger(__name__)
# Fallback global stylesheet if there is no global stylesheet provided via env
# variable or command line parameter
GLOBAL_STYLESHEET = os.path.r... | [
"logging.getLogger",
"qtpy.QtWidgets.QApplication.instance",
"os.path.realpath",
"os.getenv"
] | [((145, 172), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (162, 172), False, 'import logging\n'), ((1274, 1297), 'qtpy.QtWidgets.QApplication.instance', 'QApplication.instance', ([], {}), '()\n', (1295, 1297), False, 'from qtpy.QtWidgets import QApplication\n'), ((1744, 1778), 'os.gete... |
import numpy as np
from pyiid.experiments.elasticscatter.kernels.cpu_nxn import *
from ..kernels.cpu_flat import get_normalization_array as flat_norm
from pyiid.experiments.elasticscatter.atomics import pad_pdf
__author__ = 'christopher'
def wrap_fq(atoms, qbin=.1, sum_type='fq'):
"""
Generate the reduced st... | [
"numpy.mean",
"numpy.sum",
"numpy.zeros",
"numpy.seterr",
"numpy.float32",
"numpy.nan_to_num"
] | [((1033, 1064), 'numpy.zeros', 'np.zeros', (['(n, n, 3)', 'np.float32'], {}), '((n, n, 3), np.float32)\n', (1041, 1064), True, 'import numpy as np\n'), ((1126, 1154), 'numpy.zeros', 'np.zeros', (['(n, n)', 'np.float32'], {}), '((n, n), np.float32)\n', (1134, 1154), True, 'import numpy as np\n'), ((1219, 1257), 'numpy.z... |
import astroid.inference
import astroid
from astroid.node_classes import *
from typing import *
from typing import Callable, Union, ForwardRef, _GenericAlias
from astroid.transforms import TransformVisitor
from itertools import chain
from ..typecheck.base import Environment, TypeConstraints, _ann_node_to_type, \
_n... | [
"astroid.transforms.TransformVisitor",
"astroid.parse",
"typing.ForwardRef"
] | [((42451, 42472), 'astroid.parse', 'astroid.parse', (['source'], {}), '(source)\n', (42464, 42472), False, 'import astroid\n'), ((1639, 1657), 'astroid.transforms.TransformVisitor', 'TransformVisitor', ([], {}), '()\n', (1655, 1657), False, 'from astroid.transforms import TransformVisitor\n'), ((7092, 7110), 'astroid.t... |
import argparse
from moviepy.video.io.ffmpeg_tools import ffmpeg_extract_subclip
def extract_subclip(video, start, end, output):
"""Extract video subclip"""
ffmpeg_extract_subclip(video, start, end, targetname=output)
def __main():
"""Main function"""
# Parameters declaration and parsing
ap = ... | [
"moviepy.video.io.ffmpeg_tools.ffmpeg_extract_subclip",
"argparse.ArgumentParser"
] | [((168, 228), 'moviepy.video.io.ffmpeg_tools.ffmpeg_extract_subclip', 'ffmpeg_extract_subclip', (['video', 'start', 'end'], {'targetname': 'output'}), '(video, start, end, targetname=output)\n', (190, 228), False, 'from moviepy.video.io.ffmpeg_tools import ffmpeg_extract_subclip\n'), ((320, 345), 'argparse.ArgumentPars... |
import RPi.GPIO as GPIO
from time import sleep, time
from threading import Thread
class UltrasonicSensor:
def __init__(self, echo, trig, setup=GPIO.BOARD):
self.echo = echo
self.trig = trig
self.Time = 0
self.currentValue = 0
GPIO.setmode(setup)
GPIO.setup(self... | [
"RPi.GPIO.setup",
"RPi.GPIO.output",
"time.sleep",
"RPi.GPIO.input",
"threading.Thread",
"time.time",
"RPi.GPIO.setmode"
] | [((276, 295), 'RPi.GPIO.setmode', 'GPIO.setmode', (['setup'], {}), '(setup)\n', (288, 295), True, 'import RPi.GPIO as GPIO\n'), ((305, 336), 'RPi.GPIO.setup', 'GPIO.setup', (['self.trig', 'GPIO.OUT'], {}), '(self.trig, GPIO.OUT)\n', (315, 336), True, 'import RPi.GPIO as GPIO\n'), ((345, 375), 'RPi.GPIO.setup', 'GPIO.se... |
import logging
import argparse
from OnnxParser import OnnxParser
from Generator import Generator
import utils
def parse_args():
parser = argparse.ArgumentParser()
parser.add_argument('-m', '--onnx_model', help='input onnx model', required=True)
parser.add_argument('--aprec', help='Activation precision', re... | [
"Generator.Generator",
"argparse.ArgumentParser",
"OnnxParser.OnnxParser",
"utils.gen_test_vecs",
"sys.exit"
] | [((142, 167), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (165, 167), False, 'import argparse\n'), ((1043, 1065), 'OnnxParser.OnnxParser', 'OnnxParser', (['model_path'], {}), '(model_path)\n', (1053, 1065), False, 'from OnnxParser import OnnxParser\n'), ((1303, 1361), 'Generator.Generator', ... |
import io
import os
import unittest
from flask import Response
from tests.test_web_base import TestWebBase
from hedweb.constants import base_constants
class Test(TestWebBase):
def test_events_results_empty_data(self):
response = self.app.test.post('/events_submit')
self.assertEqual(200,... | [
"unittest.main",
"os.path.abspath"
] | [((7476, 7491), 'unittest.main', 'unittest.main', ([], {}), '()\n', (7489, 7491), False, 'import unittest\n'), ((908, 933), 'os.path.abspath', 'os.path.abspath', (['__file__'], {}), '(__file__)\n', (923, 933), False, 'import os\n'), ((1016, 1041), 'os.path.abspath', 'os.path.abspath', (['__file__'], {}), '(__file__)\n'... |
from start import client
from telethon import events
@client.on(events.NewMessage(incoming=True, func=lambda e: e.is_private))
async def my_event_handler(event):
if event.chat_id not in white:
await client.send_message(event.chat_id,CUSTOM_TEXT['pm']) | [
"start.client.send_message",
"telethon.events.NewMessage"
] | [((64, 125), 'telethon.events.NewMessage', 'events.NewMessage', ([], {'incoming': '(True)', 'func': '(lambda e: e.is_private)'}), '(incoming=True, func=lambda e: e.is_private)\n', (81, 125), False, 'from telethon import events\n'), ((211, 264), 'start.client.send_message', 'client.send_message', (['event.chat_id', "CUS... |
from axil_cdc import AxilCDC
from axilite2bft import AxiLite2Bft
from bft import Bft
from litex.soc.interconnect.axi import AXILiteInterface, AXIStreamInterface
from litex.soc.interconnect.stream import (ClockDomainCrossing, Converter,
Endpoint)
from migen import *
from pld_ax... | [
"litex.soc.interconnect.axi.AXILiteInterface"
] | [((5719, 5794), 'litex.soc.interconnect.axi.AXILiteInterface', 'AXILiteInterface', ([], {'data_width': '(32)', 'address_width': '(5)', 'clock_domain': 'clock_domain'}), '(data_width=32, address_width=5, clock_domain=clock_domain)\n', (5735, 5794), False, 'from litex.soc.interconnect.axi import AXILiteInterface, AXIStre... |
import system
import util
import lexer
class Parser:
def __init__(self,code : str, keywords : list):
self.code : str = code
self.lines : list = code.split('\n')
self.keywords : list = keywords
self.result = None
self.fofError()
def fofError(se... | [
"lexer.elseError",
"util.replace",
"system.error"
] | [((350, 378), 'system.error', 'system.error', (['self.code', '"""\\""""'], {}), '(self.code, \'"\')\n', (362, 378), False, 'import system\n'), ((1052, 1078), 'lexer.elseError', 'lexer.elseError', (['self.code'], {}), '(self.code)\n', (1067, 1078), False, 'import lexer\n'), ((427, 455), 'system.error', 'system.error', (... |
'''
Abstraction of machine learning model
Authors: <NAME>, <NAME>
'''
import os
import multiprocessing
import logging
import warnings
import itertools
import numpy as np
import scipy as sp
from sklearn.svm import SVC
from sklearn.naive_bayes import GaussianNB
from sklearn.linear_model import SGDClassifier
from sklea... | [
"scipy.stats.randint",
"vaderSentiment.vaderSentiment.SentimentIntensityAnalyzer",
"smapp_text_classifier.vectorizers.CachedCountVectorizer",
"sklearn.linear_model.SGDClassifier",
"smapp_text_classifier.vectorizers.CachedEmbeddingVectorizer",
"sklearn.feature_selection.chi2",
"logging.debug",
"os.path... | [((4198, 4241), 'sklearn.ensemble.RandomForestClassifier', 'RandomForestClassifier', ([], {'max_features': '"""auto"""'}), "(max_features='auto')\n", (4220, 4241), False, 'from sklearn.ensemble import RandomForestClassifier\n'), ((6341, 6530), 'smapp_text_classifier.vectorizers.CachedEmbeddingVectorizer', 'CachedEmbedd... |
from api.parser.utils import sanitize
def test_sanitize():
assert sanitize("hello world") == "hello world"
assert sanitize(" hello world ") == "hello world"
assert sanitize(" \thello\nworld ") == "hello world" | [
"api.parser.utils.sanitize"
] | [((71, 94), 'api.parser.utils.sanitize', 'sanitize', (['"""hello world"""'], {}), "('hello world')\n", (79, 94), False, 'from api.parser.utils import sanitize\n'), ((123, 153), 'api.parser.utils.sanitize', 'sanitize', (['""" hello world """'], {}), "(' hello world ')\n", (131, 153), False, 'from api.parser.ut... |
from eth import constants
from eth.chains.mainnet import MainnetChain
from eth.db.atomic import AtomicDB
from eth_utils import to_wei, encode_hex
MOCK_ADDRESS = constants.ZERO_ADDRESS
DEFAULT_INITIAL_BALANCE = to_wei(10000, 'ether')
GENESIS_PARAMS = {
'parent_hash': constants.GENESIS_PARENT_HASH,
'uncles_hash... | [
"eth.db.atomic.AtomicDB",
"eth_utils.to_wei",
"eth_utils.encode_hex"
] | [((212, 234), 'eth_utils.to_wei', 'to_wei', (['(10000)', '"""ether"""'], {}), "(10000, 'ether')\n", (218, 234), False, 'from eth_utils import to_wei, encode_hex\n'), ((911, 921), 'eth.db.atomic.AtomicDB', 'AtomicDB', ([], {}), '()\n', (919, 921), False, 'from eth.db.atomic import AtomicDB\n'), ((1093, 1117), 'eth_utils... |
from django.urls import include, path
from .views import BookAPIView
from todos.views import ListTodo, DetailTodo
urlpatterns = [
path('todos/', ListTodo.as_view()),
path('todos/<int:pk>/', DetailTodo.as_view()),
path('', BookAPIView.as_view()),
]
| [
"todos.views.ListTodo.as_view",
"todos.views.DetailTodo.as_view"
] | [((150, 168), 'todos.views.ListTodo.as_view', 'ListTodo.as_view', ([], {}), '()\n', (166, 168), False, 'from todos.views import ListTodo, DetailTodo\n'), ((199, 219), 'todos.views.DetailTodo.as_view', 'DetailTodo.as_view', ([], {}), '()\n', (217, 219), False, 'from todos.views import ListTodo, DetailTodo\n')] |
"""Contains AST visitor class used to parse a state machine definition"""
import ast
from collections import deque, OrderedDict
import logging
from typing import Any, Dict, List, Optional
import astor
import networkx as nx
from fluxio_parser.exceptions import assert_supported_operation, UnsupportedOperation
from flux... | [
"fluxio_parser.util.hash_node",
"collections.OrderedDict",
"collections.deque",
"logging.debug",
"fluxio_parser.exceptions.assert_supported_operation",
"astor.to_source",
"networkx.DiGraph",
"fluxio_parser.exceptions.UnsupportedOperation",
"fluxio_parser.states.create_task_state"
] | [((4173, 4186), 'collections.deque', 'deque', (['[None]'], {}), '([None])\n', (4178, 4186), False, 'from collections import deque, OrderedDict\n'), ((4740, 4752), 'networkx.DiGraph', 'nx.DiGraph', ([], {}), '()\n', (4750, 4752), True, 'import networkx as nx\n'), ((7287, 7354), 'logging.debug', 'logging.debug', (['f"""A... |
from django.conf import settings
from django.conf.urls import url
from django.contrib.auth.views import (LogoutView, PasswordResetView, PasswordResetDoneView,
PasswordResetConfirmView, PasswordResetCompleteView)
from waffle.decorators import waffle_switch
from apps.accounts.views.... | [
"django.contrib.auth.views.PasswordResetDoneView.as_view",
"django.conf.urls.url",
"django.contrib.auth.views.PasswordResetCompleteView.as_view",
"apps.accounts.views.login.LoginView.as_view",
"django.contrib.auth.views.PasswordResetConfirmView.as_view",
"apps.accounts.views.login.PasswordChangeView.as_vi... | [((532, 586), 'django.conf.urls.url', 'url', (['"""^api/profile$"""', 'my_profile'], {'name': '"""my_profile_v2"""'}), "('^api/profile$', my_profile, name='my_profile_v2')\n", (535, 586), False, 'from django.conf.urls import url\n'), ((788, 851), 'django.conf.urls.url', 'url', (['"""^settings$"""', 'account_settings'],... |
import requests
from ruamel.yaml import YAML
from bs4 import BeautifulSoup
import threading
from concurrent.futures import ThreadPoolExecutor
from functools import partial
import logging
import chatbot.constants as const
import os
import time
class Crawler:
# initialises a crawler object
def __init__(self, th... | [
"logging.getLogger",
"os.path.exists",
"os.makedirs",
"concurrent.futures.ThreadPoolExecutor",
"requests.get",
"ruamel.yaml.YAML",
"bs4.BeautifulSoup",
"threading.get_ident",
"functools.partial",
"time.time"
] | [((1089, 1116), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1106, 1116), False, 'import logging\n'), ((1989, 1995), 'ruamel.yaml.YAML', 'YAML', ([], {}), '()\n', (1993, 1995), False, 'from ruamel.yaml import YAML\n'), ((2525, 2582), 'requests.get', 'requests.get', (['url'], {'headers'... |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft and contributors. 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 ... | [
"uuid.uuid1",
"msrest.pipeline.ClientRawResponse",
"msrestazure.azure_exceptions.CloudError",
"msrestazure.azure_operation.AzureOperationPoller"
] | [((8641, 8766), 'msrestazure.azure_operation.AzureOperationPoller', 'AzureOperationPoller', (['long_running_send', 'get_long_running_output', 'get_long_running_status', 'long_running_operation_timeout'], {}), '(long_running_send, get_long_running_output,\n get_long_running_status, long_running_operation_timeout)\n',... |
'''
Author: sapatel91
Date: March 2, 2014
File: lightsControl4.py
Purpose: Set or get Control4 light intensity
Disclaimer: USE AT YOUR RISK, I TAKE NO RESPONSIBILITY
Most likely there won't be any though
'''
import socket
import time
from bs4 import BeautifulSoup
# Insert the IP of your Con... | [
"bs4.BeautifulSoup",
"socket.socket"
] | [((624, 673), 'socket.socket', 'socket.socket', (['socket.AF_INET', 'socket.SOCK_STREAM'], {}), '(socket.AF_INET, socket.SOCK_STREAM)\n', (637, 673), False, 'import socket\n'), ((1318, 1367), 'socket.socket', 'socket.socket', (['socket.AF_INET', 'socket.SOCK_STREAM'], {}), '(socket.AF_INET, socket.SOCK_STREAM)\n', (133... |
from django.contrib import admin
from django.urls import path,include
from .views import AuntViewset, UncleViewset, CousinViewset, GrandparentViewset, FamilyTreeViewset
from .views import ListRoutes, SiblingViewset, DeleteAccount
from rest_framework.routers import DefaultRouter
router = DefaultRouter()
router.registe... | [
"django.urls.path",
"rest_framework.routers.DefaultRouter",
"django.urls.include"
] | [((290, 305), 'rest_framework.routers.DefaultRouter', 'DefaultRouter', ([], {}), '()\n', (303, 305), False, 'from rest_framework.routers import DefaultRouter\n'), ((712, 732), 'django.urls.path', 'path', (['""""""', 'ListRoutes'], {}), "('', ListRoutes)\n", (716, 732), False, 'from django.urls import path, include\n'),... |
#!/usr/bin/env python
import my_func1
my_func1.hw()
| [
"my_func1.hw"
] | [((40, 53), 'my_func1.hw', 'my_func1.hw', ([], {}), '()\n', (51, 53), False, 'import my_func1\n')] |
import time
import datetime
now = datetime.datetime.now()
mid = datetime.datetime(now.year, now.month, now.day) + datetime.timedelta(1)
while True:
now = datetime.datetime.now()
if mid < now < mid + datetime.timedelta(seconds=10) :
print("정각입니다")
mid = datetime.datetime(now.year, now.month, n... | [
"datetime.datetime",
"datetime.datetime.now",
"datetime.timedelta",
"time.sleep"
] | [((35, 58), 'datetime.datetime.now', 'datetime.datetime.now', ([], {}), '()\n', (56, 58), False, 'import datetime\n'), ((65, 112), 'datetime.datetime', 'datetime.datetime', (['now.year', 'now.month', 'now.day'], {}), '(now.year, now.month, now.day)\n', (82, 112), False, 'import datetime\n'), ((115, 136), 'datetime.time... |
"""Python: Lab9.1(Moduls)
<NAME>, pm- 12343"""
def GuessNumber():
from random import randint
randNumber = randint(0,10)
userNumber = int(input('Your number = '))
if randNumber == userNumber:
print('Victory!!!')
else:
print('The right number was {}. Try again'.format(randNumber))
... | [
"random.randint"
] | [((114, 128), 'random.randint', 'randint', (['(0)', '(10)'], {}), '(0, 10)\n', (121, 128), False, 'from random import randint\n')] |
from flask import render_template, request
from mass_flask_core.models import Sample
from mass_flask_core.utils import PaginationFunctions
from mass_flask_webui.config import webui_blueprint
from mass_flask_webui.forms.sample_search import SampleSearchForm
def _is_present_and_not_empty(form_data, variable):
retu... | [
"flask.render_template",
"mass_flask_webui.config.webui_blueprint.route",
"mass_flask_webui.forms.sample_search.SampleSearchForm"
] | [((2612, 2669), 'mass_flask_webui.config.webui_blueprint.route', 'webui_blueprint.route', (['"""/search/sample/"""'], {'methods': "['GET']"}), "('/search/sample/', methods=['GET'])\n", (2633, 2669), False, 'from mass_flask_webui.config import webui_blueprint\n'), ((2702, 2741), 'mass_flask_webui.forms.sample_search.Sam... |
# @l2g 1943 python3
# [1943] Describe the Painting
# Difficulty: Medium
# https://leetcode.com/problems/describe-the-painting
#
# There is a long and thin painting that can be represented by a number line.
# The painting was painted with multiple overlapping segments where each segment was painted with a unique color.
... | [
"os.path.join"
] | [((3702, 3739), 'os.path.join', 'os.path.join', (['"""tests"""', '"""test_1943.py"""'], {}), "('tests', 'test_1943.py')\n", (3714, 3739), False, 'import os\n')] |
# -*- coding: utf-8 -*-
import re
from os import path
class JstlPathResolver:
def __init__(self, view, str_lookup, current_dir, roots, lang, settings):
self.view = view
self.import_line_regex = settings.get('import_line_regex', {})[lang]
prog = re.compile(self.import_line_regex[0])
... | [
"os.path.isfile",
"re.split",
"os.path.join",
"re.compile"
] | [((275, 312), 're.compile', 're.compile', (['self.import_line_regex[0]'], {}), '(self.import_line_regex[0])\n', (285, 312), False, 'import re\n'), ((1801, 1822), 're.compile', 're.compile', (['regex_str'], {}), '(regex_str)\n', (1811, 1822), False, 'import re\n'), ((1366, 1408), 'os.path.join', 'path.join', (['self.cur... |
import inspect
import json
from django.http import FileResponse
from django.shortcuts import HttpResponseRedirect
from webapp.controller.search.search_param_deal_down import search_parameter
from webapp.controller.renderUtil import render_result
from webapp.controller.search.search_common import *
from webapp.utils.all... | [
"inspect.stack",
"webapp.controller.search.search_param_deal_down.search_parameter",
"json.dumps",
"django.http.FileResponse",
"django.shortcuts.HttpResponseRedirect",
"webapp.controller.renderUtil.render_result"
] | [((4668, 4766), 'django.shortcuts.HttpResponseRedirect', 'HttpResponseRedirect', (["('/report/report_download_page?file_uuid=' + file_uuid + file_message_one)"], {}), "('/report/report_download_page?file_uuid=' + file_uuid +\n file_message_one)\n", (4688, 4766), False, 'from django.shortcuts import HttpResponseRedir... |
'''
Kodi video capturer for Hyperion
Copyright (c) 2013-2016 Hyperion Team
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 th... | [
"xbmc.RenderCapture",
"misc.log",
"xbmcaddon.Addon",
"hyperion.Hyperion.Hyperion",
"xbmc.sleep"
] | [((1516, 1550), 'misc.log', 'log', (['"""Entering disconnected state"""'], {}), "('Entering disconnected state')\n", (1519, 1550), False, 'from misc import log\n'), ((2577, 2608), 'misc.log', 'log', (['"""Entering connected state"""'], {}), "('Entering connected state')\n", (2580, 2608), False, 'from misc import log\n'... |
import torch
from omegaconf import DictConfig
from torch.nn import CrossEntropyLoss, Dropout, Identity
from transformers import PreTrainedModel, AdamW, PreTrainedTokenizer, AutoTokenizer, AutoModel
from models.event_detection.src.models import SequenceClassification
from models.event_detection.src.models.heads.protot... | [
"transformers.AutoModel.from_pretrained",
"torch.unique",
"torch.nn.Dropout",
"models.event_detection.src.models.heads.prototypical_head.PrototypicalHead",
"torch.nn.CrossEntropyLoss",
"models.event_detection.src.schema.PrototypicalNetworksForwardOutput",
"transformers.AutoTokenizer.from_pretrained",
... | [((715, 733), 'torch.nn.CrossEntropyLoss', 'CrossEntropyLoss', ([], {}), '()\n', (731, 733), False, 'from torch.nn import CrossEntropyLoss, Dropout, Identity\n'), ((757, 790), 'torch.nn.Dropout', 'Dropout', ([], {'p': 'cfg.model.dropout_rate'}), '(p=cfg.model.dropout_rate)\n', (764, 790), False, 'from torch.nn import C... |
from cytoolz import cons
from cytoolz import merge
from merlin import specs
def test_only():
registry = [{'key': 1, 'ubid': 'a'}, {'key': 2, 'ubid': 'b'},
{'key': 3, 'ubid': 'c'}, {'key': 4, 'ubid': 'd'}]
expected = tuple([{'key': 1, 'ubid': 'a'}, {'key': 4, 'ubid': 'd'}])
result = spec... | [
"cytoolz.cons",
"merlin.specs.only",
"merlin.specs.ubids",
"merlin.specs.refspec",
"merlin.specs.mapped",
"merlin.specs.index",
"merlin.specs.exist"
] | [((316, 360), 'merlin.specs.only', 'specs.only', ([], {'ubids': "['a', 'd']", 'specs': 'registry'}), "(ubids=['a', 'd'], specs=registry)\n", (326, 360), False, 'from merlin import specs\n'), ((480, 524), 'merlin.specs.only', 'specs.only', ([], {'ubids': "['d', 'a']", 'specs': 'registry'}), "(ubids=['d', 'a'], specs=reg... |
from account_checking import AccountChecking
def method1():
print('method1 starts')
method2()
print('method1 ends')
def method2():
print('method2 starts')
ac = AccountChecking('111-1', 'Rose', 0)
for i in range(1, 15):
ac.deposit(i + 1000)
print(ac.balance)
if (i == 5):... | [
"account_checking.AccountChecking"
] | [((182, 217), 'account_checking.AccountChecking', 'AccountChecking', (['"""111-1"""', '"""Rose"""', '(0)'], {}), "('111-1', 'Rose', 0)\n", (197, 217), False, 'from account_checking import AccountChecking\n')] |
import json
import pytest
import uuid
from pytest_httpx import HTTPXMock
from tinkoff import tasks
pytestmark = [pytest.mark.django_db]
@pytest.fixture
def idempotency_key() -> str:
return str(uuid.uuid4())
def test(order, idempotency_key, httpx_mock: HTTPXMock):
httpx_mock.add_response(
url=f'htt... | [
"pytest.mark.xfail",
"tinkoff.tasks.commit_dolyame_order",
"uuid.uuid4"
] | [((876, 951), 'pytest.mark.xfail', 'pytest.mark.xfail', ([], {'strict': '(True)', 'reason': '"""Just to make sure above code works"""'}), "(strict=True, reason='Just to make sure above code works')\n", (893, 951), False, 'import pytest\n'), ((490, 568), 'tinkoff.tasks.commit_dolyame_order', 'tasks.commit_dolyame_order'... |
import matplotlib.pyplot as plt
import random
from datetime import datetime
from PID.pid_controller import *
from simulation.sim import *
from states.states import *
from controls import controls
# set constants & gains
kp = yaw_kp
setpoint = yaw_setpoint
# data for plotting
yaw_data = []
# set current date & time
... | [
"matplotlib.pyplot.grid",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.style.use",
"matplotlib.pyplot.axhline",
"datetime.datetime.now",
"matplotlib.pyplot.title",
"matplotlib.pyplot.legend"
] | [((339, 353), 'datetime.datetime.now', 'datetime.now', ([], {}), '()\n', (351, 353), False, 'from datetime import datetime\n'), ((1777, 1819), 'matplotlib.pyplot.plot', 'plt.plot', (['yaw_data'], {'color': '"""r"""', 'label': '"""yaw"""'}), "(yaw_data, color='r', label='yaw')\n", (1785, 1819), True, 'import matplotlib.... |
# 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\visualization\connectivity_handles_visualizer.py
# Compiled at: 2013-03-15 17:13:49
# Size of source... | [
"debugvis.Context",
"services.current_zone",
"services.object_manager"
] | [((915, 948), 'debugvis.Context', 'Context', (['self.layer'], {'altitude': '(0.1)'}), '(self.layer, altitude=0.1)\n', (922, 948), False, 'from debugvis import Context\n'), ((554, 577), 'services.current_zone', 'services.current_zone', ([], {}), '()\n', (575, 577), False, 'import services, sims4.color\n'), ((676, 699), ... |
import json
from rule_data import RuleData
from rule_action import RuleAction
from rule_condition import RuleCondition
from rule_variable import RuleVariable
class RuleTemplate:
def load_from_json(self, json_template):
self.name = json_template.get("name")
json_scope = json_template.get('scope')
... | [
"rule_data.RuleData",
"rule_condition.RuleCondition"
] | [((339, 349), 'rule_data.RuleData', 'RuleData', ([], {}), '()\n', (347, 349), False, 'from rule_data import RuleData\n'), ((1487, 1528), 'rule_condition.RuleCondition', 'RuleCondition', ([], {'expression': 'json_expression'}), '(expression=json_expression)\n', (1500, 1528), False, 'from rule_condition import RuleCondit... |
from flask import Flask, render_template, request, send_file
import io
import base64 as b64
import generator
app = Flask(__name__)
def page(**kwargs):
return render_template('main.html', **kwargs)
@app.route("/")
def home():
return page()
@app.route("/<text>", methods=['GET'])
def load_origamicon(text)... | [
"flask.render_template",
"flask.Flask",
"base64.b64encode",
"io.BytesIO",
"flask.send_file",
"generator.create_origamicon"
] | [((118, 133), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (123, 133), False, 'from flask import Flask, render_template, request, send_file\n'), ((167, 205), 'flask.render_template', 'render_template', (['"""main.html"""'], {}), "('main.html', **kwargs)\n", (182, 205), False, 'from flask import Flask, re... |
import logging
from referencelistparser.states.base import BaseState
from scriptureref import ScriptureRef
logger = logging.getLogger(__file__)
class ReferenceState(BaseState):
def __init__(self, old_state, book):
super().__init__(old_state)
self.book = book
self.url = None
def hand... | [
"logging.getLogger",
"scriptureref.ScriptureRef"
] | [((118, 145), 'logging.getLogger', 'logging.getLogger', (['__file__'], {}), '(__file__)\n', (135, 145), False, 'import logging\n'), ((640, 668), 'scriptureref.ScriptureRef', 'ScriptureRef', (['self.url', 'data'], {}), '(self.url, data)\n', (652, 668), False, 'from scriptureref import ScriptureRef\n')] |
from setuptools import setup
# from disutils.core import setup
import os
import py2exe
import matplotlib
from setuptools import findall
matplotlibdatadir = matplotlib.get_data_path()
matplotlibdata = findall(matplotlibdatadir)
matplotlibdata_files = []
for f in matplotlibdata:
dirname = os.path.join('matplotlibda... | [
"setuptools.findall",
"setuptools.setup",
"matplotlib.get_data_path",
"os.path.split"
] | [((158, 184), 'matplotlib.get_data_path', 'matplotlib.get_data_path', ([], {}), '()\n', (182, 184), False, 'import matplotlib\n'), ((202, 228), 'setuptools.findall', 'findall', (['matplotlibdatadir'], {}), '(matplotlibdatadir)\n', (209, 228), False, 'from setuptools import findall\n'), ((2134, 2336), 'setuptools.setup'... |
import pendulum
import pytest
import prefect.schedules.filters as filters
def test_on_datetime_0():
filter_fn = filters.on_datetime(pendulum.datetime(2019, 1, 2, 3, 4, 5))
assert filter_fn(pendulum.datetime(2019, 1, 2, 3, 4, 5))
def test_on_datetime_1():
filter_fn = filters.on_datetime(pendulum.datetim... | [
"prefect.schedules.filters.is_day_of_week",
"prefect.schedules.filters.between_datetimes",
"pendulum.time",
"prefect.schedules.filters.between_dates",
"pytest.mark.parametrize",
"prefect.schedules.filters.is_month_end",
"pendulum.datetime",
"prefect.schedules.filters.between_times",
"prefect.schedul... | [((1848, 2035), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""test_dates"""', '[((1, 1, 12, 31), True), ((6, 1, 6, 1), True), ((5, 31, 6, 2), True), ((6, \n 2, 5, 31), False), ((6, 2, 7, 1), False), ((11, 1, 7, 1), True)]'], {}), "('test_dates', [((1, 1, 12, 31), True), ((6, 1, 6, 1\n ), True), ((5,... |
from sourcelyzer.dao import Base
from sqlalchemy import Column, Integer, String, Boolean, DateTime
import datetime
class Session(Base):
__tablename__ = 'sourcelyzer_sessions'
session_id = Column(Integer, primary_key=True, autoincrement=True)
user_id = Column(Integer)
created_on = Column(DateTime)
... | [
"sqlalchemy.Column"
] | [((198, 251), 'sqlalchemy.Column', 'Column', (['Integer'], {'primary_key': '(True)', 'autoincrement': '(True)'}), '(Integer, primary_key=True, autoincrement=True)\n', (204, 251), False, 'from sqlalchemy import Column, Integer, String, Boolean, DateTime\n'), ((266, 281), 'sqlalchemy.Column', 'Column', (['Integer'], {}),... |
#!/usr/bin/env python3
"""
Smooth an image.
Created 7/19/2021 by <NAME>.
<EMAIL>
"""
# Import external modules and libraries.
from os import PathLike
import subprocess
from pathlib import Path
def main(image: PathLike, fwhm: str, prefix: PathLike) -> None:
"""
Smooth an image.
3dmerge info: https://afni.... | [
"subprocess.run",
"pathlib.Path"
] | [((616, 636), 'subprocess.run', 'subprocess.run', (['args'], {}), '(args)\n', (630, 636), False, 'import subprocess\n'), ((413, 425), 'pathlib.Path', 'Path', (['prefix'], {}), '(prefix)\n', (417, 425), False, 'from pathlib import Path\n')] |
# %% Packages
from utils.args import get_args
from utils.config import process_config
from generator import generator_model
from discriminator import discriminator_model
from trainer import GanTrainer
# %% Load images
def main():
args = get_args()
config = process_config(args.config)
print("Calling Ge... | [
"discriminator.discriminator_model",
"generator.generator_model",
"utils.config.process_config",
"trainer.GanTrainer",
"utils.args.get_args"
] | [((246, 256), 'utils.args.get_args', 'get_args', ([], {}), '()\n', (254, 256), False, 'from utils.args import get_args\n'), ((270, 297), 'utils.config.process_config', 'process_config', (['args.config'], {}), '(args.config)\n', (284, 297), False, 'from utils.config import process_config\n'), ((352, 375), 'generator.gen... |
__author__ = "<NAME>"
__copyright__ = "Copyright 2021, <NAME>"
__version__ = "0.0.1"
__maintainer__ = "<NAME>"
__email__ = "<EMAIL> "
__status__ = "Production"
"""
Class of all the links on the game.
It's possible to create a new link and call it from the main file.
To take in consideration that the link i... | [
"src.pages.credits.Game_Credits",
"src.pages.start.Game_start",
"src.pages.pause_menu.Game_Pause_Menu",
"src.pages.quit.Game_quit",
"src.game_components.game.Game_loop",
"src.pages.menu.Game_menu",
"src.pages.game_over.Game_over"
] | [((1262, 1282), 'src.pages.start.Game_start', 'Game_start', (['game_obj'], {}), '(game_obj)\n', (1272, 1282), False, 'from src.pages.start import Game_start\n'), ((1483, 1502), 'src.pages.menu.Game_menu', 'Game_menu', (['game_obj'], {}), '(game_obj)\n', (1492, 1502), False, 'from src.pages.menu import Game_menu\n'), ((... |
#encoding:utf-8
import cv2, numpy, sys, pickle
from detector import Detector
AREA_MIN = 1000
AREA_MAX = 10000
AZUL_MIN = numpy.array([100, 150, 110], numpy.uint8)
AZUL_MAX = numpy.array([130, 255, 255], numpy.uint8)
BLANCO_MIN = cv2.mean((200, 200, 200))
BLANCO_MAX = cv2.mean((255, 255, 255))
class Calibra... | [
"detector.Detector",
"numpy.array",
"sys.exit",
"cv2.waitKey",
"cv2.mean"
] | [((128, 169), 'numpy.array', 'numpy.array', (['[100, 150, 110]', 'numpy.uint8'], {}), '([100, 150, 110], numpy.uint8)\n', (139, 169), False, 'import cv2, numpy, sys, pickle\n'), ((182, 223), 'numpy.array', 'numpy.array', (['[130, 255, 255]', 'numpy.uint8'], {}), '([130, 255, 255], numpy.uint8)\n', (193, 223), False, 'i... |
import helixtiltrot as htr
# input coordinate files
pdb = 'transmembrane-alpha-helix.pdb'
xtc = 'transmembrane-alpha-helix.xtc'
ca, dssp = htr.load_ca_dssp(xtc, top=pdb)
# create numpy mask called sse_mask, such that
# sse_mask[n,i] == True if the residue i at time step n
# is either alpha-helix (H), pi-helix (... | [
"helixtiltrot.plot.rotation",
"helixtiltrot.sse_mask",
"helixtiltrot.load_ca_dssp",
"helixtiltrot.rotation_angle"
] | [((144, 174), 'helixtiltrot.load_ca_dssp', 'htr.load_ca_dssp', (['xtc'], {'top': 'pdb'}), '(xtc, top=pdb)\n', (160, 174), True, 'import helixtiltrot as htr\n'), ((347, 376), 'helixtiltrot.sse_mask', 'htr.sse_mask', (['dssp'], {'sse': '"""HIG"""'}), "(dssp, sse='HIG')\n", (359, 376), True, 'import helixtiltrot as htr\n'... |
from flask import render_template
from otvoreniproracun.core import app, sites, pages
from otvoreniproracun.util import JSONEncoder
@app.route('/<slug>/')
def site(slug, template='site.html'):
site = sites.get(slug)
site_json = JSONEncoder().encode(site)
return render_template(template, site=site, site_j... | [
"flask.render_template",
"otvoreniproracun.util.JSONEncoder",
"otvoreniproracun.core.app.route",
"otvoreniproracun.core.pages.get_or_404",
"otvoreniproracun.core.sites.get"
] | [((136, 157), 'otvoreniproracun.core.app.route', 'app.route', (['"""/<slug>/"""'], {}), "('/<slug>/')\n", (145, 157), False, 'from otvoreniproracun.core import app, sites, pages\n'), ((338, 365), 'otvoreniproracun.core.app.route', 'app.route', (['"""/<slug>/embed/"""'], {}), "('/<slug>/embed/')\n", (347, 365), False, '... |
# Generated by Django 2.0.3 on 2018-03-20 23:50
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('project_admin', '0007_auto_20180319_1030'),
]
operations = [
migrations.RemoveField(
model_name='projectmember',
nam... | [
"django.db.migrations.RemoveField",
"django.db.models.ManyToManyField",
"django.db.models.TextField"
] | [((241, 305), 'django.db.migrations.RemoveField', 'migrations.RemoveField', ([], {'model_name': '"""projectmember"""', 'name': '"""group"""'}), "(model_name='projectmember', name='group')\n", (263, 305), False, 'from django.db import migrations, models\n'), ((460, 488), 'django.db.models.TextField', 'models.TextField',... |
import numpy as np
from PIL import Image
from scipy.ndimage.morphology import binary_erosion
from improc3d import quantile_scale, calc_bbox3d
from .utils import MIN_UINT8, MAX_UINT8
from .utils import assign_colors, compose_image_and_labels
class ImageRenderer:
"""Renders slices from a 3D image using PIL.
N... | [
"PIL.Image.fromarray",
"numpy.unique",
"improc3d.quantile_scale",
"numpy.max",
"PIL.Image.alpha_composite",
"numpy.min",
"scipy.ndimage.morphology.binary_erosion",
"improc3d.calc_bbox3d"
] | [((1066, 1132), 'improc3d.quantile_scale', 'quantile_scale', (['self.image'], {'lower_th': 'MIN_UINT8', 'upper_th': 'MAX_UINT8'}), '(self.image, lower_th=MIN_UINT8, upper_th=MAX_UINT8)\n', (1080, 1132), False, 'from improc3d import quantile_scale, calc_bbox3d\n'), ((1575, 1593), 'numpy.min', 'np.min', (['self.image'], ... |
from vnpy.event import EventEngine, Event
from vnpy.trader.engine import MainEngine
from vnpy.trader.ui import QtWidgets, QtCore
from ..engine import APP_NAME, EVENT_RPC_LOG
class RpcManager(QtWidgets.QWidget):
""""""
signal_log = QtCore.pyqtSignal(Event)
def __init__(self, main_engine: MainEngine, event... | [
"vnpy.trader.ui.QtWidgets.QLineEdit",
"vnpy.trader.ui.QtWidgets.QPushButton",
"vnpy.trader.ui.QtCore.pyqtSignal",
"vnpy.trader.ui.QtWidgets.QVBoxLayout",
"vnpy.trader.ui.QtWidgets.QFormLayout",
"vnpy.trader.ui.QtWidgets.QTextEdit",
"vnpy.trader.ui.QtWidgets.QHBoxLayout"
] | [((241, 265), 'vnpy.trader.ui.QtCore.pyqtSignal', 'QtCore.pyqtSignal', (['Event'], {}), '(Event)\n', (258, 265), False, 'from vnpy.trader.ui import QtWidgets, QtCore\n'), ((757, 792), 'vnpy.trader.ui.QtWidgets.QPushButton', 'QtWidgets.QPushButton', (['""" start up """'], {}), "(' start up ')\n", (778, 792), False, 'fro... |
import curses
import json
import os
import string
import sys
import threading
import time
import websocket
from websocket import WebSocketException as WSException
from maps import Map, ChunkMap
from chunks import ChunkDiff, jsonify_diffs, dejsonify_diffs
from utils import Position
from clientchunkpool import ClientChu... | [
"os.environ.setdefault",
"maps.ChunkMap",
"json.loads",
"curses.wrapper",
"chunks.jsonify_diffs",
"chunks.dejsonify_diffs",
"clientchunkpool.ClientChunkPool",
"json.dumps",
"curses.curs_set",
"threading.Event",
"curses.doupdate",
"maps.Map",
"websocket.create_connection",
"time.time",
"t... | [((6236, 6275), 'os.environ.setdefault', 'os.environ.setdefault', (['"""ESCDELAY"""', '"""25"""'], {}), "('ESCDELAY', '25')\n", (6257, 6275), False, 'import os\n'), ((6350, 6379), 'curses.wrapper', 'curses.wrapper', (['client.launch'], {}), '(client.launch)\n', (6364, 6379), False, 'import curses\n'), ((702, 719), 'thr... |
from django.shortcuts import render
# Create your views here.
tasks = ['foo', 'bar', 'baz']
def index(request):
return render(request, 'tasks/index.html', {'tasks': tasks}) | [
"django.shortcuts.render"
] | [((126, 179), 'django.shortcuts.render', 'render', (['request', '"""tasks/index.html"""', "{'tasks': tasks}"], {}), "(request, 'tasks/index.html', {'tasks': tasks})\n", (132, 179), False, 'from django.shortcuts import render\n')] |
import os
import os.path
import sqlite3
from urllib.parse import urlparse
import lxml.html.html5parser as html5
import whoosh.fields
import whoosh.index
import whoosh.qparser
if "." in __name__:
from .database import Database
from .util import url_to_filename, filename_to_title, filename_to_url
else:
from... | [
"util.filename_to_url",
"urllib.parse.urlparse",
"sqlite3.connect",
"util.url_to_filename",
"os.path.isdir",
"os.mkdir",
"util.filename_to_title"
] | [((634, 660), 'sqlite3.connect', 'sqlite3.connect', (['self.path'], {}), '(self.path)\n', (649, 660), False, 'import sqlite3\n'), ((2107, 2121), 'urllib.parse.urlparse', 'urlparse', (['dest'], {}), '(dest)\n', (2115, 2121), False, 'from urllib.parse import urlparse\n'), ((3973, 3997), 'os.path.isdir', 'os.path.isdir', ... |
from __future__ import print_function
import copy
from inspect import isclass, isfunction
import attr
import yaml
from attr.validators import optional, instance_of
from jira.resources import Resource, Issue, Worklog
from prettytable import PrettyTable
from .common import iso_to_ctime_str, friendly_worklog_time, iso_... | [
"prettytable.PrettyTable",
"yaml.safe_dump",
"attr.validators.instance_of",
"copy.deepcopy",
"inspect.isclass",
"inspect.isfunction",
"attr.ib"
] | [((887, 896), 'attr.ib', 'attr.ib', ([], {}), '()\n', (894, 896), False, 'import attr\n'), ((1174, 1192), 'attr.ib', 'attr.ib', ([], {'type': 'list'}), '(type=list)\n', (1181, 1192), False, 'import attr\n'), ((1498, 1516), 'attr.ib', 'attr.ib', ([], {'type': 'list'}), '(type=list)\n', (1505, 1516), False, 'import attr\... |
# Generated by Django 3.0.2 on 2020-01-11 21:58
import cloudinary.models
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_US... | [
"django.db.models.TextField",
"django.db.models.TimeField",
"django.db.models.ForeignKey",
"django.db.models.AutoField",
"django.db.models.PositiveIntegerField",
"django.db.migrations.swappable_dependency",
"django.db.models.CharField"
] | [((272, 329), 'django.db.migrations.swappable_dependency', 'migrations.swappable_dependency', (['settings.AUTH_USER_MODEL'], {}), '(settings.AUTH_USER_MODEL)\n', (303, 329), False, 'from django.db import migrations, models\n'), ((458, 551), 'django.db.models.AutoField', 'models.AutoField', ([], {'auto_created': '(True)... |
# Copyright (c) OpenMMLab. All rights reserved.
from typing import List
import torch
from torch import Tensor
from mmdeploy.core import SYMBOLIC_REWRITER
from mmdeploy.utils import Backend, get_backend, get_ir_config
# Here using mmcv.ops.roi_align.__self__ to find
# mmcv.ops.roi_align.RoIAlignFunction, because RoI... | [
"torch.tensor",
"mmdeploy.utils.get_ir_config",
"mmdeploy.utils.get_backend",
"mmdeploy.core.SYMBOLIC_REWRITER.register_symbolic"
] | [((361, 451), 'mmdeploy.core.SYMBOLIC_REWRITER.register_symbolic', 'SYMBOLIC_REWRITER.register_symbolic', (['"""mmcv.ops.roi_align.__self__"""'], {'backend': '"""default"""'}), "('mmcv.ops.roi_align.__self__', backend=\n 'default')\n", (396, 451), False, 'from mmdeploy.core import SYMBOLIC_REWRITER\n'), ((1850, 1870... |
import os
import sys
import numpy as np
import glob
chr_all = ['chr' + str(i) for i in range(1, 23)] + ['chrX']
path1='./'
model_all=['C_D','C_E','C_F','C_G','C_H','C_I', \
'CH_D','CH_E','CH_F','CH_G','CH_I', \
'CDEH_G','CDEH_I',\
'DEFGHI_C', \
'DGH_C','DGH_F','DGH_I', \
'F_C','F_D','F_E','F_G','... | [
"os.system"
] | [((599, 617), 'os.system', 'os.system', (['command'], {}), '(command)\n', (608, 617), False, 'import os\n')] |
"""
Base class for OpenC2 Command Handlers that you create.
"""
from functools import partial
import logging
from .command_decorators import _OC2PairMeta
from ..oc2_types import OC2Cmd, OC2Response, StatusCode
class OpenC2CmdDispatchBase(metaclass=_OC2PairMeta):
"""Base class to use for your OpenC2 Command Hand... | [
"functools.partial",
"logging.debug"
] | [((1984, 2014), 'logging.debug', 'logging.debug', (['"""Validating..."""'], {}), "('Validating...')\n", (1997, 2014), False, 'import logging\n'), ((2101, 2170), 'logging.debug', 'logging.debug', (['"""Determining which Consumer/Actuator function to call"""'], {}), "('Determining which Consumer/Actuator function to call... |
# -*- coding: utf-8 -*-
'''
Created on 2018. 9. 17.
@author: jason96
'''
from selenium import webdriver
from pyutil.fileutil import write_file
import time
def crawl():
target_urls = []
try:
for page in range(1, 18):
base_url = 'http://berlinstartupjobs.com/engineering/'
if ... | [
"selenium.webdriver.Chrome",
"time.sleep"
] | [((411, 451), 'selenium.webdriver.Chrome', 'webdriver.Chrome', (['"""../util/chromedriver"""'], {}), "('../util/chromedriver')\n", (427, 451), False, 'from selenium import webdriver\n'), ((859, 872), 'time.sleep', 'time.sleep', (['(1)'], {}), '(1)\n', (869, 872), False, 'import time\n')] |
# 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 rights
# to use, copy, modify, merge, publish, distribute, ... | [
"numpy.transpose",
"numpy.asarray",
"numpy.repeat"
] | [((9425, 9443), 'numpy.asarray', 'np.asarray', (['values'], {}), '(values)\n', (9435, 9443), True, 'import numpy as np\n'), ((3498, 3537), 'numpy.transpose', 'np.transpose', (['array[sls]', 'transposition'], {}), '(array[sls], transposition)\n', (3510, 3537), True, 'import numpy as np\n'), ((11394, 11422), 'numpy.trans... |
"""
Pylibui test suite.
"""
from pylibui.controls import Group, Control
from tests.utils import WindowTestCase
class GroupTest(WindowTestCase):
def setUp(self):
super().setUp()
self.group = Group('my group')
def test_title_initial_value(self):
"""Tests the group's `title` initial v... | [
"pylibui.controls.Group"
] | [((215, 232), 'pylibui.controls.Group', 'Group', (['"""my group"""'], {}), "('my group')\n", (220, 232), False, 'from pylibui.controls import Group, Control\n')] |
from insights.parsers.neutron_ovs_agent_log import NeutronOVSAgentLog
from insights.tests import context_wrap
from datetime import datetime
LOG = """
2016-11-09 14:39:25.348 3153 WARNING oslo_config.cfg [-] Option "rabbit_password" from group "oslo_messaging_rabbit" is deprecated for removal. Its value may be silent... | [
"insights.tests.context_wrap",
"datetime.datetime"
] | [((942, 959), 'insights.tests.context_wrap', 'context_wrap', (['LOG'], {}), '(LOG)\n', (954, 959), False, 'from insights.tests import context_wrap\n'), ((1035, 1068), 'datetime.datetime', 'datetime', (['(2016)', '(11)', '(9)', '(14)', '(39)', '(26)'], {}), '(2016, 11, 9, 14, 39, 26)\n', (1043, 1068), False, 'from datet... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2010-2016 .
# <NAME>, <EMAIL>
#
#
from .policy import BroadcastPolicy
from ppmessage.db.models import AppInfo
from ppmessage.db.models import DeviceUser
from ppmessage.db.models import ConversationInfo
from ppmessage.db.models import MessagePushTask
from ppmessage.core.const... | [
"logging.info",
"logging.error",
"ppmessage.core.redis.redis_hash_to_dict"
] | [((539, 747), 'logging.info', 'logging.info', (["('DISPATCH: type:%s, subtype:%s, body:%s, ft:%s, tt:%s' % (self._task[\n 'message_type'], self._task['message_subtype'], self._task['body'],\n self._task['from_type'], self._task['to_type']))"], {}), "('DISPATCH: type:%s, subtype:%s, body:%s, ft:%s, tt:%s' % (self\... |
"""
create openapi spec from resource schema
for Openapi 3.0 version
"""
import copy
import json
import logging
import yaml
from jsonschema import RefResolver
from . import utils
_LOG = logging.getLogger(__name__)
# pylint: disable=too-many-statements
# pylint: disable=too-many-lines
# pylint: disable=too-many-bra... | [
"logging.getLogger",
"yaml.dump",
"json.dumps",
"jsonschema.RefResolver",
"copy.deepcopy"
] | [((189, 216), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (206, 216), False, 'import logging\n'), ((1210, 1272), 'jsonschema.RefResolver', 'RefResolver', ([], {'base_uri': 'base', 'referrer': 'schema', 'handlers': 'handlers'}), '(base_uri=base, referrer=schema, handlers=handlers)\n', (... |
"""Loads reference data to memory."""
import csv
import pkg_resources
def load_dict() -> dict:
"""
Loads reference data to dictionary.
:return: dictionary of the syllable reference data
"""
file_name = "data.csv"
file_path = pkg_resources.resource_filename(__name__, file_name)
words = {}
... | [
"csv.reader",
"pkg_resources.resource_filename"
] | [((251, 303), 'pkg_resources.resource_filename', 'pkg_resources.resource_filename', (['__name__', 'file_name'], {}), '(__name__, file_name)\n', (282, 303), False, 'import pkg_resources\n'), ((383, 399), 'csv.reader', 'csv.reader', (['file'], {}), '(file)\n', (393, 399), False, 'import csv\n')] |
#!/usr/bin/env python3
#############################################################################
# Filename : Softlight.py
# Description : Control RGBLED with Potentiometer
# Author : www.freenove.com
# modification: 2019/12/27
########################################################################
import... | [
"RPi.GPIO.cleanup",
"smbus.SMBus",
"RPi.GPIO.setup",
"json.dumps",
"time.sleep",
"RPi.GPIO.PWM",
"RPi.GPIO.setmode"
] | [((411, 425), 'smbus.SMBus', 'smbus.SMBus', (['(1)'], {}), '(1)\n', (422, 425), False, 'import smbus\n'), ((805, 829), 'RPi.GPIO.setmode', 'GPIO.setmode', (['GPIO.BOARD'], {}), '(GPIO.BOARD)\n', (817, 829), True, 'import RPi.GPIO as GPIO\n'), ((834, 865), 'RPi.GPIO.setup', 'GPIO.setup', (['ledRedPin', 'GPIO.OUT'], {}),... |
""" Test Binary Relevance Model
"""
import unittest
import numpy as np
from numpy.testing import assert_array_equal
from sklearn import datasets
try:
from sklearn.model_selection import train_test_split
except ImportError:
from sklearn.cross_validation import train_test_split
import sklearn.linear_model
from ... | [
"numpy.abs",
"libact.models.LogisticRegression",
"sklearn.datasets.make_multilabel_classification",
"sklearn.cross_validation.train_test_split",
"libact.base.dataset.Dataset",
"unittest.main",
"numpy.shape"
] | [((2773, 2788), 'unittest.main', 'unittest.main', ([], {}), '()\n', (2786, 2788), False, 'import unittest\n'), ((542, 600), 'sklearn.datasets.make_multilabel_classification', 'datasets.make_multilabel_classification', ([], {'random_state': '(1126)'}), '(random_state=1126)\n', (581, 600), False, 'from sklearn import dat... |
"""
Contains the finder for use with filesystems.
"""
import sys
import os
from importlib.abc import MetaPathFinder
from importlib.machinery import ModuleSpec
class FSFinder(MetaPathFinder):
"""
Finder for ipynb/py files from the filesystem.
Only tries to load modules that are under ipynb.fs.
Tries ... | [
"os.path.exists",
"os.path.join",
"os.getcwd"
] | [((1013, 1047), 'os.path.join', 'os.path.join', (['base_path', 'real_path'], {}), '(base_path, real_path)\n', (1025, 1047), False, 'import os\n'), ((982, 993), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (991, 993), False, 'import os\n'), ((1131, 1167), 'os.path.join', 'os.path.join', (['path', '"""__init__.ipynb"""'],... |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compli... | [
"nova.openstack.common.cfg.StrOpt"
] | [((932, 1024), 'nova.openstack.common.cfg.StrOpt', 'cfg.StrOpt', (['"""iscsi_helper"""'], {'default': '"""tgtadm"""', 'help': '"""iscsi target user-land tool to use"""'}), "('iscsi_helper', default='tgtadm', help=\n 'iscsi target user-land tool to use')\n", (942, 1024), False, 'from nova.openstack.common import cfg\... |
from ctypes import windll
from os import system
from queue import Queue
from random import choices, choice
from string import ascii_letters, digits
from threading import Thread
from time import sleep
from colorama import Fore, init
from requests import get
from yaml import full_load
init()
default_values... | [
"random.choice",
"requests.get",
"time.sleep",
"random.choices",
"ctypes.windll.kernel32.SetConsoleTitleW",
"os.system",
"queue.Queue",
"threading.Thread",
"colorama.init"
] | [((298, 304), 'colorama.init', 'init', ([], {}), '()\n', (302, 304), False, 'from colorama import Fore, init\n'), ((1797, 1873), 'ctypes.windll.kernel32.SetConsoleTitleW', 'windll.kernel32.SetConsoleTitleW', (['f"""NitroX-{self.version} | by ShadowOxygen"""'], {}), "(f'NitroX-{self.version} | by ShadowOxygen')\n", (182... |
import tensorflow as tf
from tensorflow.python.ops import variable_scope
def get_fs_from_words(model, word_idxs, word_emb, reuse, scope=None):
"""
Get the embedding from word_idxs.
Args:
model: esrt.engine.Model.
word_idxs: Tensor with shape of [batch_size, query_max_length]
... | [
"tensorflow.nn.embedding_lookup",
"tensorflow.python.ops.variable_scope.variable_scope",
"tensorflow.matmul",
"tensorflow.reduce_mean",
"tensorflow.python.ops.variable_scope.get_variable"
] | [((804, 874), 'tensorflow.python.ops.variable_scope.variable_scope', 'variable_scope.variable_scope', (["(scope or 'f_s_abstraction')"], {'reuse': 'reuse'}), "(scope or 'f_s_abstraction', reuse=reuse)\n", (833, 874), False, 'from tensorflow.python.ops import variable_scope\n'), ((929, 972), 'tensorflow.nn.embedding_loo... |
from __future__ import absolute_import, division, print_function
import argparse
import os
import os.path as op
import code
import json
import zipfile
import torch
import numpy as np
from metro.utils.metric_pampjpe import get_alignMesh
def load_pred_json(filepath):
archive = zipfile.ZipFile(filepath, 'r')
js... | [
"numpy.mean",
"argparse.ArgumentParser",
"zipfile.ZipFile",
"metro.utils.metric_pampjpe.get_alignMesh",
"numpy.asarray",
"os.system",
"json.dump"
] | [((283, 313), 'zipfile.ZipFile', 'zipfile.ZipFile', (['filepath', '"""r"""'], {}), "(filepath, 'r')\n", (298, 313), False, 'import zipfile\n'), ((632, 654), 'numpy.asarray', 'np.asarray', (['ref_joints'], {}), '(ref_joints)\n', (642, 654), True, 'import numpy as np\n'), ((680, 704), 'numpy.asarray', 'np.asarray', (['re... |
from django.db import models
from django.db import models
from django.contrib.auth.models import User
from django.db.models.signals import post_save
from django.dispatch import receiver
from phonenumber_field.modelfields import PhoneNumberField
import datetime as dt
import string as str
# Create your models here.
cla... | [
"django.db.models.OneToOneField",
"django.db.models.EmailField",
"django.db.models.TextField",
"phonenumber_field.modelfields.PhoneNumberField",
"django.dispatch.receiver",
"django.db.models.CharField"
] | [((764, 796), 'django.dispatch.receiver', 'receiver', (['post_save'], {'sender': 'User'}), '(post_save, sender=User)\n', (772, 796), False, 'from django.dispatch import receiver\n'), ((925, 957), 'django.dispatch.receiver', 'receiver', (['post_save'], {'sender': 'User'}), '(post_save, sender=User)\n', (933, 957), False... |
import json
import urllib.parse
from utils import log
# 定义一个 class 用于保存请求的数据
class Request(object):
def __init__(self, raw_data):
# 只能 split 一次,因为 body 中可能有换行
header, self.body = raw_data.split('\r\n\r\n', 1)
h = header.split('\r\n')
parts = h[0].split()
self.method = part... | [
"utils.log",
"json.loads"
] | [((434, 485), 'utils.log', 'log', (['"""Request: path 和 query"""', 'self.path', 'self.query'], {}), "('Request: path 和 query', self.path, self.query)\n", (437, 485), False, 'from utils import log\n'), ((579, 640), 'utils.log', 'log', (['"""Request: headers 和 cookies"""', 'self.headers', 'self.cookies'], {}), "('Request... |
import pymongo
client = pymongo.MongoClient("自己的mongodb連線網址")
db = client.member_system
print("success!!!")
#如果因為驗證問題無法執行可以在後面試著加 ("自己的mongodb連線網址", tls=True, tlsAllowInvalidCertificates=True)
#https://stackoverflow.com/questions/54484890/ssl-handshake-issue-with-pymongo-on-python3
#熱心網友提供的另一個certificate failed的解... | [
"pymongo.MongoClient"
] | [((25, 62), 'pymongo.MongoClient', 'pymongo.MongoClient', (['"""自己的mongodb連線網址"""'], {}), "('自己的mongodb連線網址')\n", (44, 62), False, 'import pymongo\n')] |
# Copyright 2016 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import json
import logging
from telemetry.internal.results import output_formatter
class HistogramSetJsonOutputFormatter(output_formatter.OutputFormatter)... | [
"json.loads",
"logging.warn",
"json.dump"
] | [((952, 994), 'json.dump', 'json.dump', (['histograms', 'self._output_stream'], {}), '(histograms, self._output_stream)\n', (961, 994), False, 'import json\n'), ((1152, 1188), 'json.dump', 'json.dump', (['"""[]"""', 'self._output_stream'], {}), "('[]', self._output_stream)\n", (1161, 1188), False, 'import json\n'), ((8... |
"""简单SQL执行
"""
import logging
import pymysql
import pymysql.cursors
from typing import Sequence
from playwell.service import Result
from playwell.service.message import ServiceRequestMessage
class ExecuteSQL:
"""执行SQL语句
"""
def __init__(self):
self._config = {}
def init(self, **config):
... | [
"playwell.service.Result.ok",
"pymysql.connect",
"logging.exception"
] | [((436, 507), 'pymysql.connect', 'pymysql.connect', ([], {'cursorclass': 'pymysql.cursors.DictCursor'}), '(cursorclass=pymysql.cursors.DictCursor, **self._config)\n', (451, 507), False, 'import pymysql\n'), ((902, 922), 'logging.exception', 'logging.exception', (['e'], {}), '(e)\n', (919, 922), False, 'import logging\n... |
# Copyright (C) 2019 <NAME>
# Copyright (C) 2020 Sony Mobile Communications Inc.
# Licensed under the LICENSE.
'''
Parses hprof files' main record stream.
'''
import struct
import codecs
import gc
from contextlib import contextmanager
from enum import Enum
from .error import FormatError, HprofError, UnexpectedEof, ... | [
"mmap.mmap",
"gzip.open",
"os.fstat",
"lzma.open",
"bz2.open",
"gc.collect",
"tempfile.TemporaryFile",
"builtins.open",
"codecs.register_error"
] | [((6287, 6350), 'codecs.register_error', 'codecs.register_error', (['"""hprof-mutf8"""', 'hprof_mutf8_error_handler'], {}), "('hprof-mutf8', hprof_mutf8_error_handler)\n", (6308, 6350), False, 'import codecs\n'), ((1121, 1133), 'gc.collect', 'gc.collect', ([], {}), '()\n', (1131, 1133), False, 'import gc\n'), ((2711, 2... |
import pytest
import mitzasql.sql_parser.tokens as Token
from mitzasql.sql_parser.lexer import Lexer
from mitzasql.utils import token_is_parsed
def test_schema_object_is_tokenized():
raw = '''
`schema`.`object`
@`not a schema object`
'''
tokens = list(Lexer(raw).tokenize())
assert token_is_parsed((Token.Na... | [
"mitzasql.sql_parser.lexer.Lexer",
"mitzasql.utils.token_is_parsed"
] | [((295, 344), 'mitzasql.utils.token_is_parsed', 'token_is_parsed', (["(Token.Name, '`schema`')", 'tokens'], {}), "((Token.Name, '`schema`'), tokens)\n", (310, 344), False, 'from mitzasql.utils import token_is_parsed\n'), ((356, 405), 'mitzasql.utils.token_is_parsed', 'token_is_parsed', (["(Token.Name, '`object`')", 'to... |
#!/usr/bin/env python3
import argparse
import sys
import usb.core
import usb.backend.libusb1
parser = argparse.ArgumentParser(description="jump_ch552_bl")
parser.add_argument('-v','--vid', help="VID", required=True)
parser.add_argument('-p','--pid', help="PID", required=True)
args = parser.parse_args()
idVendor =... | [
"argparse.ArgumentParser",
"sys.exit"
] | [((105, 157), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""jump_ch552_bl"""'}), "(description='jump_ch552_bl')\n", (128, 157), False, 'import argparse\n'), ((535, 546), 'sys.exit', 'sys.exit', (['(1)'], {}), '(1)\n', (543, 546), False, 'import sys\n'), ((725, 736), 'sys.exit', 'sys.exi... |
import importlib
from django.core.management.base import BaseCommand
from giscube_search.model_utils import DocumentIndexEditor
from giscube_search.utils import giscube_search_get_app_modules
class Command(BaseCommand):
def handle(self, *args, **options):
"""Drops all index tables"""
done = []
... | [
"giscube_search.utils.giscube_search_get_app_modules",
"importlib.import_module",
"giscube_search.model_utils.DocumentIndexEditor"
] | [((342, 374), 'giscube_search.utils.giscube_search_get_app_modules', 'giscube_search_get_app_modules', ([], {}), '()\n', (372, 374), False, 'from giscube_search.utils import giscube_search_get_app_modules\n'), ((498, 524), 'importlib.import_module', 'importlib.import_module', (['m'], {}), '(m)\n', (521, 524), False, 'i... |
import logging
from typing import Optional, Text, List, Any
from pybeerxml.fermentable import Fermentable
from pybeerxml.hop import Hop
from pybeerxml.mash import Mash
from pybeerxml.misc import Misc
from pybeerxml.yeast import Yeast
from pybeerxml.style import Style
from pybeerxml.water import Water
from pybeerxml.eq... | [
"logging.getLogger",
"pybeerxml.utils.gravity_to_plato",
"pybeerxml.utils.cast_to_bool"
] | [((414, 441), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (431, 441), False, 'import logging\n'), ((3720, 3745), 'pybeerxml.utils.gravity_to_plato', 'gravity_to_plato', (['self.og'], {}), '(self.og)\n', (3736, 3745), False, 'from pybeerxml.utils import cast_to_bool, gravity_to_plato\n'... |
#!/usr/bin/python
import fileinput
import os
import re
import sys
#This regex can't find all class declaration mistakes and only checks the first few lines:
#Regex: ^class "(.+)".*\n\n(?!---@type \1\nlocal \1 = _G\["\1"])
regex = r"^class \"(.+)\".*\n\n(?!---@type \1\nlocal \1 = _G\[\"\1\"])"
print_root_regex = re.c... | [
"os.listdir",
"re.compile",
"os.getcwd",
"sys.exit",
"re.findall",
"os.walk"
] | [((316, 335), 're.compile', 're.compile', (['"""Lua.*"""'], {}), "('Lua.*')\n", (326, 335), False, 'import re\n'), ((392, 429), 'os.listdir', 'os.listdir', (["(script_dir + '/languages')"], {}), "(script_dir + '/languages')\n", (402, 429), False, 'import os\n'), ((474, 493), 'os.walk', 'os.walk', (['script_dir'], {}), ... |
# gemato: Profile behavior tests
# vim:fileencoding=utf-8
# (c) 2017-2020 <NAME>
# Licensed under the terms of 2-clause BSD license
import itertools
import os
import os.path
import pytest
import gemato.cli
from gemato.profile import (
EbuildRepositoryProfile,
BackwardsCompatEbuildRepositoryProfile,
)
fro... | [
"gemato.recursiveloader.ManifestRecursiveLoader",
"os.path.join",
"pytest.mark.parametrize",
"os.path.basename",
"os.mkdir"
] | [((4275, 4445), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""profile,path,expected"""', '[(profile, path, EXPECTED_TYPES[profile][path]) for profile in ALL_PROFILES for\n path in EXPECTED_TYPES[profile]]'], {}), "('profile,path,expected', [(profile, path,\n EXPECTED_TYPES[profile][path]) for profil... |
# -*- coding: utf-8 -*-
from django.contrib.admin.filterspecs import FilterSpec
from django.db import models
from django.utils.encoding import smart_unicode
from django.utils.translation import ugettext as _
#==============================================================================
# FilterSpec.register places ... | [
"django.utils.translation.ugettext",
"django.utils.encoding.smart_unicode"
] | [((1425, 1433), 'django.utils.translation.ugettext', '_', (['"""All"""'], {}), "('All')\n", (1426, 1433), True, 'from django.utils.translation import ugettext as _\n'), ((1443, 1457), 'django.utils.translation.ugettext', '_', (['"""Has value"""'], {}), "('Has value')\n", (1444, 1457), True, 'from django.utils.translati... |
"""
@file
@brief Simple simulation of an epidemic. It makes a couple of assumption
on how the disease is transmitted and its effect on a person. The user
can specify many parameters.
"""
import random
import copy
import os
from collections import Counter
from pyquickhelper.loghelper import noLOG
from ..helpers.pygame_h... | [
"os.path.join",
"copy.deepcopy",
"random.random",
"random.randint",
"random.gauss"
] | [((4883, 4913), 'random.gauss', 'random.gauss', (['(0)', 'self.alea_acc'], {}), '(0, self.alea_acc)\n', (4895, 4913), False, 'import random\n'), ((4926, 4956), 'random.gauss', 'random.gauss', (['(0)', 'self.alea_acc'], {}), '(0, self.alea_acc)\n', (4938, 4956), False, 'import random\n'), ((9145, 9164), 'copy.deepcopy',... |
import time
import subprocess
cmd = ['backdrop','-l', '2', '-x', '200', '-y' '500', '-w', '60', '-h', '78']
backdrop_process = subprocess.Popen(cmd, stdin=subprocess.PIPE)
time.sleep(4)
backdrop_process.stdin.write('400,100,400,300\n'.encode())
backdrop_process.stdin.flush()
time.sleep(4)
backdrop_process.termin... | [
"subprocess.Popen",
"time.sleep"
] | [((130, 174), 'subprocess.Popen', 'subprocess.Popen', (['cmd'], {'stdin': 'subprocess.PIPE'}), '(cmd, stdin=subprocess.PIPE)\n', (146, 174), False, 'import subprocess\n'), ((176, 189), 'time.sleep', 'time.sleep', (['(4)'], {}), '(4)\n', (186, 189), False, 'import time\n'), ((282, 295), 'time.sleep', 'time.sleep', (['(4... |
"""
Tesco Add to Basket
<NAME> - Feb 2018
"""
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
import time
chrome_driver = 'venv/selenium/chromedriver' # Change this to the location of your Chrome Driver
browser = webdriver.Chrome(chrome_driver)
def tesco_log_in(mail, p):
browser... | [
"selenium.webdriver.Chrome",
"time.time"
] | [((248, 279), 'selenium.webdriver.Chrome', 'webdriver.Chrome', (['chrome_driver'], {}), '(chrome_driver)\n', (264, 279), False, 'from selenium import webdriver\n'), ((2383, 2394), 'time.time', 'time.time', ([], {}), '()\n', (2392, 2394), False, 'import time\n'), ((2448, 2459), 'time.time', 'time.time', ([], {}), '()\n'... |
# -*- coding: utf-8 -*-
"""
Created on Mon Apr 23 12:31:50 2018
@author: <NAME>
"""
from QChemTool import Structure
from QChemTool.Development.polarizablesytem_periodic import PolarizableSystem
from QChemTool import energy_units
from QChemTool.QuantumChem.Fluorographene.fluorographene import orientFG
import ... | [
"QChemTool.Development.polarizablesytem_periodic.PolarizableSystem",
"numpy.zeros",
"QChemTool.QuantumChem.Fluorographene.fluorographene.orientFG",
"QChemTool.energy_units",
"QChemTool.Structure"
] | [((732, 743), 'QChemTool.Structure', 'Structure', ([], {}), '()\n', (741, 743), False, 'from QChemTool import Structure\n'), ((2013, 2071), 'QChemTool.Development.polarizablesytem_periodic.PolarizableSystem', 'PolarizableSystem', ([], {'diel': 'diel', 'elstat': 'elstat', 'params': 'params'}), '(diel=diel, elstat=elstat... |
from django.contrib import admin
from .models import Budget, Transaction
admin.site.register(Budget)
admin.site.register(Transaction)
| [
"django.contrib.admin.site.register"
] | [((75, 102), 'django.contrib.admin.site.register', 'admin.site.register', (['Budget'], {}), '(Budget)\n', (94, 102), False, 'from django.contrib import admin\n'), ((103, 135), 'django.contrib.admin.site.register', 'admin.site.register', (['Transaction'], {}), '(Transaction)\n', (122, 135), False, 'from django.contrib i... |
import numpy as np
import os
from welib import weio # https://github.com/ebranlard/weio
from welib.fast import fastlib as fastlib # latest fastlib is found at https://github.com/ebranlard/welib
def CPLambda():
""" Determine the CP-CT Lambda Pitch matrices of a turbine.
This scrip uses the function CPCT_LambdaP... | [
"numpy.linspace",
"matplotlib.pyplot.figure",
"numpy.savetxt",
"numpy.meshgrid",
"numpy.transpose",
"welib.fast.fastlib.CPCT_LambdaPitch",
"matplotlib.pyplot.show"
] | [((954, 983), 'numpy.linspace', 'np.linspace', (['(0.1)', '(22)', 'nLambda'], {}), '(0.1, 22, nLambda)\n', (965, 983), True, 'import numpy as np\n'), ((997, 1024), 'numpy.linspace', 'np.linspace', (['(-5)', '(40)', 'nPitch'], {}), '(-5, 40, nPitch)\n', (1008, 1024), True, 'import numpy as np\n'), ((1063, 1196), 'welib.... |
from rest_framework import viewsets
from handler.serializers import EventsSerializer, PlaceSerializer
from handler.models import Event, Place
class EventViewSet(viewsets.ModelViewSet):
"""
API endpoint that allows users to be viewed or edited.
"""
queryset = Event.objects.all()
serializer_class = ... | [
"handler.models.Event.objects.all",
"handler.models.Place.objects.all"
] | [((277, 296), 'handler.models.Event.objects.all', 'Event.objects.all', ([], {}), '()\n', (294, 296), False, 'from handler.models import Event, Place\n'), ((473, 492), 'handler.models.Place.objects.all', 'Place.objects.all', ([], {}), '()\n', (490, 492), False, 'from handler.models import Event, Place\n')] |
import os
import sys
import math
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.nn.parameter import Parameter
from torchlibrosa.stft import Spectrogram, LogmelFilterBank
from torchlibrosa.augmentation import SpecAugmentation
from pytorch_utils import do_mixup
def ini... | [
"torch.max",
"math.sqrt",
"torch.exp",
"pytorch_utils.do_mixup",
"torch.nn.BatchNorm1d",
"torch.sum",
"torch.nn.GRU",
"torchlibrosa.augmentation.SpecAugmentation",
"torch.nn.BatchNorm2d",
"torch.nn.functional.glu",
"torch.nn.init.xavier_uniform_",
"torchlibrosa.stft.LogmelFilterBank",
"torch... | [((395, 432), 'torch.nn.init.xavier_uniform_', 'nn.init.xavier_uniform_', (['layer.weight'], {}), '(layer.weight)\n', (418, 432), True, 'import torch.nn as nn\n'), ((1038, 1086), 'torch.nn.init._calculate_correct_fan', 'nn.init._calculate_correct_fan', (['tensor', '"""fan_in"""'], {}), "(tensor, 'fan_in')\n", (1068, 10... |
import os
import h5py
import pickle
import numpy as np
from termcolor import colored
from torch.utils.data import Dataset, DataLoader
class CIFAR10Loader(Dataset):
'''Data loader for cifar10 dataset'''
def __init__(self, data_path='data/cifar-10-batches-py', mode='train', transform=None):
self.data_... | [
"termcolor.colored",
"os.path.join",
"pickle.load",
"h5py.File",
"numpy.concatenate"
] | [((4103, 4127), 'h5py.File', 'h5py.File', (['filename', '"""r"""'], {}), "(filename, 'r')\n", (4112, 4127), False, 'import h5py\n'), ((2204, 2237), 'pickle.load', 'pickle.load', (['fp'], {'encoding': '"""bytes"""'}), "(fp, encoding='bytes')\n", (2215, 2237), False, 'import pickle\n'), ((1861, 1886), 'numpy.concatenate'... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Jul 16 09:14:50 2019
@author: <NAME>
A Quick test if Metashape detects a GPU, and if it's enabled automatically.
"""
import os
import Metashape
import datetime
import platform
folderpath = os.path.expanduser('~/metashape-pro/Puget-Benchmark')
file = ... | [
"datetime.datetime.now",
"Metashape.app.enumGPUDevices",
"platform.processor",
"os.path.expanduser"
] | [((258, 311), 'os.path.expanduser', 'os.path.expanduser', (['"""~/metashape-pro/Puget-Benchmark"""'], {}), "('~/metashape-pro/Puget-Benchmark')\n", (276, 311), False, 'import os\n'), ((898, 928), 'Metashape.app.enumGPUDevices', 'Metashape.app.enumGPUDevices', ([], {}), '()\n', (926, 928), False, 'import Metashape\n'), ... |
# python3
# coding=utf-8
# Copyright 2021 Google LLC.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | [
"absl.flags.DEFINE_bool",
"absl.flags.DEFINE_integer",
"gps_building_blocks.ml.data_prep.ml_windowing_pipeline.ml_windowing_pipeline.run_windowing_pipeline",
"absl.app.run",
"absl.flags.DEFINE_string"
] | [((1994, 2072), 'absl.flags.DEFINE_string', 'flags.DEFINE_string', (['"""project_id"""', 'None', '"""Google Cloud project to run inside."""'], {}), "('project_id', None, 'Google Cloud project to run inside.')\n", (2013, 2072), False, 'from absl import flags\n'), ((2073, 2158), 'absl.flags.DEFINE_string', 'flags.DEFINE_... |