code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
import seaborn as sns
from cleu.embeddings import Embedding,Embeddings
from cleu.utils import utils
import matplotlib.pyplot as plt
import altair as alt
import pandas as pd
import numpy as np
def plot_similarity(list_embedding_src,list_embedding_tgt,distance_function='cosine',csls_k=5):
assert(len(list_embedding_s... | [
"pandas.DataFrame",
"seaborn.heatmap",
"matplotlib.pyplot.show",
"altair.Chart",
"cleu.utils.utils.combine_embeddings_language",
"cleu.utils.utils.combine_embeddings_word",
"cleu.utils.utils.reduce_dimensionality_2d",
"cleu.utils.utils.combine_embeddings_matrix",
"seaborn.set",
"cleu.utils.utils.c... | [((593, 661), 'seaborn.set', 'sns.set', ([], {'rc': "{'figure.figsize': (13.7, 10.27), 'image.cmap': 'Blues'}"}), "(rc={'figure.figsize': (13.7, 10.27), 'image.cmap': 'Blues'})\n", (600, 661), True, 'import seaborn as sns\n'), ((688, 789), 'cleu.utils.utils.create_similarity_matrix', 'utils.create_similarity_matrix', (... |
from django import template
from django.conf import settings
import seed_control_interface
import re
register = template.Library()
@register.simple_tag
def current_version():
return seed_control_interface.__version__
@register.filter
def unslug(value):
return re.sub('[^0-9a-zA-Z]+', ' ', value).strip()
... | [
"django.template.Library",
"re.sub"
] | [((115, 133), 'django.template.Library', 'template.Library', ([], {}), '()\n', (131, 133), False, 'from django import template\n'), ((275, 310), 're.sub', 're.sub', (['"""[^0-9a-zA-Z]+"""', '""" """', 'value'], {}), "('[^0-9a-zA-Z]+', ' ', value)\n", (281, 310), False, 'import re\n')] |
#!/usr/bin/python
"""The primary script to execute the tensorflow models."""
from __future__ import print_function
from munch import munchify
from six.moves import cPickle
from config.arguments import parser
""" Default model """
from model.model import Model
from utils.processor import BatchLoader, DataLoader, eval... | [
"yaml.load",
"numpy.sum",
"tensorflow.reset_default_graph",
"tensorflow.local_variables_initializer",
"tensorflow.ConfigProto",
"numpy.random.randint",
"config.arguments.parser.parse_args",
"numpy.exp",
"tensorflow.get_default_graph",
"os.path.join",
"tensorflow.random_uniform_initializer",
"u... | [((513, 537), 'tensorflow.reset_default_graph', 'tf.reset_default_graph', ([], {}), '()\n', (535, 537), True, 'import tensorflow as tf\n'), ((593, 612), 'config.arguments.parser.parse_args', 'parser.parse_args', ([], {}), '()\n', (610, 612), False, 'from config.arguments import parser\n'), ((719, 759), 'os.path.join', ... |
import numpy as np
from matplotlib import pyplot as plt
import tensorflow as tf
from tqdm import tqdm
tf.compat.v1.enable_v2_behavior()
from tf_agents.agents.reinforce import reinforce_agent
from tf_agents.drivers import dynamic_step_driver
from tf_agents.environments import suite_gym
from tf_agents.environments impo... | [
"tf_agents.trajectories.trajectory.from_transition",
"tensorflow.compat.v1.enable_v2_behavior"
] | [((103, 136), 'tensorflow.compat.v1.enable_v2_behavior', 'tf.compat.v1.enable_v2_behavior', ([], {}), '()\n', (134, 136), True, 'import tensorflow as tf\n'), ((1759, 1825), 'tf_agents.trajectories.trajectory.from_transition', 'trajectory.from_transition', (['time_step', 'action_step', 'next_time_step'], {}), '(time_ste... |
""""CDMI storage
Copyright 2015 Archive Analytics Solutions
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 ... | [
"cdmi.capabilities.DataObjectCapabilities",
"cdmi.capabilities.StorageSystemMetadataCapabilities",
"collections.OrderedDict",
"cdmi.capabilities.ContainerCapabilities",
"re.sub"
] | [((1115, 1281), 'cdmi.capabilities.StorageSystemMetadataCapabilities', 'StorageSystemMetadataCapabilities', ([], {'cdmi_acl': '(False)', 'cdmi_size': '(False)', 'cdmi_ctime': '(False)', 'cdmi_atime': '(False)', 'cdmi_mtime': '(False)', 'cdmi_acount': '(False)', 'cdmi_mcount': '(False)'}), '(cdmi_acl=False, cdmi_size=Fa... |
import io
import matplotlib.pyplot as plt
import tensorflow as tf
def log_as_histogram(name, values):
"""Logs values as histogram."""
values *= tf.math.rsqrt(tf.reduce_mean(tf.square(values)) + 1e-10)
data = []
scale = 100
for i in range(values.shape[0]):
d = tf.zeros(tf.cast(tf.round(sca... | [
"io.BytesIO",
"matplotlib.pyplot.close",
"tensorflow.concat",
"tensorflow.cast",
"tensorflow.shape",
"tensorflow.summary.histogram",
"tensorflow.round",
"tensorflow.TensorArray",
"tensorflow.square",
"tensorflow.expand_dims",
"matplotlib.pyplot.savefig"
] | [((393, 416), 'tensorflow.concat', 'tf.concat', (['data'], {'axis': '(0)'}), '(data, axis=0)\n', (402, 416), True, 'import tensorflow as tf\n'), ((506, 567), 'tensorflow.summary.histogram', 'tf.summary.histogram', (['name', 'data'], {'buckets': '(values.shape[0] + 1)'}), '(name, data, buckets=values.shape[0] + 1)\n', (... |
import os
from keyring import get_password
from werkzeug.utils import import_string
DB = "notifications_service"
PORT = 27017
MONGO_IP = "127.0.0.1"
KAFKA_BROKERS = "127.0.0.1:9092"
BALANCES_TOPIC_NAME = "balances"
class BaseConfig(object):
DEBUG = False
TESTING = False
SERVERNAME = "localhost"
PORT ... | [
"keyring.get_password",
"os.getenv",
"werkzeug.utils.import_string"
] | [((1506, 1583), 'os.getenv', 'os.getenv', (['"""FLASK_ENV"""', '"""CryptoNotificationsService.config.DevelopmentConfig"""'], {}), "('FLASK_ENV', 'CryptoNotificationsService.config.DevelopmentConfig')\n", (1515, 1583), False, 'import os\n'), ((1642, 1696), 'keyring.get_password', 'get_password', (['"""CryptoNotification... |
# -*- coding: utf-8 -*-
#
# This file is part of Invenio.
#
# Copyright (C) 2021 Graz University of Technology.
#
# Invenio-Records-Marc21 is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
"""Tests for Resources UI marc21 serializer."""... | [
"invenio_records_marc21.resources.serializers.ui.Marc21UIJSONSerializer",
"invenio_records_marc21.resources.serializers.ui.Marc21UIXMLSerializer"
] | [((576, 599), 'invenio_records_marc21.resources.serializers.ui.Marc21UIXMLSerializer', 'Marc21UIXMLSerializer', ([], {}), '()\n', (597, 599), False, 'from invenio_records_marc21.resources.serializers.ui import Marc21UIJSONSerializer, Marc21UIXMLSerializer\n'), ((749, 772), 'invenio_records_marc21.resources.serializers.... |
"""
"""
import shlex
import sys
import os
import json
from setuptools import setup, find_packages
params = {}
args = shlex.split(' '.join(sys.argv))
print(args)
if('--kallisto' in args):
index = args.index('--kallisto')
assert(index < len(args)), \
'--kallisto option requires a path'
kallisto_path = args[in... | [
"sys.argv.remove",
"os.path.exists",
"setuptools.find_packages",
"json.dumps"
] | [((337, 366), 'os.path.exists', 'os.path.exists', (['kallisto_path'], {}), '(kallisto_path)\n', (351, 366), False, 'import os\n'), ((459, 488), 'sys.argv.remove', 'sys.argv.remove', (['"""--kallisto"""'], {}), "('--kallisto')\n", (474, 488), False, 'import sys\n'), ((490, 520), 'sys.argv.remove', 'sys.argv.remove', (['... |
"""Supporting definitions for the Python regression tests."""
import sys
HOST = 'localhost'
class Error(Exception):
"""Base class for regression test exceptions."""
class TestFailed(Error):
"""Test failed."""
class TestSkipped(Error):
"""Test skipped.
This can be raised to indicate that a test was... | [
"sys.platform.startswith",
"os.unlink",
"socket.socket",
"sys.exc_info",
"locale.setlocale",
"os.path.join",
"doctest.testmod",
"os.waitpid",
"os.path.dirname",
"os.path.exists",
"unittest.makeSuite",
"sys.getfilesystemencoding",
"unittest.TestSuite",
"re.match",
"sys._getframe",
"time... | [((8785, 8816), 'sys.platform.startswith', 'sys.platform.startswith', (['"""java"""'], {}), "('java')\n", (8808, 8816), False, 'import sys\n'), ((6727, 6758), 'socket.socket', 'socket.socket', (['family', 'socktype'], {}), '(family, socktype)\n', (6740, 6758), False, 'import socket, errno\n'), ((11748, 11767), 'os.path... |
import argparse
import sys
from typing import Optional
from typing import Sequence
import toml
def main(argv: Optional[Sequence[str]] = None) -> int:
parser = argparse.ArgumentParser()
parser.add_argument('filenames', nargs='*', help='Filenames to check.')
args = parser.parse_args(argv)
retval = 0
... | [
"toml.load",
"argparse.ArgumentParser"
] | [((166, 191), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (189, 191), False, 'import argparse\n'), ((433, 456), 'toml.load', 'toml.load', (['file_handler'], {}), '(file_handler)\n', (442, 456), False, 'import toml\n')] |
import os
class Domain(object):
def __init__(self, api_client):
self.api_client = api_client
def import_domain(self, url):
data = {'domain': os.path.basename(url), 'location': url}
self.api_client.session.post(self.api_client.get_server() + '/users/' +
... | [
"os.path.basename"
] | [((169, 190), 'os.path.basename', 'os.path.basename', (['url'], {}), '(url)\n', (185, 190), False, 'import os\n')] |
from web3.auto import w3
from json import loads
from os.path import dirname, abspath
def init():
path = dirname(dirname(dirname(abspath(__file__))))
all_address_path = path + '/test/address.json'
all_address = loads(open(all_address_path).read())
dapp_hub_abi_path = path + '/build/contracts/DappHub.j... | [
"web3.auto.w3.eth.contract",
"os.path.abspath"
] | [((1201, 1275), 'web3.auto.w3.eth.contract', 'w3.eth.contract', ([], {'address': "all_address['DappHub']", 'abi': 'contract_dapp_hub_abi'}), "(address=all_address['DappHub'], abi=contract_dapp_hub_abi)\n", (1216, 1275), False, 'from web3.auto import w3\n'), ((1311, 1398), 'web3.auto.w3.eth.contract', 'w3.eth.contract',... |
import math
import metrics.util
class Sc2MetricAnalyzer(object):
"""A class that derives useful metrics from replay files
This class is an extension to the ``sc2reader`` player class. It is meant
to be used to offer useful metric data to each player in a Starcraft II replay.
The class co... | [
"math.log"
] | [((5911, 5932), 'math.log', 'math.log', (['avg_unspent'], {}), '(avg_unspent)\n', (5919, 5932), False, 'import math\n')] |
from django.db import models
# Create your models here.
class Cases(models.Model):
title = models.CharField(max_length=126)
| [
"django.db.models.CharField"
] | [((97, 129), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(126)'}), '(max_length=126)\n', (113, 129), False, 'from django.db import models\n')] |
from authors.base_test_config import TestUsingLoggedInUser
from .test_config import TestConfig
from django.urls import reverse
from rest_framework import status
from authors.response import RESPONSE
class TestArticles(TestUsingLoggedInUser, TestConfig):
"""
test suite for creation for articles
"""
de... | [
"django.urls.reverse"
] | [((400, 419), 'django.urls.reverse', 'reverse', (['"""articles"""'], {}), "('articles')\n", (407, 419), False, 'from django.urls import reverse\n'), ((2010, 2029), 'django.urls.reverse', 'reverse', (['"""articles"""'], {}), "('articles')\n", (2017, 2029), False, 'from django.urls import reverse\n')] |
#######################################################
#This script is for evaluating for the task of SLR #
#######################################################
import argparse
import time
import collections
import os
import sys
import torch
import torch.nn
from torch.autograd import Variable
import torch.nn a... | [
"argparse.ArgumentParser",
"progressbar.Percentage",
"torch.device",
"os.path.join",
"_pickle.load",
"torch.load",
"os.path.exists",
"progressbar.Bar",
"dataloader_slr.loader",
"tensorflow.compat.v1.sparse.to_dense",
"utils.Batch",
"datetime.datetime.now",
"cv2.resize",
"torch.mean",
"tr... | [((997, 1024), 'tensorflow.compat.v1.enable_eager_execution', 'tf.enable_eager_execution', ([], {}), '()\n', (1022, 1024), True, 'import tensorflow.compat.v1 as tf\n'), ((1070, 1119), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Evaluation"""'}), "(description='Evaluation')\n", (1093, ... |
"""
Test program for Data Bootcamp course.
Repository of materials (including this file):
* https://github.com/DaveBackus/Data_Bootcamp/
* https://github.com/DaveBackus/Data_Bootcamp/Code/Python
Written by <NAME>, March 2015
Created with Python 3.4
"""
print('\nWelcome to Data Bootcamp!')
import datetime
print('Toda... | [
"os.getcwd",
"datetime.date.today",
"sys.exit"
] | [((329, 350), 'datetime.date.today', 'datetime.date.today', ([], {}), '()\n', (348, 350), False, 'import datetime\n'), ((710, 721), 'sys.exit', 'sys.exit', (['(0)'], {}), '(0)\n', (718, 721), False, 'import sys\n'), ((914, 925), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (923, 925), False, 'import os\n')] |
# Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | [
"argparse.ArgumentParser",
"paddle.load",
"paddle.reshape",
"paddle.argmax",
"sklearn.metrics.classification_report",
"numpy.array",
"yaml.safe_load",
"paddle.set_device",
"paddle.io.DataLoader",
"sklearn.metrics.precision_recall_fscore_support"
] | [((1357, 1436), 'sklearn.metrics.precision_recall_fscore_support', 'precision_recall_fscore_support', (['y_test', 'y_pred'], {'average': 'None', 'labels': '[1, 2, 3]'}), '(y_test, y_pred, average=None, labels=[1, 2, 3])\n', (1388, 1436), False, 'from sklearn.metrics import precision_recall_fscore_support\n'), ((1460, 1... |
import os
import glob
from segmentation import *
from utils.image_io import prepare_image
import numpy as np
from cv2.ximgproc import guidedFilter
from matplotlib import pyplot as plt
from _utils import *
image_dir = '../double_dip/images'
prior_hint_dir_fg = '../double_dip/saliency/output_fg'
prior_hint_dir_bg = '... | [
"matplotlib.pyplot.title",
"numpy.zeros_like",
"os.path.join",
"matplotlib.pyplot.plot",
"os.path.basename",
"matplotlib.pyplot.legend",
"os.system",
"matplotlib.pyplot.figure",
"numpy.array",
"glob.glob",
"matplotlib.pyplot.subplots"
] | [((1711, 1738), 'glob.glob', 'glob.glob', (["(image_dir + '/*')"], {}), "(image_dir + '/*')\n", (1720, 1738), False, 'import glob\n'), ((486, 514), 'os.system', 'os.system', (['"""rm -rf output/*"""'], {}), "('rm -rf output/*')\n", (495, 514), False, 'import os\n'), ((787, 801), 'matplotlib.pyplot.subplots', 'plt.subpl... |
#coding:utf-8
import os
import json
import torch
from dense_coattn.utils import (AverageMeter, Initializer, StopwatchMeter,
TimeMeter, extract_statedict, move_to_cuda,
save_checkpoint)
def evalEpoch(epoch, dataloader, model, criterion, opt, writer):
... | [
"dense_coattn.utils.AverageMeter",
"torch.sort",
"dense_coattn.utils.move_to_cuda",
"torch.set_grad_enabled"
] | [((322, 351), 'torch.set_grad_enabled', 'torch.set_grad_enabled', (['(False)'], {}), '(False)\n', (344, 351), False, 'import torch\n'), ((382, 396), 'dense_coattn.utils.AverageMeter', 'AverageMeter', ([], {}), '()\n', (394, 396), False, 'from dense_coattn.utils import AverageMeter, Initializer, StopwatchMeter, TimeMete... |
import json
import pickle
import sys
from datetime import datetime
from json import JSONEncoder
import numpy as np
import pandas as pd
import watchdog.events
import watchdog.observers
import time
import tensorflow as tf
import configparser
import os
from kafka import KafkaProducer
tf.compat.v1.logging.set_verbosity(t... | [
"sys.path.append",
"tensorflow.python.keras.models.load_model",
"warnings.filterwarnings",
"pandas.merge",
"numpy.asarray",
"kafka.KafkaProducer",
"json.dumps",
"time.time",
"time.sleep",
"numpy.append",
"datetime.datetime.now",
"tensorflow.compat.v1.logging.set_verbosity",
"numpy.array",
... | [((284, 346), 'tensorflow.compat.v1.logging.set_verbosity', 'tf.compat.v1.logging.set_verbosity', (['tf.compat.v1.logging.ERROR'], {}), '(tf.compat.v1.logging.ERROR)\n', (318, 346), True, 'import tensorflow as tf\n'), ((402, 438), 'sys.path.append', 'sys.path.append', (["(sys.path[0] + '/..')"], {}), "(sys.path[0] + '/... |
import os
import json
import pandas as pd
import gzip
from methods import sanitize
from datetime import datetime
from config import DOCUMENT_INDEX
from methods.tweets import tweet_parser, tweet_to_namedtuple
from db.elastic import Elastic
class Fill:
def __init__(self):
self.keywords = self.set_keywords(... | [
"gzip.open",
"json.loads",
"methods.tweets.tweet_parser",
"datetime.datetime",
"pandas.read_excel",
"methods.sanitize.clean_text",
"db.elastic.Elastic"
] | [((340, 349), 'db.elastic.Elastic', 'Elastic', ([], {}), '()\n', (347, 349), False, 'from db.elastic import Elastic\n'), ((392, 447), 'pandas.read_excel', 'pd.read_excel', (['"""input/twitter_supported_languages.xlsx"""'], {}), "('input/twitter_supported_languages.xlsx')\n", (405, 447), True, 'import pandas as pd\n'), ... |
# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | [
"unittest.main",
"mock.patch.object",
"tradefed_cluster.host_event_api.HostEventApi",
"mock.call",
"tradefed_cluster.datastore_entities.DeviceInfo.query",
"tradefed_cluster.host_event_api.chunks",
"tradefed_cluster.services.task_scheduler.RunCallableTask",
"tradefed_cluster.host_event.HostEvent",
"t... | [((5507, 5559), 'mock.patch.object', 'mock.patch.object', (['task_scheduler', '"""AddCallableTask"""'], {}), "(task_scheduler, 'AddCallableTask')\n", (5524, 5559), False, 'import mock\n'), ((6344, 6408), 'mock.patch.object', 'mock.patch.object', (['device_manager', '"""HandleDeviceSnapshotWithNDB"""'], {}), "(device_ma... |
import unittest
from tilecloud import Bounds
class TestBounds(unittest.TestCase):
def test_empty(self) -> None:
bounds = Bounds()
assert len(bounds) == 0
assert 1 not in bounds
self.assertRaises(StopIteration, next, iter(bounds))
assert bounds == bounds
def test_init_... | [
"tilecloud.Bounds"
] | [((136, 144), 'tilecloud.Bounds', 'Bounds', ([], {}), '()\n', (142, 144), False, 'from tilecloud import Bounds\n'), ((365, 374), 'tilecloud.Bounds', 'Bounds', (['(1)'], {}), '(1)\n', (371, 374), False, 'from tilecloud import Bounds\n'), ((475, 487), 'tilecloud.Bounds', 'Bounds', (['(1)', '(3)'], {}), '(1, 3)\n', (481, ... |
import sys
from rich import print
import pytorch_lightning as pl
from argparse import ArgumentParser
from data_modules import get_data_module
from networks_modules import Conv2, Conv4, Conv6
from pytorch_lightning.loggers import TensorBoardLogger
from pytorch_lightning.callbacks.early_stopping import EarlyStopping
from... | [
"data_modules.get_data_module",
"argparse.ArgumentParser",
"rich.print",
"pytorch_lightning.callbacks.model_checkpoint.ModelCheckpoint",
"pytorch_lightning.callbacks.progress.rich_progress.RichProgressBar",
"pytorch_lightning.loggers.TensorBoardLogger",
"pytorch_lightning.callbacks.early_stopping.EarlyS... | [((510, 526), 'argparse.ArgumentParser', 'ArgumentParser', ([], {}), '()\n', (524, 526), False, 'from argparse import ArgumentParser\n'), ((2676, 2689), 'rich.print', 'print', (['config'], {}), '(config)\n', (2681, 2689), False, 'from rich import print\n'), ((2741, 2764), 'data_modules.get_data_module', 'get_data_modul... |
from setuptools import setup, find_packages
import codegrapher
setup(
name='codegrapher',
version=codegrapher.__version__,
description='Code that graphs code',
url='http://github.com/LaurEars/codegrapher',
author='<NAME>',
author_email='<EMAIL>',
packages=find_packages(),
include_pack... | [
"setuptools.find_packages"
] | [((287, 302), 'setuptools.find_packages', 'find_packages', ([], {}), '()\n', (300, 302), False, 'from setuptools import setup, find_packages\n')] |
# Generated by Django 2.1.4 on 2020-05-03 15:54
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Movie',
fields=[
('id', models.IntegerField... | [
"django.db.models.TextField",
"django.db.models.URLField",
"django.db.models.CharField",
"django.db.models.SlugField",
"django.db.models.IntegerField"
] | [((301, 355), 'django.db.models.IntegerField', 'models.IntegerField', ([], {'primary_key': '(True)', 'serialize': '(False)'}), '(primary_key=True, serialize=False)\n', (320, 355), False, 'from django.db import migrations, models\n'), ((383, 415), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(1... |
import logging
import sys
from reconcile.utils import gql
from reconcile.utils import expiration
from reconcile.utils.aggregated_list import (AggregatedList,
AggregatedDiffRunner,
RunnerException)
from reconcile.quay_base import... | [
"logging.error",
"logging.debug",
"reconcile.utils.aggregated_list.RunnerException",
"reconcile.utils.gql.get_api",
"logging.warning",
"reconcile.utils.aggregated_list.AggregatedDiffRunner",
"logging.info",
"reconcile.utils.aggregated_list.AggregatedList",
"reconcile.quay_base.get_quay_api_store",
... | [((1355, 1371), 'reconcile.utils.aggregated_list.AggregatedList', 'AggregatedList', ([], {}), '()\n', (1369, 1371), False, 'from reconcile.utils.aggregated_list import AggregatedList, AggregatedDiffRunner, RunnerException\n'), ((2310, 2323), 'reconcile.utils.gql.get_api', 'gql.get_api', ([], {}), '()\n', (2321, 2323), ... |
# Compatibility Python 2/3
from __future__ import division, print_function, absolute_import
from builtins import range
# ----------------------------------------------------------------------------------------------------------------------
import sys
import scipyplot.log as log
import matplotlib.pyplot as plt
def sa... | [
"scipyplot.log.cnd_msg",
"matplotlib.pyplot.gcf",
"sys.exc_info",
"scipyplot.log.cnd_status"
] | [((342, 351), 'matplotlib.pyplot.gcf', 'plt.gcf', ([], {}), '()\n', (349, 351), True, 'import matplotlib.pyplot as plt\n'), ((602, 688), 'scipyplot.log.cnd_msg', 'log.cnd_msg', (['verbosity', '(0)', "('Saving to file: ' + fullNameFile)"], {'indent_depth': 'indent'}), "(verbosity, 0, 'Saving to file: ' + fullNameFile, i... |
# -*- coding: utf-8 -*-
#---------------------------------------------------------------------------
# Copyright 2020 VMware, Inc. All rights reserved.
# AUTO GENERATED FILE -- DO NOT MODIFY!
#
# vAPI stub file for package com.vmware.nsx.fabric.
#-----------------------------------------------------------------------... | [
"vmware.vapi.bindings.stub.ApiInterfaceStub.__init__",
"vmware.vapi.bindings.type.StringType",
"vmware.vapi.bindings.type.BooleanType",
"vmware.vapi.bindings.type.StructType",
"vmware.vapi.bindings.type.ReferenceType",
"vmware.vapi.bindings.type.VoidType",
"vmware.vapi.bindings.type.IntegerType",
"vmw... | [((1475, 1550), 'vmware.vapi.bindings.stub.VapiInterface.__init__', 'VapiInterface.__init__', (['self', 'config', '_ComputeCollectionFabricTemplatesStub'], {}), '(self, config, _ComputeCollectionFabricTemplatesStub)\n', (1497, 1550), False, 'from vmware.vapi.bindings.stub import ApiInterfaceStub, StubFactoryBase, VapiI... |
'''
Created on Oct 5, 2016
@author: theo
'''
from django.core.management.base import BaseCommand
from django.contrib.auth.models import User
from optparse import make_option
from django.contrib.gis.geos import Point
from django.utils import timezone
from django.conf import settings
from dateutil import parser
import ... | [
"dateutil.parser.parse",
"acacia.data.models.ProjectLocatie.objects.all",
"os.path.basename",
"iom.models.Meetpunt.objects.get",
"optparse.make_option",
"xlrd.open_workbook",
"iom.models.Waarnemer.objects.get_or_create",
"re.search",
"iom.models.Alias.objects.get",
"os.path.join",
"logging.getLo... | [((595, 622), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (612, 622), False, 'import json, logging\n'), ((881, 914), 'iom.models.Alias.objects.get', 'Alias.objects.get', ([], {'alias': 'akvoname'}), '(alias=akvoname)\n', (898, 914), False, 'from iom.models import AkvoFlow, CartoDb, Mee... |
import match_transactions
if __name__ == "__main__":
match_transactions.main()
| [
"match_transactions.main"
] | [((58, 83), 'match_transactions.main', 'match_transactions.main', ([], {}), '()\n', (81, 83), False, 'import match_transactions\n')] |
# Generated by Django 3.2.8 on 2021-11-07 20:47
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('dsaii', '0010_auto_20211108_0215'),
]
operations = [
migrations.AddField(
model_name='event',
name='date',
... | [
"django.db.models.CharField"
] | [((329, 388), 'django.db.models.CharField', 'models.CharField', ([], {'default': '"""Enter date here"""', 'max_length': '(255)'}), "(default='Enter date here', max_length=255)\n", (345, 388), False, 'from django.db import migrations, models\n')] |
import os
import sys
import numpy as np
import pandas as pd
import logging
import gc
import tqdm
import pickle
import time
gc.enable()
cwd = os.getcwd()
train_path = os.path.join(cwd, 'train_artifact')
test_path = os.path.join(cwd, 'test_artifact')
input_path = os.path.join(cwd, 'input_artifact')
embed_path = os.path... | [
"os.mkdir",
"numpy.load",
"numpy.save",
"pickle.dump",
"os.path.join",
"logging.FileHandler",
"os.getcwd",
"os.path.isdir",
"logging.StreamHandler",
"time.ctime",
"logging.Formatter",
"pickle.load",
"gc.enable",
"logging.getLogger"
] | [((125, 136), 'gc.enable', 'gc.enable', ([], {}), '()\n', (134, 136), False, 'import gc\n'), ((143, 154), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (152, 154), False, 'import os\n'), ((168, 203), 'os.path.join', 'os.path.join', (['cwd', '"""train_artifact"""'], {}), "(cwd, 'train_artifact')\n", (180, 203), False, 'im... |
from typing import Union, List, Dict, Optional, Callable, Set
from skdecide.builders.solver.policy import DeterministicPolicies, UncertainPolicies
from skdecide import Domain, Solver
from skdecide.builders.scheduling.modes import SingleMode
from skdecide.builders.scheduling.scheduling_domains_modelling import State, Sc... | [
"numpy.sum",
"numpy.mean",
"scipy.stats.kendalltau",
"deap.tools.HallOfFame",
"deap.base.Toolbox",
"numpy.max",
"skdecide.builders.discrete_optimization.rcpsp.solver.cpm.CPM",
"skdecide.hub.solver.do_solver.sk_to_do_binding.build_do_domain",
"deap.algorithms.eaSimple",
"numpy.median",
"operator.... | [((3338, 3353), 'numpy.mean', 'np.mean', (['values'], {}), '(values)\n', (3345, 3353), True, 'import numpy as np\n'), ((3576, 3590), 'numpy.min', 'np.min', (['values'], {}), '(values)\n', (3582, 3590), True, 'import numpy as np\n'), ((4153, 4167), 'numpy.max', 'np.max', (['values'], {}), '(values)\n', (4159, 4167), Tru... |
from setuptools import setup, find_packages
from codecs import open
from os import path
here = path.abspath(path.dirname(__file__))
with open(path.join(here, 'README.md'), encoding='utf-8') as f:
long_description = f.read()
setup(
name='Classifying Personality of a Person Based On Users Twitter Data',
ve... | [
"os.path.dirname",
"os.path.join",
"setuptools.setup"
] | [((231, 1279), 'setuptools.setup', 'setup', ([], {'name': '"""Classifying Personality of a Person Based On Users Twitter Data"""', 'version': '"""1.0.0"""', 'install_requires': "['pandas >= 1.0.2', 'pickleshare >= 0.7.5', 'numpy >= 1.17.2',\n 'scikit-learn >= 0.21.3', 'nltk >= 3.4.5', 'tweepy >= 3.8.0',\n 'unicod... |
from sys import stderr
import HelperFunctions
from HttpRequest import HttpRequest
from Reading import Reading
from dotenv import load_dotenv
import Adafruit_DHT
DHT_SENSOR = Adafruit_DHT.DHT22
DHT_PIN = 4
load_dotenv()
while True:
humidity, temperature = Adafruit_DHT.read_retry(DHT_SENSOR, DHT_PIN)
temperatu... | [
"HelperFunctions.convert_humidity",
"HelperFunctions.wait",
"Adafruit_DHT.read_retry",
"dotenv.load_dotenv",
"HttpRequest.HttpRequest",
"HelperFunctions.convert_temp",
"Reading.Reading"
] | [((207, 220), 'dotenv.load_dotenv', 'load_dotenv', ([], {}), '()\n', (218, 220), False, 'from dotenv import load_dotenv\n'), ((262, 306), 'Adafruit_DHT.read_retry', 'Adafruit_DHT.read_retry', (['DHT_SENSOR', 'DHT_PIN'], {}), '(DHT_SENSOR, DHT_PIN)\n', (285, 306), False, 'import Adafruit_DHT\n'), ((325, 366), 'HelperFun... |
from __future__ import absolute_import
import six
from datetime import datetime
from sentry.testutils import APITestCase
class GroupEventsOldestTest(APITestCase):
def test_simple(self):
self.login_as(user=self.user)
group = self.create_group()
event_1 = self.create_event(
e... | [
"six.text_type",
"datetime.datetime"
] | [((767, 792), 'six.text_type', 'six.text_type', (['event_1.id'], {}), '(event_1.id)\n', (780, 792), False, 'import six\n'), ((379, 410), 'datetime.datetime', 'datetime', (['(2013)', '(8)', '(13)', '(3)', '(8)', '(25)'], {}), '(2013, 8, 13, 3, 8, 25)\n', (387, 410), False, 'from datetime import datetime\n'), ((521, 552)... |
from objreader import read_obj
class SceneDescription:
def __init__(self):
self.meshes = {}
self.light_pos = (5, 5, 5)
self.light_intensity = 100
def import_mesh(self, filename):
mesh = read_obj(filename)
if mesh is not None:
self.meshes[mesh.name] = mesh
| [
"objreader.read_obj"
] | [((230, 248), 'objreader.read_obj', 'read_obj', (['filename'], {}), '(filename)\n', (238, 248), False, 'from objreader import read_obj\n')] |
# Copyright 2017 loblab
#
# 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, ... | [
"RPi.GPIO.setup",
"time.time",
"RPi.GPIO.wait_for_edge",
"time.sleep",
"RPi.GPIO.input",
"RPi.GPIO.output"
] | [((698, 726), 'RPi.GPIO.setup', 'GPIO.setup', (['pin_tx', 'GPIO.OUT'], {}), '(pin_tx, GPIO.OUT)\n', (708, 726), True, 'import RPi.GPIO as GPIO\n'), ((786, 813), 'RPi.GPIO.output', 'GPIO.output', (['self.pin_tx', '(1)'], {}), '(self.pin_tx, 1)\n', (797, 813), True, 'import RPi.GPIO as GPIO\n'), ((845, 872), 'RPi.GPIO.ou... |
import os, sys, subprocess
os.environ["OMP_NUM_THREADS"] = "1"
env = "starcraft"
# seeds = [1, 2, 3, 4, 5, 6, 7, 8, 9, 0]
# seeds = [1, 2, 3, 4, 5]
seeds = [777]
# seeds = [20]
# your models, graphs and tensorboard logs would be save in trained_models/{exp_name}
methods = ['baseline']
pretrain_exp_name = ''
# for soft... | [
"os.path.exists",
"os.system"
] | [((2524, 2548), 'os.path.exists', 'os.path.exists', (['log_path'], {}), '(log_path)\n', (2538, 2548), False, 'import os, sys, subprocess\n'), ((2777, 2814), 'os.system', 'os.system', (["(run_str + f'--seed {seed}')"], {}), "(run_str + f'--seed {seed}')\n", (2786, 2814), False, 'import os, sys, subprocess\n')] |
"""tldextract integration tests."""
import pytest
import tldextract
def test_bad_kwargs():
with pytest.raises(ValueError):
tldextract.TLDExtract(
cache_dir=None, suffix_list_urls=(), fallback_to_snapshot=False
)
| [
"pytest.raises",
"tldextract.TLDExtract"
] | [((104, 129), 'pytest.raises', 'pytest.raises', (['ValueError'], {}), '(ValueError)\n', (117, 129), False, 'import pytest\n'), ((139, 229), 'tldextract.TLDExtract', 'tldextract.TLDExtract', ([], {'cache_dir': 'None', 'suffix_list_urls': '()', 'fallback_to_snapshot': '(False)'}), '(cache_dir=None, suffix_list_urls=(),\n... |
import pytest
import gevent
import logging
import time
from volttron.platform import get_services_core, jsonapi
from volttrontesting.utils.utils import get_rand_ip_and_port
from platform_driver.interfaces.modbus_tk.server import Server
from platform_driver.interfaces.modbus_tk.maps import Map, Catalog
from volttron.pl... | [
"platform_driver.interfaces.modbus_tk.maps.Catalog",
"pytest.fixture",
"volttron.platform.jsonapi.dumps",
"logging.getLogger",
"time.sleep",
"volttron.platform.get_services_core",
"volttrontesting.utils.utils.get_rand_ip_and_port",
"platform_driver.interfaces.modbus_tk.server.Server",
"gevent.sleep"... | [((383, 410), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (400, 410), False, 'import logging\n'), ((18842, 18872), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""module"""'}), "(scope='module')\n", (18856, 18872), False, 'import pytest\n'), ((20804, 20833), 'pytest.fixture', 'p... |
import datetime
import os
import pathlib
import functools
import mimetypes
from uuid import uuid4
from PIL import Image
import boto3
import botocore
import mimetypes
mimetypes.init()
from .celery import app, logger
from celery import group
from config import Config
S3_ENDPOINT = Config.S3_ENDPOINT
S3_ACCESS_KEY = Con... | [
"mimetypes.guess_type",
"mimetypes.init",
"pathlib.Path",
"PIL.Image.open"
] | [((166, 182), 'mimetypes.init', 'mimetypes.init', ([], {}), '()\n', (180, 182), False, 'import mimetypes\n'), ((1090, 1111), 'PIL.Image.open', 'Image.open', (['file_path'], {}), '(file_path)\n', (1100, 1111), False, 'from PIL import Image\n'), ((2671, 2694), 'pathlib.Path', 'pathlib.Path', (['file_path'], {}), '(file_p... |
#!/usr/bin/env python3
#
# Copyright (c) 2016-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same directory.
... | [
"os.kill",
"eden.cli.daemon.wait_for_shutdown"
] | [((1746, 1781), 'os.kill', 'os.kill', (['daemon_pid', 'signal.SIGKILL'], {}), '(daemon_pid, signal.SIGKILL)\n', (1753, 1781), False, 'import os\n'), ((1794, 1838), 'eden.cli.daemon.wait_for_shutdown', 'wait_for_shutdown', ([], {'pid': 'daemon_pid', 'timeout': '(5)'}), '(pid=daemon_pid, timeout=5)\n', (1811, 1838), Fals... |
import random
import torch
from allennlp.data.iterators import BasicIterator
from allennlp.data.token_indexers import SingleIdTokenIndexer, ELMoTokenCharactersIndexer
from allennlp.modules import Embedding, Elmo
from torch import nn
from utils import fever_db
import numpy as np
import os
import config
from data_util... | [
"torch.nn.Dropout",
"data_util.data_readers.fever_sselection_reader.SSelectorReader",
"flint.torch_util.auto_rnn",
"random.shuffle",
"torch.cat",
"allennlp.modules.Elmo",
"sentence_retrieval.sampler_for_nmodel.get_additional_list",
"utils.common.save_jsonl",
"utils.common.load_jsonl",
"torch.no_gr... | [((11483, 11506), 'torch.manual_seed', 'torch.manual_seed', (['seed'], {}), '(seed)\n', (11500, 11506), False, 'import torch\n'), ((12026, 12083), 'data_util.data_readers.fever_sselection_reader.SSelectorReader', 'SSelectorReader', ([], {'token_indexers': 'token_indexers', 'lazy': 'lazy'}), '(token_indexers=token_index... |
# -*- coding: utf-8 -*-
# author:liuxiaodong
# contact: <EMAIL>
# datetime:2021/7/16 10:55
# software: PyCharm
# python versions: Python3.7
# file: yolov5s
# license: (C)Copyright 2019-2021 liuxiaodong
import os
import matplotlib.pyplot as plt
from osgeo import ogr
def plot_point(point,symbol='ko',**kwargs):
x,y=... | [
"matplotlib.pyplot.show",
"osgeo.ogr.Open",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.axis",
"matplotlib.pyplot.gca",
"os.chdir"
] | [((1741, 1784), 'os.chdir', 'os.chdir', (['"""D:\\\\WorkSpace\\\\Aircarft_oiltank"""'], {}), "('D:\\\\WorkSpace\\\\Aircarft_oiltank')\n", (1749, 1784), False, 'import os\n'), ((1934, 1951), 'matplotlib.pyplot.axis', 'plt.axis', (['"""equal"""'], {}), "('equal')\n", (1942, 1951), True, 'import matplotlib.pyplot as plt\n... |
from django.contrib import admin
from django_loci.admin import ObjectLocationInline
from openwisp_utils.admin import TimeReadonlyAdminMixin
from .models import Device
class DeviceAdmin(TimeReadonlyAdminMixin, admin.ModelAdmin):
list_display = ('name', 'created', 'modified')
save_on_top = True
inlines = ... | [
"django.contrib.admin.site.register"
] | [((345, 385), 'django.contrib.admin.site.register', 'admin.site.register', (['Device', 'DeviceAdmin'], {}), '(Device, DeviceAdmin)\n', (364, 385), False, 'from django.contrib import admin\n')] |
import argparse
from pytube import Playlist
# Script downloads the videos in the place that the script runs
# Parse arguments for the playlist
parser = argparse.ArgumentParser()
parser.add_argument("url",type=str)
args = parser.parse_args()
URL = args.url
# Defines playlist as python object
playlist = Playlist(URL)... | [
"argparse.ArgumentParser",
"pytube.Playlist"
] | [((154, 179), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (177, 179), False, 'import argparse\n'), ((307, 320), 'pytube.Playlist', 'Playlist', (['URL'], {}), '(URL)\n', (315, 320), False, 'from pytube import Playlist\n')] |
import json
import os
import jsonschema
from jsonschema import ValidationError
from traitlets.config import LoggingConfigurable
root = os.path.dirname(__file__)
class SchemaMismatchError(Exception):
def __init__(self, message, actual_version, expected_version):
super(SchemaMismatchError, self).__init_... | [
"jsonschema.validate",
"os.path.dirname"
] | [((138, 163), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (153, 163), False, 'import os\n'), ((2030, 2089), 'jsonschema.validate', 'jsonschema.validate', (["cell.metadata['nbgrader']", 'self.schema'], {}), "(cell.metadata['nbgrader'], self.schema)\n", (2049, 2089), False, 'import jsonschem... |
# Generated by Django 1.11.14 on 2019-03-28 12:39
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('tourism', '0004_auto_20190322_1908'),
]
operations = [
migrations.AlterField(
model_name='touristiccontent',
name=... | [
"django.db.models.ManyToManyField"
] | [((347, 516), 'django.db.models.ManyToManyField', 'models.ManyToManyField', ([], {'blank': '(True)', 'db_table': '"""t_r_contenu_touristique_type1"""', 'related_name': '"""contents1"""', 'to': '"""tourism.TouristicContentType1"""', 'verbose_name': '"""Type 1"""'}), "(blank=True, db_table='t_r_contenu_touristique_type1'... |
import sys
from setuptools import find_packages, setup
from setuptools.command.test import test as TestCommand
PACKAGE_TYPE = 'pg-tools'
PACKAGE_NAME = 'pg-export'
PACKAGE_DESC = 'pg to git converter'
PACKAGE_LONG_DESC = 'Convert postgres database to directory with object files'
PACKAGE_VERSION = '2.1.2'
class PyTe... | [
"shlex.split",
"setuptools.find_packages",
"sys.exit"
] | [((1018, 1033), 'sys.exit', 'sys.exit', (['errno'], {}), '(errno)\n', (1026, 1033), False, 'import sys\n'), ((2416, 2472), 'setuptools.find_packages', 'find_packages', ([], {'exclude': "['tests', 'examples', '.reports']"}), "(exclude=['tests', 'examples', '.reports'])\n", (2429, 2472), False, 'from setuptools import fi... |
from machin.utils.media import (
show_image, create_video, create_video_subproc,
create_image, create_image_subproc
)
from os.path import join
import os
import pytest
import numpy as np
@pytest.fixture(scope="function")
def images():
images = [
np.random.randint(0, 255, size=[128, 128], dtype=np.u... | [
"machin.utils.media.create_video_subproc",
"machin.utils.media.create_image",
"machin.utils.media.create_image_subproc",
"pytest.fixture",
"numpy.random.randint",
"numpy.random.rand",
"machin.utils.media.create_video",
"os.path.join",
"machin.utils.media.show_image"
] | [((197, 229), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""function"""'}), "(scope='function')\n", (211, 229), False, 'import pytest\n'), ((381, 413), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""function"""'}), "(scope='function')\n", (395, 413), False, 'import pytest\n'), ((565, 608), 'machin.util... |
#
# Copyright (c) 2021 <NAME> <<EMAIL>>
#
# SPDX-License-Identifier: Apache-2.0
#
import time
import pytest
from testlib import *
pd_cap = PDCapabilities([
(Capability.OutputControl, 1, 1),
(Capability.LEDControl, 1, 1),
(Capability.AudiableControl, 1, 1),
(Capability.TextOutput, 1, 1),
])
pd_info... | [
"pytest.fixture",
"time.sleep"
] | [((807, 851), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""module"""', 'autouse': '(True)'}), "(scope='module', autouse=True)\n", (821, 851), False, 'import pytest\n'), ((3496, 3511), 'time.sleep', 'time.sleep', (['(0.5)'], {}), '(0.5)\n', (3506, 3511), False, 'import time\n')] |
import pylast
import time
from platypush.message.response import Response
from .. import Plugin
class LastfmPlugin(Plugin):
def __init__(self, api_key, api_secret, username, password):
self.api_key = api_key
self.api_secret = api_secret
self.username = username
self.password = pas... | [
"platypush.message.response.Response",
"pylast.md5",
"time.time"
] | [((786, 796), 'platypush.message.response.Response', 'Response', ([], {}), '()\n', (794, 796), False, 'from platypush.message.response import Response\n'), ((1019, 1029), 'platypush.message.response.Response', 'Response', ([], {}), '()\n', (1027, 1029), False, 'from platypush.message.response import Response\n'), ((515... |
from mm2d.core.robot.description import (
BaseDescription,
LinkDescription,
JointDescription,
RobotDescription,
)
from mm2d.core.spatial import Transform
import mm2d.core.kinematics as kinematics
def three_link_robot():
base = BaseDescription("base", [], dofs=(0, 0, 0))
base.append(
Jo... | [
"mm2d.core.kinematics.KinematicModel",
"mm2d.core.spatial.Transform",
"mm2d.core.robot.description.BaseDescription",
"mm2d.core.robot.description.RobotDescription"
] | [((792, 823), 'mm2d.core.kinematics.KinematicModel', 'kinematics.KinematicModel', (['desc'], {}), '(desc)\n', (817, 823), True, 'import mm2d.core.kinematics as kinematics\n'), ((249, 292), 'mm2d.core.robot.description.BaseDescription', 'BaseDescription', (['"""base"""', '[]'], {'dofs': '(0, 0, 0)'}), "('base', [], dofs... |
# ###########################################################################
#
# CLOUDERA APPLIED MACHINE LEARNING PROTOTYPE (AMP)
# (C) Cloudera, Inc. 2020
# All rights reserved.
#
# Applicable Open Source License: Apache 2.0
#
# NOTE: Cloudera open source products are modular software products
# made up of hun... | [
"pandas.DataFrame",
"sts.data.loader.load_california_electricity_demand",
"numpy.exp",
"sts.models.prophet.seasonal_daily_prophet_model"
] | [((2318, 2354), 'sts.data.loader.load_california_electricity_demand', 'load_california_electricity_demand', ([], {}), '()\n', (2352, 2354), False, 'from sts.data.loader import load_california_electricity_demand\n'), ((2473, 2505), 'sts.models.prophet.seasonal_daily_prophet_model', 'seasonal_daily_prophet_model', (['df'... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Mรณdulo con el modelo del editor de texto.
Autor: <NAME> <<EMAIL>>.
"""
from __future__ import print_function
from text_editor_view import TextEditorDialogs
import codecs
import sys
import os
class TextEditorModel():
"""
Clase TextEditorModel: Modelo del edi... | [
"os.path.abspath",
"codecs.open",
"text_editor_view.TextEditorDialogs.show_info_message",
"os.path.join",
"os.listdir",
"text_editor_view.TextEditorDialogs.show_error_message"
] | [((3497, 3520), 'os.listdir', 'os.listdir', (['folder_path'], {}), '(folder_path)\n', (3507, 3520), False, 'import os\n'), ((2783, 2850), 'text_editor_view.TextEditorDialogs.show_info_message', 'TextEditorDialogs.show_info_message', (['u"""Fichero guardado con รฉxito!"""'], {}), "(u'Fichero guardado con รฉxito!')\n", (28... |
from django.test import TestCase
from .models import ResourceType, Book, Blog, Website, Meetup, Developer
from django.urls import reverse
from django.contrib.auth.models import User
import datetime
from .forms import WebsiteForm, MeetupForm, DeveloperForm, BookForm, BlogForm
# Testing Models:
# Test Resource... | [
"django.contrib.auth.models.User.objects.create",
"django.urls.reverse",
"django.contrib.auth.models.User.objects.create_user"
] | [((5520, 5583), 'django.contrib.auth.models.User.objects.create', 'User.objects.create', ([], {'username': '"""TestUser"""', 'password': '"""<PASSWORD>"""'}), "(username='TestUser', password='<PASSWORD>')\n", (5539, 5583), False, 'from django.contrib.auth.models import User\n'), ((6486, 6554), 'django.contrib.auth.mode... |
from .utils import needs_es, verify_es_response
from elasticsearch_dsl import Search, Q
from services.bitshares_elasticsearch_client import es
from datetime import datetime, timedelta
from services.cache import cache
@needs_es()
def get_account_history(
account_id=None,
operation_type=None,
f... | [
"datetime.datetime.utcnow",
"datetime.datetime.utcfromtimestamp",
"elasticsearch_dsl.Search",
"datetime.timedelta",
"services.cache.cache.memoize",
"elasticsearch_dsl.Q"
] | [((1560, 1575), 'services.cache.cache.memoize', 'cache.memoize', ([], {}), '()\n', (1573, 1575), False, 'from services.cache import cache\n'), ((3362, 3377), 'services.cache.cache.memoize', 'cache.memoize', ([], {}), '()\n', (3375, 3377), False, 'from services.cache import cache\n'), ((554, 591), 'elasticsearch_dsl.Sea... |
from __future__ import print_function
import argparse
import gzip
import json
import logging
import os
import traceback
import numpy as np
import tensorflow as tf
from tensorflow.keras import Model
from tensorflow.keras.layers import Conv2D, Dense, Flatten
logging.basicConfig(level=logging.DEBUG)
# Define the model... | [
"argparse.ArgumentParser",
"tensorflow.keras.layers.Dense",
"tensorflow.keras.metrics.Mean",
"numpy.mean",
"os.path.join",
"tensorflow.keras.layers.Flatten",
"tensorflow.keras.losses.SparseCategoricalCrossentropy",
"json.loads",
"numpy.std",
"os.path.exists",
"numpy.finfo",
"tensorflow.keras.o... | [((260, 300), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.DEBUG'}), '(level=logging.DEBUG)\n', (279, 300), False, 'import logging\n'), ((1832, 1868), 'numpy.mean', 'np.mean', (['x'], {'axis': 'axis', 'keepdims': '(True)'}), '(x, axis=axis, keepdims=True)\n', (1839, 1868), True, 'import numpy a... |
import pathlib
import numpy
import pytest
import helpers
import meshio
@pytest.mark.parametrize(
"mesh", [helpers.tri_mesh, helpers.quad_mesh, helpers.tri_quad_mesh]
)
def test_obj(mesh):
def writer(*args, **kwargs):
return meshio.obj.write(*args, **kwargs)
for k, c in enumerate(mesh.cells):
... | [
"numpy.sum",
"meshio.read",
"pathlib.Path",
"meshio.obj.write",
"pytest.mark.parametrize",
"helpers.write_read"
] | [((76, 173), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""mesh"""', '[helpers.tri_mesh, helpers.quad_mesh, helpers.tri_quad_mesh]'], {}), "('mesh', [helpers.tri_mesh, helpers.quad_mesh,\n helpers.tri_quad_mesh])\n", (99, 173), False, 'import pytest\n'), ((462, 565), 'pytest.mark.parametrize', 'pytest.... |
# This code is part of Qiskit.
#
# (C) Copyright IBM 2017, 2019.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivat... | [
"retworkx.generators.directed_grid_graph",
"scipy.sparse.csgraph.connected_components",
"retworkx.is_weakly_connected",
"qiskit.transpiler.exceptions.CouplingError",
"retworkx.digraph_distance_matrix",
"qiskit.exceptions.MissingOptionalLibraryError",
"retworkx.PyDiGraph",
"scipy.sparse.coo_matrix",
... | [((2012, 2026), 'retworkx.PyDiGraph', 'rx.PyDiGraph', ([], {}), '()\n', (2024, 2026), True, 'import retworkx as rx\n'), ((4287, 4533), 'warnings.warn', 'warnings.warn', (['"""The .subgraph() method is deprecated and will be removed in a future release. Instead the .reduce() method should be used instead which does the ... |
# pylint: disable=invalid-name, unused-variable, unused-argument
"""Schedule for binary dense operator."""
from __future__ import absolute_import as _abs
import tvm
from .. import tag
from .. import generic
@generic.schedule_binary_dense.register(["cpu"])
def schedule_binary_dense(outs):
"""Schedule for binary_de... | [
"tvm.create_schedule"
] | [((661, 702), 'tvm.create_schedule', 'tvm.create_schedule', (['[x.op for x in outs]'], {}), '([x.op for x in outs])\n', (680, 702), False, 'import tvm\n')] |
# -*- coding: utf-8 -*-
# Generated by Django 1.10 on 2017-01-12 11:25
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0010_auto_20170112_1124'),
]
operations = [
migrations.AlterField(
... | [
"django.db.models.FloatField"
] | [((398, 438), 'django.db.models.FloatField', 'models.FloatField', ([], {'blank': '(True)', 'null': '(True)'}), '(blank=True, null=True)\n', (415, 438), False, 'from django.db import migrations, models\n'), ((561, 601), 'django.db.models.FloatField', 'models.FloatField', ([], {'blank': '(True)', 'null': '(True)'}), '(bl... |
#!/usr/bin/env python
from __future__ import print_function
import os
import sys
chplenv_dir = os.path.join(os.path.dirname(__file__), '..')
sys.path.insert(0, os.path.abspath(chplenv_dir))
from chplenv import chpl_home_utils
from chplenv import chpl_platform
from chplenv import chpl_make
# Activate a virtualenv t... | [
"os.path.abspath",
"chplenv.chpl_platform.get",
"os.path.dirname",
"os.path.isfile",
"chplenv.chpl_home_utils.get_chpl_home",
"chplenv.chpl_make.get",
"os.path.join",
"os.getenv"
] | [((111, 136), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (126, 136), False, 'import os\n'), ((163, 191), 'os.path.abspath', 'os.path.abspath', (['chplenv_dir'], {}), '(chplenv_dir)\n', (178, 191), False, 'import os\n'), ((2923, 2972), 'os.path.join', 'os.path.join', (['venv_dir', '"""bin"... |
import numpy as np
import pandas as pd
import pytest
from rayml.data_checks import (
DataCheckActionCode,
DataCheckActionOption,
DataCheckMessageCode,
DataCheckWarning,
IDColumnsDataCheck,
)
id_data_check_name = IDColumnsDataCheck.name
def test_id_cols_data_check_init():
id_cols_check = IDCo... | [
"pandas.DataFrame",
"rayml.data_checks.DataCheckActionOption",
"pandas.DataFrame.from_dict",
"pytest.raises",
"numpy.array",
"rayml.data_checks.IDColumnsDataCheck"
] | [((316, 336), 'rayml.data_checks.IDColumnsDataCheck', 'IDColumnsDataCheck', ([], {}), '()\n', (334, 336), False, 'from rayml.data_checks import DataCheckActionCode, DataCheckActionOption, DataCheckMessageCode, DataCheckWarning, IDColumnsDataCheck\n'), ((403, 439), 'rayml.data_checks.IDColumnsDataCheck', 'IDColumnsDataC... |
"""Model for SetFee pseudo-transaction type."""
from dataclasses import dataclass, field
from typing import Optional
from xrpl.models.required import REQUIRED
from xrpl.models.transactions.pseudo_transactions.pseudo_transaction import (
PseudoTransaction,
)
from xrpl.models.transactions.types import PseudoTransac... | [
"dataclasses.field",
"dataclasses.dataclass"
] | [((409, 431), 'dataclasses.dataclass', 'dataclass', ([], {'frozen': '(True)'}), '(frozen=True)\n', (418, 431), False, 'from dataclasses import dataclass, field\n'), ((1547, 1603), 'dataclasses.field', 'field', ([], {'default': 'PseudoTransactionType.SET_FEE', 'init': '(False)'}), '(default=PseudoTransactionType.SET_FEE... |
# Generated by Django 3.1.4 on 2021-01-23 07:08
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('process', '0012_auto_20210123_1607'),
]
operations = [
migrations.AlterField(
model_name='process',
name='process',
... | [
"django.db.models.CharField"
] | [((338, 423), 'django.db.models.CharField', 'models.CharField', ([], {'blank': '(True)', 'max_length': '(16)', 'null': '(True)', 'verbose_name': '"""ๆๆฅใใจใ๏ผๆฅๅนณๅ"""'}), "(blank=True, max_length=16, null=True, verbose_name='ๆๆฅใใจใ๏ผๆฅๅนณๅ'\n )\n", (354, 423), False, 'from django.db import migrations, models\n')] |
#
# This file is part of Magnum.
#
# Copyright ยฉ 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019,
# 2020 <NAME> <<EMAIL>>
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal ... | [
"magnum.primitives.cube_solid",
"magnum.primitives.square_wireframe"
] | [((1530, 1559), 'magnum.primitives.square_wireframe', 'primitives.square_wireframe', ([], {}), '()\n', (1557, 1559), False, 'from magnum import gl, meshtools, primitives\n'), ((1718, 1741), 'magnum.primitives.cube_solid', 'primitives.cube_solid', ([], {}), '()\n', (1739, 1741), False, 'from magnum import gl, meshtools,... |
#!/usr/bin/env python
#-*- coding: utf-8 -*-
#pylint: disable=
# Author: <NAME> <<EMAIL>net AT gmail [DOT] com>
"""
Spark script to parse and aggregate DBS and PhEDEx records on HDFS.
"""
# system modules
import os
import re
import sys
import time
import json
# pyspark modules
from pyspark import SparkContext, Storag... | [
"pyspark.sql.SQLContext",
"CMSSpark.spark_utils.spark_context",
"pyspark.sql.functions.col",
"CMSSpark.spark_utils.phedex_summary_tables",
"CMSSpark.conf.OptionParser",
"pyspark.sql.types.IntegerType",
"time.strptime",
"CMSSpark.spark_utils.print_rows"
] | [((1624, 1659), 'CMSSpark.spark_utils.spark_context', 'spark_context', (['"""cms"""', 'yarn', 'verbose'], {}), "('cms', yarn, verbose)\n", (1637, 1659), False, 'from CMSSpark.spark_utils import spark_context, split_dataset\n'), ((1677, 1692), 'pyspark.sql.SQLContext', 'SQLContext', (['ctx'], {}), '(ctx)\n', (1687, 1692... |
from common import cache_request, to_list, diff_and_save
import re
from bs4 import BeautifulSoup
re_extra_spaces = re.compile(r'[^\S\n]+')
re_locale_address = re.compile(r'(?P<locale>\S([^\S\n]|\w)*\s*County)\s*Board of Elections\s*(?P<address>\S.*\d{5}(-\d+)?)\s*', flags=re.MULTILINE+re.DOTALL)
re_phone_line = re.co... | [
"bs4.BeautifulSoup",
"common.diff_and_save",
"common.cache_request",
"re.compile"
] | [((117, 141), 're.compile', 're.compile', (['"""[^\\\\S\\\\n]+"""'], {}), "('[^\\\\S\\\\n]+')\n", (127, 141), False, 'import re\n'), ((161, 320), 're.compile', 're.compile', (['"""(?P<locale>\\\\S([^\\\\S\\\\n]|\\\\w)*\\\\s*County)\\\\s*Board of Elections\\\\s*(?P<address>\\\\S.*\\\\d{5}(-\\\\d+)?)\\\\s*"""'], {'flags'... |
import tensorflow as tf
"""tf.polygamma(a,x,name=None)
ๅ่ฝ๏ผ่ฎก็ฎpsi^{(a)}(x),psi^{(a)}(x) = ({d^a}/{dx^a})*psi(x),psiๅณไธบpolygammaใ
่พๅ
ฅ๏ผxไธบๅผ ้๏ผๅฏไปฅไธบ`float32`, `float64`็ฑปๅใa=tf.constant(1,tf.float64) """
a = tf.constant(1, tf.float64)
x = tf.constant([[1, 2, 3, 4]], tf.float64)
z = tf.polygamma(a, x)
sess = tf.Session()
pri... | [
"tensorflow.Session",
"tensorflow.polygamma",
"tensorflow.constant"
] | [((202, 228), 'tensorflow.constant', 'tf.constant', (['(1)', 'tf.float64'], {}), '(1, tf.float64)\n', (213, 228), True, 'import tensorflow as tf\n'), ((233, 272), 'tensorflow.constant', 'tf.constant', (['[[1, 2, 3, 4]]', 'tf.float64'], {}), '([[1, 2, 3, 4]], tf.float64)\n', (244, 272), True, 'import tensorflow as tf\n'... |
from collections import OrderedDict
from pyramid.compat import bytes_
from pyramid.httpexceptions import HTTPBadRequest
from pyramid.view import view_config
from pyramid.response import Response
from snovault import TYPES
from collections import OrderedDict
from snovault.util import simple_path_ids
from urllib.parse im... | [
"pyramid.view.view_config",
"io.StringIO",
"csv.writer",
"urllib.parse.urlencode",
"pyramid.compat.bytes_",
"urllib.parse.parse_qs",
"snovault.util.simple_path_ids",
"collections.OrderedDict",
"pyramid.httpexceptions.HTTPBadRequest",
"logging.getLogger"
] | [((587, 614), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (604, 614), False, 'import logging\n'), ((1019, 4414), 'collections.OrderedDict', 'OrderedDict', (["[('File accession', ['files.title']), ('File format', ['files.file_type']),\n ('Output type', ['files.output_type']), ('Exper... |
# Test linked list
from app.linked_list import LinkedList
class TestLinkedList:
def test_initialize_ll(self):
ll = LinkedList(4)
assert ll.head.value == 4
assert ll.head.next is None
assert ll.tail.value == 4
assert ll.tail.next is None
assert ll.head is ll.tail
... | [
"app.linked_list.LinkedList"
] | [((130, 143), 'app.linked_list.LinkedList', 'LinkedList', (['(4)'], {}), '(4)\n', (140, 143), False, 'from app.linked_list import LinkedList\n'), ((361, 374), 'app.linked_list.LinkedList', 'LinkedList', (['(4)'], {}), '(4)\n', (371, 374), False, 'from app.linked_list import LinkedList\n'), ((500, 516), 'app.linked_list... |
# coding=utf-8
# Copyright 2022 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | [
"non_semantic_speech_benchmark.eval_embedding.sklearn.sklearn_utils.tfexamples_to_nps",
"numpy.random.seed",
"tensorflow.compat.v1.train.Example",
"absl.testing.absltest.get_default_test_tmpdir",
"tensorflow.compat.v1.python_io.TFRecordWriter",
"absl.testing.parameterized.parameters",
"tensorflow.compat... | [((999, 1085), 'absl.testing.parameterized.parameters', 'parameterized.parameters', (["{'l2_normalization': True}", "{'l2_normalization': False}"], {}), "({'l2_normalization': True}, {'l2_normalization': \n False})\n", (1023, 1085), False, 'from absl.testing import parameterized\n'), ((3382, 3396), 'tensorflow.compa... |
from __future__ import print_function
import random
import Pyro4
class GameServer(object):
def __init__(self, engine):
self.engine=engine
def register(self, name, observer):
robot=self.engine.signup_robot(name, observer)
self._pyroDaemon.register(robot) # make the robot a py... | [
"random.random",
"random.randint"
] | [((1052, 1067), 'random.random', 'random.random', ([], {}), '()\n', (1065, 1067), False, 'import random\n'), ((1089, 1104), 'random.random', 'random.random', ([], {}), '()\n', (1102, 1104), False, 'import random\n'), ((1134, 1155), 'random.randint', 'random.randint', (['(-1)', '(1)'], {}), '(-1, 1)\n', (1148, 1155), Fa... |
from gauss import Gauss
from square_roots import SquareRoots
from running import Running
from lt_rotation import LtRotation
from ui import UI
from termcolor import colored
import time
eps = 0.001
'''task 1'''
t1 = colored('TASK1', 'red')
print(t1)
a = [
[-54, -11, 40, 57, 80, -99, 29, 45, 22, 50],
[19, 40, 89... | [
"square_roots.SquareRoots",
"running.Running",
"gauss.Gauss",
"lt_rotation.LtRotation",
"time.time",
"termcolor.colored",
"ui.UI.print_slar"
] | [((216, 239), 'termcolor.colored', 'colored', (['"""TASK1"""', '"""red"""'], {}), "('TASK1', 'red')\n", (223, 239), False, 'from termcolor import colored\n'), ((699, 718), 'ui.UI.print_slar', 'UI.print_slar', (['a', '(9)'], {}), '(a, 9)\n', (712, 718), False, 'from ui import UI\n'), ((732, 743), 'time.time', 'time.time... |
# Generated by Django 3.1.3 on 2020-11-29 09:12
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("autotasks", "0008_auto_20201030_1515"),
]
operations = [
migrations.AddField(
model_name="automatedtask",
name="run_... | [
"django.db.models.IntegerField"
] | [((358, 400), 'django.db.models.IntegerField', 'models.IntegerField', ([], {'blank': '(True)', 'null': '(True)'}), '(blank=True, null=True)\n', (377, 400), False, 'from django.db import migrations, models\n')] |
# -*- encoding: utf-8 -*-
from django.shortcuts import render
from modules.forms import ModuleFilterForm
from modules.models import Module
# Create your views here.
def home(request):
module_filter_form = ModuleFilterForm(request.POST or None)
from_module = Module.objects.get(name='Entrada') #De momento sรณlo ... | [
"modules.forms.ModuleFilterForm",
"modules.models.Module.objects.filter",
"django.shortcuts.render",
"modules.models.Module.objects.get"
] | [((213, 251), 'modules.forms.ModuleFilterForm', 'ModuleFilterForm', (['(request.POST or None)'], {}), '(request.POST or None)\n', (229, 251), False, 'from modules.forms import ModuleFilterForm\n'), ((268, 302), 'modules.models.Module.objects.get', 'Module.objects.get', ([], {'name': '"""Entrada"""'}), "(name='Entrada')... |
# -*- coding: utf-8 -*-
# Resource object code
#
# Created by: The Resource Compiler for PyQt5 (Qt v5.15.2)
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore
qt_resource_data = b"\
\x00\x00\x01\x17\
\x3c\
\x73\x76\x67\x20\x78\x6d\x6c\x6e\x73\x3d\x22\x68\x74\x74\x70\x3a\
\x2f\x2f\x77\x... | [
"PyQt5.QtCore.qUnregisterResourceData",
"PyQt5.QtCore.qVersion",
"PyQt5.QtCore.qRegisterResourceData"
] | [((534471, 534572), 'PyQt5.QtCore.qRegisterResourceData', 'QtCore.qRegisterResourceData', (['rcc_version', 'qt_resource_struct', 'qt_resource_name', 'qt_resource_data'], {}), '(rcc_version, qt_resource_struct,\n qt_resource_name, qt_resource_data)\n', (534499, 534572), False, 'from PyQt5 import QtCore\n'), ((534599,... |
#!/usr/bin/env python
'''
------------------------------------------------------------------------------------------
Copyright 2020 <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 Licen... | [
"cgi.FieldStorage",
"theroom.makeUser"
] | [((999, 1017), 'cgi.FieldStorage', 'cgi.FieldStorage', ([], {}), '()\n', (1015, 1017), False, 'import cgi\n'), ((1310, 1387), 'theroom.makeUser', 'theroom.makeUser', (['gun', 'gpw'], {'acl': '(0)', 'fname': 'gfn', 'lname': 'gln', 'phone': 'gpn', 'email': 'gem'}), '(gun, gpw, acl=0, fname=gfn, lname=gln, phone=gpn, emai... |
import pandas as pd
import time
import sys
def df_parser(file) -> tuple:
"""
Returns df and name depending on file type
"""
extention = file.split('.')[1]
name = file.split('.')[0]
if extention == 'csv':
return pd.read_csv(file), name
elif extention == 'xlsx':
return pd.rea... | [
"pandas.DataFrame",
"pandas.read_csv",
"time.time",
"pandas.read_excel",
"pandas.read_sql"
] | [((1719, 1730), 'time.time', 'time.time', ([], {}), '()\n', (1728, 1730), False, 'import time\n'), ((245, 262), 'pandas.read_csv', 'pd.read_csv', (['file'], {}), '(file)\n', (256, 262), True, 'import pandas as pd\n'), ((2029, 2048), 'pandas.DataFrame', 'pd.DataFrame', (['mlst1'], {}), '(mlst1)\n', (2041, 2048), True, '... |
import discord
from discord import Colour, Embed
from discord.ext import commands
import re
import random
def replacement_func(match, repl_pattern):
match_str = match.group(0)
repl = ''.join([r_char if m_char.islower() else r_char.upper()
for r_char, m_char in zip(repl_pattern, match_str)])
... | [
"discord.ext.commands.command",
"random.choice"
] | [((498, 605), 'discord.ext.commands.command', 'commands.command', ([], {'name': '"""ebin"""', 'help': '"""Returns a spurdified version of the sentence passed as parameter"""'}), "(name='ebin', help=\n 'Returns a spurdified version of the sentence passed as parameter')\n", (514, 605), False, 'from discord.ext import ... |
import os
import unittest
from PIL import Image
from utils import getdrawer, abspath
from helper import assert_image_similar
class TestRankingScreen(unittest.TestCase):
@classmethod
def setUpClass(cls):
cls.tests = []
cls.update = False
cls.tests.append(getdrawer("", "syunn", (123123123, -1)))
cls.tests.a... | [
"unittest.main",
"utils.getdrawer",
"helper.assert_image_similar",
"PIL.Image.open"
] | [((1083, 1098), 'unittest.main', 'unittest.main', ([], {}), '()\n', (1096, 1098), False, 'import unittest\n'), ((266, 305), 'utils.getdrawer', 'getdrawer', (['""""""', '"""syunn"""', '(123123123, -1)'], {}), "('', 'syunn', (123123123, -1))\n", (275, 305), False, 'from utils import getdrawer, abspath\n'), ((326, 366), '... |
#!/usr/bin/env python
import os
import plynx
from setuptools import setup, find_packages
def parse_requirements(filename):
""" load requirements from a pip requirements file """
lineiter = (line.strip() for line in open(filename))
return [line for line in lineiter if line and not line.startswith("#")]
D... | [
"os.path.abspath",
"os.path.join",
"setuptools.find_packages"
] | [((341, 366), 'os.path.abspath', 'os.path.abspath', (['__file__'], {}), '(__file__)\n', (356, 366), False, 'import os\n'), ((406, 443), 'os.path.join', 'os.path.join', (['DIR', '"""requirements.txt"""'], {}), "(DIR, 'requirements.txt')\n", (418, 443), False, 'import os\n'), ((509, 550), 'os.path.join', 'os.path.join', ... |
import os
from flask import Flask, request, abort, jsonify, current_app
from bot import db
from bot import utils
from bot.directive import Directive
from bot.context import Context, PrivateContext, GroupContext
from apscheduler.schedulers.background import BackgroundScheduler
from .utils import send
def create_app(co... | [
"apscheduler.schedulers.background.BackgroundScheduler",
"os.mkdir",
"flask.jsonify",
"os.path.join",
"bot.utils.log",
"flask.request.headers.get",
"os.path.dirname",
"flask.abort",
"os.path.exists",
"bot.utils.randomly_save_message_to_treehole",
"bot.context.GroupContext.build",
"bot.utils.se... | [((342, 357), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (347, 357), False, 'from flask import Flask, request, abort, jsonify, current_app\n'), ((787, 808), 'bot.db.init_database', 'db.init_database', (['app'], {}), '(app)\n', (803, 808), False, 'from bot import db\n'), ((1065, 1086), 'apscheduler.sche... |
from setuptools import setup
setup(name='pyecoplug',
version='0.0.6',
description='Interface for the EcoPlug outlet',
url='http://github.com/philburr/pyecoplug',
author='<EMAIL>',
license='MIT',
packages=['pyecoplug'],
install_requires=[],
zip_safe=True)
| [
"setuptools.setup"
] | [((30, 269), 'setuptools.setup', 'setup', ([], {'name': '"""pyecoplug"""', 'version': '"""0.0.6"""', 'description': '"""Interface for the EcoPlug outlet"""', 'url': '"""http://github.com/philburr/pyecoplug"""', 'author': '"""<EMAIL>"""', 'license': '"""MIT"""', 'packages': "['pyecoplug']", 'install_requires': '[]', 'zi... |
import uuid
import urllib
from PyQt5 import uic, QtWidgets
from ..utils import ui
from ..utils.logging import error
from ..threads.load_api_data_thread import LoadAPIDataThread
from ..models.api import API
FORM_CLASS, _ = uic.loadUiType(ui.path('add_edit_api_dialog.ui'))
class AddEditAPIDialog(QtWidgets.QDialog, ... | [
"uuid.uuid4"
] | [((1427, 1439), 'uuid.uuid4', 'uuid.uuid4', ([], {}), '()\n', (1437, 1439), False, 'import uuid\n')] |
# Generated by Django 4.0.3 on 2022-03-15 15:56
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('animais', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='animal',
name='domestico',
... | [
"django.db.models.CharField"
] | [((326, 371), 'django.db.models.CharField', 'models.CharField', ([], {'default': '"""n/a"""', 'max_length': '(5)'}), "(default='n/a', max_length=5)\n", (342, 371), False, 'from django.db import migrations, models\n'), ((532, 578), 'django.db.models.CharField', 'models.CharField', ([], {'default': '"""n/a"""', 'max_leng... |
import json
from asgiref.sync import async_to_sync
from tornado.testing import AsyncHTTPTestCase
class TestUserRegistrationApi(AsyncHTTPTestCase):
def get_app(self):
from consoleme.config import config
config.CONFIG.config["auth"]["get_user_by_password"] = True
config.CONFIG.config["auth... | [
"consoleme.lib.dynamo.UserDynamoHandler",
"json.loads",
"json.dumps",
"consoleme.routes.make_app",
"consoleme.config.config.get",
"consoleme.models.LoginAttemptModel",
"asgiref.sync.async_to_sync"
] | [((419, 455), 'consoleme.routes.make_app', 'make_app', ([], {'jwt_validator': '(lambda x: {})'}), '(jwt_validator=lambda x: {})\n', (427, 455), False, 'from consoleme.routes import make_app\n'), ((725, 788), 'json.dumps', 'json.dumps', (["{'username': 'testuser5', 'password': '<PASSWORD>'}"], {}), "({'username': 'testu... |
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | [
"humanfriendly.Spinner"
] | [((3716, 3794), 'humanfriendly.Spinner', 'humanfriendly.Spinner', ([], {'label': '"""In Progress"""', 'stream': 'self.out', 'hide_cursor': '(False)'}), "(label='In Progress', stream=self.out, hide_cursor=False)\n", (3737, 3794), False, 'import humanfriendly\n')] |
import firebase_admin
from firebase_admin import credentials
default_app = firebase_admin.initialize_app()
cred = credentials.Certificate("serviceAccountKey.json")
firebase_admin.initialize_app(cred)
| [
"firebase_admin.initialize_app",
"firebase_admin.credentials.Certificate"
] | [((78, 109), 'firebase_admin.initialize_app', 'firebase_admin.initialize_app', ([], {}), '()\n', (107, 109), False, 'import firebase_admin\n'), ((118, 167), 'firebase_admin.credentials.Certificate', 'credentials.Certificate', (['"""serviceAccountKey.json"""'], {}), "('serviceAccountKey.json')\n", (141, 167), False, 'fr... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Minimal example of using pygimli to simulate the steady heat equation.
"""
import pygimli as pg
import pygimli.meshtools as mt
# Create geometry definition for the modelling domain
world = mt.createWorld(start=[-20, 0], end=[20, -16], layers=[-2, -8],
... | [
"pygimli.show",
"pygimli.meshtools.createRectangle",
"pygimli.meshtools.createMesh",
"pygimli.solver.solve",
"pygimli.meshtools.createWorld"
] | [((240, 326), 'pygimli.meshtools.createWorld', 'mt.createWorld', ([], {'start': '[-20, 0]', 'end': '[20, -16]', 'layers': '[-2, -8]', 'worldMarker': '(False)'}), '(start=[-20, 0], end=[20, -16], layers=[-2, -8], worldMarker=\n False)\n', (254, 326), True, 'import pygimli.meshtools as mt\n'), ((384, 478), 'pygimli.me... |
import requests_mock
import koji
import pytest
from koji_builder_kube import cli, errors
def test_session_setup_error_type():
with pytest.raises(errors.KojiError):
cli.session_setup({})
def test_session_setup_error_auth(fixtures_dir):
data = {
'serverca': f'{fixtures_dir}/ca.pem',
'cert': f'{fixtur... | [
"pytest.raises",
"koji_builder_kube.cli.session_setup",
"koji_builder_kube.cli.run"
] | [((791, 814), 'koji_builder_kube.cli.session_setup', 'cli.session_setup', (['data'], {}), '(data)\n', (808, 814), False, 'from koji_builder_kube import cli, errors\n'), ((1055, 1104), 'koji_builder_kube.cli.run', 'cli.run', (["['-c', f'{fixtures_dir}/kojid-ssl.conf']"], {}), "(['-c', f'{fixtures_dir}/kojid-ssl.conf'])\... |
import inspect
import itertools
class ParserRule(object):
"""
Describes a parser rule - that is, a production rule from the thinglang grammar
"""
COUNTER = itertools.count(0)
def __init__(self, constructor, pattern, predicate, index=None):
self.constructor, self.pattern, self.predicate, ... | [
"inspect.signature",
"itertools.count"
] | [((175, 193), 'itertools.count', 'itertools.count', (['(0)'], {}), '(0)\n', (190, 193), False, 'import itertools\n'), ((1460, 1483), 'inspect.signature', 'inspect.signature', (['func'], {}), '(func)\n', (1477, 1483), False, 'import inspect\n')] |
import os
from test import support
import unittest
# Skip tests if we don't have concurrent.futures.
support.import_module('concurrent.futures')
def load_tests(loader, _, pattern):
pkg_dir = os.path.dirname(__file__)
suite = AsyncioTestSuite()
return support.load_package_tests(pkg_dir, loader, suite, pat... | [
"test.support.clear_ignored_deprecations",
"os.path.dirname",
"test.support.import_module",
"test.support.load_package_tests"
] | [((102, 145), 'test.support.import_module', 'support.import_module', (['"""concurrent.futures"""'], {}), "('concurrent.futures')\n", (123, 145), False, 'from test import support\n'), ((198, 223), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (213, 223), False, 'import os\n'), ((266, 325), 't... |
from itertools import groupby
# ์์ถ ๋จ์๊ฐ n์ผ ๋, ์์ถ๋ ๋ฌธ์์ด์ ๊ธธ์ด(compressed string length)๋ฅผ ๋ฐํํ๋ ํจ์
def get_comp_str_len(s, n):
splited_str_list = [] # ๋ฌธ์์ด s๋ฅผ n๊ฐ ๋จ์๋ก ์๋ฅธ ๋ฌธ์์ด๋ค์ ์ ์ฅํ ๋ฐฐ์ด
compressed_str_list = [] # ์์ถ๋ ๋ฌธ์์ด์ ์ ์ฅํ ๋ฐฐ์ด
for i in range(0, len(s), n):
splited_str_list.append(s[i:i + n])
"""... | [
"itertools.groupby"
] | [((389, 414), 'itertools.groupby', 'groupby', (['splited_str_list'], {}), '(splited_str_list)\n', (396, 414), False, 'from itertools import groupby\n')] |
"""Test utils for rule generator scanners."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import yaml
from deploy.rule_generator import project_config
_OVERALL_DICT = {
'domain': 'domain.com',
'organization_id': '246801357924',
'folder_id'... | [
"deploy.rule_generator.project_config.ProjectConfig",
"yaml.load"
] | [((2178, 2263), 'yaml.load', 'yaml.load', (["(_PROJECT_YAML % {'project_id': project_id, 'project_num': project_num})"], {}), "(_PROJECT_YAML % {'project_id': project_id, 'project_num':\n project_num})\n", (2187, 2263), False, 'import yaml\n'), ((2367, 2479), 'deploy.rule_generator.project_config.ProjectConfig', 'pr... |