code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
"""
Module containing a 'datafiles' fixture for pytest Tests.
"""
from py import path # pylint: disable=E0611
import pytest
def _copy(src, target):
"""
Copies a single entry (file, dir) named 'src' to 'target'. Softlinks are
processed properly as well.
"""
if not src.exists():
raise Valu... | [
"py.path.local"
] | [((1646, 1663), 'py.path.local', 'path.local', (['entry'], {}), '(entry)\n', (1656, 1663), False, 'from py import path\n')] |
import argparse
import datetime
import numpy as np
import os
import optuna
import pandas as pd
import sys
import tensorflow as tf
from optuna.integration import TFKerasPruningCallback
from pathlib import Path
# global variables
DATA_SET_PATH = ""
def parse_split(split_str):
pieces = split_str.split(",")
spl... | [
"tensorflow.data.experimental.cardinality",
"tensorflow.keras.losses.MeanSquaredError",
"tensorflow.keras.callbacks.EarlyStopping",
"tensorflow.keras.layers.Dense",
"optuna.integration.TFKerasPruningCallback",
"numpy.mean",
"argparse.ArgumentParser",
"numpy.concatenate",
"numpy.abs",
"tensorflow.k... | [((1230, 1275), 'tensorflow.data.experimental.load', 'tf.data.experimental.load', (['path', 'element_spec'], {}), '(path, element_spec)\n', (1255, 1275), True, 'import tensorflow as tf\n'), ((1723, 1788), 'tensorflow.keras.Input', 'tf.keras.Input', ([], {'shape': '(None, num_twitter_features)', 'name': '"""tweets"""'})... |
#
# Autogenerated by Thrift
#
# DO NOT EDIT
# @generated
#
import typing as _typing
import folly.iobuf as _fbthrift_iobuf
from thrift.py3lite.client import (
AsyncClient as _fbthrift_py3lite_AsyncClient,
SyncClient as _fbthrift_py3lite_SyncClient,
Client as _fbthrift_py3lite_Client,
)
import thrift.py3li... | [
"thrift.py3lite.exceptions.ApplicationError"
] | [((1543, 1677), 'thrift.py3lite.exceptions.ApplicationError', '_fbthrift_py3lite_exceptions.ApplicationError', (['_fbthrift_py3lite_exceptions.ApplicationErrorType.MISSING_RESULT', '"""Empty Response"""'], {}), "(_fbthrift_py3lite_exceptions.\n ApplicationErrorType.MISSING_RESULT, 'Empty Response')\n", (1588, 1677),... |
"""
empty-values
"""
from typing import Any
from ruamel.yaml import add_representer, RoundTripDumper
from ruamel.yaml.comments import CommentedMap, CommentedSeq
from yamllint.rules.empty_values import DEFAULT, ID # noqa: F401
from yamlfix.rules.types import FormattingResult, FormattingRule
NULL_TAG = "tag:yaml.org... | [
"yamlfix.rules.types.FormattingResult",
"yamllint.rules.empty_values.DEFAULT.get",
"ruamel.yaml.add_representer"
] | [((1968, 2033), 'yamlfix.rules.types.FormattingResult', 'FormattingResult', ([], {'text': 'text', 'dumping_config': '{}', 'loading_config': '{}'}), '(text=text, dumping_config={}, loading_config={})\n', (1984, 2033), False, 'from yamlfix.rules.types import FormattingResult, FormattingRule\n'), ((2220, 2259), 'yamllint.... |
"""
project = "Protecting Patron Privacy on the Web: A Study of HTTPS and Google Analytics Implementation in Academic Library Websites"
name = "2_return_url_json.py",
version = "1.0",
author = "<NAME>",
date = "07/25/2018"
author_email = "<EMAIL>",
description = ("Step 2 of 3: Extract, transform, and load data from re... | [
"sqlite3.connect",
"urllib.parse.urlsplit"
] | [((957, 992), 'sqlite3.connect', 'sqlite3.connect', (['"""privacydb.sqlite"""'], {}), "('privacydb.sqlite')\n", (972, 992), False, 'import sqlite3\n'), ((1305, 1324), 'urllib.parse.urlsplit', 'urlsplit', (['urlReturn'], {}), '(urlReturn)\n', (1313, 1324), False, 'from urllib.parse import urlsplit\n')] |
from direct.directnotify import DirectNotifyGlobal
from direct.distributed.DistributedObjectUD import DistributedObjectUD
class DistributedAvatarUD(DistributedObjectUD):
notify = DirectNotifyGlobal.directNotify.newCategory('DistributedAvatarUD')
| [
"direct.directnotify.DirectNotifyGlobal.directNotify.newCategory"
] | [((184, 250), 'direct.directnotify.DirectNotifyGlobal.directNotify.newCategory', 'DirectNotifyGlobal.directNotify.newCategory', (['"""DistributedAvatarUD"""'], {}), "('DistributedAvatarUD')\n", (227, 250), False, 'from direct.directnotify import DirectNotifyGlobal\n')] |
import os
import unittest
import deepchem as dc
import numpy as np
import tensorflow as tf
from tensorflow.python.eager import context
class TestLayer(unittest.TestCase):
def test_interatomic_l2_distance(self):
N_atoms = 10
M_nbrs = 15
ndim = 20
layer = dc.models.layers.InteratomicL2Distances(
... | [
"deepchem.models.layers.SetGather.from_config",
"deepchem.models.layers.DTNNEmbedding.from_config",
"deepchem.models.layers.Highway",
"deepchem.models.layers.EdgeNetwork.from_config",
"deepchem.models.layers.SwitchedDropout.from_config",
"deepchem.models.layers.GraphConv.from_config",
"deepchem.models.l... | [((276, 362), 'deepchem.models.layers.InteratomicL2Distances', 'dc.models.layers.InteratomicL2Distances', ([], {'N_atoms': 'N_atoms', 'M_nbrs': 'M_nbrs', 'ndim': 'ndim'}), '(N_atoms=N_atoms, M_nbrs=M_nbrs,\n ndim=ndim)\n', (315, 362), True, 'import deepchem as dc\n'), ((419, 478), 'deepchem.models.layers.Interatomic... |
import numpy as np
import pandas as pd
from collections import defaultdict
import re
from bs4 import BeautifulSoup
import sys
import os
#os.environ['KERAS_BACKEND'] = 'theano'
import h5py
import csv
MAX_SEQUENCE_LENGTH = 500
MAX_NB_WORDS = 20000
EMBEDDING_DIM = 100
VALIDATION_SPLIT = 0.0
# analysis
labelpr... | [
"pandas.read_csv"
] | [((526, 592), 'pandas.read_csv', 'pd.read_csv', (['"""./save/predict_result.tsv"""'], {'sep': '"""\t"""', 'delimiter': '"""\t"""'}), "('./save/predict_result.tsv', sep='\\t', delimiter='\\t')\n", (537, 592), True, 'import pandas as pd\n')] |
# -*- coding:utf-8 -*-
# Created by Hans-Thomas on 2015-04-19.
#=============================================================================
# quickstart.py --- Quick test database setup
#=============================================================================
"""
Extremely fast Django test runner, based on the... | [
"sqlitebck.copy"
] | [((2002, 2062), 'sqlitebck.copy', 'sqlitebck.copy', (['quickstart.connection', 'connection.connection'], {}), '(quickstart.connection, connection.connection)\n', (2016, 2062), False, 'import sqlitebck\n')] |
#!/usr/bin/env python3
# prerequisite: xsel
import subprocess
import time
class Selection:
def __init__(self, intvl):
self.content = ""
self.intvl = intvl
def get_str(self):
while True:
cur = subprocess.check_output(["xsel"])
if cur == self.content:
... | [
"subprocess.check_output",
"time.sleep"
] | [((240, 273), 'subprocess.check_output', 'subprocess.check_output', (["['xsel']"], {}), "(['xsel'])\n", (263, 273), False, 'import subprocess\n'), ((327, 349), 'time.sleep', 'time.sleep', (['self.intvl'], {}), '(self.intvl)\n', (337, 349), False, 'import time\n')] |
import json
import logging
from django.conf import settings
from django.views.generic import View
from django.views.decorators.csrf import csrf_exempt
from django.utils.decorators import method_decorator
from django.http import HttpResponseBadRequest, JsonResponse
from qiwi_payments.models import Invoice as QiwiInvoic... | [
"logging.getLogger",
"json.loads",
"django.http.HttpResponseBadRequest",
"qiwi_payments.utils.generate_hmac_hash",
"django.http.JsonResponse",
"qiwi_kassa.signals.payment_received.send",
"django.utils.decorators.method_decorator",
"qiwi_payments.models.Invoice.prepare"
] | [((471, 498), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (488, 498), False, 'import logging\n'), ((1592, 1621), 'django.utils.decorators.method_decorator', 'method_decorator', (['csrf_exempt'], {}), '(csrf_exempt)\n', (1608, 1621), False, 'from django.utils.decorators import method_de... |
#!/usr/bin/python
import sys
import os
workload_dir = "../workload_list/"
workload = "homo_4x4"
# up, down, l1_miss
config = {\
('1','1','0.1'),\
('1','1','0.2'),\
('1','1','0.3'),\
('1','1','0.4'),\
('1','1','0.5'),\
('1','1','0.6'),\
('4','4','0.1'),\
('4','4','0.2'),\
('4','4','0.3'),\
('4','4'... | [
"os.path.exists",
"os.system",
"os.makedirs"
] | [((570, 600), 'os.path.exists', 'os.path.exists', (['out_dir_design'], {}), '(out_dir_design)\n', (584, 600), False, 'import os\n'), ((607, 634), 'os.makedirs', 'os.makedirs', (['out_dir_design'], {}), '(out_dir_design)\n', (618, 634), False, 'import os\n'), ((1128, 1151), 'os.system', 'os.system', (['command_line'], {... |
from resotolib.args import get_arg_parser, ArgumentParser
from resoto_plugin_k8s import KubernetesCollectorPlugin
def test_args():
arg_parser = get_arg_parser()
KubernetesCollectorPlugin.add_args(arg_parser)
arg_parser.parse_args()
assert len(ArgumentParser.args.k8s_context) == 0
assert ArgumentPa... | [
"resotolib.args.get_arg_parser",
"resoto_plugin_k8s.KubernetesCollectorPlugin.add_args"
] | [((150, 166), 'resotolib.args.get_arg_parser', 'get_arg_parser', ([], {}), '()\n', (164, 166), False, 'from resotolib.args import get_arg_parser, ArgumentParser\n'), ((171, 217), 'resoto_plugin_k8s.KubernetesCollectorPlugin.add_args', 'KubernetesCollectorPlugin.add_args', (['arg_parser'], {}), '(arg_parser)\n', (205, 2... |
from libs.link_manager import link_manager
from model.jg import JG
from model.tstg import TSTG
from model.zstq import ZSTQ
from model.zstq_jyb import ZSTQ_JYB
from ui.page_elements.detail_page import DetailPage
from ui.page_elements.search_page import SearchPage
class Pagejg(SearchPage):
model = JG
title = "机... | [
"ui.page_elements.detail_page.DetailPage",
"libs.link_manager.link_manager.activate",
"libs.page_magager.PageManager.get_page",
"model.jg.JG.staff_names.keys"
] | [((555, 583), 'libs.page_magager.PageManager.get_page', 'PageManager.get_page', (['"""jgxq"""'], {}), "('jgxq')\n", (575, 583), False, 'from libs.page_magager import PageManager\n'), ((787, 822), 'libs.link_manager.link_manager.activate', 'link_manager.activate', (['"""#goto:jgxq"""'], {}), "('#goto:jgxq')\n", (808, 82... |
import math
import functools
import torch
import torch.nn as nn
import torch.nn.functional as F
from . import block as B
def pa_upconv_block(
nf, unf, kernel_size=3, stride=1, padding=1, mode='nearest',
upscale_factor=2, act_type='lrelu'):
upsample = B.Upsample(scale_factor=upscale_factor, mode=... | [
"torch.nn.Sigmoid",
"torch.mul",
"torch.nn.LeakyReLU",
"torch.nn.Conv2d",
"math.log",
"functools.partial",
"torch.nn.functional.interpolate",
"torch.cat"
] | [((339, 398), 'torch.nn.Conv2d', 'nn.Conv2d', (['nf', 'unf', 'kernel_size', 'stride', 'padding'], {'bias': '(True)'}), '(nf, unf, kernel_size, stride, padding, bias=True)\n', (348, 398), True, 'import torch.nn as nn\n'), ((430, 490), 'torch.nn.Conv2d', 'nn.Conv2d', (['unf', 'unf', 'kernel_size', 'stride', 'padding'], {... |
# -*- coding=utf-8 -*-
from __future__ import absolute_import, unicode_literals
import argparse
import os
import sys
from .options import project
class BaseCommand(object):
"""A CLI command.
"""
name = None
description = None
default_arguments = [project]
arguments = []
def __init__(se... | [
"os.path.basename",
"sys.exit"
] | [((1061, 1077), 'sys.exit', 'sys.exit', (['result'], {}), '(result)\n', (1069, 1077), False, 'import sys\n'), ((428, 457), 'os.path.basename', 'os.path.basename', (['sys.argv[0]'], {}), '(sys.argv[0])\n', (444, 457), False, 'import os\n')] |
from collections import Iterable
from typing import Union, List, Tuple
import numpy as np
from functools import partial
from scipy import ndimage as ndi
import cv2
import random
from .utils import clipBBoxes
from .base import AugBase
# -------------- channel aug_cuda --------------- #
class RGB2Gray(AugBase):
d... | [
"numpy.clip",
"numpy.random.rand",
"numpy.array",
"scipy.ndimage.gaussian_filter",
"numpy.moveaxis",
"numpy.arange",
"numpy.mean",
"numpy.repeat",
"numpy.where",
"numpy.max",
"numpy.exp",
"numpy.stack",
"numpy.concatenate",
"numpy.min",
"numpy.meshgrid",
"numpy.floor",
"numpy.std",
... | [((13049, 13069), 'numpy.zeros_like', 'np.zeros_like', (['image'], {}), '(image)\n', (13062, 13069), True, 'import numpy as np\n'), ((17227, 17269), 'numpy.random.rand', 'np.random.rand', (['num_spikes_param', 'self.dim'], {}), '(num_spikes_param, self.dim)\n', (17241, 17269), True, 'import numpy as np\n'), ((18967, 19... |
import socketserver
p = 16039569229106620464524040800514429884124257515719815158247901984500687314230772373740952557793458300386707034523591862955887078885248615279630352356782248342739234012971726335390927874256196523321658767535081694857260019127316912317430419938467439526443514390709889089398059121111652224038200847... | [
"socketserver.TCPServer"
] | [((1345, 1395), 'socketserver.TCPServer', 'socketserver.TCPServer', (['(HOST, PORT)', 'MyTCPHandler'], {}), '((HOST, PORT), MyTCPHandler)\n', (1367, 1395), False, 'import socketserver\n')] |
# ---------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# ---------------------------------------------------------
from azureml._cli.workspace.workspace_subgroup import WorkspaceSubGroup
from azureml._cli.cli_command import command
from azureml._cl... | [
"azureml.core.private_endpoint.PrivateEndPointConfig",
"azureml.core.workspace.Workspace.list",
"azureml._base_sdk_common.cli_wrapper._common.get_default_subscription_id",
"azureml._cli.cli_command.command",
"azureml._base_sdk_common.cli_wrapper._common.get_cli_specific_auth",
"azureml._cli.argument.Argum... | [((4011, 4142), 'azureml._cli.argument.Argument', 'argument.Argument', (['"""no_wait"""', '"""--no-wait"""', '""""""'], {'action': '"""store_true"""', 'help': '"""Do not wait for the workspace deletion to complete."""'}), "('no_wait', '--no-wait', '', action='store_true', help=\n 'Do not wait for the workspace delet... |
#!/usr/bin/env python3
"""
File: isc_clause_managed_keys.py
Clause: managed-keys
Title: Clause statement for managed keys
Description: Provides managed-key-related grammar in
PyParsing engine for ISC-configuration style
"""
from pyparsing import Optional, OneOrMore, ZeroOrMore
from bind9_parser.isc_man... | [
"pyparsing.ZeroOrMore"
] | [((729, 774), 'pyparsing.ZeroOrMore', 'ZeroOrMore', (['managed_keys_statement_standalone'], {}), '(managed_keys_statement_standalone)\n', (739, 774), False, 'from pyparsing import Optional, OneOrMore, ZeroOrMore\n')] |
import os
import math
import numpy as np
import pandas as pd
#source_directory is where the original unzipped files like PRM**** are.
#destination_directory is where the outputs like PRM****_reduced are.
def auto_part_one(source_directory,destination_directory,selected_cols,energy_cols,first_cols,second_cols):
#fo... | [
"pandas.isnull",
"os.path.exists",
"os.listdir",
"pandas.read_csv",
"os.path.join",
"os.path.isdir",
"os.mkdir",
"pandas.DataFrame",
"pandas.concat"
] | [((3204, 3226), 'pandas.isnull', 'pd.isnull', (['cols_to_add'], {}), '(cols_to_add)\n', (3213, 3226), True, 'import pandas as pd\n'), ((350, 378), 'os.listdir', 'os.listdir', (['source_directory'], {}), '(source_directory)\n', (360, 378), False, 'import os\n'), ((3147, 3192), 'pandas.read_csv', 'pd.read_csv', (['"""./c... |
## ========================================================================== ##
## Copyright (c) 2019 The University of Texas at Austin. ##
## All rights reserved. ##
## ... | [
"numpy.random.normal",
"numpy.abs",
"numpy.random.rand",
"vtk.vtkIdList",
"vtk.reference",
"vtk.vtkGenericCell",
"vtk.vtkCellArray",
"numpy.max",
"numpy.array",
"vtk.vtkCellTreeLocator",
"numpy.random.seed",
"numpy.min"
] | [((5405, 5426), 'numpy.random.seed', 'np.random.seed', (['(12346)'], {}), '(12346)\n', (5419, 5426), True, 'import numpy as np\n'), ((5753, 5788), 'numpy.max', 'np.max', (['volume.PointData[arrayName]'], {}), '(volume.PointData[arrayName])\n', (5759, 5788), True, 'import numpy as np\n'), ((2417, 2440), 'vtk.reference',... |
import uvicorn
from models import database, Tokens, TextCommands
from fastapi import FastAPI, Request
SUCCESS = {"status": "success"}
FAILURE = {"status": "failure"}
PLATFORMS = ["twitch", "youtube"]
app = FastAPI()
database.create_tables([Tokens, TextCommands])
@app.get("/")
async def main():
return "Running!"
... | [
"fastapi.FastAPI",
"models.TextCommands.select",
"uvicorn.run",
"models.TextCommands.delete",
"models.database.create_tables",
"models.Tokens.insert",
"models.TextCommands.insert",
"models.TextCommands.update",
"models.Tokens.select",
"models.TextCommands.get"
] | [((208, 217), 'fastapi.FastAPI', 'FastAPI', ([], {}), '()\n', (215, 217), False, 'from fastapi import FastAPI, Request\n'), ((218, 264), 'models.database.create_tables', 'database.create_tables', (['[Tokens, TextCommands]'], {}), '([Tokens, TextCommands])\n', (240, 264), False, 'from models import database, Tokens, Tex... |
import argparse
import os
import subprocess
from urllib.parse import urlparse
from jinja2 import Environment, FileSystemLoader
from PIL import Image
from markdown import markdown
import requests
from slugify import slugify
import xmltodict
import logging
import logging
log_format = "%(message)s"
logging.basicConfig... | [
"logging.basicConfig",
"logging.getLogger",
"markdown.markdown",
"os.path.exists",
"PIL.Image.open",
"jinja2.Environment",
"argparse.ArgumentParser",
"xmltodict.parse",
"os.makedirs",
"urllib.parse.urlparse",
"os.path.join",
"requests.get",
"os.getcwd",
"subprocess.call",
"os.path.basena... | [((301, 359), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.INFO', 'format': 'log_format'}), '(level=logging.INFO, format=log_format)\n', (320, 359), False, 'import logging\n'), ((369, 396), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (386, 396), False, 'import ... |
# Copyright 2019-2020 <NAME>
#
# 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 writing, sof... | [
"hashlib.sha256",
"pickle.dump",
"pickle.load",
"os.path.dirname",
"threading.Thread"
] | [((930, 946), 'hashlib.sha256', 'hashlib.sha256', ([], {}), '()\n', (944, 946), False, 'import hashlib\n'), ((1892, 1984), 'threading.Thread', 'threading.Thread', ([], {'target': 'self.run', 'name': 'self.Callable.__name__', 'args': 'args', 'kwargs': 'kwargs'}), '(target=self.run, name=self.Callable.__name__, args=args... |
import requests, json
import numpy as np
from ftplib import FTP
from osgeo import ogr
from osgeo import osr
import os.path
import zipfile
import time
from math import floor, ceil, atan2, pi, sqrt
import pickle
import simplekml
from osgeo import gdal
import urllib.request
def loadMapsWCS(bbox, dim, mapTyp... | [
"osgeo.gdal.Open",
"zipfile.ZipFile",
"math.floor",
"math.sqrt",
"time.sleep",
"osgeo.osr.CoordinateTransformation",
"ftplib.FTP",
"numpy.linspace",
"json.loads",
"osgeo.ogr.Geometry",
"pickle.load",
"requests.get",
"numpy.cos",
"numpy.transpose",
"time.time",
"math.ceil",
"osgeo.osr... | [((1140, 1158), 'osgeo.gdal.Open', 'gdal.Open', (['mapFile'], {}), '(mapFile)\n', (1149, 1158), False, 'from osgeo import gdal\n'), ((2462, 2484), 'osgeo.osr.SpatialReference', 'osr.SpatialReference', ([], {}), '()\n', (2482, 2484), False, 'from osgeo import osr\n'), ((2572, 2594), 'osgeo.osr.SpatialReference', 'osr.Sp... |
import pycurl
import os
namespacename = "namespace_name.tenantname.hcpname.domain.com"
access_token = "tokenid"
curl = pycurl.Curl()
curl.setopt(pycurl.URL, "http://" + namespacename + "/rest/")
curl.setopt(pycurl.HTTPHEADER, ["Authorization: HCP " + access_token ])
curl.setopt(pycurl.SSL_VERIFYPEER, 0)
curl.setopt(p... | [
"pycurl.Curl"
] | [((121, 134), 'pycurl.Curl', 'pycurl.Curl', ([], {}), '()\n', (132, 134), False, 'import pycurl\n')] |
from enigma import eConsoleAppContainer
from Screens.Screen import Screen
from Screens.MessageBox import MessageBox
from Screens.ChoiceBox import ChoiceBox
from Screens.InputBox import InputBox
from Tools.Log import Log
from Plugins.Plugin import PluginDescriptor
import string
from random import Random
class Chan... | [
"random.Random",
"enigma.eConsoleAppContainer",
"Tools.Log.Log.w"
] | [((1110, 1132), 'enigma.eConsoleAppContainer', 'eConsoleAppContainer', ([], {}), '()\n', (1130, 1132), False, 'from enigma import eConsoleAppContainer\n'), ((1284, 1299), 'Tools.Log.Log.w', 'Log.w', (['selected'], {}), '(selected)\n', (1289, 1299), False, 'from Tools.Log import Log\n'), ((1830, 1879), 'Tools.Log.Log.w'... |
"""Test setae count trait matcher."""
import unittest
from tests.setup import test_traits
class TestSetaeCount(unittest.TestCase):
"""Test setae count trait matcher."""
def test_setae_count_01(self):
self.assertEqual(
test_traits('One long Dorsal Principal Head Seta (DPHS)'),
... | [
"tests.setup.test_traits"
] | [((251, 308), 'tests.setup.test_traits', 'test_traits', (['"""One long Dorsal Principal Head Seta (DPHS)"""'], {}), "('One long Dorsal Principal Head Seta (DPHS)')\n", (262, 308), False, 'from tests.setup import test_traits\n'), ((554, 605), 'tests.setup.test_traits', 'test_traits', (['"""no Dorsal Mesothoracic Setae (... |
import json
import os
import requests
from django.utils import translation
from django.http import HttpResponse
from django.contrib.auth.views import PasswordChangeView
from django.views.generic import FormView, DetailView, UpdateView
from django.urls import reverse_lazy, reverse
from django.shortcuts import redirect
f... | [
"django.contrib.auth.authenticate",
"requests.post",
"django.core.files.base.ContentFile",
"django.urls.reverse",
"django.http.HttpResponse",
"django.contrib.messages.error",
"os.path.join",
"django.contrib.auth.login",
"django.contrib.messages.info",
"requests.get",
"django.contrib.messages.suc... | [((701, 726), 'os.path.dirname', 'os.path.dirname', (['BASE_DIR'], {}), '(BASE_DIR)\n', (716, 726), False, 'import os\n'), ((1601, 1641), 'django.contrib.messages.info', 'messages.info', (['request', 'f"""See you later"""'], {}), "(request, f'See you later')\n", (1614, 1641), False, 'from django.contrib import messages... |
#!/usr/bin/env python
import paths
paths.add_modules_to_path()
import unittest
import os
import shutil
from behavior_tree_learning.core.logger import logplot
class TestStringBehaviorTreeForPyTree(unittest.TestCase):
OUTPUT_DIR = 'logs'
def test_trim_logs(self):
logs = []
logs.append([... | [
"behavior_tree_learning.core.logger.logplot.plot_fitness",
"behavior_tree_learning.core.logger.logplot.PlotParameters",
"behavior_tree_learning.core.logger.logplot.plot_learning_curves",
"paths.add_modules_to_path",
"os.path.isfile",
"behavior_tree_learning.core.logger.logplot.clear_logs",
"behavior_tre... | [((36, 63), 'paths.add_modules_to_path', 'paths.add_modules_to_path', ([], {}), '()\n', (61, 63), False, 'import paths\n'), ((3242, 3257), 'unittest.main', 'unittest.main', ([], {}), '()\n', (3255, 3257), False, 'import unittest\n'), ((410, 433), 'behavior_tree_learning.core.logger.logplot.trim_logs', 'logplot.trim_log... |
# Copyright (c) 2020 zfit
# noinspection PyUnresolvedReferences
from zfit.core.testing import setup_function, teardown_function, tester
# deactivating CUDA capable gpus
from zfit.z.tools import _auto_upcast
suppress_gpu = False
if suppress_gpu:
import os
os.environ["CUDA_DEVICE_ORDER"] = "PCI_BUS_ID" # see... | [
"pytest.approx",
"tensorflow.constant",
"numpy.polyval"
] | [((572, 588), 'tensorflow.constant', 'tf.constant', (['(5.0)'], {}), '(5.0)\n', (583, 588), True, 'import tensorflow as tf\n'), ((698, 727), 'numpy.polyval', 'np.polyval', (['coeffs[::-1]', '(5.0)'], {}), '(coeffs[::-1], 5.0)\n', (708, 727), True, 'import numpy as np\n'), ((781, 816), 'pytest.approx', 'pytest.approx', ... |
# Lint as: python3
# Copyright 2020 DeepMind Technologies Limited. 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
#
# U... | [
"dm_alchemy.types.stones_and_potions.unalign",
"random.sample",
"numpy.where",
"dm_alchemy.types.utils.TypeBasedAction",
"collections.Counter",
"numpy.array",
"itertools.chain.from_iterable",
"dm_alchemy.types.graphs.Node",
"copy.deepcopy",
"numpy.full"
] | [((2362, 2395), 'copy.deepcopy', 'copy.deepcopy', (['trial_items.stones'], {}), '(trial_items.stones)\n', (2375, 2395), False, 'import copy\n'), ((2568, 2602), 'copy.deepcopy', 'copy.deepcopy', (['trial_items.potions'], {}), '(trial_items.potions)\n', (2581, 2602), False, 'import copy\n'), ((11844, 11901), 'collections... |
# Begin: Python 2/3 compatibility header small
# Get Python 3 functionality:
from __future__ import\
absolute_import, print_function, division, unicode_literals
from future.utils import raise_with_traceback, raise_from
# catch exception with: except Exception as e
from builtins import range, map, zip, filter
from i... | [
"numpy.random.rand"
] | [((1603, 1649), 'numpy.random.rand', 'np.random.rand', (['(1)', "*network['input_shape'][1:]"], {}), "(1, *network['input_shape'][1:])\n", (1617, 1649), True, 'import numpy as np\n'), ((2228, 2275), 'numpy.random.rand', 'np.random.rand', (['(10)', "*network['input_shape'][1:]"], {}), "(10, *network['input_shape'][1:])\... |
import logging
from ibmsecurity.utilities import tools
logger = logging.getLogger(__name__)
# "uri" variable already used so using a different name
module_uri = "/iam/access/v8/authentication/policies"
requires_modules = ["mga"]
requires_version = None
def get_all(isamAppliance, start=None, count=None, filter=None,... | [
"logging.getLogger",
"ibmsecurity.utilities.tools.create_query_string"
] | [((65, 92), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (82, 92), False, 'import logging\n'), ((639, 725), 'ibmsecurity.utilities.tools.create_query_string', 'tools.create_query_string', ([], {'start': 'start', 'count': 'count', 'filter': 'filter', 'sortBy': 'sortBy'}), '(start=start, ... |
import gc
import time
from datetime import datetime
from typing import Dict, Any, Optional
from bxcommon import constants
from bxcommon.utils.stats.node_statistics_service import node_stats_service
from bxutils import logging
from bxutils.logging import LogRecordType
logger = logging.get_logger(LogRecordType.GarbageC... | [
"gc.get_count",
"time.time",
"bxcommon.utils.stats.node_statistics_service.node_stats_service.log_gc_duration",
"bxutils.logging.get_logger"
] | [((279, 330), 'bxutils.logging.get_logger', 'logging.get_logger', (['LogRecordType.GarbageCollection'], {}), '(LogRecordType.GarbageCollection)\n', (297, 330), False, 'from bxutils import logging\n'), ((571, 582), 'time.time', 'time.time', ([], {}), '()\n', (580, 582), False, 'import time\n'), ((834, 848), 'gc.get_coun... |
from django.utils import timezone
from django.shortcuts import get_object_or_404
from rest_framework import status, viewsets
from rest_framework.response import Response
from rest_framework.permissions import IsAuthenticated
from drf_yasg.utils import swagger_auto_schema
from .serializers import CreateReservationSeri... | [
"django.utils.timezone.now",
"rest_framework.response.Response",
"django.shortcuts.get_object_or_404",
"drf_yasg.utils.swagger_auto_schema"
] | [((927, 994), 'drf_yasg.utils.swagger_auto_schema', 'swagger_auto_schema', ([], {'responses': '{(200): MemberReservationSerializer}'}), '(responses={(200): MemberReservationSerializer})\n', (946, 994), False, 'from drf_yasg.utils import swagger_auto_schema\n'), ((1435, 1549), 'drf_yasg.utils.swagger_auto_schema', 'swag... |
# Importing Stuff
from selenium import webdriver
from selenium.common.exceptions import TimeoutException
from selenium.webdriver.support.ui import Select
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By
f... | [
"selenium.webdriver.chrome.options.Options",
"os.listdir",
"sys.exit",
"PIL.Image.open",
"selenium.webdriver.support.ui.WebDriverWait",
"pathlib.Path",
"selenium.webdriver.Chrome",
"os.environ.get",
"requests.get",
"os.chdir",
"selenium.webdriver.support.expected_conditions.presence_of_element_l... | [((1139, 1169), 'os.environ.get', 'os.environ.get', (['"""chromedriver"""'], {}), "('chromedriver')\n", (1153, 1169), False, 'import os\n'), ((1180, 1189), 'selenium.webdriver.chrome.options.Options', 'Options', ([], {}), '()\n', (1187, 1189), False, 'from selenium.webdriver.chrome.options import Options\n'), ((903, 93... |
# -*- coding: utf-8 -*-
"""
MIT License
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 without restriction, including without limitation the rights
to use, copy, modify,... | [
"numpy.abs",
"numpy.sqrt",
"numpy.array",
"numpy.zeros",
"numpy.matmul",
"numpy.argmin",
"numpy.linalg.svd"
] | [((1542, 1580), 'numpy.zeros', 'np.zeros', (['(2 * N, 9)'], {'dtype': 'np.float64'}), '((2 * N, 9), dtype=np.float64)\n', (1550, 1580), True, 'import numpy as np\n'), ((2053, 2069), 'numpy.linalg.svd', 'np.linalg.svd', (['M'], {}), '(M)\n', (2066, 2069), True, 'import numpy as np\n'), ((2624, 2655), 'numpy.sqrt', 'np.s... |
import unittest.mock as mock
from mlagentsdev.trainers import TrainerMetrics
class TestTrainerMetrics:
def test_field_names(self):
field_names = ['Brain name', 'Time to update policy',
'Time since start of training',
'Time for last experience collection',
... | [
"unittest.mock.MagicMock",
"mlagentsdev.trainers.TrainerMetrics"
] | [((737, 795), 'mlagentsdev.trainers.TrainerMetrics', 'TrainerMetrics', ([], {'path': 'mock_path', 'brain_name': 'mock_brain_name'}), '(path=mock_path, brain_name=mock_brain_name)\n', (751, 795), False, 'from mlagentsdev.trainers import TrainerMetrics\n'), ((570, 601), 'unittest.mock.MagicMock', 'mock.MagicMock', ([], {... |
from collections import deque
from .types import is_seqcont
__all__ = ['tree_leaves', 'ltree_leaves', 'tree_nodes', 'ltree_nodes']
def tree_leaves(root, follow=is_seqcont, children=iter):
"""Iterates over tree leaves."""
q = deque([[root]])
while q:
node_iter = iter(q.pop())
for sub in n... | [
"collections.deque"
] | [((237, 252), 'collections.deque', 'deque', (['[[root]]'], {}), '([[root]])\n', (242, 252), False, 'from collections import deque\n'), ((747, 762), 'collections.deque', 'deque', (['[[root]]'], {}), '([[root]])\n', (752, 762), False, 'from collections import deque\n')] |
"""
Moves data processing.
Copyright (C) 2016 PersonalGenomes.org
This software is shared under the "MIT License" license (aka "Expat License"),
see LICENSE.TXT for full license text.
May be used on the command line from this project's base directory, e.g.
foreman run python -m sources.moves <access token> files... | [
"datetime.datetime.utcnow",
"utilities.init_db",
"os.path.join",
"models.CacheItem",
"requests.get",
"time.sleep",
"models.CacheItem.request_time.desc",
"datetime.date",
"models.CacheItem.query.filter_by",
"json.dump",
"models.db.session.commit"
] | [((829, 838), 'utilities.init_db', 'init_db', ([], {}), '()\n', (836, 838), False, 'from utilities import init_db\n'), ((2108, 2147), 'requests.get', 'requests.get', (['data_url'], {'headers': 'headers'}), '(data_url, headers=headers)\n', (2120, 2147), False, 'import requests\n'), ((2501, 2520), 'models.db.session.comm... |
# Copyright 2022 The Pigweed 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | [
"prompt_toolkit.layout.FormattedTextControl",
"prompt_toolkit.layout.Window",
"prompt_toolkit.layout.HSplit",
"prompt_toolkit.layout.VSplit"
] | [((3830, 3860), 'prompt_toolkit.layout.HSplit', 'HSplit', (['rows'], {'style': 'base_style'}), '(rows, style=base_style)\n', (3836, 3860), False, 'from prompt_toolkit.layout import AnyContainer, FormattedTextControl, HSplit, VSplit, Window\n'), ((1738, 1814), 'prompt_toolkit.layout.FormattedTextControl', 'FormattedText... |
from wpilib.command import Command
import robotmap
import subsystems
import oi
class TankLiftTeleopDefault(Command):
def __init__(self):
super().__init__('TankLiftTeleopDefault')
self.requires(subsystems.drivelift)
self.setInterruptible(True)
self.setRunWhenDisabled... | [
"subsystems.drivelift.backIRToBool",
"subsystems.drivelift.frontIRToBool"
] | [((872, 907), 'subsystems.drivelift.backIRToBool', 'subsystems.drivelift.backIRToBool', ([], {}), '()\n', (905, 907), False, 'import subsystems\n'), ((916, 952), 'subsystems.drivelift.frontIRToBool', 'subsystems.drivelift.frontIRToBool', ([], {}), '()\n', (950, 952), False, 'import subsystems\n')] |
'''
Copyright 2016, EMC, Inc.
Author(s):
<NAME>
'''
import fit_path # NOQA: unused import
import os
import sys
import subprocess
import fit_common
# Select test group here using @attr
from nose.plugins.attrib import attr
@attr(all=True, regression=True, smoke=True)
class rackhd20_api_schemas(fit_common.unittest.Te... | [
"fit_common.unittest.main",
"fit_common.rackhdapi",
"nose.plugins.attrib.attr"
] | [((227, 270), 'nose.plugins.attrib.attr', 'attr', ([], {'all': '(True)', 'regression': '(True)', 'smoke': '(True)'}), '(all=True, regression=True, smoke=True)\n', (231, 270), False, 'from nose.plugins.attrib import attr\n'), ((769, 795), 'fit_common.unittest.main', 'fit_common.unittest.main', ([], {}), '()\n', (793, 79... |
import unittest
from checkov.common.models.enums import CheckResult
from checkov.terraform.checks.resource.aws.MSKClusterEncryption import check
class TestMSKClusterEncryption(unittest.TestCase):
def test_failure(self):
resource_conf = {
"name": "test-project",
}
scan_result ... | [
"unittest.main",
"checkov.terraform.checks.resource.aws.MSKClusterEncryption.check.scan_resource_conf"
] | [((3804, 3819), 'unittest.main', 'unittest.main', ([], {}), '()\n', (3817, 3819), False, 'import unittest\n'), ((322, 366), 'checkov.terraform.checks.resource.aws.MSKClusterEncryption.check.scan_resource_conf', 'check.scan_resource_conf', ([], {'conf': 'resource_conf'}), '(conf=resource_conf)\n', (346, 366), False, 'fr... |
from rest_framework.views import APIView
from rest_framework import status
from rest_framework.response import Response
from django.shortcuts import render
from .serializers import SchemaSerializer
from .utils import (
dynamic_random_data,
DynamicFieldName,
FieldName, query_random_data,
verbose_to_enum,... | [
"django.shortcuts.render",
"rest_framework.response.Response"
] | [((417, 457), 'django.shortcuts.render', 'render', (['request', '"""static/index.html"""', '{}'], {}), "(request, 'static/index.html', {})\n", (423, 457), False, 'from django.shortcuts import render\n'), ((2397, 2490), 'rest_framework.response.Response', 'Response', ([], {'data': '"""Please use POST HTTP method instead... |
#!/usr/bin/env python
import sys
import optparse
def get_intersection(fwd, rev):
s1, s1_dict = set_dict(fwd)
s2, s2_dict = set_dict(rev)
s1_s2 = s1.intersection(s2)
return s1_s2, s1_dict, s2_dict
def set_dict(inf):
s = set([])
identifier = ''
s_dict = {}
seq = ''
parser = ParseF... | [
"optparse.OptionParser"
] | [((3564, 3598), 'optparse.OptionParser', 'optparse.OptionParser', ([], {'usage': 'usage'}), '(usage=usage)\n', (3585, 3598), False, 'import optparse\n')] |
import string
def decode(digits, base):
"""Decode given digits in given base to number in base 10.
digits: str -- string representation of number (in given base)
base: int -- base of given number
return: int -- integer representation of number (in base 10)"""
# Handle up to base 36 [0-9a-z]
ass... | [
"string.printable.index"
] | [((684, 709), 'string.printable.index', 'string.printable.index', (['i'], {}), '(i)\n', (706, 709), False, 'import string\n')] |
from gtracr.lib.location import Location
'''
Creates the dictionary that contains the latitude, longitude, and altitude
of different locations, and exports them as a .pkl file for other files
to use.
'''
import os
import sys
import numpy
import pickle
import argparse
CURRENT_DIR = os.path.dirname(os.path.realpath(__f... | [
"gtracr.lib.location.Location",
"os.path.exists",
"pickle.dump",
"argparse.ArgumentParser",
"os.path.join",
"pickle.load",
"os.path.realpath",
"os.path.dirname"
] | [((341, 369), 'os.path.dirname', 'os.path.dirname', (['CURRENT_DIR'], {}), '(CURRENT_DIR)\n', (356, 369), False, 'import os\n'), ((413, 445), 'os.path.join', 'os.path.join', (['PARENT_DIR', '"""data"""'], {}), "(PARENT_DIR, 'data')\n", (425, 445), False, 'import os\n'), ((492, 525), 'os.path.join', 'os.path.join', (['D... |
"""
Django settings for Simple_PF project.
Generated by 'django-admin startproject' using Django 2.0.7.
For more information on this file, see
https://docs.djangoproject.com/en/2.0/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.0/ref/settings/
"""
import os
... | [
"os.path.abspath",
"decouple.config",
"os.path.join",
"decouple.Csv"
] | [((716, 765), 'decouple.config', 'config', (['"""SECRET_KEY"""'], {'default': '"""django_SECRET_KEY"""'}), "('SECRET_KEY', default='django_SECRET_KEY')\n", (722, 765), False, 'from decouple import config, Csv\n'), ((841, 882), 'decouple.config', 'config', (['"""DEBUG"""'], {'default': '(False)', 'cast': 'bool'}), "('DE... |
import csv
import os
import pcbnew
import re
import wx
from decimal import Decimal, getcontext
from pathlib import Path
ref_ignore = ["TP", "T", "NT", "REF**", "G", "H"]
# original rotation db from:
# https://github.com/matthewlai/JLCKicadTools/blob/master/jlc_kicad_tools/cpl_rotations_db.csv
rotations = {
"^SOT-... | [
"pcbnew.GetBoard",
"decimal.getcontext",
"csv.writer",
"re.match",
"os.path.dirname",
"wx.MessageBox",
"decimal.Decimal"
] | [((1772, 1782), 'decimal.Decimal', 'Decimal', (['(3)'], {}), '(3)\n', (1779, 1782), False, 'from decimal import Decimal, getcontext\n'), ((1096, 1106), 'decimal.Decimal', 'Decimal', (['(0)'], {}), '(0)\n', (1103, 1106), False, 'from decimal import Decimal, getcontext\n'), ((1108, 1122), 'decimal.Decimal', 'Decimal', ([... |
import mcts
from mcts import UCB, MCTS, TimeBudget
import math
import random
import os
import argparse
class TwentyOneReward(mcts.Reward):
def __init__(self, reward, player_id):
self.reward = reward
self.player_id = player_id
def apply(self, node):
if self.player_id == node.state.play... | [
"os.linesep.join",
"mcts.UCB",
"argparse.ArgumentParser",
"mcts.TimeBudget",
"mcts.MCTS"
] | [((2209, 2228), 'os.linesep.join', 'os.linesep.join', (['ys'], {}), '(ys)\n', (2224, 2228), False, 'import os\n'), ((2754, 2813), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""21 game with MCTS AI"""'}), "(description='21 game with MCTS AI')\n", (2777, 2813), False, 'import argparse\n')... |
"""Unit tests for modified Helmholtz operators."""
# pylint: disable=redefined-outer-name
# pylint: disable=C0103
import numpy as _np
import pytest
pytestmark = pytest.mark.usefixtures("default_parameters", "helpers")
def test_maxwell_electric_field_sphere(
default_parameters, helpers, device_interface, precis... | [
"numpy.testing.assert_allclose",
"bempp.api.operators.boundary.maxwell.electric_field",
"bempp.api.operators.boundary.maxwell.magnetic_field",
"pytest.mark.usefixtures",
"bempp.api.function_space",
"pytest.skip",
"numpy.random.RandomState"
] | [((164, 220), 'pytest.mark.usefixtures', 'pytest.mark.usefixtures', (['"""default_parameters"""', '"""helpers"""'], {}), "('default_parameters', 'helpers')\n", (187, 220), False, 'import pytest\n'), ((539, 569), 'bempp.api.function_space', 'function_space', (['grid', '"""RWG"""', '(0)'], {}), "(grid, 'RWG', 0)\n", (553... |
"""Utility functions for printing version information.
The original script is from
`xarray <https://github.com/pydata/xarray/blob/master/xarray/util/print_versions.py>`__
"""
import importlib
import locale
import os
import platform
import struct
import subprocess
import sys
def get_sys_info():
"""Return system i... | [
"subprocess.check_output",
"struct.calcsize",
"importlib.import_module",
"os.environ.get",
"platform.uname",
"locale.getlocale"
] | [((1181, 1197), 'platform.uname', 'platform.uname', ([], {}), '()\n', (1195, 1197), False, 'import platform\n'), ((797, 860), 'subprocess.check_output', 'subprocess.check_output', (['cmd'], {'stderr': 'subprocess.STDOUT', 'env': 'env'}), '(cmd, stderr=subprocess.STDOUT, env=env)\n', (820, 860), False, 'import subproces... |
import requests
import os
import ast
import random
# --------------- Helpers that build all of the responses ----------------------
def build_speechlet_response(title, output, reprompt_text, should_end_session):
return {
'outputSpeech': {
'type': 'PlainText',
'text': output
... | [
"ast.literal_eval",
"requests.get"
] | [((3645, 3679), 'requests.get', 'requests.get', (['url'], {'headers': 'headers'}), '(url, headers=headers)\n', (3657, 3679), False, 'import requests\n'), ((4597, 4631), 'requests.get', 'requests.get', (['url'], {'headers': 'headers'}), '(url, headers=headers)\n', (4609, 4631), False, 'import requests\n'), ((5551, 5585)... |
import unittest
from typing import List
from nayvy.importing.import_statement import (
ImportAsPart,
SingleImport,
ImportStatement
)
class TestImportAsPart(unittest.TestCase):
def test_of(self) -> None:
# named import
res = ImportAsPart.of('tensorflow as tf')
assert res is no... | [
"nayvy.importing.import_statement.ImportAsPart",
"nayvy.importing.import_statement.ImportStatement.of",
"nayvy.importing.import_statement.ImportAsPart.of",
"nayvy.importing.import_statement.ImportStatement.merge_list",
"nayvy.importing.import_statement.ImportStatement.of_lines",
"nayvy.importing.import_st... | [((260, 295), 'nayvy.importing.import_statement.ImportAsPart.of', 'ImportAsPart.of', (['"""tensorflow as tf"""'], {}), "('tensorflow as tf')\n", (275, 295), False, 'from nayvy.importing.import_statement import ImportAsPart, SingleImport, ImportStatement\n'), ((451, 473), 'nayvy.importing.import_statement.ImportAsPart.o... |
from flair.trainers import ModelTrainer
from flair.models import SequenceTagger
from typing import List
import flair.datasets
from flair.data import Corpus
from flair.embeddings import TokenEmbeddings, WordEmbeddings, StackedEmbeddings, FlairEmbeddings, CharacterEmbeddings
from flair.training_utils import EvaluationMe... | [
"flair.trainers.ModelTrainer",
"flair.embeddings.WordEmbeddings",
"flair.embeddings.StackedEmbeddings",
"flair.visual.training_curves.Plotter",
"flair.models.SequenceTagger"
] | [((594, 639), 'flair.embeddings.StackedEmbeddings', 'StackedEmbeddings', ([], {'embeddings': 'embedding_types'}), '(embeddings=embedding_types)\n', (611, 639), False, 'from flair.embeddings import TokenEmbeddings, WordEmbeddings, StackedEmbeddings, FlairEmbeddings, CharacterEmbeddings\n'), ((649, 772), 'flair.models.Se... |
import unittest
from selenium.webdriver import Firefox
from screenpy import Actor, given, when, then
from screenpy.abilities import BrowseTheWeb
from screenpy.pacing import act, scene
from screenpy.resolutions import *
from ..questions.search_results_message import SearchResultsMessage
from ..questions.number_of_sea... | [
"screenpy.pacing.act",
"screenpy.pacing.scene",
"selenium.webdriver.Firefox",
"screenpy.when",
"screenpy.then",
"screenpy.Actor.named",
"screenpy.given"
] | [((593, 606), 'screenpy.pacing.act', 'act', (['"""Search"""'], {}), "('Search')\n", (596, 606), False, 'from screenpy.pacing import act, scene\n'), ((612, 665), 'screenpy.pacing.scene', 'scene', (['"""Search for the ScreenPy repository on GitHub"""'], {}), "('Search for the ScreenPy repository on GitHub')\n", (617, 665... |
# edsk_double_step.py
#
# Create a double-step EDSK image by doubling up cylinders.
#
# Written & released by <NAME> <<EMAIL>>
#
# This is free and unencumbered software released into the public domain.
# See the file COPYING for more details, or visit <http://unlicense.org>.
import struct, sys, random
def main(arg... | [
"struct.unpack"
] | [((684, 724), 'struct.unpack', 'struct.unpack', (['"""<34s14sBBH"""', 'in_dat[:52]'], {}), "('<34s14sBBH', in_dat[:52])\n", (697, 724), False, 'import struct, sys, random\n')] |
from boxnotes2html.table import Table
class TestTable:
def test_render_markdown(self):
table = Table()
table.add_data(1, 1, "Name")
table.add_data(1, 2, "Country")
table.add_data(1, 3, "Birthdate")
table.add_data(2, 1, "Jill")
table.add_data(2, 2, "Aus... | [
"boxnotes2html.table.Table"
] | [((114, 121), 'boxnotes2html.table.Table', 'Table', ([], {}), '()\n', (119, 121), False, 'from boxnotes2html.table import Table\n'), ((958, 965), 'boxnotes2html.table.Table', 'Table', ([], {}), '()\n', (963, 965), False, 'from boxnotes2html.table import Table\n')] |
import sys
import typing
from pathlib import Path
import numpy as np
import pandas as pd
import mpmp.config as cfg
import mpmp.utilities.data_utilities as du
from mpmp.utilities.tcga_utilities import (
process_y_matrix,
process_y_matrix_cancertype,
align_matrices,
filter_to_cross_data_samples,
)
clas... | [
"mpmp.utilities.tcga_utilities.process_y_matrix_cancertype",
"numpy.count_nonzero",
"mpmp.utilities.data_utilities.load_multiple_data_types",
"mpmp.utilities.data_utilities.load_random_genes",
"mpmp.utilities.tcga_utilities.process_y_matrix",
"mpmp.utilities.data_utilities.load_top_50",
"mpmp.utilities.... | [((1997, 2017), 'numpy.random.seed', 'np.random.seed', (['seed'], {}), '(seed)\n', (2011, 2017), True, 'import numpy as np\n'), ((5226, 5395), 'mpmp.utilities.tcga_utilities.filter_to_cross_data_samples', 'filter_to_cross_data_samples', (['train_filtered_df', 'y_filtered_df'], {'data_types': 'self.overlap_data_types', ... |
from flask import Flask
app = Flask(__name__)
@app.route("/")
def hello_world():
return "hello world"
if __name__ == '__main__':
app.run()
'''
if you want to open application on localAreaNetwork
'''
# app.run(host='0.0.0.0')
'''
if you want to switch to debug mode
'''
# ap... | [
"flask.Flask"
] | [((31, 46), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (36, 46), False, 'from flask import Flask\n')] |
import time
import pytest
from common.node import Node
from integration_tests.common.blockchain_network import DefaultBlockchainNetwork, NODE00_HOSTNAME, \
NODE01_HOSTNAME, NODE02_HOSTNAME
@pytest.fixture(scope="module")
def node00():
return Node(NODE00_HOSTNAME)
@pytest.fixture(scope="module")
def node01... | [
"pytest.fixture",
"integration_tests.common.blockchain_network.DefaultBlockchainNetwork",
"time.sleep",
"common.node.Node"
] | [((198, 228), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""module"""'}), "(scope='module')\n", (212, 228), False, 'import pytest\n'), ((279, 309), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""module"""'}), "(scope='module')\n", (293, 309), False, 'import pytest\n'), ((360, 390), 'pytest.fixture', 'p... |
import logging
from datetime import datetime
from typing import Optional
from typing import Tuple
from wtforms import Form
from myfunds.web import notify
from myfunds.web.exceptions import FormValidationError
def make_amount_pattern(currency_precision: int) -> str:
pattern = r"^\d+"
if currency_precision ==... | [
"logging.getLogger",
"datetime.datetime.now",
"myfunds.web.notify.error",
"myfunds.web.exceptions.FormValidationError"
] | [((1119, 1133), 'datetime.datetime.now', 'datetime.now', ([], {}), '()\n', (1131, 1133), False, 'from datetime import datetime\n'), ((1388, 1417), 'logging.getLogger', 'logging.getLogger', (['"""werkzeug"""'], {}), "('werkzeug')\n", (1405, 1417), False, 'import logging\n'), ((1254, 1268), 'datetime.datetime.now', 'date... |
from src.pyIsoFit.core.model_fit_def import get_guess_params, get_fit_tuples
import numpy as np
import pandas as pd
import unittest
class TestModelFitDef(unittest.TestCase):
def test_get_guess_params(self):
df1 = pd.read_csv('../Datasets for testing/Computational Data (EPFL) CO2.csv')
key_uptakes =... | [
"numpy.testing.assert_array_almost_equal",
"src.pyIsoFit.core.model_fit_def.get_guess_params",
"pandas.read_csv",
"src.pyIsoFit.core.model_fit_def.get_fit_tuples"
] | [((226, 298), 'pandas.read_csv', 'pd.read_csv', (['"""../Datasets for testing/Computational Data (EPFL) CO2.csv"""'], {}), "('../Datasets for testing/Computational Data (EPFL) CO2.csv')\n", (237, 298), True, 'import pandas as pd\n'), ((415, 476), 'src.pyIsoFit.core.model_fit_def.get_guess_params', 'get_guess_params', (... |
"""
Copy a KGTK file, validating it and producing a clean KGTK file (no
comments, whitespace lines, etc.) as output.
TODO: Need KgtkWriterOptions.
TODO: Need to plumn the infrastructure so we can report at least
a count of how many repair actions took place (per action type).
Ideally, we'ld like the optino to log ind... | [
"kgtk.cli_argparse.KGTKArgumentParser.get_output_file",
"kgtk.cli_argparse.KGTKArgumentParser.get_optional_output_file",
"kgtk.io.kgtkreader.KgtkReaderOptions.from_dict",
"kgtk.exceptions.KGTKException",
"kgtk.io.kgtkwriter.KgtkWriter.open",
"kgtk.io.kgtkreader.KgtkReader.add_debug_arguments",
"kgtk.val... | [((1770, 1824), 'kgtk.io.kgtkreader.KgtkReader.add_debug_arguments', 'KgtkReader.add_debug_arguments', (['parser'], {'expert': '_expert'}), '(parser, expert=_expert)\n', (1800, 1824), False, 'from kgtk.io.kgtkreader import KgtkReader, KgtkReaderOptions\n'), ((1829, 1993), 'kgtk.io.kgtkreader.KgtkReaderOptions.add_argum... |
#Plot the potential of the periodic surface with a dipole source
import numpy as np
import matplotlib.pyplot as plt
from Calc_power_cresc import Pow_abs_rad, \
Pow_abs_rad_r,\
Pow_abs_rad_hori,\
Pow_sca_rad, ... | [
"matplotlib.pyplot.ylabel",
"Calc_power_cresc.Pow_abs_rad",
"Calc_power_cresc.Pow_sca_r",
"numpy.imag",
"numpy.arange",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"numpy.exp",
"numpy.real",
"Calc_power_cresc.Pow_abs_rad_hori",
"Calc_power_cresc.Pow_abs_rad_r",
"Calc_power_cresc.Pow_... | [((460, 490), 'numpy.arange', 'np.arange', (['(0)', '(2 * np.pi)', '(0.001)'], {}), '(0, 2 * np.pi, 0.001)\n', (469, 490), True, 'import numpy as np\n'), ((738, 762), 'numpy.arange', 'np.arange', (['(0.01)', '(8)', '(0.01)'], {}), '(0.01, 8, 0.01)\n', (747, 762), True, 'import numpy as np\n'), ((804, 817), 'matplotlib.... |
from django.db import models
class DNSBuildRun(models.Model):
"""
Everytime the DNS build scripts are ran, one of these objects is
created to track which zones we have built and which zones we haven't built
(since nothing has changed in them). :class:`BuildManifest` objects
relate back to a :class... | [
"django.db.models.ForeignKey",
"django.db.models.TextField",
"django.db.models.CharField"
] | [((398, 416), 'django.db.models.TextField', 'models.TextField', ([], {}), '()\n', (414, 416), False, 'from django.db import models\n'), ((947, 986), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': 'max_length'}), '(max_length=max_length)\n', (963, 986), False, 'from django.db import models\n'), ((... |
#!/usr/bin/env python3
from pathlib import Path
import defopt
import numpy as np
import pandas as pd
from matplotlib.backends.backend_pdf import PdfPages
import matplotlib.pyplot as plt
from gp_ppc import load_data
from gp_model import extract_filters
from plot_orsolic_paper import plot_psycho, plot_chrono
from strenum... | [
"pandas.read_pickle",
"gp_model.extract_filters",
"seaborn.set",
"plot_orsolic_paper.plot_psycho",
"pathlib.Path",
"numpy.arange",
"seaborn.despine",
"numpy.log",
"seaborn.set_context",
"gp_ppc.load_data",
"matplotlib.pyplot.close",
"numpy.isnan",
"pandas.concat",
"defopt.run",
"strenum.... | [((4748, 4781), 'strenum.strenum', 'strenum', (['"""Fold"""', '"""train val test"""'], {}), "('Fold', 'train val test')\n", (4755, 4781), False, 'from strenum import strenum\n'), ((1008, 1050), 'gp_ppc.load_data', 'load_data', (['pred_filename', 'n_samples', 'folds'], {}), '(pred_filename, n_samples, folds)\n', (1017, ... |
#!/usr/bin/env python
__author__ = "<NAME> and <NAME>"
__copyright__ = "Copyright 2019, <NAME> & <NAME>"
__credits__ = ["<NAME>", "<NAME>"]
__license__ = "MIT"
__version__ = "1.0"
__maintainer__ = "<NAME>"
from threading import Thread
import argparse
import sys
from client import *
import command
import username
imp... | [
"argparse.ArgumentParser",
"log.checkANSI",
"log.info",
"username.gen_wrd",
"sys.exit",
"threading.Thread"
] | [((1216, 1231), 'log.checkANSI', 'log.checkANSI', ([], {}), '()\n', (1229, 1231), False, 'import log\n'), ((1250, 1305), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Groupchat client"""'}), "(description='Groupchat client')\n", (1273, 1305), False, 'import argparse\n'), ((2099, 2120), ... |
from os import path
from fabric.api import cd, local, run, sudo
from fabric.contrib.files import append, upload_template
from offregister_fab_utils.fs import cmd_avail, get_tempdir_fab
from offregister_fab_utils.misc import ubuntu_install_curl
from offutils import update_d
from offutils.util import iteritems
from pkg_... | [
"offregister_fab_utils.fs.get_tempdir_fab",
"fabric.api.cd",
"offregister_fab_utils.fs.cmd_avail",
"pkg_resources.resource_filename",
"fabric.api.run",
"fabric.api.sudo",
"offregister_fab_utils.misc.ubuntu_install_curl",
"offregister_etcd.shared_serve"
] | [((476, 494), 'offregister_fab_utils.fs.cmd_avail', 'cmd_avail', (['command'], {}), '(command)\n', (485, 494), False, 'from offregister_fab_utils.fs import cmd_avail, get_tempdir_fab\n'), ((882, 914), 'offregister_fab_utils.fs.get_tempdir_fab', 'get_tempdir_fab', ([], {'run_command': 'run'}), '(run_command=run)\n', (89... |
from ariadne import MutationType
from datetime import datetime as dt
from models.user import User
from schemas.helpers.normalize import change_keys
from schemas.user import UserCreate
mutations_resolvers = MutationType()
@mutations_resolvers.field("userCreate")
async def resolve_user_create(parent, info, user) -> d... | [
"models.user.User.get_instance",
"schemas.user.UserCreate",
"ariadne.MutationType"
] | [((208, 222), 'ariadne.MutationType', 'MutationType', ([], {}), '()\n', (220, 222), False, 'from ariadne import MutationType\n'), ((342, 361), 'models.user.User.get_instance', 'User.get_instance', ([], {}), '()\n', (359, 361), False, 'from models.user import User\n'), ((373, 391), 'schemas.user.UserCreate', 'UserCreate... |
# Generated by Django 2.0.9 on 2018-11-30 14:58
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('school', '0005_auto_20181130_1342'),
]
operations = [
migrations.AlterField(
model_name='school',
name='partnership'... | [
"django.db.models.IntegerField"
] | [((340, 382), 'django.db.models.IntegerField', 'models.IntegerField', ([], {'blank': '(True)', 'null': '(True)'}), '(blank=True, null=True)\n', (359, 382), False, 'from django.db import migrations, models\n')] |
import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRET_KEY = '<PASSWORD>secret'
DEBUG = True
ALLOWED_HOSTS = []
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
... | [
"os.path.abspath",
"os.path.join",
"os.environ.get"
] | [((54, 79), 'os.path.abspath', 'os.path.abspath', (['__file__'], {}), '(__file__)\n', (69, 79), False, 'import os\n'), ((1448, 1484), 'os.path.join', 'os.path.join', (['BASE_DIR', '"""db.sqlite3"""'], {}), "(BASE_DIR, 'db.sqlite3')\n", (1460, 1484), False, 'import os\n'), ((1577, 1618), 'os.environ.get', 'os.environ.ge... |
from fastapi import APIRouter
from streams_explorer.api.routes import (
graph,
kubernetes_health,
metrics,
node,
pipelines,
update,
)
router = APIRouter()
router.include_router(update.router, prefix="/update")
router.include_router(graph.router, prefix="/graph")
router.include_router(pipeline... | [
"fastapi.APIRouter"
] | [((169, 180), 'fastapi.APIRouter', 'APIRouter', ([], {}), '()\n', (178, 180), False, 'from fastapi import APIRouter\n')] |
import requests
import unittest
from urlvalidator import URLValidator
from k2connect import webhooks, authorization, json_builder, exceptions, validation
from k2connect.exceptions import InvalidArgumentError
from tests import SAMPLE_BASE_URL, SAMPLE_WEBHOOK_SECRET, SAMPLE_CLIENT_ID, SAMPLE_CLIENT_SECRET
class Webhoo... | [
"urlvalidator.URLValidator",
"k2connect.webhooks.WebhookService",
"k2connect.json_builder.webhook_subscription",
"k2connect.authorization.TokenService"
] | [((394, 408), 'urlvalidator.URLValidator', 'URLValidator', ([], {}), '()\n', (406, 408), False, 'from urlvalidator import URLValidator\n'), ((434, 521), 'k2connect.authorization.TokenService', 'authorization.TokenService', (['SAMPLE_BASE_URL', 'SAMPLE_CLIENT_ID', 'SAMPLE_CLIENT_SECRET'], {}), '(SAMPLE_BASE_URL, SAMPLE_... |
from app.database.db import db, BaseModelMixin
class Education(db.Model, BaseModelMixin):
id = db.Column(db.Integer, primary_key=True)
name = db.Column(db.String(100))
place = db.Column(db.String)
start_date = db.Column(db.DateTime)
end_date = db.Column(db.DateTime)
curriculum_id = db.Column(d... | [
"app.database.db.db.String",
"app.database.db.db.ForeignKey",
"app.database.db.db.Column"
] | [((100, 139), 'app.database.db.db.Column', 'db.Column', (['db.Integer'], {'primary_key': '(True)'}), '(db.Integer, primary_key=True)\n', (109, 139), False, 'from app.database.db import db, BaseModelMixin\n'), ((189, 209), 'app.database.db.db.Column', 'db.Column', (['db.String'], {}), '(db.String)\n', (198, 209), False,... |
from clge.Behaviour import Vector3
class Mesh3D:
def __init__(self):
self.my_type = "mesh"
self.points = [
Vector3(-10, -10, -10),
Vector3(10, -10, -10),
Vector3(10, 10, -10),
Vector3(-10, 10, -10),
Vector3(-10, -10, 10),
Vect... | [
"clge.Behaviour.Vector3"
] | [((141, 163), 'clge.Behaviour.Vector3', 'Vector3', (['(-10)', '(-10)', '(-10)'], {}), '(-10, -10, -10)\n', (148, 163), False, 'from clge.Behaviour import Vector3\n'), ((177, 198), 'clge.Behaviour.Vector3', 'Vector3', (['(10)', '(-10)', '(-10)'], {}), '(10, -10, -10)\n', (184, 198), False, 'from clge.Behaviour import Ve... |
# -*- coding: utf-8 -*-
import datetime
from django.shortcuts import redirect
from django.views import generic
from django.contrib.auth import get_user_model
from django.core.exceptions import PermissionDenied
from ..apps import AppConfig
from ..forms import ScheduleForm, EmailForm
from ..models import Schedule
from .m... | [
"logging.getLogger",
"django.contrib.auth.get_user_model",
"datetime.date.today",
"django.shortcuts.redirect"
] | [((416, 443), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (433, 443), False, 'import logging\n'), ((517, 533), 'django.contrib.auth.get_user_model', 'get_user_model', ([], {}), '()\n', (531, 533), False, 'from django.contrib.auth import get_user_model\n'), ((4219, 4306), 'django.shortc... |
"""
Delete idea, idk if it's gonna work or not
https://photos.google.com/_/PhotosUi/data/batchexecute?rpcids=XwAOJf&f.sid=-8354753373044497059&bl=boq_photosuiserver_20210722.08_p0&hl=en&soc-app=165&soc-platform=1&soc-device=1&_reqid=2110374&rt=c
https://photos.google.com/_/PhotosUi/data/batchexecute?rpcids=XwAOJf&f.... | [
"csv.DictWriter",
"time.sleep",
"math.log",
"sys.exit",
"datetime.datetime.today",
"datetime.datetime",
"argparse.ArgumentParser",
"selenium.webdriver.firefox.options.Options",
"os.path.isdir",
"selenium.webdriver.FirefoxProfile",
"selenium.webdriver.Firefox",
"requests.get",
"os.path.isfile... | [((1486, 1537), 'os.path.isfile', 'os.path.isfile', (['f"""{destination_folder}/{file_name}"""'], {}), "(f'{destination_folder}/{file_name}')\n", (1500, 1537), False, 'import os\n'), ((1607, 1624), 'requests.get', 'requests.get', (['url'], {}), '(url)\n', (1619, 1624), False, 'import requests\n'), ((2890, 2907), 'math.... |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | [
"aliyunsdkemr.endpoint.endpoint_data.getEndpointRegional",
"aliyunsdkemr.endpoint.endpoint_data.getEndpointMap",
"aliyunsdkcore.request.RpcRequest.__init__"
] | [((963, 1039), 'aliyunsdkcore.request.RpcRequest.__init__', 'RpcRequest.__init__', (['self', '"""Emr"""', '"""2016-04-08"""', '"""DumpMetaDataSourceForOuter"""'], {}), "(self, 'Emr', '2016-04-08', 'DumpMetaDataSourceForOuter')\n", (982, 1039), False, 'from aliyunsdkcore.request import RpcRequest\n'), ((1136, 1166), 'al... |
import requests
import csv
import re
import time
import os
from bs4 import BeautifulSoup as bs
from random import randint
results_path = "scripts_output/mastersportal"
main_url = "http://www.mastersportal.eu/countries/"
# Create results folder if it does not exist
if not os.path.exists(results_path):
os.makedirs(... | [
"csv.DictWriter",
"os.path.exists",
"os.makedirs",
"requests.get",
"bs4.BeautifulSoup",
"time.time",
"random.randint",
"re.search"
] | [((533, 555), 'requests.get', 'requests.get', (['main_url'], {}), '(main_url)\n', (545, 555), False, 'import requests\n'), ((573, 603), 'bs4.BeautifulSoup', 'bs', (['countries_res.text', '"""lxml"""'], {}), "(countries_res.text, 'lxml')\n", (575, 603), True, 'from bs4 import BeautifulSoup as bs\n'), ((1377, 1435), 'csv... |
import pytest
import graphviz
DEFAULT_ENGINE = 'dot'
DEFAULT_FORMAT = 'pdf'
DEFAULT_JUPYTER_FORMAT = 'svg'
DEFAULT_JUPYTER_MIMETYPE = 'image/svg+xml'
def test_set_default_engine_invalid():
with pytest.raises(ValueError, match=r'unknown engine'):
graphviz.set_default_engine('nonengine')
def test_set... | [
"graphviz.set_default_format",
"graphviz.set_jupyter_format",
"pytest.raises",
"graphviz.Graph",
"graphviz.set_default_engine"
] | [((867, 883), 'graphviz.Graph', 'graphviz.Graph', ([], {}), '()\n', (881, 883), False, 'import graphviz\n'), ((933, 971), 'graphviz.Graph', 'graphviz.Graph', ([], {'engine': 'explicit_engine'}), '(engine=explicit_engine)\n', (947, 971), False, 'import graphviz\n'), ((1023, 1058), 'graphviz.set_default_engine', 'graphvi... |
from System import Random
rand = Random()
def randomBool():
if rand.Next(0,2) < 1:
return "True"
else:
return "False"
def run_script():
print("(" + randomBool() + ", " + randomBool() + ", " + randomBool() + ")" )
| [
"System.Random"
] | [((34, 42), 'System.Random', 'Random', ([], {}), '()\n', (40, 42), False, 'from System import Random\n')] |
from builtins import zip
from builtins import object
import re
import json
def parse_json(json_path):
replacements = []
with open(json_path) as f:
data = json.load(f)
for replacement_dict in data['replacements']:
try:
replacements.append(Replacement(**{
... | [
"json.load",
"re.sub",
"re.search",
"builtins.zip"
] | [((172, 184), 'json.load', 'json.load', (['f'], {}), '(f)\n', (181, 184), False, 'import json\n'), ((2371, 2396), 'builtins.zip', 'zip', (['entries', 'new_offsets'], {}), '(entries, new_offsets)\n', (2374, 2396), False, 'from builtins import zip\n'), ((3473, 3520), 'builtins.zip', 'zip', (['char_style_entries', 'char_s... |
import numpy as np
from scipy.interpolate import LinearNDInterpolator, interp1d
from astropy import table
from astropy.table import Table, Column
import warnings
def get_track_meta(track, key="FeH"):
""" get meta info from a track """
assert key in track.meta.keys()
return track.meta[key]
def find_ran... | [
"numpy.log10",
"astropy.table.Table",
"numpy.hstack",
"scipy.interpolate.interp1d",
"numpy.array",
"numpy.arange",
"numpy.where",
"numpy.sort",
"numpy.max",
"numpy.min",
"warnings.simplefilter",
"numpy.argmin",
"numpy.abs",
"scipy.interpolate.LinearNDInterpolator",
"astropy.table.Column"... | [((554, 579), 'numpy.hstack', 'np.hstack', (['(sub, sub + 1)'], {}), '((sub, sub + 1))\n', (563, 579), True, 'import numpy as np\n'), ((894, 911), 'numpy.abs', 'np.abs', (['(arr - val)'], {}), '(arr - val)\n', (900, 911), True, 'import numpy as np\n'), ((959, 975), 'numpy.array', 'np.array', (['weight'], {}), '(weight)... |
#!/usr/bin/env python3
#
# Copyright (C) 2016-present the asyncpg authors and contributors
# <see AUTHORS file>
#
# This module is part of asyncpg and is released under
# the Apache 2.0 License: http://www.apache.org/licenses/LICENSE-2.0
import argparse
import builtins
import re
import string
import textwrap
from as... | [
"re.split",
"asyncpg.exceptions._base.PostgresMessageMeta.get_message_class_for_sqlstate",
"argparse.ArgumentParser",
"re.compile"
] | [((1759, 1853), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""generate _exceptions.py from postgres/errcodes.txt"""'}), "(description=\n 'generate _exceptions.py from postgres/errcodes.txt')\n", (1782, 1853), False, 'import argparse\n'), ((2123, 2149), 're.compile', 're.compile', (['... |
import pytest
from datahub.event.test.factories import EventFactory
from datahub.search.event.models import Event as ESEvent
pytestmark = pytest.mark.django_db
def test_event_dbmodel_to_dict(es):
"""Tests conversion of db model to dict."""
event = EventFactory()
result = ESEvent.db_object_to_dict(event... | [
"datahub.event.test.factories.EventFactory.create_batch",
"datahub.event.test.factories.EventFactory",
"datahub.search.event.models.Event.db_objects_to_es_documents",
"datahub.search.event.models.Event.db_object_to_dict"
] | [((260, 274), 'datahub.event.test.factories.EventFactory', 'EventFactory', ([], {}), '()\n', (272, 274), False, 'from datahub.event.test.factories import EventFactory\n'), ((289, 321), 'datahub.search.event.models.Event.db_object_to_dict', 'ESEvent.db_object_to_dict', (['event'], {}), '(event)\n', (314, 321), True, 'fr... |
#!/usr/bin/env python
# Family size distribution of tags which were aligned to the reference genome
#
# Author: <NAME> & <NAME>, Johannes-Kepler University Linz (Austria)
# Contact: <EMAIL>
#
# Takes at least one TABULAR file with tags before the alignment to the SSCS,
# a BAM file with tags of reads that overlap the ... | [
"matplotlib.pyplot.grid",
"matplotlib.pyplot.ylabel",
"pysam.AlignmentFile",
"numpy.array",
"matplotlib.pyplot.switch_backend",
"numpy.genfromtxt",
"numpy.arange",
"matplotlib.pyplot.margins",
"re.search",
"re.split",
"argparse.ArgumentParser",
"numpy.where",
"matplotlib.pyplot.xlabel",
"m... | [((995, 1020), 'matplotlib.pyplot.switch_backend', 'plt.switch_backend', (['"""agg"""'], {}), "('agg')\n", (1013, 1020), True, 'import matplotlib.pyplot as plt\n'), ((1262, 1397), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Family Size Distribution of tags which were aligned to region... |
#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""
Test TorchGeneratorAgent.
"""
import unittest
import math
import torch
from parlai.core.agents import create_agent
im... | [
"parlai.core.torch_generator_agent.TopKSampling",
"parlai.core.torch_generator_agent.BeamSearch",
"parlai.core.torch_generator_agent.GreedySearch",
"math.isclose",
"torch.LongTensor",
"torch.equal",
"torch.allclose",
"torch.Tensor",
"math.log",
"parlai.core.torch_generator_agent.TorchGeneratorAgen... | [((16907, 16922), 'unittest.main', 'unittest.main', ([], {}), '()\n', (16920, 16922), False, 'import unittest\n'), ((868, 917), 'parlai.core.torch_generator_agent.TorchGeneratorAgent.upgrade_opt', 'TorchGeneratorAgent.upgrade_opt', (["{'beam_size': 1}"], {}), "({'beam_size': 1})\n", (899, 917), False, 'from parlai.core... |
# Pandigital prime
# Problem 41
# We shall say that an n-digit number is pandigital if it makes use of all the digits 1 to n exactly once. For example, 2143 is a 4-digit pandigital and is also prime.
# What is the largest n-digit pandigital prime that exists?
from common import is_prime
import itertools
def pandigit... | [
"common.is_prime"
] | [((968, 984), 'common.is_prime', 'is_prime', (['number'], {}), '(number)\n', (976, 984), False, 'from common import is_prime\n')] |
#!/usr/bin/env python
# Usage:
# python figure_five.py inputfile outputfile
# optional args: [--target, --raw]
from sequential import optimizers
from objective_functions import objectives
import numpy as np
import argparse
import pickle
import pandas as pd
from collections import defaultdict
def compute_avera... | [
"numpy.mean",
"pickle.dump",
"argparse.ArgumentParser",
"pickle.load",
"pandas.DataFrame.from_dict",
"numpy.max",
"numpy.any",
"numpy.array",
"numpy.zeros",
"collections.defaultdict",
"numpy.nonzero",
"numpy.std",
"numpy.arange"
] | [((4485, 4510), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (4508, 4510), False, 'import argparse\n'), ((733, 780), 'numpy.array', 'np.array', (["[bnd[0] for bnd in objective['bnds']]"], {}), "([bnd[0] for bnd in objective['bnds']])\n", (741, 780), True, 'import numpy as np\n'), ((802, 849),... |
from toontown.makeatoon import ClothesGUI
import ToonDNA
class TailorClothesGUI(ClothesGUI.ClothesGUI):
notify = directNotify.newCategory('MakeClothesGUI')
def __init__(self, doneEvent, swapEvent, tailorId):
ClothesGUI.ClothesGUI.__init__(self, ClothesGUI.CLOTHES_TAILOR, doneEvent, swapEvent)
... | [
"ToonDNA.getTopStyles",
"ToonDNA.getBottomStyles",
"toontown.makeatoon.ClothesGUI.ClothesGUI.__init__",
"ToonDNA.getBottoms",
"ToonDNA.getTops"
] | [((226, 315), 'toontown.makeatoon.ClothesGUI.ClothesGUI.__init__', 'ClothesGUI.ClothesGUI.__init__', (['self', 'ClothesGUI.CLOTHES_TAILOR', 'doneEvent', 'swapEvent'], {}), '(self, ClothesGUI.CLOTHES_TAILOR, doneEvent,\n swapEvent)\n', (256, 315), False, 'from toontown.makeatoon import ClothesGUI\n'), ((524, 576), 'T... |
from fastapi import APIRouter, status, Body, HTTPException, Depends
from fastapi.encoders import jsonable_encoder
from starlette.responses import JSONResponse
import security
import schema
import security
from database import db
# init router instance
router = APIRouter(tags=["Nutzerverwaltung"])
@router.post("/u... | [
"fastapi.HTTPException",
"security.get_pwd",
"starlette.responses.JSONResponse",
"fastapi.APIRouter",
"fastapi.Body",
"fastapi.encoders.jsonable_encoder",
"fastapi.Depends"
] | [((265, 301), 'fastapi.APIRouter', 'APIRouter', ([], {'tags': "['Nutzerverwaltung']"}), "(tags=['Nutzerverwaltung'])\n", (274, 301), False, 'from fastapi import APIRouter, status, Body, HTTPException, Depends\n'), ((431, 440), 'fastapi.Body', 'Body', (['...'], {}), '(...)\n', (435, 440), False, 'from fastapi import API... |
"""
<NAME> ETHZ, 2020
Script to compute dci score of learned representation.
"""
import warnings
from typing import Union, Iterable
from numpy.core._multiarray_umath import ndarray
warnings.simplefilter(action='ignore', category=FutureWarning)
import numpy as np
from absl import flags, app
from sklearn.model_select... | [
"numpy.transpose",
"numpy.ones",
"absl.flags.DEFINE_bool",
"sklearn.model_selection.train_test_split",
"os.path.join",
"numpy.diff",
"absl.app.run",
"warnings.simplefilter",
"numpy.load",
"absl.flags.DEFINE_string"
] | [((184, 246), 'warnings.simplefilter', 'warnings.simplefilter', ([], {'action': '"""ignore"""', 'category': 'FutureWarning'}), "(action='ignore', category=FutureWarning)\n", (205, 246), False, 'import warnings\n'), ((435, 505), 'absl.flags.DEFINE_string', 'flags.DEFINE_string', (['"""z_name"""', '""""""', '"""Filename ... |
# Generated by Django 2.1.5 on 2019-01-09 14:01
from django.db import migrations
from django.contrib.postgres.operations import HStoreExtension
class Migration(migrations.Migration):
dependencies = [
]
operations = [
HStoreExtension(),
]
| [
"django.contrib.postgres.operations.HStoreExtension"
] | [((242, 259), 'django.contrib.postgres.operations.HStoreExtension', 'HStoreExtension', ([], {}), '()\n', (257, 259), False, 'from django.contrib.postgres.operations import HStoreExtension\n')] |
import discord
from discord.ext import commands
from pymongo import MongoClient
from tools.Eco import Eco
from config import OWNERS
client = MongoClient("mongodb://localhost:27017/")
coll = client.peanut.user
def is_owner():
async def predicate(ctx):
return ctx.author.id in OWNERS
return commands.ch... | [
"discord.ext.commands.group",
"pymongo.MongoClient",
"discord.ext.commands.check",
"discord.ext.commands.command"
] | [((142, 183), 'pymongo.MongoClient', 'MongoClient', (['"""mongodb://localhost:27017/"""'], {}), "('mongodb://localhost:27017/')\n", (153, 183), False, 'from pymongo import MongoClient\n'), ((309, 334), 'discord.ext.commands.check', 'commands.check', (['predicate'], {}), '(predicate)\n', (323, 334), False, 'from discord... |
import sys
import stable_baselines
sys.path.append("../../../k_road/")
import numpy as np
from stable_baselines.common.vec_env import DummyVecEnv
from stable_baselines.ddpg.noise import (
OrnsteinUhlenbeckActionNoise,
)
from stable_baselines import DDPG
# from cavs_environments.vehicle.deep_road.deep_road impo... | [
"stable_baselines.DDPG",
"scenario.road.RoadObserver",
"numpy.ones",
"scenario.road.RoadProcess",
"numpy.zeros",
"scenario.road.RoadTerminator",
"sys.path.append",
"scenario.road.RoadGoalRewarder"
] | [((37, 72), 'sys.path.append', 'sys.path.append', (['"""../../../k_road/"""'], {}), "('../../../k_road/')\n", (52, 72), False, 'import sys\n'), ((2359, 2497), 'stable_baselines.DDPG', 'DDPG', (['CustomPolicy', 'env'], {'verbose': '(1)', 'tensorboard_log': '"""/tmp/k_road_0/"""', 'gamma': '(0.999)', 'param_noise': 'para... |
# DESCRIPTION: The classes that pertain to the UI and GUI.
# 50726f6772616d6d696e6720697320627265616b696e67206f66206f6e652062696720696d706f
# 737369626c65207461736b20696e746f207365766572616c207665727920736d616c6c20706f73
# 7369626c65207461736b732e
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~MAIN~~~~~~~~~~~~~~~~~~~~~~~~~~~~... | [
"lib.core.convertlist",
"lib.core.convert",
"lib.core.UnknownPieceError"
] | [((3288, 3324), 'lib.core.convert', 'core.convert', (['pos'], {'tocoordinate': '(True)'}), '(pos, tocoordinate=True)\n', (3300, 3324), False, 'from lib import core, vectors, pieces\n'), ((2484, 2534), 'lib.core.convertlist', 'core.convertlist', (['[startvec, endvec]'], {'toindex': '(True)'}), '([startvec, endvec], toin... |