code
stringlengths
22
1.05M
apis
listlengths
1
3.31k
extract_api
stringlengths
75
3.25M
""" Operative functions to be run into the SA_algorithm. Creation of initial value, definition of 2-D movements and dedicated domain boundaries conditions, optimization methods and stopping criteria are listed below. """ import numpy as np from numpy import random as rnd #-------Neighbour generation----------# de...
[ "numpy.mean", "numpy.sqrt", "numpy.random.random", "numpy.exp", "numpy.random.uniform" ]
[((1106, 1118), 'numpy.random.random', 'rnd.random', ([], {}), '()\n', (1116, 1118), True, 'from numpy import random as rnd\n'), ((4595, 4608), 'numpy.mean', 'np.mean', (['diff'], {}), '(diff)\n', (4602, 4608), True, 'import numpy as np\n'), ((2132, 2153), 'numpy.random.uniform', 'rnd.uniform', (['a', 'state'], {}), '(...
import os import unittest from docker.machine.cli.machine import Machine from docker.machine.errors import CLIError from docker.machine.cli.client import Status from docker.machine.constants import LOCALHOST digitalocean_access_token = os.environ.get('DOCKERMACHINEPY_DIGITALOCEAN_ACCESS_TOKEN') class BaseTestCases:...
[ "docker.machine.cli.machine.Machine.all_docker_machines", "docker.machine.cli.machine.Machine.active_docker_machine", "docker.machine.cli.machine.Machine", "os.environ.get", "unittest.TestCase.__init__" ]
[((238, 297), 'os.environ.get', 'os.environ.get', (['"""DOCKERMACHINEPY_DIGITALOCEAN_ACCESS_TOKEN"""'], {}), "('DOCKERMACHINEPY_DIGITALOCEAN_ACCESS_TOKEN')\n", (252, 297), False, 'import os\n'), ((475, 524), 'unittest.TestCase.__init__', 'unittest.TestCase.__init__', (['self', '*args'], {}), '(self, *args, **kwargs)\n'...
from flask import Flask def create_app(): """Create and configure instance of the Flask application""" app = Flask(__name__) @app.route('/') def barebones(): return 'the barebones' return app
[ "flask.Flask" ]
[((118, 133), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (123, 133), False, 'from flask import Flask\n')]
import discord import asyncio import random from discord.ext import commands from time import localtime, timezone modrole = 348838039302307840 class Utilities(commands.Cog): def __init__(self, client): self.client = client @commands.command(name='spam', descriptio...
[ "time.localtime", "random.choice", "discord.Game", "discord.utils.get", "asyncio.sleep", "discord.Color.blue", "discord.ext.commands.command" ]
[((257, 371), 'discord.ext.commands.command', 'commands.command', ([], {'name': '"""spam"""', 'description': '"""Spams a message that follow the command"""', 'brief': '"""Spams a Message"""'}), "(name='spam', description=\n 'Spams a message that follow the command', brief='Spams a Message')\n", (273, 371), False, 'f...
import sys from PyQt4 import QtCore, QtGui try: _fromUtf8 = QtCore.QString.fromUtf8 except AttributeError: def _fromUtf8(s): return s try: _encoding = QtGui.QApplication.UnicodeUTF8 def _translate(context, text, disambig): return QtGui.QApplication.translate(context, text...
[ "PyQt4.QtCore.QMetaObject.connectSlotsByName", "PyQt4.QtGui.QTextBrowser", "PyQt4.QtGui.QDialogButtonBox", "PyQt4.QtCore.QRect", "PyQt4.QtGui.QApplication.translate", "PyQt4.QtGui.QDialog.__init__", "PyQt4.QtGui.QFont" ]
[((278, 342), 'PyQt4.QtGui.QApplication.translate', 'QtGui.QApplication.translate', (['context', 'text', 'disambig', '_encoding'], {}), '(context, text, disambig, _encoding)\n', (306, 342), False, 'from PyQt4 import QtCore, QtGui\n'), ((552, 580), 'PyQt4.QtGui.QDialog.__init__', 'QtGui.QDialog.__init__', (['self'], {})...
# Generated by Django 2.1.3 on 2018-11-17 15:57 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('quick_search', '0004_searchresult_time_created'), ] operations = [ migrations.RenameField( model_name='searchresult', old_na...
[ "django.db.migrations.RenameField" ]
[((239, 333), 'django.db.migrations.RenameField', 'migrations.RenameField', ([], {'model_name': '"""searchresult"""', 'old_name': '"""search_key"""', 'new_name': '"""query"""'}), "(model_name='searchresult', old_name='search_key',\n new_name='query')\n", (261, 333), False, 'from django.db import migrations\n')]
from django.db import models from modeladminutils.queryset import SearchableQuerySet __all__ = ['SearchableManager'] class BaseSearchableManager(models.Manager): def get_queryset(self): return SearchableQuerySet(self.model) SearchableManager = BaseSearchableManager.from_queryset(SearchableQuerySet)
[ "modeladminutils.queryset.SearchableQuerySet" ]
[((210, 240), 'modeladminutils.queryset.SearchableQuerySet', 'SearchableQuerySet', (['self.model'], {}), '(self.model)\n', (228, 240), False, 'from modeladminutils.queryset import SearchableQuerySet\n')]
import tensorflow as tf print(tf.__version__) with tf.device('/gpu:0'): a = tf.constant([1.0, 2.0, 3.0, 4.0, 5.0, 6.0], shape=[2, 3], name='a') b = tf.constant([1.0, 2.0, 3.0, 4.0, 5.0, 6.0], shape=[3, 2], name='b') c = tf.matmul(a, b) if tf.__version__[0]=='1': with tf.Session() as sess: print (sess...
[ "tensorflow.device", "tensorflow.Session", "tensorflow.constant", "tensorflow.matmul" ]
[((51, 70), 'tensorflow.device', 'tf.device', (['"""/gpu:0"""'], {}), "('/gpu:0')\n", (60, 70), True, 'import tensorflow as tf\n'), ((80, 147), 'tensorflow.constant', 'tf.constant', (['[1.0, 2.0, 3.0, 4.0, 5.0, 6.0]'], {'shape': '[2, 3]', 'name': '"""a"""'}), "([1.0, 2.0, 3.0, 4.0, 5.0, 6.0], shape=[2, 3], name='a')\n"...
from polls.tests.test_rules.rule_2.bad_factories import ( PollFactory as BadPollFactory, ) from polls.tests.test_rules.rule_2.good_factories import ( PollFactory as GoodPollFactory, ) def test_bad_to_string_with_non_premium_question_without_author(): poll = BadPollFactory.build() assert str(poll) == "...
[ "polls.tests.test_rules.rule_2.good_factories.PollFactory.build", "polls.tests.test_rules.rule_2.bad_factories.PollFactory.build" ]
[((272, 294), 'polls.tests.test_rules.rule_2.bad_factories.PollFactory.build', 'BadPollFactory.build', ([], {}), '()\n', (292, 294), True, 'from polls.tests.test_rules.rule_2.bad_factories import PollFactory as BadPollFactory\n'), ((417, 513), 'polls.tests.test_rules.rule_2.good_factories.PollFactory.build', 'GoodPollF...
import pytest import sys # TODO: Remove this hook once Issue #5967 is resolved. def pytest_ignore_collect(path): if str(path).endswith("test_terminals_api.py"): if sys.platform.startswith('win') and sys.version_info >= (3, 9): return True # do not collect
[ "sys.platform.startswith" ]
[((179, 209), 'sys.platform.startswith', 'sys.platform.startswith', (['"""win"""'], {}), "('win')\n", (202, 209), False, 'import sys\n')]
import pytest import torch import math import numpy as np from allennlp.common.checks import ConfigurationError from allennlp.common.testing import ( AllenNlpTestCase, multi_device, global_distributed_metric, run_distributed_test, ) from allennlp.fairness.fairness_metrics import ( Independence, ...
[ "pytest.approx", "allennlp.fairness.fairness_metrics.Sufficiency", "torch.ones_like", "torch.eye", "allennlp.fairness.fairness_metrics.Separation", "allennlp.fairness.fairness_metrics.DemographicParityWithoutGroundTruth", "math.log", "math.isnan", "allennlp.fairness.fairness_metrics.Independence", ...
[((499, 517), 'allennlp.fairness.fairness_metrics.Independence', 'Independence', (['(2)', '(2)'], {}), '(2, 2)\n', (511, 517), False, 'from allennlp.fairness.fairness_metrics import Independence, Separation, Sufficiency, DemographicParityWithoutGroundTruth\n'), ((725, 743), 'allennlp.fairness.fairness_metrics.Independe...
# From Django from django.contrib import admin # My models from apps.food import models as food_models admin.site.register(food_models.FoodRun) admin.site.register(food_models.FoodDonation) admin.site.register(food_models.FoodVolunteer) admin.site.register(food_models.FeedFood)
[ "django.contrib.admin.site.register" ]
[((105, 145), 'django.contrib.admin.site.register', 'admin.site.register', (['food_models.FoodRun'], {}), '(food_models.FoodRun)\n', (124, 145), False, 'from django.contrib import admin\n'), ((146, 191), 'django.contrib.admin.site.register', 'admin.site.register', (['food_models.FoodDonation'], {}), '(food_models.FoodD...
import sys sys.path.append("..") from engineering_tool.electrics import * def Power_Electric(): voltage_DC = 15 # Volt DC current_DC = 2.5 # Amp DC voltage_AC1P = 225.5 # Vrms 1 Phase current_AC1P = 5.5 # Amp 1 Phase PF_AC1P = 0.8 # Power factor voltage_AC3P = 225.5 # Vrms...
[ "sys.path.append" ]
[((11, 32), 'sys.path.append', 'sys.path.append', (['""".."""'], {}), "('..')\n", (26, 32), False, 'import sys\n')]
from sys import argv from re import sub, finditer, VERBOSE def gen(defs): indent = 0 enum = False def p(s): print(" " * (indent * 4) + s) for item in finditer(""" (?P<type> message|enum) \\s+ (?P<name> \\w+) \\s* \\{ | (?P<var> \\w+) \\s* = \\s* (?P<val> \\w+) \\s* ; | \\} ...
[ "re.finditer" ]
[((167, 358), 're.finditer', 'finditer', (['"""\n (?P<type> message|enum) \\\\s+ (?P<name> \\\\w+) \\\\s* \\\\{ |\n (?P<var> \\\\w+) \\\\s* = \\\\s* (?P<val> \\\\w+) \\\\s* ; |\n \\\\}\n """', 'defs'], {'flags': 'VERBOSE'}), '(\n """\n (?P<type> message|enum) \\\\s+ (?P<name> \\\\w...
import re import time import click import requests from bs4 import BeautifulSoup from bs4.element import Tag WIKI_ROOT = 'https://en.wikipedia.org' WIKI_URL = WIKI_ROOT + '/wiki/Special:Random' REQUEST_TIMEOUT = 1 REQUEST_DELAY = 0.5 EARLY_STOPS = set(['Science', 'Geography', 'Knowledge', 'Fact', 'Switzerland', ...
[ "click.option", "time.sleep", "requests.get", "bs4.BeautifulSoup", "re.sub" ]
[((5965, 6096), 'click.option', 'click.option', (['"""-u"""', '"""--url"""', '"""url"""'], {'type': 'str', 'default': 'WIKI_URL', 'help': '"""URL to start the path to Philosophy."""', 'show_default': '(True)'}), "('-u', '--url', 'url', type=str, default=WIKI_URL, help=\n 'URL to start the path to Philosophy.', show_...
from django.contrib import admin # Register your models here. from .models import Note from .models import Profile class NoteAdmin(admin.ModelAdmin): class Meta: model = Note class ProfileAdmin(admin.ModelAdmin): class Meta: model = Note admin.site.register(Note,NoteAdmin) admin.s...
[ "django.contrib.admin.site.register" ]
[((277, 313), 'django.contrib.admin.site.register', 'admin.site.register', (['Note', 'NoteAdmin'], {}), '(Note, NoteAdmin)\n', (296, 313), False, 'from django.contrib import admin\n'), ((313, 355), 'django.contrib.admin.site.register', 'admin.site.register', (['Profile', 'ProfileAdmin'], {}), '(Profile, ProfileAdmin)\n...
"""APP EXCEPTIONS Exception manager (as contextmanager) to convert internal exceptions to HTTP exceptions, properly described. Custom exceptions raised by internal functions. """ # # Native # # import contextlib # # Installed # # import fastapi from fastapi import status as statuscode __all__ = ("manage_endpoint_exc...
[ "fastapi.HTTPException" ]
[((600, 708), 'fastapi.HTTPException', 'fastapi.HTTPException', ([], {'status_code': 'statuscode.HTTP_404_NOT_FOUND', 'detail': '"""Stop not found for this user"""'}), "(status_code=statuscode.HTTP_404_NOT_FOUND, detail=\n 'Stop not found for this user')\n", (621, 708), False, 'import fastapi\n'), ((779, 917), 'fast...
from flask import Flask import os from pathlib import Path def init_app(): """Construct core Flask application with embedded Dash app.""" app = Flask(__name__, instance_relative_config=False) if os.environ.get('FLASK_ENV') == 'development': app.config.from_object('heidelberg_metadata_gui.config.C...
[ "pathlib.Path.cwd", "os.environ.get", "flask.Flask" ]
[((154, 201), 'flask.Flask', 'Flask', (['__name__'], {'instance_relative_config': '(False)'}), '(__name__, instance_relative_config=False)\n', (159, 201), False, 'from flask import Flask\n'), ((574, 602), 'os.environ.get', 'os.environ.get', (['"""SECRET_KEY"""'], {}), "('SECRET_KEY')\n", (588, 602), False, 'import os\n...
import csv import json import requests from bs4 import BeautifulSoup from game_analyzer import GameAnalyzer teamUrl = "https://heroeslounge.gg/team/view/B2C" teamName = "<NAME>" r = requests.get(teamUrl) html = r.text parsedHTML = BeautifulSoup(html) matches = parsedHTML.select("#activeSeasonMatches .tab-pa...
[ "bs4.BeautifulSoup", "game_analyzer.GameAnalyzer", "json.dump", "requests.get" ]
[((191, 212), 'requests.get', 'requests.get', (['teamUrl'], {}), '(teamUrl)\n', (203, 212), False, 'import requests\n'), ((242, 261), 'bs4.BeautifulSoup', 'BeautifulSoup', (['html'], {}), '(html)\n', (255, 261), False, 'from bs4 import BeautifulSoup\n'), ((913, 941), 'json.dump', 'json.dump', (['teamData', 'outfile'], ...
from django.db import models from django.urls import reverse from core.models import IndexedTimeStampedModel class Category(IndexedTimeStampedModel): name = models.CharField('Nome', max_length=200) slug = models.SlugField('Identificador', max_length=200) class Meta: verbose_name = 'Categoria' ...
[ "django.db.models.TextField", "django.db.models.ForeignKey", "django.db.models.SlugField", "django.urls.reverse", "django.db.models.DecimalField", "django.db.models.CharField" ]
[((163, 203), 'django.db.models.CharField', 'models.CharField', (['"""Nome"""'], {'max_length': '(200)'}), "('Nome', max_length=200)\n", (179, 203), False, 'from django.db import models\n'), ((215, 264), 'django.db.models.SlugField', 'models.SlugField', (['"""Identificador"""'], {'max_length': '(200)'}), "('Identificad...
__author__ = '<NAME> @ viniciuswovst in GitHub' __version__ = '1.0' # Copyright 2020-2021 <NAME>, viniciuswovst @ GitHub # See LICENSE for details. from bs4 import BeautifulSoup import requests import pandas as pd from datetime import date from .utils.api import get_data, get_fields_date from .utils.format_data imp...
[ "pandas.DataFrame", "datetime.date.today", "bs4.BeautifulSoup", "requests.get" ]
[((2081, 2106), 'pandas.DataFrame', 'pd.DataFrame', (['list_values'], {}), '(list_values)\n', (2093, 2106), True, 'import pandas as pd\n'), ((3748, 3773), 'pandas.DataFrame', 'pd.DataFrame', (['list_values'], {}), '(list_values)\n', (3760, 3773), True, 'import pandas as pd\n'), ((5422, 5447), 'pandas.DataFrame', 'pd.Da...
from insights.parsers.limits_conf import LimitsConf from insights.tests import context_wrap LIMITS_CONF = """ #oracle soft nproc 2047 #oracle hard nproc 16384 oracle soft nofile 1024 oracle hard nofile 65536 oracle soft stack 10240 oracle hard stack 3276 root soft nproc unlimited """.strip() LIMITS_CONF_...
[ "insights.tests.context_wrap", "insights.parsers.limits_conf.LimitsConf" ]
[((1228, 1276), 'insights.tests.context_wrap', 'context_wrap', (['LIMITS_CONF'], {'path': 'LIMITS_CONF_PATH'}), '(LIMITS_CONF, path=LIMITS_CONF_PATH)\n', (1240, 1276), False, 'from insights.tests import context_wrap\n'), ((1288, 1303), 'insights.parsers.limits_conf.LimitsConf', 'LimitsConf', (['ctx'], {}), '(ctx)\n', (...
from notifications.models import Rotation, Notification from twilioHandler.twilio.example import make_call import time from django.utils import timezone from background_task import background def is_done(_id): try: notification = Notification.objects.get(pk=_id) return notification.completed ...
[ "background_task.background", "notifications.models.Rotation.objects.get", "time.sleep", "twilioHandler.twilio.example.make_call", "notifications.models.Notification.objects.get" ]
[((1484, 1514), 'background_task.background', 'background', ([], {'queue': '"""test-queue"""'}), "(queue='test-queue')\n", (1494, 1514), False, 'from background_task import background\n'), ((1605, 1641), 'notifications.models.Rotation.objects.get', 'Rotation.objects.get', ([], {'pk': 'rotation_id'}), '(pk=rotation_id)\...
# Copyright 2015 Mirantis, 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 b...
[ "netaddr.IPNetwork", "manila.i18n._", "manila.compute.nova.API", "oslo_config.cfg.StrOpt", "netaddr.iter_unique_ips", "manila.exception.NetworkBadConfigurationException", "six.text_type", "manila.utils.synchronized", "oslo_log.log.getLogger" ]
[((1217, 1240), 'oslo_log.log.getLogger', 'log.getLogger', (['__name__'], {}), '(__name__)\n', (1230, 1240), False, 'from oslo_log import log\n'), ((948, 1159), 'oslo_config.cfg.StrOpt', 'cfg.StrOpt', (['"""nova_single_network_plugin_net_id"""'], {'help': '"""Default Nova network that will be used for share servers. Th...
import os import sys from typing import List, Tuple import kaggle import zipfile import cv2 from matplotlib import pyplot as plt import numpy as np from pandas import DataFrame from torch.tensor import Tensor from torchvision import transforms # from cn.protect import Protect # from cn.protect.privacy import KAnonymit...
[ "os.path.exists", "os.listdir", "os.makedirs", "zipfile.ZipFile", "torchvision.transforms.RandomRotation", "kaggle.api.authenticate", "logger.logPrint", "kaggle.api.dataset_download_files", "os.path.join", "torchvision.transforms.RandomHorizontalFlip", "numpy.array", "sys.exit", "pandas.Data...
[((1172, 1212), 'logger.logPrint', 'logPrint', (['"""Loading Pneumonia Dataset..."""'], {}), "('Loading Pneumonia Dataset...')\n", (1180, 1212), False, 'from logger import logPrint\n'), ((1373, 1419), 'logger.logPrint', 'logPrint', (['"""Splitting datasets over clients..."""'], {}), "('Splitting datasets over clients.....
#!/usr/bin/env python3 import argparse parser = argparse.ArgumentParser( formatter_class=argparse.ArgumentDefaultsHelpFormatter, description='Calculate instantaneous surface tension from pressure tensor') # args parser.add_argument('-box', '--box', type=float, nargs=3, help='x, y, z (nm) of box dimension in NVT')...
[ "subprocess.check_output", "argparse.ArgumentParser" ]
[((49, 214), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'formatter_class': 'argparse.ArgumentDefaultsHelpFormatter', 'description': '"""Calculate instantaneous surface tension from pressure tensor"""'}), "(formatter_class=argparse.\n ArgumentDefaultsHelpFormatter, description=\n 'Calculate instan...
""" Mocsár Environment File name: envs/gmocsar.py Author: <NAME> Date created: 3/27/2020 """ from rlcard3 import models from rlcard3.envs.env import Env from rlcard3.games.mocsar.game import MocsarGame as Game from rlcard3.games.mocsar.utils import action_to_string, \ string_to_action, payoff_func...
[ "rlcard3.games.mocsar.utils.encode_to_obs", "rlcard3.games.mocsar.utils.payoff_func", "rlcard3.games.mocsar.utils.string_to_action", "rlcard3.games.mocsar.game.MocsarGame", "rlcard3.games.mocsar.utils.action_to_string", "rlcard3.games.mocsar.utils.print_state" ]
[((549, 555), 'rlcard3.games.mocsar.game.MocsarGame', 'Game', ([], {}), '()\n', (553, 555), True, 'from rlcard3.games.mocsar.game import MocsarGame as Game\n'), ((1238, 1264), 'rlcard3.games.mocsar.utils.encode_to_obs', 'encode_to_obs', ([], {'state': 'state'}), '(state=state)\n', (1251, 1264), False, 'from rlcard3.gam...
import jwt import datetime import os import requests from flask import jsonify, request, make_response from flask_restful import Resource from sqlalchemy.orm.exc import NoResultFound from ...api.controllers import format_response from ..models import OAuthClient, OAuthToken from ...api.models import User from ... imp...
[ "requests.post", "datetime.datetime.utcnow", "flask.request.form.get", "datetime.timedelta", "jwt.encode", "flask.jsonify" ]
[((548, 577), 'flask.request.form.get', 'request.form.get', (['"""auth_code"""'], {}), "('auth_code')\n", (564, 577), False, 'from flask import jsonify, request, make_response\n'), ((725, 755), 'flask.request.form.get', 'request.form.get', (['"""auth_state"""'], {}), "('auth_state')\n", (741, 755), False, 'from flask i...
import pyranges as pr exons = pr.data.exons() cpg = pr.data.cpg() from piedpiper import Debug as D with D(): cpg.join(exons.unstrand())[["CpG"]](lambda df: df.head(3))["chrX"].slack(500)
[ "pyranges.data.exons", "piedpiper.Debug", "pyranges.data.cpg" ]
[((30, 45), 'pyranges.data.exons', 'pr.data.exons', ([], {}), '()\n', (43, 45), True, 'import pyranges as pr\n'), ((52, 65), 'pyranges.data.cpg', 'pr.data.cpg', ([], {}), '()\n', (63, 65), True, 'import pyranges as pr\n'), ((105, 108), 'piedpiper.Debug', 'D', ([], {}), '()\n', (106, 108), True, 'from piedpiper import D...
import unittest import requests from cachecontrol import CacheControl from cachecontrol_sqlite import SQLiteCache class SQLiteCacheTest(unittest.TestCase): def setUp(self): self.url = "https://httpbin.org/cache/60" self.sess = CacheControl(requests.Session(), cache=SQLiteCache(":memory:")) ...
[ "unittest.main", "cachecontrol_sqlite.SQLiteCache", "requests.Session" ]
[((587, 602), 'unittest.main', 'unittest.main', ([], {}), '()\n', (600, 602), False, 'import unittest\n'), ((264, 282), 'requests.Session', 'requests.Session', ([], {}), '()\n', (280, 282), False, 'import requests\n'), ((290, 313), 'cachecontrol_sqlite.SQLiteCache', 'SQLiteCache', (['""":memory:"""'], {}), "(':memory:'...
#!/usr/bin/env python """Tests for `rawtools` package.""" import numpy as np import pytest from numpy import uint8, uint16 from rawtools import rawtools DIMS = (4, 5) @pytest.fixture def slice_uint8(): """Sample uint8 slice""" return np.rint(np.arange(0, 20, dtype=uint8).reshape(DIMS)) @pytest.fixture de...
[ "rawtools.convert.scale", "numpy.arange", "numpy.iinfo", "numpy.array", "numpy.zeros", "numpy.testing.assert_array_equal" ]
[((547, 623), 'numpy.array', 'np.array', (['[-1, 0, 100, 1000, 5000, 14830, 50321, 65535, 65536]'], {'dtype': 'uint16'}), '([-1, 0, 100, 1000, 5000, 14830, 50321, 65535, 65536], dtype=uint16)\n', (555, 623), True, 'import numpy as np\n'), ((907, 948), 'rawtools.convert.scale', 'scale', (['xs', 'lbound', 'ubound', 'lbou...
def from_mdtraj_Trajectory(item, molecular_system=None, atom_indices='all', frame_indices='all'): from molsysmt.native.molsys import MolSys from molsysmt.native.io.topology import from_mdtraj_Topology as to_topology from molsysmt.native.io.trajectory import from_mdtraj_Trajectory as to_trajectory tmp_...
[ "mdtraj.core.trajectory.Trajectory", "molsysmt.forms.classes.api_molsysmt_MolSys.get_time_from_system", "molsysmt.native.molsys.MolSys", "molsysmt.forms.classes.api_molsysmt_MolSys.get_box_angles_from_system", "molsysmt.native.io.trajectory.from_mdtraj_Trajectory", "molsysmt.forms.classes.api_molsysmt_Mol...
[((327, 335), 'molsysmt.native.molsys.MolSys', 'MolSys', ([], {}), '()\n', (333, 335), False, 'from molsysmt.native.molsys import MolSys\n'), ((363, 436), 'molsysmt.native.io.topology.from_mdtraj_Topology', 'to_topology', (['item'], {'atom_indices': 'atom_indices', 'frame_indices': 'frame_indices'}), '(item, atom_indic...
"""tests/test_logging.py Basic set of tests for logging """ import os import logging import pytest # Python 2 and 3 compatible try: from unittest.mock import MagicMock from unittest.mock import patch except ImportError: from mock import MagicMock from mock import patch import cdislogging @pytest....
[ "cdislogging.get_logger", "os.path.exists", "logging.Logger.manager.loggerDict.keys", "os.remove", "pytest.mark.parametrize", "os.path.basename", "pytest.fixture", "cdislogging.get_stream_handler", "mock.MagicMock", "cdislogging.get_file_handler" ]
[((313, 341), 'pytest.fixture', 'pytest.fixture', ([], {'autouse': '(True)'}), '(autouse=True)\n', (327, 341), False, 'import pytest\n'), ((1404, 1457), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""given,expected"""', 'log_levels'], {}), "('given,expected', log_levels)\n", (1427, 1457), False, 'import py...
# python irc bot # based on a tutorial from: https://linuxacademy.com/blog/linux-academy/creating-an-irc-bot-with-python3/ import socket import time import datetime # my files # import getweather import getdate import getfortune import gettitle import getskdtheme import random import getmessages import getartprompt fr...
[ "getmessages.userHasMsg", "getdate.printdaynumber", "getartprompt.artPrompt", "getmessages.saveMsgs", "socket.socket", "getfortune.loadfortunes", "random.choice", "gettitle.getPageTitle", "datetime.datetime.utcnow", "getlols.load", "time.sleep", "random.seed", "getmessages.addMsg", "getfor...
[((610, 659), 'socket.socket', 'socket.socket', (['socket.AF_INET', 'socket.SOCK_STREAM'], {}), '(socket.AF_INET, socket.SOCK_STREAM)\n', (623, 659), False, 'import socket\n'), ((1291, 1304), 'time.sleep', 'time.sleep', (['(1)'], {}), '(1)\n', (1301, 1304), False, 'import time\n'), ((1574, 1587), 'random.seed', 'random...
import cv2 path ="/home/senai/tiago-projects/opencv-tutorials/opencv-course/Resources" img = cv2.imread(path +"/Photos/cats.jpg") cv2.imshow('', img) gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) # Simple Threshold threshold, thresh = cv2.threshold(gray, 150, 255, cv2.THRESH_BINARY) cv2.imshow('simple thresh', thres...
[ "cv2.threshold", "cv2.imshow", "cv2.adaptiveThreshold", "cv2.waitKey", "cv2.cvtColor", "cv2.imread" ]
[((95, 132), 'cv2.imread', 'cv2.imread', (["(path + '/Photos/cats.jpg')"], {}), "(path + '/Photos/cats.jpg')\n", (105, 132), False, 'import cv2\n'), ((132, 151), 'cv2.imshow', 'cv2.imshow', (['""""""', 'img'], {}), "('', img)\n", (142, 151), False, 'import cv2\n'), ((160, 197), 'cv2.cvtColor', 'cv2.cvtColor', (['img', ...
#!/usr/bin/env python3 import argparse import json import re import os from jinja2 import Template from collections import defaultdict def get_args(): parser = argparse.ArgumentParser(description="") parser.add_argument('-t',dest="template",type=str,required=True,help='HTML template for Jinja2') parser.ad...
[ "os.listdir", "argparse.ArgumentParser", "os.path.join", "os.path.splitext", "jinja2.Template", "collections.defaultdict", "os.path.basename", "json.load", "re.sub", "os.walk" ]
[((166, 205), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '""""""'}), "(description='')\n", (189, 205), False, 'import argparse\n'), ((1015, 1031), 'os.listdir', 'os.listdir', (['path'], {}), '(path)\n', (1025, 1031), False, 'import os\n'), ((1100, 1118), 'os.walk', 'os.walk', (['director...
#----------------------------------------------------------------------------- # Copyright (c) 2012 - 2015, Continuum Analytics, Inc. All rights reserved. # # Powered by the Bokeh Development Team. # # The full license is in the file LICENSE.txt, distributed with this software. #----------------------------------------...
[ "logging.getLogger", "bokeh.protocol.deserialize_json", "uuid.uuid4", "bokeh.protocol.status_obj", "bokeh.protocol.error_obj" ]
[((419, 446), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (436, 446), False, 'import logging\n'), ((1067, 1101), 'bokeh.protocol.deserialize_json', 'protocol.deserialize_json', (['message'], {}), '(message)\n', (1092, 1101), False, 'from bokeh import protocol\n'), ((872, 884), 'uuid.uu...
from random import randint from esper import Processor, World import script from action import ActionType from ecs.components.attacktarget import AttackTarget from ecs.components.map import Map from ecs.components.message import Message from ecs.components.monster import Monster from ecs.components.player import Play...
[ "script.PLAYER_MISS.format", "script.PLAYER_HIT.format", "random.randint", "script.PLAYER_KILL.format" ]
[((871, 897), 'random.randint', 'randint', (['(0)', 'monster.defend'], {}), '(0, monster.defend)\n', (878, 897), False, 'from random import randint\n'), ((1014, 1057), 'script.PLAYER_HIT.format', 'script.PLAYER_HIT.format', ([], {'name': 'monster.name'}), '(name=monster.name)\n', (1038, 1057), False, 'import script\n')...
"""Transaction client.""" import asyncio import functools import typing import urllib.parse from genshin import paginators, utility from genshin.client import routes from genshin.client.components import base from genshin.models.genshin import transaction as models __all__ = ["TransactionClient"] class TransactionC...
[ "genshin.utility.create_short_lang_code", "functools.partial", "genshin.client.routes.YSULOG_URL.get_url", "genshin.models.genshin.transaction.TransactionKind", "typing.cast" ]
[((972, 1010), 'genshin.client.routes.YSULOG_URL.get_url', 'routes.YSULOG_URL.get_url', (['self.region'], {}), '(self.region)\n', (997, 1010), False, 'from genshin.client import routes\n'), ((1195, 1244), 'genshin.utility.create_short_lang_code', 'utility.create_short_lang_code', (['(lang or self.lang)'], {}), '(lang o...
# File path of data.xlsx is stored in path import pandas as pd import numpy as np import seaborn as sns import matplotlib.pyplot as plt offers = pd.read_excel(path, sheet_name=0) transactions = pd.read_excel(path, sheet_name=1) transactions['n'] = 1 df = pd.merge(left=offers, right=transactions, how='inner') print(df....
[ "sklearn.cluster.KMeans", "sklearn.decomposition.PCA", "pandas.merge", "pandas.read_excel", "matplotlib.pyplot.show" ]
[((146, 179), 'pandas.read_excel', 'pd.read_excel', (['path'], {'sheet_name': '(0)'}), '(path, sheet_name=0)\n', (159, 179), True, 'import pandas as pd\n'), ((195, 228), 'pandas.read_excel', 'pd.read_excel', (['path'], {'sheet_name': '(1)'}), '(path, sheet_name=1)\n', (208, 228), True, 'import pandas as pd\n'), ((256, ...
from unittest import TestCase from unittest.mock import patch, MagicMock from maintain_api.main import app import json RESPONSE_SUCCESS = { "entry_number": 1, "local-land-charge": 2 } class TestUpdateLandCharge(TestCase): def setUp(self): self.app = app.test_client() self.jwt_patcher = ...
[ "maintain_api.main.app.test_client", "unittest.mock.MagicMock", "json.dumps", "unittest.mock.patch" ]
[((476, 539), 'unittest.mock.patch', 'patch', (['"""maintain_api.views.v1_0.update_land_charge.current_app"""'], {}), "('maintain_api.views.v1_0.update_land_charge.current_app')\n", (481, 539), False, 'from unittest.mock import patch, MagicMock\n'), ((545, 611), 'unittest.mock.patch', 'patch', (['"""maintain_api.views....
from multiworld.core.image_env import normalize_image import rlkit.torch.pytorch_util as ptu from rlkit.data_management.shared_obs_dict_replay_buffer import \ SharedObsDictRelabelingBuffer from rlkit.data_management.obs_dict_replay_buffer import \ normalize_image class OnlineIMGBuffer(SharedObsDictRelabeling...
[ "rlkit.torch.pytorch_util.from_numpy", "rlkit.data_management.obs_dict_replay_buffer.normalize_image" ]
[((818, 865), 'rlkit.data_management.obs_dict_replay_buffer.normalize_image', 'normalize_image', (['next_obs[self.observation_key]'], {}), '(next_obs[self.observation_key])\n', (833, 865), False, 'from rlkit.data_management.obs_dict_replay_buffer import normalize_image\n'), ((908, 932), 'rlkit.torch.pytorch_util.from_n...
# -------------------------------------------------------- # Faster R-CNN # Copyright (c) 2015 Microsoft # Licensed under The MIT License [see LICENSE for details] # Written by <NAME> and <NAME> # # Modified by <NAME> # -------------------------------------------------------- import numpy as np def generate_anchors(...
[ "numpy.sqrt", "numpy.arange", "numpy.array", "numpy.meshgrid", "numpy.round" ]
[((1300, 1322), 'numpy.array', 'np.array', (['anchor_bases'], {}), '(anchor_bases)\n', (1308, 1322), True, 'import numpy as np\n'), ((1671, 1707), 'numpy.arange', 'np.arange', (['(0)', '(width * stride)', 'stride'], {}), '(0, width * stride, stride)\n', (1680, 1707), True, 'import numpy as np\n'), ((1723, 1760), 'numpy...
from bagnets.clipping import* from bagnets.security import* from absl import app, flags import pickle FLAGS = flags.FLAGS flags.DEFINE_string('name', None, 'metabatch name') flags.DEFINE_string('output_root', '/mnt/data/results/advertorch_results', 'directory for storing results') def main(argv): METABATCH_PATH =...
[ "pickle.load", "absl.flags.DEFINE_string", "absl.app.run" ]
[((123, 174), 'absl.flags.DEFINE_string', 'flags.DEFINE_string', (['"""name"""', 'None', '"""metabatch name"""'], {}), "('name', None, 'metabatch name')\n", (142, 174), False, 'from absl import app, flags\n'), ((175, 286), 'absl.flags.DEFINE_string', 'flags.DEFINE_string', (['"""output_root"""', '"""/mnt/data/results/a...
#!/usr/bin/python3 from robot_client_pypkg.robot_client import RobotClient import rospy if __name__ == '__main__': rospy.init_node("nics_robot_client") car_id = rospy.get_param("~CAR_ID") client = RobotClient(car_id)
[ "rospy.init_node", "rospy.get_param", "robot_client_pypkg.robot_client.RobotClient" ]
[((122, 158), 'rospy.init_node', 'rospy.init_node', (['"""nics_robot_client"""'], {}), "('nics_robot_client')\n", (137, 158), False, 'import rospy\n'), ((172, 198), 'rospy.get_param', 'rospy.get_param', (['"""~CAR_ID"""'], {}), "('~CAR_ID')\n", (187, 198), False, 'import rospy\n'), ((212, 231), 'robot_client_pypkg.robo...
import pytest from aio_bomber.sender import Sender pytestmark = pytest.mark.asyncio @pytest.fixture async def sender(): sender = Sender() yield sender await sender.close_session() async def test_get_services(sender): # Exception await sender.get_services(path='./test') services = await se...
[ "aio_bomber.sender.Sender" ]
[((137, 145), 'aio_bomber.sender.Sender', 'Sender', ([], {}), '()\n', (143, 145), False, 'from aio_bomber.sender import Sender\n')]
# -*- coding: utf-8 -*- # Copyright (c) 2015-2016 Tigera, 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 # # Unle...
[ "logging.getLogger", "threading.current_thread", "threading.Lock", "json.dumps", "time.sleep", "threading.Event", "time.time", "Queue.Queue" ]
[((937, 964), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (954, 964), False, 'import logging\n'), ((1484, 1491), 'Queue.Queue', 'Queue', ([], {}), '()\n', (1489, 1491), False, 'from Queue import Queue, Empty\n'), ((2683, 2690), 'Queue.Queue', 'Queue', ([], {}), '()\n', (2688, 2690), Fa...
# Generated by Django 2.1.7 on 2019-03-22 06:40 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('app', '0002_workoutplan'), ] operations = [ migrations.CreateModel( name='ExerciseTrack', ...
[ "django.db.models.ForeignKey", "django.db.models.AutoField", "django.db.models.CharField", "django.db.models.IntegerField" ]
[((368, 419), 'django.db.models.AutoField', 'models.AutoField', ([], {'primary_key': '(True)', 'serialize': '(False)'}), '(primary_key=True, serialize=False)\n', (384, 419), False, 'from django.db import migrations, models\n'), ((456, 487), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(50)'}),...
# -*- coding: utf-8 -*- """ Created on Wed Jun 19 12:01:47 2019 @author: WT """ import pickle import os import torch import pandas as pd from torch.autograd import Variable from nltk.translate import bleu_score from torchnlp.metrics import get_moses_multi_bleu from .models.Transformer.Transformer import create_masks f...
[ "logging.basicConfig", "logging.getLogger", "torchnlp.metrics.get_moses_multi_bleu", "nltk.translate.bleu_score.corpus_bleu", "pandas.read_csv", "torch.LongTensor", "os.path.join", "pickle.load", "time.sleep", "torch.cuda.is_available", "torch.no_grad", "tqdm.tqdm.pandas", "nltk.translate.bl...
[((478, 506), 'tqdm.tqdm.pandas', 'tqdm.pandas', ([], {'desc': '"""prog_bar"""'}), "(desc='prog_bar')\n", (489, 506), False, 'from tqdm import tqdm\n'), ((507, 633), 'logging.basicConfig', 'logging.basicConfig', ([], {'format': '"""%(asctime)s [%(levelname)s]: %(message)s"""', 'datefmt': '"""%m/%d/%Y %I:%M:%S %p"""', '...
#!/usr/bin/python # -*- coding:utf-8 -*- """ LSTM Demo """ from NeuralNetwork.ANN.activators import IdentityActivator from NeuralNetwork.LSTM import lstm_math def test(): """ 前向和后向传播 """ x, d = lstm_math.data_set() l = lstm_math.LstmLayer(3, 2, 1e-3) l.forward(x[0]) l.forward(x[1]) l...
[ "NeuralNetwork.LSTM.lstm_math.data_set", "NeuralNetwork.ANN.activators.IdentityActivator", "NeuralNetwork.LSTM.lstm_math.LstmLayer" ]
[((214, 234), 'NeuralNetwork.LSTM.lstm_math.data_set', 'lstm_math.data_set', ([], {}), '()\n', (232, 234), False, 'from NeuralNetwork.LSTM import lstm_math\n'), ((243, 275), 'NeuralNetwork.LSTM.lstm_math.LstmLayer', 'lstm_math.LstmLayer', (['(3)', '(2)', '(0.001)'], {}), '(3, 2, 0.001)\n', (262, 275), False, 'from Neur...
from __future__ import print_function import sys import functools from pylel.token import Symbols, Token from pylel.tools import is_int EMPTY_LIST = Token(Symbols.LIST, []) def _pretty_string(token): if token.type in [Symbols.NUMBER, Symbols.BOOLEAN, Symbols.STRING]: # Not all numbers are float. Fixing it before p...
[ "pylel.tools.is_int", "pylel.token.Token", "sys.exit" ]
[((150, 173), 'pylel.token.Token', 'Token', (['Symbols.LIST', '[]'], {}), '(Symbols.LIST, [])\n', (155, 173), False, 'from pylel.token import Symbols, Token\n'), ((704, 718), 'sys.exit', 'sys.exit', (['code'], {}), '(code)\n', (712, 718), False, 'import sys\n'), ((825, 851), 'pylel.token.Token', 'Token', (['Symbols.STR...
import os import logging import math from functools import reduce from collections import defaultdict import json from timeit import default_timer from tqdm import trange, tqdm import numpy as np import torch import sklearn.metrics import sklearn.svm as svm import multiprocessing import time def generator(mus, mus_te...
[ "numpy.mean", "numpy.abs", "numpy.sort", "sklearn.svm.LinearSVC", "gin.parse_config_files_and_bindings", "numpy.quantile", "numpy.zeros", "multiprocessing.Pool", "numpy.cov", "lib.disentanglement_lib.disentanglement_lib.evaluation.metrics.mig._compute_mig", "numpy.var" ]
[((738, 784), 'sklearn.svm.LinearSVC', 'svm.LinearSVC', ([], {'C': '(0.01)', 'class_weight': '"""balanced"""'}), "(C=0.01, class_weight='balanced')\n", (751, 784), True, 'import sklearn.svm as svm\n'), ((897, 922), 'numpy.mean', 'np.mean', (['(pred == y_j_test)'], {}), '(pred == y_j_test)\n', (904, 922), True, 'import ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # --- # jupyter: # jupytext: # text_representation: # extension: .py # format_name: light # format_version: '1.4' # jupytext_version: 1.1.4 # kernelspec: # display_name: Python 3 # language: python # name: python3 # --- # # S_To...
[ "numpy.eye", "matplotlib.pyplot.grid", "numpy.linalg.eig", "numpy.ones", "numpy.sort", "matplotlib.pyplot.plot", "matplotlib.pyplot.style.use", "numpy.argsort", "matplotlib.pyplot.figure", "os.path.abspath" ]
[((901, 925), 'matplotlib.pyplot.style.use', 'plt.style.use', (['"""seaborn"""'], {}), "('seaborn')\n", (914, 925), True, 'import matplotlib.pyplot as plt\n'), ((1069, 1076), 'numpy.eye', 'eye', (['n_'], {}), '(n_)\n', (1072, 1076), False, 'from numpy import ones, sort, argsort, diagflat, eye\n'), ((1247, 1253), 'numpy...
# Copyright 2018 ONES.AI # 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, softwar...
[ "urllib2.urlopen", "urlparse.parse_qs", "os.getenv", "urlparse.urlparse", "json.dumps", "traceback.format_exception", "collections.defaultdict", "unittest.TestResult", "json.load", "types.MethodType", "time.time", "unittest.TextTestRunner", "urlparse.urlunparse" ]
[((1468, 1485), 'collections.defaultdict', 'defaultdict', (['dict'], {}), '(dict)\n', (1479, 1485), False, 'from collections import defaultdict\n'), ((3549, 3584), 'types.MethodType', 'types.MethodType', (['replacement', 'test'], {}), '(replacement, test)\n', (3565, 3584), False, 'import types\n'), ((3936, 3973), 'type...
import os import subprocess import siliconcompiler import pytest @pytest.mark.eda @pytest.mark.quick def test_py(setup_example_test): setup_example_test('blinky') import blinky blinky.main() assert os.path.isfile('build/blinky/job0/bitstream/0/outputs/blinky.bit') @pytest.mark.eda @pytest.mark.qui...
[ "os.path.isfile", "os.path.join", "blinky.main" ]
[((193, 206), 'blinky.main', 'blinky.main', ([], {}), '()\n', (204, 206), False, 'import blinky\n'), ((219, 285), 'os.path.isfile', 'os.path.isfile', (['"""build/blinky/job0/bitstream/0/outputs/blinky.bit"""'], {}), "('build/blinky/job0/bitstream/0/outputs/blinky.bit')\n", (233, 285), False, 'import os\n'), ((512, 578)...
# Generated by Django 3.1.7 on 2021-09-03 16:32 from django.db import migrations, models import django.utils.timezone class Migration(migrations.Migration): dependencies = [ ('app_user', '0006_investment_harvest_amount'), ] operations = [ migrations.AddField( model_name='inv...
[ "django.db.models.DateTimeField" ]
[((382, 437), 'django.db.models.DateTimeField', 'models.DateTimeField', ([], {'default': 'django.utils.timezone.now'}), '(default=django.utils.timezone.now)\n', (402, 437), False, 'from django.db import migrations, models\n'), ((567, 622), 'django.db.models.DateTimeField', 'models.DateTimeField', ([], {'default': 'djan...
#!/usr/bin/env python3 #standard library imports from typing import Generator import os from pathlib import Path #module imports from recipe import Recipe from recipe import IngredientAmount class Frontend: BLEST = True term = None #handling dependencies COLORS={ "WARN":"", "NORM":"",...
[ "pathlib.Path", "blessed.Terminal", "os.getcwd", "os.chdir", "recipe.Recipe" ]
[((1304, 1315), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (1313, 1315), False, 'import os\n'), ((6961, 6982), 'recipe.Recipe', 'Recipe', (['self.rcp_path'], {}), '(self.rcp_path)\n', (6967, 6982), False, 'from recipe import Recipe\n'), ((562, 572), 'blessed.Terminal', 'Terminal', ([], {}), '()\n', (570, 572), False, ...
# -*- coding: utf-8 -*- from functools import reduce from odoo import api, fields, models, _ class CrmPhonecall(models.Model): _inherit = 'crm.phonecall' sale_order_ids = fields.Many2one( comodel_name='sale.order', ) class CrmPhonecall2(models.Model): _inherit = 'crm.phonecall' crm_lea...
[ "odoo.fields.Many2one" ]
[((183, 225), 'odoo.fields.Many2one', 'fields.Many2one', ([], {'comodel_name': '"""sale.order"""'}), "(comodel_name='sale.order')\n", (198, 225), False, 'from odoo import api, fields, models, _\n'), ((328, 368), 'odoo.fields.Many2one', 'fields.Many2one', ([], {'comodel_name': '"""crm.lead"""'}), "(comodel_name='crm.lea...
# Import necessary libraries import matplotlib.pyplot as plt import seaborn as sns # Reset default params sns.set() # Set context to `"paper"` sns.set_context("paper") # print("xxx") # Load iris data iris = sns.load_dataset("iris")
[ "seaborn.load_dataset", "seaborn.set", "seaborn.set_context" ]
[((107, 116), 'seaborn.set', 'sns.set', ([], {}), '()\n', (114, 116), True, 'import seaborn as sns\n'), ((145, 169), 'seaborn.set_context', 'sns.set_context', (['"""paper"""'], {}), "('paper')\n", (160, 169), True, 'import seaborn as sns\n'), ((210, 234), 'seaborn.load_dataset', 'sns.load_dataset', (['"""iris"""'], {})...
import cv2 import os import numpy as np from sys import argv from lib import sauvola, linelocalization, pathfinder from WordSegmentation import wordSegmentation, prepareImg from time import time as timer from SamplePreprocessor import preprocess from DataLoader import Batch from Model import Model def draw_line(im, p...
[ "cv2.rectangle", "cv2.imwrite", "WordSegmentation.prepareImg", "os.path.exists", "numpy.ones", "cv2.threshold", "cv2.erode", "lib.linelocalization.localize", "os.path.join", "numpy.max", "numpy.zeros", "WordSegmentation.wordSegmentation", "os.mkdir", "numpy.min", "DataLoader.Batch", "t...
[((426, 461), 'cv2.rectangle', 'cv2.rectangle', (['im', 'prev', 'curr', '(0)', '(3)'], {}), '(im, prev, curr, 0, 3)\n', (439, 461), False, 'import cv2\n'), ((791, 823), 'cv2.imwrite', 'cv2.imwrite', (['imbw_filename', 'imbw'], {}), '(imbw_filename, imbw)\n', (802, 823), False, 'import cv2\n'), ((885, 919), 'cv2.imwrite...
import pytest from moa import Function, NDArray, BinaryOperation from moa.yaccer import build_parser @pytest.mark.parametrize("filename,result", [ ("test_files/moa/example0.moa", Function( identifier='test', arguments=[ NDArray(shape=(5, 4), data=None, constant=False, identifier='A'),...
[ "pytest.mark.parametrize", "moa.yaccer.build_parser", "moa.NDArray" ]
[((1364, 1625), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""filename"""', "['test_files/moa/example0.moa', 'test_files/moa/example1.moa',\n 'test_files/moa/example2.moa', 'test_files/moa/example4.moa',\n 'test_files/moa/example8.moa', 'test_files/moa/example9.moa',\n 'test_files/moa/tmp.moa']"]...
from unittest import mock, TestCase from mopack.package_defaults import DefaultConfig, _get_default_config from mopack.yaml_tools import YamlParseError def mock_open(read_data): return mock.mock_open(read_data=read_data) class TestDefaultConfig(TestCase): def test_string_field(self): data = 'source...
[ "unittest.mock.mock_open", "mopack.package_defaults._get_default_config", "mopack.package_defaults.DefaultConfig", "unittest.mock.patch", "mopack.package_defaults._get_default_config._reset" ]
[((192, 227), 'unittest.mock.mock_open', 'mock.mock_open', ([], {'read_data': 'read_data'}), '(read_data=read_data)\n', (206, 227), False, 'from unittest import mock, TestCase\n'), ((4934, 4962), 'mopack.package_defaults._get_default_config._reset', '_get_default_config._reset', ([], {}), '()\n', (4960, 4962), False, '...
"This module holds the mixer state of the X-Air device" # part of xair-remote.py # Copyright (c) 2018, 2021 <NAME> # Additions Copyright (c) 2021 <NAME> # Some rights reserved. See LICENSE. import time import subprocess import struct import json from collections import deque from lib.xair import XAirClient, find_mixer...
[ "collections.deque", "lib.midicontroller.MidiController", "lib.xair.XAirClient", "time.sleep", "struct.unpack", "lib.midicontroller.TempoDetector", "lib.xair.find_mixer", "subprocess.call", "json.load" ]
[((10156, 10181), 'collections.deque', 'deque', ([], {'maxlen': 'self.values'}), '(maxlen=self.values)\n', (10161, 10181), False, 'from collections import deque\n'), ((12595, 12615), 'lib.midicontroller.MidiController', 'MidiController', (['self'], {}), '(self)\n', (12609, 12615), False, 'from lib.midicontroller import...
import pyrebase from datetime import datetime import firebase_admin from firebase_admin import db, credentials import pandas as pd import tabulate import time Config = { "apiKey": "<KEY>", "authDomain": "firestore-4dc04.firebaseapp.com", "databaseURL": "https://firestore-4dc04.firebaseio.com", "proje...
[ "firebase_admin.db.reference", "firebase_admin.initialize_app", "time.sleep", "pyrebase.initialize_app", "datetime.datetime.now", "firebase_admin.credentials.Certificate" ]
[((543, 574), 'pyrebase.initialize_app', 'pyrebase.initialize_app', (['Config'], {}), '(Config)\n', (566, 574), False, 'import pyrebase\n'), ((610, 688), 'firebase_admin.credentials.Certificate', 'credentials.Certificate', (['"""C:/Users/shreya_s/Desktop/whatsup/firebase_key.json"""'], {}), "('C:/Users/shreya_s/Desktop...
#!/usr/bin/env python3 import sqlite3 import pandas as pd import numpy as np import matplotlib.pyplot as plt from contextlib import closing as ctx_closing from argparse import ArgumentParser def read_daily_stats(sqc): df = pd.read_sql_query( "SELECT day, avg, (xx/n - avg*avg) AS var, min, max, n AS count FROM (" + ...
[ "pandas.read_sql_query", "numpy.sqrt", "numpy.minimum", "argparse.ArgumentParser", "sqlite3.connect", "matplotlib.pyplot.legend", "matplotlib.pyplot.style.context", "pandas.DataFrame", "numpy.maximum", "matplotlib.pyplot.subplots", "pandas.to_datetime", "matplotlib.pyplot.show" ]
[((225, 648), 'pandas.read_sql_query', 'pd.read_sql_query', (['(\'SELECT day, avg, (xx/n - avg*avg) AS var, min, max, n AS count FROM (\' +\n "SELECT strftime(\'%Y-%m-%d\',timestamp,\'unixepoch\') AS day," +\n \' AVG(delay_ms) AS avg,\' + \' MIN(delay_ms) AS min,\' +\n \' MAX(delay_ms) AS max,\' + \' SUM(delay...
from __future__ import division from __future__ import print_function from builtins import range from past.utils import old_div from builtins import object from common import * from jsonrpc import DataSource import deduplication import boar_exceptions from copy import copy """ A recipe has the following format: { ...
[ "past.utils.old_div", "copy.copy", "builtins.range", "tempfile.NamedTemporaryFile", "boar_exceptions.CorruptionError" ]
[((5628, 5657), 'tempfile.NamedTemporaryFile', 'tempfile.NamedTemporaryFile', ([], {}), '()\n', (5655, 5657), False, 'import tempfile\n'), ((6277, 6319), 'past.utils.old_div', 'old_div', (['(block_size * block_count)', '(2 ** 20)'], {}), '(block_size * block_count, 2 ** 20)\n', (6284, 6319), False, 'from past.utils imp...
# -*- coding: utf-8 -*- import tensorflow as tf import numpy as np import skimage.io as io import skimage.transform as transform from os.path import join import vfn.network as nw import argparse import json import time global_dtype = tf.float32 global_dtype_np = np.float32 batch_size = 200 def overlap_ratio(x1, y1, ...
[ "vfn.network.score", "numpy.repeat", "argparse.ArgumentParser", "tensorflow.placeholder", "vfn.network.get_variable_dict", "tensorflow.ConfigProto", "vfn.network.build_alexconvnet", "json.loads", "tensorflow.variable_scope", "tensorflow.global_variables", "argparse.ArgumentTypeError", "skimage...
[((795, 830), 'numpy.zeros', 'np.zeros', (['(batch_size, 227, 227, 3)'], {}), '((batch_size, 227, 227, 3))\n', (803, 830), True, 'import numpy as np\n'), ((1512, 1547), 'json.loads', 'json.loads', (['slidling_windows_string'], {}), '(slidling_windows_string)\n', (1522, 1547), False, 'import json\n'), ((3641, 3666), 'ar...
import pandas as pd import dash import dash_core_components as dcc import dash_html_components as html import plotly.graph_objects as go import random from dash.dependencies import Input, Output, State import json from urllib.request import urlopen import main_tab import index_calculation import neighborhood_review imp...
[ "main_tab.update_map", "index_calculation.update_index_map", "index_calculation.update_boxplot_index_no_sd", "index_calculation.content", "index_calculation.update_elbow", "dash.dependencies.Output", "dash.dependencies.Input", "dash_core_components.Tab", "compare.update_radar_chart", "dash_html_co...
[((339, 436), 'dash.Dash', 'dash.Dash', ([], {'meta_tags': "[{'name': 'viewport', 'content': 'width=device-width, initial-scale=1'}]"}), "(meta_tags=[{'name': 'viewport', 'content':\n 'width=device-width, initial-scale=1'}])\n", (348, 436), False, 'import dash\n'), ((1278, 1312), 'dash.dependencies.Output', 'Output'...
from collections import Counter import numpy as np import sklearn from pandas import DataFrame from sklearn.impute import SimpleImputer import data.utils.df_loader as dl import data.utils.web_scrappers as ws def process_data_for_labels(ticker): """ Computes new columns needed for label generation for specif...
[ "pandas.DataFrame.from_records", "data.utils.df_loader.get_dax__as_df", "numpy.log", "data.utils.web_scrappers.get_tickers", "collections.Counter", "numpy.array", "sklearn.impute.SimpleImputer", "data.utils.df_loader.get_com_as_df", "sklearn.preprocessing.MinMaxScaler" ]
[((532, 551), 'data.utils.df_loader.get_dax__as_df', 'dl.get_dax__as_df', ([], {}), '()\n', (549, 551), True, 'import data.utils.df_loader as dl\n'), ((1180, 1196), 'data.utils.web_scrappers.get_tickers', 'ws.get_tickers', ([], {}), '()\n', (1194, 1196), True, 'import data.utils.web_scrappers as ws\n'), ((2911, 2935), ...
#!/usr/bin/env python import subprocess #dirty hack to backport check_output to python <2.7 # taken from: http://stackoverflow.com/questions/4814970/subprocess-check-output-doesnt-seem-to-exist-python-2-6-5/13160748#13160748 if "check_output" not in dir( subprocess ): # duck punch it in! def f(*popenargs, **kwargs):...
[ "logging.getLogger", "subprocess.check_output", "store.AppStore.countryForStoreFrontId", "os.path.exists", "os.makedirs", "re.compile", "subprocess.Popen", "subprocess.CalledProcessError", "plistlib.readPlistFromString", "enum.Enum", "deviceconnection.shared_device_handler" ]
[((888, 927), 'logging.getLogger', 'logging.getLogger', (["('worker.' + __name__)"], {}), "('worker.' + __name__)\n", (905, 927), False, 'import logging\n'), ((1834, 1921), 'enum.Enum', 'Enum', (["['DeviceName', 'DeviceClass', 'ProductType', 'ProductVersion', 'WiFiAddress']"], {}), "(['DeviceName', 'DeviceClass', 'Prod...
import re from . import parsing from .checker import check_login from .output import Output @check_login def msgUrl(ses, next=None): html = ses.session.get( "https://mbasic.facebook.com/messages" if not next else next ).text data = parsing.parsing_href(html, "/read/") next = parsing.parsing_h...
[ "re.search" ]
[((1240, 1274), 're.search', 're.search', (['"""owner_id=(\\\\d+)"""', 'html'], {}), "('owner_id=(\\\\d+)', html)\n", (1249, 1274), False, 'import re\n'), ((680, 714), 're.search', 're.search', (['"""/(\\\\d+)\\\\W"""', "x['href']"], {}), "('/(\\\\d+)\\\\W', x['href'])\n", (689, 714), False, 'import re\n'), ((1840, 187...
# -*- coding:utf-8 -*- __author__ = 'Tonakai' from django.shortcuts import HttpResponse, render from PManager.models.users import User, PM_User from PManager.models.keys import Key from PManager.viewsExt import headers from django.contrib.auth.decorators import login_required from PManager.classes.git.gitolite_manager ...
[ "django.shortcuts.render", "PManager.models.keys.Key.create", "django.shortcuts.HttpResponse", "json.dumps", "re.match", "PManager.models.keys.Key.delete", "PManager.models.keys.Key.objects.filter", "PManager.classes.git.gitolite_manager.GitoliteManager.check_key" ]
[((2740, 2756), 'django.shortcuts.HttpResponse', 'HttpResponse', (['""""""'], {}), "('')\n", (2752, 2756), False, 'from django.shortcuts import HttpResponse, render\n'), ((893, 918), 'json.dumps', 'json.dumps', (['response_data'], {}), '(response_data)\n', (903, 918), False, 'import json\n'), ((1050, 1102), 'django.sho...
import re class CodePreprocess: def __init__(self): pass @staticmethod def remove_comment(code): return re.sub(r"(\/\/.+)|(#.+)|('.+)|(\/\*[^(\*\/)]+?\*\/)|(\"{3}[^(\"{3})]+?\"{3})", ' ', code) @staticmethod def remove_space(code): return re.sub("\s+", ' ', code.strip()) ...
[ "re.sub" ]
[((135, 245), 're.sub', 're.sub', (['"""(\\\\/\\\\/.+)|(#.+)|(\'.+)|(\\\\/\\\\*[^(\\\\*\\\\/)]+?\\\\*\\\\/)|(\\\\"{3}[^(\\\\"{3})]+?\\\\"{3})"""', '""" """', 'code'], {}), '(\n \'(\\\\/\\\\/.+)|(#.+)|(\\\'.+)|(\\\\/\\\\*[^(\\\\*\\\\/)]+?\\\\*\\\\/)|(\\\\"{3}[^(\\\\"{3})]+?\\\\"{3})\'\n , \' \', code)\n', (141, 24...
from django.shortcuts import render from .models import Category, Image, Location # Create your views here. def gallery(request): location = request.GET.get('location') print('location:', location) categories = Category.objects.all() locations = Location.objects.all() photos = Image.objects.all()...
[ "django.shortcuts.render" ]
[((416, 457), 'django.shortcuts.render', 'render', (['request', '"""homepage.html"""', 'context'], {}), "(request, 'homepage.html', context)\n", (422, 457), False, 'from django.shortcuts import render\n'), ((704, 791), 'django.shortcuts.render', 'render', (['request', '"""search.html"""', "{'message': message, 'article...
"""The main file for the Spotify Playlist Analytics project. Run this file to open the interactive GUI. MIT License Copyright (c) 2021 <NAME> 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 with...
[ "os.path.exists", "gui.show_gui", "os.mkdir", "dotenv.load_dotenv" ]
[((1209, 1240), 'dotenv.load_dotenv', 'dotenv.load_dotenv', (['"""token.env"""'], {}), "('token.env')\n", (1227, 1240), False, 'import dotenv\n'), ((1335, 1349), 'gui.show_gui', 'gui.show_gui', ([], {}), '()\n', (1347, 1349), False, 'import gui\n'), ((1287, 1310), 'os.path.exists', 'os.path.exists', (['"""cache"""'], {...
# 导入包 import zipfile import paddle import paddle.fluid as fluid import matplotlib.pyplot as plt import matplotlib.image as mping from PIL import Image import json import numpy as np import cv2 import sys import time import h5py # import scipy.io as io from matplotlib import pyplot as plt from scipy.ndimage.filters impo...
[ "paddle.fluid.layers.sqrt", "csv.DictWriter", "paddle.fluid.DataFeeder", "zipfile.ZipFile", "scipy.ndimage.filters.gaussian_filter", "paddle.fluid.layers.data", "numpy.count_nonzero", "numpy.array", "paddle.fluid.Executor", "matplotlib.pyplot.imshow", "paddle.utils.plot.Ploter", "paddle.fluid....
[((431, 442), 'time.time', 'time.time', ([], {}), '()\n', (440, 442), False, 'import time\n'), ((521, 533), 'json.load', 'json.load', (['f'], {}), '(f)\n', (530, 533), False, 'import json\n'), ((1133, 1170), 'zipfile.ZipFile', 'zipfile.ZipFile', (['"""data/train_new.zip"""'], {}), "('data/train_new.zip')\n", (1148, 117...
import datetime import pytz from django.urls import reverse from selenium.webdriver.common.by import By from selenium.webdriver.support import expected_conditions as EC from selenium.webdriver.support.wait import WebDriverWait from wkz import configuration, models def test_all_sports_page_accessible(live_server, we...
[ "datetime.datetime", "wkz.models.Sport.objects.all", "wkz.models.Sport.objects.get", "selenium.webdriver.support.wait.WebDriverWait", "wkz.models.Activity.objects.filter", "wkz.models.default_sport", "selenium.webdriver.support.expected_conditions.presence_of_element_located", "django.urls.reverse", ...
[((722, 744), 'wkz.models.default_sport', 'models.default_sport', ([], {}), '()\n', (742, 744), False, 'from wkz import configuration, models\n'), ((832, 858), 'wkz.models.Sport.objects.all', 'models.Sport.objects.all', ([], {}), '()\n', (856, 858), False, 'from wkz import configuration, models\n'), ((1776, 1802), 'wkz...
from backpack.core.derivatives.conv1d import Conv1DDerivatives from .base import GradBaseModule class GradConv1d(GradBaseModule): def __init__(self): super().__init__(derivatives=Conv1DDerivatives(), params=["bias", "weight"])
[ "backpack.core.derivatives.conv1d.Conv1DDerivatives" ]
[((194, 213), 'backpack.core.derivatives.conv1d.Conv1DDerivatives', 'Conv1DDerivatives', ([], {}), '()\n', (211, 213), False, 'from backpack.core.derivatives.conv1d import Conv1DDerivatives\n')]
''' FFT curves submodule for the SLab project It requires and imports slab.py History: Version 1.0 : First version (7/4/2017) Version 1.1 : Compatibility with Python 3.x (1/3/2018) ''' from __future__ import print_function import slab import slab_ac as ac import numpy as np # Numpy ...
[ "slab.singleWaveResponse", "numpy.abs", "numpy.sqrt", "slab.tranStore", "numpy.fft.fft", "slab.message", "slab_ac.plotFreq", "slab.plot11", "slab.setWaveFrequency", "slab.waveCosine", "slab.SlabEx" ]
[((3856, 3893), 'slab.message', 'slab.message', (['(1)', '"""SLab FFT Submodule"""'], {}), "(1, 'SLab FFT Submodule')\n", (3868, 3893), False, 'import slab\n'), ((3986, 4005), 'slab.message', 'slab.message', (['(1)', '""""""'], {}), "(1, '')\n", (3998, 4005), False, 'import slab\n'), ((1501, 1519), 'numpy.fft.fft', 'np...
""" Tests the datasets module """ from __future__ import division from __future__ import print_function from __future__ import unicode_literals import unittest import ga4gh.datamodel.datasets as datasets class TestDatasets(unittest.TestCase): """ Tests the datasets class """ def testToProtocolElemen...
[ "ga4gh.datamodel.datasets.SimulatedDataset" ]
[((373, 424), 'ga4gh.datamodel.datasets.SimulatedDataset', 'datasets.SimulatedDataset', (['datasetId', '(1)', '(2)', '(3)', '(4)', '(5)'], {}), '(datasetId, 1, 2, 3, 4, 5)\n', (398, 424), True, 'import ga4gh.datamodel.datasets as datasets\n')]
#!/usr/bin/env python3 import ftplib import os import io base_dir = os.getenv("BASE_DIR", "{}/src/github.com/raid-codex/data".format( os.getenv("GOPATH"), )) + "/generated/champions/" def upload_file(filename, full_path, ftp): content = None with open(full_path) as f: content = bytes(f.read(), "...
[ "io.BytesIO", "os.walk", "os.getenv" ]
[((1022, 1039), 'os.walk', 'os.walk', (['base_dir'], {}), '(base_dir)\n', (1029, 1039), False, 'import os\n'), ((342, 361), 'io.BytesIO', 'io.BytesIO', (['content'], {}), '(content)\n', (352, 361), False, 'import io\n'), ((617, 638), 'os.getenv', 'os.getenv', (['"""FTP_HOST"""'], {}), "('FTP_HOST')\n", (626, 638), Fals...
import numpy as np import numba as nb from dataclasses import dataclass from numba import types from numba.typed import Dict from numba import njit import pandas as pd import time import datetime import csv from openpyxl import load_workbook from pyModbusTCP.client import ModbusClient from pyModbusTCP impor...
[ "numpy.sqrt", "numpy.polyfit", "numpy.array", "numpy.where", "numpy.exp", "numpy.maximum", "numpy.abs", "numpy.ones", "pyModbusTCP.utils.word_list_to_long", "numpy.int16", "csv.writer", "pyModbusTCP.utils.decode_ieee", "numba.jit", "pyModbusTCP.client.ModbusClient", "numpy.ones_like", ...
[((25096, 25117), 'numba.jit', 'nb.jit', ([], {'nopython': '(True)'}), '(nopython=True)\n', (25102, 25117), True, 'import numba as nb\n'), ((32273, 32294), 'numba.jit', 'nb.jit', ([], {'nopython': '(True)'}), '(nopython=True)\n', (32279, 32294), True, 'import numba as nb\n'), ((33578, 33599), 'numba.jit', 'nb.jit', ([]...
import requests def get_temp(): r = requests.get("http://api.openweathermap.org/data/2.5/weather?lat=40.2212&lon=23.6666&APPID=73f3a8c7b0681b685f4195065c6719e7") data = r.json() temp_K = data['main']['temp'] temp_C = convert_K_to_C(temp_K) return temp_C def convert_K_to_C(k): return k - 273.15...
[ "requests.get" ]
[((41, 176), 'requests.get', 'requests.get', (['"""http://api.openweathermap.org/data/2.5/weather?lat=40.2212&lon=23.6666&APPID=73f3a8c7b0681b685f4195065c6719e7"""'], {}), "(\n 'http://api.openweathermap.org/data/2.5/weather?lat=40.2212&lon=23.6666&APPID=73f3a8c7b0681b685f4195065c6719e7'\n )\n", (53, 176), False,...
import cv2 import numpy as np def detect(image): """ performs detection of characters from image :param image: numpy.array :return coordinates: list of tuples coordinates of detected elements :return cropped image: list of numpy.arrays bounding boxes of detected elements """ # convert the image to grayscal...
[ "numpy.ones", "cv2.contourArea", "cv2.adaptiveThreshold", "cv2.cvtColor", "numpy.min", "cv2.findContours", "cv2.bitwise_not", "cv2.resize", "cv2.boundingRect" ]
[((336, 375), 'cv2.cvtColor', 'cv2.cvtColor', (['image', 'cv2.COLOR_BGR2GRAY'], {}), '(image, cv2.COLOR_BGR2GRAY)\n', (348, 375), False, 'import cv2\n'), ((456, 557), 'cv2.adaptiveThreshold', 'cv2.adaptiveThreshold', (['gray_image', '(255)', 'cv2.ADAPTIVE_THRESH_GAUSSIAN_C', 'cv2.THRESH_BINARY', '(21)', '(9)'], {}), '(...
import tkinter as tk class App(tk.Tk): def __init__(self, *args, **kwargs): tk.Tk.__init__(self, *args, **kwargs) self.SIZE = 50 # Size of the grid self.X = self.SIZE self.Y = self.SIZE self.WIDTH = 15 # Width and self.HEIGHT = 15 # height of the cell self...
[ "tkinter.Canvas", "tkinter.Tk.__init__" ]
[((89, 126), 'tkinter.Tk.__init__', 'tk.Tk.__init__', (['self', '*args'], {}), '(self, *args, **kwargs)\n', (103, 126), True, 'import tkinter as tk\n'), ((325, 416), 'tkinter.Canvas', 'tk.Canvas', (['self'], {'bg': '"""red"""', 'height': '(self.HEIGHT * self.SIZE)', 'width': '(self.WIDTH * self.SIZE)'}), "(self, bg='re...
from airflow import DAG from airflow.operators.dummy_operator import DummyOperator from airflow.utils import timezone default_args = { 'owner': 'ODDS', } dag = DAG( 'my_dummy_dag', schedule_interval='*/5 * * * *', default_args=default_args, start_date=timezone.datetime(2020, 8, 1), catchup=False...
[ "airflow.utils.timezone.datetime", "airflow.operators.dummy_operator.DummyOperator" ]
[((332, 371), 'airflow.operators.dummy_operator.DummyOperator', 'DummyOperator', ([], {'task_id': '"""start"""', 'dag': 'dag'}), "(task_id='start', dag=dag)\n", (345, 371), False, 'from airflow.operators.dummy_operator import DummyOperator\n'), ((387, 433), 'airflow.operators.dummy_operator.DummyOperator', 'DummyOperat...
import math import random import numpy as np from OpenGL.GL import * from OpenGL.GL.ARB.framebuffer_object import * from OpenGL.GL.EXT.framebuffer_object import * from PyEngine3D.Utilities import * from PyEngine3D.Common import logger, COLOR_BLACK from PyEngine3D.OpenGLContext import Texture2D, Texture2DArray, Textu...
[ "PyEngine3D.Common.logger.error", "PyEngine3D.Common.logger.warn", "math.log2", "numpy.zeros", "PyEngine3D.OpenGLContext.CreateTexture", "PyEngine3D.OpenGLContext.RenderBuffer" ]
[((17294, 17323), 'numpy.zeros', 'np.zeros', (['(1)'], {'dtype': 'np.float32'}), '(1, dtype=np.float32)\n', (17302, 17323), True, 'import numpy as np\n'), ((4617, 4693), 'PyEngine3D.Common.logger.warn', 'logger.warn', (["('Failed to get temporary %s render target.' % rendertarget_name)"], {}), "('Failed to get temporar...
import os import json import torch import pickle from torch.utils.data import DataLoader from model import KGEModel from dataloader import TrainDataset from dataloader import BidirectionalOneShotIterator from classifier import ClassifierTrainer, LTTrainer, NoiGANTrainer import numpy as np from sklearn.metrics import ac...
[ "classifier.NoiGANTrainer", "numpy.in1d", "torch.LongTensor", "os.path.join", "model.KGEModel", "numpy.random.randint", "numpy.concatenate", "dataloader.TrainDataset.get_true_head_and_tail", "json.load" ]
[((2913, 3193), 'model.KGEModel', 'KGEModel', ([], {'model_name': 'model', 'nentity': 'args.nentity', 'nrelation': 'args.nrelation', 'hidden_dim': 'args.hidden_dim', 'gamma': "argparse_dict['gamma']", 'double_entity_embedding': "argparse_dict['double_entity_embedding']", 'double_relation_embedding': "argparse_dict['dou...
from cloudscale import Cloudscale, CloudscaleApiException, CloudscaleException, CLOUDSCALE_API_ENDPOINT from cloudscale.cli import cli import responses import click from click.testing import CliRunner NETWORK_RESP = { "href": "https://api.cloudscale.ch/v1/networks/2db69ba3-1864-4608-853a-0771b6885a3a", "uuid":...
[ "responses.add", "cloudscale.Cloudscale", "click.testing.CliRunner" ]
[((797, 902), 'responses.add', 'responses.add', (['responses.GET', "(CLOUDSCALE_API_ENDPOINT + '/networks')"], {'json': '[NETWORK_RESP]', 'status': '(200)'}), "(responses.GET, CLOUDSCALE_API_ENDPOINT + '/networks', json=[\n NETWORK_RESP], status=200)\n", (810, 902), False, 'import responses\n'), ((935, 1040), 'respo...
""" The TicTacToe game tree and peripheral functions. -------------------------------------------------------------------------------- MIT License Copyright (c) 2021 Mu "<NAME> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Softw...
[ "doctest.testmod" ]
[((4124, 4141), 'doctest.testmod', 'doctest.testmod', ([], {}), '()\n', (4139, 4141), False, 'import doctest\n')]
#!/usr/bin/env python3 ############################################################################## # EVOLIFE http://evolife.telecom-paris.fr <NAME> # # Telecom Paris 2021 www.dessalles.fr # # ------------------------------------------------------------------------...
[ "random.choice", "random.randint" ]
[((7308, 7342), 'random.randint', 'random.randint', (['(0)', '(self.Height - 1)'], {}), '(0, self.Height - 1)\n', (7322, 7342), False, 'import random\n'), ((7350, 7383), 'random.randint', 'random.randint', (['(0)', '(self.Width - 1)'], {}), '(0, self.Width - 1)\n', (7364, 7383), False, 'import random\n'), ((7018, 7057)...
# -*- coding: utf-8 -*- import socks import urllib.request import re import os # -------------------------------------------------------------------------- def dorequest(url, params): req = urllib.request.Request(url) if params.agent is not None: req.add_header("User-agent", params.agent) else: ...
[ "re.sub", "socks.socksocket", "os.listdir", "re.compile" ]
[((802, 820), 'socks.socksocket', 'socks.socksocket', ([], {}), '()\n', (818, 820), False, 'import socks\n'), ((979, 998), 're.compile', 're.compile', (['"""<.*?>"""'], {}), "('<.*?>')\n", (989, 998), False, 'import re\n'), ((1015, 1043), 're.sub', 're.sub', (['cleanr', '""""""', 'raw_html'], {}), "(cleanr, '', raw_htm...
# -*- coding: utf-8 -*- # snapshottest: v1 - https://goo.gl/zC4yUc from __future__ import unicode_literals from snapshottest import GenericRepr, Snapshot snapshots = Snapshot() snapshots['test_args 1'] = [ ( 'trace_func', ( GenericRepr('sentinel.frame'), 'call', ...
[ "snapshottest.GenericRepr", "snapshottest.Snapshot" ]
[((169, 179), 'snapshottest.Snapshot', 'Snapshot', ([], {}), '()\n', (177, 179), False, 'from snapshottest import GenericRepr, Snapshot\n'), ((260, 289), 'snapshottest.GenericRepr', 'GenericRepr', (['"""sentinel.frame"""'], {}), "('sentinel.frame')\n", (271, 289), False, 'from snapshottest import GenericRepr, Snapshot\...
import pytest from django.conf import settings from django.db import IntegrityError from fleets.models import Fleet from commons.conftest import board from fleets.utils import add_battleship, OutOceanException, add_submarine, NearShipException def test_place_battleship_left_top_corner_vertical(board): add_battle...
[ "fleets.models.Fleet.objects.filter", "fleets.utils.add_battleship", "pytest.raises", "fleets.utils.add_submarine", "fleets.models.Fleet.objects.count" ]
[((310, 352), 'fleets.utils.add_battleship', 'add_battleship', (['board', '(1)', '(1)'], {'vertical': '(True)'}), '(board, 1, 1, vertical=True)\n', (324, 352), False, 'from fleets.utils import add_battleship, OutOceanException, add_submarine, NearShipException\n'), ((529, 572), 'fleets.utils.add_battleship', 'add_battl...
import sys from discord.ext import commands from utils import checks class AdminCommands(commands.Cog, name="Administration"): """A cog where all the server admin commands live""" def __init__(self, bot): self.bot = bot @commands.command(name='disconnect-vc', hidden=True) async def disconne...
[ "utils.checks.requires_staff_role", "discord.ext.commands.command", "sys.exit" ]
[((246, 297), 'discord.ext.commands.command', 'commands.command', ([], {'name': '"""disconnect-vc"""', 'hidden': '(True)'}), "(name='disconnect-vc', hidden=True)\n", (262, 297), False, 'from discord.ext import commands\n'), ((477, 506), 'discord.ext.commands.command', 'commands.command', ([], {'hidden': '(True)'}), '(h...
from __future__ import print_function, absolute_import, division # makes KratosMultiphysics backward compatible with python 2.6 and 2.7 #import kratos core and applications import KratosMultiphysics import KratosMultiphysics.DelaunayMeshingApplication as KratosDelaunay # Import the mesh mesher (the base class for the...
[ "KratosMultiphysics.Flags", "mesher.Mesher.__init__" ]
[((590, 655), 'mesher.Mesher.__init__', 'mesher.Mesher.__init__', (['self', 'main_model_part', 'meshing_parameters'], {}), '(self, main_model_part, meshing_parameters)\n', (612, 655), False, 'import mesher\n'), ((930, 956), 'KratosMultiphysics.Flags', 'KratosMultiphysics.Flags', ([], {}), '()\n', (954, 956), False, 'im...
# Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the...
[ "ironic_inspector.common.i18n._" ]
[((708, 855), 'ironic_inspector.common.i18n._', '_', (['"""If True, refuse to parse extra data if at least one record is too short. Additionally, remove the incoming "data" even if parsing failed."""'], {}), '(\'If True, refuse to parse extra data if at least one record is too short. Additionally, remove the incoming "...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Scan for Bluetooth Low Energy packets and attempt to identify them. """ import os import sys import argparse import logging import pathlib from .sniffer import Sniffer from ._version import get_versions REQUIRE_PLATFORM = "linux" def main() -> None: parser =...
[ "logging.basicConfig", "argparse.ArgumentParser", "pathlib.Path" ]
[((321, 507), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'prog': '"""btlesniffer"""', 'description': '"""Scan for Bluetooth Low Energy devices and gather information about them. This program will only run on Linux systems."""'}), "(prog='btlesniffer', description=\n 'Scan for Bluetooth Low Energy de...
from flask_login import current_user from flask_wtf import FlaskForm from wtforms.fields import StringField, SubmitField, FileField, BooleanField, SelectField, HiddenField from wtforms.validators import DataRequired, InputRequired, Optional from wtforms.widgets import TextArea from ..app import db class PostForm(Fla...
[ "wtforms.widgets.TextArea", "wtforms.validators.InputRequired", "wtforms.validators.Optional", "wtforms.validators.DataRequired", "wtforms.fields.SubmitField" ]
[((836, 855), 'wtforms.fields.SubmitField', 'SubmitField', (['"""Post"""'], {}), "('Post')\n", (847, 855), False, 'from wtforms.fields import StringField, SubmitField, FileField, BooleanField, SelectField, HiddenField\n'), ((574, 584), 'wtforms.widgets.TextArea', 'TextArea', ([], {}), '()\n', (582, 584), False, 'from w...
from setuptools import setup import os install_requires = ['aiohttp>=1.0.2', 'prometheus_client>=0.0.19'] def read(f): return open(os.path.join(os.path.dirname(__file__), f)).read().strip() version = 0.1 setup(name='aiohttp_prometheus', version=version, description=("prometheus middleware for aiohtt...
[ "os.path.dirname" ]
[((151, 176), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (166, 176), False, 'import os\n')]