code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
# -*- coding: utf-8 -*-
"""
Created on Mon Sep 16 11:52:12 2019
@author: z5095790
"""
import numpy as np
import copy
import pickle
import os
from keras.models import load_model
class Node:
"""Binary tree with Ture and False Branches"""
def __init__(self, col=-1, value = None, parentID = None, ... | [
"keras.models.load_model",
"copy.deepcopy",
"numpy.zeros",
"pickle.load",
"numpy.matmul",
"os.listdir",
"numpy.vstack"
] | [((852, 868), 'keras.models.load_model', 'load_model', (['path'], {}), '(path)\n', (862, 868), False, 'from keras.models import load_model\n'), ((2177, 2198), 'copy.deepcopy', 'copy.deepcopy', (['weight'], {}), '(weight)\n', (2190, 2198), False, 'import copy\n'), ((2227, 2246), 'copy.deepcopy', 'copy.deepcopy', (['bias... |
import unittest
import uuid
from datetime import datetime
import pytz
import lusid
import lusid.models as models
from lusidfeature import lusid_feature
from utilities import InstrumentLoader
from utilities import TestDataUtilities
class Portfolios(unittest.TestCase):
@classmethod
def setUpClass(cls):
... | [
"lusid.models.TransactionPrice",
"uuid.uuid4",
"lusid.models.PerpetualProperty",
"lusid.models.ResourceId",
"utilities.InstrumentLoader",
"lusid.TransactionPortfoliosApi",
"lusid.ScopesApi",
"utilities.TestDataUtilities",
"lusid.models.CreatePropertyDefinitionRequest",
"datetime.datetime",
"lusi... | [((974, 993), 'lusidfeature.lusid_feature', 'lusid_feature', (['"""F8"""'], {}), "('F8')\n", (987, 993), False, 'from lusidfeature import lusid_feature\n'), ((1798, 1817), 'lusidfeature.lusid_feature', 'lusid_feature', (['"""F9"""'], {}), "('F9')\n", (1811, 1817), False, 'from lusidfeature import lusid_feature\n'), ((4... |
from sqlalchemy import testing
from sqlalchemy.testing import (
fixtures, eq_, assert_raises, assert_raises_message, AssertsCompiledSQL)
from sqlalchemy import (
exc as sa_exc, util, Integer, Table, String, ForeignKey, select, func,
and_, asc, desc, inspect, literal_column, cast, exists)
from sqlalchemy.orm... | [
"sqlalchemy.func.sum",
"sqlalchemy.testing.fails_on",
"sqlalchemy.testing.assert_raises_message",
"sqlalchemy.orm.mapper",
"sqlalchemy.testing.schema.Column",
"sqlalchemy.select",
"sqlalchemy.orm.aliased",
"sqlalchemy.orm.create_session",
"sqlalchemy.orm.clear_mappers",
"sqlalchemy.engine.default.... | [((42438, 42481), 'sqlalchemy.testing.fails_on', 'testing.fails_on', (['"""mssql"""', '"""FIXME: unknown"""'], {}), "('mssql', 'FIXME: unknown')\n", (42454, 42481), False, 'from sqlalchemy import testing\n'), ((43259, 43302), 'sqlalchemy.testing.fails_on', 'testing.fails_on', (['"""mssql"""', '"""FIXME: unknown"""'], {... |
#----------------------------------------------------------------------------------
# Microsoft Developer & Platform Evangelism
#
# Copyright (c) Microsoft Corporation. All rights reserved.
#
# THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
# EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT... | [
"azure.storage.fileshare.ShareDirectoryClient.from_connection_string",
"azure.storage.fileshare.ShareServiceClient.from_connection_string",
"os.system",
"azure.storage.fileshare.ShareClient.from_connection_string",
"constants.Constants",
"azure.storage.fileshare.ShareFileClient.from_connection_string"
] | [((1352, 1363), 'constants.Constants', 'Constants', ([], {}), '()\n', (1361, 1363), False, 'from constants import Constants\n'), ((10831, 10847), 'os.system', 'os.system', (['"""cls"""'], {}), "('cls')\n", (10840, 10847), False, 'import os\n'), ((1561, 1626), 'azure.storage.fileshare.ShareClient.from_connection_string'... |
import numpy as np
from finitewave.core.fibrosis import FibrosisPattern
class ScarGauss2DPattern(FibrosisPattern):
def __init__(self, mean, std, corr, size):
self.mean = mean
self.std = std
self.corr = corr
self.size = size
def generate(self, size, mesh=None):
if mesh... | [
"numpy.zeros",
"numpy.random.multivariate_normal"
] | [((349, 363), 'numpy.zeros', 'np.zeros', (['size'], {}), '(size)\n', (357, 363), True, 'import numpy as np\n'), ((517, 579), 'numpy.random.multivariate_normal', 'np.random.multivariate_normal', (['self.mean', 'self.covs', 'self.size'], {}), '(self.mean, self.covs, self.size)\n', (546, 579), True, 'import numpy as np\n'... |
"""
@Time: 2020/8/17 18:08
@Author: Zhirui(<NAME>
@E-mail: <EMAIL>
@Program:
"""
import os
import random
import pandas as pd
import numpy as np
from sklearn.impute import SimpleImputer
import tensorflow as tf
from tensorflow.keras import layers, optimizers
from tensorflow.keras.models import Sequential
from tenso... | [
"data_process.get_treat_info",
"numpy.abs",
"tensorflow.keras.layers.Dense",
"random.shuffle",
"tensorflow.keras.callbacks.ModelCheckpoint",
"tensorflow.keras.models.Sequential",
"os.path.join",
"tensorflow.keras.callbacks.EarlyStopping",
"pandas.DataFrame",
"sklearn.impute.SimpleImputer",
"pand... | [((356, 418), 'tensorflow.compat.v1.logging.set_verbosity', 'tf.compat.v1.logging.set_verbosity', (['tf.compat.v1.logging.ERROR'], {}), '(tf.compat.v1.logging.ERROR)\n', (390, 418), True, 'import tensorflow as tf\n'), ((703, 719), 'pandas.DataFrame', 'pd.DataFrame', (['{}'], {}), '({})\n', (715, 719), True, 'import pan... |
# import new Network name here and add in model_class args
from .Network import MYNET
from utils import *
from tqdm import tqdm
import torch.nn.functional as F
def base_train(model, trainloader, optimizer, scheduler, epoch, args):
tl = Averager()
ta = Averager()
model = model.train()
# standard classi... | [
"tqdm.tqdm",
"torch.nn.functional.cross_entropy"
] | [((357, 374), 'tqdm.tqdm', 'tqdm', (['trainloader'], {}), '(trainloader)\n', (361, 374), False, 'from tqdm import tqdm\n'), ((563, 599), 'torch.nn.functional.cross_entropy', 'F.cross_entropy', (['logits', 'train_label'], {}), '(logits, train_label)\n', (578, 599), True, 'import torch.nn.functional as F\n'), ((2514, 253... |
import numpy as np
import networkx as nx
import matplotlib.pyplot as plt
from matplotlib import pyplot
import matplotlib
import seaborn as sns
"""
Visualization functions for processing graphs, hypergraphs and simplicial
complexes. TODOs add options for saving visuals.
"""
def visualize_q_percolation(Q):
"""
... | [
"matplotlib.pyplot.title",
"matplotlib.pyplot.show",
"networkx.from_numpy_matrix",
"matplotlib.pyplot.plot",
"seaborn.heatmap",
"matplotlib.pyplot.bar",
"networkx.bipartite.sets",
"networkx.spring_layout",
"networkx.draw",
"matplotlib.pyplot.xticks",
"networkx.Graph",
"matplotlib.pyplot.ylabel... | [((434, 484), 'matplotlib.pyplot.ylabel', 'plt.ylabel', (['"""Number of Components for Q-Dimension"""'], {}), "('Number of Components for Q-Dimension')\n", (444, 484), True, 'import matplotlib.pyplot as plt\n'), ((489, 521), 'matplotlib.pyplot.title', 'plt.title', (['"""Q-Value Percolation"""'], {}), "('Q-Value Percola... |
import logging
logging.basicConfig(
format='%(asctime)s [CTFd-Whale | %(levelname)s] %(message)s',
level=logging.DEBUG,
datefmt='%H:%M:%S'
)
| [
"logging.basicConfig"
] | [((16, 149), 'logging.basicConfig', 'logging.basicConfig', ([], {'format': '"""%(asctime)s [CTFd-Whale | %(levelname)s] %(message)s"""', 'level': 'logging.DEBUG', 'datefmt': '"""%H:%M:%S"""'}), "(format=\n '%(asctime)s [CTFd-Whale | %(levelname)s] %(message)s', level=logging.\n DEBUG, datefmt='%H:%M:%S')\n", (35,... |
# MIT License
#
# Copyright (c) 2018 <NAME>, <EMAIL>
#
# 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, mer... | [
"dateutil.parser.parse",
"ethereumetl.service.eth_service.EthService",
"os.environ.get",
"web3.HTTPProvider",
"pytest.raises",
"pytest.mark.skipif",
"pytest.mark.parametrize"
] | [((1424, 1491), 'pytest.mark.skipif', 'pytest.mark.skipif', (['(not run_slow_tests)'], {'reason': '"""Slow running tests"""'}), "(not run_slow_tests, reason='Slow running tests')\n", (1442, 1491), False, 'import pytest\n'), ((1512, 1756), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""date,expected_start_b... |
# Copyright (c) 2012-2018 SoftBank Robotics. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the COPYING file.
import sys
import mock
import qisys.interact
from qisys.test.fake_interact import FakeInteract
def test_ask_yes_no():
""" Test that you can answ... | [
"qisys.test.fake_interact.FakeInteract",
"mock.patch"
] | [((3088, 3102), 'qisys.test.fake_interact.FakeInteract', 'FakeInteract', ([], {}), '()\n', (3100, 3102), False, 'from qisys.test.fake_interact import FakeInteract\n'), ((3383, 3397), 'qisys.test.fake_interact.FakeInteract', 'FakeInteract', ([], {}), '()\n', (3395, 3397), False, 'from qisys.test.fake_interact import Fak... |
import os
import unittest
from flask import current_app
from flask_testing import TestCase
from service import create_app
app = create_app()
class TestProductionConfig(TestCase):
''' Tests for production config. '''
def create_app(self):
''' Create an app instance. '''
app.... | [
"unittest.main",
"os.environ.get",
"service.create_app"
] | [((137, 149), 'service.create_app', 'create_app', ([], {}), '()\n', (147, 149), False, 'from service import create_app\n'), ((922, 937), 'unittest.main', 'unittest.main', ([], {}), '()\n', (935, 937), False, 'import unittest\n'), ((557, 585), 'os.environ.get', 'os.environ.get', (['"""SECRET_KEY"""'], {}), "('SECRET_KEY... |
# Copyright 2013 Google Inc. All Rights Reserved.
"""config command group."""
from googlecloudsdk.calliope import base
from googlecloudsdk.calliope import exceptions as c_exc
from googlecloudsdk.core import config
from googlecloudsdk.core import properties
class Config(base.Group):
"""View and edit Google Cloud S... | [
"googlecloudsdk.core.properties.VALUES.Section",
"googlecloudsdk.calliope.exceptions.InvalidArgumentException",
"googlecloudsdk.core.properties.VALUES.AllSections"
] | [((432, 463), 'googlecloudsdk.core.properties.VALUES.AllSections', 'properties.VALUES.AllSections', ([], {}), '()\n', (461, 463), False, 'from googlecloudsdk.core import properties\n'), ((2392, 2481), 'googlecloudsdk.calliope.exceptions.InvalidArgumentException', 'c_exc.InvalidArgumentException', (['"""property"""', '"... |
from ctypes import *
import struct
from io import BytesIO
class Properties:
def __init__(self, properties) -> None:
self.lnk = False
self.embedding = False
self.storage = False
self.default_mode = False
self.compressed_no_except = False
self.compressed_except = False
... | [
"io.BytesIO"
] | [((964, 978), 'io.BytesIO', 'BytesIO', (['bytez'], {}), '(bytez)\n', (971, 978), False, 'from io import BytesIO\n')] |
# Copyright 2017 Politecnico di Torino
#
# 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... | [
"re.findall"
] | [((1192, 1236), 're.findall', 're.findall', (['"""(==|!=|<|<=|>|>=)(\\\\d+)"""', 'value'], {}), "('(==|!=|<|<=|>|>=)(\\\\d+)', value)\n", (1202, 1236), False, 'import re\n')] |
import argparse
import json
import time
import os
import sys
# import threading
from lib.Utils import Utils
from lib.Constants import Constants
from lib.SocketConnection import SocketConnection
utils = Utils()
constants = Constants()
# Argument parser
parser = argparse.ArgumentParser(description='HTTP Request Smuggli... | [
"json.load",
"argparse.ArgumentParser",
"lib.Utils.Utils",
"lib.Constants.Constants",
"lib.SocketConnection.SocketConnection",
"time.time",
"time.sleep",
"sys.exit"
] | [((203, 210), 'lib.Utils.Utils', 'Utils', ([], {}), '()\n', (208, 210), False, 'from lib.Utils import Utils\n'), ((223, 234), 'lib.Constants.Constants', 'Constants', ([], {}), '()\n', (232, 234), False, 'from lib.Constants import Constants\n'), ((263, 358), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'d... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Aug 13 12:10:41 2019
@author: reiters
"""
import numpy as np
#t1=np.load('/gpfs/laur/sepia_tools/PSGAN_textures/usedTextures/noiseBig_epoch_501_fc1.0_ngf80_ndf80_dep5-5.npy',None,'allow_pickle',True)
#t2=np.load('/gpfs/laur/sepia_tools/PSGAN_textures/... | [
"numpy.load",
"numpy.save",
"numpy.linspace"
] | [((689, 867), 'numpy.load', 'np.load', (['"""/gpfs/laur/sepia_tools/PSGAN_textures/best_paired_models/curtain_rocks1_evaluated/noiseBig_epoch_500_fc1.0_ngf80_ndf80_dep5-5.npy"""', 'None', '"""allow_pickle"""', '(True)'], {}), "(\n '/gpfs/laur/sepia_tools/PSGAN_textures/best_paired_models/curtain_rocks1_evaluated/noi... |
#!/usr/bin/env python3
#
# MIT License
#
# Copyright (c) 2020-2021 EntySec
#
# 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... | [
"ctypes.py_object",
"core.modules.modules",
"threading.Thread",
"ctypes.pythonapi.PyThreadState_SetAsyncExc",
"core.formatter.formatter",
"core.exceptions.exceptions",
"ctypes.c_long",
"core.badges.badges",
"core.storage.local_storage"
] | [((1433, 1445), 'core.exceptions.exceptions', 'exceptions', ([], {}), '()\n', (1443, 1445), False, 'from core.exceptions import exceptions\n'), ((1471, 1482), 'core.formatter.formatter', 'formatter', ([], {}), '()\n', (1480, 1482), False, 'from core.formatter import formatter\n'), ((1505, 1513), 'core.badges.badges', '... |
"""
Copyright (c) 2020 Intel Corporation
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 writin... | [
"beta.nncf.tensorflow.quantization.initializers.minmax.MinMaxInitializer",
"beta.nncf.tensorflow.graph.utils.get_original_name_and_instance_index",
"networkx.topological_sort",
"beta.nncf.tensorflow.graph.pattern_matching.search_all",
"beta.nncf.tensorflow.graph.converter.convert_keras_model_to_nxmodel",
... | [((2436, 2486), 'beta.nncf.tensorflow.algorithm_selector.TF_COMPRESSION_ALGORITHMS.register', 'TF_COMPRESSION_ALGORITHMS.register', (['"""quantization"""'], {}), "('quantization')\n", (2470, 2486), False, 'from beta.nncf.tensorflow.algorithm_selector import TF_COMPRESSION_ALGORITHMS\n'), ((3924, 4040), 'beta.nncf.tenso... |
import abc
import csv
import uuid
import json
import os
import numpy as np
import requests
import joblib
import pandas
from scipy.sparse import csr_matrix
from tworaven_apps.solver_interfaces.models import SAVED_MODELS_PATH, R_SERVICE, get_metric, StatisticalModel
from tworaven_solver import Dataset
from collections... | [
"numpy.argmax",
"json.dumps",
"collections.defaultdict",
"tworaven_solver.model.BaseModelWrapper.load",
"h2o.import_file",
"requests.post",
"os.path.join",
"os.chdir",
"pandas.DataFrame",
"h2o.save_model",
"json.loads",
"h2o.init",
"os.path.exists",
"tworaven_apps.solver_interfaces.models.... | [((1390, 1431), 'os.path.join', 'os.path.join', (['SAVED_MODELS_PATH', 'model_id'], {}), '(SAVED_MODELS_PATH, model_id)\n', (1402, 1431), False, 'import os\n'), ((1456, 1504), 'os.path.join', 'os.path.join', (['model_folder_path', '"""metadata.json"""'], {}), "(model_folder_path, 'metadata.json')\n", (1468, 1504), Fals... |
#!/usr/bin/env python3
print('Content-type:text/html\n\n')
import os
import cgi, cgitb
cgitb.enable()
if os.environ['REQUEST_METHOD'] == 'POST':
form = cgi.FieldStorage()
if not os.path.isfile('./interrogar-ud/credenciais.txt'):
open('./interrogar-ud/credenciais.txt', 'w').write('')
credenciais = open('./interro... | [
"os.path.isfile",
"cgi.FieldStorage",
"cgitb.enable"
] | [((88, 102), 'cgitb.enable', 'cgitb.enable', ([], {}), '()\n', (100, 102), False, 'import cgi, cgitb\n'), ((155, 173), 'cgi.FieldStorage', 'cgi.FieldStorage', ([], {}), '()\n', (171, 173), False, 'import cgi, cgitb\n'), ((182, 231), 'os.path.isfile', 'os.path.isfile', (['"""./interrogar-ud/credenciais.txt"""'], {}), "(... |
# Copyright 2020 Huawei Technologies Co., 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 required by applicable law or agreed to... | [
"mindspore.ops.operations.SigmoidCrossEntropyWithLogits",
"mindspore.ops.operations.GatherNd",
"mindspore.Tensor",
"mindspore.ops.operations.Cast",
"mindspore.ops.operations.DType",
"mindspore.ops.operations.IOU",
"mindspore.nn.OneHot",
"mindspore.ops.operations.Fill",
"mindspore.ops.operations.Tran... | [((1055, 1071), 'mindspore.ops.operations.TupleToArray', 'P.TupleToArray', ([], {}), '()\n', (1069, 1071), True, 'from mindspore.ops import operations as P\n'), ((1419, 1426), 'mindspore.ops.operations.Sum', 'P.Sum', ([], {}), '()\n', (1424, 1426), True, 'from mindspore.ops import operations as P\n'), ((1447, 1475), 'm... |
from chat.tests.common import *
from chat.models import Message
from chat.utils import datetime_to_timestamp, timestamp_to_datetime
def create_message(message_content, timestamp, username, channel, message_type):
"""
Creates a message with the given text, datetime,
username, channel and with typing set to... | [
"chat.utils.timestamp_to_datetime"
] | [((434, 466), 'chat.utils.timestamp_to_datetime', 'timestamp_to_datetime', (['timestamp'], {}), '(timestamp)\n', (455, 466), False, 'from chat.utils import datetime_to_timestamp, timestamp_to_datetime\n')] |
from django.db import models
from django.utils.encoding import force_text, python_2_unicode_compatible
from django.utils.translation import ugettext_lazy as _
@python_2_unicode_compatible
class Attribute(models.Model):
name = models.CharField(_('name'), max_length=255)
class Meta:
app_label = 'cms_ar... | [
"django.utils.translation.ugettext_lazy",
"django.utils.encoding.force_text"
] | [((249, 258), 'django.utils.translation.ugettext_lazy', '_', (['"""name"""'], {}), "('name')\n", (250, 258), True, 'from django.utils.translation import ugettext_lazy as _\n'), ((351, 365), 'django.utils.translation.ugettext_lazy', '_', (['"""attribute"""'], {}), "('attribute')\n", (352, 365), True, 'from django.utils.... |
"""
Tests for helper functions for processing the images for OCR
"""
from typing import Any
import os
import cv2
from src.extractor.extractor import get_boxes
def test_get_boxes() -> tuple((Any, list)):
path = os.path.join(os.getcwd(), r"data\test\test2.png")
img = cv2.imread(path, 0)
get_boxes(img)
| [
"os.getcwd",
"cv2.imread",
"src.extractor.extractor.get_boxes"
] | [((277, 296), 'cv2.imread', 'cv2.imread', (['path', '(0)'], {}), '(path, 0)\n', (287, 296), False, 'import cv2\n'), ((301, 315), 'src.extractor.extractor.get_boxes', 'get_boxes', (['img'], {}), '(img)\n', (310, 315), False, 'from src.extractor.extractor import get_boxes\n'), ((230, 241), 'os.getcwd', 'os.getcwd', ([], ... |
"""
test_hmap.py
Copyright 2012 <NAME>
This file is part of w3af, http://w3af.org/ .
w3af is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation version 2 of the License.
w3af is distributed in the hope that it will b... | [
"w3af.core.controllers.ci.moth.get_moth_http",
"nose.plugins.attrib.attr",
"w3af.core.controllers.ci.moth.get_moth_https",
"w3af.plugins.tests.helper.PluginConfig"
] | [((874, 890), 'nose.plugins.attrib.attr', 'attr', (['"""ci_fails"""'], {}), "('ci_fails')\n", (878, 890), False, 'from nose.plugins.attrib import attr\n'), ((935, 950), 'w3af.core.controllers.ci.moth.get_moth_http', 'get_moth_http', ([], {}), '()\n', (948, 950), False, 'from w3af.core.controllers.ci.moth import get_mot... |
import os
import sys
input_filename = sys.argv[1]
wav_location = sys.argv[2]
output_filename = sys.argv[3]
def replace_character( inp, index, final_char ):
b = list(inp)
b[index] = final_char
return "".join(b)
def find_last_occurence( inp, to_find ):
p = len(inp)-1-inp[::-1].find(to_find)
return p
lines = open... | [
"os.path.basename"
] | [((450, 475), 'os.path.basename', 'os.path.basename', (['line[0]'], {}), '(line[0])\n', (466, 475), False, 'import os\n')] |
# -*- coding: utf-8 -*-
"""
Basic and Monitor-Curve Exponent Transfer Functions
===================================================
Defines the exponent transfer functions:
- :func:`colour.models.exponent_function_basic`
- :func:`colour.models.exponent_function_monitor_curve`
References
----------
- :cite: `Th... | [
"colour.utilities.suppress_warnings",
"numpy.where",
"numpy.isnan",
"colour.utilities.as_float_array"
] | [((4646, 4663), 'colour.utilities.as_float_array', 'as_float_array', (['x'], {}), '(x)\n', (4660, 4663), False, 'from colour.utilities import as_float, as_float_array, suppress_warnings\n'), ((4679, 4703), 'colour.utilities.as_float_array', 'as_float_array', (['exponent'], {}), '(exponent)\n', (4693, 4703), False, 'fro... |
from django.db import models
class Item(models.Model):
name = models.CharField(max_length=100, blank=True)
parent = models.ForeignKey('Item', on_delete=models.SET_NULL, null=True, related_name='children')
item = models.ForeignKey('Item', on_delete=models.SET_NULL, null=True)
item_type = 'simple'
... | [
"django.db.models.CharField",
"django.db.models.TextField",
"django.db.models.ManyToManyField",
"django.db.models.ForeignKey"
] | [((68, 112), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(100)', 'blank': '(True)'}), '(max_length=100, blank=True)\n', (84, 112), False, 'from django.db import models\n'), ((126, 218), 'django.db.models.ForeignKey', 'models.ForeignKey', (['"""Item"""'], {'on_delete': 'models.SET_NULL', 'null... |
# Generated by Django 2.2.5 on 2019-10-12 13:17
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('home', '0010_order_name'),
]
operations = [
migrations.AddField(
model_name='order',
name='status',
fiel... | [
"django.db.models.CharField"
] | [((322, 411), 'django.db.models.CharField', 'models.CharField', ([], {'blank': '(True)', 'max_length': '(20)', 'null': '(True)', 'verbose_name': '"""accept/reject"""'}), "(blank=True, max_length=20, null=True, verbose_name=\n 'accept/reject')\n", (338, 411), False, 'from django.db import migrations, models\n')] |
from GET_Calc import GET_ALL_GOALS, GET_POINTS, GET_SEASON, CALC_SEASON_POISSON, GET_ALL_CLUBS, GET_ATT_DEF_ANALYSE
from BUILD_Graph import build_graph
from flask import Flask, render_template, request
from flask_bootstrap import Bootstrap
file = "./CSV/1_Bundesliga_2018_2019.csv"
app = Flask(__name__)
app.config... | [
"GET_Calc.GET_SEASON",
"BUILD_Graph.build_graph",
"flask.request.args.get",
"GET_Calc.GET_POINTS",
"flask.Flask",
"GET_Calc.GET_ATT_DEF_ANALYSE",
"GET_Calc.CALC_SEASON_POISSON",
"GET_Calc.GET_ALL_CLUBS",
"flask.render_template",
"flask_bootstrap.Bootstrap"
] | [((294, 309), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (299, 309), False, 'from flask import Flask, render_template, request\n'), ((354, 368), 'flask_bootstrap.Bootstrap', 'Bootstrap', (['app'], {}), '(app)\n', (363, 368), False, 'from flask_bootstrap import Bootstrap\n'), ((453, 472), 'GET_Calc.GET_... |
"""
Copyright 2017-2019 Government of Canada - Public Services and Procurement Canada - buyandsell.gc.ca
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
... | [
"indy.wallet.close_wallet",
"indy.non_secrets.delete_wallet_record",
"von_anchor.wallet.PairwiseInfo",
"json.dumps",
"indy.non_secrets.fetch_wallet_search_next_records",
"indy.crypto.auth_decrypt",
"von_anchor.wallet.KeyInfo",
"indy.did.get_my_did_with_meta",
"indy.non_secrets.close_wallet_search",
... | [((1351, 1378), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1368, 1378), False, 'import logging\n'), ((7282, 7313), 'von_anchor.wallet.KeyInfo', 'KeyInfo', (['verkey', '(metadata or {})'], {}), '(verkey, metadata or {})\n', (7289, 7313), False, 'from von_anchor.wallet import DIDInfo, ... |
import unittest
import uuid
import threading
import pytest
from time import sleep
from azure.cosmos.http_constants import ResourceType
import azure.cosmos.cosmos_client as cosmos_client
import azure.cosmos.documents as documents
from azure.cosmos.request_object import _RequestObject
from azure.cosmos.location_cache im... | [
"azure.cosmos.errors.HTTPFailure",
"azure.cosmos.http_constants.ResourceType.IsCollectionChild",
"azure.cosmos.cosmos_client.CosmosClient",
"azure.cosmos.request_object._RequestObject",
"azure.cosmos.documents.ConnectionPolicy",
"time.sleep",
"azure.cosmos.location_cache.LocationCache",
"pytest.mark.u... | [((1081, 1116), 'pytest.mark.usefixtures', 'pytest.mark.usefixtures', (['"""teardown"""'], {}), "('teardown')\n", (1104, 1116), False, 'import pytest\n'), ((2369, 2397), 'azure.cosmos.documents.ConnectionPolicy', 'documents.ConnectionPolicy', ([], {}), '()\n', (2395, 2397), True, 'import azure.cosmos.documents as docum... |
from uuid import uuid4
from config import db
class Event(db.Model):
__tablename__ = 'event'
id = db.Column(db.String(32), primary_key=True)
username = db.Column(db.String(20))
description = db.Column(db.String(250))
start = db.Column(db.DateTime)
end = db.Column(db.DateTime)
def __init__... | [
"config.db.String",
"uuid.uuid4",
"config.db.Column"
] | [((247, 269), 'config.db.Column', 'db.Column', (['db.DateTime'], {}), '(db.DateTime)\n', (256, 269), False, 'from config import db\n'), ((280, 302), 'config.db.Column', 'db.Column', (['db.DateTime'], {}), '(db.DateTime)\n', (289, 302), False, 'from config import db\n'), ((118, 131), 'config.db.String', 'db.String', (['... |
################################################################################
# Module: idf.py
# Description: Various functions for processing of EnergyPlus models and
# retrieving results in different forms
# License: MIT, see full license in LICENSE.txt
# Web: https://github.com/samuelduchesne/archety... | [
"archetypal.eplus_interface.version.EnergyPlusVersion.current",
"archetypal.eplus_interface.transition.TransitionThread",
"archetypal.ReportData.from_sqlite",
"pandas.read_csv",
"archetypal.eplus_interface.basement.BasementThread",
"archetypal.eplus_interface.version.get_eplus_dirs",
"geomeppy.patches.i... | [((3896, 3920), 'itertools.count', 'itertools.count', ([], {'start': '(1)'}), '(start=1)\n', (3911, 3920), False, 'import itertools\n'), ((73082, 73154), 'archetypal.log', 'log', (['"""looking for csv output, return the csv files in DataFrames if any"""'], {}), "('looking for csv output, return the csv files in DataFra... |
# coding: utf-8
import re
import six
from huaweicloudsdkcore.utils.http_utils import sanitize_for_serialization
class CustomerInformation:
"""
Attributes:
openapi_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The ke... | [
"huaweicloudsdkcore.utils.http_utils.sanitize_for_serialization",
"six.iteritems",
"sys.setdefaultencoding"
] | [((14393, 14426), 'six.iteritems', 'six.iteritems', (['self.openapi_types'], {}), '(self.openapi_types)\n', (14406, 14426), False, 'import six\n'), ((15411, 15442), 'sys.setdefaultencoding', 'sys.setdefaultencoding', (['"""utf-8"""'], {}), "('utf-8')\n", (15433, 15442), False, 'import sys\n'), ((15469, 15501), 'huaweic... |
# -*- coding: utf-8 -*-
"""The main app module of the project."""
import sys
from PyQt5.QtWidgets import QApplication
from app.design.design import Window
def run() -> None:
"""Run GUI that is already connected to the backend"""
app = QApplication(sys.argv)
gui = Window()
gui.show()
sys.exit(app.... | [
"PyQt5.QtWidgets.QApplication",
"app.design.design.Window"
] | [((246, 268), 'PyQt5.QtWidgets.QApplication', 'QApplication', (['sys.argv'], {}), '(sys.argv)\n', (258, 268), False, 'from PyQt5.QtWidgets import QApplication\n'), ((279, 287), 'app.design.design.Window', 'Window', ([], {}), '()\n', (285, 287), False, 'from app.design.design import Window\n')] |
#!/usr/bin/env python
import os
import ssl
import kopf
import kubernetes.client as k8s
import requests
VERSION = "v1alpha1"
GROUP = "est.mitre.org"
WELLKNOWN = "/.well-known/est"
ESTORDER_TEMPLATE = """---
apiVersion: est.mitre.org/v1alpha1
kind: EstOrder
metadata:
name: "{ordername}"
spec:
issuerRef:
name... | [
"kopf.TemporaryError",
"requests.Session",
"kopf.info",
"kubernetes.client.CoreV1Api",
"kubernetes.client.CustomObjectsApi",
"requests.packages.urllib3.util.ssl_.create_urllib3_context",
"os.getenv"
] | [((1214, 1232), 'requests.Session', 'requests.Session', ([], {}), '()\n', (1230, 1232), False, 'import requests\n'), ((2330, 2441), 'kopf.info', 'kopf.info', (['resource'], {'reason': '"""Debugging"""', 'message': 'f"""get_issuer_from_resource: {issuer[\'metadata\'][\'name\']}"""'}), '(resource, reason=\'Debugging\', m... |
# Copyright (C) 2013-2014 <NAME>
# This file is part of fortrace - http://fortrace.fbi.h-da.de
# See the file 'docs/LICENSE' for copying permission.
"""
This file contain the
"""
from __future__ import absolute_import
try:
import logging
from fortrace.inputDevice.keyboard import KeyboardManagement
from ... | [
"fortrace.utility.logger_helper.create_logger",
"fortrace.inputDevice.keyboard.KeyboardManagement",
"fortrace.inputDevice.mouse.MouseManagement"
] | [((824, 844), 'fortrace.inputDevice.keyboard.KeyboardManagement', 'KeyboardManagement', ([], {}), '()\n', (842, 844), False, 'from fortrace.inputDevice.keyboard import KeyboardManagement\n'), ((873, 890), 'fortrace.inputDevice.mouse.MouseManagement', 'MouseManagement', ([], {}), '()\n', (888, 890), False, 'from fortrac... |
import hashlib
import inspect
from strictyaml import load, Bool, Int, Str, Seq, Map, Enum, MapPattern, Optional, YAMLValidationError
from konstel import formats
from konstel import encodings
ALGORITHMS = hashlib.algorithms_available
ALPHABETS = formats.alphabets.keys()
BASE_ENCODINGS = {'base32', 'cbase32'}
ENCODIN... | [
"strictyaml.Optional",
"strictyaml.Enum",
"strictyaml.Str",
"strictyaml.Int",
"strictyaml.Bool",
"konstel.formats.alphabets.keys",
"strictyaml.load",
"inspect.getmembers"
] | [((249, 273), 'konstel.formats.alphabets.keys', 'formats.alphabets.keys', ([], {}), '()\n', (271, 273), False, 'from konstel import formats\n'), ((2136, 2159), 'strictyaml.load', 'load', (['yaml_text', 'schema'], {}), '(yaml_text, schema)\n', (2140, 2159), False, 'from strictyaml import load, Bool, Int, Str, Seq, Map, ... |
# -*- coding: utf-8 -*-
# Copyright (C) 2004-2016 Mag. <NAME>. All rights reserved
# Glasauergasse 32, A--1130 Wien, Austria. <EMAIL>
# ****************************************************************************
#
# This module is licensed under the terms of the BSD 3-Clause License
# <http://www.c-tanzer.at/license/b... | [
"_CAL.CAL.Time.from_string",
"_CAL.CAL.Date",
"_CAL.CAL._Export",
"dateutil.tz.tzlocal",
"_CAL.CAL.Time._from_string_match_kw",
"_CAL.CAL.Time_Delta",
"_CAL.CAL.Time",
"datetime.datetime.combine"
] | [((12002, 12018), '_CAL.CAL._Export', 'CAL._Export', (['"""*"""'], {}), "('*')\n", (12013, 12018), False, 'from _CAL import CAL\n'), ((10648, 10671), '_CAL.CAL.Time.from_string', 'CAL.Time.from_string', (['s'], {}), '(s)\n', (10668, 10671), False, 'from _CAL import CAL\n'), ((9651, 9682), '_CAL.CAL.Time_Delta', 'CAL.Ti... |
import json
from unittest.mock import ANY, MagicMock, Mock, call, patch
import pytest
import tornado
from jupyterlab_git.git import Git
from jupyterlab_git.handlers import NAMESPACE, setup_handlers, GitHandler
from .testutils import assert_http_error, maybe_future
def test_mapping_added():
mock_web_app = Mock(... | [
"tornado.httputil.HTTPServerRequest",
"unittest.mock.MagicMock",
"json.loads",
"jupyterlab_git.handlers.setup_handlers",
"unittest.mock.Mock",
"json.dumps",
"unittest.mock.patch",
"pytest.raises",
"jupyterlab_git.handlers.GitHandler",
"pytest.mark.parametrize"
] | [((480, 590), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""path, with_cm"""', "(('url', False), ('url/to/path', False), ('url/to/path', True))"], {}), "('path, with_cm', (('url', False), ('url/to/path', \n False), ('url/to/path', True)))\n", (503, 590), False, 'import pytest\n'), ((1039, 1106), 'unitt... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import torch
import unittest
from gpytorch.utils import sparse_eye, sparse_getitem, sparse_repeat, to_sparse
class TestSparse(unittest.TestCase):
def setUp(self):
... | [
"unittest.main",
"torch.eye",
"torch.LongTensor",
"torch.FloatTensor",
"gpytorch.utils.sparse_repeat",
"gpytorch.utils.sparse_getitem",
"gpytorch.utils.sparse_eye",
"torch.Size"
] | [((3043, 3058), 'unittest.main', 'unittest.main', ([], {}), '()\n', (3056, 3058), False, 'import unittest\n'), ((342, 394), 'torch.LongTensor', 'torch.LongTensor', (['[[0, 1, 2, 3, 4], [2, 1, 0, 0, 1]]'], {}), '([[0, 1, 2, 3, 4], [2, 1, 0, 0, 1]])\n', (358, 394), False, 'import torch\n'), ((417, 451), 'torch.FloatTenso... |
import pytest
import saltfactories.utils.functional
import saltfactories.utils.markers
@pytest.hookimpl(tryfirst=True)
def pytest_runtest_setup(item):
"""
Fixtures injection based on markers or test skips based on CLI arguments
"""
__tracebackhide__ = True
saltfactories.utils.markers.evaluate_mar... | [
"pytest.hookimpl",
"pytest.fixture"
] | [((91, 121), 'pytest.hookimpl', 'pytest.hookimpl', ([], {'tryfirst': '(True)'}), '(tryfirst=True)\n', (106, 121), False, 'import pytest\n'), ((884, 915), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""session"""'}), "(scope='session')\n", (898, 915), False, 'import pytest\n')] |
from sqlalchemy_continuum_vendored import make_versioned
# make_versioned(user_cls=None, options={'strategy' : 'subquery'})
# Import the DB things.
from common.main_archive_db import WebPages
from common.main_archive_db import WebFiles
from common.main_archive_db import PluginStatus
from common.main_archive_db impo... | [
"sqlalchemy.orm.configure_mappers"
] | [((1624, 1650), 'sqlalchemy.orm.configure_mappers', 'sa.orm.configure_mappers', ([], {}), '()\n', (1648, 1650), True, 'import sqlalchemy as sa\n')] |
#!/usr/bin/python
#
# Copyright 2017, The Android Open Source Project
#
# 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 b... | [
"subprocess.Popen",
"argparse.ArgumentParser",
"os.path.dirname",
"os.environ.copy",
"os.path.join",
"sys.exit"
] | [((880, 934), 'os.path.join', 'os.path.join', (['MAIN_DIRECTORY', '"""ktlint-android-all.jar"""'], {}), "(MAIN_DIRECTORY, 'ktlint-android-all.jar')\n", (892, 934), False, 'import os\n'), ((840, 865), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (855, 865), False, 'import os\n'), ((1183, 120... |
import streamlit as st
import pandas as pd
import altair as alt
st.title("Let's analyze some data about autonomous vehicles, collected from Pittsburgh residents 🚗📊.")
@st.cache # add caching so we load the data only once
def load_data_nine():
# Load the penguin data from https://github.com/allisonhorst/palmerp... | [
"streamlit.altair_chart",
"streamlit.markdown",
"altair.Y",
"pandas.read_csv",
"altair.Chart",
"altair.selection_multi",
"streamlit.write",
"streamlit.title",
"altair.Axis",
"altair.value",
"altair.hconcat"
] | [((65, 177), 'streamlit.title', 'st.title', (['"""Let\'s analyze some data about autonomous vehicles, collected from Pittsburgh residents 🚗📊."""'], {}), '(\n "Let\'s analyze some data about autonomous vehicles, collected from Pittsburgh residents 🚗📊."\n )\n', (73, 177), True, 'import streamlit as st\n'), ((11... |
import os
import time
from datetime import datetime, timedelta
from time import sleep
from expects import expect, have_key, contain, have_keys, be_empty, equal, be_false, be_above_or_equal, have_len
from mamba import it, before, context, description
from sdcclient.monitor import EventsClientV2
from specs import be_su... | [
"expects.have_key",
"mamba.context",
"mamba.it",
"expects.have_len",
"expects.expect",
"expects.have_keys",
"time.sleep",
"expects.equal",
"datetime.timedelta",
"mamba.description",
"datetime.datetime.now",
"os.getenv",
"expects.be_above_or_equal"
] | [((344, 383), 'mamba.description', 'description', (['"""Events v2"""', '"""integration"""'], {}), "('Events v2', 'integration')\n", (355, 383), False, 'from mamba import it, before, context, description\n'), ((650, 688), 'mamba.it', 'it', (['"""is able to create a custom event"""'], {}), "('is able to create a custom e... |
from datetime import datetime
from typing import Any, Dict, List, Optional
from enum import Enum
from pydantic import Field
from avaandmed.api_resources import ApiResource
from avaandmed.api_resources.users.user import User
class KeywordEmsCategory(ApiResource):
id: int
ems_category_id: int
keyword_id: i... | [
"pydantic.Field"
] | [((6523, 6533), 'pydantic.Field', 'Field', (['...'], {}), '(...)\n', (6528, 6533), False, 'from pydantic import Field\n'), ((6553, 6563), 'pydantic.Field', 'Field', (['...'], {}), '(...)\n', (6558, 6563), False, 'from pydantic import Field\n'), ((6590, 6600), 'pydantic.Field', 'Field', (['...'], {}), '(...)\n', (6595, ... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# Last Change: Tue Jul 17 05:00 PM 2007 J
# The code and descriptive text is copyrighted and offered under the terms of
# the BSD License from the authors; see below. However, the actual dataset may
# have a different origin and intellectual property status. See the SOURC... | [
"os.path.dirname",
"numpy.array"
] | [((4312, 4331), 'numpy.array', 'np.array', (['nfeatures'], {}), '(nfeatures)\n', (4320, 4331), True, 'import numpy as np\n'), ((4432, 4475), 'numpy.array', 'np.array', (["[(lab == '+1') for lab in labels]"], {}), "([(lab == '+1') for lab in labels])\n", (4440, 4475), True, 'import numpy as np\n'), ((4094, 4111), 'os.pa... |
import requests
import os
# get your API KEY from <https://deepai.org>
# you need to make a free account
MY_API_KEY = 'put-your-API-key-here'
# path where you keep your pictures
# can be a folder of folders of pictures, or just a folder of pictures
# make sure to end it in /
mypath = "/path/to/the/folder/with/your/pi... | [
"os.walk",
"os.path.exists",
"os.makedirs"
] | [((394, 409), 'os.walk', 'os.walk', (['mypath'], {}), '(mypath)\n', (401, 409), False, 'import os\n'), ((575, 607), 'os.walk', 'os.walk', (["(mypath + myfolder + '/')"], {}), "(mypath + myfolder + '/')\n", (582, 607), False, 'import os\n'), ((1166, 1202), 'os.path.exists', 'os.path.exists', (["(mypath + 'colorized')"],... |
# -*- coding: utf-8 -*-
import sqlite3
class DataBase:
def __init__(self, db_file):
self.db_file = db_file
self.rows = [("lamb", "meat", 39.2, 10400, "red", "red"),
("beef", "meat", 27, 15400, "red", "red"),
("pork", "meat", 12.1, 6000, "yellow", "yellow"... | [
"sqlite3.connect"
] | [((1733, 1762), 'sqlite3.connect', 'sqlite3.connect', (['self.db_file'], {}), '(self.db_file)\n', (1748, 1762), False, 'import sqlite3\n'), ((2414, 2443), 'sqlite3.connect', 'sqlite3.connect', (['self.db_file'], {}), '(self.db_file)\n', (2429, 2443), False, 'import sqlite3\n'), ((3411, 3440), 'sqlite3.connect', 'sqlite... |
#!/usr/bin/env python
"""print repo topics"""
import click
import github_topics
MODULE_NAME = "github_topics.get"
USAGE = 'python -m %s fullname' % MODULE_NAME
PROG_NAME = 'python -m %s' % USAGE
@click.command()
@click.argument('fullname')
def _cli(fullname):
topics = github_topics.get(fullname)
if topics:
... | [
"github_topics.get",
"click.argument",
"click.command"
] | [((199, 214), 'click.command', 'click.command', ([], {}), '()\n', (212, 214), False, 'import click\n'), ((216, 242), 'click.argument', 'click.argument', (['"""fullname"""'], {}), "('fullname')\n", (230, 242), False, 'import click\n'), ((276, 303), 'github_topics.get', 'github_topics.get', (['fullname'], {}), '(fullname... |
#
# Copyright (c) 2018 Juniper Networks, Inc. All rights reserved.
#
"""Contains common logger initialization to be used in job mgr internals."""
import logging
DEFAULT_JOB_MGR_LOG_PATH = '/var/log/contrail/contrail-fabric-ansible.log'
DATE_FORMAT = "%m/%d/%Y %I:%M:%S %p"
LOGGING_FORMAT = '%(asctime)s [%(name)s] [%(... | [
"logging.Formatter",
"logging.FileHandler",
"logging.getLogger"
] | [((430, 453), 'logging.getLogger', 'logging.getLogger', (['name'], {}), '(name)\n', (447, 453), False, 'import logging\n'), ((468, 513), 'logging.FileHandler', 'logging.FileHandler', (['DEFAULT_JOB_MGR_LOG_PATH'], {}), '(DEFAULT_JOB_MGR_LOG_PATH)\n', (487, 513), False, 'import logging\n'), ((530, 588), 'logging.Formatt... |
# Generated by Django 3.0.5 on 2020-04-02 10:28
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='PassModel',
fields=[
... | [
"django.db.models.CharField",
"django.db.models.AutoField",
"django.db.models.ImageField",
"django.db.models.IntegerField",
"django.db.models.DateTimeField"
] | [((334, 427), 'django.db.models.AutoField', 'models.AutoField', ([], {'auto_created': '(True)', 'primary_key': '(True)', 'serialize': '(False)', 'verbose_name': '"""ID"""'}), "(auto_created=True, primary_key=True, serialize=False,\n verbose_name='ID')\n", (350, 427), False, 'from django.db import migrations, models\... |
"""Includes function to compare abstracts."""
from weighted_levenshtein import lev
def lev_similarity(aa: str, bb: str) -> float:
"""
Get a Levenshtein similarity score.
:param aa: first string
:param bb: second string
:return: The similarity of the two strings (0=bad, 1=match):
1- l... | [
"weighted_levenshtein.lev"
] | [((853, 864), 'weighted_levenshtein.lev', 'lev', (['aa', 'bb'], {}), '(aa, bb)\n', (856, 864), False, 'from weighted_levenshtein import lev\n')] |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# 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/LICENS... | [
"spatialmedia.mpeg.box.Box.__init__",
"struct.pack"
] | [((2549, 2571), 'spatialmedia.mpeg.box.Box.__init__', 'box.Box.__init__', (['self'], {}), '(self)\n', (2565, 2571), False, 'from spatialmedia.mpeg import box\n'), ((6608, 6639), 'struct.pack', 'struct.pack', (['""">B"""', 'self.version'], {}), "('>B', self.version)\n", (6619, 6639), False, 'import struct\n'), ((6662, 6... |
from django.core.management.base import BaseCommand
from django.db import connections
from symposion.reviews.models import ProposalResult, promote_proposal
class Command(BaseCommand):
def handle(self, *args, **options):
accepted_proposals = ProposalResult.objects.filter(status="accepted")
ac... | [
"symposion.reviews.models.promote_proposal",
"symposion.reviews.models.ProposalResult.objects.filter"
] | [((261, 309), 'symposion.reviews.models.ProposalResult.objects.filter', 'ProposalResult.objects.filter', ([], {'status': '"""accepted"""'}), "(status='accepted')\n", (290, 309), False, 'from symposion.reviews.models import ProposalResult, promote_proposal\n'), ((442, 475), 'symposion.reviews.models.promote_proposal', '... |
from __future__ import print_function, division
import abc
import numpy as np
class StreamProcessor(object):
"""Base class for stream processors"""
def __call__(self, items):
"""Processed the whole stream of items.
Args:
items (Iterable(object)) the stream of items to process.
... | [
"numpy.random.randint",
"numpy.random.random",
"numpy.random.seed"
] | [((917, 937), 'numpy.random.seed', 'np.random.seed', (['seed'], {}), '(seed)\n', (931, 937), True, 'import numpy as np\n'), ((1171, 1189), 'numpy.random.random', 'np.random.random', ([], {}), '()\n', (1187, 1189), True, 'import numpy as np\n'), ((1243, 1274), 'numpy.random.randint', 'np.random.randint', (['(0)', 'self.... |
import seaborn as sns
import matplotlib.pyplot as plt
import plotly.express as px
import pandas as pd
def plot_hist(df: pd.DataFrame, column: str, color: str) -> None:
plt.figure(figsize=(9, 7))
sns.displot(data=df, x=column, color=color, kde=True, height=7, aspect=2)
plt.title(f'Distribution of {column}',... | [
"matplotlib.pyplot.title",
"seaborn.displot",
"matplotlib.pyplot.show",
"seaborn.heatmap",
"seaborn.scatterplot",
"matplotlib.pyplot.yticks",
"seaborn.barplot",
"matplotlib.pyplot.figure",
"seaborn.boxplot",
"seaborn.countplot",
"seaborn.distplot",
"matplotlib.pyplot.ylabel",
"matplotlib.pyp... | [((173, 199), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'figsize': '(9, 7)'}), '(figsize=(9, 7))\n', (183, 199), True, 'import matplotlib.pyplot as plt\n'), ((204, 277), 'seaborn.displot', 'sns.displot', ([], {'data': 'df', 'x': 'column', 'color': 'color', 'kde': '(True)', 'height': '(7)', 'aspect': '(2)'}), '(da... |
#!/usr/bin/python
# -*- coding: latin-1 -*-
"Module to show how to handle exceptions"
# This line must be at the beginning of the file
from __future__ import print_function
import sys
def GenericException():
"Generic and simple use of exceptions"
try:
a = 10 / 0
except:
print( "Exception" )
def Ge... | [
"sys.exit"
] | [((2632, 2644), 'sys.exit', 'sys.exit', (['rc'], {}), '(rc)\n', (2640, 2644), False, 'import sys\n')] |
from setuptools import setup
with open("README.md", "r") as readme_file:
readme = readme_file.read()
setup(
name="uitestcore",
version="7.0.2",
description="Package providing common functionality for UI automation test packs",
long_description=readme,
long_description_content_type="text/markdo... | [
"setuptools.setup"
] | [((107, 788), 'setuptools.setup', 'setup', ([], {'name': '"""uitestcore"""', 'version': '"""7.0.2"""', 'description': '"""Package providing common functionality for UI automation test packs"""', 'long_description': 'readme', 'long_description_content_type': '"""text/markdown"""', 'license': '"""MIT"""', 'homepage': '""... |
import sys
import os
from datetime import datetime
import argparse
import pandas as pd
from Bio import Restriction
from Bio.Seq import Seq
from Bio import SeqIO
def partition(alist, indices):
"""A function to split a list based on item indices
Parameters:
-----------------------------
: alis... | [
"pandas.DataFrame",
"Bio.SeqIO.parse",
"os.makedirs",
"argparse.ArgumentParser",
"os.path.basename",
"Bio.Restriction.NlaIII.search",
"os.path.splitext"
] | [((3448, 3470), 'pandas.DataFrame', 'pd.DataFrame', (['new_rows'], {}), '(new_rows)\n', (3460, 3470), True, 'import pandas as pd\n'), ((3879, 3920), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': 'desc'}), '(description=desc)\n', (3902, 3920), False, 'import argparse\n'), ((5104, 5157), 'os.... |
import numpy as np
from config import FEEDRATE, X_STEP, Y_STEP, HEIGHT, WIDTH
# TO DO:
# * We assume that the head's nozzles extend along the Y direction.
# (This is apparently the case.)
def array_to_gcode(array):
"""Convert numpy array into a sequence of gcodes, saved to file."""
assert isinstanc... | [
"numpy.any",
"numpy.ceil",
"numpy.all"
] | [((1442, 1468), 'numpy.all', 'np.all', (['(firing_column == 0)'], {}), '(firing_column == 0)\n', (1448, 1468), True, 'import numpy as np\n'), ((477, 499), 'numpy.ceil', 'np.ceil', (['(height / 12.0)'], {}), '(height / 12.0)\n', (484, 499), True, 'import numpy as np\n'), ((1513, 1539), 'numpy.any', 'np.any', (['(firing_... |
# -*- coding: utf-8 -*-
import os
import re
import sys
from ast import parse
from inspect import getmembers, isfunction
from unittest.mock import MagicMock
from sphinx.ext.napoleon.docstring import GoogleDocstring
confpath = os.path.dirname(__file__)
sys.path.append(confpath)
from docutil import insert_inheritance_d... | [
"sys.path.append",
"docutil.package_classes",
"os.path.abspath",
"os.path.join",
"unittest.mock.MagicMock",
"os.path.dirname",
"sys.path.insert",
"os.environ.get",
"matplotlib.use",
"re.sub",
"docutil.insert_inheritance_diagram",
"inspect.getmembers"
] | [((228, 253), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (243, 253), False, 'import os\n'), ((254, 279), 'sys.path.append', 'sys.path.append', (['confpath'], {}), '(confpath)\n', (269, 279), False, 'import sys\n'), ((1539, 1564), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '... |
#!/usr/bin/env python
"""
I2C ROS 2 Node.
This node subscribes ROS-Messages to send data over I2C
I2C:
http://www.netzmafia.de/skripten/hardware/RasPi/RasPi_I2C.html
and
https://raspberry-projects.com/pi/programming-in-python/i2c-programming-in-python/using-the-i2c-interface-2
"""
import os
import sys
import ... | [
"rclpy.spin",
"rclpy.init",
"time.sleep",
"rclpy.shutdown",
"threading.Semaphore",
"rclpy.get_default_context",
"smbus.SMBus"
] | [((561, 582), 'threading.Semaphore', 'threading.Semaphore', ([], {}), '()\n', (580, 582), False, 'import threading\n'), ((4494, 4515), 'rclpy.init', 'rclpy.init', ([], {'args': 'args'}), '(args=args)\n', (4504, 4515), False, 'import rclpy\n'), ((4555, 4571), 'rclpy.spin', 'rclpy.spin', (['node'], {}), '(node)\n', (4565... |
#-----------------------------------------------------------------------------
# Copyright (c) 2005-2015, PyInstaller Development Team.
#
# Distributed under the terms of the GNU General Public License with exception
# for distributing bootloader.
#
# The full license is in the file COPYING.txt, distributed with this s... | [
"sys.platform.startswith",
"pyi_get_datadir.get_data_dir"
] | [((602, 634), 'sys.platform.startswith', 'sys.platform.startswith', (['"""win32"""'], {}), "('win32')\n", (625, 634), False, 'import sys\n'), ((671, 704), 'sys.platform.startswith', 'sys.platform.startswith', (['"""darwin"""'], {}), "('darwin')\n", (694, 704), False, 'import sys\n'), ((895, 909), 'pyi_get_datadir.get_d... |
#!/usr/bin/env python3
import requests
from requests.auth import HTTPBasicAuth
from flask import Flask, request, jsonify
NEXMO_API_KEY = ''
NEXMO_API_SECRET = ''
app = Flask(__name__)
template1 = '''
<html>
<head>
<title>Audit Event Types</title>
</head>
<body>
<form action='/events' method='get'>
... | [
"requests.auth.HTTPBasicAuth",
"flask.Flask"
] | [((171, 186), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (176, 186), False, 'from flask import Flask, request, jsonify\n'), ((896, 942), 'requests.auth.HTTPBasicAuth', 'HTTPBasicAuth', (['NEXMO_API_KEY', 'NEXMO_API_SECRET'], {}), '(NEXMO_API_KEY, NEXMO_API_SECRET)\n', (909, 942), False, 'from requests.... |
'''
实验名称:OLED显示屏(I2C总线)
版本:v1.0
日期:2021.4
作者:01Studio
实验平台:达芬奇
社区:www.01studio.org
'''
from machine import SoftI2C,Pin #从machine模块导入SoftI2C、Pin子模块
from ssd1306 import SSD1306_I2C #从ssd1306模块中导入SSD1306_I2C子模块
i2c = SoftI2C(scl='B2', sda='B0') #SoftI2C初始化:scl--> PB2, sda --> PB0
oled = SSD1306_I2C(128, 6... | [
"ssd1306.SSD1306_I2C",
"machine.SoftI2C"
] | [((229, 256), 'machine.SoftI2C', 'SoftI2C', ([], {'scl': '"""B2"""', 'sda': '"""B0"""'}), "(scl='B2', sda='B0')\n", (236, 256), False, 'from machine import SoftI2C, Pin\n'), ((302, 336), 'ssd1306.SSD1306_I2C', 'SSD1306_I2C', (['(128)', '(64)', 'i2c'], {'addr': '(60)'}), '(128, 64, i2c, addr=60)\n', (313, 336), False, '... |
import copy
from typing import List, Dict
import numpy as np
from prettytable import PrettyTable
from ase import Atoms
from dscribe.descriptors import SineMatrix
from dscribe.descriptors import CoulombMatrix
from dscribe.descriptors import ACSF
from dscribe.descriptors import SOAP
from matminer.featurizers.compositio... | [
"copy.deepcopy",
"pymatgen.io.ase.AseAtomsAdaptor",
"numpy.array",
"prettytable.PrettyTable",
"pymatgen.core.periodic_table.Element",
"numpy.concatenate"
] | [((2141, 2154), 'prettytable.PrettyTable', 'PrettyTable', ([], {}), '()\n', (2152, 2154), False, 'from prettytable import PrettyTable\n'), ((8201, 8213), 'numpy.array', 'np.array', (['[]'], {}), '([])\n', (8209, 8213), True, 'import numpy as np\n'), ((8007, 8024), 'pymatgen.io.ase.AseAtomsAdaptor', 'AseAtomsAdaptor', (... |
from django.contrib import admin
from omap.assets.models import SimpleAsset, RelationType, AssetRelation
admin.site.register(SimpleAsset)
admin.site.register(RelationType)
admin.site.register(AssetRelation)
| [
"django.contrib.admin.site.register"
] | [((107, 139), 'django.contrib.admin.site.register', 'admin.site.register', (['SimpleAsset'], {}), '(SimpleAsset)\n', (126, 139), False, 'from django.contrib import admin\n'), ((140, 173), 'django.contrib.admin.site.register', 'admin.site.register', (['RelationType'], {}), '(RelationType)\n', (159, 173), False, 'from dj... |
# _________________________________________________________________________
#
# PyUtilib: A Python utility library.
# Copyright (c) 2008 Sandia Corporation.
# This software is distributed under the BSD License.
# Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
# the U.S. Government retains ... | [
"pyutilib.component.core.PluginGlobals.pop_env",
"pyutilib.component.core.PluginGlobals.add_env"
] | [((708, 736), 'pyutilib.component.core.PluginGlobals.add_env', 'PluginGlobals.add_env', (['"""pca"""'], {}), "('pca')\n", (729, 736), False, 'from pyutilib.component.core import PluginGlobals\n'), ((1295, 1318), 'pyutilib.component.core.PluginGlobals.pop_env', 'PluginGlobals.pop_env', ([], {}), '()\n', (1316, 1318), Fa... |
#!/usr/bin/env python
from django.utils.translation import ugettext as _
class DatasetLockedError(Exception):
"""
Exception raised when a lock can not be acquired on a dataset.
"""
pass
class DataUploadNotDeletable(Exception):
"""
Exception raised when a DataUpload can not be deleted.
"""
... | [
"django.utils.translation.ugettext"
] | [((1207, 1265), 'django.utils.translation.ugettext', '_', (['"""Unable to convert "%(value)s" to type %(normal_type)s"""'], {}), '(\'Unable to convert "%(value)s" to type %(normal_type)s\')\n', (1208, 1265), True, 'from django.utils.translation import ugettext as _\n')] |
#!/usr/bin/env python
from __future__ import unicode_literals
import unittest
from securetrading.test import abstract_test
import glob
import os
try:
import pep8
except ImportError:
pep8 = None
class Test_CodeFormat(abstract_test.TestCase):
def get_files(self, directory):
return glob.glob(os.pat... | [
"unittest.main",
"pep8.StyleGuide",
"os.path.join",
"os.path.exists"
] | [((1600, 1615), 'unittest.main', 'unittest.main', ([], {}), '()\n', (1613, 1615), False, 'import unittest\n'), ((314, 345), 'os.path.join', 'os.path.join', (['directory', '"""*.py"""'], {}), "(directory, '*.py')\n", (326, 345), False, 'import os\n'), ((701, 735), 'os.path.join', 'os.path.join', (['base_path', 'director... |
import os
import re
import zmq
from zmq.utils import jsonapi
from tornado.queues import Queue
from tornado.locks import Event
from IPython.core.getipython import get_ipython
from IPython.core.inputtransformer2 import leading_empty_lines
try:
from jupyter_client.jsonutil import json_default
except ImportError:
... | [
"zmq.utils.jsonapi.dumps",
"IPython.core.getipython.get_ipython",
"os.makedirs",
"_pydevd_bundle.pydevd_frame_utils.create_frames_list_from_frame",
"tornado.queues.Queue",
"os.path.exists",
"zmq.utils.jsonapi.loads",
"os.path.isfile",
"_pydevd_bundle.pydevd_suspended_frames._FramesTracker",
"_pyde... | [((1270, 1302), '_pydevd_bundle.pydevd_api.PyDevdAPI.VariablePresentation', 'PyDevdAPI.VariablePresentation', ([], {}), '()\n', (1300, 1302), False, 'from _pydevd_bundle.pydevd_api import PyDevdAPI\n'), ((1392, 1416), '_pydevd_bundle.pydevd_suspended_frames.SuspendedFramesManager', 'SuspendedFramesManager', ([], {}), '... |
# coding=utf-8
# Copyright 2019 The Weak Disentangle Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | [
"tensorflow.random.uniform",
"tensorflow.random.normal",
"weak_disentangle.tensorsketch.utils.compute_fan",
"weak_disentangle.tensorsketch.utils.compute_out_dims",
"tensorflow.matmul",
"collections.OrderedDict",
"tensorflow.nn.bias_add",
"numpy.sqrt"
] | [((1612, 1625), 'collections.OrderedDict', 'OrderedDict', ([], {}), '()\n', (1623, 1625), False, 'from collections import OrderedDict\n'), ((2172, 2200), 'weak_disentangle.tensorsketch.utils.compute_fan', 'tsu.compute_fan', (['self.kernel'], {}), '(self.kernel)\n', (2187, 2200), True, 'from weak_disentangle.tensorsketc... |
# -*- coding: utf-8 -*-
"""
sphinx.builders.htmlhelp
~~~~~~~~~~~~~~~~~~~~~~~~
Build HTML help support files.
Parts adapted from Python's Doc/tools/prechm.py.
:copyright: Copyright 2007-2016 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from __future__ import prin... | [
"sphinx.builders.html.StandaloneHTMLBuilder.init",
"os.walk",
"os.path.join",
"sphinx.util.pycompat.htmlescape"
] | [((5069, 5101), 'sphinx.builders.html.StandaloneHTMLBuilder.init', 'StandaloneHTMLBuilder.init', (['self'], {}), '(self)\n', (5095, 5101), False, 'from sphinx.builders.html import StandaloneHTMLBuilder\n'), ((5530, 5557), 'os.path.join', 'path.join', (['outdir', 'basename'], {}), '(outdir, basename)\n', (5539, 5557), F... |
from django.http.response import Http404
from rest_framework.response import Response
from rest_framework import status
from core.abstract.viewsets import AbstractViewSet
from core.comment.models import Comment
from core.comment.serializers import CommentSerializer
from core.auth.permissions import UserPermission
c... | [
"core.comment.models.Comment.objects.get_object_by_public_id",
"core.comment.models.Comment.objects.filter",
"rest_framework.response.Response",
"core.comment.models.Comment.objects.all"
] | [((728, 775), 'core.comment.models.Comment.objects.filter', 'Comment.objects.filter', ([], {'post__public_id': 'post_pk'}), '(post__public_id=post_pk)\n', (750, 775), False, 'from core.comment.models import Comment\n'), ((842, 900), 'core.comment.models.Comment.objects.get_object_by_public_id', 'Comment.objects.get_obj... |
"""Provides a Random wrapper that has a seed access method."""
from random import Random
class RandomWithSeed(Random):
"""Stupid class just to be able to get the seed value, which doesnt work anyway"""
def __init__(self, x):
Random.__init__(self, x)
def seed(self, a=None, version=2):
self... | [
"random.Random.__init__"
] | [((243, 267), 'random.Random.__init__', 'Random.__init__', (['self', 'x'], {}), '(self, x)\n', (258, 267), False, 'from random import Random\n')] |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Loads tilemaps, slices, returns a dict with x,y coordinates as keys
import sys
from math import ceil
import pygame
import pygame.locals
import argparse
# grab a module instance
this = sys.modules[__name__]
def cli():
parser = argparse.ArgumentParser()
parser.... | [
"pygame.event.wait",
"argparse.ArgumentParser",
"math.ceil",
"pygame.display.set_mode",
"pygame.init",
"pygame.display.flip",
"pygame.image.load",
"sys.exit"
] | [((283, 308), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (306, 308), False, 'import argparse\n'), ((2092, 2105), 'pygame.init', 'pygame.init', ([], {}), '()\n', (2103, 2105), False, 'import pygame\n'), ((2119, 2155), 'pygame.display.set_mode', 'pygame.display.set_mode', (['(1024, 768)'], {}... |
# Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | [
"tensorflow.lite.testing.zip_test_utils.get_input_shapes_map",
"tempfile.NamedTemporaryFile",
"tensorflow.compat.v1.lite.TocoConverter.from_frozen_graph",
"os.system",
"traceback.format_exc",
"tensorflow.compat.v1.lite.experimental.convert_op_hints_to_stubs",
"tensorflow.lite.testing.zip_test_utils.Extr... | [((3357, 3434), 'tensorflow.compat.v1.lite.experimental.convert_op_hints_to_stubs', 'tf.compat.v1.lite.experimental.convert_op_hints_to_stubs', ([], {'graph_def': 'graph_def'}), '(graph_def=graph_def)\n', (3413, 3434), True, 'import tensorflow as tf\n'), ((1542, 1575), 'tensorflow.lite.testing.zip_test_utils.ExtraTocoO... |
import sys, threading
from queue import Queue
_current_fiber = None
def set_current_fiber(f):
global _current_fiber
_current_fiber = f
def current():
global _current_fiber
if _current_fiber is None:
_current_fiber = _create_main_fiber()
return _current_fiber
class Fiber:
def __ini... | [
"threading.Thread",
"threading.current_thread",
"queue.Queue",
"sys.exc_info"
] | [((2203, 2229), 'threading.current_thread', 'threading.current_thread', ([], {}), '()\n', (2227, 2229), False, 'import sys, threading\n'), ((2262, 2269), 'queue.Queue', 'Queue', ([], {}), '()\n', (2267, 2269), False, 'from queue import Queue\n'), ((922, 929), 'queue.Queue', 'Queue', ([], {}), '()\n', (927, 929), False,... |
#!/usr/bin/env python
#
# Copyright (c) 2015, Linaro Limited
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this li... | [
"Crypto.Hash.SHA256.new",
"Crypto.Signature.PKCS1_v1_5.new",
"argparse.ArgumentParser",
"struct.pack"
] | [((1428, 1444), 'argparse.ArgumentParser', 'ArgumentParser', ([], {}), '()\n', (1442, 1444), False, 'from argparse import ArgumentParser\n'), ((1987, 2006), 'Crypto.Signature.PKCS1_v1_5.new', 'PKCS1_v1_5.new', (['key'], {}), '(key)\n', (2001, 2006), False, 'from Crypto.Signature import PKCS1_v1_5\n'), ((2012, 2024), 'C... |
import unittest
import ray
from ray.rllib.agents.registry import get_agent_class
from ray.rllib.examples.env.multi_agent import MultiAgentCartPole, \
MultiAgentMountainCar
from ray.rllib.utils.test_utils import framework_iterator
from ray.tune import register_env
def check_support_multiagent(alg, config):
re... | [
"ray.init",
"ray.rllib.examples.env.multi_agent.MultiAgentCartPole",
"pytest.main",
"ray.rllib.utils.test_utils.framework_iterator",
"ray.shutdown",
"ray.rllib.examples.env.multi_agent.MultiAgentMountainCar",
"ray.rllib.agents.registry.get_agent_class"
] | [((581, 635), 'ray.rllib.utils.test_utils.framework_iterator', 'framework_iterator', (['config'], {'frameworks': "('tf', 'torch')"}), "(config, frameworks=('tf', 'torch'))\n", (599, 635), False, 'from ray.rllib.utils.test_utils import framework_iterator\n'), ((1030, 1076), 'ray.init', 'ray.init', ([], {'num_cpus': '(4)... |
import numpy as np
import pandas as pd
import SimpleITK as sitk
import matplotlib.pyplot as plt
from sklearn import cluster
def show_one(img):
"""
Display a single 2D image without calling plt.show() to open in the browser
:param img: The 2D image to be shown
:return: None
"""
dpi = 40
ma... | [
"SimpleITK.BinaryThreshold",
"matplotlib.pyplot.show",
"pandas.DataFrame.from_dict",
"sklearn.cluster.KMeans",
"SimpleITK.GetArrayFromImage",
"SimpleITK.RescaleIntensity",
"SimpleITK.LabelOverlay",
"matplotlib.pyplot.figure",
"SimpleITK.CurvatureFlow",
"matplotlib.pyplot.set_cmap",
"pandas.Serie... | [((342, 369), 'SimpleITK.GetArrayFromImage', 'sitk.GetArrayFromImage', (['img'], {}), '(img)\n', (364, 369), True, 'import SimpleITK as sitk\n'), ((506, 542), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'figsize': 'figsize', 'dpi': 'dpi'}), '(figsize=figsize, dpi=dpi)\n', (516, 542), True, 'import matplotlib.pyplot... |
import codecs
import os
import re
from setuptools import setup
here = os.path.abspath(os.path.dirname(__file__))
def read(*parts):
"""Read parts of a file
Taken from pip's setup.py
intentionally *not* adding an encoding option to open
see: https://github.com/pypa/virtualenv/issues/201#issuecomment-... | [
"os.path.join",
"os.path.dirname",
"re.search",
"pypandoc.convert"
] | [((88, 113), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (103, 113), False, 'import os\n'), ((685, 758), 're.search', 're.search', (['"""^__version__ = [\'\\\\"]([^\'\\\\"]*)[\'\\\\"]"""', 'version_file', 're.M'], {}), '(\'^__version__ = [\\\'\\\\"]([^\\\'\\\\"]*)[\\\'\\\\"]\', version_fil... |
from distutils.core import setup
setup (name = "HDF5Tools",
author="<NAME>",
version='1.0',
description = "Utilities for HDF5 manipulation, requires h5dump to be present on system",
url = "http://cdat.sourceforge.net",
packages = ['HDF5Tools'],
package_dir = {'HDF5Tools': 'Lib... | [
"distutils.core.setup"
] | [((34, 284), 'distutils.core.setup', 'setup', ([], {'name': '"""HDF5Tools"""', 'author': '"""<NAME>"""', 'version': '"""1.0"""', 'description': '"""Utilities for HDF5 manipulation, requires h5dump to be present on system"""', 'url': '"""http://cdat.sourceforge.net"""', 'packages': "['HDF5Tools']", 'package_dir': "{'HDF... |
#!/usr/bin/env python
"""Apply standard license headers and generate contributor list.
Rather than trying to maintain file-level lists of contributors and copyright
dates, apply a standard license header that points to the LICENSE file for the
licensing details. And then generate the LICENSE file with a complete list... | [
"subprocess.run",
"pathlib.Path",
"shlex.split"
] | [((1031, 1082), 'shlex.split', 'shlex.split', (['"""git log --use-mailmap --format=short"""'], {}), "('git log --use-mailmap --format=short')\n", (1042, 1082), False, 'import shlex\n'), ((1093, 1155), 'subprocess.run', 'subprocess.run', (['gitargs'], {'capture_output': '(True)', 'encoding': '"""utf-8"""'}), "(gitargs, ... |
#!/usr/bin/python3
import json
import logging as l
import os
import random
import threading
import time
import math
import urllib.error
import urllib.request
display = None
try:
import pygame
pygame.init()
display = pygame.display.set_mode((100, 100))
NOGUI = False
except ImportError:
l.warning("E... | [
"pygame.draw.arc",
"json.dump",
"logging.error",
"pygame.Surface",
"json.loads",
"random.randint",
"logging.warning",
"pygame.display.set_mode",
"pygame.Color",
"pygame.Rect",
"pygame.init",
"pygame.display.flip",
"time.time",
"pygame.time.Clock",
"os.chdir"
] | [((202, 215), 'pygame.init', 'pygame.init', ([], {}), '()\n', (213, 215), False, 'import pygame\n'), ((230, 265), 'pygame.display.set_mode', 'pygame.display.set_mode', (['(100, 100)'], {}), '((100, 100))\n', (253, 265), False, 'import pygame\n'), ((4064, 4078), 'os.chdir', 'os.chdir', (['""".."""'], {}), "('..')\n", (4... |
from app.db import db, BaseModelMixin
from flask_jwt_extended import create_access_token
import datetime
class Auth(db.Model, BaseModelMixin):
id = db.Column(db.Integer, primary_key=True)
token = db.Column(db.Text, unique=True)
user_id = db.Column(db.Integer, db.ForeignKey('user.id'))
created_at = db.Column(db.Dat... | [
"app.db.db.Column",
"flask_jwt_extended.create_access_token",
"app.db.db.ForeignKey"
] | [((150, 189), 'app.db.db.Column', 'db.Column', (['db.Integer'], {'primary_key': '(True)'}), '(db.Integer, primary_key=True)\n', (159, 189), False, 'from app.db import db, BaseModelMixin\n'), ((199, 230), 'app.db.db.Column', 'db.Column', (['db.Text'], {'unique': '(True)'}), '(db.Text, unique=True)\n', (208, 230), False,... |
import math
from systems.system import System
from scripts.callbacks import *
from scripts.components import *
from scripts import character
from joystick import *
class Movement(System):
def __init__(self, engine):
System.__init__(self, engine)
self.callbacks = {JOY_STICK: self.on_joystick,
... | [
"systems.system.System.__init__",
"math.cos",
"math.sin"
] | [((232, 261), 'systems.system.System.__init__', 'System.__init__', (['self', 'engine'], {}), '(self, engine)\n', (247, 261), False, 'from systems.system import System\n'), ((907, 921), 'math.cos', 'math.cos', (['rads'], {}), '(rads)\n', (915, 921), False, 'import math\n'), ((956, 970), 'math.sin', 'math.sin', (['rads']... |
from unittest import TestCase
from picea import Sequence, SequenceReader, SequenceCollection,\
MultipleSequenceAlignment, alphabets
class SequenceTests(TestCase):
def setUp(self):
self.fasta = '>A\nABC\n>B\nDEF'
self.json = (
'[{"header":"A","sequence":"ABC"},'
'{"head... | [
"picea.Sequence",
"picea.MultipleSequenceAlignment",
"picea.SequenceReader",
"picea.SequenceCollection",
"picea.SequenceCollection.from_json",
"picea.MultipleSequenceAlignment.from_json",
"picea.MultipleSequenceAlignment.from_fasta",
"picea.SequenceCollection.from_sequence_iter",
"picea.SequenceColl... | [((571, 622), 'picea.SequenceReader', 'SequenceReader', ([], {'string': 'self.fasta', 'filetype': '"""fasta"""'}), "(string=self.fasta, filetype='fasta')\n", (585, 622), False, 'from picea import Sequence, SequenceReader, SequenceCollection, MultipleSequenceAlignment, alphabets\n'), ((699, 748), 'picea.SequenceReader',... |
from collections import deque
from itertools import count, tee
import time as ttime
from event_model import DocumentNames
from .log import doc_logger
from .utils import (
new_uid,
IllegalMessageSequence,
_rearrange_into_parallel_dicts,
short_uid,
Msg,
)
class RunBundler:
def __init__(self, md,... | [
"itertools.count",
"time.time",
"event_model.DocumentNames",
"itertools.tee",
"collections.deque"
] | [((645, 652), 'collections.deque', 'deque', ([], {}), '()\n', (650, 652), False, 'from collections import deque\n'), ((709, 716), 'collections.deque', 'deque', ([], {}), '()\n', (714, 716), False, 'from collections import deque\n'), ((786, 793), 'collections.deque', 'deque', ([], {}), '()\n', (791, 793), False, 'from c... |
import streamlit as st
from collections import defaultdict
from kafka import KafkaConsumer
from json import loads
import time
import numpy as np
from datetime import datetime
import matplotlib.pyplot as plt
import plotly.graph_objects as go
import plotly.express as px
import pandas as pd
import PIL
from PIL import Imag... | [
"streamlit.balloons",
"streamlit.image",
"pandas.read_csv",
"plotly.express.scatter_mapbox",
"collections.defaultdict",
"numpy.around",
"pickle.load",
"numpy.arange",
"numpy.mean",
"pandas.DataFrame",
"datetime.datetime.fromisoformat",
"numpy.std",
"numpy.finfo",
"streamlit.beta_columns",
... | [((541, 908), 'streamlit.markdown', 'st.markdown', (['f"""\n<style>\n .reportview-container .main .block-container{{\n max-width: 100vw;\n padding-top: 1rem;\n padding-right: 1rem;\n padding-left: 1rem;\n padding-bottom: 1rem;\n }}\n .reportview-container .main {{\n co... |
from threading import currentThread
from typing import Callable, Any
from twisted.internet.threads import deferToThread
from mdstudio.deferred.chainable import Chainable
from mdstudio.util.exception import MDStudioException
def make_deferred(method):
# type: (Callable) -> Callable[Any, Chainable]
"""
An... | [
"mdstudio.util.exception.MDStudioException",
"twisted.internet.threads.deferToThread",
"threading.currentThread"
] | [((633, 676), 'mdstudio.util.exception.MDStudioException', 'MDStudioException', (['"""Not on the main thread"""'], {}), "('Not on the main thread')\n", (650, 676), False, 'from mdstudio.util.exception import MDStudioException\n'), ((702, 740), 'twisted.internet.threads.deferToThread', 'deferToThread', (['method', '*arg... |
# Source: https://github.com/joeduffy/aws-tags-example
import pulumi
from taggable import is_taggable
# register_auto_tags registers a global stack transformation that merges a set
# of tags with whatever was also explicitly added to the resource definition.
def register_auto_tags(auto_tags):
pulumi.runtime.regis... | [
"pulumi.ResourceTransformationResult",
"taggable.is_taggable"
] | [((501, 524), 'taggable.is_taggable', 'is_taggable', (['args.type_'], {}), '(args.type_)\n', (512, 524), False, 'from taggable import is_taggable\n'), ((614, 672), 'pulumi.ResourceTransformationResult', 'pulumi.ResourceTransformationResult', (['args.props', 'args.opts'], {}), '(args.props, args.opts)\n', (649, 672), Fa... |
#!/usr/bin/env python
from http.server import BaseHTTPRequestHandler,HTTPServer
from os import curdir,sep
PORT_NUMBER = 8080
class myHandler(BaseHTTPRequestHandler):
#Handler for the GET requests
def do_GET(self):
self.send_response(200)
self.send_header('Content-type','image/png')
self.end_headers()
#f = ... | [
"http.server.HTTPServer"
] | [((495, 535), 'http.server.HTTPServer', 'HTTPServer', (["('', PORT_NUMBER)", 'myHandler'], {}), "(('', PORT_NUMBER), myHandler)\n", (505, 535), False, 'from http.server import BaseHTTPRequestHandler, HTTPServer\n')] |
import tempfile
import time
from typing import Any, Dict, List, Optional
from asyncssh.process import SSHCompletedProcess
from tenacity import retry, stop_after_attempt, wait_random
from labfunctions import defaults
from labfunctions.cluster import ssh
from labfunctions.cluster.utils import ssh_from_settings
from lab... | [
"tempfile.TemporaryDirectory",
"tenacity.stop_after_attempt",
"labfunctions.types.agent.AgentRequest",
"labfunctions.utils.run_sync",
"labfunctions.conf.jtemplates.render_to_file",
"labfunctions.cluster.utils.ssh_from_settings",
"tenacity.wait_random",
"labfunctions.utils.get_version",
"labfunctions... | [((2556, 2627), 'labfunctions.utils.run_sync', 'run_sync', (['ssh.run_cmd', 'req.machine_ip', 'cmd'], {'keys': '[req.private_key_path]'}), '(ssh.run_cmd, req.machine_ip, cmd, keys=[req.private_key_path])\n', (2564, 2627), False, 'from labfunctions.utils import execute_cmd_no_block, get_version, run_sync\n'), ((2836, 29... |
from django.core.management.base import BaseCommand, CommandError
from email_user.models import EmailUser
from service_info_cms.utils import create_essential_pages
class Command(BaseCommand):
help = """
Create CMS pages which are required for basic functionality of the site.
"""
def handle(s... | [
"django.core.management.base.CommandError",
"service_info_cms.utils.create_essential_pages",
"email_user.models.EmailUser.objects.get"
] | [((492, 528), 'email_user.models.EmailUser.objects.get', 'EmailUser.objects.get', ([], {'email': 'args[0]'}), '(email=args[0])\n', (513, 528), False, 'from email_user.models import EmailUser\n'), ((537, 570), 'service_info_cms.utils.create_essential_pages', 'create_essential_pages', (['publisher'], {}), '(publisher)\n'... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = "Ringo"
'''
Aberration策略 (难度:初级)
参考: https://www.shinnytech.com/blog/aberration/
注: 该示例策略仅用于功能示范, 实盘时请根据自己的策略/经验进行修改
'''
from tqsdk import TqApi, TargetPosTask
from tqsdk.ta import BOLL
# 设置合约代码
SYMBOL = "DCE.i2001"
api = TqApi()
quote = api.get_quote(SYMBO... | [
"tqsdk.ta.BOLL",
"tqsdk.TargetPosTask",
"tqsdk.TqApi"
] | [((285, 292), 'tqsdk.TqApi', 'TqApi', ([], {}), '()\n', (290, 292), False, 'from tqsdk import TqApi, TargetPosTask\n'), ((420, 446), 'tqsdk.TargetPosTask', 'TargetPosTask', (['api', 'SYMBOL'], {}), '(api, SYMBOL)\n', (433, 446), False, 'from tqsdk import TqApi, TargetPosTask\n'), ((522, 541), 'tqsdk.ta.BOLL', 'BOLL', (... |