code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
import argparse
from .commands.util import request_wikipedia, request_wiktionary, title_print
from .commands.wikipedia.article import p_article
from .commands.wikipedia.http import p_get
from .commands.wikipedia.revision import p_revision_feed
from .commands.wikipedia.search import p_search
from .commands.wiktionary.h... | [
"argparse.ArgumentParser"
] | [((521, 651), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Wikimedia CLI"""', 'epilog': '"""\'wiki <command> -h\' for help on specific commands"""', 'prog': '"""wiki"""'}), '(description=\'Wikimedia CLI\', epilog=\n "\'wiki <command> -h\' for help on specific commands", prog=\'wiki\... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from ykdl.extractor import VideoExtractor
from ykdl.util.match import match1, matchall
from ykdl.util.html import get_content, get_location
from ykdl.videoinfo import VideoInfo
import json
def get_realurl(url):
location = get_location(url)
if location != url:
... | [
"ykdl.util.match.matchall",
"ykdl.videoinfo.VideoInfo",
"ykdl.util.html.get_location",
"ykdl.util.match.match1",
"ykdl.util.html.get_content"
] | [((275, 292), 'ykdl.util.html.get_location', 'get_location', (['url'], {}), '(url)\n', (287, 292), False, 'from ykdl.util.html import get_content, get_location\n'), ((365, 381), 'ykdl.util.html.get_content', 'get_content', (['url'], {}), '(url)\n', (376, 381), False, 'from ykdl.util.html import get_content, get_locatio... |
"""
Contains the `tracebranches` manage.py command.
"""
import json
from django.core.management.base import BaseCommand, CommandError
from sierra.management import relationtrees
from sierra.management.commands import makefixtures
INDENT = 2
class Command(BaseCommand):
"""
Run a `tracebranches` command fr... | [
"json.dumps",
"sierra.management.commands.makefixtures.get_model_from_string",
"sierra.management.relationtrees.trace_branches",
"django.core.management.base.CommandError"
] | [((1292, 1327), 'sierra.management.relationtrees.trace_branches', 'relationtrees.trace_branches', (['model'], {}), '(model)\n', (1320, 1327), False, 'from sierra.management import relationtrees\n'), ((1074, 1126), 'sierra.management.commands.makefixtures.get_model_from_string', 'makefixtures.get_model_from_string', (["... |
import re
import base64
import requests
from lxml import etree
from urllib.parse import urlparse
from bot import APPDRIVE_EMAIL, APPDRIVE_PASS, GDTOT_CRYPT
account = {
'email': APPDRIVE_EMAIL,
'passwd': APPDRIVE_PASS
}
def account_login(client, url, email, password):
data = {
'email': email,
... | [
"re.findall",
"urllib.parse.urlparse",
"requests.Session",
"lxml.etree.HTML"
] | [((743, 776), 're.findall', 're.findall', (['""">(.*?)<\\\\/li>"""', 'data'], {}), "('>(.*?)<\\\\/li>', data)\n", (753, 776), False, 'import re\n'), ((993, 1011), 'requests.Session', 'requests.Session', ([], {}), '()\n', (1009, 1011), False, 'import requests\n'), ((2651, 2669), 'requests.Session', 'requests.Session', (... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Aug 5 11:34:19 2016
@author: bcolsen
"""
from wtforms import validators
import numpy as np
import re
class DataLength():
def __init__(self, min=-1, max=-1, message=None):
self.min = min
self.max = max
if not message:
... | [
"numpy.array",
"wtforms.validators.ValidationError"
] | [((633, 673), 'wtforms.validators.ValidationError', 'validators.ValidationError', (['self.message'], {}), '(self.message)\n', (659, 673), False, 'from wtforms import validators\n'), ((1175, 1215), 'wtforms.validators.ValidationError', 'validators.ValidationError', (['self.message'], {}), '(self.message)\n', (1201, 1215... |
#!/usr/bin/python
from __future__ import division
import os
import sys
from multiprocessing import dummy as mp
from multiprocessing import Lock
from mutex import mutex
from copy import copy
import cv2
import rospy
from sensor_msgs.msg import Image
from geometry_msgs.msg import PoseStamped
from cv_bridge import CvBri... | [
"os.path.exists",
"rospy.init_node",
"multiprocessing.dummy.Process",
"cv_bridge.CvBridge",
"rospy.Time.now",
"rospy.Rate",
"rospy.spin",
"os.mkdir",
"multiprocessing.Lock",
"copy.copy",
"rospy.Subscriber"
] | [((2255, 2267), 'copy.copy', 'copy', (['cImage'], {}), '(cImage)\n', (2259, 2267), False, 'from copy import copy\n'), ((2453, 2471), 'copy.copy', 'copy', (['poseMsg.pose'], {}), '(poseMsg.pose)\n', (2457, 2471), False, 'from copy import copy\n'), ((2538, 2592), 'rospy.init_node', 'rospy.init_node', (['"""ImagePoseSubsc... |
"""
Copyright (c) 2018-2022 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 wri... | [
"re.compile",
"collections.Counter",
"numpy.array",
"numpy.linalg.norm",
"re.sub"
] | [((1158, 1200), 're.compile', 're.compile', (['"""\\\\b(a|an|the)\\\\b"""', 're.UNICODE'], {}), "('\\\\b(a|an|the)\\\\b', re.UNICODE)\n", (1168, 1200), False, 'import re\n'), ((1215, 1239), 're.sub', 're.sub', (['regex', '""" """', 'text'], {}), "(regex, ' ', text)\n", (1221, 1239), False, 'import re\n'), ((6070, 6116)... |
# -*- coding: utf-8 -*-
# Copyright (c) 2017, <NAME> and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class Plantilladegrupodeproductos(Document):
def validate(self):
from erpnext.utilities.transac... | [
"erpnext.utilities.transaction_base.validate_uom_is_integer"
] | [((363, 424), 'erpnext.utilities.transaction_base.validate_uom_is_integer', 'validate_uom_is_integer', (['self', '"""stock_uom"""', '"""qty"""', '"""BOM Item"""'], {}), "(self, 'stock_uom', 'qty', 'BOM Item')\n", (386, 424), False, 'from erpnext.utilities.transaction_base import validate_uom_is_integer\n')] |
import telebot
from telebot import types
chave = "<KEY>"
bot = telebot.TeleBot(chave)
@bot.message_handler(commands=["badalo"])
def responder(mensagem):
bot.reply_to(mensagem,"badalado em você")
@bot.message_handler(commands=["redes"])
def responder(mensagem):
bot.reply_to(mensagem,"Jownao se encontra atual... | [
"telebot.types.KeyboardButton",
"telebot.types.ReplyKeyboardMarkup",
"telebot.TeleBot"
] | [((64, 86), 'telebot.TeleBot', 'telebot.TeleBot', (['chave'], {}), '(chave)\n', (79, 86), False, 'import telebot\n'), ((972, 999), 'telebot.types.ReplyKeyboardMarkup', 'types.ReplyKeyboardMarkup', ([], {}), '()\n', (997, 999), False, 'from telebot import types\n'), ((1011, 1041), 'telebot.types.KeyboardButton', 'types.... |
#!/usr/bin/python2.7
# Copyright 2011 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... | [
"collections.OrderedDict",
"googleapis.codegen.utilities.CamelCase",
"googleapis.codegen.language_model.NamingPolicy"
] | [((7380, 7431), 'googleapis.codegen.language_model.NamingPolicy', 'language_model.NamingPolicy', ([], {'format_string': '"""{name}"""'}), "(format_string='{name}')\n", (7407, 7431), False, 'from googleapis.codegen import language_model\n'), ((7450, 7501), 'googleapis.codegen.language_model.NamingPolicy', 'language_mode... |
from concurrent import futures
import multiprocessing
def parexec(exec_func, nblocks, nthreads=None):
if nthreads is None:
nthreads = multiprocessing.cpu_count()
with futures.ThreadPoolExecutor(nthreads) as executor:
futures.wait([executor.submit(exec_func, i) for i in range(nblocks)])
| [
"concurrent.futures.ThreadPoolExecutor",
"multiprocessing.cpu_count"
] | [((148, 175), 'multiprocessing.cpu_count', 'multiprocessing.cpu_count', ([], {}), '()\n', (173, 175), False, 'import multiprocessing\n'), ((185, 221), 'concurrent.futures.ThreadPoolExecutor', 'futures.ThreadPoolExecutor', (['nthreads'], {}), '(nthreads)\n', (211, 221), False, 'from concurrent import futures\n')] |
#!/usr/bin/env python3
PKG = 'lg_keyboard'
NAME = 'test_onboard_router'
import time
import unittest
import rospy
from lg_msg_defs.msg import StringArray
from std_msgs.msg import Bool
from interactivespaces_msgs.msg import GenericMessage
from lg_common.test_helpers import gen_browser_window
from lg_common.test_helpe... | [
"lg_common.test_helpers.gen_scene",
"lg_common.test_helpers.gen_browser_window",
"rospy.Subscriber",
"rostest.rosrun",
"rospy.init_node",
"lg_common.test_helpers.gen_touch_window",
"lg_common.test_helpers.gen_scene_msg",
"time.sleep",
"interactivespaces_msgs.msg.GenericMessage",
"std_msgs.msg.Bool... | [((5121, 5142), 'rospy.init_node', 'rospy.init_node', (['NAME'], {}), '(NAME)\n', (5136, 5142), False, 'import rospy\n'), ((5147, 5160), 'time.sleep', 'time.sleep', (['(3)'], {}), '(3)\n', (5157, 5160), False, 'import time\n'), ((5165, 5215), 'rostest.rosrun', 'rostest.rosrun', (['PKG', 'NAME', 'TestOnboardRouterOnline... |
# For each run:
# - Pick 1 file from each parent dir (alphabet) for train
# - Pick 1 file from each parent dir (alphabet) for test
import os
import random
import logging
from pathlib import Path
from shutil import copyfile
OUTPUT_PATH = './data/omniglot/all_runs_unseen'
unseen_image_folder = './data/omniglot/images... | [
"os.listdir",
"pathlib.Path",
"os.path.join",
"random.seed",
"os.path.isdir",
"os.path.basename"
] | [((543, 560), 'random.seed', 'random.seed', (['SEED'], {}), '(SEED)\n', (554, 560), False, 'import random\n'), ((576, 611), 'os.listdir', 'os.listdir', (['supervised_image_folder'], {}), '(supervised_image_folder)\n', (586, 611), False, 'import os\n'), ((1972, 2003), 'os.listdir', 'os.listdir', (['unseen_image_folder']... |
# -*- coding: utf-8 -*-
'''
:codeauthor: <NAME> <<EMAIL>>
'''
# Import Python Libs
from __future__ import absolute_import, print_function, unicode_literals
# Import Salt Testing Libs
from tests.support.mixins import LoaderModuleMockMixin
from tests.support.unit import TestCase, skipIf
from tests.support.mock impo... | [
"salt.modules.haproxyconn.enable_server",
"salt.modules.haproxyconn.list_frontends",
"salt.modules.haproxyconn.set_weight",
"salt.modules.haproxyconn.list_servers",
"salt.modules.haproxyconn.show_backends",
"salt.modules.haproxyconn.show_frontends",
"salt.modules.haproxyconn.get_backend",
"salt.module... | [((2331, 2362), 'tests.support.unit.skipIf', 'skipIf', (['NO_MOCK', 'NO_MOCK_REASON'], {}), '(NO_MOCK, NO_MOCK_REASON)\n', (2337, 2362), False, 'from tests.support.unit import TestCase, skipIf\n'), ((2749, 2782), 'salt.modules.haproxyconn.list_servers', 'haproxyconn.list_servers', (['"""mysql"""'], {}), "('mysql')\n", ... |
# -*- coding: utf-8 -*-
# Define here the models for your scraped items
#
# See documentation in:
# http://doc.scrapy.org/en/latest/topics/items.html
import scrapy
class DrugregspiderItem(scrapy.Item):
# define the fields for your item here like:
# name = scrapy.Field()
#Торговое наименование
name ... | [
"scrapy.Field"
] | [((335, 349), 'scrapy.Field', 'scrapy.Field', ([], {}), '()\n', (347, 349), False, 'import scrapy\n'), ((412, 426), 'scrapy.Field', 'scrapy.Field', ([], {}), '()\n', (424, 426), False, 'import scrapy\n'), ((474, 488), 'scrapy.Field', 'scrapy.Field', ([], {}), '()\n', (486, 488), False, 'import scrapy\n'), ((543, 557), ... |
from flask import Flask, request, render_template
from flask_cors import CORS
import os
import json
from GeometrA.src import WORKSPACE as ws
from GeometrA.src.Record import *
from GeometrA.src.path import GEOMETRA_ROOT, RESOURCE_PATH
app = Flask(__name__)
CORS(app)
LOG_FILE_NAME = 'record.log'
RECORD_FILE = GEOMET... | [
"os.path.isfile",
"flask_cors.CORS",
"flask.Flask"
] | [((243, 258), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (248, 258), False, 'from flask import Flask, request, render_template\n'), ((259, 268), 'flask_cors.CORS', 'CORS', (['app'], {}), '(app)\n', (263, 268), False, 'from flask_cors import CORS\n'), ((497, 524), 'os.path.isfile', 'os.path.isfile', (['... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Built-in packages
# External packages
import numpy as np
from matplotlib import pyplot as plt
# import seaborn as sns
# Internal packages
from fynance.backtest.dynamic_plot_backtest import DynaPlotBackTest
from fynance.neural_networks.roll_multi_neural_networks import ... | [
"numpy.mean",
"fynance.neural_networks.roll_multi_neural_networks.RollMultiNeuralNet.__call__",
"numpy.ones",
"fynance.backtest.dynamic_plot_backtest.DynaPlotBackTest",
"matplotlib.pyplot.style.use",
"fynance.neural_networks.roll_multi_neural_networks.RollMultiNeuralNet.__init__",
"numpy.argmax",
"num... | [((357, 381), 'matplotlib.pyplot.style.use', 'plt.style.use', (['"""seaborn"""'], {}), "('seaborn')\n", (370, 381), True, 'from matplotlib import pyplot as plt\n'), ((2211, 2261), 'fynance.neural_networks.roll_multi_neural_networks.RollMultiNeuralNet.__init__', 'RollMultiNeuralNet.__init__', (['self', '*args'], {}), '(... |
import os
from itertools import product
#Requirements installations works only on shell or terminal
def install():
os.system("pip3 install pyfiglet")
os.system("clear")
print("[+]Installing Requirements...")
install()
import pyfiglet
#collecting basic info about the target w
def basicinfo():
... | [
"os.system",
"pyfiglet.figlet_format"
] | [((125, 159), 'os.system', 'os.system', (['"""pip3 install pyfiglet"""'], {}), "('pip3 install pyfiglet')\n", (134, 159), False, 'import os\n'), ((165, 183), 'os.system', 'os.system', (['"""clear"""'], {}), "('clear')\n", (174, 183), False, 'import os\n'), ((854, 872), 'os.system', 'os.system', (['"""clear"""'], {}), "... |
# aoab3 written by <NAME> (bcr53), but mostly adopted from the below example on GitHub
# To be used with ImageStream Android app
# sends up to 0xffffff bytes of data
from __future__ import print_function, unicode_literals
import array
import sys
import time
import usb
PIXEL_VENDOR_ID = 0x18d1
PIXEL_UNCONFIG_ID = 0... | [
"usb.core.find",
"array.array",
"usb.util.find_descriptor",
"usb.util.endpoint_direction",
"time.sleep",
"usb.util.dispose_resources",
"usb.core.USBError"
] | [((1305, 1390), 'usb.core.find', 'usb.core.find', ([], {'idVendor': 'self._vendor_id', 'idProduct': 'self._unconfigured_product_id'}), '(idVendor=self._vendor_id, idProduct=self._unconfigured_product_id\n )\n', (1318, 1390), False, 'import usb\n'), ((1427, 1505), 'usb.core.find', 'usb.core.find', ([], {'idVendor': '... |
"""
ckwg +31
Copyright 2016 by Kitware, Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the ... | [
"vital.types.RGBColor",
"vital.types.Covariance",
"numpy.testing.assert_almost_equal",
"vital.types.Feature",
"random.random"
] | [((1866, 1875), 'vital.types.Feature', 'Feature', ([], {}), '()\n', (1873, 1875), False, 'from vital.types import Covariance, EigenArray, Feature, RGBColor\n'), ((1889, 1913), 'vital.types.Feature', 'Feature', (['[1, 1]', '(1)', '(2)', '(1)'], {}), '([1, 1], 1, 2, 1)\n', (1896, 1913), False, 'from vital.types import Co... |
n, q = (int(x) for x in input().split())
orders = [0 for _ in range(n)]
orders[0] = 1
path = [[] for _ in range(n)]
#print(path)
for i in range(n - 1):
a, b = (int(x) for x in input().split())
path[a - 1].append(b - 1)
path[b - 1].append(a - 1)
from collections import deque
d = deque()
d.append(0)
orders[... | [
"collections.deque"
] | [((293, 300), 'collections.deque', 'deque', ([], {}), '()\n', (298, 300), False, 'from collections import deque\n')] |
# Copyright (c) 2018-2020, NVIDIA CORPORATION. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditi... | [
"numpy.dtype",
"infer_util.infer_exact",
"unittest.main",
"test_util.validate_for_tf_model",
"sys.path.append"
] | [((1550, 1578), 'sys.path.append', 'sys.path.append', (['"""../common"""'], {}), "('../common')\n", (1565, 1578), False, 'import sys\n'), ((1753, 1769), 'numpy.dtype', 'np.dtype', (['object'], {}), '(object)\n', (1761, 1769), True, 'import numpy as np\n'), ((5887, 5902), 'unittest.main', 'unittest.main', ([], {}), '()\... |
import matplotlib.pyplot as plt
import numpy as np
import scipy.optimize
def plotdata(f1,f2,line=False,killme=False):
x1,y1,x2,y2=[],[],[],[]
for i in range(m):
if y[i]:x1.append(f1[i]),y1.append(f2[i])
else:x2.append(f1[i]),y2.append(f2[i])
plt.plot(x1, y1, 'rx')
plt.plot(x2,... | [
"numpy.mean",
"numpy.ones",
"matplotlib.pyplot.ylabel",
"numpy.power",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"numpy.log",
"numpy.square",
"numpy.exp",
"matplotlib.pyplot.contour",
"numpy.zeros",
"numpy.linspace",
"numpy.array",
"numpy.matrix",
"matplotlib.pyplot.legend",
... | [((2474, 2485), 'numpy.zeros', 'np.zeros', (['n'], {}), '(n)\n', (2482, 2485), True, 'import numpy as np\n'), ((280, 302), 'matplotlib.pyplot.plot', 'plt.plot', (['x1', 'y1', '"""rx"""'], {}), "(x1, y1, 'rx')\n", (288, 302), True, 'import matplotlib.pyplot as plt\n'), ((308, 330), 'matplotlib.pyplot.plot', 'plt.plot', ... |
#!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... | [
"logging.getLogger"
] | [((864, 891), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (881, 891), False, 'import logging\n')] |
import sys, math
lines = []
for line in sys.stdin:
lines.append(line.rstrip('\n'))
def toString(horaire):
if (horaire == 1440):
return "00:00"
return str('{:0>2}'.format(math.floor(horaire/60))) + ":" + str('{:0>2}'.format(horaire % 60))
tab = [0] * 60 * 24
horaire1 = 0
horaire2 = 0
horairetemp1 = 0
horairetemp... | [
"math.floor"
] | [((177, 201), 'math.floor', 'math.floor', (['(horaire / 60)'], {}), '(horaire / 60)\n', (187, 201), False, 'import sys, math\n')] |
import math
import multiprocessing as mp
import os
import torch
import torch.distributed as dist
from torch.nn import Module
from torch.utils.data import Sampler
class DistModule(Module):
def __init__(self, module):
super(DistModule, self).__init__()
self.module = module
broadcast_params... | [
"multiprocessing.get_start_method",
"torch.cuda.device_count",
"torch.distributed.all_reduce",
"torch.cuda.set_device",
"torch.distributed.broadcast",
"torch.distributed.get_rank",
"torch.distributed.is_available",
"torch.distributed.init_process_group",
"multiprocessing.set_start_method",
"torch.... | [((960, 981), 'torch.distributed.get_world_size', 'dist.get_world_size', ([], {}), '()\n', (979, 981), True, 'import torch.distributed as dist\n'), ((1341, 1366), 'torch.cuda.device_count', 'torch.cuda.device_count', ([], {}), '()\n', (1364, 1366), False, 'import torch\n'), ((1371, 1412), 'torch.cuda.set_device', 'torc... |
# Generated by Django 3.2.4 on 2021-06-10 07:43
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('wagtailcore', '0062_comment_models_and_pagesubscription'),
]
operations = [
migrations.... | [
"django.db.models.URLField",
"django.db.models.OneToOneField",
"django.db.models.BigAutoField"
] | [((417, 513), 'django.db.models.BigAutoField', 'models.BigAutoField', ([], {'auto_created': '(True)', 'primary_key': '(True)', 'serialize': '(False)', 'verbose_name': '"""ID"""'}), "(auto_created=True, primary_key=True, serialize=False,\n verbose_name='ID')\n", (436, 513), False, 'from django.db import migrations, m... |
import numpy as np
from scipy.special import expit
from librosa.core import midi_to_hz
from omnizart.constants.midi import LOWEST_MIDI_NOTE
def inference(feature, model, timestep=128, batch_size=10, feature_num=384):
assert len(feature.shape) == 2
# Padding
total_samples = len(feature)
pad_bottom = (... | [
"numpy.ceil",
"numpy.where",
"librosa.core.midi_to_hz",
"numpy.argmax",
"numpy.max",
"scipy.special.expit",
"numpy.array",
"numpy.zeros",
"numpy.sum",
"numpy.expand_dims",
"numpy.pad"
] | [((456, 516), 'numpy.pad', 'np.pad', (['feature', '((pad_len, pad_len), (pad_bottom, pad_top))'], {}), '(feature, ((pad_len, pad_len), (pad_bottom, pad_top)))\n', (462, 516), True, 'import numpy as np\n'), ((560, 590), 'numpy.zeros', 'np.zeros', (['(feature.shape + (2,))'], {}), '(feature.shape + (2,))\n', (568, 590), ... |
from subprocess import check_output
import sys,os,argparse
from StaticPath import StaticPath, Separators
from time import ctime
from SequencingFormats import BAM
parser = argparse.ArgumentParser(description='''
************************************************************************************************
B... | [
"subprocess.check_output",
"time.ctime",
"sys.exit",
"argparse.ArgumentParser",
"subprocess.run",
"os.path.join",
"GenomeReference.GenomeReference.get_reference_fasta",
"SequencingFormats.BAM",
"tools.checkout_dir"
] | [((180, 837), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""\n************************************************************************************************\nBasic description:\n\nCall mutation from tumor and normal bam\n\n**************************************************************... |
import scipy.io as sio
import os
import numpy as np
import pickle
def readMat(filename, folder, mode):
filename = os.path.join(os.getcwd(), os.path.join(folder, filename))
print(filename)
f = sio.loadmat(filename)
# import h5py
# with h5py.File(filename, 'r') as f:
#
# items = f['data... | [
"numpy.mean",
"numpy.eye",
"numpy.ones",
"scipy.io.loadmat",
"pickle.load",
"os.path.join",
"os.getcwd",
"numpy.array",
"numpy.sum",
"numpy.concatenate",
"numpy.linalg.norm",
"numpy.transpose"
] | [((207, 228), 'scipy.io.loadmat', 'sio.loadmat', (['filename'], {}), '(filename)\n', (218, 228), True, 'import scipy.io as sio\n'), ((1098, 1123), 'numpy.ones', 'np.ones', (['(x1.shape[0], 1)'], {}), '((x1.shape[0], 1))\n', (1105, 1123), True, 'import numpy as np\n'), ((1190, 1224), 'numpy.concatenate', 'np.concatenate... |
from view import screen, images
import common
from model import maps
commands = "Enter a (#) to purchase an item, (L)eave Shop"
# This function controls our interactions at the weapons store
def enter_the_map_shop(our_hero):
is_leaving_the_shop = False
message = "Welcome to Tina's Cartography, mighty warrior... | [
"common.get_stats",
"common.back_padding"
] | [((601, 633), 'common.get_stats', 'common.get_stats', (['None', 'our_hero'], {}), '(None, our_hero)\n', (617, 633), False, 'import common\n'), ((1841, 1875), 'common.back_padding', 'common.back_padding', (["m['name']", '(17)'], {}), "(m['name'], 17)\n", (1860, 1875), False, 'import common\n')] |
# Copyright 2021 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... | [
"dataclasses.field"
] | [((1321, 1360), 'dataclasses.field', 'dataclasses.field', ([], {'default_factory': 'list'}), '(default_factory=list)\n', (1338, 1360), False, 'import dataclasses\n')] |
"""
Copyright 2020 The Magma Authors.
This source code is licensed under the BSD-style license found in the
LICENSE file in the root directory of this source tree.
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES O... | [
"unittest.main",
"tempfile.TemporaryDirectory",
"magma.subscriberdb.sid.SIDUtils.to_pb",
"magma.subscriberdb.store.sqlite.SqliteStore"
] | [((4193, 4208), 'unittest.main', 'unittest.main', ([], {}), '()\n', (4206, 4208), False, 'import unittest\n'), ((948, 977), 'tempfile.TemporaryDirectory', 'tempfile.TemporaryDirectory', ([], {}), '()\n', (975, 977), False, 'import tempfile\n'), ((1000, 1037), 'magma.subscriberdb.store.sqlite.SqliteStore', 'SqliteStore'... |
import numpy as np
from numpy.linalg import norm
from joblib import Parallel, delayed
import pandas
from bcdsugar.utils import Monitor
from sparse_ho.ho import grad_search
from itertools import product
from sparse_ho.criterion import HeldOutSmoothedHinge
from sparse_ho.models import SVM
from sparse_ho.forward import Fo... | [
"sparse_ho.implicit.Implicit",
"sparse_ho.criterion.HeldOutSmoothedHinge",
"sparse_ho.implicit_forward.ImplicitForward",
"numpy.log",
"bcdsugar.utils.Monitor",
"sparse_ho.ho.grad_search",
"itertools.product",
"joblib.Parallel",
"numpy.array",
"sparse_ho.forward.Forward",
"numpy.linalg.norm",
"... | [((4952, 4977), 'pandas.DataFrame', 'pandas.DataFrame', (['results'], {}), '(results)\n', (4968, 4977), False, 'import pandas\n'), ((1056, 1088), 'sparse_ho.datasets.real.get_data', 'get_data', (['dataset_name'], {'csr': '(True)'}), '(dataset_name, csr=True)\n', (1064, 1088), False, 'from sparse_ho.datasets.real import... |
import pglet
from pglet import SearchBox, Stack, Text
with pglet.page("searchbox-with-search-clear-and-escape-events") as page:
def enter_clicked(e):
messages.controls.append(Text(f'You have searched for {sb.value}.'))
sb.value = ''
page.update()
def clear_or_esc_clicked(e):
sb.value = ''
... | [
"pglet.SearchBox",
"pglet.Text",
"pglet.page",
"pglet.Stack"
] | [((60, 119), 'pglet.page', 'pglet.page', (['"""searchbox-with-search-clear-and-escape-events"""'], {}), "('searchbox-with-search-clear-and-escape-events')\n", (70, 119), False, 'import pglet\n'), ((406, 549), 'pglet.SearchBox', 'SearchBox', ([], {'width': '(300)', 'placeholder': '"""Search something and click Enter, X ... |
from modeltranslation.translator import TranslationOptions, register
from . import models
@register(models.DynamicMenu)
class DynamicMenuTranslationOptions(TranslationOptions):
"""
Configures how model must be translated.
"""
fields = ('name', 'description', )
| [
"modeltranslation.translator.register"
] | [((94, 122), 'modeltranslation.translator.register', 'register', (['models.DynamicMenu'], {}), '(models.DynamicMenu)\n', (102, 122), False, 'from modeltranslation.translator import TranslationOptions, register\n')] |
import serial
import requests
import bs4
import time
PORT = 'COM3' # on Windows
URL = 'https://supersaa.fi' # default setting is 'Helsinki', to change location open url in web browser, change location and send cookies
USER_AGENT = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chr... | [
"time.strftime",
"time.sleep",
"requests.get",
"bs4.BeautifulSoup",
"serial.Serial"
] | [((674, 729), 'requests.get', 'requests.get', (['URL'], {'headers': "{'User-Agent': 'USER_AGENT'}"}), "(URL, headers={'User-Agent': 'USER_AGENT'})\n", (686, 729), False, 'import requests\n'), ((463, 482), 'serial.Serial', 'serial.Serial', (['PORT'], {}), '(PORT)\n', (476, 482), False, 'import serial\n'), ((531, 544), '... |
from django.urls import path
from . import views
urlpatterns = [
path('', views.index, name='index'),
path('user/<int:pk>/', views.userIndex, name='user_name'),
path('edit/<int:pk>/', views.edit, name='edit'),
path('register/', views.register, name='register'),
path('add/', views.add, name='add'),... | [
"django.urls.path"
] | [((71, 106), 'django.urls.path', 'path', (['""""""', 'views.index'], {'name': '"""index"""'}), "('', views.index, name='index')\n", (75, 106), False, 'from django.urls import path\n'), ((112, 169), 'django.urls.path', 'path', (['"""user/<int:pk>/"""', 'views.userIndex'], {'name': '"""user_name"""'}), "('user/<int:pk>/'... |
import pygame
import sys
import math
running = 1
x = y = 0
xList = []
yList = []
bgcolor = 0, 0, 0
circColourA = 0, 0, 255
circColourB = 255,127,0
gdClr = 0,255,0
bdClr = 255,0,0
tempColour = 0,255,0
baseCirc = 255,255,255
goodCirc = 1
colorTog = 1
if len(sys.argv) < 2:
radius = 40
else:
radius... | [
"pygame.draw.circle",
"pygame.event.poll",
"pygame.display.set_mode",
"pygame.display.flip",
"math.sqrt",
"pygame.font.init",
"pygame.font.Font"
] | [((352, 387), 'pygame.display.set_mode', 'pygame.display.set_mode', (['(800, 800)'], {}), '((800, 800))\n', (375, 387), False, 'import pygame\n'), ((726, 744), 'pygame.font.init', 'pygame.font.init', ([], {}), '()\n', (742, 744), False, 'import pygame\n'), ((425, 481), 'math.sqrt', 'math.sqrt', (['((x - 400) * (x - 400... |
from PreprocessData.all_class_files.PropertyValue import PropertyValue
import global_data
class LocationFeatureSpecification(PropertyValue):
def __init__(self, additionalType=None, alternateName=None, description=None, disambiguatingDescription=None, identifier=None, image=None, mainEntityOfPage=None, name=N... | [
"global_data.get_table",
"PreprocessData.all_class_files.PropertyValue.PropertyValue.__init__"
] | [((546, 805), 'PreprocessData.all_class_files.PropertyValue.PropertyValue.__init__', 'PropertyValue.__init__', (['self', 'additionalType', 'alternateName', 'description', 'disambiguatingDescription', 'identifier', 'image', 'mainEntityOfPage', 'name', 'potentialAction', 'sameAs', 'url', 'maxValue', 'minValue', 'property... |
import tensorflow as tf
from tensorflow.python.ops import rnn_cell
from experiment import ComponentBase
from experiment.qa.model import weight_variable
from experiment.qa.model.helper.pooling_helper import non_zero_tokens, attention_softmax
class LSTMBasedImportanceWeighting(ComponentBase):
def __init__(self, co... | [
"tensorflow.nn.bidirectional_dynamic_rnn",
"tensorflow.variable_scope",
"tensorflow.python.ops.rnn_cell.BasicLSTMCell",
"tensorflow.to_float",
"experiment.qa.model.helper.pooling_helper.attention_softmax",
"tensorflow.reduce_sum",
"tensorflow.shape",
"tensorflow.concat",
"tensorflow.matmul",
"tens... | [((2806, 2862), 'experiment.qa.model.weight_variable', 'weight_variable', (['"""mul_Q"""', '[cell_size * 2, cell_size * 2]'], {}), "('mul_Q', [cell_size * 2, cell_size * 2])\n", (2821, 2862), False, 'from experiment.qa.model import weight_variable\n'), ((2890, 2940), 'experiment.qa.model.weight_variable', 'weight_varia... |
import logging
from article import get_top_articles
import util.security as security
import handler.handler as handler
# log hits to memcache and requests made to the datastore
logging.basicConfig(format='%(levelname)s:%(message)s', level=logging.DEBUG)
class WikiHandler(handler.TemplateHandler):
"""
WikiHan... | [
"logging.basicConfig",
"util.security.check_secure_val",
"article.get_top_articles"
] | [((178, 254), 'logging.basicConfig', 'logging.basicConfig', ([], {'format': '"""%(levelname)s:%(message)s"""', 'level': 'logging.DEBUG'}), "(format='%(levelname)s:%(message)s', level=logging.DEBUG)\n", (197, 254), False, 'import logging\n'), ((866, 884), 'article.get_top_articles', 'get_top_articles', ([], {}), '()\n',... |
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import time
from marionette.by import By
from marionette.marionette import Actions
from gaiatest.apps.base import Base... | [
"gaiatest.apps.contacts.regions.contact_form.NewContact",
"time.sleep",
"gaiatest.apps.base.Base.__init__",
"gaiatest.apps.phone.regions.call_screen.CallScreen",
"marionette.marionette.Actions",
"gaiatest.apps.phone.app.Phone.__init__"
] | [((1058, 1090), 'gaiatest.apps.phone.app.Phone.__init__', 'Phone.__init__', (['self', 'marionette'], {}), '(self, marionette)\n', (1072, 1090), False, 'from gaiatest.apps.phone.app import Phone\n'), ((2779, 2806), 'gaiatest.apps.phone.regions.call_screen.CallScreen', 'CallScreen', (['self.marionette'], {}), '(self.mari... |
import os
def real_user():
if 'SUDO_USER' in os.environ.keys():
return os.environ['SUDO_USER']
else:
return os.environ['USER']
def real_home():
return os.environ['HOME'] | [
"os.environ.keys"
] | [((50, 67), 'os.environ.keys', 'os.environ.keys', ([], {}), '()\n', (65, 67), False, 'import os\n')] |
import dash
import dash_core_components as dcc
import dash_html_components as html
from dash.dependencies import Input, Output, State
import plotly.graph_objs as go
import math
import dash_table
from app import app
import pandas as pd
data = pd.read_excel('data/2018/economic-aggregates/S1.10.xlsx')
years = data.iloc[... | [
"dash.dependencies.Output",
"dash.dependencies.Input",
"pandas.read_excel",
"plotly.graph_objs.Bar",
"dash_html_components.H2",
"dash_core_components.Graph",
"math.isnan"
] | [((244, 301), 'pandas.read_excel', 'pd.read_excel', (['"""data/2018/economic-aggregates/S1.10.xlsx"""'], {}), "('data/2018/economic-aggregates/S1.10.xlsx')\n", (257, 301), True, 'import pandas as pd\n'), ((728, 798), 'pandas.read_excel', 'pd.read_excel', (['"""data/2018/economic-aggregates/S1.10.xlsx"""'], {'header': '... |
"""
Common test utilities
"""
import json
from tests import cassettes_dir
def save_json(response: dict, filename: str) -> None:
"""
Store the response in dictionary format to a JSON file for later inspection
Args:
response (dict): API response in dictionary format (JSON)
filename (str): n... | [
"json.dump"
] | [((435, 484), 'json.dump', 'json.dump', (['response', 'f'], {'indent': '(4)', 'sort_keys': '(False)'}), '(response, f, indent=4, sort_keys=False)\n', (444, 484), False, 'import json\n')] |
from abc import ABC
from plz.controller.api.exceptions import ExecutionNotFoundException
from plz.controller.execution_metadata import convert_measures_to_dict
from plz.controller.instances.instance_base import InstanceProvider
from plz.controller.results import ResultsStorage
from plz.controller.results.results_base ... | [
"plz.controller.api.exceptions.ExecutionNotFoundException"
] | [((2089, 2142), 'plz.controller.api.exceptions.ExecutionNotFoundException', 'ExecutionNotFoundException', ([], {'execution_id': 'execution_id'}), '(execution_id=execution_id)\n', (2115, 2142), False, 'from plz.controller.api.exceptions import ExecutionNotFoundException\n')] |
from django.utils.translation import gettext_lazy as _
from rest_framework import permissions
from rest_framework.permissions import IsAuthenticated
class IsObjectOwner(permissions.BasePermission):
def has_object_permission(self, request, view, obj):
return obj.user == request.user
class IsNotAuthentica... | [
"django.utils.translation.gettext_lazy"
] | [((356, 423), 'django.utils.translation.gettext_lazy', '_', (['"""Only unauthenticated users are allowed to perform this action."""'], {}), "('Only unauthenticated users are allowed to perform this action.')\n", (357, 423), True, 'from django.utils.translation import gettext_lazy as _\n')] |
"""
Dash app
"""
import dash_bootstrap_components as dbc
import dash_core_components as dcc
from dash.dependencies import Input, Output
import utilities as u
import constants as c
import layout as lay
from plots import plots_comparison as plots
class Page(lay.AppPage):
""" Page Comparison """
link = c.... | [
"utilities.uos.b64_to_df",
"plots.plots_comparison.ts_gradient",
"dash.dependencies.Output",
"dash.dependencies.Input",
"utilities.dfs.filter_data",
"dash_bootstrap_components.RadioItems",
"layout.get_dummy_div",
"dash_core_components.Graph",
"layout.get_options"
] | [((357, 423), 'layout.get_options', 'lay.get_options', (['[c.names.INCOMES, c.names.EXPENSES, c.names.EBIT]'], {}), '([c.names.INCOMES, c.names.EXPENSES, c.names.EBIT])\n', (372, 423), True, 'import layout as lay\n'), ((1528, 1550), 'utilities.uos.b64_to_df', 'u.uos.b64_to_df', (['df_in'], {}), '(df_in)\n', (1543, 1550... |
# Suppose we want to track runs and don't want
# to have to type in all the players in advance.
#
# There's some special code to help do this that we can
# "import" from Python's standard library.
from collections import Counter
runs = Counter()
# `+= 1` is a quick way to say "add 1 to whatever is there"
runs['... | [
"collections.Counter"
] | [((242, 251), 'collections.Counter', 'Counter', ([], {}), '()\n', (249, 251), False, 'from collections import Counter\n')] |
import datetime
import os
import sqlalchemy as sa
from ocdskingfisherprocess.store import Store
from ocdskingfisherprocess.transform import TRANSFORM_TYPE_COMPILE_RELEASES
from ocdskingfisherprocess.transform.compile_releases import CompileReleasesTransform
from tests.base import BaseDataBaseTest
class TestTransfor... | [
"sqlalchemy.sql.select",
"ocdskingfisherprocess.transform.compile_releases.CompileReleasesTransform",
"os.path.realpath",
"datetime.datetime.now",
"ocdskingfisherprocess.store.Store"
] | [((729, 762), 'ocdskingfisherprocess.store.Store', 'Store', (['self.config', 'self.database'], {}), '(self.config, self.database)\n', (734, 762), False, 'from ocdskingfisherprocess.store import Store\n'), ((1747, 1823), 'ocdskingfisherprocess.transform.compile_releases.CompileReleasesTransform', 'CompileReleasesTransfo... |
import datetime
import time
from time import mktime
from dateutil import parser
import feedparser
d = feedparser.parse('https://www.varzesh3.com/rss/all')
from DB.db_handler import update_last_check, get_all_rss
# d = feedparser.parse('http://www.irinn.ir/fa/rss/allnews')
rss = get_all_rss()[0]
entries = d.entries
e... | [
"feedparser.parse",
"dateutil.parser.parse",
"DB.db_handler.update_last_check",
"DB.db_handler.get_all_rss"
] | [((104, 156), 'feedparser.parse', 'feedparser.parse', (['"""https://www.varzesh3.com/rss/all"""'], {}), "('https://www.varzesh3.com/rss/all')\n", (120, 156), False, 'import feedparser\n'), ((282, 295), 'DB.db_handler.get_all_rss', 'get_all_rss', ([], {}), '()\n', (293, 295), False, 'from DB.db_handler import update_las... |
import pandas as pd
import numpy as np
import mplfinance as mpf # pip install mplfinance
import akshare as ak
import talib as ta
# 第一步,获取数据并且计算指标
def get_data(item_code):
stock_df = ak.stock_zh_a_hist(symbol=item_code, adjust="qfq")
stock_df['日期'] = pd.to_datetime(stock_df['日期'])
stock_df.rename(columns... | [
"mplfinance.show",
"talib.DEMA",
"numpy.where",
"numpy.round",
"mplfinance.figure",
"talib.RSI",
"mplfinance.plot",
"mplfinance.make_addplot",
"talib.MACD",
"mplfinance.make_mpf_style",
"akshare.stock_zh_a_hist",
"talib.BBANDS",
"talib.MA",
"pandas.to_datetime",
"mplfinance.make_marketco... | [((1916, 2009), 'mplfinance.make_marketcolors', 'mpf.make_marketcolors', ([], {'up': '"""r"""', 'down': '"""g"""', 'edge': '"""inherit"""', 'wick': '"""inherit"""', 'volume': '"""inherit"""'}), "(up='r', down='g', edge='inherit', wick='inherit',\n volume='inherit')\n", (1937, 2009), True, 'import mplfinance as mpf\n... |
# Write a function that counts how many times a substring occurs in a string.
import sys
def count(stringpart, stringwhole):
position = 0
tally = 0
while position < len(stringwhole):
x = stringwhole.find(stringpart, position)
if x == -1:
break
tally += 1
positi... | [
"sys._getframe"
] | [((426, 442), 'sys._getframe', 'sys._getframe', (['(1)'], {}), '(1)\n', (439, 442), False, 'import sys\n')] |
"""edges.py - Sobel edge filter
Originally part of CellProfiler, code licensed under both GPL and BSD licenses.
Website: http://www.cellprofiler.org
Copyright (c) 2003-2009 Massachusetts Institute of Technology
Copyright (c) 2009-2011 Broad Institute
All rights reserved.
Original author: <NAME>
"""
import numpy as np... | [
"scipy.ndimage.binary_erosion",
"scipy.ndimage.generate_binary_structure",
"numpy.array",
"skimage.img_as_float"
] | [((450, 481), 'scipy.ndimage.generate_binary_structure', 'generate_binary_structure', (['(2)', '(2)'], {}), '(2, 2)\n', (475, 481), False, 'from scipy.ndimage import convolve, binary_erosion, generate_binary_structure\n'), ((2510, 2529), 'skimage.img_as_float', 'img_as_float', (['image'], {}), '(image)\n', (2522, 2529)... |
# import mmcv
# import pickle
# import os
# root = '/mnt/10-5-108-187/lizhenyu1/kitti_det/public_datalist_14/'
# f1 = open(os.path.join(root,'kitti_infos_trainval.pkl'),'rb')
# trainval_pkl = pickle.load(f1)
# f2 = open(os.path.join(root,'kitti_infos_test.pkl'),'rb')
# test_pkl = pickle.load(f2)
# f3 = open(os.path.joi... | [
"pickle.dump",
"pickle.load",
"os.path.join"
] | [((1432, 1447), 'pickle.load', 'pickle.load', (['f3'], {}), '(f3)\n', (1443, 1447), False, 'import pickle\n'), ((1744, 1776), 'pickle.dump', 'pickle.dump', (['train_pkl[1581:]', 'f'], {}), '(train_pkl[1581:], f)\n', (1755, 1776), False, 'import pickle\n'), ((1871, 1915), 'pickle.dump', 'pickle.dump', (['train_pkl[1581:... |
#!/usr/bin/python
# tweets #client.slug, #video, title and url
# shortens the URL and title if needed
# if over 140 char, url is shortened using bity,
# if still over, title is truncated.
import twitter
import urllib.request, urllib.error, urllib.parse
import pprint
import pw # see pw_samp.py for sample.
from pr... | [
"twitter.Api"
] | [((1960, 2124), 'twitter.Api', 'twitter.Api', ([], {'consumer_key': "t['consumer_key']", 'consumer_secret': "t['consumer_secret']", 'access_token_key': "t['access_key']", 'access_token_secret': "t['access_secret']"}), "(consumer_key=t['consumer_key'], consumer_secret=t[\n 'consumer_secret'], access_token_key=t['acce... |
# -*- coding: utf-8 -*-
###########################################################################
# Copyright (c), The AiiDA team. All rights reserved. #
# This file is part of the AiiDA code. #
# ... | [
"aiida.tools.importexport.common.archive.extract_tar",
"aiida.common.timezone.now",
"aiida.common.links.LinkType",
"aiida.tools.importexport.common.exceptions.ImportValidationError",
"aiida.tools.importexport.dbimport.backends.sqla.utils.validate_uuid",
"aiida.common.log.override_log_formatter",
"aiida.... | [((2360, 2397), 'aiida.common.log.override_log_formatter', 'override_log_formatter', (['"""%(message)s"""'], {}), "('%(message)s')\n", (2382, 2397), False, 'from aiida.common.log import override_log_formatter\n'), ((5479, 5508), 'distutils.version.StrictVersion', 'StrictVersion', (['EXPORT_VERSION'], {}), '(EXPORT_VERS... |
import os
from typing import Dict, List, Optional, Union, Callable
from tinydb.storages import MemoryStorage, JSONStorage
from ..custom_typings import DataDict, PathType
class BaseDB(JSONStorage, MemoryStorage):
"""Base storage class that reads which extensions are available to feed the
path handling functio... | [
"tinydb.storages.JSONStorage.__init__",
"tinydb.storages.MemoryStorage.__init__"
] | [((1578, 1606), 'tinydb.storages.MemoryStorage.__init__', 'MemoryStorage.__init__', (['self'], {}), '(self)\n', (1600, 1606), False, 'from tinydb.storages import MemoryStorage, JSONStorage\n'), ((1615, 1665), 'tinydb.storages.JSONStorage.__init__', 'JSONStorage.__init__', (['self', 'current_path'], {}), '(self, current... |
import copy
from collections import deque
import onnx
from .model import Model
__all__ = ['onnx_profile', 'torch_profile']
def onnx_profile(model, profiler, reduction=None, verbose=False):
model = Model(model, remove_batchnorms=True, propagate_size=True)
outputs = []
for module in model.modules:
... | [
"torch.onnx.export",
"collections.deque",
"onnx.load",
"copy.deepcopy"
] | [((1752, 1772), 'copy.deepcopy', 'copy.deepcopy', (['model'], {}), '(model)\n', (1765, 1772), False, 'import copy\n'), ((1858, 1872), 'collections.deque', 'deque', (['[model]'], {}), '([model])\n', (1863, 1872), False, 'from collections import deque\n'), ((2121, 2172), 'torch.onnx.export', 'torch.onnx.export', (['model... |
import torch
from scripts.study_case.ID_13.torch_geometric.utils import to_undirected
class FaceToEdge(object):
def __call__(self, data):
face = data.face
edge_index = torch.cat([face[:2], face[1:], face[::2]], dim=1)
edge_index = to_undirected(edge_index, num_nodes=data.num_nodes)
... | [
"scripts.study_case.ID_13.torch_geometric.utils.to_undirected",
"torch.cat"
] | [((191, 240), 'torch.cat', 'torch.cat', (['[face[:2], face[1:], face[::2]]'], {'dim': '(1)'}), '([face[:2], face[1:], face[::2]], dim=1)\n', (200, 240), False, 'import torch\n'), ((262, 313), 'scripts.study_case.ID_13.torch_geometric.utils.to_undirected', 'to_undirected', (['edge_index'], {'num_nodes': 'data.num_nodes'... |
import pytest
from koordinates import Permission
from koordinates import Client, Group, User
from .response_data.responses_10 import (
layer_list_permissions_good_simulated_response,
layer_permission_simulated_response,
)
from .response_data.responses_10 import (
set_permission_simulated_response,
set... | [
"koordinates.Permission",
"responses.RequestsMock",
"responses.add",
"koordinates.Client"
] | [((888, 937), 'koordinates.Client', 'Client', ([], {'token': '"""test"""', 'host': '"""test.koordinates.com"""'}), "(token='test', host='test.koordinates.com')\n", (894, 937), False, 'from koordinates import Client, Group, User\n'), ((2067, 2214), 'responses.add', 'responses.add', (['responses.GET', 'target_url'], {'bo... |
import time
import argparse
import torch
from hivemind.proto.runtime_pb2 import CompressionType
from hivemind.utils import serialize_torch_tensor, deserialize_torch_tensor
def benchmark_compression(tensor: torch.Tensor, compression_type: CompressionType) -> float:
t = time.time()
deserialize_torch_tensor(ser... | [
"torch.manual_seed",
"hivemind.utils.serialize_torch_tensor",
"argparse.ArgumentParser",
"hivemind.proto.runtime_pb2.CompressionType.items",
"time.time",
"torch.randn"
] | [((276, 287), 'time.time', 'time.time', ([], {}), '()\n', (285, 287), False, 'import time\n'), ((436, 461), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (459, 461), False, 'import argparse\n'), ((728, 756), 'torch.manual_seed', 'torch.manual_seed', (['args.seed'], {}), '(args.seed)\n', (745, ... |
import datetime
from graphene_sqlalchemy import SQLAlchemyObjectType
from graphene import Mutation, Boolean, String, Field
from app.models.User import User as UserModel
from graphql import GraphQLError
class User(SQLAlchemyObjectType):
class Meta:
model = UserModel
exclude_fields = ("password",)
... | [
"graphene.String",
"graphene.Field",
"graphql.GraphQLError",
"app.models.User.User.query.filter_by",
"datetime.datetime.now",
"graphene.Boolean"
] | [((357, 394), 'graphene.Boolean', 'Boolean', ([], {'description': '"""Request status"""'}), "(description='Request status')\n", (364, 394), False, 'from graphene import Mutation, Boolean, String, Field\n'), ((409, 446), 'graphene.String', 'String', ([], {'description': '"""Request message"""'}), "(description='Request ... |
# coding=utf-8
import logging
from flask_sqlalchemy import SQLAlchemy
log = logging.getLogger(__name__)
db = SQLAlchemy()
def make_settings(app, settings):
"""
This function is invoked before initializing app.
"""
def init_app(app, settings):
"""
This function is invoked before running app.
... | [
"logging.getLogger",
"flask_sqlalchemy.SQLAlchemy",
"guniflask.orm.wrap_sqlalchemy_model"
] | [((79, 106), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (96, 106), False, 'import logging\n'), ((113, 125), 'flask_sqlalchemy.SQLAlchemy', 'SQLAlchemy', ([], {}), '()\n', (123, 125), False, 'from flask_sqlalchemy import SQLAlchemy\n'), ((582, 613), 'guniflask.orm.wrap_sqlalchemy_model... |
# -*- coding: utf-8 -*-
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
"""
# Integrating PayPal
### 1. Validate Currency Support
Example:
from frappe.integration_broker.doctype.integration_service.integration_service import get_integra... | [
"json.loads",
"frappe._dict",
"frappe.db.get_value",
"frappe.throw",
"frappe.whitelist",
"frappe.utils.get_url",
"frappe._",
"frappe.utils.call_hook_method",
"frappe.get_doc",
"urllib.urlencode"
] | [((5021, 5070), 'frappe.whitelist', 'frappe.whitelist', ([], {'allow_guest': '(True)', 'xss_safe': '(True)'}), '(allow_guest=True, xss_safe=True)\n', (5037, 5070), False, 'import frappe\n'), ((6315, 6364), 'frappe.whitelist', 'frappe.whitelist', ([], {'allow_guest': '(True)', 'xss_safe': '(True)'}), '(allow_guest=True,... |
"""
Offsite Spider Middleware
See documentation in docs/topics/spider-middleware.rst
"""
import re
from scrapy import signals
from scrapy.http import Request
from scrapy.utils.httpobj import urlparse_cached
from scrapy import log
class OffsiteMiddleware(object):
def __init__(self, stats):
self.stats = ... | [
"re.escape",
"scrapy.log.msg",
"scrapy.utils.httpobj.urlparse_cached",
"re.compile"
] | [((1940, 1957), 're.compile', 're.compile', (['regex'], {}), '(regex)\n', (1950, 1957), False, 'import re\n'), ((1787, 1801), 're.compile', 're.compile', (['""""""'], {}), "('')\n", (1797, 1801), False, 'import re\n'), ((1475, 1499), 'scrapy.utils.httpobj.urlparse_cached', 'urlparse_cached', (['request'], {}), '(reques... |
from flask import Flask
from threading import Thread
from logging import getLogger, ERROR
import time, sys, os
from nitrotype import l
import asyncio
app = Flask(__name__)
@app.route('/', methods=['POST', 'GET', 'HEAD'])#'POST'
def home():
return 'POG! U looking for me? I\'m right there! Online and running, eve... | [
"flask.Flask",
"time.sleep",
"os.execl",
"threading.Thread",
"time.time"
] | [((156, 171), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (161, 171), False, 'from flask import Flask\n'), ((365, 376), 'time.time', 'time.time', ([], {}), '()\n', (374, 376), False, 'import time, sys, os\n'), ((604, 615), 'time.time', 'time.time', ([], {}), '()\n', (613, 615), False, 'import time, sys,... |
"""
test_chemistry_hydrogen.py
Author: <NAME>
Affiliation: University of Colorado at Boulder
Created on: Mon Feb 16 12:50:43 MST 2015
Description:
"""
import ares
import numpy as np
import matplotlib.pyplot as pl
def test():
pf = \
{
'grid_cells': 64,
'include_He': True,
'isothermal': True... | [
"ares.simulations.GasParcel",
"matplotlib.pyplot.loglog",
"matplotlib.pyplot.close",
"matplotlib.pyplot.ylim",
"numpy.logspace"
] | [((606, 638), 'ares.simulations.GasParcel', 'ares.simulations.GasParcel', ([], {}), '(**pf)\n', (632, 638), False, 'import ares\n'), ((720, 775), 'matplotlib.pyplot.loglog', 'pl.loglog', (["data['Tk'][0]", "data['h_1'][-1, :]"], {'color': '"""k"""'}), "(data['Tk'][0], data['h_1'][-1, :], color='k')\n", (729, 775), True... |
from pyflink.datastream import StreamExecutionEnvironment
from pyflink.table import StreamTableEnvironment, DataTypes
from pyflink.table.descriptors import Schema, OldCsv, FileSystem
from pyflink.table.udf import udf
env = StreamExecutionEnvironment.get_execution_environment()
env.set_parallelism(1)
t_env = StreamTabl... | [
"pyflink.table.descriptors.FileSystem",
"pyflink.table.StreamTableEnvironment.create",
"pyflink.table.descriptors.Schema",
"pyflink.table.DataTypes.BIGINT",
"pyflink.table.descriptors.OldCsv",
"pyflink.datastream.StreamExecutionEnvironment.get_execution_environment",
"mpmath.fadd"
] | [((224, 278), 'pyflink.datastream.StreamExecutionEnvironment.get_execution_environment', 'StreamExecutionEnvironment.get_execution_environment', ([], {}), '()\n', (276, 278), False, 'from pyflink.datastream import StreamExecutionEnvironment\n'), ((310, 344), 'pyflink.table.StreamTableEnvironment.create', 'StreamTableEn... |
# imports shared throughout the project
import sys
import importlib
import time
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
# CONSTANTS
PJ_TO_GWH = 277.7778 # [GWh / PJ]
GWH_TO_PJ = 1/PJ_TO_GWH #[PJ/GWH]
# HELPER
import FLUCCOplus.config as config
EM_TO_EXCEL_colnames = {
"pow... | [
"matplotlib.pyplot.grid",
"numpy.arange",
"pathlib.Path",
"pandas.DataFrame",
"matplotlib.pyplot.ylim",
"time.time",
"matplotlib.pyplot.subplots",
"FLUCCOplus.config.logging.getLogger"
] | [((1010, 1048), 'FLUCCOplus.config.logging.getLogger', 'config.logging.getLogger', (['f.__module__'], {}), '(f.__module__)\n', (1034, 1048), True, 'import FLUCCOplus.config as config\n'), ((1309, 1347), 'FLUCCOplus.config.logging.getLogger', 'config.logging.getLogger', (['f.__module__'], {}), '(f.__module__)\n', (1333,... |
import os
import pytest
import math
from astropy.io import fits
from astropy.table import Table
import numpy as np
import stwcs
from stwcs import updatewcs
from stsci.tools import fileutil
from ci_watson.artifactory_helpers import get_bigdata_root
from ci_watson.hst_helpers import raw_from_asn, ref_from_image, downl... | [
"ci_watson.artifactory_helpers._is_url",
"astropy.io.fits.HDUList",
"astropy.io.fits.PrimaryHDU",
"astropy.io.fits.ImageHDU",
"os.environ.get",
"ci_watson.artifactory_helpers.get_bigdata_root",
"math.sqrt",
"os.getcwd",
"stwcs.wcsutil.HSTWCS",
"os.path.split",
"numpy.zeros",
"ci_watson.hst_hel... | [((592, 624), 'pytest.mark.usefixtures', 'pytest.mark.usefixtures', (['"""_jail"""'], {}), "('_jail')\n", (615, 624), False, 'import pytest\n'), ((4585, 4617), 'pytest.mark.usefixtures', 'pytest.mark.usefixtures', (['"""_jail"""'], {}), "('_jail')\n", (4608, 4617), False, 'import pytest\n'), ((947, 969), 'os.environ.ge... |
import time
t = time.localtime() # 返回当前时间的九元组
time.gmtime() # 返回格林威治0时区当前时间的九元组
time.time() # 常用,与1970-1-1 8:00之间的秒数,时间戳
time.mktime(t) # 把九元组时间转成时间戳
time.sleep(1)
time.asctime() # 如果有参数,是九元组形式
time.ctime() # 返回当前时间,参数是时间戳,常用
time.strftime("%Y-%m-%d") # 常用
time.strptime('2018-07-20', "%Y-%m-%d") # 返回九元组时间格式
tim... | [
"time.ctime",
"time.asctime",
"time.strptime",
"datetime.datetime.strptime",
"time.mktime",
"time.strftime",
"time.sleep",
"datetime.datetime.ctime",
"datetime.timedelta",
"datetime.datetime.now",
"time.time",
"datetime.datetime.today",
"time.localtime",
"datetime.datetime.strftime",
"ti... | [((17, 33), 'time.localtime', 'time.localtime', ([], {}), '()\n', (31, 33), False, 'import time\n'), ((48, 61), 'time.gmtime', 'time.gmtime', ([], {}), '()\n', (59, 61), False, 'import time\n'), ((83, 94), 'time.time', 'time.time', ([], {}), '()\n', (92, 94), False, 'import time\n'), ((125, 139), 'time.mktime', 'time.m... |
import secrets
from base64 import urlsafe_b64decode, urlsafe_b64encode
from cryptography.fernet import Fernet
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives import hashes
from cryptography.hazmat.primitives.kdf.pbkdf2 import PBKDF2HMAC
class Secret:
"""Encrypt and de... | [
"base64.urlsafe_b64decode",
"base64.urlsafe_b64encode",
"secrets.token_bytes",
"cryptography.hazmat.primitives.hashes.SHA256",
"cryptography.fernet.Fernet",
"cryptography.hazmat.backends.default_backend"
] | [((1009, 1032), 'secrets.token_bytes', 'secrets.token_bytes', (['(16)'], {}), '(16)\n', (1028, 1032), False, 'import secrets\n'), ((1395, 1425), 'base64.urlsafe_b64decode', 'urlsafe_b64decode', (['self.secret'], {}), '(self.secret)\n', (1412, 1425), False, 'from base64 import urlsafe_b64decode, urlsafe_b64encode\n'), (... |
# -*- coding: utf-8 -*-
"""baseline.ipynb
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/1ELj28VKxQe8E1h-VnIbU6HMb9ezVIUaB
"""
import numpy as np
import sklearn
from statistics import mean
from sklearn import metrics
from sklearn import ... | [
"statistics.mean",
"sklearn.model_selection.train_test_split",
"sklearn.metrics.roc_auc_score",
"numpy.count_nonzero",
"sklearn.model_selection.KFold"
] | [((1793, 1823), 'numpy.count_nonzero', 'np.count_nonzero', (['(comp == True)'], {}), '(comp == True)\n', (1809, 1823), True, 'import numpy as np\n'), ((2243, 2314), 'sklearn.model_selection.KFold', 'sklearn.model_selection.KFold', ([], {'n_splits': '(4)', 'random_state': '(1)', 'shuffle': '(True)'}), '(n_splits=4, rand... |
from __future__ import print_function, absolute_import, division # makes KratosMultiphysics backward compatible with python 2.6 and 2.7
# Importing the Kratos Library
import KratosMultiphysics
# Import applications
import KratosMultiphysics.MeshingApplication as MeshingApplication
def Factory(settings, Model):
... | [
"KratosMultiphysics.MeshingApplication.IntegrationValuesExtrapolationToNodesProcess",
"KratosMultiphysics.Parameters",
"KratosMultiphysics.Process.__init__"
] | [((752, 793), 'KratosMultiphysics.Process.__init__', 'KratosMultiphysics.Process.__init__', (['self'], {}), '(self)\n', (787, 793), False, 'import KratosMultiphysics\n'), ((822, 1317), 'KratosMultiphysics.Parameters', 'KratosMultiphysics.Parameters', (['"""\n {\n "help" : "This p... |
"""
A client with name and e-mail:
>>> jack = Customer('<NAME>', '<EMAIL>')
>>> jack.full_email()
'<NAME> <<EMAIL>>'
A client cannot be created with a blank e-mail:
>>> joe = Customer('<NAME>', '')
Traceback (most recent call last):
...
ValueError: 'email' must not be empty
>>> joe ... | [
"model6b.NonBlank"
] | [((1098, 1108), 'model6b.NonBlank', 'NonBlank', ([], {}), '()\n', (1106, 1108), False, 'from model6b import Model, NonBlank\n'), ((1121, 1131), 'model6b.NonBlank', 'NonBlank', ([], {}), '()\n', (1129, 1131), False, 'from model6b import Model, NonBlank\n')] |
from PyQt4 import QtCore, QtGui
import cfgdialog_ui
import coluse_ui
import colsave_ui
import errordialog_ui
import deriveddialog_ui
import confirmdialog_ui
class cfgdialog(QtGui.QDialog):
def __init__(self, model, parent=None):
QtGui.QDialog.__init__(self, parent)
self.ui = cfgdialog_ui.Ui_Dialog(... | [
"cfgdialog_ui.Ui_Dialog",
"PyQt4.QtGui.QDialog.exec_",
"colsave_ui.Ui_Dialog",
"deriveddialog_ui.Ui_deriveddialog",
"PyQt4.QtGui.QRadioButton",
"PyQt4.QtCore.QTimer.singleShot",
"coluse_ui.Ui_Dialog",
"errordialog_ui.Ui_Dialog",
"confirmdialog_ui.Ui_Dialog",
"PyQt4.QtGui.QDialog.__init__"
] | [((242, 278), 'PyQt4.QtGui.QDialog.__init__', 'QtGui.QDialog.__init__', (['self', 'parent'], {}), '(self, parent)\n', (264, 278), False, 'from PyQt4 import QtCore, QtGui\n'), ((297, 321), 'cfgdialog_ui.Ui_Dialog', 'cfgdialog_ui.Ui_Dialog', ([], {}), '()\n', (319, 321), False, 'import cfgdialog_ui\n'), ((686, 711), 'PyQ... |
import numpy as np
np.random.seed(10)
import tensorflow as tf
tf.random.set_seed(10)
tf.keras.backend.set_floatx('float64')
import matplotlib.pyplot as plt
from tensorflow.keras import Model
from tensorflow.keras import optimizers, models, regularizers
from tensorflow.keras import backend as K
from tensorflow.keras.ca... | [
"tensorflow.keras.backend.epsilon",
"tensorflow.GradientTape",
"CAE_Layers.Encoder_Block",
"tensorflow.keras.backend.mean",
"CAE_Layers.Decoder_Block",
"numpy.random.seed",
"tensorflow.keras.backend.square",
"tensorflow.Variable",
"tensorflow.keras.backend.set_floatx",
"CAE_Layers.Latent_Block",
... | [((19, 37), 'numpy.random.seed', 'np.random.seed', (['(10)'], {}), '(10)\n', (33, 37), True, 'import numpy as np\n'), ((62, 84), 'tensorflow.random.set_seed', 'tf.random.set_seed', (['(10)'], {}), '(10)\n', (80, 84), True, 'import tensorflow as tf\n'), ((85, 123), 'tensorflow.keras.backend.set_floatx', 'tf.keras.backen... |
from py_wake import IEA37SimpleBastankhahGaussian
from py_wake.deflection_models import JimenezWakeDeflection
from py_wake.examples.data.iea37._iea37 import IEA37Site
import numpy as np
import matplotlib.pyplot as plt
import pytest
from py_wake.flow_map import XYGrid
from py_wake.deflection_models.fuga_deflection impor... | [
"numpy.reshape",
"numpy.arange",
"py_wake.examples.data.iea37._iea37.IEA37Site",
"matplotlib.pyplot.plot",
"py_wake.utils.model_utils.get_models",
"matplotlib.pyplot.close",
"matplotlib.pyplot.figure",
"py_wake.examples.data.hornsrev1.V80",
"matplotlib.pyplot.title",
"py_wake.deflection_models.fug... | [((1058, 1071), 'py_wake.examples.data.iea37._iea37.IEA37Site', 'IEA37Site', (['(16)'], {}), '(16)\n', (1067, 1071), False, 'from py_wake.examples.data.iea37._iea37 import IEA37Site\n'), ((1111, 1116), 'py_wake.examples.data.hornsrev1.V80', 'V80', ([], {}), '()\n', (1114, 1116), False, 'from py_wake.examples.data.horns... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from random import shuffle, random
from collections import defaultdict
import itertools
import mazebase.items as mi
from .mazeutils import MazeException
def sprinkle(gam... | [
"random.random",
"itertools.product",
"collections.defaultdict",
"random.shuffle"
] | [((2228, 2256), 'collections.defaultdict', 'defaultdict', (['(lambda : 1e1000)'], {}), '(lambda : 1e1000)\n', (2239, 2256), False, 'from collections import defaultdict\n'), ((836, 850), 'random.shuffle', 'shuffle', (['tiles'], {}), '(tiles)\n', (843, 850), False, 'from random import shuffle, random\n'), ((898, 906), 'r... |
## imports
import os, time
import numpy as np
from colour import Color
import matplotlib.pyplot as plt
import skimage.io as io
import utilities
def localizationErrors( coco_analyze, imgs_info, saveDir ):
loc_dir = saveDir + '/localization_errors/keypoints_breakdown'
if not os.path.exists(loc_dir):
os.m... | [
"matplotlib.pyplot.imshow",
"os.path.exists",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.title",
"os.makedirs",
"matplotlib.pyplot.gca",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.close",
"numpy.array",
"numpy.zeros",
"matplotlib.pyplot.figure",
"skimage.io.imread",
"matplotlib.pyplot... | [((460, 471), 'time.time', 'time.time', ([], {}), '()\n', (469, 471), False, 'import os, time\n'), ((1266, 1278), 'numpy.zeros', 'np.zeros', (['(17)'], {}), '(17)\n', (1274, 1278), True, 'import numpy as np\n'), ((1300, 1312), 'numpy.zeros', 'np.zeros', (['(17)'], {}), '(17)\n', (1308, 1312), True, 'import numpy as np\... |
# -*- coding: utf-8 -*-
"""Compare results blueprint."""
from flask import Blueprint, jsonify, request
from ..controllers.compare_results import list_compare_results, create_compare_result, \
update_compare_result, delete_compare_result
from ..utils import to_snake_case
bp = Blueprint("compare_results", __name__... | [
"flask.request.get_json",
"flask.Blueprint",
"flask.jsonify"
] | [((283, 321), 'flask.Blueprint', 'Blueprint', (['"""compare_results"""', '__name__'], {}), "('compare_results', __name__)\n", (292, 321), False, 'from flask import Blueprint, jsonify, request\n'), ((695, 718), 'flask.jsonify', 'jsonify', (['compare_result'], {}), '(compare_result)\n', (702, 718), False, 'from flask imp... |
import sys
import numpy as np
import datetime
import helper_functions.helper_functions as hf
from sklearn.multiclass import OneVsRestClassifier
from sklearn.linear_model import LogisticRegression
from sklearn.ensemble import RandomForestClassifier
from sklearn.tree import DecisionTreeClassifier
from sklearn.naive_bayes... | [
"sec5b_ml_model_binaryclass_pipeline.MachineLearningNameEthnicityProjectBinaryClass",
"sklearn.svm.LinearSVC",
"sklearn.linear_model.LogisticRegression",
"datetime.datetime.now",
"sklearn.naive_bayes.BernoulliNB",
"numpy.logspace",
"helper_functions.helper_functions.done_alert",
"sklearn.svm.SVC"
] | [((8883, 8898), 'helper_functions.helper_functions.done_alert', 'hf.done_alert', ([], {}), '()\n', (8896, 8898), True, 'import helper_functions.helper_functions as hf\n'), ((1395, 1415), 'sklearn.linear_model.LogisticRegression', 'LogisticRegression', ([], {}), '()\n', (1413, 1415), False, 'from sklearn.linear_model im... |
from libcloud.dns.types import Provider
from libcloud.dns.providers import get_driver
cls = get_driver(Provider.POINTDNS)
driver = cls('username', 'apikey')
| [
"libcloud.dns.providers.get_driver"
] | [((93, 122), 'libcloud.dns.providers.get_driver', 'get_driver', (['Provider.POINTDNS'], {}), '(Provider.POINTDNS)\n', (103, 122), False, 'from libcloud.dns.providers import get_driver\n')] |
from ctypes import c_uint
from ctypes.wintypes import HWND, WPARAM
from travertino.size import at_least
from travertino.constants import TRANSPARENT
from toga_winforms.colors import native_color
from toga_winforms.libs import HorizontalTextAlignment, WinForms, user32
from .base import Widget
class TextInput(Widget... | [
"ctypes.wintypes.WPARAM",
"travertino.size.at_least",
"toga_winforms.libs.user32.SendMessageW",
"toga_winforms.libs.WinForms.TextBox",
"ctypes.c_uint",
"toga_winforms.libs.WinForms.ErrorProvider",
"toga_winforms.colors.native_color",
"toga_winforms.libs.HorizontalTextAlignment"
] | [((367, 385), 'toga_winforms.libs.WinForms.TextBox', 'WinForms.TextBox', ([], {}), '()\n', (383, 385), False, 'from toga_winforms.libs import HorizontalTextAlignment, WinForms, user32\n'), ((750, 774), 'toga_winforms.libs.WinForms.ErrorProvider', 'WinForms.ErrorProvider', ([], {}), '()\n', (772, 774), False, 'from toga... |
import os, sys, logging
import json
import numpy as np
import random
from collections import defaultdict, Counter
import cPickle as pickle
import cProfile, pstats
import threading
import time
import multiprocessing
import math
from sklearn import metrics
from sklearn import svm
from sklearn.naive_bayes import Gaussia... | [
"src.datasets.data_utils.tokenize_hanzi",
"multiprocessing.cpu_count",
"sklearn.metrics.precision_score",
"sklearn.metrics.recall_score",
"numpy.array",
"src.datasets.data_utils.WordVectorBuilder.filename_test",
"src.datasets.data_utils.syslogger",
"threading.Lock",
"os.path.isdir",
"src.datasets.... | [((941, 968), 'multiprocessing.cpu_count', 'multiprocessing.cpu_count', ([], {}), '()\n', (966, 968), False, 'import multiprocessing\n'), ((982, 998), 'threading.Lock', 'threading.Lock', ([], {}), '()\n', (996, 998), False, 'import threading\n'), ((1025, 1055), 'src.datasets.data_utils.syslogger', 'data_utils.syslogger... |
from actstream.models import Action
from mayan.apps.documents.tests.base import GenericDocumentTestCase
from mayan.apps.testing.tests.base import GenericViewTestCase
from ..events import (
event_cabinet_created, event_cabinet_edited, event_cabinet_document_added,
event_cabinet_document_removed
)
from ..models... | [
"actstream.models.Action.objects.first",
"actstream.models.Action.objects.last",
"actstream.models.Action.objects.count",
"actstream.models.Action.objects.all"
] | [((650, 672), 'actstream.models.Action.objects.count', 'Action.objects.count', ([], {}), '()\n', (670, 672), False, 'from actstream.models import Action\n'), ((1001, 1023), 'actstream.models.Action.objects.count', 'Action.objects.count', ([], {}), '()\n', (1021, 1023), False, 'from actstream.models import Action\n'), (... |
#
# This source file is part of the EdgeDB open source project.
#
# Copyright 2008-present MagicStack Inc. and the EdgeDB 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... | [
"edb.edgeql.compiler.get_param_anchors_for_callable",
"edb.edgeql.ast.SetSpecialField",
"edb.edgeql.parse_fragment",
"edb.errors.InvalidConstraintDefinitionError",
"edb.edgeql.utils.inline_parameters",
"edb.errors.UnsupportedFeatureError",
"edb.edgeql.generate_source",
"edb.edgeql.utils.inline_anchors... | [((5358, 5399), 'edb.edgeql.parser.parse', 'qlparser.parse', (['expr.text', 'module_aliases'], {}), '(expr.text, module_aliases)\n', (5372, 5399), True, 'from edb.edgeql import parser as qlparser\n'), ((16407, 16473), 'edb.edgeql.ast.ObjectRef', 'qlast.ObjectRef', ([], {'name': 'shortname', 'module': 'refctx.op.classna... |
import matplotlib.pyplot as plt
import pandas as pd
class Plot:
def __init__(self, input_list, output_list):
self.df1 = pd.DataFrame(input_list) # x1, y1, x2, y2, x3, y3 .. ...
self.df2 = pd.DataFrame(output_list) # theta1, theta 2 ....
self.X_train = self.df1.iloc[:,:].values
se... | [
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.scatter",
"pandas.DataFrame",
"matplotlib.pyplot.show"
] | [((134, 158), 'pandas.DataFrame', 'pd.DataFrame', (['input_list'], {}), '(input_list)\n', (146, 158), True, 'import pandas as pd\n'), ((211, 236), 'pandas.DataFrame', 'pd.DataFrame', (['output_list'], {}), '(output_list)\n', (223, 236), True, 'import pandas as pd\n'), ((482, 539), 'matplotlib.pyplot.scatter', 'plt.scat... |
__author__ = 'vitor'
import json
import os
from pathlib import Path
from urllib.parse import urlparse
import predict as pd
from flask import Flask, jsonify, render_template,send_file
from flask.globals import request
from pdf2image import convert_from_path
from werkzeug.utils import secure_filename
import ocrmypdf
fr... | [
"flask.render_template",
"werkzeug.utils.secure_filename",
"pathlib.Path",
"json.dumps",
"ocrmypdf.ocr",
"flask.globals.request.files.getlist",
"predict.make_predictions",
"tika.parser.from_file",
"os.path.isdir",
"os.mkdir",
"os.path.splitext",
"os.path.isfile",
"os.path.dirname",
"flask.... | [((2030, 2060), 'flask.render_template', 'render_template', (['"""upload.html"""'], {}), "('upload.html')\n", (2045, 2060), False, 'from flask import Flask, jsonify, render_template, send_file\n'), ((2123, 2151), 'flask.render_template', 'render_template', (['"""temp.html"""'], {}), "('temp.html')\n", (2138, 2151), Fal... |
import requests
import datetime
import time
import math
import json
import tqdm
import os
import dateutil.parser as dp
import numpy as np
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
import pdb
# pdb.set_trace()
MAX_NUM_SLOTS = 30
TIME_ZONE = '+05:30'
gdaxBaseUrl = 'https://api.gdax.co... | [
"os.path.exists",
"dateutil.parser.parse",
"datetime.datetime.fromtimestamp",
"math.ceil",
"os.makedirs",
"pandas.read_html",
"requests.get",
"pandas.DataFrame",
"pandas.to_datetime"
] | [((3391, 3414), 'pandas.DataFrame', 'pd.DataFrame', (['btc_price'], {}), '(btc_price)\n', (3403, 3414), True, 'import pandas as pd\n'), ((558, 591), 'os.path.exists', 'os.path.exists', (['"""historical_data"""'], {}), "('historical_data')\n", (572, 591), False, 'import os\n'), ((594, 624), 'os.makedirs', 'os.makedirs',... |
from __future__ import annotations
import json
from bs4 import BeautifulSoup
from psnprofiles_scraper.src.PsnProfiles.PsnProfilesObjectInterface import PsnProfilesObjectInterface
class Milestone(PsnProfilesObjectInterface):
def __init__(self, trophy: str, trophy_icon: str, game: str, description: str, date: str)... | [
"json.dumps"
] | [((518, 591), 'json.dumps', 'json.dumps', (['self'], {'default': '(lambda o: o.__dict__)', 'sort_keys': '(False)', 'indent': '(2)'}), '(self, default=lambda o: o.__dict__, sort_keys=False, indent=2)\n', (528, 591), False, 'import json\n')] |
from functools import partial
from os import environ, getcwd
import sys
from invocations import travis
from invocations.checks import blacken
from invocations.docs import docs, www, sites, watch_docs
from invocations.pytest import test, integration, coverage
from invocations.packaging import release
from invocations.u... | [
"invocations.packaging.release.upload",
"fabric2.Connection.from_v1",
"os.environ.get",
"os.getcwd",
"sys.path.remove",
"functools.partial",
"invoke.Collection",
"invocations.util.tmpdir"
] | [((3617, 3695), 'invoke.Collection', 'Collection', (['"""release"""', 'release.build', 'release.status', 'publish', 'release.prepare'], {}), "('release', release.build, release.status, publish, release.prepare)\n", (3627, 3695), False, 'from invoke import Collection, task\n'), ((3708, 3831), 'invoke.Collection', 'Colle... |
# -*- coding: utf-8 -*-
# Copyright: (c) 2021, <NAME> (@ajpantuso) <<EMAIL>>
# Copyright: (c) 2018, <NAME> (@dagwieers) <<EMAIL>>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
from ans... | [
"ansible_collections.community.general.plugins.module_utils.csv.read_csv",
"ansible_collections.community.general.plugins.module_utils.csv.initialize_dialect",
"ansible.module_utils._text.to_native"
] | [((1177, 1212), 'ansible_collections.community.general.plugins.module_utils.csv.read_csv', 'read_csv', (['data', 'dialect', 'fieldnames'], {}), '(data, dialect, fieldnames)\n', (1185, 1212), False, 'from ansible_collections.community.general.plugins.module_utils.csv import initialize_dialect, read_csv, CSVError, Dialec... |
#!/usr/bin/env python3
"""Real Requirements
Parses through the list of installed packages and explores your source code to
identify what the real requirements of your software are.
"""
import argparse
import json
import pathlib
import re
import subprocess
IMPORT_RE = re.compile(
r"(from )?(?(1)(?P<from>[a-zA-Z0-... | [
"argparse.ArgumentParser",
"pathlib.Path",
"re.compile",
"subprocess.run",
"json.load"
] | [((271, 368), 're.compile', 're.compile', (['"""(from )?(?(1)(?P<from>[a-zA-Z0-9._]*)|import (?P<import>[a-zA-Z0-9+._]*))"""'], {}), "(\n '(from )?(?(1)(?P<from>[a-zA-Z0-9._]*)|import (?P<import>[a-zA-Z0-9+._]*))'\n )\n", (281, 368), False, 'import re\n'), ((643, 656), 'json.load', 'json.load', (['fi'], {}), '(fi... |
#!/usr/bin/env python3
"""
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, software
dist... | [
"shared.common.parse_filters",
"argparse.ArgumentParser",
"shared.common_aws.aws_verbose",
"shared.common.exit_critical",
"provider.iot.command.Iot",
"argparse.ArgumentTypeError",
"shared.common_aws.generate_session",
"os.path.dirname",
"provider.vpc.command.Vpc",
"provider.limit.command.Limit",
... | [((718, 735), 'os.path.dirname', 'dirname', (['__file__'], {}), '(__file__)\n', (725, 735), False, 'from os.path import dirname\n'), ((1271, 1282), 'sys.exit', 'sys.exit', (['(1)'], {}), '(1)\n', (1279, 1282), False, 'import sys\n'), ((1741, 1766), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n',... |
from aumbry import Attr, YamlConfig
class DatabaseConfig(YamlConfig):
__mapping__ = {"file_path": Attr("file_path", str)}
connection = ""
class AppConfig(YamlConfig):
__mapping__ = {
"db": Attr("db", DatabaseConfig),
"gunicorn": Attr("gunicorn", dict),
"version": Attr("version",... | [
"aumbry.Attr"
] | [((104, 126), 'aumbry.Attr', 'Attr', (['"""file_path"""', 'str'], {}), "('file_path', str)\n", (108, 126), False, 'from aumbry import Attr, YamlConfig\n'), ((214, 240), 'aumbry.Attr', 'Attr', (['"""db"""', 'DatabaseConfig'], {}), "('db', DatabaseConfig)\n", (218, 240), False, 'from aumbry import Attr, YamlConfig\n'), (... |
#! /usr/bin/python3
#-------------------------------------------------------------------------------------------------#
# NAME: ibm_db-procedure_columns.py #
# #
... | [
"ipynb_exit.exit",
"ibm_db.procedure_columns",
"ibm_db.fetch_assoc",
"ibm_db_tools.Db2ConnectionMgr"
] | [((6164, 6220), 'ibm_db_tools.Db2ConnectionMgr', 'Db2ConnectionMgr', (['"""DB"""', 'dbName', '""""""', '""""""', 'userID', 'passWord'], {}), "('DB', dbName, '', '', userID, passWord)\n", (6180, 6220), False, 'from ibm_db_tools import Db2ConnectionMgr\n'), ((10668, 10674), 'ipynb_exit.exit', 'exit', ([], {}), '()\n', (1... |
import pcl
import numpy as np
def run_icp(data):
delta_theta_z, delta_x, delta_y, pc_in, pc_out, iter_t, iter_x, iter_y = data
# if do_exhaustive_serach:
transf_ini = np.eye(4)
transf_ini[0, 0] = np.cos(delta_theta_z[iter_t])
transf_ini[0, 1] = -np.sin(delta_theta_z[iter_t])
transf_ini[1, 0] ... | [
"numpy.eye",
"numpy.matmul",
"numpy.cos",
"numpy.sin",
"pcl.PointCloud"
] | [((182, 191), 'numpy.eye', 'np.eye', (['(4)'], {}), '(4)\n', (188, 191), True, 'import numpy as np\n'), ((215, 244), 'numpy.cos', 'np.cos', (['delta_theta_z[iter_t]'], {}), '(delta_theta_z[iter_t])\n', (221, 244), True, 'import numpy as np\n'), ((322, 351), 'numpy.sin', 'np.sin', (['delta_theta_z[iter_t]'], {}), '(delt... |