code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
import typing
from PyQt5.QtChart import QValueAxis, QChart, QBarSeries, QBarSet
from ParadoxTrading.Chart.SeriesAbstract import SeriesAbstract
class BarSeries(SeriesAbstract):
def __init__(
self, _name: str,
_x_list: typing.Sequence,
_y_list: typing.Sequence,
_col... | [
"PyQt5.QtChart.QBarSeries",
"PyQt5.QtChart.QBarSet"
] | [((666, 684), 'PyQt5.QtChart.QBarSet', 'QBarSet', (['self.name'], {}), '(self.name)\n', (673, 684), False, 'from PyQt5.QtChart import QValueAxis, QChart, QBarSeries, QBarSet\n'), ((997, 1009), 'PyQt5.QtChart.QBarSeries', 'QBarSeries', ([], {}), '()\n', (1007, 1009), False, 'from PyQt5.QtChart import QValueAxis, QChart,... |
# Copyright (c) 2006-2009 <NAME> http://garnaat.org/
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, mer... | [
"boto.cloudfront.invalidation.InvalidationBatch",
"boto.cloudfront.exception.CloudFrontServerError",
"boto.log.debug",
"boto.cloudfront.distribution.DistributionConfig",
"boto.cloudfront.distribution.StreamingDistributionConfig",
"boto.handler.XmlHandler",
"boto.cloudfront.identity.OriginAccessIdentityC... | [((3215, 3235), 'boto.log.debug', 'boto.log.debug', (['body'], {}), '(body)\n', (3229, 3235), False, 'import boto\n'), ((3501, 3529), 'boto.handler.XmlHandler', 'handler.XmlHandler', (['rs', 'self'], {}), '(rs, self)\n', (3519, 3529), False, 'from boto import handler\n'), ((3782, 3802), 'boto.log.debug', 'boto.log.debu... |
# Copyright (c) 2015, The MITRE Corporation
# All rights reserved
"""MAEC utility methods"""
from mixbox.vendor.six import iteritems
def flip_dict(d):
"""Returns a copy of the input dictionary `d` where the values of `d`
become the keys and the keys become the values.
Note:
This does not even att... | [
"mixbox.vendor.six.iteritems"
] | [((430, 442), 'mixbox.vendor.six.iteritems', 'iteritems', (['d'], {}), '(d)\n', (439, 442), False, 'from mixbox.vendor.six import iteritems\n')] |
# coding=utf-8
# Copyright 2016 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
from pants.backend.j... | [
"pants.goal.task_registrar.TaskRegistrar"
] | [((521, 577), 'pants.goal.task_registrar.TaskRegistrar', 'task', ([], {'name': '"""run-dummy-workunit"""', 'action': 'TestWorkUnitTask'}), "(name='run-dummy-workunit', action=TestWorkUnitTask)\n", (525, 577), True, 'from pants.goal.task_registrar import TaskRegistrar as task\n')] |
#!/usr/bin/env python3
#****************************************************************************************************************************************************
# Copyright (c) 2014 Freescale Semiconductor, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
#... | [
"io.open",
"os.walk",
"os.remove",
"os.path.exists",
"os.listdir",
"os.path.splitdrive",
"os.chmod",
"os.path.split",
"os.path.normpath",
"os.path.isdir",
"os.path.relpath",
"hashlib.sha256",
"os.path.isabs",
"os.access",
"os.path.isfile",
"os.path.dirname",
"os.makedirs",
"os.envi... | [((2856, 2880), 'os.path.exists', 'os.path.exists', (['filename'], {}), '(filename)\n', (2870, 2880), False, 'import os\n'), ((3731, 3755), 'os.path.exists', 'os.path.exists', (['filename'], {}), '(filename)\n', (3745, 3755), False, 'import os\n'), ((4147, 4164), 'os.stat', 'os.stat', (['filename'], {}), '(filename)\n'... |
from torch.nn.functional import mse_loss
from all.logging import DummyWriter
from all.memory import NStepAdvantageBuffer
from ._agent import Agent
class A2C(Agent):
"""
Advantage Actor-Critic (A2C).
A2C is policy gradient method in the actor-critic family.
It is the synchronous variant of the *Asychro... | [
"all.memory.NStepAdvantageBuffer",
"torch.nn.functional.mse_loss",
"all.logging.DummyWriter"
] | [((1413, 1426), 'all.logging.DummyWriter', 'DummyWriter', ([], {}), '()\n', (1424, 1426), False, 'from all.logging import DummyWriter\n'), ((3406, 3518), 'all.memory.NStepAdvantageBuffer', 'NStepAdvantageBuffer', (['self.v', 'self.features', 'self.n_steps', 'self.n_envs'], {'discount_factor': 'self.discount_factor'}), ... |
# Copyright 2016 F5 Networks Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... | [
"logging.getLogger",
"f5.utils.testutils.registrytools.register_device",
"f5.bigip.ManagementRoot",
"os.path.join"
] | [((1069, 1174), 'f5.bigip.ManagementRoot', 'ManagementRoot', (['pytest.symbols.bigip_ip', 'pytest.symbols.bigip_username', 'pytest.symbols.bigip_password'], {}), '(pytest.symbols.bigip_ip, pytest.symbols.bigip_username,\n pytest.symbols.bigip_password)\n', (1083, 1174), False, 'from f5.bigip import ManagementRoot\n'... |
import json
from typing import Dict, List
from .task_utilities import find_task_scheduled, find_task_completed, find_task_failed, \
set_processed, parse_history_event
from ..constants import HTTP_ACTION_NAME
from ..models.DurableHttpRequest import DurableHttpRequest
from ..models.TokenSource import TokenSource
fro... | [
"json.dumps"
] | [((1332, 1351), 'json.dumps', 'json.dumps', (['content'], {}), '(content)\n', (1342, 1351), False, 'import json\n')] |
"""Windpower and PV power calculation from ERA5 weather data using Feedinlib module.
This script gets input parameters from the config.mk file.
These parameters can be changed depending on the user interest.
target_file:=ERA5_data.nc : Netcdf file of weather data downloaded from CDS using feedinlib module
start_date... | [
"feedinlib.Photovoltaic",
"os.path.join",
"numpy.isnan",
"feedinlib.WindPowerPlant",
"pandas.to_datetime"
] | [((2263, 2293), 'feedinlib.WindPowerPlant', 'WindPowerPlant', ([], {}), '(**turbine_spec)\n', (2277, 2293), False, 'from feedinlib import Photovoltaic, WindPowerPlant\n'), ((2838, 2865), 'feedinlib.Photovoltaic', 'Photovoltaic', ([], {}), '(**system_data)\n', (2850, 2865), False, 'from feedinlib import Photovoltaic, Wi... |
# Copyright © 2019 Province of British Columbia
#
# 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 agr... | [
"pay_api.services.cfs_service.CFSService.create_cfs_account",
"utils.auth.get_token",
"pay_api.models.CfsAccount.find_all_pending_accounts",
"pay_api.services.cfs_service.CFSService.update_bank_details",
"utils.mailer.publish_mailer_events",
"flask.current_app.logger.info",
"datetime.datetime.today",
... | [((1746, 1789), 'pay_api.models.CfsAccount.find_all_pending_accounts', 'CfsAccountModel.find_all_pending_accounts', ([], {}), '()\n', (1787, 1789), True, 'from pay_api.models import CfsAccount as CfsAccountModel\n'), ((1964, 1975), 'utils.auth.get_token', 'get_token', ([], {}), '()\n', (1973, 1975), False, 'from utils.... |
import os
import sys
import signal
import logging.config
import driller
import argparse
import subprocess
import multiprocessing
import angr
from angr.sim_type import SimTypeString
try:
import cPickle as pickle
except:
import pickle
l = logging.getLogger("local_callback")
def _run_drill(drill, fuzz, _path... | [
"os.kill",
"driller.Driller",
"os.listdir",
"argparse.ArgumentParser",
"subprocess.Popen",
"multiprocessing.Process",
"pickle.load",
"os.path.join",
"os.getcwd",
"os.path.isfile",
"os.path.basename",
"os.mkdir",
"angr.sim_type.SimTypeString",
"os.path.abspath"
] | [((454, 515), 'os.path.join', 'os.path.join', (['_fuzzer_out_dir', '"""fuzzer-master"""', '"""fuzz_bitmap"""'], {}), "(_fuzzer_out_dir, 'fuzzer-master', 'fuzz_bitmap')\n", (466, 515), False, 'import os\n'), ((974, 1020), 'subprocess.Popen', 'subprocess.Popen', (['args'], {'stdout': 'subprocess.PIPE'}), '(args, stdout=s... |
# Generated by Django 3.0.5 on 2020-05-20 23:19
from django.db import migrations, models
import django.db.models.manager
class Migration(migrations.Migration):
dependencies = [
('poems', '0012_infofile'),
]
operations = [
migrations.AlterModelManagers(
name='poet',
... | [
"django.db.migrations.DeleteModel",
"django.db.models.CharField"
] | [((616, 655), 'django.db.migrations.DeleteModel', 'migrations.DeleteModel', ([], {'name': '"""InfoFile"""'}), "(name='InfoFile')\n", (638, 655), False, 'from django.db import migrations, models\n'), ((533, 595), 'django.db.models.CharField', 'models.CharField', ([], {'db_index': '(True)', 'default': '"""n/a"""', 'max_l... |
import logging
from datetime import datetime
from sqlalchemy import (Boolean, Column, DateTime, Enum, Float, ForeignKey,
Integer, MetaData, String, Table)
from sqlalchemy.orm import mapper, relationship
from src.domain.entities import (CastMember, CastMemberTypes, Category, Genre,
... | [
"logging.getLogger",
"sqlalchemy.orm.relationship",
"sqlalchemy.Float",
"src.infrastructure.db.utils.GUID",
"sqlalchemy.DateTime",
"sqlalchemy.Boolean",
"sqlalchemy.ForeignKey",
"sqlalchemy.Integer",
"sqlalchemy.MetaData",
"sqlalchemy.String",
"sqlalchemy.Enum"
] | [((403, 430), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (420, 430), False, 'import logging\n'), ((443, 453), 'sqlalchemy.MetaData', 'MetaData', ([], {}), '()\n', (451, 453), False, 'from sqlalchemy import Boolean, Column, DateTime, Enum, Float, ForeignKey, Integer, MetaData, String, ... |
# Licensed under the BSD 3-Clause License
# Copyright (C) 2021 GeospaceLab (geospacelab)
# Author: <NAME>, Space Physics and Astronomy, University of Oulu
__author__ = "<NAME>"
__copyright__ = "Copyright 2021, GeospaceLab"
__license__ = "BSD-3-Clause License"
__email__ = "<EMAIL>"
__docformat__ = "reStructureText"
fr... | [
"geospacelab.visualization.mpl._base.plt.figure"
] | [((978, 998), 'geospacelab.visualization.mpl._base.plt.figure', 'plt.figure', ([], {}), '(**kwargs)\n', (988, 998), False, 'from geospacelab.visualization.mpl._base import plt, FigureBase\n')] |
import math
from typing import Dict
import torch
from torch import nn
from torch.nn import functional as F
from torchvision.models.resnet import BasicBlock
from ..utils.latent_projecting import Latents, CodeLatents
class UNetLikeEncoder(nn.Module):
def __init__(self, image_size: int, latent_size: int, num_inpu... | [
"torch.nn.BatchNorm2d",
"torch.nn.functional.adaptive_avg_pool2d",
"torch.nn.ModuleList",
"torchvision.models.resnet.BasicBlock",
"torch.stack",
"torch.nn.Conv2d",
"math.log"
] | [((1377, 1447), 'torchvision.models.resnet.BasicBlock', 'BasicBlock', (['size_channel_map[image_size]', 'size_channel_map[image_size]'], {}), '(size_channel_map[image_size], size_channel_map[image_size])\n', (1387, 1447), False, 'from torchvision.models.resnet import BasicBlock\n'), ((2304, 2358), 'torch.nn.ModuleList'... |
# -*- coding: utf-8 -*-
# @Time : 2021/2/10 11:58 上午
# @Author : <NAME>
# @FileName: __init__.py
# @Software: PyCharm
# @Blog :https://lesliewongcv.github.io/
import numpy as np
import matplotlib.pyplot as plt
import sys
sys.path.append('../')
import GenericAlgorithm as GA
from math import *
def fitness_score(in... | [
"numpy.random.random",
"numpy.zeros",
"sys.path.append"
] | [((228, 250), 'sys.path.append', 'sys.path.append', (['"""../"""'], {}), "('../')\n", (243, 250), False, 'import sys\n'), ((342, 354), 'numpy.zeros', 'np.zeros', (['NP'], {}), '(NP)\n', (350, 354), True, 'import numpy as np\n'), ((608, 633), 'numpy.random.random', 'np.random.random', (['[NP, D]'], {}), '([NP, D])\n', (... |
import numpy as np
def unflatten(w, weights):
sizes = [x.size for x in weights]
split_idx = np.cumsum(sizes)
update_ravelled = np.split(w, split_idx)[:-1]
shapes = [x.shape for x in weights]
update_list = [np.reshape(u, s) for s, u in zip(shapes, update_ravelled)]
return update_list
def flatt... | [
"numpy.cumsum",
"numpy.split",
"numpy.reshape"
] | [((102, 118), 'numpy.cumsum', 'np.cumsum', (['sizes'], {}), '(sizes)\n', (111, 118), True, 'import numpy as np\n'), ((141, 163), 'numpy.split', 'np.split', (['w', 'split_idx'], {}), '(w, split_idx)\n', (149, 163), True, 'import numpy as np\n'), ((228, 244), 'numpy.reshape', 'np.reshape', (['u', 's'], {}), '(u, s)\n', (... |
# -*- coding: utf-8 -*-
#
# Copyright 2014-2017 <NAME>
# All Rights Reserved.
#
# 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
#... | [
"pronunciation.format_pronunciations",
"collections.namedtuple",
"datetime.datetime.now",
"html.escape",
"htmlmin.Minifier"
] | [((1424, 1474), 'collections.namedtuple', 'namedtuple', (['"""Ortho"""', "['value', 'rank', 'inflgrps']"], {}), "('Ortho', ['value', 'rank', 'inflgrps'])\n", (1434, 1474), False, 'from collections import namedtuple\n'), ((1483, 1519), 'collections.namedtuple', 'namedtuple', (['"""Kanji"""', "['keb', 'rank']"], {}), "('... |
### FermatsFactor.py
### https://en.wikipedia.org/wiki/Fermat%27s_factorization_method
###
### MIT License
### Copyright (c) 2017 <EMAIL>
### See more detail at https://github.com/636F57/CryptoAttackers/blob/master/LICENSE
from decimal import *
import time
import sys
bFileOutput = True
def fermatsFactorBasic(N... | [
"time.time",
"sys.exit"
] | [((1071, 1082), 'time.time', 'time.time', ([], {}), '()\n', (1080, 1082), False, 'import time\n'), ((1046, 1056), 'sys.exit', 'sys.exit', ([], {}), '()\n', (1054, 1056), False, 'import sys\n'), ((1129, 1140), 'time.time', 'time.time', ([], {}), '()\n', (1138, 1140), False, 'import time\n'), ((756, 766), 'sys.exit', 'sy... |
import sys
import os
import cv2
import numpy as np
import json
from PIL import Image, ImageFont, ImageDraw
from PyQt5 import QtCore, QtGui, QtWidgets
from PyQt5.QtWidgets import *
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from urllib.request import urlretrieve
import requests
from keras.mod... | [
"yolo_multiple_output.YOLO",
"PyQt5.QtWidgets.QMessageBox",
"PyQt5.QtGui.QPixmap.fromImage",
"PyQt5.QtGui.QImage",
"numpy.argsort",
"numpy.array",
"PIL.ImageDraw.Draw",
"PyQt5.QtWidgets.QApplication",
"PyQt5.QtWidgets.QVBoxLayout",
"os.listdir",
"urllib.request.urlretrieve",
"numpy.where",
"... | [((596, 602), 'yolo_multiple_output.YOLO', 'YOLO', ([], {}), '()\n', (600, 602), False, 'from yolo_multiple_output import YOLO, YOLO2\n'), ((612, 619), 'yolo_multiple_output.YOLO2', 'YOLO2', ([], {}), '()\n', (617, 619), False, 'from yolo_multiple_output import YOLO, YOLO2\n'), ((635, 648), 'yolo_detector.YOLO_detect',... |
# import libraries
import numpy as np
import pandas as pd
from sklearn.preprocessing import StandardScaler
from sklearn.linear_model import LogisticRegression
from sklearn.model_selection import GridSearchCV
# load data
# data set used: https://www.kaggle.com/sulianova/cardiovascular-disease-dataset/data
df = pd.read_... | [
"pandas.read_csv",
"sklearn.linear_model.LogisticRegression",
"sklearn.preprocessing.StandardScaler",
"pandas.to_numeric",
"numpy.logspace"
] | [((312, 352), 'pandas.read_csv', 'pd.read_csv', (['"""cardio_train.csv"""'], {'sep': '""","""'}), "('cardio_train.csv', sep=',')\n", (323, 352), True, 'import pandas as pd\n'), ((790, 836), 'pandas.to_numeric', 'pd.to_numeric', (["df['years']"], {'downcast': '"""integer"""'}), "(df['years'], downcast='integer')\n", (80... |
from pyspark.sql import SparkSession
import numpy as np
import pandas as pd
from pyspark.ml import feature, regression, evaluation
SHOW_VALUES = True
spark = SparkSession.builder.master("local[1]") \
.appName("Project2") \
.getOrCreate()
class Wine:
def __init__(self, d, reduce_dims=False):
self.myData = s... | [
"pyspark.ml.regression.RandomForestRegressor",
"pyspark.ml.feature.PCA",
"pyspark.sql.SparkSession.builder.master",
"pyspark.ml.evaluation.RegressionEvaluator",
"pyspark.ml.regression.LinearRegression",
"pyspark.ml.feature.VectorAssembler",
"pyspark.ml.feature.MinMaxScaler"
] | [((1404, 1453), 'pyspark.ml.evaluation.RegressionEvaluator', 'evaluation.RegressionEvaluator', ([], {'metricName': '"""rmse"""'}), "(metricName='rmse')\n", (1434, 1453), False, 'from pyspark.ml import feature, regression, evaluation\n'), ((1974, 2003), 'pyspark.ml.regression.LinearRegression', 'regression.LinearRegress... |
import datetime
import base64
from tornado.web import RequestHandler
from tornado import gen
from bson.objectid import ObjectId
class Handler(RequestHandler):
@gen.coroutine
def post(self, _id):
"""提交代码"""
try:
#if self.request.remote_ip != "192.168.3.11":
# raise Ru... | [
"datetime.datetime.now",
"bson.objectid.ObjectId"
] | [((1533, 1556), 'datetime.datetime.now', 'datetime.datetime.now', ([], {}), '()\n', (1554, 1556), False, 'import datetime\n'), ((2003, 2026), 'datetime.datetime.now', 'datetime.datetime.now', ([], {}), '()\n', (2024, 2026), False, 'import datetime\n'), ((1147, 1160), 'bson.objectid.ObjectId', 'ObjectId', (['_id'], {}),... |
from transformers import AutoTokenizer
tokenizer = AutoTokenizer.from_pretrained('bert-base-cased')
batch_sentences = ["Hello I'm a single sentence",
"And another sentence",
"And the very very last one"]
batch = tokenizer(batch_sentences, padding=True, truncation=True, max_length=... | [
"transformers.AutoTokenizer.from_pretrained"
] | [((51, 99), 'transformers.AutoTokenizer.from_pretrained', 'AutoTokenizer.from_pretrained', (['"""bert-base-cased"""'], {}), "('bert-base-cased')\n", (80, 99), False, 'from transformers import AutoTokenizer\n')] |
from ozone import create_app
from ozone.config import ProdConfigLinux, DevConfigLinux, ProdConfigWindows, DevConfigWindows, logger
from tornado.wsgi import WSGIContainer
from tornado.httpserver import HTTPServer
from tornado.ioloop import IOLoop
from ozone.utils.music_util import query_loop
import threading
import argp... | [
"ozone.utils.music_util.query_loop",
"argparse.ArgumentParser",
"ozone.config.logger.info",
"platform.platform",
"tornado.ioloop.IOLoop.instance",
"ozone.config.logger.warning",
"ozone.create_app",
"threading.Thread",
"tornado.wsgi.WSGIContainer"
] | [((416, 434), 'ozone.utils.music_util.query_loop', 'query_loop', (['config'], {}), '(config)\n', (426, 434), False, 'from ozone.utils.music_util import query_loop\n'), ((657, 712), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Ozone app parser"""'}), "(description='Ozone app parser')\n"... |
# !/usr/bin/env python
# -*- coding: utf-8 -*-
"""
celebrity problem
"""
__author__ = "prakashsellathurai"
__copyright__ = "Copyright 2021"
__version__ = "1.0.1"
__email__ = "<EMAIL>"
from random import randrange
def celeb(G):
n = len(G)
u, v = 0, 1
for c in range(2, n + 1):
if G[u][v]:
... | [
"random.randrange"
] | [((716, 728), 'random.randrange', 'randrange', (['n'], {}), '(n)\n', (725, 728), False, 'from random import randrange\n'), ((656, 668), 'random.randrange', 'randrange', (['(2)'], {}), '(2)\n', (665, 668), False, 'from random import randrange\n')] |
import numpy as np
from helpers import get_signal, number_of_frames, first_last_frame_number
import os
import cv2
import seaborn as sns; sns.set()
mode = 1024
fps = 20
signal_list = ['range', 'reflectivity', 'signal', 'ambient']
signal_name = input("Signal to display:")
for idx, val in enumerate(signal_list):
if ... | [
"seaborn.set",
"cv2.merge",
"helpers.get_signal",
"cv2.VideoWriter",
"os.chdir",
"helpers.number_of_frames",
"numpy.zeros",
"cv2.VideoWriter_fourcc",
"numpy.rot90"
] | [((137, 146), 'seaborn.set', 'sns.set', ([], {}), '()\n', (144, 146), True, 'import seaborn as sns\n'), ((417, 487), 'os.chdir', 'os.chdir', (['"""/media/nizar/Transcend/test in the lab/Data/myFormat/Lidar"""'], {}), "('/media/nizar/Transcend/test in the lab/Data/myFormat/Lidar')\n", (425, 487), False, 'import os\n'), ... |
#!/usr/bin/env python3
from McUnix.diff import argue, diff
args = argue()
diff(args.lhs.rstrip('/'), args.rhs.rstrip('/'))
| [
"McUnix.diff.argue"
] | [((68, 75), 'McUnix.diff.argue', 'argue', ([], {}), '()\n', (73, 75), False, 'from McUnix.diff import argue, diff\n')] |
import re
from src.coinverscrapy.model.formatting_handlers.abs_handler.AbstractHandler import AbstractHandler
class GenericListHandler(AbstractHandler):
def handle(self, request: str) -> str:
is_task_match = re.search('Taak: \n', request)
if is_task_match:
match = re.search('\\w+\\s*... | [
"re.sub",
"re.search"
] | [((223, 253), 're.search', 're.search', (['"""Taak: \n"""', 'request'], {}), "('Taak: \\n', request)\n", (232, 253), False, 'import re\n'), ((301, 345), 're.search', 're.search', (['"""\\\\w+\\\\s*\\\\no( )*(\\\\n)*"""', 'request'], {}), "('\\\\w+\\\\s*\\\\no( )*(\\\\n)*', request)\n", (310, 345), False, 'import re\n')... |
import os
class Paths:
ROOT = os.path.join(os.path.dirname(os.path.abspath(__file__)))
MODEL = os.path.join(ROOT, 'model')
IMAGES = os.path.join(ROOT, 'images')
OUTPUT = os.path.join(ROOT, 'out')
| [
"os.path.abspath",
"os.path.join"
] | [((105, 132), 'os.path.join', 'os.path.join', (['ROOT', '"""model"""'], {}), "(ROOT, 'model')\n", (117, 132), False, 'import os\n'), ((146, 174), 'os.path.join', 'os.path.join', (['ROOT', '"""images"""'], {}), "(ROOT, 'images')\n", (158, 174), False, 'import os\n'), ((188, 213), 'os.path.join', 'os.path.join', (['ROOT'... |
# -*- coding: utf-8 -*-
"""
Discription: TrackLab of the Molecular Nanophotonics Group
Author(s): <NAME>
Data: 19/04/21
"""
import numpy as np
import skimage
import pandas as pd
def connected_components(image, threshold, min_area, max_area, max_features, invert=False):
"""
Detect features using connected-com... | [
"pandas.DataFrame",
"skimage.measure.label",
"skimage.measure.regionprops"
] | [((641, 655), 'pandas.DataFrame', 'pd.DataFrame', ([], {}), '()\n', (653, 655), True, 'import pandas as pd\n'), ((812, 850), 'skimage.measure.label', 'skimage.measure.label', (['threshold_image'], {}), '(threshold_image)\n', (833, 850), False, 'import skimage\n'), ((865, 940), 'skimage.measure.regionprops', 'skimage.me... |
import requests
from bs4 import BeautifulSoup as bs
def formToPayload(rrs,formIdName,formIdValue):
"""Returns form with formId of rrs response as payload dict"""
# Requires requests and BeautifulSoup
html = bs(rrs.content,features="html.parser")
forms = html.body.findChildren('form')
payload = {}... | [
"bs4.BeautifulSoup"
] | [((222, 261), 'bs4.BeautifulSoup', 'bs', (['rrs.content'], {'features': '"""html.parser"""'}), "(rrs.content, features='html.parser')\n", (224, 261), True, 'from bs4 import BeautifulSoup as bs\n')] |
import config
import models.base
from models.task import TaskLock
def main():
app = config.App(config)
with app.app_context():
for lock in models.base.db.session.query(TaskLock).all():
if lock.step is not None:
lock.step.complete('Force release lock')
models.bas... | [
"config.App"
] | [((90, 108), 'config.App', 'config.App', (['config'], {}), '(config)\n', (100, 108), False, 'import config\n')] |
# -*- coding: utf-8 -*-
from exam.exceptions import ModelDoesNotExist, InvalidParameter
def create_specific_exam(name_class):
try:
app_name = name_class.lower()
module = __import__(app_name + '.models', fromlist=[name_class])
class_ = getattr(module, name_class)
instance = class_... | [
"exam.exceptions.InvalidParameter",
"exam.exceptions.ModelDoesNotExist"
] | [((386, 427), 'exam.exceptions.ModelDoesNotExist', 'ModelDoesNotExist', (['"""Model does not exist"""'], {}), "('Model does not exist')\n", (403, 427), False, 'from exam.exceptions import ModelDoesNotExist, InvalidParameter\n'), ((465, 502), 'exam.exceptions.InvalidParameter', 'InvalidParameter', (['"""Invalid paramete... |
# -*- coding: utf8 -*-
import argparse
from .Config import Config
from .Game import Game
from .Constants import ORZMC_VERSION_NUMBER_STR, BMCLAPI_DESC
from ..utils.RichText import RichText
def print_info(args):
'''打印工具版本号'''
if args.version_number:
print(ORZMC_VERSION_NUMBER_STR)
exit(0)
... | [
"argparse.ArgumentParser"
] | [((483, 605), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""A command line tool for start Minecraft client or deploy minecraft server"""'}), "(description=\n 'A command line tool for start Minecraft client or deploy minecraft server'\n )\n", (506, 605), False, 'import argparse\n')... |
from hypothesis import given, example, note
import hypothesis.strategies as st
import hypothesis
import strategies
import warnings
import base64
import json
import six
import blackboxprotobuf
warnings.filterwarnings(
"ignore",
"Call to deprecated create function.*",
)
try:
import Test_pb2
except:
im... | [
"hypothesis.example",
"hypothesis.note",
"hypothesis.assume",
"json.loads",
"blackboxprotobuf.protobuf_to_json",
"strategies.gen_message_data",
"json.dumps",
"blackboxprotobuf.protobuf_from_json",
"six.ensure_binary",
"Test_pb2.TestMessage",
"blackboxprotobuf.decode_message",
"blackboxprotobuf... | [((195, 268), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""', '"""Call to deprecated create function.*"""'], {}), "('ignore', 'Call to deprecated create function.*')\n", (218, 268), False, 'import warnings\n'), ((4231, 4267), 'hypothesis.example', 'example', ([], {'x': "{'testBytes': b'test123'}... |
# Time: O(n * 2^(n/2))
# Space: O(n * 2^(n/2))
import bisect
class Solution(object):
def minAbsDifference(self, nums, goal):
"""
:type nums: List[int]
:type goal: int
:rtype: int
"""
mx, mn = sum(x for x in nums if x > 0), sum(x for x in nums if x < 0)
if ... | [
"bisect.bisect_left"
] | [((999, 1051), 'bisect.bisect_left', 'bisect.bisect_left', (['sorted_sums1', '(goal - x - nums[i])'], {}), '(sorted_sums1, goal - x - nums[i])\n', (1017, 1051), False, 'import bisect\n')] |
import sys
import open3d
import numpy as np
import time
import os
from geometric_registration.utils import get_pcd, get_keypts, get_desc, loadlog
import cv2
from functools import partial
def build_correspondence(source_desc, target_desc):
"""
Find the mutually closest point pairs in feature space.
source ... | [
"numpy.sqrt",
"open3d.PointCloud",
"numpy.array",
"geometric_registration.utils.get_desc",
"open3d.TransformationEstimationPointToPoint",
"os.path.exists",
"os.listdir",
"numpy.asarray",
"geometric_registration.utils.loadlog",
"open3d.registration.Feature",
"os.mkdir",
"numpy.min",
"numpy.ar... | [((411, 457), 'numpy.sqrt', 'np.sqrt', (['(2 - 2 * (source_desc @ target_desc.T))'], {}), '(2 - 2 * (source_desc @ target_desc.T))\n', (418, 457), True, 'import numpy as np\n'), ((475, 502), 'numpy.argmin', 'np.argmin', (['distance'], {'axis': '(1)'}), '(distance, axis=1)\n', (484, 502), True, 'import numpy as np\n'), ... |
'''
This module provides functions to work with clingo's theories.
Example
-------
```python-repl
>>> from clingo.control import Control
>>> from clingox.theory import evaluate
>>>
>>> prg = """\
... #theory test {
... term {
... - : 3, unary;
... ** : 2, binary, right;
... * : 1, binary... | [
"clingo.Number",
"clingo.Function"
] | [((1414, 1433), 'clingo.Number', 'Number', (['(-sym.number)'], {}), '(-sym.number)\n', (1420, 1433), False, 'from clingo import Symbol, Function, String, Tuple_, Number, SymbolType, TheoryTermType\n'), ((1503, 1554), 'clingo.Function', 'Function', (['sym.name', 'sym.arguments', '(not sym.positive)'], {}), '(sym.name, s... |
import pytest
import numpy as np
from jina.excepts import BadClientCallback
from jina.flow import Flow
def validate(x):
raise NotImplementedError
@pytest.mark.parametrize('restful', [False, True])
def test_client_on_error(restful):
# In this particular test, when you write two tests in a row, you are testi... | [
"numpy.random.random",
"pytest.mark.parametrize",
"jina.flow.Flow"
] | [((156, 205), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""restful"""', '[False, True]'], {}), "('restful', [False, True])\n", (179, 205), False, 'import pytest\n'), ((1196, 1220), 'numpy.random.random', 'np.random.random', (['[5, 4]'], {}), '([5, 4])\n', (1212, 1220), True, 'import numpy as np\n'), ((79... |
import unittest
from text_transliter import TextTransliter
class TestTextTransliter(unittest.TestCase):
def setUp(self):
pass
def tearDown(self):
pass
def test_empty_line(self):
text = ''
result = TextTransliter(text, input_lang='ru').get_translitet()
self.assertE... | [
"unittest.main",
"text_transliter.TextTransliter"
] | [((939, 954), 'unittest.main', 'unittest.main', ([], {}), '()\n', (952, 954), False, 'import unittest\n'), ((245, 282), 'text_transliter.TextTransliter', 'TextTransliter', (['text'], {'input_lang': '"""ru"""'}), "(text, input_lang='ru')\n", (259, 282), False, 'from text_transliter import TextTransliter\n'), ((440, 477)... |
# -*- coding: utf-8 -*-
#单例测试导入路径
if __name__ == '__main__':
import sys, os
parent_path = os.path.dirname(os.getcwd())
sys.path.append(parent_path)
from webparser.webparserbase import ParserBase
from serializ.htmlfile import *
from serializ.oracle import *
from bean.urlbean import *
from log.log... | [
"requests.session",
"os.getcwd",
"bs4.BeautifulSoup",
"datetime.datetime.now",
"re.findall",
"sys.path.append",
"re.search"
] | [((136, 164), 'sys.path.append', 'sys.path.append', (['parent_path'], {}), '(parent_path)\n', (151, 164), False, 'import sys, os\n'), ((2061, 2079), 'requests.session', 'requests.session', ([], {}), '()\n', (2077, 2079), False, 'import requests, re\n'), ((118, 129), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (127, 129... |
# -*- coding: utf-8 -*-
'''
devicing.py raet protocol device classes
'''
# pylint: skip-file
# pylint: disable=W0611
# Import python libs
import socket
import os
# Import ioflo libs
from ioflo.base.odicting import odict
from ioflo.base import aiding
from . import raeting
from . import nacling
from ioflo.base.consoli... | [
"ioflo.base.consoling.getConsole",
"os.path.splitext",
"os.path.join",
"os.path.split"
] | [((351, 363), 'ioflo.base.consoling.getConsole', 'getConsole', ([], {}), '()\n', (361, 363), False, 'from ioflo.base.consoling import getConsole\n'), ((380, 409), 'os.path.join', 'os.path.join', (['"""/tmp"""', '""".raet"""'], {}), "('/tmp', '.raet')\n", (392, 409), False, 'import os\n'), ((1756, 1773), 'os.path.split'... |
import click
def positive_num(ctx, param, value):
if value < 1:
raise click.BadParameter("Should be a positive integer!")
return value
| [
"click.BadParameter"
] | [((84, 135), 'click.BadParameter', 'click.BadParameter', (['"""Should be a positive integer!"""'], {}), "('Should be a positive integer!')\n", (102, 135), False, 'import click\n')] |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import pandas as pd
from ..event.event import *
class HistoricalEvent(Event):
"""
Bar event, aggregated from TickEvent
"""
def __init__(self):
"""
Initialises bar
"""
self.event_type = EventType.HISTORICAL
self.bar_st... | [
"pandas.Timestamp"
] | [((331, 367), 'pandas.Timestamp', 'pd.Timestamp', (['"""1970-01-01"""'], {'tz': '"""UTC"""'}), "('1970-01-01', tz='UTC')\n", (343, 367), True, 'import pandas as pd\n')] |
'''
Author : noeru_desu
Date : 2021-08-28 18:35:58
LastEditors : noeru_desu
LastEditTime : 2021-10-06 14:30:00
Description : logger
'''
from logging import StreamHandler, getLogger
from colorlog import ColoredFormatter
class Logger(object):
def __init__(self, logger_registered_name: str = 'logger... | [
"logging.getLogger",
"logging.StreamHandler",
"colorlog.ColoredFormatter"
] | [((391, 424), 'logging.getLogger', 'getLogger', (['logger_registered_name'], {}), '(logger_registered_name)\n', (400, 424), False, 'from logging import StreamHandler, getLogger\n'), ((514, 529), 'logging.StreamHandler', 'StreamHandler', ([], {}), '()\n', (527, 529), False, 'from logging import StreamHandler, getLogger\... |
import ast
import re
from setuptools import setup, find_packages
from pip.req import parse_requirements
# get __version__ in __init__.py
_version_re = re.compile(r'__version__\s+=\s+(.*)')
with open('jsonlookup/__init__.py', 'rb') as f:
version = str(ast.literal_eval(_version_re.search(
f.read().decode('ut... | [
"pip.req.parse_requirements",
"setuptools.find_packages",
"re.compile"
] | [((152, 190), 're.compile', 're.compile', (['"""__version__\\\\s+=\\\\s+(.*)"""'], {}), "('__version__\\\\s+=\\\\s+(.*)')\n", (162, 190), False, 'import re\n'), ((472, 525), 'pip.req.parse_requirements', 'parse_requirements', (['"""requirements.txt"""'], {'session': '(False)'}), "('requirements.txt', session=False)\n",... |
# Copyright 2018 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... | [
"tensorflow.python.framework.constant_op.constant",
"tensorflow.python.platform.test.main",
"tensorflow.python.ops.control_flow_util_v2.in_defun"
] | [((2324, 2335), 'tensorflow.python.platform.test.main', 'test.main', ([], {}), '()\n', (2333, 2335), False, 'from tensorflow.python.platform import test\n'), ((2256, 2287), 'tensorflow.python.ops.control_flow_util_v2.in_defun', 'control_flow_util_v2.in_defun', ([], {}), '()\n', (2285, 2287), False, 'from tensorflow.pyt... |
from fastapi import Body, FastAPI, Form, Request
from fastapi.responses import JSONResponse
from fastapi.staticfiles import StaticFiles
from fastapi.templating import Jinja2Templates
from celery.result import AsyncResult
from worker import create_task
app = FastAPI()
app.mount("/static", StaticFiles(directory="static... | [
"fastapi.FastAPI",
"celery.result.AsyncResult",
"fastapi.templating.Jinja2Templates",
"fastapi.responses.JSONResponse",
"fastapi.Body",
"fastapi.staticfiles.StaticFiles"
] | [((260, 269), 'fastapi.FastAPI', 'FastAPI', ([], {}), '()\n', (267, 269), False, 'from fastapi import Body, FastAPI, Form, Request\n'), ((351, 389), 'fastapi.templating.Jinja2Templates', 'Jinja2Templates', ([], {'directory': '"""templates"""'}), "(directory='templates')\n", (366, 389), False, 'from fastapi.templating i... |
import multiprocessing
from fastai.dataset import *
from fasterai.files import *
from pathlib import Path
from itertools import repeat
from PIL import Image
from numpy import ndarray
from datetime import datetime
def generate_image_preprocess_path(source_path: Path, is_x:bool, uid: str):
name = generate_image_prep... | [
"PIL.Image.open",
"multiprocessing.cpu_count",
"pathlib.Path"
] | [((1567, 1594), 'multiprocessing.cpu_count', 'multiprocessing.cpu_count', ([], {}), '()\n', (1592, 1594), False, 'import multiprocessing\n'), ((645, 667), 'PIL.Image.open', 'Image.open', (['sourcepath'], {}), '(sourcepath)\n', (655, 667), False, 'from PIL import Image\n'), ((1490, 1510), 'pathlib.Path', 'Path', (['raw_... |
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import re
BUCKET_NAME_REGEX = re.compile(r'^[0-9a-z_\.\-/]{1,100}$')
class Error(Exception):
pass
class BuildNotFoundError(Error):
pass
class Buil... | [
"re.compile"
] | [((194, 233), 're.compile', 're.compile', (['"""^[0-9a-z_\\\\.\\\\-/]{1,100}$"""'], {}), "('^[0-9a-z_\\\\.\\\\-/]{1,100}$')\n", (204, 233), False, 'import re\n')] |
# ---------------------------------------------------------------------
# Eltex.TAU.get_version
# ---------------------------------------------------------------------
# Copyright (C) 2007-2020 The NOC Project
# See LICENSE for details
# ---------------------------------------------------------------------
# Python mo... | [
"re.compile"
] | [((595, 746), 're.compile', 're.compile', (['"""^(?P<platform>\\\\S+)\\\\s*.+\\\\nSystem version:\\\\s+#(?P<sysver>\\\\S+)\\\\n\\\\S.+\\\\nFirmware\\\\sversion:\\\\s+(?P<fwver>\\\\S+)"""', 're.MULTILINE'], {}), "(\n '^(?P<platform>\\\\S+)\\\\s*.+\\\\nSystem version:\\\\s+#(?P<sysver>\\\\S+)\\\\n\\\\S.+\\\\nFirmware\... |
# -*- coding: utf-8 -*-
import re
import pytest
from mimesis import Food
from . import patterns
class TestFood(object):
def test_str(self, food):
assert re.match(patterns.DATA_PROVIDER_STR_REGEX, str(food))
def test_vegetable(self, food):
result = food.vegetable()
assert result in f... | [
"mimesis.Food"
] | [((872, 887), 'mimesis.Food', 'Food', ([], {'seed': 'seed'}), '(seed=seed)\n', (876, 887), False, 'from mimesis import Food\n'), ((949, 964), 'mimesis.Food', 'Food', ([], {'seed': 'seed'}), '(seed=seed)\n', (953, 964), False, 'from mimesis import Food\n')] |
import pytest
from django.urls import reverse
from django.contrib.auth.models import User
from pytest_django.asserts import assertRedirects
@pytest.fixture
def resposta(client, db):
usr = User.objects.create_user(username='UserTest', password='<PASSWORD>')
resp = client.post(reverse('login'), data={'username':... | [
"django.contrib.auth.models.User.objects.create_user",
"django.urls.reverse"
] | [((193, 261), 'django.contrib.auth.models.User.objects.create_user', 'User.objects.create_user', ([], {'username': '"""UserTest"""', 'password': '"""<PASSWORD>"""'}), "(username='UserTest', password='<PASSWORD>')\n", (217, 261), False, 'from django.contrib.auth.models import User\n'), ((285, 301), 'django.urls.reverse'... |
"""
Copyright (c) Contributors to the Open 3D Engine Project.
For complete copyright and license terms please see the LICENSE at the root of this distribution.
SPDX-License-Identifier: Apache-2.0 OR MIT
"""
class Tests:
deferred_fog_creation = (
"Deferred Fog Entity successfully created",
"P0: De... | [
"editor_python_test_tools.utils.Report.start_test",
"editor_python_test_tools.utils.TestHelper.enter_game_mode",
"editor_python_test_tools.utils.TestHelper.wait_for_condition",
"editor_python_test_tools.utils.TestHelper.open_level",
"editor_python_test_tools.utils.TestHelper.exit_game_mode",
"azlmbr.math.... | [((21951, 22016), 'editor_python_test_tools.utils.Report.start_test', 'Report.start_test', (['AtomEditorComponents_DeferredFog_AddedToEntity'], {}), '(AtomEditorComponents_DeferredFog_AddedToEntity)\n', (21968, 22016), False, 'from editor_python_test_tools.utils import Report\n'), ((7230, 7238), 'editor_python_test_too... |
import abc
import datetime
import uuid
from boto3.dynamodb.conditions import Key
from . import iam, models
from .exceptions import WecoDeployError
class ReleaseStoreError(WecoDeployError):
pass
class ReleaseNotFoundError(ReleaseStoreError):
"""
Raised if a release store is asked to retrieve a release ... | [
"boto3.dynamodb.conditions.Key",
"datetime.datetime.utcnow",
"uuid.uuid4"
] | [((3123, 3135), 'uuid.uuid4', 'uuid.uuid4', ([], {}), '()\n', (3133, 3135), False, 'import uuid\n'), ((3308, 3334), 'datetime.datetime.utcnow', 'datetime.datetime.utcnow', ([], {}), '()\n', (3332, 3334), False, 'import datetime\n'), ((7224, 7241), 'boto3.dynamodb.conditions.Key', 'Key', (['"""project_id"""'], {}), "('p... |
import sqlite3
import sys
import re
import json
# Usage:
# python import_drugs.py
# /path/to/freemedforms-freedata/master.db
# (for example
# /usr/share/freemedforms/datapacks/appinstalled/drugs/master.db)
# /path/to/ineedmy.db (for example ./ineedmy.db)
if __name__ == '__main__':
src_conn = sqlite3.co... | [
"re.sub",
"json.dumps",
"sqlite3.connect"
] | [((310, 338), 'sqlite3.connect', 'sqlite3.connect', (['sys.argv[1]'], {}), '(sys.argv[1])\n', (325, 338), False, 'import sqlite3\n'), ((354, 382), 'sqlite3.connect', 'sqlite3.connect', (['sys.argv[2]'], {}), '(sys.argv[2])\n', (369, 382), False, 'import sqlite3\n'), ((674, 705), 'json.dumps', 'json.dumps', (["{'name': ... |
import subprocess
def main():
parser = argparse.ArgumentParser(description='Builds a Latex file.')
parser.add_argument('filename',
type=str,
default='',
help='File to be built')
args = parser.parse_args()
subprocess.check_call(['xelatex', args.filename])
if __name__ == '__main__':
main()
| [
"subprocess.check_call"
] | [((227, 276), 'subprocess.check_call', 'subprocess.check_call', (["['xelatex', args.filename]"], {}), "(['xelatex', args.filename])\n", (248, 276), False, 'import subprocess\n')] |
from django.shortcuts import render
from django.http import HttpResponseRedirect, HttpResponse
from rango.models import Category, Page
from rango.forms import CategoryForm, PageForm
from rango.forms import UserForm, UserProfileForm
from django.core.urlresolvers import reverse
from django.contrib.auth import authenticat... | [
"django.shortcuts.render",
"rango.forms.PageForm",
"rango.forms.CategoryForm",
"datetime.datetime.strptime",
"rango.models.Category.objects.get",
"datetime.datetime.now",
"rango.webhose_search.run_query",
"rango.models.Category.objects.order_by",
"rango.models.Page.objects.order_by",
"rango.models... | [((1539, 1596), 'django.shortcuts.render', 'render', (['request', '"""rango/index.html"""'], {'context': 'context_dict'}), "(request, 'rango/index.html', context=context_dict)\n", (1545, 1596), False, 'from django.shortcuts import render\n'), ((2097, 2154), 'django.shortcuts.render', 'render', (['request', '"""rango/ab... |
#bibliotecas
import random
from datetime import date
#variaveis
con = bin = 0
data = date.today().year
#layout
print("_________ _________ ___________________ _______ ")
print("\_ ___ \ \_ ___ \ / _____/\_ _____/ \ \ ")
print("/ \ \/ / \ \/ / \ ___ | __)_ / | \ ")
... | [
"datetime.date.today",
"random.randint",
"random.randrange"
] | [((1054, 1080), 'random.randrange', 'random.randrange', (['(100)', '(999)'], {}), '(100, 999)\n', (1070, 1080), False, 'import random\n'), ((1088, 1109), 'random.randint', 'random.randint', (['(1)', '(12)'], {}), '(1, 12)\n', (1102, 1109), False, 'import random\n'), ((1151, 1182), 'random.randrange', 'random.randrange'... |
import re
text = 'abbaaabbbbaaaaa'
pattern = 'ab'
for match in re.finditer(pattern, text):
print (type(match))
s = match.start()
e = match.end()
print ('Found "%s" at %d:%d' % (text[s:e], s, e))
| [
"re.finditer"
] | [((66, 92), 're.finditer', 're.finditer', (['pattern', 'text'], {}), '(pattern, text)\n', (77, 92), False, 'import re\n')] |
from flask_api import FlaskAPI
from flask_sqlalchemy import SQLAlchemy
# import the environment dict
from instance.config import app_config
from flask import request, jsonify
from flask_mail import Mail, Message
import os
import random
from flask_cors import CORS
# initialize sqlalchemy
db = SQLAlchemy()
def create_a... | [
"app.models.Business.validate_business_details",
"app.models.Business.get_all",
"flask_cors.CORS",
"app.models.User.decode_token",
"app.models.Access_token.query.filter_by",
"flask_mail.Message",
"app.models.User.get_all_users",
"flask.request.headers.get",
"flask.jsonify",
"app.models.Business.qu... | [((293, 305), 'flask_sqlalchemy.SQLAlchemy', 'SQLAlchemy', ([], {}), '()\n', (303, 305), False, 'from flask_sqlalchemy import SQLAlchemy\n'), ((512, 561), 'flask_api.FlaskAPI', 'FlaskAPI', (['__name__'], {'instance_relative_config': '(True)'}), '(__name__, instance_relative_config=True)\n', (520, 561), False, 'from fla... |
# -*- coding: utf-8 -*-
from django.conf.urls import patterns, url, include
from views import default, req, grant
urlpatterns = patterns(
'',
url(r'(?:(?P<tenant>.*)/)?api/', include('connect.az.api')),
url(r'(?:(?P<tenant>.*)/)?tos', req, name='az_tos'),
url(r'(?:(?P<tenant>.*)/)?policy', grant, name=... | [
"django.conf.urls.include",
"django.conf.urls.url"
] | [((216, 266), 'django.conf.urls.url', 'url', (['"""(?:(?P<tenant>.*)/)?tos"""', 'req'], {'name': '"""az_tos"""'}), "('(?:(?P<tenant>.*)/)?tos', req, name='az_tos')\n", (219, 266), False, 'from django.conf.urls import patterns, url, include\n'), ((273, 331), 'django.conf.urls.url', 'url', (['"""(?:(?P<tenant>.*)/)?polic... |
import numpy as np
import scipy as sp
from scipy.linalg import cho_factor, cho_solve
import time
start_time = time.time()
#float_formatter = '{:.4f}'.format
#np.set_printoptions(formatter={'float_kind':float_formatter})
N = 1000
print('N: ', N)
#Filling N*N array to initialize it
A1 = np.zeros((N,N), float)
A2 = np.... | [
"scipy.linalg.cho_solve",
"numpy.ones",
"scipy.linalg.cho_factor",
"numpy.fill_diagonal",
"numpy.zeros",
"time.time"
] | [((110, 121), 'time.time', 'time.time', ([], {}), '()\n', (119, 121), False, 'import time\n'), ((289, 312), 'numpy.zeros', 'np.zeros', (['(N, N)', 'float'], {}), '((N, N), float)\n', (297, 312), True, 'import numpy as np\n'), ((317, 340), 'numpy.zeros', 'np.zeros', (['(N, N)', 'float'], {}), '((N, N), float)\n', (325, ... |
# Generated by Django 3.2.7 on 2021-09-08 09:44
import django.contrib.auth.models
import django.contrib.auth.validators
import django.core.validators
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
initial = True
dependencies = [
('auth',... | [
"django.db.models.EmailField",
"django.db.models.DateField",
"django.db.models.ManyToManyField",
"django.db.models.BooleanField",
"django.db.models.BigAutoField",
"django.db.models.DateTimeField",
"django.db.models.CharField"
] | [((490, 602), 'django.db.models.BigAutoField', 'models.BigAutoField', ([], {'auto_created': '(True)', 'db_column': '"""id"""', 'primary_key': '(True)', 'serialize': '(False)', 'verbose_name': '"""ID"""'}), "(auto_created=True, db_column='id', primary_key=True,\n serialize=False, verbose_name='ID')\n", (509, 602), Fa... |
#!/usr/bin/env python
# coding: utf-8
# # Import Base Packages
# In[ ]:
import pandas as pd
import numpy as np
import warnings
warnings.filterwarnings('ignore')
# # Interface function to feature engineering data
# In[ ]:
from sklearn.preprocessing import LabelEncoder
from sklearn.preprocessing import Standard... | [
"sklearn.preprocessing.LabelEncoder",
"sklearn.preprocessing.PolynomialFeatures",
"matplotlib.pyplot.grid",
"pandas.read_csv",
"matplotlib.pyplot.ylabel",
"sklearn.metrics.classification_report",
"sklearn.metrics.auc",
"numpy.hstack",
"sklearn.tree.export_graphviz",
"numpy.array",
"sklearn.metri... | [((132, 165), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {}), "('ignore')\n", (155, 165), False, 'import warnings\n'), ((822, 836), 'sklearn.preprocessing.LabelEncoder', 'LabelEncoder', ([], {}), '()\n', (834, 836), False, 'from sklearn.preprocessing import LabelEncoder\n'), ((846, 862), '... |
import asyncio
from aiocache import caches, SimpleMemoryCache, RedisCache
from aiocache.serializers import StringSerializer, PickleSerializer
caches.set_config({
'default': {
'cache': "aiocache.SimpleMemoryCache",
'serializer': {
'class': "aiocache.serializers.StringSerializer"
... | [
"aiocache.caches.get_alias_config",
"aiocache.caches.set_config",
"aiocache.RedisCache",
"asyncio.get_event_loop",
"aiocache.caches.get"
] | [((144, 578), 'aiocache.caches.set_config', 'caches.set_config', (["{'default': {'cache': 'aiocache.SimpleMemoryCache', 'serializer': {'class':\n 'aiocache.serializers.StringSerializer'}}, 'redis_alt': {'cache':\n 'aiocache.RedisCache', 'endpoint': '127.0.0.1', 'port': 6379, 'timeout':\n 1, 'serializer': {'cla... |
# -*- coding: utf-8 -*-
from __future__ import print_function
from os import sys
try:
from skbuild import setup
except ImportError:
print('scikit-build is required to build from source.', file=sys.stderr)
print('Please run:', file=sys.stderr)
print('', file=sys.stderr)
print(' python -m pip instal... | [
"os.sys.exit",
"skbuild.setup"
] | [((354, 2007), 'skbuild.setup', 'setup', ([], {'name': '"""itk-genericlabelinterpolator"""', 'version': '"""1.1.0"""', 'author': '"""<NAME>"""', 'author_email': '"""<EMAIL>"""', 'packages': "['itk']", 'package_dir': "{'itk': 'itk'}", 'download_url': '"""https://github.com/InsightSoftwareConsortium/ITKGenericLabelInterp... |
import torch
from torch import nn
class BaseAligner(nn.Module):
def __init__(self, add_identity = True, add_bias = True):
super(BaseAligner, self).__init__()
self.n_parameters = None
self.add_bias = add_bias
self.add_identity = add_identity
if self.add_bias:
... | [
"torch.eye",
"torch.transpose",
"torch.bmm",
"torch.FloatTensor",
"torch.cat"
] | [((1489, 1527), 'torch.bmm', 'torch.bmm', (["transformation['matrix']", 'x'], {}), "(transformation['matrix'], x)\n", (1498, 1527), False, 'import torch\n'), ((5612, 5635), 'torch.cat', 'torch.cat', (['(x, y, z)', '(2)'], {}), '((x, y, z), 2)\n', (5621, 5635), False, 'import torch\n'), ((800, 847), 'torch.transpose', '... |
import sys
import os
import numpy as np
import cv2
from PIL import Image, ImageDraw, ImageFont
import acl
path = os.path.dirname(os.path.abspath(__file__))
sys.path.append(os.path.join(path, ".."))
sys.path.append(os.path.join(path, "../../../../common/"))
from acllite_resource import AclLiteResource
from acllite_mod... | [
"os.path.exists",
"acllite_resource.AclLiteResource",
"PIL.Image.open",
"os.listdir",
"utils.check_ret",
"os.path.join",
"PIL.ImageFont.truetype",
"acllite_image.AclLiteImage",
"os.path.splitext",
"PIL.ImageDraw.Draw",
"os.mkdir",
"os.path.basename",
"os.path.abspath",
"acllite_model.AclLi... | [((483, 507), 'os.path.join', 'os.path.join', (['path', '""".."""'], {}), "(path, '..')\n", (495, 507), False, 'import os\n'), ((521, 553), 'os.path.join', 'os.path.join', (['currentPath', '"""out"""'], {}), "(currentPath, 'out')\n", (533, 553), False, 'import os\n'), ((567, 618), 'os.path.join', 'os.path.join', (['cur... |
from .component import Component
from pynegin.conf import HOME
import pygame
import pathlib
class Image(Component):
def __init__(self, container, source, x=0, y=0, size=(0,0), isVisible=True,
surface=None, border=None, onActivate=None, basePath=None, fromString=False, PIL_img=None):
if fr... | [
"pygame.image.load",
"pathlib.Path",
"pygame.transform.scale"
] | [((876, 920), 'pygame.transform.scale', 'pygame.transform.scale', (['self.surface', 'toSize'], {}), '(self.surface, toSize)\n', (898, 920), False, 'import pygame\n'), ((1001, 1043), 'pygame.transform.scale', 'pygame.transform.scale', (['self.surface', 'size'], {}), '(self.surface, size)\n', (1023, 1043), False, 'import... |
import json
import multiprocessing
from multiprocessing import Process
import os
import random
import time
import traceback
import zmq
import zmq.decorators as zmqd
from aser.database.kg_connection import ASERKGConnection
from aser.server.utils import *
from aser.extract.aser_extractor import SeedRuleASERExtractor
from... | [
"traceback.format_exc",
"multiprocessing.Event",
"json.dumps",
"os.path.join",
"zmq.decorators.context",
"zmq.decorators.socket",
"zmq.Poller",
"aser.extract.aser_extractor.SeedRuleASERExtractor",
"time.time"
] | [((947, 961), 'zmq.decorators.context', 'zmqd.context', ([], {}), '()\n', (959, 961), True, 'import zmq.decorators as zmqd\n'), ((967, 988), 'zmq.decorators.socket', 'zmqd.socket', (['zmq.PULL'], {}), '(zmq.PULL)\n', (978, 988), True, 'import zmq.decorators as zmqd\n'), ((994, 1015), 'zmq.decorators.socket', 'zmqd.sock... |
from Textures import VOICE_MODULATION, DIALOGBOX_READOUT, NAMIKO, FRAMEBORDER
__author__ = "<NAME>"
__copyright__ = "Copyright 2007, Cobra Project"
__credits__ = ["<NAME>"]
__license__ = "GPL"
__version__ = "1.0.0"
__maintainer__ = "<NAME>"
__email__ = "<EMAIL>"
__status__ = "Demo"
from numpy import lins... | [
"pygame.init",
"pygame.quit",
"pygame.sprite.RenderUpdates",
"pygame.transform.scale",
"Textures.FRAMEBORDER.blit",
"pygame.display.set_mode",
"pygame.transform.smoothscale",
"pygame.display.flip",
"numpy.linspace",
"pygame.freetype.init",
"pygame.image.load",
"pygame.Rect",
"random.randint"... | [((13983, 13996), 'pygame.init', 'pygame.init', ([], {}), '()\n', (13994, 13996), False, 'import pygame\n'), ((14002, 14045), 'pygame.freetype.init', 'freetype.init', ([], {'cache_size': '(64)', 'resolution': '(72)'}), '(cache_size=64, resolution=72)\n', (14015, 14045), False, 'from pygame import freetype\n'), ((14064,... |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'demoTabWidget.ui'
#
# Created by: PyQt5 UI code generator 5.6
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_Dialog(object):
def setupUi(self, Dialog):
D... | [
"PyQt5.QtWidgets.QWidget",
"PyQt5.QtWidgets.QLineEdit",
"PyQt5.QtGui.QFont",
"PyQt5.QtCore.QMetaObject.connectSlotsByName",
"PyQt5.QtWidgets.QRadioButton",
"PyQt5.QtWidgets.QDialog",
"PyQt5.QtCore.QRect",
"PyQt5.QtWidgets.QLabel",
"PyQt5.QtWidgets.QApplication",
"PyQt5.QtWidgets.QTabWidget",
"Py... | [((6486, 6518), 'PyQt5.QtWidgets.QApplication', 'QtWidgets.QApplication', (['sys.argv'], {}), '(sys.argv)\n', (6508, 6518), False, 'from PyQt5 import QtCore, QtGui, QtWidgets\n'), ((6533, 6552), 'PyQt5.QtWidgets.QDialog', 'QtWidgets.QDialog', ([], {}), '()\n', (6550, 6552), False, 'from PyQt5 import QtCore, QtGui, QtWi... |
#!/usr/bin/python3
# Copyright (c) 2022 Seagate Technology LLC and/or its Affiliates
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option... | [
"time.sleep",
"cortx.utils.common.ExponentialBackoff",
"cortx.utils.conf_store.Conf.delete",
"os.remove",
"os.path.exists",
"cortx.utils.log.Log.debug",
"cortx.rgw.const.SVC_CONFIG_DICT.items",
"cortx.utils.conf_store.Conf.load",
"cortx.utils.validator.v_pkg.PkgV",
"cortx.rgw.setup.error.SetupErro... | [((12789, 12837), 'cortx.utils.common.ExponentialBackoff', 'ExponentialBackoff', ([], {'exception': 'Exception', 'tries': '(4)'}), '(exception=Exception, tries=4)\n', (12807, 12837), False, 'from cortx.utils.common import ExponentialBackoff\n'), ((1815, 1866), 'cortx.utils.log.Log.info', 'Log.info', (['f"""validations ... |
# Copyright (c) 2019 Uber Technologies, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed... | [
"hypothesis.extra.numpy.order_check",
"hypothesis.strategies.builds",
"hypothesis.strategies.fixed_dictionaries",
"hypothesis.strategies.integers",
"hypothesis.extra.numpy.arrays",
"hypothesis.strategies.just",
"collections.defaultdict",
"hypothesis.internal.validation.check_valid_bound",
"numpy.bro... | [((2688, 2721), 'hypothesis.internal.validation.check_valid_bound', 'check_valid_bound', (['min_size', 'name'], {}), '(min_size, name)\n', (2705, 2721), False, 'from hypothesis.internal.validation import check_type, check_valid_bound\n'), ((2726, 2759), 'hypothesis.internal.validation.check_valid_bound', 'check_valid_b... |
import os
import sys
import re
sys.path.insert(0, os.path.abspath('..'))
sys.path.append(os.path.abspath('extensions'))
project = 'slate.py'
copyright = '2020-Present, Axel#3456'
author = 'Axel#3456'
with open(os.path.abspath(os.path.join(os.path.dirname(__file__), '../slate/__init__.py'))) as f:
version = re.se... | [
"os.path.abspath",
"os.path.dirname"
] | [((51, 72), 'os.path.abspath', 'os.path.abspath', (['""".."""'], {}), "('..')\n", (66, 72), False, 'import os\n'), ((90, 119), 'os.path.abspath', 'os.path.abspath', (['"""extensions"""'], {}), "('extensions')\n", (105, 119), False, 'import os\n'), ((242, 267), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '... |
#!/usr/bin/python
#
# Author: <NAME> (<EMAIL>)
# Date: 19th May 2016
# Fusion Tables API:
# https://developers.google.com/resources/api-libraries/documentation/fusiontables/v2/python/latest/index.html
"""
Includes functions to integrate with Google Fusion Tables. The results and implementation is based on the API
provi... | [
"logging.getLogger",
"os.path.exists",
"csv.DictWriter",
"traceback.format_exc",
"pykml.factory.KML_ElementMaker.MultiGeometry",
"threading.current_thread",
"os.makedirs",
"pykml.factory.KML_ElementMaker.Polygon",
"colorker.security.CredentialManager.get_fusion_tables_service",
"googleapiclient.ht... | [((844, 871), 'logging.getLogger', 'logging.getLogger', (['"""worker"""'], {}), "('worker')\n", (861, 871), False, 'import logging\n'), ((2041, 2099), 'colorker.security.CredentialManager.get_fusion_tables_service', 'CredentialManager.get_fusion_tables_service', (['user_settings'], {}), '(user_settings)\n', (2084, 2099... |
""" Microservice to fetch nexrad data from aws s3 """
import os
from fastapi import FastAPI, HTTPException
import nexradaws
import uvicorn
import pyart
from matplotlib import pyplot as plt
import base64
from cachetools import cached, TTLCache
import logging
from datasource_service.response_model import ResponseModel
... | [
"logging.basicConfig",
"logging.getLogger",
"fastapi.FastAPI",
"os.listdir",
"matplotlib.pyplot.savefig",
"uvicorn.run",
"fastapi.HTTPException",
"os.path.join",
"os.getcwd",
"cachetools.TTLCache",
"nexradaws.NexradAwsInterface",
"matplotlib.pyplot.switch_backend",
"pyart.graph.RadarDisplay"... | [((321, 342), 'logging.basicConfig', 'logging.basicConfig', ([], {}), '()\n', (340, 342), False, 'import logging\n'), ((352, 371), 'logging.getLogger', 'logging.getLogger', ([], {}), '()\n', (369, 371), False, 'import logging\n'), ((662, 711), 'fastapi.FastAPI', 'FastAPI', ([], {'title': '"""Datasource-api"""', 'descri... |
import sys
import json
import matplotlib.pyplot as plt
def logplot(x,y):
plt.semilogx(x,y)
plt.title("TS for sphere with 2m radius")
plt.xlabel("Frequency [Hz]")
plt.ylabel("TS [dB]")
plt.grid(True, which="both")
filename = sys.argv[1]
with open(filename, 'r') as f:
read_data = f.read()
j... | [
"json.loads",
"matplotlib.pyplot.grid",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.semilogx",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.title",
"matplotlib.pyplot.show"
] | [((78, 96), 'matplotlib.pyplot.semilogx', 'plt.semilogx', (['x', 'y'], {}), '(x, y)\n', (90, 96), True, 'import matplotlib.pyplot as plt\n'), ((100, 141), 'matplotlib.pyplot.title', 'plt.title', (['"""TS for sphere with 2m radius"""'], {}), "('TS for sphere with 2m radius')\n", (109, 141), True, 'import matplotlib.pypl... |
# -*- coding: utf-8 -*-
##########################################################################
# 2010-2017 Webkul.
#
# NOTICE OF LICENSE
#
# All right is reserved,
# Please go through this link for complete license : https://store.webkul.com/license.html
#
# DISCLAIMER
#
# Do not edit or add to this file if you wis... | [
"logging.getLogger",
"odoo.fields.Char",
"odoo.fields.Many2one",
"odoo.fields.Boolean"
] | [((957, 984), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (974, 984), False, 'import logging\n'), ((1849, 1894), 'odoo.fields.Boolean', 'fields.Boolean', ([], {'string': '"""Auto Product Approve"""'}), "(string='Auto Product Approve')\n", (1863, 1894), False, 'from odoo import models, ... |
from random import randint
# Defines variables
COUNT = 5
running_game = True
while running_game:
# Sets limits
lower_limit_input = input("Lower lim pls:")
upper_limit_input = input("Upper lim pls:")
# Checks if inputs are numerical
if lower_limit_input.isnumeric() and upper_limit_input.isnumeric(... | [
"random.randint"
] | [((588, 621), 'random.randint', 'randint', (['lower_limit', 'upper_limit'], {}), '(lower_limit, upper_limit)\n', (595, 621), False, 'from random import randint\n')] |
# Copyright 2021-2022 <NAME>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | [
"logging.getLogger",
"logging.basicConfig",
"os.path.exists",
"os.path.join",
"os.path.splitext",
"os.path.isfile",
"sys.stderr.write",
"os.path.dirname",
"os.path.isdir",
"sys.exit",
"re.sub",
"re.search"
] | [((659, 687), 'logging.getLogger', 'logging.getLogger', (['"""luaknit"""'], {}), "('luaknit')\n", (676, 687), False, 'import logging\n'), ((688, 766), 'logging.basicConfig', 'logging.basicConfig', ([], {'format': '"""[%(levelname)s] %(message)s"""', 'level': 'logging.DEBUG'}), "(format='[%(levelname)s] %(message)s', le... |
# general libraries
import warnings
import numpy as np
# image processing libraries
from scipy import ndimage
from skimage.transform import radon
from skimage.measure.fit import _dynamic_max_trials
from ..generic.test_tools import \
construct_phase_plane, cross_spectrum_to_coordinate_list
from ..generic.data_tool... | [
"numpy.radians",
"numpy.random.default_rng",
"numpy.argsort",
"numpy.array",
"numpy.sin",
"scipy.ndimage.rotate",
"numpy.imag",
"numpy.arange",
"numpy.multiply",
"numpy.real",
"numpy.dot",
"numpy.linalg.lstsq",
"numpy.linalg.eigh",
"numpy.argmin",
"numpy.remainder",
"numpy.round",
"n... | [((622, 634), 'numpy.array', 'np.array', (['[]'], {}), '([])\n', (630, 634), True, 'import numpy as np\n'), ((653, 665), 'numpy.array', 'np.array', (['[]'], {}), '([])\n', (661, 665), True, 'import numpy as np\n'), ((670, 682), 'numpy.array', 'np.array', (['[]'], {}), '([])\n', (678, 682), True, 'import numpy as np\n')... |
#
# Copyright 2017 Wooga GmbH
#
# 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, publish, distribute... | [
"datetime.datetime.now",
"karajan.conductor.Conductor",
"mock.MagicMock",
"tests.helpers.config.ConfigHelper"
] | [((1408, 1419), 'mock.MagicMock', 'MagicMock', ([], {}), '()\n', (1417, 1419), False, 'from mock import MagicMock\n'), ((1440, 1454), 'tests.helpers.config.ConfigHelper', 'ConfigHelper', ([], {}), '()\n', (1452, 1454), False, 'from tests.helpers.config import ConfigHelper\n'), ((1513, 1533), 'karajan.conductor.Conducto... |
#!/usr/bin/env python
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# This script computs the number of concurrent links we want to run in the build
# as a function of machine spec. It's based on GetDefa... | [
"subprocess.check_output",
"os.path.exists",
"ctypes.byref",
"argparse.ArgumentParser",
"os.getenv",
"re.compile",
"sys.platform.startswith",
"multiprocessing.cpu_count",
"os.path.dirname",
"gn_helpers.ToGNString",
"ctypes.sizeof"
] | [((3538, 3563), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (3561, 3563), False, 'import argparse\n'), ((508, 533), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (523, 533), False, 'import os\n'), ((1341, 1373), 'sys.platform.startswith', 'sys.platform.startswith'... |
import logging
import os
from aiogram import Bot, Dispatcher, types
from aiogram.contrib.fsm_storage.memory import MemoryStorage
from data import config
# these paths will be used in the handlers files
cwd = os.getcwd()
input_path = os.path.join(cwd, "user_files", "input")
output_path = os.path.join(cwd, "user_files... | [
"logging.basicConfig",
"aiogram.contrib.fsm_storage.memory.MemoryStorage",
"os.path.join",
"aiogram.Dispatcher",
"os.getcwd",
"aiogram.Bot"
] | [((211, 222), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (220, 222), False, 'import os\n'), ((236, 276), 'os.path.join', 'os.path.join', (['cwd', '"""user_files"""', '"""input"""'], {}), "(cwd, 'user_files', 'input')\n", (248, 276), False, 'import os\n'), ((291, 332), 'os.path.join', 'os.path.join', (['cwd', '"""user_... |
from server.models import Actor, Videos
from server.models import Relationship_Videos, Relationship_Actor_Videos
from datetime import datetime
from sqlalchemy import func
from server import db
import json
class DBYouTube:
def get_all_actors_name():
with open('config/actors.json') as data_file:
... | [
"server.db.session.commit",
"server.models.Videos",
"datetime.datetime.strptime",
"server.models.Actor.collected_date.desc",
"server.models.Actor",
"server.models.Relationship_Videos",
"json.load",
"server.db.session.query",
"server.db.session.add",
"sqlalchemy.func.lower",
"server.models.Relati... | [((4460, 4968), 'server.models.Actor', 'Actor', ([], {'actor_name': "item['actor_name']", 'actor_username': "item['actor_username']", 'channel_id': "item['channel_id']", 'title': "item['title']", 'subscribers': "item['subscribers']", 'video_count': "item['video_count']", 'view_count': "item['view_count']", 'created_dat... |
from funcparserlib.parser import skip
from funcparserlib.parser import some
from funcparserlib.parser import forward_decl
from funcparserlib.parser import finished
from funcparserlib.parser import NoParseError
from funcparserlib.lexer import make_tokenizer
from funcparserlib.lexer import LexerError
import itertools
fr... | [
"itertools.chain",
"funcparserlib.parser.some",
"collections.defaultdict",
"funcparserlib.parser.forward_decl",
"funcparserlib.lexer.make_tokenizer"
] | [((877, 913), 'funcparserlib.lexer.make_tokenizer', 'make_tokenizer', (['property_lexer_specs'], {}), '(property_lexer_specs)\n', (891, 913), False, 'from funcparserlib.lexer import make_tokenizer\n'), ((939, 969), 'funcparserlib.parser.some', 'some', (['(lambda x: x.type == code)'], {}), '(lambda x: x.type == code)\n'... |
"""
Plots mooring records.
Specific to a request from <NAME>, 2020_11.
"""
# setup
import netCDF4 as nc
import matplotlib.pyplot as plt
import numpy as np
import matplotlib.dates as mdates
from datetime import datetime
import os; import sys
sys.path.append(os.path.abspath('../alpha'))
import Lfun
import zfun
Ldir... | [
"numpy.nanmean",
"matplotlib.dates.DayLocator",
"numpy.sin",
"datetime.datetime",
"netCDF4.Dataset",
"matplotlib.pyplot.close",
"numpy.rad2deg",
"matplotlib.dates.num2date",
"Lfun.modtime_to_mdate_vec",
"matplotlib.dates.DateFormatter",
"zfun.filt_hanning_mat",
"numpy.cos",
"matplotlib.pyplo... | [((323, 336), 'Lfun.Lstart', 'Lfun.Lstart', ([], {}), '()\n', (334, 336), False, 'import Lfun\n'), ((664, 678), 'netCDF4.Dataset', 'nc.Dataset', (['fn'], {}), '(fn)\n', (674, 678), True, 'import netCDF4 as nc\n'), ((733, 766), 'Lfun.modtime_to_mdate_vec', 'Lfun.modtime_to_mdate_vec', (['ot_vec'], {}), '(ot_vec)\n', (75... |
# Original von F-Secure (mqtt_fuzz)
# 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 writ... | [
"os.listdir",
"os.path.join",
"os.path.isdir",
"tempfile.mkdtemp",
"shutil.rmtree",
"time.gmtime"
] | [((2951, 2969), 'tempfile.mkdtemp', 'tempfile.mkdtemp', ([], {}), '()\n', (2967, 2969), False, 'import tempfile\n'), ((3597, 3628), 'os.listdir', 'os.listdir', (['fuzz_case_directory'], {}), '(fuzz_case_directory)\n', (3607, 3628), False, 'import os\n'), ((3765, 3799), 'shutil.rmtree', 'shutil.rmtree', (['fuzz_case_dir... |
# -*- coding: utf-8 -*-
import tensorflow as tf
from tensorflow.python.platform import gfile
import attention
import content_functions
import decoders
import nmt_models
def create_seq2seq_model(session, forward_only, model_path=None, use_best=False, FLAGS=None, buckets=None, translate=False):
"""Create translati... | [
"tensorflow.initialize_all_variables",
"content_functions.get_decoder_content_f",
"nmt_models.Seq2SeqModel",
"content_functions.get_content_f",
"tensorflow.train.get_checkpoint_state",
"nmt_models.NMTModel",
"attention.get_attention_f",
"tensorflow.python.platform.gfile.Exists"
] | [((1407, 1454), 'attention.get_attention_f', 'attention.get_attention_f', (['FLAGS.attention_type'], {}), '(FLAGS.attention_type)\n', (1432, 1454), False, 'import attention\n'), ((1478, 1533), 'content_functions.get_content_f', 'content_functions.get_content_f', (['FLAGS.content_function'], {}), '(FLAGS.content_functio... |
from __future__ import print_function
import pathlib
import base64
from builtins import object
from builtins import str
from typing import Dict
from empire.server.common import helpers
from empire.server.common.module_models import PydanticModule
from empire.server.utils import data_util
from empire.server.utils.modu... | [
"pathlib.Path",
"empire.server.common.helpers.encode_base64",
"builtins.str",
"empire.server.utils.data_util.obfuscate",
"empire.server.utils.data_util.keyword_obfuscation"
] | [((3551, 3588), 'empire.server.utils.data_util.keyword_obfuscation', 'data_util.keyword_obfuscation', (['script'], {}), '(script)\n', (3580, 3588), False, 'from empire.server.utils import data_util\n'), ((2372, 2499), 'empire.server.utils.data_util.obfuscate', 'data_util.obfuscate', ([], {'installPath': 'main_menu.inst... |
import zmq
import sys
import threading
import time
from random import randint, random
def tprint(msg):
"""like print, but won't get newlines confused with multiple threads"""
sys.stdout.write(msg + '\n')
sys.stdout.flush()
class ServerTask(threading.Thread):
"""ServerTask"""
def __init__(self):
... | [
"threading.Thread.__init__",
"zmq.proxy",
"sys.stdout.flush",
"zmq.Context",
"random.randint",
"sys.stdout.write"
] | [((184, 212), 'sys.stdout.write', 'sys.stdout.write', (["(msg + '\\n')"], {}), "(msg + '\\n')\n", (200, 212), False, 'import sys\n'), ((217, 235), 'sys.stdout.flush', 'sys.stdout.flush', ([], {}), '()\n', (233, 235), False, 'import sys\n'), ((326, 357), 'threading.Thread.__init__', 'threading.Thread.__init__', (['self'... |
import humanfriendly
import datetime
def duration_to_date(duration: str) -> datetime.timedelta:
seconds = humanfriendly.parse_timespan(duration)
return datetime.timedelta(seconds=seconds)
| [
"humanfriendly.parse_timespan",
"datetime.timedelta"
] | [((112, 150), 'humanfriendly.parse_timespan', 'humanfriendly.parse_timespan', (['duration'], {}), '(duration)\n', (140, 150), False, 'import humanfriendly\n'), ((162, 197), 'datetime.timedelta', 'datetime.timedelta', ([], {'seconds': 'seconds'}), '(seconds=seconds)\n', (180, 197), False, 'import datetime\n')] |
import pytest
from django.conf import settings
from requests import put
from grandchallenge.uploads.models import UserUpload
from tests.algorithms_tests.factories import AlgorithmImageFactory
from tests.factories import UserFactory
from tests.verification_tests.factories import VerificationFactory
@pytest.mark.djang... | [
"tests.factories.UserFactory.build",
"tests.verification_tests.factories.VerificationFactory",
"grandchallenge.uploads.models.UserUpload",
"tests.factories.UserFactory",
"grandchallenge.uploads.models.UserUpload.objects.filter",
"grandchallenge.uploads.models.UserUpload.objects.create",
"tests.algorithm... | [((387, 400), 'tests.factories.UserFactory', 'UserFactory', ([], {}), '()\n', (398, 400), False, 'from tests.factories import UserFactory\n'), ((470, 525), 'grandchallenge.uploads.models.UserUpload.objects.create', 'UserUpload.objects.create', ([], {'creator': 'u', 'filename': 'filename'}), '(creator=u, filename=filena... |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.6 on 2018-01-15 17:43
from __future__ import unicode_literals
from django.db import migrations, models
import uuid
class Migration(migrations.Migration):
dependencies = [
('calls', '0002_auto_20171109_0100'),
]
operations = [
migrations... | [
"django.db.models.CharField",
"django.db.models.UUIDField",
"django.db.models.BooleanField"
] | [((411, 445), 'django.db.models.BooleanField', 'models.BooleanField', ([], {'default': '(False)'}), '(default=False)\n', (430, 445), False, 'from django.db import migrations, models\n'), ((570, 604), 'django.db.models.BooleanField', 'models.BooleanField', ([], {'default': '(False)'}), '(default=False)\n', (589, 604), F... |
##Author: CORSHINE
##################################################
## / ___/ _ \| _ \/ ___|| | | |_ _| \ | | ____|##
##| | | | | | |_) \___ \| |_| || || \| | _| ##
##| |__| |_| | _ < ___) | _ || || |\ | |___ ##
## \____\___/|_| \_\____/|_| |_|___|_| \_|_____|##
##############################################... | [
"socket.gethostbyname",
"json.loads",
"requests.get",
"sys.exit"
] | [((471, 509), 'requests.get', 'requests.get', (["('https://' + sys.argv[1])"], {}), "('https://' + sys.argv[1])\n", (483, 509), False, 'import requests\n'), ((551, 584), 'socket.gethostbyname', 'socket.gethostbyname', (['sys.argv[1]'], {}), '(sys.argv[1])\n', (571, 584), False, 'import socket\n'), ((677, 734), 'request... |
import string
import re
import time
import math
import urllib.request
from urllib.request import urlopen
from json import loads
from Socket import openSocket, sendMessage
from Initialize import joinRoom
from Read import getUser, getMessage, getChannel
from Settings import COOLDOWN, IDENT, ADMIN, CLIENT_ID
from Games im... | [
"Socket.openSocket",
"Read.getUser",
"json.loads",
"math.floor",
"Read.getChannel",
"Socket.sendMessage",
"Read.getMessage",
"Initialize.joinRoom",
"time.time"
] | [((46768, 46780), 'Socket.openSocket', 'openSocket', ([], {}), '()\n', (46778, 46780), False, 'from Socket import openSocket, sendMessage\n'), ((46781, 46792), 'Initialize.joinRoom', 'joinRoom', (['s'], {}), '(s)\n', (46789, 46792), False, 'from Initialize import joinRoom\n'), ((836, 851), 'json.loads', 'loads', (['rea... |
from graph_builder.parse_osm_xml import *
from local_calculations.calculate_path import compute_distance_mi
import json
def build_directed_graph(nodes, ways):
faulty_roads = {"Chinquapin Road"}
for way in ways:
if way.name in faulty_roads:
continue
for i in range(1, len(way.nod... | [
"json.dumps",
"local_calculations.calculate_path.compute_distance_mi"
] | [((670, 763), 'local_calculations.calculate_path.compute_distance_mi', 'compute_distance_mi', (['node_a.latitude', 'node_a.longitude', 'node_b.latitude', 'node_b.longitude'], {}), '(node_a.latitude, node_a.longitude, node_b.latitude,\n node_b.longitude)\n', (689, 763), False, 'from local_calculations.calculate_path ... |