code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
#!/usr/bin/python
# -*- coding: utf-8 -*-
import argparse
import math
def arguments():
# Handle command line arguments
parser = argparse.ArgumentParser(description='Adventofcode.')
parser.add_argument('-f', '--file', required=True)
args = parser.parse_args()
return args
class TobogganTrajector... | [
"argparse.ArgumentParser",
"math.prod"
] | [((138, 190), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Adventofcode."""'}), "(description='Adventofcode.')\n", (161, 190), False, 'import argparse\n'), ((1630, 1668), 'math.prod', 'math.prod', (['map_of_tree.number_of_trees'], {}), '(map_of_tree.number_of_trees)\n', (1639, 1668), F... |
#!/usr/bin/env python
import rospy
import os
# Import the spawn urdf model service from Gazebo.
from gazebo_msgs.srv import SpawnModel, SpawnModelRequest, GetModelProperties, GetModelPropertiesRequest
from geometry_msgs.msg import Pose
def spawn_unknown_obstacle(obstacle_name, obstacle_model_xml, obstacle_pose):
#... | [
"rospy.logerr",
"gazebo_msgs.srv.SpawnModelRequest",
"geometry_msgs.msg.Pose",
"rospy.init_node",
"rospy.ServiceProxy",
"os.path.join",
"rospy.sleep",
"rospy.loginfo"
] | [((394, 452), 'rospy.ServiceProxy', 'rospy.ServiceProxy', (['"""/gazebo/spawn_urdf_model"""', 'SpawnModel'], {}), "('/gazebo/spawn_urdf_model', SpawnModel)\n", (412, 452), False, 'import rospy\n'), ((508, 527), 'gazebo_msgs.srv.SpawnModelRequest', 'SpawnModelRequest', ([], {}), '()\n', (525, 527), False, 'from gazebo_m... |
### Code Adapted From <NAME> Kaggle Submission: https://www.kaggle.com/shayantaherian/nfl-training-fasterrcnn
# Import Packages
import pandas as pd
import numpy as np
from matplotlib import pyplot as plt
from matplotlib import patches
import imageio
from tqdm import tqdm_notebook as tqdm
from tqdm import tqdm
from ... | [
"numpy.uint8",
"torch.as_tensor",
"pandas.read_csv",
"matplotlib.pyplot.ylabel",
"torch.cuda.is_available",
"numpy.moveaxis",
"torch.cuda.memory_summary",
"numpy.mean",
"os.listdir",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"albumentations.pytorch.transforms.ToTensorV2",
"torch.... | [((3411, 3480), 'torchvision.models.detection.fasterrcnn_resnet50_fpn', 'torchvision.models.detection.fasterrcnn_resnet50_fpn', ([], {'pretrained': '(True)'}), '(pretrained=True)\n', (3463, 3480), False, 'import torchvision\n'), ((3750, 3793), 'torchvision.models.detection.faster_rcnn.FastRCNNPredictor', 'FastRCNNPredi... |
# Generated by Django 3.2.9 on 2021-12-06 15:49
import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('recipes', '0005_auto_202... | [
"django.db.migrations.swappable_dependency",
"django.db.migrations.RenameField",
"django.db.models.ForeignKey"
] | [((227, 284), 'django.db.migrations.swappable_dependency', 'migrations.swappable_dependency', (['settings.AUTH_USER_MODEL'], {}), '(settings.AUTH_USER_MODEL)\n', (258, 284), False, 'from django.db import migrations, models\n'), ((368, 470), 'django.db.migrations.RenameField', 'migrations.RenameField', ([], {'model_name... |
import simplematch as sm
def test_readme_example_opener():
assert sm.match("He* {planet}!", "Hello World!") == {"planet": "World"}
assert sm.match("It* {temp:float}°C *", "It's -10.2°C outside!") == {"temp": -10.2}
def test_readme_example_basic_usage():
result = sm.match(
pattern="Invoice*_{year... | [
"simplematch.register_type",
"simplematch.test",
"simplematch.match",
"simplematch.Matcher"
] | [((279, 377), 'simplematch.match', 'sm.match', ([], {'pattern': '"""Invoice*_{year}_{month}_{day}.pdf"""', 'string': '"""Invoice_RE2321_2021_01_15.pdf"""'}), "(pattern='Invoice*_{year}_{month}_{day}.pdf', string=\n 'Invoice_RE2321_2021_01_15.pdf')\n", (287, 377), True, 'import simplematch as sm\n'), ((473, 509), 'si... |
from scipy.stats import t
print(t.pdf(2,3))
| [
"scipy.stats.t.pdf"
] | [((32, 43), 'scipy.stats.t.pdf', 't.pdf', (['(2)', '(3)'], {}), '(2, 3)\n', (37, 43), False, 'from scipy.stats import t\n')] |
"""Test the CloudFormation template generated to manage the AWS Budgets resources
"""
from aws_budget_alerting import get_alerting_cf_template
EXPECTED_ALERTING_TEMPLATE = '''AWSTemplateFormatVersion: '2010-09-09'
Description: Stack alerting forecasted and actual AWS budget overspend to Slack
Parameters:
ActualCostW... | [
"aws_budget_alerting.get_alerting_cf_template"
] | [((4588, 4614), 'aws_budget_alerting.get_alerting_cf_template', 'get_alerting_cf_template', ([], {}), '()\n', (4612, 4614), False, 'from aws_budget_alerting import get_alerting_cf_template\n')] |
# test_tools.py
import unittest2 as unittest
import os
from graphviz.tools import mkdirs
class TestMkdirs(unittest.TestCase):
@staticmethod
def _dirnames(path=os.curdir):
return [name for name in os.listdir(path) if os.path.isdir(name)]
def test_cwd(self):
dirnames = self._dirnames()
... | [
"graphviz.tools.mkdirs",
"os.listdir",
"os.path.isdir"
] | [((327, 345), 'graphviz.tools.mkdirs', 'mkdirs', (['"""setup.py"""'], {}), "('setup.py')\n", (333, 345), False, 'from graphviz.tools import mkdirs\n'), ((478, 501), 'graphviz.tools.mkdirs', 'mkdirs', (['"""setup.py/spam"""'], {}), "('setup.py/spam')\n", (484, 501), False, 'from graphviz.tools import mkdirs\n'), ((217, ... |
from __future__ import annotations
from collections import namedtuple
from copy import deepcopy
from typing import Dict, List, Optional, Tuple, Union
import numpy as np
from numpy.typing import ArrayLike, NDArray
from simweights.powerlaw import PowerLaw
from simweights.spatial import SpatialDist
from .pdgcode impor... | [
"collections.namedtuple",
"numpy.unique",
"numpy.asarray",
"numpy.any",
"numpy.isfinite",
"copy.deepcopy",
"numpy.zeros_like"
] | [((346, 425), 'collections.namedtuple', 'namedtuple', (['"""SurfaceTuple"""', "['pdgid', 'nevents', 'energy_dist', 'spatial_dist']"], {}), "('SurfaceTuple', ['pdgid', 'nevents', 'energy_dist', 'spatial_dist'])\n", (356, 425), False, 'from collections import namedtuple\n'), ((1557, 1571), 'copy.deepcopy', 'deepcopy', ([... |
import csv
import os
from datetime import datetime
import time
import locale
import re
from src.Entities import Restaurant, Product, Address, Customer, Order, Coupon
from src.database import Database
from src.logger import Logger
class OrderData:
SKIP_ROWS = 4
def __init__(self, fileName):
self.fileN... | [
"src.Entities.Order.OrderLine",
"src.Entities.Address.getOrCreateAddress",
"src.Entities.Coupon.createCouponIfNotExists",
"src.Entities.Customer.createOrUpdateCustomer",
"src.Entities.Product.getPizzaCrustByName",
"src.Entities.Product.getPizzaIdByName",
"csv.reader",
"src.Entities.Order.createOrderLi... | [((359, 369), 'src.database.Database', 'Database', ([], {}), '()\n', (367, 369), False, 'from src.database import Database\n'), ((392, 400), 'src.logger.Logger', 'Logger', ([], {}), '()\n', (398, 400), False, 'from src.logger import Logger\n'), ((6820, 6860), 'locale.setlocale', 'locale.setlocale', (['locale.LC_ALL', '... |
from flask import render_template, flash, redirect, url_for
from app import app
from app.forms import LoginForm
from flask_login import current_user, login_user
from app.models import User
from flask_login import logout_user
from flask_login import login_required
from flask import request
from werkzeug.urls import url_... | [
"flask.render_template",
"flask.request.args.get",
"app.db.session.commit",
"app.forms.ResetPasswordRequestForm",
"app.models.Post",
"app.forms.ManageForm",
"app.models.User",
"app.forms.PostEventForm",
"app.db.session.add",
"flask_login.current_user.unapply",
"guess_language.guess_language",
... | [((983, 1022), 'app.app.route', 'app.route', (['"""/"""'], {'methods': "['GET', 'POST']"}), "('/', methods=['GET', 'POST'])\n", (992, 1022), False, 'from app import app\n'), ((1095, 1139), 'app.app.route', 'app.route', (['"""/index"""'], {'methods': "['GET', 'POST']"}), "('/index', methods=['GET', 'POST'])\n", (1104, 1... |
import datetime as dt
ClassLabel = {
"NoLabel": "0",
"Meal_Preparation": "1",
"Relax": "2",
"Eating": "3",
"Work": "4",
"Sleeping": "5",
"Wash_Dishes": "6",
"Bed_to_Toilet": "7",
"Enter_Home": "8",
"Leave_Home": "9",
"Housekeeping": "10",
"Respirate": "11"
}
class State... | [
"datetime.datetime",
"datetime.datetime.now",
"datetime.timedelta"
] | [((428, 445), 'datetime.datetime.now', 'dt.datetime.now', ([], {}), '()\n', (443, 445), True, 'import datetime as dt\n'), ((1951, 2002), 'datetime.datetime', 'dt.datetime', (['year', 'month', 'day', 'hour', 'minute', 'second'], {}), '(year, month, day, hour, minute, second)\n', (1962, 2002), True, 'import datetime as d... |
#!/usr/bin/env python3
from asyncio import format_helpers
from udi_interface import Node,LOGGER,Custom,LOG_HANDLER
import sys
import json
import time
import http.client
import urllib.parse
from datetime import datetime
import os
import os.path
import re
import logging
from copy import deepcopy
from pgSession import... | [
"udi_interface.LOG_HANDLER.set_basic_config",
"udi_interface.LOGGER.info",
"datetime.datetime.fromtimestamp",
"datetime.datetime.strptime",
"json.dumps",
"udi_interface.Custom",
"udi_interface.LOGGER.warning",
"time.sleep",
"pgSession.pgSession",
"datetime.datetime.now",
"udi_interface.LOGGER.de... | [((1315, 1338), 'udi_interface.Custom', 'Custom', (['poly', '"""notices"""'], {}), "(poly, 'notices')\n", (1321, 1338), False, 'from udi_interface import Node, LOGGER, Custom, LOG_HANDLER\n'), ((1370, 1396), 'udi_interface.Custom', 'Custom', (['poly', '"""customdata"""'], {}), "(poly, 'customdata')\n", (1376, 1396), Fa... |
from behave import given, when, then
from hamcrest.core import assert_that, equal_to
from hamcrest.library.number.ordering_comparison import greater_than
import requests
import json
import logging
from hamcrest.library.text.stringcontains import contains_string
@given(u'I select "{house_price}" as House Price')
def ... | [
"behave.given",
"json.loads",
"hamcrest.library.number.ordering_comparison.greater_than",
"requests.get",
"behave.when",
"hamcrest.core.equal_to",
"behave.then"
] | [((266, 315), 'behave.given', 'given', (['u"""I select "{house_price}" as House Price"""'], {}), '(u\'I select "{house_price}" as House Price\')\n', (271, 315), False, 'from behave import given, when, then\n'), ((395, 436), 'behave.given', 'given', (['u"""I omit the "{param_name}" field"""'], {}), '(u\'I omit the "{par... |
#!/usr/bin/env python3
import argparse
import subprocess
import pathlib
import os.path
parser = argparse.ArgumentParser(description='Convert high quality scans to lower quality PDFs.')
parser.add_argument('filenames', metavar='FILE', type=str, nargs='+',
help='input files to be converted')
parser.... | [
"pathlib.PurePath",
"argparse.ArgumentParser"
] | [((98, 191), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Convert high quality scans to lower quality PDFs."""'}), "(description=\n 'Convert high quality scans to lower quality PDFs.')\n", (121, 191), False, 'import argparse\n'), ((1016, 1042), 'pathlib.PurePath', 'pathlib.PurePath'... |
from mock import Mock
from firstclasspostcodes.events import Events
class TestEventsClass:
def test_an_event_can_be_added(self):
mock_handler = Mock(return_value=None)
events = Events()
events.on('test', mock_handler)
assert 'test' in events.events
assert mock_handler in ev... | [
"mock.Mock",
"firstclasspostcodes.events.Events"
] | [((158, 181), 'mock.Mock', 'Mock', ([], {'return_value': 'None'}), '(return_value=None)\n', (162, 181), False, 'from mock import Mock\n'), ((199, 207), 'firstclasspostcodes.events.Events', 'Events', ([], {}), '()\n', (205, 207), False, 'from firstclasspostcodes.events import Events\n'), ((418, 441), 'mock.Mock', 'Mock'... |
from calendar import timegm
from datetime import datetime
from ephem import Moon, Observer, constellation, next_full_moon, next_new_moon
from numpy import rad2deg
from app.business.astronomy.planets.models import Planet, PlanetType, SolarSystem
class ObserverBuilder:
def __init__(self, latitude: str, longitude:... | [
"ephem.Observer",
"datetime.datetime.utcnow",
"app.business.astronomy.planets.models.Planet",
"ephem.next_new_moon",
"ephem.constellation",
"ephem.next_full_moon",
"numpy.rad2deg",
"app.business.astronomy.planets.models.SolarSystem"
] | [((496, 506), 'ephem.Observer', 'Observer', ([], {}), '()\n', (504, 506), False, 'from ephem import Moon, Observer, constellation, next_full_moon, next_new_moon\n'), ((1502, 1516), 'app.business.astronomy.planets.models.Planet', 'Planet', ([], {}), '(**data)\n', (1508, 1516), False, 'from app.business.astronomy.planets... |
from django.http import JsonResponse
import json
import urllib.request as urllib2
from watson_developer_cloud import VisualRecognitionV3
visual_recognition = VisualRecognitionV3(
'2018-03-19',
iam_apikey='<KEY>')
def agora(request):
target_url = request.GET["url"]
import shutil
import urlli... | [
"watson_developer_cloud.VisualRecognitionV3",
"django.http.JsonResponse"
] | [((160, 213), 'watson_developer_cloud.VisualRecognitionV3', 'VisualRecognitionV3', (['"""2018-03-19"""'], {'iam_apikey': '"""<KEY>"""'}), "('2018-03-19', iam_apikey='<KEY>')\n", (179, 213), False, 'from watson_developer_cloud import VisualRecognitionV3\n'), ((978, 999), 'django.http.JsonResponse', 'JsonResponse', (['cl... |
import sys
from PyQt5 import QtGui, QtCore, QtWidgets
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *
from time import sleep
from view import Scene
class MyApplication(QtWidgets.QMainWindow):
def __init__(self, app):
#
# Call __init__ for the parent class to init... | [
"PyQt5.QtGui.QIcon",
"PyQt5.QtCore.QFileInfo",
"view.Scene",
"PyQt5.QtWidgets.QAction",
"PyQt5.QtWidgets.QMessageBox.about",
"PyQt5.QtWidgets.QDesktopWidget"
] | [((711, 718), 'view.Scene', 'Scene', ([], {}), '()\n', (716, 718), False, 'from view import Scene\n'), ((2433, 2544), 'PyQt5.QtWidgets.QAction', 'QtWidgets.QAction', (['"""E&xit"""', 'self'], {'shortcut': '"""Ctrl+Q"""', 'statusTip': '"""Exit the application"""', 'triggered': 'self.quit'}), "('E&xit', self, shortcut='C... |
"""The code to test training process for onet"""
import tensorflow as tf
from src.mtcnn import train_net, ONet
def train_Onet(training_data, base_lr, loss_weight,
train_mode, num_epochs,
load_model=False, load_filename=None,
save_model=False, save_filename=None,
... | [
"tensorflow.device",
"tensorflow.Graph",
"src.mtcnn.train_net"
] | [((419, 429), 'tensorflow.Graph', 'tf.Graph', ([], {}), '()\n', (427, 429), True, 'import tensorflow as tf\n'), ((471, 488), 'tensorflow.device', 'tf.device', (['device'], {}), '(device)\n', (480, 488), True, 'import tensorflow as tf\n'), ((502, 836), 'src.mtcnn.train_net', 'train_net', ([], {'Net': 'ONet', 'training_d... |
#!/usr/bin/env python
# _*_ coding:utf-8 _*_
"""
Example application views.
Note that `render_template` is wrapped with `make_response` in all application
routes. While not necessary for most Flask apps, it is required in the
App Template for static publishing.
"""
import app_config
import logging
import oauth
import... | [
"logging.basicConfig",
"render_utils.make_context",
"logging.getLogger",
"flask.render_template",
"flask.Flask",
"werkzeug.debug.DebuggedApplication",
"logging.error"
] | [((542, 557), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (547, 557), False, 'from flask import Flask, make_response, render_template\n'), ((704, 753), 'logging.basicConfig', 'logging.basicConfig', ([], {'format': 'app_config.LOG_FORMAT'}), '(format=app_config.LOG_FORMAT)\n', (723, 753), False, 'import ... |
# Copyright 2021 Xanadu Quantum Technologies Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agre... | [
"numpy.allclose",
"pytest.mark.parametrize",
"numpy.array",
"math.cosh",
"math.sinh"
] | [((688, 735), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""phi"""', '[0.1, 0.2, 0.3]'], {}), "('phi', [0.1, 0.2, 0.3])\n", (711, 735), False, 'import pytest\n'), ((1186, 1225), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""n"""', '[1, 2, 3]'], {}), "('n', [1, 2, 3])\n", (1209, 1225), False,... |
__author__ = '<NAME>'
__license__ = "MIT"
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
from math import sqrt
import datetime
from mpl_toolkits.basemap import Basemap
from matplotlib.colors import LinearSegmentedColormap
# Set the plot styles
parse = lambda x: datetime.... | [
"matplotlib.pyplot.savefig",
"pandas.read_csv",
"seaborn.despine",
"seaborn.color_palette",
"pandas.merge",
"seaborn.set_context",
"math.sqrt",
"seaborn.set_style",
"mpl_toolkits.basemap.Basemap",
"matplotlib.pyplot.register_cmap",
"pandas.DataFrame"
] | [((703, 725), 'seaborn.set_style', 'sns.set_style', (['"""ticks"""'], {}), "('ticks')\n", (716, 725), True, 'import seaborn as sns\n'), ((726, 750), 'seaborn.set_context', 'sns.set_context', (['"""paper"""'], {}), "('paper')\n", (741, 750), True, 'import seaborn as sns\n'), ((803, 819), 'pandas.DataFrame', 'pd.DataFram... |
#!/usr/bin/env python3
#
# <NAME> 2017 (c) BSD 2-Clause
from sys import stdout, exit
from html import escape as esc
#import cgitb
def print_100_lines(path):
# cgitb.enable()
'''
print last lines of file
'''
header = ('Content-Type: text/html\n\n')
html_head = ('''
<!DOCTYPE html>
<htm... | [
"html.escape",
"sys.exit",
"sys.stdout.write"
] | [((537, 557), 'sys.stdout.write', 'stdout.write', (['header'], {}), '(header)\n', (549, 557), False, 'from sys import stdout, exit\n'), ((562, 585), 'sys.stdout.write', 'stdout.write', (['html_head'], {}), '(html_head)\n', (574, 585), False, 'from sys import stdout, exit\n'), ((1337, 1360), 'sys.stdout.write', 'stdout.... |
import math
from abc import ABC, abstractmethod
class TimeModifier(ABC):
@abstractmethod
def sample(self, time):
pass
class ConstantTimeModifier(TimeModifier):
def sample(self, time):
return 0
class Vibrato(TimeModifier):
def __init__(self, amplitude=10, frequency=10):
self... | [
"math.cos"
] | [((434, 457), 'math.cos', 'math.cos', (['(self.w * time)'], {}), '(self.w * time)\n', (442, 457), False, 'import math\n')] |
import turtle
from map import Map
from closing_instructions import Instructions
# # Obtendo as coordenadas da screen
# def get_mouse_click_coor(x, y):
# print(x, y)
#
#
# turtle.onscreenclick(get_mouse_click_coor)
#
# turtle.mainloop() # Forma alternativa de deixar a screen aberta mesmo depois do código ter termi... | [
"turtle.Screen",
"turtle.shape",
"map.Map",
"closing_instructions.Instructions"
] | [((336, 351), 'turtle.Screen', 'turtle.Screen', ([], {}), '()\n', (349, 351), False, 'import turtle\n'), ((534, 553), 'turtle.shape', 'turtle.shape', (['image'], {}), '(image)\n', (546, 553), False, 'import turtle\n'), ((617, 622), 'map.Map', 'Map', ([], {}), '()\n', (620, 622), False, 'from map import Map\n'), ((638, ... |
import hmac, hashlib, json, socket, threading, logging, time, functools
from halibot import HalModule, Message, Context
log = logging.getLogger(__name__)
class ListenerThread(threading.Thread):
def __init__(self, module, sockaddr, senders=None, rcps=None, format='<%(snick)s> %(msg)s', msgsize=4096):
supe... | [
"logging.getLogger",
"socket.socket",
"halibot.Message",
"halibot.Context",
"time.time"
] | [((128, 155), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (145, 155), False, 'import hmac, hashlib, json, socket, threading, logging, time, functools\n'), ((384, 432), 'socket.socket', 'socket.socket', (['socket.AF_INET', 'socket.SOCK_DGRAM'], {}), '(socket.AF_INET, socket.SOCK_DGRAM)\... |
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
import asyncio
import pytest
import logging
logger = logging.getLogger(__name__)
logger.setLevel(level=logging.INFO)
pytestmark = pytest.mark.asyncio
@pytest.m... | [
"logging.getLogger",
"pytest.mark.describe",
"asyncio.sleep",
"pytest.fixture",
"pytest.mark.it"
] | [((211, 238), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (228, 238), False, 'import logging\n'), ((312, 369), 'pytest.mark.describe', 'pytest.mark.describe', (['"""Device Client send_message method"""'], {}), "('Device Client send_message method')\n", (332, 369), False, 'import pytest... |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | [
"openerp.report.report_sxw.report_sxw"
] | [((6206, 6428), 'openerp.report.report_sxw.report_sxw', 'report_sxw.report_sxw', (['"""report.all.closed.cashbox.of.the.day"""', '"""account.bank.statement"""', '"""addons/point_of_sale/report/all_closed_cashbox_of_the_day.rml"""'], {'parser': 'all_closed_cashbox_of_the_day', 'header': '"""internal"""'}), "('report.all... |
# ------------------------------------------------------------------------------
# Access to the CodeHawk Binary Analyzer Analysis Results
# Author: <NAME>
# ------------------------------------------------------------------------------
# The MIT License (MIT)
#
# Copyright (c) 2016-2020 Kestrel Technology LLC
#
# Perm... | [
"chb.mips.MIPSRegister.MIPSRegister",
"chb.util.StringIndexedTable.StringIndexedTable",
"chb.asm.AsmRegister.ControlRegister",
"chb.util.IndexedTable.IndexedTable",
"chb.asm.AsmRegister.XmmRegister",
"chb.asm.AsmRegister.DebugRegister",
"chb.asm.AsmRegister.FloatingPointRegister",
"chb.asm.AsmRegister... | [((2112, 2134), 'chb.asm.AsmRegister.SegmentRegister', 'AR.SegmentRegister', (['*x'], {}), '(*x)\n', (2130, 2134), True, 'import chb.asm.AsmRegister as AR\n'), ((2154, 2172), 'chb.asm.AsmRegister.CPURegister', 'AR.CPURegister', (['*x'], {}), '(*x)\n', (2168, 2172), True, 'import chb.asm.AsmRegister as AR\n'), ((2192, 2... |
# Generated by Django 2.2.5 on 2019-10-28 09:58
from django.db import migrations, models
import mysign_app.models
class Migration(migrations.Migration):
dependencies = [
('mysign_app', '0008_auto_20191011_1115'),
]
operations = [
migrations.AddField(
model_name='company',
... | [
"django.db.models.ImageField"
] | [((363, 434), 'django.db.models.ImageField', 'models.ImageField', ([], {'blank': '(True)', 'upload_to': 'mysign_app.models.image_upload'}), '(blank=True, upload_to=mysign_app.models.image_upload)\n', (380, 434), False, 'from django.db import migrations, models\n')] |
# Copyright 2020 The Cirq developers
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... | [
"cirq.testing.assert_equivalent_repr",
"cirq.work.observables_to_settings",
"cirq.work.observable_settings._max_weight_observable",
"cirq.work._MeasurementSpec",
"cirq.LineQubit.range",
"cirq.Z",
"cirq.KET_ZERO",
"cirq.KET_MINUS",
"cirq.work.observable_settings._max_weight_state",
"cirq.Y",
"pyt... | [((920, 943), 'cirq.LineQubit.range', 'cirq.LineQubit.range', (['(2)'], {}), '(2)\n', (940, 943), False, 'import cirq\n'), ((1403, 1426), 'cirq.LineQubit.range', 'cirq.LineQubit.range', (['(2)'], {}), '(2)\n', (1423, 1426), False, 'import cirq\n'), ((1699, 1722), 'cirq.LineQubit.range', 'cirq.LineQubit.range', (['(2)']... |
from django.test import TestCase
from reader.sitemaps import StaticSitemap, WorksSitemap
class TestStaticSitemap(TestCase):
def test_load(self):
sitemap = StaticSitemap()
sitemap.items()
class TestWorksSitemap(TestCase):
def test_load(self):
sitemap = WorksSitemap()
sitemap... | [
"reader.sitemaps.WorksSitemap",
"reader.sitemaps.StaticSitemap"
] | [((170, 185), 'reader.sitemaps.StaticSitemap', 'StaticSitemap', ([], {}), '()\n', (183, 185), False, 'from reader.sitemaps import StaticSitemap, WorksSitemap\n'), ((290, 304), 'reader.sitemaps.WorksSitemap', 'WorksSitemap', ([], {}), '()\n', (302, 304), False, 'from reader.sitemaps import StaticSitemap, WorksSitemap\n'... |
from typing import List
import torch
from deepclustering.method import _Method
from deepclustering.model import Model
from torch import Tensor
class SubSpaceClusteringMethod(_Method):
def __init__(
self,
model: Model,
lamda: float = 0.1,
lr: float = 0.0001,
num_samples: in... | [
"torch.mm",
"torch.zeros_like",
"torch.randn",
"torch.device"
] | [((360, 380), 'torch.device', 'torch.device', (['"""cuda"""'], {}), "('cuda')\n", (372, 380), False, 'import torch\n'), ((4184, 4204), 'torch.device', 'torch.device', (['"""cuda"""'], {}), "('cuda')\n", (4196, 4204), False, 'import torch\n'), ((709, 769), 'torch.randn', 'torch.randn', (['(num_samples, num_samples)'], {... |
import numpy as np
def computeCostMulti(X, y, theta):
"""
computes the cost of using theta as the parameter for linear
regression to fit the data points in X and y
"""
m = y.size
J = 0.
# ====================== YOUR CODE HERE ======================
# Instructions: Compute the co... | [
"numpy.dot"
] | [((396, 418), 'numpy.dot', 'np.dot', (['X[i, :]', 'theta'], {}), '(X[i, :], theta)\n', (402, 418), True, 'import numpy as np\n')] |
from edi_835_parser.elements.identifier import Identifier
from edi_835_parser.elements.dollars import Dollars
from edi_835_parser.elements.adjustment_group_code import AdjustmentGroupCode
from edi_835_parser.elements.adjustment_reason_code import AdjustmentReasonCode
from edi_835_parser.segments.utilities import split_... | [
"edi_835_parser.elements.dollars.Dollars",
"edi_835_parser.elements.adjustment_group_code.AdjustmentGroupCode",
"edi_835_parser.elements.adjustment_reason_code.AdjustmentReasonCode",
"edi_835_parser.segments.utilities.split_segment",
"edi_835_parser.elements.identifier.Identifier"
] | [((394, 406), 'edi_835_parser.elements.identifier.Identifier', 'Identifier', ([], {}), '()\n', (404, 406), False, 'from edi_835_parser.elements.identifier import Identifier\n'), ((421, 442), 'edi_835_parser.elements.adjustment_group_code.AdjustmentGroupCode', 'AdjustmentGroupCode', ([], {}), '()\n', (440, 442), False, ... |
import unittest
from scheduler.show import Show
class TestShow(unittest.TestCase):
def testInitialization(self):
show = Show('1,show 1,00:03:00,20:00:00')
self.assertEqual(show.seq, '1')
self.assertEqual(show.name,'show 1')
self.assertEqual(show.duration.get_time_string(),'00:03:00... | [
"scheduler.show.Show"
] | [((134, 168), 'scheduler.show.Show', 'Show', (['"""1,show 1,00:03:00,20:00:00"""'], {}), "('1,show 1,00:03:00,20:00:00')\n", (138, 168), False, 'from scheduler.show import Show\n')] |
#!/usr/bin/python
import socket
import bluetooth, subprocess
nearby_devices = bluetooth.discover_devices(duration=4,lookup_names=True,
flush_cache=True, lookup_class=False)
TCP_IP = '44:44:1B:04:13:7D'
TCP_PORT = 13854
BUFFER_SIZE = 2048
name = 'Sichiray' #... | [
"bluetooth.discover_devices",
"subprocess.call",
"bluetooth.BluetoothSocket"
] | [((79, 178), 'bluetooth.discover_devices', 'bluetooth.discover_devices', ([], {'duration': '(4)', 'lookup_names': '(True)', 'flush_cache': '(True)', 'lookup_class': '(False)'}), '(duration=4, lookup_names=True, flush_cache=True,\n lookup_class=False)\n', (105, 178), False, 'import bluetooth, subprocess\n'), ((540, 6... |
import logging
TABLE_DOES_NOT_EXIST = 1
TABLE_ALREADY_EXISTS = 2
INPUT_DATA_IS_CORRUPTED = 3
KEY_ALREADY_EXISTS = 4
KEY_DOES_NOT_EXIST = 5
THIS_WILL_TRUNCATE_TABLE = 6
def throw_table_does_not_exist(table):
logging.error(f"{table} does not exist.")
exit(TABLE_DOES_NOT_EXIST)
def throw_table_already_exists(ta... | [
"logging.error"
] | [((213, 254), 'logging.error', 'logging.error', (['f"""{table} does not exist."""'], {}), "(f'{table} does not exist.')\n", (226, 254), False, 'import logging\n'), ((330, 371), 'logging.error', 'logging.error', (['f"""{table} already exists."""'], {}), "(f'{table} already exists.')\n", (343, 371), False, 'import loggin... |
# -*- coding: utf-8 -*-
"""
/***************************************************************************
OpenEODialog
This class is the main dialog of the plugin giving the possibility to explore the backend,
handle jobs and handle services.
-------------------
begin ... | [
"PyQt5.QtGui.QColor",
"webbrowser.open",
"copy.deepcopy",
"PyQt5.QtWidgets.QApplication.setStyle",
"PyQt5.QtWidgets.QTextEdit",
"PyQt5.QtWidgets.QListWidgetItem",
"qgis.utils.iface.actionZoomIn",
"qgis.core.QgsProject.instance",
"PyQt5.QtWidgets.QPushButton",
"qgis.utils.iface.activeLayer",
"PyQ... | [((2536, 2612), 'PyQt5.QtWidgets.QApplication.setAttribute', 'QtWidgets.QApplication.setAttribute', (['QtCore.Qt.AA_EnableHighDpiScaling', '(True)'], {}), '(QtCore.Qt.AA_EnableHighDpiScaling, True)\n', (2571, 2612), False, 'from PyQt5 import QtCore, QtGui, QtWidgets\n'), ((2639, 2712), 'PyQt5.QtWidgets.QApplication.set... |
import py42.sdk
import py42.settings
import py42.settings.debug as debug
import requests
from click import secho
from py42.exceptions import Py42UnauthorizedError
from requests.exceptions import ConnectionError
from code42cli.errors import Code42CLIError
from code42cli.errors import LoggedCLIError
from code42cli.logge... | [
"code42cli.logger.get_main_cli_logger",
"code42cli.errors.LoggedCLIError",
"requests.packages.urllib3.disable_warnings"
] | [((395, 416), 'code42cli.logger.get_main_cli_logger', 'get_main_cli_logger', ([], {}), '()\n', (414, 416), False, 'from code42cli.logger import get_main_cli_logger\n'), ((807, 915), 'requests.packages.urllib3.disable_warnings', 'requests.packages.urllib3.disable_warnings', (['requests.packages.urllib3.exceptions.Insecu... |
import torch
import numpy as np
from hparams import create_hparams as hps
def mode(obj, model = False):
if model and hps.is_cuda:
obj = obj.cuda()
elif hps.is_cuda:
obj = obj.cuda(non_blocking = hps.pin_mem)
return obj
def to_arr(var):
return var.cpu().detach().numpy().astype(np.float32)
def get_mask_from_le... | [
"librosa.istft",
"numpy.clip",
"numpy.abs",
"pydub.AudioSegment.empty",
"numpy.linalg.pinv",
"numpy.random.rand",
"numpy.power",
"torch.LongTensor",
"torch.max",
"numpy.max",
"numpy.dot",
"scipy.signal.lfilter",
"scipy.io.wavfile.read",
"librosa.filters.mel",
"librosa.stft",
"numpy.max... | [((849, 867), 'scipy.io.wavfile.read', 'wavfile.read', (['path'], {}), '(path)\n', (861, 867), False, 'from scipy.io import wavfile\n'), ((1239, 1290), 'scipy.signal.lfilter', 'scipy.signal.lfilter', (['[1, -hps.preemphasis]', '[1]', 'x'], {}), '([1, -hps.preemphasis], [1], x)\n', (1259, 1290), False, 'import scipy\n')... |
import os
os.environ["CUDA_VISIBLE_DEVICES"]="-1"
import tensorflow as tf
from tensorflow.python.client import timeline
from tensorflow.examples.tutorials.mnist import input_data
mnist = input_data.read_data_sets("MNIST_data",one_hot=True)
x = tf.placeholder(tf.float32, [None, 784])
w = tf.Variable(tf.zeros([784, 1... | [
"tensorflow.cast",
"tensorflow.placeholder",
"tensorflow.RunOptions",
"tensorflow.Session",
"tensorflow.global_variables_initializer",
"tensorflow.examples.tutorials.mnist.input_data.read_data_sets",
"tensorflow.argmax",
"tensorflow.train.GradientDescentOptimizer",
"tensorflow.matmul",
"tensorflow... | [((190, 243), 'tensorflow.examples.tutorials.mnist.input_data.read_data_sets', 'input_data.read_data_sets', (['"""MNIST_data"""'], {'one_hot': '(True)'}), "('MNIST_data', one_hot=True)\n", (215, 243), False, 'from tensorflow.examples.tutorials.mnist import input_data\n'), ((248, 287), 'tensorflow.placeholder', 'tf.plac... |
import unittest
import envi
import vivisect
import vivisect.codegraph as codegraph
import vivisect.tests.samplecode as samplecode
from vivisect.const import *
import vivisect.tests.vivbins as vivbins
# fsize, fva, cconvname, argdefs, comparisons
bins_w32 = [
# kernel32.dll 32bit version 5.1.2600.5781
... | [
"vivisect.tests.vivbins.getTestWorkspace"
] | [((2178, 2263), 'vivisect.tests.vivbins.getTestWorkspace', 'vivbins.getTestWorkspace', (['"""test_kernel32_32bit-5.1.2600.5781.dll"""'], {'analyze': '(False)'}), "('test_kernel32_32bit-5.1.2600.5781.dll', analyze=False\n )\n", (2202, 2263), True, 'import vivisect.tests.vivbins as vivbins\n'), ((2365, 2425), 'vivisec... |
#coding=utf-8
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: agent.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf.internal import enum_type_wrapper
from google.protobuf import descriptor as _descriptor
from google.protobuf import m... | [
"google.protobuf.descriptor.EnumValueDescriptor",
"google.protobuf.symbol_database.Default",
"google.protobuf.descriptor.FieldDescriptor",
"google.protobuf.internal.enum_type_wrapper.EnumTypeWrapper"
] | [((547, 573), 'google.protobuf.symbol_database.Default', '_symbol_database.Default', ([], {}), '()\n', (571, 573), True, 'from google.protobuf import symbol_database as _symbol_database\n'), ((1596, 1642), 'google.protobuf.internal.enum_type_wrapper.EnumTypeWrapper', 'enum_type_wrapper.EnumTypeWrapper', (['_TASKRESULT'... |
from django.utils.functional import cached_property
from django.utils.cache import set_response_etag
from django.utils import translation
from django.http import Http404
from django.conf import settings
from directory_components.helpers import get_user_country
from directory_components.mixins import CountryDisplayMixi... | [
"core.helpers.CompanyParser",
"directory_components.helpers.get_user_country",
"django.conf.settings.FEATURE_FLAGS.get",
"directory_cms_client.helpers.handle_cms_response",
"django.utils.translation.get_language",
"core.constants.FEATURE_FLAGGED_URLS_MAPPING.get",
"core.helpers.get_company_profile",
"... | [((788, 855), 'core.constants.FEATURE_FLAGGED_URLS_MAPPING.get', 'constants.FEATURE_FLAGGED_URLS_MAPPING.get', (['self.request.path', 'None'], {}), '(self.request.path, None)\n', (830, 855), False, 'from core import constants, helpers\n'), ((874, 913), 'django.conf.settings.FEATURE_FLAGS.get', 'settings.FEATURE_FLAGS.g... |
import os
import sys
import shutil
import constants
from os import path
from helpers import read_config
app_name = sys.argv[1]
#Copying the template
try:
src = 'templates/'+ sys.argv[2]
except:
src = 'templates/' + read_config(constants.default_template)
dir_dest = read_config("DESTINATION_OUTPUT") + "\\... | [
"os.listdir",
"os.rename",
"os.path.splitext",
"shutil.copytree",
"os.chdir",
"os.path.isfile",
"helpers.read_config"
] | [((353, 379), 'shutil.copytree', 'shutil.copytree', (['src', 'dest'], {}), '(src, dest)\n', (368, 379), False, 'import shutil\n'), ((441, 462), 'os.chdir', 'os.chdir', (['project_dir'], {}), '(project_dir)\n', (449, 462), False, 'import os\n'), ((281, 314), 'helpers.read_config', 'read_config', (['"""DESTINATION_OUTPUT... |
# crawler_her_sel.py
# -*- coding: utf-8 -*-
import time
from selenium.webdriver import Firefox
from selenium.webdriver.firefox.options import Options
from bs4 import BeautifulSoup
options = Options()
options.add_argument("--headless")
driver = Firefox(options=options)
driver.get("https://www.flashscore.... | [
"bs4.BeautifulSoup",
"selenium.webdriver.firefox.options.Options",
"selenium.webdriver.Firefox",
"time.sleep"
] | [((203, 212), 'selenium.webdriver.firefox.options.Options', 'Options', ([], {}), '()\n', (210, 212), False, 'from selenium.webdriver.firefox.options import Options\n'), ((259, 283), 'selenium.webdriver.Firefox', 'Firefox', ([], {'options': 'options'}), '(options=options)\n', (266, 283), False, 'from selenium.webdriver ... |
# -*- coding: UTF-8 -*-
import requests
session = "2B2DD9E68BD4007DC3E3FC2A055FB55C"
headers = {
"Host": "zbjkttb.nuc.edu.cn",
"Proxy-Connection": "keep-alive",
"Content-Length": "0",
"Accept": "application/json, text/plain, */*",
"Origin": "http://zbjkttb.nuc.edu.cn",
"User-Agent": "Mozilla/... | [
"requests.post"
] | [((947, 987), 'requests.post', 'requests.post', (['info_url'], {'headers': 'headers'}), '(info_url, headers=headers)\n', (960, 987), False, 'import requests\n')] |
from datetime import datetime
import os
from sqlalchemy import create_engine
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import Column, Integer, String, DateTime
from sqlalchemy.orm import sessionmaker
from srs_sqlite import db
from srs_sqlite.databases import SrsRecord
from srs_sqlite.uti... | [
"sqlalchemy.orm.sessionmaker",
"srs_sqlite.db.session.commit",
"srs_sqlite.db.session.add",
"srs_sqlite.util.get_url_images_in_text",
"srs_sqlite.db.create_all",
"sqlalchemy.ext.declarative.declarative_base",
"os.path.abspath",
"sqlalchemy.Column",
"srs_sqlite.databases.SrsRecord"
] | [((444, 462), 'sqlalchemy.ext.declarative.declarative_base', 'declarative_base', ([], {}), '()\n', (460, 462), False, 'from sqlalchemy.ext.declarative import declarative_base\n'), ((473, 498), 'sqlalchemy.orm.sessionmaker', 'sessionmaker', ([], {'bind': 'engine'}), '(bind=engine)\n', (485, 498), False, 'from sqlalchemy... |
"""Definition and setup of the TastyIgniter Binary Sensors for Home Assistant."""
import logging
import time
from homeassistant.helpers.update_coordinator import (
CoordinatorEntity,
DataUpdateCoordinator,
UpdateFailed,
)
from homeassistant.components.binary_sensor import BinarySensorEntity
from homeassis... | [
"logging.getLogger"
] | [((546, 573), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (563, 573), False, 'import logging\n')] |
import numpy as np
import torch as torch
import numpy as np
import torch as torch
from scipy.interpolate import griddata
import torch.nn.functional as F
import torch.nn as nn
# import audtorch
import piq
def calculate_CC_metrics(pred, gt):
"""
Calculate CC Metrics
:param pred:
:param gt:
:return:
... | [
"torch.nn.functional.grid_sample",
"torch.nn.functional.l1_loss",
"torch.nn.functional.mse_loss",
"numpy.corrcoef",
"torch.unsqueeze",
"scipy.interpolate.griddata",
"piq.multi_scale_ssim",
"torch.from_numpy",
"numpy.stack",
"numpy.zeros",
"numpy.argwhere",
"numpy.isnan",
"numpy.expand_dims",... | [((1740, 1757), 'numpy.argwhere', 'np.argwhere', (['mask'], {}), '(mask)\n', (1751, 1757), True, 'import numpy as np\n'), ((1810, 1824), 'numpy.arange', 'np.arange', (['(256)'], {}), '(256)\n', (1819, 1824), True, 'import numpy as np\n'), ((1833, 1847), 'numpy.arange', 'np.arange', (['(256)'], {}), '(256)\n', (1842, 18... |
from flask import Flask, render_template, request, jsonify, abort
from firebase import Firebase
from random import randint
from datetime import datetime
#added some more libs
# import base64
# import numpy as np
# import io
# # from PIL import Image
# import tensorflow as tf
# from tensorflow import keras
# from tkint... | [
"flask.render_template",
"flask.Flask",
"datetime.datetime.strptime",
"firebase.Firebase",
"flask.request.get_json",
"datetime.datetime.today",
"random.randint",
"flask.jsonify"
] | [((3582, 3598), 'firebase.Firebase', 'Firebase', (['config'], {}), '(config)\n', (3590, 3598), False, 'from firebase import Firebase\n'), ((3660, 3675), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (3665, 3675), False, 'from flask import Flask, render_template, request, jsonify, abort\n'), ((3845, 3884),... |
# TODO:m3u8文件名格式、歌曲名格式
# ui(pyqt)相关
from PyQt5.QtWidgets import QApplication, QMainWindow, QDialog, QMessageBox, QAbstractItemView, QTableWidgetItem, QWidget, QHBoxLayout, QLabel, QListWidgetItem, QProgressBar, QPushButton, QFileDialog
from PyQt5.Qt import QThread, pyqtSignal
from PyQt5.QtGui import QPixmap, QPainter... | [
"re.compile",
"time.sleep",
"xmlrpc.client.ServerProxy",
"PyQt5.QtWidgets.QApplication",
"PyQt5.QtGui.QPainterPath",
"datetime.timedelta",
"re.search",
"datetime.datetime",
"os.path.exists",
"os.listdir",
"platform.platform",
"PyQt5.QtWidgets.QListWidgetItem",
"json.dumps",
"ui.login.exec_... | [((958, 977), 'platform.platform', 'platform.platform', ([], {}), '()\n', (975, 977), False, 'import platform\n'), ((1879, 1923), 'xmlrpc.client.ServerProxy', 'rpc.ServerProxy', (['"""http://localhost:6888/rpc"""'], {}), "('http://localhost:6888/rpc')\n", (1894, 1923), True, 'import xmlrpc.client as rpc\n'), ((2151, 21... |
from pyupdater.core.uploader import BaseUploader
from pyupdater.utils.exceptions import UploaderError
import os, uuid
from azure.storage.blob import BlobServiceClient, BlobClient, ContainerClient
class AzureBlobStorageUploader(BaseUploader):
name = "azure-blob"
author = "<NAME>"
def init_config(self, c... | [
"azure.storage.blob.BlobServiceClient.from_connection_string",
"pyupdater.utils.exceptions.UploaderError",
"os.path.basename"
] | [((1196, 1260), 'azure.storage.blob.BlobServiceClient.from_connection_string', 'BlobServiceClient.from_connection_string', (['self.connection_string'], {}), '(self.connection_string)\n', (1236, 1260), False, 'from azure.storage.blob import BlobServiceClient, BlobClient, ContainerClient\n'), ((1523, 1549), 'os.path.base... |
import codecs
import os
import struct
from enum import Enum
from cryptography.hazmat.primitives import padding, hashes
from cryptography.hazmat.primitives.ciphers import algorithms, modes, Cipher
import attr
import six
from aliyun_encryption_sdk import to_bytes
from aliyun_encryption_sdk.constants import SDK_VERSION,... | [
"attr.s",
"cryptography.hazmat.primitives.ciphers.modes.GCM",
"aliyun_encryption_sdk.to_bytes",
"os.urandom",
"cryptography.hazmat.primitives.padding.PKCS7",
"struct.pack",
"attr.validators.instance_of",
"cryptography.hazmat.primitives.ciphers.algorithms.AES",
"codecs.decode"
] | [((3615, 3633), 'attr.s', 'attr.s', ([], {'hash': '(False)'}), '(hash=False)\n', (3621, 3633), False, 'import attr\n'), ((6354, 6372), 'attr.s', 'attr.s', ([], {'hash': '(False)'}), '(hash=False)\n', (6360, 6372), False, 'import attr\n'), ((6649, 6667), 'attr.s', 'attr.s', ([], {'hash': '(False)'}), '(hash=False)\n', (... |
'''
Excited States software: qFit 3.0
Contributors: <NAME>, <NAME>, and <NAME>.
Contact: <EMAIL>
Copyright (C) 2009-2019 Stanford University
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software withou... | [
"os.path.exists",
"argparse.ArgumentParser",
"subprocess.Popen",
"os.path.join",
"time.sleep",
"qfit.Structure.fromfile"
] | [((1313, 1390), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Run qfit_residue on a whole structure."""'}), "(description='Run qfit_residue on a whole structure.')\n", (1336, 1390), False, 'import argparse\n'), ((2022, 2056), 'qfit.Structure.fromfile', 'Structure.fromfile', (['args.stru... |
import os
import random
HELP_DESC = ("!imagetest\t\t-\tSend back test image\n")
async def register_to(plugin):
# Echo back the given command
async def imagetest_callback(room, event):
exts = ["gif", "jpg", "png", "jpeg"]
images = filter(lambda x:any(x.lower().endswith(ext) for ext in exts), o... | [
"os.listdir"
] | [((319, 331), 'os.listdir', 'os.listdir', ([], {}), '()\n', (329, 331), False, 'import os\n')] |
# Assignment 1
# CSC 486 - Spring 2022
# Author: Dr. <NAME>
# Purpose: to test your installation of PyCharm and make sure some of our common
# libraries are installed and working correctly.
import networkx
import matplotlib.pyplot as plt
def main():
# Draws a complete graph of 10 nodes, then presents it on the ... | [
"networkx.complete_graph",
"networkx.draw",
"matplotlib.pyplot.show"
] | [((499, 526), 'networkx.complete_graph', 'networkx.complete_graph', (['(10)'], {}), '(10)\n', (522, 526), False, 'import networkx\n'), ((531, 547), 'networkx.draw', 'networkx.draw', (['G'], {}), '(G)\n', (544, 547), False, 'import networkx\n'), ((552, 562), 'matplotlib.pyplot.show', 'plt.show', ([], {}), '()\n', (560, ... |
# -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2017-10-09 14:08
from __future__ import unicode_literals
from django.db import migrations, models
import re
import django.db.models.deletion
def calculate_num_questions(resource, ScormElement):
re_objective_id_key = r'^cmi.objectives.([0-9]+).id$'
top_key =... | [
"django.db.models.ForeignKey",
"re.match",
"django.db.migrations.RunPython",
"django.db.models.PositiveIntegerField",
"django.db.models.Max"
] | [((1447, 1513), 'django.db.migrations.RunPython', 'migrations.RunPython', (['set_num_questions', 'migrations.RunPython.noop'], {}), '(set_num_questions, migrations.RunPython.noop)\n', (1467, 1513), False, 'from django.db import migrations, models\n'), ((418, 435), 'django.db.models.Max', 'models.Max', (['"""key"""'], {... |
import json
import pulumi
import pulumi_aws as aws
from infrastructure.dynamodb.table import books_dynamodb_table
config = pulumi.Config()
lambda_name = config.get('lambda_name')
role = aws.iam.Role(
lambda_name,
name=lambda_name,
assume_role_policy=json.dumps({
"Version": "2012-10-17",
"... | [
"pulumi_aws.iam.RolePolicyAttachment",
"json.dumps",
"pulumi.Config"
] | [((125, 140), 'pulumi.Config', 'pulumi.Config', ([], {}), '()\n', (138, 140), False, 'import pulumi\n'), ((1696, 1781), 'pulumi_aws.iam.RolePolicyAttachment', 'aws.iam.RolePolicyAttachment', (['lambda_name'], {'role': 'role.name', 'policy_arn': 'policy.arn'}), '(lambda_name, role=role.name, policy_arn=policy.arn\n )... |
# Generated by Django 3.1.2 on 2020-11-28 12:13
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
ope... | [
"django.db.models.OneToOneField",
"django.db.models.IntegerField",
"django.db.models.AutoField",
"django.db.migrations.swappable_dependency",
"django.db.models.CharField"
] | [((247, 304), 'django.db.migrations.swappable_dependency', 'migrations.swappable_dependency', (['settings.AUTH_USER_MODEL'], {}), '(settings.AUTH_USER_MODEL)\n', (278, 304), False, 'from django.db import migrations, models\n'), ((440, 533), 'django.db.models.AutoField', 'models.AutoField', ([], {'auto_created': '(True)... |
from bocadillo import App
app = App(
enable_cors=True,
cors_config={"allow_origins": ["*"], "allow_methods": ["*"]},
)
_COURSES = [
{
"id": 1,
"code": "adv-maths",
"name": "Advanced Mathematics",
"created": "2018-08-14T12:09:45",
},
{
"id": 2,
"code"... | [
"bocadillo.App"
] | [((33, 120), 'bocadillo.App', 'App', ([], {'enable_cors': '(True)', 'cors_config': "{'allow_origins': ['*'], 'allow_methods': ['*']}"}), "(enable_cors=True, cors_config={'allow_origins': ['*'], 'allow_methods':\n ['*']})\n", (36, 120), False, 'from bocadillo import App\n')] |
##
# @package Blender2GltfBatch
# @ section description Description
# A script to export animated models created in Blender into a folder to be used in threeP.games.\n Running this script will loop through each of the actions associated with a model and create a GLtf (.glb) export named {blender_filename}_{action}.g... | [
"bpy.path.clean_name",
"bpy.ops.export_scene.obj",
"os.makedirs",
"bpy.ops.object.select_all",
"os.path.join",
"os.path.dirname",
"os.path.isdir",
"bpy.ops.export_scene.gltf"
] | [((580, 606), 'os.path.dirname', 'dirname', (['bpy.data.filepath'], {}), '(bpy.data.filepath)\n', (587, 606), False, 'from os.path import join, isdir, dirname\n'), ((937, 979), 'bpy.ops.object.select_all', 'bpy.ops.object.select_all', ([], {'action': '"""SELECT"""'}), "(action='SELECT')\n", (962, 979), False, 'import b... |
from catcher.steps.external_step import ExternalStep
from catcher_modules.utils import module_utils
import catcher_modules.database
class Expect(ExternalStep):
"""
This is the opposite for prepare. It compares expected data from csv to what you have in the database.
csv file supports templates.
**Imp... | [
"catcher_modules.utils.module_utils.list_modules_in_package",
"catcher_modules.utils.module_utils.find_class_in_module"
] | [((1947, 2009), 'catcher_modules.utils.module_utils.list_modules_in_package', 'module_utils.list_modules_in_package', (['catcher_modules.database'], {}), '(catcher_modules.database)\n', (1983, 2009), False, 'from catcher_modules.utils import module_utils\n'), ((2144, 2229), 'catcher_modules.utils.module_utils.find_clas... |
import argparse
import os
import numpy as np
import sys
import json
from os import listdir
import csv
from os.path import isfile, join
from face_network import create_face_network
import cv2
import argparse
from keras.optimizers import Adam, SGD
from keras.models import load_model
from emotion_model import *
from u... | [
"cv2.rectangle",
"tensorflow.local_variables_initializer",
"numpy.array",
"tensorflow.reverse_v2",
"tensorflow.nn.softmax",
"utils.preprocessor.preprocess_input",
"imutils.face_utils.FaceAligner",
"tensorflow.Graph",
"os.listdir",
"numpy.float64",
"utils.inference.detect_faces",
"tensorflow.Se... | [((12651, 12693), 'utils.inference.load_detection_model', 'load_detection_model', (['detection_model_path'], {}), '(detection_model_path)\n', (12671, 12693), False, 'from utils.inference import load_detection_model\n'), ((12719, 12764), 'keras.models.load_model', 'load_model', (['emotion_model_path'], {'compile': '(Fal... |
# Copyright (c) 2019 Alibaba 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... | [
"numpy.ones",
"gym.spaces.Discrete",
"easy_rl.utils.window_stat.WindowStat",
"numpy.zeros",
"numpy.random.seed",
"numpy.random.uniform"
] | [((1330, 1347), 'numpy.random.seed', 'np.random.seed', (['(0)'], {}), '(0)\n', (1344, 1347), True, 'import numpy as np\n'), ((2301, 2325), 'easy_rl.utils.window_stat.WindowStat', 'WindowStat', (['"""reward"""', '(50)'], {}), "('reward', 50)\n", (2311, 2325), False, 'from easy_rl.utils.window_stat import WindowStat\n'),... |
# coding: utf-8
# In[164]:
import pandas as pd
import os
from dateutil import parser
from xgboost import XGBRegressor
import numpy as np
# In[165]:
#set train and test file locations
df_train = pd.read_csv('Train.csv')
df_test = pd.read_csv('Test.csv')
# In[167]:
def rolling_diff(series):
return series[1]-... | [
"xgboost.XGBRegressor",
"pandas.to_datetime",
"pandas.read_csv"
] | [((200, 224), 'pandas.read_csv', 'pd.read_csv', (['"""Train.csv"""'], {}), "('Train.csv')\n", (211, 224), True, 'import pandas as pd\n'), ((235, 258), 'pandas.read_csv', 'pd.read_csv', (['"""Test.csv"""'], {}), "('Test.csv')\n", (246, 258), True, 'import pandas as pd\n'), ((4728, 4926), 'xgboost.XGBRegressor', 'XGBRegr... |
from datetime import datetime, timedelta
import subprocess
from yapsy.IPlugin import IPlugin
from api.sensor import Sensor
SENSOR = 11 # Acceptable values: [11, 22, 2302]
PIN = 24
HUMIDITY_READ_CMD_FORMAT = 'python /usr/src/Adafruit_Python_DHT/examples/dht_reader.py {sensor} {pin}'
HUMIDITY_READ_CMD = HUMIDITY_READ... | [
"subprocess.check_output",
"datetime.datetime.now",
"datetime.timedelta"
] | [((382, 402), 'datetime.timedelta', 'timedelta', ([], {'seconds': '(5)'}), '(seconds=5)\n', (391, 402), False, 'from datetime import datetime, timedelta\n'), ((1131, 1145), 'datetime.datetime.now', 'datetime.now', ([], {}), '()\n', (1143, 1145), False, 'from datetime import datetime, timedelta\n'), ((604, 618), 'dateti... |
from django.db import models
from django.contrib.auth.models import User
class TerminationRequest(models.Model):
"""
When an employee leaves the organization
remove access to the different services that were previously requested
"""
requester = models.ForeignKey(
User, related_name='reques... | [
"django.db.models.DateField",
"django.db.models.ForeignKey",
"django.db.models.BooleanField",
"django.db.models.DateTimeField",
"django.db.models.CharField"
] | [((267, 384), 'django.db.models.ForeignKey', 'models.ForeignKey', (['User'], {'related_name': '"""requested_terminations"""', 'on_delete': 'models.SET_NULL', 'blank': '(True)', 'null': '(True)'}), "(User, related_name='requested_terminations', on_delete=\n models.SET_NULL, blank=True, null=True)\n", (284, 384), Fals... |
#!/usr/bin/python
# Classification (U)
"""Program: run_program.py
Description: Integration testing of run_program in mongo_perf.py.
Usage:
test/integration/mongo_perf/run_program.py
Arguments:
"""
# Libraries and Global Variables
# Standard
import sys
import os
import filecmp
if sys.versio... | [
"mongo_perf.run_program",
"mock.patch",
"os.path.join",
"os.getcwd",
"os.path.isfile",
"lib.gen_libs.no_std_out",
"unittest.main",
"filecmp.cmp",
"os.remove"
] | [((448, 459), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (457, 459), False, 'import os\n'), ((4905, 4948), 'mock.patch', 'mock.patch', (['"""mongo_perf.mongo_libs.ins_doc"""'], {}), "('mongo_perf.mongo_libs.ins_doc')\n", (4915, 4948), False, 'import mock\n'), ((4954, 4987), 'mock.patch', 'mock.patch', (['"""mongo_perf... |
'''
align_all_vs_all.py - all-vs-all pairwise alignment
===================================================
:Author: <NAME>
:Release: $Id$
:Date: |today|
:Tags: Python
Purpose
-------
This script computes all-vs-all alignments between
sequences in a :term:`fasta` formatted file.
Currently only Smith-Waterman protei... | [
"alignlib_lite.py_calculatePercentIdentity",
"alignlib_lite.py_makeAlignatorFullDP",
"alignlib_lite.py_makeAlignataVector",
"CGAT.Experiment.Start",
"CGAT.FastaIterator.FastaIterator",
"alignlib_lite.py_writeAlignataCompressed",
"re.sub",
"CGAT.Experiment.Stop"
] | [((1245, 1283), 'CGAT.Experiment.Start', 'E.Start', (['parser'], {'add_pipe_options': '(True)'}), '(parser, add_pipe_options=True)\n', (1252, 1283), True, 'import CGAT.Experiment as E\n'), ((1426, 1461), 'CGAT.FastaIterator.FastaIterator', 'FastaIterator.FastaIterator', (['infile'], {}), '(infile)\n', (1453, 1461), Tru... |
import discord
from discord.ext import commands
from yonosumi_utils import GetMessageLog as log, YonosumiMsg as msg, YonosumiStaff as staff
import yonosumi_utils
class GetMessageLog(commands.Cog):
def __init__(self, bot):
self.bot = bot
self.log = log()
self.msg = msg()
self.staff ... | [
"yonosumi_utils.GetMessageLog",
"yonosumi_utils.YonosumiMsg",
"yonosumi_utils.is_nedoko",
"yonosumi_utils.check_owner",
"yonosumi_utils.YonosumiStaff",
"discord.ext.commands.command",
"discord.File"
] | [((337, 355), 'discord.ext.commands.command', 'commands.command', ([], {}), '()\n', (353, 355), False, 'from discord.ext import commands\n'), ((270, 275), 'yonosumi_utils.GetMessageLog', 'log', ([], {}), '()\n', (273, 275), True, 'from yonosumi_utils import GetMessageLog as log, YonosumiMsg as msg, YonosumiStaff as sta... |
#
# Copyright (c) European Synchrotron Radiation Facility (ESRF)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Software"), to deal in
# the Software without restriction, including without limitation the rights to
# use, copy,... | [
"edna2.utils.UtilsTest.substitueTestData",
"os.path.exists",
"edna2.utils.UtilsTest.loadTestImage",
"edna2.utils.UtilsTest.getTestImageDirPath"
] | [((1526, 1564), 'edna2.utils.UtilsTest.loadTestImage', 'UtilsTest.loadTestImage', (['imageFileName'], {}), '(imageFileName)\n', (1549, 1564), False, 'from edna2.utils import UtilsTest\n'), ((1783, 1818), 'edna2.utils.UtilsTest.substitueTestData', 'UtilsTest.substitueTestData', (['inData'], {}), '(inData)\n', (1810, 181... |
"""Test Goal Zero integration."""
from datetime import timedelta
from unittest.mock import patch
from goalzero import exceptions
from homeassistant.components.goalzero.const import DEFAULT_NAME, DOMAIN, MANUFACTURER
from homeassistant.config_entries import ConfigEntryState
from homeassistant.const import STATE_ON, ST... | [
"homeassistant.util.dt.utcnow",
"tests.common.async_fire_time_changed",
"homeassistant.helpers.device_registry.async_get_registry",
"datetime.timedelta",
"unittest.mock.patch"
] | [((857, 930), 'unittest.mock.patch', 'patch', (['"""homeassistant.components.goalzero.Yeti"""'], {'return_value': 'mocked_yeti'}), "('homeassistant.components.goalzero.Yeti', return_value=mocked_yeti)\n", (862, 930), False, 'from unittest.mock import patch\n'), ((1572, 1674), 'unittest.mock.patch', 'patch', (['"""homea... |
'''
Uses Python + Flask to handle all HTTP request and application routes. The main
idea behind the implementation is to retrieve specifications from a formatted
HTML form and make queries to the NCLC archive of meteorological data and return
the output as json. The user can choose either a visualization of long term t... | [
"flask.render_template",
"flask.request.args.get",
"csv.DictReader",
"sqlite3.connect",
"flask.Flask",
"flask_session.Session",
"flask.jsonify"
] | [((622, 637), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (627, 637), False, 'from flask import Flask, render_template, request, session, jsonify\n'), ((720, 732), 'flask_session.Session', 'Session', (['app'], {}), '(app)\n', (727, 732), False, 'from flask_session import Session\n'), ((2882, 2995), 'fla... |
import cv2
import numpy as np
from PIL import ImageGrab
from mss import mss
import SendKeys
import time
from datetime import datetime
cod = []
accel = 170
counta = 0
def findDino():
time.sleep(3)
dinoimg = cv2.imread('dino.png', 0)
w, h = dinoimg.shape[::-1]
img = ImageGrab.grab()
imgcv = cv2.cvt... | [
"cv2.countNonZero",
"mss.mss",
"cv2.threshold",
"SendKeys.SendKeys",
"PIL.ImageGrab.grab",
"time.sleep",
"cv2.minMaxLoc",
"numpy.array",
"datetime.datetime.now",
"cv2.cvtColor",
"cv2.matchTemplate",
"cv2.imread"
] | [((188, 201), 'time.sleep', 'time.sleep', (['(3)'], {}), '(3)\n', (198, 201), False, 'import time\n'), ((216, 241), 'cv2.imread', 'cv2.imread', (['"""dino.png"""', '(0)'], {}), "('dino.png', 0)\n", (226, 241), False, 'import cv2\n'), ((284, 300), 'PIL.ImageGrab.grab', 'ImageGrab.grab', ([], {}), '()\n', (298, 300), Fal... |
# <NAME> CPSC 479 SEC 1
# This is the main python file containing the K-nearest neighbor classifier
# Import libraries
import numpy as np
import pandas as pd
from mpi4py import MPI # MPI_Init() automatically called when you import MPI from library
from math import sqrt, ceil
# Distance function returns Euclidea... | [
"numpy.sort",
"math.sqrt",
"pandas.read_csv"
] | [((508, 522), 'math.sqrt', 'sqrt', (['distance'], {}), '(distance)\n', (512, 522), False, 'from math import sqrt, ceil\n'), ((872, 903), 'pandas.read_csv', 'pd.read_csv', (['"""training_set.csv"""'], {}), "('training_set.csv')\n", (883, 903), True, 'import pandas as pd\n'), ((1012, 1042), 'pandas.read_csv', 'pd.read_cs... |
"""Simple example wrapper for basic usage of vis_cpu."""
import numpy as np
from pyuvdata.uvbeam import UVBeam
from . import conversions, vis_cpu
def simulate_vis(
ants,
fluxes,
ra,
dec,
freqs,
lsts,
beams,
pixel_beams=False,
beam_npix=63,
polarized=False,
precision=1,
... | [
"numpy.array",
"numpy.zeros"
] | [((3839, 3857), 'numpy.array', 'np.array', (['beam_pix'], {}), '(beam_pix)\n', (3847, 3857), True, 'import numpy as np\n'), ((4077, 4165), 'numpy.zeros', 'np.zeros', (['(naxes, nfeeds, freqs.size, lsts.size, nants, nants)'], {'dtype': 'complex_dtype'}), '((naxes, nfeeds, freqs.size, lsts.size, nants, nants), dtype=\n ... |
import Views
if __name__ == "__main__":
Views.MenuView.main_menu()
| [
"Views.MenuView.main_menu"
] | [((45, 71), 'Views.MenuView.main_menu', 'Views.MenuView.main_menu', ([], {}), '()\n', (69, 71), False, 'import Views\n')] |
# The MIT License (MIT)
#
# Copyright (c) 2020 <NAME>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, me... | [
"micropython.const"
] | [((1273, 1283), 'micropython.const', 'const', (['(127)'], {}), '(127)\n', (1278, 1283), False, 'from micropython import const\n'), ((1340, 1351), 'micropython.const', 'const', (['(2340)'], {}), '(2340)\n', (1345, 1351), False, 'from micropython import const\n'), ((1402, 1411), 'micropython.const', 'const', (['(24)'], {... |
# Generated by Django 2.1.8 on 2019-05-15 12:12
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("payment", "0026_auto_20190506_1719")]
operations = [
migrations.AddField(
model_name="paymentrelation",
name="payment_intent_secr... | [
"django.db.models.CharField"
] | [((343, 398), 'django.db.models.CharField', 'models.CharField', ([], {'blank': '(True)', 'max_length': '(200)', 'null': '(True)'}), '(blank=True, max_length=200, null=True)\n', (359, 398), False, 'from django.db import migrations, models\n'), ((527, 718), 'django.db.models.CharField', 'models.CharField', ([], {'choices... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
import os
import platform
import shutil
import sys
sys.path.append('bin')
from autojump_argparse import ArgumentParser # noqa
SUPPORTED_SHELLS = ('bash', 'zsh', 'fish', 'tcsh')
def cp(src, dest, dryrun=False):
print('copying f... | [
"os.path.exists",
"os.getenv",
"os.makedirs",
"os.path.join",
"os.geteuid",
"platform.system",
"autojump_argparse.ArgumentParser",
"shutil.copy",
"sys.exit",
"sys.path.append",
"os.path.expanduser"
] | [((137, 159), 'sys.path.append', 'sys.path.append', (['"""bin"""'], {}), "('bin')\n", (152, 159), False, 'import sys\n'), ((1282, 1321), 'os.path.join', 'os.path.join', (['clink_dir', '"""autojump.lua"""'], {}), "(clink_dir, 'autojump.lua')\n", (1294, 1321), False, 'import os\n'), ((2084, 2231), 'autojump_argparse.Argu... |
"""
Dare! Total Power Radiometer server
Instead of superceding the inherited loggers it may be possible simply to
rename them.
"""
import logging
import signal
import sys
import time
from os.path import dirname
from support import NamedClass, check_permission, sync_second
from support.logs import get_loglevel, initi... | [
"logging.getLogger",
"support.logs.get_loglevel",
"signal.setitimer",
"support.sync_second",
"support.check_permission",
"Electronics.Instruments.Radipower.find_radipowers",
"os.path.dirname",
"support.logs.initiate_option_parser",
"time.time",
"Electronics.Instruments.radiometer.Radiometer.__init... | [((589, 616), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (606, 616), False, 'import logging\n'), ((2289, 2348), 'logging.getLogger', 'logging.getLogger', (["(module_logger.name + '.RadiometerServer')"], {}), "(module_logger.name + '.RadiometerServer')\n", (2306, 2348), False, 'import ... |
#! BPY
#add-on information
bl_info = {
"name": "BOB Exporter (text)",
"description": "Export mesh data with UV's into Binary Object Format (Bob) text format",
"author": "<NAME>",
"version": (2018, 3, 11),
"blender": (2, 79, 0),
"location": "File > Import-Export",
"warning": "",
"wiki_ur... | [
"bpy.props.BoolProperty",
"bpy_extras.io_utils.orientation_helper_factory",
"bpy.props.StringProperty",
"bpy.utils.unregister_module",
"mathutils.Matrix.Identity",
"bpy.types.INFO_MT_file_export.remove",
"bpy.utils.register_module",
"bpy.path.ensure_ext",
"bpy.types.INFO_MT_file_export.append"
] | [((662, 748), 'bpy_extras.io_utils.orientation_helper_factory', 'orientation_helper_factory', (['"""BOBOrientationHelper"""'], {'axis_forward': '"""-Z"""', 'axis_up': '"""Y"""'}), "('BOBOrientationHelper', axis_forward='-Z',\n axis_up='Y')\n", (688, 748), False, 'from bpy_extras.io_utils import ExportHelper, orienta... |
from river import optim
from .log_reg import LogisticRegression
class Perceptron(LogisticRegression):
"""Perceptron classifier.
In this implementation, the Perceptron is viewed as a special case of the logistic regression.
The loss function that is used is the Hinge loss with a threshold set to 0, whils... | [
"river.optim.SGD",
"river.optim.losses.Hinge"
] | [((1393, 1405), 'river.optim.SGD', 'optim.SGD', (['(1)'], {}), '(1)\n', (1402, 1405), False, 'from river import optim\n'), ((1452, 1485), 'river.optim.losses.Hinge', 'optim.losses.Hinge', ([], {'threshold': '(0.0)'}), '(threshold=0.0)\n', (1470, 1485), False, 'from river import optim\n')] |
from django.conf.urls import patterns, url
from django.views.decorators.csrf import ensure_csrf_cookie
from django.views.generic import TemplateView
urlpatterns = patterns(
'proso_subscription.views',
url(r'^(|home)$', ensure_csrf_cookie(TemplateView.as_view(template_name="subscription_home.html")), name='sub... | [
"django.views.generic.TemplateView.as_view",
"django.conf.urls.url"
] | [((342, 430), 'django.conf.urls.url', 'url', (['"""^mysubscriptions/$"""', '"""my_subscriptions"""'], {'name': '"""subscription_my_subscriptions"""'}), "('^mysubscriptions/$', 'my_subscriptions', name=\n 'subscription_my_subscriptions')\n", (345, 430), False, 'from django.conf.urls import patterns, url\n'), ((432, 4... |
# Day 4 - Cleaning the code + sending message from client to server (Single Execute)
import socket
def ip_address():
global server_ip
serv_ip = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
serv_ip.connect(("8.8.8.8", 80))
server_ip = serv_ip.getsockname()[0]
serv_ip.close()
return server_i... | [
"socket.socket"
] | [((154, 202), 'socket.socket', 'socket.socket', (['socket.AF_INET', 'socket.SOCK_DGRAM'], {}), '(socket.AF_INET, socket.SOCK_DGRAM)\n', (167, 202), False, 'import socket\n'), ((472, 521), 'socket.socket', 'socket.socket', (['socket.AF_INET', 'socket.SOCK_STREAM'], {}), '(socket.AF_INET, socket.SOCK_STREAM)\n', (485, 52... |
from django.conf import settings
from django.conf.urls import include, url
from tastypie.api import NamespacedApi
from namespaced.api.resources import NamespacedNoteResource, NamespacedUserResource
api = NamespacedApi(api_name='v1', urlconf_namespace='special')
api.register(NamespacedNoteResource(), canonical=True)
a... | [
"django.conf.urls.url",
"namespaced.api.resources.NamespacedNoteResource",
"tastypie.api.NamespacedApi",
"django.conf.urls.include",
"namespaced.api.resources.NamespacedUserResource"
] | [((206, 263), 'tastypie.api.NamespacedApi', 'NamespacedApi', ([], {'api_name': '"""v1"""', 'urlconf_namespace': '"""special"""'}), "(api_name='v1', urlconf_namespace='special')\n", (219, 263), False, 'from tastypie.api import NamespacedApi\n'), ((277, 301), 'namespaced.api.resources.NamespacedNoteResource', 'Namespaced... |
from core.models import CourseStatus
def serialize_user_provider_profiles(user_provider_list):
"""
Serializes the courses of a provider profile
:param user_provider_list: provider profile object
:return: dictionary that contains the finished and in
progress courses.
"""
course_list = {}
... | [
"core.models.CourseStatus.objects.filter"
] | [((821, 882), 'core.models.CourseStatus.objects.filter', 'CourseStatus.objects.filter', ([], {'profile__user__username': 'username'}), '(profile__user__username=username)\n', (848, 882), False, 'from core.models import CourseStatus\n'), ((388, 446), 'core.models.CourseStatus.objects.filter', 'CourseStatus.objects.filte... |
#!/usr/bin/env python -O
# -*- coding: utf-8 -*-
#
# rtk.tests.unit.TestConfiguration.py is part of The RTK Project
#
# All rights reserved.
# Copyright 2007 - 2017 <NAME> andrew.rowland <AT> reliaqual <DOT> com
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted p... | [
"os.makedirs",
"nose.plugins.attrib.attr",
"os.path.isfile",
"os.path.dirname",
"Configuration.Configuration"
] | [((2955, 2980), 'nose.plugins.attrib.attr', 'attr', ([], {'all': '(True)', 'unit': '(True)'}), '(all=True, unit=True)\n', (2959, 2980), False, 'from nose.plugins.attrib import attr\n'), ((7695, 7720), 'nose.plugins.attrib.attr', 'attr', ([], {'all': '(True)', 'unit': '(True)'}), '(all=True, unit=True)\n', (7699, 7720),... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# (c) 2014, Herry <<EMAIL>>
#
# This file is part of Nuri
#
# Nuri is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as
# published by the Free Software Foundation, either version 3 of
# the License, or (a... | [
"sqlite3.connect"
] | [((993, 1026), 'sqlite3.connect', 'sqlite.connect', (["config['db_file']"], {}), "(config['db_file'])\n", (1007, 1026), True, 'import sqlite3 as sqlite\n')] |
#! /usr/bin/env python3
import requests
from settings import WEATHER_API_HOST, WEATHER_API_KEY
def get_weather_forecast(city: str) -> str:
api_path = '{api_host}/data/2.5/forecast?q={city},{country}&units={units}&appid={api_key}'
country = 'usa'
unit = 'imperial'
temp_unit = 'fahrenheit'
url = ap... | [
"requests.get"
] | [((437, 454), 'requests.get', 'requests.get', (['url'], {}), '(url)\n', (449, 454), False, 'import requests\n')] |
import random
import time
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
# Create a Dataframe
df = pd.DataFrame({'Algoritms':["Bubble Sort","Selection Sort","Insertion Sort","Quick Sort","Merge Sort"]},index:=None)
samples = [100,200,500,1000,5000] #create an array with different sample s... | [
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"pandas.DataFrame",
"time.time",
"random.randint",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.show"
] | [((129, 258), 'pandas.DataFrame', 'pd.DataFrame', (["{'Algoritms': ['Bubble Sort', 'Selection Sort', 'Insertion Sort',\n 'Quick Sort', 'Merge Sort']}", '(index := None)'], {}), "({'Algoritms': ['Bubble Sort', 'Selection Sort',\n 'Insertion Sort', 'Quick Sort', 'Merge Sort']}, (index := None))\n", (141, 258), True... |
import logging
import pytest
import requests_mock
import transaction
from onegov.pay.models.payment_providers.stripe import (
StripeConnect,
StripeFeePolicy,
StripeCaptureManager
)
from purl import URL
from unittest import mock
from urllib.parse import quote
def test_oauth_url():
provider = StripeCon... | [
"onegov.pay.models.payment_providers.stripe.StripeFeePolicy.from_amount",
"purl.URL",
"onegov.pay.models.payment_providers.stripe.StripeConnect",
"onegov.pay.models.payment_providers.stripe.StripeFeePolicy.compensate",
"requests_mock.Mocker",
"urllib.parse.quote",
"pytest.raises",
"transaction.commit"... | [((311, 362), 'onegov.pay.models.payment_providers.stripe.StripeConnect', 'StripeConnect', ([], {'client_id': '"""foo"""', 'client_secret': '"""bar"""'}), "(client_id='foo', client_secret='bar')\n", (324, 362), False, 'from onegov.pay.models.payment_providers.stripe import StripeConnect, StripeFeePolicy, StripeCaptureM... |
import math
import mock
import pytest
from sessions.mock_out_external_dep.lab_01_demo import foo
def test_store_num():
assert foo.store_num(5) == True
print(foo.my_database.get_all())
@pytest.mark.parametrize(
"num",
[
(-2147483648),
(0),
pytest.param(-math.inf, marks=pytes... | [
"sessions.mock_out_external_dep.lab_01_demo.foo.store_num",
"sessions.mock_out_external_dep.lab_01_demo.foo.my_database.get_all",
"pytest.param"
] | [((134, 150), 'sessions.mock_out_external_dep.lab_01_demo.foo.store_num', 'foo.store_num', (['(5)'], {}), '(5)\n', (147, 150), False, 'from sessions.mock_out_external_dep.lab_01_demo import foo\n'), ((169, 194), 'sessions.mock_out_external_dep.lab_01_demo.foo.my_database.get_all', 'foo.my_database.get_all', ([], {}), '... |
import pickle
from pathlib import Path
class Saveable:
"""
Base class of saveable classes.
"""
#override
def dump_state(self):
"""
return a picklable state_dict that should be saved/loaded
"""
raise NotImplementedError()
#override
def load_state(self, state... | [
"pathlib.Path"
] | [((638, 652), 'pathlib.Path', 'Path', (['filepath'], {}), '(filepath)\n', (642, 652), False, 'from pathlib import Path\n'), ((881, 895), 'pathlib.Path', 'Path', (['filepath'], {}), '(filepath)\n', (885, 895), False, 'from pathlib import Path\n')] |
# 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... | [
"senlin_tempest_plugin.common.utils.create_a_node",
"senlin_tempest_plugin.common.utils.get_a_node",
"senlin_tempest_plugin.common.utils.create_a_profile",
"senlin_tempest_plugin.common.utils.api_microversion",
"tempest.lib.decorators.idempotent_id",
"senlin_tempest_plugin.common.utils.get_a_cluster",
"... | [((1726, 1762), 'tempest.lib.decorators.attr', 'decorators.attr', ([], {'type': "['functional']"}), "(type=['functional'])\n", (1741, 1762), False, 'from tempest.lib import decorators\n'), ((1768, 1832), 'tempest.lib.decorators.idempotent_id', 'decorators.idempotent_id', (['"""137a36d9-b4ee-485d-8bff-51ebb6113e9b"""'],... |
import Dataset_Generator as dg
import Evaluation as eval
import Plot_Graph as ploter
hd_dataset = dg.get_hd_dataset(5000)
reduced_hd = eval.pca_dim_reduction(hd_dataset, 3)
ploter.plot3D(reduced_hd)
broken_swiss_roll_dataset = dg.get_broken_swiss_roll_dataset(5000)
ploter.plot3D(broken_swiss_roll_dataset)
reduced_bro... | [
"Dataset_Generator.get_broken_swiss_roll_dataset",
"Dataset_Generator.get_swiss_roll_dataset",
"mnist.MNIST",
"Plot_Graph.plot3D_color",
"Dataset_Generator.get_helix_dataset",
"Plot_Graph.plot1D_color",
"Evaluation.get_continuity",
"Plot_Graph.plot2D",
"Plot_Graph.plot3D",
"Dataset_Generator.get_h... | [((99, 122), 'Dataset_Generator.get_hd_dataset', 'dg.get_hd_dataset', (['(5000)'], {}), '(5000)\n', (116, 122), True, 'import Dataset_Generator as dg\n'), ((136, 173), 'Evaluation.pca_dim_reduction', 'eval.pca_dim_reduction', (['hd_dataset', '(3)'], {}), '(hd_dataset, 3)\n', (158, 173), True, 'import Evaluation as eval... |
"""
geonames/readers
~~~~~~~~~~~~~~~~
Contains reader implementations.
"""
import contextlib
import io
import os
import zipfile
from typing import IO
@contextlib.contextmanager
def text_reader(path: str) -> IO:
with io.open(path, mode='r', encoding='utf-8') as f:
yield f
@contextlib.contex... | [
"zipfile.ZipFile",
"os.path.basename",
"io.open"
] | [((236, 277), 'io.open', 'io.open', (['path'], {'mode': '"""r"""', 'encoding': '"""utf-8"""'}), "(path, mode='r', encoding='utf-8')\n", (243, 277), False, 'import io\n'), ((430, 451), 'zipfile.ZipFile', 'zipfile.ZipFile', (['path'], {}), '(path)\n', (445, 451), False, 'import zipfile\n'), ((394, 416), 'os.path.basename... |