code stringlengths 1 199k |
|---|
import sys
import six
from heat.common import template_format
from heat.engine.clients.os import glance
from heat.engine.clients.os import keystone
from heat.engine.clients.os.keystone import fake_keystoneclient as fake_ks
from heat.engine.clients.os import nova
from heat.engine import environment
from heat.engine.reso... |
from __future__ import print_function
from builtins import range
from airflow.operators import PythonOperator
from airflow.models import DAG
from datetime import datetime, timedelta
import time
from pprint import pprint
seven_days_ago = datetime.combine(
datetime.today() - timedelta(7), datetime.min.time())
arg... |
from oslo_config import cfg
from oslo_db import options
from oslo_log import log
from ec2api import paths
from ec2api import version
CONF = cfg.CONF
_DEFAULT_SQL_CONNECTION = 'sqlite:///' + paths.state_path_def('ec2api.sqlite')
_DEFAULT_LOG_LEVELS = ['amqp=WARN', 'amqplib=WARN', 'boto=WARN',
'qpi... |
import telnetlib
from savanna.tests.integration import base
import savanna.tests.integration.configs.parameters as param
def _add_config(body, config):
if config in [param.NAMENODE_CONFIG, param.DATANODE_CONFIG]:
body['node_configs']['HDFS'] = config
elif config == param.GENERAL_CONFIG:
body['cl... |
from sqlalchemy import *
from test.lib import *
class FoundRowsTest(fixtures.TestBase, AssertsExecutionResults):
"""tests rowcount functionality"""
__requires__ = ('sane_rowcount', )
@classmethod
def setup_class(cls):
global employees_table, metadata
metadata = MetaData(testing.db)
... |
import json
import logging
import os
from lxml import etree
from django.core import management
from django.core.management.base import NoArgsCommand
from django.utils.translation import ugettext as _
from hadoop import cluster
from desktop.conf import USE_NEW_EDITOR
from desktop.models import Directory, Document, Docum... |
"""Tests for fedjax."""
import unittest
import fedjax
class FedjaxTest(unittest.TestCase):
"""Test fedjax can be imported correctly."""
def test_import(self):
self.assertTrue(hasattr(fedjax, 'FederatedAlgorithm'))
self.assertTrue(hasattr(fedjax.aggregators, 'Aggregator'))
self.assertTrue(hasattr(fedjax.... |
from __future__ import print_function
import sys
sys.path.insert(1,"../../../")
from tests import pyunit_utils
import h2o
from h2o.utils.typechecks import assert_is_type
from h2o.exceptions import H2OConnectionError, H2OServerError, H2OValueError
import tempfile
import shutil
import os
def h2oinit():
"""
Python... |
"""
Copyright (c) 2006-2017 sqlmap developers (http://sqlmap.org/)
See the file 'doc/COPYING' for copying permission
"""
class PRIORITY:
LOWEST = -100
LOWER = -50
LOW = -10
NORMAL = 0
HIGH = 10
HIGHER = 50
HIGHEST = 100
class SORT_ORDER:
FIRST = 0
SECOND = 1
THIRD = 2
FOURTH ... |
from __future__ import print_function, division
import cPickle
import gzip
import os
import sys
import timeit
import numpy
import theano
from theano import tensor
import mdn_one_ahead
batch_size = 100
L1_reg=0.00
L2_reg=0.0001
n_epochs=200
learning_rate = 0.001
momentum = 0.9
sigma_in = 320
mixing_in = 320
n_components... |
"""LSTM layer."""
from kws_streaming.layers import modes
from kws_streaming.layers.compat import tf
from kws_streaming.layers.compat import tf1
class LSTM(tf.keras.layers.Layer):
"""LSTM with support of streaming inference with internal/external state.
In training mode we use LSTM.
It receives input data [batch, ... |
import pytest
import tempfile
from polyaxon import settings
from polyaxon.auxiliaries import (
get_default_init_container,
get_default_sidecar_container,
)
from polyaxon.connections.kinds import V1ConnectionKind
from polyaxon.connections.schemas import V1BucketConnection, V1K8sResourceSchema
from polyaxon.excep... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow.compat.v1 as tf
def get_config():
return tf.contrib.training.HParams(**{
'total_bs': 64,
'eval_total_bs': 16,
'dataset_name': 'imagenet32',
'dataset_config': tf.contri... |
import urllib
import json
import time
from jose import jwk, jwt
from jose.utils import base64url_decode
region = 'ap-southeast-2'
userpool_id = 'ap-southeast-2_xxxxxxxxx'
app_client_id = '<ENTER APP CLIENT ID HERE>'
keys_url = 'https://cognito-idp.{}.amazonaws.com/{}/.well-known/jwks.json'.format(region, userpool_id)
r... |
"""Tests for MT Models."""
import lingvo.compat as tf
from lingvo.core import base_input_generator
from lingvo.core import base_layer
from lingvo.core import cluster_factory
from lingvo.core import layers
from lingvo.core import optimizer
from lingvo.core import py_utils
from lingvo.core import schedule
from lingvo.cor... |
from django.apps import AppConfig
class FundConfig(AppConfig):
name = 'fund' |
def main():
while True:
word = raw_input('Enter a word: ')
if word == '-1':
break
not_ = '' if word[:] == word[::-1] else ' not'
print "Word '%s' is%s a palindrome" % (word, not_)
main() |
from sqlalchemy.orm import exc
import quantum.db.api as db
from quantum.openstack.common import log as logging
from quantum.plugins.cisco.common import cisco_exceptions as c_exc
from quantum.plugins.cisco.db import nexus_models_v2
LOG = logging.getLogger(__name__)
def initialize():
"""Establish database connection ... |
from django.test import TestCase
from tenancy.filters import *
from tenancy.models import Tenant, TenantGroup
class TenantGroupTestCase(TestCase):
queryset = TenantGroup.objects.all()
filterset = TenantGroupFilterSet
@classmethod
def setUpTestData(cls):
parent_tenant_groups = (
Tenan... |
import glob
import os
import unittest
from src.test.py.bazel import test_base
class BazelWindowsCppTest(test_base.TestBase):
def createProjectFiles(self):
self.CreateWorkspaceWithDefaultRepos('WORKSPACE')
self.ScratchFile('BUILD', [
'package(',
' default_visibility = ["//visibility:public"],'... |
"""Utility function for voxels."""
import gin
import gin.tf
import tensorflow as tf
from tf3d.layers import sparse_voxel_net_utils
from tf3d.utils import shape_utils
compute_pooled_voxel_indices = sparse_voxel_net_utils.compute_pooled_voxel_indices
pool_features_given_indices = sparse_voxel_net_utils.pool_features_give... |
__author__ = "Ponzoni, Nelson"
__copyright__ = "Copyright 2015"
__credits__ = ["Ponzoni Nelson"]
__maintainer__ = "Ponzoni Nelson"
__contact__ = "npcuadra@gmail.com"
__email__ = "npcuadra@gmail.com"
__license__ = "GPL"
__version__ = "1.0.0"
__status__ = "Production"
"""
GRID search
""... |
from .responses import InstanceMetadataResponse
url_bases = ["http://169.254.169.254"]
instance_metadata = InstanceMetadataResponse()
url_paths = {"{0}/(?P<path>.+)": instance_metadata.metadata_response} |
import copy
import pprint
import ipaddr
import netaddr
from neutronclient.common import exceptions as neutron_exc
from neutronclient.v2_0 import client as neutron_client
from cloudferrylib.base import exception
from cloudferrylib.base import network
from cloudferrylib.os.identity import keystone as ksresource
from clou... |
from suds.client import Client
from nova import exception
from nova import db
import logging
logging.getLogger('suds').setLevel(logging.INFO)
def update_for_run_instance(service_url, region_name, server_port1, server_port2, dpid1, dpid2):
# check region name
client = Client(service_url + "?wsdl")
client.ser... |
"""Tensorflow input/output utilities."""
import collections
import json
import math
import os
import numpy as np
import tensorflow.compat.v1 as tf
class Features(object):
"""Feature keys."""
# Waveform(s) of audio observed at receiver(s).
RECEIVER_AUDIO = 'receiver_audio'
# Images of each source at each microph... |
from __future__ import absolute_import, unicode_literals
import re
from django.conf import settings
from django.template import Library, Node, NodeList, TemplateSyntaxError
from django.utils.encoding import smart_str
from thummer.utils import get_thumbnail
register = Library()
kw_pat = re.compile(r'^(?P<key>[\w]+)=(?P<... |
"""Support for RFXtrx covers."""
import logging
from homeassistant.components.cover import CoverEntity
from homeassistant.const import CONF_DEVICES, STATE_OPEN
from homeassistant.core import callback
from . import (
CONF_AUTOMATIC_ADD,
CONF_DATA_BITS,
CONF_SIGNAL_REPETITIONS,
DEFAULT_SIGNAL_REPETITIONS,... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import sys
sys.path.insert(0,'..')
import tensorflow as tf
import numpy as np
import itertools
import pickle
import os
import re
import inception_v4
os.environ['CUDA_VISIBLE_DEVICES'] = ''
def atoi(text):
re... |
from __future__ import absolute_import
from traits.api import Instance
from twisted.internet import reactor
from twisted.internet.endpoints import TCP4ServerEndpoint
from twisted.internet.protocol import Factory
from pychron.headless_loggable import HeadlessLoggable
from pychron.tx.protocols.service import ServiceProto... |
"""
WSGI config for cg4 project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.6/howto/deployment/wsgi/
"""
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "cg4.settings")
from django.core.wsgi import g... |
from .database import BaseMessage
from .records import RecordUpdateMessage, RecordDeleteMessage, RecordCreateMessage
from ..exceptions import PyOrientBadMethodCallException
from ..constants import COMMAND_OP, FIELD_BOOLEAN, FIELD_BYTE, FIELD_CHAR, \
FIELD_INT, FIELD_LONG, FIELD_SHORT, FIELD_STRING, QUERY_SYNC, FIEL... |
import time
from typing import List
from paasta_tools.deployd.common import DelayDeadlineQueueProtocol
from paasta_tools.deployd.common import PaastaThread
from paasta_tools.deployd.workers import PaastaDeployWorker
from paasta_tools.metrics.metrics_lib import BaseMetrics
class MetricsThread(PaastaThread):
def __in... |
import os
import setuptools
module_path = os.path.join(os.path.dirname(__file__), 'url_for_s3.py')
version_line = [line for line in open(module_path)
if line.startswith('__version__')][0]
__version__ = version_line.split('__version__ = ')[-1][1:][:-2]
setuptools.setup(
name="url-for-s3",
version... |
from __future__ import unicode_literals
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),
('goods', '0002_auto_20171017_2017'),
... |
import os
import subprocess
import sys
from textwrap import dedent
from twitter.common.contextutil import pushd
from pex.testing import temporary_content
def assert_entry_points(entry_points):
setup_py = dedent("""
from setuptools import setup
setup(
name='my_app',
version='0.0.0',
... |
import glob
json_files = glob.glob("tests/**/output/**/*.json", recursive=True)
html_files = glob.glob("tests/**/output/**/*.html", recursive=True)
html_list = ""
for f_ in html_files:
html_list += '\t<li><a href="{}">{}</li>\n'.format(
f_[6:],
f_.split(".")[-2],
)
json_list = ""
for f_ in json_... |
import telnetlib
import time
import socket
import sys
import getpass
TELNET_PORT = 23
TELNET_TIMEOUT = 6
def send_command(remote_conn, cmd):
'''
Initiate the Telnet Session
'''
cmd = cmd.rstrip()
remote_conn.write(cmd + '\n')
time.sleep(1)
return remote_conn.read_very_eager()
def login(remot... |
from __future__ import unicode_literals
'''Generate header file for nanopb from a ProtoBuf FileDescriptorSet.'''
nanopb_version = "nanopb-0.3.9.2"
import sys
import re
import codecs
from functools import reduce
try:
# Add some dummy imports to keep packaging tools happy.
import google, distutils.util # bbfreeze... |
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('base', '0003_auto_20151109_2002'),
]
operations = [
migrations.AlterField(
model_name='bodega',
name='sucursal',
fiel... |
import os
from copy import deepcopy
bids_schema = {
# BIDS identification bits
'modality': {
'type': 'string',
'required': True
},
'subject_id': {
'type': 'string',
'required': True
},
'session_id': {'type': 'string'},
'run_id': {'type': 'string'},
'acq_id... |
'''
Description:
Author: Ronald van Haren, NLeSC (r.vanharen@esciencecenter.nl)
Created: -
Last Modified: -
License: Apache 2.0
Notes: -
'''
from lxml.html import parse
import csv
import urllib2
from lxml import html
import numbers
import json
import os
import utils
from numpy import vst... |
"""
DataFrame-based machine learning APIs to let users quickly assemble and configure practical
machine learning pipelines.
"""
from pyspark.ml.base import Estimator, Model, Transformer
from pyspark.ml.pipeline import Pipeline, PipelineModel
__all__ = ["Transformer", "Estimator", "Model", "Pipeline", "PipelineModel"] |
from django.db.models import Count
from dcim.models import Device, Interface
from extras.api.views import CustomFieldModelViewSet
from utilities.api import FieldChoicesViewSet, ModelViewSet
from utilities.utils import get_subquery
from virtualization import filters
from virtualization.models import Cluster, ClusterGrou... |
import tensorflow as tf
from tensorflow.examples.tutorials.mnist import input_data
mnist = input_data.read_data_sets('data', one_hot=True)
mnist_train = mnist.train
mnist_val = mnist.validation
p = 28 * 28
n = 10
h1 = 300
func_act = tf.nn.sigmoid
x_pl = tf.placeholder(dtype=tf.float32, shape=[None, p])
y_pl = tf.placeh... |
from ..remote import RemoteModel
from infoblox_netmri.utils.utils import check_api_availability
class DeviceObjectObjectRemote(RemoteModel):
"""
Network Objects cross usage
| ``DeviceObjectObjectID:`` The internal NetMRI identifier of this usage relationship between network objects.
| ``attribute type... |
from touchdown.core import argument, errors, serializers
from touchdown.core.plan import Plan, Present
from touchdown.core.resource import Resource
from ..common import SimpleApply, SimpleDescribe, SimpleDestroy, TagsMixin
from .network_acl import NetworkACL
from .route_table import RouteTable
from .vpc import VPC
clas... |
class X:
return 3 |
"""A trainer object that can train models with a single output."""
from absl import logging
from third_party.tf_models import orbit
import tensorflow as tf
class IdentityMetric(tf.keras.metrics.Metric):
"""Keras metric to report value at any instant."""
def __init__(self, name, aggregation):
"""Constructor.
... |
from logging import getLogger
from cornice.resource import resource, view
from openprocurement.api.models import Complaint, STAND_STILL_TIME, get_now
from openprocurement.api.utils import (
apply_patch,
save_tender,
add_next_award,
error_handler,
update_journal_handler_params,
)
from openprocurement... |
from __future__ import print_function
from os.path import *
import re
from parseDirectiveArgs import parseDirectiveArguments
class MyError(Exception):
def __init__(self, value):
self.value = value
def __str__(self):
return repr(self.value)
assertVariants = 'Fail|Equal|True|False|LessThan|LessTha... |
from django.template import RequestContext
from django.shortcuts import render_to_response
from django.db import connection
from collections import OrderedDict
from datetime import datetime
import time
import scipy.cluster.hierarchy as hcluster
import numpy as np
class ObsoletedTasksReport:
def __init__(self):
... |
from django.db import models, migrations
import uuid
from django.contrib.auth.hashers import make_password
PUBLIC_ID = 1
def apply_migration(apps, schema_editor):
Group = apps.get_model('auth', 'Group')
public_group = Group()
public_group.name = "public"
public_group.id = PUBLIC_ID
public_group.save... |
'''
Django settings for bmcodelab project.
Generated by 'django-admin startproject' using Django 2.1.1.
For more information on this file, see
https://docs.djangoproject.com/en/2.1/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.1/ref/settings/
'''
import os
impo... |
from flask import Flask
from google.cloud import ndb
client = ndb.Client()
def ndb_wsgi_middleware(wsgi_app):
def middleware(environ, start_response):
with client.context():
return wsgi_app(environ, start_response)
return middleware
app = Flask(__name__)
app.wsgi_app = ndb_wsgi_middleware(ap... |
class BulkInsert(object):
"""
Usage:
user_insert = BulkInsert(session)
address_insert = BulkInsert(session, dependencies=[user_insert])
for user in users:
user_insert.add(user)
from address in user_addresses:
address_insert.add(address)
address_ins... |
import http.cookiejar
import json
import re
import requests
import urllib.parse
import http.server
import webbrowser
from datetime import datetime, timezone, timedelta
import os.path
from pprint import pprint
PARSE_JSON = True
GWENT_CLIENT_ID = "48242550540196492"
GWENT_CLIENT_SECRET = "d9571bba9c10784309a98aa59816696d... |
import numpy as np
try:
from aurora.ndarray import gpu_op, ndarray
except ImportError:
pass
class Node(object):
""" Node object represents a node in the computational graph"""
def __init__(self):
""" New node will be created by Op objects __call__ method"""
# list of inputs to this node
... |
from datetime import datetime
from functools import lru_cache
import inspect
import pickle
import pytest
import random
import textwrap
import numpy as np
import pyarrow as pa
import pyarrow.compute as pc
all_array_types = [
('bool', [True, False, False, True, True]),
('uint8', np.arange(5)),
('int8', np.ara... |
import unittest2
from oslo_config import cfg
from st2common.services import rbac as rbac_services
from st2common.rbac.types import PermissionType
from st2common.rbac.types import ResourceType
from st2common.rbac.types import SystemRole
from st2common.persistence.auth import User
from st2common.persistence.rbac import R... |
import re
from ztag.annotation import Annotation
from ztag.annotation import OperatingSystem
from ztag import protocols
import ztag.test
class FtpCesarFtpd(Annotation):
protocol = protocols.FTP
subprotocol = protocols.FTP.BANNER
port = None
impl_re = re.compile("^220[- ]CesarFTP 0\.\d+", re.IGNORECASE)
... |
"""Test the file transfer mechanism."""
import hashlib
import io
import itertools
import os
import platform
import struct
import unittest
from unittest import mock
from absl import app
from grr_response_core.lib import constants
from grr_response_core.lib import utils
from grr_response_core.lib.rdfvalues import client ... |
"""
Django settings for pybr11_tutorial project.
Generated by 'django-admin startproject' using Django 1.8.6.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.8/ref/settings/
"""
import o... |
import random
def append_letter_or_number():
alphabet = ['a','b','c','d','e','f']
use_number = 0
use_letter = 1
letter_or_string = random.randrange(2)
if letter_or_string == use_number:
result = str(random.randrange(0,9))
elif letter_or_string == use_letter:
next_character = rand... |
"""Motor INA219 hardware monitor configuration."""
from makani.avionics.firmware.drivers import ina219_types
from makani.avionics.firmware.serial import motor_serial_params as rev
ina219_default = {
'name': '',
'address': 0x0,
'shunt_resistor': 0.01,
'bus_voltage': ina219_types.kIna219BusVoltage16V,
... |
"""
Lazy 'tox' to quickly check if branch is up to PR standards.
This is NOT a tox replacement, only a quick check during development.
"""
import os
import asyncio
import sys
import re
import shlex
from collections import namedtuple
try:
from colorlog.escape_codes import escape_codes
except ImportError:
escape_... |
"""
Define the Python wrapper-functions which provide an interface to the C++
implementations.
"""
from .present import CPP_BINDINGS_PRESENT
from .imager import cpp_image_visibilities, CppKernelFuncs |
from django.db import models
from django.db import models
from django.utils.translation import ugettext as _
from django.conf import settings
from projects.models import Project, Customer
class Report (models.Model):
HIGHLIGHT = 'HL'
LOWLIGHT = 'LL'
ESCALATION = 'XS'
LIGHTS = (
(HIGHLIGHT, _(... |
"""A library of random helper functionality."""
import functools
import sys
import stat
import time
import platform, subprocess, operator, os, shutil, re
import collections
from enum import Enum
from functools import lru_cache
from mesonbuild import mlog
have_fcntl = False
have_msvcrt = False
project_meson_versions = {... |
"""Common utilities."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
ATT_LUONG = "luong"
ATT_LUONG_SCALED = "luong_scaled"
ATT_BAHDANAU = "bahdanau"
ATT_BAHDANAU_NORM = "bahdanau_norm"
ATT_TYPES = (ATT_LUONG, ATT_LUONG_SCALED, ATT_BAHDANAU, ATT_BAHDANAU_NO... |
"""
Copyright 2016 ARC Centre of Excellence for Climate Systems Science
author: Scott Wales <scott.wales@unimelb.edu.au>
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/lice... |
import unittest
from pyflink.table import DataTypes
from pyflink.table.udf import TableFunction, udtf, ScalarFunction, udf
from pyflink.testing import source_sink_utils
from pyflink.testing.test_case_utils import PyFlinkOldStreamTableTestCase, \
PyFlinkBlinkStreamTableTestCase, PyFlinkOldBatchTableTestCase, PyFlink... |
import abc
import time
import netaddr
from neutron_lib import constants
from oslo_log import log as logging
import six
from neutron.agent.common import ovs_lib
from neutron.agent.linux import ip_lib
from neutron.common import constants as n_const
from neutron.common import exceptions
LOG = logging.getLogger(__name__)
d... |
from distutils.core import setup
setup(
name = 'nicknester',
version = '1.3.0',
py_modules = ['nester'],
author = 'htýthon',
author_email = 'hfpython@headfirstlabs.com',
url = 'http://www.headfirstlabs.com',
description = 'A simple printer of nest... |
import errno
import os
import unittest
import mock
from taskcat._common_utils import (
exit_with_code,
fetch_ssm_parameter_value,
get_s3_domain,
make_dir,
merge_dicts,
name_from_stack_id,
param_list_to_dict,
pascal_to_snake,
region_from_stack_id,
s3_bucket_name_from_url,
s3_k... |
import random
import numpy
from graph_diff.nirvana_object_model.workflow import Workflow
from .standard_workflow_generator import StandardWorkflowGenerator
class ChainWorkflowGenerator(StandardWorkflowGenerator):
"""Generator for chained workflows"""
def __init__(self):
super().__init__()
self.c... |
from __future__ import print_function
import argparse
import os
import subprocess
import sys
from test_util import TestFailedError, run_command, \
serializeIncrParseMarkupFile
def main():
parser = argparse.ArgumentParser(
formatter_class=argparse.RawDescriptionHelpFormatter,
description='Utility... |
import datetime
import time
from pandac.PandaModules import TextNode, Vec3, Vec4, PlaneNode, Plane, Point3
from toontown.pgui.DirectGui import DirectFrame, DirectLabel, DirectButton, DirectScrolledList, DGG
from direct.directnotify import DirectNotifyGlobal
from toontown.pgui import DirectGuiGlobals
from toontown.toonb... |
"""
Sponge Knowledge Base
Using unordered rules
"""
from java.util.concurrent.atomic import AtomicInteger
from org.openksavi.sponge.examples import SameSourceJavaUnorderedRule
from org.openksavi.sponge.core.library import Deduplication
def onInit():
# Variables for assertions only
sponge.setVariable("hardwareFa... |
"""
Django settings for librarymanagementsystem project.
For more information on this file, see
https://docs.djangoproject.com/en/1.6/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.6/ref/settings/
"""
import os
BASE_DIR = os.path.dirname(os.path.dirname(__file__... |
from google.cloud import dialogflow_v2
def sample_delete_conversation_dataset():
# Create a client
client = dialogflow_v2.ConversationDatasetsClient()
# Initialize request argument(s)
request = dialogflow_v2.DeleteConversationDatasetRequest(
name="name_value",
)
# Make the request
op... |
from __future__ import division, print_function, unicode_literals
__doc__="""
Creates guides through all selected nodes.
"""
from Foundation import NSPoint
import math
thisFont = Glyphs.font # frontmost font
selectedLayers = thisFont.selectedLayers # active layers of selected glyphs
def angle( firstPoint, secondPoint )... |
import abc
import typing
import pkg_resources
import google.auth # type: ignore
from google.api_core import gapic_v1
from google.auth import credentials as ga_credentials # type: ignore
from google.ads.googleads.v9.resources.types import campaign_simulation
from google.ads.googleads.v9.services.types import campaign_... |
import codecs
import os
import re
import setuptools
from setuptools import find_packages, setup
from setuptools.command.develop import develop
from setuptools.command.install import install
PROJECT_ROOT = os.path.dirname(os.path.realpath(__file__))
REQUIREMENTS_FILE = os.path.join(PROJECT_ROOT, "requirements.txt")
REQU... |
'''
analyze_gsimg.py - analyze G Suite image processing workflow
Download image from Google Drive, archive to Google Cloud Storage, send
to Google Cloud Vision for processing, add results row to Google Sheet.
'''
from __future__ import print_function
import argparse
import base64
import io
import os
import webbrowser
f... |
from optparse import OptionParser
import filecmp
import json
import of_daemon
import of_node
import of_util
import os
import subprocess
import sys
import tempfile
import time
of_util.check_python_version()
parser = OptionParser()
(opts, args, node_list) = of_util.parse_deploy_opts(parser)
if opts.bld_dir == None:
s... |
from oslo_utils import encodeutils
import six
from six.moves.urllib import parse
from eclcli.orchestration.heatclient.common import utils
from eclcli.orchestration.heatclient.openstack.common.apiclient import base
from eclcli.orchestration.heatclient.v1 import stacks
DEFAULT_PAGE_SIZE = 20
class Event(base.Resource):
... |
import argparse
from uaitrain.operation.pack_docker_image.caffe_pack_op import CaffeUAITrainDockerImagePackOp
from uaitrain.operation.create_train_job.base_create_op import BaseUAITrainCreateTrainJobOp
from uaitrain.operation.stop_train_job.base_stop_op import BaseUAITrainStopTrainJobOp
from uaitrain.operation.delete_t... |
from django.apps import AppConfig
class AttachmentsConfig(AppConfig):
verbose_name = 'Attachments' |
import time
import logging
from typing import Callable, List, TypeVar, Text
from psycopg2.extensions import cursor
CursorObj = TypeVar('CursorObj', bound=cursor)
from django.db import connection
from zerver.models import UserProfile
'''
NOTE! Be careful modifying this library, as it is used
in a migration, and it need... |
p = dict(
subject = 'EG009',
#Fixation size (in degrees):
fixation_size = 0.4,
monitor='testMonitor',
scanner=True,
screen_number = 1,
full_screen = True,
radial_cyc = 10,
angular_cyc = 15,
angular_width=30,
size = 60, #This just needs to be larger than the screen
tempora... |
"""
Component that will help set the level of logging for components.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/logger/
"""
import logging
from collections import OrderedDict
import voluptuous as vol
import homeassistant.helpers.config_validation as... |
from ironicclient.tests.functional import base
class IronicClientHelp(base.FunctionalTestBase):
"""Test for python-ironicclient help messages."""
def test_ironic_help(self):
"""Check Ironic client main help message contents."""
caption = ("Command-line interface to the "
"Open... |
from distutils.core import setup
setup(
name='fetcher',
version='0.4',
install_requires=['pycurl==7.19.0.2'],
packages=['fetcher']) |
import warnings
from typing import Callable, Dict, Optional, Sequence, Tuple, Union
from google.api_core import grpc_helpers
from google.api_core import gapic_v1
import google.auth # type: ignore
from google.auth import credentials as ga_credentials # type: ignore
from google.auth.transport.grpc import SslCredentials... |
"""
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is... |
"""Test classes for the pubsub-to-datastore module."""
import os
import time
import unittest
import urllib
import json
import sys
sys.path.insert(1, 'lib')
import httplib2
GAE_HOST = "pubsub-to-datastore-dot-cloud-iot-dev.appspot.com"
def url_for(path):
"""Returns the URL of the endpoint for the given path."""
... |
"""This example follows the simple text document Pipeline illustrated in the figures above.
"""
from pyspark.ml import Pipeline
from pyspark.ml.classification import LogisticRegression
from pyspark.ml.feature import HashingTF, Tokenizer
training = spark.createDataFrame([
(0, "a b c d e spark", 1.0),
(1, "b d", ... |
import os
import base64
from random import choice
def random_file_from_dir(relative_path):
random_file = choice(os.listdir(os.path.join(os.getcwd(), relative_path)))
return abs_path_to_file(os.path.join(relative_path, random_file))
def abs_path_to_file(relative_path):
# print os.getcwd()
return os.path.... |
import uuid
import ddt
from zaqar.tests.functional import base
from zaqar.tests.functional import helpers
@ddt.ddt
class TestClaims(base.V1_1FunctionalTestBase):
"""Tests for Claims."""
server_class = base.ZaqarServer
def setUp(self):
super(TestClaims, self).setUp()
self.headers = helpers.cr... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.