code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
from PyQt5 import QtWidgets
from .cnmf_pytemplate import Ui_CNMFParmsWindow
from mesmerize_core.utils import *
class CNMFWidget(QtWidgets.QMainWindow):
def __init__(self, parent):
QtWidgets.QMainWindow.__init__(self, parent=parent)
self.ui = Ui_CNMFParmsWindow()
self.ui.setupUi(self)
... | [
"PyQt5.QtWidgets.QMainWindow.__init__"
] | [((194, 245), 'PyQt5.QtWidgets.QMainWindow.__init__', 'QtWidgets.QMainWindow.__init__', (['self'], {'parent': 'parent'}), '(self, parent=parent)\n', (224, 245), False, 'from PyQt5 import QtWidgets\n')] |
"""
OpenVINO DL Workbench
Class for creating environment by manifest
Copyright (c) 2021 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/... | [
"tempfile.TemporaryDirectory",
"wb.main.console_tool_wrapper.environment_managment_tool.CreateVirtualEnvTool",
"wb.main.jobs.tools_runner.local_runner.LocalRunner",
"wb.main.console_tool_wrapper.environment_managment_tool.InstallPackagesToolParser",
"wb.main.environment.creator.status_reporter.CreateEnviron... | [((1678, 1733), 'wb.main.environment.creator.status_reporter.CreateEnvironmentStatusReporter', 'CreateEnvironmentStatusReporter', (['status_report_callback'], {}), '(status_report_callback)\n', (1709, 1733), False, 'from wb.main.environment.creator.status_reporter import CreateEnvironmentStatusReporter\n'), ((1899, 192... |
"""JSON validator."""
import json
from copy import deepcopy
from jsonvl.constants.builtins import Collection, Primitive
from jsonvl.constants.reserved import ReservedSymbols, ReservedWords
from jsonvl.core._array.array_validation import register_array_constraints, validate_array
from jsonvl.core._boolean.boolean_valid... | [
"jsonvl.errors.JsonValidationError.create",
"jsonvl.core._array.array_validation.validate_array",
"jsonvl.core._boolean.boolean_validation.register_boolean_constraints",
"jsonvl.constants.builtins.Collection.has",
"jsonvl.constants.builtins.Primitive.has",
"jsonvl.errors.JsonVlSystemError.create",
"json... | [((1169, 1201), 'jsonvl.core._array.array_validation.register_array_constraints', 'register_array_constraints', (['self'], {}), '(self)\n', (1195, 1201), False, 'from jsonvl.core._array.array_validation import register_array_constraints, validate_array\n'), ((1210, 1244), 'jsonvl.core._boolean.boolean_validation.regist... |
import datetime
import random
def get_time():
t = datetime.datetime.now()
s = "minutes: {}, seconds: {}, microseconds: {}".format(t.minute,
t.second,
t.microsecond)
s = "{} {} {}".format(... | [
"datetime.datetime.now",
"random.randint"
] | [((55, 78), 'datetime.datetime.now', 'datetime.datetime.now', ([], {}), '()\n', (76, 78), False, 'import datetime\n'), ((985, 1005), 'random.randint', 'random.randint', (['(0)', '(3)'], {}), '(0, 3)\n', (999, 1005), False, 'import random\n')] |
from __future__ import unicode_literals
from django.conf import settings
from django.db import models
class Swotcard(models.Model):
user_email = models.CharField(max_length=100)
swotcard_name = models.CharField(max_length=100)
swot_type = models.CharField(max_length=10)
share_id = models.CharField(max_length=40)
... | [
"django.db.models.CharField",
"django.db.models.IntegerField",
"django.db.models.ForeignKey"
] | [((148, 180), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(100)'}), '(max_length=100)\n', (164, 180), False, 'from django.db import models\n'), ((198, 230), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(100)'}), '(max_length=100)\n', (214, 230), False, 'from django.d... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Description: This file contains functions to display an interactive
availability table for ICOS data products.
"""
__author__ = ["<NAME>"]
__credits__ = "ICOS Carbon Portal"
__license__ = "GPL-3.0"
__version__ = "0.1.0"
... | [
"bokeh.transform.dodge",
"bokeh.models.ColumnDataSource",
"bokeh.plotting.figure",
"bokeh.io.output_notebook",
"bokeh.io.show",
"bokeh.models.Label",
"bokeh.io.reset_output",
"bokeh.models.Legend"
] | [((5986, 6000), 'bokeh.io.reset_output', 'reset_output', ([], {}), '()\n', (5998, 6000), False, 'from bokeh.io import show, output_notebook, reset_output\n'), ((6005, 6022), 'bokeh.io.output_notebook', 'output_notebook', ([], {}), '()\n', (6020, 6022), False, 'from bokeh.io import show, output_notebook, reset_output\n'... |
import random
from sklearn.neural_network import MLPClassifier
class GKClassifier:
def __init__(self):
pass
@staticmethod
def predict_reviewer(features, classes):
"""
Credit: https://www.dataquest.io/blog/natural-language-processing-with-python/
:param features:
:p... | [
"sklearn.neural_network.MLPClassifier"
] | [((576, 591), 'sklearn.neural_network.MLPClassifier', 'MLPClassifier', ([], {}), '()\n', (589, 591), False, 'from sklearn.neural_network import MLPClassifier\n')] |
# -*- coding: utf-8 -*-
#%% Sample 2-1
#%% 画像データの入出力
# RGB-グレースケール変換
#
# 画像処理特論
#
# 村松 正吾
#
# 動作確認: Python 3.7, PyTorch 1.8
#%% Input and output of images
# RGB to grayscale
#
# Advanced Topics in Image Processing
#
# <NAME>
#
# Verified: Python 3.7, PyTorch 1.8
from PIL import Image
import requests
import torc... | [
"matplotlib.pyplot.show",
"torchvision.transforms.ConvertImageDtype",
"torchvision.transforms.ToPILImage",
"matplotlib.pyplot.figure",
"torchvision.transforms.Grayscale",
"requests.get",
"torchvision.transforms.ToTensor"
] | [((654, 687), 'torchvision.transforms.ToTensor', 'torchvision.transforms.ToTensor', ([], {}), '()\n', (685, 687), False, 'import torchvision\n'), ((1005, 1058), 'torchvision.transforms.ConvertImageDtype', 'torchvision.transforms.ConvertImageDtype', (['torch.uint8'], {}), '(torch.uint8)\n', (1045, 1058), False, 'import ... |
#classificação do atleta de acordo com a idade
from datetime import date
nascimento = int(input('Digite o Ano de Nascimento: '))
idade = date.today().year - nascimento
print(f'A IDADE DO ATLETA É {idade}')
if idade <= 9:
print('ATLETA MIRIM')
elif idade <= 14:
print('ATLETA INFANTIL')
elif idade <= 19:
prin... | [
"datetime.date.today"
] | [((137, 149), 'datetime.date.today', 'date.today', ([], {}), '()\n', (147, 149), False, 'from datetime import date\n')] |
# -*- coding: utf-8 -*-
import threading
from typing import Any, Dict, List
from chaoslib.types import (Activity, Configuration, Experiment, Hypothesis,
Journal, Run, Secrets)
from logzero import logger
from . import push_to_humio
__all__ = ["configure_control", "before_experiment_control... | [
"logzero.logger.debug",
"threading.local"
] | [((504, 521), 'threading.local', 'threading.local', ([], {}), '()\n', (519, 521), False, 'import threading\n'), ((866, 930), 'logzero.logger.debug', 'logger.debug', (['"""Humio logging control is active for this session"""'], {}), "('Humio logging control is active for this session')\n", (878, 930), False, 'from logzer... |
import rospy
from std_msgs.msg import Float64
class TimeOfCalcDataCollector():
def cbTimeOfCalc(self, data):
if (not self.initialized):
self.avg_time_of_calc = data.data
self.max_time_of_calc = data.data
self.initialized = True
else:
self.avg_time_of_... | [
"rospy.spin",
"rospy.Subscriber",
"rospy.init_node",
"rospy.Duration"
] | [((945, 991), 'rospy.init_node', 'rospy.init_node', (['"""datacollector_lateral_error"""'], {}), "('datacollector_lateral_error')\n", (960, 991), False, 'import rospy\n'), ((1075, 1087), 'rospy.spin', 'rospy.spin', ([], {}), '()\n', (1085, 1087), False, 'import rospy\n'), ((819, 918), 'rospy.Subscriber', 'rospy.Subscri... |
import argparse
from sryapicli.plugin_helpers import SRYClientPlugin
import omegaclient
class UserPlugin(SRYClientPlugin):
def register(self):
# command: me
self.set_command('user', help='get user information')
user_info_parser = self.add_action('info', help='show current login user info... | [
"omegaclient.OmegaClient"
] | [((487, 563), 'omegaclient.OmegaClient', 'omegaclient.OmegaClient', (["configs['host']", 'None', 'None'], {'token': "configs['token']"}), "(configs['host'], None, None, token=configs['token'])\n", (510, 563), False, 'import omegaclient\n')] |
#!/usr/bin/env python
import os
import subprocess
import xml.etree.ElementTree as ET
import csv
## for validating and checking if TIFFs are well-formed with JHOVE.
os.chdir("/Applications/JHOVE")
print("Enter the directory you'd like to check.\n")
folder = input()
current_path = folder.replace('\\', '')
current_path... | [
"os.listdir",
"xml.etree.ElementTree.parse",
"os.chdir",
"csv.DictWriter"
] | [((167, 198), 'os.chdir', 'os.chdir', (['"""/Applications/JHOVE"""'], {}), "('/Applications/JHOVE')\n", (175, 198), False, 'import os\n'), ((790, 826), 'csv.DictWriter', 'csv.DictWriter', (['f'], {'fieldnames': 'header'}), '(f, fieldnames=header)\n', (804, 826), False, 'import csv\n'), ((861, 911), 'xml.etree.ElementTr... |
"""
config file for directory and hyper parameter setting
"""
import os
import torch
from torchvision import transforms
import utils.joint_transforms as joint_transforms
print('loading configs.........')
# --------------------------------Data directory---------------------------------------------------
# data_dir = '/... | [
"utils.joint_transforms.RandomSizedCrop",
"utils.joint_transforms.RandomHorizontallyFlip",
"utils.joint_transforms.RandomRotate",
"torchvision.transforms.ToPILImage",
"torch.cuda.is_available",
"os.path.join",
"torchvision.transforms.ToTensor"
] | [((1118, 1160), 'os.path.join', 'os.path.join', (['dir_checkpoint', 'resume_model'], {}), '(dir_checkpoint, resume_model)\n', (1130, 1160), False, 'import os\n'), ((1348, 1388), 'os.path.join', 'os.path.join', (['dir_checkpoint', 'model_eval'], {}), '(dir_checkpoint, model_eval)\n', (1360, 1388), False, 'import os\n'),... |
import arcade
from src.logic.snake import Snake
# Grid rows and columns count
ROW_COUNT = 15
COLUMN_COUNT = 15
# Grid cell values
CELL_WIDTH = 30
CELL_HEIGHT = 30
# The margin between each cell
# and on the edges of the screen.
MARGIN = 5
SCREEN_WIDTH = (CELL_WIDTH + MARGIN) * COLUMN_COUNT + MARGIN
SCREEN_HEIGHT = ... | [
"arcade.start_render",
"arcade.draw_text",
"src.logic.snake.Snake",
"arcade.set_background_color"
] | [((603, 650), 'arcade.set_background_color', 'arcade.set_background_color', (['arcade.color.WHITE'], {}), '(arcade.color.WHITE)\n', (630, 650), False, 'import arcade\n'), ((673, 741), 'src.logic.snake.Snake', 'Snake', (['ROW_COUNT', 'COLUMN_COUNT', 'CELL_WIDTH', 'CELL_HEIGHT', 'MARGIN', '(0.1)'], {}), '(ROW_COUNT, COLU... |
#info: https://wikidocs.net/images/page/92082/axis_range_04.png
import matplotlib.pyplot as plt
plt.plot([1, 2, 3, 4], [2, 3, 5, 10])
plt.xlabel('X-Axis')
plt.ylabel('Y-Axis')
"""
plt.xlim([0, 5])
plt.ylim([0, 20])
#plt.xlim([X_min, X_max]): 각각 X좌표의 최소값, 최대값 지정. plt.ylim에도 동일하게 적용
"""
plt.axis([0, 5, 0, 20]) # X, Y... | [
"matplotlib.pyplot.show",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.axis",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel"
] | [((98, 135), 'matplotlib.pyplot.plot', 'plt.plot', (['[1, 2, 3, 4]', '[2, 3, 5, 10]'], {}), '([1, 2, 3, 4], [2, 3, 5, 10])\n', (106, 135), True, 'import matplotlib.pyplot as plt\n'), ((136, 156), 'matplotlib.pyplot.xlabel', 'plt.xlabel', (['"""X-Axis"""'], {}), "('X-Axis')\n", (146, 156), True, 'import matplotlib.pyplo... |
#!/usr/bin/env python
# micromanage metadata update module.
import time
import threading
import json
import urllib
import config
import event
import stream
metadata = {}
afk_streaming = False
afk_song = None
### Events.
def update_show(title):
global metadata
metadata['current'] = title
def update_dj(dj):
... | [
"json.dump",
"event.add_handler",
"json.load",
"stream.extract_annotations",
"stream.fetch_data",
"time.sleep",
"stream.extract_song",
"stream.extract_listeners",
"event.emit"
] | [((575, 622), 'event.add_handler', 'event.add_handler', (['"""metadata.show"""', 'update_show'], {}), "('metadata.show', update_show)\n", (592, 622), False, 'import event\n'), ((623, 666), 'event.add_handler', 'event.add_handler', (['"""metadata.dj"""', 'update_dj'], {}), "('metadata.dj', update_dj)\n", (640, 666), Fal... |
from django.shortcuts import render
from django.http import HttpResponse
# Create your views here.
def Courses(request):
return HttpResponse('<h1>Ths is my Home Page</h1>') | [
"django.http.HttpResponse"
] | [((133, 177), 'django.http.HttpResponse', 'HttpResponse', (['"""<h1>Ths is my Home Page</h1>"""'], {}), "('<h1>Ths is my Home Page</h1>')\n", (145, 177), False, 'from django.http import HttpResponse\n')] |
import time
import lattice,fileio
import os,sys
def runparams(param,n_equil=500000,n_calc=250000):
L = lattice.Lattice(n = param[0],T=param[3],state=param[1],J=param[2])
print("Run:%s Equilibrating..." % L.config)
sys.stdout.flush()
for i in xrange(n_equil):
L.cstep()
print("Done!")
sys... | [
"lattice.Lattice",
"fileio.writedata",
"profile.run",
"time.time",
"sys.stdout.flush"
] | [((108, 175), 'lattice.Lattice', 'lattice.Lattice', ([], {'n': 'param[0]', 'T': 'param[3]', 'state': 'param[1]', 'J': 'param[2]'}), '(n=param[0], T=param[3], state=param[1], J=param[2])\n', (123, 175), False, 'import lattice, fileio\n'), ((227, 245), 'sys.stdout.flush', 'sys.stdout.flush', ([], {}), '()\n', (243, 245),... |
"""Suppoort for Mitsubishi."""
from datetime import timedelta
import logging
import threading
import voluptuous as vol
import json
import copy
from homeassistant.components.climate import DOMAIN as CLIMATE
from homeassistant.const import (
CONF_NAME,
)
import homeassistant.helpers.config_validation as cv
from home... | [
"json.dump",
"copy.deepcopy",
"json.load",
"voluptuous.Optional",
"voluptuous.All",
"voluptuous.Required",
"threading.Lock",
"homeassistant.helpers.discovery.load_platform",
"voluptuous.Unique",
"logging.getLogger"
] | [((867, 894), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (884, 894), False, 'import logging\n'), ((1257, 1284), 'voluptuous.Required', 'vol.Required', (['REMOTE_ENTITY'], {}), '(REMOTE_ENTITY)\n', (1269, 1284), True, 'import voluptuous as vol\n'), ((1305, 1350), 'voluptuous.Optional',... |
import matgen as mg
def filter(data, remMetals=True, spinPol=False, directOnly=True, ehmax=0.05, dgDeltaMax=None, memax=None, mhmax=None):
''' '''
K = list(set.intersection(*[set(list(p.keys())) for p in data.values()]))
print('{} COMMON ENTRIES FOUND ACROSS ALL DATA TYPES'.format(len(K)))
# remove metals (s... | [
"matgen.getBS"
] | [((982, 993), 'matgen.getBS', 'mg.getBS', (['k'], {}), '(k)\n', (990, 993), True, 'import matgen as mg\n')] |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
:Description: Larva segmentation
:Authors: (c) <NAME> <<EMAIL>>
:Date: 2020-08-120
"""
import os
import cv2 as cv
import numpy as np
# from scipy.io import loadmat
from argparse import ArgumentParser, ArgumentDefaultsHelpFormatter
from glob import iglob
# import json
... | [
"argparse.ArgumentParser",
"cv2.VideoWriter_fourcc",
"numpy.ones",
"glob.iglob",
"cv2.imshow",
"os.path.join",
"cv2.subtract",
"cv2.dilate",
"cv2.cvtColor",
"os.path.exists",
"cv2.connectedComponents",
"cv2.destroyAllWindows",
"numpy.uint8",
"cv2.waitKey",
"cv2.morphologyEx",
"cv2.crea... | [((698, 827), 'argparse.ArgumentParser', 'ArgumentParser', ([], {'description': '"""Larva segmentation."""', 'formatter_class': 'ArgumentDefaultsHelpFormatter', 'conflict_handler': '"""resolve"""'}), "(description='Larva segmentation.', formatter_class=\n ArgumentDefaultsHelpFormatter, conflict_handler='resolve')\n"... |
from django.contrib import admin
from reversion.admin import VersionAdmin
from gtas.parent.models.parent import Airport
from gtas.parent.models.parent import AirportRestore
from gtas.parent.models.parent import ApiAccess
from gtas.parent.models.parent import AppConfiguration
from gtas.parent.models.parent import Audit... | [
"django.contrib.admin.register"
] | [((778, 801), 'django.contrib.admin.register', 'admin.register', (['Airport'], {}), '(Airport)\n', (792, 801), False, 'from django.contrib import admin\n'), ((1370, 1400), 'django.contrib.admin.register', 'admin.register', (['AirportRestore'], {}), '(AirportRestore)\n', (1384, 1400), False, 'from django.contrib import ... |
"""Author: Trinity Core Team
MIT License
Copyright (c) 2018 Trinity
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, mo... | [
"json.dumps",
"requests.post",
"trinity.Configure.get",
"wallet.utils.get_wallet_info",
"wallet.utils.get_magic"
] | [((2200, 2252), 'requests.post', 'requests.post', (["Configure['GatewayURL']"], {'json': 'request'}), "(Configure['GatewayURL'], json=request)\n", (2213, 2252), False, 'import requests\n'), ((2660, 2712), 'requests.post', 'requests.post', (["Configure['GatewayURL']"], {'json': 'request'}), "(Configure['GatewayURL'], js... |
import sys
word = sys.stdin.readline().strip()
suffixes = [word[i:] for i in range(len(word))]
for suffix in sorted(suffixes):
sys.stdout.write(suffix + '\n')
| [
"sys.stdout.write",
"sys.stdin.readline"
] | [((134, 165), 'sys.stdout.write', 'sys.stdout.write', (["(suffix + '\\n')"], {}), "(suffix + '\\n')\n", (150, 165), False, 'import sys\n'), ((19, 39), 'sys.stdin.readline', 'sys.stdin.readline', ([], {}), '()\n', (37, 39), False, 'import sys\n')] |
import requests
import hashlib
import hmac
import time
import json
from algoplex.api import execution
class ExchangeAccess():
base_api_url = 'https://coincheck.com/api/exchange'
order_api_url = base_api_url + '/orders'
ord_txn_api_url = base_api_url + '/orders/transactions'
unse... | [
"json.loads",
"algoplex.api.execution.Execution",
"time.time",
"requests.delete",
"requests.get",
"requests.post"
] | [((1383, 1444), 'requests.post', 'requests.post', (['self.order_api_url'], {'headers': 'headers', 'data': 'body'}), '(self.order_api_url, headers=headers, data=body)\n', (1396, 1444), False, 'import requests\n'), ((2211, 2255), 'requests.delete', 'requests.delete', (['cancel_url'], {'headers': 'headers'}), '(cancel_url... |
"""
FILTERED ELEMENT COLLECTOR - ANALYTICAL MODEL PARAMETER ELEMENTS ONLY
"""
__author__ = '<NAME> - <EMAIL>'
__twitter__ = '@solamour'
__version__ = '1.0.0'
# Importing Reference Modules
import clr # CLR ( Common Language Runtime Module )
clr.AddReference("RevitServices") # Adding the RevitServices.dll spe... | [
"clr.AddReference"
] | [((252, 285), 'clr.AddReference', 'clr.AddReference', (['"""RevitServices"""'], {}), "('RevitServices')\n", (268, 285), False, 'import clr\n'), ((511, 539), 'clr.AddReference', 'clr.AddReference', (['"""RevitAPI"""'], {}), "('RevitAPI')\n", (527, 539), False, 'import clr\n')] |
import typing
from datetime import datetime, date
from google.api_core.exceptions import RetryError, Aborted
from google.cloud import ndb
from data_service.store.mixins import AmountMixin
from data_service.utils.utils import get_days, get_payment_methods
class MembershipValidators:
@staticmethod
def start_da... | [
"google.cloud.ndb.DateTimeProperty",
"google.cloud.ndb.IntegerProperty",
"datetime.datetime.now",
"data_service.utils.utils.get_payment_methods",
"google.cloud.ndb.DateProperty",
"google.cloud.ndb.StringProperty",
"data_service.utils.utils.get_days",
"google.cloud.ndb.StructuredProperty",
"google.cl... | [((9718, 9762), 'google.cloud.ndb.StringProperty', 'ndb.StringProperty', ([], {'validator': 'setters.set_id'}), '(validator=setters.set_id)\n', (9736, 9762), False, 'from google.cloud import ndb\n'), ((9782, 9826), 'google.cloud.ndb.StringProperty', 'ndb.StringProperty', ([], {'validator': 'setters.set_id'}), '(validat... |
# -------------------------------------------------------------
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you unde... | [
"subprocess.run",
"logging.error",
"logging.debug",
"os.getcwd",
"subprocess.CalledProcessError",
"logging.info"
] | [((2711, 2756), 'logging.info', 'logging.info', (['"""Successfully executed script."""'], {}), "('Successfully executed script.')\n", (2723, 2756), False, 'import logging\n'), ((2801, 2823), 'logging.info', 'logging.info', (["('#' * 30)"], {}), "('#' * 30)\n", (2813, 2823), False, 'import logging\n'), ((2828, 2881), 'l... |
import torch.nn as nn
def init_weights(m):
if type(m) == nn.Linear:
nn.init.kaiming_normal_(m.weight)
# nn.init.xavier_uniform(m.weight)
# m.bias.data.fill_(0.01)
| [
"torch.nn.init.kaiming_normal_"
] | [((82, 115), 'torch.nn.init.kaiming_normal_', 'nn.init.kaiming_normal_', (['m.weight'], {}), '(m.weight)\n', (105, 115), True, 'import torch.nn as nn\n')] |
# -*- coding: utf-8 -*-
#单人舞程序
#使用时请将ip改成需要连接的机器人
#winxos 2012-07-14
import time,math
import wsNaoMotion as wsnm
import audioHelper as ah
if __name__ == '__main__':
nm=wsnm.wsNaoMotion("192.168.1.102")
time.sleep(1)
nm.runBehavior("dance")
ah=ah.audioHelper()
ah.play("music201207.mp3")
time.sleep(200)
... | [
"audioHelper.stop",
"time.sleep",
"audioHelper.play",
"wsNaoMotion.wsNaoMotion",
"audioHelper.audioHelper"
] | [((170, 203), 'wsNaoMotion.wsNaoMotion', 'wsnm.wsNaoMotion', (['"""192.168.1.102"""'], {}), "('192.168.1.102')\n", (186, 203), True, 'import wsNaoMotion as wsnm\n'), ((207, 220), 'time.sleep', 'time.sleep', (['(1)'], {}), '(1)\n', (217, 220), False, 'import time, math\n'), ((255, 271), 'audioHelper.audioHelper', 'ah.au... |
import os
str1 = input('enter round number ')
str2 = input("enter div ")
contest_name = "Codeforces Round #"+str1+" (Div. "+str2+")"
parent_path = os.getcwd()
folder_name = os.path.join(parent_path,contest_name)
os.mkdir(folder_name)
fname = open('template.txt', "r")
template_txt = fname.read().strip()
fname.close()... | [
"os.getcwd",
"os.mkdir",
"os.path.join",
"os.system"
] | [((149, 160), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (158, 160), False, 'import os\n'), ((175, 214), 'os.path.join', 'os.path.join', (['parent_path', 'contest_name'], {}), '(parent_path, contest_name)\n', (187, 214), False, 'import os\n'), ((214, 235), 'os.mkdir', 'os.mkdir', (['folder_name'], {}), '(folder_name)\... |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.6 on 2016-09-08 07:34
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('tf', '0001_initial'),
]
operati... | [
"django.db.models.TextField",
"django.db.models.CharField",
"django.db.models.ForeignKey",
"django.db.models.PositiveIntegerField",
"django.db.models.FloatField",
"django.db.models.BooleanField",
"django.db.models.AutoField",
"django.db.models.IntegerField",
"django.db.models.DateTimeField"
] | [((430, 523), '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", (446, 523), False, 'from django.db import migrations, models\... |
import unittest
import datetime
import mock
from boto.exception import BotoServerError
from boto.cloudformation.stack import StackEvent
from boto.cloudformation.connection import CloudFormationConnection
from cloudforge.watcher import filter_events_before, Watcher
def make_events(count):
events = []
for i i... | [
"unittest.main",
"cloudforge.watcher.filter_events_before",
"mock.patch",
"boto.exception.BotoServerError",
"cloudforge.watcher.Watcher",
"mock.MagicMock",
"datetime.datetime.now",
"boto.cloudformation.stack.StackEvent"
] | [((485, 516), 'mock.MagicMock', 'mock.MagicMock', ([], {'spec': 'StackEvent'}), '(spec=StackEvent)\n', (499, 516), False, 'import mock\n'), ((544, 567), 'datetime.datetime.now', 'datetime.datetime.now', ([], {}), '()\n', (565, 567), False, 'import datetime\n'), ((1432, 1475), 'mock.patch', 'mock.patch', (['"""cloudforg... |
"""
Adapted from https://github.com/leoxiaobin/deep-high-resolution-net.pytorch
Original licence: Copyright (c) Microsoft, under the MIT License.
"""
from abc import ABC, abstractmethod
import copy
import random
import cv2
import numpy as np
from albumentations import (
Compose,
Normalize,
)
import tensorflow... | [
"copy.deepcopy",
"numpy.sum",
"numpy.random.randn",
"cv2.cvtColor",
"random.shuffle",
"numpy.random.rand",
"numpy.zeros",
"numpy.ones",
"cv2.imread",
"cv2.warpAffine",
"random.random",
"numpy.arange",
"numpy.exp",
"albumentations.Normalize"
] | [((2316, 2343), 'copy.deepcopy', 'copy.deepcopy', (['self.db[idx]'], {}), '(self.db[idx])\n', (2329, 2343), False, 'import copy\n'), ((2470, 2542), 'cv2.imread', 'cv2.imread', (['image_file', '(cv2.IMREAD_COLOR | cv2.IMREAD_IGNORE_ORIENTATION)'], {}), '(image_file, cv2.IMREAD_COLOR | cv2.IMREAD_IGNORE_ORIENTATION)\n', ... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('answers', '0002_auto_20150622_2309'),
]
operations = [
migrations.CreateModel(
name='MultipleChoiceOtherAnswer',... | [
"django.db.models.CharField",
"django.db.models.DateTimeField",
"django.db.models.ForeignKey",
"django.db.models.AutoField"
] | [((365, 458), 'django.db.models.AutoField', 'models.AutoField', ([], {'verbose_name': '"""ID"""', 'serialize': '(False)', 'auto_created': '(True)', 'primary_key': '(True)'}), "(verbose_name='ID', serialize=False, auto_created=True,\n primary_key=True)\n", (381, 458), False, 'from django.db import models, migrations\... |
import csv
import itertools
import json
import sys
if len(sys.argv) < 3:
print('Missing LEM and POS')
exit(0)
LEM = sys.argv[1]
POS = sys.argv[2]
with open('refined_objects.txt') as base_f:
physical_objects = set([line.strip() for line in base_f])
with open('blacklist.txt') as black_f:
... | [
"itertools.combinations",
"json.dumps"
] | [((892, 930), 'itertools.combinations', 'itertools.combinations', (['all_objects', '(2)'], {}), '(all_objects, 2)\n', (914, 930), False, 'import itertools\n'), ((2211, 2247), 'itertools.combinations', 'itertools.combinations', (['intersect', '(2)'], {}), '(intersect, 2)\n', (2233, 2247), False, 'import itertools\n'), (... |
import math
import functools
import torch
from torch import nn
import torch.nn.functional as F
def get_active_fn(name):
"""Select activation function."""
active_fn = {
'nn.ReLU6': functools.partial(nn.ReLU6, inplace=True),
'nn.ReLU': functools.partial(nn.ReLU, inplace=True),
'nn.Leaky... | [
"torch.nn.Dropout",
"functools.partial",
"torch.nn.UpsamplingBilinear2d",
"torch.nn.ReLU",
"torch.nn.ConvTranspose2d",
"math.sqrt",
"torch.nn.Sequential",
"torch.nn.ModuleList",
"torch.nn.LogSoftmax",
"torch.nn.ReflectionPad2d",
"torch.nn.Conv2d",
"torch.nn.Tanh",
"math.fabs",
"torch.nn.Le... | [((4305, 4320), 'torch.nn.ModuleList', 'nn.ModuleList', ([], {}), '()\n', (4318, 4320), False, 'from torch import nn\n'), ((5229, 5244), 'torch.nn.ModuleList', 'nn.ModuleList', ([], {}), '()\n', (5242, 5244), False, 'from torch import nn\n'), ((11372, 11401), 'torch.nn.Sequential', 'nn.Sequential', (['*down_sampling'],... |
from typing import Dict, Any
import pytest
from exco.extractor_spec.table_extraction_spec import TableItemDirection, TableEndConditionSpec, TableExtractionSpec
def test_from_value():
assert TableItemDirection.from_value(
'downward') == TableItemDirection.DOWNWARD
assert TableItemDirection.from_value(... | [
"exco.extractor_spec.table_extraction_spec.TableEndConditionSpec.from_dict",
"exco.extractor_spec.table_extraction_spec.TableItemDirection.default",
"exco.extractor_spec.table_extraction_spec.TableItemDirection.from_value",
"pytest.fixture",
"exco.extractor_spec.table_extraction_spec.TableExtractionSpec.fro... | [((650, 682), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""function"""'}), "(scope='function')\n", (664, 682), False, 'import pytest\n'), ((503, 563), 'exco.extractor_spec.table_extraction_spec.TableEndConditionSpec.from_dict', 'TableEndConditionSpec.from_dict', (["{'name': 'max_row', 'n': 5}"], {}), "({'name... |
# <NAME>, 18/04/2018
# Project 2018, Iris Dataset Analysis
# https://web.microsoftstream.com/video/74b18405-5ee1-47f0-a42d-e8831a453a91
# https://docs.scipy.org/doc/numpy/reference/generated/numpy.amin.html
# https://docs.scipy.org/doc/numpy-1.14.0/reference/generated/numpy.amax.html
# https://web.microsoftstream.com/v... | [
"matplotlib.pyplot.title",
"matplotlib.pyplot.show",
"numpy.amin",
"numpy.std",
"matplotlib.pyplot.scatter",
"matplotlib.pyplot.legend",
"numpy.genfromtxt",
"numpy.amax",
"numpy.mean",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel"
] | [((598, 646), 'numpy.genfromtxt', 'numpy.genfromtxt', (['"""data/iris.csv"""'], {'delimiter': '""","""'}), "('data/iris.csv', delimiter=',')\n", (614, 646), False, 'import numpy\n'), ((1124, 1146), 'numpy.amax', 'numpy.amax', (['data[:, 2]'], {}), '(data[:, 2])\n', (1134, 1146), False, 'import numpy\n'), ((1158, 1180),... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2019/3/20 16:25
# @Author : <NAME>
# @Site :
# @File : memnet.py
# @Software: PyCharm
# @Github : https://github.com/stevehamwu
import pickle
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
def position_encoding(... | [
"torch.nn.Dropout",
"torch.nn.utils.clip_grad_norm_",
"torch.nn.Embedding",
"numpy.transpose",
"numpy.ones",
"torch.nn.functional.softmax",
"torch.nn.Linear",
"torch.sum"
] | [((367, 425), 'numpy.ones', 'np.ones', (['(embedding_size, sentence_size)'], {'dtype': 'np.float32'}), '((embedding_size, sentence_size), dtype=np.float32)\n', (374, 425), True, 'import numpy as np\n'), ((692, 714), 'numpy.transpose', 'np.transpose', (['encoding'], {}), '(encoding)\n', (704, 714), True, 'import numpy a... |
#encoding:UTF-8
import gym
import matplotlib
import numpy as np
import sys
from collections import defaultdict
if "../" not in sys.path:
sys.path.append("../")
from lib.envs.blackjack import BlackjackEnv
from lib import plotting
matplotlib.style.use('ggplot')
env = BlackjackEnv()
def make_epsilon_greedy_polic... | [
"sys.path.append",
"lib.plotting.plot_value_function",
"matplotlib.style.use",
"numpy.argmax",
"numpy.zeros",
"numpy.ones",
"collections.defaultdict",
"numpy.max",
"sys.stdout.flush",
"lib.envs.blackjack.BlackjackEnv"
] | [((237, 267), 'matplotlib.style.use', 'matplotlib.style.use', (['"""ggplot"""'], {}), "('ggplot')\n", (257, 267), False, 'import matplotlib\n'), ((275, 289), 'lib.envs.blackjack.BlackjackEnv', 'BlackjackEnv', ([], {}), '()\n', (287, 289), False, 'from lib.envs.blackjack import BlackjackEnv\n'), ((3649, 3667), 'collecti... |
import json
from channels.db import database_sync_to_async
from channels.generic.websocket import AsyncWebsocketConsumer
from channels.exceptions import DenyConnection
from django.core.exceptions import ObjectDoesNotExist
from django.contrib.auth.models import AnonymousUser
from . import models
@database_sync_to_a... | [
"django.contrib.auth.models.AnonymousUser",
"channels.exceptions.DenyConnection",
"json.loads",
"json.dumps"
] | [((1627, 1648), 'json.loads', 'json.loads', (['text_data'], {}), '(text_data)\n', (1637, 1648), False, 'import json\n'), ((762, 777), 'django.contrib.auth.models.AnonymousUser', 'AnonymousUser', ([], {}), '()\n', (775, 777), False, 'from django.contrib.auth.models import AnonymousUser\n'), ((797, 848), 'channels.except... |
# Solve audio and video out of sync problem
#
# This tool will trim the starting section of the longer mp4 file because they should always end at the same time.
# After trimming, this tool will concat audio & video.
# e.g. (after running dl_hls.py)
# output_1.mp4 (audio & video, but only need audio)
# output_2.mp4 (vid... | [
"os.getcwd",
"subprocess.run",
"os.system",
"os.listdir"
] | [((382, 393), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (391, 393), False, 'import os\n'), ((412, 433), 'os.listdir', 'os.listdir', (['curr_path'], {}), '(curr_path)\n', (422, 433), False, 'import os\n'), ((696, 887), 'subprocess.run', 'subprocess.run', (["['ffprobe', '-v', 'error', '-show_entries', 'format=duration'... |
import sys
import getopt
import numpy as np
import matplotlib.pyplot as plt
import scipy
def usage():
print("""Usage:
-o, --output [output_file_name] Output file name (Required)
-h, --help Print this message (Optional)
""")
def init_params():
'''
Initializes ... | [
"numpy.abs",
"getopt.getopt",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.show",
"numpy.fromfile",
"sys.exit"
] | [((2385, 2407), 'numpy.abs', 'np.abs', (['complex_output'], {}), '(complex_output)\n', (2391, 2407), True, 'import numpy as np\n'), ((2411, 2429), 'matplotlib.pyplot.plot', 'plt.plot', (['t', 'power'], {}), '(t, power)\n', (2419, 2429), True, 'import matplotlib.pyplot as plt\n'), ((2432, 2442), 'matplotlib.pyplot.show'... |
import pymysql
import vk
import networkx as nx
import igraph
import time
import os
import csv
from datetime import datetime, timedelta
from multiprocessing import Pool
from modules.get_student_graph import *
from modules.get_student_group import *
if __name__ == '__main__':
start_time = time.time()
session =... | [
"vk.API",
"os.makedirs",
"csv.reader",
"csv.writer",
"vk.Session",
"time.time",
"datetime.datetime",
"multiprocessing.Pool",
"pymysql.connect"
] | [((294, 305), 'time.time', 'time.time', ([], {}), '()\n', (303, 305), False, 'import time\n'), ((321, 333), 'vk.Session', 'vk.Session', ([], {}), '()\n', (331, 333), False, 'import vk\n'), ((344, 369), 'vk.API', 'vk.API', (['session'], {'v': '"""5.62"""'}), "(session, v='5.62')\n", (350, 369), False, 'import vk\n'), ((... |
from elftools.elf.elffile import ELFFile
def get_executable_arch(path):
"""
Returns the architecture of an executable binary
Parameters
----------
path : str
path to the Go binaries generated
Returns
-------
str
Architecture type of the generated binaries
"""
... | [
"elftools.elf.elffile.ELFFile"
] | [((365, 375), 'elftools.elf.elffile.ELFFile', 'ELFFile', (['f'], {}), '(f)\n', (372, 375), False, 'from elftools.elf.elffile import ELFFile\n')] |
import json
import requests as req
response ='''{"batchcomplete":"haha","continue":{"rncontinue":"0.598107603571|0.598108276726|5325815|0","continue":"-||"},"query":{"random":[{"id":17249989,"ns":0,"title":"Continental O-520"},{"id":24316758,"ns":0,"title":"<NAME>"},{"id":28271825,"ns":0,"title":"Rigid chain actuator"... | [
"json.loads",
"requests.get"
] | [((923, 955), 'requests.get', 'req.get', (['base_url'], {'params': 'params'}), '(base_url, params=params)\n', (930, 955), True, 'import requests as req\n'), ((985, 1010), 'json.loads', 'json.loads', (['response.text'], {}), '(response.text)\n', (995, 1010), False, 'import json\n')] |
from __future__ import unicode_literals
import pytest
import json
import os
from solc import get_solc_version
from solc.wrapper import (
solc_wrapper,
)
def is_benign(err):
return not err or err in (
'Warning: This is a pre-release compiler version, please do not use it in production.\n',
)
d... | [
"os.path.join",
"json.loads",
"solc.wrapper.solc_wrapper",
"json.dumps"
] | [((360, 406), 'solc.wrapper.solc_wrapper', 'solc_wrapper', ([], {'help': '(True)', 'success_return_code': '(1)'}), '(help=True, success_return_code=1)\n', (372, 406), False, 'from solc.wrapper import solc_wrapper\n'), ((529, 555), 'solc.wrapper.solc_wrapper', 'solc_wrapper', ([], {'version': '(True)'}), '(version=True)... |
# Autogenerated from KST: please remove this line if doing any edits by hand!
import unittest
from process_coerce_usertype2 import ProcessCoerceUsertype2
class TestProcessCoerceUsertype2(unittest.TestCase):
def test_process_coerce_usertype2(self):
with ProcessCoerceUsertype2.from_file('src/process_coerce... | [
"process_coerce_usertype2.ProcessCoerceUsertype2.from_file"
] | [((268, 332), 'process_coerce_usertype2.ProcessCoerceUsertype2.from_file', 'ProcessCoerceUsertype2.from_file', (['"""src/process_coerce_bytes.bin"""'], {}), "('src/process_coerce_bytes.bin')\n", (300, 332), False, 'from process_coerce_usertype2 import ProcessCoerceUsertype2\n')] |
import torch
def masked_cross_entropy_for_value(
logits: torch.Tensor,
target: torch.Tensor,
pad_idx: int = 0,
) -> torch.Tensor: # loss_gen
mask = target.ne(pad_idx)
logits_flat = logits.view(-1, logits.size(-1))
log_probs_flat = torch.log(logits_flat)
target_flat = target.view(-1, 1)
... | [
"torch.gather",
"torch.log"
] | [((258, 280), 'torch.log', 'torch.log', (['logits_flat'], {}), '(logits_flat)\n', (267, 280), False, 'import torch\n'), ((337, 391), 'torch.gather', 'torch.gather', (['log_probs_flat'], {'dim': '(1)', 'index': 'target_flat'}), '(log_probs_flat, dim=1, index=target_flat)\n', (349, 391), False, 'import torch\n')] |
import pandas as pd
import talib
import numpy as np
import os
path = os.getcwd()+'\\'
# 读取数据
Data = pd.read_table(path+'res\\999999.txt', delim_whitespace=True, encoding='gbk')
Data = Data[:-1]
Data.columns = ['time', 'openp', 'highp', 'lowp', 'closep', 'volume', 'amount']
# 计算指标,汇总到indicators里
def myMACD(price, fa... | [
"talib.MACD",
"talib.EMA",
"os.getcwd",
"pandas.ewma",
"numpy.savetxt",
"talib.STOCH",
"numpy.diff",
"talib.RSI",
"numpy.column_stack",
"pandas.read_table"
] | [((102, 180), 'pandas.read_table', 'pd.read_table', (["(path + 'res\\\\999999.txt')"], {'delim_whitespace': '(True)', 'encoding': '"""gbk"""'}), "(path + 'res\\\\999999.txt', delim_whitespace=True, encoding='gbk')\n", (115, 180), True, 'import pandas as pd\n'), ((820, 899), 'talib.MACD', 'talib.MACD', (["Data['closep']... |
import urllib.request, json, time,utils
def now(msg):
print("[*] ctftime.now request")
results=[]
with urllib.request.urlopen(urllib.request.Request(f"https://ctftime.org/api/v1/events/?limit=100&start={int(time.time())-259200}&finish={int(time.time())+259200}",None,headers={'User-Agent':'Mozilla/5.0'})) as... | [
"utils.time_to_secs",
"utils.format_json_to_ctf",
"time.time"
] | [((1169, 1198), 'utils.format_json_to_ctf', 'utils.format_json_to_ctf', (['ctf'], {}), '(ctf)\n', (1193, 1198), False, 'import urllib.request, json, time, utils\n'), ((413, 445), 'utils.time_to_secs', 'utils.time_to_secs', (["ctf['start']"], {}), "(ctf['start'])\n", (431, 445), False, 'import urllib.request, json, time... |
from django.shortcuts import render
from django.http import HttpResponse, HttpResponseRedirect
from website.forms import ContactForm, NewsletterForm
from django.contrib import messages
from blog.models import Post
def index_view(request):
latest_posts = Post.objects.filter(status=True).order_by('-published_date')[... | [
"blog.models.Post.objects.filter",
"django.contrib.messages.add_message",
"website.forms.ContactForm",
"django.shortcuts.render",
"website.forms.NewsletterForm"
] | [((373, 419), 'django.shortcuts.render', 'render', (['request', '"""website/index.html"""', 'context'], {}), "(request, 'website/index.html', context)\n", (379, 419), False, 'from django.shortcuts import render\n'), ((457, 494), 'django.shortcuts.render', 'render', (['request', '"""website/about.html"""'], {}), "(reque... |
# torch
import hydra.utils
import torch
# built-in
import copy
import os
import datetime
import time
import numpy as np
import math
# logging
import wandb
# project
import probspec_routines as ps_routines
from tester import test
import ckconv
from torchmetrics import Accuracy
import antialiasing
from optim import co... | [
"wandb.log",
"numpy.load",
"numpy.sum",
"numpy.allclose",
"torch.randn",
"optim.construct_optimizer",
"tester.test",
"torch.dropout",
"os.path.join",
"antialiasing.get_gabornet_summaries",
"antialiasing.regularize_gabornet",
"datetime.datetime.now",
"ckconv.nn.LnLoss",
"ckconv.nn.LimitLnLo... | [((715, 752), 'os.path.join', 'os.path.join', (['wandb.run.dir', 'filename'], {}), '(wandb.run.dir, filename)\n', (727, 752), False, 'import os\n'), ((1052, 1068), 'wandb.save', 'wandb.save', (['path'], {}), '(path)\n', (1062, 1068), False, 'import wandb\n'), ((2831, 2862), 'optim.construct_optimizer', 'construct_optim... |
import json
from django import test
from django.test import TestCase
from django.urls import reverse
from rest_framework.test import APIClient
from shop.views import *
client = test.Client()
# Product Tests
class GetProductsTest(TestCase):
""" Test module for GET all products API """
def setUp(self):
... | [
"django.urls.reverse",
"rest_framework.test.APIClient",
"json.dumps",
"django.test.Client"
] | [((179, 192), 'django.test.Client', 'test.Client', ([], {}), '()\n', (190, 192), False, 'from django import test\n'), ((2265, 2276), 'rest_framework.test.APIClient', 'APIClient', ([], {}), '()\n', (2274, 2276), False, 'from rest_framework.test import APIClient\n'), ((3038, 3049), 'rest_framework.test.APIClient', 'APICl... |
#%%
import torch
from torch import optim, nn
from torchvision import models, transforms
model = models.vgg16(pretrained=True)
#%%
class FeatureExtractor(nn.Module):
def __init__(self, model):
super(FeatureExtractor, self).__init__()
# Extract VGG-16 Feature Layers
self.features = list(model.features)
... | [
"lshash.LSHash",
"torch.nn.Sequential",
"torchvision.transforms.Resize",
"torchvision.transforms.ToPILImage",
"torchvision.transforms.ToTensor",
"cv2.imread",
"numpy.array",
"torch.cuda.is_available",
"torchvision.transforms.CenterCrop",
"torchvision.models.vgg16",
"torch.no_grad",
"torch.nn.F... | [((97, 126), 'torchvision.models.vgg16', 'models.vgg16', ([], {'pretrained': '(True)'}), '(pretrained=True)\n', (109, 126), False, 'from torchvision import models, transforms\n'), ((881, 910), 'torchvision.models.vgg16', 'models.vgg16', ([], {'pretrained': '(True)'}), '(pretrained=True)\n', (893, 910), False, 'from tor... |
# Generated by Django 2.0 on 2017-12-09 16:59
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('pitches', '0007_auto_20171119_1839'),
]
operations = [
migrations.AlterUniqueTogether(
name='vote',
unique_together={('client_... | [
"django.db.migrations.AlterUniqueTogether"
] | [((225, 317), 'django.db.migrations.AlterUniqueTogether', 'migrations.AlterUniqueTogether', ([], {'name': '"""vote"""', 'unique_together': "{('client_id', 'pitch_id')}"}), "(name='vote', unique_together={('client_id',\n 'pitch_id')})\n", (255, 317), False, 'from django.db import migrations\n')] |
from flask import Flask, request, make_response
from flask_cors import CORS
from moves.tile_move import TileMove
from players.new_player import NewPlayer
from players.piece_position import PiecePosition
from service.service import Service
class Facade:
def __init__(self, service: Service):
self.__service ... | [
"flask_cors.CORS",
"flask.Flask",
"players.new_player.NewPlayer.from_name",
"flask.make_response",
"flask.request.get_json"
] | [((349, 364), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (354, 364), False, 'from flask import Flask, request, make_response\n'), ((373, 387), 'flask_cors.CORS', 'CORS', (['self.app'], {}), '(self.app)\n', (377, 387), False, 'from flask_cors import CORS\n'), ((1191, 1206), 'flask.make_response', 'make_... |
import pandas as pd
import csv
import numpy as np
from datetime import datetime
import json
import os
from shapely.geometry import shape, Point
from fuzzywuzzy import process
## TODO implement string similarity for crime categories
## TODO reiterate through this data set once a week for discrepancies
## Aggregating L... | [
"pandas.DataFrame",
"shapely.geometry.Point",
"json.load",
"pandas.read_csv",
"fuzzywuzzy.process.extractOne",
"datetime.datetime.strptime",
"shapely.geometry.shape",
"numpy.concatenate"
] | [((366, 530), 'pandas.read_csv', 'pd.read_csv', (['"""https://data.boston.gov/dataset/6220d948-eae2-4e4b-8723-2dc8e67722a3/resource/12cb3883-56f5-47de-afa5-3b1cf61b257b/download/tmp3bg1m024.csv"""'], {}), "(\n 'https://data.boston.gov/dataset/6220d948-eae2-4e4b-8723-2dc8e67722a3/resource/12cb3883-56f5-47de-afa5-3b1c... |
#!/usr/bin/env python3
"""Assignment 1: UTSA CS 6243/4593 Machine Learning Fall 2017"""
import random
from statistics import mean
__author__ = '<NAME>'
class KMeans:
"""Basic KMeans Cluster Class"""
def __init__(self, num_clusters=3, max_iterations=900, random_seed=None):
self.num_clusters = num_cl... | [
"random.sample",
"random.seed",
"statistics.mean"
] | [((2938, 2962), 'random.seed', 'random.seed', (['random_seed'], {}), '(random_seed)\n', (2949, 2962), False, 'import random\n'), ((3022, 3052), 'random.sample', 'random.sample', (['X', 'num_clusters'], {}), '(X, num_clusters)\n', (3035, 3052), False, 'import random\n'), ((2047, 2054), 'statistics.mean', 'mean', (['f'],... |
# coding=utf-8
import glob
from setuptools import setup, find_packages
setup(
name='scan-pdf',
version='0.2.6',
packages=find_packages(where='./src', exclude='tests'),
package_dir={'': 'src'},
scripts=['src/scan-pdf'],
description='Tools for using scanners with document feeder',
author='<N... | [
"setuptools.find_packages"
] | [((135, 180), 'setuptools.find_packages', 'find_packages', ([], {'where': '"""./src"""', 'exclude': '"""tests"""'}), "(where='./src', exclude='tests')\n", (148, 180), False, 'from setuptools import setup, find_packages\n')] |
"""
MIT License
Copyright (c) 2020 <NAME> (Tocutoeltuco)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, ... | [
"concurrent.futures.ThreadPoolExecutor",
"traceback.print_exc",
"time.sleep"
] | [((2538, 2558), 'concurrent.futures.ThreadPoolExecutor', 'ThreadPoolExecutor', ([], {}), '()\n', (2556, 2558), False, 'from concurrent.futures import ThreadPoolExecutor\n'), ((3155, 3168), 'time.sleep', 'time.sleep', (['(1)'], {}), '(1)\n', (3165, 3168), False, 'import time\n'), ((3037, 3058), 'traceback.print_exc', 't... |
from pytrader.finance.assets import Future
from pytrader.feeds.db.futures import Futures
from .universe import Universe
import pandas as pd
import numpy as np
class ContinuousFutures():
def __init__(
self,
products,
assets,
daily_tradeable,
include_co... | [
"pytrader.feeds.db.futures.Futures"
] | [((1879, 1967), 'pytrader.feeds.db.futures.Futures', 'Futures', ([], {'products': 'self.products', 'start_date': 'self.start_date', 'end_date': 'self.end_date'}), '(products=self.products, start_date=self.start_date, end_date=self.\n end_date)\n', (1886, 1967), False, 'from pytrader.feeds.db.futures import Futures\n... |
from repo.yolov5.hubconf import yolov5x
# 载入模型
class yolo:
# 构造
def __init__(self):
print("yolo is build.")
# 载入模型
def load_model(self):
self.model = yolov5x()
self.model = self.model.cuda()
print("model load completed.")
# 模型推理
def inference(self, data):
... | [
"repo.yolov5.hubconf.yolov5x"
] | [((184, 193), 'repo.yolov5.hubconf.yolov5x', 'yolov5x', ([], {}), '()\n', (191, 193), False, 'from repo.yolov5.hubconf import yolov5x\n')] |
from enum import Enum, unique
from typing import List, Union
from zone_api.core.action import Action
from zone_api.core.event_info import EventInfo
from zone_api.core.device import Device
from zone_api.core.devices.illuminance_sensor import IlluminanceSensor
from zone_api.core.devices.switch import Light, Switch
from... | [
"zone_api.core.event_info.EventInfo",
"zone_api.platform_encapsulator.get_item_name"
] | [((16159, 16244), 'zone_api.core.event_info.EventInfo', 'EventInfo', (['ZoneEvent.SWITCH_TURNED_ON', 'item', 'self', 'immutable_zone_manager', 'events'], {}), '(ZoneEvent.SWITCH_TURNED_ON, item, self, immutable_zone_manager,\n events)\n', (16168, 16244), False, 'from zone_api.core.event_info import EventInfo\n'), ((... |
from IPython.frontend.prefilterfrontend import PrefilterFrontEnd
from pydev_console_utils import Null
import sys
original_stdout = sys.stdout
original_stderr = sys.stderr
#=======================================================================================================================
# PyDevFrontEnd
#=========... | [
"IPython.frontend.prefilterfrontend.PrefilterFrontEnd.__init__",
"traceback.print_exc",
"pydev_console_utils.Null"
] | [((530, 579), 'IPython.frontend.prefilterfrontend.PrefilterFrontEnd.__init__', 'PrefilterFrontEnd.__init__', (['self', '*args'], {}), '(self, *args, **kwargs)\n', (556, 579), False, 'from IPython.frontend.prefilterfrontend import PrefilterFrontEnd\n'), ((701, 707), 'pydev_console_utils.Null', 'Null', ([], {}), '()\n', ... |
import sys
from lib.parsers.instagram import instagram
from lib.parsers.facebook import facebook
from lib.parsers.twitter import twitter
from lib.parsers.snapchat import snapchat
from lib.parsers.linkedIn import linkedIn
from lib.parsers.gmail import gmail
from lib.parsers.discord import discord
from lib.pars... | [
"lib.colors.style.YELLOW",
"lib.colors.style.RED",
"lib.colors.style.RESET",
"lib.colors.style.GREEN",
"sys.exit"
] | [((719, 775), 'lib.colors.style.RESET', 'style.RESET', (['""" -- Choose your phishing page --\n"""'], {}), "(' -- Choose your phishing page --\\n')\n", (730, 775), False, 'from lib.colors import style\n'), ((1266, 1276), 'sys.exit', 'sys.exit', ([], {}), '()\n', (1274, 1276), False, 'import sys\n'), ((113... |
import torch
from collections import OrderedDict
from torch.nn import utils, functional as F
from torch.optim import Adam
from torch.backends import cudnn
from model import build_model, weights_init
import scipy.misc as sm
import numpy as np
import os
import cv2
from loss import bce_iou_loss
# normalize the predicted... | [
"model.build_model",
"torch.load",
"numpy.asarray",
"torch.sigmoid",
"torch.max",
"torch.no_grad",
"os.path.join",
"torch.min",
"cv2.resize"
] | [((367, 379), 'torch.max', 'torch.max', (['d'], {}), '(d)\n', (376, 379), False, 'import torch\n'), ((389, 401), 'torch.min', 'torch.min', (['d'], {}), '(d)\n', (398, 401), False, 'import torch\n'), ((1659, 1688), 'model.build_model', 'build_model', (['self.config.arch'], {}), '(self.config.arch)\n', (1670, 1688), Fals... |
#!/bin/env python3
import glob
import os
import re
import sys
def printUsage():
print("%s <wildcard> <replacement wildcard>" % sys.argv[0])
print("Example: %s * Ui*" % sys.argv[0])
print("Only one asterisk may be used in the wildcards.")
def renameFiles(wildcard, replacement):
wildcardRegex = wildcard.replace('.... | [
"os.rename",
"re.sub",
"glob.glob"
] | [((414, 433), 'glob.glob', 'glob.glob', (['wildcard'], {}), '(wildcard)\n', (423, 433), False, 'import glob\n'), ((470, 517), 're.sub', 're.sub', (['wildcardRegex', 'replacementRegex', 'infile'], {}), '(wildcardRegex, replacementRegex, infile)\n', (476, 517), False, 'import re\n'), ((552, 578), 'os.rename', 'os.rename'... |
# --------------------------------------------------------
# P2ORM: Formulation, Inference & Application
# Licensed under The MIT License [see LICENSE for details]
# Written by <NAME>
# --------------------------------------------------------
import numpy as np
import os
import ntpath
import torch
import scipy.io as s... | [
"lib.dataset.gen_label_methods.occ_order_pred_to_ori",
"scipy.io.loadmat",
"numpy.ones",
"matplotlib.pyplot.figure",
"lib.dataset.gen_label_methods.occ_order_pred_to_edge_prob",
"os.path.join",
"lib.dataset.gen_label_methods.order8_to_order_pixwise_np",
"sys.path.append",
"lib.dataset.gen_label_meth... | [((399, 424), 'matplotlib.pyplot.switch_backend', 'plt.switch_backend', (['"""agg"""'], {}), "('agg')\n", (417, 424), True, 'import matplotlib.pyplot as plt\n'), ((463, 487), 'sys.path.append', 'sys.path.append', (['"""../.."""'], {}), "('../..')\n", (478, 487), False, 'import sys\n'), ((741, 766), 'os.path.dirname', '... |
import numpy
from chainer import cuda
from chainer import optimizer
class RMSpropGraves(optimizer.Optimizer):
"""<NAME> RMSprop.
See http://arxiv.org/abs/1308.0850
"""
def __init__(self, lr=1e-4, alpha=0.95, momentum=0.9, eps=1e-4):
# Default parameter values are the ones in the original p... | [
"chainer.cuda.elementwise",
"numpy.zeros_like",
"chainer.cuda.zeros_like",
"numpy.sqrt"
] | [((486, 509), 'numpy.zeros_like', 'numpy.zeros_like', (['param'], {}), '(param)\n', (502, 509), False, 'import numpy\n'), ((522, 545), 'numpy.zeros_like', 'numpy.zeros_like', (['param'], {}), '(param)\n', (538, 545), False, 'import numpy\n'), ((562, 585), 'numpy.zeros_like', 'numpy.zeros_like', (['param'], {}), '(param... |
from typing import Optional
from flask import redirect, url_for, flash, Markup
from flask_admin import BaseView, expose
from flask_admin.contrib import sqla
from flask_security import current_user
from flask_jwt_extended import create_access_token
from src.admin.admin_forms import TestLabelFormatForm, TestCalculatedF... | [
"flask_security.current_user.has_role",
"flask.url_for",
"flask_admin.expose"
] | [((747, 758), 'flask_admin.expose', 'expose', (['"""/"""'], {}), "('/')\n", (753, 758), False, 'from flask_admin import BaseView, expose\n'), ((804, 833), 'flask.url_for', 'url_for', (['self.target_endpoint'], {}), '(self.target_endpoint)\n', (811, 833), False, 'from flask import redirect, url_for, flash, Markup\n'), (... |
import unittest
from typing import Dict, List, Tuple
import numpy as np
import pytest
from gensim.models.keyedvectors import KeyedVectors, Word2VecKeyedVectors
import swem
from swem import models
def test_load_w2v_success():
kv = swem.load_w2v(lang='ja')
assert isinstance(kv, Word2VecKeyedVectors)
def tes... | [
"swem.models._word_embeds",
"gensim.models.keyedvectors.KeyedVectors",
"swem.models._hierarchical_pool",
"swem.infer_vector",
"swem.models._word_embed",
"pytest.raises",
"swem.models.SWEM",
"swem.load_w2v"
] | [((238, 262), 'swem.load_w2v', 'swem.load_w2v', ([], {'lang': '"""ja"""'}), "(lang='ja')\n", (251, 262), False, 'import swem\n'), ((495, 524), 'gensim.models.keyedvectors.KeyedVectors', 'KeyedVectors', ([], {'vector_size': '(200)'}), '(vector_size=200)\n', (507, 524), False, 'from gensim.models.keyedvectors import Keye... |
from cement import Controller, ex
from ..database.model.problem import Problem
class List(Controller):
class Meta:
label = 'list'
stacked_type = 'embedded'
stacked_on = 'base'
@ex(
help='List all problems in the queue'
)
def list(self):
print()
headers ... | [
"cement.ex"
] | [((212, 253), 'cement.ex', 'ex', ([], {'help': '"""List all problems in the queue"""'}), "(help='List all problems in the queue')\n", (214, 253), False, 'from cement import Controller, ex\n')] |
# part 1 basic window setup
# part 2 game objects
# part 3 moving the paddles
# part 4 moving the ball
# part 5 colliding with the paddles
# part 6 scoring
# part 7 sounds
import turtle
import os
# for windows
# import winsound
window = turtle.Screen()
window.title("Pong by Likun")
window.bgcolor("black")
# changing ... | [
"turtle.Screen",
"os.system",
"turtle.Turtle"
] | [((239, 254), 'turtle.Screen', 'turtle.Screen', ([], {}), '()\n', (252, 254), False, 'import turtle\n'), ((452, 467), 'turtle.Turtle', 'turtle.Turtle', ([], {}), '()\n', (465, 467), False, 'import turtle\n'), ((647, 662), 'turtle.Turtle', 'turtle.Turtle', ([], {}), '()\n', (660, 662), False, 'import turtle\n'), ((870, ... |
import os
import glob
import pandas as pd
import scrapeTalksMain
import scrapeTalksPHV
import scrapeTalksWorkshopsBTV
import scrapeWorkshopsMain
import scrapeWorkshopsPHV
dirname = os.path.dirname(__file__)
os.chdir(dirname)
# run all scripts for updated info
scrapeTalksMain.scrapeTalksMain()
scrapeTalksPHV.scrapeT... | [
"scrapeTalksWorkshopsBTV.scrapeTalksWorkshopsBTV",
"scrapeWorkshopsPHV.scrapeWorkshopsPHV",
"scrapeWorkshopsMain.scrapeWorkshopsMain",
"scrapeTalksMain.scrapeTalksMain",
"pandas.read_csv",
"os.path.dirname",
"scrapeTalksPHV.scrapeTalksPHV",
"glob.glob",
"os.chdir"
] | [((184, 209), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (199, 209), False, 'import os\n'), ((210, 227), 'os.chdir', 'os.chdir', (['dirname'], {}), '(dirname)\n', (218, 227), False, 'import os\n'), ((264, 297), 'scrapeTalksMain.scrapeTalksMain', 'scrapeTalksMain.scrapeTalksMain', ([], {})... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
'多进程的练习'
__author__ = 'Jacklee'
# 进程间通讯
# 使用Queue Pipes等方式交换数据
### 在Windows下的执行结果是如下内容,并没有读取的任何执行结果
# Process to write: 1572
# Put A to queue...
# Put B to queue...
# Put C to queue...
###
### 在Macos下执行结果如下,可见是按照多进程模式执行
# Process to write: 58981
# Put A to queue...
#... | [
"random.random",
"multiprocessing.Process",
"os.getpid",
"multiprocessing.Queue"
] | [((875, 882), 'multiprocessing.Queue', 'Queue', ([], {}), '()\n', (880, 882), False, 'from multiprocessing import Process, Queue\n'), ((889, 922), 'multiprocessing.Process', 'Process', ([], {'target': 'write', 'args': '(q1,)'}), '(target=write, args=(q1,))\n', (896, 922), False, 'from multiprocessing import Process, Qu... |
import csv
import tqdm
import logging
import numpy as np
from os import path
from collections import deque
import chainer
import chainerrl
from chainer import serializers
from chainer.backends import cuda
from src.abstract.agent import Agent
from src.finger.model import QFunction
from src.utilities.behaviour import A... | [
"src.utilities.behaviour.AgentBehaviour",
"chainerrl.replay_buffers.prioritized.PrioritizedReplayBuffer",
"numpy.random.choice",
"chainer.optimizers.Adam",
"tqdm.tqdm",
"csv.writer",
"chainer.optimizers.MomentumSGD",
"collections.deque",
"numpy.amax",
"numpy.max",
"chainerrl.agents.DoubleDQN",
... | [((582, 609), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (599, 609), False, 'import logging\n'), ((630, 688), 'src.finger.finger_agent_environment.FingerAgentEnv', 'FingerAgentEnv', (['layout_config', 'agent_params', 'finger', 'train'], {}), '(layout_config, agent_params, finger, trai... |
import os
from flask import Flask
from flask_bcrypt import Bcrypt
from flask_cors import CORS
from bdc_sample.blueprint import bp
from bdc_sample.config import get_settings
from bdc_sample.models import db
flask_bcrypt = Bcrypt()
def create_app(config_name):
"""
Creates Brazil Data Cube Samples application ... | [
"flask_bcrypt.Bcrypt",
"os.environ.get",
"flask.Flask",
"flask_cors.CORS"
] | [((223, 231), 'flask_bcrypt.Bcrypt', 'Bcrypt', ([], {}), '()\n', (229, 231), False, 'from flask_bcrypt import Bcrypt\n'), ((828, 874), 'flask_cors.CORS', 'CORS', (['app'], {'resorces': "{'/d/*': {'origins': '*'}}"}), "(app, resorces={'/d/*': {'origins': '*'}})\n", (832, 874), False, 'from flask_cors import CORS\n'), ((... |
import datetime as dt
import zipfile
from io import BytesIO
from itertools import chain
from pathlib import Path
from time import sleep
import h5py
import numpy as np
import pandas as pd
import requests
import urllib3
from tqdm import tqdm
from EDINET_API import main_jsons
from EdinetXbrlParser import zipParser
from ... | [
"tqdm.tqdm",
"h5py.File",
"io.BytesIO",
"pandas.read_hdf",
"EdinetXbrlParser.zipParser",
"datetime.date.today",
"time.sleep",
"pathlib.Path",
"pandas.to_datetime",
"datetime.timedelta",
"requests.get",
"itertools.chain.from_iterable",
"urllib3.disable_warnings"
] | [((369, 417), 'urllib3.disable_warnings', 'urllib3.disable_warnings', (['InsecureRequestWarning'], {}), '(InsecureRequestWarning)\n', (393, 417), False, 'import urllib3\n'), ((482, 526), 'pandas.read_hdf', 'pd.read_hdf', (['h5xbrl'], {'key': '"""/index/edinetdocs"""'}), "(h5xbrl, key='/index/edinetdocs')\n", (493, 526)... |
import os
from torch.backends import cudnn
from config import Config
from utils.logger import setup_logger
from datasets import make_dataloader
from model import make_model
from solver import make_optimizer, WarmupMultiStepLR
from loss import make_loss
from processor import do_train
if __name__ == '__main__':
cfg... | [
"os.mkdir",
"config.Config",
"loss.make_loss",
"solver.make_optimizer",
"os.path.exists",
"solver.WarmupMultiStepLR",
"processor.do_train",
"datasets.make_dataloader",
"model.make_model"
] | [((323, 331), 'config.Config', 'Config', ([], {}), '()\n', (329, 331), False, 'from config import Config\n'), ((795, 815), 'datasets.make_dataloader', 'make_dataloader', (['cfg'], {}), '(cfg)\n', (810, 815), False, 'from datasets import make_dataloader\n'), ((828, 866), 'model.make_model', 'make_model', (['cfg'], {'num... |
# Avoid console warnings
import os
os.environ['TF_CPP_MIN_LOG_LEVEL']='2'
import tensorflow as tf
# Node creation
node1 = tf.constant(3.0, dtype = tf.float32)
node2 = tf.constant(4.0)
tf_session = tf.Session() # we need to call tf_session()/sess() every time we execute a function
print(tf_session.run([nod... | [
"tensorflow.reduce_sum",
"tensorflow.global_variables_initializer",
"tensorflow.Session",
"tensorflow.add",
"tensorflow.constant",
"tensorflow.placeholder",
"tensorflow.Variable",
"tensorflow.square",
"tensorflow.train.GradientDescentOptimizer"
] | [((129, 163), 'tensorflow.constant', 'tf.constant', (['(3.0)'], {'dtype': 'tf.float32'}), '(3.0, dtype=tf.float32)\n', (140, 163), True, 'import tensorflow as tf\n'), ((175, 191), 'tensorflow.constant', 'tf.constant', (['(4.0)'], {}), '(4.0)\n', (186, 191), True, 'import tensorflow as tf\n'), ((208, 220), 'tensorflow.S... |
import importlib
bgl = importlib.import_module('gen.examples.bgl.mg-src.bgl-py')
PyDijkstraVisitor = bgl.PyDijkstraVisitor()
init_map = PyDijkstraVisitor.initMap
get = PyDijkstraVisitor.get
put = PyDijkstraVisitor.put
make_edge = PyDijkstraVisitor.makeEdge
toVertexDescriptor = PyDijkstraVisitor.toVertexDescriptor
Co... | [
"importlib.import_module"
] | [((23, 80), 'importlib.import_module', 'importlib.import_module', (['"""gen.examples.bgl.mg-src.bgl-py"""'], {}), "('gen.examples.bgl.mg-src.bgl-py')\n", (46, 80), False, 'import importlib\n')] |
import urllib3
import isi_sdk_8_0 as isi_sdk
import test_constants
urllib3.disable_warnings()
def main():
# configure username and password
configuration = isi_sdk.Configuration()
configuration.username = test_constants.USERNAME
configuration.password = test_constants.PASSWORD
configuration.ver... | [
"isi_sdk_8_0.AntivirusApi",
"urllib3.disable_warnings",
"isi_sdk_8_0.ApiClient",
"isi_sdk_8_0.AntivirusScanItem",
"isi_sdk_8_0.Configuration"
] | [((70, 96), 'urllib3.disable_warnings', 'urllib3.disable_warnings', ([], {}), '()\n', (94, 96), False, 'import urllib3\n'), ((169, 192), 'isi_sdk_8_0.Configuration', 'isi_sdk.Configuration', ([], {}), '()\n', (190, 192), True, 'import isi_sdk_8_0 as isi_sdk\n'), ((453, 485), 'isi_sdk_8_0.ApiClient', 'isi_sdk.ApiClient'... |
import argparse
import sentencepiece as spm
from tqdm import tqdm
import os
import random
from sklearn.model_selection import train_test_split
parser = argparse.ArgumentParser(
description="Performs BPE on the bible dataset.")
parser.add_argument(
"sep_bible_dir", type=str,
help="Directory that contains t... | [
"os.mkdir",
"os.makedirs",
"argparse.ArgumentParser",
"sentencepiece.SentencePieceProcessor",
"os.path.isdir",
"os.path.isfile",
"os.path.join",
"os.listdir"
] | [((153, 226), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Performs BPE on the bible dataset."""'}), "(description='Performs BPE on the bible dataset.')\n", (176, 226), False, 'import argparse\n'), ((592, 638), 'os.path.join', 'os.path.join', (['args.sep_bible_dir', '"""altogether"""']... |
import json
import boto3
import logging
import os
import json
session = boto3.session.Session()
logging.basicConfig()
logger = logging.getLogger()
logger.setLevel(logging.INFO)
def lambda_handler(event, context):
cluster_name = os.environ.get('ECS_CLUSTER')
ecs_region_name = os.environ.get('ECS_REGION_NAME')... | [
"logging.basicConfig",
"boto3.client",
"json.dumps",
"os.environ.get",
"boto3.session.Session",
"logging.getLogger"
] | [((73, 96), 'boto3.session.Session', 'boto3.session.Session', ([], {}), '()\n', (94, 96), False, 'import boto3\n'), ((97, 118), 'logging.basicConfig', 'logging.basicConfig', ([], {}), '()\n', (116, 118), False, 'import logging\n'), ((128, 147), 'logging.getLogger', 'logging.getLogger', ([], {}), '()\n', (145, 147), Fal... |
import pytest
from guv.greenio import socket
from guv import listen
@pytest.fixture(scope='session')
def pub_addr():
"""A working public address that is considered always available
"""
return 'gnu.org', 80
@pytest.fixture(scope='session')
def fail_addr():
"""An address that nothing is listening on
... | [
"pytest.fixture",
"guv.greenio.socket",
"guv.listen"
] | [((72, 103), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""session"""'}), "(scope='session')\n", (86, 103), False, 'import pytest\n'), ((224, 255), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""session"""'}), "(scope='session')\n", (238, 255), False, 'import pytest\n'), ((360, 392), 'pytest.fixture', ... |
from os.path import join
from pyperplan.search import searchspace
# from strips_hgn.training_data import _generate_optimal_state_value_pairs_for_problem
from strips_hgn.planning.pyperplan_api import get_optimal_actions_using_py
from strips_hgn.utils.args.base_args import BaseArgs
from hypergraph_nets.hypergraphs impo... | [
"strips_hgn.hypergraph.delete_relaxation.DeleteRelaxationHypergraphView",
"strips_hgn.planning.pyperplan_api.get_optimal_actions_using_py",
"strips_hgn.models.strips_hgn.STRIPSHGN.load_from_checkpoint",
"strips_hgn.workflows.base_workflow.BaseFeatureMappingWorkflow",
"pyperplan.search.searchspace.make_child... | [((896, 940), 'os.path.join', 'join', (['"""../results/"""', 'path', '"""model-best.ckpt"""'], {}), "('../results/', path, 'model-best.ckpt')\n", (900, 940), False, 'from os.path import join\n'), ((1111, 1153), 'strips_hgn.models.strips_hgn.STRIPSHGN.load_from_checkpoint', 'STRIPSHGN.load_from_checkpoint', (['checkpoin... |
"""
Microsoft Academic (Science)
@website https://academic.microsoft.com
@provide-api yes
@using-api no
@results JSON
@stable no
@parse url, title, content
"""
from datetime import datetime
from json import loads
from uuid import uuid4
from searx.url_utils import urlencode
from searx.utils impor... | [
"uuid.uuid4",
"json.loads",
"searx.url_utils.urlencode",
"searx.utils.html_to_text",
"datetime.datetime.now"
] | [((507, 514), 'uuid.uuid4', 'uuid4', ([], {}), '()\n', (512, 514), False, 'from uuid import uuid4\n'), ((532, 539), 'uuid.uuid4', 'uuid4', ([], {}), '()\n', (537, 539), False, 'from uuid import uuid4\n'), ((555, 569), 'datetime.datetime.now', 'datetime.now', ([], {}), '()\n', (567, 569), False, 'from datetime import da... |
# To add a new cell, type '# %%'
# To add a new markdown cell, type '# %% [markdown]'
# %%
from IPython import get_ipython
# %%
get_ipython().run_line_magic("reload_ext", "autoreload")
get_ipython().run_line_magic("autoreload", "2")
get_ipython().run_line_magic("matplotlib", "inline")
# %%
from fastai.vision import ... | [
"IPython.get_ipython"
] | [((129, 142), 'IPython.get_ipython', 'get_ipython', ([], {}), '()\n', (140, 142), False, 'from IPython import get_ipython\n'), ((186, 199), 'IPython.get_ipython', 'get_ipython', ([], {}), '()\n', (197, 199), False, 'from IPython import get_ipython\n'), ((234, 247), 'IPython.get_ipython', 'get_ipython', ([], {}), '()\n'... |
import os
import sys
import cv2
import numpy as np
from tqdm import tqdm
def eval_phys_data_single_pendulum(data_filepath, num_vids, num_frms, save_path):
from eval_phys_single_pendulum import eval_physics, phys_vars_list
phys = {p_var:[] for p_var in phys_vars_list}
for n in tqdm(range(num_vids)):
... | [
"numpy.save",
"numpy.abs",
"numpy.isnan",
"numpy.array",
"eval_phys_elastic_pendulum.eval_physics",
"os.path.join"
] | [((746, 770), 'numpy.save', 'np.save', (['save_path', 'phys'], {}), '(save_path, phys)\n', (753, 770), True, 'import numpy as np\n'), ((2086, 2110), 'numpy.save', 'np.save', (['save_path', 'phys'], {}), '(save_path, phys)\n', (2093, 2110), True, 'import numpy as np\n'), ((3629, 3653), 'numpy.save', 'np.save', (['save_p... |
from flask_wtf import FlaskForm
from wtforms import StringField, IntegerField, SubmitField, ValidationError, \
SelectField, TextAreaField, HiddenField
from uniback.tools.local_session import LocalSession
from uniback.models.general import PhysicalLocation, Repository
from uniback.db_interfaces.physical_location imp... | [
"wtforms.ValidationError",
"wtforms.validators.DataRequired",
"wtforms.SelectField",
"wtforms.TextAreaField",
"wtforms.SubmitField",
"uniback.tools.local_session.LocalSession",
"wtforms.IntegerField",
"wtforms.StringField",
"wtforms.HiddenField"
] | [((446, 463), 'wtforms.HiddenField', 'HiddenField', (['"""Id"""'], {}), "('Id')\n", (457, 463), False, 'from wtforms import StringField, IntegerField, SubmitField, ValidationError, SelectField, TextAreaField, HiddenField\n'), ((475, 494), 'wtforms.StringField', 'StringField', (['"""Name"""'], {}), "('Name')\n", (486, 4... |
import pickle
import numpy as np
import librosa
import pandas as pd
from raw_audio_create_dict import split_data
dict_path = '/scratch/speech/raw_audio_dataset/raw_audio_full.pkl'
file = open(dict_path, 'rb')
data = pickle.load(file)
audio_path = '/scratch/speech/raw_audio_dataset/audio_paths_labels_updated.csv'
df =... | [
"pickle.dump",
"pandas.read_csv",
"pickle.load",
"numpy.array",
"raw_audio_create_dict.split_data"
] | [((217, 234), 'pickle.load', 'pickle.load', (['file'], {}), '(file)\n', (228, 234), False, 'import pickle\n'), ((321, 344), 'pandas.read_csv', 'pd.read_csv', (['audio_path'], {}), '(audio_path)\n', (332, 344), True, 'import pandas as pd\n'), ((1455, 1482), 'raw_audio_create_dict.split_data', 'split_data', (['dataset_up... |
import boto3
import iam
import event
def list_functions():
'''list of all lambda functions'''
client = boto3.client('lambda')
functions = client.list_functions()
return functions
def list_arns():
'''get a list of all lambda arns'''
client = boto3.client('lambda')
functions = client.list_f... | [
"iam.name2arn",
"boto3.client"
] | [((112, 134), 'boto3.client', 'boto3.client', (['"""lambda"""'], {}), "('lambda')\n", (124, 134), False, 'import boto3\n'), ((268, 290), 'boto3.client', 'boto3.client', (['"""lambda"""'], {}), "('lambda')\n", (280, 290), False, 'import boto3\n'), ((571, 593), 'boto3.client', 'boto3.client', (['"""lambda"""'], {}), "('l... |
# ------------------------------------------------------------------------------
# game.py
# <NAME>
# v. 1.0
# ------------------------------------------------------------------------------
from interface import format_output
import room
import os
from os import path
in_blackjack = False
class Game:
def __init__(... | [
"os.path.join",
"obj.current_game.current_room.hint",
"interface.format_output"
] | [((3671, 3702), 'interface.format_output', 'format_output', (['"""saving game..."""'], {}), "('saving game...')\n", (3684, 3702), False, 'from interface import format_output\n'), ((3861, 3889), 'interface.format_output', 'format_output', (['"""game saved."""'], {}), "('game saved.')\n", (3874, 3889), False, 'from inter... |
'''
Copyright (c) 2020 Cisco and/or its affiliates.
A copy of the License (MIT License) can be found in the LICENSE.TXT
file of this software.
Author: <NAME>
Created: January 7, 2020
'''
import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="ftd_api",
... | [
"setuptools.find_packages"
] | [((622, 648), 'setuptools.find_packages', 'setuptools.find_packages', ([], {}), '()\n', (646, 648), False, 'import setuptools\n')] |
from numpy import sqrt
import pytest
from tesserae import Tesserae
from tesserae.nucleotide_sequence import NucleotideSequence
from ..util import TEST_RESOURCES_FOLDER
TEST_QUERY = NucleotideSequence("THE_QUERY", "GTAGGCGAGATGACGCCAT")
TEST_TARGETS = [
NucleotideSequence("THE_FIRST_TARGET", "GTAGGCGAGTCCCGTTTATA... | [
"pytest.param",
"tesserae.Tesserae",
"tesserae.nucleotide_sequence.NucleotideSequence"
] | [((184, 238), 'tesserae.nucleotide_sequence.NucleotideSequence', 'NucleotideSequence', (['"""THE_QUERY"""', '"""GTAGGCGAGATGACGCCAT"""'], {}), "('THE_QUERY', 'GTAGGCGAGATGACGCCAT')\n", (202, 238), False, 'from tesserae.nucleotide_sequence import NucleotideSequence\n'), ((260, 322), 'tesserae.nucleotide_sequence.Nucleot... |
from ..langDefaults import LangDefaults
from .freqMaps import freqMapFemale, freqMapMale, freqMapFamily, freqMapOrg, freqMapStreet, freqMapCity
from .dateFormats import dateStdFormat, dateFormatsAlpha, dateFormatsNr, dateReplMonths, DateParserInfo
from collections import defaultdict, OrderedDict
import json, os
import ... | [
"zipfile.ZipFile",
"os.path.dirname",
"random.choice",
"re.escape",
"re.search",
"collections.OrderedDict",
"re.sub",
"re.compile"
] | [((2975, 3140), 'collections.OrderedDict', 'OrderedDict', (["{'er': ['', 'er', 'e', 'en', 'ern'], 'erer': ['ern'], 'eler': ['eln'],\n 'aner': ['er', ''], 'enser': ['e', 'a'], 'usser': ['us'], 'ner': ['en']}"], {}), "({'er': ['', 'er', 'e', 'en', 'ern'], 'erer': ['ern'], 'eler': [\n 'eln'], 'aner': ['er', ''], 'en... |
import python_jsonschema_objects as pjs
__all__ = [ 'DatasetProvenance', 'DataLayerProvenance' ]
dataset_provenance_schema = {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Dataset Provenance",
"description": "Represents a dataset and its derived data layers.",
"required": [
"dataset_nam... | [
"python_jsonschema_objects.ObjectBuilder"
] | [((1092, 1136), 'python_jsonschema_objects.ObjectBuilder', 'pjs.ObjectBuilder', (['dataset_provenance_schema'], {}), '(dataset_provenance_schema)\n', (1109, 1136), True, 'import python_jsonschema_objects as pjs\n'), ((2386, 2428), 'python_jsonschema_objects.ObjectBuilder', 'pjs.ObjectBuilder', (['layer_provenance_schem... |