code stringlengths 20 1.04M | apis list | extract_api stringlengths 75 9.94M |
|---|---|---|
#!/usr/bin/env python
import json
import requests
import loginsightwebhookdemo
import conftest
def test_parse():
try:
loginsightwebhookdemo.parse({"abc": "123"})
except AttributeError:
assert True
else:
assert False
def test_parse_LI_MQ():
alert = loginsightwebhookdemo.par... | [
"loginsightwebhookdemo.parseLI",
"json.loads",
"conftest.client.post",
"conftest.client.get",
"loginsightwebhookdemo.callapi",
"loginsightwebhookdemo.parse"
] | [((8518, 8542), 'conftest.client.get', 'conftest.client.get', (['"""/"""'], {}), "('/')\n", (8537, 8542), False, 'import conftest\n'), ((8796, 8824), 'conftest.client.get', 'conftest.client.get', (['"""/test"""'], {}), "('/test')\n", (8815, 8824), False, 'import conftest\n'), ((8903, 8940), 'conftest.client.get', 'conf... |
# coding: utf-8
"""
ELEMENTS API
The version of the OpenAPI document: 2
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import six
from elements_sdk.configuration import Configuration
class Proxy(object):
"""NOTE: This class is auto generated by OpenAPI Gen... | [
"six.iteritems",
"elements_sdk.configuration.Configuration"
] | [((9529, 9562), 'six.iteritems', 'six.iteritems', (['self.openapi_types'], {}), '(self.openapi_types)\n', (9542, 9562), False, 'import six\n'), ((1785, 1800), 'elements_sdk.configuration.Configuration', 'Configuration', ([], {}), '()\n', (1798, 1800), False, 'from elements_sdk.configuration import Configuration\n')] |
from gi.repository import Gio
from gi.repository import GLib
from typing import NamedTuple
from .. import config
from ..dbus_utils import DBusServer, dict_to_vardict
from .kolibri_service import KolibriServiceManager
from .kolibri_search_handler import LocalSearchHandler
INACTIVITY_TIMEOUT_MS = 30 * 1000 # 30 sec... | [
"gi.repository.Gio.bus_unown_name",
"gi.repository.Gio.bus_watch_name_on_connection",
"gi.repository.Gio.Application.do_startup",
"gi.repository.GLib.source_remove",
"gi.repository.Gio.bus_get_finish",
"gi.repository.Gio.bus_get",
"gi.repository.GLib.VariantType",
"gi.repository.Gio.Application.do_shu... | [((4334, 4457), 'gi.repository.Gio.bus_watch_name_on_connection', 'Gio.bus_watch_name_on_connection', (['connection', 'name', 'Gio.BusNameWatcherFlags.NONE', 'None', 'self.__on_hold_client_vanished'], {}), '(connection, name, Gio.BusNameWatcherFlags.\n NONE, None, self.__on_hold_client_vanished)\n', (4366, 4457), Fa... |
def server(PORT=8000):
import http.server
import socketserver
Handler = http.server.SimpleHTTPRequestHandler
httpd = socketserver.TCPServer(("", PORT), Handler)
print("Server started at port", PORT)
httpd.serve_forever()
| [
"socketserver.TCPServer"
] | [((140, 183), 'socketserver.TCPServer', 'socketserver.TCPServer', (["('', PORT)", 'Handler'], {}), "(('', PORT), Handler)\n", (162, 183), False, 'import socketserver\n')] |
"""Callable classes for Containerized Processors.
Currently we don't offer functionalities to clean up the containers after the
program finishes. Use the following commands to clean up the containers started
by this module.
$ docker stop -t 0 $(docker ps -a -q --filter="name=GABRIELTOOL")
"""
import ast
import c... | [
"docker.from_env",
"io.BytesIO",
"os.path.abspath",
"os.getpid",
"tensorflow_serving.config.model_server_config_pb2.ModelServerConfig",
"cv2.cvtColor",
"copy.copy",
"logzero.logger.info",
"time.sleep",
"cv2.imread",
"google.protobuf.text_format.MessageToString",
"cv2.imencode",
"ast.literal_... | [((642, 659), 'docker.from_env', 'docker.from_env', ([], {}), '()\n', (657, 659), False, 'import docker\n'), ((12395, 12417), 'cv2.imread', 'cv2.imread', (['"""test.png"""'], {}), "('test.png')\n", (12405, 12417), False, 'import cv2\n'), ((4357, 4368), 'os.getpid', 'os.getpid', ([], {}), '()\n', (4366, 4368), False, 'i... |
import distutils.util
import os
import matplotlib.pyplot as plt
import numpy as np
def print_arguments(args):
print("----------- Configuration Arguments -----------")
for arg, value in sorted(vars(args).items()):
print("%s: %s" % (arg, value))
print("---------------------------------------------... | [
"matplotlib.pyplot.title",
"numpy.sum",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.gca",
"numpy.set_printoptions",
"numpy.meshgrid",
"matplotlib.pyplot.imshow",
"os.path.dirname",
"matplotlib.pyplot.yticks",
"matplotlib.pyplot.colorbar",
"numpy.max",
"matplotlib.pyplot.xticks",
"matplotl... | [((781, 817), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'figsize': '(12, 8)', 'dpi': '(100)'}), '(figsize=(12, 8), dpi=100)\n', (791, 817), True, 'import matplotlib.pyplot as plt\n'), ((822, 854), 'numpy.set_printoptions', 'np.set_printoptions', ([], {'precision': '(2)'}), '(precision=2)\n', (841, 854), True, 'im... |
try:
import _thread
except ImportError:
raise Exception(
'_thread does not exist. Are you sure you are using the correct version of micropython?')
try:
from ucollections import deque as _deque
except ImportError:
raise Exception(
'UCollections Deque does not exist. Are you sure you are ... | [
"utime.ticks_us",
"time.monotonic",
"ucollections.deque",
"itertools.islice"
] | [((1347, 1355), 'ucollections.deque', '_deque', ([], {}), '()\n', (1353, 1355), True, 'from ucollections import deque as _deque\n'), ((510, 520), 'utime.ticks_us', 'ticks_us', ([], {}), '()\n', (518, 520), False, 'from utime import ticks_us\n'), ((5345, 5368), 'itertools.islice', '_islice', (['all_waiters', 'n'], {}), ... |
import os
from subprocess import call
from colorama import init, Fore
init(autoreset = True)
def err(string):
print(Fore.RED + 'Error: ' + string)
def err_no_args(command):
err(f"Command `{command}` can't have 0 arguments")
def interpret_command(cmd):
cmd = cmd.split(' ')
command = cmd[0]
args = cmd[1:]
if... | [
"colorama.init",
"os.mkdir",
"os.remove",
"os.listdir",
"os.getcwd",
"os.path.exists",
"os.rmdir",
"os.chdir"
] | [((72, 92), 'colorama.init', 'init', ([], {'autoreset': '(True)'}), '(autoreset=True)\n', (76, 92), False, 'from colorama import init, Fore\n'), ((1196, 1207), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (1205, 1207), False, 'import os\n'), ((400, 417), 'os.chdir', 'os.chdir', (['args[0]'], {}), '(args[0])\n', (408, 41... |
#!/usr/bin/python
# Copyright (c) 2020, 2022 Oracle and/or its affiliates.
# This software is made available to you under the terms of the GPL 3.0 license or the Apache 2.0 license.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Apache License v2.0
# See LICENSE.TXT for d... | [
"ansible_collections.oracle.oci.plugins.module_utils.oci_common_utils.call_with_backoff",
"ansible_collections.oracle.oci.plugins.module_utils.oci_common_utils.list_all_resources",
"ansible_collections.oracle.oci.plugins.module_utils.oci_common_utils.get_common_arg_spec",
"ansible_collections.oracle.oci.plugi... | [((20536, 20579), 'ansible_collections.oracle.oci.plugins.module_utils.oci_resource_utils.get_custom_class', 'get_custom_class', (['"""OceInstanceHelperCustom"""'], {}), "('OceInstanceHelperCustom')\n", (20552, 20579), False, 'from ansible_collections.oracle.oci.plugins.module_utils.oci_resource_utils import OCIResourc... |
"""Fixtures and utilities for integration tests."""
import pytest
@pytest.fixture(scope="module")
def state():
"""Fixture instance to hold the (incremental) test state."""
class State:
pass
return State()
| [
"pytest.fixture"
] | [((71, 101), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""module"""'}), "(scope='module')\n", (85, 101), False, 'import pytest\n')] |
import pickle
import pandas as pd
from flask import Flask, request, Response
from rossmann.Rossmann import Rossmann
# loading model
model = pickle.load(open('C:/Users/felip/repos/data_science_em_producao/Model/model_rossmann.pkl', 'rb'))
# initialize API
app = Flask(__name__)
# Endpoint
@app.route('/rossmann/predict... | [
"pandas.DataFrame",
"rossmann.Rossmann.Rossmann",
"flask.Flask",
"flask.Response",
"flask.request.get_json"
] | [((263, 278), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (268, 278), False, 'from flask import Flask, request, Response\n'), ((383, 401), 'flask.request.get_json', 'request.get_json', ([], {}), '()\n', (399, 401), False, 'from flask import Flask, request, Response\n'), ((764, 774), 'rossmann.Rossmann.R... |
"""PyTorch trainer module.
- Author: <NAME>
- Contact: <EMAIL>
"""
from typing import Optional, Tuple, Union
import numpy as np
import torch
import torch.nn as nn
import torch.optim as optim
from torch.utils.data.dataloader import DataLoader
from torch.utils.data.sampler import SequentialSampler, SubsetRandomSampler... | [
"torch.no_grad",
"torch.max",
"numpy.random.shuffle",
"torch.device"
] | [((4233, 4248), 'torch.no_grad', 'torch.no_grad', ([], {}), '()\n', (4246, 4248), False, 'import torch\n'), ((1853, 1873), 'torch.device', 'torch.device', (['device'], {}), '(device)\n', (1865, 1873), False, 'import torch\n'), ((5024, 5047), 'torch.max', 'torch.max', (['model_out', '(1)'], {}), '(model_out, 1)\n', (503... |
from __future__ import print_function
import unittest
from const import PREFIX, USER
from bank import bank
bank = bank()
class TestBank(unittest.TestCase):
redis = bank.redis
username = 'foo'
password = '<PASSWORD>'
account_key = PREFIX['account'] + username
def test_signup(self):
if self.redis.exists(self.ac... | [
"bank.bank.deposit",
"bank.bank.login",
"unittest.TextTestRunner",
"unittest.TestSuite",
"bank.bank",
"bank.bank.balance",
"bank.bank.logout",
"bank.bank.transactions",
"bank.bank.signup",
"bank.bank.withdraw"
] | [((114, 120), 'bank.bank', 'bank', ([], {}), '()\n', (118, 120), False, 'from bank import bank\n'), ((1860, 1880), 'unittest.TestSuite', 'unittest.TestSuite', ([], {}), '()\n', (1878, 1880), False, 'import unittest\n'), ((390, 431), 'bank.bank.signup', 'bank.signup', (['self.username', 'self.password'], {}), '(self.use... |
# This file is Copyright 2020 Volatility Foundation and licensed under the Volatility Software License 1.0
# which is available at https://www.volatilityfoundation.org/license/vsl-v1.0
#
import base64
import json
import logging
import os
import pathlib
import zipfile
from typing import List, Type, Any, Generator
from ... | [
"volatility3.framework.configuration.requirements.ListRequirement",
"json.load",
"zipfile.ZipFile",
"volatility3.framework.renderers.NotAvailableValue",
"volatility3.framework.layers.resources.ResourceAccessor",
"os.path.basename",
"volatility3.framework.configuration.requirements.URIRequirement",
"os... | [((667, 694), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (684, 694), False, 'import logging\n'), ((1032, 1189), 'volatility3.framework.configuration.requirements.ListRequirement', 'requirements.ListRequirement', ([], {'name': '"""filter"""', 'description': '"""String that must be pres... |
#!/usr/bin/env python
import loginsightwebhookdemo
import loginsightwebhookdemo.bigpanda
import conftest
client = loginsightwebhookdemo.app.test_client()
TOKEN = 'a-b-c-d'
APPKEY = 'abc123'
def test_bigpanda_nourl():
loginsightwebhookdemo.bigpanda.bigpandaURL = ''
rsp = client.post('/endpoint/bigpanda'... | [
"loginsightwebhookdemo.app.test_client"
] | [((119, 158), 'loginsightwebhookdemo.app.test_client', 'loginsightwebhookdemo.app.test_client', ([], {}), '()\n', (156, 158), False, 'import loginsightwebhookdemo\n')] |
import matplotlib
import shapely.geometry
import numpy as np
from owl_augmentator.owl_augmentator import augment, augment_class, AugmentationType
import owlready2
from .utils import *
from shapely.geometry import Polygon, Point, LineString, MultiPolygon
from shapely import wkt
from matplotlib import pyplot as plt
_... | [
"shapely.geometry.Point",
"matplotlib.pyplot.show",
"shapely.geometry.Polygon",
"matplotlib.pyplot.plot",
"owl_augmentator.owl_augmentator.augment",
"matplotlib.pyplot.fill",
"matplotlib.pyplot.axis",
"shapely.geometry.LineString",
"numpy.arange",
"shapely.wkt.loads"
] | [((2011, 2080), 'numpy.arange', 'np.arange', (['(0)', '((max_angle - min_angle) % 360)', '_OCCLUSION_SAMPLING_STEP'], {}), '(0, (max_angle - min_angle) % 360, _OCCLUSION_SAMPLING_STEP)\n', (2020, 2080), True, 'import numpy as np\n'), ((5243, 5292), 'owl_augmentator.owl_augmentator.augment', 'augment', (['AugmentationTy... |
from ..models import User, AnonymousUser
from .. import app, db,login_manager
from . import main
from flask import request, make_response, jsonify
import json
from flask_login import logout_user, login_user,current_user,login_required
login_manager.login_view = 'main.login'
@main.route('/')
def index():
User_num =... | [
"flask.jsonify",
"flask_login.login_user",
"json.loads",
"flask_login.logout_user"
] | [((1895, 1908), 'flask_login.logout_user', 'logout_user', ([], {}), '()\n', (1906, 1908), False, 'from flask_login import logout_user, login_user, current_user, login_required\n'), ((1920, 1961), 'flask.jsonify', 'jsonify', (["{'message': 'logout successful'}"], {}), "({'message': 'logout successful'})\n", (1927, 1961)... |
import sys, os
from pathlib import Path
from copy import deepcopy, copy
import omnibelt as belt
from collections import defaultdict, OrderedDict
from omnibelt import save_yaml, load_yaml, get_printer
from .util import primitives, global_settings, configurize, pythonize, ConfigurizeFailed
from .errors impor... | [
"copy.deepcopy",
"omnibelt.save_yaml",
"copy.copy",
"pathlib.Path",
"collections.OrderedDict",
"omnibelt.get_printer"
] | [((406, 427), 'omnibelt.get_printer', 'get_printer', (['__name__'], {}), '(__name__)\n', (417, 427), False, 'from omnibelt import save_yaml, load_yaml, get_printer\n'), ((4569, 4579), 'copy.copy', 'copy', (['self'], {}), '(self)\n', (4573, 4579), False, 'from copy import deepcopy, copy\n'), ((30752, 30762), 'copy.copy'... |
import shutil
import time
from contextlib import redirect_stdout
from io import StringIO
from pathlib import Path
from tempfile import TemporaryDirectory
from threading import Thread
from typer.testing import CliRunner
from cc_server.main import CookiecutterServer, app
from tests import test_template_dir
runner = Cl... | [
"io.StringIO",
"tempfile.TemporaryDirectory",
"cc_server.main.CookiecutterServer",
"time.sleep",
"pathlib.Path",
"contextlib.redirect_stdout",
"shutil.copytree",
"typer.testing.CliRunner"
] | [((318, 329), 'typer.testing.CliRunner', 'CliRunner', ([], {}), '()\n', (327, 329), False, 'from typer.testing import CliRunner\n'), ((629, 649), 'tempfile.TemporaryDirectory', 'TemporaryDirectory', ([], {}), '()\n', (647, 649), False, 'from tempfile import TemporaryDirectory\n'), ((662, 672), 'io.StringIO', 'StringIO'... |
from finite_state_machine import StateMachine, transition
def is_approved_or_is_admin(machine, user):
return machine.num_approvals >= 1 or user.is_admin
class GitHubPullRequest(StateMachine):
"""State Machine to represent a GitHub Pull Request workflow"""
def __init__(self):
self.state = "opene... | [
"finite_state_machine.transition"
] | [((397, 441), 'finite_state_machine.transition', 'transition', ([], {'source': '"""opened"""', 'target': '"""opened"""'}), "(source='opened', target='opened')\n", (407, 441), False, 'from finite_state_machine import StateMachine, transition\n'), ((503, 547), 'finite_state_machine.transition', 'transition', ([], {'sourc... |
"Main Flask App"
# pylint: disable=import-outside-toplevel
from logging import Logger
from typing import List
from flask import Flask, jsonify, abort, request
from flask_accepts import accepts, responds
from flask_praetorian import Praetorian, auth_required, roles_required
from flask_restx import Api, Resource, Namesp... | [
"flask_restx.Api",
"flask_sqlalchemy.SQLAlchemy",
"flask_praetorian.Praetorian",
"flask.Flask"
] | [((430, 442), 'flask_sqlalchemy.SQLAlchemy', 'SQLAlchemy', ([], {}), '()\n', (440, 442), False, 'from flask_sqlalchemy import SQLAlchemy\n'), ((451, 463), 'flask_praetorian.Praetorian', 'Praetorian', ([], {}), '()\n', (461, 463), False, 'from flask_praetorian import Praetorian, auth_required, roles_required\n'), ((557,... |
from functools import wraps
from inspect import isawaitable
from sanic import Request
from sanic.exceptions import Unauthorized
from auth.access_token import check_access_token, get_token_from_request
def protected(maybe_func=None, *, arg1=None, arg2=None):
def decorator(f):
@wraps(f)
async def ... | [
"sanic.exceptions.Unauthorized",
"auth.access_token.get_token_from_request",
"inspect.isawaitable",
"functools.wraps",
"auth.access_token.check_access_token"
] | [((293, 301), 'functools.wraps', 'wraps', (['f'], {}), '(f)\n', (298, 301), False, 'from functools import wraps\n'), ((395, 426), 'auth.access_token.get_token_from_request', 'get_token_from_request', (['request'], {}), '(request)\n', (417, 426), False, 'from auth.access_token import check_access_token, get_token_from_r... |
#!/usr/local/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2007-2021. The YARA 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.or... | [
"unittest.main",
"yara.compile",
"os.remove",
"io.BytesIO",
"yara.load",
"tempfile.gettempdir",
"yara.set_config",
"tempfile.TemporaryFile",
"binascii.unhexlify",
"os.path.join",
"StringIO.StringIO"
] | [((818, 1562), 'binascii.unhexlify', 'binascii.unhexlify', (['"""4d5a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000504500004c0101005dbe45450000000000000000e00003010b01080004000000000000000000000060010000600100006401000000004000010000000100000... |
# Ported from LiquidMetal
# https://github.com/rmm5t/liquidmetal
SCORE_NO_MATCH = 0.0
SCORE_MATCH = 1.0
SCORE_TRAILING = 0.8
SCORE_TRAILING_BUT_STARTED = 0.9
SCORE_BUFFER = 0.85
WORD_SEPARATORS = ' \t_-'
def score(string, abbrev):
# short circuits
if len(string) < len(abbrev):
# string, abbrev = abbr... | [
"time.clock"
] | [((3237, 3244), 'time.clock', 'clock', ([], {}), '()\n', (3242, 3244), False, 'from time import clock\n'), ((3506, 3513), 'time.clock', 'clock', ([], {}), '()\n', (3511, 3513), False, 'from time import clock\n')] |
from __future__ import absolute_import
from Queue import Queue
from threading import Event
from time import sleep
from context import Model
def test_load_animation(oledcontroller):
message_queue = Queue(1)
cancellation_token = Event()
message_queue.put('Event 1')
t = oledcontroller.run_load_animation... | [
"context.Model.OLEDController",
"Queue.Queue",
"threading.Event",
"time.sleep"
] | [((203, 211), 'Queue.Queue', 'Queue', (['(1)'], {}), '(1)\n', (208, 211), False, 'from Queue import Queue\n'), ((237, 244), 'threading.Event', 'Event', ([], {}), '()\n', (242, 244), False, 'from threading import Event\n'), ((360, 368), 'time.sleep', 'sleep', (['(2)'], {}), '(2)\n', (365, 368), False, 'from time import ... |
import os, math, sys, re, fnmatch
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.colors as colors
from matplotlib import cm
from mpl_toolkits.axes_grid1 import make_axes_locatable
from mpl_toolkits.axes_grid1.inset_locator import inset_axes
import unwrap
import scipy.constants as constants
pl... | [
"fnmatch.filter",
"os.mkdir",
"os.path.join",
"math.atan2",
"os.path.isdir",
"os.walk",
"re.findall",
"matplotlib.pyplot.rcParams.update",
"os.path.splitext",
"numpy.array",
"os.path.expanduser"
] | [((318, 356), 'matplotlib.pyplot.rcParams.update', 'plt.rcParams.update', (["{'font.size': 14}"], {}), "({'font.size': 14})\n", (337, 356), True, 'import matplotlib.pyplot as plt\n'), ((385, 415), 'os.path.expanduser', 'os.path.expanduser', (['"""~/plots/"""'], {}), "('~/plots/')\n", (403, 415), False, 'import os, math... |
"""Create Figure 7a (top panel) of the paper"""
import PyOSE
import matplotlib.pyplot as plt
import matplotlib.cm as cm
from matplotlib import rc
from numpy import pi
# Set stellar parameters
StellarRadius = 0.7 * 696342. # km
limb1 = 0.5971
limb2 = 0.1172
# Set planet parameters
PlanetRadius = 6371 * 4.8
PlanetAx... | [
"matplotlib.pyplot.show",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.axes",
"matplotlib.pyplot.imshow",
"matplotlib.pyplot.axis",
"PyOSE.timeaxis",
"matplotlib.pyplot.rc",
"PyOSE.river",
"matplotlib.pyplot.tick_params",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"matplotlib.pypl... | [((1402, 1666), 'PyOSE.river', 'PyOSE.river', (['StellarRadius', 'limb1', 'limb2', 'PlanetRadius', 'PlanetAxis', 'PlanetImpact', 'PlanetPeriod', 'MoonRadius', 'MoonAxis', 'MoonEccentricity', 'MoonAscendingNode', 'MoonLongitudePeriastron', 'MoonInclination', 'ShowPlanetMoonEclipses', 'Quality', 'NumberOfSamples', 'Noise... |
#!/usr/bin/env python
from os.path import dirname, join
from tornado.httpserver import HTTPServer
from tornado.ioloop import IOLoop
from tornado.web import Application
from tornado.options import define, options, parse_command_line
from amgut import media_locale
from amgut.handlers.base_handlers import (
MainHa... | [
"tornado.options.parse_command_line",
"tornado.ioloop.IOLoop.instance",
"os.path.dirname",
"amgut.lib.startup_tests.startup_tests",
"tornado.options.define",
"os.path.join"
] | [((2476, 2544), 'tornado.options.define', 'define', (['"""port"""'], {'default': '(8888)', 'help': '"""run on the given port"""', 'type': 'int'}), "('port', default=8888, help='run on the given port', type=int)\n", (2482, 2544), False, 'from tornado.options import define, options, parse_command_line\n'), ((2557, 2574),... |
from yarl import URL
from flask import current_app
from . import models
try:
from .__version__ import __version__
except ImportError:
import subprocess
status, output = subprocess.getstatusoutput('git describe --tags')
if status == 0:
__version__ = output.strip()
else:
__version__ = ... | [
"subprocess.getstatusoutput"
] | [((181, 230), 'subprocess.getstatusoutput', 'subprocess.getstatusoutput', (['"""git describe --tags"""'], {}), "('git describe --tags')\n", (207, 230), False, 'import subprocess\n')] |
#!/usr/bin/env python
# coding: utf-8
from __future__ import with_statement, unicode_literals
import datetime
import glob
import io # For Python 2 compatibility
import os
import re
year = str(datetime.datetime.now().year)
for fn in glob.glob('*.html*'):
with io.open(fn, encoding='utf-8') as f:
content =... | [
"os.rename",
"datetime.datetime.now",
"io.open",
"glob.glob",
"re.sub"
] | [((236, 256), 'glob.glob', 'glob.glob', (['"""*.html*"""'], {}), "('*.html*')\n", (245, 256), False, 'import glob\n'), ((341, 443), 're.sub', 're.sub', (['"""(?P<copyright>Copyright © 2006-)(?P<year>[0-9]{4})"""', "('Copyright © 2006-' + year)", 'content'], {}), "('(?P<copyright>Copyright © 2006-)(?P<year>[0-9]{4})', \... |
from compiler.ast import *
import os
import AST
# This is just and istance of Mul to use when we group numerators and
# denominators
_EMPTY_MUL = Mul((None, None))
def dict2TeX(d, name_dict, lhs_form='%s', split_terms=False, simpleTeX=False):
lines = []
for lhs, rhs in d.items():
if split_terms:
... | [
"AST.strip_parse",
"AST._need_parens",
"AST._collect_num_denom",
"os.linesep.join",
"AST._collect_pos_neg"
] | [((1383, 1405), 'os.linesep.join', 'os.linesep.join', (['lines'], {}), '(lines)\n', (1398, 1405), False, 'import os\n'), ((2126, 2147), 'AST.strip_parse', 'AST.strip_parse', (['expr'], {}), '(expr)\n', (2141, 2147), False, 'import AST\n'), ((4986, 5022), 'AST._need_parens', 'AST._need_parens', (['outer', 'ast', 'adjust... |
# -*- coding: utf-8 -*-
# Copyright (c) 2015 Ericsson AB
#
# 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 ... | [
"calvin.actor.actor.ActionResult",
"calvin.actor.actor.guard",
"calvin.actor.actor.manage",
"calvin.actor.actor.condition"
] | [((897, 922), 'calvin.actor.actor.manage', 'manage', ([], {'exclude': "['timer']"}), "(exclude=['timer'])\n", (903, 922), False, 'from calvin.actor.actor import Actor, ActionResult, manage, condition, guard\n'), ((1961, 1998), 'calvin.actor.actor.condition', 'condition', ([], {'action_output': "('integer',)"}), "(actio... |
import torch
import torch.nn as nn
import torch.nn.functional as F
# =============================
# Networks
# =============================
class ERFANet(nn.Module):
# Effective Receptive Attention Network
def __init__(self, in_ch, width, class_no, attention_type, dilation, mode='all', identity_add=True)... | [
"torch.nn.ReLU",
"torch.nn.Conv2d",
"torch.cat",
"torch.nn.InstanceNorm2d",
"torch.nn.Sigmoid",
"torch.nn.Upsample",
"torch.nn.functional.pad"
] | [((3415, 3479), 'torch.nn.Upsample', 'nn.Upsample', ([], {'scale_factor': '(2)', 'mode': '"""bilinear"""', 'align_corners': '(True)'}), "(scale_factor=2, mode='bilinear', align_corners=True)\n", (3426, 3479), True, 'import torch.nn as nn\n'), ((3505, 3552), 'torch.nn.Conv2d', 'nn.Conv2d', (['self.w1', 'self.final_in', ... |
"""Simple Kalman filter implementation for single-channel feed"""
from math import fabs
class KalmanFilter:
"""Simple Kalman filter for single values."""
def __init__(self, measurement_uncertainty, q=0.01, estimation_uncertainty=None) -> None:
"""Initialize the filter.
The initial estimation... | [
"math.fabs"
] | [((1462, 1505), 'math.fabs', 'fabs', (['(self.last_estimate - current_estimate)'], {}), '(self.last_estimate - current_estimate)\n', (1466, 1505), False, 'from math import fabs\n')] |
from datetime import datetime
from marshmallow import Schema, fields
class EventSchema(Schema):
event_type_name = fields.Str()
occurred_on = fields.DateTime()
class EventMessage:
# A constant that subscriber can use in their "listens_to" events to
# tell they are interested in all the events that ... | [
"marshmallow.fields.Str",
"marshmallow.fields.DateTime",
"datetime.datetime.now"
] | [((121, 133), 'marshmallow.fields.Str', 'fields.Str', ([], {}), '()\n', (131, 133), False, 'from marshmallow import Schema, fields\n'), ((152, 169), 'marshmallow.fields.DateTime', 'fields.DateTime', ([], {}), '()\n', (167, 169), False, 'from marshmallow import Schema, fields\n'), ((427, 441), 'datetime.datetime.now', '... |
##
# 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 the... | [
"pandas.DataFrame",
"pycylon.Table.from_list",
"numpy.full",
"os.path.exists",
"pycylon.net.MPIConfig",
"pycylon.io.read_csv",
"pycylon.Table.concat",
"pycylon.io.CSVReadOptions",
"numpy.array",
"pycylon.Table.from_pandas",
"pycylon.CylonContext",
"pandas.concat",
"pycylon.Table.from_pydict"... | [((1554, 1598), 'pycylon.CylonContext', 'CylonContext', ([], {'config': 'None', 'distributed': '(False)'}), '(config=None, distributed=False)\n', (1566, 1598), False, 'from pycylon import CylonContext\n'), ((1858, 1902), 'pycylon.io.read_csv', 'read_csv', (['ctx', 'table1_path', 'csv_read_options'], {}), '(ctx, table1_... |
from django.db import models
from django.contrib.auth.base_user import BaseUserManager
from django.contrib.auth.models import AbstractUser
from django.db.models.signals import post_delete, post_save
from .signals import delete_profile_pic, resize_profile_pic
class CustomUserManager(BaseUserManager):
"""
Cust... | [
"django.db.models.signals.post_delete.connect",
"django.db.models.OneToOneField",
"django.db.models.URLField",
"django.db.models.CharField",
"django.db.models.EmailField",
"django.db.models.ImageField",
"django.db.models.DateField",
"django.db.models.signals.post_save.connect"
] | [((2924, 2977), 'django.db.models.signals.post_save.connect', 'post_save.connect', (['resize_profile_pic'], {'sender': 'Profile'}), '(resize_profile_pic, sender=Profile)\n', (2941, 2977), False, 'from django.db.models.signals import post_delete, post_save\n'), ((2978, 3033), 'django.db.models.signals.post_delete.connec... |
import unittest
from fastest.type.type_usage_patterns import used_as_int
from fastest.type.type_usage_patterns import used_as_str
from fastest.type.type_usage_patterns import used_as_iterable
from fastest.type.type_usage_patterns import used_as_list
from fastest.type.type_usage_patterns import used_as_tuple
from faste... | [
"fastest.type.type_usage_patterns.used_as_tuple",
"fastest.type.type_usage_patterns.used_as_list",
"fastest.type.type_usage_patterns.used_as_iterable",
"fastest.type.type_usage_patterns.used_as_str",
"fastest.type.type_usage_patterns.used_as_int",
"fastest.type.type_usage_patterns.used_as_dict"
] | [((503, 528), 'fastest.type.type_usage_patterns.used_as_int', 'used_as_int', (['"""a = 4"""', '"""a"""'], {}), "('a = 4', 'a')\n", (514, 528), False, 'from fastest.type.type_usage_patterns import used_as_int\n'), ((604, 629), 'fastest.type.type_usage_patterns.used_as_int', 'used_as_int', (['"""a + 4"""', '"""a"""'], {}... |
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
import torch
import torch.nn.functional as F
from torch import nn
from maskrcnn_benchmark.structures.bounding_box_3d import BoxList3D
from maskrcnn_benchmark.structures.boxlist_ops_3d import boxlist_nms_3d
from maskrcnn_benchmark.structures.boxlis... | [
"maskrcnn_benchmark.modeling.box_coder_3d.BoxCoder3D",
"torch.nonzero",
"torch.cat",
"torch.full",
"torch.nn.functional.softmax",
"maskrcnn_benchmark.structures.boxlist_ops_3d.cat_boxlist_3d",
"maskrcnn_benchmark.structures.bounding_box_3d.BoxList3D",
"pdb.set_trace",
"maskrcnn_benchmark.structures.... | [((6445, 6481), 'maskrcnn_benchmark.modeling.box_coder_3d.BoxCoder3D', 'BoxCoder3D', ([], {'weights': 'bbox_reg_weights'}), '(weights=bbox_reg_weights)\n', (6455, 6481), False, 'from maskrcnn_benchmark.modeling.box_coder_3d import BoxCoder3D\n'), ((1868, 1895), 'torch.nn.functional.softmax', 'F.softmax', (['class_logit... |
import abc
import argparse
import logging
import sys
from typing import TYPE_CHECKING
from uroboros import errors
from uroboros import utils
from uroboros.constants import ExitStatus
if TYPE_CHECKING:
from typing import List, Dict, Optional, Union, Set
from uroboros.option import Option
CommandDict = Dict... | [
"uroboros.utils.call_one_by_one",
"uroboros.utils.get_args_section_name",
"uroboros.errors.CommandDuplicateError",
"uroboros.errors.CommandNotRegisteredError",
"uroboros.constants.ExitStatus",
"uroboros.utils.get_args_command_name",
"logging.getLogger"
] | [((448, 475), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (465, 475), False, 'import logging\n'), ((4429, 4469), 'uroboros.utils.get_args_command_name', 'utils.get_args_command_name', (['self._layer'], {}), '(self._layer)\n', (4456, 4469), False, 'from uroboros import utils\n'), ((1026... |
import csv
import csv
from Bio import SeqIO
prokka_fasta = "$HOME/Bioinformatics_data/lferriphilum/analysis/DNA/04_genome_annotation/prokka/20_LFerr_genome_assembly_final/LFerr.ffn"
eggNOG_ann = "$HOME/Bioinformatics_data/lferriphilum/analysis/DNA/04_genome_annotation/eggNOG-mapper/LFerr.ffn.emapper.annotations"
outpu... | [
"csv.reader",
"Bio.SeqIO.write",
"Bio.SeqIO.parse"
] | [((744, 778), 'Bio.SeqIO.parse', 'SeqIO.parse', (['prokka_fasta', '"""fasta"""'], {}), "(prokka_fasta, 'fasta')\n", (755, 778), False, 'from Bio import SeqIO\n'), ((519, 554), 'csv.reader', 'csv.reader', (['csvfile'], {'delimiter': '"""\t"""'}), "(csvfile, delimiter='\\t')\n", (529, 554), False, 'import csv\n'), ((1187... |
# 3. Supermarket
# Write a program which reads an input consisting of a name and adds it to a queue until "End" is received.
# If you receive "Paid", print every customer's name, and empty the queue.
# Otherwise, you will receive a client and you should add them to the queue.
# When you receive "End", you must print th... | [
"collections.deque"
] | [((470, 477), 'collections.deque', 'deque', ([], {}), '()\n', (475, 477), False, 'from collections import deque\n')] |
from honeybee_schema.model import Model
from honeybee_schema.energy.properties import ModelEnergyProperties
import os
# target folder where all of the samples live
root = os.path.dirname(os.path.dirname(__file__))
target_folder = os.path.join(root, 'samples', 'model')
target_folder_large = os.path.join(root, 'samples'... | [
"honeybee_schema.model.Model.parse_file",
"os.path.dirname",
"honeybee_schema.energy.properties.ModelEnergyProperties.parse_file",
"os.path.join"
] | [((231, 269), 'os.path.join', 'os.path.join', (['root', '"""samples"""', '"""model"""'], {}), "(root, 'samples', 'model')\n", (243, 269), False, 'import os\n'), ((292, 336), 'os.path.join', 'os.path.join', (['root', '"""samples"""', '"""model_large"""'], {}), "(root, 'samples', 'model_large')\n", (304, 336), False, 'im... |
from PyDigger.common import remove_db
remove_db()
| [
"PyDigger.common.remove_db"
] | [((38, 49), 'PyDigger.common.remove_db', 'remove_db', ([], {}), '()\n', (47, 49), False, 'from PyDigger.common import remove_db\n')] |
from __future__ import print_function
import logging
import os.path
import sys
from argparse import ArgumentParser
from esolang import INTERPRETERS
def list_languages():
print("Available languages:")
for cls in INTERPRETERS:
print(" - %s (%s)" % (cls.lang, cls.ext))
def select_interpreter(filenam... | [
"sys.exit",
"argparse.ArgumentParser",
"logging.basicConfig"
] | [((1327, 1404), 'argparse.ArgumentParser', 'ArgumentParser', ([], {'description': '"""Run esoteric programming language source files."""'}), "(description='Run esoteric programming language source files.')\n", (1341, 1404), False, 'from argparse import ArgumentParser\n'), ((2217, 2257), 'logging.basicConfig', 'logging.... |
import logging
import uuid
import base64
from urllib.parse import urlencode
import os
import requests
from django.http import HttpResponse, Http404, HttpResponseBadRequest, HttpResponseRedirect
from django.views.generic import TemplateView
from django.contrib.auth import logout
from django.contrib import messages
fro... | [
"uuid.uuid4",
"urllib.parse.urlencode",
"django.http.HttpResponseBadRequest",
"django.contrib.auth.logout",
"django.http.HttpResponseRedirect",
"logging.getLogger"
] | [((347, 374), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (364, 374), False, 'import logging\n'), ((4363, 4378), 'django.contrib.auth.logout', 'logout', (['request'], {}), '(request)\n', (4369, 4378), False, 'from django.contrib.auth import logout\n'), ((3866, 3896), 'django.http.HttpR... |
from __future__ import print_function
import shutil
import struct
import tempfile
import unittest
import os
from manticore.core.plugin import Plugin
from manticore.core.smtlib import ConstraintSet, operators
from manticore.core.smtlib.expression import BitVec
from manticore.core.smtlib import solver
from manticore.cor... | [
"manticore.utils.log.init_logging",
"manticore.ethereum.ABI.parse",
"manticore.core.smtlib.expression.BitVec",
"manticore.ethereum.ABI.serialize_uint",
"shutil.rmtree",
"os.path.join",
"manticore.platforms.evm.Return",
"manticore.core.smtlib.ConstraintSet",
"os.path.abspath",
"manticore.platforms.... | [((838, 852), 'manticore.utils.log.init_logging', 'init_logging', ([], {}), '()\n', (850, 852), False, 'from manticore.utils.log import init_logging\n'), ((690, 715), 'os.path.abspath', 'os.path.abspath', (['__file__'], {}), '(__file__)\n', (705, 715), False, 'import os\n'), ((890, 905), 'manticore.core.smtlib.Constrai... |
# Generated by Django 3.2.4 on 2021-10-27 13:10
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("oidc", "0002_eauthorizationprofile"),
]
operations = [
migrations.RemoveField(
model_name="oidcprofile",
name="user",
... | [
"django.db.migrations.RemoveField",
"django.db.migrations.DeleteModel"
] | [((227, 288), 'django.db.migrations.RemoveField', 'migrations.RemoveField', ([], {'model_name': '"""oidcprofile"""', 'name': '"""user"""'}), "(model_name='oidcprofile', name='user')\n", (249, 288), False, 'from django.db import migrations\n'), ((333, 385), 'django.db.migrations.DeleteModel', 'migrations.DeleteModel', (... |
# Helper function to read in tables from the annotations
# from bs4 import BeautifulSoup as bs
from html import escape
def format_html(img):
''' Formats HTML code from tokenized annotation of img
'''
html_code = img['html']['structure']['tokens'].copy()
to_insert = [i for i, tag in enumerate(html_code)... | [
"html.escape"
] | [((462, 475), 'html.escape', 'escape', (['token'], {}), '(token)\n', (468, 475), False, 'from html import escape\n')] |
import numpy
from numpy.testing import assert_equal, assert_almost_equal
class Toroid(object):
def __init__(self, coeff=None):
self.r_maj = 1e10 # initialize as plane
self.r_min = 1e10 # initialize as plane
if coeff is not None:
self.coeff = coeff.copy()
else:
... | [
"numpy.roots",
"numpy.zeros_like",
"numpy.ones_like",
"numpy.zeros",
"numpy.array",
"numpy.cos",
"numpy.sqrt"
] | [((3542, 3599), 'numpy.sqrt', 'numpy.sqrt', (['(v2[0, :] ** 2 + v2[1, :] ** 2 + v2[2, :] ** 2)'], {}), '(v2[0, :] ** 2 + v2[1, :] ** 2 + v2[2, :] ** 2)\n', (3552, 3599), False, 'import numpy\n'), ((3783, 3803), 'numpy.zeros_like', 'numpy.zeros_like', (['x2'], {}), '(x2)\n', (3799, 3803), False, 'import numpy\n'), ((568... |
#! /usr/bin/env python
#
# GUI module generated by PAGE version 4.2
# In conjunction with Tcl version 8.6
# Jan. 27, 2014 12:16:35 AM
import sys
try:
from Tkinter import *
except ImportError:
from tkinter import *
try:
import ttk
py3 = 0
except ImportError:
import tkinter.ttk as ttk
py3 = 1... | [
"tkinter.ttk.Panedwindow",
"tkinter.ttk.Labelframe",
"complex_support.set_Tk_var",
"tkinter.ttk.Style",
"complex_support.init",
"tkinter.ttk.Frame",
"tkinter.ttk.Sizegrip",
"tkinter.ttk.Notebook"
] | [((539, 567), 'complex_support.set_Tk_var', 'complex_support.set_Tk_var', ([], {}), '()\n', (565, 567), False, 'import complex_support\n'), ((621, 650), 'complex_support.init', 'complex_support.init', (['root', 'w'], {}), '(root, w)\n', (641, 650), False, 'import complex_support\n'), ((898, 926), 'complex_support.set_T... |
from bs4 import BeautifulSoup
class PrettifyMiddleware(object):
def process_response(self, request, response):
if response.status_code == 200:
if response["content-type"].startswith("text/html"):
beauty = BeautifulSoup(response.content)
response.content = beauty.... | [
"bs4.BeautifulSoup"
] | [((246, 277), 'bs4.BeautifulSoup', 'BeautifulSoup', (['response.content'], {}), '(response.content)\n', (259, 277), False, 'from bs4 import BeautifulSoup\n')] |
import os
import string
try:
import pegtree as pg
except ModuleNotFoundError:
os.system('pip install pegtree')
import pegtree as pg
_PEG = '''
Start = {
(Param / { (!Param .)* } )*
}
Param = LQuote / Quote / DoubleQuote / BackQuote
/ Data / FuncName / MaybeName / CellName/ VarName
/ Cla... | [
"os.path.abspath",
"os.path.exists",
"os.system",
"pegtree.grammar"
] | [((1560, 1576), 'pegtree.grammar', 'pg.grammar', (['_PEG'], {}), '(_PEG)\n', (1570, 1576), True, 'import pegtree as pg\n'), ((87, 119), 'os.system', 'os.system', (['"""pip install pegtree"""'], {}), "('pip install pegtree')\n", (96, 119), False, 'import os\n'), ((2827, 2852), 'os.path.abspath', 'os.path.abspath', (['__... |
"""
Methods for loading data sets.
"""
# -----------------------------------------------------------------------------
# IMPORTS
# -----------------------------------------------------------------------------
from pathlib import Path
from typing import Any, Dict, Optional, Tuple, Union
from astropy.units import Quan... | [
"hsr4hci.observing_conditions.ObservingConditions",
"h5py.File",
"astropy.units.Quantity",
"hsr4hci.config.get_datasets_dir",
"pathlib.Path",
"numpy.array",
"hsr4hci.general.prestack_array"
] | [((3399, 3459), 'hsr4hci.general.prestack_array', 'prestack_array', ([], {'array': 'parang', 'stacking_factor': 'binning_factor'}), '(array=parang, stacking_factor=binning_factor)\n', (3413, 3459), False, 'from hsr4hci.general import prestack_array\n'), ((5930, 5972), 'hsr4hci.observing_conditions.ObservingConditions',... |
import inspect
import factory
from pytest_factoryboy import register
from rgd_testing_utils import factories as tfactories
from rgd_testing_utils.data_fixtures import * # noqa
from . import factories
for _, fac in inspect.getmembers(tfactories):
if inspect.isclass(fac) and issubclass(fac, factory.Factory):
... | [
"inspect.isclass",
"pytest_factoryboy.register",
"inspect.getmembers"
] | [((218, 248), 'inspect.getmembers', 'inspect.getmembers', (['tfactories'], {}), '(tfactories)\n', (236, 248), False, 'import inspect\n'), ((353, 382), 'inspect.getmembers', 'inspect.getmembers', (['factories'], {}), '(factories)\n', (371, 382), False, 'import inspect\n'), ((257, 277), 'inspect.isclass', 'inspect.isclas... |
# -*- coding: utf-8 -*-
from collections import OrderedDict
from pyshield import CONST
LINE_LENGTH = 50
KW_COLUMN_LENGTH = 20
DOC_STRINGS = \
((CONST.SOURCES, 'Specify a yaml file containing the information of the present sources.'),
(CONST.SHIELDING, 'Specify a yaml file containing the inform... | [
"collections.OrderedDict"
] | [((4361, 4385), 'collections.OrderedDict', 'OrderedDict', (['DOC_STRINGS'], {}), '(DOC_STRINGS)\n', (4372, 4385), False, 'from collections import OrderedDict\n')] |
from itertools import zip_longest
from gi.repository import Gtk, Gdk, Gio, GdkPixbuf
from ocrd_models import OcrdFile
from pkg_resources import resource_filename
from typing import List, Any, Optional
from numpy import array as ndarray
from .scandriver import DummyDriver, AndroidADBDriver, AbstractScanDriver, PageWar... | [
"gi.repository.Gtk.Box.__init__",
"gi.repository.Gtk.Template.Child",
"itertools.zip_longest",
"gi.repository.Gtk.Template.Callback",
"pkg_resources.resource_filename",
"ocrd_browser.util.image.cv_scale",
"ocrd_browser.util.image.cv_to_pixbuf"
] | [((5189, 5209), 'gi.repository.Gtk.Template.Child', 'Gtk.Template.Child', ([], {}), '()\n', (5207, 5209), False, 'from gi.repository import Gtk, Gdk, Gio, GdkPixbuf\n'), ((5242, 5262), 'gi.repository.Gtk.Template.Child', 'Gtk.Template.Child', ([], {}), '()\n', (5260, 5262), False, 'from gi.repository import Gtk, Gdk, G... |
# -------------------------------------------------------------------------
#
# Part of the CodeChecker project, under the Apache License v2.0 with
# LLVM Exceptions. See LICENSE for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
#
# ---------------------------------------------------... | [
"libtest.env.parts_to_url",
"libtest.env.test_env",
"libtest.env.import_test_cfg",
"libtest.codechecker.check_and_store",
"logging.debug",
"libtest.env.setup_viewer_client",
"libtest.env.setup_test_proj_cfg",
"libtest.thrift_client_to_db.get_all_run_results",
"libtest.env.get_run_names",
"os.path.... | [((1512, 1557), 'libtest.env.setup_test_proj_cfg', 'env.setup_test_proj_cfg', (['self._test_workspace'], {}), '(self._test_workspace)\n', (1535, 1557), False, 'from libtest import env\n'), ((1712, 1757), 'libtest.env.setup_viewer_client', 'env.setup_viewer_client', (['self._test_workspace'], {}), '(self._test_workspace... |
# -*- coding: utf-8 -*-
"""
Showcases *Hunt* colour appearance model computations.
"""
import numpy as np
import colour
from colour.appearance.hunt import CAM_ReferenceSpecification_Hunt
from colour.utilities import message_box
message_box('"Hunt" Colour Appearance Model Computations')
XYZ = np.array([19.01, 20.00,... | [
"colour.utilities.message_box",
"colour.appearance.hunt.CAM_ReferenceSpecification_Hunt",
"numpy.array",
"colour.XYZ_to_Hunt"
] | [((231, 289), 'colour.utilities.message_box', 'message_box', (['""""Hunt" Colour Appearance Model Computations"""'], {}), '(\'"Hunt" Colour Appearance Model Computations\')\n', (242, 289), False, 'from colour.utilities import message_box\n'), ((297, 327), 'numpy.array', 'np.array', (['[19.01, 20.0, 21.78]'], {}), '([19... |
import os
import pandas as pd
from ms2pip.ms2pipC import MS2PIP
TEST_DIR = os.path.dirname(__file__)
def run_ms2pip():
"""Run ms2pipC to predict peak intensities from a PEPREC file (HCD model). """
params = {
"ms2pip": {
"ptm": [
"Oxidation,15.994915,opt,M",
... | [
"os.path.dirname",
"os.path.join"
] | [((79, 104), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (94, 104), False, 'import os\n'), ((602, 649), 'os.path.join', 'os.path.join', (['TEST_DIR', '"""test_data/test.peprec"""'], {}), "(TEST_DIR, 'test_data/test.peprec')\n", (614, 649), False, 'import os\n'), ((721, 785), 'os.path.join'... |
"""
This file implements the code used to generate figures for the paper.
When imported, the figures and tables are saved to files. When run as a
script, they are displayed as Matplotlib interactive figures and
terminal output, respectively.
"""
from itertools import chain, repeat, starmap
from os import makedirs
fro... | [
"matplotlib.rc",
"numpy.arctan2",
"skg.gauss_pdf_fit.model",
"numpy.isnan",
"numpy.histogram",
"numpy.sin",
"numpy.arange",
"numpy.exp",
"scipy.linalg.lstsq",
"numpy.random.normal",
"numpy.interp",
"os.path.isfile",
"numpy.copysign",
"numpy.round",
"os.path.join",
"numpy.sqrt",
"nump... | [((7189, 7212), 'matplotlib.rc', 'rc', (['"""text"""'], {'usetex': '(True)'}), "('text', usetex=True)\n", (7191, 7212), False, 'from matplotlib import rc, cycler\n'), ((7213, 7223), 'matplotlib.pyplot.ioff', 'plt.ioff', ([], {}), '()\n', (7221, 7223), True, 'from matplotlib import pyplot as plt\n'), ((1907, 1936), 'mat... |
# -*- coding: utf-8 -*-
"""Main module."""
from typing import Dict, Optional, Tuple, Union, List
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.distributions import Normal, Bernoulli, kl_divergence as kl
from scvi.models.distributions import ZeroInflatedNegativeBinomial, NegativeBinomia... | [
"torch.ones_like",
"torch.ones",
"scvi.models.modules.EncoderTOTALVI",
"torch.distributions.Bernoulli",
"torch.unique",
"torch.zeros_like",
"scvi.models.distributions.NegativeBinomial",
"torch.sqrt",
"scvi.models.utils.one_hot",
"scvi.models.log_likelihood.log_mixture_nb",
"scvi.models.modules.D... | [((5369, 5610), 'scvi.models.modules.EncoderTOTALVI', 'EncoderTOTALVI', (['(n_input_genes + self.n_input_proteins)', 'n_latent'], {'n_layers': 'n_layers_encoder', 'n_cat_list': '([n_batch] if encoder_batch else None)', 'n_hidden': 'n_hidden', 'dropout_rate': 'dropout_rate_encoder', 'distribution': 'latent_distribution'... |
import os
import json
import numpy as np
import pandas as pd
from spylunking.log.setup_logging import console_logger
from celery_connectors.utils import ev
from network_pipeline.consts import VALID
from network_pipeline.consts import INVALID
from network_pipeline.consts import ERROR
from sklearn.model_selection import ... | [
"celery_connectors.utils.ev",
"numpy.random.seed",
"pandas.read_csv",
"spylunking.log.setup_logging.console_logger",
"sklearn.model_selection.train_test_split",
"os.path.exists"
] | [((345, 390), 'spylunking.log.setup_logging.console_logger', 'console_logger', ([], {'name': '"""build_training_request"""'}), "(name='build_training_request')\n", (359, 390), False, 'from spylunking.log.setup_logging import console_logger\n'), ((443, 490), 'celery_connectors.utils.ev', 'ev', (['"""CSV_FILE"""', '"""/t... |
"""
Provide functions for tracking and saving
annotations that have been accepted already.
"""
import json
import dictdiffer
from IPython.display import HTML, display
from pathlib import Path
def load_style():
"""Load styles for BHSA divs."""
display(HTML(Path('bhsa.css').read_text()))
class Tracker:
de... | [
"dictdiffer.diff",
"json.dump",
"json.load",
"pathlib.Path",
"IPython.display.HTML"
] | [((542, 559), 'json.load', 'json.load', (['infile'], {}), '(infile)\n', (551, 559), False, 'import json\n'), ((628, 645), 'json.load', 'json.load', (['infile'], {}), '(infile)\n', (637, 645), False, 'import json\n'), ((866, 900), 'dictdiffer.diff', 'dictdiffer.diff', (['orig_parse', 'parse'], {}), '(orig_parse, parse)\... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
The files should be layouted as following:
- All generated CSV files should be placed somewhere within the 'Output' folder
- Every set of CSV files that belong to one Tester should be placed in a separate subfolder
for example, if a user Ahmet ran the simul... | [
"datetime.datetime.now",
"os.path.join",
"os.makedirs",
"os.path.exists"
] | [((2643, 2680), 'os.path.join', 'os.path.join', (['OUTPUT_FOLDER', 'filename'], {}), '(OUTPUT_FOLDER, filename)\n', (2655, 2680), False, 'import os\n'), ((2562, 2591), 'os.path.exists', 'os.path.exists', (['OUTPUT_FOLDER'], {}), '(OUTPUT_FOLDER)\n', (2576, 2591), False, 'import os\n'), ((2601, 2627), 'os.makedirs', 'os... |
# Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
"""
Classes used to define a grid search.
`Launcher`: a launcher is passed to each grid search explore function,
and can b... | [
"dataclasses.field",
"copy.deepcopy",
"treetable.leaf"
] | [((1268, 1302), 'dataclasses.field', 'field', ([], {'default_factory': 'OrderedDict'}), '(default_factory=OrderedDict)\n', (1273, 1302), False, 'from dataclasses import dataclass, field\n'), ((1350, 1377), 'dataclasses.field', 'field', ([], {'default_factory': 'dict'}), '(default_factory=dict)\n', (1355, 1377), False, ... |
# -*- coding: utf-8 -*-
from datetime import datetime
from time import mktime
import feedparser
import re
class RSSEngine(object):
IMG_TYPE_REGEXP = re.compile('image|img', re.I)
def __init__(self, config):
self.config = config
def process(self, url):
d = feedparser.parse(url)
... | [
"feedparser.parse",
"time.mktime",
"re.compile"
] | [((157, 186), 're.compile', 're.compile', (['"""image|img"""', 're.I'], {}), "('image|img', re.I)\n", (167, 186), False, 'import re\n'), ((290, 311), 'feedparser.parse', 'feedparser.parse', (['url'], {}), '(url)\n', (306, 311), False, 'import feedparser\n'), ((1015, 1045), 'time.mktime', 'mktime', (['entry.published_pa... |
import numpy as np
def empirical_dist(arr):
"""
**empirical distribution function**
$$ \\hat{F}_n (t) = \\frac{1}{n} \\sum_{i=1}^n 1_{X_i \\le t}$$
Arguments:
- arr: 1d numeric array
"""
_arr_idx = np.argsort(arr)
_arr = arr[_arr_idx]
_x = np.repeat(_arr, 2)
_y = np.repeat(... | [
"numpy.argsort",
"numpy.pad",
"numpy.size",
"numpy.repeat"
] | [((231, 246), 'numpy.argsort', 'np.argsort', (['arr'], {}), '(arr)\n', (241, 246), True, 'import numpy as np\n'), ((282, 300), 'numpy.repeat', 'np.repeat', (['_arr', '(2)'], {}), '(_arr, 2)\n', (291, 300), True, 'import numpy as np\n'), ((415, 428), 'numpy.size', 'np.size', (['_arr'], {}), '(_arr)\n', (422, 428), True,... |
from django.conf.urls import url
from django_jsonforms.tests.testapp import views
urlpatterns = [
url(r'^testform/', views.JSONFormView.as_view(), name='testform'),
url(r'^testformstatic/', views.JSONFormViewStatic.as_view(), name='testformstatic'),
url(r'^testformdouble/', views.JSONFormViewDouble.as_view... | [
"django_jsonforms.tests.testapp.views.JSONFormView.as_view",
"django_jsonforms.tests.testapp.views.JSONFormViewDouble.as_view",
"django.conf.urls.url",
"django_jsonforms.tests.testapp.views.JSONFormViewStatic.as_view"
] | [((352, 404), 'django.conf.urls.url', 'url', (['"""^success/"""', 'views.success_view'], {'name': '"""success"""'}), "('^success/', views.success_view, name='success')\n", (355, 404), False, 'from django.conf.urls import url\n'), ((122, 150), 'django_jsonforms.tests.testapp.views.JSONFormView.as_view', 'views.JSONFormV... |
import unittest
from unnecessary_math import multiply
class TestUM(unittest.TestCase):
def test_numbers_3_4(self):
self.assertEqual(multiply(3, 4), 12)
| [
"unnecessary_math.multiply"
] | [((146, 160), 'unnecessary_math.multiply', 'multiply', (['(3)', '(4)'], {}), '(3, 4)\n', (154, 160), False, 'from unnecessary_math import multiply\n')] |
from sklearn.base import TransformerMixin
import skorch
import numpy as np
import torch
from skorch import NeuralNet
import skorch
import os
from tempfile import mkdtemp
from torch.nn import NLLLoss
class NeuralNetBase(NeuralNet):
"""
Extends :class:`skorch.NeuralNet` mainly by including a functionality to ca... | [
"skorch.utils.to_tensor",
"hashlib.md5",
"numpy.random.seed",
"torch.manual_seed",
"torch.cuda.manual_seed",
"os.path.isfile",
"tempfile.mkdtemp"
] | [((562, 571), 'tempfile.mkdtemp', 'mkdtemp', ([], {}), '()\n', (569, 571), False, 'from tempfile import mkdtemp\n'), ((2339, 2352), 'hashlib.md5', 'hashlib.md5', ([], {}), '()\n', (2350, 2352), False, 'import hashlib\n'), ((3772, 3822), 'skorch.utils.to_tensor', 'skorch.utils.to_tensor', (['y_true'], {'device': 'self.d... |
#!/usr/bin/env python
"""Celery Entrypoint for workers."""
from brewpi.app import celery, create_app # noqa
app = create_app()
app.app_context().push()
| [
"brewpi.app.create_app"
] | [((116, 128), 'brewpi.app.create_app', 'create_app', ([], {}), '()\n', (126, 128), False, 'from brewpi.app import celery, create_app\n')] |
import pytest
from .ic_45_graph_coloring import color_graph_first_available_slightly_faster
from .problem_solve_util import GraphNode
colors = ['red', 'blue', 'green', 'yellow', 'purple', 'pink', 'orange']
def get_colors_for_graph(graph):
"""
Given a graph, returns a list of colors whose length is D + 1 where D =... | [
"pytest.raises"
] | [((3341, 3366), 'pytest.raises', 'pytest.raises', (['ValueError'], {}), '(ValueError)\n', (3354, 3366), False, 'import pytest\n')] |
"""Implementation of Rule L006."""
from typing import Tuple, List
from sqlfluff.core.parser import WhitespaceSegment
from sqlfluff.core.rules.base import (
BaseRule,
LintResult,
LintFix,
RuleContext,
EvalResultType,
)
from sqlfluff.core.rules.doc_decorators import document_fix_compatible, docume... | [
"sqlfluff.core.parser.WhitespaceSegment",
"sqlfluff.core.rules.base.LintResult"
] | [((7752, 7764), 'sqlfluff.core.rules.base.LintResult', 'LintResult', ([], {}), '()\n', (7762, 7764), False, 'from sqlfluff.core.rules.base import BaseRule, LintResult, LintFix, RuleContext, EvalResultType\n'), ((3348, 3360), 'sqlfluff.core.rules.base.LintResult', 'LintResult', ([], {}), '()\n', (3358, 3360), False, 'fr... |
#! /usr/bin/python
# -*- coding: utf-8 -*-
import tensorflow as tf
from tensorlayer.layers.core import Layer
from tensorlayer import logging
from tensorlayer.decorators import deprecated_alias
__all__ = [
'UpSampling2dLayer',
'DownSampling2dLayer',
]
class UpSampling2dLayer(Layer):
"""The :class:`UpS... | [
"tensorflow.image.resize_images",
"tensorlayer.logging.info",
"tensorflow.variable_scope",
"tensorflow.shape",
"tensorlayer.decorators.deprecated_alias"
] | [((1502, 1563), 'tensorlayer.decorators.deprecated_alias', 'deprecated_alias', ([], {'layer': '"""prev_layer"""', 'end_support_version': '(1.9)'}), "(layer='prev_layer', end_support_version=1.9)\n", (1518, 1563), False, 'from tensorlayer.decorators import deprecated_alias\n'), ((5132, 5193), 'tensorlayer.decorators.dep... |
from typing import Callable, Dict, Iterable, Tuple, Union
import itertools
import numpy as np
import pandas as pd
import lmfit
from covid19_data_analyzer.data_functions.data_utils import (
get_fit_param_results_row,
params_to_df,
)
from covid19_data_analyzer.data_functions.scrapers import ALLOWED_SOURCES, g... | [
"pandas.DataFrame",
"covid19_data_analyzer.data_functions.data_utils.params_to_df",
"covid19_data_analyzer.data_functions.data_utils.get_data_path",
"pandas.merge",
"covid19_data_analyzer.data_functions.scrapers.get_data",
"numpy.arange",
"pandas.Series",
"covid19_data_analyzer.data_functions.data_uti... | [((1761, 1792), 'numpy.arange', 'np.arange', (['region_data.shape[0]'], {}), '(region_data.shape[0])\n', (1770, 1792), True, 'import numpy as np\n'), ((5861, 5928), 'numpy.arange', 'np.arange', (['model_result.ndata', '(model_result.ndata + days_to_predict)'], {}), '(model_result.ndata, model_result.ndata + days_to_pre... |
# Generated by Django 2.2.11 on 2020-03-18 19:37
from django.conf import settings
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
... | [
"django.db.migrations.swappable_dependency",
"django.db.migrations.RenameModel",
"django.db.models.ForeignKey",
"django.db.models.CharField",
"django.db.migrations.DeleteModel",
"django.db.models.AutoField",
"django.db.models.DecimalField"
] | [((258, 315), 'django.db.migrations.swappable_dependency', 'migrations.swappable_dependency', (['settings.AUTH_USER_MODEL'], {}), '(settings.AUTH_USER_MODEL)\n', (289, 315), False, 'from django.db import migrations, models\n'), ((2074, 2139), 'django.db.migrations.RenameModel', 'migrations.RenameModel', ([], {'old_name... |
# Copyright 2016 Capital One Services, 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 applicable law or agreed to in... | [
"botocore.exceptions.ClientError",
"c7n.actions.ActionRegistry",
"c7n.actions.Action"
] | [((909, 917), 'c7n.actions.Action', 'Action', ([], {}), '()\n', (915, 917), False, 'from c7n.actions import Action, ActionRegistry\n'), ((1253, 1278), 'botocore.exceptions.ClientError', 'ClientError', (['resp', '"""test"""'], {}), "(resp, 'test')\n", (1264, 1278), False, 'from botocore.exceptions import ClientError\n')... |
"""Shared Utility functions."""
import datetime
import pickle
import re
import pandas as pd
import tensorflow as tf
from better_profanity import profanity
from . import config
star_matcher = re.compile(r"\*")
# Match present participle shortened with apostrophes like singin', workin'.
ing_matcher = re.compile(r"(\w... | [
"tensorflow.keras.preprocessing.text.Tokenizer",
"pickle.dump",
"pandas.read_csv",
"pickle.load",
"better_profanity.profanity.censor",
"datetime.datetime.now",
"re.sub",
"re.compile"
] | [((194, 211), 're.compile', 're.compile', (['"""\\\\*"""'], {}), "('\\\\*')\n", (204, 211), False, 'import re\n'), ((304, 339), 're.compile', 're.compile', (['"""(\\\\win)\'(?!\\\\w)(\\\\s)?"""'], {}), '("(\\\\win)\'(?!\\\\w)(\\\\s)?")\n', (314, 339), False, 'import re\n'), ((1180, 1206), 'pandas.read_csv', 'pd.read_cs... |
# My example script
import spacy
import os
import time
import praw
import pandas as pd
import numpy as np
import pprint
from datetime import datetime, timezone
from spacy import displacy
import matplotlib.pyplot as plt
from collections import Counter
import plotly.express as px
import boto3
username = "my_username"
p... | [
"boto3.client",
"plotly.express.bar",
"boto3.resource",
"datetime.datetime.fromtimestamp",
"collections.Counter",
"praw.Reddit"
] | [((649, 745), 'praw.Reddit', 'praw.Reddit', ([], {'client_id': 'app_client_id', 'client_secret': 'app_client_secret', 'user_agent': 'user_agent'}), '(client_id=app_client_id, client_secret=app_client_secret,\n user_agent=user_agent)\n', (660, 745), False, 'import praw\n'), ((3833, 3853), 'boto3.resource', 'boto3.res... |
from psycopg2 import connect
from psycopg2.extensions import ISOLATION_LEVEL_AUTOCOMMIT
from django.core.management.base import BaseCommand, CommandError
from django.conf import settings
class Command(BaseCommand):
help = 'Creates the initial database'
def handle(self, *args, **options):
self.stdout.... | [
"psycopg2.connect"
] | [((627, 694), 'psycopg2.connect', 'connect', ([], {'dbname': '"""postgres"""', 'user': 'user', 'host': 'host', 'password': 'password'}), "(dbname='postgres', user=user, host=host, password=password)\n", (634, 694), False, 'from psycopg2 import connect\n')] |
#!/usr/bin/env python
"""Tests for `rmcalyse` package."""
import pytest
from click.testing import CliRunner
from rmcalyse import rmcalyse
from rmcalyse import cli
from rmcalyse.general_functions.orthonormalise import orthonormalise
def test_orthonormalise():
# testing
cell = [4, 4, 4, 90.0, 60.0, 90.0]
... | [
"rmcalyse.general_functions.orthonormalise.orthonormalise"
] | [((414, 445), 'rmcalyse.general_functions.orthonormalise.orthonormalise', 'orthonormalise', (['cell', 'atom_list'], {}), '(cell, atom_list)\n', (428, 445), False, 'from rmcalyse.general_functions.orthonormalise import orthonormalise\n')] |
import re
from django import forms
from django.core.exceptions import ValidationError
from django.db import models
from django.db.models.fields import NOT_PROVIDED
from django.utils.translation import ugettext_lazy as _
from .forms import RegexFlagsFormField, RegexFormField
from .validators import Regex, RegexValidat... | [
"django.utils.translation.ugettext_lazy",
"re.compile"
] | [((352, 366), 're.compile', 're.compile', (['""""""'], {}), "('')\n", (362, 366), False, 'import re\n'), ((1838, 1864), 're.compile', 're.compile', (['pattern', 'flags'], {}), '(pattern, flags)\n', (1848, 1864), False, 'import re\n'), ((3193, 3219), 're.compile', 're.compile', (['pattern', 'flags'], {}), '(pattern, fla... |
from .interfaces import Text_to_Text_PipelineInterface
import re
# --------------------------------------
from io import StringIO
from html import unescape
from html.parser import HTMLParser
#Strips HTML tags and entities
class stdlib_strip(HTMLParser):
def __init__(self):
super().__init__()
self... | [
"bs4.BeautifulSoup",
"io.StringIO",
"html.unescape",
"re.sub"
] | [((581, 595), 'html.unescape', 'unescape', (['html'], {}), '(html)\n', (589, 595), False, 'from html import unescape\n'), ((680, 705), 're.sub', 're.sub', (['"""\\\\s+"""', '""" """', 'text'], {}), "('\\\\s+', ' ', text)\n", (686, 705), False, 'import re\n'), ((829, 863), 'bs4.BeautifulSoup', 'BeautifulSoup', (['html',... |
# Copyright (c) 2013 Rackspace, 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 wr... | [
"mock.patch.object",
"zaqarclient.queues.v2.message.create_object",
"json.dumps"
] | [((1537, 1570), 'zaqarclient.queues.v2.message.create_object', 'message.create_object', (['self.queue'], {}), '(self.queue)\n', (1558, 1570), False, 'from zaqarclient.queues.v2 import message\n'), ((2069, 2125), 'mock.patch.object', 'mock.patch.object', (['self.transport', '"""send"""'], {'autospec': '(True)'}), "(self... |
from apt_ios_repo.utils import _get_value_from_content
class PackagesFile:
"""
Class that represents a Packages file
# Arguments
content (str): the content of the Packages file
"""
def __init__(self, content):
self.__content = content.strip()
@property
def packages(self):
... | [
"apt_ios_repo.utils._get_value_from_content"
] | [((837, 890), 'apt_ios_repo.utils._get_value_from_content', '_get_value_from_content', (['self.__content', "('Package',)"], {}), "(self.__content, ('Package',))\n", (860, 890), False, 'from apt_ios_repo.utils import _get_value_from_content\n'), ((944, 997), 'apt_ios_repo.utils._get_value_from_content', '_get_value_from... |
import toml
import click
from radiosim.utils import read_config, check_outpath
from radiosim.simulations import simulate_sky_distributions
@click.command()
@click.argument("configuration_path", type=click.Path(exists=True, dir_okay=False))
@click.option(
"--mode",
type=click.Choice(
[
"sim... | [
"radiosim.simulations.simulate_sky_distributions",
"radiosim.utils.check_outpath",
"radiosim.utils.read_config",
"click.command",
"click.Choice",
"toml.load",
"click.Path"
] | [((142, 157), 'click.command', 'click.command', ([], {}), '()\n', (155, 157), False, 'import click\n'), ((475, 504), 'toml.load', 'toml.load', (['configuration_path'], {}), '(configuration_path)\n', (484, 504), False, 'import toml\n'), ((520, 539), 'radiosim.utils.read_config', 'read_config', (['config'], {}), '(config... |
"""Common fixtures"""
import os
import pytest
from reduct import Client, Bucket
@pytest.fixture(name="url")
def _url() -> str:
return "http://127.0.0.1:8383"
@pytest.fixture(name="client")
async def _make_client(url):
api_token = os.getenv("RS_API_TOKEN", default=None)
client = Client(url, api_token=ap... | [
"pytest.fixture",
"os.getenv",
"reduct.Client"
] | [((84, 110), 'pytest.fixture', 'pytest.fixture', ([], {'name': '"""url"""'}), "(name='url')\n", (98, 110), False, 'import pytest\n'), ((168, 197), 'pytest.fixture', 'pytest.fixture', ([], {'name': '"""client"""'}), "(name='client')\n", (182, 197), False, 'import pytest\n'), ((491, 522), 'pytest.fixture', 'pytest.fixtur... |
# client code to connect to server
import select, socket, sys
from util_chat import Room, ChatHall, ChatMember
import util_chat
READ_BUFFER = 4096
if len(sys.argv) < 2:
print("Usage: Python3 client.py [hostname]")
sys.exit(1)
else:
server_connection = socket.socket(socket.AF_INET, socket.SOCK... | [
"sys.stdout.write",
"socket.socket",
"select.select",
"sys.stdout.flush",
"sys.exit"
] | [((235, 246), 'sys.exit', 'sys.exit', (['(1)'], {}), '(1)\n', (243, 246), False, 'import select, socket, sys\n'), ((279, 328), 'socket.socket', 'socket.socket', (['socket.AF_INET', 'socket.SOCK_STREAM'], {}), '(socket.AF_INET, socket.SOCK_STREAM)\n', (292, 328), False, 'import select, socket, sys\n'), ((589, 613), 'sys... |
import random
import inspect
from stringfuzz.ast import *
from stringfuzz.smt import smt_new_var, smt_reset_counters, smt_declare_var
from stringfuzz.util import random_string, coin_toss
__all__ = [
'random_ast'
]
# constants
# nodes that have no inputs
TERMINALS = [
ReAllCharNode,
]
# nodes that can take e... | [
"random.randint",
"stringfuzz.smt.smt_new_var",
"stringfuzz.smt.smt_reset_counters",
"random.choice",
"stringfuzz.util.coin_toss",
"random.random",
"stringfuzz.smt.smt_declare_var",
"stringfuzz.util.random_string"
] | [((1973, 2003), 'random.choice', 'random.choice', (['variables[sort]'], {}), '(variables[sort])\n', (1986, 2003), False, 'import random\n'), ((2455, 2483), 'random.randint', 'random.randint', (['(0)', '(depth - 1)'], {}), '(0, depth - 1)\n', (2469, 2483), False, 'import random\n'), ((2607, 2637), 'random.choice', 'rand... |
import sys
from utils import run_shell_command
from sagemaker.generate_resource_names import generate_resource_names
def delete_deployment(deployment_name):
(
ecr_repo_name,
_,
_,
endpoint_name,
_,
) = generate_resource_names(deployment_name)
# delete API Gateway ... | [
"sagemaker.generate_resource_names.generate_resource_names",
"utils.run_shell_command"
] | [((253, 293), 'sagemaker.generate_resource_names.generate_resource_names', 'generate_resource_names', (['deployment_name'], {}), '(deployment_name)\n', (276, 293), False, 'from sagemaker.generate_resource_names import generate_resource_names\n'), ((390, 485), 'utils.run_shell_command', 'run_shell_command', (["['aws', '... |
import logging
import random
from collections import defaultdict
from flask import Flask, render_template, session, request
from flask_socketio import SocketIO, emit, join_room, leave_room, \
close_room, rooms, disconnect
import avalon as avalon
import model as m
import rules as r
app = Flask(__name__)
app.confi... | [
"logging.debug",
"logging.basicConfig",
"flask.Flask",
"random.getrandbits",
"collections.defaultdict",
"flask_socketio.emit",
"rules.PlayerVote",
"flask.render_template",
"flask_socketio.SocketIO",
"avalon.Game"
] | [((295, 310), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (300, 310), False, 'from flask import Flask, render_template, session, request\n'), ((359, 372), 'flask_socketio.SocketIO', 'SocketIO', (['app'], {}), '(app)\n', (367, 372), False, 'from flask_socketio import SocketIO, emit, join_room, leave_room... |
# Copyright 2017 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 applicab... | [
"model_utils.n_gram.construct_ngrams_dict",
"numpy.asarray",
"scipy.special.expit",
"numpy.mean",
"model_utils.n_gram.percent_unique_ngrams_in_train",
"model_utils.n_gram.find_all_ngrams",
"collections.Counter",
"model_utils.helper.convert_to_human_readable"
] | [((1979, 2004), 'numpy.asarray', 'np.asarray', (['sequence_eval'], {}), '(sequence_eval)\n', (1989, 2004), True, 'import numpy as np\n'), ((2017, 2092), 'model_utils.helper.convert_to_human_readable', 'helper.convert_to_human_readable', (['id_to_word', 'indices_arr', 'max_num_to_print'], {}), '(id_to_word, indices_arr,... |
from tests.contract_interfaces.owned_interface import OwnedInterface
from utils.deployutils import mine_tx
class StateInterface(OwnedInterface):
def __init__(self, contract, name):
OwnedInterface.__init__(self, contract, name)
self.contract = contract
self.contract_name = name
se... | [
"tests.contract_interfaces.owned_interface.OwnedInterface.__init__"
] | [((195, 240), 'tests.contract_interfaces.owned_interface.OwnedInterface.__init__', 'OwnedInterface.__init__', (['self', 'contract', 'name'], {}), '(self, contract, name)\n', (218, 240), False, 'from tests.contract_interfaces.owned_interface import OwnedInterface\n')] |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import print_function
import logging
import inspect
import os
import shutil
import string_utils
import tempfile
from jinja2 import Environment, FileSystemLoader
from kubernetes.client import models as k8s_models
from ..client import model... | [
"os.makedirs",
"os.path.isdir",
"os.path.dirname",
"os.path.exists",
"string_utils.camel_case_to_snake",
"jinja2.FileSystemLoader",
"tempfile.mkdtemp",
"shutil.rmtree",
"os.path.join",
"logging.getLogger",
"inspect.getmembers"
] | [((502, 529), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (519, 529), False, 'import logging\n'), ((681, 706), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (696, 706), False, 'import os\n'), ((1480, 1513), 'inspect.getmembers', 'inspect.getmembers', (['mode... |
# Lint as: python3
# Copyright 2018, The TensorFlow Federated Authors.
#
# 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 ... | [
"tensorflow_federated.python.core.api.tf_computation",
"tensorflow_federated.python.core.impl.executor_stacks.create_local_executor",
"tensorflow_federated.python.core.api.FunctionType",
"tensorflow.random.normal",
"tensorflow_federated.python.core.api.federated_computation",
"tensorflow.convert_to_tensor... | [((17876, 17894), 'tensorflow_federated.python.common_libs.test.main', 'common_test.main', ([], {}), '()\n', (17892, 17894), True, 'from tensorflow_federated.python.common_libs import test as common_test\n'), ((2367, 2383), 'tensorflow.Variable', 'tf.Variable', (['(0.0)'], {}), '(0.0)\n', (2378, 2383), True, 'import te... |
from django.test import TestCase
from django.test.client import Client
from django.core.urlresolvers import reverse
from django.contrib.auth.models import User
from .forms import LoginForm
class LoginViewTest(TestCase):
def setUp(self):
self.client = Client()
self.response = self.client.get(reve... | [
"django.test.client.Client",
"django.contrib.auth.models.User.objects.all",
"django.contrib.auth.models.User.objects.create_user",
"django.core.urlresolvers.reverse"
] | [((267, 275), 'django.test.client.Client', 'Client', ([], {}), '()\n', (273, 275), False, 'from django.test.client import Client\n'), ((854, 912), 'django.contrib.auth.models.User.objects.create_user', 'User.objects.create_user', (['"""admin"""', '"""<EMAIL>"""', '"""<PASSWORD>"""'], {}), "('admin', '<EMAIL>', '<PASSWO... |
#!/usr/bin/env python3
#
# MIT License
#
# Copyright (c) 2020-2021 EntySec
#
# 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... | [
"socket.socket",
"hatsploit.core.base.exceptions.Exceptions",
"hatsploit.core.cli.badges.Badges"
] | [((1442, 1450), 'hatsploit.core.cli.badges.Badges', 'Badges', ([], {}), '()\n', (1448, 1450), False, 'from hatsploit.core.cli.badges import Badges\n'), ((1957, 1965), 'hatsploit.core.cli.badges.Badges', 'Badges', ([], {}), '()\n', (1963, 1965), False, 'from hatsploit.core.cli.badges import Badges\n'), ((1992, 2004), 'h... |
import moonleap.resource.props as P
from moonleap import MemFun, Prop, create, empty_rule, extend, named
from moonleap.verbs import connects
from titan.api_pkg.itemlist.resources import ItemList
from . import props
from .resources import Pipeline
rules = [
(("x+pipeline", connects, "x+pipeline-elm"), empty_rule()... | [
"moonleap.resource.props.parent",
"moonleap.resource.props.children",
"moonleap.named",
"moonleap.create",
"moonleap.empty_rule",
"moonleap.resource.props.child",
"moonleap.Prop",
"moonleap.MemFun"
] | [((445, 463), 'moonleap.create', 'create', (['"""pipeline"""'], {}), "('pipeline')\n", (451, 463), False, 'from moonleap import MemFun, Prop, create, empty_rule, extend, named\n'), ((540, 560), 'moonleap.create', 'create', (['"""x+pipeline"""'], {}), "('x+pipeline')\n", (546, 560), False, 'from moonleap import MemFun, ... |
# -*- coding: utf-8 -*-
from rest_framework import serializers
from apps.authentication.models import OnlineUser as User
from apps.gallery.serializers import ResponsiveImageSerializer
from apps.inventory.models import Item, ItemCategory
from apps.payment.models import PaymentTransaction
from apps.shop.models import O... | [
"apps.gallery.serializers.ResponsiveImageSerializer",
"apps.inventory.models.Item.objects.get",
"apps.shop.models.OrderLine.objects.create",
"apps.shop.models.Order",
"rest_framework.serializers.ValidationError"
] | [((1987, 2014), 'apps.gallery.serializers.ResponsiveImageSerializer', 'ResponsiveImageSerializer', ([], {}), '()\n', (2012, 2014), False, 'from apps.gallery.serializers import ResponsiveImageSerializer\n'), ((1017, 1059), 'apps.shop.models.OrderLine.objects.create', 'OrderLine.objects.create', ([], {}), '(**validated_d... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.