code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
import re
import setuptools
README_FILENAME = "README.md"
VERSION_FILENAME = "observed.py"
VERSION_RE = r"^__version__ = ['\"]([^'\"]*)['\"]"
# Get version information
with open(VERSION_FILENAME, "r") as version_file:
mo = re.search(VERSION_RE, version_file.read(), re.M)
if mo:
version = mo.group(1)
else:
... | [
"setuptools.setup"
] | [((547, 1019), 'setuptools.setup', 'setuptools.setup', ([], {'name': '"""observed"""', 'version': 'version', 'author': '"""<NAME>"""', 'author_email': '"""<EMAIL>"""', 'description': '"""Observer pattern for functions and bound methods"""', 'long_description': 'long_description', 'long_description_content_type': '"""te... |
import os
import json
import numpy as np
import pickle
from typing import Any
from pycocotools.coco import COCO
from torch.utils.data import Dataset
class DetectionMSCOCODataset(Dataset):
def __init__(self, annotation_file: str, image_dir: str):
self._annotation_file = annotation_file
self._imag... | [
"os.path.exists",
"pickle.dump",
"pycocotools.coco.COCO",
"os.path.join",
"pickle.load",
"numpy.array",
"json.load"
] | [((420, 447), 'pycocotools.coco.COCO', 'COCO', (['self._annotation_file'], {}), '(self._annotation_file)\n', (424, 447), False, 'from pycocotools.coco import COCO\n'), ((1061, 1093), 'os.path.exists', 'os.path.exists', (['self._cache_file'], {}), '(self._cache_file)\n', (1075, 1093), False, 'import os\n'), ((1572, 1584... |
#!/usr/bin/python
# *****************************************************************************
#
# 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 A... | [
"logging.basicConfig",
"json.dumps",
"logging.info",
"sys.exit"
] | [((1413, 1539), 'logging.basicConfig', 'logging.basicConfig', ([], {'format': '"""%(levelname)-8s [%(asctime)s] %(message)s"""', 'level': 'logging.DEBUG', 'filename': 'local_log_filepath'}), "(format='%(levelname)-8s [%(asctime)s] %(message)s',\n level=logging.DEBUG, filename=local_log_filepath)\n", (1432, 1539), ... |
# usr/bin/env python
"""Functions to cluster using UPGMA
upgma takes an dictionary of pair tuples mapped to distances as input.
UPGMA_cluster takes an array and a list of PhyloNode objects corresponding
to the array as input. Can also generate this type of input from a DictArray using
inputs_from_dict_array function.... | [
"numpy.eye",
"numpy.average",
"cogent3.core.tree.PhyloNode",
"cogent3.util.dict_array.DictArray",
"numpy.take",
"numpy.argmin",
"numpy.ravel"
] | [((1128, 1157), 'cogent3.util.dict_array.DictArray', 'DictArray', (['pairwise_distances'], {}), '(pairwise_distances)\n', (1137, 1157), False, 'from cogent3.util.dict_array import DictArray\n'), ((1944, 1957), 'numpy.ravel', 'ravel', (['matrix'], {}), '(matrix)\n', (1949, 1957), False, 'from numpy import argmin, array,... |
#this code will generate the structural verilog for a single entry in the register file
#takes in the output file manager, the entry number, the number of bits, the number of reads, and the width of the
#tristate buffers on the read outputs
#expects the same things as make_store_cell, ensure code is valid there
#<NAM... | [
"make_store_cell.make_store_cell"
] | [((608, 684), 'make_store_cell.make_store_cell', 'make_store_cell', (['out_file', 'entry_number', 'bit', 'reads', 'buff_width', 'regfile_num'], {}), '(out_file, entry_number, bit, reads, buff_width, regfile_num)\n', (623, 684), False, 'from make_store_cell import make_store_cell\n')] |
"""API for AVB"""
import json
import sys
import requests
def actualite_found ():
osm = "https://opendata.bruxelles.be/api/datasets/1.0/search/?q="
data = {
"nhits":0,
"parameters":{
"dataset":"actualites-ville-de-bruxelles",
"timezone":"UTC",
"q":"actualite",
"langu... | [
"requests.get"
] | [((501, 524), 'requests.get', 'requests.get', (['osm', 'data'], {}), '(osm, data)\n', (513, 524), False, 'import requests\n')] |
from django.contrib.auth.models import User
from rest_framework import viewsets, status
from rest_framework.response import Response
from rest_framework.permissions import IsAuthenticated, IsAdminUser
from api.serializers import TODOListSerializer
from api.models import TODOList
class TODOListViewSet(viewsets.ModelVi... | [
"api.models.TODOList.objects.filter"
] | [((491, 539), 'api.models.TODOList.objects.filter', 'TODOList.objects.filter', ([], {'owner': 'self.request.user'}), '(owner=self.request.user)\n', (514, 539), False, 'from api.models import TODOList\n')] |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
def copy_existing_referrals_into_new_field(apps, schema_editor):
Pledge = apps.get_model('donation', 'Pledge')
Referral = apps.get_model('donation', 'Referral')
reason... | [
"django.db.migrations.RunPython",
"django.db.models.AutoField",
"django.db.models.CharField",
"django.db.models.ForeignKey"
] | [((1474, 1534), 'django.db.migrations.RunPython', 'migrations.RunPython', (['copy_existing_referrals_into_new_field'], {}), '(copy_existing_referrals_into_new_field)\n', (1494, 1534), False, 'from django.db import migrations, models\n'), ((1301, 1463), 'django.db.models.ForeignKey', 'models.ForeignKey', ([], {'on_delet... |
import heapq
import time
from os import path
from math import floor
class Heap:
def __init__(self):
self.size = 0
self.array = []
self.v2index_map = {}
def __get_parent_index(self, idx):
return int(floor((idx - 1) / 2))
def __get_left_child_index(self, idx):
retur... | [
"math.floor",
"os.path.join",
"heapq.heappop",
"heapq.heappush",
"time.time"
] | [((3047, 3075), 'heapq.heappush', 'heapq.heappush', (['heap', '(0, 1)'], {}), '(heap, (0, 1))\n', (3061, 3075), False, 'import heapq\n'), ((5116, 5127), 'time.time', 'time.time', ([], {}), '()\n', (5125, 5127), False, 'import time\n'), ((5372, 5383), 'time.time', 'time.time', ([], {}), '()\n', (5381, 5383), False, 'imp... |
# -*- coding: utf-8 -*-
"""Test the terminaltables output adapter."""
from __future__ import unicode_literals
from textwrap import dedent
import pytest
from cli_helpers.compat import HAS_PYGMENTS
from cli_helpers.tabular_output import terminaltables_adapter
if HAS_PYGMENTS:
from pygments.style import Style
... | [
"cli_helpers.tabular_output.terminaltables_adapter.style_output_table",
"textwrap.dedent",
"pytest.mark.skipif"
] | [((834, 910), 'pytest.mark.skipif', 'pytest.mark.skipif', (['(not HAS_PYGMENTS)'], {'reason': '"""requires the Pygments library"""'}), "(not HAS_PYGMENTS, reason='requires the Pygments library')\n", (852, 910), False, 'import pytest\n'), ((1243, 1293), 'cli_helpers.tabular_output.terminaltables_adapter.style_output_tab... |
#!/usr/bin/python3
# -*- coding:utf-8 -*-
# __author__ = '__MeGustas__'
from django.test import TestCase
from django.db import connection
from tutorials.create_table.models import *
# Create your tests here.
class TestHealthFile(TestCase):
def setUp(self):
cursor = connection.cursor()
# Popul... | [
"django.db.connection.cursor"
] | [((284, 303), 'django.db.connection.cursor', 'connection.cursor', ([], {}), '()\n', (301, 303), False, 'from django.db import connection\n')] |
import sys
sys.path.append("..") # change environment to see tools
from make_hydrodem import bathymetricGradient
workspace = r"" # path to geodatabase to use as a workspace
snapGrid = r"" # path to snapping grid
hucPoly = r"" # path to local folder polygon
hydrographyArea = r"" # path to NHD area feature class... | [
"sys.path.append",
"make_hydrodem.bathymetricGradient"
] | [((12, 33), 'sys.path.append', 'sys.path.append', (['""".."""'], {}), "('..')\n", (27, 33), False, 'import sys\n'), ((482, 605), 'make_hydrodem.bathymetricGradient', 'bathymetricGradient', (['workspace', 'snapGrid', 'hucPoly', 'hydrographyArea', 'hydrographyFlowline', 'hydrographyWaterbody', 'cellsize'], {}), '(workspa... |
# -*- coding: utf-8 -*-
# @Time: 2020/11/8 23:47
# @Author: GraceKoo
# @File: test.py
# @Desc:
from threading import Thread
import time
def print_numbers():
time.sleep(0.2)
print("子线程结束")
if __name__ == "__main__":
t1 = Thread(target=print_numbers)
t1.setDaemon(True)
t1.start()
# print("主线程结... | [
"threading.Thread",
"time.sleep"
] | [((163, 178), 'time.sleep', 'time.sleep', (['(0.2)'], {}), '(0.2)\n', (173, 178), False, 'import time\n'), ((236, 264), 'threading.Thread', 'Thread', ([], {'target': 'print_numbers'}), '(target=print_numbers)\n', (242, 264), False, 'from threading import Thread\n')] |
"""
Django settings for massenergize_portal_backend project.
Generated by 'django-admin startproject' using Django 2.1.4.
For more information on this file, see
https://docs.djangoproject.com/en/2.1/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.1/ref/setting... | [
"firebase_admin.initialize_app",
"os.environ.get",
"os.environ.update",
"firebase_admin.credentials.Certificate",
"os.path.abspath"
] | [((814, 844), 'os.environ.update', 'os.environ.update', (['CONFIG_DATA'], {}), '(CONFIG_DATA)\n', (831, 844), False, 'import os\n'), ((2574, 2609), 'os.environ.get', 'os.environ.get', (['"""AWS_ACCESS_KEY_ID"""'], {}), "('AWS_ACCESS_KEY_ID')\n", (2588, 2609), False, 'import os\n'), ((2637, 2676), 'os.environ.get', 'os.... |
import asyncio
# from aiorpcgrid.client import Client
from aiorpcgrid.task import AsyncTask, State
class AsyncClient:
_provider = None
_method = None
_requests: dict = {}
_running = True
_request_queue: asyncio.Queue = asyncio.Queue()
_loop = None
def __init__(self, provider, loop=None):... | [
"asyncio.get_event_loop",
"asyncio.Queue",
"aiorpcgrid.task.AsyncTask"
] | [((242, 257), 'asyncio.Queue', 'asyncio.Queue', ([], {}), '()\n', (255, 257), False, 'import asyncio\n'), ((399, 423), 'asyncio.get_event_loop', 'asyncio.get_event_loop', ([], {}), '()\n', (421, 423), False, 'import asyncio\n'), ((2319, 2330), 'aiorpcgrid.task.AsyncTask', 'AsyncTask', ([], {}), '()\n', (2328, 2330), Fa... |
# Copyright 2020, OpenTelemetry 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 applicable law or agreed to i... | [
"logging.getLogger",
"opentelemetry.sdk.extension.aws.trace.propagation.aws_xray_format.AwsXRayFormat",
"importlib.import_module",
"os.environ.get",
"opentelemetry.trace.get_tracer_provider",
"wrapt.wrap_function_wrapper"
] | [((1755, 1782), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1772, 1782), False, 'import logging\n'), ((1990, 2011), 'opentelemetry.trace.get_tracer_provider', 'get_tracer_provider', ([], {}), '()\n', (2009, 2011), False, 'from opentelemetry.trace import SpanKind, get_tracer, get_trace... |
# Generated by Django 4.0.2 on 2022-04-01 16:09
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('instructors', '0020_alter_user_description_alter_user_title'),
]
operations = [
migrations.AlterField(
model_name='user',
... | [
"django.db.models.ImageField"
] | [((363, 457), 'django.db.models.ImageField', 'models.ImageField', ([], {'default': '"""profile_pics/einstein_EqBibwO.jpeg"""', 'upload_to': '"""profile_pics"""'}), "(default='profile_pics/einstein_EqBibwO.jpeg', upload_to=\n 'profile_pics')\n", (380, 457), False, 'from django.db import migrations, models\n')] |
"""
@author : <NAME>
"""
from __future__ import division
import sys
import unittest
from nose.plugins.skip import SkipTest
from jv import JvWorker
from quantecon import compute_fixed_point
from quantecon.tests import get_h5_data_file, write_array, max_abs_diff
# specify params -- use defaults
A = 1.4
alpha = 0.6
bet... | [
"jv.JvWorker",
"quantecon.tests.write_array",
"quantecon.tests.max_abs_diff",
"quantecon.tests.get_h5_data_file",
"nose.plugins.skip.SkipTest",
"quantecon.compute_fixed_point"
] | [((417, 457), 'nose.plugins.skip.SkipTest', 'SkipTest', (['"""Python 3 tests aren\'t ready."""'], {}), '("Python 3 tests aren\'t ready.")\n', (425, 457), False, 'from nose.plugins.skip import SkipTest\n'), ((587, 615), 'quantecon.tests.write_array', 'write_array', (['f', 'grp', 'V', 'v_nm'], {}), '(f, grp, V, v_nm)\n',... |
"""Config
This module is in charge of providing all the necessary settings to
the rest of the modules in excentury.
"""
import os
import re
import sys
import textwrap
import argparse
from collections import OrderedDict
from excentury.command import error, trace, import_mod
DESC = """Edit a configuration file for ex... | [
"textwrap.dedent",
"collections.OrderedDict",
"os.path.exists",
"excentury.command.error",
"re.escape",
"re.compile",
"os.path.expandvars",
"excentury.command.import_mod",
"excentury.command.trace",
"sys.stdout.write"
] | [((599, 630), 're.compile', 're.compile', (['"""\\\\${(?P<key>.*?)}"""'], {}), "('\\\\${(?P<key>.*?)}')\n", (609, 630), False, 'import re\n'), ((639, 696), 're.compile', 're.compile', (['"""(?P<iftrue>.*?) IF\\\\[\\\\[(?P<cond>.*?)\\\\]\\\\]"""'], {}), "('(?P<iftrue>.*?) IF\\\\[\\\\[(?P<cond>.*?)\\\\]\\\\]')\n", (649, ... |
# -*- coding: utf-8 -*-
'''
Created on Thu Nov 19 20:52:33 2015
@author: SW274998
'''
from nseta.common.commons import *
import datetime
import unittest
import time
from bs4 import BeautifulSoup
from tests import htmls
import json
import requests
import six
from nseta.common.urls import *
import nseta.common.urls as ... | [
"unittest.TextTestRunner",
"unittest.TestLoader",
"nseta.common.urls.session.proxies.update"
] | [((541, 603), 'nseta.common.urls.session.proxies.update', 'urls.session.proxies.update', (["{'http': 'proxy1.wipro.com:8080'}"], {}), "({'http': 'proxy1.wipro.com:8080'})\n", (568, 603), True, 'import nseta.common.urls as urls\n'), ((4169, 4190), 'unittest.TestLoader', 'unittest.TestLoader', ([], {}), '()\n', (4188, 41... |
from django import forms
from .models import Account
from common.models import Comment, Attachments
from leads.models import Lead
from contacts.models import Contact
from django.db.models import Q
class AccountForm(forms.ModelForm):
def __init__(self, *args, **kwargs):
account_view = kwargs.pop('account'... | [
"django.forms.FileField",
"leads.models.Lead.objects.all",
"django.forms.CharField",
"django.db.models.Q"
] | [((2863, 2908), 'django.forms.CharField', 'forms.CharField', ([], {'max_length': '(64)', 'required': '(True)'}), '(max_length=64, required=True)\n', (2878, 2908), False, 'from django import forms\n'), ((3071, 3118), 'django.forms.FileField', 'forms.FileField', ([], {'max_length': '(1001)', 'required': '(True)'}), '(max... |
#
# Copyright 2018 PyWren 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 in writing... | [
"logging.getLogger",
"random.choice",
"time.sleep",
"pywren_ibm_cloud.cf_connector.CloudFunctions"
] | [((688, 715), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (705, 715), False, 'import logging\n'), ((1151, 1176), 'pywren_ibm_cloud.cf_connector.CloudFunctions', 'CloudFunctions', (['cf_config'], {}), '(cf_config)\n', (1165, 1176), False, 'from pywren_ibm_cloud.cf_connector import Cloud... |
#-- coding: utf-8 --
import sys
reload(sys)
sys.setdefaultencoding('utf-8')
import os
import time
import collections
from PIL import Image, ImageOps, ImageDraw, ImageFont
code_2_icono = collections.defaultdict(lambda : '38')
kor_2_eng = collections.defaultdict(lambda : 'UNKNOWN')
code_2_icono['SKY_O00'] = ['38']
... | [
"papirus.Papirus",
"sys.setdefaultencoding",
"PIL.Image.open",
"PIL.Image.new",
"os.path.join",
"PIL.ImageFont.truetype",
"PIL.ImageOps.grayscale",
"os.path.dirname",
"PIL.ImageDraw.Draw",
"collections.defaultdict",
"time.localtime"
] | [((45, 76), 'sys.setdefaultencoding', 'sys.setdefaultencoding', (['"""utf-8"""'], {}), "('utf-8')\n", (67, 76), False, 'import sys\n'), ((191, 229), 'collections.defaultdict', 'collections.defaultdict', (["(lambda : '38')"], {}), "(lambda : '38')\n", (214, 229), False, 'import collections\n'), ((242, 285), 'collections... |
# Copyright (C) 2022 Intel Corporation
# SPDX-License-Identifier: BSD-3-Clause
"""Assistant utility for automatically load network from network
description."""
import torch
class Assistant:
"""Assistant that bundles training, validation and testing workflow.
Parameters
----------
net : torch.nn.Mo... | [
"torch.no_grad"
] | [((4844, 4859), 'torch.no_grad', 'torch.no_grad', ([], {}), '()\n', (4857, 4859), False, 'import torch\n'), ((6364, 6379), 'torch.no_grad', 'torch.no_grad', ([], {}), '()\n', (6377, 6379), False, 'import torch\n')] |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import datetime
class Migration(migrations.Migration):
dependencies = [
('historias', '0006_auto_20150413_0001'),
]
operations = [
migrations.AlterField(
model_name='hist... | [
"datetime.datetime",
"django.db.models.CharField"
] | [((984, 1268), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(10)', 'choices': "[(b'SALA 1', b'SALA 1'), (b'SALA 2', b'SALA 2'), (b'SALA 3', b'SALA 3'), (\n b'SALA 4', b'SALA 4'), (b'SALA 5', b'SALA 5'), (b'GAURDIA', b'GAURDIA'),\n (b'NEO', b'NEO'), (b'UTI', b'UTI'), (b'UCO', b'UCO'), (b'... |
import os
from pathlib import Path
from data_utils import get_data_path, get_image_data_path, get_image_extension
def app_id_to_image_filename(app_id, is_horizontal_banner=False):
image_data_path = get_image_data_path(is_horizontal_banner)
image_filename = image_data_path + str(app_id) + get_image_extension... | [
"data_utils.get_image_extension",
"pathlib.Path",
"data_utils.get_data_path",
"os.path.basename",
"data_utils.get_image_data_path"
] | [((205, 246), 'data_utils.get_image_data_path', 'get_image_data_path', (['is_horizontal_banner'], {}), '(is_horizontal_banner)\n', (224, 246), False, 'from data_utils import get_data_path, get_image_data_path, get_image_extension\n'), ((414, 446), 'os.path.basename', 'os.path.basename', (['image_filename'], {}), '(imag... |
import numpy as np
from coffeine.covariance_transformers import (
Diag,
LogDiag,
ExpandFeatures,
Riemann,
RiemannSnp,
NaiveVec)
from coffeine.spatial_filters import (
ProjIdentitySpace,
ProjCommonSpace,
ProjLWSpace,
ProjRandomSpace,
ProjSPoCSpace)
from sklearn.compose impor... | [
"coffeine.covariance_transformers.ExpandFeatures",
"sklearn.linear_model.LogisticRegression",
"sklearn.preprocessing.StandardScaler",
"sklearn.pipeline.make_pipeline",
"numpy.logspace"
] | [((8747, 8807), 'sklearn.pipeline.make_pipeline', 'make_pipeline', (['filter_bank_transformer', 'scaling_', 'estimator_'], {}), '(filter_bank_transformer, scaling_, estimator_)\n', (8760, 8807), False, 'from sklearn.pipeline import make_pipeline\n'), ((12164, 12224), 'sklearn.pipeline.make_pipeline', 'make_pipeline', (... |
import os
import df2img
import disnake
import numpy as np
import pandas as pd
from menus.menu import Menu
from PIL import Image
import discordbot.config_discordbot as cfg
from discordbot.config_discordbot import gst_imgur, logger
from discordbot.helpers import autocrop_image
from gamestonk_terminal.stocks.options imp... | [
"gamestonk_terminal.stocks.options.yfinance_model.option_expirations",
"disnake.Embed",
"PIL.Image.open",
"discordbot.helpers.autocrop_image",
"df2img.save_dataframe",
"discordbot.config_discordbot.logger.debug",
"disnake.SelectOption",
"menus.menu.Menu",
"os.remove",
"numpy.percentile",
"discor... | [((860, 901), 'gamestonk_terminal.stocks.options.yfinance_model.option_expirations', 'yfinance_model.option_expirations', (['ticker'], {}), '(ticker)\n', (893, 901), False, 'from gamestonk_terminal.stocks.options import yfinance_model\n'), ((1587, 1617), 'numpy.percentile', 'np.percentile', (["df['strike']", '(1)'], {}... |
# -*- coding:utf-8 -*-
"""
"""
import cudf
from hypergbm import make_experiment
from hypernets.tabular import get_tool_box
from hypernets.tabular.datasets import dsutils
def main(target='y', dtype=None, max_trials=3, drift_detection=False, clear_cache=True, **kwargs):
tb = get_tool_box(cudf.DataFrame)
asse... | [
"hypernets.tabular.get_tool_box",
"hypernets.tabular.datasets.dsutils.load_bank"
] | [((283, 311), 'hypernets.tabular.get_tool_box', 'get_tool_box', (['cudf.DataFrame'], {}), '(cudf.DataFrame)\n', (295, 311), False, 'from hypernets.tabular import get_tool_box\n'), ((413, 432), 'hypernets.tabular.datasets.dsutils.load_bank', 'dsutils.load_bank', ([], {}), '()\n', (430, 432), False, 'from hypernets.tabul... |
#!/usr/bin/python3
from setuptools import setup, find_packages
setup(
package_dir = { '': 'src' },
packages = find_packages( where='src' ),
)
| [
"setuptools.find_packages"
] | [((120, 146), 'setuptools.find_packages', 'find_packages', ([], {'where': '"""src"""'}), "(where='src')\n", (133, 146), False, 'from setuptools import setup, find_packages\n')] |
#!/usr/bin/env python
#
# Copyright (C) 2018 The Android Open Source Project
#
# 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 req... | [
"logging.getLogger",
"common.Run",
"common.RunAndCheckOutput",
"rangelib.RangeSet",
"shlex.split",
"common.MakeTempDir",
"struct.unpack",
"sparse_img.SparseImage",
"common.MakeTempFile"
] | [((794, 821), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (811, 821), False, 'import logging\n'), ((1215, 1259), 'common.RunAndCheckOutput', 'common.RunAndCheckOutput', (['cmd'], {'verbose': '(False)'}), '(cmd, verbose=False)\n', (1239, 1259), False, 'import common\n'), ((1382, 1426), ... |
# 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... | [
"tvm.sum",
"tvm.size_var",
"tvm.reduce_axis",
"tvm.tag_scope",
"tvm.placeholder",
"tvm.save_json"
] | [((810, 835), 'tvm.tag_scope', 'tvm.tag_scope', ([], {'tag': '"""conv"""'}), "(tag='conv')\n", (823, 835), False, 'import tvm\n'), ((981, 1016), 'tvm.reduce_axis', 'tvm.reduce_axis', (['(0, IC)'], {'name': '"""ic"""'}), "((0, IC), name='ic')\n", (996, 1016), False, 'import tvm\n'), ((1026, 1061), 'tvm.reduce_axis', 'tv... |
#!/usr/bin/env python
"""
The pozyx ranging demo (c) Pozyx Labs
please check out https://www.pozyx.io/Documentation/Tutorials/getting_started/Python
This demo requires one (or two) pozyx shields. It demonstrates the 3D orientation and the functionality
to remotely read register data from a pozyx device. Connect one of... | [
"pythonosc.udp_client.SimpleUDPClient",
"modules.file_writing.SensorAndPositionFileWriting.write_sensor_and_position_header_to_file",
"modules.console_logging_functions.ConsoleLoggingFunctions.get_time",
"modules.console_logging_functions.ConsoleLoggingFunctions.print_data_error_message",
"modules.user_inpu... | [((8855, 8877), 'modules.user_input_config_functions.UserInputConfigFunctions.use_remote', 'UserInput.use_remote', ([], {}), '()\n', (8875, 8877), True, 'from modules.user_input_config_functions import UserInputConfigFunctions as UserInput\n'), ((8894, 8925), 'modules.user_input_config_functions.UserInputConfigFunction... |
# Copyright 2017 Red Hat, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | [
"fixture.style.NamedDataStyle",
"dashboard.models.Product.objects.get",
"dashboard.managers.inventory.InventoryManager"
] | [((1094, 1112), 'dashboard.managers.inventory.InventoryManager', 'InventoryManager', ([], {}), '()\n', (1110, 1112), False, 'from dashboard.managers.inventory import InventoryManager\n'), ((1004, 1020), 'fixture.style.NamedDataStyle', 'NamedDataStyle', ([], {}), '()\n', (1018, 1020), False, 'from fixture.style import N... |
# Copyright 2020 The FedLearner 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... | [
"fedlearner_webconsole.workflow.models.TransactionState",
"fedlearner_webconsole.project.models.Project.query.filter_by",
"logging.debug",
"fedlearner_webconsole.db.db.session.add",
"threading.Lock",
"concurrent.futures.ThreadPoolExecutor",
"fedlearner_webconsole.workflow.models.Workflow.query.get",
"... | [((3268, 3284), 'threading.Lock', 'threading.Lock', ([], {}), '()\n', (3282, 3284), False, 'import threading\n'), ((4173, 4214), 'logging.debug', 'logging.debug', (['"""auth_info: %s"""', 'auth_info'], {}), "('auth_info: %s', auth_info)\n", (4186, 4214), False, 'import logging\n'), ((4353, 4393), 'fedlearner_webconsole... |
#!/usr/bin/env python
from __future__ import print_function
import logging
import os
import signal
from time import sleep
from subprocess import Popen, PIPE
import socket
from core.common_functions import *
from core.run import Runner
class NginxPerf(Runner):
"""
Runs Nginx
"""
name = "nginx"
e... | [
"logging.debug",
"socket.socket",
"subprocess.Popen",
"time.sleep",
"os.killpg",
"socket.gethostname",
"logging.info"
] | [((1943, 1990), 'logging.debug', 'logging.debug', (["('Server command: %s' % servercmd)"], {}), "('Server command: %s' % servercmd)\n", (1956, 1990), False, 'import logging\n'), ((4304, 4356), 'logging.info', 'logging.info', (["('Total runs: %d' % self.num_benchmarks)"], {}), "('Total runs: %d' % self.num_benchmarks)\n... |
"""Test file sequence discovery on disk."""
# "Future" Libraries
from __future__ import print_function
# Standard Libraries
import os
import unittest
# Third Party Libraries
import mock
from builtins import range
from future.utils import lrange
from . import (DirEntry, generate_entries, initialise_mock_scandir_data... | [
"future.utils.lrange",
"builtins.range",
"mock.patch",
"os.path.join"
] | [((963, 1002), 'mock.patch', 'mock.patch', (['"""seqparse.seqparse.scandir"""'], {}), "('seqparse.seqparse.scandir')\n", (973, 1002), False, 'import mock\n'), ((2087, 2126), 'mock.patch', 'mock.patch', (['"""seqparse.seqparse.scandir"""'], {}), "('seqparse.seqparse.scandir')\n", (2097, 2126), False, 'import mock\n'), (... |
from django.contrib import admin
from wouso.core.security.models import Report
admin.site.register(Report)
| [
"django.contrib.admin.site.register"
] | [((80, 107), 'django.contrib.admin.site.register', 'admin.site.register', (['Report'], {}), '(Report)\n', (99, 107), False, 'from django.contrib import admin\n')] |
from __future__ import annotations
from typing import TypeVar, Generic, Callable, Optional, Any, cast, Tuple
import rx
from returns import pipeline
from returns.functions import identity
from returns.maybe import Maybe, Nothing
from rx import Observable
from rx.subject import BehaviorSubject
from . import ReactiveVa... | [
"rx.empty",
"typing.TypeVar"
] | [((371, 383), 'typing.TypeVar', 'TypeVar', (['"""T"""'], {}), "('T')\n", (378, 383), False, 'from typing import TypeVar, Generic, Callable, Optional, Any, cast, Tuple\n'), ((2792, 2802), 'rx.empty', 'rx.empty', ([], {}), '()\n', (2800, 2802), False, 'import rx\n')] |
#!/usr/bin/env python
#
# Copyright (C) 2018 Intel Corporation
#
# SPDX-License-Identifier: MIT
from __future__ import absolute_import, division, print_function
import argparse
import os
import glog as log
import numpy as np
import cv2
from lxml import etree
from tqdm import tqdm
def parse_args():
"""Parse argu... | [
"cv2.imwrite",
"cv2.fillPoly",
"argparse.ArgumentParser",
"os.makedirs",
"tqdm.tqdm",
"lxml.etree.parse",
"os.path.splitext",
"os.path.dirname",
"numpy.zeros"
] | [((358, 466), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'fromfile_prefix_chars': '"""@"""', 'description': '"""Convert CVAT XML annotations to masks"""'}), "(fromfile_prefix_chars='@', description=\n 'Convert CVAT XML annotations to masks')\n", (381, 466), False, 'import argparse\n'), ((2382, 2437)... |
import sys
from flask import Blueprint, request, jsonify
from flaskApp import db
from flaskApp.assignment.utils import *
from flaskApp.error.error_handlers import *
import json
from flaskApp.helpers import getAssignmentData
assignment = Blueprint('assignment', __name__)
@assignment.route('/restoreAssignment/<calID>/<... | [
"flask.request.get_data",
"flask.Blueprint",
"flaskApp.helpers.getAssignmentData",
"flask.jsonify"
] | [((238, 271), 'flask.Blueprint', 'Blueprint', (['"""assignment"""', '__name__'], {}), "('assignment', __name__)\n", (247, 271), False, 'from flask import Blueprint, request, jsonify\n'), ((2024, 2051), 'flaskApp.helpers.getAssignmentData', 'getAssignmentData', (['courseID'], {}), '(courseID)\n', (2041, 2051), False, 'f... |
import os
import shutil
SOURCE_DIR = '../deploy/runtime'
TARGET_DIR = 'SAM.app/Contents/runtime'
if os.path.exists(TARGET_DIR):
shutil.rmtree(TARGET_DIR)
shutil.copytree(SOURCE_DIR, TARGET_DIR, ignore=shutil.ignore_patterns('.git'))
SOURCE_DIR = '../deploy/solar_resource'
TARGET_DIR = 'SAM.app/Contents/solar_re... | [
"os.path.exists",
"shutil.ignore_patterns",
"shutil.rmtree"
] | [((102, 128), 'os.path.exists', 'os.path.exists', (['TARGET_DIR'], {}), '(TARGET_DIR)\n', (116, 128), False, 'import os\n'), ((332, 358), 'os.path.exists', 'os.path.exists', (['TARGET_DIR'], {}), '(TARGET_DIR)\n', (346, 358), False, 'import os\n'), ((560, 586), 'os.path.exists', 'os.path.exists', (['TARGET_DIR'], {}), ... |
# -*- coding: utf-8 -*-
"""Tests of GLSAR and diagnostics against Gretl
Created on Thu Feb 02 21:15:47 2012
Author: <NAME>
License: BSD-3
"""
import os
import numpy as np
from numpy.testing import (assert_almost_equal, assert_equal,
assert_allclose, assert_array_less)
from statsmodels.r... | [
"numpy.sqrt",
"numpy.testing.assert_equal",
"numpy.log",
"statsmodels.stats.diagnostic.het_white",
"numpy.array",
"numpy.genfromtxt",
"statsmodels.stats.diagnostic.het_breuschpagan",
"numpy.testing.assert_array_less",
"statsmodels.stats.outliers_influence.OLSInfluence",
"numpy.testing.assert_allcl... | [((662, 732), 'numpy.testing.assert_almost_equal', 'assert_almost_equal', (['contrast_res.fvalue', 'other[0]'], {'decimal': 'decimal[0]'}), '(contrast_res.fvalue, other[0], decimal=decimal[0])\n', (681, 732), False, 'from numpy.testing import assert_almost_equal, assert_equal, assert_allclose, assert_array_less\n'), ((... |
from unittest import TestCase
from datetime import date
from keras_en_parser_and_analyzer.library.pipmp_my_cv_classify import detect_date
class DetectDate(TestCase):
def test_detect_date(self):
dates_to_test = ['10-1990', '09/12/2020', 'jan 1990', 'feb 2012', '9-12-2020']
res = detect_date(dates_t... | [
"keras_en_parser_and_analyzer.library.pipmp_my_cv_classify.detect_date"
] | [((301, 330), 'keras_en_parser_and_analyzer.library.pipmp_my_cv_classify.detect_date', 'detect_date', (['dates_to_test[0]'], {}), '(dates_to_test[0])\n', (312, 330), False, 'from keras_en_parser_and_analyzer.library.pipmp_my_cv_classify import detect_date\n'), ((426, 455), 'keras_en_parser_and_analyzer.library.pipmp_my... |
# Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# unless required by applicable law or a... | [
"capirca.lib.nacaddr.ExcludeAddrs",
"string.Template"
] | [((1205, 1266), 'string.Template', 'string.Template', (['"""-A $filter -m comment --comment "$comment\\""""'], {}), '(\'-A $filter -m comment --comment "$comment"\')\n', (1220, 1266), False, 'import string\n'), ((1297, 1326), 'string.Template', 'string.Template', (['"""-A $filter"""'], {}), "('-A $filter')\n", (1312, 1... |
import warnings
import numba
import numpy as np
import strax
import straxen
DEFAULT_MAX_SAMPLES = 20_000
@straxen.mini_analysis(requires=('records',),
warn_beyond_sec=10,
default_time_selection='touching')
def records_matrix(records, time_range, seconds_range, config, ... | [
"strax.raw_to_records",
"numpy.errstate",
"numpy.zeros",
"strax.baseline",
"strax.zero_out_of_bounds",
"straxen.mini_analysis",
"warnings.warn",
"numpy.arange"
] | [((111, 214), 'straxen.mini_analysis', 'straxen.mini_analysis', ([], {'requires': "('records',)", 'warn_beyond_sec': '(10)', 'default_time_selection': '"""touching"""'}), "(requires=('records',), warn_beyond_sec=10,\n default_time_selection='touching')\n", (132, 214), False, 'import straxen\n'), ((2754, 2864), 'stra... |
from collections import namedtuple
from cryptoconditions import crypto
CryptoKeypair = namedtuple('CryptoKeypair', ('signing_key', 'verifying_key'))
def generate_keypair():
"""Generates a cryptographic key pair.
Returns:
:class:`~bigchaindb_driver.crypto.CryptoKeypair`: A
:obj:`collections... | [
"cryptoconditions.crypto.ed25519_generate_key_pair",
"collections.namedtuple"
] | [((90, 151), 'collections.namedtuple', 'namedtuple', (['"""CryptoKeypair"""', "('signing_key', 'verifying_key')"], {}), "('CryptoKeypair', ('signing_key', 'verifying_key'))\n", (100, 151), False, 'from collections import namedtuple\n'), ((559, 593), 'cryptoconditions.crypto.ed25519_generate_key_pair', 'crypto.ed25519_g... |
# Dependencies
from aurora import Controller, View, Forms
from models import Users, Notes
from aurora.security import login_required, get_session
from flask import request
from datetime import datetime
# The controller class
class NewNote(Controller):
# POST Method
@login_required(app='users')
def post(se... | [
"models.Notes",
"aurora.security.login_required",
"models.Users",
"aurora.Forms",
"aurora.View",
"aurora.security.get_session"
] | [((277, 304), 'aurora.security.login_required', 'login_required', ([], {'app': '"""users"""'}), "(app='users')\n", (291, 304), False, 'from aurora.security import login_required, get_session\n'), ((1662, 1689), 'aurora.security.login_required', 'login_required', ([], {'app': '"""users"""'}), "(app='users')\n", (1676, 1... |
# --------------
#Importing header files
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
#Code starts here
data = pd.read_csv(path)
data['Rating'].hist()
data = data[data['Rating']<=5]
data['Rating'].hist()
#Code ends here
# --------------
# code starts here
total_null = data.isnull().sum... | [
"sklearn.preprocessing.LabelEncoder",
"seaborn.regplot",
"pandas.read_csv",
"seaborn.catplot",
"pandas.DataFrame",
"pandas.concat",
"pandas.to_datetime"
] | [((142, 159), 'pandas.read_csv', 'pd.read_csv', (['path'], {}), '(path)\n', (153, 159), True, 'import pandas as pd\n'), ((392, 467), 'pandas.concat', 'pd.concat', (['[total_null, percent_null]'], {'axis': '(1)', 'keys': "['Total', 'Percentage']"}), "([total_null, percent_null], axis=1, keys=['Total', 'Percentage'])\n",... |
import numpy as np
from openpnm.algorithms import ReactiveTransport
from openpnm.models.physics import generic_source_term as gst
from openpnm.utils import logging
logger = logging.getLogger(__name__)
class ChargeConservation(ReactiveTransport):
r"""
A class to enforce charge conservation in ionic transport s... | [
"numpy.isnan",
"openpnm.utils.logging.getLogger"
] | [((173, 200), 'openpnm.utils.logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (190, 200), False, 'from openpnm.utils import logging\n'), ((3600, 3630), 'numpy.isnan', 'np.isnan', (["self['pore.bc_rate']"], {}), "(self['pore.bc_rate'])\n", (3608, 3630), True, 'import numpy as np\n'), ((3552, ... |
from jno.util import interpret_configs
from jno.util import run_arduino_process
from jno.util import create_build_directory
from jno.util import get_common_parameters
from jno.util import verify_arduino_dir
from jno.util import verify_and_get_port
from jno.util import JnoException
from jno.commands.command import Comma... | [
"getopt.getopt",
"jno.util.interpret_configs",
"jno.util.get_common_parameters",
"jno.util.verify_arduino_dir",
"jno.util.verify_and_get_port",
"jno.util.JnoException",
"jno.util.run_arduino_process",
"jno.util.create_build_directory"
] | [((769, 788), 'jno.util.interpret_configs', 'interpret_configs', ([], {}), '()\n', (786, 788), False, 'from jno.util import interpret_configs\n'), ((791, 819), 'jno.util.verify_arduino_dir', 'verify_arduino_dir', (['jno_dict'], {}), '(jno_dict)\n', (809, 819), False, 'from jno.util import verify_arduino_dir\n'), ((822,... |
import argparse
import json
import logging
import os
import torch
from transformers.file_utils import ModelOutput
from typing import Dict, Optional, Tuple
from torch.utils.data import DataLoader, SequentialSampler
from transformers.modeling_outputs import Seq2SeqLMOutput
import train_seq2seq_utils
import single_head_ut... | [
"logging.getLogger",
"os.path.exists",
"torch.log",
"argparse.ArgumentParser",
"os.makedirs",
"train_seq2seq_utils.load_and_cache_examples",
"transformers.modeling_outputs.Seq2SeqLMOutput",
"torch.utils.data.SequentialSampler",
"os.path.join",
"torch.exp",
"torch.no_grad",
"torch.utils.data.Da... | [((564, 591), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (581, 591), False, 'import logging\n'), ((5969, 6000), 'torch.utils.data.SequentialSampler', 'SequentialSampler', (['eval_dataset'], {}), '(eval_dataset)\n', (5986, 6000), False, 'from torch.utils.data import DataLoader, Sequent... |
# Copyright 2019 The MACE 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 applicable la... | [
"utils.util.MaceLogger.summary",
"yaml.load",
"utils.util.mace_check",
"copy.deepcopy",
"re.sub"
] | [((2429, 2441), 'yaml.load', 'yaml.load', (['s'], {}), '(s)\n', (2438, 2441), False, 'import yaml\n'), ((4016, 4095), 'utils.util.mace_check', 'mace_check', (['(str in [e.name for e in DataFormat])', "('unknown data format %s' % str)"], {}), "(str in [e.name for e in DataFormat], 'unknown data format %s' % str)\n", (40... |
# -*- coding: utf-8 -*-
# Copyright 2019 <NAME>. All Rights Reserved.
#
# Licensed under the MIT License;
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://opensource.org/licenses/MIT
#
# Unless required by applicable law or agreed to in writing... | [
"torch.utils.data.ConcatDataset",
"deepNormalize.factories.customTrainerFactory.TrainerFactory",
"deepNormalize.utils.image_slicer.ImageReconstructor",
"multiprocessing.cpu_count",
"kerosene.configs.configs.DatasetConfiguration",
"kerosene.loggers.visdom.visdom.VisdomLogger",
"deepNormalize.inputs.datas... | [((1889, 1907), 'numpy.random.seed', 'np.random.seed', (['(42)'], {}), '(42)\n', (1903, 1907), True, 'import numpy as np\n'), ((1908, 1923), 'random.seed', 'random.seed', (['(42)'], {}), '(42)\n', (1919, 1923), False, 'import random\n'), ((1977, 2016), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'loggi... |
from collections import defaultdict
import json
import re
import redis
import threading
import time
import traceback
import uuid
import base64
import binascii
TTL = 2
hash_keys = ('cmd', 'user')
cmd_hash_keys = {
'comment': ('addr',),
'extra_comment': ('addr',),
'area_comment': ('addr',),
'rename': ('... | [
"json.loads",
"re.compile",
"threading.Lock",
"json.dumps",
"uuid.uuid4",
"collections.defaultdict",
"redis.StrictRedis",
"threading.Thread",
"traceback.print_exc",
"time.time"
] | [((975, 1005), 're.compile', 're.compile', (['"""[^a-zA-Z0-9_\\\\-]"""'], {}), "('[^a-zA-Z0-9_\\\\-]')\n", (985, 1005), False, 'import re\n'), ((1033, 1049), 'json.loads', 'json.loads', (['data'], {}), '(data)\n', (1043, 1049), False, 'import json\n'), ((1250, 1261), 'time.time', 'time.time', ([], {}), '()\n', (1259, 1... |
# -*- coding: utf-8 -*-
"""URLs to manipulate columns."""
from django.urls import path
from ontask.condition import views
app_name = 'condition'
urlpatterns = [
#
# FILTERS
#
path(
'<int:pk>/create_filter/',
views.FilterCreateView.as_view(),
name='create_filter'),
path('<... | [
"ontask.condition.views.FilterCreateView.as_view",
"django.urls.path",
"ontask.condition.views.ConditionCreateView.as_view"
] | [((313, 381), 'django.urls.path', 'path', (['"""<int:pk>/edit_filter/"""', 'views.edit_filter'], {'name': '"""edit_filter"""'}), "('<int:pk>/edit_filter/', views.edit_filter, name='edit_filter')\n", (317, 381), False, 'from django.urls import path\n'), ((387, 461), 'django.urls.path', 'path', (['"""<int:pk>/delete_filt... |
"""Copyright 2020 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
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distr... | [
"tensorflow.keras.layers.Input",
"tensorflow.transpose",
"tensorflow.nn.l2_normalize",
"math.sqrt",
"tensorflow.concat",
"tensorflow.math.multiply",
"tensorflow.reshape",
"tensorflow.keras.models.Model",
"tensorflow.math.reduce_sum",
"tensorflow.TensorShape",
"tensorflow.keras.regularizers.l2"
] | [((2358, 2395), 'tensorflow.reshape', 'tf.reshape', (['frames', '(-1, feature_dim)'], {}), '(frames, (-1, feature_dim))\n', (2368, 2395), True, 'import tensorflow as tf\n'), ((2446, 2505), 'tensorflow.reshape', 'tf.reshape', (['activation', '(-1, max_frames, self.num_clusters)'], {}), '(activation, (-1, max_frames, sel... |
import sys
import unittest
import os
import tempfile
from netCDF4 import Dataset
import numpy as np
from numpy.testing import assert_array_equal
FILE_NAME = tempfile.NamedTemporaryFile(suffix='.nc', delete=False).name
VL_NAME = 'vlen_type'
VL_BASETYPE = np.int16
DIM1_NAME = 'lon'
DIM2_NAME = 'lat'
nlons = 5; nlats = 5... | [
"numpy.abs",
"numpy.reshape",
"numpy.testing.assert_array_equal",
"netCDF4.Dataset",
"numpy.int32",
"numpy.array",
"numpy.random.randint",
"numpy.random.uniform",
"numpy.empty",
"numpy.around",
"tempfile.NamedTemporaryFile",
"unittest.main",
"numpy.arange",
"os.remove"
] | [((451, 482), 'numpy.empty', 'np.empty', (['(nlats * nlons)', 'object'], {}), '(nlats * nlons, object)\n', (459, 482), True, 'import numpy as np\n'), ((488, 519), 'numpy.empty', 'np.empty', (['(nlats * nlons)', 'object'], {}), '(nlats * nlons, object)\n', (496, 519), True, 'import numpy as np\n'), ((682, 714), 'numpy.r... |
# Copyright 2019 The Sonnet 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 applicable l... | [
"uuid.uuid4"
] | [((1923, 1935), 'uuid.uuid4', 'uuid.uuid4', ([], {}), '()\n', (1933, 1935), False, 'import uuid\n')] |
import csv
import datetime
from collections import defaultdict
from django.contrib import messages
from django.http.response import FileResponse
from django.shortcuts import redirect, render
from django.utils import timezone
from django.views.decorators.http import require_GET, require_http_methods, require_POST
from... | [
"csv.DictWriter",
"forms.django_forms.CreateTasksForm",
"libs.streaming_zip.zip_generator",
"django.contrib.messages.warning",
"libs.http_utils.easy_url",
"libs.utils.date_utils.daterange",
"serializers.forest_serializers.ForestTaskCsvSerializer",
"constants.forest_constants.ForestTree.values",
"dat... | [((3696, 3733), 'django.views.decorators.http.require_http_methods', 'require_http_methods', (["['GET', 'POST']"], {}), "(['GET', 'POST'])\n", (3716, 3733), False, 'from django.views.decorators.http import require_GET, require_http_methods, require_POST\n'), ((1295, 1325), 'database.study_models.Study.objects.get', 'St... |
#
# this manager stores directly into the db wit Database update
from cloudmesh.mongo.DataBaseDecorator import DatabaseUpdate
from cloudmesh.mongo.CmDatabase import CmDatabase
from cloudmesh.common.console import Console
from cloudmesh.storage.Provider import Provider
import os
from datetime import datetime
class Vd... | [
"cloudmesh.storage.Provider.Provider",
"datetime.datetime.utcnow",
"cloudmesh.mongo.DataBaseDecorator.DatabaseUpdate",
"os.path.join",
"os.path.dirname",
"os.path.basename",
"cloudmesh.mongo.CmDatabase.CmDatabase",
"cloudmesh.common.console.Console.error"
] | [((1435, 1451), 'cloudmesh.mongo.DataBaseDecorator.DatabaseUpdate', 'DatabaseUpdate', ([], {}), '()\n', (1449, 1451), False, 'from cloudmesh.mongo.DataBaseDecorator import DatabaseUpdate\n'), ((3491, 3507), 'cloudmesh.mongo.DataBaseDecorator.DatabaseUpdate', 'DatabaseUpdate', ([], {}), '()\n', (3505, 3507), False, 'fro... |
import json
import logging
from redash.query_runner import *
from redash.utils import JSONEncoder
logger = logging.getLogger(__name__)
try:
from influxdb import InfluxDBClusterClient
enabled = True
except ImportError:
enabled = False
def _transform_result(results):
result_columns = []
result_r... | [
"logging.getLogger",
"influxdb.InfluxDBClusterClient.from_DSN",
"json.dumps"
] | [((109, 136), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (126, 136), False, 'import logging\n'), ((1345, 1449), 'json.dumps', 'json.dumps', (["{'columns': [{'name': c} for c in result_columns], 'rows': result_rows}"], {'cls': 'JSONEncoder'}), "({'columns': [{'name': c} for c in result... |
import numpy as np
if __name__ == '__main__':
h, w = map( int, input().split() )
row_list = []
for i in range(h):
single_row = list( map(int, input().split() ) )
np_row = np.array( single_row )
row_list.append( np_row )
min_of_each_row = np.min( row_list, axis = 1)
... | [
"numpy.max",
"numpy.array",
"numpy.min"
] | [((288, 312), 'numpy.min', 'np.min', (['row_list'], {'axis': '(1)'}), '(row_list, axis=1)\n', (294, 312), True, 'import numpy as np\n'), ((334, 357), 'numpy.max', 'np.max', (['min_of_each_row'], {}), '(min_of_each_row)\n', (340, 357), True, 'import numpy as np\n'), ((206, 226), 'numpy.array', 'np.array', (['single_row'... |
import uuid
import pickle
import pytest
import argparse
from collections import namedtuple
from six import text_type
from allure.common import AllureImpl, StepContext
from allure.constants import Status, AttachmentType, Severity, \
FAILED_STATUSES, Label, SKIPPED_STATUSES
from allure.utils import parent_module, p... | [
"allure.common.AllureImpl",
"collections.namedtuple",
"allure.structure.TestLabel",
"allure.utils.get_exception_message",
"allure.structure.Attach",
"pickle.dumps",
"pickle.loads",
"allure.utils.parent_down_from_module",
"allure.utils.now",
"uuid.uuid4",
"allure.utils.labels_of",
"allure.struc... | [((21294, 21348), 'collections.namedtuple', 'namedtuple', (['"""CollectFail"""', '"""name status message trace"""'], {}), "('CollectFail', 'name status message trace')\n", (21304, 21348), False, 'from collections import namedtuple\n'), ((3821, 3842), 'allure.common.AllureImpl', 'AllureImpl', (['reportdir'], {}), '(repo... |
bl_info = {
"name": "STRING",
"blender": (2, 80, 0),
"category": "Object",
'Author' : '<NAME>'
}
import bpy
import bmesh
class STRING(bpy.types.Operator):
"""My Object Moving Script""" # Use this as a tooltip for menu items and buttons.
bl_idname = "object.stringtool_ot" ... | [
"bpy.utils.unregister_class",
"bpy.ops.object.editmode_toggle",
"bpy.ops.mesh.delete",
"bpy.ops.mesh.select_all",
"bpy.ops.object.select_all",
"bpy.props.FloatProperty",
"bmesh.new",
"bpy.ops.object.shade_smooth",
"bpy.ops.object.convert",
"bpy.ops.mesh.primitive_plane_add",
"bpy.ops.object.join... | [((548, 625), 'bpy.props.FloatProperty', 'bpy.props.FloatProperty', ([], {'name': '"""String Thickness"""', 'min': '(0.1)', 'max': '(5)', 'precision': '(2)'}), "(name='String Thickness', min=0.1, max=5, precision=2)\n", (571, 625), False, 'import bpy\n'), ((3407, 3439), 'bpy.utils.register_class', 'bpy.utils.register_c... |
import requests
import sys
import time
import os
def main():
trigger_url = sys.argv[1]
trigger_resp = requests.get(trigger_url)
if trigger_resp.ok:
trigger_json = trigger_resp.json().get("data", {})
test_runs = trigger_json.get("runs", [])
print ("Started {} test runs.".format(l... | [
"time.sleep",
"requests.get"
] | [((112, 137), 'requests.get', 'requests.get', (['trigger_url'], {}), '(trigger_url)\n', (124, 137), False, 'import requests\n'), ((1978, 2019), 'requests.get', 'requests.get', (['result_url'], {'headers': 'headers'}), '(result_url, headers=headers)\n', (1990, 2019), False, 'import requests\n'), ((422, 435), 'time.sleep... |
from matplotlib.colors import ListedColormap
cm3 = ListedColormap(['#0000aa', '#ff2020', '#50ff50'])
cm2 = ListedColormap(['#0000aa', '#ff2020'])
| [
"matplotlib.colors.ListedColormap"
] | [((52, 101), 'matplotlib.colors.ListedColormap', 'ListedColormap', (["['#0000aa', '#ff2020', '#50ff50']"], {}), "(['#0000aa', '#ff2020', '#50ff50'])\n", (66, 101), False, 'from matplotlib.colors import ListedColormap\n'), ((108, 146), 'matplotlib.colors.ListedColormap', 'ListedColormap', (["['#0000aa', '#ff2020']"], {}... |
from .._BlackJack import BlackJackCPP
import gym
import ctypes
import numpy as np
from gym import spaces
class BlackJack(gym.Env):
def __init__(self, natural=False):
self.env = BlackJackCPP(natural)
self.action_space = spaces.Discrete(2)
self.observation_space = spaces.Tuple((
... | [
"numpy.array",
"ctypes.c_uint32",
"gym.spaces.Discrete"
] | [((242, 260), 'gym.spaces.Discrete', 'spaces.Discrete', (['(2)'], {}), '(2)\n', (257, 260), False, 'from gym import spaces\n'), ((905, 920), 'numpy.array', 'np.array', (['state'], {}), '(state)\n', (913, 920), True, 'import numpy as np\n'), ((321, 340), 'gym.spaces.Discrete', 'spaces.Discrete', (['(32)'], {}), '(32)\n'... |
import numpy as np
from . import _version
__version__ = _version.get_versions()['version']
HXR_COLORS = ("#000000", "#02004a", "#030069", "#04008f", "#0500b3", "#0700ff")
SXR_COLORS = ("#000000", "#330000", "#520000", "#850000", "#ad0000", "#ff0000")
HXR_AREAS = {
"GUN" : [2017.911, 2018.712],
"L0" : [2018.... | [
"numpy.mean"
] | [((903, 917), 'numpy.mean', 'np.mean', (['value'], {}), '(value)\n', (910, 917), True, 'import numpy as np\n'), ((1569, 1583), 'numpy.mean', 'np.mean', (['value'], {}), '(value)\n', (1576, 1583), True, 'import numpy as np\n')] |
import os
import tempfile
import numpy as np
import tensorflow as tf
from time import time
from termcolor import cprint
from unittest import TestCase
from .. import K
from .. import Input, Dense, GRU, Bidirectional, Embedding
from .. import Model, load_model
from .. import l2
from .. import maxnorm
from .. import Ada... | [
"numpy.allclose",
"numpy.random.random",
"numpy.max",
"tensorflow.compat.v1.disable_eager_execution",
"numpy.random.randint",
"numpy.random.randn",
"tempfile.gettempdir",
"numpy.array",
"numpy.cos",
"time.time",
"termcolor.cprint"
] | [((591, 629), 'tensorflow.compat.v1.disable_eager_execution', 'tf.compat.v1.disable_eager_execution', ([], {}), '()\n', (627, 629), True, 'import tensorflow as tf\n'), ((2744, 2796), 'termcolor.cprint', 'cprint', (['"""\n<< ALL MAIN TESTS PASSED >>\n"""', '"""green"""'], {}), '("""\n<< ALL MAIN TESTS PASSED >>\n""", \'... |
# Generated by Django 2.2.10 on 2020-02-18 12:51
import django.contrib.postgres.indexes
from django.db import migrations
from django.db import models
class Migration(migrations.Migration):
dependencies = [("reporting", "0098_auto_20200221_2034")]
operations = [
migrations.RunSQL(
"""
dro... | [
"django.db.models.Index",
"django.db.models.DateField",
"django.db.models.IntegerField",
"django.db.migrations.RemoveIndex",
"django.db.migrations.RunSQL"
] | [((282, 492), 'django.db.migrations.RunSQL', 'migrations.RunSQL', (['"""\ndrop materialized view if exists reporting_ocpallcostlineitem_daily_summary;\ndrop materialized view if exists reporting_ocpallcostlineitem_project_daily_summary;\n """'], {}), '(\n """\ndrop materialized view if exists reporting_oc... |
import os
import sys
import time
import random
import string
import argparse
import torch
import torch.backends.cudnn as cudnn
import torch.nn.init as init
import torch.optim as optim
import torch.utils.data
import numpy as np
from utils import CTCLabelConverter, CTCLabelConverterForBaiduWarpctc, AttnLabelConverter, ... | [
"imgaug.augmenters.PiecewiseAffine",
"torch.nn.init.constant_",
"imgaug.augmenters.GaussianBlur",
"simclr_dataset.AlignCollate",
"torch.cuda.device_count",
"simclr_dataset.Batch_Balanced_Dataset",
"torch.cuda.is_available",
"sys.exit",
"argparse.ArgumentParser",
"imgaug.augmenters.Crop",
"torch.... | [((1220, 1247), 'simclr_dataset.Batch_Balanced_Dataset', 'Batch_Balanced_Dataset', (['opt'], {}), '(opt)\n', (1242, 1247), False, 'from simclr_dataset import hierarchical_dataset, AlignCollate, Batch_Balanced_Dataset\n'), ((1328, 1338), 'imgaug.seed', 'ia.seed', (['(1)'], {}), '(1)\n', (1335, 1338), True, 'import imgau... |
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: protobufs/services/feature/actions/get_flags.proto
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database... | [
"google.protobuf.descriptor_pb2.MessageOptions",
"google.protobuf.symbol_database.Default",
"google.protobuf.descriptor.FieldDescriptor",
"google.protobuf.descriptor.FileDescriptor",
"google.protobuf.descriptor.Descriptor"
] | [((431, 457), 'google.protobuf.symbol_database.Default', '_symbol_database.Default', ([], {}), '()\n', (455, 457), True, 'from google.protobuf import symbol_database as _symbol_database\n'), ((475, 996), 'google.protobuf.descriptor.FileDescriptor', '_descriptor.FileDescriptor', ([], {'name': '"""protobufs/services/feat... |
import sys
sys.path.append('../../')
import constants as cnst
import os
os.environ['PYTHONHASHSEED'] = '2'
import tqdm
from model.stg2_generator import StyledGenerator
import numpy as np
from my_utils.visualize_flame_overlay import OverLayViz
from my_utils.flm_dynamic_fit_overlay import camera_ringnetpp
from my_utils.g... | [
"my_utils.visualize_flame_overlay.OverLayViz",
"torch.load",
"os.path.join",
"my_utils.generic_utils.save_set_of_images",
"my_utils.flm_dynamic_fit_overlay.camera_ringnetpp",
"dataset_loaders.fast_image_reshape",
"numpy.array",
"numpy.zeros",
"torch.randint",
"my_utils.eye_centering.position_to_gi... | [((11, 36), 'sys.path.append', 'sys.path.append', (['"""../../"""'], {}), "('../../')\n", (26, 36), False, 'import sys\n'), ((1244, 1267), 'numpy.array', 'np.array', (['[0.0, 0.0, 0]'], {}), '([0.0, 0.0, 0])\n', (1252, 1267), True, 'import numpy as np\n'), ((1282, 1338), 'my_utils.flm_dynamic_fit_overlay.camera_ringnet... |
import demistomock as demisto
from CommonServerPython import *
""" IMPORTS """
import json
import urllib3
import dateparser
import traceback
from typing import Any, Dict, List, Union
import logging
from argus_api import session as argus_session
from argus_api.api.currentuser.v1.user import get_current_user
from ... | [
"demistomock.params",
"logging.getLogger",
"demistomock.command",
"demistomock.args",
"argus_api.api.reputation.v1.observation.fetch_observations_for_i_p",
"argus_api.api.cases.v2.case.download_attachment",
"demistomock.setLastRun",
"argus_api.api.cases.v2.case.delete_case",
"argus_api.api.cases.v2.... | [((1357, 1383), 'urllib3.disable_warnings', 'urllib3.disable_warnings', ([], {}), '()\n', (1381, 1383), False, 'import urllib3\n'), ((5694, 5712), 'argus_api.api.currentuser.v1.user.get_current_user', 'get_current_user', ([], {}), '()\n', (5710, 5712), False, 'from argus_api.api.currentuser.v1.user import get_current_u... |
import unittest
import numpy as np
from numpy.testing import assert_almost_equal
from dymos.utils.hermite import hermite_matrices
class TestHermiteMatrices(unittest.TestCase):
def test_quadratic(self):
# Interpolate with values and rates provided at [-1, 1] in tau space
tau_given = [-1.0, 1.0]... | [
"numpy.testing.assert_almost_equal",
"numpy.linspace",
"dymos.utils.hermite.hermite_matrices",
"numpy.dot",
"unittest.main"
] | [((2209, 2224), 'unittest.main', 'unittest.main', ([], {}), '()\n', (2222, 2224), False, 'import unittest\n'), ((340, 363), 'numpy.linspace', 'np.linspace', (['(-1)', '(1)', '(100)'], {}), '(-1, 1, 100)\n', (351, 363), True, 'import numpy as np\n'), ((631, 668), 'dymos.utils.hermite.hermite_matrices', 'hermite_matrices... |
# -*- coding: utf-8 -*-
"""Application configuration."""
from __future__ import absolute_import, division, print_function, unicode_literals
import os
from . import __author__, __name__, __version__
class Config(object):
"""Base configuration."""
SERVER_NAME = os.environ.get('SERVER_NAME', None)
PREFER... | [
"os.path.join",
"os.path.dirname",
"os.environ.get"
] | [((274, 309), 'os.environ.get', 'os.environ.get', (['"""SERVER_NAME"""', 'None'], {}), "('SERVER_NAME', None)\n", (288, 309), False, 'import os\n'), ((337, 383), 'os.environ.get', 'os.environ.get', (['"""PREFERRED_URL_SCHEME"""', '"""http"""'], {}), "('PREFERRED_URL_SCHEME', 'http')\n", (351, 383), False, 'import os\n'... |
# -*- coding: utf-8 -*-
from django.db import models
class KeyConstructorUserProperty(models.Model):
name = models.CharField(max_length=100)
class Meta:
app_label = 'tests_app'
class KeyConstructorUserModel(models.Model):
property = models.ForeignKey(KeyConstructorUserProperty)
class Meta:... | [
"django.db.models.CharField",
"django.db.models.ForeignKey"
] | [((114, 146), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(100)'}), '(max_length=100)\n', (130, 146), False, 'from django.db import models\n'), ((258, 303), 'django.db.models.ForeignKey', 'models.ForeignKey', (['KeyConstructorUserProperty'], {}), '(KeyConstructorUserProperty)\n', (275, 303), ... |
# ******************************************************************************
# Copyright 2018 Intel Corporation
#
# 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.o... | [
"numpy.finfo",
"numpy.dtype",
"numpy.iinfo"
] | [((2119, 2134), 'numpy.dtype', 'np.dtype', (['dtype'], {}), '(dtype)\n', (2127, 2134), True, 'import numpy as np\n'), ((3240, 3264), 'numpy.finfo', 'np.finfo', (['self.data_type'], {}), '(self.data_type)\n', (3248, 3264), True, 'import numpy as np\n'), ((3456, 3480), 'numpy.finfo', 'np.finfo', (['self.data_type'], {}),... |
# Copyright 2020 Konstruktor, Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... | [
"platform.python_implementation",
"unittest.mock.MagicMock",
"unittest.mock.call",
"tethys.core.streams.stream_zero.ZeroStream",
"gc.collect",
"time.time",
"unittest.mock.patch"
] | [((1104, 1120), 'unittest.mock.MagicMock', 'mock.MagicMock', ([], {}), '()\n', (1118, 1120), False, 'from unittest import mock\n'), ((1138, 1154), 'unittest.mock.MagicMock', 'mock.MagicMock', ([], {}), '()\n', (1152, 1154), False, 'from unittest import mock\n'), ((1610, 1639), 'unittest.mock.MagicMock', 'mock.MagicMock... |
# Generated by Django 3.0.1 on 2020-02-15 06:02
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('course', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='subject',
name='Number_Of_Questions',
... | [
"django.db.models.IntegerField"
] | [((336, 366), 'django.db.models.IntegerField', 'models.IntegerField', ([], {'default': '(0)'}), '(default=0)\n', (355, 366), False, 'from django.db import migrations, models\n')] |
"""
Unit test for the DAG endpoints
"""
# Import from libraries
import json
# Import from internal modules
from cornflow.shared.const import EXEC_STATE_CORRECT, EXEC_STATE_MANUAL
from cornflow.tests.const import (
DAG_URL,
EXECUTION_URL_NORUN,
CASE_PATH,
INSTANCE_URL,
)
from cornflow.tests.unit.test_e... | [
"json.load"
] | [((530, 542), 'json.load', 'json.load', (['f'], {}), '(f)\n', (539, 542), False, 'import json\n'), ((1218, 1230), 'json.load', 'json.load', (['f'], {}), '(f)\n', (1227, 1230), False, 'import json\n'), ((2030, 2042), 'json.load', 'json.load', (['f'], {}), '(f)\n', (2039, 2042), False, 'import json\n')] |
#-------------------------------------------------------------#
# ResNet50的网络部分
#-------------------------------------------------------------#
import keras.backend as K
from keras import backend as K
from keras import initializers, layers, regularizers
from keras.engine import InputSpec, Layer
from keras.init... | [
"keras.layers.Conv2D",
"keras.engine.InputSpec",
"keras.backend.ndim",
"keras.layers.MaxPooling2D",
"keras.regularizers.get",
"keras.backend.reshape",
"keras.layers.add",
"keras.layers.AveragePooling2D",
"keras.backend.batch_normalization",
"keras.layers.Add",
"keras.layers.Activation",
"keras... | [((5015, 5044), 'keras.layers.add', 'layers.add', (['[x, input_tensor]'], {}), '([x, input_tensor])\n', (5025, 5044), False, 'from keras import initializers, layers, regularizers\n'), ((6269, 6294), 'keras.layers.add', 'layers.add', (['[x, shortcut]'], {}), '([x, shortcut])\n', (6279, 6294), False, 'from keras import i... |
# coding=utf-8
# Copyright 2022 The Meta-Dataset 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 applicable ... | [
"tensorflow.compat.v1.nn.l2_normalize",
"tensorflow.compat.v1.matmul",
"tensorflow.compat.v1.nn.moments",
"meta_dataset.models.functional_backbones.weight_variable",
"tensorflow.compat.v1.get_variable",
"tensorflow.compat.v1.equal",
"tensorflow.compat.v1.control_dependencies",
"tensorflow.compat.v1.ga... | [((8433, 8468), 'tensorflow.compat.v1.gather', 'tf.gather', (['num_classes', 'dataset_idx'], {}), '(num_classes, dataset_idx)\n', (8442, 8468), True, 'import tensorflow.compat.v1 as tf\n'), ((2153, 2206), 'tensorflow.compat.v1.nn.l2_normalize', 'tf.nn.l2_normalize', (['embeddings'], {'axis': '(1)', 'epsilon': '(0.001)'... |
#!/usr/bin/python3
# -*- coding: utf8 -*-
# -*- Mode: Python; py-indent-offset: 4 -*-
"""File storage adapter for timevortex project"""
import os
from os import listdir, makedirs
from os.path import isfile, join, exists
from time import tzname
from datetime import datetime
import pytz
import dateutil.parser
from djan... | [
"os.path.exists",
"os.listdir",
"os.makedirs",
"timevortex.utils.globals.LOGGER.debug",
"datetime.datetime.strptime",
"timevortex.utils.globals.LOGGER.error",
"datetime.datetime.utcnow",
"os.path.join"
] | [((928, 948), 'os.listdir', 'listdir', (['site_folder'], {}), '(site_folder)\n', (935, 948), False, 'from os import listdir, makedirs\n'), ((1590, 1610), 'os.listdir', 'listdir', (['site_folder'], {}), '(site_folder)\n', (1597, 1610), False, 'from os import listdir, makedirs\n'), ((2062, 2101), 'datetime.datetime.strpt... |
import tensorflow as tf
from typing import Optional
from tf_fourier_features import fourier_features
class FourierFeatureMLP(tf.keras.Model):
def __init__(self, units: int, final_units: int, gaussian_projection: Optional[int],
activation: str = 'relu',
final_activation: str = "l... | [
"tensorflow.keras.Sequential",
"tensorflow.keras.layers.Dense",
"tf_fourier_features.fourier_features.FourierFeatureProjection"
] | [((2692, 2719), 'tensorflow.keras.Sequential', 'tf.keras.Sequential', (['layers'], {}), '(layers)\n', (2711, 2719), True, 'import tensorflow as tf\n'), ((2747, 2875), 'tensorflow.keras.layers.Dense', 'tf.keras.layers.Dense', (['final_units'], {'activation': 'final_activation', 'use_bias': 'use_bias', 'bias_initializer'... |
# 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 applica... | [
"numpy.array",
"avod.datasets.kitti.kitti_aug.flip_boxes_3d",
"numpy.testing.assert_almost_equal"
] | [((1490, 1563), 'numpy.array', 'np.array', (['[[1, 2, 3, 4, 5, 6, np.pi / 4], [1, 2, 3, 4, 5, 6, -np.pi / 4]]'], {}), '([[1, 2, 3, 4, 5, 6, np.pi / 4], [1, 2, 3, 4, 5, 6, -np.pi / 4]])\n', (1498, 1563), True, 'import numpy as np\n'), ((1630, 1718), 'numpy.array', 'np.array', (['[[-1, 2, 3, 4, 5, 6, 3 * np.pi / 4], [-1,... |
from conans import ConanFile, AutoToolsBuildEnvironment, MSBuild, tools
from conans.errors import ConanInvalidConfiguration
import os
import shutil
required_conan_version = ">=1.33.0"
class LibStudXmlConan(ConanFile):
name = "libstudxml"
description = "A streaming XML pull parser and streaming XML serializer... | [
"os.path.exists",
"conans.tools.replace_in_file",
"conans.tools.Version",
"conans.tools.remove_files_by_mask",
"os.path.join",
"conans.tools.patch",
"conans.tools.get_env",
"conans.tools.chdir",
"conans.tools.get",
"conans.AutoToolsBuildEnvironment",
"conans.MSBuild",
"conans.tools.collect_lib... | [((1943, 2054), 'conans.tools.get', 'tools.get', ([], {'destination': 'self._source_subfolder', 'strip_root': '(True)'}), "(**self.conan_data['sources'][self.version], destination=self.\n _source_subfolder, strip_root=True)\n", (1952, 2054), False, 'from conans import ConanFile, AutoToolsBuildEnvironment, MSBuild, t... |
# Copyright 2020 <NAME> & <NAME> (<EMAIL>)
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by a... | [
"os.path.join"
] | [((2205, 2246), 'os.path.join', 'os.path.join', (['self.dir_path', 'self.subPath'], {}), '(self.dir_path, self.subPath)\n', (2217, 2246), False, 'import os\n'), ((4750, 4783), 'os.path.join', 'os.path.join', (['self.dir_path', 'file'], {}), '(self.dir_path, file)\n', (4762, 4783), False, 'import os\n'), ((4824, 4859), ... |
# -*- coding: utf-8 -*-
# Copyright 2014-2016 OpenMarket Ltd
#
# 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... | [
"logging.getLogger",
"collections.namedtuple",
"synapse.storage.state.StateFilter.all",
"synapse.util.caches.descriptors.cached",
"synapse.util.caches.dictionary_cache.DictionaryCache"
] | [((1176, 1203), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1193, 1203), False, 'import logging\n'), ((1266, 1328), 'collections.namedtuple', 'namedtuple', (['"""_GetStateGroupDelta"""', "('prev_group', 'delta_ids')"], {}), "('_GetStateGroupDelta', ('prev_group', 'delta_ids'))\n", (12... |
# Generated by Django 2.2.6 on 2020-02-09 12:24
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('core', '0010_auto_20200130_1135'),
]
operations = [
migrations.CreateModel(
name='Variation',
... | [
"django.db.models.ImageField",
"django.db.models.AutoField",
"django.db.models.CharField",
"django.db.models.ForeignKey"
] | [((363, 456), 'django.db.models.AutoField', 'models.AutoField', ([], {'auto_created': '(True)', 'primary_key': '(True)', 'serialize': '(False)', 'verbose_name': '"""ID"""'}), "(auto_created=True, primary_key=True, serialize=False,\n verbose_name='ID')\n", (379, 456), False, 'from django.db import migrations, models\... |
import os
from mnist import model
import tensorflow as tf
from tensorflow.examples.tutorials.mnist import input_data
data = input_data.read_data_sets("data/dataset/", one_hot=True)
# model
with tf.variable_scope("convolutional"):
x = tf.placeholder(tf.float32, [None, 784])
keep_prob = tf.placeholder(tf.float... | [
"tensorflow.variable_scope",
"tensorflow.placeholder",
"tensorflow.train.Saver",
"tensorflow.Session",
"tensorflow.global_variables_initializer",
"tensorflow.examples.tutorials.mnist.input_data.read_data_sets",
"tensorflow.argmax",
"os.path.dirname",
"mnist.model.convolutional",
"tensorflow.train.... | [((126, 182), 'tensorflow.examples.tutorials.mnist.input_data.read_data_sets', 'input_data.read_data_sets', (['"""data/dataset/"""'], {'one_hot': '(True)'}), "('data/dataset/', one_hot=True)\n", (151, 182), False, 'from tensorflow.examples.tutorials.mnist import input_data\n'), ((391, 429), 'tensorflow.placeholder', 't... |
import requests
import codecs
query1 = """<union>
<query type="way">
<has-kv k="addr:housenumber"/>
<has-kv k="addr:street:name"/>
<has-kv k="addr:street:type"/>
<has-kv k="addr:state"/>
<bbox-query e="%s" n="%s" s="%s" w="%s"/>
</query>
<query type="way">
<has-kv k="addr:housenumber"/>
<ha... | [
"codecs.open",
"requests.post"
] | [((1389, 1458), 'requests.post', 'requests.post', (['"""http://overpass-api.de/api/interpreter/"""'], {'data': 'query1'}), "('http://overpass-api.de/api/interpreter/', data=query1)\n", (1402, 1458), False, 'import requests\n'), ((1486, 1547), 'codecs.open', 'codecs.open', (['"""data/osm_data.xml"""'], {'encoding': '"""... |
#!/usr/bin/env python
# --------------------------------------------------------
# Fast R-CNN
# Copyright (c) 2015 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by <NAME>
# --------------------------------------------------------
"""Test a Fast R-CNN network on an image database."""
... | [
"fast_rcnn.config.cfg_from_file",
"os.path.exists",
"fast_rcnn.test.test_net",
"argparse.ArgumentParser",
"pandas.DataFrame",
"caffe.set_mode_gpu",
"caffe.set_device",
"os.path.splitext",
"os.path.split",
"time.sleep",
"os.path.join",
"os.path.basename",
"caffe.Net",
"datasets.factory.get_... | [((1067, 1140), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Test a Fast R-CNN network pipeline"""'}), "(description='Test a Fast R-CNN network pipeline')\n", (1090, 1140), False, 'import argparse\n'), ((2493, 2511), 'pprint.pprint', 'pprint.pprint', (['cfg'], {}), '(cfg)\n', (2506, 25... |
import cv2
import numpy as np
from pycocotools.coco import COCO
import os
from ..dataloading import get_yolox_datadir
from .datasets_wrapper import Dataset
class MOTDataset(Dataset):
"""
COCO dataset class.
"""
def __init__( # This function is called in the exps yolox_x_mot17_half.py in this way: ... | [
"numpy.array",
"numpy.zeros",
"os.path.join",
"cv2.imread"
] | [((3616, 3639), 'numpy.zeros', 'np.zeros', (['(num_objs, 6)'], {}), '((num_objs, 6))\n', (3624, 3639), True, 'import numpy as np\n'), ((4439, 4488), 'os.path.join', 'os.path.join', (['self.data_dir', 'self.name', 'file_name'], {}), '(self.data_dir, self.name, file_name)\n', (4451, 4488), False, 'import os\n'), ((4525, ... |
import argparse
import yaml
from subprocess import call
from train import train_bichrom
if __name__ == '__main__':
# parsing
parser = argparse.ArgumentParser(description='Train and Evaluate Bichrom')
parser.add_argument('-training_schema_yaml', required=True,
help='YAML file with pa... | [
"yaml.safe_load",
"subprocess.call",
"argparse.ArgumentParser"
] | [((143, 208), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Train and Evaluate Bichrom"""'}), "(description='Train and Evaluate Bichrom')\n", (166, 208), False, 'import argparse\n'), ((937, 960), 'subprocess.call', 'call', (["['mkdir', outdir]"], {}), "(['mkdir', outdir])\n", (941, 960)... |
# -*- coding: utf-8 -*-
"""\
This is a python port of "Goose" orignialy licensed to Gravity.com
under one or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership.
Python port was written by <NAME>
Gravity.com licenses this file
t... | [
"lxml.etree.strip_tags",
"lxml.html.fromstring",
"lxml.html.soupparser.fromstring",
"copy.deepcopy",
"goose.text.encodeValue",
"lxml.etree.tostring",
"lxml.html.HtmlElement"
] | [((1624, 1641), 'goose.text.encodeValue', 'encodeValue', (['html'], {}), '(html)\n', (1635, 1641), False, 'from goose.text import encodeValue\n'), ((1661, 1686), 'lxml.html.fromstring', 'lxmlhtml.fromstring', (['html'], {}), '(html)\n', (1680, 1686), True, 'import lxml.html as lxmlhtml\n'), ((1778, 1798), 'lxml.etree.t... |
#
# Created on Thu Apr 22 2021
# <NAME>
#
import boto3
from botocore.exceptions import ClientError
import logging
logging.basicConfig(filename="rps.log", level=logging.INFO)
iam_resource = boto3.resource("iam")
sts_client = boto3.client("sts")
def create_role(
iam_role_name: str, assume_role_policy_json: str, p... | [
"logging.basicConfig",
"boto3.client",
"logging.warning",
"logging.exception",
"boto3.resource",
"logging.info",
"logging.error"
] | [((115, 174), 'logging.basicConfig', 'logging.basicConfig', ([], {'filename': '"""rps.log"""', 'level': 'logging.INFO'}), "(filename='rps.log', level=logging.INFO)\n", (134, 174), False, 'import logging\n'), ((191, 212), 'boto3.resource', 'boto3.resource', (['"""iam"""'], {}), "('iam')\n", (205, 212), False, 'import bo... |
import collections
import copy
import intervaltree
from .label import Label
class LabelList:
"""
Represents a list of labels which describe an utterance.
An utterance can have multiple label-lists.
Args:
idx (str): An unique identifier for the label-list
within a corpus f... | [
"intervaltree.IntervalTree",
"intervaltree.Interval",
"collections.defaultdict",
"copy.deepcopy"
] | [((1013, 1040), 'intervaltree.IntervalTree', 'intervaltree.IntervalTree', ([], {}), '()\n', (1038, 1040), False, 'import intervaltree\n'), ((7210, 7240), 'collections.defaultdict', 'collections.defaultdict', (['float'], {}), '(float)\n', (7233, 7240), False, 'import collections\n'), ((8603, 8631), 'collections.defaultd... |
import pandas as pd
from OCAES import ocaes
# ----------------------
# create and run model
# ----------------------
data = pd.read_csv('timeseries_inputs_2019.csv')
inputs = ocaes.get_default_inputs()
# inputs['C_well'] = 5000.0
# inputs['X_well'] = 50.0
# inputs['L_well'] = 50.0
# inputs['X_cmp'] = 0
# inputs['X_exp... | [
"OCAES.ocaes.get_default_inputs",
"OCAES.ocaes",
"pandas.read_csv"
] | [((125, 166), 'pandas.read_csv', 'pd.read_csv', (['"""timeseries_inputs_2019.csv"""'], {}), "('timeseries_inputs_2019.csv')\n", (136, 166), True, 'import pandas as pd\n'), ((176, 202), 'OCAES.ocaes.get_default_inputs', 'ocaes.get_default_inputs', ([], {}), '()\n', (200, 202), False, 'from OCAES import ocaes\n'), ((335,... |