code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# tests/serializers.py
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list o... | [
"xml.etree.ElementTree.Element",
"king_phisher.serializers.to_elementtree_subelement",
"king_phisher.serializers.JSON.loads",
"king_phisher.serializers.from_elementtree_element",
"datetime.datetime.now"
] | [((2268, 2291), 'datetime.datetime.now', 'datetime.datetime.now', ([], {}), '()\n', (2289, 2291), False, 'import datetime\n'), ((2800, 2820), 'xml.etree.ElementTree.Element', 'ET.Element', (['"""parent"""'], {}), "('parent')\n", (2810, 2820), True, 'import xml.etree.ElementTree as ET\n'), ((2830, 2891), 'king_phisher.s... |
import string
from contextlib import contextmanager
from functools import partial as p
from pathlib import Path
from textwrap import dedent
import pytest
import redis
from tests.helpers.agent import Agent
from tests.helpers.assertions import has_datapoint, tcp_socket_open
from tests.helpers.metadata import Metadata
fr... | [
"textwrap.dedent",
"functools.partial",
"tests.helpers.util.run_container",
"tests.helpers.verify.verify",
"string.Template",
"tests.helpers.metadata.Metadata.from_package",
"tests.helpers.util.container_ip",
"pathlib.Path",
"tests.helpers.util.wait_for",
"tests.helpers.agent.Agent.run",
"pytest... | [((537, 626), 'string.Template', 'string.Template', (['"""\nmonitors:\n- type: collectd/redis\n host: $host\n port: 6379\n"""'], {}), '(\n """\nmonitors:\n- type: collectd/redis\n host: $host\n port: 6379\n""")\n', (552, 626), False, 'import string\n'), ((1108, 1147), 'tests.helpers.metadata.Metadata.from_packag... |
# -*- coding: utf-8 -*-
"""
Created on Thu Jul 4 10:23:34 2019
@author: <NAME>
"""
# This code is used for creating data set for 6DOF robotic arm with use of direct kinematic.
from sympy import symbols, pi, sin, cos, simplify
from sympy.matrices import Matrix
import numpy as np
import random
import ma... | [
"sympy.symbols",
"random.uniform",
"numpy.asarray",
"sympy.cos",
"numpy.zeros",
"sympy.simplify",
"time.time",
"numpy.array",
"sympy.sin",
"math.degrees",
"numpy.concatenate"
] | [((2866, 2877), 'time.time', 'time.time', ([], {}), '()\n', (2875, 2877), False, 'import time\n'), ((3562, 3591), 'numpy.zeros', 'np.zeros', (['[1, 6]'], {'dtype': 'float'}), '([1, 6], dtype=float)\n', (3570, 3591), True, 'import numpy as np\n'), ((3603, 3632), 'numpy.zeros', 'np.zeros', (['[1, 3]'], {'dtype': 'float'}... |
################################################################################
# Copyright (C) 2019 drinfernoo #
# #
# This Program is free software; you can redistribute it and/or modify ... | [
"xml.etree.ElementTree.parse",
"os.remove",
"resources.libs.common.tools.get_date",
"os.makedirs",
"resources.libs.common.config.CONFIG.set_setting",
"resources.libs.common.tools.get_addon_by_id",
"xml.etree.ElementTree.Element",
"os.path.exists",
"time.sleep",
"xbmcgui.Dialog",
"xml.etree.Eleme... | [((20949, 20995), 'resources.libs.common.tools.get_addon_by_id', 'tools.get_addon_by_id', (["DEBRIDID[who]['plugin']"], {}), "(DEBRIDID[who]['plugin'])\n", (20970, 20995), False, 'from resources.libs.common import tools\n'), ((21121, 21146), 'resources.libs.common.config.CONFIG.get_setting', 'CONFIG.get_setting', (['sa... |
# Generated by Django 2.2 on 2019-09-05 09:29
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('sales', '0006_auto_20190905_0857'),
]
operations = [
migrations.AddField(
model_name='contact',
name='last_contact_dat... | [
"django.db.models.DateTimeField"
] | [((342, 385), 'django.db.models.DateTimeField', 'models.DateTimeField', ([], {'blank': '(True)', 'null': '(True)'}), '(blank=True, null=True)\n', (362, 385), False, 'from django.db import migrations, models\n'), ((519, 562), 'django.db.models.DateTimeField', 'models.DateTimeField', ([], {'blank': '(True)', 'null': '(Tr... |
import scipy.io
import scipy.sparse
import argparse
import numpy as np
import os
import json
import re
import pandas
import pdb
def parse_args():
parser = argparse.ArgumentParser(description="Convert data from graphsage format to .mat format.")
parser.add_argument('--prefix', default="example_data/douban/onlin... | [
"re.split",
"os.makedirs",
"argparse.ArgumentParser",
"pandas.read_csv",
"numpy.zeros",
"os.path.exists",
"numpy.array"
] | [((160, 254), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Convert data from graphsage format to .mat format."""'}), "(description=\n 'Convert data from graphsage format to .mat format.')\n", (183, 254), False, 'import argparse\n'), ((3086, 3116), 'numpy.zeros', 'np.zeros', (['(n2[0... |
# Generated by Django 3.2 on 2022-01-16 19:58
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('finance', '0027_transactionimport_account'),
]
operations = [
migrations.AlterField(
model_name='transactionimport',
n... | [
"django.db.models.IntegerField"
] | [((357, 421), 'django.db.models.IntegerField', 'models.IntegerField', ([], {'choices': "[(1, 'DEGIRO'), (2, 'BINANCE_CSV')]"}), "(choices=[(1, 'DEGIRO'), (2, 'BINANCE_CSV')])\n", (376, 421), False, 'from django.db import migrations, models\n')] |
import inspect
import logging as _logging
import os
import time
from functools import cached_property, partial
from typing import Any, Callable, Optional
logger = _logging.getLogger(__name__)
class ADebugLogging:
def __init__(self, fun: Optional[Callable] = None, *args, **kwargs):
self.__wrapped__ = f... | [
"inspect.iscoroutinefunction",
"functools.partial",
"time.perf_counter",
"os.environ.get",
"inspect.isasyncgenfunction",
"inspect.isgeneratorfunction",
"logging.getLogger"
] | [((166, 194), 'logging.getLogger', '_logging.getLogger', (['__name__'], {}), '(__name__)\n', (184, 194), True, 'import logging as _logging\n'), ((5932, 5963), 'os.environ.get', 'os.environ.get', (['"""AIOTRACEDEBUG"""'], {}), "('AIOTRACEDEBUG')\n", (5946, 5963), False, 'import os\n'), ((6018, 6044), 'os.environ.get', '... |
#!/usr/bin/env python3
#
# Client side of the NetworkBall application
# Receive the ball from the server, and display it with Qt
#
# External dependencies
import ipaddress
import os
import socket
import sys
import threading
from PySide2 import QtCore
from PySide2 import QtGui
from PySide2 import QtWidgets
# Class to... | [
"PySide2.QtGui.QPainter",
"PySide2.QtWidgets.QApplication",
"socket.socket",
"ipaddress.ip_address",
"PySide2.QtGui.QKeySequence"
] | [((3899, 3931), 'PySide2.QtWidgets.QApplication', 'QtWidgets.QApplication', (['sys.argv'], {}), '(sys.argv)\n', (3921, 3931), False, 'from PySide2 import QtWidgets\n'), ((797, 846), 'socket.socket', 'socket.socket', (['socket.AF_INET', 'socket.SOCK_STREAM'], {}), '(socket.AF_INET, socket.SOCK_STREAM)\n', (810, 846), Fa... |
import matplotlib.pyplot as plt
import pandas as pd
import seaborn as sns
from utils import load_epub
def get_book_length_information(book):
N = len(book)
chapters = sorted(list(book.keys()))
length_by_character = [0] * N
length_by_word = [0] * N
length_by_unique_word = [0] * N
for chapter i... | [
"matplotlib.pyplot.title",
"seaborn.lineplot",
"matplotlib.pyplot.legend",
"utils.load_epub",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.xticks",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.savefig"
] | [((1247, 1274), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'figsize': '(12, 9)'}), '(figsize=(12, 9))\n', (1257, 1274), True, 'import matplotlib.pyplot as plt\n'), ((1279, 1346), 'seaborn.lineplot', 'sns.lineplot', ([], {'x': 'chapter', 'y': 'length_char', 'label': '"""length by character"""'}), "(x=chapter, y=len... |
# -*- coding: utf-8 -*-
# ---
# jupyter:
# jupytext:
# formats: ipynb,py
# text_representation:
# extension: .py
# format_name: light
# format_version: '1.5'
# jupytext_version: 1.6.0
# kernelspec:
# display_name: py37_pytorch
# language: python
# name: conda-env-py37_pyt... | [
"shapely.geometry.Point",
"geopandas.GeoSeries",
"shapely.geometry.Polygon",
"geopandas.sjoin",
"shapely.geometry.LineString",
"geopandas.overlay",
"geopandas.read_file"
] | [((1037, 1114), 'geopandas.read_file', 'gpd.read_file', (['"""zip://../../data/processed/geo/ne_110m_admin_0_countries.zip"""'], {}), "('zip://../../data/processed/geo/ne_110m_admin_0_countries.zip')\n", (1050, 1114), True, 'import geopandas as gpd\n'), ((4165, 4241), 'geopandas.read_file', 'gpd.read_file', (['"""zip:/... |
import os
import sys
import cv2
import imutils
import numpy as np
from tqdm import tqdm
from enum import Enum
from math import sqrt
from time import time
# Define a custom ENUM to specify which text-extraction function should be executed
# later on on the last step of the pipeline
class FTYPE(Enum):
ALL = 0
E... | [
"cv2.GaussianBlur",
"os.mkdir",
"cv2.bitwise_and",
"cv2.medianBlur",
"numpy.ones",
"cv2.rectangle",
"cv2.normalize",
"cv2.absdiff",
"cv2.imshow",
"cv2.inRange",
"os.path.join",
"cv2.cvtColor",
"cv2.copyMakeBorder",
"cv2.split",
"cv2.drawContours",
"cv2.boundingRect",
"cv2.resize",
... | [((1883, 1906), 'cv2.imshow', 'cv2.imshow', (['name', 'plate'], {}), '(name, plate)\n', (1893, 1906), False, 'import cv2\n'), ((1915, 1929), 'cv2.waitKey', 'cv2.waitKey', (['(0)'], {}), '(0)\n', (1926, 1929), False, 'import cv2\n'), ((2836, 2874), 'cv2.cvtColor', 'cv2.cvtColor', (['plate', 'cv2.COLOR_BGR2HSV'], {}), '(... |
import os
import shutil
import threading
from PyQt5 import QtCore, QtGui, QtWidgets
from MainConfig import MainConfig
# from Main import Window
from ConfigFile import ConfigFile
# from AnomalyDetection import AnomalyDetection
from AnomalyDetection import AnomAnalWindow
from SeaBASSHeader import SeaBASSHeader
from Sea... | [
"PyQt5.QtWidgets.QPushButton",
"PyQt5.QtWidgets.QVBoxLayout",
"os.path.isfile",
"SeaBASSHeader.SeaBASSHeader.loadSeaBASSHeader",
"SeaBASSHeaderWindow.SeaBASSHeaderWindow.configUpdateButtonPressed",
"os.path.join",
"shutil.copy",
"PyQt5.QtWidgets.QLabel",
"GetAnc.GetAnc.userCreds",
"PyQt5.QtWidgets... | [((1074, 1107), 'PyQt5.QtWidgets.QPushButton', 'QtWidgets.QPushButton', (['"""Add Cals"""'], {}), "('Add Cals')\n", (1095, 1107), False, 'from PyQt5 import QtCore, QtGui, QtWidgets\n'), ((1243, 1279), 'PyQt5.QtWidgets.QPushButton', 'QtWidgets.QPushButton', (['"""Remove Cals"""'], {}), "('Remove Cals')\n", (1264, 1279),... |
#!/usr/bin/env python
# Copyright (c) 2020 - for information on the respective copyright owner
# see the NOTICE file and/or the repository
# <https://github.com/boschresearch/amira-blender-rendering>.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance w... | [
"amira_blender_rendering.utils.logging.configure_logger",
"sys.path.append",
"argparse.ArgumentParser",
"os.path.exists",
"amira_blender_rendering.scenes.get_registered",
"os.path.expandvars",
"amira_blender_rendering.utils.io.expandpath",
"sys.argv.index",
"sys.exit",
"re.compile"
] | [((2970, 3089), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Render dataset in blender"""', 'prog': "('blender -b -P ' + __file__)", 'add_help': '(False)'}), "(description='Render dataset in blender', prog=\n 'blender -b -P ' + __file__, add_help=False)\n", (2993, 3089), False, 'imp... |
import tensorflow as tf
import os
from utils.reprocessing import generator_enqueue
from utils.reprocessing import PAD_ID,GO_ID, EOS_ID, UNK_ID
class Variational_autoencoder_Seq2Seq(object):
def __init__(self, layers_size=100, VAE_layers_size=100, learning_rate=0.01,
vocab_size=1000,
... | [
"tensorflow.train.Coordinator",
"tensorflow.reduce_sum",
"tensorflow.trainable_variables",
"tensorflow.constant_initializer",
"tensorflow.train.AdamOptimizer",
"tensorflow.floor",
"tensorflow.Variable",
"tensorflow.contrib.seq2seq.BasicDecoder",
"tensorflow.reduce_max",
"tensorflow.split",
"os.p... | [((1250, 1289), 'tensorflow.contrib.rnn.BasicLSTMCell', 'tf.contrib.rnn.BasicLSTMCell', (['num_units'], {}), '(num_units)\n', (1278, 1289), True, 'import tensorflow as tf\n'), ((2078, 2126), 'tensorflow.Variable', 'tf.Variable', (['self.learning_rate'], {'trainable': '(False)'}), '(self.learning_rate, trainable=False)\... |
from django.contrib import admin
from django.contrib.auth.admin import UserAdmin
from django.contrib.auth import get_user_model
from Documentos.models import Usuario
from Documentos.forms import CrearUsuarioForm, ModificarUsuarioForm
class UsuarioAdmin(UserAdmin):
add_form = CrearUsuarioForm
form = ModificarU... | [
"django.contrib.admin.site.register"
] | [((393, 435), 'django.contrib.admin.site.register', 'admin.site.register', (['Usuario', 'UsuarioAdmin'], {}), '(Usuario, UsuarioAdmin)\n', (412, 435), False, 'from django.contrib import admin\n')] |
# -*- coding: utf-8 -*-
"""
This module contains a method for determining the sampling frequency (interval)
of passed dataframes with time-like index.
================================================================================
@Author:
| <NAME>, NSSC Contractor (ORAU)
| U.S. EPA / ORD / CEMM / AMCD / SFSB
C... | [
"pandas.DataFrame"
] | [((1374, 1446), 'pandas.DataFrame', 'pd.DataFrame', (['t_delta.components'], {'columns': "['value']", 'index': 't_delta_comps'}), "(t_delta.components, columns=['value'], index=t_delta_comps)\n", (1386, 1446), True, 'import pandas as pd\n')] |
import nltk
from nltk.util import ngrams
import re
import string
import pandas as pd
#1. read in dataset
course_data_df = pd.read_csv("..\\Web-Scraping Scripts and Data\\Accredited Canadian English Undergrad MechEng Programs\\All_Web-Scraped_Courses_Master_List.csv")
#########################################... | [
"pandas.read_csv",
"nltk.WordNetLemmatizer",
"re.split",
"pandas.DataFrame"
] | [((130, 285), 'pandas.read_csv', 'pd.read_csv', (['"""..\\\\Web-Scraping Scripts and Data\\\\Accredited Canadian English Undergrad MechEng Programs\\\\All_Web-Scraped_Courses_Master_List.csv"""'], {}), "(\n '..\\\\Web-Scraping Scripts and Data\\\\Accredited Canadian English Undergrad MechEng Programs\\\\All_Web-Scra... |
from __future__ import division, print_function
import os
import pytest
from lxml import etree as ET
from .. import word_error_rate, words, page_text, alto_text
data_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'data')
@pytest.mark.integration
def test_word_error_rate_between_page_files():
#... | [
"os.path.abspath",
"os.path.join"
] | [((205, 230), 'os.path.abspath', 'os.path.abspath', (['__file__'], {}), '(__file__)\n', (220, 230), False, 'import os\n'), ((449, 495), 'os.path.join', 'os.path.join', (['data_dir', '"""test-gt.page2018.xml"""'], {}), "(data_dir, 'test-gt.page2018.xml')\n", (461, 495), False, 'import os\n'), ((679, 731), 'os.path.join'... |
# Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | [
"config.models.SiteConfiguration.objects.create",
"config.models.SiteConfiguration.objects.get",
"django.contrib.admin.site.register"
] | [((736, 795), 'django.contrib.admin.site.register', 'admin.site.register', (['SiteConfiguration', 'SingletonModelAdmin'], {}), '(SiteConfiguration, SingletonModelAdmin)\n', (755, 795), False, 'from django.contrib import admin\n'), ((922, 953), 'config.models.SiteConfiguration.objects.get', 'SiteConfiguration.objects.ge... |
import re
from typing import Dict, List, Optional
from ciphey.iface import (
Config,
Cracker,
CrackInfo,
CrackResult,
ParamSpec,
Translation,
registry,
)
from loguru import logger
@registry.register
class Baconian(Cracker[str]):
def getInfo(self, ctext: str) -> CrackInfo:
retu... | [
"ciphey.iface.ParamSpec",
"ciphey.iface.CrackResult",
"loguru.logger.trace",
"ciphey.iface.CrackInfo",
"re.search"
] | [((323, 402), 'ciphey.iface.CrackInfo', 'CrackInfo', ([], {'success_likelihood': '(0.1)', 'success_runtime': '(1e-05)', 'failure_runtime': '(1e-05)'}), '(success_likelihood=0.1, success_runtime=1e-05, failure_runtime=1e-05)\n', (332, 402), False, 'from ciphey.iface import Config, Cracker, CrackInfo, CrackResult, ParamS... |
import os
import time
import numpy as np
import random
import torch
import math
from behavenet.data.utils import build_data_generator
from behavenet.fitting.eval import export_train_plots
from behavenet.fitting.hyperparam_utils import get_all_params
from behavenet.fitting.hyperparam_utils import get_slurm_params
from ... | [
"numpy.random.uniform",
"behavenet.models.aes.load_pretrained_ae",
"random.randint",
"os.path.join",
"torch.manual_seed",
"behavenet.fitting.training.fit",
"behavenet.fitting.hyperparam_utils.get_all_params",
"behavenet.fitting.eval.export_train_plots",
"torch.get_rng_state",
"behavenet.models.Cus... | [((915, 938), 'behavenet.fitting.utils._print_hparams', '_print_hparams', (['hparams'], {}), '(hparams)\n', (929, 938), False, 'from behavenet.fitting.utils import _print_hparams\n'), ((1345, 1374), 'behavenet.fitting.utils.create_tt_experiment', 'create_tt_experiment', (['hparams'], {}), '(hparams)\n', (1365, 1374), F... |
"""Admin module"""
import os
import math
from datetime import datetime
import copy
import discord
from discord.ext import commands
from modules.utils import checks
from modules.utils import utils
def is_owner_or_moderator(ctx):
"""Returns true if the author is the bot's owner or a moderator on the server"""
r... | [
"copy.deepcopy",
"modules.utils.utils.load_json",
"discord.ext.commands.command",
"os.makedirs",
"math.pow",
"discord.Embed",
"os.path.isdir",
"modules.utils.checks.is_owner_or_server_owner",
"os.path.exists",
"datetime.datetime.now",
"datetime.datetime.strptime",
"modules.utils.checks.custom"... | [((9080, 9098), 'discord.ext.commands.command', 'commands.command', ([], {}), '()\n', (9096, 9098), False, 'from discord.ext import commands\n'), ((9104, 9121), 'modules.utils.checks.is_owner', 'checks.is_owner', ([], {}), '()\n', (9119, 9121), False, 'from modules.utils import checks\n'), ((9732, 9750), 'discord.ext.c... |
from manim import *
import random
HOME = "C:\manim\Manim_7_July\Projects\\assets\Images"
HOME2 = "C:\manim\Manim_7_July\Projects\\assets\SVG_Images"
# This is for SVG Files to be imported. It is the directory from my PC
class RandomNumbers(Scene):
def construct(self):
numbers = VGroup()
... | [
"random.uniform"
] | [((512, 532), 'random.uniform', 'random.uniform', (['(0)', '(1)'], {}), '(0, 1)\n', (526, 532), False, 'import random\n')] |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2016-07-29 20:05
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('notes', '0001_initial'),
]
operations = [
migrations.AlterField(
... | [
"django.db.models.ManyToManyField"
] | [((383, 454), 'django.db.models.ManyToManyField', 'models.ManyToManyField', ([], {'blank': '(True)', 'related_name': '"""notes"""', 'to': '"""tags.Tag"""'}), "(blank=True, related_name='notes', to='tags.Tag')\n", (405, 454), False, 'from django.db import migrations, models\n')] |
from eppy import modeleditor
from eppy.modeleditor import IDF
import os
iddfile = r"C:\EnergyPlusV9-4-0\Energy+.idd"
# fname1 = r"D:\OneDrive - UNIVERSIDAD DE SEVILLA\Papers OneDrive\VPO_cadiz_parametrico\BA_V01.idf"
path = r'C:\Users\daniel.sanchez\Documents\Personal\VPO_parametrico\input_IDFs'
outputpath = r'C:\Use... | [
"eppy.modeleditor.IDF.setiddname",
"eppy.modeleditor.IDF",
"os.listdir"
] | [((493, 516), 'eppy.modeleditor.IDF.setiddname', 'IDF.setiddname', (['iddfile'], {}), '(iddfile)\n', (507, 516), False, 'from eppy.modeleditor import IDF\n'), ((2760, 2771), 'eppy.modeleditor.IDF', 'IDF', (['fname1'], {}), '(fname1)\n', (2763, 2771), False, 'from eppy.modeleditor import IDF\n'), ((433, 449), 'os.listdi... |
#!/usr/bin/python
from subprocess import Popen, PIPE, check_output
import argparse
import calendar
import os
import re
import time
import xml.etree.ElementTree as ET
parser = argparse.ArgumentParser(
description='Get OCSP production time for X-Road certificates.',
formatter_class=argparse.RawDescriptionHelpFo... | [
"subprocess.Popen",
"argparse.ArgumentParser",
"re.match",
"time.strftime",
"time.time",
"calendar.timegm",
"re.search",
"os.listdir"
] | [((177, 424), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Get OCSP production time for X-Road certificates."""', 'formatter_class': 'argparse.RawDescriptionHelpFormatter', 'epilog': '"""Status returns number of seconds since production of oldest OCSP responce."""'}), "(description=\n ... |
import tensorflow as tf
def load_dataset(batch_size, motion_input_length, motion_dim, data_files, num_cpu_threads=2):
#files = tf.io.gfile.glob("../data/gan_with_trans/gan_train_tfrecord-*")
name_to_features = {}
name_to_features.update({
"motion_name": tf.io.FixedLenFeature([], tf.string),
... | [
"tensorflow.random.uniform",
"tensorflow.io.VarLenFeature",
"tensorflow.sparse.to_dense",
"tensorflow.dtypes.cast",
"tensorflow.io.parse_single_example",
"tensorflow.constant",
"tensorflow.shape",
"tensorflow.io.FixedLenFeature",
"tensorflow.io.gfile.glob"
] | [((1629, 1657), 'tensorflow.io.gfile.glob', 'tf.io.gfile.glob', (['data_files'], {}), '(data_files)\n', (1645, 1657), True, 'import tensorflow as tf\n'), ((539, 591), 'tensorflow.io.parse_single_example', 'tf.io.parse_single_example', (['record', 'name_to_features'], {}), '(record, name_to_features)\n', (565, 591), Tru... |
#!python3
from datetime import datetime
from datetime import date
print(datetime.today())
# datetime.datetime(2018, 2, 19, 14, 38, 52, 133483)
today = datetime.today()
print(type(today))
# <class 'datetime.datetime'>
today_date = date.today()
print(today_date)
# datetime.date(2018, 2, 19)
print(type(today_date))... | [
"datetime.date.today",
"datetime.datetime.today",
"datetime.date"
] | [((154, 170), 'datetime.datetime.today', 'datetime.today', ([], {}), '()\n', (168, 170), False, 'from datetime import datetime\n'), ((235, 247), 'datetime.date.today', 'date.today', ([], {}), '()\n', (245, 247), False, 'from datetime import date\n'), ((448, 466), 'datetime.date', 'date', (['(2018)', '(12)', '(25)'], {}... |
import unittest
from mock import Mock
from foundations_events.consumers.jobs.queued.creation_time import CreationTime
class TestCreationTime(unittest.TestCase):
def setUp(self):
self._redis = Mock()
self._consumer = CreationTime(self._redis)
def test_call_saves_creation_time(self):
... | [
"foundations_events.consumers.jobs.queued.creation_time.CreationTime",
"mock.Mock"
] | [((209, 215), 'mock.Mock', 'Mock', ([], {}), '()\n', (213, 215), False, 'from mock import Mock\n'), ((241, 266), 'foundations_events.consumers.jobs.queued.creation_time.CreationTime', 'CreationTime', (['self._redis'], {}), '(self._redis)\n', (253, 266), False, 'from foundations_events.consumers.jobs.queued.creation_tim... |
import numpy as np
import pytest
@pytest.fixture
def simulate():
np.random.seed(0)
l = np.random.normal(size=(100, 3))
f = np.random.normal(size=(3, 200))
eta = l.dot(f)
eta *= 5 / eta.max()
x = np.random.poisson(lam=np.exp(eta))
return x, eta
@pytest.fixture
def simulate_lam_low_rank():
np.random.see... | [
"numpy.exp",
"numpy.random.seed",
"numpy.random.poisson",
"numpy.random.normal"
] | [((68, 85), 'numpy.random.seed', 'np.random.seed', (['(0)'], {}), '(0)\n', (82, 85), True, 'import numpy as np\n'), ((92, 123), 'numpy.random.normal', 'np.random.normal', ([], {'size': '(100, 3)'}), '(size=(100, 3))\n', (108, 123), True, 'import numpy as np\n'), ((130, 161), 'numpy.random.normal', 'np.random.normal', (... |
# Generated by Django 2.2.1 on 2021-03-10 16:26
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('web', '0003_auto_20210310_1622'),
]
operations = [
migrations.AlterField(
model_name='movie',
name='movie_url',
... | [
"django.db.models.URLField"
] | [((334, 351), 'django.db.models.URLField', 'models.URLField', ([], {}), '()\n', (349, 351), False, 'from django.db import migrations, models\n')] |
from asm import load_asm
from vm import get_vm
prog = load_asm('test.asm')
vm = get_vm()
vm.load_symbols(prog["labels"])
vm.load_program(prog["lines"])
while not(vm.stop):
vm.step()
| [
"asm.load_asm",
"vm.get_vm"
] | [((55, 75), 'asm.load_asm', 'load_asm', (['"""test.asm"""'], {}), "('test.asm')\n", (63, 75), False, 'from asm import load_asm\n'), ((81, 89), 'vm.get_vm', 'get_vm', ([], {}), '()\n', (87, 89), False, 'from vm import get_vm\n')] |
# -*- coding: utf-8 -*-
# encoding: utf-8
'''
Created on 2014年1月1日
@author: kane
'''
from django.http import HttpResponse
from billiards.models import Group, Membership
from django.db.models.query_utils import Q
from billiards.settings import TEMPLATE_ROOT, PREFER_LOGIN_SITE,\
SOCIALOAUTH_SITES, STATIC_URL
from dj... | [
"validate_email.validate_email",
"django.utils.simplejson.loads",
"billiards.commons.forceLogin",
"django.shortcuts.redirect",
"django.template.context.RequestContext",
"hmac.new",
"rest_framework.decorators.renderer_classes",
"django.db.models.query_utils.Q",
"json.dumps",
"django.core.exceptions... | [((957, 981), 're.compile', 're.compile', (['"""^1\\\\d{10}$"""'], {}), "('^1\\\\d{10}$')\n", (967, 981), False, 'import re\n'), ((3824, 3841), 'rest_framework.decorators.api_view', 'api_view', (["['GET']"], {}), "(['GET'])\n", (3832, 3841), False, 'from rest_framework.decorators import api_view, renderer_classes\n'), ... |
import unittest
import os
from companies_house.api import CompaniesHouseAPIBase, CompaniesHouseAPI, flatten_dict
API_KEY = os.environ.get('CH_API_KEY')
if not API_KEY:
API_KEY = input('Please enter API key!\n')
COMPANY_NUMBER = '09117429'
class CompaniesHouseTestCase(unittest.TestCase):
def setUp(self):
... | [
"os.environ.get",
"companies_house.api.CompaniesHouseAPIBase",
"companies_house.api.flatten_dict",
"companies_house.api.CompaniesHouseAPI"
] | [((125, 153), 'os.environ.get', 'os.environ.get', (['"""CH_API_KEY"""'], {}), "('CH_API_KEY')\n", (139, 153), False, 'import os\n'), ((365, 395), 'companies_house.api.CompaniesHouseAPIBase', 'CompaniesHouseAPIBase', (['API_KEY'], {}), '(API_KEY)\n', (386, 395), False, 'from companies_house.api import CompaniesHouseAPIB... |
# Local file checksum cache implementation
#
# Copyright (C) 2012 Intel Corporation
#
# SPDX-License-Identifier: GPL-2.0-only
#
import glob
import operator
import os
import stat
import bb.utils
import logging
from bb.cache import MultiProcessCache
logger = logging.getLogger("BitBake.Cache")
# mtime cache (non-persis... | [
"os.stat",
"os.path.basename",
"os.path.isdir",
"os.walk",
"bb.cache.MultiProcessCache.__init__",
"os.path.islink",
"glob.glob",
"operator.itemgetter",
"os.path.join",
"logging.getLogger"
] | [((259, 293), 'logging.getLogger', 'logging.getLogger', (['"""BitBake.Cache"""'], {}), "('BitBake.Cache')\n", (276, 293), False, 'import logging\n'), ((1215, 1247), 'bb.cache.MultiProcessCache.__init__', 'MultiProcessCache.__init__', (['self'], {}), '(self)\n', (1241, 1247), False, 'from bb.cache import MultiProcessCac... |
"""Utility functions for all.
"""
# This code is borrowed and re-implemented from
# https://github.com/jyhjinghwang/SegSort/blob/master/network/segsort/common_utils.py
import torch
import spml.utils.general.common as common_utils
def calculate_prototypes_from_labels(embeddings,
... | [
"torch.eq",
"torch.ne",
"torch.stack",
"torch.unique",
"torch.gather",
"torch.zeros_like",
"torch.argmax",
"spml.utils.general.common.one_hot",
"torch.cat",
"spml.utils.general.common.normalize_embedding",
"torch.meshgrid",
"torch.index_select",
"torch.arange",
"torch.zeros",
"torch.lins... | [((1079, 1179), 'torch.zeros', 'torch.zeros', (['(max_label, embeddings.shape[-1])'], {'dtype': 'embeddings.dtype', 'device': 'embeddings.device'}), '((max_label, embeddings.shape[-1]), dtype=embeddings.dtype,\n device=embeddings.device)\n', (1090, 1179), False, 'import torch\n'), ((1370, 1414), 'spml.utils.general.... |
#!/usr/bin/python
# API Gateway Ansible Modules
#
# Modules in this project allow management of the AWS API Gateway service.
#
# Authors:
# - <NAME> <github: bjfelton>
#
# apigw_api_key
# Manage creation, update, and removal of API Gateway ApiKey resources
#
# NOTE: While it is possible via the boto api to update ... | [
"boto3.client"
] | [((4548, 4574), 'boto3.client', 'boto3.client', (['"""apigateway"""'], {}), "('apigateway')\n", (4560, 4574), False, 'import boto3\n')] |
from urllib.request import urlopen
from json import loads
from itertools import groupby
import datetime
def get_date(dataPart):
return datetime.datetime.strptime(dataPart['timestamp'], '%Y-%m-%dT%H:%M:%SZ').date()
url = 'https://ru.wikipedia.org/w/api.php?action=query&format=json&prop=revisions&rvlimit=500&titl... | [
"itertools.groupby",
"datetime.datetime.strptime",
"urllib.request.urlopen"
] | [((543, 607), 'itertools.groupby', 'groupby', (["data['query']['pages']['183903']['revisions']", 'get_date'], {}), "(data['query']['pages']['183903']['revisions'], get_date)\n", (550, 607), False, 'from itertools import groupby\n'), ((141, 212), 'datetime.datetime.strptime', 'datetime.datetime.strptime', (["dataPart['t... |
# https://www.codingame.com/ide/puzzle/asteroids // puzzle easy
import math
from collections import defaultdict
# needed variables
f, s = [], []
coor = defaultdict(list)
w, h, t1, t2, t3 = [int(i) for i in input().split()]
for i in range(h):
fp, sp = input().split()
f.append(fp); s.append(sp)
# hold all l... | [
"collections.defaultdict",
"math.floor"
] | [((155, 172), 'collections.defaultdict', 'defaultdict', (['list'], {}), '(list)\n', (166, 172), False, 'from collections import defaultdict\n'), ((798, 863), 'math.floor', 'math.floor', (['((let[1][1][0] - let[1][0][0]) / (t2 - t1) * (t3 - t2))'], {}), '((let[1][1][0] - let[1][0][0]) / (t2 - t1) * (t3 - t2))\n', (808, ... |
"""
sklearn extend のテストコード
"""
import os
import numpy as np
import pytest
from lightgbm import LGBMClassifier
from sklearn.linear_model import Ridge, Lasso, LassoCV, RidgeClassifierCV
from sklearn.utils.validation import NotFittedError
from xgboost import XGBClassifier
from vivid.sklearn_extend import UtilityTransfor... | [
"numpy.random.uniform",
"os.path.join",
"pytest.fixture",
"joblib.dump",
"pytest.raises",
"numpy.array",
"numpy.array_equal",
"pytest.mark.parametrize",
"joblib.load",
"vivid.sklearn_extend.PrePostProcessModel",
"vivid.sklearn_extend.UtilityTransform"
] | [((382, 446), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""scaling"""', "[None, 'standard', 'minmax']"], {}), "('scaling', [None, 'standard', 'minmax'])\n", (405, 446), False, 'import pytest\n'), ((448, 493), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""log"""', '[True, False]'], {}), "('l... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
CERN@school: Data Profiling - Time Stuff - Wrappers.
See http://cernatschool.web.cern.ch for more information.
"""
#...for the logging.
import logging as lg
#...for the time (being).
import time
#...for the custom Pixelman time string.
from handlers import getPix... | [
"time.gmtime",
"time.strftime",
"logging.info",
"handlers.getPixelmanTimeString",
"handlers.make_time_dir"
] | [((500, 546), 'logging.info', 'lg.info', (['""" * Initialising DataMonth object..."""'], {}), "(' * Initialising DataMonth object...')\n", (507, 546), True, 'import logging as lg\n'), ((717, 741), 'time.gmtime', 'time.gmtime', (['self.__st_s'], {}), '(self.__st_s)\n', (728, 741), False, 'import time\n'), ((1024, 1048),... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = 'ipetrash'
def split_by_pair(text):
items = list()
for i in range(0, len(text), 2):
pair = text[i] + text[i + 1]
items.append(pair)
return items
def split_by_pair_1(text):
result = [a + b for a, b in list(zip(text[::2], t... | [
"re.findall"
] | [((405, 427), 're.findall', 're.findall', (['""".."""', 'text'], {}), "('..', text)\n", (415, 427), False, 'import re\n')] |
import matplotlib.cm as cm
import matplotlib.pyplot as plt
import numpy as np
def gen_color_map(keys):
colors = cm.rainbow(np.linspace(0, 1, len(keys)))
return dict(zip(keys, colors))
def visualize_dataset_2d(x1, x2, ys, alpha=0.5, x1_label='', x2_label='',
loc='upper left', figsize=(... | [
"matplotlib.pyplot.tight_layout",
"matplotlib.rc",
"matplotlib.pyplot.xlim",
"matplotlib.pyplot.show",
"numpy.argmax",
"matplotlib.pyplot.ylim",
"matplotlib.pyplot.scatter",
"matplotlib.pyplot.legend",
"numpy.logical_not",
"matplotlib.rcdefaults",
"matplotlib.pyplot.figure",
"matplotlib.pyplot... | [((1000, 1027), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'figsize': 'figsize'}), '(figsize=figsize)\n', (1010, 1027), True, 'import matplotlib.pyplot as plt\n'), ((1344, 1364), 'matplotlib.pyplot.xlabel', 'plt.xlabel', (['x1_label'], {}), '(x1_label)\n', (1354, 1364), True, 'import matplotlib.pyplot as plt\n'), ... |
from .block import Block
from .common import fail
from .errors import Errors
from .ir import Ctx, CONST, UNOP, RELOP, TEMP, JUMP, PHI, LPHI
from .type import Type
from logging import getLogger
logger = getLogger(__name__)
class LoopFlatten(object):
def __init__(self):
pass
def process(self, scope):
... | [
"logging.getLogger"
] | [((202, 221), 'logging.getLogger', 'getLogger', (['__name__'], {}), '(__name__)\n', (211, 221), False, 'from logging import getLogger\n')] |
#!/usr/bin/env python
##############################################################################
# (c) Crown copyright 2018 Met Office. All rights reserved.
# The file LICENCE, distributed with this code, contains details of the terms
# under which the code may be used.
#############################################... | [
"tempfile.NamedTemporaryFile"
] | [((850, 903), 'tempfile.NamedTemporaryFile', 'tempfile.NamedTemporaryFile', ([], {'suffix': '""".f90"""', 'mode': '"""wt"""'}), "(suffix='.f90', mode='wt')\n", (877, 903), False, 'import tempfile\n')] |
import pytest
from osp.common.utils import parse_domain
@pytest.mark.parametrize('url,domain', [
# Unchanged
(
'test.edu',
'test.edu',
),
# Strip protocol
(
'http://test.edu',
'test.edu',
),
(
'https://test.edu',
'test.edu',
),
... | [
"pytest.mark.parametrize",
"osp.common.utils.parse_domain"
] | [((62, 542), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""url,domain"""', "[('test.edu', 'test.edu'), ('http://test.edu', 'test.edu'), (\n 'https://test.edu', 'test.edu'), ('www.test.edu', 'test.edu'), (\n 'sub.test.edu', 'test.edu'), ('http://test.edu/syllabus.pdf',\n 'test.edu'), (' http://te... |
# Generated by Django 4.0.2 on 2022-03-11 13:16
from django.db import migrations, models
import spid_cie_oidc.entity.validators
class Migration(migrations.Migration):
dependencies = [
('spid_cie_oidc_onboarding', '0003_alter_onboardingregistration_options'),
]
operations = [
migrations.... | [
"django.db.models.JSONField"
] | [((431, 573), 'django.db.models.JSONField', 'models.JSONField', ([], {'default': 'list', 'help_text': '"""Public jwks of the Entities"""', 'validators': '[spid_cie_oidc.entity.validators.validate_public_jwks]'}), "(default=list, help_text='Public jwks of the Entities',\n validators=[spid_cie_oidc.entity.validators.v... |
import pytest
from app.domains.entities.user import User
from app.domains.exceptions import ValidationError
def test_initialize_user():
user = User(
username="john",
email="<EMAIL>",
account_name="ジョン",
hashed_password="<PASSWORD>",
created_by="john",
)
assert use... | [
"pytest.mark.parametrize",
"pytest.raises",
"app.domains.entities.user.User.get_hashed_password",
"app.domains.entities.user.User"
] | [((1370, 1576), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""username,message"""', "[('あいう', 'only alphanumeric, underscore and hyphen is ok'), ('',\n 'must be 1 or more and 32 or less'), ('t' * 33,\n 'must be 1 or more and 32 or less')]"], {}), "('username,message', [('あいう',\n 'only alphanumeri... |
from datetime import datetime
import config
from .tank import tank
class client:
"""
Used to store the info for an active client
"""
def __init__(self, clientSocket, clientType):
self.socket = clientSocket # The client's websocket
self.type = clientType # The type... | [
"datetime.datetime.now"
] | [((588, 602), 'datetime.datetime.now', 'datetime.now', ([], {}), '()\n', (600, 602), False, 'from datetime import datetime\n'), ((1100, 1114), 'datetime.datetime.now', 'datetime.now', ([], {}), '()\n', (1112, 1114), False, 'from datetime import datetime\n'), ((1286, 1300), 'datetime.datetime.now', 'datetime.now', ([], ... |
import subprocess
import tempfile
import os
import time
from inferelator_ng import kvs_controller
from inferelator_ng.tests.test_mi import Test2By2, Test2By3
# TODO: Actually implement this well
# TODO: Find out if nosetests going alphabetical is actually spec or just a thing that happens sometimes
temp_fd, temp_file_... | [
"subprocess.Popen",
"os.remove",
"tempfile.mkstemp",
"inferelator_ng.kvs_controller.KVSController",
"time.sleep",
"os.close"
] | [((327, 345), 'tempfile.mkstemp', 'tempfile.mkstemp', ([], {}), '()\n', (343, 345), False, 'import tempfile\n'), ((346, 363), 'os.close', 'os.close', (['temp_fd'], {}), '(temp_fd)\n', (354, 363), False, 'import os\n'), ((447, 472), 'subprocess.Popen', 'subprocess.Popen', (['KVS_CMD'], {}), '(KVS_CMD)\n', (463, 472), Fa... |
"""Ajout champ deactivation_date
Revision ID: a504dd88a502
Revises: <PASSWORD>
Create Date: 2021-01-15 15:48:51.893410
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'a504dd88a502'
down_revision = 'c<PASSWORD>'
branch_labels = None
depends_on = None
def upgr... | [
"alembic.op.drop_column",
"sqlalchemy.Date"
] | [((441, 491), 'alembic.op.drop_column', 'op.drop_column', (['"""inscription"""', '"""deactivation_date"""'], {}), "('inscription', 'deactivation_date')\n", (455, 491), False, 'from alembic import op\n'), ((391, 400), 'sqlalchemy.Date', 'sa.Date', ([], {}), '()\n', (398, 400), True, 'import sqlalchemy as sa\n')] |
import abc
import dataclasses
import json
from typing import List
@dataclasses.dataclass
class Message(abc.ABC):
chat_id: int
message_id: int
urls: List[str]
def serialize(self) -> bytes:
return json.dumps(dataclasses.asdict(self)).encode("utf-8")
@classmethod
def deserialize(cls, se... | [
"dataclasses.asdict"
] | [((233, 257), 'dataclasses.asdict', 'dataclasses.asdict', (['self'], {}), '(self)\n', (251, 257), False, 'import dataclasses\n')] |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import seaborn as sns
import matplotlib.pyplot as plt
from .statistic import StatisticHistogram
import singlecellmultiomics.pyutils as pyutils
import collections
import pandas as pd
import matplotlib
matplotlib.rcParams['figure.dpi'] = 160
matplotlib.use('Agg')
class Con... | [
"pandas.DataFrame",
"matplotlib.pyplot.show",
"seaborn.clustermap",
"matplotlib.pyplot.close",
"collections.defaultdict",
"matplotlib.use",
"matplotlib.pyplot.subplots_adjust"
] | [((287, 308), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (301, 308), False, 'import matplotlib\n'), ((486, 530), 'collections.defaultdict', 'collections.defaultdict', (['collections.Counter'], {}), '(collections.Counter)\n', (509, 530), False, 'import collections\n'), ((555, 599), 'collection... |
# Copyright (c) 2017 <NAME>
# All rights reserved.
from flask import Blueprint, jsonify, request, current_app, url_for
from flask_jwt_extended import get_jwt_identity, jwt_required
from pytz import all_timezones
from inpassing.worker.rules import dict_from_ruleset, ruleset_from_dict, \
pattern_reoccurs
from .. i... | [
"flask.Blueprint",
"inpassing.worker.rules.pattern_reoccurs",
"flask.request.args.get",
"flask_jwt_extended.get_jwt_identity",
"inpassing.worker.rules.dict_from_ruleset",
"flask.jsonify",
"flask.url_for",
"flask.request.get_json"
] | [((660, 686), 'flask.Blueprint', 'Blueprint', (['"""org"""', '__name__'], {}), "('org', __name__)\n", (669, 686), False, 'from flask import Blueprint, jsonify, request, current_app, url_for\n'), ((1501, 1519), 'flask_jwt_extended.get_jwt_identity', 'get_jwt_identity', ([], {}), '()\n', (1517, 1519), False, 'from flask_... |
from modelcluster.models import ClusterableModel
from wagtail.admin.edit_handlers import StreamFieldPanel
from wagtail.contrib.settings.models import BaseSetting, register_setting
from wagtail.core import blocks
from wagtail.core.fields import StreamField
class ResetNetworkMenusItem(blocks.StructBlock):
class Met... | [
"wagtail.contrib.settings.models.register_setting",
"wagtail.admin.edit_handlers.StreamFieldPanel",
"wagtail.core.blocks.CharBlock",
"wagtail.core.blocks.PageChooserBlock"
] | [((517, 549), 'wagtail.contrib.settings.models.register_setting', 'register_setting', ([], {'icon': '"""list-ul"""'}), "(icon='list-ul')\n", (533, 549), False, 'from wagtail.contrib.settings.models import BaseSetting, register_setting\n'), ((887, 919), 'wagtail.contrib.settings.models.register_setting', 'register_setti... |
"""Misc telegram commands."""
from stickerfinder.session import message_wrapper
from stickerfinder.helper.display import (
get_settings_text,
get_help_text_and_keyboard,
)
from stickerfinder.i18n import i18n
from stickerfinder.telegram.keyboard import (
get_main_keyboard,
get_settings_keyboard,
)
@mes... | [
"stickerfinder.session.message_wrapper",
"stickerfinder.i18n.i18n.t",
"stickerfinder.telegram.keyboard.get_main_keyboard",
"stickerfinder.helper.display.get_help_text_and_keyboard"
] | [((317, 334), 'stickerfinder.session.message_wrapper', 'message_wrapper', ([], {}), '()\n', (332, 334), False, 'from stickerfinder.session import message_wrapper\n'), ((807, 824), 'stickerfinder.session.message_wrapper', 'message_wrapper', ([], {}), '()\n', (822, 824), False, 'from stickerfinder.session import message_... |
from __future__ import print_function
import boto3
import json
import os
from botocore.exceptions import ClientError
def get(event, context):
messages_table_name = os.environ['DYNAMODB_MESSAGES_TABLE']
dynamodb_region = os.environ['DYNAMODB_MESSAGES_TABLE_REGION']
dynamodb = boto3.resource('dynamodb', re... | [
"boto3.resource",
"json.dumps"
] | [((291, 346), 'boto3.resource', 'boto3.resource', (['"""dynamodb"""'], {'region_name': 'dynamodb_region'}), "('dynamodb', region_name=dynamodb_region)\n", (305, 346), False, 'import boto3\n'), ((416, 433), 'json.dumps', 'json.dumps', (['event'], {}), '(event)\n', (426, 433), False, 'import json\n'), ((980, 996), 'json.... |
"""TestOutputGraph to check output of GeneralGraph"""
from unittest import TestCase
import numpy as np
import networkx as nx
from grape.general_graph import GeneralGraph
def test_nodal_eff_before():
"""
The following test checks the nodal efficiency before any perturbation.
"""
g = GeneralGraph()
g.loa... | [
"grape.general_graph.GeneralGraph",
"networkx.get_node_attributes"
] | [((296, 310), 'grape.general_graph.GeneralGraph', 'GeneralGraph', ([], {}), '()\n', (308, 310), False, 'from grape.general_graph import GeneralGraph\n'), ((1061, 1108), 'networkx.get_node_attributes', 'nx.get_node_attributes', (['g', '"""original_nodal_eff"""'], {}), "(g, 'original_nodal_eff')\n", (1083, 1108), True, '... |
from django.contrib.auth.forms import PasswordResetForm as RestAuthPasswordResetForm
from django.contrib.auth.tokens import default_token_generator
from django.contrib.sites.shortcuts import get_current_site
from django.utils.http import urlsafe_base64_encode
from django.utils.encoding import force_bytes
from django.co... | [
"django.contrib.sites.shortcuts.get_current_site",
"django.core.mail.EmailMultiAlternatives",
"django.utils.encoding.force_bytes",
"urllib.parse.urlencode"
] | [((908, 1044), 'django.core.mail.EmailMultiAlternatives', 'EmailMultiAlternatives', ([], {'from_email': 'settings.KRIT_SUPPORT_EMAIL_ADDRESS', 'reply_to': '[settings.KRIT_REPLY_TO_EMAIL_ADDRESS]', 'to': 'to_email'}), '(from_email=settings.KRIT_SUPPORT_EMAIL_ADDRESS,\n reply_to=[settings.KRIT_REPLY_TO_EMAIL_ADDRESS],... |
import argparse
import json
import tcpjson
from tcpjson import TcpJson
def Main():
parser = argparse.ArgumentParser(description='TCP/SSL JSON Echo Client')
parser.add_argument(
'-ip', '--ip_address', default='127.0.0.1',
help='server IP address (default 127.0.0.1)')
parser.add_argu... | [
"tcpjson.TcpJson",
"tcpjson.Ts",
"argparse.ArgumentParser",
"json.loads"
] | [((98, 161), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""TCP/SSL JSON Echo Client"""'}), "(description='TCP/SSL JSON Echo Client')\n", (121, 161), False, 'import argparse\n'), ((653, 689), 'tcpjson.TcpJson', 'TcpJson', (['host', 'port', '(not args.no_ssl)'], {}), '(host, port, not arg... |
# -*- coding: utf-8 -*-
# Copyright (c) 2018, 9t9it and Contributors
# See license.txt
from __future__ import unicode_literals
from datetime import date
from frappe.utils import (
get_first_day, get_last_day, getdate, add_months, add_days
)
def generate_intervals(interval, start_date, end_date):
if interval == 'We... | [
"frappe.utils.add_days",
"frappe.utils.getdate",
"frappe.utils.get_first_day",
"datetime.date",
"frappe.utils.get_last_day",
"frappe.utils.add_months"
] | [((352, 371), 'frappe.utils.getdate', 'getdate', (['start_date'], {}), '(start_date)\n', (359, 371), False, 'from frappe.utils import get_first_day, get_last_day, getdate, add_months, add_days\n'), ((807, 832), 'frappe.utils.get_first_day', 'get_first_day', (['start_date'], {}), '(start_date)\n', (820, 832), False, 'fr... |
# generated by datamodel-codegen:
# filename: openapi.yaml
# timestamp: 2021-12-31T02:45:57+00:00
from __future__ import annotations
from datetime import datetime
from enum import Enum
from typing import Annotated, Any, List, Optional
from pydantic import BaseModel, Extra, Field
class AddFacetToObjectResponse... | [
"pydantic.Field"
] | [((452, 513), 'pydantic.Field', 'Field', ([], {'max_length': '(64)', 'min_length': '(1)', 'regex': '"""^[a-zA-Z0-9._-]*$"""'}), "(max_length=64, min_length=1, regex='^[a-zA-Z0-9._-]*$')\n", (457, 513), False, 'from pydantic import BaseModel, Extra, Field\n'), ((1844, 1876), 'pydantic.Field', 'Field', ([], {'regex': '""... |
import unittest
import os
import requests
from awsauth import S3Auth
TEST_BUCKET = 'testpolpol'
ACCESS_KEY = '<KEY>'
SECRET_KEY = '<KEY>'
if 'AWS_ACCESS_KEY' in os.environ:
ACCESS_KEY = os.environ['AWS_ACCESS_KEY']
if 'AWS_SECRET_KEY' in os.environ:
SECRET_KEY = os.environ['AWS_SECRET_KEY']
class TestAWS(uni... | [
"unittest.main",
"awsauth.S3Auth",
"requests.delete",
"requests.get",
"requests.put"
] | [((2222, 2237), 'unittest.main', 'unittest.main', ([], {}), '()\n', (2235, 2237), False, 'import unittest\n'), ((376, 406), 'awsauth.S3Auth', 'S3Auth', (['ACCESS_KEY', 'SECRET_KEY'], {}), '(ACCESS_KEY, SECRET_KEY)\n', (382, 406), False, 'from awsauth import S3Auth\n'), ((487, 593), 'requests.put', 'requests.put', (["('... |
# Copyright 2017 Amazon.com, Inc. or its affiliates. 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. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompa... | [
"six.add_metaclass"
] | [((672, 702), 'six.add_metaclass', 'six.add_metaclass', (['abc.ABCMeta'], {}), '(abc.ABCMeta)\n', (689, 702), False, 'import six\n')] |
import tests.experiments.blueprints.maxima_knowledge_discovery_task as blueprint
from active_learning_ts.experiments.experiment_runner import ExperimentRunner
def test_find_maxima():
"""
Not yet a test, Just a cool demo (FYI the maximum of the function is 10, so the printed value should be around -10)
:re... | [
"active_learning_ts.experiments.experiment_runner.ExperimentRunner"
] | [((343, 407), 'active_learning_ts.experiments.experiment_runner.ExperimentRunner', 'ExperimentRunner', (['[blueprint.MaximaKnowledgeDiscovery]'], {'log': '(True)'}), '([blueprint.MaximaKnowledgeDiscovery], log=True)\n', (359, 407), False, 'from active_learning_ts.experiments.experiment_runner import ExperimentRunner\n'... |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
__author__ = "<NAME>"
__license__ = "GPL"
# Config
from configobj import ConfigObj, ConfigObjError
cfg = None
plugin_cfg = None
#
# Read ConfigObj from file
#
def read_cfg(filename):
cfg_obj = None
try:
cfg_obj = ConfigObj(filename, raise_errors=True, fil... | [
"configobj.ConfigObj"
] | [((278, 333), 'configobj.ConfigObj', 'ConfigObj', (['filename'], {'raise_errors': '(True)', 'file_error': '(True)'}), '(filename, raise_errors=True, file_error=True)\n', (287, 333), False, 'from configobj import ConfigObj, ConfigObjError\n')] |
from django.db import migrations
from django.db.models import (
AutoField, CharField, ForeignKey, PositiveIntegerField, Manager, CASCADE,
)
from mptt.fields import TreeForeignKey
from tree.fields import PathField
from tree.operations import CreateTreeTrigger
from ..models import get_random_name
class Migration(m... | [
"tree.operations.CreateTreeTrigger",
"django.db.models.CharField",
"django.db.models.ForeignKey",
"django.db.models.PositiveIntegerField",
"django.db.models.Manager",
"django.db.models.AutoField",
"mptt.fields.TreeForeignKey",
"tree.fields.PathField"
] | [((1700, 1730), 'tree.operations.CreateTreeTrigger', 'CreateTreeTrigger', (['"""TreePlace"""'], {}), "('TreePlace')\n", (1717, 1730), False, 'from tree.operations import CreateTreeTrigger\n'), ((530, 616), 'django.db.models.AutoField', 'AutoField', ([], {'verbose_name': '"""ID"""', 'serialize': '(False)', 'auto_created... |
from __future__ import print_function
# Copyright 2016-2016 Amazon.com, Inc. or its affiliates. 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. A copy of the License is located at
# http://aws.amazon.com/apache2.0/
... | [
"boto3.client"
] | [((806, 829), 'boto3.client', 'boto3.client', (['"""route53"""'], {}), "('route53')\n", (818, 829), False, 'import boto3\n'), ((836, 855), 'boto3.client', 'boto3.client', (['"""ecs"""'], {}), "('ecs')\n", (848, 855), False, 'import boto3\n'), ((862, 881), 'boto3.client', 'boto3.client', (['"""ec2"""'], {}), "('ec2')\n"... |
import vdsr
import tensorflow as tf
import argparse
train_dir = '/train'
test_dir = '/test/Set5'
validation_dir = '/test/Set5'
model_dir = '/model/'
result_dir = '/result/'
args = argparse.ArgumentParser()
args.add_argument('--do_train', type=bool, default=False)
args.add_argument('--do_test', type=bool, default=Fals... | [
"tensorflow.Session",
"argparse.ArgumentParser",
"vdsr.VDSR"
] | [((182, 207), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (205, 207), False, 'import argparse\n'), ((1177, 1189), 'tensorflow.Session', 'tf.Session', ([], {}), '()\n', (1187, 1189), True, 'import tensorflow as tf\n'), ((1213, 1234), 'vdsr.VDSR', 'vdsr.VDSR', (['args', 'sess'], {}), '(args, s... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import pytest
from flask_sqlalchemy import SQLAlchemy
@pytest.mark.usefixtures("flask_app", "fake_menus")
def test_menu() -> None:
from smorest_sfs.modules.auth import PERMISSIONS
from smorest_sfs.modules.menus.models import Menu
menus = Menu.query.all()
... | [
"smorest_sfs.utils.flatten.flatten_nested_tree",
"smorest_sfs.modules.roles.models.Permission.get_by_name",
"smorest_sfs.modules.menus.models.Menu.where",
"smorest_sfs.modules.menus.models.Menu.query.all",
"pytest.mark.usefixtures"
] | [((103, 153), 'pytest.mark.usefixtures', 'pytest.mark.usefixtures', (['"""flask_app"""', '"""fake_menus"""'], {}), "('flask_app', 'fake_menus')\n", (126, 153), False, 'import pytest\n'), ((446, 496), 'pytest.mark.usefixtures', 'pytest.mark.usefixtures', (['"""flask_app"""', '"""fake_menus"""'], {}), "('flask_app', 'fak... |
import arcade
class MyGame(arcade.Window):
def __init__(self, width, height, title, bg_color):
super().__init__(width, height, title)
arcade.set_background_color(bg_color)
self.width = width
self.height = height
self.title = title
def on_draw(self):
arcade.star... | [
"arcade.draw_text",
"arcade.start_render",
"arcade.set_background_color",
"arcade.run"
] | [((539, 551), 'arcade.run', 'arcade.run', ([], {}), '()\n', (549, 551), False, 'import arcade\n'), ((156, 193), 'arcade.set_background_color', 'arcade.set_background_color', (['bg_color'], {}), '(bg_color)\n', (183, 193), False, 'import arcade\n'), ((309, 330), 'arcade.start_render', 'arcade.start_render', ([], {}), '(... |
from django.urls import path
from .views import *
#app_name = "calc"
urlpatterns = [
path('calc/', calc_list, name = 'calc_list'),
path('adding_calc/', adding_calc, name = 'adding_calc'),
path('calc/<int:calc_id>/', calc_details_form, name = 'calc_details_form'),
path('adding_detail/', adding_detail,... | [
"django.urls.path"
] | [((91, 133), 'django.urls.path', 'path', (['"""calc/"""', 'calc_list'], {'name': '"""calc_list"""'}), "('calc/', calc_list, name='calc_list')\n", (95, 133), False, 'from django.urls import path\n'), ((141, 194), 'django.urls.path', 'path', (['"""adding_calc/"""', 'adding_calc'], {'name': '"""adding_calc"""'}), "('addin... |
from experiment.qa.data import QAData
from experiment.qa.data.insuranceqa.reader.v1_reader import V1Reader
class V1Data(QAData):
def _get_reader(self):
return V1Reader(self.config['insuranceqa'], self.lowercased, self.logger)
component = V1Data
| [
"experiment.qa.data.insuranceqa.reader.v1_reader.V1Reader"
] | [((173, 239), 'experiment.qa.data.insuranceqa.reader.v1_reader.V1Reader', 'V1Reader', (["self.config['insuranceqa']", 'self.lowercased', 'self.logger'], {}), "(self.config['insuranceqa'], self.lowercased, self.logger)\n", (181, 239), False, 'from experiment.qa.data.insuranceqa.reader.v1_reader import V1Reader\n')] |
from tetris import Tetris
import gym
from gym import error, spaces, utils
from gym.utils import seeding
from gym import spaces
from gym.envs.toy_text import discrete
import numpy as np
class TetrisEnv(discrete.DiscreteEnv):
metadata = {'render.modes': ['human']}
def __init__(self):
self.t = Tetris()
state_n... | [
"tetris.Tetris",
"gym.spaces.Discrete",
"numpy.zeros",
"numpy.array",
"gym.utils.seeding.np_random"
] | [((301, 309), 'tetris.Tetris', 'Tetris', ([], {}), '()\n', (307, 309), False, 'from tetris import Tetris\n'), ((744, 769), 'numpy.array', 'np.array', (['init_state_dist'], {}), '(init_state_dist)\n', (752, 769), True, 'import numpy as np\n'), ((917, 935), 'gym.spaces.Discrete', 'spaces.Discrete', (['(5)'], {}), '(5)\n'... |
import sublime, sublime_plugin
import time
class ShowTimeInStatusCommand(sublime_plugin.TextCommand):
def run(self, edit):
# view.set_status('time_msg', ' 当前时间:'+datetime.datetime.now())
sublime.status_message(' 当前时间:'+time.strftime("%Y-%m-%d %H:%M:%S"))
| [
"time.strftime"
] | [((235, 269), 'time.strftime', 'time.strftime', (['"""%Y-%m-%d %H:%M:%S"""'], {}), "('%Y-%m-%d %H:%M:%S')\n", (248, 269), False, 'import time\n')] |
# -*- coding: utf-8 -*-
"""Test Config
"""
import os
import sys
sys.path.insert(1, os.path.abspath(os.path.join(os.path.dirname(__file__), os.path.pardir)))
| [
"os.path.dirname"
] | [((114, 139), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (129, 139), False, 'import os\n')] |
import pytest
def test_stages_prod_initialize_prod_stage():
from aws_cdk import Stage
from aws_cdk import App
from infrastructure.stages.prod import ProdDeployStage
app = App()
prod_deploy_stage = ProdDeployStage(
app,
'TestProdDeployStage'
)
assert isinstance(prod_deploy_s... | [
"infrastructure.stages.prod.ProdDeployStage",
"aws_cdk.App"
] | [((189, 194), 'aws_cdk.App', 'App', ([], {}), '()\n', (192, 194), False, 'from aws_cdk import App\n'), ((219, 262), 'infrastructure.stages.prod.ProdDeployStage', 'ProdDeployStage', (['app', '"""TestProdDeployStage"""'], {}), "(app, 'TestProdDeployStage')\n", (234, 262), False, 'from infrastructure.stages.prod import Pr... |
import matplotlib.pyplot as plt
import numpy as np
import math
n = np.linspace(2, 7)
plt.plot(n, n**3, label="n**3")
plt.plot(n, n**0.3, label="n**0.3")
plt.plot(n, n, label="n")
plt.plot(n, np.sqrt(n), label="sqrtn")
plt.plot(n, (n ** 2) / np.sqrt(n), label="(n ** 2) / np.sqrt(n)")
plt.plot(n, n ** 2, label="n **2")
... | [
"matplotlib.pyplot.show",
"numpy.log",
"matplotlib.pyplot.plot",
"numpy.log2",
"matplotlib.pyplot.legend",
"numpy.linspace",
"numpy.sqrt"
] | [((68, 85), 'numpy.linspace', 'np.linspace', (['(2)', '(7)'], {}), '(2, 7)\n', (79, 85), True, 'import numpy as np\n'), ((86, 119), 'matplotlib.pyplot.plot', 'plt.plot', (['n', '(n ** 3)'], {'label': '"""n**3"""'}), "(n, n ** 3, label='n**3')\n", (94, 119), True, 'import matplotlib.pyplot as plt\n'), ((118, 155), 'matp... |
import pygame
pygame.init()
wn = pygame.display.set_mode((600,600))
xball = 500
yball = 550
xspeed = 0
yspeed = 0
holeR = 30
strokes = 0
water = [(400,50,150,400), (50,400,200,70)]
sand = [(200,200,70,70), (260,70,70,150), (10,10,50,150), (10,10,150,50)]
font = pygame.font.Font('VGAFIX.FON', 30)
while True:
wn.... | [
"pygame.draw.line",
"pygame.draw.circle",
"pygame.event.get",
"pygame.display.set_mode",
"pygame.draw.rect",
"pygame.time.delay",
"pygame.init",
"pygame.display.update",
"pygame.font.Font",
"pygame.mouse.get_pos"
] | [((15, 28), 'pygame.init', 'pygame.init', ([], {}), '()\n', (26, 28), False, 'import pygame\n'), ((34, 69), 'pygame.display.set_mode', 'pygame.display.set_mode', (['(600, 600)'], {}), '((600, 600))\n', (57, 69), False, 'import pygame\n'), ((267, 301), 'pygame.font.Font', 'pygame.font.Font', (['"""VGAFIX.FON"""', '(30)'... |
# -*- coding: utf-8 -*-
from unittest import mock
from pytest import mark
from story.helpers import datetime
@mark.parametrize('no_releases', [True, False])
@mark.parametrize('limit', [None, 100, 200])
def test_list(runner, patch, init_sample_app_in_cwd, no_releases, limit):
if not no_releases:
patch.ob... | [
"story.api.Releases.list.assert_called_with",
"story.api.Releases.get.assert_called_with",
"pytest.mark.parametrize",
"unittest.mock.call",
"story.api.Releases.rollback.assert_called_with"
] | [((114, 160), 'pytest.mark.parametrize', 'mark.parametrize', (['"""no_releases"""', '[True, False]'], {}), "('no_releases', [True, False])\n", (130, 160), False, 'from pytest import mark\n'), ((162, 205), 'pytest.mark.parametrize', 'mark.parametrize', (['"""limit"""', '[None, 100, 200]'], {}), "('limit', [None, 100, 20... |
import h5py
import pickle
import numpy as np
from torch.utils.data import Dataset
from sklearn.model_selection import train_test_split
class ExpressionDataset(Dataset):
'''
Gene expression dataset capable of using subsets of inputs.
Args:
data: array of inputs with size (samples, dim).
labels... | [
"h5py.File",
"pickle.dump",
"numpy.random.seed",
"sklearn.model_selection.train_test_split",
"numpy.sort",
"pickle.load",
"numpy.arange",
"numpy.random.choice",
"numpy.unique"
] | [((9452, 9511), 'sklearn.model_selection.train_test_split', 'train_test_split', (['data'], {'test_size': 'N_test', 'random_state': 'seed'}), '(data, test_size=N_test, random_state=seed)\n', (9468, 9511), False, 'from sklearn.model_selection import train_test_split\n'), ((9529, 9592), 'sklearn.model_selection.train_test... |
import torch
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
import torch.backends.cudnn as cudnn
import torchvision
import torchvision.transforms as transforms
from weights_init import weight_init
import os
import argparse
from datetime import datetime
import matplotlib.pyplot as... | [
"torch.nn.Dropout",
"numpy.sum",
"torch.argmax",
"torch.cat",
"torchvision.transforms.Normalize",
"torch.no_grad",
"numpy.set_printoptions",
"torch.utils.data.DataLoader",
"torch.load",
"torch.set_printoptions",
"torch.Tensor",
"torch.nn.Linear",
"torch.zeros",
"torch.nn.AvgPool2d",
"tor... | [((3061, 3171), 'torchvision.datasets.CIFAR100', 'torchvision.datasets.CIFAR100', ([], {'root': '"""~/projectdata"""', 'train': '(False)', 'download': '(True)', 'transform': 'transform_test'}), "(root='~/projectdata', train=False, download=\n True, transform=transform_test)\n", (3090, 3171), False, 'import torchvisi... |
from faker import Faker
from .user import UserFixtures
from .group import GroupFixtures
from .application import ApplicationFixtures
from .table import TableFixtures
from .view import ViewFixtures
from .field import FieldFixtures
class Fixtures(UserFixtures, GroupFixtures, ApplicationFixtures, TableFixtures,
... | [
"faker.Faker"
] | [((369, 376), 'faker.Faker', 'Faker', ([], {}), '()\n', (374, 376), False, 'from faker import Faker\n')] |
"""
Copyright 2020 The OneFlow Authors. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agr... | [
"oneflow.config.machine_num",
"oneflow.serving.InferenceSession",
"oneflow.typing.Numpy.Placeholder",
"numpy.allclose",
"oneflow.clear_default_session",
"oneflow.config.cpu_device_num",
"oneflow.unittest.skip_unless_1n1d",
"shutil.rmtree",
"unittest.main",
"oneflow.transpose",
"os.path.exists",
... | [((3159, 3191), 'oneflow.unittest.skip_unless_1n1d', 'flow.unittest.skip_unless_1n1d', ([], {}), '()\n', (3189, 3191), True, 'import oneflow as flow\n'), ((1221, 1236), 'oneflow.env.init', 'flow.env.init', ([], {}), '()\n', (1234, 1236), True, 'import oneflow as flow\n'), ((1241, 1267), 'oneflow.config.machine_num', 'f... |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.6 on 2016-06-02 20:59
from __future__ import unicode_literals
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateMod... | [
"django.db.models.CharField",
"django.db.models.TextField",
"django.db.models.DateTimeField",
"django.db.models.AutoField"
] | [((396, 489), 'django.db.models.AutoField', 'models.AutoField', ([], {'auto_created': '(True)', 'primary_key': '(True)', 'serialize': '(False)', 'verbose_name': '"""ID"""'}), "(auto_created=True, primary_key=True, serialize=False,\n verbose_name='ID')\n", (412, 489), False, 'from django.db import migrations, models\... |
from pathlib import Path
from setuptools import setup, find_packages
def read_requirements(path):
return list(Path(path).read_text().splitlines())
setup(
name="PythonTemplate",
description='Unit8 python library template.',
version="dev",
python_requires='>=3.6',
install_requires=read_require... | [
"pathlib.Path",
"setuptools.find_packages"
] | [((365, 380), 'setuptools.find_packages', 'find_packages', ([], {}), '()\n', (378, 380), False, 'from setuptools import setup, find_packages\n'), ((116, 126), 'pathlib.Path', 'Path', (['path'], {}), '(path)\n', (120, 126), False, 'from pathlib import Path\n')] |
#
# This file is part of seirmo (https://github.com/SABS-R3-Epidemiology/seirmo/)
# which is released under the BSD 3-clause license. See accompanying LICENSE.md
# for copyright notice and full license details.
#
import numpy as np
from scipy.integrate import solve_ivp
import seirmo
class DeterministicSEIRModel(sei... | [
"seirmo.SEIROutputCollector",
"seirmo.SEIRParameters",
"numpy.vstack"
] | [((1121, 1182), 'seirmo.SEIROutputCollector', 'seirmo.SEIROutputCollector', (["['S', 'E', 'I', 'R', 'Incidence']"], {}), "(['S', 'E', 'I', 'R', 'Incidence'])\n", (1147, 1182), False, 'import seirmo\n'), ((1223, 1296), 'seirmo.SEIRParameters', 'seirmo.SEIRParameters', (["['S0', 'E0', 'I0', 'R0', 'alpha', 'beta', 'gamma'... |
# -*- coding: utf-8 -*-
"""Module containing the TLS Extension classes
"""
# import basic stuff
import abc
import time
import logging
from typing import Tuple, Any, Optional, List, Union
# import own stuff
import tlsmate.client_state as client_state
import tlsmate.tls as tls
import tlsmate.structs as structs
import t... | [
"tlsmate.tls.SignatureScheme",
"tlsmate.tls.SupportedGroups",
"tlsmate.pdu.unpack_uint24",
"tlsmate.pdu.unpack_uint16",
"tlsmate.pdu.pack_uint8",
"tlsmate.structs.KeyShareEntry",
"tlsmate.pdu.unpack_uint32",
"tlsmate.pdu.pack_uint32",
"tlsmate.pdu.unpack_bytes",
"tlsmate.tls.Extension.val2enum",
... | [((2081, 2116), 'tlsmate.pdu.unpack_uint16', 'pdu.unpack_uint16', (['fragment', 'offset'], {}), '(fragment, offset)\n', (2098, 2116), True, 'import tlsmate.pdu as pdu\n'), ((2134, 2168), 'tlsmate.tls.Extension.val2enum', 'tls.Extension.val2enum', (['ext_id_int'], {}), '(ext_id_int)\n', (2156, 2168), True, 'import tlsma... |
from django.contrib import admin
from twobuntu.ads.models import Ad
admin.site.register(Ad)
| [
"django.contrib.admin.site.register"
] | [((74, 97), 'django.contrib.admin.site.register', 'admin.site.register', (['Ad'], {}), '(Ad)\n', (93, 97), False, 'from django.contrib import admin\n')] |
import datetime as dt
from floa.models.loa import LoA
import random
import unittest
from unittest.mock import Mock, patch
from requests.exceptions import HTTPError
class TestLoA(unittest.TestCase):
@staticmethod
def _generate_list(count, start=1, rand=False):
result = []
for id in range(start... | [
"floa.models.loa.LoA",
"unittest.main",
"floa.models.loa.LoA.scrape",
"requests.exceptions.HTTPError",
"unittest.mock.Mock",
"unittest.mock.patch",
"datetime.datetime.strptime",
"random.randrange",
"floa.models.loa.LoA.loa_request",
"datetime.datetime.now"
] | [((1980, 2017), 'unittest.mock.patch', 'patch', (['"""floa.models.loa.requests.get"""'], {}), "('floa.models.loa.requests.get')\n", (1985, 2017), False, 'from unittest.mock import Mock, patch\n'), ((2235, 2272), 'unittest.mock.patch', 'patch', (['"""floa.models.loa.requests.get"""'], {}), "('floa.models.loa.requests.ge... |
import os
from time import sleep
try:
from colorama import Fore, Back, Style
except:
print("You need colorama to use this program.\nOpen Command Prompt and type \"pip install colorama\" and wait for it to finish.\nThen, rerun this program.")
print("\nClosing in 10 seconds...")
sleep(10)
quit()
try:
... | [
"requests.get",
"os.system",
"googlesearch.search",
"time.sleep"
] | [((915, 931), 'os.system', 'os.system', (['"""cls"""'], {}), "('cls')\n", (924, 931), False, 'import os\n'), ((2416, 2432), 'os.system', 'os.system', (['"""cls"""'], {}), "('cls')\n", (2425, 2432), False, 'import os\n'), ((2942, 2950), 'time.sleep', 'sleep', (['(1)'], {}), '(1)\n', (2947, 2950), False, 'from time impor... |
from __future__ import annotations
import json
from datetime import datetime, timedelta
from pathlib import Path
from timeit import default_timer as timer
from typing import Any, Dict, List, Union, TYPE_CHECKING
from sqlalchemy import create_engine, Index, Table
from sqlalchemy.exc import OperationalError
if TYPE_CHE... | [
"sqlalchemy.Index",
"json.loads",
"timeit.default_timer",
"pathlib.Path",
"datetime.datetime.strptime",
"datetime.timedelta",
"sqlalchemy.create_engine"
] | [((957, 1001), 'sqlalchemy.create_engine', 'create_engine', (['connection_string'], {'echo': '(False)'}), '(connection_string, echo=False)\n', (970, 1001), False, 'from sqlalchemy import create_engine, Index, Table\n'), ((1169, 1183), 'pathlib.Path', 'Path', (['data_dir'], {}), '(data_dir)\n', (1173, 1183), False, 'fro... |
from django.shortcuts import render
from django.http import HttpResponse
from .models import *
from collections import namedtuple
Sticker = namedtuple('Sticker', ['model', 'name', 'components'])
Navigation = namedtuple('Navigation', ['name', 'address', 'focus'])
class MainCategory(object):
def __init__(self,... | [
"django.shortcuts.render",
"collections.namedtuple"
] | [((144, 198), 'collections.namedtuple', 'namedtuple', (['"""Sticker"""', "['model', 'name', 'components']"], {}), "('Sticker', ['model', 'name', 'components'])\n", (154, 198), False, 'from collections import namedtuple\n'), ((213, 267), 'collections.namedtuple', 'namedtuple', (['"""Navigation"""', "['name', 'address', ... |
# Dev Note:
# Log Finished.
# early stop Finished.
# Autosave Finished.
# Learning rate decay
# Warm start
# Parameters regularization
import io
import os
import logging
from datetime import datetime
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
fro... | [
"io.StringIO",
"logging.error",
"os.makedirs",
"logging.basicConfig",
"os.path.join",
"os.path.isdir",
"torch.manual_seed",
"torch.nn.utils.clip_grad_norm",
"torch.nn.functional.cross_entropy",
"torch.save",
"logging.info",
"torch.cuda.is_available",
"numpy.exp",
"torch.device",
"datetim... | [((5015, 5054), 'logging.info', 'logging.info', (['"""Training PyTorch model."""'], {}), "('Training PyTorch model.')\n", (5027, 5054), False, 'import logging\n'), ((1317, 1330), 'io.StringIO', 'io.StringIO', ([], {}), '()\n', (1328, 1330), False, 'import io\n'), ((1343, 1515), 'logging.basicConfig', 'logging.basicConf... |
from django.contrib import admin
from .models import Accounts, Team, Group
# Register your models here.
class AccountsAdmin(admin.ModelAdmin):
list_display = ('accounts_fullname', 'accounts_key', 'key_vendor')
admin.site.register(Accounts, AccountsAdmin)
admin.site.register(Team)
admin.site.register(Group) | [
"django.contrib.admin.site.register"
] | [((216, 260), 'django.contrib.admin.site.register', 'admin.site.register', (['Accounts', 'AccountsAdmin'], {}), '(Accounts, AccountsAdmin)\n', (235, 260), False, 'from django.contrib import admin\n'), ((261, 286), 'django.contrib.admin.site.register', 'admin.site.register', (['Team'], {}), '(Team)\n', (280, 286), False... |
#!/usr/bin/env python3
# Copyright (c) 2020 <NAME>
# Distributed under the MIT software license, see the accompanying
# file LICENSE or http://www.opensource.org/licenses/mit-license.php
import json
import sys
import os
sys.path.insert(1, os.path.realpath(os.path.pardir))
#print(sys.modules)
from moneysocket.messag... | [
"moneysocket.socket.crypt.MoneysocketCrypt.wire_encode",
"os.path.realpath",
"moneysocket.message.request.ping.RequestPing",
"moneysocket.socket.crypt.MoneysocketCrypt.wire_decode",
"moneysocket.beacon.shared_seed.SharedSeed",
"moneysocket.beacon.shared_seed.SharedSeed.from_hex_string",
"moneysocket.mes... | [((1195, 1207), 'moneysocket.beacon.shared_seed.SharedSeed', 'SharedSeed', ([], {}), '()\n', (1205, 1207), False, 'from moneysocket.beacon.shared_seed import SharedSeed\n'), ((1259, 1290), 'moneysocket.beacon.shared_seed.SharedSeed.from_hex_string', 'SharedSeed.from_hex_string', (['sss'], {}), '(sss)\n', (1285, 1290), ... |
#
# Copyright (c) 2020 Wind River Systems, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
"""
Tests for the API / ntp / methods.
"""
import mock
from six.moves import http_client
from sysinv.tests.api import base
from sysinv.tests.db import base as dbbase
from sysinv.tests.db import utils as dbutils
class FakeCondu... | [
"sysinv.tests.db.utils.post_get_test_ntp",
"mock.MagicMock",
"mock.patch",
"sysinv.tests.db.utils.create_test_ntp"
] | [((395, 411), 'mock.MagicMock', 'mock.MagicMock', ([], {}), '()\n', (409, 411), False, 'import mock\n'), ((1354, 1404), 'mock.patch', 'mock.patch', (['"""sysinv.conductor.rpcapi.ConductorAPI"""'], {}), "('sysinv.conductor.rpcapi.ConductorAPI')\n", (1364, 1404), False, 'import mock\n'), ((1700, 1812), 'sysinv.tests.db.u... |
# coding=utf-8
from datetime import datetime
from flask_sqlalchemy import event
from app.backend.database import db
from app.backend.database.models.base import Base
class Pet(db.Model, Base):
__tablename__ = 'pet'
__table_args__ = {'extend_existing': True}
# Integer
id = db.Column(db.Integer, primary_key=Tru... | [
"app.backend.database.db.Float",
"app.backend.database.db.Boolean",
"app.backend.database.db.DateTime",
"datetime.datetime.utcnow",
"flask_sqlalchemy.event.listens_for",
"app.backend.database.db.ForeignKey",
"app.backend.database.db.Text",
"app.backend.database.db.Column",
"app.backend.database.db.S... | [((1084, 1124), 'flask_sqlalchemy.event.listens_for', 'event.listens_for', (['Pet.is_deleted', '"""set"""'], {}), "(Pet.is_deleted, 'set')\n", (1101, 1124), False, 'from flask_sqlalchemy import event\n'), ((1411, 1445), 'flask_sqlalchemy.event.listens_for', 'event.listens_for', (['Pet.info', '"""set"""'], {}), "(Pet.in... |
# coding=utf-8
# Copyright 2021 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | [
"tensorflow.test.main",
"tf3d.standard_fields.get_input_voxel_to_object_field_mapping",
"tensorflow.random.uniform",
"tf3d.standard_fields.get_output_voxel_to_object_field_mapping",
"tensorflow.eye",
"tf3d.losses.box_prediction_losses.box_corner_distance_loss_on_object_tensors",
"tensorflow.constant",
... | [((15179, 15193), 'tensorflow.test.main', 'tf.test.main', ([], {}), '()\n', (15191, 15193), True, 'import tensorflow as tf\n'), ((2691, 2723), 'tensorflow.constant', 'tf.constant', (['[0]'], {'dtype': 'tf.int32'}), '([0], dtype=tf.int32)\n', (2702, 2723), True, 'import tensorflow as tf\n'), ((6530, 6649), 'tf3d.losses.... |