code stringlengths 1 199k |
|---|
from __future__ import absolute_import
__copyright__ = "Copyright (C) 2013 David Braam - Released under terms of the AGPLv3 License"
import math
import os
import base64
import zlib
import logging
from octoprint.settings import settings
preferences = {
"extruder_offset_x1": -22.0,
"extruder_offset_y1": 0.0,
... |
{
"name": "Use email templates in notifications",
"version": "8.0.1.0.0",
"author": "Therp BV,Odoo Community Association (OCA)",
"license": "AGPL-3",
"category": "Social Network",
"summary": "Allows to configure message subtypes with mail templates",
"depends": [
'mail',
'ema... |
from numpy import matrix
o3X = matrix([
[0.00335570469798658,-11.919,0,0,1.05,0,0,1,0,0],
[0.00561797752808989,-10.675,1,0,1.257,0,0,1,0,0],
[0.00546448087431694,-10.675,1,0,1.257,0,0,1,0,0],
[0.00518134715025907,-10.675,1,0,1.257,0,0,1,0,0],
[0.00480769230769231,-10.675,1,0,1.257,0,0,1,0,0],
[0.00462962962962963,-10.6... |
data2 = open("w6_group.txt").read()
group = data2.splitlines()
result_g = []
for i in group:
#print(i)
#print(i.split(",")[:-1])
for j in i.split(",")[:-1]:
result_g .append(j)
print(result_g)
data3 = open("w6_list.txt").read()
registered = data3.splitlines()
print(registered)
for m in registered :
... |
import datetime
import hashlib
import logging
import re
import sys
import werkzeug
import werkzeug.exceptions
import werkzeug.routing
import werkzeug.urls
import werkzeug.utils
import openerp
import openerp.exceptions
import openerp.models
from openerp import http
from openerp.http import request
from openerp.osv impor... |
"""Tests of email marketing signal handlers."""
import datetime
import logging
import ddt
from django.conf import settings
from django.contrib.auth.models import AnonymousUser
from django.contrib.sites.models import Site
from django.test import TestCase
from django.test.client import RequestFactory
from freezegun impor... |
from tastypie.api import Api
from resources.user import UserResource
from resources.agora import AgoraResource
from resources.election import ElectionResource
from resources.castvote import CastVoteResource
from resources.delegateelectioncount import DelegateElectionCountResource
from resources.search import SearchReso... |
COMPONENT_SYSTEM_DEFAULT = {
'main_dish': 1,
'size': 'R',
'dessert': 1,
'diabetic': 0,
'fruit_salad': 0,
'green_salad': 0,
'pudding': 0,
'compote': 0,
'sides': 0
} |
"""
Content type gating waffle flag
"""
import random
from django.dispatch import receiver
from django.db import IntegrityError
from experiments.models import ExperimentData, ExperimentKeyValue
from openedx.core.djangoapps.waffle_utils import WaffleFlagNamespace, WaffleFlag
from student.models import EnrollStatusChange... |
from Acquisition import aq_inner
from Acquisition import aq_parent
from Products.CMFCore.utils import getToolByName
from Products.Archetypes.config import REFERENCE_CATALOG
def upgrade(tool):
"""Added bika.lims.instrumentcalibration.edit.js
"""
portal = aq_parent(aq_inner(tool))
setup = portal.portal_se... |
from spack import *
class Jpegoptim(AutotoolsPackage):
"""jpegoptim - utility to optimize/compress JPEG files"""
homepage = "https://www.iki.fi/tjko/projects.html"
url = "https://github.com/tjko/jpegoptim/archive/RELEASE.1.4.6.tar.gz"
version('1.4.6', sha256='c44dcfac0a113c3bec13d0fc60faf57a0f9a31f... |
def itemTemplate():
return ['object/tangible/loot/creature_loot/collections/shared_housing_improvement_04.iff']
def lootDescriptor():
return 'customattributes'
def customizationAttributes():
return ['/private/index_color_1']
def customizationValues():
return [7]
def STFparams():
return ['static_item_n','i... |
from . import util
frozen_machinery, source_machinery = util.import_importlib('importlib.machinery')
import sys
import unittest
@unittest.skipUnless(sys.platform.startswith('win'), 'requires Windows')
class WindowsRegistryFinderTests:
# XXX Need a test that finds the spec via the registry.
def test_find_spec_mi... |
"""Tests for Grappler AutoMixedPrecision."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
from absl.testing import parameterized
import numpy as np
from tensorflow.core.framework import types_pb2
from tensorflow.core.protobuf import config_pb2
fr... |
from __future__ import with_statement
from itertools import groupby
import os
import posixpath
import re
from StringIO import StringIO
from genshi.builder import tag
from trac.config import Option, BoolOption, IntOption
from trac.core import *
from trac.mimeview.api import Mimeview
from trac.perm import IPermissionRequ... |
from __future__ import print_function
import fault_tolerance_utils as utils
import h2o
import unittest
class FrameReloadTest(unittest.TestCase):
def test_frame_reload(self):
name_node = utils.hadoop_namenode()
work_dir = utils.get_workdir()
dataset = "/datasets/mnist/train.csv.gz"
sa... |
from tempest.api.compute import base
from tempest.common.utils import data_utils
from tempest import config
from tempest import exceptions
from tempest.openstack.common import log as logging
from tempest import test
CONF = config.CONF
LOG = logging.getLogger(__name__)
class ImagesOneServerNegativeTestJSON(base.BaseV2Co... |
import os
from os.path import dirname
import testtools
from cloudify.constants import MANAGER_FILE_SERVER_BLUEPRINTS_ROOT_URL_KEY, \
MANAGER_FILE_SERVER_URL_KEY
from cloudify import context
from cloudify import exceptions
from cloudify.utils import create_temp_folder
import cloudify.tests as tests_path
class Cloudi... |
import json
from ..errors import InvalidVersion
from ..utils import check_resource, minimum_version
from ..utils import version_lt
class NetworkApiMixin(object):
@minimum_version('1.21')
def networks(self, names=None, ids=None):
filters = {}
if names:
filters['name'] = names
... |
"""Module containing classes related to Azure VM networking.
The Firewall class provides a way of opening VM ports. The Network class allows
VMs to communicate via internal ips and isolates PerfKitBenchmarker VMs from
others in
the same project. See http://msdn.microsoft.com/library/azure/jj156007.aspx
for more informa... |
from __future__ import division, print_function, absolute_import
import sys
import math
import numpy as np
from numpy import sqrt, cos, sin, arctan, exp, log, pi, Inf
from numpy.testing import (assert_, TestCase, run_module_suite, dec,
assert_allclose, assert_array_less, assert_almost_equal)
from scipy.integrat... |
"""
description: Configuration part of wrfpy
license: APACHE 2.0
"""
import os
import tempfile
import unittest
import pkg_resources
from wrfpy.config import config
class TestConfig(unittest.TestCase):
"""Tests for the config module."""
def test_load_valid_config(self):
"""Test validation for r... |
"""Test class for iSCSI deploy mechanism."""
import os
import tempfile
from ironic_lib import disk_utils
from ironic_lib import utils as ironic_utils
import mock
from oslo_config import cfg
from oslo_utils import fileutils
from ironic.common import dhcp_factory
from ironic.common import driver_factory
from ironic.commo... |
from rest_framework import serializers
from drf_nest.serializer_fields import TypeField, GenericRelatedField
from cbe.party.models import GenericPartyRole, Owner, PartyRoleAssociation
from cbe.party.serializers import GenericPartyRoleSerializer
from cbe.customer.models import Customer
from cbe.customer.serializers impo... |
import mock
from kombu import Connection
from oslo.config import cfg
from st2actions.resultstracker import ACTIONSTATE_WORK_Q, ResultsTracker
from st2common.models.db.executionstate import ActionExecutionStateDB
from st2common.persistence.executionstate import ActionExecutionState
from st2tests.base import DbTestCase, ... |
from __future__ import print_function
import unittest
import numpy as np
from op_test import OpTest
from paddle import fluid
def row_conv_forward(x, lod, wt):
out = np.zeros_like(x)
num_sequences = len(lod[0])
seq_info = [0]
for seq_len in lod[0]:
seq_info.append(seq_info[-1] + seq_len)
cont... |
"""Wrapper scripts to ensure that main.py commands are called correctly."""
import argh
import argparse
import cloud_logging
import logging
import os
import main
import shipname
import sys
import time
import shutil
import dual_net
import preprocessing
import glob
from utils import timer
from tensorflow import gfile
imp... |
"""
Record types for representing deployment models.
**IMPORTANT:**
If you change classes in this module that get serialized as part of the
cluster configuration file you need to write upgrade code to support
upgrading from older versions of Flocker.
"""
from uuid import UUID
from warnings import warn
from hashlib impo... |
"""Tests for the fake file system builder object."""
import unittest
from dfvfs.helpers import fake_file_system_builder
from tests import test_lib as shared_test_lib
class FakeFileSystemBuilderTest(shared_test_lib.BaseTestCase):
"""The unit test for the fake file system builder object."""
def testAddDirectory(self)... |
from .get import GetView |
from __future__ import unicode_literals
from django.db import migrations, models
import uuid
class Migration(migrations.Migration):
dependencies = [
('workflow', '0022_organization_allow_budget_decimal'),
]
operations = [
migrations.RemoveField(
model_name='contact',
... |
"""The volumes snapshots api."""
from http import HTTPStatus
from oslo_log import log as logging
from oslo_utils import strutils
import webob
from cinder.api import api_utils
from cinder.api import common
from cinder.api.openstack import wsgi
from cinder.api.schemas import snapshots as snapshot
from cinder.api import v... |
outfile = None
class lrilog(object):
def __init__(self,name,outfilename=None,verbose=False):
global outfile
self.name = name
self.outfilename = outfilename
self.verbose = verbose
if self.outfilename:
if not outfile:
self.open_logfile()
def open... |
from a10sdk.common.A10BaseClass import A10BaseClass
class Stats(A10BaseClass):
"""This class does not support CRUD Operations please use parent.
:param sessions_num: {"description": "Total Data Sessions", "format": "counter", "type": "number", "oid": "1", "optional": true, "size": "8"}
:param port_out_of_ra... |
from distutils.core import setup
setup(
name='edx-analytics-data-api-client',
version='0.6.1',
packages=['analyticsclient', 'analyticsclient.constants'],
url='https://github.com/edx/edx-analytics-data-api-client',
description='Client used to access edX analytics data warehouse',
long_description... |
class InvalidTriggerError(Exception):
def __init__(self, trigger, state, valid_triggers):
self.trigger = trigger
self.state = state
self.valid_triggers = valid_triggers
self.message = 'Cannot trigger "{}" from state "{}". Valid triggers: {}'.format(trigger, state, valid_triggers) |
import unittest
from .base import BaseTestCase
@unittest.skip
class ScriptTest(BaseTestCase):
def test(self):
self.assert_expression(
script.doc[ShopDocument.type].value,
"doc['type'].value"
)
self.assert_expression(
script.doc[ShopDocument.location].dista... |
"""Fetch sources from upstream locations and combine them with sources from
the osg/ dir in the package.
Lines from upstream/*.source files can specify a cached upstream source
archive, relative to the upstream cache prefix:
pkg/version/file.ext [sha1sum=...]
OR a field=value sequence, with support for building fro... |
import argparse
import os
import pwd
import signal
import subprocess
import sys
import time
import traceback
from urllib.parse import urlunparse
from lib import sanity_check
sanity_check.check_venv(__file__)
from tornado import httpclient
from tornado import httputil
from tornado import gen
from tornado import web
from... |
"""This module is deprecated. Please use `airflow.hooks.dbapi`."""
import warnings
from airflow.hooks.dbapi import DbApiHook # noqa
warnings.warn(
"This module is deprecated. Please use `airflow.hooks.dbapi`.", DeprecationWarning, stacklevel=2
) |
"""Configuration and utilities for receiving inputs at serving time."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import collections
import os
import six
from tensorflow.python.estimator import util
from tensorflow.python.framework import dtypes
from te... |
"""
OpenAPI spec version:
Generated by: https://github.com/swagger-api/swagger-codegen.git
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/L... |
import argparse
import base64
import functools
import json
import sys
import uuid
import weakref
from threading import Thread, Lock
try:
from urllib.parse import urlencode
except ImportError:
from urllib import urlencode
import pika
import tornado.websocket
import tornado.ioloop
import tornado.auth
import torna... |
import base64
import hashlib
import hmac
import sys
import time
import uuid
from libcloud.utils.py3 import ET
from libcloud.common.base import ConnectionUserAndKey, XmlResponse
from libcloud.common.types import MalformedResponseError
from libcloud.utils.py3 import b, u, urlquote, PY3
from libcloud.utils.xml import find... |
"""Tests and benchmarks for the ResNet50 model, executed eagerly."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import gc
import tempfile
import time
from six.moves import xrange # pylint: disable=redefined-builtin
import tensorflow as tf
import tensorf... |
"""Tests for the WinVer Windows Registry plugin."""
import unittest
from plaso.dfwinreg import definitions as dfwinreg_definitions
from plaso.dfwinreg import fake as dfwinreg_fake
from plaso.formatters import winreg as _ # pylint: disable=unused-import
from plaso.lib import eventdata
from plaso.lib import timelib
from... |
import collections
import random
import threading
import time
import weakref
import sqlalchemy as tsa
from sqlalchemy import event
from sqlalchemy import pool
from sqlalchemy import select
from sqlalchemy import testing
from sqlalchemy.testing import assert_raises
from sqlalchemy.testing import assert_raises_context_ok... |
config = {
"interfaces": {
"google.bigtable.admin.v2.BigtableTableAdmin": {
"retry_codes": {
"idempotent": ["DEADLINE_EXCEEDED", "UNAVAILABLE"],
"non_idempotent": [],
},
"retry_params": {
"default": {
"in... |
from api.views.post_views import PostDetails, PublicPosts, AuthoredPosts, VisiblePosts, DeletePost
from api.views.author_views import AuthorViewSet
from api.views.friends_views import FriendQuery, Friend2Friend, FriendRequest, UnfriendRequest, FollowRequest, UnfollowRequest |
from typing import Any, Optional, Tuple, List, Set, Iterable, Mapping, Callable, Dict, Text
from django.utils.translation import ugettext as _
from django.conf import settings
from django.db import transaction
from django.http import HttpRequest, HttpResponse
from zerver.lib.exceptions import JsonableError, ErrorCode
f... |
"""Conv2D schedule for ARM CPU"""
from __future__ import absolute_import as _abs
import tvm
from tvm import te
from tvm import autotvm
import tvm.contrib.nnpack
from ..util import traverse_inline, get_const_tuple
from .. import nn
from ..nn.util import get_const_int, get_pad_tuple
from ..nn.winograd_util import winogra... |
import logging
if __name__ == '__main__':
logging.basicConfig()
_log = logging.getLogger(__name__)
import unittest
import app
import common
import pyxb.utils.domutils
from pyxb.utils import six
pyxb.utils.domutils.BindingDOMSupport.DeclareNamespace(app.Namespace, 'app')
pyxb.utils.domutils.BindingDOMSupport.Declare... |
"""Config flow for Mailgun."""
from homeassistant.helpers import config_entry_flow
from .const import DOMAIN
config_entry_flow.register_webhook_flow(
DOMAIN,
"Mailgun Webhook",
{
"mailgun_url": "https://documentation.mailgun.com/en/latest/user_manual.html#webhooks",
"docs_url": "https://www.... |
from nose.tools import *
from pykt import KyotoTycoon, KTException
import time
def clear():
db = KyotoTycoon()
db = db.open()
db.clear()
db.close()
@raises(IOError)
def test_err_cas():
db = KyotoTycoon()
db.cas("A")
@with_setup(setup=clear)
def test_cas():
db = KyotoTycoon()
db = db.open... |
"""A cleanup tool for HTML.
Removes unwanted tags and content. See the `Cleaner` class for
details.
"""
import re
import copy
try:
from urlparse import urlsplit
except ImportError:
# Python 3
from urllib.parse import urlsplit
from lxml import etree
from lxml.html import defs
from lxml.html import fromstrin... |
"""Text Utilities."""
from difflib import SequenceMatcher
from kombu import version_info_t
def escape_regex(p, white=''):
# type: (str, str) -> str
"""Escape string for use within a regular expression."""
# what's up with re.escape? that code must be neglected or something
return ''.join(c if c.isalnum(... |
import json
from django.views.generic.base import View
from django.http import Http404
from braces import views
from libs.views.list import DentexchangeListView
from employee.models import EmployeeQuestionnaire
from employer.models import JobPosting
from .utils import PraxisFilterSerializer, AutomatchMatchManagementAda... |
__version__ = '0.2.dev2'
from .validation import ( # noqa
CommonPasswordValidator, MinimumLengthValidator, NumericPasswordValidator,
UserAttributeSimilarityValidator, get_default_password_validators,
get_password_validators, password_changed,
password_validators_help_text_html, password_validators_help... |
"""
fs.ftpfs
========
FTPFS is a filesystem for accessing an FTP server (uses ftplib in standard library)
"""
__all__ = ['FTPFS']
import sys
import fs
from fs.base import *
from fs.errors import *
from fs.path import pathsplit, abspath, dirname, recursepath, normpath, pathjoin, isbase
from ftplib import FTP, error_perm... |
import numpy as np
from copy import deepcopy
from ..surface import fast_cross_3d, _project_onto_surface
from ..io.constants import FIFF, FWD
from ..transforms import apply_trans
from ..utils import logger, verbose, _pl, warn
from ..parallel import parallel_func
from ..io.compensator import get_current_comp, make_compen... |
"""Fitting Data (Nonlinear + Symbolic)
======================================
This example creates fake data with noise
then fits the exponential with the fitdata
function."""
from pyspecdata import *
from sympy import symbols, latex, Symbol
from sympy import exp as s_exp
from matplotlib.pyplot import figure, subplot, ... |
import IECore
import Gaffer
import GafferTest
import GafferImage
class ImageSamplerTest( GafferTest.TestCase ) :
def test( self ) :
dataWindow = IECore.Box2i( IECore.V2i( 0 ), IECore.V2i( 74 ) )
image = IECore.ImagePrimitive( dataWindow, dataWindow )
red = IECore.FloatVectorData()
green = IECore.FloatVectorDat... |
import sys
import os
import os.path
import time
STARTUP_DIR=sys.path[0]
sys.path.append(os.path.join(STARTUP_DIR,"../../.."))
from glideinwms.factory.tools.lib import gWftArgsHelper,gWftLogParser
from glideinwms.factory import glideFactoryConfig
USAGE="Usage: find_logs.py <factory> YY/MM/DD [hh:mm:ss]"
def parse_args()... |
import sys
import numpy as np
import matplotlib.mlab as mlab
import matplotlib.pyplot as plt
import scipy.stats as stats
class TwoComponentGaussianEM():
def __init__(self, y, numIters, numRuns,verbose=False):
self.y = y
self.verbose = verbose
self.maxLike, self.bestEst = self.run_em_algorith... |
from kdl_template import *
train, valid, test = fetch_binarized_mnist()
X = train[0].astype(theano.config.floatX)
y = convert_to_one_hot(train[1], n_classes=10)
graph = OrderedDict()
X_sym, y_sym = add_datasets_to_graph([X, y], ["X", "y"], graph)
random_state = np.random.RandomState(1999)
minibatch_size = 100
n_code = ... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import logging
import os
import subprocess
from . import config
class InferJavacCapture():
def __init__(self, javac_args):
self.javac_args = javac_args
def... |
import amsoil.core.pluginmanager as pm
def setup():
# setup config keys
config = pm.getService("config")
config.install("dhcprm.max_reservation_duration", 10*60, "Maximum duration a DHCP resource can be held allocated (not provisioned).")
config.install("dhcprm.max_lease_duration", 24*60*60, "Maximum du... |
import json
from django.conf import settings
from django.contrib.messages.storage.base import BaseStorage, Message
from django.http import SimpleCookie
from django.utils.crypto import salted_hmac, constant_time_compare
from django.utils.safestring import SafeData, mark_safe
from django.utils import six
class MessageEnc... |
import numpy as np
from .. ndtypes import ( Int8, Int24, Int32, Int64, Float32, Float64, Bool, FloatT, IntT, BoolT,
NoneType, ScalarT, make_slice_type, make_tuple_type, ClosureT,
FnT, Type, make_closure_type, ArrayT)
from array_expr import Slice
from expr import Const, ... |
"""
============================
Faces dataset decompositions
============================
This example applies to :ref:`olivetti_faces_dataset` different unsupervised
matrix decomposition (dimension reduction) methods from the module
:py:mod:`sklearn.decomposition` (see the documentation chapter
:ref:`decompositions`)... |
import datetime
from burst.http import Request, RequestSet
try:
import lxml.html
import lxml.etree
has_lxml = True
except ImportError:
has_lxml = False
def import_from_burp(requests_file):
if not has_lxml:
raise Exception("To use the import, you need lxml")
tree = lxml.etree.parse(requests_file)
items... |
"""This module makes available standard errno system symbols.
The value of each symbol is the corresponding integer value,
e.g., on most systems, errno.ENOENT equals the integer 2.
The dictionary errno.errorcode maps numeric codes to symbol names,
e.g., errno.errorcode[2] could be the string 'ENOENT'.
Symbols that are ... |
import numpy
def goodExpoMeasure(inRGB, sigma):
'''
Compute the good exposition image quality measure on 1 input image.
'''
R = inRGB[0,:,:].astype(numpy.float64)
G = inRGB[1,:,:].astype(numpy.float64)
B = inRGB[2,:,:].astype(numpy.float64)
goodExpoR = numpy.exp(- ((R - 128)**2) / sigma)
... |
import re
from django import forms
import os
import datetime
import urllib2
import json
TIMEOUT = 5
INVALID_CHARS = "[@#$%^&*\[\]/{}|\"<>\\\]"
URL_INVALID_CHARS = "[@$^*\[\]\'{}|\"<>\\\]"
XSS_INVALID_CHARS = "[<>]"
def hasText(str):
'''Utility function to establish whether a string has any non-empty characters.'''
... |
"""Unittests for the binpkg.py module."""
import os
import sys
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.dirname(
os.path.abspath(__file__)))))
from chromite.lib import binpkg
from chromite.lib import cros_test_lib
from chromite.lib import gs_unittest
class FetchTarballsTest(cros_test_lib.MockTempD... |
"""
This is the __init__ file
"""
version = '0.1'
__all__ = ['hydrologycalibrator',
'sedimentcalibrator',
'calibrate',
'validate',
'autocalibrator',
'calibratormodel',
]
from .autocalibrator import AutoCalibrator
from .calibratormodel import Cal... |
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('kong_admin', '0003_auto_20150909_0756'),
]
operations = [
migrations.RenameField(
model_name='pluginconfigurationreference',
old_... |
import unittest
import thread_cert
LEADER = 1
ED = 2
class Cert_6_3_2_NetworkDataUpdate(thread_cert.TestCase):
TOPOLOGY = {
LEADER: {
'mode': 'rsdn',
'panid': 0xface,
'whitelist': [ED]
},
ED: {
'is_mtd': True,
'mode': 'rsn',
... |
from _compact import BytesIO
from pyexcel.renderer import (
Renderer,
DbRenderer,
BinaryRenderer,
AbstractRenderer,
)
from nose.tools import raises
@raises(NotImplementedError)
def test_render_sheet():
r = Renderer("xls")
r.render_sheet("something")
@raises(NotImplementedError)
def test_abstract... |
from datetime import datetime
from django.test import TestCase
from django.db import models
from django.conf import settings
from django.core.urlresolvers import reverse
from omblog.tests.mock import MockRequest
from omblog import listeners
from omblog import settings as o_settings
from omblog.models import Post
from o... |
import datetime
import os
import time
import unittest
import requests
from nose.plugins.attrib import attr
from nose.tools import assert_raises
from nose.tools import assert_equal as eq
from nose.tools import assert_true as ok
from datadog import initialize
from datadog import api as dog
from datadog.api.exceptions imp... |
from lettuce import *
from survey.features.page_objects.accounts import LogoutPage
from survey.features.page_objects.root import AboutPage
@step(u'Given I am not logged in')
def given_i_am_not_logged_in(step):
world.page = LogoutPage(world.browser)
world.page.visit()
@step(u'Then I should see the completion map... |
GITHUB_BRANCH = 'dev'
GITHUB_REPO = 'securestate/king-phisher'
import sys
import os
_prj_root = os.path.dirname(__file__)
_prj_root = os.path.relpath(os.path.join('..', '..'), _prj_root)
_prj_root = os.path.abspath(_prj_root)
sys.path.insert(1, _prj_root)
_pkg = os.path.join(_prj_root, 'king_phisher', 'third_party')
sy... |
from django.db import models
from django.contrib.auth.models import User
class ApiKey(models.Model):
key = models.CharField(max_length=100, unique=True)
user = models.ForeignKey(User)
active = models.BooleanField(default=True)
def __unicode__(self):
return self.key |
"""
Simplified Chinese language mappings for language-dependent features of
reStructuredText.
"""
__docformat__ = 'reStructuredText'
directives = {
# language-dependent: fixed
u'注意': 'attention',
u'小心': 'caution',
u'危险': 'danger',
u'错误': 'error',
u'提示': 'hint',
u'重要': 'importan... |
import knack.output
class AzOutputProducer(knack.output.OutputProducer):
def check_valid_format_type(self, format_type):
return format_type in self._FORMAT_DICT
def get_output_format(cli_ctx):
return cli_ctx.invocation.data.get("output", None)
def set_output_format(cli_ctx, desired_format):
if cli_c... |
import logging
import config
RX_BYTES = 'rx_bytes'
TX_BYTES = 'tx_bytes'
RX_PACKETS = 'rx_packets'
TX_PACKETS = 'tx_packets'
SDN_RX_BYTES = 'sdn_rx_bytes'
SDN_TX_BYTES = 'sdn_tx_bytes'
SDN_RX_PACKETS = 'sdn_rx_packets'
SDN_TX_PACKETS = 'sdn_tx_packets'
IS_VIRTUAL = 'is_virtual'
PORT_NAME = 'name'
PORT_STATS = {RX_BYTES... |
from test_base import BaseTestCase
import unittest
import flask_testing
class TestRaisApiTests(BaseTestCase):
def test_should_respond_ok_to_rais_path(self):
response = self.client.get('/rais/year/')
self.assert_200(response)
def test_should_check_if_all_years_are_loaded(self):
response =... |
from django.conf.urls import *
urlpatterns = patterns('comunicacion.notas.views',
url(r'^$', 'index'),
url(r'^index-filtrado/(?P<pais_id>\d+)/$', 'index_filtrado', name='filtrar-index'),
url(r'^notas/$', 'lista_notas', name="notas_list"),
url(r'^notas-contraparte/(?P<id>\d+)/$', 'lista_notas_contraparte... |
"""
This bot searches for selflinks and allows removing them.
These command line parameters can be used to specify which pages to work on:
¶ms;
-always Unlink always but don't prompt you for each replacement.
ATTENTION: Use this with care!
"""
from __future__ import absolute_import, unic... |
import unittest2
import datetime
from consts.district_type import DistrictType
from consts.event_type import EventType
from datafeeds.usfirst_event_list_parser import UsfirstEventListParser
class TestUsfirstEventListParser(unittest2.TestCase):
def test_parse_2012(self):
with open('test_data/usfirst_html/usf... |
from typing import List
Vector = List[float]
height_weight_age = [70, # inches,
170, # pounds,
40 ] # years
grades = [95, # exam1
80, # exam2
75, # exam3
62 ] # exam4
def add(v: Vector, w: Vector) -> Vector:
"""Adds corresponding elemen... |
from . import raster
import random
import pyagg
import PIL, PIL.Image, PIL.ImageTk
class MapCanvas:
def __init__(self, layers, width, height, background=None, *args, **kwargs):
# remember and be remembered by the layergroup
self.layers = layers
layers.connected_maps.append(self)
# cr... |
"""distutils
The main package for the Python Module Distribution Utilities. Normally
used from a setup script as
from distutils.core import setup
setup (...)
"""
__revision__ = "$Id: __init__.py,v 1.23 2002/11/19 13:12:26 akuchling Exp $"
__version__ = "1.0.3" |
import sys, os
if os.name == "nt":
def _get_build_version():
"""Return the version of MSVC that was used to build Python.
For Python 2.3 and up, the version number is included in
sys.version. For earlier versions, assume the compiler is MSVC 6.
"""
# This function was copied... |
"""
Send all Repair Failed hosts that the user running this script has access to
back into Verifying. (Only hosts ACL accessable to the user)
Suggested use: Run this as an occasional cron job to re-check if Repair Failed
hosts have overcome whatever issue caused the failure and are useful again.
"""
import optparse, o... |
import threading
import logging
import sys, os
import ctypes
import time
from ctypes import *
from struct import *
import datetime
class AleaData(ctypes.Structure):
"""Class to contain data returned from API event."""
_fields_ = [("rawDataTimestamp", ctypes.c_long),
("intelligazeX", ctypes.c_dou... |
from gi.repository import Gtk
from senf import fsn2text
from quodlibet import qltk
from quodlibet import util
from quodlibet import _
from quodlibet.formats import AudioFileError
from quodlibet.qltk._editutils import OverwriteWarning, WriteFailedError
from quodlibet.qltk.views import HintedTreeView, TreeViewColumn
from... |
import pytest
from cfme.physical.provider.lenovo import LenovoProvider
from cfme.utils.rest import assert_response
from cfme.utils.wait import wait_for
pytestmark = [
pytest.mark.tier(3),
pytest.mark.provider([LenovoProvider], scope='module')
]
TIMEOUT = 600
DELAY = 60
@pytest.fixture(scope="module")
def physic... |
import urllib2, urlparse, re, base64
from request import Request
from random import random, shuffle
from string import letters, digits
from core.pollution import pollute_with_random_str
from core.utils import randstr
default_prefixes = [ "ID", "SID", "APISID", "USRID", "SESSID", "SESS", "SSID", "USR", "PREF" ]
shuffle(... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.