code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
# coding: utf-8
# Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c... | [
"oci.util.formatted_flat_dict",
"oci.util.value_allowed_none_or_none_sentinel"
] | [((17297, 17322), 'oci.util.formatted_flat_dict', 'formatted_flat_dict', (['self'], {}), '(self)\n', (17316, 17322), False, 'from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel\n'), ((13448, 13526), 'oci.util.value_allowed_none_or_none_sentinel', 'value_allowed_none_or_none_sent... |
# -*- coding: utf-8 -*-
""" Datetime functions
"""
# Ensure backwards compatibility with Python 2
from __future__ import (
absolute_import,
division,
print_function,
unicode_literals)
from builtins import *
from datetime import datetime
import iso8601
import pytz
from tzlocal import get_localzone
def... | [
"datetime.datetime.utcfromtimestamp",
"iso8601.parse_date",
"tzlocal.get_localzone"
] | [((943, 967), 'iso8601.parse_date', 'iso8601.parse_date', (['date'], {}), '(date)\n', (961, 967), False, 'import iso8601\n'), ((1903, 1918), 'tzlocal.get_localzone', 'get_localzone', ([], {}), '()\n', (1916, 1918), False, 'from tzlocal import get_localzone\n'), ((1151, 1183), 'datetime.datetime.utcfromtimestamp', 'date... |
import argparse
import matplotlib.pyplot as plt
import numpy as np
import os
import pandas as pd
import seaborn as sns
import sqlite3
def load_data():
"""loads the required .csv files."""
return pd.read_csv(r'C:\Users\Dell\OneDrive\Desktop\netflix_titles.csv')
def db_connection():
"""creates a connectio... | [
"pandas.read_sql_query",
"sqlite3.connect",
"pandas.read_csv",
"matplotlib.pyplot.ylabel",
"argparse.ArgumentParser",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.figure",
"seaborn.countplot",
"matplotlib.pyplot.title",
"pandas.to_datetime",
"matplotlib.pyplot.show"
] | [((205, 274), 'pandas.read_csv', 'pd.read_csv', (['"""C:\\\\Users\\\\Dell\\\\OneDrive\\\\Desktop\\\\netflix_titles.csv"""'], {}), "('C:\\\\Users\\\\Dell\\\\OneDrive\\\\Desktop\\\\netflix_titles.csv')\n", (216, 274), True, 'import pandas as pd\n'), ((353, 382), 'sqlite3.connect', 'sqlite3.connect', (['"""netflix.db"""']... |
from dataclasses import dataclass
from apischema.json_schema import deserialization_schema
@dataclass
class Bar:
baz: str
@dataclass
class Foo:
bar1: Bar
bar2: Bar
assert deserialization_schema(Foo, all_refs=False) == {
"$schema": "http://json-schema.org/draft/2020-12/schema#",
"$defs": {
... | [
"apischema.json_schema.deserialization_schema"
] | [((190, 233), 'apischema.json_schema.deserialization_schema', 'deserialization_schema', (['Foo'], {'all_refs': '(False)'}), '(Foo, all_refs=False)\n', (212, 233), False, 'from apischema.json_schema import deserialization_schema\n'), ((698, 740), 'apischema.json_schema.deserialization_schema', 'deserialization_schema', ... |
import grpc
import time
from bettermq_pb2 import *
from bettermq_pb2_grpc import *
host = '127.0.0.1:8404'
with grpc.insecure_channel(host) as channel:
client = PriorityQueueStub(channel)
i = 1
while True:
req = DequeueRequest(
topic = "root",
count = 1,
)
i... | [
"grpc.insecure_channel",
"time.sleep"
] | [((114, 141), 'grpc.insecure_channel', 'grpc.insecure_channel', (['host'], {}), '(host)\n', (135, 141), False, 'import grpc\n'), ((436, 449), 'time.sleep', 'time.sleep', (['(5)'], {}), '(5)\n', (446, 449), False, 'import time\n')] |
from totalimpactwebapp.cards_factory import *
import os
def make(profile):
response = {
"profile": profile,
"css": get_css(),
}
return response
def get_css():
path = os.path.join(
os.path.dirname(__file__),
'static/less.emails/css/new-metrics.css'
)
file = op... | [
"os.path.dirname"
] | [((225, 250), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (240, 250), False, 'import os\n')] |
#!/usr/bin/python
# -*- coding: utf-8 -*-
## Add path to library (just for examples; you do not need this)
import initExample
import numpy as np
from numpy import linspace
from pyqtgraph.Qt import QtGui, QtCore
import pyqtgraph as pg
from pyqtgraph import MultiPlotWidget
try:
from pyqtgraph.metaarray import *
exce... | [
"numpy.random.normal",
"pyqtgraph.Qt.QtGui.QApplication.instance",
"numpy.array",
"pyqtgraph.mkQApp",
"numpy.linspace",
"pyqtgraph.MultiPlotWidget",
"pyqtgraph.Qt.QtGui.QMainWindow"
] | [((445, 482), 'pyqtgraph.mkQApp', 'pg.mkQApp', (['"""MultiPlot Widget Example"""'], {}), "('MultiPlot Widget Example')\n", (454, 482), True, 'import pyqtgraph as pg\n'), ((488, 507), 'pyqtgraph.Qt.QtGui.QMainWindow', 'QtGui.QMainWindow', ([], {}), '()\n', (505, 507), False, 'from pyqtgraph.Qt import QtGui, QtCore\n'), ... |
import doctest
import sys
from notebook import Notebook, Note
class Menu:
"""
Menu class. Contains __init__ , display_menu, run, show_notes,
search_notes, add_note, modify_note, quit methods
"""
def __init__(self):
"""
main method to create object. It is called when
the n... | [
"sys.exit",
"notebook.Notebook"
] | [((411, 421), 'notebook.Notebook', 'Notebook', ([], {}), '()\n', (419, 421), False, 'from notebook import Notebook, Note\n'), ((2585, 2596), 'sys.exit', 'sys.exit', (['(0)'], {}), '(0)\n', (2593, 2596), False, 'import sys\n')] |
# get overview of data
# read data from given files, and produce a reduced image of each data file
import argparse
import logging
import math
import os
import shutil
import subprocess
from typing import Any, Dict, List, Optional
import h5py
import nibabel as nib
import numpy as np
from PIL import Image
from tqdm impo... | [
"math.floor",
"numpy.array",
"logging.info",
"numpy.arange",
"os.path.exists",
"argparse.ArgumentParser",
"AssistedVolumeSegmentation.common.get_file_list",
"AssistedVolumeSegmentation.common.init_logging",
"subprocess.run",
"numpy.stack",
"numpy.min",
"AssistedVolumeSegmentation.common.get_fu... | [((4654, 4668), 'numpy.min', 'np.min', (['ratios'], {}), '(ratios)\n', (4660, 4668), True, 'import numpy as np\n'), ((4717, 4754), 'math.ceil', 'math.ceil', (['(input_count * reduce_ratio)'], {}), '(input_count * reduce_ratio)\n', (4726, 4754), False, 'import math\n'), ((5088, 5259), 'logging.info', 'logging.info', (["... |
# SPDX-FileCopyrightText: 2017 <NAME> for Adafruit Industries
#
# SPDX-License-Identifier: MIT
import time
from rainbowio import colorwheel
import board
import neopixel
from digitalio import DigitalInOut, Direction
pixpin = board.D1
numpix = 5
led = DigitalInOut(board.D13)
led.direction = Direction.OUTPUT
strip = n... | [
"digitalio.DigitalInOut",
"neopixel.NeoPixel",
"rainbowio.colorwheel",
"time.sleep"
] | [((253, 276), 'digitalio.DigitalInOut', 'DigitalInOut', (['board.D13'], {}), '(board.D13)\n', (265, 276), False, 'from digitalio import DigitalInOut, Direction\n'), ((319, 383), 'neopixel.NeoPixel', 'neopixel.NeoPixel', (['pixpin', 'numpix'], {'brightness': '(1)', 'auto_write': '(True)'}), '(pixpin, numpix, brightness=... |
#!/usr/bin/env python
"""
Common argparse arguments and utility functions
"""
from os.path import expandvars
import json
# split up a comma-delimited string into list
def _comma_list(arg_list, type):
return [type(a) for a in arg_list.split(',')]
def int_comma_list(arg_list):
return _comma_list(arg_list, in... | [
"os.path.expandvars"
] | [((3425, 3476), 'os.path.expandvars', 'expandvars', (['"""$I3_BUILD/ice-models/resources/models"""'], {}), "('$I3_BUILD/ice-models/resources/models')\n", (3435, 3476), False, 'from os.path import expandvars\n'), ((4197, 4265), 'os.path.expandvars', 'expandvars', (['"""$I3_SRC/ice-models/resources/models/angsens/as.h2-5... |
# -*- coding: utf-8 -*-
' a module for conducting the statistical analysis '
__author__ = '<NAME>'
import numpy as np
from scipy.stats import ttest_1samp, ttest_rel, ttest_ind
from neurora.stuff import permutation_test
' a function for conducting the statistical analysis for results of EEG-like data '
def stats(c... | [
"neurora.stuff.permutation_test",
"numpy.log",
"numpy.zeros",
"scipy.stats.ttest_rel",
"scipy.stats.ttest_ind",
"scipy.stats.ttest_1samp",
"numpy.shape"
] | [((1693, 1732), 'numpy.zeros', 'np.zeros', (['[chls, ts, 2]'], {'dtype': 'np.float'}), '([chls, ts, 2], dtype=np.float)\n', (1701, 1732), True, 'import numpy as np\n'), ((3838, 3882), 'numpy.zeros', 'np.zeros', (['[n_x, n_y, n_z, 2]'], {'dtype': 'np.float'}), '([n_x, n_y, n_z, 2], dtype=np.float)\n', (3846, 3882), True... |
# Copyright 2022 Google.
#
# 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, soft... | [
"seqio.TfdsDataSource",
"seqio.CacheDatasetPlaceholder",
"functools.partial"
] | [((2060, 2122), 'seqio.TfdsDataSource', 'seqio.TfdsDataSource', ([], {'tfds_name': "DATASETS[dataset]['tfds_name']"}), "(tfds_name=DATASETS[dataset]['tfds_name'])\n", (2080, 2122), False, 'import seqio\n'), ((2156, 2391), 'functools.partial', 'functools.partial', (['spot_preprocessors.preprocess_text_classification'], ... |
"""Blockly Games: Legacy Reddit to Turtle/Movie router.
Copyright 2014 Google LLC
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 a... | [
"os.environ.get"
] | [((828, 862), 'os.environ.get', 'os.environ.get', (['"""QUERY_STRING"""', '""""""'], {}), "('QUERY_STRING', '')\n", (842, 862), False, 'import os\n'), ((779, 810), 'os.environ.get', 'os.environ.get', (['"""PATH_INFO"""', '""""""'], {}), "('PATH_INFO', '')\n", (793, 810), False, 'import os\n')] |
# Generated by Django 3.2.4 on 2021-08-28 04:30
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0005_auto_20210828_0428'),
]
operations = [
migrations.RemoveField(
model_name='section',
name='teachers',
... | [
"django.db.migrations.RemoveField",
"django.db.models.ManyToManyField"
] | [((232, 293), 'django.db.migrations.RemoveField', 'migrations.RemoveField', ([], {'model_name': '"""section"""', 'name': '"""teachers"""'}), "(model_name='section', name='teachers')\n", (254, 293), False, 'from django.db import migrations, models\n'), ((588, 648), 'django.db.migrations.RemoveField', 'migrations.RemoveF... |
# Copyright (C) 2018-2021 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import unittest
import numpy as np
from extensions.ops.elementwise import Round
from mo.graph.graph import Node
from unit_tests.utils.graph import build_graph
def round_test_graph(nodes_attributes, value, mode: str):
graph = build... | [
"numpy.array",
"extensions.ops.elementwise.Round.infer",
"mo.graph.graph.Node",
"unit_tests.utils.graph.build_graph"
] | [((315, 531), 'unit_tests.utils.graph.build_graph', 'build_graph', (['nodes_attributes', "[('node_1', 'elementwise_node'), ('elementwise_node', 'node_3')]", "{'node_1': {'value': value}, 'elementwise_node': {'op': 'Round', 'mode':\n mode}, 'node_3': {'value': None}}"], {}), "(nodes_attributes, [('node_1', 'elementwi... |
from struct import Struct
def read_records(format, f):
record_struct = Struct(format)
chunks = iter(lambda: f.read(record_struct.size), b'')
return (record_struct.unpack(chunk) for chunk in chunks)
# Example
if __name__ == '__main__':
with open('data.b','rb') as f:
for rec in read_records('<id... | [
"struct.Struct"
] | [((76, 90), 'struct.Struct', 'Struct', (['format'], {}), '(format)\n', (82, 90), False, 'from struct import Struct\n')] |
#Crie um programa que leia um número inteiro e diga se é par ou impar
from time import sleep
num = int(input('Digite um número: '))
if num % 2 == 0:
print('ANALISANDO...')
sleep(2)
print('O número é par!')
else:
print('ANALISANDO...')
sleep(2)
print('O número é impar')
print('======FIM=====') | [
"time.sleep"
] | [((180, 188), 'time.sleep', 'sleep', (['(2)'], {}), '(2)\n', (185, 188), False, 'from time import sleep\n'), ((255, 263), 'time.sleep', 'sleep', (['(2)'], {}), '(2)\n', (260, 263), False, 'from time import sleep\n')] |
# -*- coding: utf-8 -*-
# upd dist
import sys
import sqlite3
import time
from typing import List, Dict
from collections import namedtuple, defaultdict
from common import upcase_regex, pos2pos, penn2pos, is_stop_ngram
Record = namedtuple('Record', ['word', 'lemma', 'sublemma', 'tag', 'abs', 'arf'])
def create_tabl... | [
"collections.namedtuple",
"sqlite3.connect",
"time.time",
"collections.defaultdict",
"sys.exit",
"common.upcase_regex.match",
"common.is_stop_ngram"
] | [((229, 301), 'collections.namedtuple', 'namedtuple', (['"""Record"""', "['word', 'lemma', 'sublemma', 'tag', 'abs', 'arf']"], {}), "('Record', ['word', 'lemma', 'sublemma', 'tag', 'abs', 'arf'])\n", (239, 301), False, 'from collections import namedtuple, defaultdict\n'), ((4166, 4189), 'collections.defaultdict', 'defa... |
from typing import Dict, List
from dataclasses import dataclass, field
import tvm
from tvm import relay
import pickle
import random
import numpy as np
import random
from copy import deepcopy
from .tvmpass import PassDependenceGraph, PassNode
# TODO: Add parameters.
# TODO: Add more passes.
_RELAY_FUNCTION_HARD_PASSE... | [
"tvm.parser.fromtext",
"tvm.rocm",
"tvm.relay.TensorType",
"tvm.cpu",
"pickle.dump",
"numpy.random.chisquare",
"tvm.nd.array",
"pickle.load",
"tvm.relay.ty.is_dynamic",
"tvm.relay.frontend.from_keras",
"numpy.zeros",
"numpy.random.uniform",
"copy.deepcopy",
"tvm.cuda",
"tvm.target.Target... | [((1532, 1557), 'tvm.target.Target', 'tvm.target.Target', (['"""llvm"""'], {}), "('llvm')\n", (1549, 1557), False, 'import tvm\n'), ((4246, 4273), 'dataclasses.field', 'field', ([], {'default_factory': 'list'}), '(default_factory=list)\n', (4251, 4273), False, 'from dataclasses import dataclass, field\n'), ((2968, 2977... |
from unittest.mock import patch
import pytest
import requests
from scenario_player.exceptions.services import (
BrokenService,
ServiceReadTimeout,
ServiceUnavailable,
ServiceUnreachable,
)
from scenario_player.services.utils.interface import ServiceInterface, SPaaSAdapter
from scenario_player.utils.co... | [
"scenario_player.services.utils.interface.SPaaSAdapter",
"requests.Response",
"scenario_player.utils.configuration.spaas.SPaaSConfig",
"requests.Request",
"pytest.mark.parametrize",
"pytest.raises",
"unittest.mock.patch",
"pytest.mark.depends"
] | [((360, 409), 'pytest.mark.depends', 'pytest.mark.depends', ([], {'name': '"""spaas_adapter_mounted"""'}), "(name='spaas_adapter_mounted')\n", (379, 409), False, 'import pytest\n'), ((612, 666), 'pytest.mark.depends', 'pytest.mark.depends', ([], {'depends': "['spaas_adapter_mounted']"}), "(depends=['spaas_adapter_mount... |
# 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... | [
"testtools.matchers.StartsWith",
"oauthlib.oauth1.rfc5849.utils.parse_authorization_header",
"keystoneauth1.session.Session",
"uuid.uuid4",
"oauthlib.oauth1.Client",
"keystoneauth1.extras.oauth1.V3OAuth1",
"keystoneauth1.fixture.V3Token"
] | [((964, 976), 'uuid.uuid4', 'uuid.uuid4', ([], {}), '()\n', (974, 976), False, 'import uuid\n'), ((2671, 2776), 'keystoneauth1.fixture.V3Token', 'fixture.V3Token', ([], {'methods': "['oauth1']", 'oauth_consumer_id': 'consumer_key', 'oauth_access_token_id': 'access_key'}), "(methods=['oauth1'], oauth_consumer_id=consume... |
import json
import os
import unittest
import shutil
from satstac import __version__, Catalog, STACError, Item
testpath = os.path.dirname(__file__)
class Test(unittest.TestCase):
path = os.path.join(testpath, 'test-catalog')
@classmethod
def tearDownClass(cls):
""" Remove test files """
... | [
"os.path.exists",
"satstac.Catalog.create",
"os.path.join",
"os.path.dirname",
"satstac.Catalog",
"shutil.rmtree"
] | [((124, 149), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (139, 149), False, 'import os\n'), ((195, 233), 'os.path.join', 'os.path.join', (['testpath', '"""test-catalog"""'], {}), "(testpath, 'test-catalog')\n", (207, 233), False, 'import os\n'), ((325, 349), 'os.path.exists', 'os.path.exi... |
# Generated by Django 2.1 on 2020-11-28 00:58
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
import multiselectfield.db.fields
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.s... | [
"django.db.models.TextField",
"django.db.models.ForeignKey",
"django.db.models.DateTimeField",
"django.db.models.SlugField",
"django.db.models.AutoField",
"django.db.models.ImageField",
"django.db.migrations.swappable_dependency",
"django.db.models.URLField",
"django.db.models.CharField"
] | [((308, 365), 'django.db.migrations.swappable_dependency', 'migrations.swappable_dependency', (['settings.AUTH_USER_MODEL'], {}), '(settings.AUTH_USER_MODEL)\n', (339, 365), False, 'from django.db import migrations, models\n'), ((494, 587), 'django.db.models.AutoField', 'models.AutoField', ([], {'auto_created': '(True)... |
import unittest
import helpers
from latexpp.fixes import preamble
class TestAddPreamble(unittest.TestCase):
def test_simple(self):
lpp = helpers.MockLPP()
lpp.install_fix( preamble.AddPreamble(preamble=r"""
% use this package:
\usepackage{mycoolpackage}
% also keep these definitions:
... | [
"helpers.MockLPP",
"latexpp.fixes.preamble.AddPreamble",
"helpers.test_main"
] | [((815, 834), 'helpers.test_main', 'helpers.test_main', ([], {}), '()\n', (832, 834), False, 'import helpers\n'), ((163, 180), 'helpers.MockLPP', 'helpers.MockLPP', ([], {}), '()\n', (178, 180), False, 'import helpers\n'), ((206, 378), 'latexpp.fixes.preamble.AddPreamble', 'preamble.AddPreamble', ([], {'preamble': '"""... |
"""
VW Platform Application Package Constructor
"""
from flask import Flask
from flask_cors import CORS
from flask_mongoengine import MongoEngine
from config import config
db = MongoEngine()
# enable cross-origin resource sharing for the REST API
cors = CORS(resources={r'/api/*': {'origins': '*'}})
# enable cross... | [
"flask.Flask",
"flask_cors.CORS",
"flask_mongoengine.MongoEngine"
] | [((180, 193), 'flask_mongoengine.MongoEngine', 'MongoEngine', ([], {}), '()\n', (191, 193), False, 'from flask_mongoengine import MongoEngine\n'), ((258, 302), 'flask_cors.CORS', 'CORS', ([], {'resources': "{'/api/*': {'origins': '*'}}"}), "(resources={'/api/*': {'origins': '*'}})\n", (262, 302), False, 'from flask_cor... |
from queue import PriorityQueue
import pygame
from mazecreator.MazeCreator import MazeCreator
from mazecreator.Picasso import Picasso
from mazecreator.RGBColours import RGBColours
from mazecreator.SquareState import SquareState
class AStar:
"""
Poor man's implementation of A* Pathfinding algorithm
"""
... | [
"pygame.quit",
"pygame.draw.line",
"pygame.event.get",
"pygame.display.set_mode",
"mazecreator.MazeCreator.MazeCreator",
"pygame.display.set_caption",
"queue.PriorityQueue",
"pygame.display.update",
"mazecreator.Picasso.Picasso.get_valid_neighbours"
] | [((438, 453), 'queue.PriorityQueue', 'PriorityQueue', ([], {}), '()\n', (451, 453), False, 'from queue import PriorityQueue\n'), ((678, 727), 'pygame.display.set_mode', 'pygame.display.set_mode', (['(self.width, self.width)'], {}), '((self.width, self.width))\n', (701, 727), False, 'import pygame\n'), ((903, 948), 'pyg... |
# -*- coding: utf-8 -*-
import furl
import urllib
import urlparse
import bson.objectid
import httplib as http
from datetime import datetime
import itsdangerous
from flask import request
from werkzeug.local import LocalProxy
from weakref import WeakKeyDictionary
from framework.flask import redirect
from framework.mo... | [
"weakref.WeakKeyDictionary",
"flask.request.args.get",
"flask.request.args.to_dict",
"flask.request._get_current_object",
"datetime.datetime.utcnow",
"urlparse.urlparse",
"framework.auth.cas.make_response_from_ticket",
"framework.auth.core.get_user",
"flask.request.cookies.get",
"werkzeug.local.Lo... | [((3344, 3363), 'weakref.WeakKeyDictionary', 'WeakKeyDictionary', ([], {}), '()\n', (3361, 3363), False, 'from weakref import WeakKeyDictionary\n'), ((3374, 3397), 'werkzeug.local.LocalProxy', 'LocalProxy', (['get_session'], {}), '(get_session)\n', (3384, 3397), False, 'from werkzeug.local import LocalProxy\n'), ((562,... |
# https://raspi.tv/2015/7-segment-display-python-raspberry-pi-countdown-ticker
from threading import Timer
import time
from RPi import GPIO as gpio
class CountDownTimer(Timer):
cycle_wait = 0.001
servo = 6
# gpio ports for the 7seg pins
segments = (11, 4, 23, 8, 7, 10, 18, 25)
# gpio ports for... | [
"RPi.GPIO.cleanup",
"RPi.GPIO.setup",
"RPi.GPIO.output",
"time.sleep",
"RPi.GPIO.PWM",
"time.time",
"RPi.GPIO.setmode"
] | [((2211, 2224), 'time.sleep', 'time.sleep', (['(1)'], {}), '(1)\n', (2221, 2224), False, 'import time\n'), ((967, 989), 'RPi.GPIO.setmode', 'gpio.setmode', (['gpio.BCM'], {}), '(gpio.BCM)\n', (979, 989), True, 'from RPi import GPIO as gpio\n'), ((998, 1042), 'RPi.GPIO.setup', 'gpio.setup', (['self.digits', 'gpio.OUT'],... |
import speech_recognition as sr
#r=sr.Recognizer()
#a=speech_recognition.AudioFile('1.wav')
#with a as source:
#audio=r.record(source)
r=sr.Recognizer()
a=sr.AudioFile('1.wav')
with a as source:
audio=r.record(source)
text=r.recognize_google(audio)
file1=open(r"F:\java\Java Application\Magic\Game\2.txt","a"... | [
"speech_recognition.Recognizer",
"speech_recognition.AudioFile"
] | [((143, 158), 'speech_recognition.Recognizer', 'sr.Recognizer', ([], {}), '()\n', (156, 158), True, 'import speech_recognition as sr\n'), ((161, 182), 'speech_recognition.AudioFile', 'sr.AudioFile', (['"""1.wav"""'], {}), "('1.wav')\n", (173, 182), True, 'import speech_recognition as sr\n')] |
import os
import argparse
import matplotlib.pyplot as plt
from datetime import datetime, timedelta, date
import nottingham_covid_modelling.lib.priors as priors
import numpy as np
import pints
from nottingham_covid_modelling import MODULE_DIR
# Load project modules
from nottingham_covid_modelling.lib._command_line_args... | [
"nottingham_covid_modelling.lib.priors.get_good_starting_point",
"pints.OptimisationController",
"numpy.ones",
"os.makedirs",
"argparse.ArgumentParser",
"os.path.join",
"nottingham_covid_modelling.lib.settings.Params",
"numpy.asarray",
"numpy.max",
"numpy.argsort",
"numpy.errstate",
"pints.Rec... | [((1714, 1739), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (1737, 1739), False, 'import argparse\n'), ((3547, 3566), 'numpy.random.seed', 'np.random.seed', (['(100)'], {}), '(100)\n', (3561, 3566), True, 'import numpy as np\n'), ((3651, 3659), 'nottingham_covid_modelling.lib.settings.Params... |
import os
from setuptools import find_packages, setup
def read(fname):
with open(os.path.join(os.path.dirname(__file__), fname)) as f:
return f.read()
deps = [
"black",
"coverage",
"debugpy",
"flake8",
"git-aggregator",
"ipython",
"isort>=4.3.10",
"pylint_odoo",
"pyt... | [
"os.path.dirname",
"setuptools.find_packages",
"os.getenv"
] | [((354, 386), 'os.getenv', 'os.getenv', (['"""DISABLE_PYTEST_ODOO"""'], {}), "('DISABLE_PYTEST_ODOO')\n", (363, 386), False, 'import os\n'), ((802, 822), 'setuptools.find_packages', 'find_packages', (['"""src"""'], {}), "('src')\n", (815, 822), False, 'from setuptools import find_packages, setup\n'), ((101, 126), 'os.p... |
"""
Your chance to explore Loops and Turtles!
Authors: <NAME>, <NAME>, <NAME>, <NAME>,
<NAME>, their colleagues, and <NAME>.
"""
########################################################################
# DONE: 1.
# On Line 5 above, replace PUT_YOUR_NAME_HERE with your own name.
###########################... | [
"rosegraphics.Pen",
"rosegraphics.SimpleTurtle",
"rosegraphics.TurtleWindow"
] | [((1255, 1272), 'rosegraphics.TurtleWindow', 'rg.TurtleWindow', ([], {}), '()\n', (1270, 1272), True, 'import rosegraphics as rg\n'), ((1281, 1306), 'rosegraphics.SimpleTurtle', 'rg.SimpleTurtle', (['"""turtle"""'], {}), "('turtle')\n", (1296, 1306), True, 'import rosegraphics as rg\n'), ((1318, 1335), 'rosegraphics.Pe... |
import os
array=[
'flask',
'flask-admin',
'flask-login',
'enum',
'requests',
'python-dateutil',
'sqlalchemy',
'python-dotenv',
'moviepy',
'pydub',
'speechrecognition'
]
for package in array:
os.system('pip install '+package)
| [
"os.system"
] | [((195, 230), 'os.system', 'os.system', (["('pip install ' + package)"], {}), "('pip install ' + package)\n", (204, 230), False, 'import os\n')] |
"""
PlanUML format sequence diagram generation
"""
import re
import os
from . import sd_action
from . import util
def _output_participants(sd_context):
"""
Generate a string containing participants in order of the occurrence.
"""
output = []
for o in sd_context._objects.values():
stereoty... | [
"os.path.join",
"re.match"
] | [((4042, 4090), 'os.path.join', 'os.path.join', (['output_dir', "(diagram_name + '.puml')"], {}), "(output_dir, diagram_name + '.puml')\n", (4054, 4090), False, 'import os\n'), ((1213, 1253), 're.match', 're.match', (['"""<<\\\\w+>>"""', 'action.method_name'], {}), "('<<\\\\w+>>', action.method_name)\n", (1221, 1253), ... |
from django.conf.urls import re_path
from mailing.views import unsubscribe, render_mail
app_name = 'mailing'
urlpatterns = [
re_path(r'^unsubscribe/$', unsubscribe, name='unsubscribe'),
re_path(r'^render/mail/$', render_mail, name='render_mail'),
] | [
"django.conf.urls.re_path"
] | [((131, 189), 'django.conf.urls.re_path', 're_path', (['"""^unsubscribe/$"""', 'unsubscribe'], {'name': '"""unsubscribe"""'}), "('^unsubscribe/$', unsubscribe, name='unsubscribe')\n", (138, 189), False, 'from django.conf.urls import re_path\n'), ((196, 254), 'django.conf.urls.re_path', 're_path', (['"""^render/mail/$""... |
from django.http import HttpResponse
import json
import time
from datetime import datetime
from model import models
from api.v11 import common
def processRequest(request):
parsedRequest = common.parseRequest(request)
if parsedRequest['error'] is not None:
return parsedRequest['error']
if parsedRequest['respon... | [
"api.v11.common.error",
"model.models.DrawingTemplate.objects.defer",
"json.dumps",
"model.models.DrawingTemplate.objects.get",
"api.v11.common.parseRequest",
"api.v11.common.response",
"model.models.DrawingTemplate.objects.get_or_create"
] | [((192, 220), 'api.v11.common.parseRequest', 'common.parseRequest', (['request'], {}), '(request)\n', (211, 220), False, 'from api.v11 import common\n'), ((1755, 1853), 'model.models.DrawingTemplate.objects.get', 'models.DrawingTemplate.objects.get', ([], {'ownerSource': 'clientId', 'ownerId': 'userId', 'tool': 'tool',... |
import os
import shutil
import traceback
from contextlib import suppress
import PyInstaller.__main__
from scripts import Script
application_name = 'Projetor bíblico'
assets_path = os.path.join('data')
dist_path = os.path.join('dist')
copy_files = [
('icon.ico', dist_path),
]
copy_folders = [
('data', os.p... | [
"os.path.join",
"shutil.copytree",
"contextlib.suppress",
"shutil.copy",
"shutil.rmtree",
"traceback.print_exc",
"os.remove"
] | [((184, 204), 'os.path.join', 'os.path.join', (['"""data"""'], {}), "('data')\n", (196, 204), False, 'import os\n'), ((217, 237), 'os.path.join', 'os.path.join', (['"""dist"""'], {}), "('dist')\n", (229, 237), False, 'import os\n'), ((316, 347), 'os.path.join', 'os.path.join', (['dist_path', '"""data"""'], {}), "(dist_... |
# ライブラリのインポート
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.patches as patches
import gym
from gym import spaces
# gym.Envを継承したEasyMazeクラス
class EasyMaze(gym.Env):
# この環境ではrenderのモードとしてrgb_arrayのみを用意していることを宣言しておく
# GymのWrapperなどから参照される可能性がある
metadata = {'render.modes': ['rgb_array']}... | [
"matplotlib.patches.Rectangle",
"numpy.roll",
"gym.spaces.Discrete",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.axes"
] | [((2840, 2862), 'gym.spaces.Discrete', 'gym.spaces.Discrete', (['(4)'], {}), '(4)\n', (2859, 2862), False, 'import gym\n'), ((2933, 2956), 'gym.spaces.Discrete', 'gym.spaces.Discrete', (['(12)'], {}), '(12)\n', (2952, 2956), False, 'import gym\n'), ((3973, 4008), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'figsize... |
#
# Copyright 1993-2017 NVIDIA Corporation. All rights reserved.
#
# NOTICE TO LICENSEE:
#
# This source code and/or documentation ("Licensed Deliverables") are
# subject to NVIDIA intellectual property rights under U.S. and
# international Copyright laws.
#
# These Licensed Deliverables contained herein is PROPRIETAR... | [
"pycuda.driver.mem_alloc",
"pycuda.driver.pagelocked_empty",
"pycuda.driver.Stream",
"tensorrt.infer.ConsoleLogger",
"tensorrt.parsers.uffparser.create_uff_parser",
"lenet5.learn",
"pycuda.driver.memcpy_htod_async",
"numpy.argmax",
"os.path.realpath",
"uff.from_tensorflow",
"tensorrt.utils.uff_t... | [((3442, 3493), 'tensorrt.infer.ConsoleLogger', 'trt.infer.ConsoleLogger', (['trt.infer.LogSeverity.INFO'], {}), '(trt.infer.LogSeverity.INFO)\n', (3465, 3493), True, 'import tensorrt as trt\n'), ((4073, 4123), 'pycuda.driver.pagelocked_empty', 'cuda.pagelocked_empty', (['elt_count'], {'dtype': 'np.float32'}), '(elt_co... |
import collections
import os
import io_utils
import utils as e_utils
from core.common.utils import create_dir_if_not_exists
from core.networks.network_io import NetworkIO
from core.networks.data_type import DataType
from core.source.rusentrel.helpers.parsed_news import RuSentRelParsedNewsHelper
from core.source.rusent... | [
"core.source.rusentrel.news.RuSentRelNews.read_document",
"core.common.utils.create_dir_if_not_exists",
"io_utils.get_data_root",
"core.source.rusentrel.helpers.parsed_news.RuSentRelParsedNewsHelper.create_parsed_news",
"experiments.rusentrel.rusvectores_io.get_rusvectores_news_embedding_filepath",
"core.... | [((1820, 1861), 'experiments.rusentrel.rusvectores_io.get_rusvectores_news_embedding_filepath', 'get_rusvectores_news_embedding_filepath', ([], {}), '()\n', (1859, 1861), False, 'from experiments.rusentrel.rusvectores_io import get_rusvectores_news_embedding_filepath\n'), ((3070, 3182), 'core.source.rusentrel.entities.... |
#!/usr/bin/python2
#
# Acquire data from OPC-N2
#
# <NAME> <<EMAIL>>
# Laboratory for Atmospheric Research at Washington State University
from __future__ import print_function
import os, os.path as osp
import time
import json
import logging
from logging.handlers import TimedRotatingFileHandler
import spidev
from opc... | [
"logging.getLogger",
"os.makedirs",
"logging.Formatter",
"spidev.SpiDev",
"json.dumps",
"os.path.join",
"time.sleep",
"ConfigParser.ConfigParser",
"os.path.isdir",
"time.time",
"opc.OPCN2"
] | [((397, 424), 'ConfigParser.ConfigParser', 'configparser.ConfigParser', ([], {}), '()\n', (422, 424), True, 'import ConfigParser as configparser\n'), ((812, 853), 'logging.Formatter', 'logging.Formatter', (['jsonfmt'], {'datefmt': 'tsfmt'}), '(jsonfmt, datefmt=tsfmt)\n', (829, 853), False, 'import logging\n'), ((1078, ... |
from time import sleep
def lin(tam=42):
print('-' * tam)
def cabecalho(msg):
lin()
print(msg)
lin()
def limpa_tela():
from sys import platform
from os import system
if platform == 'win32':
system('cls')
else:
system('clear')
def leiaint(txt):
try:
... | [
"os.system",
"time.sleep"
] | [((611, 623), 'time.sleep', 'sleep', (['salto'], {}), '(salto)\n', (616, 623), False, 'from time import sleep\n'), ((664, 676), 'time.sleep', 'sleep', (['salto'], {}), '(salto)\n', (669, 676), False, 'from time import sleep\n'), ((717, 729), 'time.sleep', 'sleep', (['salto'], {}), '(salto)\n', (722, 729), False, 'from ... |
# -*- coding: utf-8 -*-
from odoo.tests import common
import odoo
GIF = b"R0lGODdhAQABAIAAAP///////ywAAAAAAQABAAACAkQBADs="
class test_ir_http_mimetype(common.TransactionCase):
def test_ir_http_mimetype_attachment(self):
""" Test mimetype for attachment """
attachment = self.env['ir.attachment'... | [
"odoo.tools.image_get_resized_images"
] | [((2401, 2502), 'odoo.tools.image_get_resized_images', 'odoo.tools.image_get_resized_images', (['prop.value_binary'], {'return_big': '(True)', 'avoid_resize_medium': '(True)'}), '(prop.value_binary, return_big=True,\n avoid_resize_medium=True)\n', (2436, 2502), False, 'import odoo\n')] |
# 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 required by applica... | [
"tensorflow.train.Checkpoint",
"tensorflow.keras.metrics.Mean",
"orbit.utils.make_distributed_dataset",
"orbit.utils.create_global_step",
"tensorflow.distribute.get_strategy",
"orbit.StandardTrainerOptions",
"tensorflow.nest.map_structure"
] | [((1336, 1364), 'tensorflow.distribute.get_strategy', 'tf.distribute.get_strategy', ([], {}), '()\n', (1362, 1364), True, 'import tensorflow as tf\n'), ((1569, 1601), 'orbit.utils.create_global_step', 'orbit.utils.create_global_step', ([], {}), '()\n', (1599, 1601), False, 'import orbit\n'), ((1788, 1916), 'tensorflow.... |
# Copyright (C) 2021 ZELDA USERBOT
# Created by mrismanaziz
# FROM <https://github.com/fhmyngrh/Zelda-Ubot>
# t.me/SharingUserbot & t.me/Lunatic0de
from asyncio.exceptions import TimeoutError
from telethon.errors.rpcerrorlist import YouBlockedUserError
from userbot import CMD_HANDLER as cmd
from userbot import CMD_H... | [
"userbot.bot.send_read_acknowledge",
"userbot.CMD_HELP.update",
"userbot.bot.conversation",
"userbot.events.zelda_cmd"
] | [((2278, 2489), 'userbot.CMD_HELP.update', 'CMD_HELP.update', (['{\'pdf\':\n f"""**Plugin : **`pdf` \n\n • **Syntax :** `{cmd}pdf` <reply text> \n • **Function : **Untuk Mengconvert teks menjadi file PDF menggunakan @office2pdf_bot """\n }'], {}), '({\'pdf\':\n f"""**Plugin : **`pdf` ... |
# -*- coding: utf-8 -*-
from django.conf.urls import url
from . views import raiseerror, raise404, notfound
urlpatterns = [
url(r'^check/raise/500/$',
view=raiseerror,
name='check_raise'),
url(r'^check/raise/404/$',
view=raise404,
name='check_raise'),
url(r'^check/404/$',
... | [
"django.conf.urls.url"
] | [((129, 191), 'django.conf.urls.url', 'url', (['"""^check/raise/500/$"""'], {'view': 'raiseerror', 'name': '"""check_raise"""'}), "('^check/raise/500/$', view=raiseerror, name='check_raise')\n", (132, 191), False, 'from django.conf.urls import url\n'), ((215, 275), 'django.conf.urls.url', 'url', (['"""^check/raise/404/... |
'''
This file contains a set of functions to plot models for Matisse. Including
- Map of ScS, SKS and SKKS data
- Global map of the Trigonal domains
- Regional view showing phases and domains
- Global view showing Reciever Side corrections
- Regional map showing the number of ScS, SKS and SKKS paths in each domain f... | [
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.gcf",
"cartopy.crs.PlateCarree",
"numpy.isin",
"matplotlib.collections.PatchCollection",
"numpy.array",
"matplotlib.pyplot.figure",
"matplotlib.colorbar.make_axes",
"numpy.zeros",
"numpy.loadtxt",
"numpy.rad2deg",
"cartopy.feature.GSHHSFeature",
... | [((698, 716), 'cartopy.crs.PlateCarree', 'ccrs.PlateCarree', ([], {}), '()\n', (714, 716), True, 'import cartopy.crs as ccrs\n'), ((1609, 1641), 'matplotlib.collections.PatchCollection', 'PatchCollection', (['trig'], {'alpha': '(0.6)'}), '(trig, alpha=0.6)\n', (1624, 1641), False, 'from matplotlib.collections import Pa... |
'''
Author: <NAME> and <NAME>
Date: Sunday, June 13, 2021
Description: A Super Smash Bros clone using the PyGame module. The character sprites all come from real people.
'''
# Packages, Libraries, and Modules
from scenes import GameScene, MainMenu, PostGameP1, PostGameP2, CharacterSelect
import settings as s
import py... | [
"pygame.display.set_caption",
"pygame.init",
"pygame.quit",
"pygame.event.get",
"pygame.display.set_mode",
"pygame.display.flip",
"pygame.key.get_pressed",
"pygame.time.Clock",
"scenes.MainMenu"
] | [((447, 460), 'pygame.init', 'pygame.init', ([], {}), '()\n', (458, 460), False, 'import pygame\n'), ((487, 517), 'pygame.display.set_mode', 'pygame.display.set_mode', (['s.s_s'], {}), '(s.s_s)\n', (510, 517), False, 'import pygame\n'), ((522, 568), 'pygame.display.set_caption', 'pygame.display.set_caption', (['"""Dupe... |
from PIL import Image, ImageDraw, ImageFont
import ctypes
import urllib.request
import json
import time
from datetime import datetime
def get_item(item):
if item == 'id':
line = 0
char = 11
elif item =='key':
line = 1
char = 8
elif item == 'path':
line = 2
ch... | [
"ctypes.windll.user32.SystemParametersInfoW",
"json.loads",
"PIL.Image.new",
"PIL.ImageFont.truetype",
"time.sleep",
"datetime.datetime.now",
"PIL.ImageDraw.Draw"
] | [((1727, 1764), 'PIL.ImageFont.truetype', 'ImageFont.truetype', (['"""arial.ttf"""', '(1000)'], {}), "('arial.ttf', 1000)\n", (1745, 1764), False, 'from PIL import Image, ImageDraw, ImageFont\n'), ((1777, 1832), 'PIL.Image.new', 'Image.new', ([], {'mode': '"""RGB"""', 'size': '(1920, 1080)', 'color': '"""white"""'}), "... |
# -*- coding: utf-8 -*-
import warnings
from contextlib import redirect_stderr, redirect_stdout, suppress
from copy import deepcopy
from logging import Logger, LogRecord
from os import devnull
from typing import Optional, Sequence, Sized, Tuple, TypeVar
import numpy as np
import pandas as pd
import sklearn.datasets
fr... | [
"pandas.Series",
"contextlib.redirect_stdout",
"copy.deepcopy",
"pada.utils.log.logger.addFilter",
"numpy.asarray",
"numpy.ndim",
"numpy.any",
"warnings.catch_warnings",
"contextlib.redirect_stderr",
"warnings.simplefilter",
"numpy.isnan",
"contextlib.suppress",
"pada.utils.log.logger.remove... | [((2642, 2655), 'typing.TypeVar', 'TypeVar', (['"""_T"""'], {}), "('_T')\n", (2649, 2655), False, 'from typing import Optional, Sequence, Sized, Tuple, TypeVar\n'), ((3522, 3539), 'funcy.complement', 'complement', (['falsy'], {}), '(falsy)\n', (3532, 3539), False, 'from funcy import complement, decorator, lfilter\n'), ... |
import enoki as ek
import pytest
import mitsuba
def test01_construction(variant_scalar_rgb):
from mitsuba.core import Frame3f
# Uninitialized frame
_ = Frame3f()
# Frame3f from the 3 vectors: no normalization should be performed
f1 = Frame3f([0.005, 50, -6], [0.01, -13.37, 1], [0.5, 0, -6.2])
... | [
"enoki.sqrt",
"mitsuba.core.Frame3f.cos_phi_2",
"enoki.cos",
"mitsuba.core.Frame3f.cos_theta",
"mitsuba.core.Frame3f.sincos_phi_2",
"mitsuba.core.Frame3f.sin_phi_2",
"mitsuba.core.Frame3f.cos_theta_2",
"enoki.allclose",
"enoki.sin",
"mitsuba.core.Frame3f.sin_theta_2",
"mitsuba.core.Frame3f.sin_p... | [((167, 176), 'mitsuba.core.Frame3f', 'Frame3f', ([], {}), '()\n', (174, 176), False, 'from mitsuba.core import Frame3f\n'), ((258, 317), 'mitsuba.core.Frame3f', 'Frame3f', (['[0.005, 50, -6]', '[0.01, -13.37, 1]', '[0.5, 0, -6.2]'], {}), '([0.005, 50, -6], [0.01, -13.37, 1], [0.5, 0, -6.2])\n', (265, 317), False, 'fro... |
# Generated by Django 3.0.5 on 2021-10-30 09:33
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('school', '0023_auto_20211024_1308'),
]
operations = [
migrations.CreateModel(
name='Grading',
fields=[
... | [
"django.db.models.DecimalField",
"django.db.models.DateField",
"django.db.models.AutoField",
"django.db.models.CharField"
] | [((330, 423), '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", (346, 423), False, 'from django.db import migrations, models\... |
import re
from sqlalchemy import inspect
from sqlalchemy.ext.declarative import (
as_declarative,
declared_attr)
from sqlalchemy.sql.schema import (
Column,
ForeignKey,
MetaData)
# #############################################################################
# Declarative base, naming convention ... | [
"sqlalchemy.sql.schema.ForeignKey",
"sqlalchemy.sql.schema.MetaData",
"sqlalchemy.sql.schema.Column",
"sqlalchemy.inspect",
"re.sub"
] | [((705, 750), 'sqlalchemy.sql.schema.MetaData', 'MetaData', ([], {'naming_convention': 'naming_convention'}), '(naming_convention=naming_convention)\n', (713, 750), False, 'from sqlalchemy.sql.schema import Column, ForeignKey, MetaData\n'), ((2010, 2031), 'sqlalchemy.sql.schema.Column', 'Column', (['*args'], {}), '(*ar... |
from django.contrib import admin
from .models import Blog
# Register your models here.
admin.site.site_header ='Community Health Admin' #changes the header of the admin page
admin.site.register(Blog)
| [
"django.contrib.admin.site.register"
] | [((176, 201), 'django.contrib.admin.site.register', 'admin.site.register', (['Blog'], {}), '(Blog)\n', (195, 201), False, 'from django.contrib import admin\n')] |
"""Collection of helpers."""
from homeassistant.components.coinbase.const import (
CONF_CURRENCIES,
CONF_EXCHANGE_RATES,
DOMAIN,
)
from homeassistant.const import CONF_API_KEY, CONF_API_TOKEN
from .const import GOOD_EXCHANGE_RATE, GOOD_EXCHANGE_RATE_2, MOCK_ACCOUNTS_RESPONSE
from tests.common import MockC... | [
"tests.common.MockConfigEntry"
] | [((1891, 2102), 'tests.common.MockConfigEntry', 'MockConfigEntry', ([], {'domain': 'DOMAIN', 'unique_id': 'None', 'title': '"""Test User"""', 'data': "{CONF_API_KEY: '123456', CONF_API_TOKEN: 'AbCDeF'}", 'options': '{CONF_CURRENCIES: currencies or [], CONF_EXCHANGE_RATES: rates or []}'}), "(domain=DOMAIN, unique_id=Non... |
"""Create example plot with different metrics.
Example
-------
python docs/stats_explainer.py
"""
import matplotlib.pyplot as plt
import numpy as np
from asreviewcontrib.insights.plot import _fix_start_tick
# The recall at a given number of documents read is the fraction of the
# relevant records found at that mo... | [
"numpy.sum",
"numpy.linspace",
"asreviewcontrib.insights.plot._fix_start_tick",
"numpy.cumsum",
"matplotlib.pyplot.subplots",
"numpy.round"
] | [((919, 953), 'numpy.round', 'np.round', (['(percentages * n_pos_docs)'], {}), '(percentages * n_pos_docs)\n', (927, 953), True, 'import numpy as np\n'), ((1135, 1149), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {}), '()\n', (1147, 1149), True, 'import matplotlib.pyplot as plt\n'), ((2102, 2121), 'asreviewcontr... |
import math
from OpenGL.GL import *
from OpenGL.GLUT import *
from OpenGL.GLU import *
"""
Turtle drawings
Once the functions reset(), turn(), turnTo() and forw() there is a possibility to
program a path. In essence this is very similar to using polar coordinates relative
to the last set point. Meaning you define t... | [
"math.radians"
] | [((1142, 1161), 'math.radians', 'math.radians', (['angle'], {}), '(angle)\n', (1154, 1161), False, 'import math\n'), ((1196, 1215), 'math.radians', 'math.radians', (['angle'], {}), '(angle)\n', (1208, 1215), False, 'import math\n')] |
from django import http
from urlparse import urlparse
from corsheaders import defaults as settings
class CorsMiddleware(object):
def process_request(self, request):
'''
If CORS preflight header, then create an empty body response (200 OK) and return it
Django won't b... | [
"django.http.HttpResponse",
"urlparse.urlparse"
] | [((597, 616), 'django.http.HttpResponse', 'http.HttpResponse', ([], {}), '()\n', (614, 616), False, 'from django import http\n'), ((933, 949), 'urlparse.urlparse', 'urlparse', (['origin'], {}), '(origin)\n', (941, 949), False, 'from urlparse import urlparse\n')] |
import os
from unittest import mock
import pytest
from kubernetes.client.exceptions import ApiException
from task_processing.plugins.kubernetes.kube_client import ExceededMaxAttempts
from task_processing.plugins.kubernetes.kube_client import KubeClient
def test_KubeClient_no_kubeconfig():
with mock.patch(
... | [
"unittest.mock.Mock",
"unittest.mock.patch.dict",
"task_processing.plugins.kubernetes.kube_client.KubeClient",
"pytest.raises",
"unittest.mock.patch"
] | [((303, 417), 'unittest.mock.patch', 'mock.patch', (['"""task_processing.plugins.kubernetes.kube_client.kube_config.load_kube_config"""'], {'autospec': '(True)'}), "(\n 'task_processing.plugins.kubernetes.kube_client.kube_config.load_kube_config'\n , autospec=True)\n", (313, 417), False, 'from unittest import moc... |
# Lint as: python3
# Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... | [
"lingvo.core.optimizer.Adam.Params",
"lingvo.compat.zeros",
"lingvo.core.optimizer.Accumulator.Params",
"lingvo.core.layers.ProjectionLayer.Params",
"lingvo.core.optimizer.RMSProp.Params",
"lingvo.core.py_utils.GetOrCreateGlobalStepVar",
"lingvo.core.py_utils.ComputeGradients",
"numpy.random.seed",
... | [((7285, 7312), 'lingvo.core.py_utils.SetEagerMode', 'py_utils.SetEagerMode', (['(True)'], {}), '(True)\n', (7306, 7312), False, 'from lingvo.core import py_utils\n'), ((7315, 7329), 'lingvo.compat.test.main', 'tf.test.main', ([], {}), '()\n', (7327, 7329), True, 'import lingvo.compat as tf\n'), ((1068, 1111), 'lingvo.... |
#!/usr/bin/python3
# -*- coding:utf-8 -*-
# @Time : 2019/2/23 18:15
# @Author : <NAME>
# @Email : <EMAIL>
# @File : Headless.py
# @Des :
# @Software : PyCharm
from selenium import webdriver
def get(url):
options = webdriver.FirefoxOptions()
options.set_headless()
options.add... | [
"selenium.webdriver.FirefoxOptions",
"selenium.webdriver.Firefox"
] | [((251, 277), 'selenium.webdriver.FirefoxOptions', 'webdriver.FirefoxOptions', ([], {}), '()\n', (275, 277), False, 'from selenium import webdriver\n'), ((398, 440), 'selenium.webdriver.Firefox', 'webdriver.Firefox', ([], {'firefox_options': 'options'}), '(firefox_options=options)\n', (415, 440), False, 'from selenium ... |
#MenuTitle: Vertical Metrics Manager
# -*- coding: utf-8 -*-
from __future__ import division, print_function, unicode_literals
try:
from builtins import str
except Exception as e:
print("Warning: 'future' module not installed. Run 'sudo pip install future' in Terminal.")
__doc__="""
Manage and sync ascender, descende... | [
"vanilla.FloatingWindow",
"vanilla.TextBox",
"vanilla.SquareButton",
"traceback.format_exc",
"vanilla.EditText",
"webbrowser.open",
"vanilla.CheckBox",
"vanilla.HelpButton",
"vanilla.PopUpButton",
"vanilla.Button"
] | [((1150, 1425), 'vanilla.FloatingWindow', 'vanilla.FloatingWindow', (['(windowWidth, windowHeight)', '"""Vertical Metrics Manager"""'], {'minSize': '(windowWidth, windowHeight)', 'maxSize': '(windowWidth + windowWidthResize, windowHeight + windowHeightResize)', 'autosaveName': '"""com.mekkablue.VerticalMetricsManager.m... |
#!/usr/bin/env python
# BSD 3-Clause License; see https://github.com/scikit-hep/aghast/blob/master/LICENSE
import math
import numbers
try:
from inspect import signature
except ImportError:
try:
from funcsigs import signature
except ImportError:
raise ImportError("Install funcsigs package w... | [
"funcsigs.signature"
] | [((10431, 10454), 'funcsigs.signature', 'signature', (['cls.__init__'], {}), '(cls.__init__)\n', (10440, 10454), False, 'from funcsigs import signature\n')] |
"""
Utilities for starting up a test slapd server
and talking to it with ldapsearch/ldapadd.
"""
import sys, os, socket, time, subprocess, logging
_log = logging.getLogger("slapd")
def quote(s):
'''Quotes the '"' and '\' characters in a string and surrounds with "..."'''
return '"' + s.replace('\\','\\\\')... | [
"logging.getLogger",
"logging.basicConfig",
"socket.socket",
"subprocess.Popen",
"os.access",
"os.path.join",
"time.sleep",
"os.mkdir",
"posix.kill",
"os.walk",
"os.remove"
] | [((158, 184), 'logging.getLogger', 'logging.getLogger', (['"""slapd"""'], {}), "('slapd')\n", (175, 184), False, 'import sys, os, socket, time, subprocess, logging\n'), ((663, 691), 'os.walk', 'os.walk', (['path'], {'topdown': '(False)'}), '(path, topdown=False)\n', (670, 691), False, 'import sys, os, socket, time, sub... |
# Copyright (c) 2021 The Trade Desk, Inc
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following discl... | [
"datetime.datetime",
"uid2_client.encryption._encrypt_data_v1",
"datetime.datetime.utcnow",
"base64.b64encode",
"base64.b64decode",
"uid2_client.decrypt_token",
"uid2_client.decrypt_data",
"uid2_client.encrypt_data",
"datetime.timedelta"
] | [((2086, 2106), 'datetime.datetime.utcnow', 'dt.datetime.utcnow', ([], {}), '()\n', (2104, 2106), True, 'import datetime as dt\n'), ((2425, 2457), 'datetime.datetime', 'dt.datetime', (['(2020)', '(1)', '(1)', '(0)', '(0)', '(0)'], {}), '(2020, 1, 1, 0, 0, 0)\n', (2436, 2457), True, 'import datetime as dt\n'), ((2459, 2... |
# Copyright (c) The Diem Core Contributors
# SPDX-License-Identifier: Apache-2.0
from diem import identifier, LocalAccount, offchain, jsonrpc
from diem_utils.types.currencies import DiemCurrency
from tests.wallet_tests.resources.seeds.one_user_seeder import OneUser
from wallet.services.account import (
generate_n... | [
"wallet.services.offchain.process_inbound_command",
"diem.jsonrpc.TransactionData",
"diem.identifier.gen_subaddress",
"context.get",
"diem.offchain.reply_request",
"wallet.services.offchain._user_kyc_data",
"diem.LocalAccount.generate",
"diem.identifier.encode_account",
"tests.wallet_tests.resources... | [((987, 1066), 'tests.wallet_tests.resources.seeds.one_user_seeder.OneUser.run', 'OneUser.run', (['db_session'], {'account_amount': '(100000000000)', 'account_currency': 'currency'}), '(db_session, account_amount=100000000000, account_currency=currency)\n', (998, 1066), False, 'from tests.wallet_tests.resources.seeds.o... |
from joerd.util import BoundingBox
import joerd.download as download
import joerd.check as check
import joerd.srs as srs
import joerd.mask as mask
from joerd.mkdir_p import mkdir_p
from shutil import copyfileobj
import os.path
import os
import requests
import logging
import re
import tempfile
import sys
import tracebac... | [
"joerd.srs.wgs84",
"os.makedirs",
"os.walk",
"os.path.join",
"os.path.isdir",
"joerd.mask.negative",
"joerd.util.BoundingBox"
] | [((1621, 1655), 'os.path.join', 'os.path.join', (['self.base_dir', 'fname'], {}), '(self.base_dir, fname)\n', (1633, 1655), False, 'import os\n'), ((2627, 2649), 'os.walk', 'os.walk', (['self.base_dir'], {}), '(self.base_dir)\n', (2634, 2649), False, 'import os\n'), ((4296, 4307), 'joerd.srs.wgs84', 'srs.wgs84', ([], {... |
import firebase_admin, os, sys
from firebase_admin import credentials, firestore, storage, db, auth
class FirebaseDbUtility:
"""Handles the upload of video files to firebase damagereport-897b3"""
cred = None
app = None
logger = None
def __init__(self, credfilename, main_dir, log):
s... | [
"firebase_admin.db.reference",
"firebase_admin.initialize_app",
"firebase_admin.firestore.client",
"firebase_admin.credentials.Certificate",
"firebase_admin.storage.bucket"
] | [((357, 405), 'firebase_admin.credentials.Certificate', 'credentials.Certificate', (['(main_dir + credfilename)'], {}), '(main_dir + credfilename)\n', (380, 405), False, 'from firebase_admin import credentials, firestore, storage, db, auth\n'), ((425, 663), 'firebase_admin.initialize_app', 'firebase_admin.initialize_ap... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
from django.conf import settings
import uuid
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
... | [
"django.db.models.ForeignKey",
"django.db.models.CharField",
"django.db.models.DateTimeField",
"django.db.migrations.swappable_dependency",
"django.db.models.UUIDField"
] | [((255, 312), 'django.db.migrations.swappable_dependency', 'migrations.swappable_dependency', (['settings.AUTH_USER_MODEL'], {}), '(settings.AUTH_USER_MODEL)\n', (286, 312), False, 'from django.db import migrations, models\n'), ((449, 540), 'django.db.models.UUIDField', 'models.UUIDField', ([], {'default': 'uuid.uuid4'... |
from os import urandom
import numpy as np
s1 = '''
11111
19991
19191
19991
11111'''
sampleIn = '''
5483143223
2745854711
5264556173
6141336146
6357385478
4167524645
2176841721
6882881134
4846848554
5283751526'''
realIn = '''
4438624262
6263251864
2618812434
2134264565
1815131247
2612457325
8585767584
7217134556
2825... | [
"numpy.count_nonzero",
"numpy.array",
"numpy.copy",
"numpy.where"
] | [((478, 489), 'numpy.array', 'np.array', (['b'], {}), '(b)\n', (486, 489), True, 'import numpy as np\n'), ((1925, 1936), 'numpy.array', 'np.array', (['b'], {}), '(b)\n', (1933, 1936), True, 'import numpy as np\n'), ((656, 669), 'numpy.copy', 'np.copy', (['newA'], {}), '(newA)\n', (663, 669), True, 'import numpy as np\n... |
import xml.etree.ElementTree as ET
import json
import argparse
import sys
def parse_args(args=sys.argv[1:]):
""" Get the parsed arguments specified on this script.
"""
parser = argparse.ArgumentParser(description="")
parser.add_argument(
'path_to_xml',
action='store',
type=str,... | [
"json.load",
"json.dump",
"xml.etree.ElementTree.parse",
"argparse.ArgumentParser"
] | [((190, 229), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '""""""'}), "(description='')\n", (213, 229), False, 'import argparse\n'), ((760, 772), 'json.load', 'json.load', (['f'], {}), '(f)\n', (769, 772), False, 'import json\n'), ((986, 1005), 'xml.etree.ElementTree.parse', 'ET.parse', (... |
# Copyright: 2005-2008 <NAME> <<EMAIL>>
# License: GPL2/BSD
"""
filtering repository
"""
__all__ = ("tree",)
from itertools import filterfalse
from snakeoil.klass import GetAttrProxy, DirProxy
from pkgcore.operations.repo import operations_proxy
from pkgcore.repository import prototype, errors
from pkgcore.restric... | [
"snakeoil.klass.GetAttrProxy",
"pkgcore.repository.prototype.tree.itermatch.__doc__.replace",
"pkgcore.repository.errors.InitializationError",
"snakeoil.klass.DirProxy"
] | [((1834, 1858), 'snakeoil.klass.GetAttrProxy', 'GetAttrProxy', (['"""raw_repo"""'], {}), "('raw_repo')\n", (1846, 1858), False, 'from snakeoil.klass import GetAttrProxy, DirProxy\n'), ((1873, 1893), 'snakeoil.klass.DirProxy', 'DirProxy', (['"""raw_repo"""'], {}), "('raw_repo')\n", (1881, 1893), False, 'from snakeoil.kl... |
# coding=utf-8
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License");... | [
"apache_beam.Pipeline",
"json.dumps",
"apache_beam.Create",
"apache_beam.Partition"
] | [((1122, 1137), 'apache_beam.Pipeline', 'beam.Pipeline', ([], {}), '()\n', (1135, 1137), True, 'import apache_beam as beam\n'), ((2251, 2266), 'apache_beam.Pipeline', 'beam.Pipeline', ([], {}), '()\n', (2264, 2266), True, 'import apache_beam as beam\n'), ((3743, 3758), 'apache_beam.Pipeline', 'beam.Pipeline', ([], {}),... |
# This file is part of Scapy
# See http://www.secdev.org/projects/scapy for more information
# Copyright (C) <NAME> <<EMAIL>>
# This program is published under a GPLv2 license
"""A minimal implementation of the CANopen protocol, based on
Wireshark dissectors. See https://wiki.wireshark.org/CANopen
"""
import struct... | [
"scapy.packet.bind_layers",
"scapy.config.conf.l2types.register",
"scapy.fields.FlagsField",
"scapy.fields.StrLenField",
"scapy.fields.XBitField",
"scapy.fields.ThreeBytesField",
"scapy.fields.FieldLenField",
"binascii.unhexlify"
] | [((2793, 2838), 'scapy.config.conf.l2types.register', 'conf.l2types.register', (['DLT_CAN_SOCKETCAN', 'CAN'], {}), '(DLT_CAN_SOCKETCAN, CAN)\n', (2814, 2838), False, 'from scapy.config import conf\n'), ((2839, 2878), 'scapy.packet.bind_layers', 'bind_layers', (['CookedLinux', 'CAN'], {'proto': '(12)'}), '(CookedLinux, ... |
import logging
from functools import wraps
from celery import states
from . import events
from .application import celery_application
from .events import RUNTIME_METADATA_ATTR
winnow_task_logger = logging.getLogger(__name__)
class WinnowTask(celery_application.Task):
def update_metadata(self, meta=None, task_i... | [
"logging.getLogger",
"functools.wraps"
] | [((200, 227), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (217, 227), False, 'import logging\n'), ((1238, 1249), 'functools.wraps', 'wraps', (['task'], {}), '(task)\n', (1243, 1249), False, 'from functools import wraps\n'), ((1603, 1630), 'logging.getLogger', 'logging.getLogger', (['""... |
import os
class StaticHandler(object):
def __init__(self, web_root, http_port, https_port):
self.static_dir = os.path.join(
os.getcwd(), "tools/wave/www")
self._web_root = web_root
self._http_port = http_port
self._https_port = https_port
def handle_request(self, r... | [
"os.path.join",
"os.getcwd"
] | [((648, 688), 'os.path.join', 'os.path.join', (['self.static_dir', 'file_path'], {}), '(self.static_dir, file_path)\n', (660, 688), False, 'import os\n'), ((150, 161), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (159, 161), False, 'import os\n')] |
import json
import requests
import smtplib
input_city = str(input("enter city name : "))
sender_email = str(input("enter sender's email ID : "))
sender_pwd = str(input("enter sender's email password : "))
receiver_email = str(input("enter receiver's email ID : "))
API_key = str(input("enter the API key : "))
input_ci... | [
"json.loads",
"requests.get",
"smtplib.SMTP_SSL"
] | [((686, 707), 'json.loads', 'json.loads', (['json1_str'], {}), '(json1_str)\n', (696, 707), False, 'import json\n'), ((2281, 2320), 'smtplib.SMTP_SSL', 'smtplib.SMTP_SSL', (['"""smtp.gmail.com"""', '(465)'], {}), "('smtp.gmail.com', 465)\n", (2297, 2320), False, 'import smtplib\n'), ((1245, 1262), 'requests.get', 'requ... |
#!/usr/bin/env python
import re
import unittest
import mock
import pytest
from cachet_url_monitor.configuration import HttpStatus, Regex
from cachet_url_monitor.configuration import Latency
class LatencyTest(unittest.TestCase):
def setUp(self):
self.expectation = Latency({'type': 'LATENCY', 'threshold':... | [
"re.compile",
"mock.Mock",
"cachet_url_monitor.configuration.Latency",
"pytest.raises",
"cachet_url_monitor.configuration.HttpStatus",
"cachet_url_monitor.configuration.Regex"
] | [((280, 324), 'cachet_url_monitor.configuration.Latency', 'Latency', (["{'type': 'LATENCY', 'threshold': 1}"], {}), "({'type': 'LATENCY', 'threshold': 1})\n", (287, 324), False, 'from cachet_url_monitor.configuration import Latency\n'), ((509, 520), 'mock.Mock', 'mock.Mock', ([], {}), '()\n', (518, 520), False, 'import... |
from django.urls import path, include
from django.conf.urls import url
from rest_framework import routers
from . import views
app_name = "flights"
# router = routers.DefaultRouter()
# router.register(r'users', views.UserViewSet)
urlpatterns = [
# path("", views.index, name='index')
# path("", include(router.... | [
"django.urls.path"
] | [((331, 378), 'django.urls.path', 'path', (['""""""', 'views.flight_list'], {'name': '"""flight-list"""'}), "('', views.flight_list, name='flight-list')\n", (335, 378), False, 'from django.urls import path, include\n'), ((384, 443), 'django.urls.path', 'path', (['"""<int:pk>"""', 'views.flight_detail'], {'name': '"""fl... |
from django.db import models
class Country(models.Model):
name = models.CharField(max_length=200, db_index=True)
code = models.CharField(max_length=20, db_index=True)
# municipality_levels is a list of strings blank-separated with
# possible values GeonamesAdm1-GeonamesAdm5, PopulatedPlace
# and t... | [
"django.db.models.ForeignKey",
"django.db.models.CharField",
"django.db.models.BooleanField"
] | [((71, 118), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(200)', 'db_index': '(True)'}), '(max_length=200, db_index=True)\n', (87, 118), False, 'from django.db import models\n'), ((130, 176), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(20)', 'db_index': '(True)'}),... |
from django.core.exceptions import ValidationError
from django.db import models
from django.utils.translation import ugettext_lazy as _
from .storage import USE_SCANNER
from .scanner import AVScanner
scanner = AVScanner()
def file_validator(f):
if USE_SCANNER:
has_virus, name = scanner.has_v... | [
"django.utils.translation.ugettext_lazy"
] | [((391, 436), 'django.utils.translation.ugettext_lazy', '_', (['"""In dieser Datei wurde ein Virus erkannt."""'], {}), "('In dieser Datei wurde ein Virus erkannt.')\n", (392, 436), True, 'from django.utils.translation import ugettext_lazy as _\n')] |
import os,pytest,sys
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
from page_objects.PageFactory import PageFactory
from conf import browser_os_name_conf
from conf import base_url_conf
from utils import post_test_reports_to_slack
from utils.email_pytest_report import Email_Pytest_Report
from utils import ... | [
"utils.post_test_reports_to_slack.post_reports_to_slack",
"utils.Tesults.post_results_to_tesults",
"page_objects.PageFactory.PageFactory.get_page_object",
"os.path.abspath",
"utils.email_pytest_report.Email_Pytest_Report",
"pytest.hookimpl"
] | [((11258, 11275), 'pytest.hookimpl', 'pytest.hookimpl', ([], {}), '()\n', (11273, 11275), False, 'import os, pytest, sys\n'), ((53, 78), 'os.path.abspath', 'os.path.abspath', (['__file__'], {}), '(__file__)\n', (68, 78), False, 'import os, pytest, sys\n'), ((622, 676), 'page_objects.PageFactory.PageFactory.get_page_obj... |
import pytest
import mease_elabftw
import test_ids
def test_get_metadata():
data = mease_elabftw.get_metadata(test_ids.valid_experiment)
assert len(data.keys()) == 9
start_time = data.get("ElectrodeGroup name")
assert start_time["value"] == "ElectrodeGroup"
description = data.get("Ecephys Device n... | [
"mease_elabftw.get_metadata",
"pytest.raises"
] | [((89, 142), 'mease_elabftw.get_metadata', 'mease_elabftw.get_metadata', (['test_ids.valid_experiment'], {}), '(test_ids.valid_experiment)\n', (115, 142), False, 'import mease_elabftw\n'), ((474, 498), 'pytest.raises', 'pytest.raises', (['Exception'], {}), '(Exception)\n', (487, 498), False, 'import pytest\n'), ((533, ... |
# TODO: Faire un test QUI MARCHE sur une des annales du hashcode
# TODO: Coder une solution algo genetique.
# TODO: Voir si splitter Problem en une seconde classe (Solver?) (qui gère parsing + output) est pas plus pratique. C'est surement plus lisible.
import glob
import os
import collections
import ntpath
from typin... | [
"collections.namedtuple",
"os.path.join",
"os.makedirs",
"ntpath.basename"
] | [((384, 412), 'os.path.join', 'os.path.join', (['""".."""', '"""inputs"""'], {}), "('..', 'inputs')\n", (396, 412), False, 'import os\n'), ((432, 461), 'os.path.join', 'os.path.join', (['""".."""', '"""outputs"""'], {}), "('..', 'outputs')\n", (444, 461), False, 'import os\n'), ((471, 506), 'collections.namedtuple', 'c... |
#!/usr/bin/python
# coding=utf-8
#
# Font build utility
#
import sys
import time
import os
import fontforge
import psMat
from tempfile import mkstemp
from fontTools.ttLib import TTFont
from fontTools.ttx import makeOutputFileName
import argparse
def flattenNestedReferences(font, ref, new_transform=(1, 0, 0, 1, 0, 0)... | [
"psMat.compose",
"os.path.exists",
"argparse.ArgumentParser",
"time.strftime",
"os.path.join",
"fontTools.ttx.makeOutputFileName",
"os.mkdir",
"os.path.basename",
"fontforge.open",
"fontTools.ttLib.TTFont",
"os.remove"
] | [((2663, 2685), 'fontforge.open', 'fontforge.open', (['infont'], {}), '(infont)\n', (2677, 2685), False, 'import fontforge\n'), ((2982, 3011), 'os.path.join', 'os.path.join', (['outdir', 'outfont'], {}), '(outdir, outfont)\n', (2994, 3011), False, 'import os\n'), ((3805, 3836), 'fontTools.ttLib.TTFont', 'TTFont', (['tm... |
from flask import current_app as app, Blueprint, request, abort
from hook.upstream import Github, Gitlab
from hook.utils import make_response, is_valid_request, LogMessage, is_ping
from logging import getLogger
bp_deploy = Blueprint('deploy', __name__)
@bp_deploy.route('/', methods=['POST'])
def deploy():
logger... | [
"logging.getLogger",
"hook.upstream.Gitlab",
"hook.utils.is_valid_request",
"hook.utils.make_response",
"hook.upstream.Github",
"hook.utils.is_ping",
"hook.utils.LogMessage",
"flask.abort",
"flask.Blueprint"
] | [((224, 253), 'flask.Blueprint', 'Blueprint', (['"""deploy"""', '__name__'], {}), "('deploy', __name__)\n", (233, 253), False, 'from flask import current_app as app, Blueprint, request, abort\n'), ((331, 351), 'logging.getLogger', 'getLogger', (['"""webhook"""'], {}), "('webhook')\n", (340, 351), False, 'from logging i... |
#!/usr/bin/env python3
"""Renaming and replacing files
"""
# end_pymotw_header
import glob
import os
with open("rename_start.txt", "w") as f:
f.write("starting as rename_start.txt")
print("Starting:", glob.glob("rename*.txt"))
os.rename("rename_start.txt", "rename_finish.txt")
print("After rename:", glob.glob... | [
"os.rename",
"os.unlink",
"glob.glob",
"os.replace"
] | [((236, 286), 'os.rename', 'os.rename', (['"""rename_start.txt"""', '"""rename_finish.txt"""'], {}), "('rename_start.txt', 'rename_finish.txt')\n", (245, 286), False, 'import os\n'), ((532, 590), 'os.replace', 'os.replace', (['"""rename_new_contents.txt"""', '"""rename_finish.txt"""'], {}), "('rename_new_contents.txt',... |
import os
from gitaccount.gitaccounthelpers.gitaccounthelpers import (
get_repos_from_url, clone, pull, already_cloned,
get_gists_from_url)
class GitAccount:
"""GitAccount class provides clone_repos and update_repos methods"""
def __init__(self, account_type, userName):
self._userName = userNa... | [
"gitaccount.gitaccounthelpers.gitaccounthelpers.already_cloned",
"os.path.join",
"os.path.abspath",
"os.chdir",
"os.mkdir",
"gitaccount.gitaccounthelpers.gitaccounthelpers.get_repos_from_url",
"gitaccount.gitaccounthelpers.gitaccounthelpers.clone",
"gitaccount.gitaccounthelpers.gitaccounthelpers.get_g... | [((699, 736), 'os.path.join', 'os.path.join', (['self._userName', '"""repos"""'], {}), "(self._userName, 'repos')\n", (711, 736), False, 'import os\n'), ((763, 800), 'os.path.join', 'os.path.join', (['self._userName', '"""gists"""'], {}), "(self._userName, 'gists')\n", (775, 800), False, 'import os\n'), ((1007, 1031), ... |
#
# Copyright 2017 Mirantis Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | [
"tempest.common.utils.services",
"tempest.lib.decorators.idempotent_id"
] | [((982, 1046), 'tempest.lib.decorators.idempotent_id', 'decorators.idempotent_id', (['"""defff515-a6ff-44f6-9d8d-2ded51196d98"""'], {}), "('defff515-a6ff-44f6-9d8d-2ded51196d98')\n", (1006, 1046), False, 'from tempest.lib import decorators\n'), ((1052, 1104), 'tempest.common.utils.services', 'utils.services', (['"""ima... |
from application import app
from flask import Response, request
import json
import logging
import traceback
from jsonschema import Draft4Validator
import random
name_schema = {
"type": "object",
"properties": {
"forenames": {
"type": "array",
"items": {"type": "string"},
... | [
"traceback.format_exc",
"jsonschema.Draft4Validator",
"random.randrange",
"json.dumps",
"application.app.route",
"flask.request.get_json",
"flask.Response",
"application.app.errorhandler",
"flask.request.__hash__",
"logging.info",
"logging.error"
] | [((2028, 2059), 'application.app.route', 'app.route', (['"""/"""'], {'methods': "['GET']"}), "('/', methods=['GET'])\n", (2037, 2059), False, 'from application import app\n'), ((2108, 2145), 'application.app.route', 'app.route', (['"""/health"""'], {'methods': "['GET']"}), "('/health', methods=['GET'])\n", (2117, 2145)... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import requests
from requests.auth import HTTPBasicAuth
import json
import matplotlib.pyplot as plt
import networkx as nx
import random
IP = '127.0.0.1'
PORT = '8080'
def retrieveTopology(ip, port, user='', password=''):
print ("Reading network-topology")
topologies... | [
"requests.auth.HTTPBasicAuth",
"networkx.Graph",
"matplotlib.pyplot.show",
"networkx.draw_networkx"
] | [((683, 693), 'networkx.Graph', 'nx.Graph', ([], {}), '()\n', (691, 693), True, 'import networkx as nx\n'), ((1146, 1173), 'networkx.draw_networkx', 'nx.draw_networkx', (['nwk_graph'], {}), '(nwk_graph)\n', (1162, 1173), True, 'import networkx as nx\n'), ((1282, 1292), 'matplotlib.pyplot.show', 'plt.show', ([], {}), '(... |
# -*- coding: utf-8 -*-
"""
-------------------------------------------------------------------------------
Authors: <NAME> | https://parshanpakiman.github.io/homepage/
<NAME> | https://selvan.people.uic.edu/
Licensing Information: The MIT License
----------------... | [
"utils.mean_confidence_interval",
"numpy.less_equal",
"utils.make_text_bold",
"numpy.zeros_like",
"numpy.empty",
"numpy.linalg.lstsq",
"numpy.nonzero",
"warnings.simplefilter",
"numpy.maximum",
"time.time",
"utils.output_handler_option_pricing"
] | [((649, 714), 'warnings.simplefilter', 'warnings.simplefilter', (['"""ignore"""'], {'category': 'NumbaDeprecationWarning'}), "('ignore', category=NumbaDeprecationWarning)\n", (670, 714), False, 'import warnings\n'), ((715, 787), 'warnings.simplefilter', 'warnings.simplefilter', (['"""ignore"""'], {'category': 'NumbaPen... |
import json
import dateutil.parser
from app import app, db
from flask import g
from datetime import date, datetime
from app.utils.testing import ApiTestCase
from app.responses.models import Response, Answer
from app.events.models import Event
from app.users.models import AppUser, Country, UserCategory
from app.applica... | [
"datetime.datetime",
"app.db.session.commit",
"json.loads",
"app.users.models.UserCategory",
"app.applicationModel.models.Question",
"app.responses.models.Response",
"app.responses.models.Answer",
"json.dumps",
"datetime.datetime.now",
"app.db.session.flush",
"app.app.app_context",
"app.users.... | [((413, 432), 'app.db.session.add', 'db.session.add', (['obj'], {}), '(obj)\n', (427, 432), False, 'from app import app, db\n'), ((437, 456), 'app.db.session.commit', 'db.session.commit', ([], {}), '()\n', (454, 456), False, 'from app import app, db\n'), ((1151, 1173), 'app.users.models.Country', 'Country', (['"""Indab... |
from os import getenv
from gevent import monkey; monkey.patch_all()
from flask import Flask
from huey import RedisHuey
DEBUG = getenv('DEBUG', True)
app = Flask(__name__)
app.config.from_object(__name__)
huey = RedisHuey('task-scheduler', host=getenv('REDIS_HOST'), always_eager=DEBUG)
huey.immediate = False
| [
"flask.Flask",
"os.getenv",
"gevent.monkey.patch_all"
] | [((50, 68), 'gevent.monkey.patch_all', 'monkey.patch_all', ([], {}), '()\n', (66, 68), False, 'from gevent import monkey\n'), ((130, 151), 'os.getenv', 'getenv', (['"""DEBUG"""', '(True)'], {}), "('DEBUG', True)\n", (136, 151), False, 'from os import getenv\n'), ((159, 174), 'flask.Flask', 'Flask', (['__name__'], {}), ... |
import logging
import os
import numpy as np
import pandas as pd
import sqlalchemy
from cached_property import cached_property
from scipy.interpolate import interp1d
from aqueduct.errors import Error
class RiskService(object):
def __init__(self, user_selections):
# DB Connection
self.engine = sql... | [
"pandas.Series",
"sqlalchemy.Table",
"os.getenv",
"numpy.flipud",
"numpy.where",
"scipy.interpolate.interp1d",
"numpy.append",
"sqlalchemy.MetaData",
"numpy.array",
"numpy.linspace",
"pandas.concat",
"pandas.melt",
"pandas.DataFrame",
"logging.info",
"numpy.atleast_1d"
] | [((393, 430), 'sqlalchemy.MetaData', 'sqlalchemy.MetaData', ([], {'bind': 'self.engine'}), '(bind=self.engine)\n', (412, 430), False, 'import sqlalchemy\n'), ((6995, 7027), 'logging.info', 'logging.info', (['"""[RISK]: lp_curve"""'], {}), "('[RISK]: lp_curve')\n", (7007, 7027), False, 'import logging\n'), ((9216, 9261)... |
import os
import cv2
import numpy as np
def blur(img, kSize=7):
return cv2.blur(img,(kSize,kSize)).astype(np.uint8)
def gauss(img, kSize=7):
return cv2.GaussianBlur(img, (kSize,kSize),0).astype(np.uint8)
def median(img, kSize=7):
return cv2.medianBlur(img, kSize).astype(np.uint8)
__all__ = ['blur,gauss... | [
"cv2.GaussianBlur",
"cv2.medianBlur",
"cv2.blur"
] | [((77, 106), 'cv2.blur', 'cv2.blur', (['img', '(kSize, kSize)'], {}), '(img, (kSize, kSize))\n', (85, 106), False, 'import cv2\n'), ((159, 199), 'cv2.GaussianBlur', 'cv2.GaussianBlur', (['img', '(kSize, kSize)', '(0)'], {}), '(img, (kSize, kSize), 0)\n', (175, 199), False, 'import cv2\n'), ((253, 279), 'cv2.medianBlur'... |
"""
All utils for model
"""
import hashlib
import logging
import os
import random
import string
from threading import Thread
from typing import Callable
from django.contrib.auth import get_user_model
from django.contrib.messages import add_message
from django.db import models, transaction, IntegrityError, Operatio... | [
"logging.getLogger",
"django.contrib.auth.get_user_model",
"random.choice",
"django.db.transaction.atomic",
"django_autoutils.exceptions.RequestException",
"rest_framework.exceptions.AuthenticationFailed",
"django.utils.translation.gettext_lazy",
"os.path.splitext",
"os.path.join",
"django_autouti... | [((575, 612), 'logging.getLogger', 'logging.getLogger', (['"""django_autoutils"""'], {}), "('django_autoutils')\n", (592, 612), False, 'import logging\n'), ((3716, 3742), 'os.path.splitext', 'os.path.splitext', (['filename'], {}), '(filename)\n', (3732, 3742), False, 'import os\n'), ((3936, 4031), 'os.path.join', 'os.p... |
"""Schefel26 1981 dataset tests.
Scientific Machine Learning Benchmark:
A benchmark of regression models in chem- and materials informatics.
(c) <NAME> 2020, Citrine Informatics.
"""
import pytest
import numpy as np
import smlb
def test_schwefel26_1981_examples():
"""Tests instantiating and evaluating Schwef... | [
"numpy.asfarray",
"datasets.synthetic.schwefel26_1981.schwefel26_1981.Schwefel261981Data",
"pytest.raises"
] | [((442, 474), 'datasets.synthetic.schwefel26_1981.schwefel26_1981.Schwefel261981Data', 'Schwefel261981Data', ([], {'dimensions': '(1)'}), '(dimensions=1)\n', (460, 474), False, 'from datasets.synthetic.schwefel26_1981.schwefel26_1981 import Schwefel261981Data\n'), ((484, 516), 'datasets.synthetic.schwefel26_1981.schwef... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
Starts from catalog.gatech.edu and attempts to read all degree
information into JSON format at once.
Could perhaps use a name more appropriate to its function.
Job of this module: get all relevant DOMs under their degrees/programs.
Comment: let users go through a chec... | [
"logging.getLogger",
"lxml.html.fromstring",
"requests.get",
"utils.get_hrefs",
"config.Statistics",
"requirements.get_reqs"
] | [((1106, 1132), 'logging.getLogger', 'logging.getLogger', (['"""gecho"""'], {}), "('gecho')\n", (1123, 1132), False, 'import logging\n'), ((1233, 1245), 'config.Statistics', 'Statistics', ([], {}), '()\n', (1243, 1245), False, 'from config import Statistics\n'), ((1261, 1300), 'requests.get', 'requests.get', (["(catalo... |