code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
import os
import time
import webbrowser
import threading
from addons.addons_server import *
from page import *
import http.server
import socketserver
last_modified_time = 0
dev_page_prefix = '''
<html>
<title>SwiftPage Development Server</title>
<script src='https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquer... | [
"threading.Thread",
"os.remove",
"webbrowser.open",
"os.system",
"time.sleep",
"os.path.getmtime",
"socketserver.TCPServer"
] | [((2822, 2854), 'os.remove', 'os.remove', (['""".swiftpage_commands"""'], {}), "('.swiftpage_commands')\n", (2831, 2854), False, 'import os\n'), ((3234, 3268), 'threading.Thread', 'threading.Thread', ([], {'target': 'main_loop'}), '(target=main_loop)\n', (3250, 3268), False, 'import threading\n'), ((3274, 3310), 'threa... |
# todo: add dropout to trainer
# todo: add GPU support to trainer
# todo: reset lstm hidden state for inference
# todo: cleanup batch_sizing inconsistencies
import tensorflow as tf
import re
import os
import lm1b.model.char_embedding_nodes as char_embedding_nodes
from lm1b.utils.util import merge
from lm1b.utils.model... | [
"tensorflow.reduce_sum",
"tensorflow.nn.rnn_cell.LSTMStateTuple",
"tensorflow.trainable_variables",
"tensorflow.get_collection",
"tensorflow.identity",
"tensorflow.reshape",
"tensorflow.matmul",
"tensorflow.assign",
"tensorflow.global_variables",
"tensorflow.Variable",
"os.path.join",
"tensorf... | [((899, 1113), 'tensorflow.contrib.rnn.LSTMCell', 'tf.contrib.rnn.LSTMCell', ([], {'num_units': '(NUM_SHARDS * hparams.word_embedding_size)', 'num_proj': 'hparams.word_embedding_size', 'num_unit_shards': 'NUM_SHARDS', 'num_proj_shards': 'NUM_SHARDS', 'forget_bias': '(1.0)', 'use_peepholes': '(True)'}), '(num_units=NUM_... |
import pygame, sys
import time
from pygame.math import Vector2
from .config import FPS, xSize, ySize, cell_size, cell_number, CUTTING
from .eatable.saw import Saw
from .eatable.cake import Cake
class Snake(object):
is_moving = False
def __init__(self, screen: pygame.Surface) -> None:
self.load_snak... | [
"pygame.image.load",
"pygame.math.Vector2",
"pygame.Rect"
] | [((453, 466), 'pygame.math.Vector2', 'Vector2', (['(1)', '(0)'], {}), '(1, 0)\n', (460, 466), False, 'from pygame.math import Vector2\n'), ((4531, 4590), 'pygame.image.load', 'pygame.image.load', (['"""assets/Schlange/Schlange_Kopf_oben.png"""'], {}), "('assets/Schlange/Schlange_Kopf_oben.png')\n", (4548, 4590), False,... |
# -*- coding: utf-8 -*-
"""
Created on Sun Mar 6 18:22:04 2011
@author: -
"""
import os
import numpy
from matplotlib import pyplot
from neuronpy.graphics import spikeplot
from bulbspikes import *
from neuronpy.util import spiketrain
from params import sim_var
homedir = os.path.join(os.path.relpath('..'))
analysis_pa... | [
"numpy.multiply",
"numpy.abs",
"numpy.ma.masked_where",
"synweightsnapshot.SynWeightSnapshot",
"neuronpy.graphics.spikeplot.SpikePlot",
"numpy.zeros",
"numpy.ones",
"matplotlib.pyplot.figure",
"numpy.max",
"numpy.arange",
"os.path.relpath",
"numpy.linspace",
"numpy.add",
"os.path.join",
... | [((286, 307), 'os.path.relpath', 'os.path.relpath', (['""".."""'], {}), "('..')\n", (301, 307), False, 'import os\n'), ((1748, 1850), 'synweightsnapshot.SynWeightSnapshot', 'synweightsnapshot.SynWeightSnapshot', ([], {'nummit': "sim_var['num_mitral']", 'numgran': "sim_var['num_granule']"}), "(nummit=sim_var['num_mitral... |
import os
import subprocess
from loguru import logger
from time import sleep
import random
import requests
from packaging import version as pyver
from django.conf import settings
from tacticalrmm.celery import app
from agents.models import Agent, AgentOutage
from core.models import CoreSettings
logger.configure(**... | [
"random.randint",
"loguru.logger.error",
"loguru.logger.configure",
"agents.models.AgentOutage.objects.get",
"agents.models.Agent.objects.only",
"agents.models.AgentOutage",
"agents.models.Agent.objects.filter",
"packaging.version.parse",
"time.sleep",
"agents.models.Agent.salt_batch_async",
"lo... | [((301, 340), 'loguru.logger.configure', 'logger.configure', ([], {}), '(**settings.LOG_CONFIG)\n', (317, 340), False, 'from loguru import logger\n'), ((437, 469), 'agents.models.Agent.objects.filter', 'Agent.objects.filter', ([], {'pk__in': 'pks'}), '(pk__in=pks)\n', (457, 469), False, 'from agents.models import Agent... |
import collections
import dataclasses
import gc
import multiprocessing
import os
from multiprocessing import Lock, Pipe, Pool, Process, Value
from typing import Any, Callable, Dict, Iterable, List, NewType, Tuple, Union
from .exceptions import (UserFuncRaisedException, WorkerDiedError,
WorkerI... | [
"multiprocessing.get_context",
"multiprocessing.Pipe"
] | [((1277, 1312), 'multiprocessing.get_context', 'multiprocessing.get_context', (['method'], {}), '(method)\n', (1304, 1312), False, 'import multiprocessing\n'), ((1346, 1363), 'multiprocessing.Pipe', 'Pipe', ([], {'duplex': '(True)'}), '(duplex=True)\n', (1350, 1363), False, 'from multiprocessing import Lock, Pipe, Pool... |
import click
from guniflask_cli import __version__
@click.group()
def cli_version():
pass
@cli_version.command('version')
def main():
"""
Print the version.
"""
Version().run()
class Version:
def run(self):
print(f" guniflask-cli: v{__version__}")
import guniflask
... | [
"click.group"
] | [((55, 68), 'click.group', 'click.group', ([], {}), '()\n', (66, 68), False, 'import click\n')] |
import torch
# the copy model returns the identity,
# this is its own class so we dont have to change the code to use the copymodel
class CopyEnvModel(torch.nn.Module):
def __init__(self):
super(CopyEnvModel, self).__init__()
def forward(self, input_frame, input_action):
return input_frame, tor... | [
"torch.zeros"
] | [((317, 350), 'torch.zeros', 'torch.zeros', (['input_frame.shape[0]'], {}), '(input_frame.shape[0])\n', (328, 350), False, 'import torch\n')] |
from nonebot import CommandSession, on_command
from nonebot import on_natural_language, NLPSession, IntentCommand
from ....requests import Request
from ....responses import *
from ....distributor import Distributor
from ....utils import image_url_to_path
from ....paths import PATHS
import os, logging, traceback
... | [
"nonebot.on_command",
"os.path.abspath",
"logging.debug",
"nonebot.IntentCommand",
"traceback.format_exc",
"os.path.join",
"nonebot.on_natural_language"
] | [((372, 465), 'nonebot.on_natural_language', 'on_natural_language', ([], {'only_to_me': '(False)', 'only_short_message': '(False)', 'allow_empty_message': '(True)'}), '(only_to_me=False, only_short_message=False,\n allow_empty_message=True)\n', (391, 465), False, 'from nonebot import on_natural_language, NLPSession,... |
import os
import subprocess
import sys
import tempfile
import threading
import time
here = os.path.abspath(os.path.dirname(__file__))
class TestApp(threading.Thread):
name = None
args = None
stdin = None
daemon = True
def __init__(self):
super(TestApp, self).__init__()
self.exitc... | [
"subprocess.Popen",
"os.unlink",
"tempfile.mkstemp",
"os.path.getsize",
"os.path.dirname",
"os.environ.copy",
"time.time",
"time.sleep",
"os.close",
"os.utime"
] | [((108, 133), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (123, 133), False, 'import os\n'), ((2272, 2283), 'time.time', 'time.time', ([], {}), '()\n', (2281, 2283), False, 'import time\n'), ((2295, 2316), 'os.path.getsize', 'os.path.getsize', (['path'], {}), '(path)\n', (2310, 2316), Fals... |
import os
from data_loader.data_generator import DataGenerator
from models.invariant_basic import invariant_basic
from trainers.trainer import Trainer
from Utils.config import process_config
from Utils.dirs import create_dirs
from Utils import doc_utils
from Utils.utils import get_args
from data_loader import data_help... | [
"Utils.dirs.create_dirs",
"Utils.config.process_config",
"pandas.read_csv",
"tensorflow.compat.v1.set_random_seed",
"tensorflow.compat.v1.Session",
"tensorflow.compat.v1.reset_default_graph",
"numpy.mean",
"data_loader.data_generator.DataGenerator",
"numpy.array",
"tensorflow.compat.v1.ConfigProto... | [((434, 547), 'Utils.config.process_config', 'process_config', (['"""/Users/jiahe/PycharmProjects/gnn multiple inputs/configs/parameter_search_config.json"""'], {}), "(\n '/Users/jiahe/PycharmProjects/gnn multiple inputs/configs/parameter_search_config.json'\n )\n", (448, 547), False, 'from Utils.config import pr... |
import contextlib
import os
from unittest import TestCase
from seleniumwire.proxy.utils import get_upstream_proxy
class GetUpstreamProxyTest(TestCase):
def test_get_config(self):
options = {
'proxy': {
'http': 'http://username1:password1@server1:8888',
'https'... | [
"seleniumwire.proxy.utils.get_upstream_proxy",
"os.environ.update",
"os.environ.clear"
] | [((447, 474), 'seleniumwire.proxy.utils.get_upstream_proxy', 'get_upstream_proxy', (['options'], {}), '(options)\n', (465, 474), False, 'from seleniumwire.proxy.utils import get_upstream_proxy\n'), ((3075, 3102), 'seleniumwire.proxy.utils.get_upstream_proxy', 'get_upstream_proxy', (['options'], {}), '(options)\n', (309... |
import torch
import torch.nn as nn
class DenseOmega(nn.Module):
"""
Dense (+symmetric) Omega matrix
which applies to vectorized state with shape (batch, c, n, 1).
"""
def __init__(self, n, c):
super(DenseOmega, self).__init__()
self.n = n
self.c = c
# self.fc should... | [
"torch.matmul",
"torch.nn.Linear"
] | [((522, 545), 'torch.nn.Linear', 'nn.Linear', (['(n * c)', '(n * c)'], {}), '(n * c, n * c)\n', (531, 545), True, 'import torch.nn as nn\n'), ((662, 693), 'torch.matmul', 'torch.matmul', (['self.fc.weight', 'x'], {}), '(self.fc.weight, x)\n', (674, 693), False, 'import torch\n')] |
from models.DAO import DAO
from utils.exception import ValidationError
from utils.validation import is_money
from models.shared import find_user
import string
from random import randint
# Prepare the char set for the coupon code
# Modify the char set according to your needs
# The char set contains all upper case lett... | [
"models.shared.find_user",
"models.DAO.DAO",
"utils.exception.ValidationError",
"utils.validation.is_money"
] | [((892, 897), 'models.DAO.DAO', 'DAO', ([], {}), '()\n', (895, 897), False, 'from models.DAO import DAO\n'), ((1444, 1449), 'models.DAO.DAO', 'DAO', ([], {}), '()\n', (1447, 1449), False, 'from models.DAO import DAO\n'), ((1917, 1922), 'models.DAO.DAO', 'DAO', ([], {}), '()\n', (1920, 1922), False, 'from models.DAO imp... |
import uuid
from django.test import TestCase
from django.shortcuts import resolve_url as r
from eventex.subscriptions.models import Subscription
class SubscriptionDetailGet(TestCase):
def setUp(self):
self.obj = Subscription.objects.create(
name='<NAME>',
cpf='12345678901',
... | [
"eventex.subscriptions.models.Subscription.objects.create",
"uuid.uuid4",
"django.shortcuts.resolve_url"
] | [((227, 329), 'eventex.subscriptions.models.Subscription.objects.create', 'Subscription.objects.create', ([], {'name': '"""<NAME>"""', 'cpf': '"""12345678901"""', 'email': '"""<EMAIL>"""', 'phone': '"""938654321"""'}), "(name='<NAME>', cpf='12345678901', email=\n '<EMAIL>', phone='938654321')\n", (254, 329), False, ... |
from django.urls import path
from . import views
urlpatterns = [
path('', views.index),
path('expand', views.expand),
path('upload', views.upload),
path('comment', views.add_comment),
path('public_data', views.get_public_data),
] | [
"django.urls.path"
] | [((70, 91), 'django.urls.path', 'path', (['""""""', 'views.index'], {}), "('', views.index)\n", (74, 91), False, 'from django.urls import path\n'), ((97, 125), 'django.urls.path', 'path', (['"""expand"""', 'views.expand'], {}), "('expand', views.expand)\n", (101, 125), False, 'from django.urls import path\n'), ((131, 1... |
import MySQLdb
def antisql(content):
antistr=u"'|and|exec|insert|select|delete|update|count|*|%|chr|mid|master|truncate|char|declare|;|or|-|+|,".split(u"|")
for i in range (len(antistr)):
if antistr[i] in content:
return 1
return 0
def sql_select(text):
conn=MyS... | [
"MySQLdb.connect"
] | [((317, 433), 'MySQLdb.connect', 'MySQLdb.connect', ([], {'host': '"""localhost"""', 'user': '"""root"""', 'passwd': '"""<PASSWORD>"""', 'db': '"""dimcreator"""', 'port': '(3306)', 'charset': '"""utf8"""'}), "(host='localhost', user='root', passwd='<PASSWORD>', db=\n 'dimcreator', port=3306, charset='utf8')\n", (332... |
import os
import shutil
prepath_in='/n/home02/ndeporzio/projects/cosmicfish/cfworkspace/results/FINAL_RESULTS/EUCLID/EUCLID_GridPlot_'
prepath_out='/n/home02/ndeporzio/projects/cosmicfish/cfworkspace/results/FINAL_RESULTS/Parsed/EUCLID/EUCLID_GridPlot_'
for idx in range(120):
tidx=idx//10
midx=idx%10
pat... | [
"os.mkdir"
] | [((351, 365), 'os.mkdir', 'os.mkdir', (['path'], {}), '(path)\n', (359, 365), False, 'import os\n')] |
# Generated by Django 2.2 on 2019-04-24 03:05
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('users', '0001_initial'),
]
operations = [
migrations.RemoveField(
model_name='customuser',
name='ward_name',
)... | [
"django.db.migrations.RemoveField",
"django.db.models.IntegerField"
] | [((220, 285), 'django.db.migrations.RemoveField', 'migrations.RemoveField', ([], {'model_name': '"""customuser"""', 'name': '"""ward_name"""'}), "(model_name='customuser', name='ward_name')\n", (242, 285), False, 'from django.db import migrations, models\n'), ((444, 475), 'django.db.models.IntegerField', 'models.Intege... |
"""Methods used to build ROC."""
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
from sklearn.metrics import roc_curve, auc
# seaborn settings
sns.set_style("white")
sns.set_context("paper")
color_palette = sns.color_palette("colorblind")
sns.set_palette(color_palette)
d... | [
"matplotlib.pyplot.title",
"seaborn.set_style",
"matplotlib.pyplot.xlim",
"sklearn.metrics.roc_curve",
"matplotlib.pyplot.ylim",
"seaborn.tsplot",
"numpy.zeros",
"sklearn.metrics.auc",
"matplotlib.pyplot.figure",
"numpy.mean",
"numpy.linspace",
"seaborn.color_palette",
"numpy.interp",
"mat... | [((190, 212), 'seaborn.set_style', 'sns.set_style', (['"""white"""'], {}), "('white')\n", (203, 212), True, 'import seaborn as sns\n'), ((213, 237), 'seaborn.set_context', 'sns.set_context', (['"""paper"""'], {}), "('paper')\n", (228, 237), True, 'import seaborn as sns\n'), ((254, 285), 'seaborn.color_palette', 'sns.co... |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | [
"azure.profiles.ProfileDefinition",
"azure.mgmt.core.AsyncARMPipelineClient"
] | [((2763, 3637), 'azure.profiles.ProfileDefinition', 'ProfileDefinition', (["{_PROFILE_TAG: {None: DEFAULT_API_VERSION, 'assets': '1.0.0',\n 'async_operations': 'v1.0', 'batch_job_deployment':\n '2020-09-01-dataplanepreview', 'batch_job_endpoint':\n '2020-09-01-dataplanepreview', 'data_call': '1.5.0', 'data_con... |
import numpy as np
import scipy.sparse
import akg
from akg import tvm
from akg import topi
from tests.common.base import get_rtol_atol
from tests.common.gen_random import random_gaussian
from tests.common.tensorio import compare_tensor
from akg.utils import kernel_exec as utils
from akg.utils.result_analysis import ta... | [
"tests.common.tensorio.compare_tensor",
"akg.tvm.context",
"tests.common.gen_random.random_gaussian",
"tests.common.base.get_rtol_atol",
"akg.tvm.ir_builder.create",
"akg.utils.dsl_create.get_broadcast_shape",
"numpy.zeros",
"akg.utils.format_transform.get_shape",
"akg.tvm.decl_buffer",
"akg.utils... | [((753, 775), 'akg.utils.format_transform.get_shape', 'get_shape', (['dense.shape'], {}), '(dense.shape)\n', (762, 775), False, 'from akg.utils.format_transform import to_tvm_nd_array, get_shape\n'), ((795, 811), 'akg.utils.format_transform.get_shape', 'get_shape', (['shape'], {}), '(shape)\n', (804, 811), False, 'from... |
import ast
EXCEPTION_TYPE_PREFIX = "<class 'webfaction_api.exceptions."
EXCEPTION_TYPE_SUFFIX = "'>"
def _parse_exc_type(exc_type):
# This is horribly hacky, but there's not a particularly elegant
# way to go from the exception type to a string representing that
# exception.
if not exc_type.startswi... | [
"ast.literal_eval"
] | [((620, 649), 'ast.literal_eval', 'ast.literal_eval', (['exc_message'], {}), '(exc_message)\n', (636, 649), False, 'import ast\n')] |
# Generated by Django 2.2.9 on 2019-12-30 10:47
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('secret', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='secret',
name='expiry_date',
... | [
"django.db.models.DateTimeField"
] | [((329, 372), 'django.db.models.DateTimeField', 'models.DateTimeField', ([], {'blank': '(True)', 'null': '(True)'}), '(blank=True, null=True)\n', (349, 372), False, 'from django.db import migrations, models\n')] |
# encoding: utf-8
"""
Input/output package.
"""
from __future__ import absolute_import, division, print_function
import io as _io
import contextlib
import numpy as np
from .audio import load_audio_file
from .midi import load_midi, write_midi
from ..utils import suppress_warnings, string_types
ENCODING = 'utf8'
#... | [
"numpy.sum",
"numpy.ones_like",
"numpy.any",
"numpy.append",
"numpy.array",
"numpy.loadtxt",
"io.open",
"warnings.warn",
"numpy.vstack"
] | [((1773, 1802), 'numpy.loadtxt', 'np.loadtxt', (['filename'], {'ndmin': '(2)'}), '(filename, ndmin=2)\n', (1783, 1802), True, 'import numpy as np\n'), ((2590, 2606), 'numpy.array', 'np.array', (['events'], {}), '(events)\n', (2598, 2606), True, 'import numpy as np\n'), ((3721, 3750), 'numpy.loadtxt', 'np.loadtxt', (['f... |
from acondbs.db.sa import sa
from acondbs.models import Map, Beam
# These tests are written primarily for the developer to understand
# how models in flask_sqlalchemy work.
# __________________________________________________________________||
def test_simple(app):
'''A simple test of adding an object
'''
... | [
"acondbs.db.sa.sa.session.commit",
"acondbs.db.sa.sa.session.add",
"acondbs.models.Map",
"acondbs.models.Map.query.filter_by",
"acondbs.models.Map.query.all",
"acondbs.models.Beam",
"acondbs.models.Beam.query.filter_by"
] | [((521, 537), 'acondbs.models.Map', 'Map', ([], {'name': '"""map1"""'}), "(name='map1')\n", (524, 537), False, 'from acondbs.models import Map, Beam\n'), ((1087, 1103), 'acondbs.models.Map', 'Map', ([], {'name': '"""map1"""'}), "(name='map1')\n", (1090, 1103), False, 'from acondbs.models import Map, Beam\n'), ((1682, 1... |
from yattag import Doc
from .SimpleContent import (
AddressText,
AddressTypeName,
CountryCode,
CountyCode,
LocalityName,
PostalCode,
StateCode,
SupplementalAddressText,
)
class OrganizationAddress:
"""
The physical address of an organization.
"""
__... | [
"yattag.Doc"
] | [((4778, 4783), 'yattag.Doc', 'Doc', ([], {}), '()\n', (4781, 4783), False, 'from yattag import Doc\n')] |
import os
import sys
from helper import CopyArtifactsTestCase
from beets import config
class CopyArtifactsFilename(CopyArtifactsTestCase):
"""
Tests to check handling of artifacts with filenames containing unicode characters
"""
def setUp(self):
super(CopyArtifactsFilename, self).setUp()
... | [
"os.path.join",
"os.makedirs"
] | [((373, 415), 'os.path.join', 'os.path.join', (['self.import_dir', '"""the_album"""'], {}), "(self.import_dir, 'the_album')\n", (385, 415), False, 'import os\n'), ((424, 452), 'os.makedirs', 'os.makedirs', (['self.album_path'], {}), '(self.album_path)\n', (435, 452), False, 'import os\n'), ((753, 797), 'os.path.join', ... |
import functools
import os
import time
from typing import List
from jina import DocumentArray
from jina.logging.logger import JinaLogger
from jina.enums import LogVerbosity
def _get_non_empty_fields_doc_array(docs: DocumentArray) -> List[str]:
non_empty_fields = list(docs[0].non_empty_fields)
for doc in docs... | [
"os.environ.get",
"jina.enums.LogVerbosity.from_string",
"functools.wraps",
"time.time"
] | [((1100, 1125), 'functools.wraps', 'functools.wraps', (['function'], {}), '(function)\n', (1115, 1125), False, 'import functools\n'), ((1209, 1247), 'os.environ.get', 'os.environ.get', (['"""JINA_LOG_LEVEL"""', 'None'], {}), "('JINA_LOG_LEVEL', None)\n", (1223, 1247), False, 'import os\n'), ((2002, 2013), 'time.time', ... |
# PROJECT : kungfucms
# TIME : 2020/6/9 12:54
# AUTHOR : <NAME>
# EMAIL : <EMAIL>
# PHONE : 13811754531
# WECHAT : 13811754531
# https://github.com/youngershen
from django.core.signals import request_started, \
request_finished
from django.dispatch import Signal, receiver
before_sign_in = Signal(providing_args... | [
"django.dispatch.receiver",
"django.dispatch.Signal"
] | [((299, 342), 'django.dispatch.Signal', 'Signal', ([], {'providing_args': "['toppings', 'size']"}), "(providing_args=['toppings', 'size'])\n", (305, 342), False, 'from django.dispatch import Signal, receiver\n'), ((359, 402), 'django.dispatch.Signal', 'Signal', ([], {'providing_args': "['toppings', 'size']"}), "(provid... |
# -*- coding: utf-8 -*- #
# Copyright 2021 Google LLC. 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 requir... | [
"googlecloudsdk.command_lib.dataproc.flags.AddBucket",
"googlecloudsdk.command_lib.dataproc.local_file_uploader.HasLocalFiles",
"googlecloudsdk.command_lib.dataproc.flags.AddJarFiles",
"googlecloudsdk.command_lib.dataproc.flags.AddMainSqlScript",
"googlecloudsdk.command_lib.dataproc.flags.AddSqlScriptVariab... | [((2824, 2854), 'googlecloudsdk.command_lib.dataproc.flags.AddMainSqlScript', 'flags.AddMainSqlScript', (['parser'], {}), '(parser)\n', (2846, 2854), False, 'from googlecloudsdk.command_lib.dataproc import flags\n'), ((2857, 2882), 'googlecloudsdk.command_lib.dataproc.flags.AddJarFiles', 'flags.AddJarFiles', (['parser'... |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
# Copyright (c) 2021, Pearl TV LLC
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# l... | [
"dataclasses.dataclass",
"logging.getLogger"
] | [((1687, 1714), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1704, 1714), False, 'import logging\n'), ((5222, 5244), 'dataclasses.dataclass', 'dataclass', ([], {'frozen': '(True)'}), '(frozen=True)\n', (5231, 5244), False, 'from dataclasses import dataclass\n')] |
import os
from vibration_compensation import read_gcode, Data
import pytest
from numpy.testing import *
import numpy as np
import scipy as sp
import vibration_compensation.bokeh_imports as plt
@pytest.fixture(scope="module")
def figures():
path, filename = os.path.split(os.path.realpath(__file__))
... | [
"numpy.sum",
"os.makedirs",
"vibration_compensation.read_gcode",
"os.path.realpath",
"pytest.fixture",
"vibration_compensation.bokeh_imports.Figure",
"numpy.linalg.norm",
"os.path.splitext",
"vibration_compensation.bokeh_imports.save",
"pytest.approx",
"os.path.join"
] | [((205, 235), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""module"""'}), "(scope='module')\n", (219, 235), False, 'import pytest\n'), ((641, 673), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""function"""'}), "(scope='function')\n", (655, 673), False, 'import pytest\n'), ((328, 356), 'os.path.join', ... |
import subprocess
import threading
from collections import defaultdict
from concurrent.futures import Executor
from concurrent.futures.thread import ThreadPoolExecutor
class RecursiveLibraryScanner:
def __init__(self, executor: Executor, scan_private: bool):
self.executor = executor
self.libraries... | [
"collections.defaultdict",
"subprocess.check_output",
"concurrent.futures.thread.ThreadPoolExecutor",
"threading.Event"
] | [((323, 339), 'collections.defaultdict', 'defaultdict', (['set'], {}), '(set)\n', (334, 339), False, 'from collections import defaultdict\n'), ((457, 474), 'threading.Event', 'threading.Event', ([], {}), '()\n', (472, 474), False, 'import threading\n'), ((1339, 1359), 'concurrent.futures.thread.ThreadPoolExecutor', 'Th... |
import time
import base64
import binascii
from secrets import token_hex
from rsa import prime
from arc4 import ARC4
def gcd(a, b):
while b != 0:
a, b = b, a % b
return a
def lcm(a, b):
return a * b // gcd(a, b)
def imod(a, n):
i = 1
while True:
c = n * i + 1
if(c % a == 0... | [
"base64.b64encode",
"secrets.token_hex",
"rsa.prime.getprime",
"arc4.ARC4"
] | [((435, 444), 'arc4.ARC4', 'ARC4', (['key'], {}), '(key)\n', (439, 444), False, 'from arc4 import ARC4\n'), ((541, 550), 'arc4.ARC4', 'ARC4', (['key'], {}), '(key)\n', (545, 550), False, 'from arc4 import ARC4\n'), ((2082, 2102), 'secrets.token_hex', 'token_hex', ([], {'nbytes': '(10)'}), '(nbytes=10)\n', (2091, 2102),... |
# Copyright © 2020 Red Hat Inc.
#
# 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 writin... | [
"rudra.data_store.aws.AmazonS3",
"logging.getLogger"
] | [((780, 807), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (797, 807), False, 'import logging\n'), ((1153, 1400), 'rudra.data_store.aws.AmazonS3', 'AmazonS3', ([], {'region_name': 'AWS_SETTINGS.s3_region', 'bucket_name': 'AWS_SETTINGS.s3_bucket_name', 'aws_access_key_id': 'AWS_SETTINGS.... |
import torch
import torch.nn as nn
import torchvision.transforms as T
from .MADE import MADE
from .Shuffle import Shuffle
from .Flow import SequentialConditionalFlow
from .NormFunctions import ActNorm, RunningBatchNorm1d
from utils.logger import log
class MAF(nn.Module):
def __init__(self, flow_dim, condition_dim... | [
"torch.logit",
"torchvision.transforms.RandomHorizontalFlip",
"torch.load",
"torch.rand_like",
"torch.randperm",
"torch.no_grad",
"torch.tensor",
"torchvision.transforms.ToTensor"
] | [((2173, 2215), 'torch.load', 'torch.load', (['path'], {'map_location': 'self.device'}), '(path, map_location=self.device)\n', (2183, 2215), False, 'import torch\n'), ((2895, 2949), 'torch.logit', 'torch.logit', (['(self.alpha + (1 - 2 * self.alpha) * image)'], {}), '(self.alpha + (1 - 2 * self.alpha) * image)\n', (290... |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Dict, List, Mapping, Optional, Tuple, Union
from .. import ... | [
"pulumi.get",
"pulumi.getter",
"pulumi.set"
] | [((1281, 1313), 'pulumi.getter', 'pulumi.getter', ([], {'name': '"""pushStatus"""'}), "(name='pushStatus')\n", (1294, 1313), False, 'import pulumi\n'), ((620, 666), 'pulumi.set', 'pulumi.set', (['__self__', '"""expression"""', 'expression'], {}), "(__self__, 'expression', expression)\n", (630, 666), False, 'import pulu... |
#!/usr/bin/env python
import numpy as np
import copy
import rospy
import rospkg
import rosparam
import threading
import argparse
from geometry_msgs.msg import Vector3
from std_msgs.msg import Header, Float64
from sub8_msgs.msg import Thrust, ThrusterStatus
from mil_ros_tools import wait_for_param, thread_lock, numpy_to... | [
"geometry_msgs.msg.Vector3",
"rosparam.load_file",
"rospy.Subscriber",
"argparse.ArgumentParser",
"mil_ros_tools.thread_lock",
"std_msgs.msg.Float64",
"numpy.mean",
"numpy.isclose",
"rospy.get_name",
"mil_ros_tools.numpy_to_point",
"ros_alarms.AlarmBroadcaster",
"rospy.Duration",
"rospy.logw... | [((533, 549), 'threading.Lock', 'threading.Lock', ([], {}), '()\n', (547, 549), False, 'import threading\n'), ((3696, 3712), 'rospy.get_name', 'rospy.get_name', ([], {}), '()\n', (3710, 3712), False, 'import rospy\n'), ((5932, 5949), 'mil_ros_tools.thread_lock', 'thread_lock', (['lock'], {}), '(lock)\n', (5943, 5949), ... |
#!/usr/bin/env python
from argparse import ArgumentParser
from dht.server import app
if __name__ == '__main__':
parser = ArgumentParser(
description='PiplineDHT -- A simple distributed hash table')
parser.add_argument('-n', '--name', action='store', required=True,
help='name of node')
... | [
"dht.server.app.run",
"argparse.ArgumentParser"
] | [((126, 201), 'argparse.ArgumentParser', 'ArgumentParser', ([], {'description': '"""PiplineDHT -- A simple distributed hash table"""'}), "(description='PiplineDHT -- A simple distributed hash table')\n", (140, 201), False, 'from argparse import ArgumentParser\n'), ((602, 641), 'dht.server.app.run', 'app.run', ([], {'ho... |
import collections
import logging
import re
from typing import Optional, Pattern, Tuple, Iterable, Set
import django.dispatch
from django.conf import settings
from django.contrib.auth.models import User
from django.db import models, IntegrityError
from django.db.models import Value as V, QuerySet, F
from django.db.mod... | [
"django.db.models.TextField",
"django.db.models.ForeignKey",
"django.dispatch.receiver",
"django.db.models.functions.Greatest",
"django.db.models.Value",
"logging.warning",
"django.db.models.JSONField",
"django.db.models.BooleanField",
"django.db.models.F",
"snpdb.models.models_genome.GenomeBuild.... | [((1406, 1467), 're.compile', 're.compile', (['"""^([^:]+):(\\\\d+)[,\\\\s]*([GATC]+)$"""', 're.IGNORECASE'], {}), "('^([^:]+):(\\\\d+)[,\\\\s]*([GATC]+)$', re.IGNORECASE)\n", (1416, 1467), False, 'import re\n'), ((1527, 1600), 're.compile', 're.compile', (['"""^([^:]+):(\\\\d+)[,\\\\s]*([GATC]+)>(=|[GATC]+)$"""', 're.... |
from fabric.decorators import task
from fabric.operations import run, sudo, local
from ConfigParser import ConfigParser
import geospatial
from fabric.context_managers import lcd
cp = ConfigParser()
cp.read('ocgis.cfg')
if cp.get('install','location') == 'local':
run = local
cd = lcd
def lsudo(op):
... | [
"ConfigParser.ConfigParser",
"geospatial.install_netCDF4",
"fabric.decorators.task"
] | [((184, 198), 'ConfigParser.ConfigParser', 'ConfigParser', ([], {}), '()\n', (196, 198), False, 'from ConfigParser import ConfigParser\n'), ((464, 482), 'fabric.decorators.task', 'task', ([], {'default': '(True)'}), '(default=True)\n', (468, 482), False, 'from fabric.decorators import task\n'), ((531, 559), 'geospatial... |
import torch
import numpy as np
from torch.autograd import Variable
import torch.optim as optim
import argparse
import random
import os
import models
import torchvision.utils as vutils
import utils
import dataLoader
from torch.utils.data import DataLoader
parser = argparse.ArgumentParser()
# The locationi of training ... | [
"random.randint",
"argparse.ArgumentParser",
"torch.utils.data.DataLoader",
"torch.manual_seed",
"torch.FloatTensor",
"os.system",
"numpy.ones",
"torch.cat",
"models.globalIllumination",
"utils.writeErrToFile",
"utils.turnErrorIntoNumpy",
"numpy.mean",
"random.seed",
"torch.cuda.is_availab... | [((266, 291), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (289, 291), False, 'import argparse\n'), ((1842, 1882), 'os.system', 'os.system', (["('cp *.py %s' % opt.experiment)"], {}), "('cp *.py %s' % opt.experiment)\n", (1851, 1882), False, 'import os\n'), ((1970, 1994), 'random.randint', 'r... |
from openprocurement.auctions.core.utils import (
log_auction_status_change
)
from openprocurement.auctions.geb.constants import (
AUCTION_STATUSES_FOR_CLEAN_BIDS_IN_CANCELLATION
)
from openprocurement.auctions.geb.managers.changers.base import (
BaseAction
)
class CancellationActivationAction(BaseAction)... | [
"openprocurement.auctions.core.utils.log_auction_status_change"
] | [((1212, 1273), 'openprocurement.auctions.core.utils.log_auction_status_change', 'log_auction_status_change', (['self.request', 'self.context', 'status'], {}), '(self.request, self.context, status)\n', (1237, 1273), False, 'from openprocurement.auctions.core.utils import log_auction_status_change\n')] |
import sys
try:
from archan import Provider, Argument, DomainMappingMatrix, Logger
from pylint.lint import Run
class LoggerWriter:
def __init__(self, level):
self.level = level
def write(self, message):
if message != '\n':
self.level('from pylint:... | [
"archan.DomainMappingMatrix",
"archan.Logger.get_logger",
"pylint.lint.Run",
"archan.Argument"
] | [((619, 679), 'archan.Argument', 'Argument', (['"""pylint_args"""', 'list', '"""Pylint arguments as a list."""'], {}), "('pylint_args', list, 'Pylint arguments as a list.')\n", (627, 679), False, 'from archan import Provider, Argument, DomainMappingMatrix, Logger\n'), ((1093, 1120), 'archan.Logger.get_logger', 'Logger.... |
# Copyright (C) 2019 Intel Corporation
# SPDX-License-Identifier: BSD-3-Clause
import logging
import collections
log = logging.getLogger('codebasin')
class TreeWalker():
"""
Generic tree walker class.
"""
def __init__(self, _tree, _node_associations):
self.tree = _tree
self._node_as... | [
"logging.getLogger"
] | [((121, 151), 'logging.getLogger', 'logging.getLogger', (['"""codebasin"""'], {}), "('codebasin')\n", (138, 151), False, 'import logging\n')] |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.9 on 2018-01-09 14:58
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('daiquiri_files', '0001_initial'),
]
operations = [
migrations.AddField(
... | [
"django.db.models.CharField",
"django.db.models.IntegerField"
] | [((397, 427), 'django.db.models.IntegerField', 'models.IntegerField', ([], {'default': '(0)'}), '(default=0)\n', (416, 427), False, 'from django.db import migrations, models\n'), ((550, 656), 'django.db.models.CharField', 'models.CharField', ([], {'blank': '(True)', 'help_text': '"""Path of the directory."""', 'max_len... |
# Copyright (c) Facebook, Inc. and its affiliates. All rights reserved.
#
# This source code is licensed under the BSD license found in the
# LICENSE file in the root directory of this source tree.
# Implementation of Top2Gating described in https://arxiv.org/pdf/2006.16668.pdf
# Code is inspired by Top2GatingOnLogits... | [
"torch.mean",
"torch.distributions.gumbel.Gumbel",
"torch.finfo",
"torch.argmax",
"torch.nn.functional.one_hot",
"torch.lt",
"torch.nn.functional.softmax",
"torch.einsum",
"torch.cumsum",
"torch.nn.Linear",
"torch.sum",
"torch.tensor"
] | [((1109, 1133), 'torch.nn.functional.softmax', 'F.softmax', (['logits'], {'dim': '(1)'}), '(logits, dim=1)\n', (1118, 1133), True, 'import torch.nn.functional as F\n'), ((1401, 1427), 'torch.argmax', 'torch.argmax', (['gates'], {'dim': '(1)'}), '(gates, dim=1)\n', (1413, 1427), False, 'import torch\n'), ((1440, 1486), ... |
import errno
import os
from refgenconf import MissingRecipeError
from ubiquerg import is_writable
from .asset_build_packages import asset_build_packages
from .exceptions import MissingFolderError
def _parse_user_build_input(input):
"""
Parse user input specification. Used in build for specific parents and i... | [
"os.makedirs",
"os.path.dirname",
"os.path.exists",
"os.access"
] | [((909, 931), 'os.path.exists', 'os.path.exists', (['outdir'], {}), '(outdir)\n', (923, 931), False, 'import os\n'), ((780, 801), 'os.access', 'os.access', (['d', 'os.W_OK'], {}), '(d, os.W_OK)\n', (789, 801), False, 'import os\n'), ((806, 827), 'os.access', 'os.access', (['d', 'os.X_OK'], {}), '(d, os.X_OK)\n', (815, ... |
from django.conf.urls import patterns, include, url
urlpatterns = patterns('',
url(r'^', include('demo.urls')),
url(r'^login/$', 'django.contrib.auth.views.login', {'template_name': 'nuit/generic/login.html'}),
url(r'^logout/$', 'django.contrib.auth.views.logout'),
)
| [
"django.conf.urls.include",
"django.conf.urls.url"
] | [((121, 221), 'django.conf.urls.url', 'url', (['"""^login/$"""', '"""django.contrib.auth.views.login"""', "{'template_name': 'nuit/generic/login.html'}"], {}), "('^login/$', 'django.contrib.auth.views.login', {'template_name':\n 'nuit/generic/login.html'})\n", (124, 221), False, 'from django.conf.urls import pattern... |
"""
:code:`iceswe.py`
Holdout both iceland and sweden
"""
import pymc3 as pm
from epimodel import EpidemiologicalParameters
from epimodel.preprocessing.data_preprocessor import preprocess_data
import argparse
import pickle
from scripts.sensitivity_analysis.utils import *
import os
os.environ['OMP_NUM_THREADS'] =... | [
"pymc3.sample",
"epimodel.EpidemiologicalParameters",
"argparse.ArgumentParser"
] | [((415, 440), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (438, 440), False, 'import argparse\n'), ((795, 822), 'epimodel.EpidemiologicalParameters', 'EpidemiologicalParameters', ([], {}), '()\n', (820, 822), False, 'from epimodel import EpidemiologicalParameters\n'), ((1155, 1293), 'pymc3.s... |
import datetime
import random
import factory
import factory.fuzzy as fuzzy
from django.core.files.base import ContentFile
from courses import models
from courses.models import LANGUAGE_CHOICES, PROFILE_CHOICES
from tests.users import factories as users_factories
from users import models as users_models
PROFILE_CHOIC... | [
"factory.django.ImageField",
"factory.Faker",
"factory.fuzzy.FuzzyText",
"users.models.Student.objects.all",
"factory.SubFactory",
"datetime.date.today",
"factory.fuzzy.FuzzyChoice",
"factory.Sequence",
"users.models.Teacher.objects.all",
"datetime.timedelta"
] | [((523, 567), 'factory.Sequence', 'factory.Sequence', (["(lambda n: 'Grade %03d' % n)"], {}), "(lambda n: 'Grade %03d' % n)\n", (539, 567), False, 'import factory\n'), ((585, 613), 'factory.Faker', 'factory.Faker', (['"""date_object"""'], {}), "('date_object')\n", (598, 613), False, 'import factory\n'), ((631, 681), 'f... |
from redisbus.utility import DictObj
def test_dictobj():
subject_dict = {
"foo": "bar",
"left": "right"
}
subject_obj = DictObj(subject_dict)
assert hasattr(subject_obj, 'foo')
assert hasattr(subject_obj, 'left')
assert subject_obj.foo == "bar"
assert subject_obj.left == ... | [
"redisbus.utility.DictObj"
] | [((151, 172), 'redisbus.utility.DictObj', 'DictObj', (['subject_dict'], {}), '(subject_dict)\n', (158, 172), False, 'from redisbus.utility import DictObj\n')] |
# Copyright 2020 The Kale 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 or agreed to ... | [
"kale.utils.jupyter_utils.generate_html_output",
"kale.utils.jupyter_utils.javascript_html_template.format",
"testfixtures.mock.patch",
"kale.utils.jupyter_utils.image_html_template.format",
"kale.utils.jupyter_utils.run_code",
"os.path.join",
"kale.utils.jupyter_utils.update_uimetadata",
"kale.utils.... | [((1441, 1489), 'testfixtures.mock.patch', 'mock.patch', (['"""kale.utils.jupyter_utils.pod_utils"""'], {}), "('kale.utils.jupyter_utils.pod_utils')\n", (1451, 1489), False, 'from testfixtures import mock\n'), ((2215, 2263), 'testfixtures.mock.patch', 'mock.patch', (['"""kale.utils.jupyter_utils.pod_utils"""'], {}), "(... |
import yaml
from pkg_resources import resource_stream
def load(filename):
with resource_stream(__name__, filename) as config_file:
return yaml.load(config_file)
def load_cluster_config(name):
return load('{0}.yml'.format(name))
_env = load('context.yml')
_configs = {}
def get_config(env):
i... | [
"pkg_resources.resource_stream",
"yaml.load"
] | [((86, 121), 'pkg_resources.resource_stream', 'resource_stream', (['__name__', 'filename'], {}), '(__name__, filename)\n', (101, 121), False, 'from pkg_resources import resource_stream\n'), ((153, 175), 'yaml.load', 'yaml.load', (['config_file'], {}), '(config_file)\n', (162, 175), False, 'import yaml\n')] |
import importlib
import sys
import pytest
from firewood import models
gan = ["gan." + model for model in models.gan.__all__]
semantic_segmentation = [
"semantic_segmentation." + model
for model in models.semantic_segmentation.__all__
]
all_models = gan + semantic_segmentation
@pytest.mark.parametrize("mod... | [
"pytest.mark.parametrize",
"importlib.import_module"
] | [((292, 336), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""model"""', 'all_models'], {}), "('model', all_models)\n", (315, 336), False, 'import pytest\n'), ((387, 438), 'importlib.import_module', 'importlib.import_module', (["('firewood.models.' + model)"], {}), "('firewood.models.' + model)\n", (410, 43... |
# keylogger_remoto_py
#Um Keylogger Remoto em Python
import keyboard # para keylogs
import smtplib # para enviar email usando o protocolo SMTP (gmail)
# O semáforo é para bloquear o segmento atual
# O temporizador é para executar um método após uma quantidade de tempo "intervalo"
from threading import Semaphore, Timer... | [
"threading.Timer",
"threading.Semaphore",
"keyboard.on_release",
"smtplib.SMTP"
] | [((789, 801), 'threading.Semaphore', 'Semaphore', (['(0)'], {}), '(0)\n', (798, 801), False, 'from threading import Semaphore, Timer\n'), ((1783, 1828), 'smtplib.SMTP', 'smtplib.SMTP', ([], {'host': '"""smtp.gmail.com"""', 'port': '(587)'}), "(host='smtp.gmail.com', port=587)\n", (1795, 1828), False, 'import smtplib\n'... |
import json
import os
# make it easy to change this for testing
XDG_DATA_HOME=os.getenv('XDG_DATA_HOME','/usr/share/')
def default_search_folders(app_name):
'''
Return the list of folders to search for configuration files
'''
return [
'%s/cdis/%s' % (XDG_DATA_HOME, app_name),
'/usr/share/cdis/%s' % a... | [
"json.load",
"os.path.join",
"os.getenv",
"os.path.exists"
] | [((79, 120), 'os.getenv', 'os.getenv', (['"""XDG_DATA_HOME"""', '"""/usr/share/"""'], {}), "('XDG_DATA_HOME', '/usr/share/')\n", (88, 120), False, 'import os\n'), ((675, 706), 'os.path.join', 'os.path.join', (['folder', 'file_name'], {}), '(folder, file_name)\n', (687, 706), False, 'import os\n'), ((1157, 1174), 'json.... |
#Instructions from https://www.youtube.com/watch?v=XQgXKtPSzUI&t=174s
#How to open python in command prompt:
#1) Shift+Right Click -> open command prompt
#2) type "conda activate"
#3) type "python"
#To run the python script, type the following line into the command prompt:
#python "C:\Users\travi\Dropbox\P... | [
"codecs.open",
"selenium.webdriver.Chrome",
"time.sleep"
] | [((666, 695), 'selenium.webdriver.Chrome', 'webdriver.Chrome', (['chrome_path'], {}), '(chrome_path)\n', (682, 695), False, 'from selenium import webdriver\n'), ((747, 755), 'time.sleep', 'sleep', (['(2)'], {}), '(2)\n', (752, 755), False, 'from time import sleep\n'), ((830, 880), 'codecs.open', 'codecs.open', (['filen... |
"""
The Sims 4 Community Library is licensed under the Creative Commons Attribution 4.0 International public license (CC BY 4.0).
https://creativecommons.org/licenses/by/4.0/
https://creativecommons.org/licenses/by/4.0/legalcode
Copyright (c) COLONOLNUTTY
"""
from typing import Any
from sims4communitylib.modinfo impo... | [
"sims4communitylib.utils.common_function_utils.CommonFunctionUtils.run_predicate_with_reversed_result",
"sims4communitylib.utils.common_function_utils.CommonFunctionUtils.run_with_arguments",
"sims4communitylib.testing.common_assertion_utils.CommonAssertionUtils.are_equal",
"sims4communitylib.modinfo.ModInfo.... | [((719, 765), 'sims4communitylib.testing.common_test_service.CommonTestService.test', 'CommonTestService.test', (['(True)', '(True)', '(True)', '(True)'], {}), '(True, True, True, True)\n', (741, 765), False, 'from sims4communitylib.testing.common_test_service import CommonTestService\n'), ((771, 819), 'sims4communityl... |
__all__ = ['SockFilterError']
import collections
class SockFilterError(Exception):
Tuple = collections.namedtuple('SockFilterError', ['address'])
def __init__(self, address):
self.address = address
def __repr__(self):
return repr(self._tuple)
def __str__(self):
return str(... | [
"collections.namedtuple"
] | [((99, 153), 'collections.namedtuple', 'collections.namedtuple', (['"""SockFilterError"""', "['address']"], {}), "('SockFilterError', ['address'])\n", (121, 153), False, 'import collections\n')] |
import re
from pathlib import Path
from setuptools import setup
install_requires = ["croniter>=1.0.1"]
def read(*parts):
return Path(__file__).resolve().parent.joinpath(*parts).read_text().strip()
def read_version():
regexp = re.compile(r"^__version__\W*=\W*\"([\d.abrc]+)\"")
for line in read("aio_bac... | [
"pathlib.Path",
"re.compile"
] | [((240, 294), 're.compile', 're.compile', (['"""^__version__\\\\W*=\\\\W*\\\\"([\\\\d.abrc]+)\\\\\\""""'], {}), '(\'^__version__\\\\W*=\\\\W*\\\\"([\\\\d.abrc]+)\\\\"\')\n', (250, 294), False, 'import re\n'), ((136, 150), 'pathlib.Path', 'Path', (['__file__'], {}), '(__file__)\n', (140, 150), False, 'from pathlib impor... |
from google.cloud import vision
import io
import re
import os
os.environ["GOOGLE_APPLICATION_CREDENTIALS"] = "swagger_server/firebase_key.json"
client = vision.ImageAnnotatorClient()
def process_image(image_file):
total = -1
with io.open(image_file, 'rb') as image_file:
content = image_file.read()
... | [
"google.cloud.vision.types.Image",
"google.cloud.vision.ImageAnnotatorClient",
"re.match",
"re.findall",
"io.open",
"re.compile"
] | [((155, 184), 'google.cloud.vision.ImageAnnotatorClient', 'vision.ImageAnnotatorClient', ([], {}), '()\n', (182, 184), False, 'from google.cloud import vision\n'), ((331, 366), 'google.cloud.vision.types.Image', 'vision.types.Image', ([], {'content': 'content'}), '(content=content)\n', (349, 366), False, 'from google.c... |
import numpy
""" Utility variables and functions
"""
aa2au = 1.8897261249935897 # bohr / AA
# converts nuclear charge to atom label
Z2LABEL = {
1: 'H', 2: 'He',
3: 'Li', 4: 'Be', 5: 'B', 6: 'C', 7: 'N', 8: 'O', 9: 'F', 10: 'Ne',
11: 'NA', 12: 'Mg... | [
"numpy.abs"
] | [((2360, 2372), 'numpy.abs', 'numpy.abs', (['a'], {}), '(a)\n', (2369, 2372), False, 'import numpy\n'), ((2851, 2863), 'numpy.abs', 'numpy.abs', (['a'], {}), '(a)\n', (2860, 2863), False, 'import numpy\n')] |
from Invoice import Invoice
def main():
items = [Invoice("RTX 2080", "VGA", 5, 10000000), Invoice("Intel i9 10900K", "Processor", 10, 8000000)]
for item in items:
print(item.part_num)
print(item.part_desc)
print(item.quantity)
print(item.price)
print("Total tagihanmu adalah", item.get_invoice_am... | [
"Invoice.Invoice"
] | [((56, 95), 'Invoice.Invoice', 'Invoice', (['"""RTX 2080"""', '"""VGA"""', '(5)', '(10000000)'], {}), "('RTX 2080', 'VGA', 5, 10000000)\n", (63, 95), False, 'from Invoice import Invoice\n'), ((97, 149), 'Invoice.Invoice', 'Invoice', (['"""Intel i9 10900K"""', '"""Processor"""', '(10)', '(8000000)'], {}), "('Intel i9 10... |
from django.contrib import admin
from polymorphic.admin import PolymorphicParentModelAdmin
from polymorphic.admin import PolymorphicChildModelAdmin
from csat.acquisition import get_collectors, models
class AcquisitionSessionConfigAdmin(admin.ModelAdmin):
list_display = ('id', 'name', 'started', 'completed', 'te... | [
"csat.acquisition.get_collectors",
"django.contrib.admin.site.register"
] | [((360, 447), 'django.contrib.admin.site.register', 'admin.site.register', (['models.AcquisitionSessionConfig', 'AcquisitionSessionConfigAdmin'], {}), '(models.AcquisitionSessionConfig,\n AcquisitionSessionConfigAdmin)\n', (379, 447), False, 'from django.contrib import admin\n'), ((955, 1040), 'django.contrib.admin.... |
from __future__ import print_function, division
import os
from os.path import exists
import numpy as np
import torch
import torch.nn as nn
from torch.utils.data import Dataset, DataLoader
from collections import OrderedDict
from lib.model import ImMatchNet
from lib.pf_willow_dataset import PFDataset
from lib.normaliza... | [
"lib.torch_util.BatchTensorToVars",
"argparse.ArgumentParser",
"torch.utils.data.DataLoader",
"os.path.join",
"lib.normalization.NormalizeImageDict",
"numpy.isnan",
"lib.point_tnf.corr_to_matches",
"numpy.mean",
"torch.cuda.is_available",
"lib.model.ImMatchNet",
"lib.eval_util.pck_metric"
] | [((656, 681), 'torch.cuda.is_available', 'torch.cuda.is_available', ([], {}), '()\n', (679, 681), False, 'import torch\n'), ((711, 775), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Compute PF Willow matches"""'}), "(description='Compute PF Willow matches')\n", (734, 775), False, 'impo... |
import unittest
from ipaddress import IPv4Address, IPv6Address
from unittest.mock import patch
from utils.dhcp import parse_dhcp_lease_file
from utils.config_reader import ConfigData
def config_file_with_black_list(self):
return {
'dhcp': {
'lease_file': './dhcp_leases_test',
... | [
"unittest.mock.patch.object",
"utils.dhcp.parse_dhcp_lease_file"
] | [((1180, 1250), 'unittest.mock.patch.object', 'patch.object', (['ConfigData', '"""get_dhcp_info"""', 'config_file_with_black_list'], {}), "(ConfigData, 'get_dhcp_info', config_file_with_black_list)\n", (1192, 1250), False, 'from unittest.mock import patch\n'), ((523, 561), 'utils.dhcp.parse_dhcp_lease_file', 'parse_dhc... |
import pickle
import easymunk as p
class TestShapeFilter:
def test_init(self) -> None:
f = p.ShapeFilter()
assert f.group == 0
assert f.categories == 0xFFFFFFFF
assert f.mask == 0xFFFFFFFF
f = p.ShapeFilter(1, 2, 3)
assert f.group == 1
assert f.categories... | [
"pickle.loads",
"easymunk.ShapeFilter",
"easymunk.ShapeFilter.ALL_CATEGORIES",
"easymunk.ShapeFilter.ALL_MASKS",
"pickle.dumps"
] | [((107, 122), 'easymunk.ShapeFilter', 'p.ShapeFilter', ([], {}), '()\n', (120, 122), True, 'import easymunk as p\n'), ((242, 264), 'easymunk.ShapeFilter', 'p.ShapeFilter', (['(1)', '(2)', '(3)'], {}), '(1, 2, 3)\n', (255, 264), True, 'import easymunk as p\n'), ((552, 574), 'easymunk.ShapeFilter', 'p.ShapeFilter', (['(1... |
#!/usr/bin/env python3
# coding: utf-8
from .BaseType import BaseType
from ..Manager import Register
import re
class Integer(BaseType):
'''Integer type
An Integer is a number that can be written without a fractional component.
An Integer is only compose of digits from 0 to 9.
'''
name = '... | [
"re.match"
] | [((575, 604), 're.match', 're.match', (['"""^-?[0-9]+$"""', 'value'], {}), "('^-?[0-9]+$', value)\n", (583, 604), False, 'import re\n')] |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
"""Evohome RF - The evohome-compatible system."""
import logging
from asyncio import Task
from datetime import timedelta as td
from threading import Lock
from typing import List, Optional
from .command import Command, FaultLog, Priority
from .const import (
ATTR_DE... | [
"threading.Lock",
"datetime.timedelta",
"logging.getLogger"
] | [((859, 886), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (876, 886), False, 'import logging\n'), ((11388, 11394), 'threading.Lock', 'Lock', ([], {}), '()\n', (11392, 11394), False, 'from threading import Lock\n'), ((13353, 13369), 'datetime.timedelta', 'td', ([], {'seconds': 'secs'}),... |
import argparse
import unittest
import os
import importlib
import sys
from gmc.conf import settings, ENVIRONMENT_VARIABLE
from gmc.core import handler
def build_suite(test_labels=None):
suite = unittest.TestSuite()
test_loader = unittest.defaultTestLoader
test_labels = test_labels or ['.']
discover_kw... | [
"os.path.abspath",
"gmc.core.handler.execute_from_command_line",
"unittest.TextTestRunner",
"importlib.import_module",
"argparse.ArgumentParser",
"unittest.TestSuite",
"os.path.isdir",
"os.path.dirname",
"os.path.exists",
"os.path.normpath",
"os.path.join"
] | [((200, 220), 'unittest.TestSuite', 'unittest.TestSuite', ([], {}), '()\n', (218, 220), False, 'import unittest\n'), ((2082, 2107), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (2105, 2107), False, 'import argparse\n'), ((2792, 2817), 'unittest.TextTestRunner', 'unittest.TextTestRunner', ([],... |
# -*- coding: utf-8 -*-
""" Singleton class to manage configuration
Description:
Todo:
"""
import json
import os
import sys
import logging
import constant
class Config(object):
# Here will be the instance stored.
__instance = None
@classmethod
def getInstance(cls):
""" Static access method.... | [
"json.dump",
"logging.info",
"logging.error"
] | [((936, 961), 'logging.info', 'logging.info', (['self.config'], {}), '(self.config)\n', (948, 961), False, 'import logging\n'), ((1009, 1044), 'logging.error', 'logging.error', (['error'], {'exc_info': '(True)'}), '(error, exc_info=True)\n', (1022, 1044), False, 'import logging\n'), ((1173, 1214), 'json.dump', 'json.du... |
##
## Graficacion usando Matplotlib
## ===========================================================================
##
## Construya una gráfica similar a la presentada en el archivo `original.png`
## usando el archivo `data.csv`. La gráfica generada debe salvarse en el
## archivo `generada.png`.
##
## Salve la f... | [
"pandas.read_csv",
"matplotlib.pyplot.setp",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.subplots_adjust",
"matplotlib.pyplot.tight_layout",
"matplotlib.pyplot.savefig"
] | [((539, 571), 'pandas.read_csv', 'pd.read_csv', (['"""data.csv"""'], {'sep': '""","""'}), "('data.csv', sep=',')\n", (550, 571), True, 'import pandas as pd\n'), ((675, 746), 'matplotlib.pyplot.subplots', 'plt.subplots', (['(1)', '(6)'], {'sharex': '"""col"""', 'sharey': '"""row"""', 'figsize': '(13, 6)', 'dpi': '(72)'}... |
#!/usr/bin/env python
# Written by: DGC
#
#D This is purely for developer use, it will not be included in the program it
#D is just for adding/changing options in the standard Options.pickle file.
#
# python imports
from __future__ import unicode_literals
import os
import csv
import pickle
import sys
import re
# lo... | [
"pickle.dump",
"csv.reader",
"os.path.dirname",
"re.search",
"os.path.join",
"os.listdir"
] | [((1345, 1382), 'os.path.join', 'os.path.join', (['options_path', 'file_name'], {}), '(options_path, file_name)\n', (1357, 1382), False, 'import os\n'), ((2979, 2994), 'os.listdir', 'os.listdir', (['"""."""'], {}), "('.')\n", (2989, 2994), False, 'import os\n'), ((1263, 1291), 'os.path.dirname', 'os.path.dirname', (['s... |
import os
clear = lambda: os.system('clear')
clear()
opcao = 1
while(opcao != 0):
print("Atividade de PARADIGMAS")
print(" 1 - QUESTÃO 01")
print(" 2 - QUESTÃO 02")
print(" 3 - QUESTÃO 03")
print(" 4 - QUESTÃO 04")
print(" 5 - QUESTÃO 05")
print(" 0 - PARA SAIR")
prin... | [
"funcionario.Funcionario",
"os.system",
"retangulo.Retangulo"
] | [((27, 45), 'os.system', 'os.system', (['"""clear"""'], {}), "('clear')\n", (36, 45), False, 'import os\n'), ((1566, 1583), 'retangulo.Retangulo', 'Retangulo', (['A1', 'L1'], {}), '(A1, L1)\n', (1575, 1583), False, 'from retangulo import Retangulo\n'), ((2177, 2212), 'funcionario.Funcionario', 'Funcionario', (['nome', ... |
# -*- coding: utf-8 -*-
import time
import logging
from logging.handlers import SysLogHandler
from hamcrest import *
from amplify.agent.pipelines.syslog import SyslogTail, SYSLOG_ADDRESSES, AmplifyAddresssAlreadyInUse
from test.base import BaseTestCase, disabled_test
__author__ = "<NAME>"
__copyright__ = "Copyright... | [
"time.sleep",
"logging.Formatter",
"amplify.agent.pipelines.syslog.SyslogTail",
"logging.handlers.SysLogHandler",
"logging.getLogger"
] | [((583, 635), 'amplify.agent.pipelines.syslog.SyslogTail', 'SyslogTail', ([], {'address': "('localhost', 514)", 'interval': '(0.1)'}), "(address=('localhost', 514), interval=0.1)\n", (593, 635), False, 'from amplify.agent.pipelines.syslog import SyslogTail, SYSLOG_ADDRESSES, AmplifyAddresssAlreadyInUse\n'), ((690, 732)... |
import datetime
from enum import Enum
import hitherdither
from PIL import Image
from inky.inky_uc8159 import Inky
WIDTH, HEIGHT = 600, 448
SATURATION = 1.0
start_log = datetime.datetime.now()
last_log = start_log
def log(msg: str) -> None:
global last_log
now = datetime.datetime.now()
diff = (now - las... | [
"hitherdither.ordered.bayer.bayer_dithering",
"datetime.datetime.now",
"hitherdither.ordered.cluster.cluster_dot_dithering"
] | [((171, 194), 'datetime.datetime.now', 'datetime.datetime.now', ([], {}), '()\n', (192, 194), False, 'import datetime\n'), ((275, 298), 'datetime.datetime.now', 'datetime.datetime.now', ([], {}), '()\n', (296, 298), False, 'import datetime\n'), ((953, 1044), 'hitherdither.ordered.cluster.cluster_dot_dithering', 'hither... |
#!/usr/bin/env python2.7
import json
from pprint import pprint
import os
import sys
import re
import dokumentor
import subprocess
def parseParam(arg, indent=0, isReturn=False):
out = ""
if isReturn:
out += "Returns (%s): %s\n" % (parseParamsType(arg["typed"]), arg["description"])
else:
out... | [
"os.mkdir",
"json.loads",
"dokumentor.process",
"dokumentor.report",
"re.sub"
] | [((4870, 4900), 'dokumentor.process', 'dokumentor.process', (['"""../docs/"""'], {}), "('../docs/')\n", (4888, 4900), False, 'import dokumentor\n'), ((4932, 4963), 'dokumentor.report', 'dokumentor.report', (['"""json"""', 'docs'], {}), "('json', docs)\n", (4949, 4963), False, 'import dokumentor\n'), ((4971, 4998), 'jso... |
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import plotly.express as px
import plotly.graph_objects as go
import streamlit as st
import io
import base64
from util import process_file
def limit_x_values(data, x_column, settings):
st.markdown("### Limit x Range")
x_min = st.number_in... | [
"streamlit.form",
"streamlit.markdown",
"streamlit.text_input",
"streamlit.plotly_chart",
"streamlit.checkbox",
"plotly.graph_objects.Figure",
"streamlit.write",
"streamlit.file_uploader",
"util.process_file",
"streamlit.form_submit_button",
"streamlit.pyplot",
"streamlit.selectbox",
"matplo... | [((263, 295), 'streamlit.markdown', 'st.markdown', (['"""### Limit x Range"""'], {}), "('### Limit x Range')\n", (274, 295), True, 'import streamlit as st\n'), ((832, 864), 'streamlit.markdown', 'st.markdown', (['"""### Scale Current"""'], {}), "('### Scale Current')\n", (843, 864), True, 'import streamlit as st\n'), (... |
#!/usr/bin/env python3
from sys import stderr, exit
import sys
import graph_connectivity_lib as gcl
def startAlgo():
numNodes = None
spoon = input().strip()
# Getting graph
while spoon[:len("graph:")] != "graph:":
# Getting number of nodes
if spoon[:len("# number of nodes:")] == "# ... | [
"graph_connectivity_lib.Graph"
] | [((684, 703), 'graph_connectivity_lib.Graph', 'gcl.Graph', (['numNodes'], {}), '(numNodes)\n', (693, 703), True, 'import graph_connectivity_lib as gcl\n')] |
#import Pillow
#from colors.py import generate_colors
import colorthief
from colorthief import ColorThief
import glob
from pathlib import Path
def get_colors(image):
dominant_color = ColorThief(image).get_palette(color_count=3, quality=3)
return dominant_color
#print (get_colors('blockchains/polygon/info/logo.png'... | [
"pathlib.Path",
"colorthief.ColorThief"
] | [((186, 203), 'colorthief.ColorThief', 'ColorThief', (['image'], {}), '(image)\n', (196, 203), False, 'from colorthief import ColorThief\n'), ((355, 374), 'pathlib.Path', 'Path', (['"""blockchains"""'], {}), "('blockchains')\n", (359, 374), False, 'from pathlib import Path\n')] |
import pandas as pd
from crawler import MyDict
class MyEnglishDict(MyDict):
def __init__(self, url):
super(MyEnglishDict, self).__init__(url)
def lookup(self, word):
output = {}
raw_text = self.get_web_result(self.url, word)
phonetic_symbols = raw_text.find(name='ul', class... | [
"pandas.DataFrame"
] | [((1370, 1441), 'pandas.DataFrame', 'pd.DataFrame', ([], {'columns': "['Word', 'Audio', 'Meaning', 'Example', 'Source']"}), "(columns=['Word', 'Audio', 'Meaning', 'Example', 'Source'])\n", (1382, 1441), True, 'import pandas as pd\n')] |
import matplotlib.pyplot as plt
from mpl_toolkits.axes_grid.axislines import SubplotZero
import numpy as np
import cyllene.f_functionclass as f_funct
import sympy as sp
'''
A lot of problems need to be resolved:
1)Can we keep a record of the graphs graphed? this can be done by just keeping the numpy arrays ?
2)w... | [
"mpl_toolkits.axes_grid.axislines.SubplotZero",
"sympy.Interval",
"matplotlib.pyplot.figure",
"numpy.array",
"numpy.arange"
] | [((486, 499), 'matplotlib.pyplot.figure', 'plt.figure', (['(1)'], {}), '(1)\n', (496, 499), True, 'import matplotlib.pyplot as plt\n'), ((512, 538), 'mpl_toolkits.axes_grid.axislines.SubplotZero', 'SubplotZero', (['self.fig', '(111)'], {}), '(self.fig, 111)\n', (523, 538), False, 'from mpl_toolkits.axes_grid.axislines ... |
import sc_utils
import model_factory
import numpy as np
from keras.preprocessing.text import Tokenizer
from keras.preprocessing.sequence import pad_sequences
INPUT_LENGTH = 100
# Prepare data
X_train, Y_train, X_test, Y_test = sc_utils.load_data()
X_train, Y_train, X_val, Y_val, X_test, Y_test, tokenizer = sc_utils.p... | [
"keras.preprocessing.sequence.pad_sequences",
"sc_utils.load_data",
"sc_utils.create_embedding_matrix",
"numpy.array",
"model_factory.create_rnn_model",
"sc_utils.preprocess_data"
] | [((229, 249), 'sc_utils.load_data', 'sc_utils.load_data', ([], {}), '()\n', (247, 249), False, 'import sc_utils\n'), ((310, 382), 'sc_utils.preprocess_data', 'sc_utils.preprocess_data', (['X_train', 'Y_train', 'X_test', 'Y_test', 'INPUT_LENGTH'], {}), '(X_train, Y_train, X_test, Y_test, INPUT_LENGTH)\n', (334, 382), Fa... |
#Copyright (c) 2019 Uber Technologies, Inc.
#
#Licensed under the Uber Non-Commercial License (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at the root directory of this project.
#
#See the License for the specific language governing permission... | [
"pickle.loads",
"pickle.dumps"
] | [((790, 818), 'pickle.dumps', 'pickle.dumps', (['(args, kwargs)'], {}), '((args, kwargs))\n', (802, 818), False, 'import pickle\n'), ((917, 940), 'pickle.loads', 'pickle.loads', (['frames[0]'], {}), '(frames[0])\n', (929, 940), False, 'import pickle\n')] |
import unittest
import rx
class History(rx.Stream):
def __init__(self):
self.events = []
super().__init__()
def notify(self, value):
self.events.append(value)
class TestRx(unittest.TestCase):
def test_combine_streams(self):
clicks = rx.Stream()
indices = rx.Strea... | [
"rx.Stream",
"rx.scan_reset",
"rx.scan_reset_emit_seed"
] | [((282, 293), 'rx.Stream', 'rx.Stream', ([], {}), '()\n', (291, 293), False, 'import rx\n'), ((312, 323), 'rx.Stream', 'rx.Stream', ([], {}), '()\n', (321, 323), False, 'import rx\n'), ((341, 409), 'rx.scan_reset', 'rx.scan_reset', (['clicks'], {'accumulator': '(lambda a, i: a + i)', 'reset': 'indices'}), '(clicks, acc... |
from modules.visitor.symbol_table import SymbolTable
from .ast_node import ASTNode
from .if_node import IfNode
class LineNode(ASTNode):
def __init__(self, expression, depth, no_end = False):
self.expression = expression
self.depth = depth
self.no_end = no_end
super().__init__(expre... | [
"modules.visitor.symbol_table.SymbolTable"
] | [((843, 876), 'modules.visitor.symbol_table.SymbolTable', 'SymbolTable', (['visitor.symbol_table'], {}), '(visitor.symbol_table)\n', (854, 876), False, 'from modules.visitor.symbol_table import SymbolTable\n')] |
from __future__ import absolute_import
from erlpack import pack
def test_nil():
assert pack(None) == b'\x83s\x03nil'
| [
"erlpack.pack"
] | [((93, 103), 'erlpack.pack', 'pack', (['None'], {}), '(None)\n', (97, 103), False, 'from erlpack import pack\n')] |
import unittest
import operative
import datetime
from caliendo.patch import patch
from caliendo import expected_value
from nose.tools import eq_, ok_
from operative.settings import TEST_FTP_LOGIN
class ReportTest(unittest.TestCase):
"""
Test the various reports.
"""
@patch('operative.FTPConnection... | [
"caliendo.expected_value.get_or_store",
"datetime.datetime",
"operative.reports.line_item_report.LineItemReport",
"caliendo.patch.patch",
"operative.FTPCredentials"
] | [((290, 332), 'caliendo.patch.patch', 'patch', (['"""operative.FTPConnection.get_files"""'], {}), "('operative.FTPConnection.get_files')\n", (295, 332), False, 'from caliendo.patch import patch\n'), ((338, 392), 'caliendo.patch.patch', 'patch', (['"""operative.FTPConnection._establish_connection"""'], {}), "('operative... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import hashlib
import io
import os
import random
from PIL import Image, ImageStat
import tensorflow as tf
from datasets import dataset_utils
flags = tf.app.flags
flags.DEFINE_string('dataset_dir',
... | [
"os.listdir",
"io.BytesIO",
"datasets.dataset_utils.int64_feature",
"os.path.isdir",
"random.shuffle",
"PIL.Image.open",
"tensorflow.compat.v1.logging.info",
"hashlib.sha256",
"datasets.dataset_utils.bytes_feature",
"tensorflow.compat.v1.logging.set_verbosity",
"datasets.dataset_utils.float_list... | [((832, 887), 'os.path.join', 'os.path.join', (['FLAGS.dataset_dir', 'FLAGS.dataset_category'], {}), '(FLAGS.dataset_dir, FLAGS.dataset_category)\n', (844, 887), False, 'import os\n'), ((902, 922), 'os.listdir', 'os.listdir', (['cls_path'], {}), '(cls_path)\n', (912, 922), False, 'import os\n'), ((1947, 1990), 'os.path... |
from pydantic import BaseModel, Field
from app.shared.enums import Units
class LocationBase(BaseModel):
units: Units = Units.METRIC
class CityLocation(BaseModel):
city: str
state: str | None = Field(default=None, max_length=3)
country: str | None = None
class Config:
schema_extra = {
... | [
"pydantic.Field"
] | [((210, 243), 'pydantic.Field', 'Field', ([], {'default': 'None', 'max_length': '(3)'}), '(default=None, max_length=3)\n', (215, 243), False, 'from pydantic import BaseModel, Field\n')] |
# Copyright 2014 The University of Edinburgh
#
# 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... | [
"rest_framework.serializers.SerializerMethodField",
"vercereg.utils.get_base_rest_uri",
"rest_framework.serializers.CharField",
"models.RegistryUserGroup.objects.get",
"django.contrib.auth.models.Group.objects.get"
] | [((1808, 1859), 'rest_framework.serializers.SerializerMethodField', 'serializers.SerializerMethodField', (['"""get_reg_groups"""'], {}), "('get_reg_groups')\n", (1841, 1859), False, 'from rest_framework import serializers\n'), ((3620, 3666), 'rest_framework.serializers.CharField', 'serializers.CharField', ([], {'source... |
import pdb # for debuggin
import sys
import time
import pprint
import fcntl # for get_ip_address
import struct # for get_ip_address
import threading # for threading UDPServer
import socket # for UDPServer
#sys.path.append("./third_party/libs/") # for scapy
#import StringIO # for dummy_exec
#import logging... | [
"threading.Thread",
"socket.socket",
"anhost.get_int_ip"
] | [((1695, 1743), 'socket.socket', 'socket.socket', (['socket.AF_INET', 'socket.SOCK_DGRAM'], {}), '(socket.AF_INET, socket.SOCK_DGRAM)\n', (1708, 1743), False, 'import socket\n'), ((1622, 1641), 'anhost.get_int_ip', 'anhost.get_int_ip', ([], {}), '()\n', (1639, 1641), False, 'import anhost\n'), ((1853, 1901), 'threading... |
#%%
import os
import pickle
import cloudpickle
import itertools
import glob
import numpy as np
import scipy as sp
import pandas as pd
import git
# Import matplotlib stuff for plotting
import matplotlib.pyplot as plt
import matplotlib.cm as cm
import matplotlib as mpl
# Seaborn, useful for graphics
import seaborn as s... | [
"pandas.DataFrame",
"matplotlib.pyplot.hist",
"numpy.argmax",
"pandas.read_csv",
"matplotlib.pyplot.legend",
"git.Repo",
"ccutils.model.log_p_m_unreg",
"ccutils.viz.set_plotting_style",
"numpy.exp",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.tight_layout",
"pi... | [((394, 426), 'ccutils.viz.set_plotting_style', 'ccutils.viz.set_plotting_style', ([], {}), '()\n', (424, 426), False, 'import ccutils\n'), ((486, 532), 'git.Repo', 'git.Repo', (['"""./"""'], {'search_parent_directories': '(True)'}), "('./', search_parent_directories=True)\n", (494, 532), False, 'import git\n'), ((733,... |
import pickle
import time
from datetime import datetime
def checkpoint(shared_model, shared_dataset, args):
try:
while True:
# Save dataset
file = open(args.data, 'wb')
pickle.dump(list(shared_dataset), file)
file.close()
# Save model
... | [
"datetime.datetime.now",
"time.sleep"
] | [((452, 471), 'time.sleep', 'time.sleep', (['(10 * 60)'], {}), '(10 * 60)\n', (462, 471), False, 'import time\n'), ((328, 342), 'datetime.datetime.now', 'datetime.now', ([], {}), '()\n', (340, 342), False, 'from datetime import datetime\n')] |
import unittest
import numpy as np
from frozendict import frozendict
from msdm.core.distributions import DictDistribution
from msdm.algorithms import ValueIteration, PolicyIteration, LRTDP
from msdm.tests.domains import Counter, GNTFig6_6, Geometric, VaryingActionNumber, make_russell_norvig_grid
from msdm.domains impor... | [
"unittest.main",
"msdm.algorithms.PolicyIteration",
"msdm.tests.domains.Counter",
"msdm.tests.domains.Geometric",
"msdm.algorithms.ValueIteration",
"msdm.tests.domains.make_russell_norvig_grid",
"msdm.algorithms.LRTDP",
"numpy.isclose",
"msdm.domains.GridWorld",
"msdm.domains.heavenorhell.HeavenOr... | [((5289, 5304), 'unittest.main', 'unittest.main', ([], {}), '()\n', (5302, 5304), False, 'import unittest\n'), ((422, 432), 'msdm.tests.domains.Counter', 'Counter', (['(3)'], {}), '(3)\n', (429, 432), False, 'from msdm.tests.domains import Counter, GNTFig6_6, Geometric, VaryingActionNumber, make_russell_norvig_grid\n')... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Test some edge cases.
"""
import unittest
from socialgraph import autommittee
class TestPowerHistory(unittest.TestCase):
def setUp(self):
self.G = autommittee.Graph()
self.G.add_edge('b', 'a')
self.G.add_edge('a', 'c')
self.G.add... | [
"socialgraph.autommittee.Graph"
] | [((214, 233), 'socialgraph.autommittee.Graph', 'autommittee.Graph', ([], {}), '()\n', (231, 233), False, 'from socialgraph import autommittee\n')] |
# Generated by Django 3.2.5 on 2021-07-20 13:39
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('chat', '0001_initial'),
... | [
"django.db.models.ForeignKey",
"django.db.migrations.swappable_dependency"
] | [((227, 284), 'django.db.migrations.swappable_dependency', 'migrations.swappable_dependency', (['settings.AUTH_USER_MODEL'], {}), '(settings.AUTH_USER_MODEL)\n', (258, 284), False, 'from django.db import migrations, models\n'), ((461, 590), 'django.db.models.ForeignKey', 'models.ForeignKey', ([], {'null': '(True)', 'on... |
# Copyright 2018 <NAME>, <NAME>, <NAME>.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | [
"os.makedirs",
"os.path.isdir",
"matplotlib.pyplot.close",
"os.path.dirname",
"matplotlib.rcParams.update",
"matplotlib.use",
"os.path.splitext"
] | [((749, 763), 'matplotlib.use', 'mpl.use', (['"""Agg"""'], {}), "('Agg')\n", (756, 763), True, 'import matplotlib as mpl\n'), ((2348, 2367), 'matplotlib.pyplot.close', 'plt.close', (['self.fig'], {}), '(self.fig)\n', (2357, 2367), True, 'import matplotlib.pyplot as plt\n'), ((3223, 3244), 'os.path.dirname', 'os.path.di... |