content stringlengths 4 20k |
|---|
# -*- coding: utf-8 -*-
'''
Specto Add-on
Copyright (C) 2015 lambda
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any l... |
from flask.ext.wtf import Form
from wtforms import StringField, PasswordField, BooleanField, SubmitField
from wtforms.validators import Required, Length, Email, Regexp, EqualTo
from wtforms import ValidationError
from ..models import User
class LoginForm(Form):
email = StringField('Email', validators=[Required(),... |
__author__ = 'Jonathan Brodie'
import ctypes
from hzclient.clientmessage import ClientMessage
from util import util
'''
OFFER
'''
def offerEncode():
msg=ClientMessage()
msg.optype=0x1401
util.raiseNotDefined()
def offerDecode(bytesobject):
servermsg=ClientMessage.decodeMessage(bytesobject)
util.rais... |
#!/usr/bin/python
""" turtle-example-suite:
tdemo_peace.py
A very simple drawing suitable as a beginner's
programming example.
Uses only commands, which are also available in
old turtle.py.
Intentionally no variables are used except for the
colorloop:
"""
from turtle import *
def main():
p... |
import unittest
from swift.common.middleware import keystoneauth
from swift.common.swob import Request, Response
from swift.common.http import HTTP_FORBIDDEN
from test.unit import FakeLogger
class FakeApp(object):
def __init__(self, status_headers_body_iter=None):
self.calls = 0
self.status_heade... |
"""
Functions that generate and cache SDRs on the filesystem, and a standalone
SDR generator that can run from the command line.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import glob
import json
import multiprocessing
import os
import random
impor... |
import logging
from botocore import xform_name
from .params import create_request_parameters
from .response import RawHandler, ResourceHandler
from .model import Action
from boto3.docs.docstring import ActionDocstring
from boto3.utils import inject_attribute
logger = logging.getLogger(__name__)
class ServiceActi... |
'''
Integration Test for creating KVM VM in MN HA mode after destroying MN VM.
@author: Mirabel
'''
import zstackwoodpecker.test_util as test_util
import zstackwoodpecker.test_state as test_state
import zstackwoodpecker.test_lib as test_lib
import zstackwoodpecker.operations.node_operations as node_ops
im... |
"""
Module for factory class for BlockStructure objects.
"""
from .block_structure import BlockStructureModulestoreData, BlockStructureBlockData
class BlockStructureFactory(object):
"""
Factory class for BlockStructure objects.
"""
@classmethod
def create_from_modulestore(cls, root_block_usage_key... |
"""Suite Text:
Level 0, version 0
Generated from /Volumes/Sap/Applications (Mac OS 9)/Netscape Communicator\xe2\x84\xa2 Folder/Netscape Communicator\xe2\x84\xa2
AETE/AEUT resource version 1/0, language 0, script 0
"""
import aetools
import MacOS
_code = 'TEXT'
from StdSuites.Text_Suite import *
class Text_Events(Te... |
from sqlalchemy import Column
from sqlalchemy import Integer
from sqlalchemy import MetaData
from sqlalchemy import select
from sqlalchemy import String
from sqlalchemy import Table
from sqlalchemy.engine import default
from sqlalchemy.testing import AssertsExecutionResults
from sqlalchemy.testing import fixtures
from ... |
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}
from ansible.module_utils.basic import AnsibleModule
try:
from ansible.module_utils.network.avi.avi import (
avi_common_argument_spec, HAS_AVI, avi_ansible_api)
except ... |
"""Unit tests for git_rebase_update.py"""
import os
import sys
DEPOT_TOOLS_ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.path.insert(0, DEPOT_TOOLS_ROOT)
from testing_support import coverage_utils
from testing_support import git_test_utils
class GitRebaseUpdateTest(git_test_utils.GitRepoRea... |
"""
mbed SDK
Copyright (c) 2011-2013 ARM Limited
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 wr... |
from os import path
import numpy as np
from numpy.testing import *
from numpy.compat import asbytes, asunicode
import warnings
class TestFromrecords(TestCase):
def test_fromrecords(self):
r = np.rec.fromrecords([[456, 'dbe', 1.2], [2, 'de', 1.3]],
names='col1,col2,col3')
... |
"""
Document map modules can in general be easily parallelized using multiprocessing. This module provides
implementations of a pool and base worker processes that use multiprocessing, making it dead easy to
implement a parallelized module, simply by defining what should be done on each document.
In particular, use :f... |
"""
Starting in CherryPy 3.1, cherrypy.server is implemented as an
:ref:`Engine Plugin<plugins>`. It's an instance of
:class:`cherrypy._cpserver.Server`, which is a subclass of
:class:`cherrypy.process.servers.ServerAdapter`. The ``ServerAdapter`` class
is designed to control other servers, as well.
Multiple servers/p... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import parse_duration
class SWRMediathekIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?swrmediathek\.de/(?:content/)?player\.htm\?show=(?P<id>[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}... |
'''Originate a call on an Asterisk server
Developed as an example for "Asterisk: The Definitive Guide"
'''
import getpass
import logging
import optparse
import sys
import starpy.manager
from twisted.internet import reactor
LOG = logging.getLogger(__name__)
class OriginateCall(object):
def __init__(self, opti... |
# -*- coding: utf-8 -*-
import json
from pprint import pprint
from sets import Set
json_data=open("C:\\Users\\Heschoon\\Dropbox\\ULB\\Current trends of artificial intelligence\\Trends_project\\profiles.json")
profiles = json.load(json_data)
json_data.close()
fields=Set()
for id in profiles:
for field in profiles[... |
""" FileCatalogFactory class to create file catalog client objects according to the
configuration description
"""
from DIRAC import gLogger, gConfig, S_OK, S_ERROR
from DIRAC.ConfigurationSystem.Client.Helpers.Resources import getCatalogPath
from DIRAC.Resources.Catalog.FileCatalogProxyClient import FileCatalogPr... |
from distutils.core import setup
import textfsm
setup(name='textfsm',
maintainer='Google',
maintainer_email='<EMAIL>',
version=textfsm.__version__,
url='https://code.google.com/p/textfsm/',
license='Apache License, Version 2.0',
classifiers=[
'Development Status :: 5 - P... |
# coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
int_or_none,
float_or_none,
qualities,
ExtractorError,
)
class GfycatIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?gfycat\.com/(?:ru/|ifr/|gifs/detail/)?(?P<id>[^-/?#]+)'
_TE... |
'''
Script to generate list of seed nodes for chainparams.cpp.
This script expects two text files in the directory that is passed as an
argument:
nodes_main.txt
nodes_test.txt
These files must consist of lines in the format
<ip>:<port>
[<ipv6>]:<port>
<onion>.onion:<port>
The output will be two... |
import time
import threading
import struct
import pytest
from slc import Communicator as Comm
from slc import (COMP_ZLIB_DEFAULT, COMP_ZLIB_MAX, SER_PICKLE_HIGHEST)
data = [
b'Not all those who wander are lost.',
b'Time is a drug. Too much of it kills you.',
'The mirror does not reflect evil, but create... |
#!/usr/bin/env python3
"""Find Kconfig symbols that are referenced but not defined."""
# (c) 2014-2017 Valentin Rothberg <<EMAIL>>
# (c) 2014 Stefan Hengelein <<EMAIL>>
#
# Licensed under the terms of the GNU GPL License version 2
import argparse
import difflib
import os
import re
import signal
import subprocess
im... |
"""
==================================
Compute ICA components on raw data
==================================
ICA is fit to MEG raw data.
The sources matching the ECG and EOG are automatically found and displayed.
Subsequently, artifact detection and rejection quality are assessed.
"""
# Authors: Denis Engemann <<EMAIL... |
# -*- coding:utf-8 -*-
"""
/***************************************************************************
qgsplugininstallerrepositorydialog.py
Plugin Installer module
-------------------
Date : June 2013
Copyright ... |
#!/usr/bin/env python
import json
import requests
from datetime import datetime
from flask import Blueprint, jsonify, request, g
from flask_autodoc import Autodoc
order_api = Blueprint('orderApi', __name__)
auto = Autodoc()
@order_api.route('/order/spec', strict_slashes=False)
def order_doc():
"""
Documenta... |
#-------------------------------------------------------------------------------
# Name: wanga_update
# Purpose: wanga游戏update
#
#
# Copyright: (c) winxos 2011
# Licence: free
#-------------------------------------------------------------------------------
#!/usr/bin/env python
# -*- coding: utf-8 -*-... |
# -*- coding:utf-8 -*-
"""
Utilities for helping developers use python for adding various attributes,
elements, and UI elements to forms generated via the uni_form template tag.
"""
from django.core.urlresolvers import reverse, NoReverseMatch
from django.forms.forms import BoundField
from django.template.loade... |
from . import AWSProperty, AWSObject
from .validators import boolean, integer, integer_range, positive_integer
VALID_VOLUME_TYPES = ('standard', 'gp2', 'io1')
try:
from awacs.aws import Policy
policytypes = (dict, Policy)
except ImportError:
policytypes = dict,
def validate_volume_type(volume_type):
... |
"""Install boost headers into a list of toolchains, in such a way that it gets
pulled into the SDK installer. Note that this script only installs boost
headers, and does not build any of the boost libraries that require building.
"""
import build_utils
import os
import shutil
import sys
import tarfile
import tempfile... |
import platform
from setuptools import setup, find_packages
from pgcli import __version__
description = "CLI for Postgres Database. With auto-completion and syntax highlighting."
install_requirements = [
"pgspecial>=1.11.8",
"click >= 4.1",
"Pygments >= 2.0", # Pygments has to be Capitalcased. WTF?
... |
"""
FormWizard class -- implements a multi-page form, validating between each
step and storing the form's state as HTML hidden fields so that no state is
stored on the server side.
"""
import cPickle as pickle
from django import forms
from django.conf import settings
from django.contrib.formtools.utils import securit... |
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['deprecated'],
'supported_by': 'community'}
from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils._text import to_native
try:
import pan.xapi
from pan.xapi import PanXapiError
import... |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}
DOCUMENTATION = r'''
---
module: bigip_device_group_member
short_description: Manages member... |
#cython: boundscheck=False
#cython: wraparound=False
import numpy as np
from numpy import random
import math
from scipy import weave
import earandom as random
#def distance(np.array[double,ndim=1] ind1, np.array[double,ndim=1] ind2):
# """
# Euclidean distance
# ind1 -- first array to compare
# ind2 -- sec... |
import os
from threading import local
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.utils.importlib import import_module
DEFAULT_DB_ALIAS = 'default'
# Define some exceptions that mirror the PEP249 interface.
# We will rethrow any backend-specific errors using ... |
"""
Application-class that implements pyFoamInitVCSCase.py
"""
from optparse import OptionGroup
from .PyFoamApplication import PyFoamApplication
from PyFoam.RunDictionary.SolutionDirectory import SolutionDirectory
from PyFoam.Basics.GeneralVCSInterface import getVCS
from os import path
from glob import glob
ruleLi... |
"""
An example for computing correlation matrix.
Run with:
bin/spark-submit examples/src/main/python/ml/correlation_example.py
"""
from __future__ import print_function
# $example on$
from pyspark.ml.linalg import Vectors
from pyspark.ml.stat import Correlation
# $example off$
from pyspark.sql import SparkSession
i... |
import os
import tempfile
import unittest
import logging
from pyidf import ValidationLevel
import pyidf
from pyidf.idf import IDF
from pyidf.plant import CondenserEquipmentList
log = logging.getLogger(__name__)
class TestCondenserEquipmentList(unittest.TestCase):
def setUp(self):
self.fd, self.path = tem... |
# -*- coding: utf-8 -*-
#
# pysqlite documentation build configuration file, created by
# sphinx-quickstart.py on Sat Mar 22 02:47:54 2008.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# The contents of this file are pickled, so don't put values in the namespace
# that aren't pic... |
from .sql import (
alias,
and_,
asc,
between,
bindparam,
case,
cast,
collate,
column,
delete,
desc,
distinct,
except_,
except_all,
exists,
extract,
false,
func,
funcfilter,
insert,
intersect,
intersect_all,
join,
literal,
... |
from nose.tools import eq_
from js_helper import TestCase
class TestBinaryOperators(TestCase):
"""Test that all of the binary operators in JS work as expected."""
def do_expr(self, expr, output):
self.setUp()
self.run_script("var x = %s" % expr)
self.assert_var_eq("x", output)
d... |
""" Sahana Eden Automated Test - HRM001 Create Job Title
@copyright: 2011-2012 (c) Sahana Software Foundation
@license: MIT
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software wit... |
"""Collection of useful methods for manipulating pairing data"""
from mittab.apps.tab.models import Round, RoundStats
import random
# Speaks every quarter point
speak_range = [23 + .25 * i for i in range(17)]
def generate_speaks_for_debater(debater, is_forfeit=False):
"""
Generates a fake speak for a debater... |
from __future__ import unicode_literals
from .common import InfoExtractor
from ..compat import (
compat_urllib_parse,
)
class MuzuTVIE(InfoExtractor):
_VALID_URL = r'https?://www\.muzu\.tv/(.+?)/(.+?)/(?P<id>\d+)'
IE_NAME = 'muzu.tv'
_TEST = {
'url': 'http://www.muzu.tv/defected/marcashken-f... |
#!/usr/bin/python
try:
from PyQt4 import QtCore, QtGui
QtCore.Signal = QtCore.pyqtSignal
QtCore.Slot = QtCore.pyqtSlot
except ImportError:
try:
from PySide import QtCore, QtGui
QtCore.QString = str
except ImportError:
raise ImportError("Cannot load either PyQt or PySide")
f... |
from parakeet.testing_helpers import expect, run_local_tests
def varargs_return(*x):
return x
def test_varargs_return():
expect(varargs_return, [1,2], (1,2))
def varargs_add(*x):
return x[0] + x[1]
def test_varargs_add():
expect(varargs_add, [1,2], 3)
def call_varargs_add(x,y):
local_tuple = (x,y)
retu... |
#!/usr/bin/python
import time, MySQLdb, pygal, yaml, sys
with open(sys.argv[1], 'r') as ymlfile:
credentials = yaml.load(ymlfile)
UTime = str(time.strftime("%H:%M:%S", time.gmtime()))
print UTime
db = MySQLdb.connect(host=credentials['mysql']['host'],
user=credentials['mysql']['user'],
pas... |
from unittest import TestCase
from pybuilder.core import Project
from mock import Mock, patch
from logging import Logger
from pybuilder.plugins.ronn_manpage_plugin import (
build_generate_manpages_command,
init_ronn_manpage_plugin,
assert_ronn_is_executable,
assert_gzip_is_executable
)
class RonnM... |
from nose.plugins.attrib import attr
from helpers import with_config
from webhdfs_minicluster import WebHdfsMiniClusterTestCase
from contrib.hdfs_test import HdfsTargetTestMixin
from luigi.contrib.hdfs import WebHdfsClient
@attr('minicluster')
class WebHdfsTargetTest(WebHdfsMiniClusterTestCase, HdfsTargetTestMixin):... |
#
# An implementation of the environment technology. This technology
# is responsible for reporting sensor data on the weather, sun, and
# other environmental conditions.
#
#
import sys
import socket
import struct
import requests
import time
from threading import Thread
# Global members, which are requi... |
"""Support for Luftdaten stations."""
import logging
from luftdaten import Luftdaten
from luftdaten.exceptions import LuftdatenError
import voluptuous as vol
from homeassistant.config_entries import SOURCE_IMPORT
from homeassistant.const import (
CONCENTRATION_MICROGRAMS_PER_CUBIC_METER,
CONF_MONITORED_CONDIT... |
__revision__ = "test/implicit-cache/DualTargets.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
"""
Test that --implicit-cache works correctly in conjonction with a
builder that produces multiple targets.
"""
import TestSCons
test = TestSCons.TestSCons()
test.write('SConstruct', """\
import os.path
de... |
"""This namespace aggregates modules related to Tuna's plugin system.
Why have a plugin system?
-------------------------
In a sense, Tuna is both a toolkit and a framework. When used as a library, the
tools, models and structural pieces of Tuna can be used by external programs,
just like any other Python module. As ... |
from ctypes import c_void_p, POINTER, sizeof, Structure, windll, WinError, WINFUNCTYPE
from ctypes.wintypes import BOOL, BYTE, DWORD, HANDLE, LPCWSTR, LPWSTR, UINT, WORD
LPVOID = c_void_p
LPBYTE = POINTER(BYTE)
LPDWORD = POINTER(DWORD)
SW_HIDE = 0
def ErrCheckBool(result, func, args):
"""errcheck funct... |
"""
Handling of VM disk images.
"""
import os
from oslo_config import cfg
from oslo_log import log as logging
from nova import exception
from nova.i18n import _, _LE
from nova import image
from nova.openstack.common import fileutils
from nova.openstack.common import imageutils
from nova import utils
LOG = logging.g... |
from openerp.osv import orm, fields
from lxml import etree
class add_mis_report_instance_dashboard(orm.TransientModel):
_name = "add.mis.report.instance.dashboard.wizard"
_columns = {'name': fields.char('Name', size=32, required=True),
'dashboard_id': fields.many2one(
'ir.... |
"""Implementation of a USB HID mouse.
Two classes are provided by this module. The MouseFeature class implements
the core functionality of a HID mouse and can be included in any HID gadget.
The MouseGadget class implements an example mouse gadget.
"""
import struct
import hid_constants
import hid_descriptors
import ... |
from datetime import datetime
from recurrence import Recurrence, Rule
import recurrence
def test_truthiness_with_single_rrule():
rule = Rule(
recurrence.DAILY
)
object = Recurrence(
rrules=[rule]
)
assert bool(object)
def test_truthiness_with_single_exrule():
rule = Rule(
... |
#!/usr/bin/env python
"""Configuration parameters for the test subsystem."""
from grr.lib import config_lib
# Default for running in the current directory
config_lib.DEFINE_constant_string("Test.srcdir",
"%(grr|module_path)/../",
"The directory contai... |
"""
borrowed from jython
https://bitbucket.org/jython/jython/raw/28a66ba038620292520470a0bb4dc9bb8ac2e403/Lib/select.py
"""
#import java.nio.channels.SelectableChannel
#import java.nio.channels.SelectionKey
#import java.nio.channels.Selector
#from java.nio.channels.SelectionKey import OP_ACCEPT, OP_CONNECT, OP_WRITE, ... |
# -*- encoding: utf-8 -*-
import csv
import io
import unittest2
from openerp.tests.common import TransactionCase
from .. import models
ID_FIELD = {
'id': 'id',
'name': 'id',
'string': "External ID",
'required': False,
'fields': [],
}
def make_field(name='value', string='unknown', required=False... |
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import os
from collections import defaultdict, namedtuple
from pants.util.dirutil import safe_mkdir
# Lists of target addresses.
CacheStat = namedtuple('CacheStat',... |
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import (
compat_urllib_request,
compat_urlparse,
)
from ..utils import (
ExtractorError,
determine_ext,
int_or_none,
)
class VoiceRepublicIE(InfoExtractor):
_VALID_URL = r'https?://voicerepublic... |
from __future__ import print_function
from basicDNSSEC import BasicDNSSEC
import os
import subprocess
class basicNSEC3(BasicDNSSEC):
__test__ = True
_confdir = 'basicNSEC3'
@classmethod
def secureZone(cls, confdir, zonename, key=None):
zone = '.' if zonename == 'ROOT' else zonename
if ... |
#!/usr/bin/env python
# -*- mode: python; coding: utf-8 -*-
# (c) Valik mailto:<EMAIL>
'''
Created on 2011-07-04
@author: Valik
Python >= 2.5
cx_Oracle-5.1-10g.win32-py2.5.msi
Task
select fountains (xdata like '00:"Фонтан питьевой";99:56045100')
from big table;
insert them to featureclass table fountai... |
import os
import json
import logging
from os.path import join, exists
from queuelib import PriorityQueue
from scrapy.utils.reqser import request_to_dict, request_from_dict
from scrapy.utils.misc import load_object
from scrapy.utils.job import job_dir
logger = logging.getLogger(__name__)
class Scheduler(object):
... |
"""Log alarm notifier."""
from oslo_log import log
from ceilometer.alarm import notifier
from ceilometer.i18n import _
LOG = log.getLogger(__name__)
class LogAlarmNotifier(notifier.AlarmNotifier):
"Log alarm notifier."""
@staticmethod
def notify(action, alarm_id, alarm_name, severity, previous, curren... |
# settings/local.py
from django.utils.crypto import get_random_string
from .base import *
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = os.environ.get('SECRET_KEY', get_random_string(50, "abcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*(-_=+)"))
# SECURITY WARNING: don't run with debug... |
import sys
import pandas as pd
import numpy as np
from scipy import stats
def significant(array1,array2):
try:
arr1 = np.array(array1)
arr2 = np.array(array2)
print(stats.ttest_ind(arr1,arr2)[1])
return stats.ttest_ind(arr1,arr2)[1] < 0.1
except:
print('PROBLEM!')
... |
from django.conf.urls.defaults import patterns
from django.contrib.auth.urls import urlpatterns
from django.contrib.auth.views import password_reset
from django.contrib.auth.decorators import login_required
from django.http import HttpResponse
from django.template import Template, RequestContext
def remote_user_auth_v... |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}
DOCUMENTATION = r'''
---
module: vmware_cluster
short_description: Manage VMware vSphere clu... |
ANSIBLE_METADATA = {'metadata_version': '1.0',
'status': ['preview'],
'supported_by': 'core'}
from functools import partial
from ncclient.xml_ import new_ele, sub_ele, to_xml
from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.junos import load_conf... |
{
'name': 'Time Off',
'version': '1.5',
'category': 'Human Resources/Time Off',
'summary': 'Allocate time off and follow time off requests',
'website': 'https://www.odoo.com/page/leaves',
'description': """
Manage time off requests and allocations
=====================================
This appl... |
"""
Implements plugin related api.
To define a new plugin just subclass Plugin, like this.
class AuthPlugin(Plugin):
pass
Then start creating subclasses of your new plugin.
class MyFancyAuth(AuthPlugin):
capability = ['sign', 'vmac']
The actual interface is duck typed.
"""
import glob
import imp
import os... |
import unittest
from autothreadharness.harness_case import HarnessCase
class REED_5_2_4(HarnessCase):
role = HarnessCase.ROLE_REED
case = '5 2 4'
golden_devices_required = 17
def on_dialog(self, dialog, title):
pass
if __name__ == '__main__':
unittest.main() |
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['stableinterface'],
'supported_by': 'core'}
DOCUMENTATION = r'''
---
module: win_get_url
version_added: "1.7"
short_description: Downloads file from HTTP, HTTPS, or FTP to node
description:
- Downloads files from HTTP, HT... |
from .testmodels import FieldsWithOptionsModel, OrderedModel, SelfReferenceModel
import datetime
from django.test import TestCase
from django.core.exceptions import ObjectDoesNotExist, MultipleObjectsReturned
class NonReturnSetsTest(TestCase):
floats = [5.3, 2.6, 9.1, 1.58, 2.4]
emails = ['<EMAIL>', '<EMAIL>'... |
import re
PHYSICAL_SIDES = ["top", "left", "bottom", "right"]
LOGICAL_SIDES = ["block-start", "block-end", "inline-start", "inline-end"]
PHYSICAL_SIZES = ["width", "height"]
LOGICAL_SIZES = ["block-size", "inline-size"]
# bool is True when logical
ALL_SIDES = [(side, False) for side in PHYSICAL_SIDES] + [(side, True)... |
from __future__ import absolute_import, division, unicode_literals
from . import base
class Filter(base.Filter):
def slider(self):
previous1 = previous2 = None
for token in self.source:
if previous1 is not None:
yield previous2, previous1, token
previous2 =... |
import aiohttp
import asyncio
import logging
from yarl import URL
from . import exceptions
from .protocol import (
JsonRpcMsgTyp,
encode_request,
encode_error,
decode_error,
encode_result,
decode_msg,
)
default_logger = logging.getLogger('aiohttp-json-rpc.client')
class JsonRpcClient:
... |
from django.contrib import admin
from django.contrib.contenttypes import models as ct_models
from django.contrib.contenttypes.admin import GenericTabularInline
from django.forms import ModelForm
from waldur_core.core.admin import ReversionAdmin
from waldur_core.quotas import models, utils
class QuotaScopeClassListFi... |
# -*- coding: utf-8 -*-
import openerp
from openerp import SUPERUSER_ID
from openerp.addons.web import http
from openerp.addons.website.models.website import unslug
from openerp.tools.translate import _
from openerp.addons.web.http import request
import werkzeug.urls
class WebsiteCustomer(http.Controller):
_refere... |
ANSIBLE_METADATA = {'status': ['preview'],
'supported_by': 'community',
'version': '1.0'}
import os
import urlparse
import hashlib
try:
import boto
HAS_BOTO = True
except ImportError:
HAS_BOTO = False
def grant_check(module, gs, obj):
try:
acp = obj.get... |
import struct
import dns.exception
import dns.name
import dns.rdata
from dns._compat import xrange, text_type
def _write_string(file, s):
l = len(s)
assert l < 256
file.write(struct.pack('!B', l))
file.write(s)
def _sanitize(value):
if isinstance(value, text_type):
return value.encode()... |
#!/usr/bin/env python
# Dan Blankenberg
from __future__ import print_function
import optparse
import os
import subprocess
import sys
from json import dumps, loads
DEFAULT_DATA_TABLE_NAME = "picard_indexes"
def get_id_name(params, dbkey, fasta_description=None):
# TODO: ensure sequence_id is unique and does not ... |
import xml.etree.ElementTree as ET
FreeCAD_On = False
FreeCAD_Doc = None
FreeCAD_ObjList = []
def ParseUserData(element):
res = {}
for i in element.findall('{http://www.plmxml.org/Schemas/PLMXMLSchema}UserData'):
for value in i.findall('{http://www.plmxml.org/Schemas/PLMXMLSchema}UserValue'):
... |
import unittest as ut
import numpy as np
import pickle
import espressomd
import espressomd.observables
import espressomd.accumulators
N_PART = 4
class TimeSeriesTest(ut.TestCase):
"""
Test class for the TimeSeries accumulator.
"""
system = espressomd.System(box_l=[10.0] * 3)
system.cell_syste... |
#!/usr/bin/python
import cairo, gobject, gtk, gtk.gdk, gtk.glade, os, pygtk, re, sys, thread
BRUSHES_ZOOM = 0.5
DOWN_KEY = 65364
INITIAL_ZOOM = 0.5
LEFT_KEY = 65361
LEVEL_WIDTH = 100
LEVEL_HEIGHT = 100
MAX_ZOOM = 4
MIN_ZOOM = 0.25
RIGHT_KEY = 65363
SCROLL_STEP = 64
SETTINGS_DIR = os.getenv("HOME") + '/.abb_editor'
L... |
'''
JSON store
==========
A :mod:`Storage <kivy.storage>` module used to save/load key-value pairs from
a json file.
'''
__all__ = ('JsonStore', )
from os.path import exists
from kivy.compat import iteritems
from kivy.storage import AbstractStore
from json import loads, dump
class JsonStore(AbstractStore):
''... |
"""Scala module"""
from contextlib import suppress
from gettext import gettext as _
import logging
import os
import re
import umake.frameworks.baseinstaller
from umake.interactions import DisplayMessage
from umake.tools import add_env_to_user
from umake.ui import UI
logger = logging.getLogger(__name__)
class ScalaC... |
"""
Django settings for mysite 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/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
imp... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django_pgjson.fields
class Migration(migrations.Migration):
dependencies = [
('webhooks', '0004_auto_20150202_0834'),
]
operations = [
migrations.AlterField(
model... |
"""
Verifies things related to bundle resources.
"""
import TestGyp
import os
import stat
import sys
def check_attribs(path, expected_exec_bit):
out_path = test.built_file_path(
os.path.join('resource.app/Contents/Resources', path), chdir=CHDIR)
in_stat = os.stat(os.path.join(CHDIR, path))
out_stat = o... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
extool Copyright (C) 2017 Rustam Gilyazov
This program comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to redistribute it
under certain conditions.
extool
======
Command line tool to rename Image and Video f... |
# -*- encoding:utf-8 -*-
from __future__ import unicode_literals
MESSAGES = {
"%d min remaining to read": "%d minuta preostalo za čitanje",
"(active)": "(aktivno)",
"Also available in:": "Takođe dostupan u:",
"Archive": "Arhiva",
"Authors": "Autori",
"Categories": "Kategorije",
"Comments": ... |
import time
from openerp.osv import fields, osv
import openerp.addons.decimal_precision as dp
from openerp.tools.translate import _
class account_bank_statement(osv.osv):
_inherit = 'account.bank.statement'
def write(self, cr, uid, ids, vals, context=None):
if context is None:
context = {}... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.