code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
""" Implement the Vanilla Interval domain based on PyTorch.
Vanilla Interval: Simply propagates using interval arithmetic without any optimization.
"""
from __future__ import annotations
from pathlib import Path
from typing import Tuple, Union, Iterator, Callable, Iterable
import torch
from torch import Tensor, ... | [
"torch.nn.ReLU",
"torch.nn.Tanh",
"pathlib.Path",
"diffabs.abs.forward_linear",
"diffabs.utils.valid_lb_ub",
"torch.max",
"torch.stack",
"torch.min",
"torch.zeros",
"torch.nn.Linear",
"torch.nn.functional.relu",
"diffabs.utils.divide_pos_neg",
"torch.clamp",
"torch.cat"
] | [((3621, 3658), 'torch.cat', 'torch.cat', (['[e._lb for e in es]'], {'dim': '(0)'}), '([e._lb for e in es], dim=0)\n', (3630, 3658), False, 'import torch\n'), ((3672, 3709), 'torch.cat', 'torch.cat', (['[e._ub for e in es]'], {'dim': '(0)'}), '([e._ub for e in es], dim=0)\n', (3681, 3709), False, 'import torch\n'), ((9... |
import os
import unittest
from dotenv import dotenv_values
from skyflow.service_account._token import *
from skyflow.service_account import is_expired
class TestGenerateBearerToken(unittest.TestCase):
def setUp(self) -> None:
self.dataPath = os.path.join(
os.getcwd(), 'tests/service_account/... | [
"skyflow.service_account.is_expired",
"os.getcwd"
] | [((284, 295), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (293, 295), False, 'import os\n'), ((485, 502), 'skyflow.service_account.is_expired', 'is_expired', (['token'], {}), '(token)\n', (495, 502), False, 'from skyflow.service_account import is_expired\n'), ((687, 701), 'skyflow.service_account.is_expired', 'is_expir... |
import setuptools
setuptools.setup(
name='ready-python-logs',
version='0.3',
author="<NAME>",
author_email="<EMAIL>",
url="https://github.com/alejandroperezcosio/ready-python-logs",
license='MIT',
long_description=open('README.md').read(),
packages=setuptools.find_packages(),
instal... | [
"setuptools.find_packages"
] | [((282, 308), 'setuptools.find_packages', 'setuptools.find_packages', ([], {}), '()\n', (306, 308), False, 'import setuptools\n')] |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import math
from matplotlib import image as mpimg
from matplotlib import pyplot as plt
# measured coordinates from lane corners for perspective transform
# img = mpimg.imread('examples/straight_lines1.jpg')
# measured lane marking for calculating curvature
img = mpimg.... | [
"matplotlib.pyplot.imshow",
"matplotlib.image.imread",
"matplotlib.pyplot.show"
] | [((314, 371), 'matplotlib.image.imread', 'mpimg.imread', (['"""output/images/test5.jpg.2.warped_orig.jpg"""'], {}), "('output/images/test5.jpg.2.warped_orig.jpg')\n", (326, 371), True, 'from matplotlib import image as mpimg\n'), ((489, 504), 'matplotlib.pyplot.imshow', 'plt.imshow', (['img'], {}), '(img)\n', (499, 504)... |
from data.types.pixel_coordinate_system import PixelCoordinateSystem
from data.types.bounding_box_format import BoundingBoxFormat
from data.types.bounding_box_coordinate_system import BoundingBoxCoordinateSystem
from data.types.pixel_definition import PixelDefinition
def _common_routine(bounding_box, image_size, boun... | [
"data.operator.bbox.rasterized.xywh2xyxy.bbox_xywh2xyxy"
] | [((1016, 1044), 'data.operator.bbox.rasterized.xywh2xyxy.bbox_xywh2xyxy', 'bbox_xywh2xyxy', (['bounding_box'], {}), '(bounding_box)\n', (1030, 1044), False, 'from data.operator.bbox.rasterized.xywh2xyxy import bbox_xywh2xyxy\n'), ((1487, 1515), 'data.operator.bbox.rasterized.xywh2xyxy.bbox_xywh2xyxy', 'bbox_xywh2xyxy',... |
'''Covid_data_Handler related test function calls'''
from Tests.test_covid_data_handler import test_parse_csv_data
from Tests.test_covid_data_handler import test_process_covid_csv_data
from Tests.test_covid_data_handler import test_schedule_covid_updates
from Tests.test_covid_data_handler import test_covid_API_requ... | [
"Tests.test_covid_data_handler.test_process_covid_csv_data",
"Tests.test_covid_news_handling.test_news_API_request",
"Tests.test_covid_data_handler.test_parse_csv_data",
"Tests.test_covid_data_handler.test_schedule_covid_updates"
] | [((325, 346), 'Tests.test_covid_data_handler.test_parse_csv_data', 'test_parse_csv_data', ([], {}), '()\n', (344, 346), False, 'from Tests.test_covid_data_handler import test_parse_csv_data\n'), ((348, 377), 'Tests.test_covid_data_handler.test_process_covid_csv_data', 'test_process_covid_csv_data', ([], {}), '()\n', (3... |
# SPDX-FileCopyrightText: 2020 The Magma Authors.
# SPDX-FileCopyrightText: 2022 Open Networking Foundation <<EMAIL>>
#
# SPDX-License-Identifier: BSD-3-Clause
from datetime import datetime, timedelta
class StateMachineTimer():
def __init__(self, seconds_remaining: int) -> None:
self.start_time = datetim... | [
"datetime.datetime.now",
"datetime.timedelta"
] | [((313, 327), 'datetime.datetime.now', 'datetime.now', ([], {}), '()\n', (325, 327), False, 'from datetime import datetime, timedelta\n'), ((424, 438), 'datetime.datetime.now', 'datetime.now', ([], {}), '()\n', (436, 438), False, 'from datetime import datetime, timedelta\n'), ((483, 514), 'datetime.timedelta', 'timedel... |
from __future__ import division
from collections import OrderedDict
import logging
from wazimap.data.tables import get_datatable, get_table_id
from wazimap.data.utils import get_session, add_metadata
from wazimap.geo import geo_data
from dynamic_profile.models import IndicatorProfile, Profile
from dynamic_profile.util... | [
"logging.getLogger",
"collections.OrderedDict",
"wazimap.data.utils.calculate_median_stat",
"wazimap.data.utils.dataset_context",
"wazimap.data.utils.get_session",
"wazimap.data.utils.percent",
"wazimap.geo.geo_data.get_comparative_geos",
"wazimap.data.utils.current_context",
"wazimap.data.utils.cal... | [((576, 603), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (593, 603), False, 'import logging\n'), ((701, 714), 'wazimap.data.utils.get_session', 'get_session', ([], {}), '()\n', (712, 714), False, 'from wazimap.data.utils import get_session, add_metadata\n'), ((1989, 2023), 'dynamic_pr... |
import pandas as pd
from os import listdir
import shutil
df = pd.read_csv("data/ranked.tsv", sep="\t")
followers: list[str] = df["follower"].to_list()
pics = set(name.replace(".jpeg", "") for name in listdir("imgs/profiles"))
for follower in followers:
if follower in pics:
shutil.copyfile(
f"i... | [
"shutil.copyfile",
"os.listdir",
"pandas.read_csv"
] | [((63, 103), 'pandas.read_csv', 'pd.read_csv', (['"""data/ranked.tsv"""'], {'sep': '"""\t"""'}), "('data/ranked.tsv', sep='\\t')\n", (74, 103), True, 'import pandas as pd\n'), ((288, 373), 'shutil.copyfile', 'shutil.copyfile', (['f"""imgs/profiles/{follower}.jpeg"""', 'f"""data/images/{follower}.jpeg"""'], {}), "(f'img... |
import sys, argparse, os
dir_path = os.path.dirname(os.path.realpath(__file__))+"/"
os.chdir(dir_path)
sys.path.append('../')
import datetime
from connections.sql_connection import SQL_connection
from classes.update import Update
from classes.binnacle import Binnacle
from updater.main_emd import main
'''
@author dn... | [
"classes.binnacle.Binnacle",
"argparse.ArgumentParser",
"updater.main_emd.main",
"connections.sql_connection.SQL_connection",
"os.chdir",
"os.path.realpath",
"datetime.datetime.now",
"sys.path.append"
] | [((85, 103), 'os.chdir', 'os.chdir', (['dir_path'], {}), '(dir_path)\n', (93, 103), False, 'import sys, argparse, os\n'), ((104, 126), 'sys.path.append', 'sys.path.append', (['"""../"""'], {}), "('../')\n", (119, 126), False, 'import sys, argparse, os\n'), ((781, 791), 'classes.binnacle.Binnacle', 'Binnacle', ([], {}),... |
#!/usr/bin/env python
from iris_sdk.models.base_resource import BaseData, BaseResourceList
from iris_sdk.models.maps.sites import SitesMap
from iris_sdk.models.site import Site
class SitesData(SitesMap, BaseData):
def __init__(self, parent=None):
self.site = BaseResourceList(Site, self) | [
"iris_sdk.models.base_resource.BaseResourceList"
] | [((274, 302), 'iris_sdk.models.base_resource.BaseResourceList', 'BaseResourceList', (['Site', 'self'], {}), '(Site, self)\n', (290, 302), False, 'from iris_sdk.models.base_resource import BaseData, BaseResourceList\n')] |
# Clean data for predicting
import pandas as pd
import numpy as np
import scipy.sparse as sparse
import pickle
import os
import ipdb
import gc
from sklearn.cluster import MiniBatchKMeans
from joblib import Parallel, delayed
from departments import all_departments, top_upcs
train = test = labels = features = None
gr... | [
"pandas.isnull",
"pandas.read_csv",
"sklearn.cluster.MiniBatchKMeans",
"joblib.delayed",
"joblib.Parallel",
"gc.collect",
"pandas.DataFrame",
"os.system",
"scipy.sparse.csr_matrix",
"pandas.concat"
] | [((4259, 4289), 'pandas.read_csv', 'pd.read_csv', (['"""input/train.csv"""'], {}), "('input/train.csv')\n", (4270, 4289), True, 'import pandas as pd\n'), ((4301, 4330), 'pandas.read_csv', 'pd.read_csv', (['"""input/test.csv"""'], {}), "('input/test.csv')\n", (4312, 4330), True, 'import pandas as pd\n'), ((6442, 6454), ... |
import paddle
import numpy as np
from ppgan.models.generators.generator_styleganv2ada import StyleGANv2ADA_AugmentPipe
# 默认配置
xflip = 0
rotate90 = 0
xint = 0
xint_max = 0.125
scale = 0
rotate = 0
aniso = 0
xfrac = 0
scale_std = 0.2
rotate_max = 1
aniso_std = 0.2
xfrac_std = 0.125
brightness = 0
contrast = 0
lumaflip... | [
"numpy.mean",
"paddle.ones",
"ppgan.models.generators.generator_styleganv2ada.StyleGANv2ADA_AugmentPipe",
"numpy.sum",
"paddle.to_tensor",
"numpy.load"
] | [((1463, 1797), 'ppgan.models.generators.generator_styleganv2ada.StyleGANv2ADA_AugmentPipe', 'StyleGANv2ADA_AugmentPipe', (['xflip', 'rotate90', 'xint', 'xint_max', 'scale', 'rotate', 'aniso', 'xfrac', 'scale_std', 'rotate_max', 'aniso_std', 'xfrac_std', 'brightness', 'contrast', 'lumaflip', 'hue', 'saturation', 'brigh... |
from mail import Mailer
import os, time
from config import *
appliciant_list = [x.replace("\n", "") for x in open(os.getcwd() + '/list.txt', 'r').readlines()];
mailer = Mailer(MAIL_HOST, MAIL_PORT, MAIL_USER, MAIL_PASS)
mail_subject = "Vernora.com | Interview Request"
mail_message = """
Hello {{NAME}},<br>
We are i... | [
"mail.Mailer",
"time.sleep",
"os.getcwd"
] | [((171, 221), 'mail.Mailer', 'Mailer', (['MAIL_HOST', 'MAIL_PORT', 'MAIL_USER', 'MAIL_PASS'], {}), '(MAIL_HOST, MAIL_PORT, MAIL_USER, MAIL_PASS)\n', (177, 221), False, 'from mail import Mailer\n'), ((575, 589), 'time.sleep', 'time.sleep', (['(20)'], {}), '(20)\n', (585, 589), False, 'import os, time\n'), ((115, 126), '... |
from __future__ import absolute_import
from collections import namedtuple
import mock
from sentry.coreapi import ClientApiHelper
from sentry.testutils import TestCase
from sentry.utils.data_filters import FilterStatKeys
class ClientApiHelperTestCase(TestCase):
@mock.patch('sentry.coreapi.is_valid_error_message')... | [
"mock.call",
"collections.namedtuple",
"mock.patch",
"sentry.coreapi.ClientApiHelper"
] | [((269, 320), 'mock.patch', 'mock.patch', (['"""sentry.coreapi.is_valid_error_message"""'], {}), "('sentry.coreapi.is_valid_error_message')\n", (279, 320), False, 'import mock\n'), ((412, 460), 'collections.namedtuple', 'namedtuple', (['"""TestItem"""', '"""value formatted result"""'], {}), "('TestItem', 'value formatt... |
# coding: utf-8
# ----------------------------------------------------------------------------
# <copyright company="Aspose" file="MapiCalendarRecurrencePatternDto.py">
# Copyright (c) 2018-2020 Aspose Pty Ltd. All rights reserved.
# </copyright>
# <summary>
# Permission is hereby granted, free of charge, to... | [
"six.iteritems"
] | [((18775, 18808), 'six.iteritems', 'six.iteritems', (['self.swagger_types'], {}), '(self.swagger_types)\n', (18788, 18808), False, 'import six\n')] |
import FreeCAD
import FreeCADGui
from pivy import coin
import arch_texture_utils.faceset_utils as faceset_utils
class Light():
def __init__(self, obj):
obj.Proxy = self
self.setProperties(obj)
def setProperties(self, obj):
pl = obj.PropertiesList
if not 'Color' in pl:
... | [
"FreeCAD.ActiveDocument.addObject",
"pivy.coin.SbVec3f",
"pivy.coin.SoSeparator",
"pivy.coin.SoSwitch",
"FreeCADGui.ActiveDocument.ActiveView.getSceneGraph",
"pivy.coin.SbColor",
"pivy.coin.SoTransform",
"pivy.coin.SoMaterial",
"FreeCAD.Vector"
] | [((5925, 5999), 'FreeCAD.ActiveDocument.addObject', 'FreeCAD.ActiveDocument.addObject', (['"""App::FeaturePython"""', '"""DirectionalLight"""'], {}), "('App::FeaturePython', 'DirectionalLight')\n", (5957, 5999), False, 'import FreeCAD\n'), ((1221, 1273), 'FreeCADGui.ActiveDocument.ActiveView.getSceneGraph', 'FreeCADGui... |
import Examples.metadata_manager_results as results_manager
import Source.io_util as io
import numpy as np
import os
def improvements_err_speedup_size(obj: np.ndarray, ref: np.ndarray, i_obj=0) -> np.ndarray:
assert obj.shape[1] > i_obj and ref.shape[0] > i_obj
valid = obj[:, i_obj] < ref[i_obj]
obj = o... | [
"numpy.less",
"numpy.ones",
"os.path.join",
"numpy.array",
"numpy.zeros",
"numpy.argmin",
"Examples.metadata_manager_results.get_ids_by_fieldval",
"Examples.metadata_manager_results.get_results_by_id"
] | [((349, 386), 'numpy.ones', 'np.ones', (['(obj.shape[1], obj.shape[1])'], {}), '((obj.shape[1], obj.shape[1]))\n', (356, 386), True, 'import numpy as np\n'), ((1007, 1044), 'numpy.ones', 'np.ones', (['(obj.shape[1], obj.shape[1])'], {}), '((obj.shape[1], obj.shape[1]))\n', (1014, 1044), True, 'import numpy as np\n'), (... |
"""
CR module customisations for DRK
License: MIT
"""
from gluon import current, URL, \
A, DIV, H2, H3, H4, P, TABLE, TR, TD, XML, HR
from core import IS_ONE_OF
# -------------------------------------------------------------------------
def check_in_status(site, person):
"""
De... | [
"gluon.H2",
"gluon.current.auth.permission.fail",
"gluon.current.db",
"dateutil.relativedelta.relativedelta",
"gluon.current.s3db.configure",
"gluon.URL",
"core.CustomController._view",
"gluon.TD",
"gluon.HR",
"gluon.XML",
"gluon.P",
"gluon.current.T",
"gluon.TABLE",
"gluon.DIV",
"core.I... | [((20657, 20707), 'gluon.DIV', 'DIV', (['item'], {'_id': '"""cms_weather"""', '_class': '"""cms_content"""'}), "(item, _id='cms_weather', _class='cms_content')\n", (20660, 20707), False, 'from gluon import current, URL, A, DIV, H2, H3, H4, P, TABLE, TR, TD, XML, HR\n'), ((3883, 3921), 'gluon.DIV', 'DIV', (['*info'], {'... |
from packaging.version import parse as Version
import sys
import requests
def get_pypi_xmlrpc_client():
"""This is actually deprecated client."""
import xmlrpc.client
return xmlrpc.client.ServerProxy("https://pypi.python.org/pypi", use_datetime=True)
class PyPIClient:
def __init__(self, host="http... | [
"packaging.specifiers.SpecifierSet",
"packaging.version.parse",
"requests.Session"
] | [((386, 404), 'requests.Session', 'requests.Session', ([], {}), '()\n', (402, 404), False, 'import requests\n'), ((1772, 1796), 'packaging.version.parse', 'Version', (['package_version'], {}), '(package_version)\n', (1779, 1796), True, 'from packaging.version import parse as Version\n'), ((1467, 1496), 'packaging.speci... |
# Generated by Django 3.2 on 2021-04-27 05:02
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('client', '0001_initial'),
]
operations = [
migrations.RemoveField(
model_name='client',
name='client_DOB',
),
... | [
"django.db.migrations.RemoveField",
"django.db.models.CharField"
] | [((221, 283), 'django.db.migrations.RemoveField', 'migrations.RemoveField', ([], {'model_name': '"""client"""', 'name': '"""client_DOB"""'}), "(model_name='client', name='client_DOB')\n", (243, 283), False, 'from django.db import migrations, models\n'), ((328, 393), 'django.db.migrations.RemoveField', 'migrations.Remov... |
from telegram import InlineKeyboardMarkup
from telegram.message import Message
from telegram.update import Update
import time
import psutil
from bot import AUTO_DELETE_MESSAGE_DURATION, LOGGER, bot, \
status_reply_dict, status_reply_dict_lock, download_dict, download_dict_lock
from bot.helper.ext_utils.bot_u... | [
"bot.helper.ext_utils.bot_utils.get_readable_message",
"psutil.cpu_percent",
"psutil.disk_usage",
"bot.helper.ext_utils.bot_utils.get_readable_file_size",
"bot.bot.send_document",
"bot.bot.delete_message",
"bot.bot.edit_message_text",
"time.sleep",
"bot.download_dict.values",
"bot.status_reply_dic... | [((2762, 2784), 'bot.helper.ext_utils.bot_utils.get_readable_message', 'get_readable_message', ([], {}), '()\n', (2782, 2784), False, 'from bot.helper.ext_utils.bot_utils import get_readable_message, get_readable_file_size, MirrorStatus\n'), ((4444, 4466), 'bot.helper.ext_utils.bot_utils.get_readable_message', 'get_rea... |
# -*- coding: utf-8 -*-
"""Command Line Interface module for explorepy"""
import click
import explorepy
from sys import platform as _platform
CONTEXT_SETTINGS = dict(help_option_names=['-h', '--help'])
if _platform == 'darwin':
default_bt_backend = 'sdk'
else:
default_bt_backend = 'pybluez'
@click.group(con... | [
"click.Choice",
"explorepy.tools.bt_scan",
"click.IntRange",
"click.group",
"explorepy.set_bt_interface",
"click.option",
"click.echo",
"click.Path",
"explorepy.explore.Explore"
] | [((305, 380), 'click.group', 'click.group', ([], {'context_settings': 'CONTEXT_SETTINGS', 'invoke_without_command': '(True)'}), '(context_settings=CONTEXT_SETTINGS, invoke_without_command=True)\n', (316, 380), False, 'import click\n'), ((382, 459), 'click.option', 'click.option', (['"""--version"""', '"""-V"""'], {'hel... |
from edi_835_parser.elements.identifier import Identifier
from edi_835_parser.segments.utilities import split_segment, get_element
class ProviderSummary:
identification = 'TS3'
identifier = Identifier()
def __init__(self, segment: str):
self.index = segment.split(':', 1)[0]
segment = segment.split(':', 1)[1]... | [
"edi_835_parser.elements.identifier.Identifier",
"edi_835_parser.segments.utilities.split_segment",
"edi_835_parser.segments.utilities.get_element"
] | [((195, 207), 'edi_835_parser.elements.identifier.Identifier', 'Identifier', ([], {}), '()\n', (205, 207), False, 'from edi_835_parser.elements.identifier import Identifier\n'), ((333, 355), 'edi_835_parser.segments.utilities.split_segment', 'split_segment', (['segment'], {}), '(segment)\n', (346, 355), False, 'from ed... |
"""
pgoapi - Pokemon Go API
Copyright (c) 2016 tjado <https://github.com/tejado>
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... | [
"logging.getLogger",
"s2sphere.LatLng.from_degrees",
"struct.pack",
"geopy.geocoders.GoogleV3"
] | [((1368, 1395), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1385, 1395), False, 'import logging\n'), ((1920, 1930), 'geopy.geocoders.GoogleV3', 'GoogleV3', ([], {}), '()\n', (1928, 1930), False, 'from geopy.geocoders import GoogleV3\n'), ((1442, 1466), 'struct.pack', 'struct.pack', ([... |
import time
from locust import HttpLocust, TaskSet, task, events
import boto3
import json
import os
class SageMakerEndpointTastSet(TaskSet):
def __init__(self, parent):
super().__init__(parent)
self.__config__ = None
@property
def data(self):
return self.config["dataPayload"]
... | [
"boto3.client",
"locust.events.request_failure.fire",
"os.path.realpath",
"os.path.dirname",
"locust.events.request_success.fire",
"time.time"
] | [((875, 928), 'boto3.client', 'boto3.client', (['"""sagemaker-runtime"""'], {'region_name': 'region'}), "('sagemaker-runtime', region_name=region)\n", (887, 928), False, 'import boto3\n'), ((1948, 1959), 'time.time', 'time.time', ([], {}), '()\n', (1957, 1959), False, 'import time\n'), ((983, 1008), 'os.path.dirname', ... |
from movies_search import MoviesSearch
movie_to_search = input('Enter a movie name or part of it: ')
search = MoviesSearch(movie_to_search)
search.get_formatted_result()
| [
"movies_search.MoviesSearch"
] | [((114, 143), 'movies_search.MoviesSearch', 'MoviesSearch', (['movie_to_search'], {}), '(movie_to_search)\n', (126, 143), False, 'from movies_search import MoviesSearch\n')] |
import unittest
import os
class TestLoadFasta(unittest.TestCase):
def test_protein_unchanged_invalid(self):
from multicov.alignment import Alignment
from multicov.align_io import load_fasta
from multicov.alphabet import protein_alphabet
align = load_fasta(os.path.join('test_data',... | [
"multicov.align_io.from_hdf",
"os.path.join",
"multicov.alignment.Alignment",
"multicov.align_io.to_hdf"
] | [((440, 514), 'multicov.alignment.Alignment', 'Alignment', (["['IVGGYTCQ', 'XVGGTEAQ', 'IGG-KDT-']"], {'alphabet': 'protein_alphabet'}), "(['IVGGYTCQ', 'XVGGTEAQ', 'IGG-KDT-'], alphabet=protein_alphabet)\n", (449, 514), False, 'from multicov.alignment import Alignment\n'), ((952, 1026), 'multicov.alignment.Alignment', ... |
""" Classes to implement the artificial bee colony algorithm. """
from numpy.random import uniform
class Colony:
""" Implements the artificial bee colony algorithm.
Args:
objective: objective function called by each bee at each food source.
Must return a "honey" value that will be max... | [
"numpy.random.uniform"
] | [((4169, 4180), 'numpy.random.uniform', 'uniform', (['*v'], {}), '(*v)\n', (4176, 4180), False, 'from numpy.random import uniform\n')] |
import numpy as np
import os
import math
import random
from argparse import ArgumentParser
from util.config import configure
from tqdm import tqdm
import renderer.randomize.scene_randomizer as sr
'''
This script creates a folder structure containing 'size' + 'testing_size' batches,
where each batch consists of a cer... | [
"renderer.randomize.scene_randomizer.select_randomizer",
"argparse.ArgumentParser",
"os.makedirs",
"util.config.configure",
"os.path.join",
"os.path.abspath",
"random.randint"
] | [((532, 548), 'argparse.ArgumentParser', 'ArgumentParser', ([], {}), '()\n', (546, 548), False, 'from argparse import ArgumentParser\n'), ((1280, 1313), 'util.config.configure', 'configure', (['args'], {'ignore_data': '(True)'}), '(args, ignore_data=True)\n', (1289, 1313), False, 'from util.config import configure\n'),... |
import os
import sys
def set_action_output(name: str, value: str):
sys.stdout.write(f'::set-output name={name}::{value}\n')
def main():
path = os.environ["INPUT_PATH"]
extension = os.environ["INPUT_TYPE"]
path_count = 0
paths = ''
for root, dirs, files in os.walk(path):
for file in ... | [
"sys.exit",
"os.walk",
"sys.stdout.write"
] | [((73, 129), 'sys.stdout.write', 'sys.stdout.write', (['f"""::set-output name={name}::{value}\n"""'], {}), "(f'::set-output name={name}::{value}\\n')\n", (89, 129), False, 'import sys\n'), ((285, 298), 'os.walk', 'os.walk', (['path'], {}), '(path)\n', (292, 298), False, 'import os\n'), ((587, 598), 'sys.exit', 'sys.exi... |
import FWCore.ParameterSet.Config as cms
from L1TriggerConfig.L1GtConfigProducers.l1GtPrescaleFactorsTechTrig_cfi import *
#
L1GtPrescaleFactorsTechTrigRcdSource = cms.ESSource("EmptyESSource",
recordName = cms.string('L1GtPrescaleFactorsTechTrigRcd'),
iovIsRunNotTime = cms.bool(True),
firstValid = cms.vui... | [
"FWCore.ParameterSet.Config.string",
"FWCore.ParameterSet.Config.vuint32",
"FWCore.ParameterSet.Config.bool"
] | [((212, 256), 'FWCore.ParameterSet.Config.string', 'cms.string', (['"""L1GtPrescaleFactorsTechTrigRcd"""'], {}), "('L1GtPrescaleFactorsTechTrigRcd')\n", (222, 256), True, 'import FWCore.ParameterSet.Config as cms\n'), ((280, 294), 'FWCore.ParameterSet.Config.bool', 'cms.bool', (['(True)'], {}), '(True)\n', (288, 294), ... |
import numpy as np
import scipy as sp
from ipdb import set_trace as st
import skimage as ski
import utils
from matplotlib import pyplot as plt
import matplotlib as mpl
from common import *
from munch import Munch as M
from scipy import sparse
from scipy.interpolate import Rbf
import os
class Register:
def __init__... | [
"utils.get_nearest_neighbors",
"numpy.unique",
"numpy.ones",
"utils.nearby_pairs",
"numpy.arange",
"numpy.sort",
"numpy.stack",
"numpy.zeros",
"os.path.basename",
"numpy.linalg.norm",
"numpy.percentile",
"munch.Munch",
"numpy.save",
"utils.fit_affine"
] | [((383, 574), 'munch.Munch', 'M', ([], {'max_stars': '(500)', 'nneighbors': '(500)', 'ba_max_ratio': '(0.99)', 'cb_max_ratio': '(0.99)', 'epsilon': '(0.001)', 'min_abs_diff': '(1)', 'min_rel_diff': '(1.4)', 'ransac_iters': '(50)', 'ransac_keep_percentile': '(99)', 'linear_fit_tol': '(2.0)'}), '(max_stars=500, nneighbor... |
# coding=utf-8
from collections import namedtuple
from slideatlas import models
from .common import OAuthLogin
################################################################################
__all__ = ()
################################################################################
class FacebookOAuthLogin(OAut... | [
"collections.namedtuple",
"slideatlas.models.Group.objects"
] | [((1478, 1556), 'collections.namedtuple', 'namedtuple', (['"""FacebookPerson"""', "(OAuthLogin.Person._fields + ('facebook_groups',))"], {}), "('FacebookPerson', OAuthLogin.Person._fields + ('facebook_groups',))\n", (1488, 1556), False, 'from collections import namedtuple\n'), ((3227, 3287), 'slideatlas.models.Group.ob... |
from django import forms
from django.contrib import admin
from .models import Tag
class TagAdminForm(forms.ModelForm):
class Meta:
model = Tag
widgets = {
'color': forms.TextInput(attrs={'type': 'color'})
}
fields = '__all__'
@admin.register(Tag)
class TagAdmin(admin... | [
"django.contrib.admin.register",
"django.forms.TextInput"
] | [((280, 299), 'django.contrib.admin.register', 'admin.register', (['Tag'], {}), '(Tag)\n', (294, 299), False, 'from django.contrib import admin\n'), ((199, 239), 'django.forms.TextInput', 'forms.TextInput', ([], {'attrs': "{'type': 'color'}"}), "(attrs={'type': 'color'})\n", (214, 239), False, 'from django import forms... |
from elasticsearch import Elasticsearch
es = Elasticsearch(
hosts = [{'host': 'es-domain.es.amazonaws.com', 'port': 443}],
use_ssl=True, verify_certs=True
)
document = {"name": "ruan", "surname": "bekker"}
response = es.index(index='my-index', doc_type='_doc', body=document)
# response
# {'_index': 'my-ind... | [
"elasticsearch.Elasticsearch"
] | [((46, 157), 'elasticsearch.Elasticsearch', 'Elasticsearch', ([], {'hosts': "[{'host': 'es-domain.es.amazonaws.com', 'port': 443}]", 'use_ssl': '(True)', 'verify_certs': '(True)'}), "(hosts=[{'host': 'es-domain.es.amazonaws.com', 'port': 443}],\n use_ssl=True, verify_certs=True)\n", (59, 157), False, 'from elasticse... |
import traceback
import logging
import attr
from .. import entities, exceptions
logger = logging.getLogger(name=__name__)
@attr.s
class User(entities.BaseEntity):
"""
User entity
"""
created_at = attr.ib()
updated_at = attr.ib(repr=False)
name = attr.ib()
last_name = attr.ib()
userna... | [
"logging.getLogger",
"traceback.format_exc",
"attr.fields",
"attr.ib"
] | [((91, 123), 'logging.getLogger', 'logging.getLogger', ([], {'name': '__name__'}), '(name=__name__)\n', (108, 123), False, 'import logging\n'), ((216, 225), 'attr.ib', 'attr.ib', ([], {}), '()\n', (223, 225), False, 'import attr\n'), ((243, 262), 'attr.ib', 'attr.ib', ([], {'repr': '(False)'}), '(repr=False)\n', (250, ... |
"""
Copyright (c) 2020 COTOBA DESIGN, Inc.
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, publish, distri... | [
"programy.clients.events.console.config.ConsoleConfiguration",
"os.path.dirname",
"programy.utils.substitutions.substitues.Substitutions",
"unittest.skip",
"programy.config.file.xml_file.XMLConfigurationFile"
] | [((1449, 1473), 'unittest.skip', 'unittest.skip', (['"""単体操作が必要"""'], {}), "('単体操作が必要')\n", (1462, 1473), False, 'import unittest\n'), ((3110, 3134), 'unittest.skip', 'unittest.skip', (['"""単体操作が必要"""'], {}), "('単体操作が必要')\n", (3123, 3134), False, 'import unittest\n'), ((3881, 3905), 'unittest.skip', 'unittest.skip', ([... |
from datetime import timedelta
from .interchange import WaypointType
class ActivityStatisticCalculator:
ImplicitPauseTime = timedelta(minutes=1, seconds=5)
def CalculateDistance(act, startWpt=None, endWpt=None):
import math
dist = 0
altHold = None # seperate from the lastLoc variable,... | [
"math.cos",
"datetime.timedelta",
"math.sqrt"
] | [((129, 160), 'datetime.timedelta', 'timedelta', ([], {'minutes': '(1)', 'seconds': '(5)'}), '(minutes=1, seconds=5)\n', (138, 160), False, 'from datetime import timedelta\n'), ((2590, 2602), 'datetime.timedelta', 'timedelta', (['(0)'], {}), '(0)\n', (2599, 2602), False, 'from datetime import timedelta\n'), ((2132, 217... |
import logging
from collections import defaultdict
from pathlib import Path
from typing import DefaultDict, Dict, Iterable, List, Optional, Set
from panimg.exceptions import UnconsumedFilesException
from panimg.image_builders import DEFAULT_IMAGE_BUILDERS
from panimg.models import (
PanImg,
PanImgFile,
Pan... | [
"logging.getLogger",
"panimg.models.PostProcessorResult",
"pathlib.Path",
"collections.defaultdict",
"panimg.models.PanImgResult"
] | [((498, 525), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (515, 525), False, 'import logging\n'), ((991, 1008), 'collections.defaultdict', 'defaultdict', (['list'], {}), '(list)\n', (1002, 1008), False, 'from collections import defaultdict\n'), ((1853, 2011), 'panimg.models.PanImgResul... |
# -*- coding: utf-8 -*-
# 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | [
"warnings.warn",
"google.api_core.grpc_helpers.create_channel",
"grpc.ssl_channel_credentials",
"google.auth.transport.grpc.SslCredentials"
] | [((9606, 9769), 'google.api_core.grpc_helpers.create_channel', 'grpc_helpers.create_channel', (['host'], {'credentials': 'credentials', 'credentials_file': 'credentials_file', 'scopes': 'scopes', 'quota_project_id': 'quota_project_id'}), '(host, credentials=credentials, credentials_file\n =credentials_file, scopes=s... |
import collections
import os
import tempfile
import pytest # noqa
import anwesende.utils.excel as aue
the_3by3_file = "anwesende/utils/tests/data/3by3.xlsx"
def test_read_excel_as_columnsdict():
cd = aue.read_excel_as_columnsdict(the_3by3_file)
assert set(cd.keys()) == set(["A-str", "B-int", "C-str"])
... | [
"collections.namedtuple",
"anwesende.utils.excel.read_excel_as_columnsdict",
"os.unlink",
"anwesende.utils.excel.write_excel_from_rowslists",
"tempfile.NamedTemporaryFile"
] | [((210, 254), 'anwesende.utils.excel.read_excel_as_columnsdict', 'aue.read_excel_as_columnsdict', (['the_3by3_file'], {}), '(the_3by3_file)\n', (239, 254), True, 'import anwesende.utils.excel as aue\n'), ((744, 792), 'collections.namedtuple', 'collections.namedtuple', (['"""TestTuple"""', '"""a b c dee"""'], {}), "('Te... |
# coding: utf-8
"""
TeamCity REST API
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
OpenAPI spec version: 2018.1
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
fro... | [
"six.iteritems",
"re.search"
] | [((120752, 120783), 'six.iteritems', 'six.iteritems', (["params['kwargs']"], {}), "(params['kwargs'])\n", (120765, 120783), False, 'import six\n'), ((123729, 123760), 'six.iteritems', 'six.iteritems', (["params['kwargs']"], {}), "(params['kwargs'])\n", (123742, 123760), False, 'import six\n'), ((126597, 126628), 'six.i... |
from torch import nn
class Discriminator(nn.Module):
def __init__(self, hidden_size=512):
super(Discriminator,self).__init__()
self.model = nn.Sequential(
nn.Linear(hidden_size, hidden_size//2),
nn.LeakyReLU(0.2, inplace=True),
nn.Linear(hidden_size//2, 256),
nn.LeakyReLU(0.2, inplace=True),
nn.Li... | [
"torch.nn.Sigmoid",
"torch.nn.LeakyReLU",
"torch.nn.Linear"
] | [((165, 205), 'torch.nn.Linear', 'nn.Linear', (['hidden_size', '(hidden_size // 2)'], {}), '(hidden_size, hidden_size // 2)\n', (174, 205), False, 'from torch import nn\n'), ((208, 239), 'torch.nn.LeakyReLU', 'nn.LeakyReLU', (['(0.2)'], {'inplace': '(True)'}), '(0.2, inplace=True)\n', (220, 239), False, 'from torch imp... |
import requests
import ast
"""some modifactions to coinCommand to allow an easier way to test cli"""
def cp(coin,currency):
"""gets coin price """
try:
return cp_Request_to_Url(coin,currency)
except Exception as err:
return "coin or currency doesnt exist"
def cp_Request_to_Url(coin,price):
url="https:/... | [
"ast.literal_eval",
"requests.get"
] | [((407, 424), 'requests.get', 'requests.get', (['url'], {}), '(url)\n', (419, 424), False, 'import requests\n'), ((558, 583), 'ast.literal_eval', 'ast.literal_eval', (['request'], {}), '(request)\n', (574, 583), False, 'import ast\n'), ((978, 995), 'requests.get', 'requests.get', (['url'], {}), '(url)\n', (990, 995), F... |
"""
@author : <NAME>
@date : 1-10-2021
Ensemble Learning is an often overshadowed and underestimated field of machine learning. Here we provide 2 algorithms
central to the game - random forests and ensemble/voting classifier. Random Forests are very especially fast
with parallel processing to fit multiple decision tre... | [
"random.sample",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"multiprocessing.cpu_count",
"joblib.delayed",
"numpy.array_split",
"numpy.array",
"joblib.Parallel",
"joblib.parallel_backend",
"pandas.DataFrame",
"matplotlib.pyplot.title",
"matplotlib.pyplot.cla",
"warnings.filterwa... | [((521, 576), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {'category': 'UserWarning'}), "('ignore', category=UserWarning)\n", (544, 576), False, 'import warnings\n'), ((6863, 6872), 'matplotlib.pyplot.cla', 'plt.cla', ([], {}), '()\n', (6870, 6872), True, 'import matplotlib.pyplot as plt\n'... |
from flask import abort
from flask_security import current_user
from classes.shared import db, socketio
from classes import RecordedVideo
from classes import settings
from classes import notifications
from classes import subscriptions
from functions import system
from functions import webhookFunc
from functions impor... | [
"functions.templateFilters.get_topicName",
"functions.videoFunc.changeVideoMetadata",
"functions.videoFunc.changeClipMetadata",
"classes.shared.socketio.on",
"functions.templateFilters.get_userName",
"functions.videoFunc.deleteVideo",
"flask.abort",
"functions.videoFunc.createClip",
"classes.shared.... | [((422, 448), 'classes.shared.socketio.on', 'socketio.on', (['"""deleteVideo"""'], {}), "('deleteVideo')\n", (433, 448), False, 'from classes.shared import db, socketio\n'), ((925, 949), 'classes.shared.socketio.on', 'socketio.on', (['"""editVideo"""'], {}), "('editVideo')\n", (936, 949), False, 'from classes.shared im... |
#!/usr/bin/env python
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# <NAME>
# California Institute of Technology
# (C) 2007 All Rights Reserved
#
# {LicenseText}
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~... | [
"unittestX.makeSuite",
"mcstas2.components.componentfactory",
"unittestX.TestSuite",
"unittestX.TextTestRunner",
"mcstas2.wrappers.wrap"
] | [((1113, 1146), 'unittestX.makeSuite', 'unittest.makeSuite', (['wrap_TestCase'], {}), '(wrap_TestCase)\n', (1131, 1146), True, 'import unittestX as unittest\n'), ((1158, 1187), 'unittestX.TestSuite', 'unittest.TestSuite', (['(suite1,)'], {}), '((suite1,))\n', (1176, 1187), True, 'import unittestX as unittest\n'), ((132... |
"""App exceptions manager."""
import asyncio
import traceback
from typing import Optional
from kivy.base import (
ExceptionHandler,
ExceptionManager,
)
from kivy.clock import Clock
from kivy.properties import StringProperty # pylint: disable=no-name-in-module
from kivy.lang import Builder
from kivy.logger imp... | [
"traceback.format_exc",
"kivy.lang.Builder.load_string",
"kivy.logger.Logger.exception",
"kivy.clock.Clock.schedule_once",
"kivy.properties.StringProperty"
] | [((463, 1160), 'kivy.lang.Builder.load_string', 'Builder.load_string', (['"""<-UnhandledExceptionPopupHere>:\n title: "Unhandled Exception catched"\n BoxLayout:\n orientation: \'vertical\'\n padding: 10\n spacing: 20\n Label:\n size_hint_y: None\n font_size: \'18s... |
import os
import re
import sys
from setuptools import setup, find_packages
DIRNAME = os.path.abspath(os.path.dirname(__file__))
rel = lambda *parts: os.path.abspath(os.path.join(DIRNAME, *parts))
README = open(rel('README.md')).read()
INIT_PY = open(rel('flask_staticsite', '__init__.py')).read()
VERSION = re.search(... | [
"os.path.dirname",
"setuptools.find_packages",
"os.path.join",
"re.search"
] | [((103, 128), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (118, 128), False, 'import os\n'), ((167, 196), 'os.path.join', 'os.path.join', (['DIRNAME', '*parts'], {}), '(DIRNAME, *parts)\n', (179, 196), False, 'import os\n'), ((310, 355), 're.search', 're.search', (['"""__version__ = \'([^\... |
import os
import argparse
import json
import requests
from bs4 import BeautifulSoup
FILE_PATH = './'
def get_data_set(path):
with open(path) as f:
return json.loads(f.read())
def get_img_url_by_post_url(url):
resp = requests.get(url)
if resp.status_code != 200:
return None
soup = Bea... | [
"os.path.exists",
"argparse.ArgumentParser",
"os.makedirs",
"json.dumps",
"os.path.join",
"requests.get",
"bs4.BeautifulSoup",
"os.path.dirname"
] | [((235, 252), 'requests.get', 'requests.get', (['url'], {}), '(url)\n', (247, 252), False, 'import requests\n'), ((317, 356), 'bs4.BeautifulSoup', 'BeautifulSoup', (['resp.text', '"""html.parser"""'], {}), "(resp.text, 'html.parser')\n", (330, 356), False, 'from bs4 import BeautifulSoup\n'), ((1602, 1627), 'argparse.Ar... |
import discord
from discord.ext import commands
from modules.economy import Economy
from modules.helpers import *
class GamblingHelpers(commands.Cog, name='General'):
def __init__(self, client: commands.Bot) -> None:
self.client = client
self.economy = Economy()
@commands.command(hidden=True)... | [
"discord.Color.gold",
"modules.economy.Economy",
"discord.ext.commands.is_owner",
"discord.ext.commands.cooldown",
"discord.ext.commands.command"
] | [((291, 320), 'discord.ext.commands.command', 'commands.command', ([], {'hidden': '(True)'}), '(hidden=True)\n', (307, 320), False, 'from discord.ext import commands\n'), ((326, 345), 'discord.ext.commands.is_owner', 'commands.is_owner', ([], {}), '()\n', (343, 345), False, 'from discord.ext import commands\n'), ((639,... |
#!/usr/bin/env python
import RPi.GPIO as GPIO
import time
# pinoutBCM scheme - http://pinout.xyz/
D = [4,17,18,27,22,23,24,25]
E = 11
RW = 8
RS = 7
def wr(rs,rw,data):
GPIO.output(RS,True if rs else False)
GPIO.output(RW,True if rw else False)
time.sleep(0.001)
GPIO.output(E,True)
for i in range(8):
GP... | [
"RPi.GPIO.setup",
"RPi.GPIO.output",
"RPi.GPIO.setwarnings",
"time.sleep",
"RPi.GPIO.setmode"
] | [((540, 563), 'RPi.GPIO.setwarnings', 'GPIO.setwarnings', (['(False)'], {}), '(False)\n', (556, 563), True, 'import RPi.GPIO as GPIO\n'), ((564, 586), 'RPi.GPIO.setmode', 'GPIO.setmode', (['GPIO.BCM'], {}), '(GPIO.BCM)\n', (576, 586), True, 'import RPi.GPIO as GPIO\n'), ((587, 610), 'RPi.GPIO.setup', 'GPIO.setup', (['E... |
# Generated by Django 2.1.5 on 2019-02-19 13:28
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('membership', '0005_transaction_type_cleanup'),
]
operations = [
migrations.AddField(
model_name='addresslink',
name=... | [
"django.db.models.DecimalField"
] | [((354, 417), 'django.db.models.DecimalField', 'models.DecimalField', ([], {'null': '(True)', 'max_digits': '(23)', 'decimal_places': '(4)'}), '(null=True, max_digits=23, decimal_places=4)\n', (373, 417), False, 'from django.db import migrations, models\n')] |
import torch
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
activations = nn.ModuleDict([
['sigmoid', nn.Sigmoid()],
['tanh', nn.Tanh()],
['lrelu', nn.LeakyReLU()],
['relu', nn.ReLU()],
['selu', nn.SELU()],
... | [
"numpy.prod",
"torch.nn.ReLU",
"torch.nn.Dropout",
"torch.nn.Tanh",
"torch.nn.Sequential",
"torch.nn.BatchNorm1d",
"torch.nn.MaxPool1d",
"torch.nn.BatchNorm2d",
"torch.nn.Sigmoid",
"torch.nn.init.xavier_uniform_",
"torch.nn.AdaptiveAvgPool2d",
"torch.randn",
"torch.nn.LeakyReLU",
"numpy.fl... | [((626, 657), 'torch.randn', 'torch.randn', (['(1)', '(1)', '*input_shape'], {}), '(1, 1, *input_shape)\n', (637, 657), False, 'import torch\n'), ((726, 746), 'numpy.prod', 'np.prod', (['x.shape[1:]'], {}), '(x.shape[1:])\n', (733, 746), True, 'import numpy as np\n'), ((14486, 14514), 'torch.rand', 'torch.rand', (['(2,... |
#
# MLDB-694_external_python_procedure.py
# mldb.ai inc, 2015
# this file is part of mldb. copyright 2015 mldb.ai inc. all rights reserved.
#
from mldb import mldb
conf = {
"type": "experimental.external.procedure",
"params": {
"stdInData": "pwet",
"scriptConfig": {
"source": """
i... | [
"mldb.mldb.log",
"mldb.mldb.put"
] | [((938, 983), 'mldb.mldb.put', 'mldb.put', (['"""/v1/procedures/externalProc"""', 'conf'], {}), "('/v1/procedures/externalProc', conf)\n", (946, 983), False, 'from mldb import mldb\n'), ((984, 1002), 'mldb.mldb.log', 'mldb.log', (['rez.text'], {}), '(rez.text)\n', (992, 1002), False, 'from mldb import mldb\n'), ((1010,... |
import torch
import torch.nn as nn
from torchvision import models
class Conv2D_BN_activa(nn.Module):
def __init__(
self, in_channels, out_channels, kernel_size, stride, padding=0,
dilation=1, if_bn=True, activation='relu', bias=None, initializer=None, transpose=False
):
super(C... | [
"torch.nn.Sigmoid",
"torch.nn.BatchNorm2d",
"torch.nn.ReLU",
"torch.nn.Sequential",
"torch.nn.Conv2d",
"torch.nn.init.normal_",
"torchvision.models.vgg16_bn",
"torch.nn.ConvTranspose2d",
"torch.cat"
] | [((2201, 2227), 'torch.cat', 'torch.cat', (['(x1, x2, x3)', '(1)'], {}), '((x1, x2, x3), 1)\n', (2210, 2227), False, 'import torch\n'), ((3023, 3065), 'torch.cat', 'torch.cat', (['(path1, path2, path3, path4)', '(1)'], {}), '((path1, path2, path3, path4), 1)\n', (3032, 3065), False, 'import torch\n'), ((3657, 3690), 't... |
"""
A Programamtic entrypoint for sli commands, populates sys.argv
as if the command were called from the CLI directly.
usage:
from sli.sli_api import run_command
run_command("sli configure -n my_skillet.skillet.yaml -d 192.168.1.1 -u username -p password")
"""
import sys
from sli.cli import cli
from sli.errors impor... | [
"sli.errors.InvalidArgumentsException",
"sys.argv.append",
"sli.cli.cli",
"sli.errors.SLIException"
] | [((1498, 1524), 'sli.cli.cli', 'cli', ([], {'standalone_mode': '(False)'}), '(standalone_mode=False)\n', (1501, 1524), False, 'from sli.cli import cli\n'), ((936, 986), 'sli.errors.SLIException', 'SLIException', (['"""SLI command did not start with sli"""'], {}), "('SLI command did not start with sli')\n", (948, 986), ... |
# coding=utf-8
import math
import types
import numpy as np
import pandas as pd
from ....data.materials.CompositionEntry import CompositionEntry
from ....data.materials.util.LookUpData import LookUpData
class YangOmegaAttributeGenerator:
"""Class to compute the attributes :math:`\Omega` and :math:`\delta`
devel... | [
"pandas.DataFrame",
"math.sqrt",
"math.log",
"numpy.average"
] | [((5705, 5752), 'pandas.DataFrame', 'pd.DataFrame', (['feat_values'], {'columns': 'feat_headers'}), '(feat_values, columns=feat_headers)\n', (5717, 5752), True, 'import pandas as pd\n'), ((4572, 4616), 'numpy.average', 'np.average', (['tmp_meltingT'], {'weights': 'elem_fracs'}), '(tmp_meltingT, weights=elem_fracs)\n', ... |
from SpaceUnitTest import SpaceUnitTest
from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
import SpaceHabitServer
import threading
import cherrypy
import time
import requests
import AuthenticationLayer
import DatabaseL... | [
"SpaceHabitServer.HabitServer",
"selenium.webdriver.Firefox",
"time.sleep",
"DatabaseTestSetupCleanup.clean_up"
] | [((505, 535), 'SpaceHabitServer.HabitServer', 'SpaceHabitServer.HabitServer', ([], {}), '()\n', (533, 535), False, 'import SpaceHabitServer\n'), ((823, 840), 'DatabaseTestSetupCleanup.clean_up', 'dbHelp.clean_up', ([], {}), '()\n', (838, 840), True, 'import DatabaseTestSetupCleanup as dbHelp\n'), ((1122, 1141), 'seleni... |
# -*- coding: utf-8 -*-
"""
Created on Fri Sep 27 15:54:52 2019
@author: <NAME>.
"""
#importing the libraries.
import numpy as np
import pandas as pd
import torch
import torch.nn as nn
import torch.nn.parallel
import torch.optim as optim
import torch.autograd as variable
from sklearn.model_selection import train_test_... | [
"torch.abs",
"pandas.read_csv",
"sklearn.model_selection.train_test_split",
"numpy.zeros",
"torch.FloatTensor"
] | [((637, 695), 'sklearn.model_selection.train_test_split', 'train_test_split', (['test_set'], {'test_size': '(0.5)', 'random_state': '(42)'}), '(test_set, test_size=0.5, random_state=42)\n', (653, 695), False, 'from sklearn.model_selection import train_test_split\n'), ((495, 541), 'pandas.read_csv', 'pd.read_csv', (['""... |
import os
import re
import sys
import ssl
import shutil
import zipfile
import tarfile
import logging
import argparse
import platform
from os import makedirs
from os.path import join, isfile, basename
from os.path import isdir, dirname, abspath
from urllib.request import urlopen
from __init__ import __description__, __... | [
"logging.getLogger",
"tarfile.open",
"zipfile.ZipFile",
"os.remove",
"argparse.ArgumentParser",
"platform.system",
"os.path.isdir",
"urllib.request.urlopen",
"shutil.copyfileobj",
"os.rename",
"re.match",
"os.path.isfile",
"os.path.dirname",
"platform.machine",
"logging.basicConfig",
"... | [((331, 427), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.INFO', 'format': '"""%(asctime)s - %(levelname)s - %(message)s"""'}), "(level=logging.INFO, format=\n '%(asctime)s - %(levelname)s - %(message)s')\n", (350, 427), False, 'import logging\n'), ((432, 459), 'logging.getLogger', 'logging... |
'''
divxstage urlresolver plugin
Copyright (C) 2011 t0mm0, DragonWin
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This prog... | [
"urlresolver.common.Net",
"re.compile",
"urlresolver.resolver.ResolverError",
"re.search"
] | [((1088, 1100), 'urlresolver.common.Net', 'common.Net', ([], {}), '()\n', (1098, 1100), False, 'from urlresolver import common\n'), ((1258, 1301), 're.search', 're.search', (['"""flashvars.filekey=(.+?);"""', 'html'], {}), "('flashvars.filekey=(.+?);', html)\n", (1267, 1301), False, 'import re\n'), ((1988, 2016), 're.s... |
import base64
import os
import time
import uuid
import requests
import typer
from pydantic import BaseModel
from collections import namedtuple
from .backend_profile import backend_profile
from .utils import log_title
app = typer.Typer()
SLACK_INTEGRATION_SERVICE_ADDRESS = os.environ.get(
"SLACK_INTEGRATION_SERV... | [
"typer.secho",
"collections.namedtuple",
"typer.launch",
"os.environ.get",
"typer.Typer",
"time.sleep",
"uuid.uuid4",
"requests.get",
"typer.style"
] | [((226, 239), 'typer.Typer', 'typer.Typer', ([], {}), '()\n', (237, 239), False, 'import typer\n'), ((277, 406), 'os.environ.get', 'os.environ.get', (['"""SLACK_INTEGRATION_SERVICE_ADDRESS"""', 'f"""{backend_profile.robusta_cloud_api_host}/integrations/slack/get-token"""'], {}), "('SLACK_INTEGRATION_SERVICE_ADDRESS',\n... |
#!/usr/bin/env python
# coding: utf-8
# In[1]:
xs = [1,2,3,4,5,6,7,8]
ys = []
for x in xs:
ys.append(x*x)
print(xs)
print(ys)
# In[2]:
xs = [1,2,3,4,5,6,7,8]
ys = [x*x for x in xs]
print(xs)
print(ys)
# In[4]:
students = ["Max", "Min", "Xi", "Feng", "Ding"]
#lengths = []
#for student in students... | [
"matplotlib.pyplot.plot"
] | [((523, 539), 'matplotlib.pyplot.plot', 'plt.plot', (['xs', 'ys'], {}), '(xs, ys)\n', (531, 539), True, 'import matplotlib.pyplot as plt\n')] |
# Always prefer setuptools over distutils
from setuptools import setup, find_packages
# To use a consistent encoding
from codecs import open
from os import path
here = path.abspath(path.dirname(__file__))
# Get the long description from the README file
with open(path.join(here, 'README.md'), encoding='utf-8') as f:
... | [
"os.path.join",
"os.path.dirname",
"setuptools.setup"
] | [((352, 1307), 'setuptools.setup', 'setup', ([], {'version': '"""0.0.2"""', 'name': '"""heroku-kafka-eze"""', 'description': '"""Python kafka package for use with heroku\'s kafka. You\'ll only need your heroku api key and app name"""', 'long_description': 'long_description', 'classifiers': "['Development Status :: 4 - ... |
# coding: utf-8
from __future__ import absolute_import
from datetime import date, datetime # noqa: F401
from typing import List, Dict # noqa: F401
from tapi_server.models.base_model_ import Model
from tapi_server.models.tapi_common_context_service_interface_point import TapiCommonContextServiceInterfacePoint # no... | [
"tapi_server.util.deserialize_model"
] | [((5136, 5169), 'tapi_server.util.deserialize_model', 'util.deserialize_model', (['dikt', 'cls'], {}), '(dikt, cls)\n', (5158, 5169), False, 'from tapi_server import util\n')] |
# TODO: Only require market stats that are being used by ML models
# TODO: Allow storage/retrieval of multiple markets
""" Allows storage/retrieval for custom market data instead of automatic gathering """
from api import api, db
from api.helpers import HTTP_CODES, query_to_dict, validate_db
from api.models.market impo... | [
"api.helpers.validate_db",
"webargs.flaskparser.use_kwargs",
"api.db.session.add",
"api.models.market.Data.query.all",
"api.models.market.Data.query.get_or_404",
"api.models.market.Data.query.delete",
"api.db.session.commit",
"api.models.market.Data",
"api.helpers.query_to_dict",
"api.api.resource... | [((693, 729), 'api.api.resource', 'api.resource', (['"""/api/private/market/"""'], {}), "('/api/private/market/')\n", (705, 729), False, 'from api import api, db\n'), ((497, 526), 'webargs.fields.Integer', 'fields.Integer', ([], {'required': '(True)'}), '(required=True)\n', (511, 526), False, 'from webargs import field... |
# -*- coding: utf-8 -*-
# Copyright 2018 Moarri 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 required by applicable law o... | [
"os.listdir",
"moarri_profile_iacs.iacs_graphics.profile_image.ProfileGraphicsImage",
"os.path.join",
"os.path.splitext",
"os.path.isdir",
"moarri_profile_iacs.profile_tools.spp.import_spp",
"os.path.abspath"
] | [((1113, 1136), 'os.path.isdir', 'os.path.isdir', (['spp_path'], {}), '(spp_path)\n', (1126, 1136), False, 'import os\n'), ((1963, 1999), 'moarri_profile_iacs.iacs_graphics.profile_image.ProfileGraphicsImage', 'ProfileGraphicsImage', (['s[0]', '(800)', '(620)'], {}), '(s[0], 800, 620)\n', (1983, 1999), False, 'from moa... |
import collections
import time
import socket
import select
import sys
from swfc_lt_stream import net, sampler
class Node(object):
def __init__(self, samples, block):
self.samples = samples
self.block = block
class Decoder(object):
def __init__(self, conf):
self.sampler = sampler.PRN... | [
"swfc_lt_stream.net.build_shift_packet",
"select.select",
"socket.socket",
"time.sleep",
"swfc_lt_stream.net.build_packet",
"sys.stdout.buffer.write",
"collections.defaultdict",
"swfc_lt_stream.net.clean_packet",
"swfc_lt_stream.sampler.PRNG"
] | [((309, 354), 'swfc_lt_stream.sampler.PRNG', 'sampler.PRNG', (['conf.window', 'conf.c', 'conf.delta'], {}), '(conf.window, conf.c, conf.delta)\n', (321, 354), False, 'from swfc_lt_stream import net, sampler\n'), ((696, 725), 'collections.defaultdict', 'collections.defaultdict', (['list'], {}), '(list)\n', (719, 725), F... |
'''
SpeakDiar.py
21 audio recordings of academic conferences making up the NIST speaker
diarization dataset, created to asses the ability of different models to
segment speech data into unique speakers.
The 21 recordings are meant to be trained on independently.
Thus, get_data() takes a meetingNum parameter (default ... | [
"matplotlib.pylab.xlim",
"matplotlib.pylab.xticks",
"numpy.argsort",
"matplotlib.pylab.hold",
"bnpy.data.GroupXData.read_from_mat",
"matplotlib.pylab.show",
"argparse.ArgumentParser",
"numpy.asarray",
"os.path.isdir",
"numpy.maximum",
"matplotlib.pylab.plot",
"numpy.allclose",
"numpy.size",
... | [((1925, 1950), 'os.path.isdir', 'os.path.isdir', (['datasetdir'], {}), '(datasetdir)\n', (1938, 1950), False, 'import os\n'), ((2583, 2651), 'os.path.join', 'os.path.join', (['datasetdir', '"""rawData"""', '"""speakerDiarizationData"""', 'fName'], {}), "(datasetdir, 'rawData', 'speakerDiarizationData', fName)\n", (259... |
import pandas as pd
import plotly
import plotly.graph_objs as go
def I_have_both():
A = float(input("What is your A value?: "))
Z = float(input("What is your Z value?: "))
B= find_binding_energy(A, Z)
print("Your binding energy per nucleon is: " + str(B / A) + "MeV \n" + "Your binding energy ... | [
"pandas.DataFrame",
"plotly.offline.plot",
"plotly.graph_objs.Scatter"
] | [((1652, 1704), 'pandas.DataFrame', 'pd.DataFrame', (['output'], {'columns': "['B', 'A', 'Z', 'B/A']"}), "(output, columns=['B', 'A', 'Z', 'B/A'])\n", (1664, 1704), True, 'import pandas as pd\n'), ((1715, 1763), 'plotly.graph_objs.Scatter', 'go.Scatter', ([], {'x': "output_df['Z']", 'y': "output_df['B/A']"}), "(x=outpu... |
from openvino.inference_engine import IECore, IENetwork
class Network:
#Constructor class to declare variables, any of these still as 'None' in console, an error occured when initializing it
def __init__(self):
#NEED TO: put ntoes done indicating what each does
self.plugin = None
... | [
"openvino.inference_engine.IECore",
"openvino.inference_engine.IENetwork"
] | [((731, 739), 'openvino.inference_engine.IECore', 'IECore', ([], {}), '()\n', (737, 739), False, 'from openvino.inference_engine import IECore, IENetwork\n'), ((764, 803), 'openvino.inference_engine.IENetwork', 'IENetwork', (['model_xml'], {'weights': 'model_bin'}), '(model_xml, weights=model_bin)\n', (773, 803), False... |
# Copyright (c) 2011 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import BaseHTTPServer
import cgi
import mimetypes
import os
import os.path
import posixpath
import SimpleHTTPServer
import SocketServer
import threading
... | [
"mimetypes.types_map.copy",
"SimpleHTTPServer.SimpleHTTPRequestHandler.send_header",
"time.strptime",
"posixpath.splitext",
"urllib.unquote",
"threading.Lock",
"time.mktime",
"os.path.join",
"cgi.parse_qs",
"time.sleep",
"os.path.isfile",
"os.remove",
"os.path.basename",
"SimpleHTTPServer.... | [((10515, 10541), 'mimetypes.types_map.copy', 'mimetypes.types_map.copy', ([], {}), '()\n', (10539, 10541), False, 'import mimetypes\n'), ((2450, 2474), 'posixpath.splitext', 'posixpath.splitext', (['path'], {}), '(path)\n', (2468, 2474), False, 'import posixpath\n'), ((4116, 4191), 'SimpleHTTPServer.SimpleHTTPRequestH... |
from django.contrib.auth.models import User
from django.db.models import Q
from django.test import TestCase, Client, RequestFactory
from ..models import Report
# Create your tests here.
class SearchTest(TestCase):
def setUp(self):
self.client = Client()
self.client.post('/report/user_register/'... | [
"django.test.RequestFactory",
"django.db.models.Q",
"django.contrib.auth.models.User.objects.get",
"django.test.Client"
] | [((262, 270), 'django.test.Client', 'Client', ([], {}), '()\n', (268, 270), False, 'from django.test import TestCase, Client, RequestFactory\n'), ((567, 583), 'django.test.RequestFactory', 'RequestFactory', ([], {}), '()\n', (581, 583), False, 'from django.test import TestCase, Client, RequestFactory\n'), ((674, 696), ... |
import os
def check(path):
for item in os.scandir(path):
if item.is_file() and not item.name.endswith(".gz"):
print(item.name)
if item.is_dir():
check(item.path)
if __name__ == "__main__":
check(".")
| [
"os.scandir"
] | [((44, 60), 'os.scandir', 'os.scandir', (['path'], {}), '(path)\n', (54, 60), False, 'import os\n')] |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
1D PASS/MAT sideband order cross-section
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
"""
# %%
# This example illustrates the use of mrsimulator and LMFIT modules in fitting the
# sideband intensity profile across the isotropic chemical shift cross-section from a
# PASS/MAT... | [
"matplotlib.pyplot.grid",
"mrsimulator.utils.get_spectral_dimensions",
"lmfit.Minimizer",
"mrsimulator.signal_processing.Scale",
"mrsimulator.SpinSystem",
"mrsimulator.utils.spectral_fitting.make_LMFIT_params",
"mrsimulator.Simulator",
"mrsimulator.methods.BlochDecaySpectrum",
"csdmpy.load",
"matp... | [((863, 876), 'csdmpy.load', 'cp.load', (['name'], {}), '(name)\n', (870, 876), True, 'import csdmpy as cp\n'), ((1250, 1281), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'figsize': '(4.25, 3.0)'}), '(figsize=(4.25, 3.0))\n', (1260, 1281), True, 'import matplotlib.pyplot as plt\n'), ((1287, 1317), 'matplotlib.pyplo... |
import uuid
from decimal import Decimal
from django.db import models
from django.contrib.auth.models import AbstractUser
from django.core.validators import MinValueValidator
class User(AbstractUser):
id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)
pass
def __str__(self):
... | [
"django.db.models.UUIDField",
"django.db.models.TextField",
"django.db.models.ForeignKey",
"django.db.models.DateTimeField",
"django.db.models.ImageField",
"django.db.models.CharField",
"decimal.Decimal"
] | [((211, 281), 'django.db.models.UUIDField', 'models.UUIDField', ([], {'primary_key': '(True)', 'default': 'uuid.uuid4', 'editable': '(False)'}), '(primary_key=True, default=uuid.uuid4, editable=False)\n', (227, 281), False, 'from django.db import models\n'), ((388, 458), 'django.db.models.UUIDField', 'models.UUIDField'... |
# -*- coding:utf-8 -*-
# Copyright (c) 2020 Huawei Technologies Co.,Ltd.
#
# openGauss is licensed under Mulan PSL v2.
# You can use this software according to the terms
# and conditions of the Mulan PSL v2.
# You may obtain a copy of Mulan PSL v2 at:
#
# http://license.coscl.org.cn/MulanPSL2
#
# THIS SOFTWARE... | [
"gspylib.hardware.gsdisk.g_disk.getMountPathByDataDir",
"gspylib.hardware.gsdisk.g_disk.getDiskInodeUsage",
"gspylib.inspection.common.SharedFuncs.runShellCmd",
"gspylib.common.Common.DefaultValue.getEnv",
"gspylib.hardware.gsdisk.g_disk.getDiskMountType"
] | [((3176, 3204), 'gspylib.inspection.common.SharedFuncs.runShellCmd', 'SharedFuncs.runShellCmd', (['cmd'], {}), '(cmd)\n', (3199, 3204), False, 'from gspylib.inspection.common import SharedFuncs\n'), ((2813, 2842), 'gspylib.common.Common.DefaultValue.getEnv', 'DefaultValue.getEnv', (['"""PGHOST"""'], {}), "('PGHOST')\n"... |
import sys
import pytest
import tempfile
import subprocess
from unittest import mock
from andriller import adb_conn
fake_adb = tempfile.NamedTemporaryFile()
@pytest.fixture
def ADB(mocker):
mocker.patch('andriller.adb_conn.ADBConn.kill')
mocker.patch('andriller.adb_conn.ADBConn._opt_use_capture', return_valu... | [
"unittest.mock.Mock",
"unittest.mock.MagicMock",
"andriller.adb_conn.ADBConn._file_regex",
"pytest.mark.parametrize",
"andriller.adb_conn.ADBConn",
"tempfile.NamedTemporaryFile",
"unittest.mock.patch"
] | [((128, 157), 'tempfile.NamedTemporaryFile', 'tempfile.NamedTemporaryFile', ([], {}), '()\n', (155, 157), False, 'import tempfile\n'), ((1954, 2136), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""file_path, result"""', "[('/some/file.txt', '/some/file.txt\\n'), ('/some/my file.txt',\n '/some/my file.tx... |
#-- coding: UTF-8 --#
from math import log
import operator
#计算熵
def calcShannonEnt(dataSet):
numEntries = len(dataSet)
labelCounts = {}
for featVec in dataSet:
currentLabel = featVec[-1]
if currentLabel not in labelCounts.keys():
labelCounts[currentLabel] = 0
labelCoun... | [
"operator.itemgetter",
"math.log"
] | [((486, 498), 'math.log', 'log', (['prob', '(2)'], {}), '(prob, 2)\n', (489, 498), False, 'from math import log\n'), ((3191, 3213), 'operator.itemgetter', 'operator.itemgetter', (['(1)'], {}), '(1)\n', (3210, 3213), False, 'import operator\n')] |
from model.project import Project
from selenium.webdriver.support.select import Select
import string
import random
import re
class ProjectHelper:
def __init__(self, app):
self.app = app
project_cache = None
def random_string(self, prefix, maxlen):
symbols = string.ascii_letters + string... | [
"re.sub",
"random.choice",
"model.project.Project",
"random.randrange"
] | [((3904, 3926), 're.sub', 're.sub', (['"""\\\\s+"""', '""" """', 's'], {}), "('\\\\s+', ' ', s)\n", (3910, 3926), False, 'import re\n'), ((372, 394), 'random.choice', 'random.choice', (['symbols'], {}), '(symbols)\n', (385, 394), False, 'import random\n'), ((2737, 2832), 'model.project.Project', 'Project', ([], {'name'... |
from django.db import models
from django.utils import timezone
# All models are registered with the admin interface 5.0 pts
# At least five fields of the following list are used among all models:
# BooleanField, CharField, DateField, DatetimeField, FloatField, EmailField, TextField, URLField 5.0 pts
# Create your m... | [
"django.db.models.EmailField",
"django.db.models.FloatField",
"django.db.models.TextField",
"django.db.models.ManyToManyField",
"django.db.models.DateTimeField",
"django.db.models.BooleanField",
"django.db.models.ImageField",
"django.db.models.DatetimeField",
"django.db.models.URLField",
"django.d... | [((382, 403), 'django.db.models.BooleanField', 'models.BooleanField', ([], {}), '()\n', (401, 403), False, 'from django.db import models\n'), ((426, 458), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(200)'}), '(max_length=200)\n', (442, 458), False, 'from django.db import models\n'), ((480, 4... |
"""
1 1: 73 's'
2 2: 4f73 'Os'
3 3: 204f73 ' Os'
4 4: 68204f73 ... | [
"urllib.parse.quote",
"urllib.request.urlopen"
] | [((3254, 3275), 'urllib.parse.quote', 'urllib.parse.quote', (['q'], {}), '(q)\n', (3272, 3275), False, 'import urllib\n'), ((3360, 3390), 'urllib.request.urlopen', 'urllib.request.urlopen', (['target'], {}), '(target)\n', (3382, 3390), False, 'import urllib\n')] |
"""MIT xPro Open edX middlware"""
import re
from django.conf import settings
from django.shortcuts import redirect
from django.utils.deprecation import MiddlewareMixin
def redirect_to_login():
"""Returns a response redirecting to the login url"""
return redirect(settings.MITXPRO_CORE_REDIRECT_LOGIN_URL)
cl... | [
"django.shortcuts.redirect",
"re.match"
] | [((265, 315), 'django.shortcuts.redirect', 'redirect', (['settings.MITXPRO_CORE_REDIRECT_LOGIN_URL'], {}), '(settings.MITXPRO_CORE_REDIRECT_LOGIN_URL)\n', (273, 315), False, 'from django.shortcuts import redirect\n'), ((1218, 1249), 're.match', 're.match', (['pattern', 'request.path'], {}), '(pattern, request.path)\n',... |
from dashboard.utils.finder import Finder
import requests
class AsianDrama(Finder):
def search_asian(self, query):
# search and get the response
resp = requests.get(self.kuryana + query).json()["results"]
print(resp)
return resp | [
"requests.get"
] | [((174, 208), 'requests.get', 'requests.get', (['(self.kuryana + query)'], {}), '(self.kuryana + query)\n', (186, 208), False, 'import requests\n')] |
import pytest
from insta_api.insta_api import InstaAPI
from insta_api.endpoints import *
@pytest.fixture(scope="module")
def insta():
insta = InstaAPI(use_cookies=False)
yield insta
insta._close_session()
class TestEndpoints:
""" These tests make sure that the API endpoints are still reachable and ... | [
"pytest.fixture",
"insta_api.insta_api.InstaAPI"
] | [((92, 122), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""module"""'}), "(scope='module')\n", (106, 122), False, 'import pytest\n'), ((148, 175), 'insta_api.insta_api.InstaAPI', 'InstaAPI', ([], {'use_cookies': '(False)'}), '(use_cookies=False)\n', (156, 175), False, 'from insta_api.insta_api import InstaAPI\... |
'''
symmetrical-synthesis
Copyright (c) 2020-present NAVER Corp.
MIT license
'''
import os
import sys
import tensorflow as tf
import numpy as np
from nets import googlenet
from tensorflow.contrib import slim
FLAGS = tf.app.flags.FLAGS
class model_builder:
def __init__(self, batch_size=64, n_classes=1, dim_feature... | [
"tensorflow.variable_scope",
"tensorflow.nn.l2_normalize",
"tensorflow.placeholder",
"tensorflow.split",
"tensorflow.concat",
"nets.googlenet.GoogleNet_Model",
"tensorflow.reduce_mean",
"tensorflow.squeeze",
"tensorflow.contrib.slim.conv2d"
] | [((3360, 3436), 'tensorflow.placeholder', 'tf.placeholder', (['tf.float32'], {'shape': '[batch_size, h, w, c]', 'name': '"""input_images"""'}), "(tf.float32, shape=[batch_size, h, w, c], name='input_images')\n", (3374, 3436), True, 'import tensorflow as tf\n'), ((894, 957), 'tensorflow.split', 'tf.split', ([], {'axis':... |
#!/usr/local/bin/python
# -*- coding: utf-8 -*-
import nlpregex.abs_graph.double_link
import nlpregex.abs_graph.node
import nlpregex.abs_graph.edge
import nlpregex.abs_graph.graph
from graphviz import Digraph
import re
import subprocess
import os
SYM_EPSILON = "<eps>"
# @class FA
#
# Represents a finite-state aut... | [
"re.compile",
"subprocess.run",
"re.match",
"graphviz.Digraph",
"re.sub",
"os.remove"
] | [((31226, 31345), 'subprocess.run', 'subprocess.run', (["['fstcompile', '--isymbols=fst_sym_in.txt', '--osymbols=fst_sym_out.txt',\n 'nfa_fst.txt', 'nfa.fst']"], {}), "(['fstcompile', '--isymbols=fst_sym_in.txt',\n '--osymbols=fst_sym_out.txt', 'nfa_fst.txt', 'nfa.fst'])\n", (31240, 31345), False, 'import subproc... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""--- Day 2: I Was Told There Would Be No Math ---
The elves are running low on wrapping paper, and so they need to submit an
order for more. They have a list of the dimensions (length l, width w, and
height h) of each present, and only want to order exactly as much as th... | [
"click.option",
"click.command",
"functools.reduce"
] | [((3056, 3071), 'click.command', 'click.command', ([], {}), '()\n', (3069, 3071), False, 'import click\n'), ((3073, 3167), 'click.option', 'click.option', (['"""--source_file"""'], {'default': '"""data/02.txt"""', 'help': '"""source data file for problem"""'}), "('--source_file', default='data/02.txt', help=\n 'sour... |
"""
File: 1220.py
Title: Count Vowels Permutation
Difficulty: Hard
URL: https://leetcode.com/problems/count-vowels-permutation/
"""
import unittest
from collections import defaultdict
class Solution:
MOD = 10**9 + 7
def __init__(self):
self.cache = defaultdict(dict)
def count... | [
"unittest.main",
"collections.defaultdict"
] | [((2142, 2157), 'unittest.main', 'unittest.main', ([], {}), '()\n', (2155, 2157), False, 'import unittest\n'), ((288, 305), 'collections.defaultdict', 'defaultdict', (['dict'], {}), '(dict)\n', (299, 305), False, 'from collections import defaultdict\n')] |
# SPDX-FileCopyrightText: 2020 <NAME>
#
# SPDX-License-Identifier: MIT
import pytest
from zignalz import cli
@pytest.mark.skip
def test_db_start():
cli.db.up()
cli.db.down()
| [
"zignalz.cli.db.down",
"zignalz.cli.db.up"
] | [((156, 167), 'zignalz.cli.db.up', 'cli.db.up', ([], {}), '()\n', (165, 167), False, 'from zignalz import cli\n'), ((172, 185), 'zignalz.cli.db.down', 'cli.db.down', ([], {}), '()\n', (183, 185), False, 'from zignalz import cli\n')] |
# -*- coding: utf-8 -*-
"""
Clase perteneciente al módulo de procesamiento de datos e inferencias Ama.
.. module:: dbscan_processor
:platform: Unix
:synopsis: Detección de clusters de tormenta utilizando el algoritmo DBSCAN.
.. moduleauthor:: <NAME> <<EMAIL>>
"""
import ama.utils as utils
import ama.processor... | [
"ama.processor.Processor.process",
"shapely.geometry.MultiPoint",
"numpy.column_stack",
"numpy.ndenumerate",
"matplotlib.pyplot.style.use",
"numpy.array",
"wradlib.georef.polar2lonlat",
"geopy.distance.great_circle",
"numpy.matrix",
"time.time",
"matplotlib.pyplot.subplots",
"sklearn.cluster.D... | [((3043, 3080), 'ama.processor.Processor.process', 'processor.Processor.process', (['filename'], {}), '(filename)\n', (3070, 3080), True, 'import ama.processor as processor\n'), ((3358, 3403), 'numpy.ndenumerate', 'np.ndenumerate', (["data[layer_key][u'Z']['data']"], {}), "(data[layer_key][u'Z']['data'])\n", (3372, 340... |
import cv2
import numpy as np
from PIL import Image
from PIL import ImageDraw
from subprocess import Popen, PIPE
import pycocotools.mask as coco_mask_util
def draw_bboxes(image, bboxes, labels=None, output_file=None, fill='red'):
"""
Draw bounding boxes on image.
Return image with drawings as BGR ndarray.... | [
"PIL.Image.fromarray",
"PIL.Image.open",
"subprocess.Popen",
"numpy.array",
"PIL.ImageDraw.Draw"
] | [((926, 947), 'PIL.ImageDraw.Draw', 'ImageDraw.Draw', (['image'], {}), '(image)\n', (940, 947), False, 'from PIL import ImageDraw\n'), ((2274, 2322), 'subprocess.Popen', 'Popen', (['cmd'], {'stdin': 'PIPE', 'stdout': 'PIPE', 'stderr': 'PIPE'}), '(cmd, stdin=PIPE, stdout=PIPE, stderr=PIPE)\n', (2279, 2322), False, 'from... |
#!/usr/bin/env python3
# Copyright 2019 <NAME>
#
# 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 agree... | [
"warnings.warn",
"numpy.prod"
] | [((2584, 2689), 'warnings.warn', 'warn', (['(\'Please use class "hnets.hnet_interface.CLHyperNetInterface" \' + \'instead.\')', 'DeprecationWarning'], {}), '(\'Please use class "hnets.hnet_interface.CLHyperNetInterface" \' +\n \'instead.\', DeprecationWarning)\n', (2588, 2689), False, 'from warnings import warn\n'),... |
import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()
x = tf.placeholder(tf.float32)
y = tf.placeholder(tf.float32)
z = x + y
session = tf.Session()
values = {x: 5.0, y: 4.0}
result = session.run([z], values)
print(result)
| [
"tensorflow.compat.v1.placeholder",
"tensorflow.compat.v1.disable_v2_behavior",
"tensorflow.compat.v1.Session"
] | [((35, 59), 'tensorflow.compat.v1.disable_v2_behavior', 'tf.disable_v2_behavior', ([], {}), '()\n', (57, 59), True, 'import tensorflow.compat.v1 as tf\n'), ((65, 91), 'tensorflow.compat.v1.placeholder', 'tf.placeholder', (['tf.float32'], {}), '(tf.float32)\n', (79, 91), True, 'import tensorflow.compat.v1 as tf\n'), ((9... |
import cv2
import zmq
import json
import base64
import pickle
import threading
import numpy as np
from random import choice
from cvmodule import CVModule
from image_search import ImageSearch
from elasticsearch_driver import ImsES
from elasticsearch import Elasticsearch
class Server(threading.Thread):
def __init__... | [
"threading.Thread.__init__",
"elasticsearch.Elasticsearch",
"json.dumps",
"cvmodule.CVModule",
"image_search.ImageSearch",
"zmq.Poller",
"zmq.Context"
] | [((336, 367), 'threading.Thread.__init__', 'threading.Thread.__init__', (['self'], {}), '(self)\n', (361, 367), False, 'import threading\n'), ((415, 428), 'zmq.Context', 'zmq.Context', ([], {}), '()\n', (426, 428), False, 'import zmq\n'), ((849, 861), 'zmq.Poller', 'zmq.Poller', ([], {}), '()\n', (859, 861), False, 'im... |
import json
import http3
def to_sochain_network(net: str):
return 'LTCTEST' if net == 'testnet' else 'LTC'
async def get_balance(sochain_url:str, net:str, address:str):
"""Get address balance
https://sochain.com/api#get-balance
:param net: mainnet or testnet
:type net: str
:param address: wa... | [
"http3.AsyncClient"
] | [((515, 534), 'http3.AsyncClient', 'http3.AsyncClient', ([], {}), '()\n', (532, 534), False, 'import http3\n'), ((1429, 1448), 'http3.AsyncClient', 'http3.AsyncClient', ([], {}), '()\n', (1446, 1448), False, 'import http3\n'), ((2088, 2107), 'http3.AsyncClient', 'http3.AsyncClient', ([], {}), '()\n', (2105, 2107), Fals... |
import argparse
import re
def main(args):
learned_hyp_file_path = args.learned_hyp_file
test_examples_path = args.test_examples
predictor_pos_value = args.predictor_positive_value
# Take in learned hypothesis, test las file and generate F1 score and accuracy
# over the test examples.
learned_h... | [
"re.sub",
"re.findall",
"argparse.ArgumentParser",
"re.compile"
] | [((593, 630), 're.findall', 're.findall', (['r_str', 'test_examples_file'], {}), '(r_str, test_examples_file)\n', (603, 630), False, 'import re\n'), ((1427, 1462), 're.findall', 're.findall', (['r_str', 'learned_hyp_file'], {}), '(r_str, learned_hyp_file)\n', (1437, 1462), False, 'import re\n'), ((3196, 3285), 'argpars... |
from contacts import Contacts
import time
import os
# Simulate the PhoneBook functions
# - Display Contacts
# - Add Contacts
# - Delete Contacts
# - Search Contacts
# - Exit
# Declare an empty list
contactList = list()
# validate the input of the user if a number
def input_validation(num):
try:
... | [
"os.system",
"contacts.Contacts",
"time.sleep"
] | [((1948, 1961), 'time.sleep', 'time.sleep', (['(5)'], {}), '(5)\n', (1958, 1961), False, 'import time\n'), ((1039, 1055), 'os.system', 'os.system', (['"""cls"""'], {}), "('cls')\n", (1048, 1055), False, 'import os\n'), ((1065, 1080), 'time.sleep', 'time.sleep', (['(0.5)'], {}), '(0.5)\n', (1075, 1080), False, 'import t... |