code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
# uncompyle6 version 3.4.1
# Python bytecode 2.7 (62211)
# Decompiled from: Python 2.7.16 (v2.7.16:413a49145e, Mar 2 2019, 14:32:10)
# [GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.57)]
# Embedded file name: /Users/versonator/Jenkins/live/output/mac_64_static/Release/python-bundle/MIDI Remote Scripts/SL_MkIII/phy... | [
"itertools.ifilter",
"itertools.imap"
] | [((803, 858), 'itertools.ifilter', 'ifilter', (['(lambda c: c in self._translation_table)', 'string'], {}), '(lambda c: c in self._translation_table, string)\n', (810, 858), False, 'from itertools import chain, ifilter, imap\n'), ((1370, 1423), 'itertools.imap', 'imap', (['wrap_segment_message', 'display._logical_segme... |
from bs4 import BeautifulSoup
import requests
# By no means is this a complete list, but it is very easy to search for the ones you need later.
KNOWN_OPENGRAPH_TAGS = [
"og:site_name",
"og:title",
"og:locale",
"og:type",
"og:image",
"og:url",
"og:image:url",
"og:image:secure_url",
... | [
"bs4.BeautifulSoup",
"requests.get"
] | [((853, 875), 'requests.get', 'requests.get', (['page_url'], {}), '(page_url)\n', (865, 875), False, 'import requests\n'), ((978, 1024), 'bs4.BeautifulSoup', 'BeautifulSoup', (['response.content', '"""html.parser"""'], {}), "(response.content, 'html.parser')\n", (991, 1024), False, 'from bs4 import BeautifulSoup\n')] |
# -*- coding: utf-8 -*-
from datetime import datetime, timedelta
class PyBrDST():
def easter_date(self, year):
a = year % 19
b = year // 100
c = year % 100
d = b // 4
e = b % 4
f = (b + 8) // 25
g = (b - f + 1) // 3
h = (19 * a + b - d - g + 15) % ... | [
"datetime.timedelta",
"datetime.datetime"
] | [((552, 578), 'datetime.datetime', 'datetime', (['year', 'month', 'day'], {}), '(year, month, day)\n', (560, 578), False, 'from datetime import datetime, timedelta\n'), ((649, 667), 'datetime.timedelta', 'timedelta', ([], {'days': '(47)'}), '(days=47)\n', (658, 667), False, 'from datetime import datetime, timedelta\n')... |
# coding: utf-8
# Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c... | [
"oci.util.formatted_flat_dict"
] | [((7261, 7286), 'oci.util.formatted_flat_dict', 'formatted_flat_dict', (['self'], {}), '(self)\n', (7280, 7286), False, 'from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel\n')] |
from collections import deque
from .entity import Entity
from .matcher import Matcher
from .group import Group
from .exceptions import MissingEntity
class Context(object):
"""A context is a data structure managing entities."""
def __init__(self):
#: Entities retained by this context.
self._... | [
"collections.deque"
] | [((419, 426), 'collections.deque', 'deque', ([], {}), '()\n', (424, 426), False, 'from collections import deque\n')] |
# coding=utf-8
# Copyright 2021 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... | [
"tf_agents.specs.array_spec.BoundedArraySpec",
"pickle.dump",
"numpy.sum",
"numpy.amin",
"numpy.maximum",
"absl.logging.info",
"tensorflow.compat.v1.Summary.Value",
"numpy.histogram",
"numpy.mean",
"tensorflow.compat.v1.gfile.Exists",
"numpy.linalg.norm",
"os.path.join",
"tensorflow.compat.v... | [((1009, 1094), 'absl.flags.DEFINE_integer', 'flags.DEFINE_integer', (['"""checkpoint_iterations"""', '(50)', '"""Periodicity of checkpoints."""'], {}), "('checkpoint_iterations', 50, 'Periodicity of checkpoints.'\n )\n", (1029, 1094), False, 'from absl import flags\n'), ((1090, 1164), 'absl.flags.DEFINE_integer', '... |
import datetime
from django.urls import reverse
from rest_framework import status
from rest_framework.test import APITestCase
from clinic.models import Doctor, Speciality
from timetables.models import Timetable
class TimetableTestCase(APITestCase):
def test_return_empty_list(self):
response = self._get_... | [
"timetables.models.Timetable.objects.filter",
"timetables.models.Timetable.objects.count",
"clinic.models.Doctor.objects.create",
"django.urls.reverse",
"clinic.models.Speciality.objects.create",
"datetime.time"
] | [((501, 540), 'clinic.models.Speciality.objects.create', 'Speciality.objects.create', ([], {'title': '"""Test"""'}), "(title='Test')\n", (526, 540), False, 'from clinic.models import Doctor, Speciality\n'), ((555, 632), 'clinic.models.Doctor.objects.create', 'Doctor.objects.create', ([], {'speciality': 'spec', 'first_n... |
# Generated by Django 3.2.5 on 2021-07-23 19:39
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import localflavor.br.models
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUT... | [
"django.db.models.URLField",
"django.db.migrations.swappable_dependency",
"django.db.models.ManyToManyField",
"django.db.models.BigAutoField",
"django.db.models.CharField",
"django.db.models.ForeignKey",
"django.db.models.BooleanField",
"django.db.models.SlugField",
"django.db.models.IntegerField",
... | [((276, 333), 'django.db.migrations.swappable_dependency', 'migrations.swappable_dependency', (['settings.AUTH_USER_MODEL'], {}), '(settings.AUTH_USER_MODEL)\n', (307, 333), False, 'from django.db import migrations, models\n'), ((508, 604), 'django.db.models.BigAutoField', 'models.BigAutoField', ([], {'auto_created': '... |
from securitybot import loader
PATH_ROOT = 'securitybot'
def main():
config = loader.load_yaml('config/bot.yaml')
secrets_provider = config['secretsmgmt']['provider']
secretsclient = loader.build_secrets_client(
secrets_provider=secrets_provider,
connection_config=config['se... | [
"securitybot.loader.build_secrets_client",
"securitybot.loader.load_yaml"
] | [((91, 126), 'securitybot.loader.load_yaml', 'loader.load_yaml', (['"""config/bot.yaml"""'], {}), "('config/bot.yaml')\n", (107, 126), False, 'from securitybot import loader\n'), ((210, 335), 'securitybot.loader.build_secrets_client', 'loader.build_secrets_client', ([], {'secrets_provider': 'secrets_provider', 'connect... |
"""
Tests the analysis module.
"""
import unittest
import pandas as pd
import mock
from .context import analysis
from .context import evaluation
from .context import interpretability
from .context import label
from .context import purity
from .context import util
from .context import test_utils as tu
class AnalysisTe... | [
"unittest.main",
"pandas.read_csv.assert_called_with",
"unittest.TestLoader",
"mock.Mock"
] | [((3689, 3704), 'unittest.main', 'unittest.main', ([], {}), '()\n', (3702, 3704), False, 'import unittest\n'), ((433, 455), 'mock.Mock', 'mock.Mock', (['label.Label'], {}), '(label.Label)\n', (442, 455), False, 'import mock\n'), ((482, 506), 'mock.Mock', 'mock.Mock', (['purity.Purity'], {}), '(purity.Purity)\n', (491, ... |
# import warnings
# warnings.filterwarnings("ignore", category=DeprecationWarning)
import requests_mock
import zeeguu.core.model
from faker import Faker
from unittest import TestCase
from zeeguu.core.test.test_data.mocking_the_web import mock_requests_get
class ModelTestMixIn(TestCase):
db = zeeguu.core.db
... | [
"requests_mock.Mocker",
"zeeguu.core.test.test_data.mocking_the_web.mock_requests_get",
"faker.Faker"
] | [((361, 368), 'faker.Faker', 'Faker', ([], {}), '()\n', (366, 368), False, 'from faker import Faker\n'), ((961, 983), 'requests_mock.Mocker', 'requests_mock.Mocker', ([], {}), '()\n', (981, 983), False, 'import requests_mock\n'), ((1002, 1022), 'zeeguu.core.test.test_data.mocking_the_web.mock_requests_get', 'mock_reque... |
import tensorflow as tf
from arekit.contrib.networks.context.configurations.rnn import RNNConfig
from arekit.contrib.networks.tf_helpers.cell_types import CellTypes
class BiLSTMConfig(RNNConfig):
__lstm_cell_initializer = tf.keras.initializers.glorot_normal()
def __init__(self):
super(BiLSTMConfig, ... | [
"tensorflow.constant_initializer",
"tensorflow.contrib.layers.xavier_initializer",
"tensorflow.keras.initializers.glorot_normal"
] | [((229, 266), 'tensorflow.keras.initializers.glorot_normal', 'tf.keras.initializers.glorot_normal', ([], {}), '()\n', (264, 266), True, 'import tensorflow as tf\n'), ((648, 676), 'tensorflow.constant_initializer', 'tf.constant_initializer', (['(0.1)'], {}), '(0.1)\n', (671, 676), True, 'import tensorflow as tf\n'), ((7... |
#!/usr/bin/env python3
# -*- coding:utf-8 -*-
#
# Inspired by https://github.com/silvester747/aio_marantz_avr
#
# This is to control Denon/Marantz AVR devices
#
# Copyright (c) 2020 <NAME>
#
# Note large part of this code was taken from scapy and other opensource software
#
# Permission is hereby granted, free of charg... | [
"logging.error",
"logging.debug",
"asyncio.get_event_loop",
"logging.warning",
"re.finditer",
"asyncio.open_connection",
"logging.debugf",
"asyncio.Queue",
"re.sub"
] | [((2077, 2162), 're.finditer', 're.finditer', (['""".+?(?:(?<=[a-z])(?=[A-Z])|(?<=[A-Z])(?=[A-Z][a-z])|$)"""', 'identifier'], {}), "('.+?(?:(?<=[a-z])(?=[A-Z])|(?<=[A-Z])(?=[A-Z][a-z])|$)', identifier\n )\n", (2088, 2162), False, 'import re\n'), ((5493, 5508), 'asyncio.Queue', 'asyncio.Queue', ([], {}), '()\n', (550... |
# -*- coding: utf-8 -*-
import math
from arizona_asr.optim.lr_scheduler.lr_scheduler import LearningRateScheduler
class TransformerLRScheduler(LearningRateScheduler):
""" Transformer Learning Rate Scheduler proposed in "Attention Is All You Need" """
def __init__(self, optimizer, peak_lr, final_lr, final_lr_... | [
"math.log",
"math.exp"
] | [((827, 851), 'math.log', 'math.log', (['final_lr_scale'], {}), '(final_lr_scale)\n', (835, 851), False, 'import math\n'), ((1471, 1516), 'math.exp', 'math.exp', (['(-self.decay_factor * steps_in_stage)'], {}), '(-self.decay_factor * steps_in_stage)\n', (1479, 1516), False, 'import math\n')] |
# Generated by Django 3.2.4 on 2021-06-18 04:17
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('timewebapp', '0041_alter_settingsmodel_background_image'),
]
operations = [
migrations.AddField(
model_name='timewebmodel',
... | [
"django.db.models.JSONField"
] | [((359, 398), 'django.db.models.JSONField', 'models.JSONField', ([], {'blank': '(True)', 'null': '(True)'}), '(blank=True, null=True)\n', (375, 398), False, 'from django.db import migrations, models\n')] |
from flask import Blueprint, request
from .controllers import Controllers
def make_blueprint(db_connection_string=None, configuration={}): # noqa
"""Create blueprint.
"""
controllers = Controllers(configuration=configuration,
connection_string=db_connection_string)
# ... | [
"flask.Blueprint"
] | [((352, 389), 'flask.Blueprint', 'Blueprint', (['"""etl_server"""', '"""etl_server"""'], {}), "('etl_server', 'etl_server')\n", (361, 389), False, 'from flask import Blueprint, request\n')] |
from dataclasses import dataclass
from typing import Optional, Type, TypeVar
from commanderbot.ext.automod import events
from commanderbot.ext.automod.automod_event import AutomodEvent
from commanderbot.ext.automod.automod_trigger import (
AutomodTrigger,
AutomodTriggerBase,
)
from commanderbot.lib import Json... | [
"commanderbot.lib.RolesGuard.from_field_optional",
"typing.TypeVar"
] | [((345, 358), 'typing.TypeVar', 'TypeVar', (['"""ST"""'], {}), "('ST')\n", (352, 358), False, 'from typing import Optional, Type, TypeVar\n'), ((994, 1039), 'commanderbot.lib.RolesGuard.from_field_optional', 'RolesGuard.from_field_optional', (['data', '"""roles"""'], {}), "(data, 'roles')\n", (1024, 1039), False, 'from... |
import os
import numpy as np
from keras.models import Sequential, Model
from keras.layers import Dense, Dropout, LSTM, TimeDistributed, Activation, Reshape, concatenate, Input
from keras.optimizers import Adam
from keras.callbacks import ModelCheckpoint, CSVLogger, Callback
START_CHAR = '\b'
END_CHAR = '\t'
PADDING_C... | [
"os.remove",
"numpy.sum",
"numpy.argmax",
"numpy.random.multinomial",
"keras.models.Model",
"os.path.isfile",
"numpy.exp",
"keras.layers.Input",
"keras.layers.concatenate",
"keras.callbacks.ModelCheckpoint",
"keras.layers.Dropout",
"numpy.asarray",
"keras.optimizers.Adam",
"numpy.log",
"... | [((6724, 6755), 'keras.callbacks.CSVLogger', 'CSVLogger', (["(model_fname + '.log')"], {}), "(model_fname + '.log')\n", (6733, 6755), False, 'from keras.callbacks import ModelCheckpoint, CSVLogger, Callback\n'), ((6772, 6870), 'keras.callbacks.ModelCheckpoint', 'ModelCheckpoint', (['"""model.hdf5"""'], {'monitor': '"""... |
import os
import os.path as osp
dir_path = osp.join( os.path.expanduser('~'), "space/trt_plugin/build/lib/")
if not osp.exists(dir_path):
if "AMIRSTAN_LIBRARY_PATH" in os.environ:
dir_path = os.environ["AMIRSTAN_LIBRARY_PATH"]
else:
dir_path = os.path.dirname(os.path.realpath(__file__)) | [
"os.path.realpath",
"os.path.expanduser",
"os.path.exists"
] | [((53, 76), 'os.path.expanduser', 'os.path.expanduser', (['"""~"""'], {}), "('~')\n", (71, 76), False, 'import os\n'), ((117, 137), 'os.path.exists', 'osp.exists', (['dir_path'], {}), '(dir_path)\n', (127, 137), True, 'import os.path as osp\n'), ((285, 311), 'os.path.realpath', 'os.path.realpath', (['__file__'], {}), '... |
from django.db import models
from django.db.models import Q, Max
import logging
from wouso.core.config.models import IntegerSetting
from wouso.core.game.models import Game
from wouso.core.user.models import Player
from wouso.games.challenge.models import Challenge, ChallengeUser
class GrandChallengeUser(Player):
... | [
"logging.error",
"wouso.games.challenge.models.Challenge.objects.get",
"logging.debug",
"logging.exception",
"django.db.models.ForeignKey",
"wouso.core.user.models.Player.objects.exclude",
"django.db.models.Q",
"django.db.models.IntegerField",
"wouso.core.config.models.IntegerSetting.get",
"wouso.... | [((388, 418), 'django.db.models.IntegerField', 'models.IntegerField', ([], {'default': '(0)'}), '(default=0)\n', (407, 418), False, 'from django.db import models\n'), ((436, 466), 'django.db.models.IntegerField', 'models.IntegerField', ([], {'default': '(0)'}), '(default=0)\n', (455, 466), False, 'from django.db import... |
"""
Cisco Intersight Universal API Calls Module, v1.1
Author: <NAME>
Contact: <EMAIL>, <EMAIL>
Summary: The Cisco Intersight Universal API Calls module provides
a set of functions that simplify creation, retrieval,
modification, and deletion of resources on Cisco Intersight.
"""
# Import n... | [
"intersight.intersight_api_client.IntersightApiClient",
"os.path.isfile",
"json.loads"
] | [((1112, 1182), 'intersight.intersight_api_client.IntersightApiClient', 'IntersightApiClient', ([], {'host': 'base_url', 'private_key': 'key', 'api_key_id': 'key_id'}), '(host=base_url, private_key=key, api_key_id=key_id)\n', (1131, 1182), False, 'from intersight.intersight_api_client import IntersightApiClient\n'), ((... |
#!/usr/bin/python2
"""worker to read presence records from redis and write to mongodb"""
from pymongo import MongoClient
import syslog
import redis
import json
import time
import datetime
from argparse import ArgumentParser
#from riemann import RiemannClient, RiemannUDPTransport
#rmmonitor = RiemannClient(transport ... | [
"redis.Redis",
"pymongo.MongoClient",
"argparse.ArgumentParser",
"syslog.syslog",
"json.loads",
"time.sleep",
"datetime.timedelta",
"traceback.format_exc",
"datetime.datetime.now"
] | [((549, 565), 'argparse.ArgumentParser', 'ArgumentParser', ([], {}), '()\n', (563, 565), False, 'from argparse import ArgumentParser\n'), ((805, 828), 'datetime.datetime.now', 'datetime.datetime.now', ([], {}), '()\n', (826, 828), False, 'import datetime\n'), ((1628, 1651), 'datetime.datetime.now', 'datetime.datetime.n... |
"""Cryptography module.
Encrypt and decrypt user's Bitcoin WIFs.
"""
import rncryptor
from base64 import b64encode, b64decode
def encrypt(wif, password):
return b64encode(rncryptor.RNCryptor().encrypt(data=wif, password=password)).decode('utf-8')
def decrypt(enc_wif, password):
return rncryptor.RNCryptor()... | [
"rncryptor.RNCryptor"
] | [((299, 320), 'rncryptor.RNCryptor', 'rncryptor.RNCryptor', ([], {}), '()\n', (318, 320), False, 'import rncryptor\n'), ((178, 199), 'rncryptor.RNCryptor', 'rncryptor.RNCryptor', ([], {}), '()\n', (197, 199), False, 'import rncryptor\n')] |
# Copyright 2020 IBM Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | [
"pandas.DataFrame",
"matplotlib.pyplot.tight_layout",
"numpy.stack",
"argparse.ArgumentParser",
"os.path.join",
"sklearn.model_selection.train_test_split",
"sklearn.metrics.r2_score",
"os.environ.get",
"pandas.read_parquet",
"pandas.Series",
"xgboost.XGBRegressor",
"matplotlib.pyplot.ylabel",
... | [((901, 928), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (918, 928), False, 'import logging\n'), ((1798, 1817), 'pandas.DataFrame', 'pd.DataFrame', (['evals'], {}), '(evals)\n', (1810, 1817), True, 'import pandas as pd\n'), ((2275, 2311), 'matplotlib.pyplot.subplots', 'plt.subplots', ... |
#!/usr/bin/env python
# coding:utf-8
# Code by : <NAME>
# E-mail : <EMAIL>
"""
#set:usage.py,examples.py,changelog.txt
##################################################################
# USAGE :
#s
from imgtoascii import imgtoascii
imgtoascii("<IMAGE_PATH>","<OPTION>").view()
#e
########################... | [
"pipincluder.pipincluder"
] | [((2805, 2868), 'pipincluder.pipincluder', 'pipincluder', (['"""from PIL import Image"""', '"""from hexor import hexor"""'], {}), "('from PIL import Image', 'from hexor import hexor')\n", (2816, 2868), False, 'from pipincluder import pipincluder\n')] |
###############################################################################
# Copyright (C) Intel Corporation
#
# SPDX-License-Identifier: MIT
###############################################################################
"""Build oneVPL-cpu ffmpeg dependencies"""
from io import BytesIO
import sys
import os
import... | [
"os.remove",
"argparse.ArgumentParser",
"os.environ.copy",
"os.path.isfile",
"shutil.rmtree",
"os.path.join",
"os.chdir",
"multiprocessing.cpu_count",
"os.path.dirname",
"os.path.exists",
"ssl._create_unverified_context",
"subprocess.Popen",
"os.chmod",
"os.pathsep.join",
"os.path.realpa... | [((908, 935), 'multiprocessing.cpu_count', 'multiprocessing.cpu_count', ([], {}), '()\n', (933, 935), False, 'import multiprocessing\n'), ((2499, 2521), 'posixpath.join', 'posixpath.join', (['*parts'], {}), '(*parts)\n', (2513, 2521), False, 'import posixpath\n'), ((3380, 3391), 'os.getcwd', 'os.getcwd', ([], {}), '()\... |
#
# Copyright (c) 2019 ISP RAS (http://www.ispras.ru)
# Ivannikov Institute for System Programming of the Russian Academy of Sciences
#
# 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
#
# h... | [
"os.path.commonpath",
"klever.core.utils.make_relative_path",
"os.path.splitext",
"os.path.split",
"re.compile"
] | [((1477, 1499), 're.compile', 're.compile', (['"""\\\\w+main"""'], {}), "('\\\\w+main')\n", (1487, 1499), False, 'import re\n'), ((1670, 1709), 'os.path.commonpath', 'os.path.commonpath', (["['libbb', rel_path]"], {}), "(['libbb', rel_path])\n", (1688, 1709), False, 'import os\n'), ((1895, 1918), 'os.path.split', 'os.p... |
# Shapely installed via pip doesn't have GEOS dependencies
# Instead we download a custom Python wheel which does have the dependencies
# (see https://stackoverflow.com/questions/13144158/python-geos-and-shapely-on-windows-64)
from urllib import urlretrieve
from subprocess import call
import os
wheels = [
'https://do... | [
"os.remove",
"subprocess.call",
"urllib.urlretrieve"
] | [((622, 655), 'subprocess.call', 'call', (["['pip', 'install', 'wheel']"], {}), "(['pip', 'install', 'wheel'])\n", (626, 655), False, 'from subprocess import call\n'), ((806, 832), 'urllib.urlretrieve', 'urlretrieve', (['url', 'filename'], {}), '(url, filename)\n', (817, 832), False, 'from urllib import urlretrieve\n')... |
from django.db import models
# Create your models here.
class User(models.Model):
first_name = models.CharField(max_length=255)
last_name = models.CharField(max_length=255)
email_address = models.CharField(max_length=255)
age = models.IntegerField()
created_at = models.DateTimeField(auto_now_add=True)
upda... | [
"django.db.models.CharField",
"django.db.models.IntegerField",
"django.db.models.DateTimeField"
] | [((98, 130), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(255)'}), '(max_length=255)\n', (114, 130), False, 'from django.db import models\n'), ((145, 177), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(255)'}), '(max_length=255)\n', (161, 177), False, 'from django.db... |
# coding=utf-8
#
# pylint: disable = wildcard-import, unused-wildcard-import
# pylint: disable = missing-docstring, invalid-name
# pylint: disable = unused-argument, no-member, attribute-defined-outside-init
# pylint: disable = too-many-lines, too-many-branches, too-many-statements
"""
Copyright (c) 2020, <NAME>. Al... | [
"fnmatch.filter",
"zm.features.ToolchainVars.cfgVarToSetToolchain",
"os.walk",
"shutil.which",
"pytest.mark.skipif",
"zm.features.ToolchainVars.sysVarToSetToolchain",
"os.path.split",
"os.path.join",
"pytest.mark.usefixtures"
] | [((588, 627), 'pytest.mark.usefixtures', 'pytest.mark.usefixtures', (['"""unsetEnviron"""'], {}), "('unsetEnviron')\n", (611, 627), False, 'import pytest\n'), ((1916, 2004), 'pytest.mark.skipif', 'pytest.mark.skipif', (["(PLATFORM != 'linux')"], {'reason': '"""It\'s enough to test on linux only"""'}), '(PLATFORM != \'l... |
from brewgorithm import beer2vec, beer_emb, word_weighter
import numpy as np
import unittest
from sklearn.metrics.pairwise import cosine_similarity
class TestBeer2vec(unittest.TestCase):
def test_most_similar_test(self):
beers = beer2vec.get_beer2vec()
embeddings = beer_emb.embed_doc("apricot peach fruity"... | [
"unittest.main",
"sklearn.metrics.pairwise.cosine_similarity",
"numpy.average",
"brewgorithm.beer_emb.embed_doc",
"brewgorithm.beer2vec.get_beer2vec",
"brewgorithm.beer_emb.most_similar"
] | [((1029, 1044), 'unittest.main', 'unittest.main', ([], {}), '()\n', (1042, 1044), False, 'import unittest\n'), ((237, 260), 'brewgorithm.beer2vec.get_beer2vec', 'beer2vec.get_beer2vec', ([], {}), '()\n', (258, 260), False, 'from brewgorithm import beer2vec, beer_emb, word_weighter\n'), ((279, 352), 'brewgorithm.beer_em... |
# Copyright (c) 2018, Curious AI Ltd. All rights reserved.
#
# This work is licensed under the Creative Commons Attribution-NonCommercial
# 4.0 International License. To view a copy of this license, visit
# http://creativecommons.org/licenses/by-nc/4.0/ or send a letter to
# Creative Commons, PO Box 1866, Mountain View... | [
"re.sub",
"argparse.ArgumentParser",
"logging.getLogger",
"argparse.ArgumentTypeError"
] | [((502, 527), 'logging.getLogger', 'logging.getLogger', (['"""main"""'], {}), "('main')\n", (519, 527), False, 'import logging\n'), ((613, 677), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""PyTorch ImageNet Training"""'}), "(description='PyTorch ImageNet Training')\n", (636, 677), Fals... |
from sys import argv
import boto3
# unfortunately the AWS CLI cannot generate presigned S3 URLs for PutObject requests,
# so we have to do it with a proper AWS SDK
url = boto3.client('s3').generate_presigned_url(
ClientMethod='put_object',
Params={'Bucket': argv[1], 'Key': argv[2]},
ExpiresIn=3600
)
prin... | [
"boto3.client"
] | [((172, 190), 'boto3.client', 'boto3.client', (['"""s3"""'], {}), "('s3')\n", (184, 190), False, 'import boto3\n')] |
import copy
import json
import random
import pytest
from indy_common.constants import REVOC_TYPE, TAG, TAG_LIMIT_SIZE
from plenum.common.constants import GENERAL_LIMIT_SIZE, REQNACK, REJECT
from plenum.common.types import OPERATION
from plenum.common.util import randomString
from plenum.test.helper import sdk_sign_re... | [
"copy.deepcopy",
"random.randint",
"pytest.fixture",
"json.dumps",
"plenum.common.util.randomString",
"plenum.test.helper.sdk_get_replies",
"plenum.test.helper.sdk_sign_request_from_dict"
] | [((383, 440), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""module"""', 'params': "['lt', 'eq', 'gt']"}), "(scope='module', params=['lt', 'eq', 'gt'])\n", (397, 440), False, 'import pytest\n'), ((493, 549), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""module"""', 'params': '[REVOC_TYPE, TAG]'}), "(sc... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='Country',
fields=[
('id', models.AutoField(auto... | [
"django.db.models.TextField",
"django.db.models.ManyToManyField",
"django.db.models.CharField",
"django.db.models.ForeignKey",
"django.db.models.SlugField",
"django.db.models.AutoField",
"django.db.models.BooleanField",
"django.db.models.DateTimeField"
] | [((5555, 5701), 'django.db.models.ManyToManyField', 'models.ManyToManyField', ([], {'to': '"""web.Region"""', 'verbose_name': '"""Please select the geographic regions in which you have professional experience:*"""'}), "(to='web.Region', verbose_name=\n 'Please select the geographic regions in which you have professi... |
# Copyright 2020, The TensorFlow Federated Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | [
"absl.testing.absltest.main",
"tensorflow_federated.test.set_no_default_context",
"tensorflow_federated.backends.native.create_thread_debugging_execution_context",
"tensorflow_federated.federated_zip",
"tensorflow_federated.federated_value",
"tensorflow_federated.framework.get_context_stack",
"tensorflo... | [((3672, 3705), 'tensorflow_federated.test.set_no_default_context', 'tff.test.set_no_default_context', ([], {}), '()\n', (3703, 3705), True, 'import tensorflow_federated as tff\n'), ((3708, 3723), 'absl.testing.absltest.main', 'absltest.main', ([], {}), '()\n', (3721, 3723), False, 'from absl.testing import absltest\n'... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2007 Zuza Software Foundation
#
# This file is part of translate.
#
# translate is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of t... | [
"translate.lang.factory.getlanguage",
"translate.filters.pofilter.POTeeChecker"
] | [((1552, 1597), 'translate.lang.factory.getlanguage', 'lang.factory.getlanguage', (['self.sourcelanguage'], {}), '(self.sourcelanguage)\n', (1576, 1597), False, 'from translate import lang\n'), ((1930, 1982), 'translate.filters.pofilter.POTeeChecker', 'pofilter.POTeeChecker', ([], {'checkerclasses': 'checkerclasses'}),... |
import os
from os.path import dirname, abspath, join
import torch
CODEPATH = dirname(abspath(__file__))
DATAPATH = abspath(join(join(CODEPATH, os.pardir), 'data'))
RESPATH = abspath(join(join(CODEPATH, os.pardir), 'results'))
Tensor = torch.DoubleTensor
| [
"os.path.abspath",
"os.path.join"
] | [((87, 104), 'os.path.abspath', 'abspath', (['__file__'], {}), '(__file__)\n', (94, 104), False, 'from os.path import dirname, abspath, join\n'), ((130, 155), 'os.path.join', 'join', (['CODEPATH', 'os.pardir'], {}), '(CODEPATH, os.pardir)\n', (134, 155), False, 'from os.path import dirname, abspath, join\n'), ((189, 21... |
from Tkinter import PhotoImage
from random import randint
dX=[-3,3,-3,3]
dY=[-3,-3,3,3]
def nd(n, x):
if n == 1 or n == 3:
return (x + 2) % 4
elif n == 2:
return x + 1
elif n == 4:
return x - 1
class pcg:
def __init__(self, x, y, direction, master):
sel... | [
"random.randint",
"Tkinter.PhotoImage"
] | [((1202, 1240), 'Tkinter.PhotoImage', 'PhotoImage', ([], {'file': '"""images\\\\package.gif"""'}), "(file='images\\\\package.gif')\n", (1212, 1240), False, 'from Tkinter import PhotoImage\n'), ((1527, 1540), 'random.randint', 'randint', (['(2)', '(3)'], {}), '(2, 3)\n', (1534, 1540), False, 'from random import randint\... |
import numpy as np
import pandas as pd
import statsmodels.api as sm
from sklearn.preprocessing import OneHotEncoder
import statistics
import math
import sys
import itertools
import time
np.seterr(over='raise', under="ignore")
def batch_pp(df, covariates, batch_column, ignore):
"""This function takes in a df, the ... | [
"pandas.DataFrame",
"statsmodels.api.OLS",
"numpy.seterr",
"pandas.get_dummies",
"statistics.stdev",
"time.time",
"pandas.concat"
] | [((187, 226), 'numpy.seterr', 'np.seterr', ([], {'over': '"""raise"""', 'under': '"""ignore"""'}), "(over='raise', under='ignore')\n", (196, 226), True, 'import numpy as np\n'), ((1670, 1720), 'pandas.get_dummies', 'pd.get_dummies', (['df[batch_column]'], {'drop_first': '(False)'}), '(df[batch_column], drop_first=False... |
from google.protobuf.symbol_database import Default
import nltk
import random
import pickle
from nltk.corpus.reader.chasen import test
from pandas.core.indexes import period
from statsmodels.tsa.seasonal import _extrapolate_trend
nltk.download('punkt')
nltk.download('wordnet')
from nltk.stem import WordNetLemm... | [
"keras.models.load_model",
"streamlit.balloons",
"streamlit.selectbox",
"csv.reader",
"statsmodels.tsa.arima_model.ARIMA",
"streamlit.sidebar.write",
"pandas.read_csv",
"streamlit.radio",
"streamlit.title",
"streamlit.sidebar.title",
"streamlit.sidebar.selectbox",
"nltk.download",
"streamlit... | [((237, 259), 'nltk.download', 'nltk.download', (['"""punkt"""'], {}), "('punkt')\n", (250, 259), False, 'import nltk\n'), ((261, 285), 'nltk.download', 'nltk.download', (['"""wordnet"""'], {}), "('wordnet')\n", (274, 285), False, 'import nltk\n'), ((393, 412), 'nltk.stem.WordNetLemmatizer', 'WordNetLemmatizer', ([], {... |
"""
Quick smoke test that our implementation of salsa20 does the right thing.
"""
from hypothesis import given
import hypothesis.strategies as st
from Crypto.Cipher import Salsa20
from umash import C, FFI
@given(
length=st.integers(min_value=1, max_value=512),
nonce=st.binary(min_size=8, max_size=8),
key=... | [
"hypothesis.strategies.binary",
"Crypto.Cipher.Salsa20.new",
"umash.FFI.new",
"umash.FFI.buffer",
"umash.C.salsa20_stream",
"hypothesis.strategies.integers"
] | [((472, 497), 'umash.FFI.new', 'FFI.new', (['"""char[]"""', 'length'], {}), "('char[]', length)\n", (479, 497), False, 'from umash import C, FFI\n'), ((502, 543), 'umash.C.salsa20_stream', 'C.salsa20_stream', (['buf', 'length', 'nonce', 'key'], {}), '(buf, length, nonce, key)\n', (518, 543), False, 'from umash import C... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Jul 1 18:22:15 2018
@author: arpit-mint
"""
from keras.models import Sequential
from keras.layers import Convolution2D
from keras.layers import MaxPooling2D
from keras.layers import Flatten
from keras.layers import Dense
#Initializing the CNN
classif... | [
"keras.preprocessing.image.ImageDataGenerator",
"keras.layers.Convolution2D",
"keras.layers.Flatten",
"keras.layers.Dense",
"keras.models.Sequential",
"keras.layers.MaxPooling2D"
] | [((324, 336), 'keras.models.Sequential', 'Sequential', ([], {}), '()\n', (334, 336), False, 'from keras.models import Sequential\n'), ((1058, 1154), 'keras.preprocessing.image.ImageDataGenerator', 'ImageDataGenerator', ([], {'rescale': '(1.0 / 255)', 'shear_range': '(0.2)', 'zoom_range': '(0.2)', 'horizontal_flip': '(T... |
# Copyright (C) 2018 <NAME>
#
# SPDX-License-Identifier: MIT
"""This module contains a collection of functions related to
geographical data.
"""
from .utils import sorted_by_key # noqa
from haversine import haversine
# Task 1B
def stations_by_distance(stations, p):
"""returns all stations sorted by distance fro... | [
"haversine.haversine"
] | [((611, 638), 'haversine.haversine', 'haversine', (['station.coord', 'p'], {}), '(station.coord, p)\n', (620, 638), False, 'from haversine import haversine\n'), ((1169, 1201), 'haversine.haversine', 'haversine', (['station.coord', 'centre'], {}), '(station.coord, centre)\n', (1178, 1201), False, 'from haversine import ... |
# This file is part of Buildbot. Buildbot is free software: you can
# redistribute it and/or modify it under the terms of the GNU General Public
# License as published by the Free Software Foundation, version 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without eve... | [
"future.utils.lrange"
] | [((830, 839), 'future.utils.lrange', 'lrange', (['(7)'], {}), '(7)\n', (836, 839), False, 'from future.utils import lrange\n')] |
# -*- coding: utf-8 -*-
# Copyright (C) 2020. Huawei Technologies Co., Ltd. All rights reserved.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the MIT License.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the... | [
"zeus.modules.operators.PruneConv2DFilter",
"zeus.modules.operators.PruneBatchNormFilter",
"zeus.modules.operators.PruneLinearFilter",
"zeus.common.ClassFactory.register"
] | [((693, 733), 'zeus.common.ClassFactory.register', 'ClassFactory.register', (['ClassType.NETWORK'], {}), '(ClassType.NETWORK)\n', (714, 733), False, 'from zeus.common import ClassType, ClassFactory\n'), ((1202, 1239), 'zeus.modules.operators.PruneConv2DFilter', 'PruneConv2DFilter', (['module', 'self.props'], {}), '(mod... |
from wsgiref.simple_server import make_server
import oauth2
import oauth2.grant
import oauth2.error
import oauth2.store.memory
import oauth2.tokengenerator
import oauth2.web.wsgi
# Create a SiteAdapter to interact with the user.
# This can be used to display confirmation dialogs and the like.
class ExampleSiteAdapter... | [
"oauth2.web.wsgi.Application",
"oauth2.grant.ImplicitGrant",
"oauth2.store.memory.TokenStore",
"oauth2.tokengenerator.Uuid4TokenGenerator",
"oauth2.grant.RefreshToken",
"wsgiref.simple_server.make_server",
"oauth2.store.memory.ClientStore",
"oauth2.grant.AuthorizationCodeGrant"
] | [((1294, 1327), 'oauth2.store.memory.ClientStore', 'oauth2.store.memory.ClientStore', ([], {}), '()\n', (1325, 1327), False, 'import oauth2\n'), ((1607, 1639), 'oauth2.store.memory.TokenStore', 'oauth2.store.memory.TokenStore', ([], {}), '()\n', (1637, 1639), False, 'import oauth2\n'), ((2252, 2298), 'oauth2.web.wsgi.A... |
import astropy
from astropy.cosmology import WMAP9 as cosmo
z = cosmo.comoving_distance([0.5, 1.0, 1.5])
print(z) | [
"astropy.cosmology.WMAP9.comoving_distance"
] | [((68, 108), 'astropy.cosmology.WMAP9.comoving_distance', 'cosmo.comoving_distance', (['[0.5, 1.0, 1.5]'], {}), '([0.5, 1.0, 1.5])\n', (91, 108), True, 'from astropy.cosmology import WMAP9 as cosmo\n')] |
from abc import ABC, abstractmethod
from typing import Any, TypeVar, Optional
GOType = TypeVar("GOType", bound="GameObjectInterface")
class GameObjectInterface(ABC):
"""
A game object is a composable element in game.
"""
_parent: Optional["GameObjectInterface"] = None
def __init_subclass__(cls,... | [
"typing.TypeVar"
] | [((88, 134), 'typing.TypeVar', 'TypeVar', (['"""GOType"""'], {'bound': '"""GameObjectInterface"""'}), "('GOType', bound='GameObjectInterface')\n", (95, 134), False, 'from typing import Any, TypeVar, Optional\n')] |
import bravado
import pytest
import requests
from client import BaseDevicesApiClient, ManagementClient, \
SimpleInternalClient, SimpleManagementClient
from common import Device, DevAuthorizer, device_auth_req, \
make_devid, explode_jwt
class TestToken(ManagementClient):
intclient = SimpleInternalClient(... | [
"common.Device",
"client.SimpleManagementClient",
"client.SimpleInternalClient",
"common.DevAuthorizer",
"common.explode_jwt",
"requests.post",
"client.BaseDevicesApiClient",
"common.device_auth_req"
] | [((299, 321), 'client.SimpleInternalClient', 'SimpleInternalClient', ([], {}), '()\n', (319, 321), False, 'from client import BaseDevicesApiClient, ManagementClient, SimpleInternalClient, SimpleManagementClient\n'), ((336, 358), 'client.BaseDevicesApiClient', 'BaseDevicesApiClient', ([], {}), '()\n', (356, 358), False,... |
#!/usr/bin/env python3
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import re
import tempfile
import numpy as np
import six
from tensorflow.python.distribute import distribute_coordinator_context as dc_context
from tensorflow.py... | [
"os.remove",
"tensorboard.plugins.projector.visualize_embeddings",
"tensorflow.python.keras.distribute.multi_worker_training_state.MultiWorkerTrainingState",
"tensorflow.python.ops.array_ops.reshape",
"tensorflow.python.distribute.distribute_coordinator_context.get_current_worker_context",
"os.close",
"... | [((7464, 7491), 'tensorboard.plugins.projector.ProjectorConfig', 'projector.ProjectorConfig', ([], {}), '()\n', (7489, 7491), False, 'from tensorboard.plugins import projector\n'), ((8537, 8583), 'tensorboard.plugins.projector.visualize_embeddings', 'projector.visualize_embeddings', (['writer', 'config'], {}), '(writer... |
"""Module containing the recipient alias API of the v1 API."""
from flask import abort
from flask.views import MethodView
from .root import API_V1
from .models import RecipientAlias
from ...db import DB
from ...db.models.recipient_alias import RecipientAlias as RecipientAlias_DB
@API_V1.route("/recipient_alias/")
... | [
"flask.abort"
] | [((2496, 2546), 'flask.abort', 'abort', (['(404)', '"""Requested recipient alias not found."""'], {}), "(404, 'Requested recipient alias not found.')\n", (2501, 2546), False, 'from flask import abort\n'), ((2924, 2974), 'flask.abort', 'abort', (['(404)', '"""Requested recipient alias not found."""'], {}), "(404, 'Reque... |
from django.conf import settings
from django.contrib.auth import (
authenticate, login, logout, get_user_model,
user_logged_out
)
from rest_framework.views import APIView
from rest_framework.response import Response
from rest_framework import status
import traceback
User = get_user_model()
class LoginView(A... | [
"traceback.print_exc",
"django.contrib.auth.get_user_model",
"django.contrib.auth.user_logged_out.send",
"django.contrib.auth.logout",
"rest_framework.response.Response",
"django.contrib.auth.authenticate",
"django.contrib.auth.login"
] | [((285, 301), 'django.contrib.auth.get_user_model', 'get_user_model', ([], {}), '()\n', (299, 301), False, 'from django.contrib.auth import authenticate, login, logout, get_user_model, user_logged_out\n'), ((1813, 1905), 'django.contrib.auth.user_logged_out.send', 'user_logged_out.send', ([], {'sender': 'request.user._... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from db.player_draft import PlayerDraft
from db.team import Team
def test_find_by_id():
pdft = PlayerDraft.find_by_player_id(8475883) # <NAME>
assert len(pdft) == 2
pdft = PlayerDraft.find_by_player_id(8466145) # <NAME>
assert len(pdft) == 2
def test_... | [
"db.player_draft.PlayerDraft",
"db.player_draft.PlayerDraft.find_by_player_id",
"db.player_draft.PlayerDraft.find",
"db.team.Team.find_by_id"
] | [((148, 186), 'db.player_draft.PlayerDraft.find_by_player_id', 'PlayerDraft.find_by_player_id', (['(8475883)'], {}), '(8475883)\n', (177, 186), False, 'from db.player_draft import PlayerDraft\n'), ((234, 272), 'db.player_draft.PlayerDraft.find_by_player_id', 'PlayerDraft.find_by_player_id', (['(8466145)'], {}), '(84661... |
from django.db import models
class Student(models.Model):
roll = models.IntegerField(unique=True)
name = models.CharField(max_length=100)
phone = models.CharField(max_length=10, unique=True, blank=True, null=True)
email = models.EmailField(unique=True, blank=True, null=True)
sem = models.IntegerFie... | [
"django.db.models.OneToOneField",
"django.db.models.CharField",
"django.db.models.BooleanField",
"django.db.models.EmailField",
"django.db.models.ImageField",
"django.db.models.IntegerField"
] | [((70, 102), 'django.db.models.IntegerField', 'models.IntegerField', ([], {'unique': '(True)'}), '(unique=True)\n', (89, 102), False, 'from django.db import models\n'), ((114, 146), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(100)'}), '(max_length=100)\n', (130, 146), False, 'from django.db ... |
# pylint: disable=redefined-outer-name,unused-argument
"""Coupon request API tests"""
import os
from types import SimpleNamespace
import pytest
from pygsheets import Worksheet, Spreadsheet
from pygsheets.client import Client as PygsheetsClient
from pygsheets.drive import DriveAPIWrapper
from pygsheets.sheet import Sh... | [
"ecommerce.factories.ProductVersionFactory.create",
"ecommerce.models.Company.objects.order_by",
"sheets.coupon_request_api.CouponRequestHandler",
"sheets.coupon_request_api.CouponRequestRow.parse_raw_data",
"sheets.models.CouponGenerationRequest.objects.all",
"ecommerce.models.Coupon.objects.all",
"she... | [((800, 872), 'courses.factories.CourseRunFactory.create', 'CourseRunFactory.create', ([], {'courseware_id': '"""course-v1:edX+DemoX+Demo_Course"""'}), "(courseware_id='course-v1:edX+DemoX+Demo_Course')\n", (823, 872), False, 'from courses.factories import CourseRunFactory\n'), ((877, 934), 'ecommerce.factories.Product... |
from django.conf.urls import url
from app05plus.views import index, register, mylogin
from app05plus.views import mylogout
urlpatterns = [
url(r"^newindex01$",index),
url(r"^register01$",register,name="register"),
url(r"^mylogin01$",mylogin,name="mylogin"),
url(r"^logout$",mylogout),
] | [
"django.conf.urls.url"
] | [((153, 179), 'django.conf.urls.url', 'url', (['"""^newindex01$"""', 'index'], {}), "('^newindex01$', index)\n", (156, 179), False, 'from django.conf.urls import url\n'), ((186, 232), 'django.conf.urls.url', 'url', (['"""^register01$"""', 'register'], {'name': '"""register"""'}), "('^register01$', register, name='regis... |
'''
Gets the Text out of an English Audio File
'''
import speech_recognition as sr
r = sr.Recognizer()
def convert_to_text(audioFile):
with sr.AudioFile(audioFile) as source:
audioData = r.record(source)
text = r.recognize_google(audioData)
print("\ntext : ", text)
if __name__ == "__ma... | [
"speech_recognition.AudioFile",
"speech_recognition.Recognizer"
] | [((90, 105), 'speech_recognition.Recognizer', 'sr.Recognizer', ([], {}), '()\n', (103, 105), True, 'import speech_recognition as sr\n'), ((148, 171), 'speech_recognition.AudioFile', 'sr.AudioFile', (['audioFile'], {}), '(audioFile)\n', (160, 171), True, 'import speech_recognition as sr\n')] |
# -*- coding: utf-8 -*-
"""
Created on Fri Oct 4 16:56:20 2019
@author: CHaithcock
"""
import sys
sys.path.insert(1, 'C:/Users/chaithcock/Documents/repos/RushHour/RHGraph')
import RHConstants as const
'''
Constants for Toplogical Combinatorial Constructions.
'''
STRIPS = ['C','CC','CCC','CT','TC','T','TT']
SLO... | [
"sys.path.insert"
] | [((101, 175), 'sys.path.insert', 'sys.path.insert', (['(1)', '"""C:/Users/chaithcock/Documents/repos/RushHour/RHGraph"""'], {}), "(1, 'C:/Users/chaithcock/Documents/repos/RushHour/RHGraph')\n", (116, 175), False, 'import sys\n')] |
import matplotlib.pyplot as plt
import tensorflow as tf
from tensorflow.keras.datasets import cifar10
from PIL import Image, ImageEnhance
import cv2
import urllib
import numpy as np
from tensorflow.keras.utils import to_categorical
import glob
from random import shuffle
import h5py
import torch
from torchvision import ... | [
"tensorflow.keras.preprocessing.image.ImageDataGenerator",
"argparse.ArgumentParser",
"os.makedirs",
"tensorflow.config.list_physical_devices",
"time.strftime",
"load_data.prep_pixels_h5",
"tensorflow.keras.losses.CategoricalCrossentropy",
"tensorflow.keras.optimizers.Adam",
"tensorflow.keras.layers... | [((651, 676), 'tensorflow.test.gpu_device_name', 'tf.test.gpu_device_name', ([], {}), '()\n', (674, 676), True, 'import tensorflow as tf\n'), ((876, 951), 'tensorflow.test.is_gpu_available', 'tf.test.is_gpu_available', ([], {'cuda_only': '(False)', 'min_cuda_compute_capability': 'None'}), '(cuda_only=False, min_cuda_co... |
import spacy
import sys
import numpy as np
import operator
from keras.models import load_model
from keras.preprocessing.text import Tokenizer
from keras.preprocessing.sequence import pad_sequences
import preprocess_data
MAX_SEQUENCE_LENGTH = 100
EMBEDDING_DIM = 300
model = load_model('models/bidirectional_lstm/mod... | [
"keras.models.load_model",
"numpy.ndenumerate",
"numpy.zeros",
"spacy.load",
"operator.itemgetter",
"preprocess_data.load_intents"
] | [((279, 327), 'keras.models.load_model', 'load_model', (['"""models/bidirectional_lstm/model.h5"""'], {}), "('models/bidirectional_lstm/model.h5')\n", (289, 327), False, 'from keras.models import load_model\n'), ((334, 350), 'spacy.load', 'spacy.load', (['"""en"""'], {}), "('en')\n", (344, 350), False, 'import spacy\n'... |
import argparse
import numpy as np
import os, sys
import keyboard
sys.path.append(os.path.dirname(os.path.dirname(os.path.dirname(__file__))))
from functions import (
assert_OBJ_exist_if_GRP_exist,
get_OBJECT_dict,
is_obj_grp_OBJ_GRP,
partition_str,
object_file_name,
print_if_worked,
)
parser ... | [
"functions.is_obj_grp_OBJ_GRP",
"argparse.ArgumentParser",
"functions.partition_str",
"functions.object_file_name",
"os.path.dirname",
"functions.get_OBJECT_dict",
"functions.assert_OBJ_exist_if_GRP_exist"
] | [((322, 413), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""view the grasps saved on the predetermined file"""'}), "(description=\n 'view the grasps saved on the predetermined file')\n", (345, 413), False, 'import argparse\n'), ((857, 896), 'functions.assert_OBJ_exist_if_GRP_exist', ... |
"""empty message
Revision ID: dc089ecc2c38
Revises: <PASSWORD>
Create Date: 2019-09-25 00:46:18.814508
"""
from alembic import op
# revision identifiers, used by Alembic.
revision = "dc089ecc2c38"
down_revision = "<PASSWORD>"
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated b... | [
"alembic.op.drop_index",
"alembic.op.f",
"alembic.op.create_index"
] | [((355, 405), 'alembic.op.drop_index', 'op.drop_index', (['"""ix_shops_name"""'], {'table_name': '"""shops"""'}), "('ix_shops_name', table_name='shops')\n", (368, 405), False, 'from alembic import op\n'), ((667, 731), 'alembic.op.create_index', 'op.create_index', (['"""ix_shops_name"""', '"""shops"""', "['name']"], {'u... |
import numpy as np
def train_test(
X: np.ndarray,
y: np.ndarray,
test_size: float,
random_seed: int = 0,
) -> tuple[np.ndarray, np.ndarray, np.ndarray, np.ndarray]:
"""
Split input data randomly after shuffling
Args:
X (np.ndarray): decision matrix
y (np.ndarray): ground-t... | [
"numpy.random.seed",
"numpy.arange",
"numpy.concatenate"
] | [((605, 632), 'numpy.random.seed', 'np.random.seed', (['random_seed'], {}), '(random_seed)\n', (619, 632), True, 'import numpy as np\n'), ((762, 784), 'numpy.arange', 'np.arange', (['num_samples'], {}), '(num_samples)\n', (771, 784), True, 'import numpy as np\n'), ((1939, 1966), 'numpy.random.seed', 'np.random.seed', (... |
"""
Special numbers utility functions.
"""
# pylint: disable=invalid-name
import math
def get_triangle_number(n: int) -> int:
"""Get Triangle number `T_n=n(n+1)/2` for a given number `n`."""
return (n * (n + 1)) // 2
def is_triangle_number(number: int) -> bool:
"""Check if a given number `number` is a ... | [
"math.sqrt"
] | [((381, 406), 'math.sqrt', 'math.sqrt', (['(8 * number + 1)'], {}), '(8 * number + 1)\n', (390, 406), False, 'import math\n'), ((857, 883), 'math.sqrt', 'math.sqrt', (['(24 * number + 1)'], {}), '(24 * number + 1)\n', (866, 883), False, 'import math\n'), ((1198, 1223), 'math.sqrt', 'math.sqrt', (['(8 * number + 1)'], {... |
# Author: <NAME>
# Angular Distribution Dependency Parser
# This is a python script that is placed into an Angular project directory and is run to obtain a list
# of unique npmjs package directories. It parsed the vendor source map header that contains the paths
# to all the files that are pulled in from the node_modu... | [
"os.path.dirname",
"os.path.isfile",
"glob.glob"
] | [((1834, 1855), 'os.path.dirname', 'os.path.dirname', (['path'], {}), '(path)\n', (1849, 1855), False, 'import glob, os\n'), ((568, 602), 'glob.glob', 'glob.glob', (['"""./dist/*/vendor.*.map"""'], {}), "('./dist/*/vendor.*.map')\n", (577, 602), False, 'import glob, os\n'), ((1663, 1683), 'os.path.isfile', 'os.path.isf... |
import pymysql
pymysql.version_info = (1,4,0, "final", 0)
pymysql.install_as_MySQLdb() | [
"pymysql.install_as_MySQLdb"
] | [((58, 86), 'pymysql.install_as_MySQLdb', 'pymysql.install_as_MySQLdb', ([], {}), '()\n', (84, 86), False, 'import pymysql\n')] |
from copy import copy
from typing import Optional, Union
import numpy as np
import torch
import torch.nn.functional as F
from torch import Tensor
from torch.autograd import grad
from tqdm import tqdm
from graphwar import Surrogate
from graphwar.attack.injection.injection_attacker import InjectionAttacker
... | [
"torch.topk",
"torch.autograd.grad",
"torch.nn.functional.cross_entropy",
"torch.cat",
"torch.as_tensor",
"torch.no_grad"
] | [((5311, 5348), 'torch.cat', 'torch.cat', (['[x, injected_feats]'], {'dim': '(0)'}), '([x, injected_feats], dim=0)\n', (5320, 5348), False, 'import torch\n'), ((5663, 5700), 'torch.nn.functional.cross_entropy', 'F.cross_entropy', (['logit', 'target_labels'], {}), '(logit, target_labels)\n', (5678, 5700), True, 'import ... |
from markdownio import block
def test_linebreak(document):
elem = block.HorizontalRule()
document.add(elem)
assert "---\n" == document.output()
| [
"markdownio.block.HorizontalRule"
] | [((72, 94), 'markdownio.block.HorizontalRule', 'block.HorizontalRule', ([], {}), '()\n', (92, 94), False, 'from markdownio import block\n')] |
""" Usage:
<file-name> --in=IN_FILE --langs=LANGUAGES --out=OUT_FILE [--debug]
"""
# External imports
import logging
import pdb
from pprint import pprint
from pprint import pformat
from docopt import docopt
from collections import defaultdict
from operator import itemgetter
from tqdm import tqdm
# Local imports
fr... | [
"tqdm.tqdm",
"logging.basicConfig",
"docopt.docopt",
"google_translate.google_translate",
"logging.info"
] | [((447, 462), 'docopt.docopt', 'docopt', (['__doc__'], {}), '(__doc__)\n', (453, 462), False, 'from docopt import docopt\n'), ((713, 756), 'logging.info', 'logging.info', (['f"""Writing output to {out_fn}"""'], {}), "(f'Writing output to {out_fn}')\n", (725, 756), False, 'import logging\n'), ((1249, 1269), 'logging.inf... |
"""Authors: <NAME>."""
from spikeextractors import load_extractor_from_pickle
from ..baserecordingextractorinterface import BaseRecordingExtractorInterface
from ..basesortingextractorinterface import BaseSortingExtractorInterface
from ....utils import FilePathType
class SIPickleRecordingExtractorInterface(BaseRecord... | [
"spikeextractors.load_extractor_from_pickle"
] | [((552, 598), 'spikeextractors.load_extractor_from_pickle', 'load_extractor_from_pickle', ([], {'pkl_file': 'file_path'}), '(pkl_file=file_path)\n', (578, 598), False, 'from spikeextractors import load_extractor_from_pickle\n'), ((966, 1012), 'spikeextractors.load_extractor_from_pickle', 'load_extractor_from_pickle', (... |
#!/usr/bin/env python
import rospy
import numpy as np
from smach import State, StateMachine, Sequence
from smach_ros import SimpleActionState, MonitorState, IntrospectionServer
# action message
import actionlib
from actionlib_msgs.msg import GoalStatus
from geometry_msgs.msg import Pose, Point, Quaternion, PoseStamp... | [
"vortex_msgs.msg.MoveGoal",
"smach.StateMachine",
"rospy.sleep",
"rospy.loginfo",
"rospy.init_node",
"rospy.get_name",
"rospy.spin"
] | [((835, 845), 'vortex_msgs.msg.MoveGoal', 'MoveGoal', ([], {}), '()\n', (843, 845), False, 'from vortex_msgs.msg import MoveAction, MoveGoal\n'), ((1173, 1237), 'rospy.init_node', 'rospy.init_node', (['"""move_to_and_inspect_point_sm"""'], {'anonymous': '(False)'}), "('move_to_and_inspect_point_sm', anonymous=False)\n"... |
import re
import copy
import random
from faker import Faker
from . import filth as filth_module
from .filth import Filth
from .detectors.known import KnownFilthItem
from typing import List, Dict, Union, Optional, Tuple
import pandas as pd
import sklearn.metrics
def get_filth_classification_report(
filth_li... | [
"pandas.DataFrame",
"random.randint",
"faker.Faker",
"faker.Faker.seed",
"re.finditer",
"pandas.merge",
"copy.copy",
"random.choice",
"pandas.isnull",
"random.seed"
] | [((8279, 8300), 'pandas.DataFrame', 'pd.DataFrame', (['results'], {}), '(results)\n', (8291, 8300), True, 'import pandas as pd\n'), ((11677, 11697), 'faker.Faker', 'Faker', ([], {'locale': 'locale'}), '(locale=locale)\n', (11682, 11697), False, 'from faker import Faker\n'), ((12247, 12263), 'faker.Faker.seed', 'Faker.s... |
# -*- encoding: utf-8 -*-
"""
@File : address.py
@Time : 2020/4/24 13:57
@Author : Tianjin
@Email : <EMAIL>
@Software: PyCharm
"""
from lin.exception import NotFound, ParameterException
from lin.interface import InfoCrud as Base
from sqlalchemy import Integer, Column, ForeignKey, String, Boolean
class Addre... | [
"sqlalchemy.String",
"lin.exception.NotFound",
"sqlalchemy.ForeignKey",
"sqlalchemy.Column"
] | [((370, 447), 'sqlalchemy.Column', 'Column', (['"""id"""', 'Integer'], {'primary_key': '(True)', 'autoincrement': '(True)', 'comment': '"""收货地址id"""'}), "('id', Integer, primary_key=True, autoincrement=True, comment='收货地址id')\n", (376, 447), False, 'from sqlalchemy import Integer, Column, ForeignKey, String, Boolean\n'... |
import numpy as np
import pandas as pd
from tqdm import tqdm
def map_prediction_to_emergence_label(results, training_values, test_values, predictors_to_run, test_terms,
emergence_linear_thresholds=(
('rapidly emergent', 0.1),
... | [
"pandas.DataFrame",
"tqdm.tqdm",
"numpy.polyfit"
] | [((3031, 3066), 'pandas.DataFrame', 'pd.DataFrame', (["{'terms': test_terms}"], {}), "({'terms': test_terms})\n", (3043, 3066), True, 'import pandas as pd\n'), ((919, 968), 'numpy.polyfit', 'np.polyfit', (['x_data', 'normalised_counts_to_trend', '(1)'], {}), '(x_data, normalised_counts_to_trend, 1)\n', (929, 968), True... |
#
# This file is part of scopedconfig software.
#
# Copyright (c) 2019, <NAME> <<EMAIL>>
# License: https://github.com/etingof/scopedconfig/blob/master/LICENSE.rst
#
import unittest
suite = unittest.TestLoader().loadTestsFromNames(
['tests.unit.__main__.suite']
)
if __name__ == '__main__':
unittest.TextTestR... | [
"unittest.TextTestRunner",
"unittest.TestLoader"
] | [((191, 212), 'unittest.TestLoader', 'unittest.TestLoader', ([], {}), '()\n', (210, 212), False, 'import unittest\n'), ((302, 338), 'unittest.TextTestRunner', 'unittest.TextTestRunner', ([], {'verbosity': '(2)'}), '(verbosity=2)\n', (325, 338), False, 'import unittest\n')] |
import json
from time import sleep
from Transliterator import transliterate_to_english
import requests
from bs4 import BeautifulSoup
path_raw = './data/raw/'
path_json = './data/json/'
url = "http://www.kashmirizabaan.com/eng_ver.php"
def query(key):
payload = f'meaning_target={key}&Submit=Go&lantype=hin&opt_di... | [
"json.dump",
"json.load",
"Transliterator.transliterate_to_english",
"time.sleep",
"bs4.BeautifulSoup",
"requests.request"
] | [((513, 573), 'requests.request', 'requests.request', (['"""POST"""', 'url'], {'data': 'payload', 'headers': 'headers'}), "('POST', url, data=payload, headers=headers)\n", (529, 573), False, 'import requests\n'), ((1490, 1522), 'bs4.BeautifulSoup', 'BeautifulSoup', (['page_text', '"""lxml"""'], {}), "(page_text, 'lxml'... |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Data Series Sonification
========================
Functionality for sonifying data series.
"""
import warnings
from inspect import signature, Parameter
import numpy as np
from astropy.table import Table, MaskedColumn
from astropy.time import Time
... | [
"numpy.isnan",
"pyo.Server",
"numpy.diff",
"inspect.signature",
"warnings.warn",
"numpy.repeat"
] | [((4450, 4462), 'pyo.Server', 'pyo.Server', ([], {}), '()\n', (4460, 4462), False, 'import pyo\n'), ((8386, 8422), 'numpy.repeat', 'np.repeat', (["self.data['asf_pitch']", '(2)'], {}), "(self.data['asf_pitch'], 2)\n", (8395, 8422), True, 'import numpy as np\n'), ((8440, 8477), 'numpy.repeat', 'np.repeat', (["self.data[... |
"""
This prints a list of publicly accessible resources in a group
"""
from django.core.management.base import BaseCommand
from hs_access_control.models import GroupAccess
def usage():
print("groups_with_public_resources usage:")
print(" groups_with_public_resources ")
def shorten(title, length):
if ... | [
"hs_access_control.models.GroupAccess.groups_with_public_resources"
] | [((759, 801), 'hs_access_control.models.GroupAccess.groups_with_public_resources', 'GroupAccess.groups_with_public_resources', ([], {}), '()\n', (799, 801), False, 'from hs_access_control.models import GroupAccess\n')] |
from datetime import datetime
import gzip
import json
import os
from pytest import fixture
from time import sleep
from baq.operations import backup, restore
from baq.backends import FileBackend
@fixture
def sample_age_key(temp_dir):
secret_key_path = temp_dir / 'age_key'
secret_key_path.write_text('<KEY>')
... | [
"baq.backends.FileBackend",
"json.loads",
"time.sleep",
"datetime.datetime.utcnow",
"baq.operations.backup",
"os.urandom",
"baq.operations.restore"
] | [((649, 688), 'baq.backends.FileBackend', 'FileBackend', (["(temp_dir / 'backup_target')"], {}), "(temp_dir / 'backup_target')\n", (660, 688), False, 'from baq.backends import FileBackend\n'), ((709, 786), 'baq.operations.backup', 'backup', (["(temp_dir / 'src')"], {'backend': 'backend', 'recipients': '[]', 'recipients... |
import logging
import random as rnd
import lea
import scapy.layers.inet as inet
import Attack.BaseAttack as BaseAttack
import Lib.Utility as Util
from Attack.Parameter import Parameter, Boolean, Float, IPAddress, MACAddress, Port
logging.getLogger("scapy.runtime").setLevel(logging.ERROR)
# noinspection PyPep8
cl... | [
"Attack.Parameter.IPAddress",
"random.randint",
"random.shuffle",
"lea.Lea.fromValFreqsDict",
"scapy.layers.inet.TCP",
"Attack.Parameter.Boolean",
"random.choice",
"scapy.layers.inet.Ether",
"scapy.layers.inet.IP",
"Attack.Parameter.Float",
"Attack.Parameter.Port",
"Attack.Parameter.MACAddress... | [((234, 268), 'logging.getLogger', 'logging.getLogger', (['"""scapy.runtime"""'], {}), "('scapy.runtime')\n", (251, 268), False, 'import logging\n'), ((4444, 4465), 'random.randint', 'rnd.randint', (['(1)', '(65535)'], {}), '(1, 65535)\n', (4455, 4465), True, 'import random as rnd\n'), ((4293, 4316), 'random.shuffle', ... |
#! python3
"""Walks through a folder tree and copies every file with a given extensison
to a new folder."""
import os, sys, shutil
from pathlib import Path
def main(args):
"""Walks through the current working directory and copies files with a given extension."""
for folder, subfolders, files in os.walk... | [
"pathlib.Path.cwd",
"sys.exit"
] | [((321, 331), 'pathlib.Path.cwd', 'Path.cwd', ([], {}), '()\n', (329, 331), False, 'from pathlib import Path\n'), ((822, 832), 'sys.exit', 'sys.exit', ([], {}), '()\n', (830, 832), False, 'import os, sys, shutil\n'), ((567, 577), 'pathlib.Path.cwd', 'Path.cwd', ([], {}), '()\n', (575, 577), False, 'from pathlib import ... |
import pickle
import numpy as np
import pandas as pd
from keras.utils import np_utils
from keras.utils.vis_utils import plot_model
from keras.models import Sequential
from keras.preprocessing.sequence import pad_sequences
from keras.layers import LSTM, Dense, Embedding, Dropout
from sklearn.model_selection import train... | [
"pickle.dump",
"numpy.argmax",
"pandas.read_csv",
"keras.preprocessing.sequence.pad_sequences",
"sklearn.model_selection.train_test_split",
"keras.utils.vis_utils.plot_model",
"sklearn.metrics.accuracy_score",
"keras.layers.LSTM",
"keras.layers.Dropout",
"time.time",
"keras.utils.np_utils.to_cat... | [((632, 653), 'pandas.read_csv', 'pd.read_csv', (['filepath'], {}), '(filepath)\n', (643, 653), True, 'import pandas as pd\n'), ((1586, 1657), 'keras.preprocessing.sequence.pad_sequences', 'pad_sequences', ([], {'maxlen': 'input_shape', 'sequences': 'x', 'padding': '"""post"""', 'value': '(0)'}), "(maxlen=input_shape, ... |
import os
from src.Background import Background
from PIL import Image
# Class that represents the whole set of background images in the application
class BackgroundSet:
def __init__(self, directory):
self.directory = directory
self.number_of_backgrounds = 0
self.background_images = []
... | [
"os.listdir",
"PIL.Image.open"
] | [((377, 403), 'os.listdir', 'os.listdir', (['self.directory'], {}), '(self.directory)\n', (387, 403), False, 'import os\n'), ((502, 529), 'PIL.Image.open', 'Image.open', (['image_path', '"""r"""'], {}), "(image_path, 'r')\n", (512, 529), False, 'from PIL import Image\n')] |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import io
import os
import sys
from setuptools import find_packages, setup, Command
# Package meta-data.
NAME = 'Commit-Man'
DESCRIPTION = 'Official Commit man python package'
URL = 'https://github.com/atharva-Gundawar/commit-man'
EMAIL = '<EMAIL>'
AUTHOR = '<NAME>'
REQU... | [
"os.path.dirname",
"os.path.join",
"setuptools.find_packages"
] | [((448, 473), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (463, 473), False, 'import os\n'), ((989, 1004), 'setuptools.find_packages', 'find_packages', ([], {}), '()\n', (1002, 1004), False, 'from setuptools import find_packages, setup, Command\n'), ((498, 529), 'os.path.join', 'os.path.jo... |
import re
import os
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.intersphinx',
'sphinx.ext.coverage']
master_doc = 'index'
project = 'cairocffi'
copyright = '2013, <NAME>'
release = re.search(
"VERSION = '([^']+)'",
open(os.path.join(os.path.dirname(__file__), os.pardir,
'cairocffi', ... | [
"os.path.dirname"
] | [((260, 285), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (275, 285), False, 'import os\n')] |
from Components.Sources.Source import Source
class CurrentService(Source):
def __init__(self, session):
Source.__init__(self)
self.session = session
def command(self):
currentServiceRef = self.session.nav.getCurrentlyPlayingServiceReference()
if currentServiceRef is not None:
text = currentServiceRef.toS... | [
"Components.Sources.Source.Source.__init__"
] | [((108, 129), 'Components.Sources.Source.Source.__init__', 'Source.__init__', (['self'], {}), '(self)\n', (123, 129), False, 'from Components.Sources.Source import Source\n')] |
from pyregions.utilities import table_utilities
import pytest
@pytest.mark.parametrize(
"columns,expected",
[
(['abc', '123', 456], ['123',456]),
(["13.4", 'aslkjnsf12312ll'], ['13.4'])
]
)
def test_get_numeric_columns(columns, expected):
result = table_utilities.get_numeric_columns(columns)
assert result == ... | [
"pytest.mark.parametrize",
"pyregions.utilities.table_utilities._get_delimiter",
"pyregions.utilities.table_utilities.get_numeric_columns"
] | [((64, 192), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""columns,expected"""', "[(['abc', '123', 456], ['123', 456]), (['13.4', 'aslkjnsf12312ll'], ['13.4'])]"], {}), "('columns,expected', [(['abc', '123', 456], ['123', \n 456]), (['13.4', 'aslkjnsf12312ll'], ['13.4'])])\n", (87, 192), False, 'import... |
# coding: utf-8
import base64
from decimal import *
from .asset import Asset
from .stellarxdr import Xdr
from .utils import account_xdr_object, signer_key_xdr_object, encode_check, best_rational_approximation as best_r, division, decode_check
from .utils import XdrLengthError, DecodeError
ONE = Decimal(10 ** 7)
cla... | [
"base64.b64decode"
] | [((1531, 1552), 'base64.b64decode', 'base64.b64decode', (['xdr'], {}), '(xdr)\n', (1547, 1552), False, 'import base64\n')] |
import sqlite3
class DatabaseError(Exception):
pass
class Database:
def __init__(self, db_path):
self.db_path = db_path
# connect
conn = sqlite3.connect(self.db_path)
cursor = conn.cursor()
# check if table exists, or create one
tables = cursor.execute("SELECT... | [
"sqlite3.connect"
] | [((172, 201), 'sqlite3.connect', 'sqlite3.connect', (['self.db_path'], {}), '(self.db_path)\n', (187, 201), False, 'import sqlite3\n'), ((660, 689), 'sqlite3.connect', 'sqlite3.connect', (['self.db_path'], {}), '(self.db_path)\n', (675, 689), False, 'import sqlite3\n'), ((1483, 1512), 'sqlite3.connect', 'sqlite3.connec... |
from flask_assets import Bundle, Environment
scss_styles = Bundle( # pylint: disable=invalid-name
'src/app/scss/styles.scss',
filters='libsass',
depends='**/*.scss',
output='build/css/styles.css',
)
css_styles = Bundle( # pylint: disable=invalid-name
scss_styles,
filters='autoprefixer6',
... | [
"flask_assets.Bundle"
] | [((61, 170), 'flask_assets.Bundle', 'Bundle', (['"""src/app/scss/styles.scss"""'], {'filters': '"""libsass"""', 'depends': '"""**/*.scss"""', 'output': '"""build/css/styles.css"""'}), "('src/app/scss/styles.scss', filters='libsass', depends='**/*.scss',\n output='build/css/styles.css')\n", (67, 170), False, 'from fl... |
# Python Standard Libraries
import warnings
import time
import os
import sys
from pathlib import Path
# Third party imports
# fancy prints
import numpy as np
from tqdm import tqdm
# grAdapt package
import grAdapt.utils.math
import grAdapt.utils.misc
import grAdapt.utils.sampling
from grAdapt import surrogate as sur, ... | [
"numpy.random.seed",
"grAdapt.sampling.equidistributed.MaximalMinDistance",
"grAdapt.surrogate.GPRSlidingWindow",
"grAdapt.optimizer.AMSGradBisection",
"numpy.array",
"numpy.linalg.norm",
"warnings.warn",
"grAdapt.escape.NormalDistributionDecay"
] | [((1506, 1539), 'numpy.random.seed', 'np.random.seed', (['self.random_state'], {}), '(self.random_state)\n', (1520, 1539), True, 'import numpy as np\n'), ((1600, 1622), 'grAdapt.surrogate.GPRSlidingWindow', 'sur.GPRSlidingWindow', ([], {}), '()\n', (1620, 1622), True, 'from grAdapt import surrogate as sur, optimizer as... |
import unittest
from inan.util.setproctitle import setproctitle
class TestSetProcTitle(unittest.TestCase):
def test_does_not_crash(self):
setproctitle("inan test title")
| [
"inan.util.setproctitle.setproctitle"
] | [((153, 184), 'inan.util.setproctitle.setproctitle', 'setproctitle', (['"""inan test title"""'], {}), "('inan test title')\n", (165, 184), False, 'from inan.util.setproctitle import setproctitle\n')] |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
# -*- coding: utf-8 -*-
from asdf import yamlutil
from asdf.versioning import AsdfSpec
from ..types import AstronomyDataModelType
from ..obs_context import ObsContext
class ObsContextType(AstronomyDataModelType):
name = 'datamodel/obs_context'
ve... | [
"asdf.yamlutil.tagged_tree_to_custom_tree",
"asdf.yamlutil.custom_tree_to_tagged_tree"
] | [((617, 673), 'asdf.yamlutil.custom_tree_to_tagged_tree', 'yamlutil.custom_tree_to_tagged_tree', (['node.telescope', 'ctx'], {}), '(node.telescope, ctx)\n', (652, 673), False, 'from asdf import yamlutil\n'), ((744, 801), 'asdf.yamlutil.custom_tree_to_tagged_tree', 'yamlutil.custom_tree_to_tagged_tree', (['node.instrume... |
import pandas as pd
from bs4 import BeautifulSoup
from urllib.request import urlopen
class nba_request():
def __init__(self):
self.url = 'https://www.basketball-reference.com/leagues/NBA_' # NOT A FULL URL
def totals(self, url, year):
""" This gets the total statistics in a season
... | [
"bs4.BeautifulSoup",
"urllib.request.urlopen",
"pandas.DataFrame"
] | [((3433, 3446), 'urllib.request.urlopen', 'urlopen', (['temp'], {}), '(temp)\n', (3440, 3446), False, 'from urllib.request import urlopen\n'), ((3462, 3498), 'bs4.BeautifulSoup', 'BeautifulSoup', (['html'], {'features': '"""lxml"""'}), "(html, features='lxml')\n", (3475, 3498), False, 'from bs4 import BeautifulSoup\n')... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""CLI Interface to Walletlib
This is a simple implementation to allow walletlib to be used from the cli.
It will certainly gain more features as they are added. Currently it takes a wallet.dat file and dumps either a full
seet of its contents or just the keys out.
"""
... | [
"walletlib.ProtobufWallet.load",
"click.option",
"click.echo",
"walletlib.Walletdat.load",
"click.command",
"json.dumps",
"click.Path"
] | [((395, 410), 'click.command', 'click.command', ([], {}), '()\n', (408, 410), False, 'import click\n'), ((470, 545), 'click.option', 'click.option', (['"""-p"""', '"""--password"""'], {'help': '"""Password if any"""', 'type': 'click.STRING'}), "('-p', '--password', help='Password if any', type=click.STRING)\n", (482, 5... |
from django.http import HttpResponse
from django.template import loader
def customer_weekly(request, site_id):
template = loader.get_template('customer_weekly.html')
context = {
# 'site_id' : site_id,
}
return HttpResponse(template.render(context, request))
def serve_svg(request):
template ... | [
"django.template.loader.get_template"
] | [((127, 170), 'django.template.loader.get_template', 'loader.get_template', (['"""customer_weekly.html"""'], {}), "('customer_weekly.html')\n", (146, 170), False, 'from django.template import loader\n'), ((322, 359), 'django.template.loader.get_template', 'loader.get_template', (['"""serve_svg.html"""'], {}), "('serve_... |
#!/usr/bin/env python3
"""
Set effective registration.
**Note**: This is generally for testing only and should be done automatically via
`jaws-effective-processor <https://github.com/JeffersonLab/jaws-effective-processor>`_
"""
import click
from jaws_libp.clients import EffectiveRegistrationProducer
from... | [
"click.argument",
"click.option",
"click.command",
"jaws_libp.entities.SimpleProducer",
"jaws_libp.clients.EffectiveRegistrationProducer",
"jaws_libp.entities.EffectiveRegistration"
] | [((716, 731), 'click.command', 'click.command', ([], {}), '()\n', (729, 731), False, 'import click\n'), ((733, 828), 'click.option', 'click.option', (['"""--unset"""'], {'is_flag': '(True)', 'help': '"""present to clear state, missing to set state"""'}), "('--unset', is_flag=True, help=\n 'present to clear state, mi... |
#!/usr/bin/python3
"""modelling.py
Various utility functions for modelling
"""
__author__ = "<NAME>"
import os
import numpy as np
import tensorflow as tf
from tensorflow.keras.callbacks import Callback
from tensorflow.keras.models import Model
from tensorflow.keras.layers import Activation, BatchNormalization, \... | [
"tensorflow.keras.layers.Dense",
"tensorflow.keras.layers.concatenate",
"tensorflow.keras.layers.Masking",
"os.path.join",
"tensorflow.keras.losses.SparseCategoricalCrossentropy",
"tensorflow.keras.layers.BatchNormalization",
"nicu_los.src.utils.custom_keras_layers.ApplyMask",
"tensorflow.keras.losses... | [((1471, 1507), 'tensorflow.keras.layers.Input', 'Input', ([], {'shape': '(None, input_dimension)'}), '(shape=(None, input_dimension))\n', (1476, 1507), False, 'from tensorflow.keras.layers import Activation, BatchNormalization, Bidirectional, concatenate, Conv1D, Dense, Dropout, GlobalAveragePooling1D, GRU, Input, LST... |
#!/usr/bin/env python
#
# Copyright (c) 2005-2007 <NAME> <<EMAIL>>
# Copyright (c) 2007-2012 <NAME> and <NAME>
# All rights reserved.
#
# Generates marshaling code based on libevent.
# pylint: disable=too-many-lines
# pylint: disable=too-many-branches
# pylint: disable=too-many-public-methods
# pylint: disable=too-man... | [
"argparse.ArgumentParser",
"re.escape",
"sys.stderr.write",
"re.sub",
"argparse.FileType",
"re.compile"
] | [((760, 783), 're.compile', 're.compile', (['"""\\\\/\\\\/.*$"""'], {}), "('\\\\/\\\\/.*$')\n", (770, 783), False, 'import re\n'), ((797, 814), 're.compile', 're.compile', (['"""\\\\W"""'], {}), "('\\\\W')\n", (807, 814), False, 'import re\n'), ((837, 859), 're.compile', 're.compile', (['"""^#define"""'], {}), "('^#def... |