code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'prototype_activity_about.ui'
#
# Created by: PyQt5 UI code generator 5.15.4
#
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
# run again. Do not edit this file unless you know what you are doing.
from PyQt5 im... | [
"PyQt5.QtWidgets.QLabel",
"PyQt5.QtWidgets.QSizePolicy",
"PyQt5.QtWidgets.QWidget",
"PyQt5.QtWidgets.QGridLayout",
"PyQt5.QtWidgets.QHBoxLayout",
"PyQt5.QtWidgets.QPushButton",
"PyQt5.QtCore.QSize",
"PyQt5.QtWidgets.QGroupBox",
"PyQt5.QtWidgets.QSpacerItem",
"PyQt5.QtWidgets.QVBoxLayout",
"PyQt5... | [((501, 528), 'PyQt5.QtWidgets.QVBoxLayout', 'QtWidgets.QVBoxLayout', (['Form'], {}), '(Form)\n', (522, 528), False, 'from PyQt5 import QtCore, QtGui, QtWidgets\n'), ((615, 638), 'PyQt5.QtWidgets.QWidget', 'QtWidgets.QWidget', (['Form'], {}), '(Form)\n', (632, 638), False, 'from PyQt5 import QtCore, QtGui, QtWidgets\n'... |
import matrices_new_extended as mne
import numpy as np
import sympy as sp
from equality_check import Point
x, y, z = sp.symbols("x y z")
Point.base_point = np.array([x, y, z, 1])
class Test_Axis_2_x0x:
def test_matrix_2_x0x(self):
expected = Point([ z, -y, x, 1])
calculated = Point.calculate(mne... | [
"sympy.symbols",
"numpy.array",
"equality_check.Point.calculate",
"equality_check.Point"
] | [((118, 137), 'sympy.symbols', 'sp.symbols', (['"""x y z"""'], {}), "('x y z')\n", (128, 137), True, 'import sympy as sp\n'), ((157, 179), 'numpy.array', 'np.array', (['[x, y, z, 1]'], {}), '([x, y, z, 1])\n', (165, 179), True, 'import numpy as np\n'), ((258, 278), 'equality_check.Point', 'Point', (['[z, -y, x, 1]'], {... |
# Copyright 2018 Google, 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... | [
"tensorflow.distributions.Bernoulli",
"sonnet.nest.flatten",
"sonnet.Sequential",
"tensorflow.split",
"tensorflow.distributions.Categorical",
"tensorflow.TensorShape",
"tensorflow.to_float",
"tensorflow.squeeze",
"tensorflow.map_fn",
"sonnet.nest.map",
"tensorflow.name_scope",
"tensorflow.rang... | [((1820, 1854), 'sonnet.nest.flatten', 'snt.nest.flatten', (['self._input_size'], {}), '(self._input_size)\n', (1836, 1854), True, 'import sonnet as snt\n'), ((2048, 2080), 'tensorflow.TensorShape', 'tf.TensorShape', (['[flattened_size]'], {}), '([flattened_size])\n', (2062, 2080), True, 'import tensorflow as tf\n'), (... |
"""URLs for testing."""
from django.http import HttpResponse
from django.urls import path
from model_reviews import views
def homeview(request):
"""Return home page."""
return HttpResponse("<h1>home page</h1>")
urlpatterns = [
path("", homeview),
path("bulk", views.BulkReviewsView.as_view()),
p... | [
"model_reviews.views.BulkReviewsView.as_view",
"model_reviews.views.ReviewView.as_view",
"django.http.HttpResponse",
"django.urls.path"
] | [((187, 221), 'django.http.HttpResponse', 'HttpResponse', (['"""<h1>home page</h1>"""'], {}), "('<h1>home page</h1>')\n", (199, 221), False, 'from django.http import HttpResponse\n'), ((244, 262), 'django.urls.path', 'path', (['""""""', 'homeview'], {}), "('', homeview)\n", (248, 262), False, 'from django.urls import p... |
import logging
import os
from typing import Iterable, Union
from urllib.parse import urlparse
import redis
from fastjsonschema import JsonSchemaException # type: ignore
from werkzeug.exceptions import BadRequest, HTTPException
from werkzeug.routing import Map
from werkzeug.wrappers import Response
from .topics impor... | [
"logging.basicConfig",
"werkzeug.exceptions.BadRequest",
"os.environ.get",
"werkzeug.routing.Map",
"urllib.parse.urlparse"
] | [((496, 536), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.DEBUG'}), '(level=logging.DEBUG)\n', (515, 536), False, 'import logging\n'), ((2658, 2755), 'os.environ.get', 'os.environ.get', (['"""OPENSLIDES_WRITE_SERVICE_DATABASE_URL"""', '"""http://localhost:8008/get-elements"""'], {}), "('OPENSL... |
from graphql.language import parse
from graphql.utilities import build_schema, find_deprecated_usages
def describe_find_deprecated_usages():
schema = build_schema(
"""
enum EnumType {
NORMAL_VALUE
DEPRECATED_VALUE @deprecated(reason: "Some enum reason.")
}
typ... | [
"graphql.language.parse",
"graphql.utilities.build_schema"
] | [((157, 478), 'graphql.utilities.build_schema', 'build_schema', (['"""\n enum EnumType {\n NORMAL_VALUE\n DEPRECATED_VALUE @deprecated(reason: "Some enum reason.")\n }\n\n type Query {\n normalField(enumArg: EnumType): String\n deprecatedField: String @deprecated... |
from sqlalchemy import Table, Column, ForeignKey, BigInteger, Sequence
from sqlalchemy.orm import relationship, backref
def defineRelation11(TableA, TableB):
"""defines relation 1:1 between two tables
Parameters
----------
TableA
Model of first table
TableB
Model of second table
... | [
"sqlalchemy.orm.relationship",
"sqlalchemy.ForeignKey",
"sqlalchemy.Column",
"sqlalchemy.Sequence"
] | [((2424, 2446), 'sqlalchemy.Sequence', 'Sequence', (['"""all_id_seq"""'], {}), "('all_id_seq')\n", (2432, 2446), False, 'from sqlalchemy import Table, Column, ForeignKey, BigInteger, Sequence\n'), ((791, 866), 'sqlalchemy.orm.relationship', 'relationship', (['TableB'], {'back_populates': 'f"""{tableANameSingular}"""', ... |
# Generated by Django 2.0.6 on 2018-07-18 22:29
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('marketplace', '0034_volunteerapplication_reviewer'),
]
operations = [
migr... | [
"django.db.models.ForeignKey"
] | [((442, 721), 'django.db.models.ForeignKey', 'models.ForeignKey', ([], {'blank': '(True)', 'help_text': '"""User that reviewed the membership application"""', 'null': '(True)', 'on_delete': 'django.db.models.deletion.CASCADE', 'related_name': '"""reviewed_organization_membership_request"""', 'to': 'settings.AUTH_USER_M... |
from CNF_Creator import *
import numpy as np
import time
import timeit
#---Parameters-----------------------------------------------
num_of_literals = 50 # Number of literals
pop_size = 10 # Population size of each generation
time_limit = 45
p_mutate = 0.9 # Probability of Mutation
p_mutate_lite... | [
"numpy.zeros",
"time.time",
"numpy.append",
"numpy.random.random",
"numpy.random.randint",
"numpy.random.choice"
] | [((4268, 4298), 'numpy.zeros', 'np.zeros', (['self.population_size'], {}), '(self.population_size)\n', (4276, 4298), True, 'import numpy as np\n'), ((4827, 4852), 'numpy.random.randint', 'np.random.randint', (['length'], {}), '(length)\n', (4844, 4852), True, 'import numpy as np\n'), ((4921, 4970), 'numpy.append', 'np.... |
# vim:ts=4:sw=4:ai:et:si:sts=4
import logging
import statistics
import scippy
logger = logging.getLogger(__name__)
class GridMath(object):
@staticmethod
def arithmetic_mean(readings):
return [statistics.mean(item) if item else None for item in readings]
@staticmethod
def harmonic_mean(read... | [
"statistics.median",
"statistics.pstdev",
"statistics.pvariance",
"statistics.mean",
"statistics.mode",
"logging.getLogger"
] | [((90, 117), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (107, 117), False, 'import logging\n'), ((213, 234), 'statistics.mean', 'statistics.mean', (['item'], {}), '(item)\n', (228, 234), False, 'import statistics\n'), ((805, 828), 'statistics.median', 'statistics.median', (['item'], {... |
import time
from collections import defaultdict
from typing import List, Dict
import numpy as np
def timed(callback, *args, **kwargs):
start = time.time()
result = callback(*args, **kwargs)
return result, time.time() - start
class Timer:
def __init__(self):
self.start = 0.
self.res... | [
"collections.defaultdict",
"numpy.mean",
"time.time"
] | [((150, 161), 'time.time', 'time.time', ([], {}), '()\n', (159, 161), False, 'import time\n'), ((376, 387), 'time.time', 'time.time', ([], {}), '()\n', (385, 387), False, 'import time\n'), ((707, 724), 'collections.defaultdict', 'defaultdict', (['list'], {}), '(list)\n', (718, 724), False, 'from collections import defa... |
"""
Tests for job management
"""
import unittest
import copy
import itertools
from unittest import mock
import re
import os
from IPython.display import HTML
import biokbase.narrative.jobs.jobmanager
from biokbase.narrative.jobs.jobmanager import (
JOB_NOT_REG_ERR,
JOB_NOT_BATCH_ERR,
JOBS_MISSING_FALSY_ERR,... | [
"unittest.main",
"unittest.mock.patch.object",
"copy.deepcopy",
"biokbase.narrative.jobs.jobmanager.get_error_output_state",
"unittest.mock.Mock",
"re.escape",
"unittest.mock.patch",
"itertools.combinations",
"unittest.mock.call",
"re.sub"
] | [((3108, 3169), 'unittest.mock.patch', 'mock.patch', (['"""biokbase.narrative.clients.get"""', 'get_mock_client'], {}), "('biokbase.narrative.clients.get', get_mock_client)\n", (3118, 3169), False, 'from unittest import mock\n'), ((3382, 3443), 'unittest.mock.patch', 'mock.patch', (['"""biokbase.narrative.clients.get""... |
# -*- coding: utf-8 -*-
#
# Copyright 2013-2020 <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 ... | [
"sys.stdin.detach",
"sys.stdout.write",
"sys.stdin.isatty",
"argparse.ArgumentParser",
"sys.stdin.readline",
"sys.stdin.close",
"os.path.isfile",
"sys.stdout.isatty",
"sys.stderr.write",
"itertools.chain.from_iterable",
"os.getenv",
"sys.exit"
] | [((1103, 1120), 'os.getenv', 'os.getenv', (['"""HOME"""'], {}), "('HOME')\n", (1112, 1120), False, 'import os\n'), ((2744, 2843), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'prog': '"""TxtStyle"""', 'description': '"""Prettifies output of console programs."""'}), "(prog='TxtStyle', description=\n 'P... |
import praw, datetime, pytz
from . import utils, exceptions
def r2md(post, **kwargs):
'''
Convert given post to markdown and save it as a file in current path as given file name.
Parameters:
post (:obj:`praw.models.Submission`): A Praw's submission object
fi... | [
"pytz.timezone"
] | [((1815, 1838), 'pytz.timezone', 'pytz.timezone', (['timezone'], {}), '(timezone)\n', (1828, 1838), False, 'import praw, datetime, pytz\n')] |
""" This module contains classes that preprocess the data. """
import calendar
from datetime import datetime
from util.util_functions import *
class CSVProcessor:
""" Class that contains methods to process csv data. """
def fix_date(self, input_date):
""" Function """
months = {v: k for k, v... | [
"datetime.datetime"
] | [((445, 465), 'datetime.datetime', 'datetime', (['(1970)', '(1)', '(1)'], {}), '(1970, 1, 1)\n', (453, 465), False, 'from datetime import datetime\n'), ((961, 991), 'datetime.datetime', 'datetime', (['year', 'month_index', '(1)'], {}), '(year, month_index, 1)\n', (969, 991), False, 'from datetime import datetime\n'), (... |
import random
import sentry_sdk
sentry_sdk.init("https://8e577dc11e2743b4bb2581da3bbcc5a9@sentry.io/1307203")
def answer(question, printable=False):
"""Simulates a magic 8 ball answer to a user's question.
Keyword arguments:
question -- a question made by the user
printable -- prints answer when Tru... | [
"sentry_sdk.init",
"random.seed",
"random.choice"
] | [((33, 110), 'sentry_sdk.init', 'sentry_sdk.init', (['"""https://8e577dc11e2743b4bb2581da3bbcc5a9@sentry.io/1307203"""'], {}), "('https://8e577dc11e2743b4bb2581da3bbcc5a9@sentry.io/1307203')\n", (48, 110), False, 'import sentry_sdk\n'), ((977, 998), 'random.seed', 'random.seed', (['question'], {}), '(question)\n', (988... |
#!/usr/bin/evn python
from __future__ import print_function
import sys
import os
import glob
import fileinput
import socket
import commands
os.system("""echo "TFile.Recover 0" >> .rootrc""")
import ROOT
from argparse import ArgumentParser
from pprint import pprint
#--------------------------------------------------
# u... | [
"argparse.ArgumentParser",
"os.makedirs",
"os.getcwd",
"os.path.exists",
"os.system",
"socket.gethostname",
"ROOT.TFile",
"pprint.pprint",
"os.chdir",
"sys.exit"
] | [((140, 186), 'os.system', 'os.system', (['"""echo "TFile.Recover 0" >> .rootrc"""'], {}), '(\'echo "TFile.Recover 0" >> .rootrc\')\n', (149, 186), False, 'import os\n'), ((1339, 1355), 'argparse.ArgumentParser', 'ArgumentParser', ([], {}), '()\n', (1353, 1355), False, 'from argparse import ArgumentParser\n'), ((4219, ... |
# from io import open_code
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.chrome.options import Options
import time
def account_info():
with open('data.txt','r') as rd:
info = rd.read().split()
email = info[0]
password = info[1]
re... | [
"selenium.webdriver.chrome.options.Options",
"selenium.webdriver.Chrome",
"time.sleep"
] | [((466, 475), 'selenium.webdriver.chrome.options.Options', 'Options', ([], {}), '()\n', (473, 475), False, 'from selenium.webdriver.chrome.options import Options\n'), ((525, 558), 'selenium.webdriver.Chrome', 'webdriver.Chrome', ([], {'options': 'options'}), '(options=options)\n', (541, 558), False, 'from selenium impo... |
import matplotlib.pyplot as plt
from matplotlib import animation
import matplotlib.gridspec as gridspec
from IPython.core.display import HTML
import numpy as np
import math
def animate(sequences, interval=100, blit=True, fig_size=(14, 10), get_fig=False):
if isinstance(sequences, list) or isinstance(sequences, n... | [
"numpy.pad",
"matplotlib.colors.Normalize",
"math.ceil",
"matplotlib.cm.get_cmap",
"numpy.roll",
"numpy.argmax",
"numpy.zeros",
"matplotlib.pyplot.axis",
"matplotlib.animation.ArtistAnimation",
"matplotlib.pyplot.figure",
"numpy.arange",
"numpy.squeeze",
"matplotlib.pyplot.xticks",
"matplo... | [((1273, 1342), 'matplotlib.animation.ArtistAnimation', 'animation.ArtistAnimation', (['fig', 'animate'], {'interval': 'interval', 'blit': 'blit'}), '(fig, animate, interval=interval, blit=blit)\n', (1298, 1342), False, 'from matplotlib import animation\n'), ((350, 368), 'matplotlib.pyplot.subplots', 'plt.subplots', ([... |
#!/usr/bin/env python3
import re
import uuid
import pathlib
import eventlet
import subprocess
from urllib.parse import urlparse
from eventlet.green.subprocess import Popen
from flask import Flask, send_from_directory, jsonify, request
from flask_socketio import SocketIO, emit
from flask_cors import CORS
requests = e... | [
"uuid.uuid4",
"pathlib.Path.cwd",
"flask_cors.CORS",
"flask.Flask",
"eventlet.green.subprocess.Popen",
"flask.jsonify",
"flask_socketio.emit",
"flask_socketio.SocketIO",
"flask.send_from_directory",
"eventlet.import_patched",
"re.search",
"flask.request.get_json",
"urllib.parse.urlparse",
... | [((319, 354), 'eventlet.import_patched', 'eventlet.import_patched', (['"""requests"""'], {}), "('requests')\n", (342, 354), False, 'import eventlet\n'), ((362, 377), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (367, 377), False, 'from flask import Flask, send_from_directory, jsonify, request\n'), ((425,... |
# mdbook-publisher
# Author: <NAME>
# Date: 1/4/2021
import json
import os
import sys
# Global config
config = {}
def generate(name, path):
with open(path, 'r', encoding='utf-8') as f:
summary_text = '# Summary\n\n'
item_array = f.read().split('\n- ')
print(str(len(item_array) - 1) + ' it... | [
"os.mkdir",
"json.load",
"os.path.exists",
"os.system"
] | [((1524, 1566), 'os.system', 'os.system', (["('mdbook build projects/' + name)"], {}), "('mdbook build projects/' + name)\n", (1533, 1566), False, 'import os\n'), ((2054, 2068), 'os.system', 'os.system', (['cmd'], {}), '(cmd)\n', (2063, 2068), False, 'import os\n'), ((2193, 2205), 'json.load', 'json.load', (['f'], {}),... |
from typing import Mapping, Optional
from textwrap import dedent
import discord
from discord import Color, Embed
from discord.ext.commands import Cog, Command, Group, HelpCommand
from helpers.paginator import Paginator
from .views import HelpCommandMenu
class CustomHelpCommand(HelpCommand):
def __init__(self):
... | [
"textwrap.dedent",
"helpers.paginator.Paginator",
"discord.Color.og_blurple"
] | [((2183, 2226), 'helpers.paginator.Paginator', 'Paginator', (['self.context', 'embeds'], {'embed': '(True)'}), '(self.context, embeds, embed=True)\n', (2192, 2226), False, 'from helpers.paginator import Paginator\n'), ((1060, 1079), 'textwrap.dedent', 'dedent', (['description'], {}), '(description)\n', (1066, 1079), Fa... |
# coding: utf-8
from __future__ import absolute_import
from datetime import date, datetime # noqa: F401
from typing import List, Dict # noqa: F401
from swagger_server.models.base_model_ import Model
from swagger_server.models.contact import Contact # noqa: F401,E501
import re # noqa: F401,E501
from swagger_serve... | [
"swagger_server.util.deserialize_model"
] | [((3200, 3233), 'swagger_server.util.deserialize_model', 'util.deserialize_model', (['dikt', 'cls'], {}), '(dikt, cls)\n', (3222, 3233), False, 'from swagger_server import util\n')] |
# -*- coding: utf-8 -*-
###########################################################################
# Copyright (c), The AiiDA team. All rights reserved. #
# This file is part of the AiiDA code. #
# ... | [
"click_completion.init"
] | [((844, 867), 'click_completion.init', 'click_completion.init', ([], {}), '()\n', (865, 867), False, 'import click_completion\n')] |
'''
Clean 'Component', 'Fleet', 'System', 'Mitigation' fields and output csv.
TODO: Refine.
# Author
@ <NAME>
# License
MIT License 2020
'''
# Import libraries and define functions
import re
import numpy as np
import pandas as pd
import matplotlib
import matplotlib.pyplot as plt
# Function to make all strings lowerc... | [
"pandas.read_csv"
] | [((1009, 1064), 'pandas.read_csv', 'pd.read_csv', (['filename'], {'encoding': '"""ISO-8859-1"""', 'dtype': 'str'}), "(filename, encoding='ISO-8859-1', dtype=str)\n", (1020, 1064), True, 'import pandas as pd\n')] |
from automationcommon.models import clear_local_user, set_local_user
class RequestUserMiddleware(object):
"""
Middleware that simply set's the request.user to be used for the audit trail.
"""
def __init__(self, get_response=None):
self.get_response = get_response
def __call__(self, reques... | [
"automationcommon.models.set_local_user",
"automationcommon.models.clear_local_user"
] | [((703, 731), 'automationcommon.models.set_local_user', 'set_local_user', (['request.user'], {}), '(request.user)\n', (717, 731), False, 'from automationcommon.models import clear_local_user, set_local_user\n'), ((912, 930), 'automationcommon.models.clear_local_user', 'clear_local_user', ([], {}), '()\n', (928, 930), F... |
# -*- coding: utf-8 -*-
'''
@Author: <NAME>
@Description: file content
@Date: 2019-04-20 16:53:54
@LastEditTime: 2019-04-21 20:42:41
'''
import os
import sys
import re
import cv2
PATH_RESULT = 'xxx'
PATH_VIDEO = "xxx"
PATH_CROP_IMG = "xx"
def cropXY(img, point1, point2):
min_x = min(int(point1[0]), int(point2[0])... | [
"os.makedirs",
"os.path.isdir",
"cv2.VideoCapture",
"re.findall",
"sys.stdout.flush",
"os.path.join",
"os.listdir"
] | [((942, 965), 'os.listdir', 'os.listdir', (['PATH_RESULT'], {}), '(PATH_RESULT)\n', (952, 965), False, 'import os\n'), ((1040, 1079), 'os.path.join', 'os.path.join', (['PATH_VIDEO', "(name + '.mp4')"], {}), "(PATH_VIDEO, name + '.mp4')\n", (1052, 1079), False, 'import os\n'), ((1099, 1139), 'os.path.join', 'os.path.joi... |
from distutils.core import setup
setup(name='pyLucidIo',
version='',
description='',
author='',
url='',
#py_modules=['lucidIo'],
packages=['PbSignal'])
| [
"distutils.core.setup"
] | [((33, 130), 'distutils.core.setup', 'setup', ([], {'name': '"""pyLucidIo"""', 'version': '""""""', 'description': '""""""', 'author': '""""""', 'url': '""""""', 'packages': "['PbSignal']"}), "(name='pyLucidIo', version='', description='', author='', url='',\n packages=['PbSignal'])\n", (38, 130), False, 'from distu... |
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | [
"copy.deepcopy",
"knack.util.CLIError"
] | [((12637, 12672), 'copy.deepcopy', 'copy.deepcopy', (['virtual_machine.nics'], {}), '(virtual_machine.nics)\n', (12650, 12672), False, 'import copy\n'), ((15179, 15215), 'copy.deepcopy', 'copy.deepcopy', (['virtual_machine.disks'], {}), '(virtual_machine.disks)\n', (15192, 15215), False, 'import copy\n'), ((13230, 1335... |
#! python
# -*- coding: utf-8 -*-
"""
WavyTool is a simple program that allows you to acquire data from input devices,
i.e microphones, and save them as file (csv, png). Also, you can perform
some simple processing as spectral analysis.
:authors: <NAME>, <NAME>
:contact: <EMAIL>, <EMAIL>
:since: 2015/02/27
"""
impo... | [
"qdarkstyle.load_stylesheet_from_environment",
"numpy.empty",
"pyqtgraph.exporters.CSVExporter",
"os.path.join",
"collections.deque",
"os.path.expanduser",
"qtpy.QtWidgets.QSplashScreen",
"logging.warning",
"qtpy.QtCore.QTimer",
"numpy.linspace",
"pyqtgraph.mkPen",
"wavytool.mw_wavy.Ui_MainWin... | [((1169, 1209), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.DEBUG'}), '(level=logging.DEBUG)\n', (1188, 1209), False, 'import logging\n'), ((1242, 1355), 'logging.info', 'logging.info', (['"""Using Qt binding (QtPy/PyQtGraph): %s"""', "(os.environ['QT_API'], os.environ['PYQTGRAPH_QT_LIB'])"], ... |
# coding=utf-8
import argparse
from RedisTCPClient import RedisTCPClient
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument(
'--host',
required=True,
help='host name of redis.'
)
parser.add_argument(
'--port',
required=True,
... | [
"argparse.ArgumentParser"
] | [((117, 142), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (140, 142), False, 'import argparse\n')] |
import argparse
import logging
import os
import random
import socket
import subprocess
import sys
import tempfile
import requests
import retrying
from kubernetes import client, config
from kubernetes.client.rest import ApiException
WAIT_TIMEOUT_SEC: int = 5 * 60
WAIT_SLEEP_SEC: int = 5
# Initialization & basic valid... | [
"argparse.ArgumentParser",
"os.environ.copy",
"socket.socket",
"os.close",
"logging.error",
"random.randint",
"kubernetes.client.CoreV1Api",
"kubernetes.client.AppsV1Api",
"random.seed",
"requests.get",
"retrying.retry",
"subprocess.Popen",
"os.write",
"sys.exit",
"logging.basicConfig",
... | [((326, 423), 'logging.basicConfig', 'logging.basicConfig', ([], {'format': '"""%(asctime)s : %(levelname)s : %(message)s"""', 'level': 'logging.NOTSET'}), "(format='%(asctime)s : %(levelname)s : %(message)s',\n level=logging.NOTSET)\n", (345, 423), False, 'import logging\n'), ((484, 509), 'logging.getLogger', 'logg... |
from torchvision import models
import pretrainedmodels
import torch
from torch import nn
__all__ = ['resnet50', 'resnet152', 'alexnet', 'vgg', 'densenet',
'inception', 'xception', 'nasnetalarge', 'nasnetamobile',
"yolov5s", "yolov5m"]
def set_parameter_requires_grad(model, feature_extracting):... | [
"pretrainedmodels.nasnetalarge",
"pretrainedmodels.nasnetamobile",
"torchvision.models.vgg11_bn",
"torchvision.models.densenet121",
"torchvision.models.alexnet",
"pretrainedmodels.xception",
"torchvision.models.inception_v3",
"torchvision.models.resnet50",
"torch.nn.Linear",
"torch.hub.load",
"t... | [((1000, 1070), 'pretrainedmodels.nasnetalarge', 'pretrainedmodels.nasnetalarge', ([], {'num_classes': '(1000)', 'pretrained': '"""imagenet"""'}), "(num_classes=1000, pretrained='imagenet')\n", (1029, 1070), False, 'import pretrainedmodels\n'), ((1959, 2030), 'pretrainedmodels.nasnetamobile', 'pretrainedmodels.nasnetam... |
import re
import string
import ipaddress
from . import utils
class RequestProtocol(object):
METHOD_GET = 'GET'
METHOD_OPTIONS = 'OPTIONS'
METHOD_HEAD = 'HEAD'
METHOD_POST = 'POST'
METHOD_PUT = 'PUT'
METHOD_DELETE = 'DELETE'
METHOD_TRACE = 'TRACE'
METHOD_CONNECT = 'CONNECT'
HTTP_V... | [
"ipaddress.IPv6Address",
"ipaddress.IPv4Address",
"re.compile"
] | [((1102, 1142), 're.compile', 're.compile', (['""";\\\\s*charset=([^;]*)"""', 're.I'], {}), "(';\\\\s*charset=([^;]*)', re.I)\n", (1112, 1142), False, 'import re\n'), ((1161, 1233), 're.compile', 're.compile', (['"""([a-zA-Z][a-zA-Z_-]*)\\\\s*(?:=(?:"([^"]*)"|([^ \\\\t",;]*)))?"""'], {}), '(\'([a-zA-Z][a-zA-Z_-]*)\\\\s... |
import numpy as np
import tensiga
from tensiga.iga.Nurbs import Nurbs
from tensiga.iga.Bspline import Bspline
from math import sqrt
import os
def UnitCube(n, p):
dim = n
codim = n
deg = [ p for _ in range(n) ]
kv = [ np.repeat([0., 1.], deg[k]+1) for k in range(n) ]
cp_shape = [ deg[k]+1 for k in r... | [
"math.sqrt",
"tensiga.iga.Bspline.Bspline",
"os.path.dirname",
"numpy.zeros",
"numpy.hstack",
"tensiga.iga.Nurbs.Nurbs",
"numpy.prod",
"numpy.array",
"numpy.loadtxt",
"numpy.linspace",
"numpy.unique",
"numpy.repeat"
] | [((1134, 1166), 'tensiga.iga.Bspline.Bspline', 'Bspline', (['dim', 'codim', 'kv', 'deg', 'cp'], {}), '(dim, codim, kv, deg, cp)\n', (1141, 1166), False, 'from tensiga.iga.Bspline import Bspline\n'), ((1547, 1573), 'tensiga.iga.Bspline.Bspline', 'Bspline', (['(1)', '(1)', 'kv', 'deg', 'cp'], {}), '(1, 1, kv, deg, cp)\n'... |
# -*- coding: utf-8 -*-
"""
Created on Thu Jul 9 15:45:53 2020
@author: Antony
"""
import matplotlib.pyplot as plt
import time
from skimage.draw import random_shapes
import numpy as np
import astra
def cirmask(im, npx=0):
"""
Apply a circular mask to the image
"""
... | [
"matplotlib.pyplot.clf",
"numpy.floor",
"matplotlib.pyplot.figure",
"astra.data2d.get",
"pathlib.Path",
"SampleGen.random_sample",
"numpy.arange",
"numpy.round",
"astra.create_vol_geom",
"os.chdir",
"astra.create_projector",
"numpy.random.rand",
"skimage.draw.random_shapes",
"matplotlib.py... | [((820, 831), 'time.time', 'time.time', ([], {}), '()\n', (829, 831), False, 'import time\n'), ((907, 1063), 'skimage.draw.random_shapes', 'random_shapes', (['(sz, sz)'], {'min_shapes': 'min_shapes', 'max_shapes': 'max_shapes', 'multichannel': '(False)', 'min_size': 'min_size', 'max_size': 'max_size', 'allow_overlap': ... |
import os
from flask import current_app
from flask import flash
from flask import redirect
from flask import render_template
from flask import request
from flask import send_from_directory
from flask import url_for
from werkzeug.utils import secure_filename
from utils import download
from . import main
from .. import b... | [
"flask.flash",
"flask.request.args.get",
"os.path.exists",
"werkzeug.utils.secure_filename",
"flask.url_for",
"flask.render_template",
"utils.download_image_url",
"flask.send_from_directory",
"os.path.join"
] | [((1812, 1841), 'flask.render_template', 'render_template', (['"""index.html"""'], {}), "('index.html')\n", (1827, 1841), False, 'from flask import render_template\n'), ((1913, 1941), 'flask.request.args.get', 'request.args.get', (['"""filename"""'], {}), "('filename')\n", (1929, 1941), False, 'from flask import reques... |
import unittest
import math
import pyomo.environ as pe
import coramin
import numpy as np
from coramin.relaxations.segments import compute_k_segment_points
class TestUnivariateExp(unittest.TestCase):
@classmethod
def setUpClass(cls):
model = pe.ConcreteModel()
cls.model = model
model.y ... | [
"math.exp",
"pyomo.environ.log",
"pyomo.environ.SolverFactory",
"coramin.relaxations.PWUnivariateRelaxation",
"pyomo.environ.Constraint",
"pyomo.environ.Var",
"pyomo.environ.value",
"pyomo.environ.Objective",
"pyomo.environ.exp",
"coramin.relaxations.segments.compute_k_segment_points",
"numpy.li... | [((259, 277), 'pyomo.environ.ConcreteModel', 'pe.ConcreteModel', ([], {}), '()\n', (275, 277), True, 'import pyomo.environ as pe\n'), ((322, 330), 'pyomo.environ.Var', 'pe.Var', ([], {}), '()\n', (328, 330), True, 'import pyomo.environ as pe\n'), ((349, 375), 'pyomo.environ.Var', 'pe.Var', ([], {'bounds': '(-1.5, 1.5)'... |
import sys
import re
import time
import argparse
from collections import namedtuple, deque
from itertools import cycle, chain, repeat
import numpy as np
from PIL import Image
import rgbmatrix as rgb
sys.path.append("/home/pi/pixel_art/")
from settings import (NES_PALETTE_HEX, dispmatrix)
from core import *
from sp... | [
"sys.path.append",
"numpy.random.shuffle",
"argparse.ArgumentParser",
"collections.deque",
"settings.dispmatrix.Clear"
] | [((203, 241), 'sys.path.append', 'sys.path.append', (['"""/home/pi/pixel_art/"""'], {}), "('/home/pi/pixel_art/')\n", (218, 241), False, 'import sys\n'), ((1462, 1571), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': 'desc', 'add_help': '(False)', 'epilog': 'epilog', 'formatter_class': 'Custo... |
#!/usr/bin/python
from __future__ import print_function
from logbot import AutoLogger
import logging
import sys
config = {
'stream' : sys.stdout,
'level' : logging.DEBUG
}
print('instantiating new logbot class')
log = AutoLogger(app_name='testapp', config=config)
@log.autolog
def test(a, b, c, d, *args, **k... | [
"logbot.AutoLogger"
] | [((229, 274), 'logbot.AutoLogger', 'AutoLogger', ([], {'app_name': '"""testapp"""', 'config': 'config'}), "(app_name='testapp', config=config)\n", (239, 274), False, 'from logbot import AutoLogger\n')] |
'''
KnockoffGAN Knockoff Variable Generation
<NAME> (9/27/2018)
'''
#%% Necessary Packages
import numpy as np
from tqdm import tqdm
import tensorflow as tf
import logging
import argparse
import pandas as pd
from sklearn.preprocessing import MinMaxScaler
#%% KnockoffGAN Function
'''
Inputs:
x_train: Training data
lamd... | [
"tensorflow.reduce_sum",
"argparse.ArgumentParser",
"tensorflow.nn.tanh",
"pandas.read_csv",
"tensorflow.reset_default_graph",
"sklearn.preprocessing.MinMaxScaler",
"tensorflow.ConfigProto",
"tensorflow.matmul",
"tensorflow.sqrt",
"tensorflow.RunOptions",
"pandas.DataFrame",
"tensorflow.concat... | [((394, 413), 'logging.getLogger', 'logging.getLogger', ([], {}), '()\n', (411, 413), False, 'import logging\n'), ((2404, 2451), 'tensorflow.placeholder', 'tf.placeholder', (['tf.float32'], {'shape': '[None, x_dim]'}), '(tf.float32, shape=[None, x_dim])\n', (2418, 2451), True, 'import tensorflow as tf\n'), ((2496, 2543... |
# -*- coding: utf-8 -*-
"""
Created on Sat Jan 19 13:39:52 2019
@author: <NAME>
"""
import tensorflow as tf
import os
from model.inference_model import InferenceModel
tf.app.flags.DEFINE_string('checkpoints_path', os.path.abspath(os.path.join(os.path.dirname( __file__ ), '..', 'checkpoints/')),
... | [
"tensorflow.saved_model.signature_def_utils.build_signature_def",
"tensorflow.train.Saver",
"tensorflow.saved_model.utils.build_tensor_info",
"os.path.dirname",
"model.inference_model.InferenceModel",
"tensorflow.Session",
"tensorflow.placeholder",
"tensorflow.Graph",
"tensorflow.saved_model.builder... | [((555, 634), 'tensorflow.app.flags.DEFINE_integer', 'tf.app.flags.DEFINE_integer', (['"""model_version"""', '(1)', '"""Version number of the model."""'], {}), "('model_version', 1, 'Version number of the model.')\n", (582, 634), True, 'import tensorflow as tf\n'), ((636, 747), 'tensorflow.app.flags.DEFINE_integer', 't... |
'''Author- <NAME>, Email- <EMAIL>, Year- 2022'''
import os,sys
import logging
from os import get_exec_path
logging.basicConfig(level=logging.INFO, format='%(levelname)s: %(message)s')
from tqdm import tqdm
import torch
from self_supervised.core import ssl_loss
from self_supervised.apply import config
sys.path.append(... | [
"os.path.dirname",
"logging.basicConfig"
] | [((108, 184), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.INFO', 'format': '"""%(levelname)s: %(message)s"""'}), "(level=logging.INFO, format='%(levelname)s: %(message)s')\n", (127, 184), False, 'import logging\n'), ((320, 345), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__fil... |
#!/usr/bin/python
import numpy as np
import sys
import argparse
from assembler import symbolTable, singleInstr, doubleInstr, tripleInstr
from transcoder import key_note_length, offsetArr
from music21 import midi, note, chord
#The stack size and the program size are both 256 for easy addressing
STACK_SIZE = 256
PROG_SI... | [
"sys.stdout.write",
"numpy.uint8",
"argparse.ArgumentParser",
"numpy.zeros",
"music21.midi.translate.midiTrackToStream",
"music21.midi.base.MidiFile",
"music21.chord.Chord",
"music21.note.Note"
] | [((7199, 7275), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""This is a VM to run Ballad (byte)code"""'}), "(description='This is a VM to run Ballad (byte)code')\n", (7222, 7275), False, 'import argparse\n'), ((586, 622), 'numpy.zeros', 'np.zeros', (['STACK_SIZE'], {'dtype': 'np.uint8'}... |
import numpy as np
import matplotlib as mpl
from matplotlib import pyplot as plt
from matplotlib_venn import venn3, venn3_circles
from sympy import ( symbols, solve )
x = symbols( 'x' )
U = 54
N = 2
C = U - N
A = 6
TGx = 10
SGx = 18
TSx = x + A
Tx = 22
Gx = 29
Sx = 39
TS = solve( ( Tx + Gx + Sx - SGx - TGx - TSx... | [
"matplotlib.pyplot.title",
"sympy.symbols",
"sympy.solve",
"matplotlib.pyplot.show",
"matplotlib_venn.venn3"
] | [((172, 184), 'sympy.symbols', 'symbols', (['"""x"""'], {}), "('x')\n", (179, 184), False, 'from sympy import symbols, solve\n'), ((436, 475), 'matplotlib_venn.venn3', 'venn3', ([], {'subsets': '(T, G, TG, S, TS, SG, A)'}), '(subsets=(T, G, TG, S, TS, SG, A))\n', (441, 475), False, 'from matplotlib_venn import venn3, v... |
# -*- coding: utf-8 -*-
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# Authors: <NAME> / Coopérative ARTEFACTS <<EMAIL>>
"""
Item Thematic tests
"""
import factory
import pytest
import sys
from django.core.managem... | [
"django.urls.reverse",
"parameterized.parameterized.expand",
"factory.build"
] | [((1976, 2020), 'parameterized.parameterized.expand', 'parameterized.expand', (['ITEMTHEMATIC_STRUCTURE'], {}), '(ITEMTHEMATIC_STRUCTURE)\n', (1996, 2020), False, 'from parameterized import parameterized\n'), ((1557, 1608), 'django.urls.reverse', 'reverse', (['"""itemthematic-list"""'], {'kwargs': "{'item_pk': 1}"}), "... |
# Copyright 2019 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | [
"unittest.main",
"tempfile.TemporaryDirectory",
"os.getpid",
"concurrent.futures.ProcessPoolExecutor",
"time.sleep",
"time.time",
"persistent_queue.Queue",
"concurrent.futures.ThreadPoolExecutor",
"os.path.join"
] | [((5239, 5254), 'unittest.main', 'unittest.main', ([], {}), '()\n', (5252, 5254), False, 'import unittest\n'), ((807, 841), 'persistent_queue.Queue', 'persistent_queue.Queue', (['""":memory:"""'], {}), "(':memory:')\n", (829, 841), False, 'import persistent_queue\n'), ((929, 963), 'persistent_queue.Queue', 'persistent_... |
from features.importers.venepaikka_harbors.importer import VenepaikkaHarborsClient
from features.models import ContactInfo, Feature
from features.tests.factories import ContactInfoFactory
HARBORS_URL = VenepaikkaHarborsClient.url
HARBOR_ID = "SGFyYm9yTm9kZTpiNzE0ODE1NC1kYmE5LTRlM2ItOWQ2ZS1jNTYzNmEyNWFhMzk="
def test... | [
"features.models.Feature.objects.get",
"features.models.ContactInfo.objects.count"
] | [((503, 543), 'features.models.Feature.objects.get', 'Feature.objects.get', ([], {'source_id': 'HARBOR_ID'}), '(source_id=HARBOR_ID)\n', (522, 543), False, 'from features.models import ContactInfo, Feature\n'), ((1520, 1547), 'features.models.ContactInfo.objects.count', 'ContactInfo.objects.count', ([], {}), '()\n', (1... |
# MIT License
# Copyright 2017,Code 4 Canada
# written by and for the bicycle parking project, a joint project of
# Civic Tech Toronto, Cycle Toronto, Code 4 Canada, and the
# City of Toronto
#
# Modified 2017 10 28
# Purpose add geocode to view
#
# Modified 2018 02 27
# Purpose added code to write to separate picture ... | [
"bicycleparking.models.Approval.objects.values_list",
"bicycleparking.photos.gcpuploader.GCPUploader",
"bicycleparking.models.Picture",
"json.loads",
"django.http.HttpResponse",
"bicycleparking.models.BetaComments.objects.all",
"django.http.JsonResponse",
"base64.b64decode",
"bicycleparking.geocode.... | [((1751, 1799), 'django.shortcuts.render', 'render', (['request', '"""bicycleparking/index.html"""', '{}'], {}), "(request, 'bicycleparking/index.html', {})\n", (1757, 1799), False, 'from django.shortcuts import render\n'), ((2134, 2160), 'bicycleparking.models.SurveyAnswer.objects.all', 'SurveyAnswer.objects.all', ([]... |
import sys
list1=['a','b','c','d','e','f','g','h','i','j','k','l','m']
list2=['n','o','p','q','r','s','t','u','v','w','x','y','z']
w=input("Enter a word ")
prepartner=prepartner1=[]
postpartner1=postpartner=[]
for i in w:
if(i in list1):
prepartner.append(i)
if(i in list2):
postpartner... | [
"sys.exit"
] | [((532, 542), 'sys.exit', 'sys.exit', ([], {}), '()\n', (540, 542), False, 'import sys\n'), ((933, 943), 'sys.exit', 'sys.exit', ([], {}), '()\n', (941, 943), False, 'import sys\n')] |
# coding: utf-8
from __future__ import absolute_import
from flask import json
from six import BytesIO
from swagger_server.test import BaseTestCase
class TestClassAttributeController(BaseTestCase):
"""ClassAttributeController integration test stubs"""
def test_get_class_attributes(self):
"""Test ca... | [
"unittest.main"
] | [((802, 817), 'unittest.main', 'unittest.main', ([], {}), '()\n', (815, 817), False, 'import unittest\n')] |
import json
from app import db, create_app
from tests.base import BaseTestHelper
class ReviewsTestCase(BaseTestHelper):
# reviews url
review_url = 'api/v2/businesses/{}/reviews'
"""class for testing reviews"""
def setUp(self):
"""initilize the app and
set test variables"""
sel... | [
"app.create_app",
"app.db.create_all",
"app.db.drop_all",
"app.db.session.remove"
] | [((328, 361), 'app.create_app', 'create_app', ([], {'config_name': '"""testing"""'}), "(config_name='testing')\n", (338, 361), False, 'from app import db, create_app\n'), ((867, 882), 'app.db.create_all', 'db.create_all', ([], {}), '()\n', (880, 882), False, 'from app import db, create_app\n'), ((3793, 3812), 'app.db.s... |
import argparse
import os
import subprocess
import sys
import ssl
import urllib.request
import tarfile
parser = argparse.ArgumentParser()
parser.add_argument(
'--name',
required=True,
)
parser.add_argument(
'--url',
required=True,
)
parser.add_argument(
'--token',
required=True,
)
args = pa... | [
"os.mkdir",
"argparse.ArgumentParser",
"os.path.isdir",
"subprocess.call",
"tarfile.open",
"sys.exit"
] | [((113, 138), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (136, 138), False, 'import argparse\n'), ((1191, 1237), 'os.path.isdir', 'os.path.isdir', (["(actions_runner_path + '.runner')"], {}), "(actions_runner_path + '.runner')\n", (1204, 1237), False, 'import os\n'), ((1454, 1473), 'sys.exi... |
from setuptools import setup
setup(
name="fuzz",
version="0.1.1",
description="Contains tools for modelling values with associated uncertainty.",
url="https://fuzz.samireland.com",
author="<NAME>",
author_email="<EMAIL>",
license="MIT",
classifiers=[
"Development Status :: 4 - Beta",
"Intended Audience :: ... | [
"setuptools.setup"
] | [((30, 882), 'setuptools.setup', 'setup', ([], {'name': '"""fuzz"""', 'version': '"""0.1.1"""', 'description': '"""Contains tools for modelling values with associated uncertainty."""', 'url': '"""https://fuzz.samireland.com"""', 'author': '"""<NAME>"""', 'author_email': '"""<EMAIL>"""', 'license': '"""MIT"""', 'classif... |
# Build the speaker and phone networks.
# In this framework, they are both TDNN with different settings.
# The speaker network is a hard-coded TDNN and the phone network is specified by the parameters.
# Of course, the speaker network can be modified (e.g. to a larger network). Meanwhile, the parameters for the
# phone... | [
"tensorflow.contrib.layers.l2_regularizer",
"model.multitask_v1.pooling.statistics_pooling_v2",
"tensorflow.variable_scope",
"tensorflow.squeeze",
"model.common.shape_list",
"tensorflow.layers.batch_normalization",
"tensorflow.expand_dims"
] | [((1534, 1585), 'tensorflow.variable_scope', 'tf.variable_scope', (['"""encoder"""'], {'reuse': 'reuse_variables'}), "('encoder', reuse=reuse_variables)\n", (1551, 1585), True, 'import tensorflow as tf\n'), ((2128, 2241), 'tensorflow.layers.batch_normalization', 'tf.layers.batch_normalization', (['features'], {'momentu... |
import unittest
from katas.kyu_8.volume_of_a_cuboid import get_volume_of_cuboid
class GetVolumeOfCuboidTestCase(unittest.TestCase):
def test_equal_1(self):
self.assertEqual(get_volume_of_cuboid(1, 2, 2), 4)
def test_equal_2(self):
self.assertEqual(get_volume_of_cuboid(6.3, 2, 5), 63)
| [
"katas.kyu_8.volume_of_a_cuboid.get_volume_of_cuboid"
] | [((188, 217), 'katas.kyu_8.volume_of_a_cuboid.get_volume_of_cuboid', 'get_volume_of_cuboid', (['(1)', '(2)', '(2)'], {}), '(1, 2, 2)\n', (208, 217), False, 'from katas.kyu_8.volume_of_a_cuboid import get_volume_of_cuboid\n'), ((276, 307), 'katas.kyu_8.volume_of_a_cuboid.get_volume_of_cuboid', 'get_volume_of_cuboid', ([... |
"""
Copyright contributors to the Application Gateway project
"""
import logging
import yaml
import os
import sys
from functools import reduce
logger = logging.getLogger(__name__)
class Environment(object):
"""
This class is used to manage access to the configuration data for the
test run.
"""
... | [
"os.path.dirname",
"os.environ.get",
"os.path.isfile",
"yaml.safe_load",
"sys.exit",
"logging.getLogger"
] | [((156, 183), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (173, 183), False, 'import logging\n'), ((3006, 3045), 'os.environ.get', 'os.environ.get', (['"""IS_CONTAINER"""', '"""false"""'], {}), "('IS_CONTAINER', 'false')\n", (3020, 3045), False, 'import os\n'), ((2542, 2569), 'os.path.... |
import shutil
import os
import zipfile
with zipfile.ZipFile('Backup.zip','w') as my_zip:
my_zip.write('Finance.db')
src='Backup.zip'
dst='E:/backup'
shutil.copy(src=src,dst=dst) | [
"zipfile.ZipFile",
"shutil.copy"
] | [((167, 196), 'shutil.copy', 'shutil.copy', ([], {'src': 'src', 'dst': 'dst'}), '(src=src, dst=dst)\n', (178, 196), False, 'import shutil\n'), ((49, 83), 'zipfile.ZipFile', 'zipfile.ZipFile', (['"""Backup.zip"""', '"""w"""'], {}), "('Backup.zip', 'w')\n", (64, 83), False, 'import zipfile\n')] |
# coding=utf-8
from OTLMOW.OTLModel.BaseClasses.OTLAttribuut import OTLAttribuut
from OTLMOW.OTLModel.Classes.NaampadObject import NaampadObject
from OTLMOW.OTLModel.Datatypes.KlPadNetwerkprotectie import KlPadNetwerkprotectie
from OTLMOW.GeometrieArtefact.GeenGeometrie import GeenGeometrie
# Generated with OTLClassC... | [
"OTLMOW.OTLModel.BaseClasses.OTLAttribuut.OTLAttribuut",
"OTLMOW.OTLModel.Classes.NaampadObject.NaampadObject.__init__",
"OTLMOW.GeometrieArtefact.GeenGeometrie.GeenGeometrie.__init__"
] | [((750, 778), 'OTLMOW.OTLModel.Classes.NaampadObject.NaampadObject.__init__', 'NaampadObject.__init__', (['self'], {}), '(self)\n', (772, 778), False, 'from OTLMOW.OTLModel.Classes.NaampadObject import NaampadObject\n'), ((787, 815), 'OTLMOW.GeometrieArtefact.GeenGeometrie.GeenGeometrie.__init__', 'GeenGeometrie.__init... |
from app import db_main, app
from app.helper.sqlalchemy import ObjectIDField
from sqlalchemy.ext.declarative import declared_attr
from datetime import datetime
from re import sub as re_sub
from bson.objectid import ObjectId
from bson.errors import InvalidId
from werkzeug.routing import BaseConverter, ValidationError
fr... | [
"app.db_main.session.flush",
"app.db_main.session.add",
"bson.objectid.ObjectId",
"app.db_main.session.rollback",
"app.db_main.session.delete",
"app.db_main.session.commit",
"app.db_main.DateTime",
"app.helper.sqlalchemy.ObjectIDField",
"werkzeug.routing.ValidationError",
"functools.wraps",
"re.... | [((1207, 1248), 're.sub', 're_sub', (['"""(.)([A-Z][a-z]+)"""', '"""\\\\1_\\\\2"""', 's0'], {}), "('(.)([A-Z][a-z]+)', '\\\\1_\\\\2', s0)\n", (1213, 1248), True, 'from re import sub as re_sub\n'), ((2280, 2334), 'app.db_main.Column', 'db_main.Column', (['db_main.Integer'], {'index': '(True)', 'default': '(0)'}), '(db_m... |
'''
This code defines the object relational model classes that sqlalchemy uses.
Each class maps to a table in the database.
'''
# Create the sqlite database and map python objects
# Configuration: import all modules needed
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import relationship... | [
"sqlalchemy.ForeignKey",
"sqlalchemy.ext.declarative.declarative_base",
"sqlalchemy.orm.relationship",
"sqlalchemy.Column",
"sqlalchemy.String"
] | [((495, 513), 'sqlalchemy.ext.declarative.declarative_base', 'declarative_base', ([], {}), '()\n', (511, 513), False, 'from sqlalchemy.ext.declarative import declarative_base\n'), ((664, 697), 'sqlalchemy.Column', 'Column', (['Integer'], {'primary_key': '(True)'}), '(Integer, primary_key=True)\n', (670, 697), False, 'f... |
"""
Django settings for professorSheetCheap project.
Generated by 'django-admin startproject' using Django 2.0.5.
For more information on this file, see
https://docs.djangoproject.com/en/2.0/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.0/ref/settings/
"""
... | [
"os.path.abspath",
"os.path.join",
"os.getenv"
] | [((599, 624), 'os.path.abspath', 'os.path.abspath', (['__file__'], {}), '(__file__)\n', (614, 624), False, 'import os\n'), ((2424, 2460), 'os.path.join', 'os.path.join', (['BASE_DIR', '"""db.sqlite3"""'], {}), "(BASE_DIR, 'db.sqlite3')\n", (2436, 2460), False, 'import os\n'), ((1781, 1816), 'os.path.join', 'os.path.joi... |
import logging
import os
import colorama
from . import locked
from ..exceptions import RecursiveAddingWhileUsingFilename
from ..output.base import OutputDoesNotExistError
from ..progress import Tqdm
from ..repo.scm_context import scm_context
from ..stage import Stage
from ..utils import LARGE_DIR_SIZE
logger = loggi... | [
"os.path.isdir",
"logging.getLogger"
] | [((315, 342), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (332, 342), False, 'import logging\n'), ((2588, 2609), 'os.path.isdir', 'os.path.isdir', (['target'], {}), '(target)\n', (2601, 2609), False, 'import os\n'), ((1039, 1060), 'os.path.isdir', 'os.path.isdir', (['target'], {}), '(t... |
from Utils.Array import input_array
class Node:
def __init__(self, data):
self.data = data
self.next = None
def input_linked_list() -> Node:
"""
In our case, we do not need -1 to stop taking input
"""
linked_list_data = input_array()
temporary_node = Node(-9999999)
head ... | [
"Utils.Array.input_array"
] | [((260, 273), 'Utils.Array.input_array', 'input_array', ([], {}), '()\n', (271, 273), False, 'from Utils.Array import input_array\n'), ((851, 870), 'Utils.Array.input_array', 'input_array', (['"""LL :"""'], {}), "('LL :')\n", (862, 870), False, 'from Utils.Array import input_array\n')] |
from numpy.random import choice
from statistics import mode
KEY = 0
VALUE = 1
TWICE = 2
THRICE = 3
PROBABILITY = [0.30, 0.265, 0.179, 0.129, 0.073, 0.035, 0.019]
NOTHING = ":x:"
CHERRY = ":cherries:"
BLUEBERRY = ":blueberries:"
COIN = ":coin:"
CARD = ":credit_card:"
GEM = ":gem:"
EIGHTBALL = ":8ball:"
SLOT = [NOTHING... | [
"statistics.mode",
"numpy.random.choice"
] | [((849, 889), 'numpy.random.choice', 'choice', (['SLOT'], {'size': 'THRICE', 'p': 'PROBABILITY'}), '(SLOT, size=THRICE, p=PROBABILITY)\n', (855, 889), False, 'from numpy.random import choice\n'), ((1038, 1047), 'statistics.mode', 'mode', (['row'], {}), '(row)\n', (1042, 1047), False, 'from statistics import mode\n')] |
import warnings
from django.conf import settings
# Avoid shadowing the login() and logout() views below.
from django.contrib import messages
from django.contrib.auth import (
get_user_model, update_session_auth_hash
)
from django.contrib.auth.forms import (
PasswordResetForm, SetPasswordForm, PasswordChangeFor... | [
"django.core.urlresolvers.reverse",
"django.contrib.messages.error",
"django.http.HttpResponseRedirect",
"django.contrib.auth.login",
"django.contrib.auth.models.User.objects.get",
"django.contrib.auth.logout",
"django.contrib.auth.forms.PasswordChangeForm",
"django.shortcuts.render",
"django.utils.... | [((10141, 10168), 'django.views.decorators.debug.sensitive_post_parameters', 'sensitive_post_parameters', ([], {}), '()\n', (10166, 10168), False, 'from django.views.decorators.debug import sensitive_post_parameters\n'), ((2675, 2738), 'django.shortcuts.render', 'render', (['request', '"""session/contact_u.html"""', "{... |
# coding: utf-8
# # Exploratory data analysis of TCGA mutation data
# In[1]:
import os
import numpy
import pandas
import seaborn
get_ipython().run_line_magic('matplotlib', 'inline')
# ## Read TCGA datasets
# In[2]:
path = os.path.join('data', 'mutation-matrix.tsv.bz2')
mutation_df = pandas.read_table(path, ... | [
"seaborn.heatmap",
"numpy.expm1",
"seaborn.distplot",
"seaborn.jointplot",
"pandas.read_table",
"os.path.join",
"numpy.log1p"
] | [((234, 281), 'os.path.join', 'os.path.join', (['"""data"""', '"""mutation-matrix.tsv.bz2"""'], {}), "('data', 'mutation-matrix.tsv.bz2')\n", (246, 281), False, 'import os\n'), ((296, 332), 'pandas.read_table', 'pandas.read_table', (['path'], {'index_col': '(0)'}), '(path, index_col=0)\n', (313, 332), False, 'import pa... |
import requests
from bs4 import BeautifulSoup
import json
import csv
class ProxyScraper:
results = []
def fetch(self, url):
"""Fetch data from url"""
return requests.get(url)
def parse(self, html):
"""Parse the result of fetch"""
soup = BeautifulSoup(html, 'html.parser')
... | [
"bs4.BeautifulSoup",
"csv.writer",
"requests.get"
] | [((184, 201), 'requests.get', 'requests.get', (['url'], {}), '(url)\n', (196, 201), False, 'import requests\n'), ((285, 319), 'bs4.BeautifulSoup', 'BeautifulSoup', (['html', '"""html.parser"""'], {}), "(html, 'html.parser')\n", (298, 319), False, 'from bs4 import BeautifulSoup\n'), ((780, 798), 'csv.writer', 'csv.write... |
"""
Ipc Transmitter Module
"""
import win32api, win32pipe, win32file, pywintypes
import json
class IpcOutHandler:
__pipe_out__ = None # パイプ(内部保持)
__is_initialize__ = False # 初期化されたかどうか
__is_finalize__ = False # 破棄されたかどうか
__seqno_counter__ = 0 ... | [
"win32pipe.CreateNamedPipe",
"win32pipe.DisconnectNamedPipe",
"win32pipe.ConnectNamedPipe",
"json.dumps"
] | [((2808, 2919), 'json.dumps', 'json.dumps', (["{'command': commname, 'seqNo': seqno, 'type': commtype, 'param': commparam}"], {'ensure_ascii': '(False)'}), "({'command': commname, 'seqNo': seqno, 'type': commtype, 'param':\n commparam}, ensure_ascii=False)\n", (2818, 2919), False, 'import json\n'), ((2952, 3080), 'j... |
import factory
from .models import Group
class GroupFactory(factory.DjangoModelFactory):
remote_id = factory.Sequence(lambda n: n)
class Meta:
model = Group
| [
"factory.Sequence"
] | [((109, 138), 'factory.Sequence', 'factory.Sequence', (['(lambda n: n)'], {}), '(lambda n: n)\n', (125, 138), False, 'import factory\n')] |
# --------------
# Importing header files
import numpy as np
import warnings
warnings.filterwarnings('ignore')
#New record
new_record=[[50, 9, 4, 1, 0, 0, 40, 0]]
#Reading file
data = np.genfromtxt(path, delimiter=",", skip_header=1)
new=np.concatenate((data,new_record),axis=0)
age=new[:,0]
max_ag... | [
"numpy.sum",
"warnings.filterwarnings",
"numpy.std",
"numpy.genfromtxt",
"numpy.max",
"numpy.min",
"numpy.mean",
"numpy.array",
"numpy.concatenate"
] | [((82, 115), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {}), "('ignore')\n", (105, 115), False, 'import warnings\n'), ((203, 252), 'numpy.genfromtxt', 'np.genfromtxt', (['path'], {'delimiter': '""","""', 'skip_header': '(1)'}), "(path, delimiter=',', skip_header=1)\n", (216, 252), True, 'i... |
from django.contrib import admin
from core.models import Universe, Year
class UniverseAdmin(admin.ModelAdmin):
list_display = ('name',)
class YearAdmin(admin.ModelAdmin):
list_display = ('year', 'current_year', 'universe')
admin.site.register(Universe, UniverseAdmin)
admin.site.register(Year, YearAdmin)... | [
"django.contrib.admin.site.register"
] | [((239, 283), 'django.contrib.admin.site.register', 'admin.site.register', (['Universe', 'UniverseAdmin'], {}), '(Universe, UniverseAdmin)\n', (258, 283), False, 'from django.contrib import admin\n'), ((284, 320), 'django.contrib.admin.site.register', 'admin.site.register', (['Year', 'YearAdmin'], {}), '(Year, YearAdmi... |
#Contains tables, every model represents a table in the database
from .database import Base
from sqlalchemy import TIMESTAMP, Column, Integer, String, Boolean
from sqlalchemy.sql.expression import text
class Post(Base):
__tablename__ = "posts"
id = Column(Integer, primary_key=True, nullable=False)
title =... | [
"sqlalchemy.sql.expression.text",
"sqlalchemy.TIMESTAMP",
"sqlalchemy.Column"
] | [((259, 308), 'sqlalchemy.Column', 'Column', (['Integer'], {'primary_key': '(True)', 'nullable': '(False)'}), '(Integer, primary_key=True, nullable=False)\n', (265, 308), False, 'from sqlalchemy import TIMESTAMP, Column, Integer, String, Boolean\n'), ((321, 351), 'sqlalchemy.Column', 'Column', (['String'], {'nullable':... |
""" A collection of common routines for plotting ones """
import time
import matplotlib.pyplot as plt
import numpy as np
from lamberthub.utils.misc import _get_sample_vectors_from_theta_and_rho
class TauThetaPlotter:
"""A class for modelling a discrete grid contour plotter."""
def __init__(self, ax=None, ... | [
"numpy.vectorize",
"time.perf_counter",
"lamberthub.utils.misc._get_sample_vectors_from_theta_and_rho",
"numpy.linalg.norm",
"numpy.array",
"numpy.linspace",
"numpy.cos",
"numpy.log10",
"matplotlib.pyplot.subplots"
] | [((6346, 6444), 'numpy.vectorize', 'np.vectorize', (['_measure_performance'], {'otypes': '[np.ndarray, np.ndarray, np.ndarray]', 'excluded': '[0]'}), '(_measure_performance, otypes=[np.ndarray, np.ndarray, np.\n ndarray], excluded=[0])\n', (6358, 6444), True, 'import numpy as np\n'), ((5144, 5194), 'lamberthub.utils... |
# shows album info for a URN or URL
import spotipy
import sys
import pprint
if len(sys.argv) > 1:
urn = sys.argv[1]
else:
urn = 'spotify:album:5yTx83u3qerZF7GRJu7eFk'
sp = spotipy.Spotify()
album = sp.album(urn)
pprint.pprint(album)
| [
"spotipy.Spotify",
"pprint.pprint"
] | [((185, 202), 'spotipy.Spotify', 'spotipy.Spotify', ([], {}), '()\n', (200, 202), False, 'import spotipy\n'), ((225, 245), 'pprint.pprint', 'pprint.pprint', (['album'], {}), '(album)\n', (238, 245), False, 'import pprint\n')] |
"""Script to import/export all the skeleton related objects."""
# ***** BEGIN LICENSE BLOCK *****
#
# Copyright © 2012, NIF File Format Library and Tools contributors.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the followi... | [
"io_scene_niftools.utils.math.nifformat_to_mathutils_matrix",
"io_scene_niftools.utils.math.set_bone_orientation",
"io_scene_niftools.modules.nif_import.animation.transform.TransformAnimation",
"io_scene_niftools.utils.blocks.safe_decode",
"pyffi.formats.nif.NifFormat.Matrix44",
"bpy.data.armatures.new",
... | [((2511, 2531), 'io_scene_niftools.modules.nif_import.animation.transform.TransformAnimation', 'TransformAnimation', ([], {}), '()\n', (2529, 2531), False, 'from io_scene_niftools.modules.nif_import.animation.transform import TransformAnimation\n'), ((2970, 3024), 'io_scene_niftools.utils.logging.NifLog.debug', 'NifLog... |
# Generated by Django 3.0.5 on 2022-03-09 18:26
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('registration', '0003_auto_20220308_0149'),
]
operations = [
migrations.Create... | [
"django.db.models.TextField",
"django.db.models.ForeignKey",
"django.db.models.CharField",
"django.db.models.SlugField",
"django.db.models.AutoField"
] | [((3493, 3617), 'django.db.models.ForeignKey', 'models.ForeignKey', ([], {'on_delete': 'django.db.models.deletion.CASCADE', 'related_name': '"""race_categories"""', 'to': '"""registration.Races"""'}), "(on_delete=django.db.models.deletion.CASCADE, related_name\n ='race_categories', to='registration.Races')\n", (3510... |
from os import close
import json
import re
from PIL import Image
DIR = "/home/vishals/Dataset/UFPR-ALPR/UFPR-ALPR dataset/training"
FINAL = "data_coco_train.json"
def write_json(data, filename=FINAL):
with open(filename, 'w') as f:
json.dump(data, f, indent=4)
# =========================================... | [
"json.dump",
"json.load",
"PIL.Image.open"
] | [((247, 275), 'json.dump', 'json.dump', (['data', 'f'], {'indent': '(4)'}), '(data, f, indent=4)\n', (256, 275), False, 'import json\n'), ((767, 787), 'json.load', 'json.load', (['json_file'], {}), '(json_file)\n', (776, 787), False, 'import json\n'), ((2475, 2495), 'json.load', 'json.load', (['json_file'], {}), '(json... |
from tensorflow.keras import Model
from tensorflow.keras.layers import Conv2D, Flatten, Dense, Input
class CNN2Net(Model):
def __init__(self, output_dim=3):
"""
Args:
output_dim: 网络需要三个输出,对应3个动作的累积回报
"""
super(CNN2Net, self).__init__()
self.c1 = Conv2D(filters=... | [
"tensorflow.keras.layers.Dense",
"tensorflow.keras.layers.Conv2D",
"tensorflow.keras.layers.Input",
"tensorflow.keras.layers.Flatten"
] | [((305, 373), 'tensorflow.keras.layers.Conv2D', 'Conv2D', ([], {'filters': '(16)', 'kernel_size': '(4, 4)', 'strides': '(2)', 'activation': '"""relu"""'}), "(filters=16, kernel_size=(4, 4), strides=2, activation='relu')\n", (311, 373), False, 'from tensorflow.keras.layers import Conv2D, Flatten, Dense, Input\n'), ((399... |
# -*- coding: utf-8 -*-
from copy import deepcopy
import numpy as np
import pytest
from pygam import *
from pygam.terms import Term, Intercept, SplineTerm, LinearTerm, FactorTerm, TensorTerm, TermList
from pygam.utils import flatten
@pytest.fixture
def chicago_gam(chicago_X_y):
X, y = chicago_X_y
gam = Pois... | [
"copy.deepcopy",
"pygam.utils.flatten",
"numpy.allclose",
"pygam.terms.FactorTerm",
"pygam.penalties.derivative",
"pygam.terms.Term.build_from_info",
"pytest.raises",
"pygam.terms.TensorTerm",
"numpy.arange",
"pygam.terms.SplineTerm",
"numpy.linspace",
"pygam.terms.LinearTerm",
"pygam.terms.... | [((1283, 1296), 'pygam.terms.SplineTerm', 'SplineTerm', (['(0)'], {}), '(0)\n', (1293, 1296), False, 'from pygam.terms import Term, Intercept, SplineTerm, LinearTerm, FactorTerm, TensorTerm, TermList\n'), ((1693, 1746), 'numpy.allclose', 'np.allclose', (['gam.coef_', 'chicago_gam.coef_'], {'atol': '(1e-06)'}), '(gam.co... |
from serial import Serial
import time
from PyQt5.QtCore import pyqtSignal, QObject, QTimer
from PyQt5.QtWidgets import QMessageBox
from PyQt5 import QtTest
from math import isclose
import numpy as np
class Stages(QObject):
def __init__(self,parent=None):
super().__init__()
... | [
"serial.Serial",
"PyQt5.QtCore.QTimer",
"numpy.abs",
"numpy.asarray",
"PyQt5.QtTest.QTest.qWait",
"PyQt5.QtWidgets.QMessageBox.question",
"numpy.sqrt"
] | [((1056, 1083), 'numpy.asarray', 'np.asarray', (['[0.0, 0.0, 0.0]'], {}), '([0.0, 0.0, 0.0])\n', (1066, 1083), True, 'import numpy as np\n'), ((1110, 1137), 'numpy.asarray', 'np.asarray', (['[0.1, 0.1, 0.1]'], {}), '([0.1, 0.1, 0.1])\n', (1120, 1137), True, 'import numpy as np\n'), ((5024, 5173), 'PyQt5.QtWidgets.QMess... |
import numpy as np
from scipy.ndimage import gaussian_filter1d
from . import ExpFilter, Source, Visualizer
from .melbank import compute_melmat
class Sampler:
y_rolling: np.ndarray
source: Source
_gamma_table = None
def __init__(self, source: Source, visualizer: Visualizer, gamma_table_path: str = No... | [
"numpy.pad",
"numpy.load",
"numpy.fft.rfft",
"numpy.abs",
"numpy.sum",
"numpy.copy",
"numpy.array_equal",
"scipy.ndimage.gaussian_filter1d",
"numpy.log2",
"numpy.clip",
"numpy.tile",
"numpy.array_split",
"numpy.concatenate"
] | [((719, 751), 'numpy.tile', 'np.tile', (['(1)', '(3, self.num_pixels)'], {}), '(1, (3, self.num_pixels))\n', (726, 751), True, 'import numpy as np\n'), ((779, 813), 'numpy.tile', 'np.tile', (['(253)', '(3, self.num_pixels)'], {}), '(253, (3, self.num_pixels))\n', (786, 813), True, 'import numpy as np\n'), ((2279, 2310)... |
import random
from telegram import Update
from telegram.ext import MessageHandler, Filters
from feature.base_command import BaseCommand
class ReplyKudoMessage(BaseCommand):
def __init__(self):
self.messages = [
"Sick Beast!",
"Teamwork!",
"Aye aye boi",
"S... | [
"telegram.ext.MessageHandler",
"random.choice"
] | [((1081, 1140), 'telegram.ext.MessageHandler', 'MessageHandler', (['(Filters.text & ~Filters.command)', 'reply_kudo'], {}), '(Filters.text & ~Filters.command, reply_kudo)\n', (1095, 1140), False, 'from telegram.ext import MessageHandler, Filters\n'), ((934, 962), 'random.choice', 'random.choice', (['self.messages'], {}... |
from flask_wtf import FlaskForm
from wtforms import TextField, PasswordField, SubmitField
from wtforms.fields.html5 import EmailField
from wtforms.validators import DataRequired, Length, Email, EqualTo
from wtforms import ValidationError
from ..models.models import User
class RegisterForm(FlaskForm):
username = Te... | [
"wtforms.ValidationError",
"wtforms.validators.Length",
"wtforms.validators.Email",
"wtforms.SubmitField",
"wtforms.validators.EqualTo",
"wtforms.PasswordField",
"wtforms.validators.DataRequired"
] | [((623, 656), 'wtforms.PasswordField', 'PasswordField', (['"""Confirm Password"""'], {}), "('Confirm Password')\n", (636, 656), False, 'from wtforms import TextField, PasswordField, SubmitField\n'), ((670, 691), 'wtforms.SubmitField', 'SubmitField', (['"""Submit"""'], {}), "('Submit')\n", (681, 691), False, 'from wtfor... |
"""
Base Settings - standard Django settings and others needed in all environments
"""
import os
# Filesystem path to the project directory
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = os.environ.get('DJANGO_SEC... | [
"os.environ.get",
"os.path.abspath",
"os.path.join"
] | [((294, 329), 'os.environ.get', 'os.environ.get', (['"""DJANGO_SECRET_KEY"""'], {}), "('DJANGO_SECRET_KEY')\n", (308, 329), False, 'import os\n'), ((2895, 2926), 'os.path.join', 'os.path.join', (['BASE_DIR', '"""media"""'], {}), "(BASE_DIR, 'media')\n", (2907, 2926), False, 'import os\n'), ((2666, 2698), 'os.path.join'... |
# generated by update to not change manually
import dataclasses as dt
import typing as t
from enum import Enum
from bungieapi.json import to_json
from bungieapi.types import ManifestReference
class DestinyActivityModeType(Enum):
"""For historical reasons, this list will have both D1 and D2-relevant
Activity ... | [
"dataclasses.field",
"bungieapi.json.to_json",
"dataclasses.dataclass"
] | [((2324, 2349), 'dataclasses.dataclass', 'dt.dataclass', ([], {'frozen': '(True)'}), '(frozen=True)\n', (2336, 2349), True, 'import dataclasses as dt\n'), ((2433, 2493), 'dataclasses.field', 'dt.field', ([], {'metadata': "{'description': 'Category for the stat.'}"}), "(metadata={'description': 'Category for the stat.'}... |
import contextvars
s3_var = contextvars.ContextVar('s3')
| [
"contextvars.ContextVar"
] | [((30, 58), 'contextvars.ContextVar', 'contextvars.ContextVar', (['"""s3"""'], {}), "('s3')\n", (52, 58), False, 'import contextvars\n')] |
# -*- coding: utf-8 -*-
"""
Created on Fri Jul 20 23:53:00 2012
###############################################################################
#
# autoPACK Authors: <NAME>, <NAME>, <NAME>, <NAME>
# Based on COFFEE Script developed by <NAME> between 2005 and 2010
# with assistance from <NAME> in 2009 and periodic i... | [
"DejaVu.Polylines.Polylines"
] | [((8923, 9014), 'DejaVu.Polylines.Polylines', 'Polylines', (['"""jitter vectors"""'], {'vertices': 'verts', 'visible': '(1)', 'inheritLineWidth': '(0)', 'lineWidth': '(4)'}), "('jitter vectors', vertices=verts, visible=1, inheritLineWidth=0,\n lineWidth=4)\n", (8932, 9014), False, 'from DejaVu.Polylines import Polyl... |
#
# author: <NAME>
#
# Copyright 2010 University of Zurich
#
# 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... | [
"rdftools.tools.bloom.ScalableBloomFilter",
"rdftools.tools.bloom.check",
"rdftools.log.logger.warn",
"rdftools.gcityhash.city64",
"random.randint",
"rdftools.tools.bloom.add",
"io.open"
] | [((1023, 1036), 'rdftools.gcityhash.city64', 'city64', (['value'], {}), '(value)\n', (1029, 1036), False, 'from rdftools.gcityhash import city64\n'), ((1725, 1775), 'rdftools.tools.bloom.ScalableBloomFilter', 'ScalableBloomFilter', (['capacity_triples', 'FP_ERR_RATE'], {}), '(capacity_triples, FP_ERR_RATE)\n', (1744, 1... |
# -*- coding: utf-8 -*-
"""
Created on Tue Jul 16 02:13:59 2019
@author: <NAME>
"""
import tensorflow as tf
def Transferred_MobileNetV2():
# Download MobileNet-V2 with pretrained weight on ImageNet
model = tf.keras.applications.MobileNetV2(weights='imagenet')
# model.summary()
# Trim off the last FC... | [
"tensorflow.keras.layers.Dense",
"tensorflow.keras.Model",
"tensorflow.keras.optimizers.Adam",
"tensorflow.keras.Sequential",
"tensorflow.keras.applications.MobileNetV2"
] | [((218, 271), 'tensorflow.keras.applications.MobileNetV2', 'tf.keras.applications.MobileNetV2', ([], {'weights': '"""imagenet"""'}), "(weights='imagenet')\n", (251, 271), True, 'import tensorflow as tf\n'), ((344, 412), 'tensorflow.keras.Model', 'tf.keras.Model', ([], {'inputs': 'model.inputs', 'outputs': 'model.layers... |
from xlab.data.importer.iex.api import base
class IexSymbolsApi:
def __init__(self, token: str = ''):
self._client = base.SimpleIexApiHttpClient(token, 'ref-data/symbols',
lambda: {})
def get_symbols(self):
return self._client.call()
| [
"xlab.data.importer.iex.api.base.SimpleIexApiHttpClient"
] | [((132, 199), 'xlab.data.importer.iex.api.base.SimpleIexApiHttpClient', 'base.SimpleIexApiHttpClient', (['token', '"""ref-data/symbols"""', '(lambda : {})'], {}), "(token, 'ref-data/symbols', lambda : {})\n", (159, 199), False, 'from xlab.data.importer.iex.api import base\n')] |
from django.db import models
from django.conf import settings
import os
import json
class Importer(models.Model):
class Meta:
abstract = True
def get_json_file( file ):
path = settings.APPS_DIR
data = None
with open( os.path.join(path,file), encoding='utf-8' ) as f:
... | [
"json.load",
"os.path.join"
] | [((331, 343), 'json.load', 'json.load', (['f'], {}), '(f)\n', (340, 343), False, 'import json\n'), ((262, 286), 'os.path.join', 'os.path.join', (['path', 'file'], {}), '(path, file)\n', (274, 286), False, 'import os\n')] |
""" validator/util.py
Utilities and methods to help with data validation.
"""
import re
# See: https://emailregex.com/
EMAIL_REGEX = re.compile(r"(^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+$)")
# See: https://codereview.stackexchange.com/questions/19663/http-url-validating
URL_REGEX = re.compile(
r'(^(?:h... | [
"re.compile"
] | [((137, 202), 're.compile', 're.compile', (['"""(^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\\\\.[a-zA-Z0-9-.]+$)"""'], {}), "('(^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\\\\.[a-zA-Z0-9-.]+$)')\n", (147, 202), False, 'import re\n'), ((296, 547), 're.compile', 're.compile', (['"""(^(?:http|ftp)s?://)?(?:(?:[A-Z0-9](?:[A-Z0-9-]{0,61}[A-Z0-9])... |
# Landsat Util
# License: CC0 1.0 Universal
"""Tests for landsat"""
import sys
import errno
import shutil
import unittest
import subprocess
from tempfile import mkdtemp
from os.path import join, abspath, dirname
try:
import landsat.landsat as landsat
except ImportError:
sys.path.append(abspath(join(dirname(_... | [
"unittest.main",
"os.path.dirname",
"tempfile.mkdtemp",
"landsat.landsat.args_options",
"shutil.rmtree",
"os.path.join"
] | [((3398, 3413), 'unittest.main', 'unittest.main', ([], {}), '()\n', (3411, 3413), False, 'import unittest\n'), ((493, 502), 'tempfile.mkdtemp', 'mkdtemp', ([], {}), '()\n', (500, 502), False, 'from tempfile import mkdtemp\n'), ((581, 626), 'os.path.join', 'join', (['cls.base_dir', '"""samples"""', '"""test.tar.bz2"""']... |
import sys, os
sys.path.append(os.path.join(os.path.dirname(__file__), '..','..'))
import numpy as np
import commpy
from sdr_utils import vector as vec
from sdr_utils import plot_two_signals
class synchronization():
def __init__(self, param):
self.halfpreamble = param.halfpreamble
self... | [
"numpy.pad",
"numpy.abs",
"numpy.sum",
"numpy.argmax",
"os.path.dirname",
"numpy.empty_like",
"sdr_utils.vector.shift",
"numpy.append",
"numpy.where",
"numpy.array",
"numpy.correlate"
] | [((47, 72), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (62, 72), False, 'import sys, os\n'), ((1644, 1694), 'numpy.correlate', 'np.correlate', (['data', 'self.halfpreamble'], {'mode': '"""same"""'}), "(data, self.halfpreamble, mode='same')\n", (1656, 1694), True, 'import numpy as np\n'), ... |
import os
import argparse
import numpy as np
from tqdm import tqdm
from utils.audio import AudioProcessor
from utils.text import phoneme_to_sequence
def load_metadata(metadata_file):
items = []
with open(metadata_file, 'r') as fp:
for line in fp:
cols = line.split('|')
wav_file... | [
"tqdm.tqdm",
"numpy.save",
"argparse.ArgumentParser",
"os.makedirs",
"numpy.asarray",
"os.path.exists",
"utils.text.phoneme_to_sequence",
"utils.audio.AudioProcessor",
"os.path.join"
] | [((495, 586), 'utils.text.phoneme_to_sequence', 'phoneme_to_sequence', (['text', "['phoneme_cleaners']"], {'language': '"""en-us"""', 'enable_eos_bos': '(False)'}), "(text, ['phoneme_cleaners'], language='en-us',\n enable_eos_bos=False)\n", (514, 586), False, 'from utils.text import phoneme_to_sequence\n'), ((668, 7... |
import torch
import torch.nn as nn
import torch.nn.functional as F
from .backbone import resnet18
from .fusion_modules import SumFusion, ConcatFusion, FiLM, GatedFusion
class AVClassifier(nn.Module):
def __init__(self, args):
super(AVClassifier, self).__init__()
fusion = args.fusion_method
... | [
"torch.flatten",
"torch.nn.functional.adaptive_avg_pool2d",
"torch.nn.functional.adaptive_avg_pool3d"
] | [((1552, 1579), 'torch.nn.functional.adaptive_avg_pool2d', 'F.adaptive_avg_pool2d', (['a', '(1)'], {}), '(a, 1)\n', (1573, 1579), True, 'import torch.nn.functional as F\n'), ((1592, 1619), 'torch.nn.functional.adaptive_avg_pool3d', 'F.adaptive_avg_pool3d', (['v', '(1)'], {}), '(v, 1)\n', (1613, 1619), True, 'import tor... |
# Cube Class - Marching Cubes Algorithm
from graphics import *
from triangles import get_triangles # triangle-table look-up
class Cube:
""" - Cube Class -
"""
def __init__(self, pos, size, inside=[]):
# coordinates
self.pos = pos # center of the cube
# shape
self.size = size
# vertices
self.verti... | [
"triangles.get_triangles"
] | [((871, 897), 'triangles.get_triangles', 'get_triangles', (['self.inside'], {}), '(self.inside)\n', (884, 897), False, 'from triangles import get_triangles\n')] |
from __future__ import print_function
import os
import unittest
from pywekaclassifiers.classifiers import Classifier, PredictionResult, PredictionError, BP, DENSE, UPDATEABLE_WEKA_CLASSIFIER_NAMES
from pywekaclassifiers.classifiers import IBk # pylint: disable=no-name-in-module
from pywekaclassifiers import arff
from... | [
"unittest.main",
"os.remove",
"pywekaclassifiers.arff.ArffFile.parse",
"pywekaclassifiers.arff.Date",
"pywekaclassifiers.arff.ArffFile",
"pywekaclassifiers.arff.Nom",
"pywekaclassifiers.classifiers.Classifier.load",
"pywekaclassifiers.arff.Int",
"pywekaclassifiers.classifiers.Classifier",
"os.path... | [((11006, 11021), 'unittest.main', 'unittest.main', ([], {}), '()\n', (11019, 11021), False, 'import unittest\n'), ((632, 641), 'pywekaclassifiers.arff.Num', 'Num', (['(1.23)'], {}), '(1.23)\n', (635, 641), False, 'from pywekaclassifiers.arff import Num, Nom, Int, Str, Date\n'), ((655, 664), 'pywekaclassifiers.arff.Num... |
import os
from collections import deque
from multiprocessing import Process
import cv2 as cv
import dlib
import numpy as np
from skimage import transform as tf
from tqdm import tqdm
STD_SIZE = (224, 224)
stablePntsIDs = [33, 36, 39, 42, 45]
def shape_to_array(shape):
coords = np.empty((68, 2))
... | [
"cv2.resize",
"tqdm.tqdm",
"numpy.concatenate",
"cv2.cvtColor",
"numpy.empty",
"os.system",
"cv2.VideoCapture",
"numpy.mean",
"numpy.array",
"dlib.get_frontal_face_detector",
"skimage.transform.warp",
"skimage.transform.estimate_transform",
"multiprocessing.Process",
"collections.deque"
] | [((300, 317), 'numpy.empty', 'np.empty', (['(68, 2)'], {}), '((68, 2))\n', (308, 317), True, 'import numpy as np\n'), ((535, 561), 'numpy.mean', 'np.mean', (['landmarks'], {'axis': '(0)'}), '(landmarks, axis=0)\n', (542, 561), True, 'import numpy as np\n'), ((5524, 5550), 'cv2.VideoCapture', 'cv.VideoCapture', (['video... |