code stringlengths 21 1.03M | apis list | extract_api stringlengths 74 8.23M |
|---|---|---|
import jsonpickle
import pickle
load_success = jsonpickle.load_backend('json')
print (load_success)
jsonpickle.set_preferred_backend('json')
json_path_in = "examples/process_design_example/frame_ortho_lap_joints_no_rfl_process.json"
pickle_path_out = "examples/process_design_example/frame_ortho_lap_joints_no_rfl_pro... | [
"jsonpickle.decode",
"pickle.load",
"jsonpickle.load_backend",
"pickle.dump",
"jsonpickle.set_preferred_backend"
] | [((48, 79), 'jsonpickle.load_backend', 'jsonpickle.load_backend', (['"""json"""'], {}), "('json')\n", (71, 79), False, 'import jsonpickle\n'), ((102, 142), 'jsonpickle.set_preferred_backend', 'jsonpickle.set_preferred_backend', (['"""json"""'], {}), "('json')\n", (134, 142), False, 'import jsonpickle\n'), ((444, 482), ... |
#!/usr/bin/env python3
import sys, os, re
import boto3, botocore
from flask import request, Response
from s3path import S3Path, PureS3Path
from sallybrowse.extensions import BaseExtension
class Extension(BaseExtension):
PATTERN = re.compile(r".*\.(jpg|jpeg|png|gif|webp)$", re.IGNORECASE)
PRIORITY = 100
def __init... | [
"flask.request.path.replace",
"boto3.client",
"re.compile",
"flask.Response",
"sallybrowse.extensions.BaseExtension.__init__"
] | [((233, 291), 're.compile', 're.compile', (['""".*\\\\.(jpg|jpeg|png|gif|webp)$"""', 're.IGNORECASE'], {}), "('.*\\\\.(jpg|jpeg|png|gif|webp)$', re.IGNORECASE)\n", (243, 291), False, 'import sys, os, re\n'), ((349, 394), 'sallybrowse.extensions.BaseExtension.__init__', 'BaseExtension.__init__', (['self', '*args'], {}),... |
import logging
from PyQt4.QtGui import QColor
from Vispa.Share.BasicDataAccessor import BasicDataAccessor
from Vispa.Share.RelativeDataAccessor import RelativeDataAccessor
from Vispa.Share.ParticleDataAccessor import ParticleDataAccessor
from Vispa.Plugins.EventBrowser.EventFileAccessor import EventFileAccessor
clas... | [
"PyQt4.QtGui.QColor"
] | [((3707, 3728), 'PyQt4.QtGui.QColor', 'QColor', (['(176)', '(179)', '(177)'], {}), '(176, 179, 177)\n', (3713, 3728), False, 'from PyQt4.QtGui import QColor\n')] |
import onfido
from onfido.regions import Region
api = onfido.Api("<AN_API_TOKEN>", region=Region.EU)
fake_uuid = "58a9c6d2-8661-4dbd-96dc-b9b9d344a7ce"
check_details = {
"applicant_id": fake_uuid,
"report_names": ["identity_enhanced"]
}
def test_create_check(requests_mock):
mock_create = requests_mock... | [
"onfido.Api"
] | [((56, 102), 'onfido.Api', 'onfido.Api', (['"""<AN_API_TOKEN>"""'], {'region': 'Region.EU'}), "('<AN_API_TOKEN>', region=Region.EU)\n", (66, 102), False, 'import onfido\n')] |
from ellipticcurve.privateKey import PrivateKey
from objects.transaction import TransactionInput
from objects.transaction import Transaction
from constants import constants as const
class Wallet():
def __init__(self):
self.privateKey = PrivateKey()
self.publicKey = self.privateKey.publicK... | [
"ellipticcurve.privateKey.PrivateKey",
"objects.transaction.TransactionInput",
"objects.transaction.Transaction"
] | [((258, 270), 'ellipticcurve.privateKey.PrivateKey', 'PrivateKey', ([], {}), '()\n', (268, 270), False, 'from ellipticcurve.privateKey import PrivateKey\n'), ((1202, 1266), 'objects.transaction.Transaction', 'Transaction', (['"""0"""', 'self.publicKey', 'reciepient', 'value_sent', 'inputs'], {}), "('0', self.publicKey,... |
# Copyright 2015 Open Platform for NFV Project, Inc. and its contributors
# This software is distributed under the terms and conditions of the 'Apache-2.0'
# license which can be found in the file 'LICENSE' in this package distribution
# or at 'http://www.apache.org/licenses/LICENSE-2.0'.
from flask import Flask, json... | [
"flask_restful.Api",
"logging.getLogger",
"moon_utilities.configuration.get_configuration",
"moon_utilities.cache.Cache",
"flask.Flask"
] | [((660, 698), 'logging.getLogger', 'logging.getLogger', (['"""moon.wrapper.http"""'], {}), "('moon.wrapper.http')\n", (677, 698), False, 'import logging\n'), ((709, 716), 'moon_utilities.cache.Cache', 'Cache', ([], {}), '()\n', (714, 716), False, 'from moon_utilities.cache import Cache\n'), ((2570, 2585), 'flask.Flask'... |
import os
import re
import torch
from engine import *
# TODO: sgf.py
# SGF Regexes for size, handicap, add_black and black_white
SGF_SZ = r'SZ\[(\d*)\]'
SGF_HA = r'HA\[(\d*)\]'
SGF_AB = r'AB\[([a-s][a-s])\]'
SGF_AW = r'AW\[([a-s][a-s])\]'
SGF_BW = r';([BW])\[([a-s])([a-s])\]'
SGF_TREE = r'\(.*\)'
# TODO: add ko inp... | [
"torch.cuda.is_available",
"torch.from_numpy",
"re.findall",
"re.search"
] | [((1086, 1108), 're.search', 're.search', (['SGF_SZ', 'sgf'], {}), '(SGF_SZ, sgf)\n', (1095, 1108), False, 'import re\n'), ((1438, 1461), 're.findall', 're.findall', (['SGF_BW', 'sgf'], {}), '(SGF_BW, sgf)\n', (1448, 1461), False, 'import re\n'), ((1225, 1247), 're.search', 're.search', (['SGF_HA', 'sgf'], {}), '(SGF_H... |
import requests
from .models import Moderation
def async_get_request(url, params):
return requests.get(url, params)
def post_moderation_async(moderation_id, data):
from .slack import SlackSdk
slack = SlackSdk()
response_data = slack.post_moderation(
text=data['content'])
message_id = res... | [
"requests.get"
] | [((96, 121), 'requests.get', 'requests.get', (['url', 'params'], {}), '(url, params)\n', (108, 121), False, 'import requests\n')] |
import sys
sys.path.extend((".",".."))
from local_settings import * ### for codePath dataPath psqlPath
#---------------------------------------------------LIBRARIES
import json
import numpy as np
import pandas as pd
import os
import tqdm
import matplotlib
import gzip
import psycopg2
from functools import partial
impor... | [
"datetime.datetime.strptime",
"functools.partial",
"numpy.where",
"numpy.repeat",
"numpy.zeros",
"pandas.DataFrame",
"numpy.indices",
"sys.path.extend",
"io.BytesIO",
"numpy.random.choice",
"numpy.set_printoptions",
"numpy.append",
"requests.get",
"json.loads",
"numpy.random.rand",
"pa... | [((11, 39), 'sys.path.extend', 'sys.path.extend', (["('.', '..')"], {}), "(('.', '..'))\n", (26, 39), False, 'import sys\n'), ((787, 813), 'os.listdir', 'os.listdir', (['directory_name'], {}), '(directory_name)\n', (797, 813), False, 'import os\n'), ((856, 877), 'tqdm.tqdm', 'tqdm.tqdm', (['file_names'], {}), '(file_na... |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import json
import warnings
import pulumi
import pulumi.runtime
from .. import utilities, tables
class ProjectMetadataItem(pulumi.Cust... | [
"warnings.warn"
] | [((1570, 1645), 'warnings.warn', 'warnings.warn', (['"""explicit use of __name__ is deprecated"""', 'DeprecationWarning'], {}), "('explicit use of __name__ is deprecated', DeprecationWarning)\n", (1583, 1645), False, 'import warnings\n'), ((1728, 1827), 'warnings.warn', 'warnings.warn', (['"""explicit use of __opts__ i... |
import re
import typing
from s2sphere import LatLng, LatLngRect # type: ignore
class Runway:
def __init__(self) -> None:
self._airport_icao: typing.Optional[str] = None
self._surface = "con"
self._bounds = LatLngRect()
def set_from_array(self, array: typing.List[typing.Any]) -> None... | [
"s2sphere.LatLngRect.from_point",
"s2sphere.LatLngRect",
"re.search"
] | [((238, 250), 's2sphere.LatLngRect', 'LatLngRect', ([], {}), '()\n', (248, 250), False, 'from s2sphere import LatLng, LatLngRect\n'), ((1298, 1310), 's2sphere.LatLngRect', 'LatLngRect', ([], {}), '()\n', (1308, 1310), False, 'from s2sphere import LatLng, LatLngRect\n'), ((2080, 2150), 're.search', 're.search', (['"""bi... |
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | [
"openstack.exceptions.raise_from_response",
"openstack.exceptions.MethodNotSupported",
"openstack.resource.Body"
] | [((787, 808), 'openstack.resource.Body', 'resource.Body', (['"""name"""'], {}), "('name')\n", (800, 808), False, 'from openstack import resource\n'), ((882, 902), 'openstack.resource.Body', 'resource.Body', (['"""uid"""'], {}), "('uid')\n", (895, 902), False, 'from openstack import resource\n'), ((963, 997), 'openstack... |
# Generated by Django 3.0.7 on 2020-08-16 03:03
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('school', '0007_course_period_amount'),
]
operations = [
migrations.AlterField(
model_name='teacher',
name='photo',
... | [
"django.db.models.ImageField"
] | [((337, 434), 'django.db.models.ImageField', 'models.ImageField', ([], {'db_column': '"""photo"""', 'default': '""""""', 'upload_to': '"""teacherphoto"""', 'verbose_name': '"""职位"""'}), "(db_column='photo', default='', upload_to='teacherphoto',\n verbose_name='职位')\n", (354, 434), False, 'from django.db import migra... |
import smtplib
import ssl
import email
import sys
import dotenv
import os
from pathlib import Path
from email import encoders
from email.mime.base import MIMEBase
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
toMail = sys.argv[1]
otp = sys.argv[2]
CompanyName = sys.argv[3]
OrgM... | [
"email.mime.text.MIMEText",
"smtplib.SMTP",
"sys.exit",
"email.mime.multipart.MIMEMultipart"
] | [((383, 411), 'email.mime.multipart.MIMEMultipart', 'MIMEMultipart', (['"""alternative"""'], {}), "('alternative')\n", (396, 411), False, 'from email.mime.multipart import MIMEMultipart\n'), ((673, 695), 'email.mime.text.MIMEText', 'MIMEText', (['html', '"""html"""'], {}), "(html, 'html')\n", (681, 695), False, 'from e... |
import tkinter as tk
import pyscreenshot
import time
#some new stuff
class Display:
"""
The display class that generates the tkinter canvas for displaying the composite as it
is being edited and save the display as an image file.
It includes options to resize and overlay a ruler / grid.
... | [
"tkinter.Tk",
"tkinter.Canvas",
"pyscreenshot.grab",
"time.sleep"
] | [((474, 481), 'tkinter.Tk', 'tk.Tk', ([], {}), '()\n', (479, 481), True, 'import tkinter as tk\n'), ((505, 553), 'tkinter.Canvas', 'tk.Canvas', (['self.root'], {'width': 'width', 'height': 'height'}), '(self.root, width=width, height=height)\n', (514, 553), True, 'import tkinter as tk\n'), ((1410, 1437), 'pyscreenshot.... |
import glob
import pathlib
from pathlib import Path
from typing import List
from typing import Union
from .checks import is_string_like
def strip_ext(filepath: Union[str, pathlib.Path]) -> Union[str, pathlib.Path]:
"""
Strip extension from a file.
Parameters
----------
filepath : str or pathlib.... | [
"pathlib.Path"
] | [((470, 484), 'pathlib.Path', 'Path', (['filepath'], {}), '(filepath)\n', (474, 484), False, 'from pathlib import Path\n'), ((904, 918), 'pathlib.Path', 'Path', (['filepath'], {}), '(filepath)\n', (908, 918), False, 'from pathlib import Path\n'), ((860, 874), 'pathlib.Path', 'Path', (['filepath'], {}), '(filepath)\n', ... |
"""203. Remove Linked List Elements
https://leetcode.com/problems/remove-linked-list-elements/
Given the head of a linked list and an integer val, remove all the nodes of
the linked list that has Node.val == val, and return the new head.
Example 1:
Input: head = [1,2,6,3,4,5,6], val = 6
Output: [1,2,3,4,5]
Example ... | [
"common.list_node.ListNode"
] | [((669, 688), 'common.list_node.ListNode', 'ListNode', ([], {'next': 'head'}), '(next=head)\n', (677, 688), False, 'from common.list_node import ListNode\n')] |
'''
tray icons
'''
import config
import wx
from wx import Point
from gui.taskbar import DigsbyTaskBarIcon
import common.actions as actions
from common import pref
from gui.toolbox import draw_tiny_text, Monitor, GetDoubleClickTime
from util import try_this
import social
from traceback import print_exc
from operator i... | [
"wx.Point",
"common.pref",
"gui.toolbox.Monitor.GetFromPointer",
"gui.toolbox.GetDoubleClickTime",
"protocols.advise",
"wx.PyTimer",
"wx.FindWindowByName",
"cgui.GetTrayRect",
"operator.itemgetter",
"gui.toolbox.Monitor.GetFromPoint",
"wx.LaunchDefaultBrowser",
"wx.CallAfter",
"traceback.pri... | [((762, 861), 'protocols.advise', 'protocols.advise', ([], {'instancesProvide': '[ITrayIconProvider]', 'asAdapterForTypes': '[common.AccountBase]'}), '(instancesProvide=[ITrayIconProvider], asAdapterForTypes=[\n common.AccountBase])\n', (778, 861), False, 'import protocols\n'), ((6801, 6841), 'common.pref', 'pref', ... |
"""Database module."""
import os
import shutil
from tinydb import TinyDB, Query
import util
DATABASE_FOLDER = '.db/'
DATABASE_PATH = DATABASE_FOLDER + 'files.json'
class Database:
"""A class to handle a TinyDB instance for keeping track of downloads."""
def __init__(self, file_handler, dropbox):
c... | [
"os.getcwd",
"tinydb.TinyDB",
"tinydb.Query",
"shutil.copyfile",
"os.path.exists",
"shutil.rmtree",
"os.makedirs"
] | [((508, 528), 'tinydb.TinyDB', 'TinyDB', (['self.db_path'], {}), '(self.db_path)\n', (514, 528), False, 'from tinydb import TinyDB, Query\n'), ((848, 855), 'tinydb.Query', 'Query', ([], {}), '()\n', (853, 855), False, 'from tinydb import TinyDB, Query\n'), ((1030, 1037), 'tinydb.Query', 'Query', ([], {}), '()\n', (1035... |
"""Miniprez.
Running with watch starts will rebuild build the html
whenever the input changes.
Usage:
miniprez.py <markdown_file>
miniprez.py watch <markdown_file>
Options:
-h --help Show this screen.
-v --version Show the version.
"""
from _version import __version__
import asyncio
from docop... | [
"logging.getLogger",
"coloredlogs.install",
"docopt.docopt",
"continuous_integration.build_html",
"continuous_integration.parser_loop",
"asyncio.get_event_loop"
] | [((470, 499), 'logging.getLogger', 'logging.getLogger', (['"""miniprez"""'], {}), "('miniprez')\n", (487, 499), False, 'import coloredlogs, logging\n'), ((546, 604), 'coloredlogs.install', 'coloredlogs.install', ([], {'level': '"""DEBUG"""', 'logger': 'logger', 'fmt': 'fmt'}), "(level='DEBUG', logger=logger, fmt=fmt)\n... |
# Copyright 2010-2019 <NAME>, <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 ag... | [
"util.responseJSON",
"bottle.abort",
"util.getRowsFromTable",
"util.insertRow",
"util.updateRowById",
"bottle.route",
"bottle.HTTPResponse",
"util.getIdsFromTable",
"authentication.authorized",
"util.deleteRowFromTableById",
"util.getRowFromTableById",
"bottle.request.params.get"
] | [((748, 803), 'bottle.route', 'route', (['"""/resources/data/air_deductions"""'], {'method': "['GET']"}), "('/resources/data/air_deductions', method=['GET'])\n", (753, 803), False, 'from bottle import route\n'), ((805, 823), 'authentication.authorized', 'authorized', (['"""User"""'], {}), "('User')\n", (815, 823), Fals... |
import scipy.io as sio
import numpy as np
import matplotlib.pyplot as plt
# from process import denoise
# from deeg.check import check_nan
# from deeg.band import band
# from deeg.sampling import sampling
# from deeg.segment import segment
from deeg.features import cal_eeg_features
data_dir = "D:/EEG/data_pr... | [
"scipy.io.loadmat",
"deeg.features.cal_eeg_features"
] | [((349, 382), 'scipy.io.loadmat', 'sio.loadmat', (["(data_dir + 's01.mat')"], {}), "(data_dir + 's01.mat')\n", (360, 382), True, 'import scipy.io as sio\n'), ((638, 676), 'deeg.features.cal_eeg_features', 'cal_eeg_features', (['s01_data', '(1000)', '(2000)'], {}), '(s01_data, 1000, 2000)\n', (654, 676), False, 'from de... |
import os
import argparse
import tensorflow as tf
import tensorflow.keras.layers as klayers
def export_model(path, input_seq_len, vocab_size, emb_dim):
model = tf.keras.Sequential([
klayers.Embedding(vocab_size+1, emb_dim, input_length=input_seq_len),
klayers.Bidirectional(klayers.LSTM(256)),
... | [
"tensorflow.keras.layers.Embedding",
"tensorflow.keras.layers.LSTM",
"tensorflow.keras.layers.Dense",
"argparse.ArgumentParser",
"os.path.exists",
"tensorflow.keras.layers.BatchNormalization",
"os.makedirs"
] | [((589, 656), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Create and export the model."""'}), "(description='Create and export the model.')\n", (612, 656), False, 'import argparse\n'), ((1215, 1240), 'os.path.exists', 'os.path.exists', (['args.path'], {}), '(args.path)\n', (1229, 1240... |
import re
import json
from collections import OrderedDict
_register = OrderedDict()
def register(name, ttf_fname, fontd_fname):
"""Register an Iconfont
:param name: font name identifier.
:param ttf_fname: ttf filename (path)
:param fontd_fname: fontdic filename. (See create_fontdic)
"""
with ... | [
"re.finditer",
"collections.OrderedDict",
"json.dumps",
"re.compile"
] | [((71, 84), 'collections.OrderedDict', 'OrderedDict', ([], {}), '()\n', (82, 84), False, 'from collections import OrderedDict\n'), ((1745, 1781), 're.compile', 're.compile', (['"""}.+content:"""', 're.DOTALL'], {}), "('}.+content:', re.DOTALL)\n", (1755, 1781), False, 'import re\n'), ((1966, 2001), 're.compile', 're.co... |
import json
import pytest
import numpy as np
import pandas as pd
import requests
from .test_helpers import KNOWNCASES, CASENAMES, CASEDATA, RESULTS, get_dataprocessing_result
@pytest.mark.persistence
def test_vis_id_creation_base():
testcases = [
{"params": {"q": "air quality management", "from": "1665-0... | [
"pytest.mark.parametrize",
"json.dumps",
"requests.post"
] | [((23769, 23816), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""testcase"""', 'KNOWNCASES'], {}), "('testcase', KNOWNCASES)\n", (23792, 23816), False, 'import pytest\n'), ((24392, 24439), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""testcase"""', 'KNOWNCASES'], {}), "('testcase', KNOWNCASES... |
import numpy as np
class OptimizerSGD:
def __init__(self, learning_rate=1.0, decay=0., momentum=0.):
self.learning_rate = learning_rate
self.current_learning_rate = learning_rate
self.decay = decay
self.iterations = 0
self.momentum = momentum
def pre_update_para... | [
"numpy.sqrt",
"numpy.zeros_like"
] | [((2558, 2586), 'numpy.zeros_like', 'np.zeros_like', (['layer.weights'], {}), '(layer.weights)\n', (2571, 2586), True, 'import numpy as np\n'), ((2618, 2645), 'numpy.zeros_like', 'np.zeros_like', (['layer.biases'], {}), '(layer.biases)\n', (2631, 2645), True, 'import numpy as np\n'), ((3942, 3970), 'numpy.zeros_like', ... |
from userapp import UserApp
import os
APP_DIRECTORY = "cpp/userapps"
app_list = {}
def load_apps():
global app_list
subfolders = [subfolder for subfolder in os.listdir(APP_DIRECTORY) if os.path.isdir(os.path.join(APP_DIRECTORY, subfolder))]
for subfolder in subfolders:
userapp = UserApp(subfold... | [
"os.path.join",
"userapp.UserApp",
"os.listdir"
] | [((305, 323), 'userapp.UserApp', 'UserApp', (['subfolder'], {}), '(subfolder)\n', (312, 323), False, 'from userapp import UserApp\n'), ((173, 198), 'os.listdir', 'os.listdir', (['APP_DIRECTORY'], {}), '(APP_DIRECTORY)\n', (183, 198), False, 'import os\n'), ((216, 254), 'os.path.join', 'os.path.join', (['APP_DIRECTORY',... |
# Generated by Django 2.2.1 on 2019-06-17 09:12
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('schema', '0011_booked_phonenumber'),
]
operations = [
migrations.AddField(
model_name='cleanshifts'... | [
"django.db.models.TimeField",
"django.db.models.DateField"
] | [((365, 416), 'django.db.models.DateField', 'models.DateField', ([], {'default': 'django.utils.timezone.now'}), '(default=django.utils.timezone.now)\n', (381, 416), False, 'from django.db import migrations, models\n'), ((581, 599), 'django.db.models.TimeField', 'models.TimeField', ([], {}), '()\n', (597, 599), False, '... |
import subprocess
import pytest
def test_get_version_from_vcs(test_project):
with pytest.raises(subprocess.CalledProcessError) as excinfo:
test_project.get_current_version_from_project_dir()
stderr = excinfo.value.stderr.decode()
assert 'vcsver.errors.RevisionInfoNotFoundError:' in stderr.strip(... | [
"pytest.raises"
] | [((89, 133), 'pytest.raises', 'pytest.raises', (['subprocess.CalledProcessError'], {}), '(subprocess.CalledProcessError)\n', (102, 133), False, 'import pytest\n')] |
from selenium import webdriver
from selenium.webdriver.common.by import By
driver = webdriver.Chrome()
try:
driver.get("https://the-internet.herokuapp.com/add_remove_elements/")
add_button = driver.find_element(By.CSS_SELECTOR, "#content > div > button")
for i in range(20):
add_button.click()
... | [
"selenium.webdriver.Chrome"
] | [((85, 103), 'selenium.webdriver.Chrome', 'webdriver.Chrome', ([], {}), '()\n', (101, 103), False, 'from selenium import webdriver\n')] |
import requests
from bs4 import BeautifulSoup
req1 = requests.get("https://www.polywork.com/rakesh")
soup1 = BeautifulSoup(req1.content, "html.parser")
res1 = soup1.title
print("TITLE")
print(res1.get_text())
html1 =soup1.contents
html1 = soup1.prettify("utf-8")
with open("output1.html", "w") as file:
file.write... | [
"requests.get",
"bs4.BeautifulSoup"
] | [((54, 101), 'requests.get', 'requests.get', (['"""https://www.polywork.com/rakesh"""'], {}), "('https://www.polywork.com/rakesh')\n", (66, 101), False, 'import requests\n'), ((110, 152), 'bs4.BeautifulSoup', 'BeautifulSoup', (['req1.content', '"""html.parser"""'], {}), "(req1.content, 'html.parser')\n", (123, 152), Fa... |
import numpy as np
import matplotlib.pyplot as plt
from skimage import exposure
from mpl_toolkits.axes_grid1 import make_axes_locatable
from src.models.predict_model import *
def get_class_plot_prop():
"""
Returns dict specifying colors and other graphics properties
to be used for plotting. Specifically:
... | [
"numpy.linspace",
"mpl_toolkits.axes_grid1.make_axes_locatable",
"numpy.prod",
"numpy.percentile",
"numpy.copy",
"matplotlib.pyplot.colorbar",
"numpy.zeros",
"matplotlib.pyplot.subplots",
"skimage.exposure.adjust_gamma",
"numpy.array",
"numpy.arange",
"numpy.unique"
] | [((1720, 1732), 'numpy.unique', 'np.unique', (['x'], {}), '(x)\n', (1729, 1732), True, 'import numpy as np\n'), ((6216, 6236), 'numpy.prod', 'np.prod', (['y.shape[:2]'], {}), '(y.shape[:2])\n', (6223, 6236), True, 'import numpy as np\n'), ((7595, 7610), 'numpy.copy', 'np.copy', (['yscore'], {}), '(yscore)\n', (7602, 76... |
"""Unit test for apihelper.py
This program is part of "Dive Into Python", a free Python book for
experienced programmers. Visit http://diveintopython.org/ for the
latest version.
"""
__author__ = "<NAME> (<EMAIL>)"
__version__ = "$Revision: 1.4 $"
__date__ = "$Date: 2004/05/05 21:57:19 $"
__copyright__ = "Copyright ... | [
"StringIO.StringIO",
"apihelper.info",
"unittest.main"
] | [((1847, 1862), 'unittest.main', 'unittest.main', ([], {}), '()\n', (1860, 1862), False, 'import unittest\n'), ((555, 565), 'StringIO.StringIO', 'StringIO', ([], {}), '()\n', (563, 565), False, 'from StringIO import StringIO\n'), ((792, 817), 'apihelper.info', 'apihelper.info', (['apihelper'], {}), '(apihelper)\n', (80... |
import numpy as np
import pytest
from homeworks.hw01 import perceptron
from homeworks.hw01.perceptron import label_points, random_points
from homeworks.hw02.regression import regression_learning
NUM_RUNS = 1000
MONTE_CARLO_NUM_POINTS = 1000
NUM_POINTS = 1000
FRACTION_NOISE = .1
def main():
result = [run_experim... | [
"numpy.random.choice",
"homeworks.hw01.perceptron.random_points",
"homeworks.hw01.perceptron.calculate_p_f_neq_g",
"numpy.isclose",
"homeworks.hw02.regression.regression_learning",
"homeworks.hw01.perceptron.label_points",
"numpy.mean",
"pytest.main",
"numpy.array",
"numpy.arange",
"numpy.column... | [((383, 406), 'numpy.mean', 'np.mean', (['result'], {'axis': '(0)'}), '(result, axis=0)\n', (390, 406), True, 'import numpy as np\n'), ((570, 593), 'numpy.mean', 'np.mean', (['result'], {'axis': '(0)'}), '(result, axis=0)\n', (577, 593), True, 'import numpy as np\n'), ((656, 865), 'numpy.array', 'np.array', (['[[-1.0, ... |
import json
from typing import Optional
import pyrebase
from .database import Database
class FirebaseDatabase(Database):
def __init__(self, serialised_config: str):
super().__init__()
self.config = json.loads(serialised_config)
def add_document(self, doc_id: str, doc: dict) -> None:
... | [
"json.loads",
"json.dumps",
"pyrebase.initialize_app"
] | [((223, 252), 'json.loads', 'json.loads', (['serialised_config'], {}), '(serialised_config)\n', (233, 252), False, 'import json\n'), ((765, 792), 'json.dumps', 'json.dumps', (['replay_analysis'], {}), '(replay_analysis)\n', (775, 792), False, 'import json\n'), ((523, 559), 'pyrebase.initialize_app', 'pyrebase.initializ... |
from datetime import datetime, timedelta
import os
from airflow import DAG
from airflow.operators.dummy_operator import DummyOperator
from airflow.operators.postgres_operator import PostgresOperator
from airflow.operators import S3ToRedshiftOperator
from airflow.operators import CalculateTripsOperator
from airflow.oper... | [
"airflow.operators.DataQualityOperator",
"sql_statements.AGG_DELETE_FROM_TABLE.format",
"sql_statements.AGG_INSERT_TABLE.format",
"datetime.datetime",
"datetime.timedelta",
"sql_statements.BASE_INSERT_TABLE.format",
"sql_statements.BASE_DELETE_FROM_TABLE.format",
"airflow.DAG",
"airflow.operators.S3... | [((387, 412), 'os.environ.get', 'os.environ.get', (['"""AWS_KEY"""'], {}), "('AWS_KEY')\n", (401, 412), False, 'import os\n'), ((426, 454), 'os.environ.get', 'os.environ.get', (['"""AWS_SECRET"""'], {}), "('AWS_SECRET')\n", (440, 454), False, 'import os\n'), ((695, 867), 'airflow.DAG', 'DAG', (['"""mobility-pipeline"""... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals, absolute_import
import logging
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "tests.settings")
from django.core.management import execute_from_command_line
if len(sys.a... | [
"os.environ.setdefault",
"logging.disable",
"django.core.management.execute_from_command_line"
] | [((172, 237), 'os.environ.setdefault', 'os.environ.setdefault', (['"""DJANGO_SETTINGS_MODULE"""', '"""tests.settings"""'], {}), "('DJANGO_SETTINGS_MODULE', 'tests.settings')\n", (193, 237), False, 'import os\n'), ((403, 438), 'django.core.management.execute_from_command_line', 'execute_from_command_line', (['sys.argv']... |
from Bulletin import Bulletin
from generators.gh_issue import generate_gh_issue
from generators.html import generate_html
from generators.gfm import generate_gfm
from scanners import http_observatory
from scanners import security_headers
from scanners.ssllabs import ssllabs
import argparse
if __name__ == '__main__':
... | [
"generators.gfm.generate_gfm",
"scanners.security_headers.SecurityHeaders",
"argparse.ArgumentParser",
"generators.html.generate_html",
"scanners.ssllabs.ssllabs.SSLLabs",
"generators.gh_issue.generate_gh_issue",
"scanners.http_observatory.HTTPObservatory"
] | [((332, 423), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Checks website security using multiple scanners"""'}), "(description=\n 'Checks website security using multiple scanners')\n", (355, 423), False, 'import argparse\n'), ((1708, 1745), 'scanners.http_observatory.HTTPObservator... |
from ui.board_renderer import BoardRenderer
import cairo
import tkinter as tk
from PIL import Image, ImageTk
class MainWindow(tk.Frame):
"""
Application main window
board: Game board to represent
master: Parent widget
"""
REFRESH_DELAY = 200
def __init__(self, board, maste... | [
"tkinter.Label",
"ui.board_renderer.BoardRenderer",
"PIL.Image.frombytes",
"cairo.Context",
"cairo.ImageSurface"
] | [((702, 716), 'tkinter.Label', 'tk.Label', (['self'], {}), '(self)\n', (710, 716), True, 'import tkinter as tk\n'), ((840, 866), 'ui.board_renderer.BoardRenderer', 'BoardRenderer', (['self._board'], {}), '(self._board)\n', (853, 866), False, 'from ui.board_renderer import BoardRenderer\n'), ((1383, 1470), 'PIL.Image.fr... |
import os, urllib, json, StringIO
from datetime import datetime
from django.db import models
from django.conf import settings
from django.contrib.auth.models import User
from django.core.files import File # you need this somewhere
from django.core.mail import EmailMessage
from PIL import Image
from imagekit.models... | [
"django.db.models.ForeignKey",
"django.db.models.IntegerField",
"django.db.models.ImageField",
"datetime.datetime.now",
"urllib.urlretrieve",
"imagekit.processors.ResizeToFit",
"django.db.models.DecimalField",
"django.db.models.BooleanField",
"django.db.models.TextField",
"django.db.models.CharFie... | [((433, 465), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(200)'}), '(max_length=200)\n', (449, 465), False, 'from django.db import models\n'), ((559, 591), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(200)'}), '(max_length=200)\n', (575, 591), False, 'from django.d... |
import argparse
from operation.gen_job_signature_op import UAIOcrGenJobSignatureOp
from operation.create_ocr_idcard_job_op import CreateUAIOcrIdcardJobOp
from operation.create_ocr_bill_job_op import CreateUAIOcrBillJobOp
from operation.create_ocr_resource_op import CreateOcrResourceOp
from operation.delete_ocr_resourc... | [
"operation.modify_ocr_resource_memo_op.ModifyUAIOcrResourceMemoOp",
"operation.modify_ocr_resource_name_op.ModifyUAIOcrResourceNameOp",
"operation.get_ocr_resource_record_info_op.GetUAIOcrResourceRecordInfoOp",
"argparse.ArgumentParser",
"operation.modify_ocr_resource_oss_op.ModifyUAIOcrResourceOssOp",
"o... | [((2580, 2625), 'operation.gen_job_signature_op.UAIOcrGenJobSignatureOp', 'UAIOcrGenJobSignatureOp', (['gen_signature_parser'], {}), '(gen_signature_parser)\n', (2603, 2625), False, 'from operation.gen_job_signature_op import UAIOcrGenJobSignatureOp\n'), ((2652, 2695), 'operation.create_ocr_resource_op.CreateOcrResourc... |
# encoding=utf-8
import json
import re
from urlparse import urljoin
from pytube import YouTube
import scrapy
from scrapy.http import Request
from scrapy.selector import Selector
from videos2.items import VideoItem
from videos2.util import getImage,getVideo
class VideoSiper(scrapy.Spider):
name = 'video-youtube'
... | [
"urlparse.urljoin",
"videos2.items.VideoItem",
"json.loads",
"scrapy.http.Request",
"videos2.util.getVideo",
"videos2.util.getImage"
] | [((2121, 2134), 'videos2.util.getVideo', 'getVideo', (['url'], {}), '(url)\n', (2129, 2134), False, 'from videos2.util import getImage, getVideo\n'), ((2169, 2180), 'videos2.items.VideoItem', 'VideoItem', ([], {}), '()\n', (2178, 2180), False, 'from videos2.items import VideoItem\n'), ((3192, 3217), 'videos2.util.getIm... |
# import subprocess
import re
from shutil import copyfile
import os
from itertools import chain
import pathlib
import json
# from app import app
def copy_diff_snapshots(copy_path):
pathlib.Path(copy_path).mkdir(parents=True, exist_ok=True)
files = []
# r=root, d=directories, f = files
for r, d, f in... | [
"os.path.join",
"os.walk",
"pathlib.Path",
"shutil.copyfile",
"re.sub"
] | [((950, 981), 'os.walk', 'os.walk', (['f"""/opt/app/logs/{sha}"""'], {}), "(f'/opt/app/logs/{sha}')\n", (957, 981), False, 'import os\n'), ((2943, 2960), 'os.walk', 'os.walk', (['"""./logs"""'], {}), "('./logs')\n", (2950, 2960), False, 'import os\n'), ((3707, 3724), 'os.walk', 'os.walk', (['"""./temp"""'], {}), "('./t... |
import logging
import pprint
log = logging.getLogger(__name__)
pp = pprint.PrettyPrinter(indent=4)
def _pprint_me(thing, prefix):
return prefix + "\n" + pp.pformat(thing)
def task(ctx, config):
"""
Dump task context and config in teuthology log/output
The intended use case is didactic - to provide a... | [
"logging.getLogger",
"pprint.PrettyPrinter"
] | [((36, 63), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (53, 63), False, 'import logging\n'), ((69, 99), 'pprint.PrettyPrinter', 'pprint.PrettyPrinter', ([], {'indent': '(4)'}), '(indent=4)\n', (89, 99), False, 'import pprint\n')] |
#!/usr/bin/env python3
import tmdbsimple as tmdb
from requests import HTTPError
from datetime import datetime
from utils import logger
log = logger.get_log(__name__)
YOUTUBE_BASE_URL = 'https://www.youtube.com/watch?v='
VIMEO_BASE_URL = 'https://vimeo.com/'
TMDB_API = '<KEY>'
class Tmdb(object):
def __init__(sel... | [
"datetime.datetime.strptime",
"tmdbsimple.Find",
"tmdbsimple.Search",
"tmdbsimple.Movies",
"utils.logger.get_log"
] | [((143, 167), 'utils.logger.get_log', 'logger.get_log', (['__name__'], {}), '(__name__)\n', (157, 167), False, 'from utils import logger\n'), ((5335, 5354), 'tmdbsimple.Movies', 'tmdb.Movies', (['tmdbid'], {}), '(tmdbid)\n', (5346, 5354), True, 'import tmdbsimple as tmdb\n'), ((6191, 6204), 'tmdbsimple.Search', 'tmdb.S... |
"""
This is a setup.py script generated by py2applet
Usage:
python setup.py py2app
"""
from setuptools import setup
APP = ['shotput/Shotput.py']
DATA_FILES = []
OPTIONS = {
'argv_emulation': True,
'iconfile': 'shotput.icns',
'plist': {
'LSUIElement': True,
'CFBundleName': 'Shotput',
... | [
"setuptools.setup"
] | [((1262, 1382), 'setuptools.setup', 'setup', ([], {'app': 'APP', 'data_files': 'DATA_FILES', 'options': "{'py2app': OPTIONS}", 'packages': "['shotput']", 'setup_requires': "['py2app']"}), "(app=APP, data_files=DATA_FILES, options={'py2app': OPTIONS}, packages\n =['shotput'], setup_requires=['py2app'])\n", (1267, 138... |
import json
from bs4 import BeautifulSoup
row_selector = "table>tbody>tr"
column_selector = "td"
header_selector = "thead>tr>th"
with open('get_data.html', 'rb') as file:
page = file.read()
soup = BeautifulSoup(page, 'html.parser')
rows = soup.select(row_selector)
head_elements = soup.select(header_selector)
he... | [
"json.dump",
"bs4.BeautifulSoup"
] | [((204, 238), 'bs4.BeautifulSoup', 'BeautifulSoup', (['page', '"""html.parser"""'], {}), "(page, 'html.parser')\n", (217, 238), False, 'from bs4 import BeautifulSoup\n'), ((631, 671), 'json.dump', 'json.dump', (['all_data', 'json_data'], {'indent': '(2)'}), '(all_data, json_data, indent=2)\n', (640, 671), False, 'impor... |
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
from resources.api import main_router
# creating the FastAPI app instance
app = FastAPI()
# Add CORS permissions
app.add_middleware(
CORSMiddleware,
allow_origins=["*"], # shift to authenticated domain
allow_credentials=True,
allow_m... | [
"fastapi.FastAPI"
] | [((162, 171), 'fastapi.FastAPI', 'FastAPI', ([], {}), '()\n', (169, 171), False, 'from fastapi import FastAPI\n')] |
from django.db import models
from django.contrib.auth.models import User
# Create your models here.
class Vacancy(models.Model):
description = models.CharField(max_length=1024)
author = models.ForeignKey(User, on_delete=models.CASCADE)
'''Vacancy.objects.create(
author=User.objects.create(username="Akun... | [
"django.db.models.CharField",
"django.db.models.ForeignKey"
] | [((149, 182), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(1024)'}), '(max_length=1024)\n', (165, 182), False, 'from django.db import models\n'), ((196, 245), 'django.db.models.ForeignKey', 'models.ForeignKey', (['User'], {'on_delete': 'models.CASCADE'}), '(User, on_delete=models.CASCADE)\n',... |
#!/usr/bin/env python3
"""
* xml_dataset_generator_nsp.py
*
* Copyright (c) 2022, DarkMatterCore <<EMAIL>>.
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear i... | [
"zlib.crc32",
"re.findall",
"argparse.ArgumentParser",
"os.remove",
"os.path.exists",
"os.path.isfile",
"os.path.realpath",
"threading.enumerate",
"argparse.ArgumentTypeError",
"os.scandir",
"psutil.cpu_count",
"cnmt.Cnmt.ContentType",
"threading.current_thread",
"os.makedirs",
"tik.Tik.... | [((1302, 1328), 'os.path.realpath', 'os.path.realpath', (['__file__'], {}), '(__file__)\n', (1318, 1328), False, 'import os\n'), ((1348, 1377), 'os.path.basename', 'os.path.basename', (['SCRIPT_PATH'], {}), '(SCRIPT_PATH)\n', (1364, 1377), False, 'import os\n'), ((1397, 1425), 'os.path.dirname', 'os.path.dirname', (['S... |
import numpy as np
from . import utilities
class Tilemap:
def __init__(self, width, height):
self._width = width
self._height = height
self._data = np.zeros((width, height), np.uint8)
@property
def width(self):
return self._width
@property
def height(self):
... | [
"numpy.zeros"
] | [((179, 214), 'numpy.zeros', 'np.zeros', (['(width, height)', 'np.uint8'], {}), '((width, height), np.uint8)\n', (187, 214), True, 'import numpy as np\n')] |
import random
import numpy as np
from sklearn.base import BaseEstimator, MetaEstimatorMixin, ClassifierMixin
from sklearn.utils import validation
from ..problem_transformation import ClassifierChain
class EnsembleClassifierChain(
BaseEstimator, MetaEstimatorMixin, ClassifierMixin):
def __init__(
... | [
"sklearn.utils.validation.check_is_fitted",
"sklearn.utils.validation.check_array",
"numpy.sum",
"sklearn.utils.validation.check_X_y"
] | [((1850, 1895), 'sklearn.utils.validation.check_X_y', 'validation.check_X_y', (['X', 'y'], {'multi_output': '(True)'}), '(X, y, multi_output=True)\n', (1870, 1895), False, 'from sklearn.utils import validation\n'), ((1908, 1953), 'sklearn.utils.validation.check_array', 'validation.check_array', (['y'], {'accept_sparse'... |
import time
import gc
import wifi
import random
import adafruit_requests
import ssl
import socketpool
import terminalio
from adafruit_magtag.magtag import MagTag
magtag = MagTag()
# Add a secrets.py to your filesystem that has a dictionary called secrets with "ssid" and
# "password" keys with your WiFi credentials. D... | [
"wifi.radio.connect",
"socketpool.SocketPool",
"adafruit_magtag.magtag.MagTag",
"ssl.create_default_context",
"time.sleep"
] | [((172, 180), 'adafruit_magtag.magtag.MagTag', 'MagTag', ([], {}), '()\n', (178, 180), False, 'from adafruit_magtag.magtag import MagTag\n'), ((641, 697), 'wifi.radio.connect', 'wifi.radio.connect', (["secrets['ssid']", "secrets['password']"], {}), "(secrets['ssid'], secrets['password'])\n", (659, 697), False, 'import ... |
import opendbpy as odb
import os
import re
current_dir = os.path.dirname(os.path.realpath(__file__))
tests_dir = os.path.abspath(os.path.join(current_dir, os.pardir))
opendb_dir = os.path.abspath(os.path.join(tests_dir, os.pardir))
data_dir = os.path.join(tests_dir, "data")
db = odb.dbDatabase.create()
chip = odb.od... | [
"os.path.join",
"re.match",
"opendbpy.lefin",
"opendbpy.defin",
"re.findall",
"os.path.realpath",
"opendbpy.dbDatabase.create"
] | [((245, 276), 'os.path.join', 'os.path.join', (['tests_dir', '"""data"""'], {}), "(tests_dir, 'data')\n", (257, 276), False, 'import os\n'), ((283, 306), 'opendbpy.dbDatabase.create', 'odb.dbDatabase.create', ([], {}), '()\n', (304, 306), True, 'import opendbpy as odb\n'), ((75, 101), 'os.path.realpath', 'os.path.realp... |
from __future__ import annotations
import imghdr
import io
import os
import time
from collections.abc import Callable
from typing import TYPE_CHECKING, Optional, Union
from urllib.parse import urlencode
import pytest
from flask.testing import FlaskClient
from hypothesis import example, given, strategies as st
from lo... | [
"tests.utils.make_route",
"imghdr.what",
"io.BytesIO",
"hypothesis.example",
"loguru.logger.info",
"hypothesis.given",
"tests.utils.compact_dict",
"os.path.isfile",
"hypothesis.strategies.text",
"pytest.mark.parametrize",
"os.path.getsize",
"hypothesis.strategies.fixed_dictionaries",
"time.p... | [((670, 737), 'hypothesis.strategies.fixed_dictionaries', 'st.fixed_dictionaries', (["{'text': text_strategy, 'dpi': dpi_strategy}"], {}), "({'text': text_strategy, 'dpi': dpi_strategy})\n", (691, 737), True, 'from hypothesis import example, given, strategies as st\n'), ((891, 1001), 'hypothesis.given', 'given', ([], {... |
# vim: sw=4:ts=4:et:cc=120
import unittest
import saq
from saq.integration import integration_enabled
from saq.submission import Submission
from saq.test import *
from saq.util import *
from saq.collectors.falcon import *
metadata ={ KEY_EVENT_CREATION_TIME: 1587665314 * 1000 }
event = {
"PatternDispositionDesc... | [
"unittest.SkipTest",
"saq.integration.integration_enabled"
] | [((3101, 3130), 'saq.integration.integration_enabled', 'integration_enabled', (['"""falcon"""'], {}), "('falcon')\n", (3120, 3130), False, 'from saq.integration import integration_enabled\n'), ((3150, 3201), 'unittest.SkipTest', 'unittest.SkipTest', (['"""falcon integration not enabled"""'], {}), "('falcon integration ... |
# -*- coding: utf-8 -*-
# Define here the models for your spider middleware
#
# See documentation in:
# http://doc.scrapy.org/en/latest/topics/spider-middleware.html
import logging
import requests
from scrapy import signals
from random import choice
class ScrapyBtSpiderMiddleware(object):
# Not all methods need ... | [
"random.choice",
"requests.get",
"logging.getLogger"
] | [((6808, 6832), 'random.choice', 'choice', (['self.user_agents'], {}), '(self.user_agents)\n', (6814, 6832), False, 'from random import choice\n'), ((6917, 6944), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (6934, 6944), False, 'import logging\n'), ((7064, 7092), 'requests.get', 'reque... |
import random
import time
import gym
import gym_tetris
def main():
env = gym.make('tetris-v1', action_mode=1)
env.reset()
start_time = time.time()
log_every = 5
counter_fps = 0
counter_games = 0
log_until_quit = 5
while log_until_quit > 0:
x = random.randrange(10)
rota... | [
"random.randrange",
"gym.make",
"time.time"
] | [((79, 115), 'gym.make', 'gym.make', (['"""tetris-v1"""'], {'action_mode': '(1)'}), "('tetris-v1', action_mode=1)\n", (87, 115), False, 'import gym\n'), ((150, 161), 'time.time', 'time.time', ([], {}), '()\n', (159, 161), False, 'import time\n'), ((287, 307), 'random.randrange', 'random.randrange', (['(10)'], {}), '(10... |
import os
class Worker():
def __init__(self,job,name):
self.fn = job
self.name = name
def do(self,timestamp):
pid = None
try:
print('[{timestamp}] {name}'.format(timestamp=timestamp,name=self.name))
pid = os.fork()
if pid == 0:
... | [
"os.fork"
] | [((271, 280), 'os.fork', 'os.fork', ([], {}), '()\n', (278, 280), False, 'import os\n')] |
import FWCore.ParameterSet.Config as cms
trackAssociatorByChi2 = cms.EDProducer("TrackAssociatorByChi2Producer",
chi2cut = cms.double(25.0),
beamSpot = cms.InputTag("offlineBeamSpot"),
onlyDiagonal = cms.bool(False)
)
| [
"FWCore.ParameterSet.Config.double",
"FWCore.ParameterSet.Config.bool",
"FWCore.ParameterSet.Config.InputTag"
] | [((128, 144), 'FWCore.ParameterSet.Config.double', 'cms.double', (['(25.0)'], {}), '(25.0)\n', (138, 144), True, 'import FWCore.ParameterSet.Config as cms\n'), ((161, 192), 'FWCore.ParameterSet.Config.InputTag', 'cms.InputTag', (['"""offlineBeamSpot"""'], {}), "('offlineBeamSpot')\n", (173, 192), True, 'import FWCore.P... |
from datetime import datetime
from typing import Optional, List, Union, Dict
from lxml.etree import CDATA
from .utils import ElementT, create_element
from .enclosure import Enclosure, EnclosureOrDictT
from .image import Image
__all__ = ('Item',)
class Item:
"""Data for item tag for rss.
:param title: Titl... | [
"lxml.etree.CDATA"
] | [((2983, 3001), 'lxml.etree.CDATA', 'CDATA', (['self.author'], {}), '(self.author)\n', (2988, 3001), False, 'from lxml.etree import CDATA\n'), ((3110, 3125), 'lxml.etree.CDATA', 'CDATA', (['category'], {}), '(category)\n', (3115, 3125), False, 'from lxml.etree import CDATA\n'), ((2419, 2436), 'lxml.etree.CDATA', 'CDATA... |
import random
n=int(input("Maximum Number: ")) #the range
no_to_be_guessed=int(n*random.random())+1
guess=0
attempt=0
while guess!=no_to_be_guessed:
if attempt==5:
print("Sorry, better luck next time.")
print("It was {}.".format(no_to_be_guessed))
break
guess=int(input("Your gu... | [
"random.random"
] | [((85, 100), 'random.random', 'random.random', ([], {}), '()\n', (98, 100), False, 'import random\n')] |
import os, sys
PROJECT_ROOT = os.path.join(os.path.dirname(__file__), '..')
sys.path.append(PROJECT_ROOT)
from include.csvhandler import *
from include.svg_visualizer import *
# settings
REFERENCE_PATH = os.path.join(PROJECT_ROOT, "csv/ovalpath_r15m.csv")
VEHICLE_LOG = os.path.join(PROJECT_ROOT, "csv/vehicle_stat... | [
"sys.path.append",
"os.path.dirname",
"os.path.join"
] | [((76, 105), 'sys.path.append', 'sys.path.append', (['PROJECT_ROOT'], {}), '(PROJECT_ROOT)\n', (91, 105), False, 'import os, sys\n'), ((206, 257), 'os.path.join', 'os.path.join', (['PROJECT_ROOT', '"""csv/ovalpath_r15m.csv"""'], {}), "(PROJECT_ROOT, 'csv/ovalpath_r15m.csv')\n", (218, 257), False, 'import os, sys\n'), (... |
from decimal import Decimal
from typing import Dict, List, Tuple
from rich.console import Console
from badger_api.requests import fetch_token
from config.singletons import env_config
from helpers.constants import EMISSIONS_CONTRACTS, XSUSHI
from helpers.discord import get_discord_url, send_message_to_discord
from hel... | [
"subgraph.queries.harvests.fetch_sushi_harvest_events",
"badger_api.requests.fetch_token",
"helpers.time_utils.to_utc_date",
"rewards.snapshot.chain_snapshot.sett_snapshot",
"helpers.time_utils.to_hours",
"config.singletons.env_config.get_web3",
"rewards.utils.emission_utils.get_flat_emission_rate",
"... | [((1091, 1100), 'rich.console.Console', 'Console', ([], {}), '()\n', (1098, 1100), False, 'from rich.console import Console\n'), ((1250, 1276), 'config.singletons.env_config.get_web3', 'env_config.get_web3', (['chain'], {}), '(chain)\n', (1269, 1276), False, 'from config.singletons import env_config\n'), ((1304, 1326),... |
from setuptools import setup
setup(
name='exercise-2-ffmpeg-mmark9',
version='',
url='',
license='MIT',
author='Miguel',
author_email='<EMAIL>',
description='async hw',
install_requires=['flake8','pytest'],
)
| [
"setuptools.setup"
] | [((30, 215), 'setuptools.setup', 'setup', ([], {'name': '"""exercise-2-ffmpeg-mmark9"""', 'version': '""""""', 'url': '""""""', 'license': '"""MIT"""', 'author': '"""Miguel"""', 'author_email': '"""<EMAIL>"""', 'description': '"""async hw"""', 'install_requires': "['flake8', 'pytest']"}), "(name='exercise-2-ffmpeg-mmar... |
import glob
import os
import nska_deserialize as nd
import sqlite3
import datetime
import blackboxprotobuf
from scripts.artifact_report import ArtifactHtmlReport
from scripts.ilapfuncs import logfunc, tsv, timeline, is_platform_windows, open_sqlite_db_readonly
def get_kikGroupadmins(files_found, report_folder, seeke... | [
"blackboxprotobuf.decode_message",
"scripts.ilapfuncs.open_sqlite_db_readonly",
"scripts.ilapfuncs.logfunc",
"scripts.ilapfuncs.tsv",
"scripts.artifact_report.ArtifactHtmlReport"
] | [((491, 526), 'scripts.ilapfuncs.open_sqlite_db_readonly', 'open_sqlite_db_readonly', (['file_found'], {}), '(file_found)\n', (514, 526), False, 'from scripts.ilapfuncs import logfunc, tsv, timeline, is_platform_windows, open_sqlite_db_readonly\n'), ((5440, 5486), 'scripts.artifact_report.ArtifactHtmlReport', 'Artifact... |
#!usr/bin/env python
# -*- coding: utf-8 -*-
import re, time, logging, logging.handlers, copy
from common import base_dir, log_dir, journal_elsevier, get_html_text,\
get_html_str, init_dir
from util import get_random_uniform, get_database_connect, get_phantomjs_page
# 保存下载文件的目录
root_dir = base_dir + 'elsevier/jour... | [
"copy.deepcopy",
"logging.getLogger",
"logging.Formatter",
"re.compile",
"logging.basicConfig",
"util.get_phantomjs_page",
"logging.handlers.RotatingFileHandler",
"util.get_database_connect",
"time.localtime",
"util.get_random_uniform",
"re.sub",
"common.get_html_text",
"common.init_dir"
] | [((455, 494), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.INFO'}), '(level=logging.INFO)\n', (474, 494), False, 'import re, time, logging, logging.handlers, copy\n'), ((504, 532), 'logging.getLogger', 'logging.getLogger', (['"""science"""'], {}), "('science')\n", (521, 532), False, 'import re,... |
import numpy as np
from mfdrouting import SCA
#from matplotlib import pyplot as pl
n = 30
xr = np.linspace(0, 2*1.5, int(n*1.5))
yr = np.linspace(0, 2, n)
x, y = np.meshgrid(xr, yr)
z = np.exp(-x*x-y*y)
#pl.pcolormesh(x, y, z)
#pl.colorbar()
#ax = pl.gca()
#ax.set_aspect('equal')
#pl.show()
w = abs(xr[0]-xr[1])
a = S... | [
"numpy.linspace",
"numpy.save",
"mfdrouting.SCA",
"numpy.meshgrid",
"numpy.exp"
] | [((135, 155), 'numpy.linspace', 'np.linspace', (['(0)', '(2)', 'n'], {}), '(0, 2, n)\n', (146, 155), True, 'import numpy as np\n'), ((163, 182), 'numpy.meshgrid', 'np.meshgrid', (['xr', 'yr'], {}), '(xr, yr)\n', (174, 182), True, 'import numpy as np\n'), ((187, 209), 'numpy.exp', 'np.exp', (['(-x * x - y * y)'], {}), '... |
from django.urls import path
from django.contrib.auth.decorators import login_required
from accounting_integrations.fyle import views
urlpatterns = [
path('projects',
login_required(views.ProjectListView.as_view()), name='project_list'),
path('projects/<str:pk>/update',
login_required(views.P... | [
"accounting_integrations.fyle.views.ImportBatchAdvanceListView.as_view",
"accounting_integrations.fyle.views.CostCenterUpdateView.as_view",
"accounting_integrations.fyle.views.ImportBatchFileListView.as_view",
"accounting_integrations.fyle.views.EmployeeUpdateView.as_view",
"accounting_integrations.fyle.vie... | [((196, 227), 'accounting_integrations.fyle.views.ProjectListView.as_view', 'views.ProjectListView.as_view', ([], {}), '()\n', (225, 227), False, 'from accounting_integrations.fyle import views\n'), ((313, 346), 'accounting_integrations.fyle.views.ProjectUpdateView.as_view', 'views.ProjectUpdateView.as_view', ([], {}),... |
from pathlib import Path
from setuptools import setup, find_packages
package_dir = 'python_data_utils'
root = Path(__file__).parent.resolve()
# Read in package meta from about.py
about_path = root / package_dir / 'about.py'
with about_path.open('r', encoding='utf8') as f:
about = {}
exec(f.read(), about)
# G... | [
"pathlib.Path",
"setuptools.find_packages"
] | [((1255, 1289), 'setuptools.find_packages', 'find_packages', ([], {'exclude': "('tests*',)"}), "(exclude=('tests*',))\n", (1268, 1289), False, 'from setuptools import setup, find_packages\n'), ((111, 125), 'pathlib.Path', 'Path', (['__file__'], {}), '(__file__)\n', (115, 125), False, 'from pathlib import Path\n')] |
# Generated by Django 3.1.7 on 2021-03-28 14:56
from django.db import migrations, models
import django.db.models.deletion
import uuid
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Component',
fi... | [
"django.db.models.ForeignKey",
"django.db.models.UUIDField",
"django.db.models.DateTimeField",
"django.db.models.TextField",
"django.db.models.AutoField",
"django.db.models.CharField"
] | [((350, 443), '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", (366, 443), False, 'from django.db import migrations, models\... |
# This is a sample Python script.
# Press Mayús+F10 to execute it or replace it with your code.
# Press Double Shift to search everywhere for classes, files, tool windows, actions, and settings.
import sqlite3
from sqlite3 import Error
import numpy as np
def create_connection(db_file):
""" create a database con... | [
"numpy.random.randint",
"sqlite3.connect",
"numpy.random.uniform",
"numpy.random.normal"
] | [((393, 417), 'sqlite3.connect', 'sqlite3.connect', (['db_file'], {}), '(db_file)\n', (408, 417), False, 'import sqlite3\n'), ((893, 921), 'numpy.random.randint', 'np.random.randint', (['(-100)', '(100)'], {}), '(-100, 100)\n', (910, 921), True, 'import numpy as np\n'), ((1039, 1067), 'numpy.random.uniform', 'np.random... |
"""A minimalistic FTP util. A shell client for Python ftplib
getwelcome - Return the welcome message sent by the server in reply to the initial connection. (This message sometimes
contains disclaimers or help information that may be relevant to the user.)
connect [host=''] [port=0] [timeout=None] - Connect to the giv... | [
"ftplib.FTP",
"readline.set_startup_hook",
"os.path.getsize",
"getpass.getpass",
"sys.exit"
] | [((3892, 3919), 'getpass.getpass', 'getpass', (['"""Enter password: """'], {}), "('Enter password: ')\n", (3899, 3919), False, 'from getpass import getpass\n'), ((3936, 3945), 'ftplib.FTP', 'FTP', (['host'], {}), '(host)\n', (3939, 3945), False, 'from ftplib import FTP, error_perm, all_errors\n'), ((4185, 4212), 'readl... |
"""This module provides the PiFaceGPIO type."""
from raspy import string_utils
from raspy.argument_null_exception import ArgumentNullException
from raspy.illegal_argument_exception import IllegalArgumentException
from raspy.io import gpio
from raspy.io import pi_face_pins
from raspy.io import pin_mode
class PiFaceGP... | [
"raspy.io.pi_face_pins.Input02",
"raspy.io.pi_face_pins.Input07",
"raspy.io.pi_face_pins.Input04",
"raspy.io.pi_face_pins.Input01",
"raspy.io.pi_face_pins.Output03",
"raspy.io.gpio.Gpio.dispose",
"raspy.io.pi_face_pins.Output05",
"raspy.io.pi_face_pins.Output07",
"raspy.string_utils.is_null_or_empty... | [((597, 620), 'raspy.io.pi_face_pins.Output00', 'pi_face_pins.Output00', ([], {}), '()\n', (618, 620), False, 'from raspy.io import pi_face_pins\n'), ((630, 653), 'raspy.io.pi_face_pins.Output01', 'pi_face_pins.Output01', ([], {}), '()\n', (651, 653), False, 'from raspy.io import pi_face_pins\n'), ((663, 686), 'raspy.i... |
from spacel.provision.template.tables import TablesTemplate
from test import ORBIT_NAME
from test.provision.template import BaseTemplateTest
class TestTablesTemplate(BaseTemplateTest):
def _template_name(self):
return 'tables'
def _cache(self, ami_finder):
return TablesTemplate()
def tes... | [
"spacel.provision.template.tables.TablesTemplate"
] | [((291, 307), 'spacel.provision.template.tables.TablesTemplate', 'TablesTemplate', ([], {}), '()\n', (305, 307), False, 'from spacel.provision.template.tables import TablesTemplate\n')] |
import torch
import torch.nn as nn
import torch.nn.init as init
import torch.nn.functional as F
from tensorboardX import SummaryWriter
class AttrProxy(object):
"""
Translates index lookups into attribute lookups.
To implement some trick which able to use list of nn.Module in a nn.Module
see https://dis... | [
"torch.nn.init.normal_",
"torch.nn.Tanh",
"torch.bmm",
"torch.nn.Linear",
"torch.nn.functional.pairwise_distance",
"torch.nn.init.xavier_normal_",
"torch.nn.ReLU",
"torch.nn.CrossEntropyLoss",
"torch.nn.Sigmoid",
"torch.mul",
"torch.nn.LeakyReLU",
"torch.stack",
"torch.nn.Softmax",
"torch.... | [((1405, 1430), 'torch.bmm', 'torch.bmm', (['A_in', 'state_in'], {}), '(A_in, state_in)\n', (1414, 1430), False, 'import torch\n'), ((1447, 1474), 'torch.bmm', 'torch.bmm', (['A_out', 'state_out'], {}), '(A_out, state_out)\n', (1456, 1474), False, 'import torch\n'), ((1487, 1525), 'torch.cat', 'torch.cat', (['(a_in, a_... |
# Compatibility Python 3
# Import project files
import utils_data
# Import External Packages
import numpy as np
import math
from sklearn.model_selection import train_test_split
from sklearn import linear_model
from sklearn.preprocessing import StandardScaler, MinMaxScaler
# torch packages
import torch
from torch.aut... | [
"torch.save",
"sklearn.preprocessing.StandardScaler",
"numpy.arctan2",
"numpy.zeros",
"torch.stack",
"numpy.concatenate",
"utils_data.millis",
"torch.nn.LeakyReLU",
"numpy.sin",
"torch.load",
"torch.autograd.Variable",
"utils_data.states2delta",
"torch.Tensor",
"sklearn.linear_model.Linear... | [((31707, 31718), 'numpy.array', 'np.array', (['X'], {}), '(X)\n', (31715, 31718), True, 'import numpy as np\n'), ((871, 902), 'sklearn.linear_model.LinearRegression', 'linear_model.LinearRegression', ([], {}), '()\n', (900, 902), False, 'from sklearn import linear_model\n'), ((1418, 1456), 'numpy.hstack', 'np.hstack',... |
"""Treadmill cell checkout.
"""
import collections
import datetime
import importlib
import logging
import multiprocessing
import os
import random
import time
import traceback
import socket
import unittest
import click
import flask
import HtmlTestRunner
from treadmill import cli
from treadmill import context
from tre... | [
"treadmill.fs.mkdir_safe",
"unittest.TestSuite",
"treadmill.fs.rm_safe",
"socket.socket",
"treadmill.sysinfo.hostname",
"flask.Flask",
"time.sleep",
"traceback.print_exc",
"os.path.join",
"HtmlTestRunner.HtmlTestRunner",
"datetime.datetime.now",
"treadmill.cli.make_multi_command",
"click.Pat... | [((407, 434), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (424, 434), False, 'import logging\n'), ((524, 547), 'treadmill.utils.drop_privileges', 'utils.drop_privileges', ([], {}), '()\n', (545, 547), False, 'from treadmill import utils\n'), ((558, 579), 'flask.Flask', 'flask.Flask', (... |
"""
https://saucelabs.com/selenium-4
"""
import pathlib
import re
import time
from typing import Dict, List, Optional
from dictor import dictor
from loguru import logger
from pydantic import (
HttpUrl,
ValidationError,
validate_arguments,
Field
)
from selenium.common.exceptions import (
NoSuchWindo... | [
"sel4.core.helpers__.shadow.is_shadow_selector",
"rich.table.Table",
"sel4.core.helpers__.shared.check_if_time_limit_exceeded",
"loguru.logger.exception",
"sel4.core.helpers__.js_utils.wait_for_angularjs",
"sel4.core.helpers__.page_actions.is_element_enabled",
"selenium.common.exceptions.NoSuchWindowExc... | [((8700, 8724), 'sel4.core.helpers__.js_utils.is_in_frame', 'is_in_frame', (['self.driver'], {}), '(self.driver)\n', (8711, 8724), False, 'from sel4.core.helpers__.js_utils import wait_for_ready_state_complete, get_scroll_distance_to_element, wait_for_angularjs, is_in_frame, slow_scroll_to_element, scroll_to_element, j... |
import os
import sys
from netCDF4 import Dataset,stringtochar,chartostring
from netcdf import NetCDF
import numpy as np
import time
import json
import copy
def createNetCDF(filePath,folder=os.getcwd(),metadata={},dimensions={},variables={},groups={},ncSize=1.0):
"""
Create typical NetCDF file based on set of varia... | [
"numpy.prod",
"netcdf.NetCDF.create",
"netCDF4.Dataset",
"numpy.dtype",
"numpy.where",
"numpy.insert",
"numpy.concatenate",
"numpy.arange",
"os.getcwd",
"numpy.ravel_multi_index",
"numpy.floor",
"numpy.min",
"numpy.all",
"numpy.unravel_index",
"numpy.append",
"json.loads",
"numpy.max... | [((190, 201), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (199, 201), False, 'import os\n'), ((614, 670), 'netcdf.NetCDF.create', 'NetCDF.create', (['filePath', 'metadata', 'dimensions', 'variables'], {}), '(filePath, metadata, dimensions, variables)\n', (627, 670), False, 'from netcdf import NetCDF\n'), ((12057, 12093... |
# Lint as: python3
# Copyright 2021 The TensorFlow Authors All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless r... | [
"os.path.join",
"tensorflow.convert_to_tensor",
"tensorflow.io.gfile.GFile",
"numpy.random.shuffle",
"tensorflow.norm",
"tensorflow.shape",
"delf.python.training.global_features_utils.debug_and_log",
"tensorflow.argsort",
"pickle.load",
"tensorflow.linalg.matmul",
"delf.python.training.model.glo... | [((6009, 6066), 'tensorflow.convert_to_tensor', 'tf.convert_to_tensor', (['([-1, 1] + [0] * self._num_negatives)'], {}), '([-1, 1] + [0] * self._num_negatives)\n', (6029, 6066), True, 'import tensorflow as tf\n'), ((8385, 8447), 'delf.python.training.global_features_utils.debug_and_log', 'global_features_utils.debug_an... |
from jukebox import app
from jukebox import db
from flask import (
redirect,
url_for,
flash,
request,
session
)
from jukebox.models import User, Session, Song
from jukebox import db
from flask_login import login_required, current_user
from sqlalchemy.exc import IntegrityError
from werkzeug.exception... | [
"flask.url_for",
"requests.post",
"spotipy.Spotify",
"flask.request.args.get",
"flask.flash",
"jukebox.app.route",
"flask.redirect",
"jukebox.db.session.commit"
] | [((846, 871), 'jukebox.app.route', 'app.route', (['"""/spotify-add"""'], {}), "('/spotify-add')\n", (855, 871), False, 'from jukebox import app\n'), ((1169, 1200), 'jukebox.app.route', 'app.route', (['"""/spotify-callback/"""'], {}), "('/spotify-callback/')\n", (1178, 1200), False, 'from jukebox import app\n'), ((1148,... |
from constants.cdr_cleaner import clean_cdr as cdr_consts
import constants.bq_utils as bq_consts
OBSERVATION_TABLE = 'observation'
REMOVE_DUPLICATE_TEMPLATE = """
SELECT
o.*
FROM
`{project_id}.{dataset_id}.observation` AS o
JOIN
(
SELECT
observation_id
FROM (
SELECT
DENSE_RANK() OVER(PARTITION ... | [
"cdr_cleaner.clean_cdr_engine.add_console_logging",
"cdr_cleaner.args_parser.parse_args",
"cdr_cleaner.clean_cdr_engine.clean_dataset"
] | [((1672, 1691), 'cdr_cleaner.args_parser.parse_args', 'parser.parse_args', ([], {}), '()\n', (1689, 1691), True, 'import cdr_cleaner.args_parser as parser\n'), ((1697, 1747), 'cdr_cleaner.clean_cdr_engine.add_console_logging', 'clean_engine.add_console_logging', (['ARGS.console_log'], {}), '(ARGS.console_log)\n', (1729... |
#!/usr/bin/env python
# encoding: utf-8
import npyscreen
#npyscreen.disableColor()
class TestApp(npyscreen.NPSApp):
def main(self):
# These lines create the form and populate it with widgets.
# A fairly complex screen in only 8 or so lines of code - a line for each control.
F = npyscreen.Fo... | [
"npyscreen.FormMultiPageActionWithMenus"
] | [((308, 375), 'npyscreen.FormMultiPageActionWithMenus', 'npyscreen.FormMultiPageActionWithMenus', ([], {'name': '"""Welcome to Npyscreen"""'}), "(name='Welcome to Npyscreen')\n", (346, 375), False, 'import npyscreen\n')] |
from network import WLAN
from network import ETH
import time
import machine
from machine import RTC
import pycom
import _thread
print('\nStarting LoRaWAN concentrator')
# Disable Hearbeat
pycom.heartbeat(False)
# Define callback function for Pygate events
def machine_cb (arg):
evt = machine.events()
if (evt &... | [
"_thread.start_new_thread",
"pycom.rgbled",
"network.WLAN",
"machine.callback",
"pycom.heartbeat",
"machine.RTC",
"machine.events",
"network.ETH",
"machine.pygate_init",
"time.sleep"
] | [((189, 211), 'pycom.heartbeat', 'pycom.heartbeat', (['(False)'], {}), '(False)\n', (204, 211), False, 'import pycom\n'), ((604, 731), 'machine.callback', 'machine.callback', ([], {'trigger': '(machine.PYGATE_START_EVT | machine.PYGATE_STOP_EVT | machine.PYGATE_ERROR_EVT)', 'handler': 'machine_cb'}), '(trigger=machine.... |
import json
import os
import pandas as pd
from time import time
class WikidataFilter():
def __init__(self, choice="id", files=[],
source='./data/latest-all.json.gz'):
self.choice = choice
self.source = source
if choice != "type" and choice != "id":
raise Valu... | [
"os.path.splitext",
"json.loads",
"pandas.read_csv",
"time.time",
"pandas.DataFrame",
"os.path.basename"
] | [((544, 600), 'pandas.DataFrame', 'pd.DataFrame', ([], {'columns': "['FileDescriptor', 'ids', 'Found']"}), "(columns=['FileDescriptor', 'ids', 'Found'])\n", (556, 600), True, 'import pandas as pd\n'), ((2087, 2208), 'pandas.read_csv', 'pd.read_csv', (['self.source'], {'chunksize': 'chunksize', 'compression': '"""gzip""... |
## Automatically adapted for numpy.oldnumeric Jul 23, 2007 by
#############################################################################
#
# Author: <NAME>
#
# Copyright: <NAME> TSRI 2000
#
#############################################################################
#
# $Header: /opt/cvs/python/packages/share1.5/... | [
"numpy.oldnumeric.array",
"copy.deepcopy"
] | [((3178, 3206), 'copy.deepcopy', 'deepcopy', (['work[lo + h][::-1]'], {}), '(work[lo + h][::-1])\n', (3186, 3206), False, 'from copy import deepcopy\n'), ((7375, 8573), 'numpy.oldnumeric.array', 'Numeric.array', (['((16.967, 12.784, 4.338), (13.856, 11.469, 6.066), (13.66, 10.707, 9.787),\n (10.646, 8.991, 11.408), ... |
# -*- coding: utf-8 -*-
import os
import pytest
import pandas as pd
from stocks_correlation.providers.quandl import url, API_KEY_ENV, dataframe
@pytest.mark.parametrize('ticker, start_date, end_date, expected', (
('MSFT', '2010-01-01', '2011-01-01', 'https://www.quandl.com/api/v3/datasets/WIKI/MSFT.csv?start_dat... | [
"pytest.mark.parametrize",
"stocks_correlation.providers.quandl.dataframe",
"stocks_correlation.providers.quandl.url"
] | [((148, 650), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""ticker, start_date, end_date, expected"""', "(('MSFT', '2010-01-01', '2011-01-01',\n 'https://www.quandl.com/api/v3/datasets/WIKI/MSFT.csv?start_date=2010-01-01&end_date=2011-01-01'\n ), ('FB', '2010-05-27', '2015-07-06',\n 'https://www.... |
import glob
import pandas as pd
import numpy as np
buildings = glob.glob("cache/*buildings_match_controls.csv")
juris_names = [b.replace("_buildings_match_controls.csv", "").
replace("cache/", "") for b in buildings]
buildings = [pd.read_csv(b) for b in buildings]
for i in range(len(buildings)):
bui... | [
"pandas.concat",
"pandas.read_csv",
"pandas.to_numeric",
"glob.glob"
] | [((64, 112), 'glob.glob', 'glob.glob', (['"""cache/*buildings_match_controls.csv"""'], {}), "('cache/*buildings_match_controls.csv')\n", (73, 112), False, 'import glob\n'), ((373, 393), 'pandas.concat', 'pd.concat', (['buildings'], {}), '(buildings)\n', (382, 393), True, 'import pandas as pd\n'), ((1317, 1361), 'pandas... |
import os
import shutil
path = os.pathsep.join([
'.',
os.path.expanduser('~/pymotw'),
])
mode = os.F_OK | os.R_OK
filename = shutil.which(
'config.ini',
mode=mode,
path=path,
)
print(filename)
| [
"os.path.expanduser",
"shutil.which"
] | [((136, 184), 'shutil.which', 'shutil.which', (['"""config.ini"""'], {'mode': 'mode', 'path': 'path'}), "('config.ini', mode=mode, path=path)\n", (148, 184), False, 'import shutil\n'), ((63, 93), 'os.path.expanduser', 'os.path.expanduser', (['"""~/pymotw"""'], {}), "('~/pymotw')\n", (81, 93), False, 'import os\n')] |
# Generated by Django 3.1 on 2020-08-10 20:13
import datetime
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('myapp', '0007_auto_20200810_1700'),
]
operations = [
migrations.CreateModel(
name='EmailRecord',
field... | [
"django.db.models.DateTimeField",
"django.db.models.AutoField",
"django.db.models.BooleanField",
"django.db.models.CharField",
"django.db.models.EmailField"
] | [((1154, 1188), 'django.db.models.BooleanField', 'models.BooleanField', ([], {'default': '(False)'}), '(default=False)\n', (1173, 1188), False, 'from django.db import migrations, models\n'), ((347, 440), 'django.db.models.AutoField', 'models.AutoField', ([], {'auto_created': '(True)', 'primary_key': '(True)', 'serializ... |
# -*- coding: utf-8 -*-
# @Author: Climax
# @Date: 2022-04-27 23:02:15
# @Last Modified by: Climax
# @Last Modified time: 2022-04-28 00:52:44
import sys
from PyQt5.QtCore import Qt
from PyQt5.QtWidgets import QApplication, QMainWindow, QWidget, QStackedLayout
from layout_colorwidget import Color
class MainWindow... | [
"layout_colorwidget.Color",
"PyQt5.QtWidgets.QStackedLayout",
"PyQt5.QtWidgets.QWidget",
"PyQt5.QtWidgets.QApplication"
] | [((730, 752), 'PyQt5.QtWidgets.QApplication', 'QApplication', (['sys.argv'], {}), '(sys.argv)\n', (742, 752), False, 'from PyQt5.QtWidgets import QApplication, QMainWindow, QWidget, QStackedLayout\n'), ((435, 451), 'PyQt5.QtWidgets.QStackedLayout', 'QStackedLayout', ([], {}), '()\n', (449, 451), False, 'from PyQt5.QtWi... |
"""Global Parameters"""
from src.utilities import get_labelset
# SPECIFY PATH TO AUDIO FILES
AUDIO_DIR_PATH = ""
# SPECIFY PATH TO ANNOTATION FILES
ANNOT_DIR_PATH = ""
# SPECIFY TARGET DIRECTORY FOR GENERATED SPECTROGRAMS
SPECT_DIR_PATH = ""
# SPECIFY SUBDIRECTORIES FOR SPECTROGRAM WINDOWS AND WINDOW LABELVECTORS
W... | [
"src.utilities.get_labelset"
] | [((1521, 1565), 'src.utilities.get_labelset', 'get_labelset', (['ANNOT_DIR_PATH', 'ANNOT_FILE_FMT'], {}), '(ANNOT_DIR_PATH, ANNOT_FILE_FMT)\n', (1533, 1565), False, 'from src.utilities import get_labelset\n')] |
import pandas as pd
import numpy as np
import os
from gneiss.util import match
from biom.util import biom_open
from biom import load_table
from collections import Counter
import numpy as np
import shutil
import os
np.random.seed(42)
def make_safe_dir(tmp_w):
if not os.path.exists(tmp_w):
os.makedirs(tmp_w)... | [
"os.path.join",
"numpy.random.choice",
"os.listdir",
"os.path.exists",
"biom.util.biom_open",
"biom.load_table",
"shutil.rmtree",
"collections.Counter",
"numpy.random.seed",
"numpy.arange",
"os.makedirs"
] | [((214, 232), 'numpy.random.seed', 'np.random.seed', (['(42)'], {}), '(42)\n', (228, 232), True, 'import numpy as np\n'), ((754, 798), 'os.path.join', 'os.path.join', (['"""data"""', 'dataset_', '"""table.biom"""'], {}), "('data', dataset_, 'table.biom')\n", (766, 798), False, 'import os\n'), ((809, 828), 'biom.load_ta... |
import ifaddr
def get_ip_address(interface_name):
adapters = ifaddr.get_adapters()
for adapter in adapters:
if adapter.name == interface_name or adapter.nice_name == interface_name:
for ip in adapter.ips:
if ":" not in ip.ip[0]: # We only want ipv4
retu... | [
"ifaddr.get_adapters"
] | [((67, 88), 'ifaddr.get_adapters', 'ifaddr.get_adapters', ([], {}), '()\n', (86, 88), False, 'import ifaddr\n')] |
from hyperts.utils import consts
from collections import OrderedDict
import tensorflow as tf
from tensorflow.keras import layers
from tensorflow.keras import models
import tensorflow.keras.backend as K
from hypernets.utils import logging
logger = logging.get_logger(__name__)
class MultiColEmbedding(layers.Layer):
... | [
"hypernets.utils.logging.get_logger",
"tensorflow.concat",
"tensorflow.keras.layers.Dense",
"tensorflow.keras.backend.reshape",
"tensorflow.reshape",
"tensorflow.multiply",
"tensorflow.keras.layers.GlobalAveragePooling1D",
"tensorflow.squeeze",
"tensorflow.cast",
"tensorflow.transpose",
"tensorf... | [((250, 278), 'hypernets.utils.logging.get_logger', 'logging.get_logger', (['__name__'], {}), '(__name__)\n', (268, 278), False, 'from hypernets.utils import logging\n'), ((7165, 7178), 'collections.OrderedDict', 'OrderedDict', ([], {}), '()\n', (7176, 7178), False, 'from collections import OrderedDict\n'), ((7204, 721... |
from lib2to3.pytree import convert
from urllib import parse
from bs4 import BeautifulSoup
import requests
import discord
from discord.ext import commands
class url:
def __init__(self, stock: str):
self.stock = stock
self.BASE_URL = "https://finance.naver.com"
def convert_stock(self):
r... | [
"discord.ext.commands.command",
"requests.get",
"bs4.BeautifulSoup"
] | [((2298, 2330), 'discord.ext.commands.command', 'commands.command', ([], {'aliases': "['주식']"}), "(aliases=['주식'])\n", (2314, 2330), False, 'from discord.ext import commands\n'), ((507, 531), 'requests.get', 'requests.get', (['search_url'], {}), '(search_url)\n', (519, 531), False, 'import requests\n'), ((597, 638), 'b... |
from keras.models import Model
from keras.models import Input
from keras.layers import Conv2D
from keras.layers import Conv2DTranspose
from keras.layers import Activation
from keras.initializers import RandomNormal
from keras.layers import Concatenate
from tensorflow_addons.layers import InstanceNormalization
def res... | [
"tensorflow_addons.layers.InstanceNormalization",
"keras.layers.Activation",
"keras.models.Model",
"keras.layers.Conv2DTranspose",
"keras.initializers.RandomNormal",
"keras.layers.Concatenate",
"keras.layers.Conv2D",
"keras.models.Input"
] | [((394, 419), 'keras.initializers.RandomNormal', 'RandomNormal', ([], {'stddev': '(0.02)'}), '(stddev=0.02)\n', (406, 419), False, 'from keras.initializers import RandomNormal\n'), ((980, 1005), 'keras.initializers.RandomNormal', 'RandomNormal', ([], {'stddev': '(0.02)'}), '(stddev=0.02)\n', (992, 1005), False, 'from k... |
from yahoofinancials import YahooFinancials
import Common.Readers.YahooTicker as YahooTicker
from datetime import date
from Common.Readers.Engine.AbstractEngine import AbstractEngine
class YahooFinancialEngine(AbstractEngine):
"""description of class"""
StockName: str
PeRatio: float
FromDate: date
... | [
"yahoofinancials.YahooFinancials"
] | [((715, 756), 'yahoofinancials.YahooFinancials', 'YahooFinancials', (['self.__ticker.TickerName'], {}), '(self.__ticker.TickerName)\n', (730, 756), False, 'from yahoofinancials import YahooFinancials\n')] |
import cv2
cameraCapture = cv2.VideoCapture(0)
fps = 30 # an assumption
size = (int(cameraCapture.get(cv2.cv.CV_CAP_PROP_FRAME_WIDTH)),
int(cameraCapture.get(cv2.cv.CV_CAP_PROP_FRAME_HEIGHT)))
videoWriter = cv2.VideoWriter(
'MyOutputVid.avi', cv2.cv.CV_FOURCC('I','4','2','0'), fps, size)
success, frame = ... | [
"cv2.cv.CV_FOURCC",
"cv2.VideoCapture"
] | [((28, 47), 'cv2.VideoCapture', 'cv2.VideoCapture', (['(0)'], {}), '(0)\n', (44, 47), False, 'import cv2\n'), ((256, 292), 'cv2.cv.CV_FOURCC', 'cv2.cv.CV_FOURCC', (['"""I"""', '"""4"""', '"""2"""', '"""0"""'], {}), "('I', '4', '2', '0')\n", (272, 292), False, 'import cv2\n')] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.