code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
import math
import torch
import torch.nn as nn
from torch.autograd import grad
from stadyn.anode import ODEBlock
from stadyn.mlp import MLP
from stadyn.geometry import *
from stadyn.lyapunov import CandFun
from stadyn.utils import *
def _is_almost_zero(x, eps:float):
if type(x) is torch.Tensor:
return to... | [
"torch.ones_like",
"torch.mean",
"stadyn.mlp.MLP",
"torch.zeros_like",
"stadyn.anode.ODEBlock",
"torch.autograd.grad",
"torch.sum",
"torch.cat",
"torch.pow",
"torch.max",
"torch.zeros",
"torch.abs",
"stadyn.lyapunov.CandFun"
] | [((645, 678), 'torch.ones_like', 'torch.ones_like', (['x'], {'device': 'device'}), '(x, device=device)\n', (660, 678), False, 'import torch\n'), ((887, 924), 'torch.zeros_like', 'torch.zeros_like', (['out3'], {'device': 'device'}), '(out3, device=device)\n', (903, 924), False, 'import torch\n'), ((1165, 1273), 'stadyn.... |
from setuptools import setup, find_packages
requirements = [
"azure.common",
"azure.keyvault",
"cryptography"
]
setup(
name="azure-custom-data-encryption",
version="0.0.1",
description="",
long_description="",
url="",
packages=find_packages(include=["azure_encryption_helper"]),
... | [
"setuptools.find_packages"
] | [((265, 315), 'setuptools.find_packages', 'find_packages', ([], {'include': "['azure_encryption_helper']"}), "(include=['azure_encryption_helper'])\n", (278, 315), False, 'from setuptools import setup, find_packages\n')] |
from __future__ import absolute_import
import numpy as np
from targets.marshalling.marshaller import Marshaller
from targets.target_config import FileFormat
class NumpyArrayMarshaller(Marshaller):
type = np.ndarray
file_format = FileFormat.numpy
def target_to_value(self, target, **kwargs):
"""
... | [
"numpy.load",
"numpy.save"
] | [((867, 916), 'numpy.load', 'np.load', (['target.path'], {'allow_pickle': '(True)'}), '(target.path, allow_pickle=True, **kwargs)\n', (874, 916), True, 'import numpy as np\n'), ((982, 1038), 'numpy.save', 'np.save', (['target.path', 'value'], {'allow_pickle': '(True)'}), '(target.path, value, allow_pickle=True, **kwarg... |
from datetime import timedelta
from urllib.parse import urlparse, urlencode
from django.conf import settings
from django.contrib.staticfiles import finders
from django.dispatch import receiver
from django.http import HttpRequest, HttpResponse
from django.template.loader import get_template
from django.urls import reso... | [
"pretix.base.middleware._merge_csp",
"django.contrib.staticfiles.finders.find",
"django.utils.translation.gettext_lazy",
"django.dispatch.receiver",
"pretix.base.middleware._render_csp",
"django.urls.reverse",
"pretix.base.middleware._parse_csp",
"datetime.timedelta",
"django.urls.resolve",
"urlli... | [((1536, 1590), 'django.dispatch.receiver', 'receiver', (['order_info'], {'dispatch_uid': '"""stay22_order_info"""'}), "(order_info, dispatch_uid='stay22_order_info')\n", (1544, 1590), False, 'from django.dispatch import receiver\n'), ((2437, 2509), 'django.dispatch.receiver', 'receiver', ([], {'signal': 'process_respo... |
from toontown.safezone import DLPlayground
from toontown.safezone import SafeZoneLoader
class DLSafeZoneLoader(SafeZoneLoader.SafeZoneLoader):
def __init__(self, hood, parentFSM, doneEvent):
SafeZoneLoader.SafeZoneLoader.__init__(self, hood, parentFSM, doneEvent)
self.playgroundClass = DLPlaygroun... | [
"toontown.safezone.SafeZoneLoader.SafeZoneLoader.__init__"
] | [((205, 277), 'toontown.safezone.SafeZoneLoader.SafeZoneLoader.__init__', 'SafeZoneLoader.SafeZoneLoader.__init__', (['self', 'hood', 'parentFSM', 'doneEvent'], {}), '(self, hood, parentFSM, doneEvent)\n', (243, 277), False, 'from toontown.safezone import SafeZoneLoader\n')] |
from django.urls import path
from library.views import BooksView, BookView
urlpatterns = [
path('v1/library/books', BooksView.as_view()),
path('v1/library/book/<pk>/', BookView.as_view()),
] | [
"library.views.BookView.as_view",
"library.views.BooksView.as_view"
] | [((122, 141), 'library.views.BooksView.as_view', 'BooksView.as_view', ([], {}), '()\n', (139, 141), False, 'from library.views import BooksView, BookView\n'), ((178, 196), 'library.views.BookView.as_view', 'BookView.as_view', ([], {}), '()\n', (194, 196), False, 'from library.views import BooksView, BookView\n')] |
# Generated by Django 4.0 on 2022-01-09 17:50
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('auth', '0012_alter_user_first_name_max_length'),
('neighbourhood', '0008_alter_business_business_neighbourhood'),
... | [
"django.db.models.ForeignKey",
"django.db.models.TextField",
"django.db.models.CharField"
] | [((453, 480), 'django.db.models.TextField', 'models.TextField', ([], {'null': '(True)'}), '(null=True)\n', (469, 480), False, 'from django.db import migrations, models\n'), ((610, 756), 'django.db.models.ForeignKey', 'models.ForeignKey', ([], {'null': '(True)', 'on_delete': 'django.db.models.deletion.CASCADE', 'related... |
from django.conf.urls import patterns, url
from rest_auth.views import (Login, Logout, UserDetails, PasswordChange,
PasswordReset, PasswordResetConfirm)
urlpatterns = patterns('',
# URLs that do not require a session or valid token
url(r'^password/reset/$', PasswordReset.as_view(),
name='rest_passwo... | [
"rest_auth.views.UserDetails.as_view",
"rest_auth.views.Logout.as_view",
"rest_auth.views.PasswordReset.as_view",
"rest_auth.views.PasswordResetConfirm.as_view",
"rest_auth.views.Login.as_view",
"rest_auth.views.PasswordChange.as_view"
] | [((270, 293), 'rest_auth.views.PasswordReset.as_view', 'PasswordReset.as_view', ([], {}), '()\n', (291, 293), False, 'from rest_auth.views import Login, Logout, UserDetails, PasswordChange, PasswordReset, PasswordResetConfirm\n'), ((370, 400), 'rest_auth.views.PasswordResetConfirm.as_view', 'PasswordResetConfirm.as_vie... |
import matplotlib.pyplot as plt
import seaborn as sb
from pathlib import Path
def get_model_path(experiment, model_number):
"""Get all the trained model paths from experiment.
Parameters
----------
experiment : str
Which experiment trained models to load.
Returns
-------
model pa... | [
"pathlib.Path"
] | [((373, 387), 'pathlib.Path', 'Path', (['__file__'], {}), '(__file__)\n', (377, 387), False, 'from pathlib import Path\n'), ((621, 635), 'pathlib.Path', 'Path', (['__file__'], {}), '(__file__)\n', (625, 635), False, 'from pathlib import Path\n'), ((748, 762), 'pathlib.Path', 'Path', (['__file__'], {}), '(__file__)\n', ... |
import pygame
# initialize sounds
pygame.mixer.init(buffer=200) # This can be increased for better sound quality, but causes latency (incorrect tempo)
pygame.mixer.set_num_channels(100)
# Set variables used to represent the arrows in each cell
LEFT = ((10, 37.5), (65, 10), (65, 65))
RIGHT = ((10, 10), (10, 65), (65... | [
"pygame.Surface",
"pygame.sprite.collide_rect",
"pygame.mixer.init",
"pygame.mixer.set_num_channels",
"pygame.sprite.Sprite.__init__",
"pygame.draw.polygon"
] | [((35, 64), 'pygame.mixer.init', 'pygame.mixer.init', ([], {'buffer': '(200)'}), '(buffer=200)\n', (52, 64), False, 'import pygame\n'), ((154, 188), 'pygame.mixer.set_num_channels', 'pygame.mixer.set_num_channels', (['(100)'], {}), '(100)\n', (183, 188), False, 'import pygame\n'), ((1722, 1757), 'pygame.sprite.Sprite._... |
from flask_dbshell import DbShell
from flask_migrate import Migrate, MigrateCommand
from flask_script import Manager, Shell,Server
from pitches.app import db,create_app
from pitches.models import User, Role, Permission, Topic, TopicGroup, Comment, PollVote, PollAnswer, Message
app = create_app()
manager = Manager... | [
"pitches.models.Role.insert_roles",
"utils.data_generator.generate_fake_topics",
"utils.data_generator.generate_fake_votes",
"unittest.TextTestRunner",
"flask_script.Manager",
"utils.data_generator.generate_fake_users",
"pitches.app.create_app",
"flask_migrate.Migrate",
"pitches.models.TopicGroup.in... | [((290, 302), 'pitches.app.create_app', 'create_app', ([], {}), '()\n', (300, 302), False, 'from pitches.app import db, create_app\n'), ((313, 325), 'flask_script.Manager', 'Manager', (['app'], {}), '(app)\n', (320, 325), False, 'from flask_script import Manager, Shell, Server\n'), ((336, 352), 'flask_migrate.Migrate',... |
#!/usr/bin/env python
from __future__ import absolute_import
from __future__ import print_function
import os
import sys
def words(line):
"""Splits a line of text into tokens."""
return line.strip().split()
def create_vocabulary(lines, max_vocab, min_count=5):
"""Reads text lines and generates a vocabul... | [
"sys.stdout.write",
"os.path.dirname",
"os.path.exists",
"sys.stdout.flush"
] | [((826, 848), 'sys.stdout.write', 'sys.stdout.write', (['"""\n"""'], {}), "('\\n')\n", (842, 848), False, 'import sys\n'), ((1256, 1281), 'os.path.exists', 'os.path.exists', (['data_path'], {}), '(data_path)\n', (1270, 1281), False, 'import os\n'), ((1312, 1338), 'os.path.dirname', 'os.path.dirname', (['data_path'], {}... |
# <NAME>, April 2020
from helper_fns import *
import numpy as np
import matplotlib.pyplot as plt
import math
from bson import objectid
data = process_lookup2() # Takes ~10 seconds
def flip_state(s):
return [1] + s[10:] + s[1:10]
def get_cost_per_game(user, game):
if game["_id"] == objectid.ObjectId("... | [
"numpy.average",
"matplotlib.pyplot.show",
"bson.objectid.ObjectId",
"matplotlib.pyplot.twinx"
] | [((2468, 2479), 'matplotlib.pyplot.twinx', 'plt.twinx', ([], {}), '()\n', (2477, 2479), True, 'import matplotlib.pyplot as plt\n'), ((2605, 2615), 'matplotlib.pyplot.show', 'plt.show', ([], {}), '()\n', (2613, 2615), True, 'import matplotlib.pyplot as plt\n'), ((1249, 1266), 'numpy.average', 'np.average', (['costs'], {... |
# The MIT License (MIT)
#
# Copyright (c) 2020 Aibolit
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, m... | [
"networkx.dfs_tree",
"deprecated.deprecated",
"aibolit.utils.cfg_builder.build_cfg"
] | [((1570, 1633), 'deprecated.deprecated', 'deprecated', (['"""This functionality must be transmitted to ASTNode"""'], {}), "('This functionality must be transmitted to ASTNode')\n", (1580, 1633), False, 'from deprecated import deprecated\n'), ((4436, 4451), 'aibolit.utils.cfg_builder.build_cfg', 'build_cfg', (['self'], ... |
from dragonfly import Repeat, Choice, MappingRule
from castervoice.lib.actions import Key
from castervoice.lib.ctrl.mgr.rule_details import RuleDetails
from castervoice.lib.merge.additions import IntegerRefST
from castervoice.lib.merge.state.short import R
class LyxRule(MappingRule):
mapping = {
"new file... | [
"castervoice.lib.actions.Key",
"castervoice.lib.ctrl.mgr.rule_details.RuleDetails",
"castervoice.lib.merge.additions.IntegerRefST",
"dragonfly.Repeat",
"dragonfly.Choice"
] | [((794, 818), 'castervoice.lib.merge.additions.IntegerRefST', 'IntegerRefST', (['"""n"""', '(1)', '(10)'], {}), "('n', 1, 10)\n", (806, 818), False, 'from castervoice.lib.merge.additions import IntegerRefST\n'), ((828, 1476), 'dragonfly.Choice', 'Choice', (['"""environment"""', "{'(in line formula | in line)': 'i', '(d... |
from compilation.errors import IncorrectCallError
from compilation.tokens import Token
class Context:
def __init__(self):
self.variables = {}
self.funciones = {}
self.errors = []
self.contextPadre = None
self.enfuncion = None
self.enwhile = None
def clear(self)... | [
"compilation.errors.IncorrectCallError"
] | [((3429, 3552), 'compilation.errors.IncorrectCallError', 'IncorrectCallError', (['"""there is no variable with this name accessible from this scope"""', '""""""', 'token.line', 'token.column'], {}), "(\n 'there is no variable with this name accessible from this scope', '',\n token.line, token.column)\n", (3447, 3... |
from django.db import models
from django.contrib.auth.models import User
from django.utils.timezone import now
# Create your models here.
class UserIncome(models.Model):
amount = models.FloatField() # DECIMAL
date = models.DateField(default=now)
description = models.TextField()
owner = models.Foreig... | [
"django.db.models.TextField",
"django.db.models.ForeignKey",
"django.db.models.CharField",
"django.db.models.FloatField",
"django.db.models.DateField"
] | [((186, 205), 'django.db.models.FloatField', 'models.FloatField', ([], {}), '()\n', (203, 205), False, 'from django.db import models\n'), ((228, 257), 'django.db.models.DateField', 'models.DateField', ([], {'default': 'now'}), '(default=now)\n', (244, 257), False, 'from django.db import models\n'), ((276, 294), 'django... |
import pyrealsense2 as rs
import numpy as np
import datetime as dt
import time
import multiprocessing as mp
import os
# import mpio
import cv2
from queue import Queue
import threading as th
class RecordingJob(th.Thread):
def __init__(self, video_name, queue):
super(RecordingJob, self).__init__()
... | [
"os.mkdir",
"cv2.VideoWriter_fourcc",
"pyrealsense2.pipeline",
"cv2.waitKey",
"numpy.asanyarray",
"os.path.exists",
"pyrealsense2.config",
"time.sleep",
"time.time",
"threading.Event",
"cv2.VideoWriter",
"cv2.imshow",
"datetime.datetime.now",
"queue.Queue"
] | [((1350, 1357), 'queue.Queue', 'Queue', ([], {}), '()\n', (1355, 1357), False, 'from queue import Queue\n'), ((1513, 1526), 'pyrealsense2.pipeline', 'rs.pipeline', ([], {}), '()\n', (1524, 1526), True, 'import pyrealsense2 as rs\n'), ((1540, 1551), 'pyrealsense2.config', 'rs.config', ([], {}), '()\n', (1549, 1551), Tru... |
# Copyright (c) 2019-2021 CRS4
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribut... | [
"numpy.zeros",
"pytest.mark.parametrize",
"pytest.raises",
"numpy.array"
] | [((1302, 1355), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""ecvl"""', '[ecvl_core, ecvl_py]'], {}), "('ecvl', [ecvl_core, ecvl_py])\n", (1325, 1355), False, 'import pytest\n'), ((1733, 1786), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""ecvl"""', '[ecvl_core, ecvl_py]'], {}), "('ecvl', [e... |
##############################################################################
# Copyright (c) 2019 <NAME>, <NAME>, and others.
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accompanies this distribution, and is avail... | [
"django.template.loader.render_to_string",
"account.models.PublicNetwork.objects.get",
"resource_inventory.models.Vlan.objects.filter"
] | [((1537, 1577), 'django.template.loader.render_to_string', 'render_to_string', (['template'], {'context': 'info'}), '(template, context=info)\n', (1553, 1577), False, 'from django.template.loader import render_to_string\n'), ((2432, 2500), 'account.models.PublicNetwork.objects.get', 'PublicNetwork.objects.get', ([], {'... |
import esphome.codegen as cg
import esphome.config_validation as cv
from esphome.components import light, output
from esphome.const import CONF_OUTPUT_ID, CONF_OUTPUT
monochromatic_ns = cg.esphome_ns.namespace("monochromatic")
MonochromaticLightOutput = monochromatic_ns.class_(
"MonochromaticLightOutput", light.Li... | [
"esphome.config_validation.use_id",
"esphome.config_validation.Required",
"esphome.components.light.register_light",
"esphome.codegen.get_variable",
"esphome.codegen.new_Pvariable",
"esphome.config_validation.GenerateID",
"esphome.config_validation.declare_id",
"esphome.codegen.esphome_ns.namespace"
] | [((187, 227), 'esphome.codegen.esphome_ns.namespace', 'cg.esphome_ns.namespace', (['"""monochromatic"""'], {}), "('monochromatic')\n", (210, 227), True, 'import esphome.codegen as cg\n'), ((590, 630), 'esphome.codegen.new_Pvariable', 'cg.new_Pvariable', (['config[CONF_OUTPUT_ID]'], {}), '(config[CONF_OUTPUT_ID])\n', (6... |
import requests
from requests.auth import HTTPBasicAuth
from requests.exceptions import HTTPError
import configparser
import json
import paramiko
# Load the configuration file
config = configparser.ConfigParser()
config.read('config.ini')
# Set the proxy to Call the Microsoft Teams WebHook
proxyDict = {
'http... | [
"paramiko.SSHClient",
"json.dumps",
"requests.auth.HTTPBasicAuth",
"configparser.ConfigParser",
"paramiko.AutoAddPolicy"
] | [((186, 213), 'configparser.ConfigParser', 'configparser.ConfigParser', ([], {}), '()\n', (211, 213), False, 'import configparser\n'), ((1442, 1462), 'paramiko.SSHClient', 'paramiko.SSHClient', ([], {}), '()\n', (1460, 1462), False, 'import paramiko\n'), ((653, 684), 'requests.auth.HTTPBasicAuth', 'HTTPBasicAuth', (['"... |
from rest_framework import status
from core.tests.mommy_utils import make_recipe
from core.tests.test_base import NestedSimpleResourceAPIMixin
from legalaid.utils import diversity
class PersonalDetailsAPIMixin(NestedSimpleResourceAPIMixin):
LOOKUP_KEY = "case_reference"
PARENT_LOOKUP_KEY = "reference"
A... | [
"legalaid.utils.diversity.save_diversity_data",
"core.tests.mommy_utils.make_recipe"
] | [((3810, 3858), 'core.tests.mommy_utils.make_recipe', 'make_recipe', (['"""legalaid.personal_details"""'], {}), "('legalaid.personal_details', **data)\n", (3821, 3858), False, 'from core.tests.mommy_utils import make_recipe\n'), ((5041, 5110), 'legalaid.utils.diversity.save_diversity_data', 'diversity.save_diversity_da... |
import os
import cv2
from PIL import Image
def full_essay_checker(directory, max_height):
"""
:param directory: Directory of interest
:param max_height: Height threshold beyond which a file should be
flagged as a potential child essay.
:return: None
This function will generate and dis... | [
"os.path.isdir",
"cv2.waitKey",
"cv2.destroyAllWindows",
"os.walk",
"PIL.Image.open",
"cv2.imread",
"cv2.imshow",
"os.path.join"
] | [((685, 709), 'os.path.isdir', 'os.path.isdir', (['directory'], {}), '(directory)\n', (698, 709), False, 'import os\n'), ((867, 885), 'os.walk', 'os.walk', (['directory'], {}), '(directory)\n', (874, 885), False, 'import os\n'), ((1176, 1204), 'os.path.join', 'os.path.join', (['root', 'filename'], {}), '(root, filename... |
import numpy as np
import pandas as pd
class FplusTreeSampling(object):
"""
F+ tree for sampling from a large population
Construct in O(N) time
Sample and update in O(log(N)) time
"""
def __init__(self, dimension, weights=None):
self.dimension = dimension
self.layers = int(np.... | [
"numpy.ceil",
"numpy.log2",
"numpy.zeros",
"numpy.ones",
"numpy.array",
"numpy.random.sample"
] | [((2227, 2264), 'numpy.zeros', 'np.zeros', (['(batch_size,)'], {'dtype': 'np.int'}), '((batch_size,), dtype=np.int)\n', (2235, 2264), True, 'import numpy as np\n'), ((2283, 2322), 'numpy.zeros', 'np.zeros', (['(batch_size,)'], {'dtype': 'np.float'}), '((batch_size,), dtype=np.float)\n', (2291, 2322), True, 'import nump... |
import random
from typing import List
from network_simulator.BloodType import BloodType
from network_simulator.Network import Network
from network_simulator.Organ import Organ
from network_simulator.OrganList import OrganList
from network_simulator.compatibility_markers import OrganType, BloodTypeLetter, BloodT... | [
"network_simulator.compatibility_markers.BloodTypeLetter.random_blood_type",
"network_simulator.compatibility_markers.BloodTypePolarity.random_blood_polarity",
"random.choice",
"random.randrange",
"network_simulator.Organ.Organ"
] | [((1524, 1544), 'random.choice', 'random.choice', (['nodes'], {}), '(nodes)\n', (1537, 1544), False, 'import random\n'), ((1581, 1616), 'network_simulator.compatibility_markers.BloodTypeLetter.random_blood_type', 'BloodTypeLetter.random_blood_type', ([], {}), '()\n', (1614, 1616), False, 'from network_simulator.compati... |
# Copyright (C) 2019-2021, TomTom (http://tomtom.com).
#
# 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... | [
"re.compile"
] | [((6250, 6281), 're.compile', 're.compile', (['"""=\\\\s*default\\\\s*$"""'], {}), "('=\\\\s*default\\\\s*$')\n", (6260, 6281), False, 'import re\n'), ((6298, 6328), 're.compile', 're.compile', (['"""=\\\\s*delete\\\\s*$"""'], {}), "('=\\\\s*delete\\\\s*$')\n", (6308, 6328), False, 'import re\n')] |
import argparse
import typing
import aztk.spark
from aztk_cli import config
from aztk_cli.config import JobConfig
def setup_parser(parser: argparse.ArgumentParser):
parser.add_argument(
"--id",
dest="job_id",
required=False,
help="The unique id of your Spark Job. Defaults to the i... | [
"aztk_cli.config.JobConfig",
"aztk_cli.config.load_aztk_spark_config",
"aztk_cli.config.load_aztk_secrets"
] | [((679, 690), 'aztk_cli.config.JobConfig', 'JobConfig', ([], {}), '()\n', (688, 690), False, 'from aztk_cli.config import JobConfig\n'), ((825, 856), 'aztk_cli.config.load_aztk_spark_config', 'config.load_aztk_spark_config', ([], {}), '()\n', (854, 856), False, 'from aztk_cli import config\n'), ((636, 662), 'aztk_cli.c... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# System libs
import json
from pandas.io.json import json_normalize
import plotly.graph_objs as go
import plotly.offline as plotly
import plotly.figure_factory as ff
colors = {'pref': 'rgb(85, 239, 196)', '1': 'rgb(255, 201, 26)', '2': 'rgb(250, 177, 160)', '3': 'rgb(2... | [
"plotly.figure_factory.create_distplot",
"pandas.io.json.json_normalize",
"json.load",
"plotly.offline.plot"
] | [((1443, 1463), 'pandas.io.json.json_normalize', 'json_normalize', (['data'], {}), '(data)\n', (1457, 1463), False, 'from pandas.io.json import json_normalize\n'), ((1818, 1949), 'plotly.figure_factory.create_distplot', 'ff.create_distplot', (['hist_data', 'group_labels'], {'colors': 'cols', 'histnorm': '"""probability... |
"""
test_template
~~~~~~~~~~~~~
This module implements tests for the mapping of a XML description to a
template tree.
"""
from binalyzer_core import Template
from binalyzer_template_provider import XMLTemplateParser
def test_template_mapping_root():
template = XMLTemplateParser(
"""
... | [
"binalyzer_template_provider.XMLTemplateParser"
] | [((284, 353), 'binalyzer_template_provider.XMLTemplateParser', 'XMLTemplateParser', (['"""\n <template>\n </template>\n """'], {}), '("""\n <template>\n </template>\n """)\n', (301, 353), False, 'from binalyzer_template_provider import XMLTemplateParser\n'), ((838, 964), 'binalyzer_tem... |
#!/usr/bin/env python
# -*- coding: utf8 -*-
import time
import datetime
import pickle
import uuid
import binascii
import json
import zlib
#import gzip
import hashlib
import random
import string
import __init__ as nomagic
from setting import conn
def email_invite(email):
"""email invite can be used for both se... | [
"__init__._get_entity_by_id",
"uuid.uuid4",
"setting.conn.query",
"__init__._node",
"setting.conn.execute_rowcount",
"__init__._pack",
"__init__._update_entity_by_id",
"__init__._new_key",
"datetime.datetime.now",
"__init__._get_entities_by_ids"
] | [((478, 575), 'setting.conn.execute_rowcount', 'conn.execute_rowcount', (['"""INSERT INTO index_invite (email, token) VALUES(%s, %s)"""', 'email', 'token'], {}), "('INSERT INTO index_invite (email, token) VALUES(%s, %s)',\n email, token)\n", (499, 575), False, 'from setting import conn\n'), ((670, 704), '__init__._g... |
import pjsua as pj
import logging
from .callbacks import log_cb
logger = logging.getLogger(__name__)
class PJSipClient:
"""
Manage the PJSip instance
"""
def __init__(self):
self.lib = pj.Lib() # Create library instance
self.lib.init(log_cfg=pj.LogConfig(level=6, callback=log_cb,
... | [
"pjsua.LogConfig",
"logging.getLogger",
"pjsua.Lib"
] | [((74, 101), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (91, 101), False, 'import logging\n'), ((213, 221), 'pjsua.Lib', 'pj.Lib', ([], {}), '()\n', (219, 221), True, 'import pjsua as pj\n'), ((279, 344), 'pjsua.LogConfig', 'pj.LogConfig', ([], {'level': '(6)', 'callback': 'log_cb', '... |
import bcrypt
import exceptions
import apiservice_pb2
import logging
# String encoding to convert between str and bytes
STR_ENCODING = 'utf-8'
class Controller:
def __init__(self, datastore: 'DataStore', sessionstore: 'SessionStore'):
"""Create a new Controller object
Args:
datastore... | [
"apiservice_pb2.LogoutResponse",
"bcrypt.checkpw",
"exceptions.BadCredentialsError",
"apiservice_pb2.GetSessionResponse",
"apiservice_pb2.LoginResponse"
] | [((725, 811), 'apiservice_pb2.GetSessionResponse', 'apiservice_pb2.GetSessionResponse', ([], {'user_id': 'state.user_id', 'username': 'state.username'}), '(user_id=state.user_id, username=state.\n username)\n', (758, 811), False, 'import apiservice_pb2\n'), ((1519, 1551), 'exceptions.BadCredentialsError', 'exception... |
# Generated by Django 2.2.2 on 2019-08-27 00:25
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('admin01', '0006_delete_connect'),
]
operations = [
migrations.CreateModel(
name='Connect',
... | [
"django.db.models.ForeignKey",
"django.db.models.AutoField"
] | [((360, 453), 'django.db.models.AutoField', 'models.AutoField', ([], {'auto_created': '(True)', 'primary_key': '(True)', 'serialize': '(False)', 'verbose_name': '"""ID"""'}), "(auto_created=True, primary_key=True, serialize=False,\n verbose_name='ID')\n", (376, 453), False, 'from django.db import migrations, models\... |
import pytest
from repro.common.docker import image_exists
from repro.models.lin2004 import DEFAULT_IMAGE
from sacrerouge.common.testing.metric_test_cases import ReferenceBasedMetricTestCase
from sacrerouge.common.testing.util import sacrerouge_command_exists
from sacrerouge.metrics.docker import DockerRouge
@pytest... | [
"repro.common.docker.image_exists",
"sacrerouge.metrics.docker.DockerRouge",
"sacrerouge.common.testing.util.sacrerouge_command_exists"
] | [((591, 604), 'sacrerouge.metrics.docker.DockerRouge', 'DockerRouge', ([], {}), '()\n', (602, 604), False, 'from sacrerouge.metrics.docker import DockerRouge\n'), ((13318, 13331), 'sacrerouge.metrics.docker.DockerRouge', 'DockerRouge', ([], {}), '()\n', (13329, 13331), False, 'from sacrerouge.metrics.docker import Dock... |
# (c) 2021 Amazon Web Services, Inc. or its affiliates. All Rights Reserved.
# This AWS Content is provided subject to the terms of the AWS Customer Agreement
# available at http://aws.amazon.com/agreement or other written agreement between
# Customer and Amazon Web Services, Inc.
import logging
import time
import re
... | [
"logging.getLogger",
"functools.wraps",
"logging.basicConfig",
"time.sleep"
] | [((349, 370), 'logging.basicConfig', 'logging.basicConfig', ([], {}), '()\n', (368, 370), False, 'import logging\n'), ((380, 399), 'logging.getLogger', 'logging.getLogger', ([], {}), '()\n', (397, 399), False, 'import logging\n'), ((400, 429), 'logging.getLogger', 'logging.getLogger', (['"""botocore"""'], {}), "('botoc... |
import configparser
import slackclient
import os
import argparse
# variable definitions
configFile = '../conf.d/angryNinja.ini'
conf = configparser.ConfigParser ()
conf.read(configFile)
#slack_token = SLACK_API_TOKEN
slack_token = os.environ['SLACK_API_TOKEN']
print(slack_token)
sc = slackclient.SlackClient(slack_tok... | [
"configparser.ConfigParser",
"slackclient.SlackClient",
"argparse.ArgumentParser"
] | [((136, 163), 'configparser.ConfigParser', 'configparser.ConfigParser', ([], {}), '()\n', (161, 163), False, 'import configparser\n'), ((287, 323), 'slackclient.SlackClient', 'slackclient.SlackClient', (['slack_token'], {}), '(slack_token)\n', (310, 323), False, 'import slackclient\n'), ((344, 430), 'argparse.ArgumentP... |
# Laser demo. The "raytracing" is not perfect in resolution.
from pyalleg import *
import math
import time
def mid(x,y,z):
return max(x, min(y, z))
init()
initGfx(0,320,240)
initKeyboard()
initMouse()
buffer=Bitmap(320,240)
screen=getScreen()
end=0
white=Color(255,255,255)
green=Color(0,192,0)
red=Color(255,0,0)
v... | [
"time.clock",
"math.cos",
"math.sin"
] | [((691, 704), 'math.cos', 'math.cos', (['ang'], {}), '(ang)\n', (699, 704), False, 'import math\n'), ((709, 722), 'math.sin', 'math.sin', (['ang'], {}), '(ang)\n', (717, 722), False, 'import math\n'), ((751, 763), 'time.clock', 'time.clock', ([], {}), '()\n', (761, 763), False, 'import time\n'), ((803, 815), 'time.cloc... |
import datetime
print("---------------------------------------")
print("Enter 1 if you want to know about the year (365 or 366 days).")
print("Enter 2 if you want to know about the age group.")
print("Enter 3 if you want to know about the age in seconds.")
print("-------------------------------------")
birth_day = int... | [
"datetime.date.today"
] | [((470, 491), 'datetime.date.today', 'datetime.date.today', ([], {}), '()\n', (489, 491), False, 'import datetime\n'), ((509, 530), 'datetime.date.today', 'datetime.date.today', ([], {}), '()\n', (528, 530), False, 'import datetime\n'), ((549, 570), 'datetime.date.today', 'datetime.date.today', ([], {}), '()\n', (568, ... |
###############################################################################
# ProteusLib Copyright (c) 2021, The Regents of the University of California,
# through Lawrence Berkeley National Laboratory, Oak Ridge National
# Laboratory, National Renewable Energy Laboratory, and National Energy
# Technology Laborator... | [
"proteuslib.edb.validate.validate",
"proteuslib.edb.commands.get_edb_data",
"proteuslib.edb.commands._load_bootstrap",
"mongomock.MongoClient",
"proteuslib.edb.db_api.ElectrolyteDB._process_component",
"proteuslib.edb.db_api.ElectrolyteDB._process_reaction"
] | [((1378, 1429), 'proteuslib.edb.commands._load_bootstrap', 'commands._load_bootstrap', (['mockdb'], {'do_validate': '(False)'}), '(mockdb, do_validate=False)\n', (1402, 1429), False, 'from proteuslib.edb import commands\n'), ((1042, 1065), 'mongomock.MongoClient', 'mongomock.MongoClient', ([], {}), '()\n', (1063, 1065)... |
import unittest
from pron_dict_quality_assurance import compound_analysis
class TestCompound(unittest.TestCase):
def test_compound_analysis(self):
comp_tree = compound_analysis.build_compound_tree('framhaldsskólanemendur')
elem_arr = []
comp_tree.preorder(elem_arr)
print(str(elem_... | [
"pron_dict_quality_assurance.compound_analysis.build_compound_tree"
] | [((174, 237), 'pron_dict_quality_assurance.compound_analysis.build_compound_tree', 'compound_analysis.build_compound_tree', (['"""framhaldsskólanemendur"""'], {}), "('framhaldsskólanemendur')\n", (211, 237), False, 'from pron_dict_quality_assurance import compound_analysis\n')] |
# -*- coding: utf-8 -*-
"""
Tests for the ConcatenateWorkChain.
"""
# pylint: disable=unused-argument,redefined-outer-name,invalid-name
import pytest
from aiida import orm
from aiida.plugins import WorkflowFactory
from aiida.engine.launch import run_get_node
from aiida_tools.process_inputs import get_fullname
from ... | [
"aiida.orm.Float",
"aiida.orm.Dict",
"aiida.plugins.WorkflowFactory",
"aiida.orm.List",
"pytest.raises",
"aiida_tools.process_inputs.get_fullname"
] | [((643, 691), 'aiida.plugins.WorkflowFactory', 'WorkflowFactory', (['"""optimize.wrappers.concatenate"""'], {}), "('optimize.wrappers.concatenate')\n", (658, 691), False, 'from aiida.plugins import WorkflowFactory\n'), ((2007, 2055), 'aiida.plugins.WorkflowFactory', 'WorkflowFactory', (['"""optimize.wrappers.concatenat... |
# -*- coding: utf-8 -*-
'''
Budget Support Vector Machine under POM6
'''
__author__ = "<NAME>"
__date__ = "Apr. 2021"
import numpy as np
from MMLL.models.Common_to_all_POMs import Common_to_all_POMs
from transitions import State
from transitions.extensions import GraphMachine
#from pympler import asizeof ... | [
"pickle.dump",
"numpy.random.seed",
"numpy.sum",
"numpy.argmax",
"numpy.ones",
"numpy.linalg.norm",
"numpy.exp",
"numpy.random.normal",
"transitions.extensions.GraphMachine",
"numpy.multiply",
"skl2onnx.common.data_types.FloatTensorType",
"transitions.State",
"dill.dumps",
"numpy.linalg.in... | [((796, 807), 'time.time', 'time.time', ([], {}), '()\n', (805, 807), False, 'import time\n'), ((859, 884), 'numpy.random.seed', 'np.random.seed', ([], {'seed': 'seed'}), '(seed=seed)\n', (873, 884), True, 'import numpy as np\n'), ((1436, 1472), 'numpy.exp', 'np.exp', (['(-XC2 / 2.0 / self.sigma ** 2)'], {}), '(-XC2 / ... |
# -*- coding: utf-8 -*-
"""
Automated Tool for Optimized Modelling (ATOM)
Author: Mavs
Description: Module containing the feature engineering estimators.
"""
# Standard packages
import random
import numpy as np
import pandas as pd
from typeguard import typechecked
from typing import Optional, Union
# Other packages... | [
"pandas.DataFrame",
"sklearn.feature_selection.SequentialFeatureSelector",
"sklearn.feature_selection.RFECV",
"woodwork.column_schema.ColumnSchema",
"sklearn.feature_selection.RFE",
"featuretools.dfs",
"numpy.ones",
"numpy.hstack",
"numpy.argpartition",
"featuretools.EntitySet",
"numpy.sin",
"... | [((28379, 28464), 'pandas.DataFrame', 'pd.DataFrame', ([], {'columns': "['drop_feature', 'correlated_feature', 'correlation_value']"}), "(columns=['drop_feature', 'correlated_feature',\n 'correlation_value'])\n", (28391, 28464), True, 'import pandas as pd\n'), ((15848, 15917), 'featuretools.EntitySet', 'ft.EntitySet... |
"""
position_analysis.py contains scripts for analyzing position data, as the
name might imply.
"""
import ast
import csv
import glob
import os
import signal
import sys
import time
from mpl_toolkits.mplot3d import Axes3D
from sensor_msgs.msg import Image
import cv2
import matplotlib.pyplot as plt
impo... | [
"rospy.Subscriber",
"cv2.bitwise_and",
"agent.agent_ros.HemiAgentROS",
"matplotlib.pyplot.figure",
"numpy.sin",
"glob.glob",
"os.path.join",
"psutil.process_iter",
"cv2.cvtColor",
"matplotlib.pyplot.close",
"numpy.reshape",
"numpy.fromstring",
"mpl_toolkits.mplot3d.Axes3D",
"csv.DictReader... | [((1299, 1337), 'cv2.cvtColor', 'cv2.cvtColor', (['hemi', 'cv2.COLOR_BGR2GRAY'], {}), '(hemi, cv2.COLOR_BGR2GRAY)\n', (1311, 1337), False, 'import cv2\n'), ((1357, 1408), 'cv2.threshold', 'cv2.threshold', (['hemi_gray', '(1)', '(255)', 'cv2.THRESH_BINARY'], {}), '(hemi_gray, 1, 255, cv2.THRESH_BINARY)\n', (1370, 1408),... |
#!/usr/bin/env python3
import os, sys
sys.path.append(os.path.join(os.path.dirname(__file__), '..', 'lib'))
from support import Database, Config
import numpy as np
import queue, math, socket, subprocess, support, threading
import tensorflow as tf
class Learn:
def __init__(self, config):
graph = tf.Graph(... | [
"sys.stdout.write",
"tensorflow.reduce_sum",
"tensorflow.nn.rnn_cell.LSTMStateTuple",
"tensorflow.trainable_variables",
"socket.socket",
"tensorflow.merge_all_summaries",
"tensorflow.matmul",
"os.path.isfile",
"numpy.mean",
"tensorflow.Variable",
"numpy.arange",
"tensorflow.nn.rnn_cell.LSTMCel... | [((10832, 10847), 'support.Database.find', 'Database.find', ([], {}), '()\n', (10845, 10847), False, 'from support import Database, Config\n'), ((10866, 10896), 'os.path.dirname', 'os.path.dirname', (['database_path'], {}), '(database_path)\n', (10881, 10896), False, 'import os, sys\n'), ((68, 93), 'os.path.dirname', '... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Jun 7 11:51:53 2019
@author: carsault
"""
#%%
import pickle
import torch
from utilities import chordUtil
from utilities.chordUtil import *
from utilities import testFunc
from utilities.testFunc import *
from utilities import distance
from utilities.di... | [
"pickle.dump",
"utilities.chordUtil.getDictKey",
"utilities.testFunc.computeMat",
"numpy.std",
"numpy.log2",
"numpy.zeros",
"ACE_Analyzer.ACEAnalyzer",
"numpy.mean",
"torch.cuda.is_available",
"pickle.load"
] | [((928, 950), 'utilities.chordUtil.getDictKey', 'chordUtil.getDictKey', ([], {}), '()\n', (948, 950), False, 'from utilities import chordUtil\n'), ((25321, 25352), 'pickle.dump', 'pickle.dump', (['dictFinalRes', 'sauv'], {}), '(dictFinalRes, sauv)\n', (25332, 25352), False, 'import pickle\n'), ((514, 539), 'torch.cuda.... |
from django.contrib import admin
from .models import Neighbourhood, healthservices, notifications, Business, Health, Authorities, Profile
# Register your models here.
admin.site.register(Neighbourhood)
admin.site.register(Health)
admin.site.register(Business)
admin.site.register(healthservices)
admin.site.register(Au... | [
"django.contrib.admin.site.register"
] | [((169, 203), 'django.contrib.admin.site.register', 'admin.site.register', (['Neighbourhood'], {}), '(Neighbourhood)\n', (188, 203), False, 'from django.contrib import admin\n'), ((204, 231), 'django.contrib.admin.site.register', 'admin.site.register', (['Health'], {}), '(Health)\n', (223, 231), False, 'from django.con... |
#!/usr/bin/env python3
#
# author : <NAME>.
# contact: <mailto:<EMAIL>>
# license: Apache 2.0 :http://www.apache.org/licenses/LICENSE-2.0
#
# copyright 2020 The Meson-UI development team
#
from mesonui.repository.mesonapi import MesonAPI
from mesonui.mesonuilib.mesonapi.projectinfo import ProjectInfo
from mesonui.me... | [
"mesonui.mesonuilib.mesonapi.projectinfo.MesonInfo",
"logging.info",
"os.path.relpath",
"mesonui.mesonuilib.mesonapi.projectinfo.ProjectInfo",
"os.path.join"
] | [((645, 677), 'mesonui.mesonuilib.mesonapi.projectinfo.ProjectInfo', 'ProjectInfo', ([], {'meson_api': 'meson_api'}), '(meson_api=meson_api)\n', (656, 677), False, 'from mesonui.mesonuilib.mesonapi.projectinfo import ProjectInfo\n'), ((703, 733), 'mesonui.mesonuilib.mesonapi.projectinfo.MesonInfo', 'MesonInfo', ([], {'... |
#!/usr/bin/python
"""
__version__ = "$Revision: 1.7 $"
__date__ = "$Date: 2004/04/25 23:12:46 $"
"""
import PythonCard
from PythonCard import dialog, log, model
import wx
import os
import time
import chatWindow
class GroupChatWindow(chatWindow.ChatWindow):
# this isn't quite right, the wxFlexGridSizer
# c... | [
"PythonCard.font.fontFromDescription",
"wx.BoxSizer",
"time.strftime",
"time.time",
"wx.CallAfter"
] | [((480, 504), 'wx.BoxSizer', 'wx.BoxSizer', (['wx.VERTICAL'], {}), '(wx.VERTICAL)\n', (491, 504), False, 'import wx\n'), ((522, 548), 'wx.BoxSizer', 'wx.BoxSizer', (['wx.HORIZONTAL'], {}), '(wx.HORIZONTAL)\n', (533, 548), False, 'import wx\n'), ((566, 592), 'wx.BoxSizer', 'wx.BoxSizer', (['wx.HORIZONTAL'], {}), '(wx.HO... |
import torchopenl3
import torch
import torch.nn as nn
class ScaleLayer(nn.Module):
def __init__(self, init_value=1e-3):
super().__init__()
self.scale = nn.Parameter(torch.FloatTensor([init_value] * 6144))
def forward(self, input):
return input * self.scale
class AudioJNDModel(nn.Mod... | [
"torch.FloatTensor",
"torch.randn",
"torch.nn.CosineSimilarity",
"torchopenl3.models.load_audio_embedding_model",
"torch.no_grad",
"torch.all"
] | [((1085, 1113), 'torch.randn', 'torch.randn', (['(2)', '(17)', '(1)', '(48000)'], {}), '(2, 17, 1, 48000)\n', (1096, 1113), False, 'import torch\n'), ((1151, 1179), 'torch.randn', 'torch.randn', (['(2)', '(17)', '(1)', '(48000)'], {}), '(2, 17, 1, 48000)\n', (1162, 1179), False, 'import torch\n'), ((398, 509), 'torchop... |
from fhir_parser import FHIR
from typing import List
class SkypeURI:
def __getSkypePrefixURI(self, patientUUIDs: List[str]):
url = "skype:"
for index, patientUUID in enumerate(patientUUIDs):
if index == 9:
break
patient = FHIR().get_patient(patientUUID)
... | [
"fhir_parser.FHIR"
] | [((284, 290), 'fhir_parser.FHIR', 'FHIR', ([], {}), '()\n', (288, 290), False, 'from fhir_parser import FHIR\n')] |
from freezegun import freeze_time
from allegation.factories import OfficerFactory
from common.tests.core import SimpleTestCase
BEGIN_OF_2000 = '2000-01-01 01:01:01'
class OfficerModelTestCase(SimpleTestCase):
@freeze_time(BEGIN_OF_2000)
def test_age_property(self):
officer = OfficerFactory(birth_ye... | [
"freezegun.freeze_time",
"allegation.factories.OfficerFactory"
] | [((219, 245), 'freezegun.freeze_time', 'freeze_time', (['BEGIN_OF_2000'], {}), '(BEGIN_OF_2000)\n', (230, 245), False, 'from freezegun import freeze_time\n'), ((372, 398), 'freezegun.freeze_time', 'freeze_time', (['BEGIN_OF_2000'], {}), '(BEGIN_OF_2000)\n', (383, 398), False, 'from freezegun import freeze_time\n'), ((2... |
import sys
from os import path, remove
sys.path.append(path.dirname(path.dirname(path.abspath(__file__))))
from flask import Blueprint, url_for
from flask_restplus import Api, Resource, reqparse
from .apis.server_ns import api as serverNS
from .apis.channel_ns import api as channelNS
from .apis.stream_ns import api ... | [
"os.path.abspath",
"flask.Blueprint"
] | [((1032, 1079), 'flask.Blueprint', 'Blueprint', (['"""api"""', '__name__'], {'url_prefix': '"""/apiv1"""'}), "('api', __name__, url_prefix='/apiv1')\n", (1041, 1079), False, 'from flask import Blueprint, url_for\n'), ((81, 103), 'os.path.abspath', 'path.abspath', (['__file__'], {}), '(__file__)\n', (93, 103), False, 'f... |
# from turtle import Turtle, Screen
# import turtle
# timmy = Turtle()
# print(timmy)
# timmy.shape("turtle")
# timmy.color("red", "green")
# timmy.shapesize(3,3,3)
# timmy.forward(100)
# my_screen = Screen()
# print(my_screen.canvheight)
# my_screen.exitonclick()
from prettytable import PrettyTable
my_table = Pre... | [
"prettytable.PrettyTable"
] | [((317, 330), 'prettytable.PrettyTable', 'PrettyTable', ([], {}), '()\n', (328, 330), False, 'from prettytable import PrettyTable\n')] |
# test_yolov3.py
# Basic script to test YOLOv3 model.
#
# Reference: https://machinelearningmastery.com/how-to-perform-object-detection-with-yolov3-in-keras/
from yolo3_one_file_to_detect_them_all import *
import numpy as np
from keras.models import load_model
from keras.preprocessing.image import load_img, img_to_ar... | [
"keras.models.load_model",
"matplotlib.pyplot.show",
"matplotlib.patches.Rectangle",
"matplotlib.pyplot.imshow",
"numpy.expand_dims",
"matplotlib.pyplot.axis",
"matplotlib.pyplot.text",
"keras.preprocessing.image.img_to_array",
"keras.preprocessing.image.load_img",
"matplotlib.pyplot.gca",
"matp... | [((1628, 1650), 'keras.models.load_model', 'load_model', (['"""model.h5"""'], {}), "('model.h5')\n", (1638, 1650), False, 'from keras.models import load_model\n'), ((2566, 2584), 'keras.preprocessing.image.load_img', 'load_img', (['filename'], {}), '(filename)\n', (2574, 2584), False, 'from keras.preprocessing.image im... |
import ctypes as C
from .util import OP_CODES
class PackedCIGAR:
"""
Represents a CIGAR string and stores the operations as BAM format in memory.
"""
__slots__ = "buffer"
def __init__(self, buffer: memoryview):
self.buffer = buffer or bytearray()
def __repr__(self) -> str:
"... | [
"ctypes.c_uint32.__ctype_le__"
] | [((1512, 1538), 'ctypes.c_uint32.__ctype_le__', 'C.c_uint32.__ctype_le__', (['b'], {}), '(b)\n', (1535, 1538), True, 'import ctypes as C\n')] |
#!/usr/bin/env python3
import argparse
import subprocess
import time
import sys
from pathlib import Path
from resource_rich.monitor.monitor_impl import MonitorBase
from tools.run import supported_firmware_types, DEFAULT_LOG_DIR
from tools.run.util import Teed, Popen, StreamNoTimestamp, ApplicationRunner
from tools.k... | [
"resource_rich.monitor.monitor_impl.MonitorBase",
"argparse.ArgumentParser",
"tools.keygen.util.eui64_to_ipv6",
"time.sleep",
"tools.run.util.Popen",
"argparse.ArgumentError",
"pathlib.Path.cwd",
"tools.run.util.Teed",
"tools.run.util.StreamNoTimestamp"
] | [((5159, 5209), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Edge runner"""'}), "(description='Edge runner')\n", (5182, 5209), False, 'import argparse\n'), ((3392, 3407), 'time.sleep', 'time.sleep', (['(0.1)'], {}), '(0.1)\n', (3402, 3407), False, 'import time\n'), ((3611, 3626), 'time... |
#!/usr/bin/python3 -u
import glob
import os
import time
import re
import tempfile
import subprocess
import sys
import stat
import string
import traceback
import base64
print("Welcome to SLOC - your Simple Language Online Compiler")
print("")
print("What do you want to do?")
print("1 <size>\\n<code (size bytes) Compi... | [
"subprocess.Popen",
"traceback.print_exc",
"sys.stdin.read",
"os.unlink",
"tempfile.mkstemp",
"subprocess.check_output",
"time.time",
"os.close",
"os.path.getmtime",
"glob.glob",
"os.urandom",
"re.search",
"sys.stdin.readline"
] | [((3586, 3606), 'sys.stdin.readline', 'sys.stdin.readline', ([], {}), '()\n', (3604, 3606), False, 'import sys\n'), ((1177, 1218), 'tempfile.mkstemp', 'tempfile.mkstemp', ([], {'dir': '"""runs"""', 'suffix': 'suff'}), "(dir='runs', suffix=suff)\n", (1193, 1218), False, 'import tempfile\n'), ((1220, 1232), 'os.close', '... |
# Lint as: python3
#!/usr/bin/env python
# Copyright 2021 The CARFAC Authors. All Rights Reserved.
#
# This file is part of an implementation of Lyon's cochlear model:
# "Cascade of Asymmetric Resonators with Fast-Acting Compression"
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use... | [
"unittest.main",
"numpy.fft.ifft",
"tensorflow.ones",
"tensorflow.math.conj",
"numpy.fft.fft",
"tensorflow.keras.layers.RNN",
"numpy.zeros",
"tensorflow.constant",
"tensorflow.cast",
"absl.app.run",
"tensorflow.zeros",
"numpy.exp",
"numpy.linspace",
"numpy.array",
"numpy.testing.assert_a... | [((5852, 5867), 'unittest.main', 'unittest.main', ([], {}), '()\n', (5865, 5867), False, 'import unittest\n'), ((5898, 5911), 'absl.app.run', 'app.run', (['main'], {}), '(main)\n', (5905, 5911), False, 'from absl import app\n'), ((1992, 2041), 'tensorflow.constant', 'tf.constant', (['[1, 2, 3, 4, 5]'], {'dtype': 'tf.co... |
import os
os.system('rm *.txt Utemp *.pdf *.pth') | [
"os.system"
] | [((11, 50), 'os.system', 'os.system', (['"""rm *.txt Utemp *.pdf *.pth"""'], {}), "('rm *.txt Utemp *.pdf *.pth')\n", (20, 50), False, 'import os\n')] |
# Copyright 2017 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | [
"setuptools.find_packages"
] | [((1979, 2005), 'setuptools.find_packages', 'setuptools.find_packages', ([], {}), '()\n', (2003, 2005), False, 'import setuptools\n')] |
from .memory import Memory
import collections
import random
import numpy as np
eps = 1e-10
class PrioMemory(Memory):
def __init__(self, model, memory_size=65536):
self.model = model
self.memory_size = memory_size
self.memory = collections.OrderedDict()
self.max_prio = 1.0
... | [
"numpy.sum",
"numpy.argmax",
"numpy.frombuffer",
"numpy.array",
"collections.OrderedDict"
] | [((258, 283), 'collections.OrderedDict', 'collections.OrderedDict', ([], {}), '()\n', (281, 283), False, 'import collections\n'), ((1312, 1373), 'numpy.array', 'np.array', (['[((n * probs[idx]) ** -beta) for idx in chosen_idx]'], {}), '([((n * probs[idx]) ** -beta) for idx in chosen_idx])\n', (1320, 1373), True, 'impor... |
from constructs import Construct
from cdktf import TerraformStack, TerraformVariable
from limber.imports.google import (
GoogleProvider,
StorageBucket,
SecretManagerSecret,
SecretManagerSecretVersion
)
import os
import glob
import json
import importlib
import sys
import hashlib
from limber.main.dag.dag ... | [
"limber.imports.google.GoogleProvider",
"limber.imports.google.SecretManagerSecret",
"json.loads",
"importlib.util.spec_from_loader",
"cdktf.TerraformVariable",
"limber.imports.google.StorageBucket",
"importlib.machinery.SourceFileLoader",
"limber.imports.google.SecretManagerSecretVersion",
"glob.gl... | [((635, 697), 'limber.imports.google.GoogleProvider', 'GoogleProvider', (['self'], {'id': 'ns', 'region': 'region', 'project': 'project_id'}), '(self, id=ns, region=region, project=project_id)\n', (649, 697), False, 'from limber.imports.google import GoogleProvider, StorageBucket, SecretManagerSecret, SecretManagerSecr... |
import torch
from torch import nn
__all__ = ['Lambda', 'GeneralizedReLU']
class Lambda(nn.Module):
def __init__(self, fn):
super().__init__()
self.fn = fn
def forward(self, x):
return self.fn(x)
def __repr__(self):
return f"Lambda({self.fn.__name__})"
class GeneralizedReL... | [
"torch.nn.LeakyReLU",
"torch.nn.ReLU",
"torch.clamp_max_"
] | [((515, 531), 'torch.nn.ReLU', 'nn.ReLU', (['inplace'], {}), '(inplace)\n', (522, 531), False, 'from torch import nn\n'), ((553, 580), 'torch.nn.LeakyReLU', 'nn.LeakyReLU', (['leak', 'inplace'], {}), '(leak, inplace)\n', (565, 580), False, 'from torch import nn\n'), ((700, 735), 'torch.clamp_max_', 'torch.clamp_max_', ... |
import torch
from torch.utils.data import Dataset
from torch.utils.data import DataLoader
from utils import *
from model_pmnet import *
import time
import sys, os
import matplotlib
matplotlib.use('Agg')
from matplotlib import pyplot as plt
import soundfile as sf
## Locations
FALCON_DIR = os.environ.get('FALCON_DIR')
... | [
"sys.path.append",
"os.mkdir",
"matplotlib.pyplot.subplot",
"torch.utils.data.DataLoader",
"torch.LongTensor",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.close",
"os.path.exists",
"torch.FloatTensor",
"time.time",
"os.environ.get",
"torch.save",
"matplotlib.use",
"torch.cuda.is_available... | [((181, 202), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (195, 202), False, 'import matplotlib\n'), ((291, 319), 'os.environ.get', 'os.environ.get', (['"""FALCON_DIR"""'], {}), "('FALCON_DIR')\n", (305, 319), False, 'import sys, os\n'), ((331, 357), 'os.environ.get', 'os.environ.get', (['"""b... |
from datetime import datetime
from datetime import timedelta
import json
import pathlib
import os
import re
import pytz
from nonebot.adapters.cqhttp import Event, Message
from nonebot.adapters.cqhttp.bot import Bot
from nonebot.plugin import on_message
from nonebot.rule import regex
from nonebot.typing import T_State
f... | [
"nonebot.on_command",
"selenium.webdriver.chrome.options.Options",
"PIL.Image.new",
"json.dump",
"json.load",
"os.getcwd",
"PIL.ImageFont.truetype",
"datetime.timedelta",
"pytz.timezone",
"selenium.webdriver.Chrome",
"bs4.BeautifulSoup",
"PIL.ImageDraw.Draw",
"nonebot.rule.regex",
"nonebot... | [((1115, 1135), 'nonebot.on_command', 'on_command', (['"""turnip"""'], {}), "('turnip')\n", (1125, 1135), False, 'from nonebot import on_command\n'), ((4283, 4292), 'selenium.webdriver.chrome.options.Options', 'Options', ([], {}), '()\n', (4290, 4292), False, 'from selenium.webdriver.chrome.options import Options\n'), ... |
# -*- coding: utf-8 -*-
#
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_Decoder(object):
def setupUi(self, Decoder):
Decoder.setObjectName("Decoder")
Decoder.setWindowModality(QtCore.Qt.WindowModal)
Decoder.resize(923, 685)
... | [
"PyQt5.QtWidgets.QSizePolicy",
"PyQt5.QtWidgets.QGridLayout",
"PyQt5.QtWidgets.QPushButton",
"PyQt5.QtWidgets.QVBoxLayout",
"PyQt5.QtWidgets.QListWidget",
"PyQt5.QtWidgets.QSpinBox",
"PyQt5.QtWidgets.QLabel",
"PyQt5.QtWidgets.QWidget",
"PyQt5.QtWidgets.QRadioButton",
"PyQt5.QtWidgets.QToolButton",... | [((381, 411), 'PyQt5.QtWidgets.QVBoxLayout', 'QtWidgets.QVBoxLayout', (['Decoder'], {}), '(Decoder)\n', (402, 411), False, 'from PyQt5 import QtCore, QtGui, QtWidgets\n'), ((510, 533), 'PyQt5.QtWidgets.QHBoxLayout', 'QtWidgets.QHBoxLayout', ([], {}), '()\n', (531, 533), False, 'from PyQt5 import QtCore, QtGui, QtWidget... |
# -*- coding: utf-8 -*-
import scrapy
from scrapy_statsd.tests.test_project.test_project.items import TestProjectItem
class TestSpider(scrapy.Spider):
name = "test"
allowed_domains = ["github.com"]
start_urls = (
'https://github.com/scrapy/scrapy',
)
def parse(self, response):
yiel... | [
"scrapy_statsd.tests.test_project.test_project.items.TestProjectItem"
] | [((322, 339), 'scrapy_statsd.tests.test_project.test_project.items.TestProjectItem', 'TestProjectItem', ([], {}), '()\n', (337, 339), False, 'from scrapy_statsd.tests.test_project.test_project.items import TestProjectItem\n')] |
import numpy
import chainer
from chainer import functions
from chainer_pointnet.models.conv_block import ConvBlock
from chainer_pointnet.utils.grouping import query_ball_by_diff
from chainer_pointnet.utils.sampling import farthest_point_sampling
class SetAbstractionModule(chainer.Chain):
def __init__(self, k, ... | [
"numpy.random.uniform",
"chainer_pointnet.utils.grouping.query_ball_by_diff",
"chainer_pointnet.models.conv_block.ConvBlock",
"chainer.functions.concat",
"chainer.functions.max",
"chainer.functions.broadcast_to",
"cupy.random.uniform",
"chainer.functions.transpose"
] | [((2467, 2516), 'chainer.functions.transpose', 'functions.transpose', (['grouped_points', '(0, 3, 2, 1)'], {}), '(grouped_points, (0, 3, 2, 1))\n', (2486, 2516), False, 'from chainer import functions\n'), ((2723, 2762), 'chainer.functions.max', 'functions.max', (['h'], {'axis': '(2)', 'keepdims': '(True)'}), '(h, axis=... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Author: Yangfenglong
# @Date: 2019-05-20
"""
set of useful functions
usage: import useful_functions as uf
uf.create_dir(dir)
"""
import os
import hashlib
from datetime import datetime
import logging
import traceback
from functools import wraps
from sklearn.base i... | [
"io.StringIO",
"traceback.print_exc",
"logging.FileHandler",
"logging.StreamHandler",
"os.path.exists",
"logging.Formatter",
"functools.wraps",
"re.sub",
"datetime.datetime.now",
"logging.getLogger"
] | [((751, 770), 'logging.getLogger', 'logging.getLogger', ([], {}), '()\n', (768, 770), False, 'import logging\n'), ((836, 859), 'logging.StreamHandler', 'logging.StreamHandler', ([], {}), '()\n', (857, 859), False, 'import logging\n'), ((929, 1002), 'logging.Formatter', 'logging.Formatter', (['"""%(asctime)s %(message)s... |
from __future__ import absolute_import
import os
import six
from . import multipart
from .exceptions import InvalidArguments
from .multipart import default_chunk_size
class Command(object):
def __init__(self, path):
self.path = path
def request(self, client, *args, **kwargs):
return clien... | [
"os.path.isdir"
] | [((1294, 1310), 'os.path.isdir', 'os.path.isdir', (['f'], {}), '(f)\n', (1307, 1310), False, 'import os\n')] |
import numpy as np
import ScanMatchPy
import matlab
import brainscore
import brainio_collection
from brainscore.benchmarks import Benchmark, ceil_score
from brainscore.model_interface import BrainModel
from brainscore.metrics import Score
from brainscore.utils import fullname
import logging
from tqdm import tqdm
clas... | [
"brainscore.benchmarks.ceil_score",
"numpy.std",
"numpy.asarray",
"ScanMatchPy.initialize",
"brainscore.utils.fullname",
"numpy.max",
"numpy.mean",
"brainscore.get_assembly",
"brainscore.metrics.Score",
"numpy.sqrt"
] | [((468, 566), 'brainscore.metrics.Score', 'Score', (['[ceil_score, np.nan]'], {'coords': "{'aggregation': ['center', 'error']}", 'dims': "['aggregation']"}), "([ceil_score, np.nan], coords={'aggregation': ['center', 'error']},\n dims=['aggregation'])\n", (473, 566), False, 'from brainscore.metrics import Score\n'), ... |
from django.apps import AppConfig
from django.utils.translation import ugettext_lazy as _
class PrivateURLConfig(AppConfig):
name = 'privateurl'
verbose_name = _('Django Private URL')
| [
"django.utils.translation.ugettext_lazy"
] | [((170, 193), 'django.utils.translation.ugettext_lazy', '_', (['"""Django Private URL"""'], {}), "('Django Private URL')\n", (171, 193), True, 'from django.utils.translation import ugettext_lazy as _\n')] |
# Python Standard Library Imports
import time
from rauth import OAuth1Service
from rauth.service import process_token_request
from rauth.utils import parse_utf8_qsl
YAHOO_OAUTH_REQUEST_TOKEN_URL = 'https://api.login.yahoo.com/oauth/v2/get_request_token'
YAHOO_OAUTH_ACCESS_TOKEN_URL = 'https://api.login.yahoo.com/oau... | [
"rauth.service.process_token_request",
"rauth.OAuth1Service",
"time.time"
] | [((3006, 3234), 'rauth.OAuth1Service', 'OAuth1Service', ([], {'name': '"""Yahoo"""', 'consumer_key': 'app_key', 'consumer_secret': 'app_secret', 'request_token_url': 'YAHOO_OAUTH_REQUEST_TOKEN_URL', 'access_token_url': 'YAHOO_OAUTH_ACCESS_TOKEN_URL', 'authorize_url': 'YAHOO_OAUTH_AUTHORIZE_URL'}), "(name='Yahoo', consu... |
#----------------------------------------------------------------------------#
# Imports
#----------------------------------------------------------------------------#
import json
import dateutil.parser
import babel
from flask import Flask, render_template, request, Response, flash, redirect, url_for
from flas... | [
"sqlalchemy.inspect",
"flask.flash",
"logging.FileHandler",
"flask.request.form.getlist",
"flask.request.form.get",
"flask.Flask",
"logging.Formatter",
"flask_moment.Moment",
"flask.url_for",
"flask_migrate.Migrate",
"flask_sqlalchemy.SQLAlchemy",
"flask.render_template",
"sqlalchemy.func.co... | [((750, 765), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (755, 765), False, 'from flask import Flask, render_template, request, Response, flash, redirect, url_for\n'), ((776, 787), 'flask_moment.Moment', 'Moment', (['app'], {}), '(app)\n', (782, 787), False, 'from flask_moment import Moment\n'), ((828,... |
import csv
import cv2
import numpy as np
lines = []
with open('/opt/carnd_p3/data/driving_log.csv') as csvfile:
reader = csv.reader(csvfile)
firstLineRead = False
for line in reader:
if not firstLineRead:
firstLineRead = True
else:
lines.append(line)
images ... | [
"matplotlib.pyplot.title",
"csv.reader",
"keras.layers.Cropping2D",
"keras.layers.Flatten",
"matplotlib.pyplot.show",
"keras.callbacks.ModelCheckpoint",
"keras.layers.Dropout",
"matplotlib.pyplot.legend",
"keras.applications.inception_v3.InceptionV3",
"matplotlib.pyplot.ylabel",
"cv2.flip",
"m... | [((881, 897), 'numpy.array', 'np.array', (['images'], {}), '(images)\n', (889, 897), True, 'import numpy as np\n'), ((908, 930), 'numpy.array', 'np.array', (['measurements'], {}), '(measurements)\n', (916, 930), True, 'import numpy as np\n'), ((1061, 1073), 'keras.models.Sequential', 'Sequential', ([], {}), '()\n', (10... |
import zipfile
import os
import glob
from multiprocessing import Pool
from tqdm import tqdm
def gzip_single(dirs, target):
''' 解压单个文件到目标文件夹。
'''
path, _ = os.path.split(target)
if os.path.exists(path) == 0:
os.makedirs(path)
_dir = dirs.split('/')[-1]
cd_command = 'cd {} && cd ..... | [
"os.path.split",
"os.path.exists",
"os.makedirs"
] | [((171, 192), 'os.path.split', 'os.path.split', (['target'], {}), '(target)\n', (184, 192), False, 'import os\n'), ((201, 221), 'os.path.exists', 'os.path.exists', (['path'], {}), '(path)\n', (215, 221), False, 'import os\n'), ((237, 254), 'os.makedirs', 'os.makedirs', (['path'], {}), '(path)\n', (248, 254), False, 'im... |
"""Drop-in replacement for the Adafruit neopixel library: prints matrix to STDOUT."""
import collections
import os
from typing import Union
from ledmatrix.stubs.mock_gpio_pin import MockGpioPin
from ledmatrix.utilities.colors import BLACK, Color, ColorOrder, GRB, GRBW, RGB
class MockNeoPixel(collections.abc.Sequence... | [
"ledmatrix.utilities.colors.Color",
"os.system"
] | [((2819, 2894), 'ledmatrix.utilities.colors.Color', 'Color', ([], {'red': 'color.green', 'green': 'color.red', 'blue': 'color.blue', 'white': 'color.white'}), '(red=color.green, green=color.red, blue=color.blue, white=color.white)\n', (2824, 2894), False, 'from ledmatrix.utilities.colors import BLACK, Color, ColorOrder... |
from django.test import TestCase
from survey.forms.aboutus_form import AboutUsForm
class AboutUsFormTest(TestCase):
def test_valid(self):
form_data = {
'content': 'description goes here',
}
aboutus_form = AboutUsForm(form_data)
self.assertTrue(aboutus_form.is_valid(... | [
"survey.forms.aboutus_form.AboutUsForm"
] | [((251, 273), 'survey.forms.aboutus_form.AboutUsForm', 'AboutUsForm', (['form_data'], {}), '(form_data)\n', (262, 273), False, 'from survey.forms.aboutus_form import AboutUsForm\n'), ((438, 460), 'survey.forms.aboutus_form.AboutUsForm', 'AboutUsForm', (['form_data'], {}), '(form_data)\n', (449, 460), False, 'from surve... |
import sys
import unittest
import coverage
cov = coverage.Coverage(
branch=True,
source=['animation_retarget'],
)
cov.start()
suite = unittest.defaultTestLoader.discover('.')
if not unittest.TextTestRunner().run(suite).wasSuccessful():
exit(1)
cov.stop()
cov.xml_report()
if '--save-html-report' in sys.... | [
"unittest.defaultTestLoader.discover",
"unittest.TextTestRunner",
"coverage.Coverage"
] | [((51, 112), 'coverage.Coverage', 'coverage.Coverage', ([], {'branch': '(True)', 'source': "['animation_retarget']"}), "(branch=True, source=['animation_retarget'])\n", (68, 112), False, 'import coverage\n'), ((145, 185), 'unittest.defaultTestLoader.discover', 'unittest.defaultTestLoader.discover', (['"""."""'], {}), "... |
# -*- coding: utf-8 -*-
"""
Helper functions for HDF5
Created on Tue Jun 2 12:37:50 2020
:copyright:
<NAME> (<EMAIL>)
:license:
MIT
"""
# =============================================================================
# Imports
# ==========================================================================... | [
"gc.get_objects",
"mth5.utils.mth5_logger.setup_logger",
"inspect.getmro",
"numpy.array"
] | [((476, 498), 'mth5.utils.mth5_logger.setup_logger', 'setup_logger', (['__name__'], {}), '(__name__)\n', (488, 498), False, 'from mth5.utils.mth5_logger import setup_logger\n'), ((3440, 3456), 'gc.get_objects', 'gc.get_objects', ([], {}), '()\n', (3454, 3456), False, 'import gc\n'), ((6379, 6398), 'inspect.getmro', 'in... |
import gzip
import os
import re
import shutil
import yaml
def load_yml(filename):
try:
with open(filename, "r") as f:
return yaml.load(f, Loader=yaml.FullLoader)
except FileNotFoundError:
return None
def write_yml(data, filename):
with open(filename, "w") as f:
yaml.... | [
"shutil.copyfileobj",
"shutil.unpack_archive",
"yaml.load",
"gzip.open",
"hashlib.md5",
"os.path.join",
"os.getcwd",
"os.path.dirname",
"yaml.dump",
"shutil._find_unpack_format",
"os.path.split",
"re.sub",
"os.listdir",
"shutil.register_unpack_format"
] | [((988, 1050), 'shutil.register_unpack_format', 'shutil.register_unpack_format', (['"""gz"""', "['.gz']", 'gunzip_something'], {}), "('gz', ['.gz'], gunzip_something)\n", (1017, 1050), False, 'import shutil\n'), ((728, 779), 're.sub', 're.sub', (['"""\\\\.gz$"""', '""""""', 'filename'], {'flags': 're.IGNORECASE'}), "('... |
import os
import sys
def is_flag(arg):
return arg.startswith("-")
def check_files(file_list):
"""
Procedure that checks if each folder of a list is valid (exists and was given as output)
:param file_list list of file paths to be verified for existance:
"""
for f in file_list:
if f is ... | [
"os.path.isdir",
"os.mkdir",
"os.path.isfile",
"sys.exit"
] | [((433, 450), 'os.path.isfile', 'os.path.isfile', (['f'], {}), '(f)\n', (447, 450), False, 'import os\n'), ((881, 897), 'os.path.isdir', 'os.path.isdir', (['f'], {}), '(f)\n', (894, 897), False, 'import os\n'), ((1408, 1419), 'sys.exit', 'sys.exit', (['(2)'], {}), '(2)\n', (1416, 1419), False, 'import sys\n'), ((1654, ... |
import json
def game_to_iterable(game_file):
game_list = game_file.split("\n")
assert not len(game_list) % 3, "Given game stats are not complete"
return {game_list[i + 1]: game_list[i:i + 2] for i in range(0, len(game_list), 3)}
def game_stats(game):
game_file = open(game, 'r').read()
return gam... | [
"json.dump",
"json.load"
] | [((427, 447), 'json.load', 'json.load', (['json_file'], {}), '(json_file)\n', (436, 447), False, 'import json\n'), ((637, 670), 'json.dump', 'json.dump', (['json_object', 'json_file'], {}), '(json_object, json_file)\n', (646, 670), False, 'import json\n'), ((1573, 1593), 'json.load', 'json.load', (['json_file'], {}), '... |
import sys
import os
import pytest
sys.path.append(os.path.realpath(os.path.dirname(__file__) + "/../.."))
sys.path.append(os.path.realpath(os.path.dirname(__file__) + "/../../lib/intelligence/"))
from lib.gui_helper import GUIHelper
from src.game import Game
from src.bot import Bot
from src.dice import Dice
from int... | [
"os.path.dirname",
"pytest.lazy_fixture",
"pytest.fixture",
"src.dice.Dice",
"lib.gui_helper.GUIHelper",
"intelligence_low.IntelligenceLow",
"src.game.Game",
"pytest.mark.parametrize"
] | [((860, 1068), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""test_param"""', '[[0, 0, 0, 0, True], [87, 91, 3, 3, True], [98, 81, 3, 3, True], [37, 29, \n 18, 3, False], [87, 79, 10, 5, True], [37, 29, 26, 7, False], [77, 87, \n 18, 3, False]]'], {}), "('test_param', [[0, 0, 0, 0, True], [87, 91, 3,... |
# MIT License
# Copyright (c) 2022 <NAME>™
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publis... | [
"telethon.events.NewMessage",
"asyncio.sleep",
"elaina.telethn.iter_participants",
"telethon.tl.functions.channels.EditBannedRequest",
"telethon.tl.types.ChatBannedRights"
] | [((1499, 1686), 'telethon.tl.types.ChatBannedRights', 'ChatBannedRights', ([], {'until_date': 'None', 'view_messages': '(True)', 'send_messages': '(True)', 'send_media': '(True)', 'send_stickers': '(True)', 'send_gifs': '(True)', 'send_games': '(True)', 'send_inline': '(True)', 'embed_links': '(True)'}), '(until_date=N... |
import sys
from setuptools import setup
CURRENT_PYTHON = sys.version_info[:2]
REQUIRED_PYTHON = (3, 6)
if CURRENT_PYTHON < REQUIRED_PYTHON:
sys.stderr.write('This project does not support your Python version.')
sys.exit(1)
setup(
install_requires=[
'requests',
],
)
| [
"sys.stderr.write",
"setuptools.setup",
"sys.exit"
] | [((234, 270), 'setuptools.setup', 'setup', ([], {'install_requires': "['requests']"}), "(install_requires=['requests'])\n", (239, 270), False, 'from setuptools import setup\n'), ((146, 216), 'sys.stderr.write', 'sys.stderr.write', (['"""This project does not support your Python version."""'], {}), "('This project does ... |
import graphene
from graphene import relay
# from graphene.contrib.sqlalchemy import (SQLAlchemyConnectionField,
# SQLAlchemyNode)
# from models import Department as DepartmentModel
# from models import Employee as EmployeeModel
# from models import Role as RoleModel
schema ... | [
"graphene.Field",
"graphene.ID",
"graphene.Schema",
"graphene.String"
] | [((322, 339), 'graphene.Schema', 'graphene.Schema', ([], {}), '()\n', (337, 339), False, 'import graphene\n'), ((637, 665), 'graphene.Schema', 'graphene.Schema', ([], {'query': 'Query'}), '(query=Query)\n', (652, 665), False, 'import graphene\n'), ((403, 416), 'graphene.ID', 'graphene.ID', ([], {}), '()\n', (414, 416),... |
import os
import random
import numpy as np
import torch
def set_seed(seed=None):
if seed is None:
return None
random.seed(seed)
os.environ['PYTHONHASHSEED'] = ("%s" % seed)
np.random.seed(seed)
torch.manual_seed(seed)
torch.cuda.manual_seed(seed)
torch.cuda.manual_seed_all(seed)
... | [
"numpy.random.seed",
"torch.manual_seed",
"torch.cuda.manual_seed",
"torch.cuda.manual_seed_all",
"random.seed"
] | [((129, 146), 'random.seed', 'random.seed', (['seed'], {}), '(seed)\n', (140, 146), False, 'import random\n'), ((200, 220), 'numpy.random.seed', 'np.random.seed', (['seed'], {}), '(seed)\n', (214, 220), True, 'import numpy as np\n'), ((225, 248), 'torch.manual_seed', 'torch.manual_seed', (['seed'], {}), '(seed)\n', (24... |
"""
Sepulsa Client Builder
"""
from sepulsa.request import SepulsaRequest
from sepulsa.response import SepulsaResponse
from sepulsa.provider import SepulsaProvider
from sepulsa.core.remote_call import RemoteCall
def build_client(base_url, username, password):
"""" combine request response and remote call into... | [
"sepulsa.request.SepulsaRequest",
"sepulsa.provider.SepulsaProvider",
"sepulsa.response.SepulsaResponse",
"sepulsa.core.remote_call.RemoteCall"
] | [((379, 413), 'sepulsa.request.SepulsaRequest', 'SepulsaRequest', (['username', 'password'], {}), '(username, password)\n', (393, 413), False, 'from sepulsa.request import SepulsaRequest\n'), ((429, 446), 'sepulsa.response.SepulsaResponse', 'SepulsaResponse', ([], {}), '()\n', (444, 446), False, 'from sepulsa.response ... |
# Copyright: (c) 2018 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# FUTURE: this could be swapped out for our bundled version of distro to move more complete platform
# logic to the targets, so long as we maintain Py2.6 compat and don't need to do any ki... | [
"platform.dist",
"os.access",
"json.dumps",
"io.open"
] | [((537, 561), 'os.access', 'os.access', (['path', 'os.R_OK'], {}), '(path, os.R_OK)\n', (546, 561), False, 'import os\n'), ((592, 629), 'io.open', 'io.open', (['path', '"""r"""'], {'encoding': 'encoding'}), "(path, 'r', encoding=encoding)\n", (599, 629), False, 'import io\n'), ((831, 846), 'platform.dist', 'platform.di... |
# coding: utf-8
from __future__ import absolute_import
from datetime import date, datetime # noqa: F401
from typing import List, Dict # noqa: F401
from openapi_server.models.base_model_ import Model
from openapi_server import util
class Metric(Model):
"""NOTE: This class is auto generated by OpenAPI Generato... | [
"openapi_server.util.deserialize_model"
] | [((2514, 2547), 'openapi_server.util.deserialize_model', 'util.deserialize_model', (['dikt', 'cls'], {}), '(dikt, cls)\n', (2536, 2547), False, 'from openapi_server import util\n')] |
"""Answer to Exercise 1.3
Author: <NAME>
Email : <EMAIL>
"""
from __future__ import print_function
import numpy as np
import keras.backend as K
# create variable w, b and x
w = K.placeholder(shape=(2,), dtype=np.float32)
# note that b is not a scalar
b = K.placeholder(shape=(1,), dtype=np.float32)
x = K.placeholder(... | [
"keras.backend.placeholder",
"keras.backend.exp",
"keras.backend.function",
"keras.backend.sum",
"numpy.array"
] | [((180, 223), 'keras.backend.placeholder', 'K.placeholder', ([], {'shape': '(2,)', 'dtype': 'np.float32'}), '(shape=(2,), dtype=np.float32)\n', (193, 223), True, 'import keras.backend as K\n'), ((258, 301), 'keras.backend.placeholder', 'K.placeholder', ([], {'shape': '(1,)', 'dtype': 'np.float32'}), '(shape=(1,), dtype... |
from typing import Union
import yaml
from mason.util.logger import logger
def parse_yaml(file: str):
try:
with open(file, 'r') as stream:
try:
yaml_load: dict = yaml.safe_load(stream)
if type(yaml_load).__name__ == "dict":
return yaml_load
... | [
"mason.util.logger.logger.error",
"yaml.safe_load"
] | [((564, 615), 'mason.util.logger.logger.error', 'logger.error', (['f"""Specified YAML does not exist: {e}"""'], {}), "(f'Specified YAML does not exist: {e}')\n", (576, 615), False, 'from mason.util.logger import logger\n'), ((204, 226), 'yaml.safe_load', 'yaml.safe_load', (['stream'], {}), '(stream)\n', (218, 226), Fal... |
import Register
sample = Register('read','01','sda12','sample.txt')
sample.postStream | [
"Register"
] | [((25, 70), 'Register', 'Register', (['"""read"""', '"""01"""', '"""sda12"""', '"""sample.txt"""'], {}), "('read', '01', 'sda12', 'sample.txt')\n", (33, 70), False, 'import Register\n')] |
from collections import Counter
from copy import copy
def process_input(lines):
template = lines[0]
rules = {
line.split('->')[0].strip(): line.split('->')[1].strip() for line in lines[2:]
}
return template, rules
def apply_insertion(template, rules, num):
output = copy(template)
for... | [
"collections.Counter",
"copy.copy"
] | [((298, 312), 'copy.copy', 'copy', (['template'], {}), '(template)\n', (302, 312), False, 'from copy import copy\n'), ((690, 706), 'collections.Counter', 'Counter', (['polymer'], {}), '(polymer)\n', (697, 706), False, 'from collections import Counter\n')] |
#!/usr/bin/env python3
# Copyright 2004-present Facebook. All Rights Reserved.
import argparse
import json
import logging
import os
import random
import time
import torch
import deep_sdf
import deep_sdf.workspace as ws
import numpy as np
def reconstruct(
decoder,
num_iterations,
latent_size,
test_sd... | [
"argparse.ArgumentParser",
"torch.var",
"random.shuffle",
"deep_sdf.data.get_instance_filenames",
"torch.cat",
"os.path.isfile",
"deep_sdf.data.unpack_sdf_samples_from_ram",
"torch.no_grad",
"os.path.join",
"torch.ones",
"torch.load",
"torch.zeros",
"torch.mean",
"torch.optim.Adam",
"tor... | [((1003, 1036), 'torch.optim.Adam', 'torch.optim.Adam', (['[latent]'], {'lr': 'lr'}), '([latent], lr=lr)\n', (1019, 1036), False, 'import torch\n'), ((1069, 1086), 'torch.nn.L1Loss', 'torch.nn.L1Loss', ([], {}), '()\n', (1084, 1086), False, 'import torch\n'), ((2251, 2375), 'argparse.ArgumentParser', 'argparse.Argument... |
"""Database inclusion hook - keep minimal to avoid cyclic dependencies"""
# SQLAlchemy provides the database object relational mapping (ORM)
from flask_sqlalchemy import SQLAlchemy
db = SQLAlchemy()
| [
"flask_sqlalchemy.SQLAlchemy"
] | [((188, 200), 'flask_sqlalchemy.SQLAlchemy', 'SQLAlchemy', ([], {}), '()\n', (198, 200), False, 'from flask_sqlalchemy import SQLAlchemy\n')] |
"""Unit tests for interface implementations in pyatv.protocols.mrp."""
import math
import pytest
from pyatv import exceptions
from pyatv.protocols.mrp import MrpAudio, messages, protobuf
DEVICE_UID = "F2204E63-BCAB-4941-80A0-06C46CB71391"
# This mock is _extremely_ basic, so needs to be adjusted heavily when addin... | [
"pytest.fixture",
"pytest.raises",
"math.isclose",
"pytest.mark.parametrize",
"pyatv.protocols.mrp.messages.create",
"pyatv.protocols.mrp.MrpAudio"
] | [((1094, 1125), 'pytest.fixture', 'pytest.fixture', ([], {'name': '"""protocol"""'}), "(name='protocol')\n", (1108, 1125), False, 'import pytest\n'), ((1204, 1232), 'pytest.fixture', 'pytest.fixture', ([], {'name': '"""audio"""'}), "(name='audio')\n", (1218, 1232), False, 'import pytest\n'), ((1586, 1692), 'pytest.mark... |