code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
from django.shortcuts import render, redirect
from django.views.generic import CreateView, UpdateView, DeleteView, ListView, TemplateView
from django.views.generic.edit import BaseCreateView
from .models import Classes, Subject, Routine, Section, Room
from payroll.models import Teacher
from django.urls import rev... | [
"django.shortcuts.render",
"datetime.time",
"django.http.JsonResponse",
"datetime.datetime.strptime",
"payroll.models.Teacher.objects.get",
"home.models.SchoolProfile.objects.filter",
"django.forms.TextInput",
"django.forms.TypedMultipleChoiceField",
"payroll.models.Teacher.objects.filter",
"djang... | [((1098, 1135), 'datetime.datetime.strptime', 'datetime.strptime', (['time_str1', '"""%H:%M"""'], {}), "(time_str1, '%H:%M')\n", (1115, 1135), False, 'from datetime import datetime, time, date, timedelta\n'), ((1146, 1183), 'datetime.datetime.strptime', 'datetime.strptime', (['time_str2', '"""%H:%M"""'], {}), "(time_st... |
import torch
import torch.nn as nn
import torchvision.models as models
class EncoderCNN(nn.Module):
def __init__(self, embed_size):
super(EncoderCNN, self).__init__()
resnet = models.resnet50(pretrained=True)
for param in resnet.parameters():
param.requires_grad_(False)
... | [
"torch.nn.Sequential",
"torch.nn.LSTM",
"torch.nn.Linear",
"torchvision.models.resnet50",
"torch.randn",
"torch.nn.Embedding",
"torch.argmax"
] | [((198, 230), 'torchvision.models.resnet50', 'models.resnet50', ([], {'pretrained': '(True)'}), '(pretrained=True)\n', (213, 230), True, 'import torchvision.models as models\n'), ((391, 414), 'torch.nn.Sequential', 'nn.Sequential', (['*modules'], {}), '(*modules)\n', (404, 414), True, 'import torch.nn as nn\n'), ((436,... |
#! /usr/bin/env python3
# Written by <NAME> (ethteck)
# MIT License
# Copyright 2021
# Modified by EpochFlame
import argparse
import sys
# Byte sequence that marks code size
CODESIZE_MAGIC = b"\x00\x00\x00\x06\x00\x00\x00\x00\x00\x00\x00\x34"
BLR_BYTE_SEQ = b"\x4E\x80\x00\x20"
MTLR_BYTE_SEQ = b"\x7C\x08\x03\xA6"
#... | [
"argparse.FileType",
"argparse.ArgumentParser",
"sys.exit"
] | [((983, 1008), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (1006, 1008), False, 'import argparse\n'), ((1689, 1700), 'sys.exit', 'sys.exit', (['(0)'], {}), '(0)\n', (1697, 1700), False, 'import sys\n'), ((1080, 1103), 'argparse.FileType', 'argparse.FileType', (['"""rb"""'], {}), "('rb')\n", ... |
# -*- coding: utf-8 -*-
import uuid
import junopy
import json
import sys
def main(arg):
junopy.Juno('4E1574938F3DD69306BC336E348276ACC9CBE72B4E8396B2520436663C66C08E',
'9OuOfYM2QZRhmUug', 'gw<Nl6bc2Ib,VX&)c2U{mX1?d_zEg0^d', sandbox=True)
# PLANO
uudi = str(uuid.uuid4())
pix = junopy.... | [
"junopy.Juno",
"junopy.pix.Keys",
"uuid.uuid4"
] | [((95, 248), 'junopy.Juno', 'junopy.Juno', (['"""4E1574938F3DD69306BC336E348276ACC9CBE72B4E8396B2520436663C66C08E"""', '"""9OuOfYM2QZRhmUug"""', '"""gw<Nl6bc2Ib,VX&)c2U{mX1?d_zEg0^d"""'], {'sandbox': '(True)'}), "('4E1574938F3DD69306BC336E348276ACC9CBE72B4E8396B2520436663C66C08E',\n '9OuOfYM2QZRhmUug', 'gw<Nl6bc2Ib,... |
import unittest
from brume.config import Config
class TestConfig(unittest.TestCase):
"""Test for brume.Config."""
def test_load(self):
"""A configuration file can be loaded."""
conf = Config.load()
assert conf['region'] == 'eu-west-1'
assert isinstance(conf['stack'], dict)
... | [
"unittest.main",
"brume.config.Config.load"
] | [((403, 418), 'unittest.main', 'unittest.main', ([], {}), '()\n', (416, 418), False, 'import unittest\n'), ((212, 225), 'brume.config.Config.load', 'Config.load', ([], {}), '()\n', (223, 225), False, 'from brume.config import Config\n')] |
"""HML"""
import datetime
import pytest
from pyiem.nws.products.hml import parser as hmlparser
from pyiem.util import get_test_file, utc
@pytest.mark.parametrize("database", ["hml"])
def test_200926_nokey(dbcursor):
"""Test that we add a new observation key, when necessary."""
prod = hmlparser(get_test_file(... | [
"pyiem.util.utc",
"pytest.mark.parametrize",
"pyiem.util.get_test_file",
"datetime.datetime.now"
] | [((141, 185), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""database"""', "['hml']"], {}), "('database', ['hml'])\n", (164, 185), False, 'import pytest\n'), ((602, 646), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""database"""', "['hml']"], {}), "('database', ['hml'])\n", (625, 646), False,... |
"""
SAMS umbrella sampling for DDR1 kinase DFG loop flip.
"""
__author__ = '<NAME>'
################################################################################
# IMPORTS
################################################################################
import os, os.path
import sys, math
import numpy as np
impor... | [
"simtk.openmm.VerletIntegrator",
"simtk.openmm.LocalEnergyMinimizer.minimize",
"simtk.openmm.app.PDBFile",
"simtk.openmm.MonteCarloBarostat",
"sams.samplers.SamplerState",
"simtk.openmm.CustomBondForce",
"netCDF4.Dataset",
"openmmtools.integrators.LangevinIntegrator",
"numpy.linspace",
"sams.sampl... | [((3583, 3614), 'simtk.openmm.app.PDBFile', 'app.PDBFile', (['state_pdb_filename'], {}), '(state_pdb_filename)\n', (3594, 3614), False, 'from simtk.openmm import app\n'), ((4693, 4735), 'simtk.openmm.CustomTorsionForce', 'openmm.CustomTorsionForce', (['energy_function'], {}), '(energy_function)\n', (4718, 4735), False,... |
import os
import spacy
import json
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
class BatchTokenizer():
def __init__(self):
self.nlp = spacy.load("en_core_web_md")
def tokenize(self, documents):
tokens = []
for doc in self.nlp.pipe(documents, batch_size = 30):
... | [
"spacy.load"
] | [((159, 187), 'spacy.load', 'spacy.load', (['"""en_core_web_md"""'], {}), "('en_core_web_md')\n", (169, 187), False, 'import spacy\n')] |
try:
from .version import version as __version__
from .version import githash as __githash__
except ImportError:
__version__ = ''
__githash__ = ''
import os
import sys
# Ensure that all module-level code in astropy or other packages know that
# we're in setup mode:
if ('__main__' in sys.modules and
... | [
"os.path.basename"
] | [((389, 439), 'os.path.basename', 'os.path.basename', (["sys.modules['__main__'].__file__"], {}), "(sys.modules['__main__'].__file__)\n", (405, 439), False, 'import os\n')] |
"""
The board class manages the position of pieces, and conversion to and from
Forsyth-Edwards Notation (FEN). This class is only used internally by the
`Game` class.
"""
import numpy as np
class Board(object):
"""
This class manages the position of all pieces in a chess game. The
position is stored as a ... | [
"numpy.reshape",
"numpy.hstack",
"numpy.array",
"numpy.vstack",
"numpy.arange"
] | [((809, 849), 'numpy.reshape', 'np.reshape', (['np_pos', '(-1, self._row_size)'], {}), '(np_pos, (-1, self._row_size))\n', (819, 849), True, 'import numpy as np\n'), ((945, 971), 'numpy.hstack', 'np.hstack', (['(ranks, np_pos)'], {}), '((ranks, np_pos))\n', (954, 971), True, 'import numpy as np\n'), ((1125, 1151), 'num... |
"ESPNetv2: A Light-weight, Power Efficient, and General Purpose for Semantic Segmentation"
import torch
import torch.nn as nn
import torch.nn.functional as F
from .segbase import SegBaseModel
from .model_zoo import MODEL_REGISTRY
from ..modules import _ConvBNPReLU, EESP, _BNPReLU, _FCNHead
from ..config import cfg
@... | [
"torch.nn.Dropout2d",
"torch.nn.functional.avg_pool2d",
"torch.nn.Conv2d",
"torch.nn.functional.interpolate",
"torch.cat"
] | [((1573, 1652), 'torch.nn.functional.interpolate', 'F.interpolate', (['out_l4_proj'], {'scale_factor': '(2)', 'mode': '"""bilinear"""', 'align_corners': '(True)'}), "(out_l4_proj, scale_factor=2, mode='bilinear', align_corners=True)\n", (1586, 1652), True, 'import torch.nn.functional as F\n'), ((1870, 1956), 'torch.nn.... |
from flask import Flask, redirect, render_template, session
import os
from gpiozero import LED
import simplejson as json
from time import sleep, time
import Adafruit_DHT
import RPi.GPIO as GPIO
app = Flask(__name__)
app.secret_key = os.urandom(12)
# For system LED's
led = LED(18)
led1 = LED(10)
led2 = LED(9)
# For U... | [
"flask.render_template",
"flask.session.get",
"flask.Flask",
"os.urandom",
"RPi.GPIO.setup",
"RPi.GPIO.output",
"gpiozero.LED",
"time.sleep",
"flask.redirect",
"Adafruit_DHT.read_retry",
"RPi.GPIO.input",
"time.time",
"RPi.GPIO.setmode"
] | [((201, 216), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (206, 216), False, 'from flask import Flask, redirect, render_template, session\n'), ((234, 248), 'os.urandom', 'os.urandom', (['(12)'], {}), '(12)\n', (244, 248), False, 'import os\n'), ((275, 282), 'gpiozero.LED', 'LED', (['(18)'], {}), '(18)\n... |
from post_grades import Post_Grades
Post_Grades() | [
"post_grades.Post_Grades"
] | [((37, 50), 'post_grades.Post_Grades', 'Post_Grades', ([], {}), '()\n', (48, 50), False, 'from post_grades import Post_Grades\n')] |
# Generated by Django 3.2.4 on 2021-07-14 12:37
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('animal_shelters', '0003_auto_20210714_1141'),
]
operations = [
migrations.AlterField(
model_name... | [
"django.db.models.FileField",
"django.db.models.ForeignKey"
] | [((381, 504), 'django.db.models.ForeignKey', 'models.ForeignKey', ([], {'blank': '(True)', 'null': '(True)', 'on_delete': 'django.db.models.deletion.CASCADE', 'to': '"""animal_shelters.animaltype"""'}), "(blank=True, null=True, on_delete=django.db.models.\n deletion.CASCADE, to='animal_shelters.animaltype')\n", (398... |
"""Smart tasks set timers to turn on/off lights in various ways.
> Currently supporting wake up
SmartTask # return top level info
TaskControl # Change top level values
StartAction # Get top level info on start action
StartActionItem # Get info on specific device in task
StartActionItemCont... | [
"datetime.datetime",
"datetime.time",
"datetime.datetime.utcnow",
"pydantic.Field",
"datetime.timedelta"
] | [((1609, 1639), 'pydantic.Field', 'Field', ([], {'alias': 'ATTR_DEVICE_STATE'}), '(alias=ATTR_DEVICE_STATE)\n', (1614, 1639), False, 'from pydantic import BaseModel, Field\n'), ((1766, 1799), 'pydantic.Field', 'Field', ([], {'alias': 'ATTR_TRANSITION_TIME'}), '(alias=ATTR_TRANSITION_TIME)\n', (1771, 1799), False, 'from... |
import sublime
import sublime_plugin
class EventDump(sublime_plugin.EventListener):
def on_close(self, view):
sublime.message_dialog("file is closed.")
| [
"sublime.message_dialog"
] | [((125, 166), 'sublime.message_dialog', 'sublime.message_dialog', (['"""file is closed."""'], {}), "('file is closed.')\n", (147, 166), False, 'import sublime\n')] |
# Title : Calculator
# Author : <NAME>
# Date : 08/05/2019
# Description : It's an Calculator
import pygame
import collections
WHITE = (255, 255, 255)
GREY = (192, 192, 192)
BLACK = (0, 0, 0)
DGREY = (169, 169, 169)
BGREEN = (0, 106, 78)
Button = collections.namedtuple("Button", ["label", "color",... | [
"collections.namedtuple",
"pygame.init",
"pygame.quit",
"pygame.event.get",
"pygame.time.wait",
"pygame.display.set_mode",
"pygame.mouse.get_pos",
"pygame.font.Font",
"pygame.display.update",
"pygame.Rect"
] | [((269, 355), 'collections.namedtuple', 'collections.namedtuple', (['"""Button"""', "['label', 'color', 'x', 'y', 'length', 'height']"], {}), "('Button', ['label', 'color', 'x', 'y', 'length',\n 'height'])\n", (291, 355), False, 'import collections\n'), ((3077, 3103), 'pygame.font.Font', 'pygame.font.Font', (['None'... |
#!/usr/bin/env python
from setuptools import setup, find_packages
setup (
name = "Nark",
version = "0.1",
description="Various python utilities",
author="<NAME>",
author_email="", # Removed to limit spam harvesting.
url="",
package_dir = {'': 'src'},
packages = find_packages("src", exclude="tests"),
... | [
"setuptools.find_packages"
] | [((280, 317), 'setuptools.find_packages', 'find_packages', (['"""src"""'], {'exclude': '"""tests"""'}), "('src', exclude='tests')\n", (293, 317), False, 'from setuptools import setup, find_packages\n')] |
# -*- coding: utf-8 -*-
#
# Copyright (C) Red Hat, Inc
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | [
"dci.api.v1.notifications.format_mail_message",
"dci.api.v1.notifications.get_email_event",
"mock.patch",
"dci.api.v1.notifications.get_emails"
] | [((1596, 1645), 'mock.patch', 'mock.patch', (['"""dci.api.v1.notifications.dispatcher"""'], {}), "('dci.api.v1.notifications.dispatcher')\n", (1606, 1645), False, 'import mock\n'), ((2565, 2614), 'mock.patch', 'mock.patch', (['"""dci.api.v1.notifications.dispatcher"""'], {}), "('dci.api.v1.notifications.dispatcher')\n"... |
import symbols
def display(tick, score, centers, radius, *args):
args = list(args)
display_str = None
for arg, center in zip(args, centers):
if isinstance(arg, dict):
arg_str = percept_string(arg)
else:
arg_str = world_string(arg, radius, center)
if display... | [
"symbols.strip_color",
"symbols.apply_color"
] | [((3495, 3524), 'symbols.strip_color', 'symbols.strip_color', (['lines[0]'], {}), '(lines[0])\n', (3514, 3524), False, 'import symbols\n'), ((3279, 3313), 'symbols.apply_color', 'symbols.apply_color', (['symbol', 'color'], {}), '(symbol, color)\n', (3298, 3313), False, 'import symbols\n')] |
from datetime import datetime
import re
__formatted_date_regex__ = "(\d{2,4}[\/|.|\-])?\d{1,2}(\/|\.|-)\d{1,2}( \d{1,2}:\d{1,2}(:\d{1,2})?)?"
__formatted_date_pattern__ = re.compile(__formatted_date_regex__)
__DATETIME__ = 0
__YEAR__ = 1
__DELIMITER__ = 2
__TIME__ = 3
__SECOND__ = 4
def parse(sentence)... | [
"re.compile"
] | [((172, 208), 're.compile', 're.compile', (['__formatted_date_regex__'], {}), '(__formatted_date_regex__)\n', (182, 208), False, 'import re\n')] |
import theano.tensor as T
from lasagne.nonlinearities import elu
def elu_plus_one(x):
return elu(x) + 1. + 1.e-5
def log_linear(x):
return T.switch(T.lt(x, 0), -T.log(1. - x), x) + 1.
| [
"theano.tensor.lt",
"theano.tensor.log",
"lasagne.nonlinearities.elu"
] | [((100, 106), 'lasagne.nonlinearities.elu', 'elu', (['x'], {}), '(x)\n', (103, 106), False, 'from lasagne.nonlinearities import elu\n'), ((162, 172), 'theano.tensor.lt', 'T.lt', (['x', '(0)'], {}), '(x, 0)\n', (166, 172), True, 'import theano.tensor as T\n'), ((175, 189), 'theano.tensor.log', 'T.log', (['(1.0 - x)'], {... |
from mumbling import accum
class TestMumbling:
def test_0(self):
assert accum("ZpglnRxqenU") == "Z-Pp-Ggg-Llll-Nnnnn-Rrrrrr-Xxxxxxx-Qqqqqqqq-Eeeeeeeee-Nnnnnnnnnn-Uuuuuuuuuuu"
def test_1(self):
assert accum("NyffsGeyylB") == "N-Yy-Fff-Ffff-Sssss-Gggggg-Eeeeeee-Yyyyyyyy-Yyyyyyyyy-Llllllllll-Bbb... | [
"mumbling.accum"
] | [((86, 106), 'mumbling.accum', 'accum', (['"""ZpglnRxqenU"""'], {}), "('ZpglnRxqenU')\n", (91, 106), False, 'from mumbling import accum\n'), ((227, 247), 'mumbling.accum', 'accum', (['"""NyffsGeyylB"""'], {}), "('NyffsGeyylB')\n", (232, 247), False, 'from mumbling import accum\n'), ((368, 388), 'mumbling.accum', 'accum... |
#!/usr/bin/env python
"""
Created on 2015-09-26T12:13:49
"""
from __future__ import division, print_function
import sys
import argparse
import re
import time
try:
import numpy as np
except ImportError:
print('You need numpy installed')
sys.exit(1)
import pandas as pd
from splinter.browser import Browser
i... | [
"pandas.read_sql_query",
"numpy.int64",
"argparse.ArgumentParser",
"splinter.browser.Browser",
"connect_aws_db.connect_aws_db",
"time.sleep",
"numpy.random.uniform",
"sys.exit",
"pandas.DataFrame",
"re.findall"
] | [((3479, 3516), 'numpy.int64', 'np.int64', (["bigdf['business_id'].values"], {}), "(bigdf['business_id'].values)\n", (3487, 3516), True, 'import numpy as np\n'), ((4060, 4069), 'splinter.browser.Browser', 'Browser', ([], {}), '()\n', (4067, 4069), False, 'from splinter.browser import Browser\n'), ((5832, 5845), 'time.s... |
import time
import pytest
import threading
import sys
from azure.eventhub import EventData
from azure.eventhub import EventHubConsumerClient
from azure.eventhub._eventprocessor.in_memory_checkpoint_store import InMemoryCheckpointStore
from azure.eventhub._constants import ALL_PARTITIONS
@pytest.mark.liveTest
def test... | [
"azure.eventhub._eventprocessor.in_memory_checkpoint_store.InMemoryCheckpointStore",
"sys.platform.startswith",
"time.sleep",
"azure.eventhub.EventData",
"azure.eventhub.EventHubConsumerClient.from_connection_string",
"pytest.skip",
"threading.Thread"
] | [((517, 628), 'azure.eventhub.EventHubConsumerClient.from_connection_string', 'EventHubConsumerClient.from_connection_string', (['connection_str'], {'consumer_group': '"""$default"""', 'receive_timeout': '(1)'}), "(connection_str,\n consumer_group='$default', receive_timeout=1)\n", (562, 628), False, 'from azure.eve... |
import random
from typing import List
import NeuralNetwork as nn
import os
import multiprocessing as mp
import threading as thrd
import pickle
import time
class Cards:
def __init__(self):
self.cards = []
for _ in range(4):
temp = random.sample(range(8), 8)
for ... | [
"pickle.dump",
"random.shuffle",
"pickle.load",
"multiprocessing.Pool",
"os.getpid",
"time.time",
"NeuralNetwork.NeuralNetwork",
"random.randint"
] | [((10446, 10457), 'time.time', 'time.time', ([], {}), '()\n', (10455, 10457), False, 'import time\n'), ((10509, 10520), 'time.time', 'time.time', ([], {}), '()\n', (10518, 10520), False, 'import time\n'), ((11068, 11077), 'multiprocessing.Pool', 'mp.Pool', ([], {}), '()\n', (11075, 11077), True, 'import multiprocessing... |
import numpy as np
import matplotlib.pyplot as plt
import matplotlib
matplotlib
matplotlib.rc('font', family='FreeSans', size=16)
data = []
with open('weak_scaling.txt', 'r') as file:
for line in file:
if 'Average' in line:
_line = line.split(' ')
data.append(float(_line[-1]))
... | [
"matplotlib.pyplot.savefig",
"numpy.asarray",
"matplotlib.pyplot.figure",
"matplotlib.rc",
"matplotlib.pyplot.tight_layout",
"matplotlib.pyplot.legend"
] | [((80, 129), 'matplotlib.rc', 'matplotlib.rc', (['"""font"""'], {'family': '"""FreeSans"""', 'size': '(16)'}), "('font', family='FreeSans', size=16)\n", (93, 129), False, 'import matplotlib\n'), ((478, 511), 'numpy.asarray', 'np.asarray', (['[1, 4, 9, 18, 36, 72]'], {}), '([1, 4, 9, 18, 36, 72])\n', (488, 511), True, '... |
from datetime import timedelta, datetime
from celery.schedules import crontab
from celery.task.base import periodic_task
from couchlog.models import ExceptionRecord
from django.conf import settings
@periodic_task(run_every=crontab(minute=0, hour=0), queue=getattr(settings, 'CELERY_PERIODIC_QUEUE', 'celery'))
def purge... | [
"datetime.datetime.now",
"couchlog.models.ExceptionRecord.get_db",
"celery.schedules.crontab",
"datetime.timedelta"
] | [((589, 613), 'couchlog.models.ExceptionRecord.get_db', 'ExceptionRecord.get_db', ([], {}), '()\n', (611, 613), False, 'from couchlog.models import ExceptionRecord\n'), ((343, 357), 'datetime.datetime.now', 'datetime.now', ([], {}), '()\n', (355, 357), False, 'from datetime import timedelta, datetime\n'), ((360, 379), ... |
"""Test mysensors messages."""
import pytest
import voluptuous as vol
from mysensors import Gateway, Message, get_const, Sensor
from mysensors.const_14 import Internal, MessageType
PRES_FIXTURES_14 = {
'S_DOOR': 'Front Door',
'S_ARDUINO_NODE': '1.4',
'S_ARDUINO_RELAY': '1.4',
}
PRES_FIXTURES_15 = {
'... | [
"mysensors.Gateway",
"mysensors.get_const",
"mysensors.Sensor",
"pytest.raises",
"mysensors.Message"
] | [((4654, 4671), 'mysensors.Gateway', 'Gateway', ([], {}), '(**kwargs)\n', (4661, 4671), False, 'from mysensors import Gateway, Message, get_const, Sensor\n'), ((4749, 4770), 'mysensors.Message', 'Message', (['message_data'], {}), '(message_data)\n', (4756, 4770), False, 'from mysensors import Gateway, Message, get_cons... |
import diffractsim
diffractsim.set_backend("CPU") #Change the string to "CUDA" to use GPU acceleration
from diffractsim import PolychromaticField,ApertureFromImage, cf, mm, cm
F = PolychromaticField(
spectrum=1.5 * cf.illuminant_d65,
extent_x=20 * mm,
extent_y=20 * mm,
Nx=1600,
Ny=1600,
)
F.add(A... | [
"diffractsim.PolychromaticField",
"diffractsim.set_backend",
"diffractsim.ApertureFromImage"
] | [((19, 49), 'diffractsim.set_backend', 'diffractsim.set_backend', (['"""CPU"""'], {}), "('CPU')\n", (42, 49), False, 'import diffractsim\n'), ((182, 292), 'diffractsim.PolychromaticField', 'PolychromaticField', ([], {'spectrum': '(1.5 * cf.illuminant_d65)', 'extent_x': '(20 * mm)', 'extent_y': '(20 * mm)', 'Nx': '(1600... |
__source__ = 'https://leetcode.com/problems/guess-number-higher-or-lower-ii/'
# https://github.com/kamyu104/LeetCode/blob/master/Python/guess-number-higher-or-lower-ii.py
# Time: O(n^2)
# Space: O(n^2)
#
# Description: Leetcode # 375. Guess Number Higher or Lower II
#
# We are playing the Guess Game. The game is as fo... | [
"unittest.main"
] | [((2372, 2387), 'unittest.main', 'unittest.main', ([], {}), '()\n', (2385, 2387), False, 'import unittest\n')] |
from fanstatic import Library, Resource, Group
library = Library('codemirror', 'resources')
codemirror_js = Resource(
library,
'lib/codemirror.js')
codemirror_css = Resource(
library,
'lib/codemirror.css')
codemirror = Group([
codemirror_js,
codemirror_css,
])
codemirror_keymap_emacs =... | [
"fanstatic.Group",
"fanstatic.Library",
"fanstatic.Resource"
] | [((59, 93), 'fanstatic.Library', 'Library', (['"""codemirror"""', '"""resources"""'], {}), "('codemirror', 'resources')\n", (66, 93), False, 'from fanstatic import Library, Resource, Group\n'), ((112, 150), 'fanstatic.Resource', 'Resource', (['library', '"""lib/codemirror.js"""'], {}), "(library, 'lib/codemirror.js')\n... |
# Copyright 2019 Extreme Networks, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | [
"tests.unit.base.ChangeRevFakeModelDB.drop_collection",
"tests.unit.base.ChangeRevFakeModel",
"uuid.uuid4"
] | [((944, 964), 'tests.unit.base.ChangeRevFakeModel', 'ChangeRevFakeModel', ([], {}), '()\n', (962, 964), False, 'from tests.unit.base import ChangeRevFakeModel, ChangeRevFakeModelDB\n'), ((998, 1036), 'tests.unit.base.ChangeRevFakeModelDB.drop_collection', 'ChangeRevFakeModelDB.drop_collection', ([], {}), '()\n', (1034,... |
"""
PosePipelineMaker.py
Generates and executes a pipeline to estimate poses
"""
import numpy as np
import time
import rospy
import numpy as np
from shutil import copyfile
from libs import *
import sys
import threading
import PointCloudVisualizer
import Classes.State as State
import CommandLine
from open3d import... | [
"CommandLine.Start",
"Classes.State.State",
"time.sleep",
"rospy.spin",
"PointCloudVisualizer.PCViewer"
] | [((1097, 1110), 'Classes.State.State', 'State.State', ([], {}), '()\n', (1108, 1110), True, 'import Classes.State as State\n'), ((1312, 1376), 'PointCloudVisualizer.PCViewer', 'PointCloudVisualizer.PCViewer', (['poses', 'argv[0]', '(480, 640)', 'state'], {}), '(poses, argv[0], (480, 640), state)\n', (1341, 1376), False... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# nats-client.py: Subscribe to a nats topic and wait for CoA requests
# Requisitos:
#
# pip3 install aiohttp
# pip3 install cchardet
# pip3 install aiodns
# pip3 install asyncio-nats-client
import sys
import json
import argparse
import asyncio
import traceback
import aio... | [
"traceback.format_exc",
"asyncio.sleep",
"argparse.ArgumentParser",
"logging.captureWarnings",
"json.dumps",
"aiohttp.TCPConnector",
"sys.exit",
"nats.aio.client.Client",
"asyncio.get_event_loop",
"aruba.clearpass.session"
] | [((531, 560), 'logging.captureWarnings', 'logging.captureWarnings', (['(True)'], {}), '(True)\n', (554, 560), False, 'import logging\n'), ((4041, 4047), 'nats.aio.client.Client', 'NATS', ([], {}), '()\n', (4045, 4047), True, 'from nats.aio.client import Client as NATS, Msg\n'), ((4758, 4783), 'argparse.ArgumentParser',... |
# Copyright (C) 2011 <NAME>
# Distributed under the MIT license, see the LICENSE file for details.
from nose.tools import *
from tests import prepare_database, with_database
from acoustic.data.source import find_or_insert_source
@with_database
def test_find_or_insert_source(conn):
rows = conn.execute("SELECT id,... | [
"acoustic.data.source.find_or_insert_source"
] | [((499, 532), 'acoustic.data.source.find_or_insert_source', 'find_or_insert_source', (['conn', '(1)', '(1)'], {}), '(conn, 1, 1)\n', (520, 532), False, 'from acoustic.data.source import find_or_insert_source\n'), ((567, 600), 'acoustic.data.source.find_or_insert_source', 'find_or_insert_source', (['conn', '(2)', '(2)']... |
import sys
import argparse
class DefaultHelpArgParser(argparse.ArgumentParser):
def error(self, message):
sys.stderr.write("Error: %s\n" %message)
self.print_help()
sys.exit(1)
def process_args(sysargs=None):
cmds = {
"version": do_version,
"predict": do_predict,
... | [
"sys.stderr.write",
"moanna.main.moanna_predict",
"sys.exit",
"moanna.main.moanna_train"
] | [((1083, 1159), 'moanna.main.moanna_predict', 'moanna_predict', (['args.input', 'args.summary', 'args.output', 'args.model', 'args.json'], {}), '(args.input, args.summary, args.output, args.model, args.json)\n', (1097, 1159), False, 'from moanna.main import moanna_predict\n'), ((1436, 1485), 'moanna.main.moanna_train',... |
from rest_framework.test import APITestCase
from rest_framework import status
from django.contrib.auth import get_user_model
from django.urls import reverse
from ..models import Post, Tag
class BlogAPIViewTests(APITestCase):
def setUp(self) -> None:
self.url_post_list = reverse('post_list')
self.... | [
"django.contrib.auth.get_user_model",
"django.urls.reverse"
] | [((286, 306), 'django.urls.reverse', 'reverse', (['"""post_list"""'], {}), "('post_list')\n", (293, 306), False, 'from django.urls import reverse\n'), ((1353, 1393), 'django.urls.reverse', 'reverse', (['"""post_detail"""'], {'kwargs': "{'pk': 1}"}), "('post_detail', kwargs={'pk': 1})\n", (1360, 1393), False, 'from djan... |
from django.shortcuts import render
from django.http import HttpResponseRedirect, HttpResponse
from django.urls import reverse
from django.contrib.auth import login, authenticate
from django.contrib.auth.views import logout
from django.views.generic import TemplateView
from django.contrib.auth.mixins import LoginRequir... | [
"django.shortcuts.render",
"django.http.HttpResponse",
"csv.DictReader"
] | [((25952, 26002), 'django.http.HttpResponse', 'HttpResponse', (['dataset.csv'], {'content_type': '"""text/csv"""'}), "(dataset.csv, content_type='text/csv')\n", (25964, 26002), False, 'from django.http import HttpResponseRedirect, HttpResponse\n'), ((26274, 26333), 'django.http.HttpResponse', 'HttpResponse', (['dataset... |
# -*- coding: utf-8 -*-
import django_rq
import stripe
import logging
from djmoney.money import Money
from datetime import datetime, timedelta
from dateutil import tz
from django.conf import settings
from django.contrib.auth.models import Group
from django.contrib.auth import authenticate
from django.db.models import Q... | [
"logging.getLogger",
"rest_framework.serializers.SlugField",
"stripe.Charge.create",
"rest_framework.serializers.BooleanField",
"django.utils.translation.ugettext_lazy",
"rest_framework.serializers.JSONField",
"stripe.Customer.create",
"rest_framework.serializers.CharField",
"django_rq.enqueue"
] | [((841, 868), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (858, 868), False, 'import logging\n'), ((1037, 1108), 'rest_framework.serializers.JSONField', 'serializers.JSONField', ([], {'required': '(True)', 'allow_null': '(False)', 'write_only': '(True)'}), '(required=True, allow_null=F... |
import logging
logging.basicConfig(
format="%(asctime)s,%(msecs)d %(levelname)-8s [%(filename)s:%(lineno)d] %(message)s",
datefmt="%Y-%m-%d:%H:%M:%S",
level=logging.DEBUG,
)
logger = logging.getLogger(__name__)
import os
import uuid
import glob
import json
import time
import shlex
import shutil
from dat... | [
"logging.basicConfig",
"logging.getLogger",
"os.getenv",
"diskcache.Deque",
"diskcache.Index",
"os.path.join",
"time.time"
] | [((16, 181), 'logging.basicConfig', 'logging.basicConfig', ([], {'format': '"""%(asctime)s,%(msecs)d %(levelname)-8s [%(filename)s:%(lineno)d] %(message)s"""', 'datefmt': '"""%Y-%m-%d:%H:%M:%S"""', 'level': 'logging.DEBUG'}), "(format=\n '%(asctime)s,%(msecs)d %(levelname)-8s [%(filename)s:%(lineno)d] %(message)s'\n... |
import time
from dataclasses import dataclass, field
from typing import Optional
from rlbot.training.training import Grade, Pass, Fail
from rlbot.utils.game_state_util import GameState
from rlbot.utils.structures.game_data_struct import GameTickPacket
from rlbottraining.grading.grader import Grader
from rlbottraining.... | [
"rlbot.training.training.Pass",
"match.PlayerScore",
"bots.fmt_bot_name",
"rlbot.utils.game_state_util.GameState",
"time.time",
"dataclasses.field"
] | [((808, 844), 'dataclasses.field', 'field', ([], {'default_factory': 'ReplayMonitor'}), '(default_factory=ReplayMonitor)\n', (813, 844), False, 'from dataclasses import dataclass, field\n'), ((4067, 4101), 'dataclasses.field', 'field', ([], {'default_factory': 'MatchGrader'}), '(default_factory=MatchGrader)\n', (4072, ... |
# ------------------------------------------------------------------------------
# Recurrence
# ------------------------------------------------------------------------------
# Somewhat based upon RFC 5545 RRules, implemented using dateutil.rrule
# Does not support timezones ... and probably never will
# Does not suppo... | [
"operator.attrgetter",
"dateutil.rrule.rrulestr",
"django.utils.translation.gettext",
"dateutil.rrule.rrule",
"datetime.timedelta"
] | [((3504, 3528), 'operator.attrgetter', 'attrgetter', (['"""rule._freq"""'], {}), "('rule._freq')\n", (3514, 3528), False, 'from operator import attrgetter\n'), ((3604, 3632), 'operator.attrgetter', 'attrgetter', (['"""rule._interval"""'], {}), "('rule._interval')\n", (3614, 3632), False, 'from operator import attrgette... |
# -*- coding: utf-8 -*-
"""
Created on Wed Apr 7 09:58:55 2021
@author: emari
"""
import numpy as np
import pandas as pd
class node():
def __init__(self):
self.parent_node = ""
self.child_connections = [np.array([],dtype=object),np.array([],dtype=object),np.array([],dtype=object),np.array([],dty... | [
"pandas.DataFrame",
"numpy.array",
"pandas.Series"
] | [((1286, 1470), 'pandas.DataFrame', 'pd.DataFrame', ([], {'columns': "['parent_node', 'username', 'connection_type', 'bio', 'captions',\n 'total_likes', 'total_followers', 'total_following', 'profile_img_url',\n 'root_post_url']"}), "(columns=['parent_node', 'username', 'connection_type', 'bio',\n 'captions', ... |
from __future__ import unicode_literals
from django.db import reset_queries, transaction, router
from reversion.models import Revision, Version, _safe_subquery
from reversion.management.commands import BaseRevisionCommand
from reversion.revisions import create_revision, set_comment, add_to_revision
class Command(Base... | [
"reversion.revisions.set_comment",
"django.db.transaction.atomic",
"reversion.models.Version.objects.using",
"django.db.reset_queries",
"reversion.revisions.add_to_revision",
"reversion.revisions.create_revision",
"django.db.router.db_for_write"
] | [((1250, 1279), 'django.db.router.db_for_write', 'router.db_for_write', (['Revision'], {}), '(Revision)\n', (1269, 1279), False, 'from django.db import reset_queries, transaction, router\n'), ((1293, 1324), 'django.db.transaction.atomic', 'transaction.atomic', ([], {'using': 'using'}), '(using=using)\n', (1311, 1324), ... |
"""
marchenko_pastur.py
--------------
Graph reconstruction algorithm based on <NAME>., & <NAME>. (1967).
Distribution of eigenvalues for some sets of random matrices. Matematicheskii
Sbornik, 114(4), 507-536.
author: <NAME>
Submitted as part of the 2019 NetSI Collabathon.
"""
from .base import BaseReconstructor
i... | [
"numpy.sqrt",
"numpy.corrcoef",
"networkx.empty_graph",
"numpy.diag",
"numpy.linalg.eigh"
] | [((4505, 4520), 'numpy.corrcoef', 'np.corrcoef', (['TS'], {}), '(TS)\n', (4516, 4520), True, 'import numpy as np\n'), ((4568, 4585), 'numpy.linalg.eigh', 'np.linalg.eigh', (['C'], {}), '(C)\n', (4582, 4585), True, 'import numpy as np\n'), ((4782, 4801), 'networkx.empty_graph', 'nx.empty_graph', ([], {'n': 'N'}), '(n=N)... |
#! /usr/bin/python3
__license__ = "MIT"
import os
# Welcome
print("\n\n")
print(" _______ __ __ _______ _______ _______ _______ _______ _______ _______ ______ ___ _______ _______ ")
print("| _ || | | || || | | _ || || | | || || _ | | |... | [
"os.system"
] | [((1089, 1115), 'os.system', 'os.system', (['"""apt update -y"""'], {}), "('apt update -y')\n", (1098, 1115), False, 'import os\n'), ((1141, 1168), 'os.system', 'os.system', (['"""apt upgrade -y"""'], {}), "('apt upgrade -y')\n", (1150, 1168), False, 'import os\n'), ((1214, 1246), 'os.system', 'os.system', (['"""apt fu... |
# coding: utf-8
# In[ ]:
# Boto3 is the Amazon Web Services (AWS) Software Development Kit (SDK) for Python, which allows Python developers to write software that makes use of services like Amazon S3 and Amazon EC2.
# OpenCV is a library of programming functions mainly aimed at real-time computer vision
from __fut... | [
"json.loads",
"PIL.Image.open",
"base64.b64encode",
"json.dumps",
"io.BytesIO",
"base64.b64decode",
"PIL.ImageDraw.Draw"
] | [((1350, 1371), 'json.loads', 'json.loads', (['conf_json'], {}), '(conf_json)\n', (1360, 1371), False, 'import json\n'), ((1750, 1792), 'base64.b64decode', 'base64.b64decode', (["msg.value['image_bytes']"], {}), "(msg.value['image_bytes'])\n", (1766, 1792), False, 'import base64\n'), ((1888, 1909), 'io.BytesIO', 'io.By... |
import flask
from flask_flamegraph import FlaskFlamegraph
def test_wsgi():
app = flask.Flask(__name__)
flask_flamegraph = FlaskFlamegraph()
flask_flamegraph.init_app(app)
| [
"flask_flamegraph.FlaskFlamegraph",
"flask.Flask"
] | [((88, 109), 'flask.Flask', 'flask.Flask', (['__name__'], {}), '(__name__)\n', (99, 109), False, 'import flask\n'), ((133, 150), 'flask_flamegraph.FlaskFlamegraph', 'FlaskFlamegraph', ([], {}), '()\n', (148, 150), False, 'from flask_flamegraph import FlaskFlamegraph\n')] |
import numpy as np
from scipy import special as special
from scipy.special import logsumexp
from mimo.abstraction import MixtureDistribution
from mimo.abstraction import BayesianMixtureDistribution
from mimo.distributions.bayesian import CategoricalWithDirichlet
from mimo.distributions.bayesian import CategoricalWith... | [
"numpy.log",
"numpy.arange",
"pathos.helpers.mp.current_process",
"numpy.where",
"sklearn.decomposition.PCA",
"numpy.max",
"numpy.linspace",
"numpy.empty",
"numpy.vstack",
"matplotlib.pyplot.scatter",
"matplotlib.pyplot.Rectangle",
"matplotlib.pyplot.axis",
"sklearn.preprocessing.MinMaxScale... | [((1361, 1396), 'numpy.bincount', 'np.bincount', (['z'], {'minlength': 'self.size'}), '(z, minlength=self.size)\n', (1372, 1396), True, 'import numpy as np\n'), ((1412, 1438), 'numpy.zeros', 'np.zeros', (['(size, self.dim)'], {}), '((size, self.dim))\n', (1420, 1438), True, 'import numpy as np\n'), ((1573, 1600), 'nump... |
import hashlib
from datetime import datetime
from django.http import HttpResponse
from django.conf import settings
from urllib import urlencode
from urllib2 import urlopen
from xml.etree.ElementTree import XML
from dimagi.utils.web import get_url_base
from django.core.urlresolvers import reverse
from xml.sax.saxutils i... | [
"corehq.apps.ivr.api.format_ivr_response",
"urllib2.urlopen",
"corehq.apps.smsforms.app.start_session",
"datetime.datetime.utcnow",
"xml.etree.ElementTree.XML",
"corehq.apps.app_manager.models.Form.get_form",
"django.core.urlresolvers.reverse",
"dimagi.utils.web.get_url_base",
"corehq.apps.smsforms.... | [((2275, 2319), 'corehq.apps.app_manager.models.Form.get_form', 'Form.get_form', (['call_log_entry.form_unique_id'], {}), '(call_log_entry.form_unique_id)\n', (2288, 2319), False, 'from corehq.apps.app_manager.models import Form\n'), ((2567, 2592), 'corehq.apps.smsforms.util.form_requires_input', 'form_requires_input',... |
# Copyright (c) OpenMMLab. All rights reserved.
import os
import os.path as osp
from typing import Optional, Sequence, Union
from .base_dataset import BaseDataset
from .builder import DATASETS
@DATASETS.register_module()
class Sintel(BaseDataset):
"""Sintel optical flow dataset.
Args:
pass_style (st... | [
"os.listdir",
"os.path.join"
] | [((3059, 3100), 'os.path.join', 'osp.join', (['self.data_root', 'self.subset_dir'], {}), '(self.data_root, self.subset_dir)\n', (3067, 3100), True, 'import os.path as osp\n'), ((3121, 3162), 'os.path.join', 'osp.join', (['self.data_root', 'self.pass_style'], {}), '(self.data_root, self.pass_style)\n', (3129, 3162), Tru... |
from unittest.mock import Mock, patch
import pytest
from flask import Blueprint, Flask
from combojsonapi.spec.apispec import _add_leading_slash, DocBlueprintMixin
module_path = 'combojsonapi.spec.apispec'
@pytest.mark.parametrize('input_', ('/some_string', 'some_string'))
def test_leading_slash(input_):
asser... | [
"combojsonapi.spec.apispec.DocBlueprintMixin._openapi_redoc",
"unittest.mock.Mock",
"combojsonapi.spec.apispec.DocBlueprintMixin._openapi_swagger_ui",
"combojsonapi.spec.apispec.DocBlueprintMixin._register_redoc_rule",
"combojsonapi.spec.apispec.DocBlueprintMixin._register_swagger_ui_rule",
"pytest.param"... | [((212, 278), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""input_"""', "('/some_string', 'some_string')"], {}), "('input_', ('/some_string', 'some_string'))\n", (235, 278), False, 'import pytest\n'), ((485, 539), 'unittest.mock.patch.object', 'patch.object', (['Blueprint', '"""add_url_rule"""'], {'autosp... |
import os
import re
import setuptools
with open("README.md", "r", encoding="utf-8") as f:
long_description = f.read()
init_py = os.path.join(os.path.dirname(__file__), "arpq", "__init__.py")
with open(init_py) as f:
cont = f.read()
str_regex = r"['\"]([^'\"]*)['\"]"
try:
version = re.findal... | [
"os.path.dirname",
"re.findall",
"setuptools.find_packages"
] | [((148, 173), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (163, 173), False, 'import os\n'), ((1809, 1835), 'setuptools.find_packages', 'setuptools.find_packages', ([], {}), '()\n', (1833, 1835), False, 'import setuptools\n'), ((311, 373), 're.findall', 're.findall', (['f"""^__version__ = ... |
from django.shortcuts import render
def painelProfessor (request):
return render(request,"painel/painelProfessor.html") | [
"django.shortcuts.render"
] | [((80, 126), 'django.shortcuts.render', 'render', (['request', '"""painel/painelProfessor.html"""'], {}), "(request, 'painel/painelProfessor.html')\n", (86, 126), False, 'from django.shortcuts import render\n')] |
import pytest
import pickle
from tokenizers.decoders import Decoder, ByteLevel, WordPiece, Metaspace, BPEDecoder
class TestByteLevel:
def test_instantiate(self):
assert ByteLevel() is not None
assert isinstance(ByteLevel(), Decoder)
assert isinstance(ByteLevel(), ByteLevel)
assert... | [
"tokenizers.decoders.ByteLevel",
"tokenizers.decoders.WordPiece",
"tokenizers.decoders.BPEDecoder",
"tokenizers.decoders.Metaspace",
"pytest.raises"
] | [((432, 443), 'tokenizers.decoders.ByteLevel', 'ByteLevel', ([], {}), '()\n', (441, 443), False, 'from tokenizers.decoders import Decoder, ByteLevel, WordPiece, Metaspace, BPEDecoder\n'), ((947, 958), 'tokenizers.decoders.WordPiece', 'WordPiece', ([], {}), '()\n', (956, 958), False, 'from tokenizers.decoders import Dec... |
"""This module is used for Plotting the loss and accuracy curve."""
import numpy as np
import plotly.graph_objects as go
from plotly import offline
def scatter_plotly_keras(history_dict=None, title=None, filename=None,
plot_loss=True):
"""使用 Keras 模型输出的训练字典,画出损失值和准确度的折线图。
"""... | [
"plotly.graph_objects.Bar",
"plotly.graph_objects.Layout",
"plotly.offline.plot",
"plotly.graph_objects.Figure",
"plotly.graph_objects.Scatter"
] | [((4405, 4416), 'plotly.graph_objects.Figure', 'go.Figure', ([], {}), '()\n', (4414, 4416), True, 'import plotly.graph_objects as go\n'), ((4849, 4895), 'plotly.offline.plot', 'offline.plot', (['fig'], {'filename': 'f"""{filename}.html"""'}), "(fig, filename=f'{filename}.html')\n", (4861, 4895), False, 'from plotly imp... |
# !/usr/bin/python
# -*- coding: utf-8 -*-
# @time : 2020/5/6 21:51
# @author : Mo
# @function: trainer of text-classification
# 适配linux
import sys
import os
path_root = os.path.abspath(os.path.join(os.path.dirname(__file__), "../.."))
sys.path.append(path_root)
## cpu-gpu与tf.keras
# os.environ["CUDA_VISIBLE_DEVI... | [
"macadam.conf.logger_config.logger.info",
"os.path.join",
"os.path.dirname",
"macadam.base.utils.txt_read",
"time.time",
"macadam.base.preprocess.FilePrerocessXY",
"sys.path.append",
"macadam.base.preprocess.ListPrerocessXY"
] | [((242, 268), 'sys.path.append', 'sys.path.append', (['path_root'], {}), '(path_root)\n', (257, 268), False, 'import sys\n'), ((5250, 5276), 'macadam.conf.logger_config.logger.info', 'logger.info', (['"""训练/验证语料读取完成"""'], {}), "('训练/验证语料读取完成')\n", (5261, 5276), False, 'from macadam.conf.logger_config import logger\n'),... |
#
# Copyright (C) 2020 <NAME> <<EMAIL>>.
# SPDX-License-Identifier: MIT
#
# pylint: disable=missing-function-docstring
"""SELinux modules tests.
"""
import random
import subprocess
import infraspec.service.systemctl as TT
def list_services_itr(status: str = "enabled"):
cmd = "systemctl list-unit-files --type=ser... | [
"subprocess.check_output",
"infraspec.service.systemctl.is_running",
"infraspec.service.systemctl.is_enabled",
"subprocess.check_call"
] | [((344, 372), 'subprocess.check_output', 'subprocess.check_output', (['cmd'], {}), '(cmd)\n', (367, 372), False, 'import subprocess\n'), ((999, 1017), 'infraspec.service.systemctl.is_enabled', 'TT.is_enabled', (['svc'], {}), '(svc)\n', (1012, 1017), True, 'import infraspec.service.systemctl as TT\n'), ((1146, 1164), 'i... |
"""Implements Benchmark class to choose optimal inbatch_parallel target for SeismicBatch methods"""
# pylint: disable=import-error
import dill
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
from seismicpro.batchflow import Pipeline, CPUMonitor, C
from seismicpro.batchflow.research import Opt... | [
"seismicpro.batchflow.Pipeline",
"matplotlib.pyplot.xticks",
"matplotlib.pyplot.ylabel",
"seaborn.set_theme",
"matplotlib.pyplot.xlabel",
"dill.dump",
"dill.load",
"matplotlib.pyplot.figure",
"seaborn.lineplot",
"seismicpro.batchflow.research.Research",
"seismicpro.batchflow.research.EC",
"mat... | [((340, 371), 'seaborn.set_theme', 'sns.set_theme', ([], {'style': '"""darkgrid"""'}), "(style='darkgrid')\n", (353, 371), True, 'import seaborn as sns\n'), ((2679, 2690), 'seismicpro.batchflow.C', 'C', (['"""target"""'], {}), "('target')\n", (2680, 2690), False, 'from seismicpro.batchflow import Pipeline, CPUMonitor, ... |
# Generated by Django 3.0.5 on 2021-10-09 10:53
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('quiz', '0008_auto_20210802_1446'),
]
operations = [
migrations.AddField(
model_name='course',
name='status',
... | [
"django.db.models.BooleanField"
] | [((331, 365), 'django.db.models.BooleanField', 'models.BooleanField', ([], {'default': '(False)'}), '(default=False)\n', (350, 365), False, 'from django.db import migrations, models\n')] |
import setuptools
VERSION = '0.1.2'
NAME = 'get_response'
AUTHOR = 'skv0zsneg'
DESCRIPTION = ("Parsing Tool for json-like, xml-like and etc Types of Response"
"for Humans.")
with open("README.md", "r", encoding="utf-8") as fh:
LONG_DESCRIPTION = fh.read()
setuptools.setup(
name=NAME,
ver... | [
"setuptools.find_packages"
] | [((836, 873), 'setuptools.find_packages', 'setuptools.find_packages', ([], {'where': '"""src"""'}), "(where='src')\n", (860, 873), False, 'import setuptools\n')] |
"""
Name : __init__.py
boxes module
This import path is important to allow importing correctly as package
"""
import os, sys
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '.')))
| [
"os.path.dirname"
] | [((174, 199), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (189, 199), False, 'import os, sys\n')] |
# ------------------------------------------------------
# Morphological Operations
#
# Created by <NAME> on 19/09/21.
# Copyright (c) 2021 <NAME>. All rights reserved.
#
# ------------------------------------------------------
import cv2
import numpy as np
# Image path
# Tried with other images to by changing the f... | [
"cv2.imwrite",
"cv2.countNonZero",
"numpy.ones",
"cv2.threshold",
"cv2.erode",
"numpy.size",
"cv2.morphologyEx",
"numpy.zeros",
"cv2.getStructuringElement",
"cv2.waitKey",
"cv2.bitwise_or",
"cv2.destroyAllWindows",
"cv2.bitwise_not",
"cv2.dilate",
"cv2.subtract",
"cv2.imread"
] | [((675, 698), 'cv2.imread', 'cv2.imread', (['img_path', '(0)'], {}), '(img_path, 0)\n', (685, 698), False, 'import cv2\n'), ((718, 743), 'numpy.ones', 'np.ones', (['(5, 5)', 'np.uint8'], {}), '((5, 5), np.uint8)\n', (725, 743), True, 'import numpy as np\n'), ((765, 801), 'cv2.erode', 'cv2.erode', (['img', 'kernel'], {'... |
import pandas as pd
import numpy as np
import sys
import pickle
import os
import shutil
import time
import argparse
import peakutils
from sklearn.ensemble import GradientBoostingRegressor
from sklearn.model_selection import RandomizedSearchCV
from sklearn.model_selection import train_test_split
import configparser
from... | [
"sys.exit",
"numpy.arange",
"pandas.read_feather",
"os.path.exists",
"numpy.mean",
"argparse.ArgumentParser",
"pandas.DataFrame",
"sklearn.ensemble.GradientBoostingRegressor",
"configparser.ExtendedInterpolation",
"numpy.abs",
"sklearn.model_selection.train_test_split",
"pandas.merge",
"os.p... | [((2876, 3049), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Using the library sequences, build run-specific coordinate estimators for the sequence-charges identified in the experiment."""'}), "(description=\n 'Using the library sequences, build run-specific coordinate estimators fo... |
from utilities.testing import APIViewTestCases
from netbox_dns.tests.custom import APITestCase
from netbox_dns.models import View
class ViewTest(
APITestCase,
APIViewTestCases.GetObjectViewTestCase,
APIViewTestCases.ListObjectsViewTestCase,
APIViewTestCases.CreateObjectViewTestCase,
APIViewTestCa... | [
"netbox_dns.models.View",
"netbox_dns.models.View.objects.bulk_create"
] | [((763, 794), 'netbox_dns.models.View.objects.bulk_create', 'View.objects.bulk_create', (['views'], {}), '(views)\n', (787, 794), False, 'from netbox_dns.models import View\n'), ((661, 679), 'netbox_dns.models.View', 'View', ([], {'name': '"""test1"""'}), "(name='test1')\n", (665, 679), False, 'from netbox_dns.models i... |
from micropython import const
"""
ShipModul 3Wi edition uses a defined SSID and password. These will
need to be changed appropriately before installing boot.py on the
microcontroller.
http://www.shipmodul.com/downloads/manuals/MiniPlex-3_EN.pdf
"""
SSID = const("MiniPlex")
PASS = const("<PASSWORD>")
IP = const("10.0... | [
"micropython.const"
] | [((259, 276), 'micropython.const', 'const', (['"""MiniPlex"""'], {}), "('MiniPlex')\n", (264, 276), False, 'from micropython import const\n'), ((284, 303), 'micropython.const', 'const', (['"""<PASSWORD>"""'], {}), "('<PASSWORD>')\n", (289, 303), False, 'from micropython import const\n'), ((309, 326), 'micropython.const... |
import discord
class HavePermission:
"""Checks whether a user has the necessary permission to perform an action"""
def __init__(self, discord_member, guild):
self.discord_member = discord_member
self.guild = guild
def channel(self):
if self.discord_member.guild_permissions.manage... | [
"discord.utils.get"
] | [((1222, 1284), 'discord.utils.get', 'discord.utils.get', (['self.discord_member.guild.roles'], {'id': 'role_id'}), '(self.discord_member.guild.roles, id=role_id)\n', (1239, 1284), False, 'import discord\n')] |
import pandas, sys
data_dir = sys.argv[1] + '/'
project_name = sys.argv[2]
deleted_lines_filename = data_dir + 'lines_deleted_in_bf_shas/' + project_name + '.buggylines'
df = pandas.read_csv(deleted_lines_filename)
df = df[['bf_sha', 'bi_sha']]
grouped = df.groupby(['bf_sha', 'bi_sha'])
index = [gp_keys[0] for gp_key... | [
"pandas.read_csv"
] | [((177, 216), 'pandas.read_csv', 'pandas.read_csv', (['deleted_lines_filename'], {}), '(deleted_lines_filename)\n', (192, 216), False, 'import pandas, sys\n')] |
# Example 12: small scene
#
# This time we render a small scene with shadow
from pyrt.math import Vec3
from pyrt.scene import Scene
from pyrt.light import PointLight
from pyrt.geometry import Triangle, Sphere, Vertex
from pyrt.material import PhongMaterial
from pyrt.camera import PerspectiveCamera
from pyrt.renderer i... | [
"pyrt.scene.Scene",
"pyrt.camera.PerspectiveCamera",
"moviepy.editor.VideoClip",
"pyrt.geometry.Vertex",
"pyrt.renderer.SimpleRT",
"pyrt.geometry.Triangle",
"pyrt.math.Vec3"
] | [((2179, 2216), 'moviepy.editor.VideoClip', 'mpy.VideoClip', (['make_frame'], {'duration': '(4)'}), '(make_frame, duration=4)\n', (2192, 2216), True, 'import moviepy.editor as mpy\n'), ((615, 651), 'pyrt.camera.PerspectiveCamera', 'PerspectiveCamera', (['width', 'height', '(45)'], {}), '(width, height, 45)\n', (632, 65... |
# <NAME>
# 11/16/2016
from Solution import check
import unittest
class MyTestCase(unittest.TestCase):
def test_same_length(self):
self.assertEqual(check("dog", "god"), True)
self.assertEqual(check("Happy", "appHy"), True)
def test_different_length(self):
self.assertEqual(check("Dokok... | [
"unittest.main",
"Solution.check"
] | [((601, 616), 'unittest.main', 'unittest.main', ([], {}), '()\n', (614, 616), False, 'import unittest\n'), ((162, 181), 'Solution.check', 'check', (['"""dog"""', '"""god"""'], {}), "('dog', 'god')\n", (167, 181), False, 'from Solution import check\n'), ((214, 237), 'Solution.check', 'check', (['"""Happy"""', '"""appHy"... |
import torch
import superp
import math
############################################
# set default data type to double
############################################
torch.set_default_dtype(torch.float64)
torch.set_default_tensor_type(torch.DoubleTensor)
# torch.set_default_dtype(torch.float32)
# torch.set_default_tensor... | [
"torch.tensor",
"torch.pow",
"torch.set_default_tensor_type",
"torch.set_default_dtype"
] | [((164, 202), 'torch.set_default_dtype', 'torch.set_default_dtype', (['torch.float64'], {}), '(torch.float64)\n', (187, 202), False, 'import torch\n'), ((203, 252), 'torch.set_default_tensor_type', 'torch.set_default_tensor_type', (['torch.DoubleTensor'], {}), '(torch.DoubleTensor)\n', (232, 252), False, 'import torch\... |
import pyautogui
from pynput.mouse import Button, Listener
from datetime import *
def clicou(x,y, botao, pressionado):
if pressionado == True:
im1 = pyautogui.screenshot()
im1.save(f'{datetime.now()}.png')
listener = Listener(on_click=clicou)
listener.start()
listener.join() | [
"pyautogui.screenshot",
"pynput.mouse.Listener"
] | [((239, 264), 'pynput.mouse.Listener', 'Listener', ([], {'on_click': 'clicou'}), '(on_click=clicou)\n', (247, 264), False, 'from pynput.mouse import Button, Listener\n'), ((162, 184), 'pyautogui.screenshot', 'pyautogui.screenshot', ([], {}), '()\n', (182, 184), False, 'import pyautogui\n')] |
"""
Eto API
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: 0.11.0
Generated by: https://openapi-generator.tech
"""
import re # noqa: F401
import sys # noqa: F401
from eto._internal.api_c... | [
"eto._internal.api_client.ApiClient",
"eto._internal.api_client.Endpoint"
] | [((1015, 1720), 'eto._internal.api_client.Endpoint', '_Endpoint', ([], {'settings': "{'response_type': (bool, date, datetime, dict, float, int, list, str,\n none_type), 'auth': [], 'endpoint_path': '/api/v1/projects/{project}',\n 'operation_id': 'create_project', 'http_method': 'POST', 'servers': None}", 'params_... |
from rmonitor.common.helpers import Duration
class HeartbeatMessage(object):
def __init__(self, fields):
self.type = '$F'
# Number of laps to go
# (0 - 99999)
self.laps_to_go = fields[0]
# Time until the session ends
# ("HH:MM:SS")
self.time_to_go = Durat... | [
"rmonitor.common.helpers.Duration"
] | [((315, 334), 'rmonitor.common.helpers.Duration', 'Duration', (['fields[1]'], {}), '(fields[1])\n', (323, 334), False, 'from rmonitor.common.helpers import Duration\n'), ((413, 432), 'rmonitor.common.helpers.Duration', 'Duration', (['fields[2]'], {}), '(fields[2])\n', (421, 432), False, 'from rmonitor.common.helpers im... |
import torch
import torch.nn as nn
class Model(torch.nn.Module):
def __init__(self, input_shape, hidden_count = 128, lattent_size = 8):
super(Model, self).__init__()
self.device = "cpu"
self.layers_encoder = [
nn.Linear(input_shape[0], hidden_count),
nn.ReLU(),
... | [
"torch.nn.ReLU",
"torch.nn.Tanh",
"torch.nn.init.xavier_uniform_",
"torch.nn.Sequential",
"torch.load",
"torch.nn.Linear"
] | [((771, 831), 'torch.nn.init.xavier_uniform_', 'torch.nn.init.xavier_uniform_', (['self.layers_encoder[0].weight'], {}), '(self.layers_encoder[0].weight)\n', (800, 831), False, 'import torch\n'), ((840, 900), 'torch.nn.init.xavier_uniform_', 'torch.nn.init.xavier_uniform_', (['self.layers_encoder[2].weight'], {}), '(se... |
import sys
sys.path.append('/usr/local/lib/python2.7/site-packages')
import socket
import cv2
import numpy
import pickle
import http.server
import socketserver
Handler = http.server.SimpleHTTPRequestHandler
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
s.setsockopt(socket.SOL_SOCKET, socket.SO_SNDBUF, 1000000... | [
"socketserver.TCPServer",
"socket.socket",
"pickle.dumps",
"cv2.imshow",
"cv2.waitKey",
"cv2.destroyAllWindows",
"cv2.VideoCapture",
"sys.path.append",
"socket.gethostname"
] | [((11, 68), 'sys.path.append', 'sys.path.append', (['"""/usr/local/lib/python2.7/site-packages"""'], {}), "('/usr/local/lib/python2.7/site-packages')\n", (26, 68), False, 'import sys\n'), ((214, 262), 'socket.socket', 'socket.socket', (['socket.AF_INET', 'socket.SOCK_DGRAM'], {}), '(socket.AF_INET, socket.SOCK_DGRAM)\n... |
"""
Zabbix Monitoring for Elasticsearch
"""
import json
import sys
import logging
import argparse
from distutils.util import strtobool
import configparser
from collections import MutableMapping
from elasticsearch import Elasticsearch, exceptions
import urllib3
def parse_conf(argv=None):
"""Read configuration pa... | [
"logging.basicConfig",
"distutils.util.strtobool",
"configparser.ConfigParser",
"argparse.ArgumentParser",
"elasticsearch.Elasticsearch",
"json.dumps",
"logging.info",
"urllib3.disable_warnings",
"sys.exit",
"logging.error"
] | [((678, 797), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '__doc__', 'formatter_class': 'argparse.RawDescriptionHelpFormatter', 'add_help': '(False)'}), '(description=__doc__, formatter_class=argparse.\n RawDescriptionHelpFormatter, add_help=False)\n', (701, 797), False, 'import argpar... |
import json
from setuptools import setup, find_packages
with open('install.json', 'r') as fh:
version = json.load(fh)['programVersion']
if not version:
raise RuntimeError('Cannot find version information')
setup(
author='',
description='Playbook app wrapper for TextBlob (https://github.com/sloria/Tex... | [
"json.load",
"setuptools.find_packages"
] | [((109, 122), 'json.load', 'json.load', (['fh'], {}), '(fh)\n', (118, 122), False, 'import json\n'), ((365, 380), 'setuptools.find_packages', 'find_packages', ([], {}), '()\n', (378, 380), False, 'from setuptools import setup, find_packages\n')] |
# Generated by Django 2.2.3 on 2019-08-02 08:52
from django.db import migrations, models
import django.db.models.deletion
import uuid
class Migration(migrations.Migration):
dependencies = [("user", "0004_auto_20190802_1046"), ("event", "0006_subscriber")]
operations = [
migrations.AlterModelOptions... | [
"django.db.models.ForeignKey",
"django.db.models.BooleanField",
"django.db.migrations.AlterModelOptions",
"django.db.models.PositiveSmallIntegerField",
"django.db.migrations.RemoveField",
"django.db.models.UUIDField"
] | [((292, 443), 'django.db.migrations.AlterModelOptions', 'migrations.AlterModelOptions', ([], {'name': '"""scheduleevent"""', 'options': "{'verbose_name': 'Schedule in event', 'verbose_name_plural':\n 'Schedules in events'}"}), "(name='scheduleevent', options={'verbose_name':\n 'Schedule in event', 'verbose_na... |
from typing import List, Tuple
from nnttpy import jackcompiler
class JackCompileEngine(jackcompiler.XMLCompilationEngine):
"""Symbol engine with symbol table."""
kind_list = ["static", "field", "argument", "var"]
ops_table = {
"+": "add",
"-": "sub",
"=": "eq",
"<": ... | [
"nnttpy.jackcompiler.SymbolTable",
"nnttpy.jackcompiler.VMWriter"
] | [((547, 573), 'nnttpy.jackcompiler.SymbolTable', 'jackcompiler.SymbolTable', ([], {}), '()\n', (571, 573), False, 'from nnttpy import jackcompiler\n'), ((597, 620), 'nnttpy.jackcompiler.VMWriter', 'jackcompiler.VMWriter', ([], {}), '()\n', (618, 620), False, 'from nnttpy import jackcompiler\n')] |
from . import config
import networkx as nx
import torch
import torch.nn
import torch_geometric as tg
import torch_geometric.data
import torch_geometric.utils
from tqdm.auto import tqdm
def batch_of_dataset(dataset):
loader = tg.data.DataLoader(dataset, batch_size=len(dataset))
for g, h, lb, ub in loader:
... | [
"torch_geometric.data.Data",
"torch.LongTensor",
"torch.argmax",
"torch.exp",
"torch.norm",
"torch.nn.functional.one_hot",
"torch.nn.functional.relu",
"tqdm.auto.tqdm",
"torch_geometric.utils.to_networkx",
"torch.isnan",
"torch.zeros",
"tqdm.auto.tqdm.write"
] | [((581, 620), 'tqdm.auto.tqdm.write', 'tqdm.write', (['"""move labels to node attrs"""'], {}), "('move labels to node attrs')\n", (591, 620), False, 'from tqdm.auto import tqdm\n'), ((801, 828), 'tqdm.auto.tqdm', 'tqdm', (['graphs'], {'desc': '"""graphs"""'}), "(graphs, desc='graphs')\n", (805, 828), False, 'from tqdm.... |
#!/usr/bin/env python
from distutils.core import setup
setup(name='online_cognacy_ident',
packages=['online_cognacy_ident'],
)
| [
"distutils.core.setup"
] | [((57, 126), 'distutils.core.setup', 'setup', ([], {'name': '"""online_cognacy_ident"""', 'packages': "['online_cognacy_ident']"}), "(name='online_cognacy_ident', packages=['online_cognacy_ident'])\n", (62, 126), False, 'from distutils.core import setup\n')] |
from typing import List
from logging import getLogger
import notify
logger = getLogger(__name__)
class _RegisteredNotifyTaskList():
def __init__(self):
self._task_list: List[notify.NotifyTask] = []
def append_task(self, task: notify.NotifyTask) -> None:
self._task_list.append(task)
... | [
"logging.getLogger"
] | [((80, 99), 'logging.getLogger', 'getLogger', (['__name__'], {}), '(__name__)\n', (89, 99), False, 'from logging import getLogger\n')] |
# Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | [
"tensorflow.python.data.ops.dataset_ops.Dataset.from_tensors",
"tensorflow.python.data.ops.dataset_ops.Dataset.from_sparse_tensor_slices",
"numpy.array",
"tensorflow.python.data.kernel_tests.test_base.default_test_combinations",
"tensorflow.python.framework.sparse_tensor.SparseTensor",
"tensorflow.python.... | [((3710, 3721), 'tensorflow.python.platform.test.main', 'test.main', ([], {}), '()\n', (3719, 3721), False, 'from tensorflow.python.platform import test\n'), ((1510, 1554), 'tensorflow.python.data.ops.dataset_ops.Dataset.from_tensors', 'dataset_ops.Dataset.from_tensors', (['components'], {}), '(components)\n', (1542, 1... |
from graphviz import Digraph
from lodlord.triple_term import TripleURI, TripleBlank, TripleLiteral
class ModelVisualizer(object):
def __init__(self, model, format='svg'):
self._g = Digraph(comment='Graph', format=format)
self.model = model
def render(self, *args, **kwargs):
self._g.a... | [
"graphviz.Digraph"
] | [((196, 235), 'graphviz.Digraph', 'Digraph', ([], {'comment': '"""Graph"""', 'format': 'format'}), "(comment='Graph', format=format)\n", (203, 235), False, 'from graphviz import Digraph\n')] |
from django.urls import path
from . import views
urlpatterns = [
path('', views.index, name='index'),
path('graph', views.graph, name='graph'),
path('view_plot1', views.view_plot1, name='view_plot1'),
path('view_plot2', views.view_plot2, name='view_plot2'),
path('get_graph_data',views.get_graph_dat... | [
"django.urls.path"
] | [((70, 105), 'django.urls.path', 'path', (['""""""', 'views.index'], {'name': '"""index"""'}), "('', views.index, name='index')\n", (74, 105), False, 'from django.urls import path\n'), ((111, 151), 'django.urls.path', 'path', (['"""graph"""', 'views.graph'], {'name': '"""graph"""'}), "('graph', views.graph, name='graph... |
from __future__ import division, print_function, absolute_import
import vzlog
import vzlog.pyplot as plt
import numpy as np
vz = vzlog.VzLog('log-image-grids')
vz.title('Image grids')
rs = np.random.RandomState(0)
x = rs.uniform(size=(9, 20, 20))
grid = vzlog.image.ImageGrid(x, cmap=plt.cm.rainbow)
grid.save(vz.im... | [
"vzlog.image.ImageGrid",
"vzlog.image.ColorImageGrid",
"numpy.random.RandomState",
"vzlog.VzLog"
] | [((131, 161), 'vzlog.VzLog', 'vzlog.VzLog', (['"""log-image-grids"""'], {}), "('log-image-grids')\n", (142, 161), False, 'import vzlog\n'), ((193, 217), 'numpy.random.RandomState', 'np.random.RandomState', (['(0)'], {}), '(0)\n', (214, 217), True, 'import numpy as np\n'), ((259, 304), 'vzlog.image.ImageGrid', 'vzlog.im... |
from flask import Blueprint
inpatient = Blueprint('inpatient', __name__) # 设定蓝本的名称
from .import views | [
"flask.Blueprint"
] | [((41, 73), 'flask.Blueprint', 'Blueprint', (['"""inpatient"""', '__name__'], {}), "('inpatient', __name__)\n", (50, 73), False, 'from flask import Blueprint\n')] |
#!/usr/bin/env python
from distutils.core import setup
"""
try:
import progress
except ImportError:
print("Could not import progress. Install progress first")
"""
setup(
name='easymp',
version='0.13',
author='<NAME>',
url='thomasmertz.eu',
license='GNU GPL',
py_modules=['easymp', 'mybuffer', 'myqueue', 'temp'... | [
"distutils.core.setup"
] | [((167, 338), 'distutils.core.setup', 'setup', ([], {'name': '"""easymp"""', 'version': '"""0.13"""', 'author': '"""<NAME>"""', 'url': '"""thomasmertz.eu"""', 'license': '"""GNU GPL"""', 'py_modules': "['easymp', 'mybuffer', 'myqueue', 'temp', 'test_client']"}), "(name='easymp', version='0.13', author='<NAME>', url='th... |
# -*- coding: utf-8 -*-
"""
在 SQL 中我们常有一种查询模式是 根据某个 Column, 通常是时间, 筛选出部分数据, 然后排序返回.
比如博客应用中的列出最近所有帖子. 在 SQL 中式这么写的::
SELECT * FROM table t
WHERE t.time BETWEEN ...
但是在 DynamoDB 中, 如果你要使用 query, 则你必须制定 Hash Key, 而你只想根据 Range Key 来查询.
所以此时我们只能用 scan 了.
Reference
- scan() API: https://boto3.amazonaws.com/v1/d... | [
"rolex.rnd_datetime",
"pynamodb.attributes.UnicodeAttribute"
] | [((696, 727), 'pynamodb.attributes.UnicodeAttribute', 'UnicodeAttribute', ([], {'hash_key': '(True)'}), '(hash_key=True)\n', (712, 727), False, 'from pynamodb.attributes import UnicodeAttribute\n'), ((739, 771), 'pynamodb.attributes.UnicodeAttribute', 'UnicodeAttribute', ([], {'range_key': '(True)'}), '(range_key=True)... |
# -------------------------------------------------------------------------
#
# Part of the CodeChecker project, under the Apache License v2.0 with
# LLVM Exceptions. See LICENSE for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
#
# ---------------------------------------------------... | [
"subprocess.check_output",
"codechecker_analyzer.analyzers.clangsa.clang_options.ctu_mapping",
"codechecker_common.logger.get_logger",
"codechecker_analyzer.host_check.has_analyzer_config_option",
"codechecker_analyzer.analyzers.clangsa.version.ClangVersionInfoParser"
] | [((586, 616), 'codechecker_common.logger.get_logger', 'get_logger', (['"""analyzer.clangsa"""'], {}), "('analyzer.clangsa')\n", (596, 616), False, 'from codechecker_common.logger import get_logger\n'), ((1247, 1335), 'subprocess.check_output', 'subprocess.check_output', (['invocation'], {'env': 'environ', 'encoding': '... |
import math
import time
### IronPython 2
from mesh_vertex_color import irp_ray_triangle_intersection
reload(irp_ray_triangle_intersection)
rt = irp_ray_triangle_intersection.RayTriangleIntersection()
class MeshPointInsideOutside():
"""
mesh = [[v0.X, v0.Y, v0.Z], [v1.X, v1.Y, v1.Z], [v... | [
"mesh_vertex_color.irp_ray_triangle_intersection.RayTriangleIntersection"
] | [((153, 208), 'mesh_vertex_color.irp_ray_triangle_intersection.RayTriangleIntersection', 'irp_ray_triangle_intersection.RayTriangleIntersection', ([], {}), '()\n', (206, 208), False, 'from mesh_vertex_color import irp_ray_triangle_intersection\n')] |
import unittest
from bmaclient.client import MonitoringAPI
from bmaclient.exceptions import APIClientError
class FetchLavaDomesTest(unittest.TestCase):
def setUp(self):
self.api = MonitoringAPI(api_key='TEST_API_KEY')
def test_request_without_supplying_params(self):
with self.assertRaises(A... | [
"unittest.main",
"bmaclient.client.MonitoringAPI"
] | [((993, 1008), 'unittest.main', 'unittest.main', ([], {}), '()\n', (1006, 1008), False, 'import unittest\n'), ((196, 233), 'bmaclient.client.MonitoringAPI', 'MonitoringAPI', ([], {'api_key': '"""TEST_API_KEY"""'}), "(api_key='TEST_API_KEY')\n", (209, 233), False, 'from bmaclient.client import MonitoringAPI\n'), ((622, ... |
import os
import sys
print('about to import', file=sys.stderr)
print('python is', sys.version_info)
print('pid is', os.getpid())
import my_pb_mod
print('imported, about to call', file=sys.stderr)
result = my_pb_mod.add(2, 3)
print(result)
assert result == 5
print('done!', file=sys.stderr)
| [
"my_pb_mod.add",
"os.getpid"
] | [((209, 228), 'my_pb_mod.add', 'my_pb_mod.add', (['(2)', '(3)'], {}), '(2, 3)\n', (222, 228), False, 'import my_pb_mod\n'), ((117, 128), 'os.getpid', 'os.getpid', ([], {}), '()\n', (126, 128), False, 'import os\n')] |
# x_7_6
#
#
import re
pattern = r'も+'
print(re.search(pattern, 'すもももももももものうち'))
onis = '赤鬼青鬼黄鬼'
print(re.search(r'(.鬼)+', onis)[1])
| [
"re.search"
] | [((47, 81), 're.search', 're.search', (['pattern', '"""すもももももももものうち"""'], {}), "(pattern, 'すもももももももものうち')\n", (56, 81), False, 'import re\n'), ((106, 130), 're.search', 're.search', (['"""(.鬼)+"""', 'onis'], {}), "('(.鬼)+', onis)\n", (115, 130), False, 'import re\n')] |
from rvb import db
from rvb.models import *
from datetime import datetime
from sqlalchemy import func
from flask import json
from rvb.exceptions import ResourceMissing, IsDead, IllegalMove
class Safehouse(db.Model):
__tablename__ = 'safehouses'
id = db.Column(db.Integer, primary_key=True)
agents = db.rela... | [
"sqlalchemy.func.now",
"sqlalchemy.func.current_timestamp",
"rvb.db.Column",
"rvb.db.relationship",
"rvb.db.session.commit",
"rvb.db.session.add"
] | [((260, 299), 'rvb.db.Column', 'db.Column', (['db.Integer'], {'primary_key': '(True)'}), '(db.Integer, primary_key=True)\n', (269, 299), False, 'from rvb import db\n'), ((313, 365), 'rvb.db.relationship', 'db.relationship', (['"""Agent"""'], {'back_populates': '"""safehouse"""'}), "('Agent', back_populates='safehouse')... |
from jinja2 import nodes, lexer
from jinja2.ext import Extension
import re
class LayoutExtension(Extension):
tags = set(["use_layout"])
def __init__(self, environment):
super(LayoutExtension, self).__init__(environment)
environment.extend(default_layout="layout.html",
... | [
"jinja2.lexer.Token",
"jinja2.nodes.Block",
"jinja2.nodes.Const",
"jinja2.nodes.Extends"
] | [((1223, 1266), 'jinja2.lexer.Token', 'lexer.Token', (['(1)', 'lexer.TOKEN_BLOCK_END', '"""%}"""'], {}), "(1, lexer.TOKEN_BLOCK_END, '%}')\n", (1234, 1266), False, 'from jinja2 import nodes, lexer\n'), ((827, 871), 'jinja2.nodes.Const', 'nodes.Const', (['self.environment.default_layout'], {}), '(self.environment.defaul... |
from dftparse.wien2k.reflectivity_parser import ReflectivityParser
def test_parse_reflectivity():
"""Test that the optical conductivity and absorption are parsed out correctly"""
lines = """
#
# Lorentzian broadening with ... | [
"dftparse.wien2k.reflectivity_parser.ReflectivityParser"
] | [((781, 801), 'dftparse.wien2k.reflectivity_parser.ReflectivityParser', 'ReflectivityParser', ([], {}), '()\n', (799, 801), False, 'from dftparse.wien2k.reflectivity_parser import ReflectivityParser\n')] |
from requests import Request, get
from openapi_core import create_spec
spec_dict = get('https://petstore3.swagger.io/api/v3/openapi.json').json()
spec = create_spec(spec_dict)
requests_request = Request(method='GET', url='https://petstore3.swagger.io/api/v3/pet/1')
from openapi_core.validation.request.validators im... | [
"openapi_core.create_spec",
"openapi_core.validation.request.validators.RequestValidator",
"requests.get",
"requests.Request",
"openapi_core.contrib.requests.RequestsOpenAPIRequest"
] | [((155, 177), 'openapi_core.create_spec', 'create_spec', (['spec_dict'], {}), '(spec_dict)\n', (166, 177), False, 'from openapi_core import create_spec\n'), ((198, 268), 'requests.Request', 'Request', ([], {'method': '"""GET"""', 'url': '"""https://petstore3.swagger.io/api/v3/pet/1"""'}), "(method='GET', url='https://p... |