code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
''' Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
Created on Feb 24, 2014
@author: dfleck
'''
import math
class FingerEntry:
'''Represents an entry in the finger table.
Note: Finger indexes go from 0-->m-1 which is different than the
C... | [
"math.pow"
] | [((652, 678), 'math.pow', 'math.pow', (['(2)', 'FingerEntry.m'], {}), '(2, FingerEntry.m)\n', (660, 678), False, 'import math\n'), ((704, 722), 'math.pow', 'math.pow', (['(2)', '(k - 1)'], {}), '(2, k - 1)\n', (712, 722), False, 'import math\n'), ((805, 819), 'math.pow', 'math.pow', (['(2)', 'k'], {}), '(2, k)\n', (813... |
from leapp.actors import Actor
from leapp.libraries.actor import readopensshconfig
from leapp.models import OpenSshConfig
from leapp.tags import FactsPhaseTag, IPUWorkflowTag
class OpenSshConfigScanner(Actor):
"""
Collect information about the OpenSSH configuration.
Currently supporting the following opt... | [
"leapp.libraries.actor.readopensshconfig.scan_sshd"
] | [((594, 635), 'leapp.libraries.actor.readopensshconfig.scan_sshd', 'readopensshconfig.scan_sshd', (['self.produce'], {}), '(self.produce)\n', (621, 635), False, 'from leapp.libraries.actor import readopensshconfig\n')] |
from subprocess import Popen, PIPE
def shell(cmd, shell=False):
if shell:
p = Popen(cmd, shell=True, stdin=PIPE, stdout=PIPE, stderr=PIPE)
else:
cmd = cmd.split()
p = Popen(cmd, stdin=PIPE, stdout=PIPE, stderr=PIPE)
output, err = p.communicate()
return output
| [
"subprocess.Popen"
] | [((93, 153), 'subprocess.Popen', 'Popen', (['cmd'], {'shell': '(True)', 'stdin': 'PIPE', 'stdout': 'PIPE', 'stderr': 'PIPE'}), '(cmd, shell=True, stdin=PIPE, stdout=PIPE, stderr=PIPE)\n', (98, 153), False, 'from subprocess import Popen, PIPE\n'), ((202, 250), 'subprocess.Popen', 'Popen', (['cmd'], {'stdin': 'PIPE', 'st... |
# Generated by Django 3.1.4 on 2020-12-22 07:46
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
import question.models
class Migration(migrations.Migration):
initial = True
dependencies = [
('core', '0001_initial'),
]
operations = [
... | [
"django.db.models.FileField",
"django.db.models.TextField",
"django.db.models.CharField",
"django.db.models.ForeignKey",
"django.db.models.BooleanField",
"django.db.models.AutoField",
"django.db.models.IntegerField"
] | [((424, 490), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(10)', 'primary_key': '(True)', 'serialize': '(False)'}), '(max_length=10, primary_key=True, serialize=False)\n', (440, 490), False, 'from django.db import migrations, models\n'), ((518, 549), 'django.db.models.CharField', 'models.Char... |
"""
Deletes files in a directory that is not a photo.
"""
import logging
from PIL import Image
import pathlib
def check_image_with_pil(path: pathlib.Path) -> bool:
"""
Checks if the path is an image.
:param pathlib.Path path: path to check the image of
:return: true if the path is an image.
:rt... | [
"pathlib.Path",
"argparse.ArgumentParser",
"logging.getLogger",
"PIL.Image.open"
] | [((1210, 1299), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Deletes files which cannot be parsed by EXIF."""'}), "(description=\n 'Deletes files which cannot be parsed by EXIF.')\n", (1233, 1299), False, 'import argparse\n'), ((1743, 1769), 'pathlib.Path', 'pathlib.Path', (['args.s... |
# Copyright 2015 Observable Networks
#
# 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 ... | [
"utils.utcnow",
"snmp_handler.SnmpHandler",
"utils.persistent_dict",
"json.dumps",
"time.sleep",
"logging.Formatter",
"os.environ.get",
"socket.gethostname",
"logging.handlers.SysLogHandler",
"logging.getLogger"
] | [((1061, 1080), 'logging.getLogger', 'getLogger', (['__name__'], {}), '(__name__)\n', (1070, 1080), False, 'from logging import getLogger, DEBUG, Formatter\n'), ((2536, 2556), 'logging.getLogger', 'getLogger', (['"""obsrvbl"""'], {}), "('obsrvbl')\n", (2545, 2556), False, 'from logging import getLogger, DEBUG, Formatte... |
from django.urls import include, path
from catalog.admin import admin_site
from django.contrib.auth import logout
from django.conf import settings
from . import views
app_name="catalog"
urlpatterns = [
path('', views.HomeView.as_view(), name='home'),
path('accounts/login/', views.LoginView.as_view(), name='l... | [
"django.urls.path",
"django.urls.include"
] | [((332, 401), 'django.urls.path', 'path', (['"""accounts/logout/"""', 'views.LogoutView.logout_user'], {'name': '"""logout"""'}), "('accounts/logout/', views.LogoutView.logout_user, name='logout')\n", (336, 401), False, 'from django.urls import include, path\n'), ((407, 438), 'django.urls.path', 'path', (['"""admin/"""... |
"""
Copyright (c) 2011, <NAME>.
License: MIT (see http://www.opensource.org/licenses/mit-license.php for details)
URL: http://www.gtsystem.eu/blog/2011/11/bottle-decorator-for-validate-query-parameters/
"""
from bottle import request
import functools
import inspect
def checkParams(**types):
def decorate(f):
... | [
"inspect.getargspec",
"functools.wraps"
] | [((349, 370), 'inspect.getargspec', 'inspect.getargspec', (['f'], {}), '(f)\n', (367, 370), False, 'import inspect\n'), ((594, 612), 'functools.wraps', 'functools.wraps', (['f'], {}), '(f)\n', (609, 612), False, 'import functools\n')] |
import datetime
import enum
import typing
import uuid
import pydantic
from .color import Color
from .number import Number
from .parent import DatabaseParents
from .rich_text import RichText
class NumberProperty(pydantic.BaseModel):
id: str
name: str
type: typing.Literal["number"] = "number"
number: ... | [
"pydantic.Field"
] | [((1047, 1083), 'pydantic.Field', 'pydantic.Field', ([], {'default_factory': 'dict'}), '(default_factory=dict)\n', (1061, 1083), False, 'import pydantic\n'), ((1293, 1329), 'pydantic.Field', 'pydantic.Field', ([], {'default_factory': 'dict'}), '(default_factory=dict)\n', (1307, 1329), False, 'import pydantic\n'), ((156... |
import uuid
from calm.dsl.builtins import Job, JobScheduler
start_date_time = "2050-10-08 16:17:15"
expiry_date_time = "2050-10-09 00:17:00"
cron = "15 1 32 * *"
time_zone = "America/Jamaica"
RUNBOOK_NAME = "invalid_cron_recurring"
class JobInvalidRecurringSpec(Job):
"""Recurring Job for Executing a Runbook wi... | [
"calm.dsl.builtins.JobScheduler.Exec.runbook",
"uuid.uuid4",
"calm.dsl.builtins.JobScheduler.ScheduleInfo.recurring"
] | [((430, 521), 'calm.dsl.builtins.JobScheduler.ScheduleInfo.recurring', 'JobScheduler.ScheduleInfo.recurring', (['cron', 'start_date_time', 'expiry_date_time', 'time_zone'], {}), '(cron, start_date_time, expiry_date_time,\n time_zone)\n', (465, 521), False, 'from calm.dsl.builtins import Job, JobScheduler\n'), ((549,... |
import sys
from PyQt5.uic import loadUi
import PyQt5.QtCore as QtCore
from PyQt5.QtWidgets import QDialog, QApplication, QStackedWidget, QFileDialog, QProgressBar, QTableWidget, \
QAbstractItemView, QPushButton, QDesktopWidget, QTableWidgetItem
from transformers import AutoTokenizer
import re
import emoji
from soyn... | [
"PyQt5.QtWidgets.QProgressBar",
"PyQt5.QtWidgets.QDesktopWidget",
"PyQt5.QtWidgets.QTableWidget",
"soynlp.normalizer.repeat_normalize",
"PyQt5.QtWidgets.QPushButton",
"PyQt5.uic.loadUi",
"PyQt5.QtWidgets.QFileDialog.getOpenFileName",
"transformers.AutoTokenizer.from_pretrained",
"PyQt5.QtWidgets.QTa... | [((440, 497), 're.compile', 're.compile', (["f'[^ .,?!/@$%~%·∼()\\x00-\\x7fㄱ-ㅣ가-힣{emojis}]+'"], {}), "(f'[^ .,?!/@$%~%·∼()\\x00-\\x7fㄱ-ㅣ가-힣{emojis}]+')\n", (450, 497), False, 'import re\n'), ((512, 644), 're.compile', 're.compile', (['"""https?:\\\\/\\\\/(www\\\\.)?[-a-zA-Z0-9@:%._\\\\+~#=]{1,256}\\\\.[a-zA-Z0-9()]{1,6... |
from keras.models import load_model
from sklearn.externals import joblib
from keras.preprocessing.sequence import pad_sequences
import os
current_directory = os.getcwd()
file_name = "CNN__31_05_2020__20_33.h5"
tokenizer_name = "tokenizer_31_05_2020__20_45.pkl"
input_path = "\\".join([current_directory, "models", file... | [
"os.getcwd",
"keras.models.load_model",
"keras.preprocessing.sequence.pad_sequences",
"sklearn.externals.joblib.load"
] | [((160, 171), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (169, 171), False, 'import os\n'), ((420, 447), 'sklearn.externals.joblib.load', 'joblib.load', (['tokenizer_path'], {}), '(tokenizer_path)\n', (431, 447), False, 'from sklearn.externals import joblib\n'), ((456, 478), 'keras.models.load_model', 'load_model', ([... |
#! /usr/bin/python3
from flask import abort, jsonify
from json import loads
carreras = ("Sistemas", "Derecho", "Actuaría", "Arquitectura", "Administración")
orden = ('nombre', 'primer_apellido', 'segundo_apellido', 'carrera','semestre', 'promedio', 'al_corriente')
campos = {'cuenta': (int, True), 'nombre': (str, True... | [
"flask.jsonify",
"flask.abort",
"json.loads"
] | [((2186, 2204), 'flask.jsonify', 'jsonify', (['candidato'], {}), '(candidato)\n', (2193, 2204), False, 'from flask import abort, jsonify\n'), ((1658, 1673), 'json.loads', 'loads', (['peticion'], {}), '(peticion)\n', (1663, 1673), False, 'from json import loads\n'), ((2077, 2087), 'flask.abort', 'abort', (['(400)'], {})... |
import contextlib
import logging
from time import time_ns
from types import SimpleNamespace
import warnings
import ipywidgets as widgets
from IPython.display import display
import lightkurve_ext as lke
import lightkurve_ext_tls as lke_tls
import lightkurve_ext_pg as lke_pg
def _current_time_millis():
return ti... | [
"lightkurve_ext_pg.errorbar_transit_depth",
"lightkurve_ext_pg.validate_tls_n_report",
"lightkurve_ext_pg.validate_bls_n_report",
"lightkurve_ext_pg.plot_lc_with_model",
"warnings.filterwarnings",
"IPython.display.display",
"ipywidgets.Output",
"lightkurve_ext_pg.plot_pg_n_mark_max",
"lightkurve_ext... | [((2627, 2790), 'types.SimpleNamespace', 'SimpleNamespace', ([], {'pg': 'pg', 'lc': 'lc', 'ax_pg': 'ax_pg', 'ax_lc_model_1': 'ax_lc_model_1', 'ax_lc_model_2': 'ax_lc_model_2', 'ax_lc_model_f': 'ax_lc_model_f', 'ax_tt_depth': 'ax_tt_depth'}), '(pg=pg, lc=lc, ax_pg=ax_pg, ax_lc_model_1=ax_lc_model_1,\n ax_lc_model_2=a... |
import logging
log = logging.getLogger(__name__)
log.setLevel(logging.DEBUG)
def start_action(payload, channels, ws):
# extract all of the data that we need
channel = payload.get("channel")
action = payload.get("action")
rate = payload.get("rate")
cutoff_voltage = payload.get("cutoffVoltage")
... | [
"logging.getLogger"
] | [((22, 49), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (39, 49), False, 'import logging\n')] |
# -*- coding: utf-8 -*-
"""S3 utils."""
import gzip
from typing import Optional
import boto3
def get_s3(aws_access_key, aws_secret_access_key):
"""Get S3 connections."""
s3 = boto3.client('s3', aws_access_key_id=aws_access_key,
aws_secret_access_key=aws_secret_access_key)
return s3... | [
"boto3.resource",
"boto3.client"
] | [((187, 289), 'boto3.client', 'boto3.client', (['"""s3"""'], {'aws_access_key_id': 'aws_access_key', 'aws_secret_access_key': 'aws_secret_access_key'}), "('s3', aws_access_key_id=aws_access_key, aws_secret_access_key=\n aws_secret_access_key)\n", (199, 289), False, 'import boto3\n'), ((428, 531), 'boto3.resource', '... |
#! python
#-*- coding: utf-8 -*-
import requests
import json
class Vendo:
def __init__(self, url_api):
self.setHeader({'Content-Type' : 'application/json', "Content-Length" : "length"})
self.setApi(url_api)
def setApi(self,api_url):
self.API_URL = api_url
def setHeader(self, api... | [
"requests.post"
] | [((482, 548), 'requests.post', 'requests.post', (['req_url'], {'json': 'request_data', 'headers': 'self.API_HEADER'}), '(req_url, json=request_data, headers=self.API_HEADER)\n', (495, 548), False, 'import requests\n')] |
"""
Http Server for our API
"""
from flask import Flask, jsonify, request
from controller import product_controller
app = Flask(__name__)
def serialize(products):
return list(map(lambda p: p.serialize(), products))
@app.route("/product/<name>")
def get_product(name: str):
return jsonify({"product": produ... | [
"controller.product_controller.change",
"controller.product_controller.get",
"controller.product_controller.delete_by_id",
"flask.Flask",
"controller.product_controller.save",
"flask.request.json.get",
"controller.product_controller.get_by_name"
] | [((125, 140), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (130, 140), False, 'from flask import Flask, jsonify, request\n'), ((562, 586), 'flask.request.json.get', 'request.json.get', (['"""name"""'], {}), "('name')\n", (578, 586), False, 'from flask import Flask, jsonify, request\n'), ((598, 622), 'fla... |
from torch.nn.modules.loss import _Loss
from torch.autograd import Variable
import torch
import time
import numpy as np
import torch.nn as nn
import random
import copy
import math
CEloss = nn.CrossEntropyLoss()
def loss_calculation(semantic, target):
bs = semantic.size()[0]
pix_num = 480 * 640
... | [
"torch.nn.CrossEntropyLoss"
] | [((200, 221), 'torch.nn.CrossEntropyLoss', 'nn.CrossEntropyLoss', ([], {}), '()\n', (219, 221), True, 'import torch.nn as nn\n')] |
from hdlConvertorAst.hdlAst import HdlOp, HdlValueId, HdlFunctionDef, HdlOpType
from hdlConvertorAst.to.hdl_ast_modifier import HdlAstModifier
from hdlConvertorAst.translate.verilog_to_basic_hdl_sim_model.utils import hdl_call
class AddCallOperatorForCallWithoutParenthesis(HdlAstModifier):
"""
Verilog functio... | [
"hdlConvertorAst.to.hdl_ast_modifier.HdlAstModifier.__init__",
"hdlConvertorAst.translate.verilog_to_basic_hdl_sim_model.utils.hdl_call"
] | [((529, 558), 'hdlConvertorAst.to.hdl_ast_modifier.HdlAstModifier.__init__', 'HdlAstModifier.__init__', (['self'], {}), '(self)\n', (552, 558), False, 'from hdlConvertorAst.to.hdl_ast_modifier import HdlAstModifier\n'), ((1377, 1392), 'hdlConvertorAst.translate.verilog_to_basic_hdl_sim_model.utils.hdl_call', 'hdl_call'... |
import copy
import itertools
input = """###..#..
.#######
#####...
#..##.#.
###..##.
##...#..
..#...#.
.#....##"""
# input = """.#.
# ..#
# ###"""
cycles_count = 6
def step(world):
size = len(world[0][0])
new_size = size + 2
new_world = copy.deepcopy(world)
# RESIZE PART:
# Add new planes and ... | [
"copy.deepcopy",
"itertools.product"
] | [((255, 275), 'copy.deepcopy', 'copy.deepcopy', (['world'], {}), '(world)\n', (268, 275), False, 'import copy\n'), ((1039, 1063), 'copy.deepcopy', 'copy.deepcopy', (['new_world'], {}), '(new_world)\n', (1052, 1063), False, 'import copy\n'), ((943, 982), 'itertools.product', 'itertools.product', (['(-1, 0, 1)'], {'repea... |
from django.contrib import admin
from tweets.models import Tweet, Comment, Likes
admin.site.register(Tweet)
admin.site.register(Comment)
admin.site.register(Likes)
| [
"django.contrib.admin.site.register"
] | [((82, 108), 'django.contrib.admin.site.register', 'admin.site.register', (['Tweet'], {}), '(Tweet)\n', (101, 108), False, 'from django.contrib import admin\n'), ((109, 137), 'django.contrib.admin.site.register', 'admin.site.register', (['Comment'], {}), '(Comment)\n', (128, 137), False, 'from django.contrib import adm... |
"""
This module creates a scatterplot for specified team with shot attempt rates versus league median from down 3 to up 3.
"""
import matplotlib.pyplot as plt
import math
import pandas as pd
import scrapenhl2.scrape.team_info as team_info
import scrapenhl2.manipulate.manipulate as manip
import scrapenhl2.plot.visuali... | [
"math.atan",
"matplotlib.pyplot.show",
"scrapenhl2.scrape.team_info.team_as_str",
"matplotlib.pyplot.annotate",
"matplotlib.pyplot.ylim",
"matplotlib.pyplot.scatter",
"scrapenhl2.scrape.team_info.team_as_id",
"scrapenhl2.plot.visualization_helper.parallel_coords",
"scrapenhl2.plot.visualization_help... | [((1707, 1750), 'scrapenhl2.plot.visualization_helper.parallel_coords', 'vhelper.parallel_coords', (['df', 'teamdf', '"""Team"""'], {}), "(df, teamdf, 'Team')\n", (1730, 1750), True, 'import scrapenhl2.plot.visualization_helper as vhelper\n'), ((1867, 1887), 'matplotlib.pyplot.ylim', 'plt.ylim', (['(0.35)', '(0.65)'], ... |
import torch
import os
from Lib.Nets.utils.generic.image2tensorboard import reconstruct_tile
import pickle as pkl
path = '/home/ale/Documents/Python/13_Tesi_2/runs/agan/10_32_idt/checkpoints/args.pkl'
opt = pkl.load(open(path, "rb"))
posx = pkl.load(open(os.path.join(opt.data_dir_train, 'posx.pkl'), "rb"))
posy = pkl.... | [
"Lib.Nets.utils.generic.image2tensorboard.reconstruct_tile",
"os.path.join",
"os.listdir"
] | [((396, 418), 'os.listdir', 'os.listdir', (['opt.tb_dir'], {}), '(opt.tb_dir)\n', (406, 418), False, 'import os\n'), ((683, 779), 'Lib.Nets.utils.generic.image2tensorboard.reconstruct_tile', 'reconstruct_tile', (['name', 'opt.patch_size', 'posx', 'posy', 'opt.tb_dir', '[8736, 13984]', 'epoch', 'trans'], {}), '(name, op... |
"""
Dataloaders for CUB200-2011, CARS196 and Stanford Online Products.
"""
"""==================================================================================================="""
################### LIBRARIES ###################
import warnings
warnings.filterwarnings("ignore")
import numpy as np, os, sys, pandas a... | [
"copy.deepcopy",
"torch.utils.data.DataLoader",
"warnings.filterwarnings",
"torchvision.transforms.RandomHorizontalFlip",
"torchvision.transforms.RandomResizedCrop",
"PIL.Image.open",
"torchvision.transforms.Compose",
"numpy.array",
"pandas.read_table",
"torchvision.transforms.CenterCrop",
"torc... | [((248, 281), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {}), "('ignore')\n", (271, 281), False, 'import warnings\n'), ((8460, 8550), 'pandas.read_table', 'pd.read_table', (["(opt.source_path + '/Info_Files/Ebay_train.txt')"], {'header': '(0)', 'delimiter': '""" """'}), "(opt.source_path +... |
from typing import NewType
RPCEndpoint = NewType("RPCEndpoint", str) | [
"typing.NewType"
] | [((44, 71), 'typing.NewType', 'NewType', (['"""RPCEndpoint"""', 'str'], {}), "('RPCEndpoint', str)\n", (51, 71), False, 'from typing import NewType\n')] |
from rpeakdetection.Utility import Utility
util = Utility()
class Evaluation:
def evaluate(self, rpeaks, name, evaluation_width, rule_based, test_index=None):
real_locations = util.remove_non_beat(name, rule_based)[0]
if test_index is not None:
real_locations = list(filter(lambda x: ... | [
"rpeakdetection.Utility.Utility"
] | [((51, 60), 'rpeakdetection.Utility.Utility', 'Utility', ([], {}), '()\n', (58, 60), False, 'from rpeakdetection.Utility import Utility\n')] |
# Generated by Django 2.1.2 on 2018-12-28 16:58
from django.conf import settings
import django.contrib.postgres.fields.jsonb
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('contenttypes', '0002_remove_content_type_name')... | [
"django.db.models.ForeignKey",
"django.db.models.DateTimeField",
"django.db.models.PositiveIntegerField",
"django.db.models.AutoField"
] | [((499, 592), '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", (515, 592), False, 'from django.db import migrations, models\... |
import sys
import matplotlib
matplotlib.use('Qt5Agg')
from PyQt5 import QtCore, QtGui, QtWidgets
from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg, NavigationToolbar2QT as NavigationToolbar
from matplotlib.figure import Figure
class MplCanvas(FigureCanvasQTAgg):
def __init__(self, parent=None, wi... | [
"PyQt5.QtWidgets.QWidget",
"PyQt5.QtWidgets.QVBoxLayout",
"matplotlib.figure.Figure",
"matplotlib.use",
"matplotlib.backends.backend_qt5agg.NavigationToolbar2QT",
"PyQt5.QtWidgets.QApplication"
] | [((29, 53), 'matplotlib.use', 'matplotlib.use', (['"""Qt5Agg"""'], {}), "('Qt5Agg')\n", (43, 53), False, 'import matplotlib\n'), ((1200, 1232), 'PyQt5.QtWidgets.QApplication', 'QtWidgets.QApplication', (['sys.argv'], {}), '(sys.argv)\n', (1222, 1232), False, 'from PyQt5 import QtCore, QtGui, QtWidgets\n'), ((361, 401),... |
import os
import sqlite3
from fridgeai import camera
from PyQt5 import QtCore, QtGui, QtWidgets
from fridgeai.gui.manual import Ui_Manual
from fridgeai.gui.predict import Ui_predict
from fridgeai.gui.testing import Ui_List
from fridgeai.gui.learn import Ui_Learn
from datetime import date
class Ui_MainWindow(object):
... | [
"PyQt5.QtGui.QColor",
"PyQt5.QtWidgets.QPushButton",
"os.path.join",
"PyQt5.QtWidgets.QLabel",
"PyQt5.QtWidgets.QWidget",
"PyQt5.QtCore.QTimer",
"fridgeai.gui.testing.Ui_List",
"fridgeai.gui.manual.Ui_Manual",
"PyQt5.QtCore.QRect",
"PyQt5.QtWidgets.QMainWindow",
"datetime.date.today",
"PyQt5.Q... | [((468, 497), 'PyQt5.QtWidgets.QWidget', 'QtWidgets.QWidget', (['MainWindow'], {}), '(MainWindow)\n', (485, 497), False, 'from PyQt5 import QtCore, QtGui, QtWidgets\n'), ((581, 617), 'PyQt5.QtWidgets.QLabel', 'QtWidgets.QLabel', (['self.centralwidget'], {}), '(self.centralwidget)\n', (597, 617), False, 'from PyQt5 impo... |
import pkg_resources
import shutil
import tempfile
import unittest
import jinja2
import os.path
import pwd
import grp
import mock
from charmhelpers.core import templating
TEMPLATES_DIR = pkg_resources.resource_filename(__name__, 'templates')
class TestTemplating(unittest.TestCase):
def setUp(self):
sel... | [
"mock.patch.object",
"tempfile.NamedTemporaryFile",
"charmhelpers.core.templating.render",
"mock.patch",
"pkg_resources.resource_filename",
"jinja2.FileSystemLoader",
"tempfile.mkdtemp",
"jinja2.exceptions.TemplateNotFound",
"shutil.rmtree"
] | [((190, 244), 'pkg_resources.resource_filename', 'pkg_resources.resource_filename', (['__name__', '"""templates"""'], {}), "(__name__, 'templates')\n", (221, 244), False, 'import pkg_resources\n'), ((708, 755), 'mock.patch.object', 'mock.patch.object', (['templating.host.os', '"""fchown"""'], {}), "(templating.host.os,... |
#!/usr/bin/env python
#------------------------------------------------------------
# Purpose: Program finds best-fit pararameters of a model
# a*sin(bx+c) with data with errors in both variables
# x and y. It uses the effective variance method for
# kmpfit and the results are compared with S... | [
"kapteyn.kmpfit.Fitter",
"scipy.odr.ODR",
"matplotlib.pyplot.show",
"scipy.odr.Model",
"scipy.odr.RealData",
"matplotlib.pyplot.figure",
"numpy.where",
"numpy.sin",
"matplotlib.pyplot.rc",
"numpy.random.normal",
"numpy.linspace",
"numpy.cos"
] | [((1276, 1302), 'numpy.linspace', 'numpy.linspace', (['(-3)', '(7.0)', 'N'], {}), '(-3, 7.0, N)\n', (1290, 1302), False, 'import numpy\n'), ((1356, 1375), 'numpy.random.normal', 'normal', (['(0.1)', '(0.2)', 'N'], {}), '(0.1, 0.2, N)\n', (1362, 1375), False, 'from numpy.random import normal\n'), ((1384, 1403), 'numpy.r... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import numpy as np
import tensorflow as tf
from tensorflow.keras.layers import Layer
from kerastools.initializers import RandomMaclaurin
class CompactKOrderPooling(Layer):
""" Keras layer to compute K-th order moments representation. In the non-trainable case, the Ra... | [
"tensorflow.nn.conv2d",
"kerastools.initializers.RandomMaclaurin"
] | [((4864, 4981), 'tensorflow.nn.conv2d', 'tf.nn.conv2d', ([], {'input': 'second_block', 'filter': 'self.proj', 'strides': '[1, 1, 1, 1]', 'padding': '"""VALID"""', 'dilations': '[1, 1, 1, 1]'}), "(input=second_block, filter=self.proj, strides=[1, 1, 1, 1],\n padding='VALID', dilations=[1, 1, 1, 1])\n", (4876, 4981), ... |
from argparse import ArgumentParser
from typing import Optional, Sequence, Text
from luh3417.serialized_replace import walk
from luh3417.utils import make_doer, run_main, setup_logging
doing = make_doer("luh3417.replace")
def parse_args(argv: Optional[Sequence[Text]] = None):
parser = ArgumentParser(description... | [
"argparse.ArgumentParser",
"luh3417.utils.setup_logging",
"luh3417.utils.run_main",
"luh3417.utils.make_doer",
"luh3417.serialized_replace.walk"
] | [((195, 223), 'luh3417.utils.make_doer', 'make_doer', (['"""luh3417.replace"""'], {}), "('luh3417.replace')\n", (204, 223), False, 'from luh3417.utils import make_doer, run_main, setup_logging\n'), ((294, 360), 'argparse.ArgumentParser', 'ArgumentParser', ([], {'description': '"""Seeks and replaces serialized values"""... |
from common.preprocessor import Preprocessor
class EnvWrapper:
# Wrapper class for SC2Env.
# Used to fit the data coming from SC2Env to the agents model and vice versa
def __init__(self, env, model_config):
self.env = env
self.model_config = model_config
self.preprocesso... | [
"common.preprocessor.Preprocessor"
] | [((324, 350), 'common.preprocessor.Preprocessor', 'Preprocessor', (['model_config'], {}), '(model_config)\n', (336, 350), False, 'from common.preprocessor import Preprocessor\n')] |
# Generated by Django 3.1 on 2020-08-24 21:24
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('shortener', '0008_auto_20200824_1342'),
]
operations = [
migrations.AlterField(
model_name='short... | [
"django.db.models.OneToOneField",
"django.db.models.CharField",
"django.db.models.JSONField",
"django.db.models.AutoField",
"django.db.models.DateField"
] | [((372, 442), 'django.db.models.CharField', 'models.CharField', ([], {'db_index': '(True)', 'default': '""""""', 'max_length': '(8)', 'unique': '(True)'}), "(db_index=True, default='', max_length=8, unique=True)\n", (388, 442), False, 'from django.db import migrations, models\n'), ((567, 617), 'django.db.models.DateFie... |
# coding: utf-8
"""
Copyright 2016 SmartBear Software
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applica... | [
"six.iteritems"
] | [((20100, 20129), 'six.iteritems', 'iteritems', (['self.swagger_types'], {}), '(self.swagger_types)\n', (20109, 20129), False, 'from six import iteritems\n')] |
#-*- coding:utf-8 -*-
"""
Main class that provides SPC analysis. It detects SPC rules violations.
It can draw charts using matplotlib.
:arguments:
data
user data as flat array/list
"""
from utils import *
import numpy as np
import pandas as pd
RULE_1_BEYOND_3SIGMA = '1个点落在A区以外'
RULE_2_OF_3_BEYOND_2S... | [
"numpy.std",
"numpy.mean"
] | [((2792, 2805), 'numpy.mean', 'np.mean', (['data'], {}), '(data)\n', (2799, 2805), True, 'import numpy as np\n'), ((2882, 2902), 'numpy.std', 'np.std', (['data'], {'ddof': '(1)'}), '(data, ddof=1)\n', (2888, 2902), True, 'import numpy as np\n')] |
import pytest
from helpers.cluster import ClickHouseCluster
from helpers.client import QueryRuntimeException
FIRST_PART_NAME = "all_1_1_0"
@pytest.fixture(scope="module")
def cluster():
try:
cluster = ClickHouseCluster(__file__)
node = cluster.add_instance("node",
... | [
"pytest.mark.parametrize",
"pytest.raises",
"helpers.cluster.ClickHouseCluster",
"pytest.fixture"
] | [((143, 173), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""module"""'}), "(scope='module')\n", (157, 173), False, 'import pytest\n'), ((567, 683), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""policy"""', "['encrypted_policy', 'encrypted_policy_key192b', 'local_policy', 's3_policy']"], {}), "('p... |
# Generated by Django 3.1.2 on 2021-04-05 18:16
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('catalog', '0006_auto_20210405_1803'),
]
operations = [
migrations.AddField(
model_name='deliverytime',
name='synthes... | [
"django.db.models.BigIntegerField",
"django.db.models.BooleanField"
] | [((345, 379), 'django.db.models.BooleanField', 'models.BooleanField', ([], {'default': '(False)'}), '(default=False)\n', (364, 379), False, 'from django.db import migrations, models\n'), ((505, 538), 'django.db.models.BigIntegerField', 'models.BigIntegerField', ([], {'default': '(0)'}), '(default=0)\n', (527, 538), Fal... |
import csv
import os
import datetime
from typing import re
from django.core.files import File
from django.core.management import BaseCommand
from django.db import transaction
from django.utils.encoding import force_text
from django.utils.functional import keep_lazy_text
from report.models import Report, WatchlistedRe... | [
"os.listdir",
"django.core.files.File",
"report.models.Report.objects.filter",
"os.path.realpath",
"os.path.isfile",
"typing.re.sub",
"django.utils.encoding.force_text",
"os.path.join",
"django.db.transaction.atomic"
] | [((1313, 1343), 'os.listdir', 'os.listdir', (['report_folder_path'], {}), '(report_folder_path)\n', (1323, 1343), False, 'import os\n'), ((2169, 2198), 'typing.re.sub', 're.sub', (['"""(?u)[^-\\\\w.]"""', '""""""', 's'], {}), "('(?u)[^-\\\\w.]', '', s)\n", (2175, 2198), False, 'from typing import re\n'), ((569, 595), '... |
#Crie um programa que faça o computador jogar Jokenpô com você.
import random
from time import sleep
print('VAMOS <NAME>!')
print('''Coloque:
[1]PEDRA
[2]PAPEL
[3]TESOURA''')
op = input('Qual opção voce escolhe?')
lista = ['1','2','3']
pc = random.choice(lista)
sleep(1)
print('\033[36mJO!')
sleep(1)
print('\033[36mKEM... | [
"random.choice",
"time.sleep"
] | [((242, 262), 'random.choice', 'random.choice', (['lista'], {}), '(lista)\n', (255, 262), False, 'import random\n'), ((263, 271), 'time.sleep', 'sleep', (['(1)'], {}), '(1)\n', (268, 271), False, 'from time import sleep\n'), ((293, 301), 'time.sleep', 'sleep', (['(1)'], {}), '(1)\n', (298, 301), False, 'from time impor... |
# Copyright 2014 Cisco Systems, Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... | [
"networking_cisco._i18n._"
] | [((995, 1064), 'networking_cisco._i18n._', '_', (['"""Value for expected key: %(key)s is missing.Driver cannot proceed"""'], {}), "('Value for expected key: %(key)s is missing.Driver cannot proceed')\n", (996, 1064), False, 'from networking_cisco._i18n import _\n'), ((1217, 1304), 'networking_cisco._i18n._', '_', (['""... |
# -*- coding: utf-8 -*-
# Copyright 2019 The Matrix.org Foundation C.I.C.
#
# 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 require... | [
"synapse.types.UserID.from_string",
"logging.getLogger"
] | [((767, 815), 'logging.getLogger', 'logging.getLogger', (["('synapse.contrib.' + __name__)"], {}), "('synapse.contrib.' + __name__)\n", (784, 815), False, 'import logging\n'), ((3870, 3905), 'synapse.types.UserID.from_string', 'UserID.from_string', (['inviter_user_id'], {}), '(inviter_user_id)\n', (3888, 3905), False, ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2018/12/21 2:30 PM
# @Author : zhangzhen
# @Site :
# @File : __init__.py
# @Software: PyCharm
import tensorflow as tf
from numpy.random import RandomState as rdm
import logging
logging.basicConfig(format='%(asctime)s : %(levelname)s : %(message)s', leve... | [
"logging.basicConfig",
"tensorflow.clip_by_value",
"tensorflow.global_variables_initializer",
"tensorflow.Session",
"numpy.random.RandomState",
"tensorflow.constant",
"tensorflow.placeholder",
"tensorflow.matmul",
"tensorflow.random_normal",
"tensorflow.train.AdamOptimizer"
] | [((244, 340), 'logging.basicConfig', 'logging.basicConfig', ([], {'format': '"""%(asctime)s : %(levelname)s : %(message)s"""', 'level': 'logging.DEBUG'}), "(format='%(asctime)s : %(levelname)s : %(message)s',\n level=logging.DEBUG)\n", (263, 340), False, 'import logging\n'), ((1214, 1285), 'tensorflow.placeholder', ... |
"""Tests for Geofabrik module."""
import os
from datetime import datetime
from tempfile import TemporaryDirectory
import pytest
import vcr
from geohealthaccess.geofabrik import Geofabrik, Page, Region
BASEURL = "http://download.geofabrik.de/"
@vcr.use_cassette("tests/cassettes/geofabrik-index.yaml")
def test_page... | [
"tempfile.TemporaryDirectory",
"vcr.use_cassette",
"geohealthaccess.geofabrik.Page",
"geohealthaccess.geofabrik.Region",
"os.path.isfile",
"os.path.getmtime",
"geohealthaccess.geofabrik.Geofabrik",
"pytest.approx"
] | [((250, 306), 'vcr.use_cassette', 'vcr.use_cassette', (['"""tests/cassettes/geofabrik-index.yaml"""'], {}), "('tests/cassettes/geofabrik-index.yaml')\n", (266, 306), False, 'import vcr\n'), ((486, 543), 'vcr.use_cassette', 'vcr.use_cassette', (['"""tests/cassettes/geofabrik-africa.yaml"""'], {}), "('tests/cassettes/geo... |
# -*- coding: utf-8 -*-
"""pyvib sample data files"""
import socket
import os.path
import warnings
from shutil import move
from tempfile import TemporaryDirectory
from subprocess import check_call
from .config import get_and_create_sample_dir
__all__ = ['download_sample_data', 'get_sample_file']
# https://api.github... | [
"shutil.move",
"tempfile.TemporaryDirectory",
"subprocess.check_call"
] | [((2414, 2434), 'tempfile.TemporaryDirectory', 'TemporaryDirectory', ([], {}), '()\n', (2432, 2434), False, 'from tempfile import TemporaryDirectory\n'), ((2466, 2512), 'subprocess.check_call', 'check_call', (["['github-download.sh', url]"], {'cwd': 'd'}), "(['github-download.sh', url], cwd=d)\n", (2476, 2512), False, ... |
"""Search for files purely in discord."""
from .async_search_client import AsyncSearchClient
import discord
from typing import List, Dict
from fuzzywuzzy import fuzz
from utils import attachment_to_search_dict
import datetime
class PastFileSearch(AsyncSearchClient):
"""Search for files in discord with just discor... | [
"utils.attachment_to_search_dict"
] | [((3527, 3567), 'utils.attachment_to_search_dict', 'attachment_to_search_dict', (['message', 'atch'], {}), '(message, atch)\n', (3552, 3567), False, 'from utils import attachment_to_search_dict\n')] |
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | [
"tests.test_utils.config.conf_vars",
"airflow.utils.timezone.datetime",
"airflow.utils.log.logging_mixin.set_context",
"pytest.fixture",
"tests.test_utils.db.clear_db_runs",
"airflow.operators.empty.EmptyOperator",
"airflow.models.DAG",
"logging.config.dictConfig",
"airflow.models.TaskInstance"
] | [((1291, 1311), 'airflow.utils.timezone.datetime', 'datetime', (['(2019)', '(1)', '(1)'], {}), '(2019, 1, 1)\n', (1299, 1311), False, 'from airflow.utils.timezone import datetime\n'), ((1610, 1654), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""module"""', 'autouse': '(True)'}), "(scope='module', autouse=True)... |
''' mbinary
#########################################################################
# File : radixSort.py
# Author: mbinary
# Mail: <EMAIL>
# Blog: https://mbinary.xyz
# Github: https://github.com/mbinary
# Created Time: 2018-07-06 15:52
# Description:
################################################################... | [
"random.randint",
"time.time"
] | [((948, 964), 'random.randint', 'randint', (['(0)', 'span'], {}), '(0, span)\n', (955, 964), False, 'from random import randint\n'), ((1098, 1104), 'time.time', 'time', ([], {}), '()\n', (1102, 1104), False, 'from time import time\n'), ((1355, 1370), 'random.randint', 'randint', (['(0)', '(100)'], {}), '(0, 100)\n', (1... |
# import libraries
import pandas as pd
import os
import sys
from operator import itemgetter
from collections import defaultdict
class MovieRecommendation:
user_threshold: int
min_support: int
min_confidence: float
def __init__(self):
# users in train set
self.user_threshold = 200
... | [
"pandas.read_csv",
"collections.defaultdict",
"pandas.to_datetime",
"sys.stdout.flush",
"operator.itemgetter",
"os.path.join"
] | [((787, 824), 'os.path.join', 'os.path.join', (['os.path.curdir', '"""input"""'], {}), "(os.path.curdir, 'input')\n", (799, 824), False, 'import os\n'), ((851, 891), 'os.path.join', 'os.path.join', (['data_folder', '"""ratings.dat"""'], {}), "(data_folder, 'ratings.dat')\n", (863, 891), False, 'import os\n'), ((922, 96... |
"""Generate python files from protobufs."""
import glob
import re
from grpc_tools import protoc
protoc.main([
'grpc_tools.protoc',
'--proto_path=protobuf/',
'--python_out=.',
'--grpc_python_out=.'
] + list(glob.iglob('./protobuf/*.proto')))
# Make pb2 imports in generated scripts relative
for script... | [
"glob.iglob",
"re.sub"
] | [((324, 349), 'glob.iglob', 'glob.iglob', (['"""./*_pb2*.py"""'], {}), "('./*_pb2*.py')\n", (334, 349), False, 'import glob\n'), ((225, 257), 'glob.iglob', 'glob.iglob', (['"""./protobuf/*.proto"""'], {}), "('./protobuf/*.proto')\n", (235, 257), False, 'import glob\n'), ((455, 507), 're.sub', 're.sub', (['"""\\\\n(impo... |
from django.http import HttpResponse # type: ignore
from pylti1p3.oidc_login import OIDCLogin
from pylti1p3.request import Request
from .cookie import DjangoCookieService
from .redirect import DjangoRedirect
from .request import DjangoRequest
from .session import DjangoSessionService
class DjangoOIDCLogin(OIDCLogin... | [
"django.http.HttpResponse"
] | [((1043, 1061), 'django.http.HttpResponse', 'HttpResponse', (['html'], {}), '(html)\n', (1055, 1061), False, 'from django.http import HttpResponse\n')] |
import os
import csv
import yaml
import argparse
import numpy as np
from operator import itemgetter
from os import listdir
from os.path import isfile, join
""" Find the biggest files
"""
def Main():
parser = argparse.ArgumentParser()
parser.add_argument("dataset",
metavar='p0',
... | [
"operator.itemgetter",
"yaml.safe_load",
"argparse.ArgumentParser"
] | [((214, 239), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (237, 239), False, 'import argparse\n'), ((993, 1010), 'yaml.safe_load', 'yaml.safe_load', (['f'], {}), '(f)\n', (1007, 1010), False, 'import yaml\n'), ((1056, 1069), 'operator.itemgetter', 'itemgetter', (['(1)'], {}), '(1)\n', (1066,... |
import minecraft_data
# Java edition minecraft-data
mcd = minecraft_data("1.13")
print(mcd.version)
print(mcd.find_item_or_block(1))
print(mcd.find_item_or_block('stone'))
print(mcd.recipes['5'][0])
print(mcd.windows['minecraft:brewing_stand'])
print(mcd.effects_name['Haste'])
# Pocket Edition minecraft-data
mcd_... | [
"minecraft_data"
] | [((58, 80), 'minecraft_data', 'minecraft_data', (['"""1.13"""'], {}), "('1.13')\n", (72, 80), False, 'import minecraft_data\n'), ((325, 352), 'minecraft_data', 'minecraft_data', (['"""1.0"""', '"""pe"""'], {}), "('1.0', 'pe')\n", (339, 352), False, 'import minecraft_data\n')] |
from ...models import Headline
import requests
from bs4 import BeautifulSoup
from datetime import datetime, time, timedelta
from dateparser import parse
def getslate(per_site):
url = 'https://slate.com/news-and-politics'
html = requests.get(url).text
soup = BeautifulSoup(html, 'lxml')
articles = soup.... | [
"dateparser.parse",
"datetime.timedelta",
"requests.get",
"bs4.BeautifulSoup",
"datetime.datetime.now"
] | [((271, 298), 'bs4.BeautifulSoup', 'BeautifulSoup', (['html', '"""lxml"""'], {}), "(html, 'lxml')\n", (284, 298), False, 'from bs4 import BeautifulSoup\n'), ((237, 254), 'requests.get', 'requests.get', (['url'], {}), '(url)\n', (249, 254), False, 'import requests\n'), ((1230, 1244), 'datetime.datetime.now', 'datetime.n... |
###############################################################################
# #
# SYMBOLS, TABLES, SEMANTIC ANALYSIS #
# #
... | [
"base.SemanticError"
] | [((3927, 4023), 'base.SemanticError', 'SemanticError', ([], {'error_code': 'error_code', 'token': 'token', 'message': 'f"""{error_code.value} -> {token}"""'}), "(error_code=error_code, token=token, message=\n f'{error_code.value} -> {token}')\n", (3940, 4023), False, 'from base import _SHOULD_LOG_SCOPE, _SHOULD_LOG_... |
from mrq.job import Job
import datetime
from mrq.queue import Queue
import time
import pytest
@pytest.mark.parametrize(["p_queue", "p_pushback", "p_timed", "p_flags"], [
["test_timed_set", False, True, "--greenlets 10"],
["pushback_timed_set", True, True, "--greenlets 10"],
["test_sorted_set", False, Fals... | [
"mrq.job.Job",
"time.time",
"time.sleep",
"pytest.mark.parametrize",
"mrq.queue.Queue"
] | [((97, 341), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (["['p_queue', 'p_pushback', 'p_timed', 'p_flags']", "[['test_timed_set', False, True, '--greenlets 10'], ['pushback_timed_set', \n True, True, '--greenlets 10'], ['test_sorted_set', False, False,\n '--greenlets 1']]"], {}), "(['p_queue', 'p_pushb... |
import math
from typing import Callable
class Method:
@staticmethod
def calculate(f: Callable, a: float, b: float):
pass
@staticmethod
def name():
pass
class left_rectangle(Method):
@staticmethod
def calculate(f: Callable, a: float, b: float):
return f(a) * (b - a)
... | [
"math.exp"
] | [((2131, 2143), 'math.exp', 'math.exp', (['(-x)'], {}), '(-x)\n', (2139, 2143), False, 'import math\n'), ((2171, 2183), 'math.exp', 'math.exp', (['(-x)'], {}), '(-x)\n', (2179, 2183), False, 'import math\n')] |
# -*- coding: utf-8 -*-
import decimal
from django.db import connection
class StatsManager:
def __init__(self):
self.cursor = connection.cursor()
def _result(self, args):
result = []
self.cursor.execute(self.sql, args)
for k, v in self.cursor.fetchall():
... | [
"django.db.connection.cursor"
] | [((141, 160), 'django.db.connection.cursor', 'connection.cursor', ([], {}), '()\n', (158, 160), False, 'from django.db import connection\n')] |
# -*- coding: utf-8 -*-
"""
@author: wangyouqish
"""
import sys
sys.path.append("..")
import time,datetime
import pytz
import requests
import feedparser
import threading
import database.dbConn as dbConn
import log.logCenter as logCenter
def getFeedFromLink(url,name):
head = {'User-Agent': 'Mozilla/5.0 (Windows NT... | [
"sys.path.append",
"feedparser.parse",
"threading.Thread",
"time.strptime",
"time.time",
"time.mktime",
"datetime.datetime.strptime",
"pytz.timezone",
"requests.get",
"log.logCenter.getLogger",
"database.dbConn.getConn"
] | [((64, 85), 'sys.path.append', 'sys.path.append', (['""".."""'], {}), "('..')\n", (79, 85), False, 'import sys\n'), ((7058, 7090), 'log.logCenter.getLogger', 'logCenter.getLogger', (['"""rssSpider"""'], {}), "('rssSpider')\n", (7077, 7090), True, 'import log.logCenter as logCenter\n'), ((783, 813), 'feedparser.parse', ... |
import re
import time
import socket
import struct
import logging
import traceback
from functools import wraps
try:
from Queue import Queue, Empty # Python 2
except ImportError:
from queue import Queue, Empty # Python 3
from collections import defaultdict
from threading import RLock, Thread, Semaphore
__all_... | [
"threading.Thread",
"traceback.print_exc",
"threading.RLock",
"socket.socket",
"struct.pack",
"time.sleep",
"collections.defaultdict",
"socket.gethostname",
"time.time",
"functools.wraps",
"re.sub",
"threading.Semaphore",
"queue.Queue",
"logging.getLogger"
] | [((462, 491), 'logging.getLogger', 'logging.getLogger', (['"""collectd"""'], {}), "('collectd')\n", (479, 491), False, 'import logging\n'), ((6127, 6134), 'queue.Queue', 'Queue', ([], {}), '()\n', (6132, 6134), False, 'from queue import Queue, Empty\n'), ((6142, 6190), 'socket.socket', 'socket.socket', (['socket.AF_INE... |
import os
import cv2
import math
import random
import numpy as np
import pandas as pd
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.utils.data import Dataset
import timm
class VIT_Attention(nn.Module):
def __init__(self,
arch_name,
pretrained=False,
img_s... | [
"torch.nn.Dropout",
"torch.nn.ModuleList",
"torch.nn.Tanh",
"timm.create_model",
"torch.cuda.is_available",
"torch.nn.Linear",
"torch.nn.Identity"
] | [((644, 695), 'timm.create_model', 'timm.create_model', (['arch_name'], {'pretrained': 'pretrained'}), '(arch_name, pretrained=pretrained)\n', (661, 695), False, 'import timm\n'), ((793, 806), 'torch.nn.Identity', 'nn.Identity', ([], {}), '()\n', (804, 806), True, 'import torch.nn as nn\n'), ((828, 852), 'torch.nn.Line... |
from torch.functional import Tensor
import torchvision.models as models
import torch.nn as nn
class Encoder_VGG16(nn.Module):
def __init__(self):
super(Encoder_VGG16, self).__init__()
pretrained_model = models.vgg16(pretrained=True)
self.conv_base = pretrained_model.features
# Fre... | [
"torch.nn.ReLU",
"torch.nn.Sequential",
"torchvision.models.densenet161",
"torchvision.models.resnet50",
"torchvision.models.vgg16",
"torch.nn.Flatten"
] | [((225, 254), 'torchvision.models.vgg16', 'models.vgg16', ([], {'pretrained': '(True)'}), '(pretrained=True)\n', (237, 254), True, 'import torchvision.models as models\n'), ((585, 601), 'torch.nn.Flatten', 'nn.Flatten', (['(2)', '(3)'], {}), '(2, 3)\n', (595, 601), True, 'import torch.nn as nn\n'), ((1146, 1178), 'torc... |
# Deletes selected objects recursively from the object hierarchy
import bpy
obj = bpy.context.object
stack = [obj]
while len(stack) > 0:
tmp = stack.pop()
if hasattr(tmp, "children"):
for child in tmp.children:
child.select = True
stack.append(child)
bpy.ops.object.delete() | [
"bpy.ops.object.delete"
] | [((265, 288), 'bpy.ops.object.delete', 'bpy.ops.object.delete', ([], {}), '()\n', (286, 288), False, 'import bpy\n')] |
"""Implementations of edge walk aggregators."""
import abc
import torch
from torch import nn
class BaseAggregator(abc.ABC, nn.Module):
"""Base class for edge walk aggregators."""
def __init__(self):
"""Inits BaseAggregator."""
super().__init__()
self._device = torch.device(
... | [
"torch.cuda.is_available"
] | [((333, 358), 'torch.cuda.is_available', 'torch.cuda.is_available', ([], {}), '()\n', (356, 358), False, 'import torch\n')] |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2012-2014 pyReScene
#
# 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 ri... | [
"struct.Struct",
"rescene.rarstream.RarStream",
"rescene.utility.is_rar"
] | [((1397, 1416), 'struct.Struct', 'struct.Struct', (['""">L"""'], {}), "('>L')\n", (1410, 1416), False, 'import struct\n'), ((1457, 1476), 'struct.Struct', 'struct.Struct', (['""">Q"""'], {}), "('>Q')\n", (1470, 1476), False, 'import struct\n'), ((2423, 2435), 'rescene.utility.is_rar', 'is_rar', (['path'], {}), '(path)\... |
from math import sqrt
from PEPit import PEP
from PEPit.functions import ConvexLipschitzFunction
def wc_subgradient_method(M, n, gamma, verbose=1):
"""
Consider the minimization problem
.. math:: f_\\star \\triangleq \\min_x f(x),
where :math:`f` is convex and :math:`M`-Lipschitz. This problem is a ... | [
"math.sqrt",
"PEPit.PEP"
] | [((3966, 3971), 'PEPit.PEP', 'PEP', ([], {}), '()\n', (3969, 3971), False, 'from PEPit import PEP\n'), ((4968, 4979), 'math.sqrt', 'sqrt', (['(n + 1)'], {}), '(n + 1)\n', (4972, 4979), False, 'from math import sqrt\n'), ((5585, 5596), 'math.sqrt', 'sqrt', (['(n + 1)'], {}), '(n + 1)\n', (5589, 5596), False, 'from math ... |
import logging
import azure.functions as func
import azure.durable_functions as df
def generator_function(context):
tasks = []
for i in range(30):
current_task = context.df.callActivity("DurableActivity", str(i))
tasks.append(current_task)
results = yield context.df.task_all(tasks)
l... | [
"logging.warn",
"azure.durable_functions.Orchestrator.create"
] | [((319, 364), 'logging.warn', 'logging.warn', (['f"""!!! fanout results {results}"""'], {}), "(f'!!! fanout results {results}')\n", (331, 364), False, 'import logging\n'), ((414, 471), 'logging.warn', 'logging.warn', (["('Durable Orchestration Trigger: ' + context)"], {}), "('Durable Orchestration Trigger: ' + context)... |
from uqcsbot import bot, Command
from uqcsbot.utils.command_utils import loading_status
from typing import Tuple
import requests
from bs4 import BeautifulSoup as Soup
def get_pf_parking_data() -> Tuple[int, str]:
"""
Returns a parking HTML document from the UQ P&F website
"""
page = requests.get("htt... | [
"bs4.BeautifulSoup",
"uqcsbot.bot.on_command",
"uqcsbot.bot.post_message",
"requests.get"
] | [((388, 413), 'uqcsbot.bot.on_command', 'bot.on_command', (['"""parking"""'], {}), "('parking')\n", (402, 413), False, 'from uqcsbot import bot, Command\n'), ((303, 343), 'requests.get', 'requests.get', (['"""https://pg.pf.uq.edu.au/"""'], {}), "('https://pg.pf.uq.edu.au/')\n", (315, 343), False, 'import requests\n'), ... |
import csv
import datetime
import os
from django.contrib.gis.geos import Point
from django.core.management import BaseCommand, CommandError
from django.db import transaction
from geopy import Nominatim
from countries.models import Country
from report.models import Report, Sighting, ReportedViaChoice
from users.models... | [
"report.models.Report.objects.all",
"django.db.transaction.atomic",
"report.models.Sighting.objects.filter"
] | [((513, 533), 'django.db.transaction.atomic', 'transaction.atomic', ([], {}), '()\n', (531, 533), False, 'from django.db import transaction\n'), ((553, 573), 'report.models.Report.objects.all', 'Report.objects.all', ([], {}), '()\n', (571, 573), False, 'from report.models import Report, Sighting, ReportedViaChoice\n'),... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Oct 5 23:54:49 2018
@author: tyler
"""
import numpy as np
#%%
def postprocess_cut(supernodes_original,supernodes_f,supernode_nonempty_Q,not_loop_Q):
'''
returns : partition of original vertices of $G$ and size of coresponding cut
'''... | [
"numpy.load",
"numpy.copy",
"numpy.shape",
"numpy.cumsum",
"numpy.any",
"numpy.random.randint",
"numpy.where"
] | [((2949, 2970), 'numpy.load', 'np.load', (['"""b0_pre.npz"""'], {}), "('b0_pre.npz')\n", (2956, 2970), True, 'import numpy as np\n'), ((3117, 3137), 'numpy.copy', 'np.copy', (['supernodes_'], {}), '(supernodes_)\n', (3124, 3137), True, 'import numpy as np\n'), ((3138, 3168), 'numpy.copy', 'np.copy', (['supernode_nonemp... |
import numpy as np
import torch
from scipy.io import loadmat
import cv2
import time
import deepLabv3.deeplab as deeplab
from deepLabv3.pascal import VOCSegmentation
from deepLabv3.cityscapes import Cityscapes
from deepLabv3.utils import AverageMeter, inter_and_union, load_model
from deepLabv3.detector import Detector... | [
"deepLabv3.cityscapes.Cityscapes",
"deepLabv3.utils.AverageMeter",
"scipy.io.loadmat",
"torch.load",
"deepLabv3.argLoader.ArgLoader",
"deepLabv3.pascal.VOCSegmentation",
"time.time",
"torch.cuda.is_available",
"torch.cuda.set_device",
"deepLabv3.utils.load_model",
"deepLabv3.detector.Detector"
] | [((388, 413), 'torch.cuda.is_available', 'torch.cuda.is_available', ([], {}), '()\n', (411, 413), False, 'import torch\n'), ((430, 441), 'deepLabv3.argLoader.ArgLoader', 'ArgLoader', ([], {}), '()\n', (439, 441), False, 'from deepLabv3.argLoader import ArgLoader\n'), ((948, 981), 'deepLabv3.utils.load_model', 'load_mod... |
import time
from autocfr.worker import Worker, VecWorker, GroupVecWorker
import numpy as np
import ray
class DiverContainer(Worker):
@ray.remote
def run(task):
a = task["a"]
b = task["b"]
result = {
"worker_index": task["worker_index"],
"group_index": task["grou... | [
"ray.init",
"time.sleep",
"numpy.random.randint",
"ray.shutdown",
"autocfr.worker.VecWorker",
"autocfr.worker.GroupVecWorker"
] | [((1315, 1325), 'ray.init', 'ray.init', ([], {}), '()\n', (1323, 1325), False, 'import ray\n'), ((1343, 1362), 'autocfr.worker.VecWorker', 'VecWorker', (['(3)', 'Diver'], {}), '(3, Diver)\n', (1352, 1362), False, 'from autocfr.worker import Worker, VecWorker, GroupVecWorker\n'), ((1656, 1670), 'ray.shutdown', 'ray.shut... |
# Copyright 2021 - 2022, <NAME> <<EMAIL>>, Dr. <NAME> <<EMAIL>>
# Use of this source code is governed by an MIT-style
# license that can be found in the LICENSE file or at
# https://opensource.org/licenses/MIT.
# This is a small debug utility to print the pid KMLogger is
# running on to help with profiling
import os
... | [
"base.util.block_text",
"os.getpid"
] | [((376, 393), 'base.util.block_text', 'block_text', (['"""PID"""'], {}), "('PID')\n", (386, 393), False, 'from base.util import block_text\n'), ((404, 415), 'os.getpid', 'os.getpid', ([], {}), '()\n', (413, 415), False, 'import os\n')] |
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
import json
import logging
from typing import Set, Tuple
from botocore.exceptions import ClientError
from intelliflow.core.platform.definitions.aws.common import _is_trust_policy_AWS_principle_deleted
logger =... | [
"intelliflow.core.platform.definitions.aws.common._is_trust_policy_AWS_principle_deleted",
"json.loads",
"logging.getLogger",
"json.dumps"
] | [((321, 348), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (338, 348), False, 'import logging\n'), ((5632, 5658), 'json.dumps', 'json.dumps', (['default_policy'], {}), '(default_policy)\n', (5642, 5658), False, 'import json\n'), ((6375, 6405), 'json.loads', 'json.loads', (["response['Po... |
from flask import jsonify, request
from flask_restful import Resource, reqparse
from processing import agent_checkin
from processing.user_role import authorized_groups
from logger import log
agent_checkin_parser = reqparse.RequestParser()
agent_checkin_parser.add_argument('TransportId')
agent_checkin_parser.add_argum... | [
"processing.user_role.authorized_groups",
"flask.jsonify",
"flask_restful.reqparse.RequestParser",
"flask.request.args.get"
] | [((216, 240), 'flask_restful.reqparse.RequestParser', 'reqparse.RequestParser', ([], {}), '()\n', (238, 240), False, 'from flask_restful import Resource, reqparse\n'), ((425, 473), 'processing.user_role.authorized_groups', 'authorized_groups', (["['StandardRead', 'Transport']"], {}), "(['StandardRead', 'Transport'])\n"... |
import json
import os
from urllib.parse import parse_qsl
import asyncio
from requests_oauthlib import OAuth1Session
from flask import Flask, jsonify, request, redirect, url_for
from flask import render_template
from citrus_drop import CitrusDrop
app = Flask(__name__)
user_drop = {
'screen_name': '未取得',
... | [
"asyncio.get_event_loop",
"flask.request.args.get",
"asyncio.sleep",
"flask.Flask",
"flask.render_template"
] | [((255, 270), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (260, 270), False, 'from flask import Flask, jsonify, request, redirect, url_for\n'), ((745, 837), 'flask.render_template', 'render_template', (['"""main.html"""'], {'title': 'title', 'page': 'page', 'message': 'user_drop', 'disabled': '"""true""... |
import sympy
_id = lambda x: x
class Kinematics(object):
"""Robot symbolic Jacobians.
kinobj.J: list of link frame Jacobians - complete (6 x N):
[linear_velocity
angular_velocity] = J * joint_velocities
kinobj.Jc: list of link center-of-mass Jacobians - c... | [
"sympy.zeros",
"sympy.Matrix"
] | [((871, 939), 'sympy.Matrix', 'sympy.Matrix', (['[[0, -v[2], v[1]], [v[2], 0, -v[0]], [-v[1], v[0], 0]]'], {}), '([[0, -v[2], v[1]], [v[2], 0, -v[0]], [-v[1], v[0], 0]])\n', (883, 939), False, 'import sympy\n'), ((1400, 1431), 'sympy.zeros', 'sympy.zeros', (['(3)', 'self.rbtdef.dof'], {}), '(3, self.rbtdef.dof)\n', (14... |
# Copyright 2020 Astronomer 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 writin... | [
"setuptools.find_namespace_packages",
"os.path.dirname",
"re.search"
] | [((986, 1059), 're.search', 're.search', (['"""^__version__ = [\'\\\\"]([^\'\\\\"]*)[\'\\\\"]"""', 'version_file', 're.M'], {}), '(\'^__version__ = [\\\'\\\\"]([^\\\'\\\\"]*)[\\\'\\\\"]\', version_file, re.M)\n', (995, 1059), False, 'import re\n'), ((698, 723), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), ... |
from .errors import TorrentHashNotFound, TorrentNotValid, HttpException
import aiohttp
import asyncio
import json
class AConnector:
def __init__(self, *, base, session = None, loop = None):
self.base = base
self.loop = loop or asyncio.get_event_loop()
self.session = session
async def ... | [
"aiohttp.CookieJar",
"asyncio.get_event_loop",
"json.loads",
"asyncio.sleep",
"requests.Session"
] | [((249, 273), 'asyncio.get_event_loop', 'asyncio.get_event_loop', ([], {}), '()\n', (271, 273), False, 'import asyncio\n'), ((2481, 2499), 'requests.Session', 'requests.Session', ([], {}), '()\n', (2497, 2499), False, 'import requests\n'), ((3016, 3034), 'requests.Session', 'requests.Session', ([], {}), '()\n', (3032, ... |
import os
import pytest
from httpx import AsyncClient
from odm2_postgres_api.aquamonitor.aquamonitor_client import (
get_method_by_id,
get_project_stations,
get_taxonomy,
get_taxonomy_domain_id,
get_taxonomy_codes,
)
from odm2_postgres_api.aquamonitor.aquamonitor_mapping import METHODS_NIVABASE_MA... | [
"odm2_postgres_api.aquamonitor.aquamonitor_client.get_project_stations",
"pytest.fixture",
"httpx.AsyncClient",
"odm2_postgres_api.aquamonitor.aquamonitor_client.get_taxonomy_codes",
"odm2_postgres_api.aquamonitor.aquamonitor_client.get_method_by_id",
"odm2_postgres_api.aquamonitor.aquamonitor_client.get_... | [((459, 491), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""function"""'}), "(scope='function')\n", (473, 491), False, 'import pytest\n'), ((687, 739), 'httpx.AsyncClient', 'AsyncClient', ([], {'base_url': 'url', 'auth': '(username, password)'}), '(base_url=url, auth=(username, password))\n', (698, 739), False... |
from django.templatetags.static import static
from django.utils.functional import lazy
static_lazy = lazy(static, str)
| [
"django.utils.functional.lazy"
] | [((102, 119), 'django.utils.functional.lazy', 'lazy', (['static', 'str'], {}), '(static, str)\n', (106, 119), False, 'from django.utils.functional import lazy\n')] |
import pennylane as qml
import numpy as np
if __name__ != '__main__':
from . encoder.encoding_circuits import EncodingCircuitsPennylane
from . pqc.parametric_circuits import ParametricCircuitsPennylane
from . measurement.measurement_circuits import MeasurementCircuitsPennylane
class PennylaneQNNCi... | [
"measurement.measurement_circuits.MeasurementCircuitsPennylane",
"pqc.parametric_circuits.ParametricCircuitsPennylane",
"pennylane.device",
"numpy.random.random",
"pennylane.QNode",
"encoder.encoding_circuits.EncodingCircuitsPennylane"
] | [((1949, 1979), 'numpy.random.random', 'np.random.random', (['input_length'], {}), '(input_length)\n', (1965, 1979), True, 'import numpy as np\n'), ((1991, 2028), 'pennylane.device', 'qml.device', (['"""default.qubit"""'], {'wires': '(10)'}), "('default.qubit', wires=10)\n", (2001, 2028), True, 'import pennylane as qml... |
import asyncio
from typing import List
from . import utils
from .abc import IRaftServer
from .errors import *
from .rpc import protocol as prot
from .rpc import rpc
from .state_machine import RaftStateMachine, State, Command
ELECTION_TIMEOUT = 0.5
FLEXIBLE_PAXOS_QUORUM = 2 / 6
RPC_TIMEOUT = 1
class ClusterMember:
... | [
"asyncio.start_server",
"asyncio.sleep",
"asyncio.Event",
"asyncio.as_completed",
"asyncio.Queue"
] | [((698, 713), 'asyncio.Event', 'asyncio.Event', ([], {}), '()\n', (711, 713), False, 'import asyncio\n'), ((1923, 1938), 'asyncio.Queue', 'asyncio.Queue', ([], {}), '()\n', (1936, 1938), False, 'import asyncio\n'), ((4978, 5009), 'asyncio.as_completed', 'asyncio.as_completed', (['rpc_calls'], {}), '(rpc_calls)\n', (499... |
"""
Train a speaker model on R2R
"""
import logging
from typing import List, Tuple, Dict
import copy
import os
import random
import shutil
import sys
from datetime import datetime
from tqdm import tqdm
import numpy as np
import torch
import torch.distributed as dist
import torch.nn.functional as F
from torch import nn
... | [
"numpy.random.seed",
"torch.utils.data.RandomSampler",
"torch.cuda.device_count",
"torch.distributed.get_world_size",
"torch.device",
"torch.no_grad",
"os.path.join",
"torch.ones",
"torch.utils.data.DataLoader",
"torch.distributed.get_rank",
"os.path.exists",
"vilbert.optimization.WarmupLinear... | [((892, 1054), 'logging.basicConfig', 'logging.basicConfig', ([], {'format': '"""%(asctime)s - %(levelname)s - %(name)s - %(message)s"""', 'datefmt': '"""%m/%d/%Y %H:%M:%S"""', 'level': 'logging.INFO', 'stream': 'sys.stdout'}), "(format=\n '%(asctime)s - %(levelname)s - %(name)s - %(message)s', datefmt=\n '%m... |
"""
5_costsTester.py
Created by <NAME> at 18/02/2021, University of Milano-Bicocca.
(<EMAIL>)
All rights reserved.
This file is part of the EcoFin-Library (https://github.com/LucaCamerani/EcoFin-Library),
and is released under the "BSD Open Source License".
"""
"""
4_portfolioTester.py
Created by <NAME> at 10/02/20... | [
"EcoFin.utils.utils.polarizeTable",
"tqdm.tqdm",
"matplotlib.pyplot.show",
"numpy.log",
"EcoFin.assetAllocation.allocation.Allocation",
"pandas.to_datetime",
"matplotlib.pyplot.subplots",
"pandas.concat"
] | [((1762, 1802), 'tqdm.tqdm', 'tqdm', (['ticker_list'], {'desc': '"""Importing data"""'}), "(ticker_list, desc='Importing data')\n", (1766, 1802), False, 'from tqdm import tqdm\n'), ((4040, 4100), 'EcoFin.assetAllocation.allocation.Allocation', 'Allocation', (["data['signals']"], {'buyOnly': 'buy_only', 'limit': 'w_limi... |
import textract
from itertools import tee
import base64
import bson
import uuid
import os
from flask import Flask, request, jsonify
import datetime
from pymongo import MongoClient
import string
import json
UPLOAD_FOLDER = '/tmp/'
ALLOWED_EXTENSIONS = {'pdf'}
app = Flask(__name__)
app.config['UPLOAD_FOLDER'] = UPLOAD_... | [
"pymongo.MongoClient",
"uuid.uuid4",
"bson.objectid.ObjectId",
"flask.Flask",
"flask.request.cookies.get",
"base64.b64decode",
"flask.jsonify",
"datetime.datetime.strptime",
"bson.ObjectId",
"textract.process",
"itertools.tee",
"os.path.join"
] | [((267, 282), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (272, 282), False, 'from flask import Flask, request, jsonify\n'), ((336, 377), 'pymongo.MongoClient', 'MongoClient', (['"""mongodb://localhost:27017/"""'], {}), "('mongodb://localhost:27017/')\n", (347, 377), False, 'from pymongo import MongoCli... |
#!/usr/bin/env python3
import re
from pprint import pprint
import os
import yaml
import random
import string
from passlib.hash import md5_crypt, sha256_crypt, sha512_crypt
secrets_file = '_secrets_file_'
yaml_pp_vars = dict(os.environ)
yaml_pp_vars[secrets_file] = '_secrets.yaml'
secrets = None
sshkey_re = re.comp... | [
"random.sample",
"yaml.dump",
"passlib.hash.sha256_crypt.hash",
"os.path.isfile",
"yaml.safe_load",
"passlib.hash.md5_crypt.hash",
"passlib.hash.sha512_crypt.hash",
"re.compile"
] | [((313, 377), 're.compile', 're.compile', (['"""(.*)\\\\$SSHKEY:([A-Za-z][A-Za-z0-9]*)(:[^\\\\$]*|)\\\\$"""'], {}), "('(.*)\\\\$SSHKEY:([A-Za-z][A-Za-z0-9]*)(:[^\\\\$]*|)\\\\$')\n", (323, 377), False, 'import re\n'), ((1479, 1521), 'os.path.isfile', 'os.path.isfile', (['yaml_pp_vars[secrets_file]'], {}), '(yaml_pp_vars... |
"""Setup file for cheshire3 package."""
from __future__ import with_statement
import sys
import os
import inspect
from warnings import warn
# Import Distribute / Setuptools
from ez_setup import use_setuptools
use_setuptools()
from setuptools import setup, find_packages
from pkg_resources import DistributionNotFound... | [
"setuptools.setup",
"os.path.dirname",
"inspect.currentframe",
"warnings.warn",
"os.path.join",
"ez_setup.use_setuptools"
] | [((212, 228), 'ez_setup.use_setuptools', 'use_setuptools', ([], {}), '()\n', (226, 228), False, 'from ez_setup import use_setuptools\n'), ((635, 661), 'os.path.dirname', 'os.path.dirname', (['setuppath'], {}), '(setuppath)\n', (650, 661), False, 'import os\n'), ((1730, 4007), 'setuptools.setup', 'setup', ([], {'name': ... |
# Copyright 2021 UW-IT, University of Washington
# SPDX-License-Identifier: Apache-2.0
import json
import logging
from restclients_core.exceptions import DataFailureException
from uw_iasystem.dao import IASystem_DAO
from uw_iasystem.exceptions import TermEvalNotCreated
from uw_iasystem.util.thread import ThreadWithRes... | [
"json.loads",
"uw_iasystem.exceptions.TermEvalNotCreated",
"uw_iasystem.util.thread.ThreadWithResponse",
"uw_iasystem.dao.IASystem_DAO",
"restclients_core.exceptions.DataFailureException",
"logging.getLogger"
] | [((337, 364), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (354, 364), False, 'import logging\n'), ((430, 450), 'uw_iasystem.dao.IASystem_DAO', 'IASystem_DAO', (['domain'], {}), '(domain)\n', (442, 450), False, 'from uw_iasystem.dao import IASystem_DAO\n'), ((1741, 1766), 'json.loads', ... |
# -*- coding: utf-8 -*-
import numpy as np
import chainer
from chainer import cuda, Function, Variable
from chainer import Link, Chain, ChainList
import chainer.functions as F
import chainer.links as L
from src.lib.loss import softmax_dice_loss
class Model_L2(Chain):
def __init__(
self,
nd... | [
"chainer.initializers.HeNormal",
"chainer.functions.max_pooling_nd",
"numpy.array",
"chainer.functions.softmax",
"chainer.links.BatchNormalization"
] | [((932, 963), 'chainer.initializers.HeNormal', 'chainer.initializers.HeNormal', ([], {}), '()\n', (961, 963), False, 'import chainer\n'), ((4333, 4387), 'chainer.functions.max_pooling_nd', 'F.max_pooling_nd', (['syn0', 'self.pool_size', 'self.pool_size'], {}), '(syn0, self.pool_size, self.pool_size)\n', (4349, 4387), T... |
# pylint: disable-msg=E1101
"""
Wrapper to lowess and stl routines.
LOWESS:
Initial Fortran code available at:
http://netlib.bell-labs.com/netlib/go/lowess.f.gz
initial author: <NAME>, 1979.
Simple to double precision conversion of the Fortran code by Pierre
Gerard-Marchant, 2007/03.
STL:
Initial Fortran code availa... | [
"numpy.any",
"numpy.empty",
"numpy.array"
] | [((6139, 6185), 'numpy.array', 'array', (['x'], {'copy': '(False)', 'subok': '(True)', 'dtype': 'float_'}), '(x, copy=False, subok=True, dtype=float_)\n', (6144, 6185), False, 'from numpy import array, recarray, empty, fromiter, logical_not\n'), ((6194, 6240), 'numpy.array', 'array', (['y'], {'copy': '(False)', 'subok'... |
# Generated by Django 2.0.7 on 2018-10-25 16:57
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('hivs_pp', '0011_rename_field_confidential_to_is_confidential_on_service'),
]
operations = [
migrations.Alte... | [
"django.db.models.ForeignKey"
] | [((408, 686), 'django.db.models.ForeignKey', 'models.ForeignKey', ([], {'blank': '(True)', 'help_text': '"""If client profile is set this can be overwritten based on the client\'s profile."""', 'null': '(True)', 'on_delete': 'django.db.models.deletion.SET_NULL', 'related_name': '"""pp_deliveries"""', 'to': '"""hivs_uti... |
from setuptools import setup, find_packages
version = '0.0.1'
setup(
name="alerta-beacon",
version=version,
description='Alerta plugin for Beacon',
url='https://github.com/ernadhalilovic/alerta-contrib',
license='MIT',
author='<NAME>',
author_email='<EMAIL>',
packages=find_packages(),
... | [
"setuptools.find_packages"
] | [((303, 318), 'setuptools.find_packages', 'find_packages', ([], {}), '()\n', (316, 318), False, 'from setuptools import setup, find_packages\n')] |
from math import inf
from typing import Dict, Tuple, List
import torch
from torch import nn, Tensor
import pointneighbor as pn
from ..adj import get_adj_sft_spc, vec_sod
from .. import properties as p
def ravel1(idx: List[Tensor], siz: List[int]):
return pn.fn.ravel1(
torch.stack(idx), torch.tensor(siz, d... | [
"torch.ones",
"torch.stack",
"torch.where",
"torch.zeros_like",
"pointneighbor.coo2_n_i_j",
"torch.full",
"torch.exp",
"pointneighbor.fn.cumsum_from_zero",
"torch.unique_consecutive",
"torch.zeros",
"torch.tensor"
] | [((283, 299), 'torch.stack', 'torch.stack', (['idx'], {}), '(idx)\n', (294, 299), False, 'import torch\n'), ((301, 340), 'torch.tensor', 'torch.tensor', (['siz'], {'device': 'idx[0].device'}), '(siz, device=idx[0].device)\n', (313, 340), False, 'import torch\n'), ((2042, 2083), 'torch.where', 'torch.where', (['sing', '... |
import argparse
import json
from copy import deepcopy
import numpy as np
def write_submission_output(dialog_turn_id_data, retrieval_scores, output_submission_format_path):
"""
Write the model_scores in
"""
submission_format_output=[]
for dialog in dialog_turn_id_data:
_dialog=[]
for ... | [
"json.dump",
"json.load",
"argparse.ArgumentParser"
] | [((1685, 1753), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Response Retrieval Evaluation"""'}), "(description='Response Retrieval Evaluation')\n", (1708, 1753), False, 'import argparse\n'), ((1014, 1080), 'json.dump', 'json.dump', (['submission_format_output', 'f_retrieval_submission... |
""" FrankenStrings Service """
import binascii
import hashlib
import mmap
import os
import re
import traceback
from typing import Dict, Iterable, List, Optional, Set, Tuple
import magic
import pefile
from assemblyline.common.net import is_valid_domain, is_valid_email
from assemblyline.common.str_utils import safe_s... | [
"os.path.join",
"binascii.a2b_base64",
"os.path.exists",
"magic.Magic",
"re.escape",
"hashlib.sha256",
"assemblyline_v4_service.common.balbuzard.patterns.PatternMatch",
"re.findall",
"traceback.format_exc",
"re.search",
"re.sub",
"assemblyline_v4_service.common.result.ResultSection",
"franke... | [((3928, 3977), 'frankenstrings.flarefloss.strings.extract_ascii_strings', 'strings.extract_ascii_strings', (['data'], {'n': 'min_length'}), '(data, n=min_length)\n', (3957, 3977), False, 'from frankenstrings.flarefloss import strings\n'), ((4138, 4189), 'frankenstrings.flarefloss.strings.extract_unicode_strings', 'str... |
# 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.
from recipe_engine.types import freeze
DEPS = [
'adb',
'build',
'chromium',
'chromium_android',
'recipe_engine/json',
'recipe_engine... | [
"recipe_engine.types.freeze",
"recipe_engine.recipe_api.Property"
] | [((428, 2750), 'recipe_engine.types.freeze', 'freeze', (["{'basic_builder': {'target': 'Release', 'build': True},\n 'restart_usb_builder': {'restart_usb': True, 'target': 'Release',\n 'build': True}, 'coverage_builder': {'coverage': True, 'target':\n 'Debug', 'build': True}, 'tester': {}, 'perf_runner': {'perf... |
# ===========================================================================
# Single process:
# 0.0003s
# Multiprocessing:
# ncpu = 1: ~0.16s
# ncpu = 2: ~0.07s
# ===========================================================================
from __future__ import print_function, division, absolute_import
import os
imp... | [
"odin.visual.plot_save",
"odin.fuel.load_iris",
"odin.utils.UnitTimer",
"matplotlib.use",
"odin.visual.plot_scatter",
"odin.ml.MiniBatchPCA"
] | [((335, 356), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (349, 356), False, 'import matplotlib\n'), ((577, 590), 'odin.fuel.load_iris', 'F.load_iris', ([], {}), '()\n', (588, 590), True, 'from odin import fuel as F, visual\n'), ((609, 623), 'odin.ml.MiniBatchPCA', 'MiniBatchPCA', ([], {}), '(... |