code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
import collections
import datetime
import logging
try:
import json
except ImportError:
import simplejson as json
import re
def get_log():
return logging.getLogger(__name__.split('.')[0])
class MarathonJsonEncoder(json.JSONEncoder):
"""Custom JSON encoder for Marathon object serialization."""
... | [
"datetime.datetime.strptime",
"re.sub"
] | [((1660, 1708), 're.sub', 're.sub', (['"""(.)([A-Z][a-z]+)"""', '"""\\\\1_\\\\2"""', 'camel_str'], {}), "('(.)([A-Z][a-z]+)', '\\\\1_\\\\2', camel_str)\n", (1666, 1708), False, 'import re\n'), ((1719, 1761), 're.sub', 're.sub', (['"""([a-z0-9])([A-Z])"""', '"""\\\\1_\\\\2"""', 's1'], {}), "('([a-z0-9])([A-Z])', '\\\\1_... |
import os
import os.path as osp
import mmcv
import torch
import torch.distributed as dist
from mmcv.runner import Hook, obj_from_dict
from torch.utils.data import Dataset
from ... import datasets
from ..parallel import collate, scatter
from .accuracy import top_k_accuracy
class DistEvalHook(Hook):
def __init__... | [
"os.remove",
"mmcv.load",
"mmcv.runner.obj_from_dict",
"torch.distributed.barrier",
"mmcv.dump",
"torch.cuda.current_device",
"torch.no_grad",
"os.path.join"
] | [((3562, 3590), 'mmcv.dump', 'mmcv.dump', (['results', 'tmp_file'], {}), '(results, tmp_file)\n', (3571, 3590), False, 'import mmcv\n'), ((3599, 3613), 'torch.distributed.barrier', 'dist.barrier', ([], {}), '()\n', (3611, 3613), True, 'import torch.distributed as dist\n'), ((510, 563), 'mmcv.runner.obj_from_dict', 'obj... |
from pathlib import Path
CAMVIEWER_CFG = '/reg/g/pcds/pyps/config/{}/camviewer.cfg'
CONDA_BASE = Path('/reg/g/pcds/pyps/conda/py36')
CUR_EXP_SCRIPT = '/reg/g/pcds/engineering_tools/{0}/scripts/get_curr_exp {0}'
CLASS_SEARCH_PATH = ['pcdsdevices.device_types']
DIR_MODULE = Path(__file__).resolve().parent
FILE_YAML... | [
"pathlib.Path"
] | [((99, 134), 'pathlib.Path', 'Path', (['"""/reg/g/pcds/pyps/conda/py36"""'], {}), "('/reg/g/pcds/pyps/conda/py36')\n", (103, 134), False, 'from pathlib import Path\n'), ((278, 292), 'pathlib.Path', 'Path', (['__file__'], {}), '(__file__)\n', (282, 292), False, 'from pathlib import Path\n')] |
"""Provides an easy way of generating several geometric objects.
CONTAINS
--------
vtkArrowSource
vtkCylinderSource
vtkSphereSource
vtkPlaneSource
vtkLineSource
vtkCubeSource
vtkConeSource
vtkDiskSource
vtkRegularPolygonSource
vtkPyramid
vtkPlatonicSolidSource
vtkSuperquadricSource
as well as some pure-python helpers... | [
"numpy.sum",
"pyvista.StructuredGrid",
"numpy.empty",
"numpy.allclose",
"pyvista._vtk.vtkUnstructuredGrid",
"numpy.sin",
"numpy.linalg.norm",
"numpy.arange",
"numpy.full",
"pyvista._vtk.vtkArrowSource",
"numpy.meshgrid",
"pyvista._vtk.vtkTriangleFilter",
"pyvista._vtk.vtkPlaneSource",
"pyv... | [((894, 926), 'numpy.cross', 'np.cross', (['normx', '[0, 1.0, 1e-07]'], {}), '(normx, [0, 1.0, 1e-07])\n', (902, 926), True, 'import numpy as np\n'), ((944, 965), 'numpy.linalg.norm', 'np.linalg.norm', (['normz'], {}), '(normz)\n', (958, 965), True, 'import numpy as np\n'), ((978, 1000), 'numpy.cross', 'np.cross', (['n... |
# -*- coding: utf-8 -*-
'''
Manage Grafana v4.0 users
.. versionadded:: 2017.7.0
:configuration: This state requires a configuration profile to be configured
in the minion config, minion pillar, or master config. The module will use
the 'grafana' key by default, if defined.
Example configuration using ba... | [
"salt.utils.dictdiffer.deep_diff"
] | [((4816, 4845), 'salt.utils.dictdiffer.deep_diff', 'deep_diff', (['old_data', 'new_data'], {}), '(old_data, new_data)\n', (4825, 4845), False, 'from salt.utils.dictdiffer import deep_diff\n')] |
"""Turtle invaders"""
import turtle
import time
import random
class CircleBoundary(object):
def __init__(self, pos, size):
self.pos = pos
self.size = size
def goto(self, pos, y=None):
if y:
pos = turtle.Vec2D(pos, y)
self.pos = pos
def intersec... | [
"turtle.listen",
"random.randint",
"turtle.Turtle",
"turtle.Vec2D",
"time.sleep",
"turtle.tracer",
"turtle.update",
"turtle.onkeypress",
"turtle.onkeyrelease"
] | [((519, 534), 'turtle.Turtle', 'turtle.Turtle', ([], {}), '()\n', (532, 534), False, 'import turtle\n'), ((1636, 1664), 'turtle.Vec2D', 'turtle.Vec2D', (['(100 / 120.0)', '(0)'], {}), '(100 / 120.0, 0)\n', (1648, 1664), False, 'import turtle\n'), ((2855, 2874), 'turtle.Vec2D', 'turtle.Vec2D', (['(-5)', '(0)'], {}), '(-... |
"""
Sample script using EEGNet to classify Event-Related Potential (ERP) EEG data
from a four-class classification task, using the sample dataset provided in
the MNE [1, 2] package:
https://martinos.org/mne/stable/manual/sample_dataset.html#ch-sample-data
The four classes used from this dataset are:
L... | [
"matplotlib.pyplot.switch_backend",
"sklearn.metrics.confusion_matrix",
"tensorflow.keras.utils.to_categorical",
"mne.pick_types",
"mne.io.Raw",
"EEGModels.EEGNet",
"tensorflow.keras.callbacks.ModelCheckpoint",
"mne.Epochs",
"matplotlib.pyplot.figure",
"mne.read_events",
"mne.datasets.sample.dat... | [((3628, 3653), 'matplotlib.pyplot.switch_backend', 'plt.switch_backend', (['"""agg"""'], {}), "('agg')\n", (3646, 3653), True, 'from matplotlib import pyplot as plt\n'), ((3793, 3811), 'mne.datasets.sample.data_path', 'sample.data_path', ([], {}), '()\n', (3809, 3811), False, 'from mne.datasets import sample\n'), ((41... |
from twisted.internet import defer
from twisted.trial import unittest
from txpostgres import reconnection
class ArbitraryException(Exception):
pass
class Reconnectable(object):
def __init__(self):
self.calls = []
self.connects = []
def call(self):
self.calls.append(defer.Deferr... | [
"twisted.internet.defer.gatherResults",
"txpostgres.reconnection.DeadConnectionDetector",
"twisted.internet.defer.Deferred"
] | [((764, 818), 'txpostgres.reconnection.DeadConnectionDetector', 'reconnection.DeadConnectionDetector', (['self.deathChecker'], {}), '(self.deathChecker)\n', (799, 818), False, 'from txpostgres import reconnection\n'), ((3083, 3128), 'twisted.internet.defer.gatherResults', 'defer.gatherResults', (['[d1, d2, d3, d4, d5, ... |
'''
A class that performs tracking and drift scans
with parameters acquired from the scan queue.
Author: <NAME>
Date: June 2018
'''
from CommandStation import CommandStation
from astropy.coordinates import SkyCoord, EarthLocation, AltAz
from astropy.time import Time
from astropy.table import Table
from astropy import... | [
"io.BytesIO",
"re.split",
"astropy.table.Table",
"astropy.time.Time",
"astropy.coordinates.AltAz",
"CommandStation.CommandStation",
"datetime.date.today",
"sqlite3.connect",
"astropy.coordinates.EarthLocation",
"numpy.linspace",
"srtutility.NTPTime.NTPTime",
"astropy.coordinates.SkyCoord"
] | [((11124, 11168), 'sqlite3.connect', 'sqlite3.connect', (['"""../srtdatabase/srtdata.db"""'], {}), "('../srtdatabase/srtdata.db')\n", (11139, 11168), False, 'import sqlite3\n'), ((527, 543), 'CommandStation.CommandStation', 'CommandStation', ([], {}), '()\n', (541, 543), False, 'from CommandStation import CommandStatio... |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe, random
from frappe.utils.make_random import how_many, get_random
from frappe.desk import query_report
from erpnext.setup.utils import ge... | [
"erpnext.accounts.party.get_party_account_currency",
"frappe.utils.make_random.how_many",
"frappe.desk.query_report.run",
"frappe.utils.make_random.get_random",
"frappe.db.get_global",
"random.randint",
"frappe.new_doc",
"frappe.get_doc",
"random.random",
"erpnext.stock.doctype.material_request.ma... | [((1985, 2007), 'frappe.utils.make_random.get_random', 'get_random', (['"""Supplier"""'], {}), "('Supplier')\n", (1995, 2007), False, 'from frappe.utils.make_random import how_many, get_random\n'), ((2029, 2097), 'frappe.db.get_value', 'frappe.db.get_value', (['"""Company"""', '"""Wind Power LLC"""', '"""default_curren... |
# -*- coding: utf-8 -*-
from operator import attrgetter
import requests
from argh.decorators import arg
from lain_cli.auth import SSOAccess, get_auth_header
from lain_cli.utils import check_phase, get_app_state, get_domain
from lain_sdk.util import error, info
class AppInfo(object):
"""App info to show"""
... | [
"lain_sdk.util.error",
"argh.decorators.arg",
"lain_cli.utils.get_app_state",
"operator.attrgetter",
"lain_cli.utils.get_domain",
"lain_cli.auth.SSOAccess.get_token",
"requests.get",
"lain_cli.auth.get_auth_header",
"lain_cli.utils.check_phase",
"lain_sdk.util.info"
] | [((690, 766), 'argh.decorators.arg', 'arg', (['"""phase"""'], {'help': '"""lain cluster phase id, can be added by lain config save"""'}), "('phase', help='lain cluster phase id, can be added by lain config save')\n", (693, 766), False, 'from argh.decorators import arg\n'), ((768, 863), 'argh.decorators.arg', 'arg', (['... |
# Copyright The PyTorch Lightning team.
#
# 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 i... | [
"torch.abs",
"torchmetrics.utilities.checks._check_same_shape"
] | [((803, 835), 'torchmetrics.utilities.checks._check_same_shape', '_check_same_shape', (['preds', 'target'], {}), '(preds, target)\n', (820, 835), False, 'from torchmetrics.utilities.checks import _check_same_shape\n'), ((866, 891), 'torch.abs', 'torch.abs', (['(preds - target)'], {}), '(preds - target)\n', (875, 891), ... |
# -*- coding: utf-8 -*-
#https://packaging.python.org/tutorials/distributing-packages/
import os
#https://pythonhosted.org/versiontools/usage.html
import setuptools
from pip import download
from pip import req
HERE = os.path.dirname(os.path.abspath(__file__))
def get_requirements(file):
path = os.path.join(HE... | [
"pip.download.PipSession",
"os.path.abspath",
"os.path.join",
"setuptools.find_packages"
] | [((237, 262), 'os.path.abspath', 'os.path.abspath', (['__file__'], {}), '(__file__)\n', (252, 262), False, 'import os\n'), ((305, 329), 'os.path.join', 'os.path.join', (['HERE', 'file'], {}), '(HERE, file)\n', (317, 329), False, 'import os\n'), ((1138, 1189), 'setuptools.find_packages', 'setuptools.find_packages', ([],... |
# Generated by Django 3.2 on 2021-04-28 14:41
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Document',
fields=[
('id', models.BigAutoFiel... | [
"django.db.models.FileField",
"django.db.models.TextField",
"django.db.models.BigAutoField",
"django.db.models.CharField",
"django.db.models.DateField"
] | [((302, 398), 'django.db.models.BigAutoField', 'models.BigAutoField', ([], {'auto_created': '(True)', 'primary_key': '(True)', 'serialize': '(False)', 'verbose_name': '"""ID"""'}), "(auto_created=True, primary_key=True, serialize=False,\n verbose_name='ID')\n", (321, 398), False, 'from django.db import migrations, m... |
"""
An experimental protocol is handled as a pandas DataFrame
that includes an 'onset' field.
This yields the onset time of the events in the experimental paradigm.
It can also contain:
* a 'trial_type' field that yields the condition identifier.
* a 'duration' field that yields event duration (for so-called ... | [
"warnings.warn",
"numpy.array",
"numpy.ones",
"numpy.repeat"
] | [((1664, 1689), 'numpy.array', 'np.array', (["events['onset']"], {}), "(events['onset'])\n", (1672, 1689), True, 'import numpy as np\n'), ((1794, 1824), 'numpy.array', 'np.array', (["events['trial_type']"], {}), "(events['trial_type'])\n", (1802, 1824), True, 'import numpy as np\n'), ((1842, 1859), 'numpy.ones', 'np.on... |
import numpy as np
from BMA_support import *
from BMA_agent import *
try:
from scipy.special import lambertw
except:
print("could not import lambertw (bounded priors won't work)")
class Node(object):
def __init__(self,name='',dims=[],inds=[],num=1,cp=False):
self.name = name
self.ag = [Age... | [
"numpy.log",
"numpy.copy",
"numpy.einsum",
"numpy.unravel_index",
"numpy.zeros",
"numpy.shape",
"numpy.exp"
] | [((1531, 1579), 'numpy.einsum', 'np.einsum', (['joint.val', 'joint.r', 'self.prior.r[:-1]'], {}), '(joint.val, joint.r, self.prior.r[:-1])\n', (1540, 1579), True, 'import numpy as np\n'), ((1602, 1692), 'numpy.einsum', 'np.einsum', (['(1.0 / (Z + 1e-55))', 'self.prior.r[:-1]', 'joint.val', 'joint.r', 'self.post.r[:-1]'... |
"""
tests.components.device_tracker.test_mqtt
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Tests the MQTT device tracker component.
"""
import unittest
import os
from homeassistant.components import device_tracker
from homeassistant.const import CONF_PLATFORM
from tests.common import (
get_test_home_assistant, mock... | [
"homeassistant.components.device_tracker.ENTITY_ID_FORMAT.format",
"tests.common.fire_mqtt_message",
"tests.common.get_test_home_assistant",
"tests.common.mock_mqtt_component",
"homeassistant.components.device_tracker.setup"
] | [((526, 551), 'tests.common.get_test_home_assistant', 'get_test_home_assistant', ([], {}), '()\n', (549, 551), False, 'from tests.common import get_test_home_assistant, mock_mqtt_component, fire_mqtt_message\n'), ((560, 590), 'tests.common.mock_mqtt_component', 'mock_mqtt_component', (['self.hass'], {}), '(self.hass)\n... |
from boa3.builtin import public
from boa3.builtin.interop.json import json_serialize
@public
def main() -> bytes:
return json_serialize(b'unit test')
| [
"boa3.builtin.interop.json.json_serialize"
] | [((127, 155), 'boa3.builtin.interop.json.json_serialize', 'json_serialize', (["b'unit test'"], {}), "(b'unit test')\n", (141, 155), False, 'from boa3.builtin.interop.json import json_serialize\n')] |
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2020 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this ... | [
"re.compile"
] | [((10745, 10785), 're.compile', 're.compile', (['"""^(\\\\w+\\\\.)*(Missing\\\\w+: )"""'], {}), "('^(\\\\w+\\\\.)*(Missing\\\\w+: )')\n", (10755, 10785), False, 'import re\n'), ((10805, 10849), 're.compile', 're.compile', (['"""buildout: Running \\\\S*setup.py"""'], {}), "('buildout: Running \\\\S*setup.py')\n", (10815... |
""" Classes for interacting with Salesforce Bulk API """
try:
from collections import OrderedDict
except ImportError:
# Python < 2.7
from ordereddict import OrderedDict
import json
import requests
from time import sleep
from simple_salesforce.util import call_salesforce
class SFBulkHandler(object):
... | [
"requests.Session",
"simple_salesforce.util.call_salesforce",
"json.dumps",
"time.sleep"
] | [((4105, 4192), 'simple_salesforce.util.call_salesforce', 'call_salesforce', ([], {'url': 'url', 'method': '"""GET"""', 'session': 'self.session', 'headers': 'self.headers'}), "(url=url, method='GET', session=self.session, headers=self.\n headers)\n", (4120, 4192), False, 'from simple_salesforce.util import call_sal... |
from collections import OrderedDict
from sqlalchemy.exc import (DataError, IntegrityError,
InternalError, ProgrammingError)
from qwc_services_core.database import DatabaseEngine
from qwc_services_core.permissions_reader import PermissionsReader
from qwc_services_core.runtime_config import ... | [
"qwc_services_core.permissions_reader.PermissionsReader",
"qwc_services_core.runtime_config.RuntimeConfig",
"dataset_features_provider.DatasetFeaturesProvider",
"qwc_services_core.database.DatabaseEngine"
] | [((808, 841), 'qwc_services_core.permissions_reader.PermissionsReader', 'PermissionsReader', (['tenant', 'logger'], {}), '(tenant, logger)\n', (825, 841), False, 'from qwc_services_core.permissions_reader import PermissionsReader\n'), ((867, 883), 'qwc_services_core.database.DatabaseEngine', 'DatabaseEngine', ([], {}),... |
import os
import time
import torch
from dataset.music import MUSICMixDataset
from helpers.utils import AverageMeter, makedirs, get_ctx, get_timestr
from steps.common import build_model, get_underlying_nets, init_history, adjust_learning_rate
from steps.evaluate_base import _evaluate
def save_nets(ctx, suffix):
... | [
"torch.cuda.synchronize",
"steps.common.adjust_learning_rate",
"steps.evaluate_base._evaluate",
"helpers.utils.AverageMeter",
"time.perf_counter",
"helpers.utils.get_timestr",
"steps.common.build_model",
"helpers.utils.get_ctx",
"steps.common.init_history",
"torch.set_grad_enabled",
"os.path.joi... | [((327, 347), 'helpers.utils.get_ctx', 'get_ctx', (['ctx', '"""path"""'], {}), "(ctx, 'path')\n", (334, 347), False, 'from helpers.utils import AverageMeter, makedirs, get_ctx, get_timestr\n'), ((747, 768), 'helpers.utils.get_ctx', 'get_ctx', (['ctx', '"""epoch"""'], {}), "(ctx, 'epoch')\n", (754, 768), False, 'from he... |
import MultipleFiles as mf
import glob
import sys
import numpy as np
path = "/home/xjh0560/Supernova_Lightcurves/LC_Data/"
filelist = np.asarray(glob.glob("/home/xjh0560/Supernova_Lightcurves/LC_Data/sample_lc_v2/*.h5"))
args = sys.argv
print("Running")
mf.run_analysis_multi(filelist[int(args[1]):int(args[1])+2]) | [
"glob.glob"
] | [((146, 220), 'glob.glob', 'glob.glob', (['"""/home/xjh0560/Supernova_Lightcurves/LC_Data/sample_lc_v2/*.h5"""'], {}), "('/home/xjh0560/Supernova_Lightcurves/LC_Data/sample_lc_v2/*.h5')\n", (155, 220), False, 'import glob\n')] |
#!/usr/bin/python2.7
# -*- coding: utf-8 -*-
# vim:ts=4:sw=4:softtabstop=4:smarttab:expandtab
# 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
... | [
"pycopia.ssl.certs.CertificateRequest",
"pycopia.tty.getpass",
"pycopia.ssl.certs.create_rsa_keypair"
] | [((1618, 1718), 'pycopia.ssl.certs.CertificateRequest', 'certs.CertificateRequest', (['country', 'state', 'locality', 'organization', 'organization_unit', 'name', 'email'], {}), '(country, state, locality, organization,\n organization_unit, name, email)\n', (1642, 1718), False, 'from pycopia.ssl import certs\n'), ((... |
# Copyright 2018 Contributors to Hyperledger Sawtooth
#
# 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 ... | [
"requests.Session"
] | [((1188, 1206), 'requests.Session', 'requests.Session', ([], {}), '()\n', (1204, 1206), False, 'import requests\n')] |
import io
import re
from setuptools import find_packages
from setuptools import setup
with io.open("README.rst", "rt", encoding="utf8") as f:
readme = f.read()
with io.open("src/flask/__init__.py", "rt", encoding="utf8") as f:
version = re.search(r'__version__ = "(.*?)"', f.read()).group(1)
setup(
name=... | [
"setuptools.find_packages",
"io.open"
] | [((93, 137), 'io.open', 'io.open', (['"""README.rst"""', '"""rt"""'], {'encoding': '"""utf8"""'}), "('README.rst', 'rt', encoding='utf8')\n", (100, 137), False, 'import io\n'), ((172, 227), 'io.open', 'io.open', (['"""src/flask/__init__.py"""', '"""rt"""'], {'encoding': '"""utf8"""'}), "('src/flask/__init__.py', 'rt', ... |
import logging
import numpy as np
from monai.transforms import LoadImage
from monailabel.interfaces.datastore import Datastore, DefaultLabelTag
from monailabel.interfaces.tasks import ScoringMethod
logger = logging.getLogger(__name__)
class Sum(ScoringMethod):
"""
Consider implementing simple np sum method... | [
"monai.transforms.LoadImage",
"numpy.sum",
"logging.getLogger"
] | [((210, 237), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (227, 237), False, 'import logging\n'), ((650, 676), 'monai.transforms.LoadImage', 'LoadImage', ([], {'image_only': '(True)'}), '(image_only=True)\n', (659, 676), False, 'from monai.transforms import LoadImage\n'), ((1028, 1050)... |
#
# pr8_1_1
from math import pi
import matplotlib.pyplot as plt
import numpy as np
from scipy.signal import ellipord, ellip, freqz, group_delay
def freqz_m(b, a):
"""
Modified version of freqz subroutine
:param b: numerator polynomial of H(z) (for FIR: b=h)
:param a: denominator polynomial of H(z) (for FIR: a... | [
"matplotlib.pyplot.title",
"numpy.abs",
"scipy.signal.ellip",
"scipy.signal.group_delay",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.show",
"numpy.angle",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.axis",
"numpy.finfo",
"matplotlib.pyplot.figure",
"numpy.max",
"numpy.array",
"scipy.s... | [((636, 665), 'scipy.signal.freqz', 'freqz', (['b', 'a', '(1000)'], {'whole': '(True)'}), '(b, a, 1000, whole=True)\n', (641, 665), False, 'from scipy.signal import ellipord, ellip, freqz, group_delay\n'), ((701, 710), 'numpy.abs', 'np.abs', (['H'], {}), '(H)\n', (707, 710), True, 'import numpy as np\n'), ((792, 803), ... |
from django.conf import settings
from django.http import HttpResponseRedirect
from django.shortcuts import render
from django.urls import reverse
from django.views.generic import TemplateView
from applications.models import Application
from reimbursement.models import Reimbursement
from baggage.models import Bag
from d... | [
"django.urls.reverse",
"django.shortcuts.get_object_or_404",
"urllib.parse.quote",
"app.utils.is_app_closed",
"django.shortcuts.render",
"django.http.HttpResponseRedirect",
"os.path.split"
] | [((1291, 1327), 'django.shortcuts.render', 'render', (['request', '"""code_conduct.html"""'], {}), "(request, 'code_conduct.html')\n", (1297, 1327), False, 'from django.shortcuts import render\n'), ((1368, 1404), 'django.shortcuts.render', 'render', (['request', '"""legal_notice.html"""'], {}), "(request, 'legal_notice... |
""" manager, for starters
"""
# pylint: disable=no-self-use,unsubscriptable-object,fixme,bad-continuation
import base64
from pathlib import Path
from typing import List, Text
from urllib.parse import unquote
import jinja2
import traitlets as T
from jupyter_core.paths import jupyter_config_path
from notebook import _tz... | [
"traitlets.default",
"notebook.utils.url_path_join",
"traitlets.Dict",
"jupyter_core.paths.jupyter_config_path",
"pathlib.Path",
"notebook._tz.utcfromtimestamp",
"traitlets.Instance",
"traitlets.import_item"
] | [((913, 943), 'traitlets.Instance', 'T.Instance', (['jinja2.Environment'], {}), '(jinja2.Environment)\n', (923, 943), True, 'import traitlets as T\n'), ((971, 979), 'traitlets.Dict', 'T.Dict', ([], {}), '()\n', (977, 979), True, 'import traitlets as T\n'), ((998, 1006), 'traitlets.Dict', 'T.Dict', ([], {}), '()\n', (10... |
"""Model class for sorting numbers."""
import torch.nn as nn
class Features(nn.Module):
def __init__(self, latent_dim, output_dim, dropout_prob):
"""
In the constructor we instantiate two nn.Linear modules and assign them as
member variables.
This Feature extractor class takes a... | [
"torch.nn.Dropout",
"torch.nn.ReLU",
"torch.nn.Linear"
] | [((899, 923), 'torch.nn.Linear', 'nn.Linear', (['(1)', 'latent_dim'], {}), '(1, latent_dim)\n', (908, 923), True, 'import torch.nn as nn\n'), ((945, 954), 'torch.nn.ReLU', 'nn.ReLU', ([], {}), '()\n', (952, 954), True, 'import torch.nn as nn\n'), ((973, 999), 'torch.nn.Dropout', 'nn.Dropout', ([], {'p': 'dropout_prob'}... |
# 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 required by applica... | [
"tensorflow.python.data.ops.dataset_ops.Dataset.from_tensors",
"tensorflow.contrib.distribute.python.combinations.combine",
"tensorflow.python.framework.constant_op.constant",
"numpy.ones",
"tensorflow.python.distribute.values.select_replica",
"tensorflow.python.framework.ops.device",
"json.dumps",
"t... | [((2753, 3033), 'tensorflow.contrib.distribute.python.combinations.combine', 'combinations.combine', ([], {'distribution': '[combinations.mirrored_strategy_with_gpu_and_cpu, combinations.\n mirrored_strategy_with_two_gpus, combinations.\n core_mirrored_strategy_with_gpu_and_cpu, combinations.\n core_mirrored_s... |
import numpy
import argparse
from matplotlib import colors
from src.powerspectrum import from_frequency_to_eta
from src.powerspectrum import fiducial_eor_power_spectrum
from src.radiotelescope import RadioTelescope
from src.plottools import plot_2dpower_spectrum
from src.plottools import plot_power_contours
from src... | [
"matplotlib.pyplot.tight_layout",
"matplotlib.pyplot.show",
"argparse.ArgumentParser",
"src.powerspectrum.fiducial_eor_power_spectrum",
"src.plottools.plot_2dpower_spectrum",
"src.covariance.calibrated_residual_error",
"matplotlib.colors.LogNorm",
"numpy.array",
"matplotlib.use",
"src.powerspectru... | [((663, 694), 'numpy.array', 'numpy.array', (['[1.0, 10.0, 100.0]'], {}), '([1.0, 10.0, 100.0])\n', (674, 694), False, 'import numpy\n'), ((984, 1011), 'numpy.array', 'numpy.array', (['[0.0001, 0.11]'], {}), '([0.0001, 0.11])\n', (995, 1011), False, 'import numpy\n'), ((1136, 1174), 'src.powerspectrum.from_frequency_to... |
import argparse, os, time, func_timeout
from shutil import copyfile
from .colorful import *
def secure_chained_vars(default_cfg, new_cfg, vb):
default_cfg_dict = default_cfg.__dict__
altered_cv = []
for key in default_cfg_dict:
if not key.endswith('_cv'): continue
o_key = key.replace('_cv',... | [
"json.dump",
"json.load",
"argparse.ArgumentParser",
"importlib.import_module",
"os.makedirs",
"os.path.basename",
"os.path.exists",
"json.dumps",
"glob.glob",
"func_timeout.func_set_timeout",
"shutil.copyfile"
] | [((4379, 4412), 'func_timeout.func_set_timeout', 'func_timeout.func_set_timeout', (['(60)'], {}), '(60)\n', (4408, 4412), False, 'import argparse, os, time, func_timeout\n'), ((2399, 2441), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""HMP"""'}), "(description='HMP')\n", (2422, 2441), F... |
# -*- coding: utf-8 -*-
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("gallery", "0004_responsiveimage_description")]
operations = [
migrations.AddField(
model_name="responsiveimage",
name="image_wide",
field=mo... | [
"django.db.models.FileField"
] | [((318, 414), 'django.db.models.FileField', 'models.FileField', ([], {'default': '""""""', 'upload_to': "b'images/responsive/wide'", 'verbose_name': '"""Bredformat"""'}), "(default='', upload_to=b'images/responsive/wide',\n verbose_name='Bredformat')\n", (334, 414), False, 'from django.db import migrations, models\n... |
import unittest
from django.conf import settings
from django.core.checks import Error, Warning
from django.core.checks.model_checks import _check_lazy_references
from django.core.exceptions import ImproperlyConfigured
from django.db import connection, connections, models
from django.db.models.functions import Lower
fr... | [
"django.db.connection.ops.max_name_length",
"unittest.skipIf",
"django.db.models.OneToOneField",
"django.db.models.ManyToManyField",
"django.test.utils.register_lookup",
"django.db.models.ForeignKey",
"django.db.models.CharField",
"django.db.models.PositiveIntegerField",
"django.db.models.Index",
... | [((961, 997), 'django.test.utils.isolate_apps', 'isolate_apps', (['"""invalid_models_tests"""'], {}), "('invalid_models_tests')\n", (973, 997), False, 'from django.test.utils import isolate_apps, override_settings, register_lookup\n'), ((4100, 4136), 'django.test.utils.isolate_apps', 'isolate_apps', (['"""invalid_model... |
import socket
class client:
def __init__(self):
self.clientSocket = self.setups.SocketSetup()
self.alias = ""
# Function for connecting to a server
def connect(self,alias,host,port):
try:
self.clienSocket.connect((host,port))
self.alias = alias
r... | [
"socket.socket"
] | [((1115, 1164), 'socket.socket', 'socket.socket', (['socket.AF_INET', 'socket.SOCK_STREAM'], {}), '(socket.AF_INET, socket.SOCK_STREAM)\n', (1128, 1164), False, 'import socket\n')] |
"""Support for Vallox ventilation units."""
from __future__ import annotations
from dataclasses import dataclass, field
import ipaddress
import logging
from typing import Any, NamedTuple
from uuid import UUID
from vallox_websocket_api import PROFILE as VALLOX_PROFILE, Vallox
from vallox_websocket_api.exceptions impor... | [
"homeassistant.helpers.config_validation.deprecated",
"homeassistant.helpers.update_coordinator.UpdateFailed",
"voluptuous.Optional",
"vallox_websocket_api.Vallox",
"voluptuous.All",
"voluptuous.Required",
"voluptuous.Clamp",
"dataclasses.field",
"vallox_websocket_api.vallox.get_uuid",
"voluptuous... | [((1162, 1189), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1179, 1189), False, 'import logging\n'), ((3251, 3278), 'dataclasses.field', 'field', ([], {'default_factory': 'dict'}), '(default_factory=dict)\n', (3256, 3278), False, 'from dataclasses import dataclass, field\n'), ((4578, ... |
# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
# SPDX-License-Identifier: MIT
import time
import board
import digitalio
import usb_hid
from adafruit_hid.keyboard import Keyboard
from adafruit_hid.keycode import Keycode
kbd = Keyboard(usb_hid.devices)
# define buttons. these can be any physical switch... | [
"digitalio.DigitalInOut",
"adafruit_hid.keyboard.Keyboard",
"time.sleep"
] | [((243, 268), 'adafruit_hid.keyboard.Keyboard', 'Keyboard', (['usb_hid.devices'], {}), '(usb_hid.devices)\n', (251, 268), False, 'from adafruit_hid.keyboard import Keyboard\n'), ((432, 464), 'digitalio.DigitalInOut', 'digitalio.DigitalInOut', (['board.D4'], {}), '(board.D4)\n', (454, 464), False, 'import digitalio\n'),... |
import socket
import re
import backoff
from . import basetest
from .runner import CfLocalRunnerWithPostgreSQL
# Constants
KAFKA_CLUSTER_IMAGE_NAME = "johnnypark/kafka-zookeeper"
KAFKA_CLUSTER_IMAGE_VERSION = "2.4.0"
KAFKA_CLUSTER_NAME = "kafka-cluster"
KAFKA_CONNECT_URL = "http://localhost:8083"
KAFKA_P... | [
"socket.socket",
"re.findall",
"backoff.on_predicate",
"backoff.on_exception"
] | [((2509, 2573), 'backoff.on_predicate', 'backoff.on_predicate', (['backoff.expo', '(lambda x: x > 0)'], {'max_time': '(30)'}), '(backoff.expo, lambda x: x > 0, max_time=30)\n', (2529, 2573), False, 'import backoff\n'), ((4465, 4568), 'backoff.on_exception', 'backoff.on_exception', (['backoff.constant', 'Exception'], {'... |
'''
Created on Nov 9, 2011
@author: ppa
'''
from analyzerdam.baseDAM import BaseDAM
from analyzerdam.excelLib import ExcelLib
from analyzer.model import TICK_FIELDS, QUOTE_FIELDS, Quote, Tick
from analyzer.lib.errors import UfException, Errors
from os import path
import logging
LOG = logging.getLogger()... | [
"analyzer.model.Quote",
"os.path.abspath",
"analyzer.model.Tick",
"analyzerdam.excelLib.ExcelLib",
"os.path.exists",
"analyzer.lib.errors.UfException",
"os.path.join",
"logging.getLogger"
] | [((301, 320), 'logging.getLogger', 'logging.getLogger', ([], {}), '()\n', (318, 320), False, 'import logging\n'), ((588, 644), 'os.path.join', 'path.join', (['self.__dir', "('%s-%s.xls' % (self.symbol, kind))"], {}), "(self.__dir, '%s-%s.xls' % (self.symbol, kind))\n", (597, 644), False, 'from os import path\n'), ((182... |
#!/usr/bin/env python
"""steam-swissapiknife test suite"""
from steamswissapiknife import main
import unittest
import os
from contextlib import contextmanager
import sys
if sys.version_info[0] < 3:
from StringIO import StringIO
else:
from io import StringIO
key = os.environ['STEAM_API_KEY']
@contextmanager
d... | [
"steamswissapiknife.main.main",
"io.StringIO",
"steamswissapiknife.main.parse_args"
] | [((645, 703), 'steamswissapiknife.main.parse_args', 'main.parse_args', (["['-f', 'wiki', '-i', 'ITFItems_440', key]"], {}), "(['-f', 'wiki', '-i', 'ITFItems_440', key])\n", (660, 703), False, 'from steamswissapiknife import main\n'), ((1129, 1187), 'steamswissapiknife.main.parse_args', 'main.parse_args', (["['-f', 'lis... |
# Copyright 2020 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... | [
"tensorflow.python.platform.test.main",
"threading.Thread",
"tensorflow.python.eager.context.context",
"tensorflow.python.eager.context._reset_context",
"tensorflow.python.distribute.combinations.combine",
"tensorflow.python.ops.collective_ops.all_reduce_v2",
"tensorflow.python.eager.def_function.functi... | [((2388, 2461), 'tensorflow.python.distribute.combinations.combine', 'combinations.combine', ([], {'device': '"""CPU"""', 'communication': '"""RING"""', 'required_gpus': '(0)'}), "(device='CPU', communication='RING', required_gpus=0)\n", (2408, 2461), False, 'from tensorflow.python.distribute import combinations\n'), (... |
from rest_framework.serializers import ModelSerializer
from formidable.constants import ID, NAME, DESCRIPTION, SECTIONS
from formidable.models import Form
from formidable.serializers.section import SectionMinimalSerializer
class FormSerializer(ModelSerializer):
sections = SectionMinimalSerializer(many=True, read... | [
"formidable.serializers.section.SectionMinimalSerializer"
] | [((280, 331), 'formidable.serializers.section.SectionMinimalSerializer', 'SectionMinimalSerializer', ([], {'many': '(True)', 'read_only': '(True)'}), '(many=True, read_only=True)\n', (304, 331), False, 'from formidable.serializers.section import SectionMinimalSerializer\n'), ((472, 523), 'formidable.serializers.section... |
import logging
from logging.handlers import RotatingFileHandler
from os import path
# 3 MB max files, up to 2 backup files.
logging.basicConfig(format='%(asctime)s %(levelname)s - %(message)s - [%(funcName)s:%(lineno)d]',
level=logging.INFO,
handlers=[RotatingFileHandler(path.re... | [
"os.path.relpath",
"logging.getLogger"
] | [((471, 504), 'logging.getLogger', 'logging.getLogger', (['"""pasoapasobot"""'], {}), "('pasoapasobot')\n", (488, 504), False, 'import logging\n'), ((313, 336), 'os.path.relpath', 'path.relpath', (['"""bot.log"""'], {}), "('bot.log')\n", (325, 336), False, 'from os import path\n')] |
# coding=utf-8
# Copyright 2020 The Mesh TensorFlow 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 by applicab... | [
"mesh_tensorflow.einsum",
"mesh_tensorflow.gather",
"mesh_tensorflow.concat",
"math.ceil",
"mesh_tensorflow.Dimension",
"mesh_tensorflow.layers.weights_nonzero",
"mesh_tensorflow.log_softmax",
"mesh_tensorflow.layers.softmax_cross_entropy_with_logits",
"mesh_tensorflow.cast",
"mesh_tensorflow.redu... | [((3763, 3822), 'math.ceil', 'math.ceil', (['(self._length_projection_factor * length_dim.size)'], {}), '(self._length_projection_factor * length_dim.size)\n', (3772, 3822), False, 'import math\n'), ((4553, 4650), 'mesh_tensorflow.one_hot', 'mtf.one_hot', (['(targets - self._start_token_id)', 'self._vocab_dim'], {'dtyp... |
# streamClientTCP.py
__author__ = 'William'
import json
from socket import *
# Set server ip and port
serverName = '192.168.43.28'
serverPort = 12000
# Create socket
clientSocket = socket(AF_INET, SOCK_STREAM)
# Connect to socket
clientSocket.connect((serverName, serverPort))
# Set request message to send
messageSi... | [
"json.dumps"
] | [((474, 494), 'json.dumps', 'json.dumps', (['sendInfo'], {}), '(sendInfo)\n', (484, 494), False, 'import json\n')] |
"""
Created on Mon Nov 23 2020
@author: <NAME>
"""
import numpy as np
from PIL import Image
import cv2
import time
import copy
import arcpy
from arcpy import env
from arcpy.sa import Viewshed2
#from arcpy.da import *
import gym
from gym import error, spaces, utils
from gym.utils import seeding
import matplotlib.pypl... | [
"math.atan2",
"gym.spaces.Discrete",
"arcpy.sa.Viewshed2",
"cv2.startWindowThread",
"arcpy.ClearWorkspaceCache_management",
"cv2.imshow",
"gym.utils.seeding.np_random",
"numpy.multiply",
"math.radians",
"numpy.max",
"cv2.destroyAllWindows",
"arcpy.NumPyArrayToRaster",
"cv2.resize",
"arcpy.... | [((518, 556), 'arcpy.ClearWorkspaceCache_management', 'arcpy.ClearWorkspaceCache_management', ([], {}), '()\n', (554, 556), False, 'import arcpy\n'), ((762, 809), 'arcpy.SpatialReference', 'arcpy.SpatialReference', (['"""WGS 1984 UTM Zone 18N"""'], {}), "('WGS 1984 UTM Zone 18N')\n", (784, 809), False, 'import arcpy\n'... |
import os
import shutil
import tensorflow as tf
import torch
from torch_mimicry.metrics import compute_fid
from torch_mimicry.metrics.inception_model import inception_utils
from torch_mimicry.nets.gan import gan
class ExampleGen(gan.BaseGenerator):
def __init__(self,
bottom_width=4,
... | [
"torch.ones",
"torch_mimicry.metrics.compute_fid.fid_score",
"os.path.abspath",
"os.makedirs",
"os.path.exists",
"tensorflow.ConfigProto",
"tensorflow.compat.v1.Session",
"torch_mimicry.metrics.compute_fid.compute_real_dist_stats",
"torch_mimicry.metrics.compute_fid.compute_gen_dist_stats",
"torch... | [((719, 752), 'torch.ones', 'torch.ones', (['x.shape[0]', '(3)', '(32)', '(32)'], {}), '(x.shape[0], 3, 32, 32)\n', (729, 752), False, 'import torch\n'), ((975, 994), 'torch.device', 'torch.device', (['"""cpu"""'], {}), "('cpu')\n", (987, 994), False, 'import torch\n'), ((1199, 1258), 'torch_mimicry.metrics.inception_m... |
from setuptools import setup
def read(file):
return open(file, 'r').read()
LONG_DESCRIPTION = read('README.md')
LICENSE = read('LICENSE.txt')
setup(
name='OceanLab',
version='0.1.0',
packages=['OceanLab'],
include_package_data=True,
description='Python functions for Physical Oceanography',
... | [
"setuptools.setup"
] | [((149, 976), 'setuptools.setup', 'setup', ([], {'name': '"""OceanLab"""', 'version': '"""0.1.0"""', 'packages': "['OceanLab']", 'include_package_data': '(True)', 'description': '"""Python functions for Physical Oceanography"""', 'long_description': 'LONG_DESCRIPTION', 'long_description_content_type': '"""text/markdown... |
#!/usr/bin/env python3
# Copyright (c) 2014 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or https://www.opensource.org/licenses/mit-license.php .
#
# Test proper accounting with malleable transactions
#
from test_framework.test_framework import BitcoinT... | [
"test_framework.util.gather_inputs",
"test_framework.util.connect_nodes",
"test_framework.util.assert_equal",
"test_framework.util.sync_blocks"
] | [((1388, 1456), 'test_framework.util.gather_inputs', 'gather_inputs', (['self.nodes[0]', '(starting_balance - (mining_reward - 2))'], {}), '(self.nodes[0], starting_balance - (mining_reward - 2))\n', (1401, 1456), False, 'from test_framework.util import assert_equal, connect_nodes, sync_blocks, gather_inputs\n'), ((180... |
from typing import Any, List, Literal, TypedDict
from .FHIR_CodeableConcept import FHIR_CodeableConcept
from .FHIR_Element import FHIR_Element
from .FHIR_Identifier import FHIR_Identifier
from .FHIR_Quantity import FHIR_Quantity
from .FHIR_string import FHIR_string
# The detailed description of a substance, typically... | [
"typing.TypedDict"
] | [((406, 911), 'typing.TypedDict', 'TypedDict', (['"""FHIR_SubstanceSpecification_Moiety"""', "{'id': FHIR_string, 'extension': List[Any], 'modifierExtension': List[Any],\n 'role': FHIR_CodeableConcept, 'identifier': FHIR_Identifier, 'name':\n FHIR_string, '_name': FHIR_Element, 'stereochemistry':\n FHIR_Codeab... |
from __future__ import print_function
import warnings
from setuptools import setup, find_packages, Extension
from setuptools.command.install import install
import numpy
from six.moves import input
# from theano.compat.six.moves import input
# Because many people neglected to run the pylearn2/utils/setup.py script
# ... | [
"numpy.get_include",
"warnings.warn",
"setuptools.command.install.install.run",
"six.moves.input",
"setuptools.find_packages"
] | [((576, 786), 'warnings.warn', 'warnings.warn', (['"""Cython was not found and hence pylearn2.utils._window_flip and pylearn2.utils._video and classes that depend on them (e.g. pylearn2.train_extensions.window_flip) will not be available"""'], {}), "(\n 'Cython was not found and hence pylearn2.utils._window_flip and... |
from unittest import TestCase
import numpy as np
from scvi.dataset import (
SyntheticDataset,
SyntheticRandomDataset,
SyntheticDatasetCorr,
ZISyntheticDatasetCorr,
)
from .utils import unsupervised_training_one_epoch
class TestSyntheticDataset(TestCase):
def test_train_one(self):
dataset... | [
"scvi.dataset.SyntheticDataset",
"scvi.dataset.ZISyntheticDatasetCorr",
"scvi.dataset.SyntheticRandomDataset",
"numpy.arange",
"scvi.dataset.SyntheticDatasetCorr",
"numpy.unique"
] | [((323, 367), 'scvi.dataset.SyntheticDataset', 'SyntheticDataset', ([], {'batch_size': '(10)', 'nb_genes': '(10)'}), '(batch_size=10, nb_genes=10)\n', (339, 367), False, 'from scvi.dataset import SyntheticDataset, SyntheticRandomDataset, SyntheticDatasetCorr, ZISyntheticDatasetCorr\n'), ((493, 539), 'scvi.dataset.Synth... |
# --------------
import numpy as np
import pandas as pd
from sklearn.model_selection import train_test_split
# path- variable storing file path
df = pd.read_csv(path)
df.head()
X = df.drop(["Price"] , axis = 1)
y = df["Price"]
X_train,X_test,y_train,y_test = train_test_split(X,y,test_size = 0.3, random_st... | [
"pandas.read_csv",
"sklearn.model_selection.train_test_split",
"sklearn.linear_model.Ridge",
"sklearn.metrics.r2_score",
"sklearn.model_selection.cross_val_score",
"sklearn.linear_model.LinearRegression",
"sklearn.preprocessing.PolynomialFeatures",
"sklearn.linear_model.Lasso"
] | [((155, 172), 'pandas.read_csv', 'pd.read_csv', (['path'], {}), '(path)\n', (166, 172), True, 'import pandas as pd\n'), ((273, 326), 'sklearn.model_selection.train_test_split', 'train_test_split', (['X', 'y'], {'test_size': '(0.3)', 'random_state': '(6)'}), '(X, y, test_size=0.3, random_state=6)\n', (289, 326), False, ... |
"""Tests for http_router"""
from datetime import datetime
from bareasgi import (
HttpRequest,
HttpResponse
)
from bareasgi.application import DEFAULT_NOT_FOUND_RESPONSE
from bareasgi.basic_router import BasicHttpRouter
async def ok_handler(_request: HttpRequest) -> HttpResponse:
"""Return OK"""
retur... | [
"bareasgi.HttpResponse",
"bareasgi.basic_router.BasicHttpRouter",
"datetime.datetime"
] | [((322, 339), 'bareasgi.HttpResponse', 'HttpResponse', (['(200)'], {}), '(200)\n', (334, 339), False, 'from bareasgi import HttpRequest, HttpResponse\n'), ((427, 470), 'bareasgi.basic_router.BasicHttpRouter', 'BasicHttpRouter', (['DEFAULT_NOT_FOUND_RESPONSE'], {}), '(DEFAULT_NOT_FOUND_RESPONSE)\n', (442, 470), False, '... |
#
# MIT License
#
# Copyright (c) 2020 Airbyte
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, pu... | [
"airbyte_cdk.logger.AirbyteLogger"
] | [((1673, 1688), 'airbyte_cdk.logger.AirbyteLogger', 'AirbyteLogger', ([], {}), '()\n', (1686, 1688), False, 'from airbyte_cdk.logger import AirbyteLogger\n')] |
import pandas as pd
import matplotlib.pyplot as plt
data = pd.read_csv("titanic.csv")#zadanie 1 i zadanie 2
data.columns
a = data.Survived
len(a)
data.Survived.value_counts()#zadanie 3
data2 = pd.read_csv("titanic.csv", index_col = "PassengerId")
data2
b = data2.loc[data2.Survived == 1]
c = data2... | [
"pandas.read_csv",
"matplotlib.pyplot.hist"
] | [((61, 87), 'pandas.read_csv', 'pd.read_csv', (['"""titanic.csv"""'], {}), "('titanic.csv')\n", (72, 87), True, 'import pandas as pd\n'), ((211, 262), 'pandas.read_csv', 'pd.read_csv', (['"""titanic.csv"""'], {'index_col': '"""PassengerId"""'}), "('titanic.csv', index_col='PassengerId')\n", (222, 262), True, 'import pa... |
# Copyright (C) 2019 Intel Corporation. All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
#
import collections
import board_cfg_lib
import common
PCI_HEADER = r"""
#ifndef PCI_DEVICES_H_
#define PCI_DEVICES_H_
"""
PCI_END_HEADER = r"""
#endif /* PCI_DEVICES_H_ */"""
HI_MMIO_OFFSET = 0
class Bar_Mem:
... | [
"common.undline_name",
"board_cfg_lib.get_info",
"common.round_up",
"collections.Counter",
"board_cfg_lib.handle_bios_info"
] | [((1688, 1719), 'common.round_up', 'common.round_up', (['bar_addr', 'size'], {}), '(bar_addr, size)\n', (1703, 1719), False, 'import common\n'), ((1951, 2030), 'board_cfg_lib.get_info', 'board_cfg_lib.get_info', (['common.BOARD_INFO_FILE', '"""<PCI_DEVICE>"""', '"""</PCI_DEVICE>"""'], {}), "(common.BOARD_INFO_FILE, '<P... |
import argparse
import os
import random
from math import log10
import torch.backends.cudnn as cudnn
import torch.optim as optim
import torch.optim.lr_scheduler as lr_scheduler
import torchvision.utils as vutils
from tensorboardX import SummaryWriter
from torch.autograd import Variable, grad
from data.UData import Cre... | [
"tensorboardX.SummaryWriter",
"argparse.ArgumentParser",
"os.makedirs",
"torch.autograd.Variable",
"data.UData.CreateDataLoader",
"torch.optim.lr_scheduler.ReduceLROnPlateau",
"math.log10",
"random.seed"
] | [((377, 402), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (400, 402), False, 'import argparse\n'), ((2927, 2954), 'random.seed', 'random.seed', (['opt.manualSeed'], {}), '(opt.manualSeed)\n', (2938, 2954), False, 'import random\n'), ((3105, 3160), 'tensorboardX.SummaryWriter', 'SummaryWriter... |
# -*- coding: utf-8 -*-
import os
import tempfile
import unittest
from django.conf import settings
from django.core.cache import cache
from django.core.validators import ValidationError
import mock
from nose.tools import assert_raises, eq_, raises
from amo.utils import (cache_ns_key, escape_all, LocalFileStorage,
... | [
"amo.utils.LocalFileStorage",
"amo.utils.rm_local_tmp_dir",
"os.mkdir",
"amo.utils.escape_all",
"os.remove",
"tempfile.mkstemp",
"django.core.cache.cache.clear",
"os.path.exists",
"mock.patch",
"tempfile.mkdtemp",
"amo.utils.resize_image",
"nose.tools.eq_",
"nose.tools.assert_raises",
"amo... | [((555, 612), 'nose.tools.assert_raises', 'assert_raises', (['ValidationError', 'slug_validator', '"""234.add"""'], {}), "(ValidationError, slug_validator, '234.add')\n", (568, 612), False, 'from nose.tools import assert_raises, eq_, raises\n'), ((617, 672), 'nose.tools.assert_raises', 'assert_raises', (['ValidationErr... |
from discord.ext import commands
import requests
import discord
class Ipfy(commands.Cog):
def __init__(self, client):
self.client = client
@commands.Cog.listener()
async def on_ready(self):
print('Ipfy cog loaded successfully')
@commands.command(aliases=['ip'],description="Shows the ... | [
"discord.Embed",
"discord.ext.commands.command",
"requests.get",
"discord.ext.commands.Cog.listener"
] | [((159, 182), 'discord.ext.commands.Cog.listener', 'commands.Cog.listener', ([], {}), '()\n', (180, 182), False, 'from discord.ext import commands\n'), ((265, 359), 'discord.ext.commands.command', 'commands.command', ([], {'aliases': "['ip']", 'description': '"""Shows the info about the given ip/webiste"""'}), "(aliase... |
import types
import typing
import traceback
import contextlib
import sys
from mitmproxy import exceptions
from mitmproxy import eventsequence
from mitmproxy import controller
from mitmproxy import flow
from . import ctx
import pprint
def _get_name(itm):
return getattr(itm, "name", itm.__class__.__name__.lower())... | [
"mitmproxy.exceptions.ControlException",
"traceback.format_exception",
"sys.exc_info",
"mitmproxy.exceptions.AddonManagerError",
"traceback.extract_tb"
] | [((664, 688), 'traceback.extract_tb', 'traceback.extract_tb', (['tb'], {}), '(tb)\n', (684, 688), False, 'import traceback\n'), ((979, 993), 'sys.exc_info', 'sys.exc_info', ([], {}), '()\n', (991, 993), False, 'import sys\n'), ((5869, 5943), 'mitmproxy.exceptions.ControlException', 'exceptions.ControlException', (["('M... |
import gettext
import json
from os import path
from django.conf import settings
from django.test import (
RequestFactory, SimpleTestCase, TestCase, modify_settings,
override_settings,
)
from django.test.selenium import SeleniumTestCase
from django.urls import reverse
from django.utils.translation import (
... | [
"gettext.translation",
"os.path.abspath",
"django.test.RequestFactory",
"django.test.modify_settings",
"django.views.i18n.JavaScriptCatalog.as_view",
"django.utils.translation.get_language",
"json.dumps",
"django.utils.translation.override",
"django.urls.reverse",
"django.test.override_settings",
... | [((463, 512), 'django.test.override_settings', 'override_settings', ([], {'ROOT_URLCONF': '"""view_tests.urls"""'}), "(ROOT_URLCONF='view_tests.urls')\n", (480, 512), False, 'from django.test import RequestFactory, SimpleTestCase, TestCase, modify_settings, override_settings\n'), ((8746, 8795), 'django.test.override_se... |
# BSD 3-Clause License
#
# Copyright (c) 2012, the Sentry Team, see AUTHORS for more details
# Copyright (c) 2019, Elasticsearch BV
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Red... | [
"platform.python_version",
"os.getppid",
"elasticapm.utils.cloud.aws_metadata",
"elasticapm.utils.compat.iteritems",
"elasticapm.utils.stacks.get_stack_info",
"elasticapm.conf.VersionedConfig",
"elasticapm.utils.stacks.get_culprit",
"logging.getLevelName",
"elasticapm.utils.stacks.get_path_regex",
... | [((3222, 3246), 'elasticapm.utils.logging.get_logger', 'get_logger', (['"""elasticapm"""'], {}), "('elasticapm')\n", (3232, 3246), False, 'from elasticapm.utils.logging import get_logger\n'), ((3380, 3432), 'elasticapm.utils.logging.get_logger', 'get_logger', (["('%s.%s' % (cls.__module__, cls.__name__))"], {}), "('%s.... |
from .client import PingboardClient
__version__ = '0.0.6'
import logging
try: # Python 2.7+
from logging import NullHandler
except ImportError:
class NullHandler(logging.Handler):
def emit(self, record):
pass
logging.getLogger('pyngboard').addHandler(NullHandler())
| [
"logging.getLogger",
"logging.NullHandler"
] | [((292, 305), 'logging.NullHandler', 'NullHandler', ([], {}), '()\n', (303, 305), False, 'from logging import NullHandler\n'), ((250, 280), 'logging.getLogger', 'logging.getLogger', (['"""pyngboard"""'], {}), "('pyngboard')\n", (267, 280), False, 'import logging\n')] |
import chainer
from chainer.dataset import dataset_mixin
class Cifar10Dataset(dataset_mixin.DatasetMixin):
def __init__(self, split='train'):
x_train, x_test = chainer.datasets.get_cifar10(ndim=3, withlabel=False,
scale=1.0)
if split == 'train... | [
"chainer.datasets.get_cifar10"
] | [((174, 238), 'chainer.datasets.get_cifar10', 'chainer.datasets.get_cifar10', ([], {'ndim': '(3)', 'withlabel': '(False)', 'scale': '(1.0)'}), '(ndim=3, withlabel=False, scale=1.0)\n', (202, 238), False, 'import chainer\n')] |
# Copyright (c) 2012--2014 King's College London
# Created by the Software Development Team <http://soft-dev.org/>
#
# 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, inclu... | [
"grammar_parser.gparser.Terminal",
"grammar_parser.gparser.Epsilon"
] | [((4883, 4914), 'grammar_parser.gparser.Terminal', 'Terminal', (['oldaction.action.prec'], {}), '(oldaction.action.prec)\n', (4891, 4914), False, 'from grammar_parser.gparser import Terminal, Nonterminal, Epsilon\n'), ((2211, 2228), 'grammar_parser.gparser.Terminal', 'Terminal', (['"""<eos>"""'], {}), "('<eos>')\n", (2... |
from django.db import models
# Create your models here.
from datetime import datetime
__doc__ = """
存储文件地址
历史记录
任务信息
注意,对 Model 的操作写在 Manage 中,不要把复杂操作写到 views 中
"""
class Host(models.Model):
ip = models.GenericIPAddressField(
'IP地址',
null=False,
blank=False,
default='127.0.0.1'
... | [
"django.db.models.URLField",
"django.db.models.CharField",
"django.db.models.ForeignKey",
"django.db.models.PositiveIntegerField",
"django.db.models.BooleanField",
"django.db.models.GenericIPAddressField",
"django.db.models.SmallIntegerField",
"django.db.models.DateTimeField",
"django.db.models.File... | [((205, 292), 'django.db.models.GenericIPAddressField', 'models.GenericIPAddressField', (['"""IP地址"""'], {'null': '(False)', 'blank': '(False)', 'default': '"""127.0.0.1"""'}), "('IP地址', null=False, blank=False, default=\n '127.0.0.1')\n", (233, 292), False, 'from django.db import models\n'), ((340, 398), 'django.db... |
import json
import os
from constants import DATA_PATH
from data_utils import DiffAST, DiffExample, DiffASTExample, CommentCategory
PARTITIONS = ['train', 'valid', 'test']
def get_data_splits(comment_type_str=None, ignore_ast=False):
"""Retrieves train/validation/test sets for the given comment_type_str.
c... | [
"json.load",
"data_utils.DiffAST.from_json",
"data_utils.DiffASTExample",
"data_utils.DiffExample",
"os.path.join",
"data_utils.CommentCategory"
] | [((1240, 1313), 'os.path.join', 'os.path.join', (['DATA_PATH', '"""resources"""', 'comment_type', '"""clean_test_ids.json"""'], {}), "(DATA_PATH, 'resources', comment_type, 'clean_test_ids.json')\n", (1252, 1313), False, 'import os\n'), ((2036, 2073), 'os.path.join', 'os.path.join', (['DATA_PATH', 'comment_type'], {}),... |
# Generated by Django 2.2.20 on 2021-06-03 14:22
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('analyzer', '0009_graphitevariable_period'),
]
operations = [
migrations.AlterField(
model_name='graphitevariable',
... | [
"django.db.models.CharField"
] | [((353, 408), 'django.db.models.CharField', 'models.CharField', ([], {'blank': '(True)', 'default': '""""""', 'max_length': '(12)'}), "(blank=True, default='', max_length=12)\n", (369, 408), False, 'from django.db import migrations, models\n')] |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
pymixer.py - wrapper for amixer command line tool
.. Created on 2017-07-05
.. Licence MIT
.. codeauthor:: <NAME> <<EMAIL>>, <EMAIL>
"""
import subprocess
import logging
class PyMixer(object):
"""
Wrapping class for linux command line ``amixer`` to get/set v... | [
"subprocess.check_output",
"logging.getLogger"
] | [((707, 735), 'logging.getLogger', 'logging.getLogger', (['"""PyMixer"""'], {}), "('PyMixer')\n", (724, 735), False, 'import logging\n'), ((1447, 1532), 'subprocess.check_output', 'subprocess.check_output', (["[self.amixer, 'get', 'Master']"], {'universal_newlines': '(True)'}), "([self.amixer, 'get', 'Master'], univers... |
"""
Basic statistics module.
This module provides functions for calculating statistics of data, including
averages, variance, and standard deviation.
Calculating averages
--------------------
================== ==================================================
Function Description
================== ==... | [
"itertools.repeat",
"math.exp",
"math.hypot",
"math.fabs",
"math.sqrt",
"bisect.bisect_right",
"random.Random",
"fractions.Fraction",
"math.fsum",
"math.isclose",
"itertools.groupby",
"collections.Counter",
"math.log",
"math.isfinite",
"bisect.bisect_left",
"operator.itemgetter",
"do... | [((4662, 4681), 'itertools.groupby', 'groupby', (['data', 'type'], {}), '(data, type)\n', (4669, 4681), False, 'from itertools import groupby\n'), ((8396, 8413), 'bisect.bisect_left', 'bisect_left', (['a', 'x'], {}), '(a, x)\n', (8407, 8413), False, 'from bisect import bisect_left, bisect_right\n'), ((8573, 8597), 'bis... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('api', '0053_ownedcard_skill'),
]
operations = [
migrations.AlterField(
model_name='activity',
name='... | [
"django.db.models.CharField"
] | [((348, 637), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(300)', 'choices': "[(b'Added a card', 'Added a card'), (b'Idolized a card', 'Idolized a card'),\n (b'Max Leveled a card', 'Max Leveled a card'), (b'Max Bonded a card',\n 'Max Bonded a card'), (b'Rank Up', 'Rank Up'), (b'Ranked i... |
"""
This is a data preparation script for the ASpIRE dataset. The following description
is taken from the LDC website:
ASpIRE Development and Development Test Sets was developed for the Automatic Speech
recognition In Reverberant Environments (ASpIRE) Challenge sponsored by IARPA
(the Intelligent Advanced Research P... | [
"lhotse.audio.RecordingSet.from_dir",
"lhotse.supervision.SupervisionSet.from_segments",
"lhotse.fix_manifests",
"collections.defaultdict",
"lhotse.validate_recordings_and_supervisions",
"pathlib.Path",
"lhotse.audio.RecordingSet.from_recordings"
] | [((2731, 2747), 'pathlib.Path', 'Path', (['corpus_dir'], {}), '(corpus_dir)\n', (2735, 2747), False, 'from pathlib import Path\n'), ((3707, 3724), 'collections.defaultdict', 'defaultdict', (['dict'], {}), '(dict)\n', (3718, 3724), False, 'from collections import defaultdict\n'), ((3778, 3794), 'pathlib.Path', 'Path', (... |
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: health_assessment_rule_version.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
f... | [
"google.protobuf.symbol_database.Default",
"google.protobuf.descriptor.FieldDescriptor",
"google.protobuf.reflection.GeneratedProtocolMessageType"
] | [((484, 510), 'google.protobuf.symbol_database.Default', '_symbol_database.Default', ([], {}), '()\n', (508, 510), True, 'from google.protobuf import symbol_database as _symbol_database\n'), ((6348, 6547), 'google.protobuf.reflection.GeneratedProtocolMessageType', '_reflection.GeneratedProtocolMessageType', (['"""Healt... |
# LIBTBX_SET_DISPATCHER_NAME prime.frame_extractor
"""
Author : Uervirojnangkoorn, M.
Desc : Taking the original code from xfel/command_line/frame_extractor.py
and adding by scan so that each scan is output as a single pickle file.
"""
from __future__ import absolute_import, division, print_fu... | [
"os.path.basename",
"os.path.isdir",
"cctbx.miller.set",
"dials.util.options.Importer",
"dials.array_family.flex.vec2_double",
"dials.array_family.flex.sqrt",
"dials.util.options.flatten_experiments",
"dials.util.options.flatten_reflections",
"os.path.isfile",
"libtbx.easy_pickle.dump",
"os.path... | [((10173, 10209), 'dials.util.options.OptionParser', 'OptionParser', ([], {'phil': 'master_phil_scope'}), '(phil=master_phil_scope)\n', (10185, 10209), False, 'from dials.util.options import Importer, flatten_reflections, flatten_experiments, OptionParser\n'), ((10314, 10432), 'dials.util.options.Importer', 'Importer',... |
# Copyright (c) 2015-2017, NVIDIA CORPORATION. All rights reserved.
import flask
import functools
import re
import werkzeug.exceptions
from .routing import get_request_arg, request_wants_json
def get_username():
return get_request_arg('username') or \
flask.request.cookies.get('username', None)
def ... | [
"functools.partial",
"re.match",
"flask.request.cookies.get",
"flask.url_for",
"functools.wraps"
] | [((1125, 1143), 'functools.wraps', 'functools.wraps', (['f'], {}), '(f)\n', (1140, 1143), False, 'import functools\n'), ((270, 313), 'flask.request.cookies.get', 'flask.request.cookies.get', (['"""username"""', 'None'], {}), "('username', None)\n", (295, 313), False, 'import flask\n'), ((497, 524), 're.match', 're.matc... |
import json
import uuid
from collections import defaultdict
import factory
import wagtail_factories
from django.core.files.uploadedfile import SimpleUploadedFile
from django.core.serializers.json import DjangoJSONEncoder
from wagtail.core.blocks import RichTextBlock
from wagtail.core.rich_text import RichText
from hy... | [
"factory.django.ImageField",
"wagtail.core.rich_text.RichText",
"factory.Faker",
"uuid.uuid4",
"json.loads",
"factory.django.FileField",
"factory.SubFactory",
"json.dumps",
"collections.defaultdict"
] | [((3227, 3252), 'factory.Faker', 'factory.Faker', (['"""sentence"""'], {}), "('sentence')\n", (3240, 3252), False, 'import factory\n'), ((3271, 3296), 'factory.Faker', 'factory.Faker', (['"""sentence"""'], {}), "('sentence')\n", (3284, 3296), False, 'import factory\n'), ((3797, 3822), 'factory.Faker', 'factory.Faker', ... |
"""The db model for a user."""
from sqlalchemy import Column, func
from sqlalchemy.orm import relationship
from sqlalchemy.types import (
Boolean,
DateTime,
String,
)
from pornhub.db import base
class User(base):
"""The model for a user."""
__tablename__ = "user"
USER = "users"
MODEL = ... | [
"sqlalchemy.orm.relationship",
"sqlalchemy.func.now",
"sqlalchemy.Column"
] | [((365, 397), 'sqlalchemy.Column', 'Column', (['String'], {'primary_key': '(True)'}), '(String, primary_key=True)\n', (371, 397), False, 'from sqlalchemy import Column, func\n'), ((409, 436), 'sqlalchemy.Column', 'Column', (['String'], {'unique': '(True)'}), '(String, unique=True)\n', (415, 436), False, 'from sqlalchem... |
# Copyright 2020 <NAME>
# SPDX-License-Identifier: Apache-2.0
'''
batch and commandline utilities
'''
from __future__ import print_function
import gc
import os
import ssl
import sys
import site
import shlex
import logging
import warnings
import argparse
import platform
import resource
import subprocess
import time
if ... | [
"sys.stdout.write",
"logging.addLevelName",
"subprocess.list2cmdline",
"logging.Formatter",
"gc.collect",
"pathlib.Path",
"sys.stdout.flush",
"resource.getrusage",
"subprocess.check_call",
"numpy.set_printoptions",
"logging.FileHandler",
"logging.log",
"shlex.split",
"site.getsitepackages"... | [((380, 407), 'warnings.warn', 'warnings.warn', (['"""old python"""'], {}), "('old python')\n", (393, 407), False, 'import warnings\n'), ((6927, 6946), 'logging.getLogger', 'logging.getLogger', ([], {}), '()\n', (6944, 6946), False, 'import logging\n'), ((8334, 8365), 'logging.getLogger', 'logging.getLogger', (['"""ten... |
"""Update old version URIs to be the same as the latest version
Revision ID: 2018_05_17_unify_uris
Revises: 2018_05_04_coalesce_contacts
Create Date: 2018-05-17 11:50:00.000000
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = "2018_05_17_unify_uris"
down_revisio... | [
"alembic.op.execute",
"alembic.op.get_bind"
] | [((534, 547), 'alembic.op.get_bind', 'op.get_bind', ([], {}), '()\n', (545, 547), False, 'from alembic import op\n'), ((552, 888), 'alembic.op.execute', 'op.execute', (['"""\n UPDATE page\n SET uri = subquery.uri\n FROM (SELECT guid, uri\n FROM page\n WHERE external_edit_s... |
"""
Models
"""
from typing import Iterator, List, Optional, Set
import mongoengine as me
from sni.esi.scope import EsiScope
import sni.utils as utils
class Alliance(me.Document):
"""
EVE alliance database model.
"""
SCHEMA_VERSION = 3
"""Latest schema version for this collection"""
_versi... | [
"mongoengine.ReferenceField",
"mongoengine.BooleanField",
"mongoengine.DateTimeField",
"mongoengine.IntField",
"mongoengine.StringField"
] | [((325, 360), 'mongoengine.IntField', 'me.IntField', ([], {'default': 'SCHEMA_VERSION'}), '(default=SCHEMA_VERSION)\n', (336, 360), True, 'import mongoengine as me\n'), ((422, 446), 'mongoengine.IntField', 'me.IntField', ([], {'unique': '(True)'}), '(unique=True)\n', (433, 446), True, 'import mongoengine as me\n'), ((5... |
# -*- coding: utf-8 -*-
# @Time : 2018/8/21 下午4:25
# @Author : <NAME>
# @Email : <EMAIL>
# @File : connect_database.py
# @Software: PyCharm
'''
为了标准化,在设计初始阶段,主要分三个模块用来测试;
这是第一个模块,即,与数据库交互的功能部分;
数据库名:fanuc
表名:session
用户名:fanuc
密码:<PASSWORD>
请尽量按照此标准进行
'''
import pymysql
#host=self.hostname, user=self.user,... | [
"pymysql.connect"
] | [((1120, 1145), 'pymysql.connect', 'pymysql.connect', ([], {}), '(**config)\n', (1135, 1145), False, 'import pymysql\n')] |
# Copyright Materialize, Inc. and contributors. All rights reserved.
#
# Use of this software is governed by the Business Source License
# included in the LICENSE file at the root of this repository.
#
# As of the Change Date specified in that file, in accordance with
# the Business Source License, use of this software... | [
"materialize.mzcompose.Materialized",
"materialize.mzcompose.SchemaRegistry",
"materialize.mzcompose.Kafka",
"os.environ.pop",
"materialize.mzcompose.Testdrive",
"materialize.mzcompose.Zookeeper"
] | [((535, 666), 'materialize.mzcompose.Materialized', 'Materialized', ([], {'options': '"""--persistent-user-tables --persistent-kafka-upsert-source --disable-persistent-system-tables-test"""'}), "(options=\n '--persistent-user-tables --persistent-kafka-upsert-source --disable-persistent-system-tables-test'\n )\n",... |
#!/usr/bin/python
# Copyright (C) <NAME> 2006.
# Distributed under the Boost Software License, Version 1.0. (See
# accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
import BoostBuild
t = BoostBuild.Tester()
t.write("jamroot.jam", """
exe a1 : a1.cpp : <conditional>@a1-... | [
"BoostBuild.Tester"
] | [((234, 253), 'BoostBuild.Tester', 'BoostBuild.Tester', ([], {}), '()\n', (251, 253), False, 'import BoostBuild\n')] |
import settings
import handlers.base_handler
import csv
class CartogramHandler(handlers.base_handler.BaseCartogramHandler):
def get_name(self):
return "Bangladesh"
def get_gen_file(self):
return "{}/bangladesh_processedmap.json".format(settings.CARTOGRAM_DATA_DIR)
def validate_values... | [
"csv.reader"
] | [((849, 868), 'csv.reader', 'csv.reader', (['csvfile'], {}), '(csvfile)\n', (859, 868), False, 'import csv\n')] |
# Generated by Django 3.1 on 2020-08-28 01:34
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("automation", "0004_auto_20200617_0332"),
("agents", "0012_auto_20200810_0544"),
("winupdate", "0002_auto_20200... | [
"django.db.models.ForeignKey"
] | [((474, 620), 'django.db.models.ForeignKey', 'models.ForeignKey', ([], {'blank': '(True)', 'null': '(True)', 'on_delete': 'django.db.models.deletion.CASCADE', 'related_name': '"""winupdatepolicy"""', 'to': '"""automation.policy"""'}), "(blank=True, null=True, on_delete=django.db.models.\n deletion.CASCADE, related_n... |
# 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"); you may not u... | [
"pandas.DataFrame",
"logging.error",
"logging.debug",
"logging.warning",
"datetime.datetime.strptime",
"re.search"
] | [((1101, 1150), 'logging.debug', 'logging.debug', (['"""Initiating schemaReader.source()"""'], {}), "('Initiating schemaReader.source()')\n", (1114, 1150), False, 'import logging\n'), ((1357, 1415), 'logging.debug', 'logging.debug', (['"""Executing schemaReader.readTableColumns()"""'], {}), "('Executing schemaReader.re... |
#!/usr/bin/env python
# Copyright 2018 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 applicable law or a... | [
"tensorflow_hub.image_embedding_column",
"tensorflow.feature_column.categorical_column_with_vocabulary_list",
"tensorflow.metrics.accuracy",
"tensorflow.feature_column.embedding_column",
"math.ceil",
"tensorflow.contrib.estimator.add_metrics",
"tensorflow.metrics.recall",
"tensorflow.train.AdagradOpti... | [((2232, 2356), 'tensorflow.feature_column.categorical_column_with_vocabulary_list', 'tf.feature_column.categorical_column_with_vocabulary_list', (['"""subspecies"""'], {'vocabulary_list': 'BEE_SUBSPECIES', 'default_value': '(0)'}), "('subspecies',\n vocabulary_list=BEE_SUBSPECIES, default_value=0)\n", (2289, 2356),... |
"""Data Processor.
Crunches the numbers and calculates the time left, as well as writes the status
file so we only need to code that once.
Author:
<NAME> <<EMAIL>>
"""
import datetime
from utils.slacker import Slacker
def process_data(step, epoch, accuracy, loss, rate, status_file_path,
validat... | [
"utils.slacker.Slacker.send_message",
"datetime.timedelta",
"datetime.datetime.now"
] | [((1535, 1572), 'datetime.timedelta', 'datetime.timedelta', ([], {'seconds': 'time_left'}), '(seconds=time_left)\n', (1553, 1572), False, 'import datetime\n'), ((1593, 1616), 'datetime.datetime.now', 'datetime.datetime.now', ([], {}), '()\n', (1614, 1616), False, 'import datetime\n'), ((2710, 2733), 'datetime.datetime.... |
import esphome.codegen as cg
import esphome.config_validation as cv
from esphome.components import spi, pn532
from esphome.const import CONF_ID
AUTO_LOAD = ["pn532"]
CODEOWNERS = ["@OttoWinter", "@jesserockz"]
DEPENDENCIES = ["spi"]
MULTI_CONF = True
pn532_spi_ns = cg.esphome_ns.namespace("pn532_spi")
PN532Spi = pn53... | [
"esphome.components.pn532.setup_pn532",
"esphome.components.spi.spi_device_schema",
"esphome.components.spi.register_spi_device",
"esphome.codegen.new_Pvariable",
"esphome.config_validation.GenerateID",
"esphome.config_validation.declare_id",
"esphome.codegen.esphome_ns.namespace"
] | [((268, 304), 'esphome.codegen.esphome_ns.namespace', 'cg.esphome_ns.namespace', (['"""pn532_spi"""'], {}), "('pn532_spi')\n", (291, 304), True, 'import esphome.codegen as cg\n'), ((605, 638), 'esphome.codegen.new_Pvariable', 'cg.new_Pvariable', (['config[CONF_ID]'], {}), '(config[CONF_ID])\n', (621, 638), True, 'impor... |
import unittest
import numpy as np
from collections import namedtuple
from pyrostest import RosTest, with_launch_file, launch_node
from process.bearing import calculate_directions
from sensor_msgs.msg import NavSatFix
from std_msgs.msg import Float64
fix = namedtuple('fix', ['latitude', 'longitude'])
class TestBear... | [
"process.bearing.calculate_directions.get_distance",
"numpy.isclose",
"pyrostest.with_launch_file",
"collections.namedtuple",
"pyrostest.launch_node",
"sensor_msgs.msg.NavSatFix"
] | [((259, 303), 'collections.namedtuple', 'namedtuple', (['"""fix"""', "['latitude', 'longitude']"], {}), "('fix', ['latitude', 'longitude'])\n", (269, 303), False, 'from collections import namedtuple\n'), ((589, 641), 'pyrostest.with_launch_file', 'with_launch_file', (['"""buzzmobile"""', '"""test_params.launch"""'], {}... |
import requests
def do_post(url, input, headers=None, quiet=False, json=False, debug=False):
# NOTE: Using python to do this is slow compared with running curl
# directly on the command line (or some other purpose-built tool).
# As a result this mustn't be used for performance testing
if debug:
... | [
"requests.post"
] | [((538, 585), 'requests.post', 'requests.post', (['url'], {'json': 'input', 'headers': 'headers'}), '(url, json=input, headers=headers)\n', (551, 585), False, 'import requests\n'), ((615, 662), 'requests.post', 'requests.post', (['url'], {'data': 'input', 'headers': 'headers'}), '(url, data=input, headers=headers)\n', ... |
# Copyright (c) 2021 PaddlePaddle 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 app... | [
"unittest.main",
"paddle.fluid.tests.unittests.op_test.skip_check_grad_ci",
"math.ceil",
"paddle.enable_static",
"numpy.zeros",
"numpy.transpose",
"math.floor",
"numpy.random.random",
"numpy.array"
] | [((2692, 2765), 'paddle.fluid.tests.unittests.op_test.skip_check_grad_ci', 'skip_check_grad_ci', ([], {'reason': '"""Haven not implement interpolate grad kernel."""'}), "(reason='Haven not implement interpolate grad kernel.')\n", (2710, 2765), False, 'from paddle.fluid.tests.unittests.op_test import skip_check_grad_ci\... |
from typing import AnyStr, ByteString, Callable, List, Sequence, TypeVar, Union
import numpy as np
ReturnType = TypeVar("ReturnType")
dtype_dict = {
"float": "FLOAT",
"double": "DOUBLE",
"float32": "FLOAT",
"float64": "DOUBLE",
"int8": "INT8",
"int16": "INT16",
"int32": "INT32",
"int6... | [
"typing.TypeVar",
"numpy.dtype",
"numpy.frombuffer",
"numpy.fromstring"
] | [((114, 135), 'typing.TypeVar', 'TypeVar', (['"""ReturnType"""'], {}), "('ReturnType')\n", (121, 135), False, 'from typing import AnyStr, ByteString, Callable, List, Sequence, TypeVar, Union\n'), ((1477, 1510), 'numpy.fromstring', 'np.fromstring', (['value'], {'dtype': 'dtype'}), '(value, dtype=dtype)\n', (1490, 1510),... |
import numpy as np
from path import Path
import scipy.misc
from collections import Counter
import matplotlib.pyplot as plt
class KittiRawLoader(object):
def __init__(self,
dataset_dir,
static_frames_file=None,
img_height=128,
img_width=416,
... | [
"numpy.eye",
"numpy.fromfile",
"collections.Counter",
"numpy.zeros",
"numpy.genfromtxt",
"path.Path",
"numpy.linalg.norm",
"numpy.reshape",
"numpy.int",
"numpy.array",
"numpy.where",
"numpy.dot",
"numpy.round"
] | [((869, 886), 'path.Path', 'Path', (['dataset_dir'], {}), '(dataset_dir)\n', (873, 886), False, 'from path import Path\n'), ((4336, 4395), 'numpy.reshape', 'np.reshape', (["filedata['P_rect_' + scene_data['cid']]", '(3, 4)'], {}), "(filedata['P_rect_' + scene_data['cid']], (3, 4))\n", (4346, 4395), True, 'import numpy ... |
import json
import logging
import numpy as np
import pathlib
import pickle
import random
from sklearn.preprocessing import LabelEncoder
import torch
import torch.utils.data
class TranscribedDataset():
le = None
sos = '<sos>'
eos = '<eos>'
pad = '<pad>'
unk = '<unk>'
@classmethod
def init_... | [
"json.load",
"torch.stack",
"random.sample",
"torch.load",
"sklearn.preprocessing.LabelEncoder",
"pathlib.Path",
"pickle.load",
"numpy.memmap",
"torch.tensor",
"torch.from_numpy"
] | [((9024, 9046), 'torch.stack', 'torch.stack', (['images', '(0)'], {}), '(images, 0)\n', (9035, 9046), False, 'import torch\n'), ((370, 384), 'sklearn.preprocessing.LabelEncoder', 'LabelEncoder', ([], {}), '()\n', (382, 384), False, 'from sklearn.preprocessing import LabelEncoder\n'), ((1977, 1995), 'pathlib.Path', 'pat... |
# Clyde 'Thluffy' Sinclair
# SoftDev -- Rona Ed.
# Oct 2020
from flask import Flask
app = Flask(__name__) # create instance of class Flask
@app.route("/") # assign fxn to route
def hello_world():
print("the __name__ of this module is... ")
# Still should print '__main__' in `python app.py`
# and with `... | [
"flask.Flask"
] | [((91, 106), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (96, 106), False, 'from flask import Flask\n')] |
# Capstone Python bindings, by <NAME> <<EMAIL>>
import sys
from platform import system
_python2 = sys.version_info[0] < 3
if _python2:
range = xrange
__all__ = [
'Cs',
'CsInsn',
'cs_disasm_quick',
'cs_disasm_lite',
'cs_version',
'cs_support',
'version_bind',
'debug',
'CS_API_M... | [
"ctypes.c_int",
"ctypes.c_size_t",
"ctypes.byref",
"ctypes.cdll.LoadLibrary",
"pkg_resources.resource_filename",
"ccapstone.Cs",
"ctypes.cast",
"inspect.currentframe",
"os.path.split",
"os.path.join",
"ccapstone.debug",
"ctypes.POINTER"
] | [((6144, 6160), 'os.path.join', 'join', (['path', '_lib'], {}), '(path, _lib)\n', (6148, 6160), False, 'from os.path import split, join, dirname\n'), ((6791, 6839), 'pkg_resources.resource_filename', 'pkg_resources.resource_filename', (['__name__', '"""lib"""'], {}), "(__name__, 'lib')\n", (6822, 6839), False, 'import ... |