code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
# Generated by Django 2.2.2 on 2019-11-13 13:52
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('users', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='users',
name='site_key',
fi... | [
"django.db.models.CharField"
] | [((324, 397), 'django.db.models.CharField', 'models.CharField', ([], {'blank': '(True)', 'default': '"""<KEY>"""', 'max_length': '(32)', 'unique': '(True)'}), "(blank=True, default='<KEY>', max_length=32, unique=True)\n", (340, 397), False, 'from django.db import migrations, models\n')] |
# -*- coding: UTF-8 -*-
import sys
import socket
import time
import threading
import select
HOST = '192.168.11.98'
PORT = int(sys.argv[1])
queue = []
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((HOST, PORT))
queue.append(s)
print("add client to queue")
def socketRecv():
while True:
... | [
"threading.Thread",
"time.sleep",
"socket.socket",
"sys.exit"
] | [((156, 205), 'socket.socket', 'socket.socket', (['socket.AF_INET', 'socket.SOCK_STREAM'], {}), '(socket.AF_INET, socket.SOCK_STREAM)\n', (169, 205), False, 'import socket\n'), ((535, 570), 'threading.Thread', 'threading.Thread', ([], {'target': 'socketRecv'}), '(target=socketRecv)\n', (551, 570), False, 'import thread... |
# GENERATED BY KOMAND SDK - DO NOT EDIT
import komand
import json
class Component:
DESCRIPTION = "Import observable(s) into Anomali ThreatStream with approval"
class Input:
FILE = "file"
OBSERVABLE_SETTINGS = "observable_settings"
class Output:
RESULTS = "results"
class ImportObservableI... | [
"json.loads"
] | [((353, 5143), 'json.loads', 'json.loads', (['"""\n {\n "type": "object",\n "title": "Variables",\n "properties": {\n "file": {\n "$ref": "#/definitions/file",\n "title": "File",\n "description": "File of data to be imported into Anomali ThreatStream",\n "order": 1\n },\n "observable_s... |
# Copyright 2012 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | [
"trove.quota.models.Reservation",
"trove.quota.quota.DbQuotaDriver",
"testtools.skipIf",
"mockito.mock",
"mock.Mock",
"mockito.unstub",
"trove.extensions.mgmt.quota.service.QuotaController",
"mockito.verify",
"trove.quota.models.Quota",
"mockito.when",
"trove.quota.quota.run_with_quotas",
"tro... | [((1308, 1362), 'trove.quota.models.Resource', 'Resource', (['Resource.INSTANCES', '"""max_instances_per_user"""'], {}), "(Resource.INSTANCES, 'max_instances_per_user')\n", (1316, 1362), False, 'from trove.quota.models import Resource\n'), ((1386, 1436), 'trove.quota.models.Resource', 'Resource', (['Resource.VOLUMES', ... |
from flask_restful import reqparse
def retornar_parser():
parser = reqparse.RequestParser()
parser.add_argument('sentenca', type=str, required=True)
return parser
| [
"flask_restful.reqparse.RequestParser"
] | [((72, 96), 'flask_restful.reqparse.RequestParser', 'reqparse.RequestParser', ([], {}), '()\n', (94, 96), False, 'from flask_restful import reqparse\n')] |
from django.contrib import admin
from dicoms.models import Subject
from dicoms.models import Session
from dicoms.models import Series
admin.site.register(Session)
admin.site.register(Subject)
admin.site.register(Series)
| [
"django.contrib.admin.site.register"
] | [((135, 163), 'django.contrib.admin.site.register', 'admin.site.register', (['Session'], {}), '(Session)\n', (154, 163), False, 'from django.contrib import admin\n'), ((164, 192), 'django.contrib.admin.site.register', 'admin.site.register', (['Subject'], {}), '(Subject)\n', (183, 192), False, 'from django.contrib impor... |
#!/usr/bin/env python
#
# Copyright (c) 2018
# FZI Forschungszentrum Informatik, Karlsruhe, Germany (www.fzi.de)
# KIT, Institute of Measurement and Control, Karlsruhe, Germany (www.mrt.kit.edu)
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted p... | [
"rospy.logerr",
"lanelet2.io.Origin",
"rospy.init_node",
"rospy.get_param",
"tf2_ros.TransformBroadcaster",
"rospy.Time.now",
"tf.transformations.quaternion_from_euler",
"lanelet2.core.GPSPoint",
"rospy.spin",
"rospy.Duration",
"rospy.sleep"
] | [((2032, 2048), 'rospy.Time.now', 'rospy.Time.now', ([], {}), '()\n', (2046, 2048), False, 'import rospy\n'), ((2798, 2846), 'rospy.init_node', 'rospy.init_node', (['"""map_frame_to_utm_tf_publisher"""'], {}), "('map_frame_to_utm_tf_publisher')\n", (2813, 2846), False, 'import rospy\n'), ((3001, 3047), 'lanelet2.core.G... |
# Import kratos core and applications
import KratosMultiphysics
import KratosMultiphysics.KratosUnittest as KratosUnittest
import KratosMultiphysics.kratos_utilities as KratosUtilities
from KratosMultiphysics.FluidDynamicsApplication.fluid_dynamics_analysis import FluidDynamicsAnalysis
class SodShockTubeTest(KratosUni... | [
"KratosMultiphysics.kratos_utilities.DeleteFileIfExisting",
"KratosMultiphysics.KratosUnittest.WorkFolderScope",
"KratosMultiphysics.Parameters",
"KratosMultiphysics.FluidDynamicsApplication.fluid_dynamics_analysis.FluidDynamicsAnalysis",
"KratosMultiphysics.Model"
] | [((2962, 4763), 'KratosMultiphysics.Parameters', 'KratosMultiphysics.Parameters', (['"""{\n "python_module" : "gid_output_process",\n "kratos_module" : "KratosMultiphysics",\n "process_name" : "GiDOutputProcess",\n "help" : "This process writes postprocessing files ... |
import asyncio
import json
import logging
import websockets
logging.basicConfig()
async def counter(websocket, path):
try:
print("connect")
async for message in websocket:
print(message)
finally:
USERS.remove(websocket)
async def main():
async with websockets.serve(c... | [
"logging.basicConfig",
"websockets.serve",
"asyncio.Future"
] | [((61, 82), 'logging.basicConfig', 'logging.basicConfig', ([], {}), '()\n', (80, 82), False, 'import logging\n'), ((302, 346), 'websockets.serve', 'websockets.serve', (['counter', '"""localhost"""', '(5000)'], {}), "(counter, 'localhost', 5000)\n", (318, 346), False, 'import websockets\n'), ((362, 378), 'asyncio.Future... |
import re
import numbers
import collections
import logging
from collections.abc import Iterable
import itertools
import aws_error_utils
from .lookup import Ids, lookup_accounts_for_ou
from .format import format_account_id
LOGGER = logging.getLogger(__name__)
_Context = collections.namedtuple("_Context", [
"sess... | [
"logging.getLogger",
"itertools.chain",
"logging.basicConfig",
"collections.namedtuple",
"json.loads",
"aws_error_utils.catch_aws_error",
"boto3.Session",
"re.match"
] | [((234, 261), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (251, 261), False, 'import logging\n'), ((274, 555), 'collections.namedtuple', 'collections.namedtuple', (['"""_Context"""', "['session', 'ids', 'principal', 'principal_filter', 'permission_set',\n 'permission_set_filter', 't... |
#!/usr/bin/env python3
import os
import argparse
import subprocess
if __name__ == '__main__':
from version import __version__
from configParser import ConfigParser
else:
from .version import __version__
from .configParser import ConfigParser
def command(cmd):
"""Run a shell command"""
subprocess.call(cmd, sh... | [
"argparse.ArgumentParser",
"os.path.join",
"os.getcwd",
"configParser.ConfigParser",
"subprocess.call",
"os.path.abspath"
] | [((297, 329), 'subprocess.call', 'subprocess.call', (['cmd'], {'shell': '(True)'}), '(cmd, shell=True)\n', (312, 329), False, 'import subprocess\n'), ((686, 853), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'prog': '"""buildutil"""', 'description': '"""Assembly/C/C++ utility to build embedded systems"""... |
import json
import copy
import pdb
import numpy as np
import pickle
def listify_mat(matrix):
matrix = np.array(matrix).astype(str)
if len(matrix.shape) > 1:
matrix_list = []
for row in matrix:
try:
matrix_list.append(list(row))
except:
pd... | [
"pickle.dump",
"numpy.array",
"pdb.set_trace",
"copy.deepcopy",
"json.dump"
] | [((1905, 1920), 'pdb.set_trace', 'pdb.set_trace', ([], {}), '()\n', (1918, 1920), False, 'import pdb\n'), ((108, 124), 'numpy.array', 'np.array', (['matrix'], {}), '(matrix)\n', (116, 124), True, 'import numpy as np\n'), ((555, 584), 'copy.deepcopy', 'copy.deepcopy', (['self._cur_traj'], {}), '(self._cur_traj)\n', (568... |
# Generated by Django 2.2.4 on 2019-10-03 21:09
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('ingreso', '0003_auto_20190907_2152'),
]
operations = [
migrations.AlterField(
model_name='detal... | [
"django.db.models.ForeignKey"
] | [((379, 480), 'django.db.models.ForeignKey', 'models.ForeignKey', ([], {'null': '(True)', 'on_delete': 'django.db.models.deletion.CASCADE', 'to': '"""producto.Producto"""'}), "(null=True, on_delete=django.db.models.deletion.CASCADE,\n to='producto.Producto')\n", (396, 480), False, 'from django.db import migrations, ... |
from __future__ import print_function, division
import os,unittest
from pyscf.nao import tddft_iter
dname = os.path.dirname(os.path.abspath(__file__))
td = tddft_iter(label='water', cd=dname)
try:
from pyscf.lib import misc
libnao_gpu = misc.load_library("libnao_gpu")
td_gpu = tddft_iter(label='water', cd... | [
"os.path.abspath",
"pyscf.lib.misc.load_library",
"pyscf.nao.tddft_iter",
"unittest.main"
] | [((158, 193), 'pyscf.nao.tddft_iter', 'tddft_iter', ([], {'label': '"""water"""', 'cd': 'dname'}), "(label='water', cd=dname)\n", (168, 193), False, 'from pyscf.nao import tddft_iter\n'), ((125, 150), 'os.path.abspath', 'os.path.abspath', (['__file__'], {}), '(__file__)\n', (140, 150), False, 'import os, unittest\n'), ... |
import io
from os import path
from setuptools import setup
dirname = path.abspath(path.dirname(__file__))
with io.open(path.join(dirname, 'README.md'), encoding='utf-8') as f:
long_description = f.read()
def parse_requirements(filename):
lines = (line.strip() for line in open(path.join(dirname, filename)))
... | [
"os.path.dirname",
"os.path.join"
] | [((83, 105), 'os.path.dirname', 'path.dirname', (['__file__'], {}), '(__file__)\n', (95, 105), False, 'from os import path\n'), ((120, 151), 'os.path.join', 'path.join', (['dirname', '"""README.md"""'], {}), "(dirname, 'README.md')\n", (129, 151), False, 'from os import path\n'), ((287, 315), 'os.path.join', 'path.join... |
import sqlite3
from contextlib import closing
nome = input('Nome do produto: ').lower().capitalize()
with sqlite3.connect('precos.db') as conexao:
with closing(conexao.cursor()) as cursor:
cursor.execute('SELECT * FROM Precos WHERE nome_produto = ?', (nome,))
registro = cursor.fetchone()
... | [
"sqlite3.connect"
] | [((108, 136), 'sqlite3.connect', 'sqlite3.connect', (['"""precos.db"""'], {}), "('precos.db')\n", (123, 136), False, 'import sqlite3\n')] |
import torch
from mmdet.datasets.pipelines.transforms import Pad
from mmdet.datasets.pipelines.transforms import FilterBox
import numpy as np
import cv2
def test_pad():
raw = dict(
img=np.zeros((200, 401, 3), dtype=np.uint8)
)
cv2.imshow('raw', raw['img'])
pad = Pad(square=True, pad_val=255)
... | [
"cv2.imshow",
"numpy.array",
"numpy.zeros",
"mmdet.datasets.pipelines.transforms.FilterBox",
"mmdet.datasets.pipelines.transforms.Pad",
"cv2.waitKey"
] | [((249, 278), 'cv2.imshow', 'cv2.imshow', (['"""raw"""', "raw['img']"], {}), "('raw', raw['img'])\n", (259, 278), False, 'import cv2\n'), ((289, 318), 'mmdet.datasets.pipelines.transforms.Pad', 'Pad', ([], {'square': '(True)', 'pad_val': '(255)'}), '(square=True, pad_val=255)\n', (292, 318), False, 'from mmdet.datasets... |
#
# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
# its licensors.
#
# For complete copyright and license terms please see the LICENSE at the root of this
# distribution (the "License"). All use of this software is governed by the License,
# or, if provided, by the license below or th... | [
"lumberyard_modules.ProjectSettingsFile",
"pytest.param",
"lumberyard_modules.sanitize_kw_input",
"pytest.raises",
"pytest.fixture"
] | [((1263, 1279), 'pytest.fixture', 'pytest.fixture', ([], {}), '()\n', (1277, 1279), False, 'import pytest\n'), ((1632, 1648), 'pytest.fixture', 'pytest.fixture', ([], {}), '()\n', (1646, 1648), False, 'import pytest\n'), ((1800, 1840), 'lumberyard_modules.sanitize_kw_input', 'lumberyard_modules.sanitize_kw_input', (['k... |
#!/usr/bin/env python3
"""Curve fitting with linear programming.
Minimizes the sum of error for each fit point to find the optimal coefficients
for a given polynomial.
Overview:
Objective: Sum of errors
Subject to: Bounds on coefficients
Credit: "Curve Fitting with Linear Programming", <NAME> and <NAME>
"""... | [
"enum.auto",
"ortools.linear_solver.pywraplp.Solver"
] | [((555, 566), 'enum.auto', 'enum.auto', ([], {}), '()\n', (564, 566), False, 'import enum\n'), ((591, 602), 'enum.auto', 'enum.auto', ([], {}), '()\n', (600, 602), False, 'import enum\n'), ((4198, 4275), 'ortools.linear_solver.pywraplp.Solver', 'pywraplp.Solver', (['"""polynomial_solver"""', 'pywraplp.Solver.GLOP_LINEA... |
from pathlib import PosixPath
import configparser
from typing import Dict, Optional, Any, List
from inspect import cleandoc
import shutil
import tensorhive
import os
import logging
log = logging.getLogger(__name__)
class CONFIG_FILES:
# Where to copy files
# (TensorHive tries to load these by default)
con... | [
"logging.getLogger",
"configparser.ConfigParser",
"os.getenv",
"pathlib.PosixPath",
"os.chmod",
"ast.literal_eval",
"yaml.safe_load",
"inspect.cleandoc",
"shutil.copy",
"pathlib.PosixPath.home"
] | [((187, 214), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (204, 214), False, 'import logging\n'), ((330, 346), 'pathlib.PosixPath.home', 'PosixPath.home', ([], {}), '()\n', (344, 346), False, 'from pathlib import PosixPath\n'), ((683, 702), 'pathlib.PosixPath', 'PosixPath', (['__file__... |
import random
from typing import Tuple
import torch
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
from torch import Tensor
class Encoder(nn.Module):
def __init__(self, input_dim, emb_dim, enc_hid_dim, dec_hid_dim, dropout):
super().__init__()
self.input_dim = in... | [
"torch.nn.Dropout",
"torch.cat",
"torch.sum",
"torch.nn.Linear",
"torch.bmm",
"torch.zeros",
"random.random",
"torch.nn.functional.softmax",
"torch.nn.Embedding",
"torch.nn.GRU"
] | [((494, 526), 'torch.nn.Embedding', 'nn.Embedding', (['input_dim', 'emb_dim'], {}), '(input_dim, emb_dim)\n', (506, 526), True, 'import torch.nn as nn\n'), ((546, 594), 'torch.nn.GRU', 'nn.GRU', (['emb_dim', 'enc_hid_dim'], {'bidirectional': '(True)'}), '(emb_dim, enc_hid_dim, bidirectional=True)\n', (552, 594), True, ... |
from typing import Dict, Any, List
import string
from parlai.core.agents import Agent
from parlai.core.message import Message
from random import sample
import pathlib
path = pathlib.Path(__file__).parent.absolute()
class LightImitateMixin(Agent):
"""Abstract class that handles passing expert trajectories alo... | [
"pathlib.Path"
] | [((179, 201), 'pathlib.Path', 'pathlib.Path', (['__file__'], {}), '(__file__)\n', (191, 201), False, 'import pathlib\n')] |
from git import Repo
from pf_pweb_sourceman.common.console import console
from pf_py_file.pfpf_file_util import PFPFFileUtil
class GitRepoMan:
def get_repo_name_from_url(self, url: str):
if not url:
return None
last_slash_index = url.rfind("/")
last_suffix_index = url.rfind("... | [
"git.Repo.clone_from",
"pf_py_file.pfpf_file_util.PFPFFileUtil.is_exist",
"pf_pweb_sourceman.common.console.console.success",
"git.Repo"
] | [((795, 822), 'pf_py_file.pfpf_file_util.PFPFFileUtil.is_exist', 'PFPFFileUtil.is_exist', (['path'], {}), '(path)\n', (816, 822), False, 'from pf_py_file.pfpf_file_util import PFPFFileUtil\n'), ((836, 908), 'pf_pweb_sourceman.common.console.console.success', 'console.success', (["('Cloning project: ' + repo_name + ', B... |
# Install all examples to connected device(s)
import subprocess
import sys
answer = input("Install all vulkan examples to attached device, this may take some time! (Y/N)").lower() == 'y'
if answer:
BUILD_ARGUMENTS = ""
for arg in sys.argv[1:]:
if arg == "-validation":
BUILD_ARGUMENTS += "-v... | [
"sys.exit"
] | [((499, 511), 'sys.exit', 'sys.exit', (['(-1)'], {}), '(-1)\n', (507, 511), False, 'import sys\n')] |
from generators.ahoughton import AhoughtonGenerator
from render_config import RendererConfig
from problem_renderer import ProblemRenderer
from moonboard import get_moonboard
from adapters.default import DefaultProblemAdapter
from adapters.crg import CRGProblemAdapter
from adapters.ahoughton import AhoughtonAdapter
impo... | [
"adapters.default.DefaultProblemAdapter",
"moonboard.get_moonboard",
"json.load",
"adapters.crg.CRGProblemAdapter",
"generators.ahoughton.AhoughtonGenerator",
"adapters.ahoughton.AhoughtonAdapter",
"render_config.RendererConfig"
] | [((377, 393), 'render_config.RendererConfig', 'RendererConfig', ([], {}), '()\n', (391, 393), False, 'from render_config import RendererConfig\n'), ((789, 876), 'generators.ahoughton.AhoughtonGenerator', 'AhoughtonGenerator', ([], {'year': '(2016)', 'driver_path': '"""C:/.selenium_drivers/chromedriver.exe"""'}), "(year... |
import discord
from Util import Utils, Emoji, Translator
page_handlers = dict()
known_messages = dict()
def on_ready(bot):
load_from_disc()
def register(type, init, update, sender_only=False):
page_handlers[type] = {
"init": init,
"update": update,
"sender_only": sender_only
}... | [
"Util.Emoji.get_emoji",
"Util.Emoji.get_chat_emoji",
"Util.Utils.fetch_from_disk",
"Util.Utils.saveToDisk"
] | [((5066, 5116), 'Util.Utils.saveToDisk', 'Utils.saveToDisk', (['"""known_messages"""', 'known_messages'], {}), "('known_messages', known_messages)\n", (5082, 5116), False, 'from Util import Utils, Emoji, Translator\n'), ((5188, 5227), 'Util.Utils.fetch_from_disk', 'Utils.fetch_from_disk', (['"""known_messages"""'], {})... |
from __future__ import annotations
from dataclasses import dataclass, field, InitVar
from typing import List, Tuple, Iterator, Iterable, Optional
from random import choice
import pyxel
# -------------------------------------------------------
# Types
# -------------------------------------------------------
Maze = T... | [
"random.choice",
"pyxel.btnp",
"pyxel.rect",
"pyxel.mouse",
"pyxel.init",
"pyxel.rectb",
"pyxel.run",
"pyxel.cls",
"dataclasses.field"
] | [((1146, 1174), 'dataclasses.field', 'field', ([], {'init': '(False)', 'default': '(0)'}), '(init=False, default=0)\n', (1151, 1174), False, 'from dataclasses import dataclass, field, InitVar\n'), ((1211, 1250), 'dataclasses.field', 'field', ([], {'init': '(False)', 'default_factory': 'list'}), '(init=False, default_fa... |
from django.db import models
from django.contrib.auth.models import User
from PIL import Image
class Profile(models.Model):
user = models.ForeignKey(User, on_delete=models.CASCADE)
image = models.ImageField(default='default.jpg',
upload_to='profile_pic/')
... | [
"django.db.models.ImageField",
"PIL.Image",
"django.db.models.ForeignKey"
] | [((136, 185), 'django.db.models.ForeignKey', 'models.ForeignKey', (['User'], {'on_delete': 'models.CASCADE'}), '(User, on_delete=models.CASCADE)\n', (153, 185), False, 'from django.db import models\n'), ((198, 264), 'django.db.models.ImageField', 'models.ImageField', ([], {'default': '"""default.jpg"""', 'upload_to': '... |
## MODULE WITH UTIL FUNCTIONS - NOTION
"----------------------------------------------------------------------------------------------------------------------"
####################################################### Imports ########################################################
"---------------------------------... | [
"pandas.DataFrame.from_dict",
"pkg_dir.src.utils.general_utils.read_yaml",
"requests.request"
] | [((1577, 1628), 'requests.request', 'requests.request', (['"""POST"""', 'read_url'], {'headers': 'headers'}), "('POST', read_url, headers=headers)\n", (1593, 1628), False, 'import requests\n'), ((2130, 2149), 'pkg_dir.src.utils.general_utils.read_yaml', 'read_yaml', (['crds_loc'], {}), '(crds_loc)\n', (2139, 2149), Fal... |
# -*- coding: utf-8 -*-
#
from conans import python_requires
import conans.tools as tools
import os
base = python_requires("Eigen3ToPython/latest@multi-contact/dev")
class MCRTCDataConan(base.Eigen3ToPythonConan):
name = "mc_rtc_data"
version = "1.0.4"
description = "Environments/Robots description for m... | [
"conans.python_requires",
"os.path.exists",
"os.path.join",
"os.remove"
] | [((109, 167), 'conans.python_requires', 'python_requires', (['"""Eigen3ToPython/latest@multi-contact/dev"""'], {}), "('Eigen3ToPython/latest@multi-contact/dev')\n", (124, 167), False, 'from conans import python_requires\n'), ((1062, 1115), 'os.path.join', 'os.path.join', (['self.package_folder', '"""lib"""', '"""pkgcon... |
import torch
import json
import numpy as np
from torch.autograd import Variable
import gzip
import yaml
from re import split
from matplotlib import pyplot
def showImg( im ):
pyplot.imshow( im )
pyplot.show()
def myOpen( fname, mode ):
return open( fname, mode, encoding="utf-8" )
def readFile( fname ):
... | [
"matplotlib.pyplot.imshow",
"torch.load",
"yaml.load",
"json.load",
"json.dump",
"matplotlib.pyplot.show"
] | [((180, 197), 'matplotlib.pyplot.imshow', 'pyplot.imshow', (['im'], {}), '(im)\n', (193, 197), False, 'from matplotlib import pyplot\n'), ((204, 217), 'matplotlib.pyplot.show', 'pyplot.show', ([], {}), '()\n', (215, 217), False, 'from matplotlib import pyplot\n'), ((609, 621), 'json.load', 'json.load', (['f'], {}), '(f... |
#coding:utf-8
#0导入模块 ,生成模拟数据集
import tensorflow as tf
import numpy as np
import matplotlib.pyplot as plt
import opt4_8_generateds
import opt4_8_forward
STEPS = 40000
BATCH_SIZE = 30
LEARNING_RATE_BASE = 0.001
LEARNING_RATE_DECAY = 0.999
REGULARIZER = 0.01
def backward():
x = tf.placeholder(tf.float32, shape=(None, ... | [
"tensorflow.Variable",
"opt4_8_generateds.generateds",
"tensorflow.placeholder",
"tensorflow.Session",
"tensorflow.get_collection",
"opt4_8_forward.forward",
"numpy.squeeze",
"tensorflow.global_variables_initializer",
"matplotlib.pyplot.contour",
"tensorflow.train.exponential_decay",
"tensorflow... | [((280, 323), 'tensorflow.placeholder', 'tf.placeholder', (['tf.float32'], {'shape': '(None, 2)'}), '(tf.float32, shape=(None, 2))\n', (294, 323), True, 'import tensorflow as tf\n'), ((330, 373), 'tensorflow.placeholder', 'tf.placeholder', (['tf.float32'], {'shape': '(None, 1)'}), '(tf.float32, shape=(None, 1))\n', (34... |
# -*- coding: utf-8 -*-
# MIT License
#
# Copyright 2018-2020 New York University A<NAME>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation ... | [
"camel_tools.utils.transliterate.Transliterator",
"pytest.raises",
"camel_tools.utils.charmap.CharMapper"
] | [((1624, 1650), 'camel_tools.utils.charmap.CharMapper', 'CharMapper', (['TEST_MAP', 'None'], {}), '(TEST_MAP, None)\n', (1634, 1650), False, 'from camel_tools.utils.charmap import CharMapper\n'), ((2328, 2355), 'camel_tools.utils.transliterate.Transliterator', 'Transliterator', (['TEST_MAPPER'], {}), '(TEST_MAPPER)\n',... |
######################################################################################################################
# Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. #
# ... | [
"json.loads",
"json.dumps"
] | [((2110, 2166), 'json.loads', 'json.loads', (['template_text'], {'object_pairs_hook': 'OrderedDict'}), '(template_text, object_pairs_hook=OrderedDict)\n', (2120, 2166), False, 'import json\n'), ((2327, 2357), 'json.dumps', 'json.dumps', (['template'], {'indent': '(4)'}), '(template, indent=4)\n', (2337, 2357), False, '... |
#!/usr/bin/env python3
#
# Copyright (C) 2018 <NAME> <<EMAIL>>
# Copyright (C) 2019,2020 <NAME> <<EMAIL>>
# Copyright (C) 2020, <NAME>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Software"), to deal in
# the Software withou... | [
"logging.getLogger",
"requests.Session",
"py7zr.SevenZipFile",
"urllib3.util.retry.Retry",
"pathlib.Path",
"requests.adapters.HTTPAdapter",
"subprocess.run",
"time.perf_counter",
"aqt.settings.Settings",
"os.getcwd",
"os.path.join",
"sys.exc_info",
"os.unlink",
"aqt.helper.versiontuple",
... | [((2119, 2129), 'aqt.settings.Settings', 'Settings', ([], {}), '()\n', (2127, 2129), False, 'from aqt.settings import Settings\n'), ((2292, 2311), 'time.perf_counter', 'time.perf_counter', ([], {}), '()\n', (2309, 2311), False, 'import time\n'), ((2447, 2465), 'requests.Session', 'requests.Session', ([], {}), '()\n', (... |
"""Utility Modules."""
from typing import Any, Callable, Dict, List, Optional, Sequence, TypeVar, Union
import jax
import jax.numpy as jnp
from .module import Module, parameters_method
T = TypeVar("T", bound=Module)
O = TypeVar("O")
class ParameterModule(Module):
"""A PAX module that registers attributes as ... | [
"jax.tree_flatten",
"jax.tree_unflatten",
"typing.TypeVar"
] | [((194, 220), 'typing.TypeVar', 'TypeVar', (['"""T"""'], {'bound': 'Module'}), "('T', bound=Module)\n", (201, 220), False, 'from typing import Any, Callable, Dict, List, Optional, Sequence, TypeVar, Union\n'), ((225, 237), 'typing.TypeVar', 'TypeVar', (['"""O"""'], {}), "('O')\n", (232, 237), False, 'from typing import... |
import base64
import mimetypes
import os
from django.conf import settings
from django.http import Http404, HttpResponse
from django.shortcuts import get_object_or_404
from django.views.decorators.cache import cache_control
from django.views.static import serve as django_serve
from database_files.models import File
... | [
"django.http.HttpResponse",
"django.shortcuts.get_object_or_404",
"django.views.decorators.cache.cache_control",
"mimetypes.guess_type",
"django.views.static.serve"
] | [((321, 349), 'django.views.decorators.cache.cache_control', 'cache_control', ([], {'max_age': '(86400)'}), '(max_age=86400)\n', (334, 349), False, 'from django.views.decorators.cache import cache_control\n'), ((442, 476), 'django.shortcuts.get_object_or_404', 'get_object_or_404', (['File'], {'name': 'name'}), '(File, ... |
# coding: utf-8
'''フロントコントローラを提供する
'''
from math import ceil
import os
from flask import json
from flask import Flask
from flask import request
from flask import send_from_directory
from flask import render_template
# from json_loader import load_locations
# from json_loader import prepare_locations
from models imp... | [
"flask.render_template",
"flask.request.args.get",
"flask.send_from_directory",
"math.ceil",
"flask.json.jsonify",
"flask.Flask",
"models.Location.selectbase",
"models.Location.select"
] | [((387, 402), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (392, 402), False, 'from flask import Flask\n'), ((647, 682), 'flask.send_from_directory', 'send_from_directory', (['"""static"""', 'path'], {}), "('static', path)\n", (666, 682), False, 'from flask import send_from_directory\n'), ((725, 754), 'f... |
import serial
import serial.tools.list_ports
from hale_hub.constants import STARTING_OUTLET_COMMAND, SERIAL_BAUD_RATE, SERIAL_TIMEOUT
from hale_hub.ifttt_logger import send_ifttt_log
class _Outlet:
def __init__(self, name):
self.state = 0
self.name = name
class _OutletInterface:
def __init__... | [
"hale_hub.ifttt_logger.send_ifttt_log",
"serial.tools.list_ports.comports",
"serial.Serial"
] | [((1036, 1101), 'serial.Serial', 'serial.Serial', (['ports[0]', 'SERIAL_BAUD_RATE'], {'timeout': 'SERIAL_TIMEOUT'}), '(ports[0], SERIAL_BAUD_RATE, timeout=SERIAL_TIMEOUT)\n', (1049, 1101), False, 'import serial\n'), ((1141, 1199), 'hale_hub.ifttt_logger.send_ifttt_log', 'send_ifttt_log', (['__name__', '"""No serial por... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import numpy as np
def remove_nan(xyzs): return xyzs[~np.isnan(xyzs).any(axis = 1)]
def measure_twocores(core_xyz_ref, core_xyz_tar):
''' Measure the following aspects of two helical cores.
- Interhelical distance vector between the centers.
- Inte... | [
"numpy.nanmean",
"numpy.dot",
"numpy.isnan",
"numpy.linalg.norm"
] | [((402, 434), 'numpy.nanmean', 'np.nanmean', (['core_xyz_ref'], {'axis': '(0)'}), '(core_xyz_ref, axis=0)\n', (412, 434), True, 'import numpy as np\n'), ((454, 486), 'numpy.nanmean', 'np.nanmean', (['core_xyz_tar'], {'axis': '(0)'}), '(core_xyz_tar, axis=0)\n', (464, 486), True, 'import numpy as np\n'), ((662, 685), 'n... |
"""
Unit tests for module `homework_1.tasks.task_3`.
"""
from tempfile import NamedTemporaryFile
from typing import Tuple
import pytest
from homework_1.tasks.task_3 import find_maximum_and_minimum
@pytest.mark.parametrize(
["file_content", "expected_result"],
[
pytest.param(
"0\n",
... | [
"homework_1.tasks.task_3.find_maximum_and_minimum",
"pytest.param",
"tempfile.NamedTemporaryFile"
] | [((1456, 1485), 'tempfile.NamedTemporaryFile', 'NamedTemporaryFile', ([], {'mode': '"""wt"""'}), "(mode='wt')\n", (1474, 1485), False, 'from tempfile import NamedTemporaryFile\n'), ((283, 344), 'pytest.param', 'pytest.param', (['"""0\n"""', '(0, 0)'], {'id': '"""\'0\n\', result is (0, 0)."""'}), '(\'0\\n\', (0, 0), id=... |
#!/usr/bin/python2.5
# Copyright (C) 2007 Google 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 la... | [
"util.ApproximateDistanceBetweenStops",
"util.NonNegIntStringToInt",
"util.IsEmpty"
] | [((2293, 2324), 'util.IsEmpty', 'util.IsEmpty', (['self.from_stop_id'], {}), '(self.from_stop_id)\n', (2305, 2324), False, 'import util\n'), ((2462, 2491), 'util.IsEmpty', 'util.IsEmpty', (['self.to_stop_id'], {}), '(self.to_stop_id)\n', (2474, 2491), False, 'import util\n'), ((4865, 4921), 'util.ApproximateDistanceBet... |
from django.urls import path
from . import views
from . views import UserPostListView, PostDetailView, PostDeleteview, PostCreateView, PostUpdateView,CommentUpdateView, VideoCreateView, video_update
urlpatterns = [
path('',views.base, name='base'),
path('login',views.login, name='login'),
path('register',v... | [
"django.urls.path"
] | [((220, 253), 'django.urls.path', 'path', (['""""""', 'views.base'], {'name': '"""base"""'}), "('', views.base, name='base')\n", (224, 253), False, 'from django.urls import path\n'), ((258, 298), 'django.urls.path', 'path', (['"""login"""', 'views.login'], {'name': '"""login"""'}), "('login', views.login, name='login')... |
# https://medium.com/@kumon/how-to-realize-similarity-search-with-elasticsearch-3dd5641b9adb
# https://docs.aws.amazon.com/opensearch-service/latest/developerguide/knn.html
import sys
import requests
import h5py
import numpy as np
import json
import aiohttp
import asyncio
import time
import httpx
from requests.auth imp... | [
"statistics.mean",
"json.loads",
"requests.auth.HTTPBasicAuth",
"h5py.File",
"numpy.array",
"time.time"
] | [((1014, 1050), 'requests.auth.HTTPBasicAuth', 'HTTPBasicAuth', (['"""admin"""', '"""<PASSWORD>"""'], {}), "('admin', '<PASSWORD>')\n", (1027, 1050), False, 'from requests.auth import HTTPBasicAuth\n'), ((2465, 2485), 'h5py.File', 'h5py.File', (['path', '"""r"""'], {}), "(path, 'r')\n", (2474, 2485), False, 'import h5p... |
# coding: utf-8
import math
import dateutil
import dateutil.parser
import json
from ChartBars import Chart
from ChartUpdaterByCCWebsocket import ChartUpdaterByCoincheckWS
from Util import BitcoinUtil
def adjust_price_to_tick(price, tick):
return price - math.fmod(price, tick)
def adjust_amount_to_tick(amount, t... | [
"dateutil.parser.parse",
"json.loads",
"Util.BitcoinUtil.roundBTCby1satoshi",
"math.fmod"
] | [((261, 283), 'math.fmod', 'math.fmod', (['price', 'tick'], {}), '(price, tick)\n', (270, 283), False, 'import math\n'), ((346, 369), 'math.fmod', 'math.fmod', (['amount', 'tick'], {}), '(amount, tick)\n', (355, 369), False, 'import math\n'), ((12727, 12775), 'dateutil.parser.parse', 'dateutil.parser.parse', (["transac... |
import unittest
from test import test_support
import base64
class LegacyBase64TestCase(unittest.TestCase):
def test_encodestring(self):
eq = self.assertEqual
eq(base64.encodestring("www.python.org"), "d3d3LnB5dGhvbi5vcmc=\n")
eq(base64.encodestring("a"), "YQ==\n")
eq(base64.encod... | [
"cStringIO.StringIO",
"base64.urlsafe_b64decode",
"base64.urlsafe_b64encode",
"base64.b32decode",
"base64.b16decode",
"base64.b64encode",
"base64.b64decode",
"test.test_support.run_unittest",
"base64.standard_b64decode",
"base64.encode",
"base64.encodestring",
"base64.standard_b64encode",
"b... | [((9275, 9310), 'test.test_support.run_unittest', 'test_support.run_unittest', (['__name__'], {}), '(__name__)\n', (9300, 9310), False, 'from test import test_support\n'), ((1685, 1789), 'cStringIO.StringIO', 'StringIO', (['"""abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#0^&*();:<>,. []{}"""'], {}),... |
import numpy as np
from ctypes import c_void_p
from .Shader import Shader
from .transforms import *
from OpenGL.GL import *
class Path:
# position=[x1, y1, z1, ..., xn, yn, zn] ; rotation = [[Rx1, Ry1, Rz1], ..., [Rxn, Ryn, Rzn]]
def __init__(self, position, rotation=None):
self.loadPath(position)
... | [
"numpy.identity",
"numpy.array",
"ctypes.c_void_p"
] | [((4234, 4248), 'numpy.identity', 'np.identity', (['(4)'], {}), '(4)\n', (4245, 4248), True, 'import numpy as np\n'), ((1016, 1056), 'numpy.array', 'np.array', (['self.vertices'], {'dtype': '"""float32"""'}), "(self.vertices, dtype='float32')\n", (1024, 1056), True, 'import numpy as np\n'), ((1137, 1148), 'ctypes.c_voi... |
from argparse import (
ArgumentParser
)
from os import getcwd as os_getcwd
DEFAULT_OUTPUT_FOLDER = os_getcwd()
DEFAULT_SAMPLE_VOLUME = 10000
def build_args_parser(
program,
description):
parser = ArgumentParser(
program,
description,
)
parser = add_arguments(pars... | [
"argparse.ArgumentParser",
"os.getcwd"
] | [((108, 119), 'os.getcwd', 'os_getcwd', ([], {}), '()\n', (117, 119), True, 'from os import getcwd as os_getcwd\n'), ((228, 264), 'argparse.ArgumentParser', 'ArgumentParser', (['program', 'description'], {}), '(program, description)\n', (242, 264), False, 'from argparse import ArgumentParser\n')] |
import math
x = float(input())
prop_2 = -(x**2) / math.factorial(2)
prop_3 = (x**4) / math.factorial(4)
prop_4 = -(x**6) / math.factorial(6)
cos_x = float(1 + prop_2 + prop_3 + prop_4)
print(prop_2)
print(prop_3)
print(prop_4)
print(cos_x)
| [
"math.factorial"
] | [((52, 69), 'math.factorial', 'math.factorial', (['(2)'], {}), '(2)\n', (66, 69), False, 'import math\n'), ((89, 106), 'math.factorial', 'math.factorial', (['(4)'], {}), '(4)\n', (103, 106), False, 'import math\n'), ((127, 144), 'math.factorial', 'math.factorial', (['(6)'], {}), '(6)\n', (141, 144), False, 'import math... |
# -*- coding: utf-8 -*-
# Define here the models for your scraped items
#
# See documentation in:
# https://doc.scrapy.org/en/latest/topics/items.html
import scrapy
from scrapy.loader import ItemLoader
from scrapy.loader.processors import TakeFirst
# class SpiderItem(scrapy.Item):
# # define the fields for your... | [
"scrapy.loader.processors.TakeFirst",
"scrapy.Field"
] | [((665, 676), 'scrapy.loader.processors.TakeFirst', 'TakeFirst', ([], {}), '()\n', (674, 676), False, 'from scrapy.loader.processors import TakeFirst\n'), ((812, 826), 'scrapy.Field', 'scrapy.Field', ([], {}), '()\n', (824, 826), False, 'import scrapy\n'), ((846, 860), 'scrapy.Field', 'scrapy.Field', ([], {}), '()\n', ... |
#
# (C) Copyright 2013 Enthought, Inc., Austin, TX
# All right reserved.
#
# This file is open source software distributed according to the terms in
# LICENSE.txt
#
""" Context holding multiple subcontexts.
"""
from __future__ import absolute_import
from itertools import chain
from collections import MutableMapping ... | [
"traits.api.Str",
"traits.api.on_trait_change",
"traits.api.provides",
"traits.api.Bool",
"traits.api.Supports",
"traits.api.adapt"
] | [((613, 635), 'traits.api.provides', 'provides', (['IDataContext'], {}), '(IDataContext)\n', (621, 635), False, 'from traits.api import Bool, List, Str, Undefined, Supports, adapt, provides, on_trait_change\n'), ((788, 805), 'traits.api.Str', 'Str', (['"""multidummy"""'], {}), "('multidummy')\n", (791, 805), False, 'fr... |
"""Data pipelines."""
from collections import defaultdict, OrderedDict
from tqdm import tqdm
from torch.utils.data import TensorDataset, DataLoader, RandomSampler, SequentialSampler
import torch
def get_info(examples, vocab=None, max_seq_len=256):
"""Gathers info on and creats a featurized example generator for... | [
"collections.OrderedDict",
"torch.stack",
"torch.utils.data.RandomSampler",
"torch.tensor",
"collections.defaultdict"
] | [((3172, 3189), 'collections.defaultdict', 'defaultdict', (['list'], {}), '(list)\n', (3183, 3189), False, 'from collections import defaultdict, OrderedDict\n'), ((4077, 4129), 'torch.tensor', 'torch.tensor', (['featurized_data[var_name]'], {'dtype': 'dtype'}), '(featurized_data[var_name], dtype=dtype)\n', (4089, 4129)... |
import discord
from discord.ext import commands
import os
import json
from datetime import date, datetime, timedelta
from .utils import helper_functions as hf
from copy import deepcopy
dir_path = os.path.dirname(os.path.dirname(os.path.realpath(__file__))).replace('\\', '/')
class Jpserv(commands.Cog):
"""Module... | [
"datetime.datetime.strptime",
"discord.ext.commands.group",
"os.path.realpath",
"copy.deepcopy",
"datetime.datetime.today",
"datetime.date.today",
"discord.ext.commands.command"
] | [((668, 686), 'discord.ext.commands.command', 'commands.command', ([], {}), '()\n', (684, 686), False, 'from discord.ext import commands\n'), ((1305, 1365), 'discord.ext.commands.group', 'commands.group', ([], {'invoke_without_command': '(True)', 'aliases': "['uhc']"}), "(invoke_without_command=True, aliases=['uhc'])\n... |
# Copyright 2015 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... | [
"keras.backend.image_data_format",
"keras.utils.conv_utils.normalize_padding",
"keras.engine.input_spec.InputSpec",
"keras.utils.conv_utils.conv_output_length",
"tensorflow.compat.v2.TensorShape",
"keras.utils.conv_utils.normalize_data_format",
"tensorflow.compat.v2.transpose",
"keras.utils.conv_utils... | [((2611, 2664), 'keras.utils.conv_utils.normalize_tuple', 'conv_utils.normalize_tuple', (['pool_size', '(3)', '"""pool_size"""'], {}), "(pool_size, 3, 'pool_size')\n", (2637, 2664), False, 'from keras.utils import conv_utils\n'), ((2688, 2754), 'keras.utils.conv_utils.normalize_tuple', 'conv_utils.normalize_tuple', (['... |
import os
import re
from setuptools import setup
version = re.search(
'^__version__\s*=\s*"(.*)"',
open('braumeister/braumeister.py').read(),
re.M
).group(1)
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
name="braumeister",
packages=["braumeiste... | [
"os.path.dirname"
] | [((220, 245), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (235, 245), False, 'import os\n')] |
# standard library imports
import os
# third party imports
import numpy as np
from PIL import Image
import torch.nn as nn
from torchvision import transforms
# local imports
import config
from . import utils
from . import geometric_transformer
class GeoTransformationInfer(nn.Module):
def __init__(self, output_di... | [
"numpy.uint8",
"PIL.Image.new",
"numpy.moveaxis"
] | [((3034, 3072), 'PIL.Image.new', 'Image.new', (['"""RGB"""', '(1568, 224)', '"""white"""'], {}), "('RGB', (1568, 224), 'white')\n", (3043, 3072), False, 'from PIL import Image\n'), ((1872, 1901), 'numpy.uint8', 'np.uint8', (['(model_apparel * 255)'], {}), '(model_apparel * 255)\n', (1880, 1901), True, 'import numpy as ... |
from pathlib import Path
import h5py
import numpy as np
from torchvision.datasets.vision import VisionDataset
from PIL import Image
import requests
import zipfile
from tqdm import tqdm
def download_file_from_google_drive(id, destination):
URL = "https://docs.google.com/uc?export=download"
session = requests... | [
"PIL.Image.fromarray",
"requests.Session",
"pathlib.Path",
"numpy.square",
"numpy.random.seed",
"numpy.concatenate",
"numpy.arange",
"numpy.random.shuffle"
] | [((312, 330), 'requests.Session', 'requests.Session', ([], {}), '()\n', (328, 330), False, 'import requests\n'), ((2396, 2418), 'numpy.random.seed', 'np.random.seed', (['(484347)'], {}), '(484347)\n', (2410, 2418), True, 'import numpy as np\n'), ((2538, 2566), 'numpy.random.shuffle', 'np.random.shuffle', (['font_idxs']... |
import findspark
findspark.init()
from pyspark import SparkConf,SparkContext
from pyspark.streaming import StreamingContext
from pyspark.sql import Row,SQLContext
import sys
import requests
def tmp(x):
y = (x.split(';')[7]).split(',')
return (y)
def forf(x):
for i in x:
yield (i,1)
def topprint(time,rdd):
re... | [
"findspark.init",
"pyspark.SparkContext",
"pyspark.SparkConf"
] | [((17, 33), 'findspark.init', 'findspark.init', ([], {}), '()\n', (31, 33), False, 'import findspark\n'), ((457, 468), 'pyspark.SparkConf', 'SparkConf', ([], {}), '()\n', (466, 468), False, 'from pyspark import SparkConf, SparkContext\n'), ((499, 522), 'pyspark.SparkContext', 'SparkContext', ([], {'conf': 'conf'}), '(c... |
# Generated by Django 4.0.1 on 2022-01-20 13:10
import courses.fields
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('courses', '0002_video_text_image_file_content'),
]
operations = [
migrations.AlterModelOptions(
name='content',
... | [
"django.db.migrations.AlterModelOptions"
] | [((260, 337), 'django.db.migrations.AlterModelOptions', 'migrations.AlterModelOptions', ([], {'name': '"""content"""', 'options': "{'ordering': ['order']}"}), "(name='content', options={'ordering': ['order']})\n", (288, 337), False, 'from django.db import migrations\n'), ((382, 458), 'django.db.migrations.AlterModelOpt... |
#!/usr/bin/python
# Copyright 2016 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 appli... | [
"google_compute_engine.file_utils.LockFile",
"textwrap.dedent",
"os.path.basename",
"google_compute_engine.compat.parser.SafeConfigParser"
] | [((1260, 1285), 'google_compute_engine.compat.parser.SafeConfigParser', 'parser.SafeConfigParser', ([], {}), '()\n', (1283, 1285), False, 'from google_compute_engine.compat import parser\n'), ((1504, 1539), 'textwrap.dedent', 'textwrap.dedent', (['self.config_header'], {}), '(self.config_header)\n', (1519, 1539), False... |
# Copyright (c) 2020-2022, NVIDIA CORPORATION. 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 ... | [
"torch.load",
"torch.tensor",
"numpy.zeros",
"torch.classes.load_library",
"numpy.maximum"
] | [((946, 982), 'torch.classes.load_library', 'torch.classes.load_library', (['ths_path'], {}), '(ths_path)\n', (972, 982), False, 'import torch\n'), ((10265, 10296), 'torch.load', 'torch.load', (['"""pytorch_model.bin"""'], {}), "('pytorch_model.bin')\n", (10275, 10296), False, 'import torch\n'), ((9514, 9557), 'torch.t... |
# -*- coding: utf-8 -*-
# Copyright 1999-2020 Alibaba Group Holding Ltd.
#
# 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 require... | [
"logging.getLogger",
"random.choice",
"kubernetes.config.load_incluster_config",
"kubernetes.watch.Watch",
"os.environ.get",
"kubernetes.client.Configuration",
"kubernetes.client.ApiClient",
"os.getpid",
"gevent.threadpool.ThreadPool"
] | [((731, 758), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (748, 758), False, 'import logging\n'), ((1635, 1648), 'gevent.threadpool.ThreadPool', 'ThreadPool', (['(1)'], {}), '(1)\n', (1645, 1648), False, 'from gevent.threadpool import ThreadPool\n'), ((3396, 3409), 'kubernetes.watch.Wa... |
from unittest import TestCase
import torch
import transformers
from model.bert_model import BertModel
class TestBertModel(TestCase):
def test_forward(self):
# Bert Config
vocab_size = 10
sequence_len = 20
batch = 32
num_classes = 3
expected_shape = (batch, seque... | [
"torch.randint",
"transformers.BertConfig",
"model.bert_model.BertModel"
] | [((365, 434), 'torch.randint', 'torch.randint', ([], {'low': '(0)', 'high': '(vocab_size - 1)', 'size': '(batch, sequence_len)'}), '(low=0, high=vocab_size - 1, size=(batch, sequence_len))\n', (378, 434), False, 'import torch\n'), ((449, 583), 'transformers.BertConfig', 'transformers.BertConfig', ([], {'vocab_size': 'v... |
import json
import os
import tempfile
from unittest import TestCase
import pytest
from donjuan import Dungeon, DungeonRandomizer, Renderer
class RendererTest(TestCase):
def setUp(self):
super().setUp()
self.TEMP_DIR = tempfile.mkdtemp()
def test_smoke(self):
r = Renderer()
a... | [
"donjuan.Renderer",
"os.path.exists",
"os.path.join",
"os.path.dirname",
"tempfile.mkdtemp",
"donjuan.DungeonRandomizer",
"json.load",
"donjuan.Dungeon"
] | [((242, 260), 'tempfile.mkdtemp', 'tempfile.mkdtemp', ([], {}), '()\n', (258, 260), False, 'import tempfile\n'), ((300, 310), 'donjuan.Renderer', 'Renderer', ([], {}), '()\n', (308, 310), False, 'from donjuan import Dungeon, DungeonRandomizer, Renderer\n'), ((379, 396), 'donjuan.Renderer', 'Renderer', ([], {'scale': '(... |
# Copyright 2016 Rackspace Australia
# 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 requi... | [
"fixtures.MonkeyPatch",
"nova.tests.fixtures.OSAPIFixture",
"nova.tests.unit.image.fake.stub_out_image_service",
"nova.tests.functional.fixtures.PlacementFixture",
"nova.tests.fixtures.NeutronFixture",
"requests.request",
"oslo_utils.uuidutils.is_uuid_like",
"oslo_serialization.jsonutils.dumps",
"os... | [((1119, 1142), 'oslo_serialization.jsonutils.dumps', 'jsonutils.dumps', (['result'], {}), '(result)\n', (1134, 1142), False, 'from oslo_serialization import jsonutils\n'), ((1718, 1757), 'nova.tests.unit.image.fake.stub_out_image_service', 'fake_image.stub_out_image_service', (['self'], {}), '(self)\n', (1751, 1757), ... |
import os
import sys
import json
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "../../bert")))
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "../../")))
import tokenization
from config import config
class Model_data_preparation(object):
def __init__(self, DATA_... | [
"os.path.dirname",
"json.loads",
"os.path.exists",
"os.path.join"
] | [((78, 103), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (93, 103), False, 'import os\n'), ((166, 191), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (181, 191), False, 'import os\n'), ((807, 832), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__fi... |
"""
GitLab webhook receiver - see http://doc.gitlab.com/ee/web_hooks/web_hooks.html
"""
import asyncio
import json
import logging
from sinks.base_bot_request_handler import AsyncRequestHandler
logger = logging.getLogger(__name__)
try:
import dateutil.parser
except ImportError:
logger.error("missing module p... | [
"logging.getLogger",
"json.loads",
"json.dumps"
] | [((205, 232), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (222, 232), False, 'import logging\n'), ((877, 896), 'json.loads', 'json.loads', (['content'], {}), '(content)\n', (887, 896), False, 'import json\n'), ((1072, 1091), 'json.dumps', 'json.dumps', (['payload'], {}), '(payload)\n',... |
import os
from typing import Union, List
from tei_entity_enricher.interface.postprocessing.io import FileReader, FileWriter
from tei_entity_enricher.util.helper import local_save_path, makedir_if_necessary
from tei_entity_enricher.util.exceptions import FileNotFound
class GndConnector:
def __init__(
... | [
"os.path.dirname",
"tei_entity_enricher.interface.postprocessing.io.FileReader",
"tei_entity_enricher.interface.postprocessing.io.FileWriter",
"os.path.join"
] | [((1901, 1978), 'os.path.join', 'os.path.join', (['local_save_path', '"""config"""', '"""postprocessing"""', '"""gnd_apilist.json"""'], {}), "(local_save_path, 'config', 'postprocessing', 'gnd_apilist.json')\n", (1913, 1978), False, 'import os\n'), ((2040, 2149), 'tei_entity_enricher.interface.postprocessing.io.FileRea... |
#/usr/bin/python
__version__ = '1.0'
__author__ = '<EMAIL>'
##
## Imports
import string
import os
import errno
import shutil
import sys
import glob
import datetime
import subprocess
import logging as log
import numpy as np
import csv
from io import StringIO
import PyPDF2
from sklearn import preprocessing
from collecti... | [
"sklearn.preprocessing.LabelEncoder",
"numpy.array",
"sys.exit",
"logging.error",
"lxml.etree.tostring",
"numpy.arange",
"os.path.exists",
"xml.etree.cElementTree.XML",
"subprocess.Popen",
"os.path.lexists",
"os.path.isdir",
"numpy.empty",
"lxml.etree.DTD",
"csv.reader",
"os.path.isfile"... | [((22060, 22081), 'os.path.lexists', 'os.path.lexists', (['path'], {}), '(path)\n', (22075, 22081), False, 'import os\n'), ((28633, 28654), 'lxml.etree.Element', 'etree.Element', (['"""data"""'], {}), "('data')\n", (28646, 28654), False, 'from lxml import etree\n'), ((28787, 28843), 'lxml.etree.Element', 'etree.Element... |
# Generated by Django 2.2.13 on 2020-11-27 05:49
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('mvp', '0003_hublocation'),
]
operations = [
migrations.RemoveField(
model_name='hublocation',
name='longitude',
... | [
"django.db.migrations.RemoveField",
"django.db.models.TextField"
] | [((225, 291), 'django.db.migrations.RemoveField', 'migrations.RemoveField', ([], {'model_name': '"""hublocation"""', 'name': '"""longitude"""'}), "(model_name='hublocation', name='longitude')\n", (247, 291), False, 'from django.db import migrations, models\n'), ((439, 530), 'django.db.models.TextField', 'models.TextFie... |
# -*- coding: utf-8 -*-
"""
tornadio2.tests.gen
~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2011 by the <NAME>, see AUTHORS for more details.
:license: Apache, see LICENSE for more details.
"""
from collections import deque
from nose.tools import eq_
from tornadio2 import gen
_queue = None
def init_envir... | [
"tornadio2.gen.Task",
"collections.deque",
"nose.tools.eq_"
] | [((361, 368), 'collections.deque', 'deque', ([], {}), '()\n', (366, 368), False, 'from collections import deque\n'), ((1937, 1957), 'nose.tools.eq_', 'eq_', (['dummy.v', '"""test"""'], {}), "(dummy.v, 'test')\n", (1940, 1957), False, 'from nose.tools import eq_\n'), ((2096, 2116), 'nose.tools.eq_', 'eq_', (['dummy.v', ... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
#
# author: <NAME>
# contact: <EMAIL>
import torch
import SimpleITK as sitk
import numpy as np
import nibabel as nib
from torch.autograd import Variable
from skimage.transform import resize
from torchvision import transforms
from time import gmtime, strftime
from tqdm i... | [
"numpy.uint8",
"nibabel.load",
"torch.from_numpy",
"numpy.array",
"torch.cuda.is_available",
"numpy.empty",
"os.system",
"torchvision.transforms.ToTensor",
"os.path.expanduser",
"os.path.dirname",
"torchvision.transforms.Normalize",
"skimage.transform.resize",
"numpy.transpose",
"torchvisi... | [((422, 437), 'os.path.expanduser', 'expanduser', (['"""~"""'], {}), "('~')\n", (432, 437), False, 'from os.path import expanduser\n'), ((584, 614), 'os.path.join', 'os.path.join', (['"""/opt/ANTs/bin/"""'], {}), "('/opt/ANTs/bin/')\n", (596, 614), False, 'import os\n'), ((2026, 2111), 'os.path.join', 'os.path.join', (... |
import numpy as np
from statsmodels.discrete.conditional_models import (
ConditionalLogit, ConditionalPoisson)
from statsmodels.tools.numdiff import approx_fprime
from numpy.testing import assert_allclose
import pandas as pd
def test_logit_1d():
y = np.r_[0, 1, 0, 1, 0, 1, 0, 1, 1, 1]
g = np.r_[0, 0, 0... | [
"numpy.random.normal",
"statsmodels.discrete.conditional_models.ConditionalLogit",
"numpy.ones",
"numpy.random.poisson",
"numpy.hstack",
"numpy.testing.assert_allclose",
"statsmodels.discrete.conditional_models.ConditionalPoisson",
"statsmodels.discrete.conditional_models.ConditionalPoisson.from_formu... | [((420, 452), 'statsmodels.discrete.conditional_models.ConditionalLogit', 'ConditionalLogit', (['y', 'x'], {'groups': 'g'}), '(y, x, groups=g)\n', (436, 452), False, 'from statsmodels.discrete.conditional_models import ConditionalLogit, ConditionalPoisson\n'), ((997, 1057), 'numpy.testing.assert_allclose', 'assert_allc... |
from abc import ABCMeta, abstractmethod
import numpy as np
class Agent(object):
__metaclass__ = ABCMeta
def __init__(self, name, id_, action_num, env):
self.name = name
self.id_ = id_
self.action_num = action_num
# len(env.action_space[id_])
# self.opp_action_space = e... | [
"numpy.random.choice",
"numpy.array",
"numpy.random.dirichlet",
"numpy.sum",
"numpy.min"
] | [((1170, 1199), 'numpy.array', 'np.array', (['pi'], {'dtype': 'np.double'}), '(pi, dtype=np.double)\n', (1178, 1199), True, 'import numpy as np\n'), ((1482, 1492), 'numpy.min', 'np.min', (['pi'], {}), '(pi)\n', (1488, 1492), True, 'import numpy as np\n'), ((1559, 1569), 'numpy.sum', 'np.sum', (['pi'], {}), '(pi)\n', (1... |
#
# @lc app=leetcode id=290 lang=python3
#
# [290] Word Pattern
#
# https://leetcode.com/problems/word-pattern/description/
#
# algorithms
# Easy (35.86%)
# Likes: 825
# Dislikes: 113
# Total Accepted: 164K
# Total Submissions: 455.9K
# Testcase Example: '"abba"\n"dog cat cat dog"'
#
# Given a pattern and a stri... | [
"collections.defaultdict"
] | [((1216, 1232), 'collections.defaultdict', 'defaultdict', (['str'], {}), '(str)\n', (1227, 1232), False, 'from collections import defaultdict\n'), ((1249, 1265), 'collections.defaultdict', 'defaultdict', (['str'], {}), '(str)\n', (1260, 1265), False, 'from collections import defaultdict\n')] |
from torch import nn
class MyAwesomeModel(nn.Module):
def __init__(self):
super().__init__()
self.cnn = nn.Sequential(nn.Conv2d(in_channels=1, out_channels=5, kernel_size=3),
nn.ReLU(),
nn.Conv2d(in_channels=5, out_channels=3, kernel... | [
"torch.nn.ReLU",
"torch.nn.LogSoftmax",
"torch.nn.Linear",
"torch.nn.Conv2d"
] | [((141, 196), 'torch.nn.Conv2d', 'nn.Conv2d', ([], {'in_channels': '(1)', 'out_channels': '(5)', 'kernel_size': '(3)'}), '(in_channels=1, out_channels=5, kernel_size=3)\n', (150, 196), False, 'from torch import nn\n'), ((230, 239), 'torch.nn.ReLU', 'nn.ReLU', ([], {}), '()\n', (237, 239), False, 'from torch import nn\n... |
import unittest
from musket_core import coders
import numpy as np
import pandas as pd
import os
import math
fl=__file__
fl=os.path.dirname(fl)
class TestCoders(unittest.TestCase):
def test_binary_num(self):
a=np.array([0,1,0,1])
bc=coders.get_coder("binary",a, None)
self.as... | [
"os.path.dirname",
"numpy.array",
"musket_core.coders.get_coder",
"math.isnan"
] | [((134, 153), 'os.path.dirname', 'os.path.dirname', (['fl'], {}), '(fl)\n', (149, 153), False, 'import os\n'), ((237, 259), 'numpy.array', 'np.array', (['[0, 1, 0, 1]'], {}), '([0, 1, 0, 1])\n', (245, 259), True, 'import numpy as np\n'), ((269, 304), 'musket_core.coders.get_coder', 'coders.get_coder', (['"""binary"""',... |
#!/usr/bin/env python3
import os
import sys
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
sys.path.append(BASE_DIR)
import scripts.lib.setup_path_on_import
if __name__ == "__main__":
if 'posix' in os.name and os.geteuid() == 0:
print("manage.py should not be run as root. Use `su zulip` to drop ro... | [
"os.environ.setdefault",
"django.core.management.execute_from_command_line",
"sys.argv.append",
"os.access",
"os.path.join",
"os.geteuid",
"sys.exit",
"os.path.abspath",
"sys.path.append"
] | [((99, 124), 'sys.path.append', 'sys.path.append', (['BASE_DIR'], {}), '(BASE_DIR)\n', (114, 124), False, 'import sys\n'), ((72, 97), 'os.path.abspath', 'os.path.abspath', (['__file__'], {}), '(__file__)\n', (87, 97), False, 'import os\n'), ((1003, 1071), 'os.environ.setdefault', 'os.environ.setdefault', (['"""DJANGO_S... |
from ..dojo_test_case import DojoTestCase
from dojo.models import Test
from dojo.tools.intsights.parser import IntSightsParser
class TestIntSightsParser(DojoTestCase):
def test_intsights_parser_with_one_critical_vuln_has_one_findings_json(
self):
testfile = open("unittests/scans/intsights/ints... | [
"dojo.models.Test",
"dojo.tools.intsights.parser.IntSightsParser"
] | [((358, 375), 'dojo.tools.intsights.parser.IntSightsParser', 'IntSightsParser', ([], {}), '()\n', (373, 375), False, 'from dojo.tools.intsights.parser import IntSightsParser\n'), ((1169, 1186), 'dojo.tools.intsights.parser.IntSightsParser', 'IntSightsParser', ([], {}), '()\n', (1184, 1186), False, 'from dojo.tools.ints... |
from __future__ import unicode_literals
try:
from unittest.mock import patch
except ImportError:
from mock import patch
from django.contrib.auth.models import User
from django.contrib.contenttypes.models import ContentType
from django.test import TestCase
from django.urls import reverse
from rest_framework.t... | [
"mock.patch",
"rest_framework.test.force_authenticate",
"django_comments_xtd.django_comments.get_form",
"django_comments_xtd.api.views.CommentCreate.as_view",
"django_comments_xtd.tests.models.Article.objects.create",
"django.urls.reverse",
"rest_framework.test.APIRequestFactory",
"django.contrib.auth... | [((554, 573), 'rest_framework.test.APIRequestFactory', 'APIRequestFactory', ([], {}), '()\n', (571, 573), False, 'from rest_framework.test import APIRequestFactory, force_authenticate\n'), ((774, 797), 'django_comments_xtd.api.views.CommentCreate.as_view', 'CommentCreate.as_view', ([], {}), '()\n', (795, 797), False, '... |
'''
@file momentum_kinematics_optimizer.py
@package momentumopt
@author <NAME> (<EMAIL>)
@license License BSD-3-Clause
@copyright Copyright (c) 2019, New York University and Max Planck Gesellschaft.
@date 2019-10-08
'''
import os
import numpy as np
from momentumopt.kinoptpy.qp import QpSolver
from momentumopt.kinoptp... | [
"numpy.all",
"pinocchio.integrate",
"pinocchio.neutral",
"numpy.zeros",
"pinocchio.RobotWrapper",
"numpy.vstack",
"numpy.linalg.norm",
"numpy.matrix",
"momentumopt.kinoptpy.inverse_kinematics.PointContactInverseKinematics"
] | [((3951, 3989), 'numpy.zeros', 'np.zeros', (['(num_time_steps, num_eff, 3)'], {}), '((num_time_steps, num_eff, 3))\n', (3959, 3989), True, 'import numpy as np\n'), ((4015, 4053), 'numpy.zeros', 'np.zeros', (['(num_time_steps, num_eff, 3)'], {}), '((num_time_steps, num_eff, 3))\n', (4023, 4053), True, 'import numpy as n... |
import json
import urllib
import os
import jupyterhub
from tornado.httpclient import HTTPRequest, AsyncHTTPClient
from traitlets import Unicode
from jupyterhub.auth import Authenticator
from tornado import gen
class HttpAuthenticator(Authenticator):
server = Unicode(
None,
allow_none=True,
... | [
"urllib.parse.urlencode",
"traitlets.Unicode",
"tornado.httpclient.AsyncHTTPClient"
] | [((265, 373), 'traitlets.Unicode', 'Unicode', (['None'], {'allow_none': '(True)', 'config': '(True)', 'help': '"""\n Http authentication server.\n """'}), '(None, allow_none=True, config=True, help=\n """\n Http authentication server.\n """)\n', (272, 373), False, 'from traitlets impo... |
import torch
import torch.nn as nn
import numpy as np
import matplotlib.pyplot as plt
# NOT -> ParameterModule
# NOT -> children_and_parameters
# NOT -> flatten_model
# NOT -> lr_range
# NOT -> scheduling functions
# NOT -> SmoothenValue
# YES -> lr_find
# NOT -> plot_lr_find
# NOT TO BE MODIFIED
class ParameterModu... | [
"numpy.array",
"matplotlib.pyplot.FormatStrFormatter",
"numpy.cos",
"torch.isnan",
"matplotlib.pyplot.subplots",
"torch.device"
] | [((1675, 1688), 'numpy.array', 'np.array', (['res'], {}), '(res)\n', (1683, 1688), True, 'import numpy as np\n'), ((4280, 4300), 'torch.device', 'torch.device', (['"""cuda"""'], {}), "('cuda')\n", (4292, 4300), False, 'import torch\n'), ((9315, 9333), 'matplotlib.pyplot.subplots', 'plt.subplots', (['(1)', '(1)'], {}), ... |
# This file is part of the pyMOR project (http://www.pymor.org).
# Copyright 2013-2020 pyMOR developers and contributors. All rights reserved.
# License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause)
from pymortests.base import runmodule
if __name__ == "__main__":
runmodule(filename=__file__... | [
"pymortests.base.runmodule"
] | [((293, 321), 'pymortests.base.runmodule', 'runmodule', ([], {'filename': '__file__'}), '(filename=__file__)\n', (302, 321), False, 'from pymortests.base import runmodule\n')] |
# The MIT License
#
# Copyright 2014, 2015 <NAME>
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the 'Software'),
# to deal in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge,... | [
"pyjsparser.PyJsParser"
] | [((1686, 1698), 'pyjsparser.PyJsParser', 'PyJsParser', ([], {}), '()\n', (1696, 1698), False, 'from pyjsparser import PyJsParser, Node, WrappingNode, node_to_dict\n')] |
import torch
def expanded_pairwise_distances(x, y):
'''
Input: x is a bxNxd matrix
y is an optional bxMxd matirx
Output: dist is a bxNxM matrix where dist[i,j] is the square norm between x[i,:] and y[j,:]
if y is not given then use 'y=x'.
i.e. dist[i,j] = ||x[i,:]-y[j,:]||^2
... | [
"torch.tensor",
"torch.topk",
"torch.sum"
] | [((390, 430), 'torch.sum', 'torch.sum', (['(differences * differences)', '(-1)'], {}), '(differences * differences, -1)\n', (399, 430), False, 'import torch\n'), ((1095, 1220), 'torch.tensor', 'torch.tensor', (['[[[0.0, 0.0, 0.0], [0.0, 1.0, 0.0], [0.0, 1.0, 0.0]], [[1.0, 1.0, 0.0], [\n 1.0, 2.0, 0.0], [0.0, 1.0, 0.... |
from __future__ import absolute_import
from __future__ import print_function
from __future__ import division
from __future__ import unicode_literals
from django.http import HttpResponse, HttpResponseRedirect, JsonResponse, QueryDict #, HttpResponseForbidden, Http404, , JsonResponse
from django.shortcuts import get_obj... | [
"django.shortcuts.render",
"django.http.HttpResponseRedirect",
"rules.contrib.views.objectgetter",
"django.contrib.admin.views.decorators.user_passes_test",
"django.http.JsonResponse",
"django.shortcuts.get_object_or_404",
"django.urls.reverse"
] | [((844, 900), 'django.contrib.admin.views.decorators.user_passes_test', 'user_passes_test', (['(lambda u: u.is_superuser or u.is_staff)'], {}), '(lambda u: u.is_superuser or u.is_staff)\n', (860, 900), False, 'from django.contrib.admin.views.decorators import staff_member_required, user_passes_test\n'), ((2451, 2507), ... |
#!/usr/bin/env python3
# coding: utf8
# /*##########################################################################
#
# Copyright (c) 2015-2021 European Synchrotron Radiation Facility
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files ... | [
"logging.getLogger",
"sys.path.insert",
"importlib.import_module",
"logging.captureWarnings",
"subprocess.Popen",
"os.environ.get",
"os.path.join",
"pytest.main",
"os.path.dirname",
"os.path.isdir",
"warnings.simplefilter",
"os.path.abspath",
"logging.error",
"distutils.sysconfig.get_confi... | [((1714, 1743), 'logging.captureWarnings', 'logging.captureWarnings', (['(True)'], {}), '(True)\n', (1737, 1743), False, 'import logging\n'), ((1760, 1792), 'warnings.simplefilter', 'warnings.simplefilter', (['"""default"""'], {}), "('default')\n", (1781, 1792), False, 'import warnings\n'), ((1803, 1833), 'logging.getL... |
# Copyright 2008-2015 Nokia Solutions and Networks
#
# 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 l... | [
"traceback.format_tb",
"os.getenv",
"re.compile",
"sys.exc_info",
"java.io.PrintWriter",
"traceback.tb_frame.f_globals.get",
"java.io.StringWriter"
] | [((796, 830), 'os.getenv', 'os.getenv', (['"""ROBOT_INTERNAL_TRACES"""'], {}), "('ROBOT_INTERNAL_TRACES')\n", (805, 830), False, 'import os\n'), ((4930, 4959), 're.compile', 're.compile', (['"""^\\\\s+at (\\\\w.+)"""'], {}), "('^\\\\s+at (\\\\w.+)')\n", (4940, 4959), False, 'import re\n'), ((1976, 1990), 'sys.exc_info'... |
import unittest
from unittest import TestCase
from misc import verify
class TestVerify(TestCase):
"""Tests misc.py verifies function."""
def test_verify__with_zero_threshold_and_expected_succeeds(self):
"""Test passes when expected rate, actual rate and threshold are all zero."""
result = ve... | [
"unittest.main",
"misc.verify"
] | [((1414, 1429), 'unittest.main', 'unittest.main', ([], {}), '()\n', (1427, 1429), False, 'import unittest\n'), ((318, 394), 'misc.verify', 'verify', ([], {'metric': '"""Query failure rate"""', 'actual': '(0.0)', 'expected': '(0.0)', 'threshold': '(0.0)'}), "(metric='Query failure rate', actual=0.0, expected=0.0, thresh... |
from django.apps import AppConfig
from django.contrib.admin.apps import AdminConfig
from django.contrib.auth.apps import AuthConfig
from django.contrib.contenttypes.apps import ContentTypesConfig
from django.contrib.sessions.apps import SessionsConfig
from django.db.models.signals import post_migrate
from django_celery... | [
"django.db.models.signals.post_migrate.connect",
"geotrek.common.utils.signals.check_srid_has_meter_unit"
] | [((730, 822), 'django.db.models.signals.post_migrate.connect', 'post_migrate.connect', (['pm_callback'], {'sender': 'self', 'dispatch_uid': '"""geotrek.core.pm_callback"""'}), "(pm_callback, sender=self, dispatch_uid=\n 'geotrek.core.pm_callback')\n", (750, 822), False, 'from django.db.models.signals import post_mig... |
import sys, os
from subprocess import call
try:
from downloadPdb import downloadPDB
except ImportError:
from .downloadPdb import downloadPDB
pdbListFile="/home/rsanchez/Tesis/rriPredMethod/data/joanDimers/117_dimers_list.tsv"
outPath="/home/rsanchez/Tesis/rriPredMethod/data/joanDimers/pdbFiles/rawPDBs"
USE_BIO_... | [
"downloadPdb.downloadPDB",
"os.path.expanduser"
] | [((1146, 1208), 'downloadPdb.downloadPDB', 'downloadPDB', (['pdbId', 'outPath'], {'bioUnit': '(0 if useBioUnit else None)'}), '(pdbId, outPath, bioUnit=0 if useBioUnit else None)\n', (1157, 1208), False, 'from downloadPdb import downloadPDB\n'), ((1299, 1330), 'os.path.expanduser', 'os.path.expanduser', (['sys.argv[1]'... |
import re
from rest_framework import serializers
from .models import Collection, CollectionIcon
class CollectionSerializer(serializers.ModelSerializer):
"""Collections's serializer"""
class Meta:
model = Collection
read_only = ('token', )
class CollectionIconSerializer(serializers.ModelSe... | [
"re.sub",
"rest_framework.serializers.ValidationError"
] | [((780, 803), 're.sub', 're.sub', (['"""-+"""', '"""-"""', 'name'], {}), "('-+', '-', name)\n", (786, 803), False, 'import re\n'), ((1164, 1254), 'rest_framework.serializers.ValidationError', 'serializers.ValidationError', (['"""Either a packicon or the shape of icon should be given"""'], {}), "(\n 'Either a packico... |
from setuptools import setup, find_packages
import pathlib
here = pathlib.Path(__file__).parent.resolve()
long_description = (here / "readme.md").read_text(encoding="utf-8")
setup(
name="data_dashboard",
version="0.1.1",
description="Dashboard to explore the data and to create baseline Machine Learning m... | [
"setuptools.find_packages",
"pathlib.Path"
] | [((1018, 1033), 'setuptools.find_packages', 'find_packages', ([], {}), '()\n', (1031, 1033), False, 'from setuptools import setup, find_packages\n'), ((68, 90), 'pathlib.Path', 'pathlib.Path', (['__file__'], {}), '(__file__)\n', (80, 90), False, 'import pathlib\n')] |
#coding: utf-8
import sys
import os
import asyncio
import websockets
import json
import socket
import xlrd
#global vars
phd_data = None
pro_data = None
def get_host_ip():
try:
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
s.connect(('192.168.127.12', 65535))
ip = s.getsockname()[0]... | [
"json.loads",
"socket.socket",
"xlrd.open_workbook",
"json.dumps",
"websockets.serve",
"asyncio.get_event_loop"
] | [((2634, 2679), 'websockets.serve', 'websockets.serve', (['main_logic', '"""0.0.0.0"""', 'port'], {}), "(main_logic, '0.0.0.0', port)\n", (2650, 2679), False, 'import websockets\n'), ((195, 243), 'socket.socket', 'socket.socket', (['socket.AF_INET', 'socket.SOCK_DGRAM'], {}), '(socket.AF_INET, socket.SOCK_DGRAM)\n', (2... |
#
# Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.
# Use of this file is governed by the BSD 3-clause license that
# can be found in the LICENSE.txt file in the project root.
#/
# A DFA walker that knows how to dump them to serialized strings.#/
from io import StringIO
from antlr4 import DFA
from antl... | [
"io.StringIO",
"antlr4.Utils.str_list"
] | [((757, 767), 'io.StringIO', 'StringIO', ([], {}), '()\n', (765, 767), False, 'from io import StringIO\n'), ((2186, 2208), 'antlr4.Utils.str_list', 'str_list', (['s.predicates'], {}), '(s.predicates)\n', (2194, 2208), False, 'from antlr4.Utils import str_list\n')] |
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
"""
Calibration Controller
Performs calibration for hue, center of camera position, and servo offsets
"""
import os
import cv2
import time
import json
import argparse
import datetime
import numpy as np
import logging as log
from env import Moa... | [
"numpy.radians",
"time.sleep",
"numpy.arctan2",
"numpy.sin",
"logging.info",
"hardware.plate_angles_to_servo_positions",
"numpy.mean",
"argparse.ArgumentParser",
"env.MoabEnv",
"numpy.linspace",
"numpy.degrees",
"numpy.abs",
"controllers.pid_controller",
"logging.warning",
"os.path.isfil... | [((3843, 3885), 'logging.warning', 'log.warning', (['f"""Offset calibration failed."""'], {}), "(f'Offset calibration failed.')\n", (3854, 3885), True, 'import logging as log\n'), ((4006, 4017), 'time.time', 'time.time', ([], {}), '()\n', (4015, 4017), False, 'import time\n'), ((4031, 4044), 'common.Vector2', 'Vector2'... |
from datetime import datetime, timedelta
from django.test import TestCase
from django.test.utils import override_settings
from marketing.tasks import (
delete_multiple_contacts_tasks,
list_all_bounces_unsubscribes,
run_all_campaigns,
run_campaign,
send_campaign_email_to_admin_contact,
send_sch... | [
"marketing.tasks.send_scheduled_campaigns.apply",
"marketing.tasks.send_campaign_email_to_admin_contact.apply",
"marketing.tasks.run_campaign.apply",
"marketing.tasks.run_all_campaigns.apply",
"datetime.datetime.now",
"marketing.tasks.delete_multiple_contacts_tasks.apply",
"django.test.utils.override_se... | [((468, 581), 'django.test.utils.override_settings', 'override_settings', ([], {'CELERY_EAGER_PROPAGATES_EXCEPTIONS': '(True)', 'CELERY_ALWAYS_EAGER': '(True)', 'BROKER_BACKEND': '"""memory"""'}), "(CELERY_EAGER_PROPAGATES_EXCEPTIONS=True,\n CELERY_ALWAYS_EAGER=True, BROKER_BACKEND='memory')\n", (485, 581), False, '... |
import unittest
from JorGpi.pickup.pickup import SmartPickUp,Reference,CommandLineOptions
class TestPickupIron(unittest.TestCase):
@staticmethod
def options(*args):
return CommandLineOptions(*args)
def test_iron_001(self):
_input = "test -R _VASP/Fe/noFlip -D _VASP/Fe/flip00000 -E Fe -J1 ... | [
"JorGpi.pickup.pickup.CommandLineOptions"
] | [((190, 215), 'JorGpi.pickup.pickup.CommandLineOptions', 'CommandLineOptions', (['*args'], {}), '(*args)\n', (208, 215), False, 'from JorGpi.pickup.pickup import SmartPickUp, Reference, CommandLineOptions\n')] |
# Copyright 2018 <NAME> <<EMAIL>>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in w... | [
"pydffi.FFI"
] | [((639, 651), 'pydffi.FFI', 'pydffi.FFI', ([], {}), '()\n', (649, 651), False, 'import pydffi\n')] |