content string |
|---|
from array import array
import reprlib
import math
import numbers
import functools
import operator
import itertools
class Vector:
typecode = 'd'
def __init__(self, components):
self._components = array(self.typecode, components)
def __iter__(self):
return iter(self._components)
... |
from core.models import ConfigEntry
#defaults = [("TEST_SETTING", "BOB")]
defaults = [
("MAP_PVP_THRESHOLD", "0"),
("MAP_NPC_THRESHOLD", "10"),
("MAP_SCAN_WARNING", "3"),
("MAP_INTEREST_TIME", "15"),
("MAP_ESCALATION_BURN", "3"),
("MAP_ADVANCED_LOGGING", "1"),
("MAP_ZEN_MODE", "0"),
("MA... |
# -*- coding: utf-8 -*-
"""
pygments.formatters.latex
~~~~~~~~~~~~~~~~~~~~~~~~~
Formatter for LaTeX fancyvrb output.
:copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from __future__ import division
from pygments.formatter import Forma... |
"""
Handles the IO note type and card template
"""
from .config import *
# DEFAULT CARD TEMPLATES
iocard_front = """\
{{#%(src_img)s}}
<div id="io-header">{{%(header)s}}</div>
<div id="io-wrapper">
<div id="io-overlay">{{%(que)s}}</div>
<div id="io-original">{{%(src_img)s}}</div>
</div>
<div id="io-footer">{{%(f... |
import logging
from django.core.urlresolvers import reverse
from django.utils.translation import ugettext_lazy as _
from horizon import exceptions
from horizon import forms
from horizon import messages
from openstack_dashboard import api
LOG = logging.getLogger(__name__)
class UpdatePort(forms.SelfHandlingForm):... |
#!./env/bin/python
""" FTP Scanner/Brute Forcer
Use this to either scan a host for anonymous FTP logins or
to try a password list against a host.
Don't be a moron, please don't use this for something illegal.
Usage:
ftp.py brute [-v] <host> <user> <password_file>
ftp.py anon [-v] <ho... |
"""
Function descriptors.
"""
from __future__ import print_function, division, absolute_import
from collections import defaultdict
import itertools
import sys
from types import ModuleType
from . import six, types
def transform_arg_name(arg):
if isinstance(arg, types.Record):
return "Record_%s" % arg._co... |
from netforce.model import Model, fields
class Budget(Model):
_name = "account.budget"
_string = "Budget"
_key = ["name"]
_fields = {
"name": fields.Char("Name", required=True, search=True),
"date_from": fields.Date("From Date"),
"date_to": fields.Date("To Date", required=True,... |
data = (
'Hu ', # 0x00
'Qi ', # 0x01
'He ', # 0x02
'Cui ', # 0x03
'Tao ', # 0x04
'Chun ', # 0x05
'Bei ', # 0x06
'Chang ', # 0x07
'Huan ', # 0x08
'Fei ', # 0x09
'Lai ', # 0x0a
'Qi ', # 0x0b
'Meng ', # 0x0c
'Ping ', # 0x0d
'Wei ', # 0x0e
'Dan ', # 0x0f
'Sha ', # 0x10
'Hu... |
"""
Support for SleepIQ from SleepNumber.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sleepiq/
"""
import logging
from datetime import timedelta
import voluptuous as vol
import homeassistant.helpers.config_validation as cv
from homeassistant.helper... |
from __future__ import absolute_import
from django.contrib import admin
from django.core.paginator import Paginator
from .models import (Event, Child, Parent, Genre, Band, Musician, Group,
Quartet, Membership, ChordsMusician, ChordsBand, Invitation, Swallow)
site = admin.AdminSite(name="admin")
class CustomPag... |
# -*- coding: utf-8 -*-
"""Test for a helper function for PanelHAC robust covariance
the functions should be rewritten to make it more efficient
Created on Thu May 17 21:09:41 2012
Author: Josef Perktold
"""
import numpy as np
from numpy.testing import assert_equal, assert_raises
import statsmodels.stats.sandwich_co... |
"""
WSGI config for mcwww project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICATION`` se... |
#!/usr/bin/env python
'''
Ansible module for zabbix graphprototypes
'''
# vim: expandtab:tabstop=4:shiftwidth=4
#
# Zabbix graphprototypes ansible module
#
#
# Copyright 2015 Red Hat Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with t... |
import errno
import os
import signal
import time
from contextlib import closing
import psutil
from twitter.common import log
from twitter.common.dirutil import lock_file, safe_mkdir
from twitter.common.quantity import Amount, Time
from twitter.common.recordio import ThriftRecordWriter
from apache.thermos.common.ckpt ... |
r'''>>> import pickle1_ext
>>> import pickle
>>> pickle1_ext.world.__module__
'pickle1_ext'
>>> pickle1_ext.world.__safe_for_unpickling__
1
>>> pickle1_ext.world.__name__
'world'
>>> pickle1_ext.world('Hello').__reduce__()
(<class 'pickle1_ext.world'>, ('Hello',))
>>> wd = pickle... |
"""Test the grr aff4 objects."""
import time
from grr.lib import aff4
from grr.lib import flow
from grr.lib import rdfvalue
from grr.lib import test_lib
from grr.lib import utils
from grr.lib.rdfvalues import client as rdf_client
from grr.lib.rdfvalues import flows as rdf_flows
from grr.lib.rdfvalues import paths as ... |
from datetime import datetime
from openerp.tools import DEFAULT_SERVER_DATE_FORMAT as OE_DATEFORMAT
from report import report_sxw
class Parser(report_sxw.rml_parse):
def __init__(self, cr, uid, name, context):
super(Parser, self).__init__(cr, uid, name, context)
self.localcontext.update({
... |
"""
We have a few different kind of Matrices
Matrix, ImmutableMatrix, MatrixExpr
Here we test the extent to which they cooperate
"""
from sympy import symbols
from sympy.matrices import (Matrix, MatrixSymbol, eye, Identity,
ImmutableMatrix)
from sympy.core.compatibility import range
from sympy.matrices.expres... |
"""Tests for the DataFormatVecPermute operator."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
from tensorflow.compiler.tests import xla_test
from tensorflow.python.framework import dtypes
from tensorflow.python.ops import array_ops
... |
#!/usr/bin/env python
from Hidden_Sec_Utilities import *
from Hidden_Sec_Physics import *
import itertools
"""
I use kappa and epsilon interchangeably. They mean the same thing.
Many of these limits are not valid in the off-shell regime, or
change dramatically. Use at your own risk!
"""
#Default value of alpha_p to... |
import argparse
import glob
import os
import sys
if sys.version_info < (2, 7, 0):
sys.stderr.write("python 2.7 or later is required run this script\n")
sys.exit(1)
import buildbot_common
import build_paths
from build_paths import NACL_DIR, SDK_SRC_DIR, EXTRACT_ARCHIVE_DIR
sys.path.append(os.path.join(SDK_SRC_DIR... |
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import logging
from abc import abstractproperty
from collections import OrderedDict
from twitter.common.collections import OrderedSet
from pants.engine.addressable i... |
from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'j. F Y'
TIME_FORMAT = 'H:i'
DATETIME_FORMAT = 'j. F Y H:i'
YEAR_MONTH_FORMAT = 'F Y'
MONTH_DAY_FORMAT = 'j. F'
SHORT_DATE_FORMAT = 'd.... |
import clr
clr.AddReferenceToFile("csextend.dll")
import Simple
dir(Simple)
s = Simple(10)
print s
# Task 2
import clr
clr.AddReferenceToFile("csextend.dll")
import Simple
dir(Simple)
s = Simple(10)
for i in s: print i
# Task 3
import clr
clr.AddReferenceToFile("csextend.dll")
import Simple
dir(Simple)
a = Simple(1... |
# Python test set -- part 7, bound and unbound methods
from test_support import *
print 'Bound and unbound methods (test_methods.py)'
class A:
def one(self): return 'one'
class B(A):
def two(self): return 'two'
class C(A):
def one(self): return 'another one'
a = A()
b = B()
c = C()
print 'unbound met... |
"""Unit tests for :func:`iris.fileformats.pp_rules._dim_or_aux`."""
from __future__ import (absolute_import, division, print_function)
from six.moves import (filter, input, map, range, zip) # noqa
# Import iris.tests first so that some things can be initialised before
# importing anything else.
import iris.tests as ... |
import datetime
from unittest import mock
from django.core.urlresolvers import reverse
from django.test import TestCase, RequestFactory
from base.tests.factories.academic_year import AcademicYearFactory
from base.tests.factories.offer_year import OfferYearFactory
from assessments.views import score_sheet
from assessm... |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}
from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.urls import ... |
"""
Represents a Dynamips hypervisor and starts/stops the associated Dynamips process.
"""
import os
import subprocess
import tempfile
import asyncio
from .dynamips_hypervisor import DynamipsHypervisor
from .dynamips_error import DynamipsError
import logging
log = logging.getLogger(__name__)
class Hypervisor(Dynam... |
# -*- coding: utf-8 -*-
"""
***************************************************************************
Project Provider tests
---------------------
Date : July 2018
Copyright : (C) 2018 by Nyall Dawson
Email : nyall dot dawson at gmail dot com
************... |
"""
Tests for L{twisted.python.runtime}.
"""
from __future__ import division, absolute_import
import sys
from twisted.trial.util import suppress as SUPRESS
from twisted.trial.unittest import SynchronousTestCase
from twisted.python.runtime import Platform, shortPythonVersion
class PythonVersionTests(SynchronousTes... |
# YouTube Video: https://www.youtube.com/watch?v=op42w-5o3nE
class Node:
def __init__(self, data):
self.data = data
self.next = None
class CircularLinkedList:
def __init__(self):
self.head = None
def prepend(self, data):
new_node = Node(data)
cur = self.head
... |
import functools
import collections
def instantiate(cls): return cls()
class Namespace(object):
def registry(name, bases, dict_):
cls = type(name, bases, dict_)
cls.__dict = {}
return cls
__metaclass__ = registry
def __init__(self, instance=None):
self.__dict__ = self.__dict... |
import logging
from django import http
from django.conf import settings
from common import api
from common import clean
from common.models import ExternalProfile
from common import memcache
from common import twitter
from common import user
from common import util
def get_nick_from_email(email):
nick = util.displa... |
#!/usr/bin/env python
#
# EasyInstall setup script for digest
#
# $Id$
# ---------------------------------------------------------------------------
import sys
import os
sys.path += [os.getcwd()]
from setuptools import setup, find_packages
import re
import imp
PKG = 'digest'
DESCRIPTION = 'Calculate message digests ... |
from django.contrib.auth.models import (
AbstractBaseUser, AbstractUser, BaseUserManager, Group, Permission,
PermissionsMixin, UserManager,
)
from django.db import models
# The custom user uses email as the unique identifier, and requires
# that every user provide a date of birth. This lets us test
# changes ... |
import os
import getopt
import tempfile
from viper.common.out import *
from viper.common.objects import File
from viper.common.colors import bold, cyan, white
from viper.common.network import download
from viper.core.session import __session__
from viper.core.plugins import __modules__
from viper.core.database import ... |
#!/usr/bin/env python
"""
* FCKeditor - The text editor for Internet - http://www.fckeditor.net
* Copyright (C) 2003-2008 Frederico Caldeira Knabben
*
* == BEGIN LICENSE ==
*
* Licensed under the terms of any of the following licenses at your
* choice:
*
* - GNU General Public License Version 2 or l... |
"""
Template file used by ExpGenerator to generate the actual
permutations.py file by replacing $XXXXXXXX tokens with desired values.
This permutations.py file was generated by:
'/Users/ronmarianetti/nupic/eng/lib/python2.6/site-packages/nupic/frameworks/opf/expGenerator/experiment_generator.py'
"""
import os
from n... |
from __future__ import absolute_import
import weakref
from defcon.objects.base import BaseDictObject
from defcon.objects.color import Color
_defaultTransformation = {
"xScale" : 1,
"xyScale" : 0,
"yxScale" : 0,
"yScale" : 1,
"xOffset" : 0,
"yOffset" : 0
}
class Image(BaseDictObject):
"... |
class ModuleDocFragment(object):
# Standard files documentation fragment
DOCUMENTATION = """
options:
authorize:
description:
- Instructs the module to enter privileged mode on the remote device
before sending any commands. If not specified, the device will
attempt to execute all c... |
"""
===================================================================
Multi-output Decision Tree Regression
===================================================================
An example to illustrate multi-output regression with decision tree.
The :ref:`decision trees <tree>`
is used to predict simultaneously the ... |
"""This module tests SyntaxErrors.
Here's an example of the sort of thing that is tested.
>>> def f(x):
... global x
Traceback (most recent call last):
SyntaxError: name 'x' is parameter and global
The tests are all raise SyntaxErrors. They were created by checking
each C call that raises SyntaxError. There ar... |
"""Unit testing base class for Port implementations."""
import unittest2 as unittest
from webkitpy.port.server_process_mock import MockServerProcess
from webkitpy.port.image_diff import ImageDiffer
class FakePort(object):
def __init__(self, server_process_output):
self._server_process_constructor = lamb... |
from social.exceptions import NotAllowedToDisconnect
def allowed_to_disconnect(strategy, user, name, user_storage,
association_id=None, *args, **kwargs):
if not user_storage.allowed_to_disconnect(user, name, association_id):
raise NotAllowedToDisconnect()
def get_entries(strate... |
__author__ = 'Simone Campagna'
import re
import textwrap
class Text(object):
__re_split__ = re.compile(r'\n\n')
def __init__(self, width=70):
self.width = width
def split_paragraphs(self, text):
for paragraph in self.__re_split__.split(text):
yield paragraph
def wrap(self... |
"""
This is the default template for our main set of AWS servers.
Before importing this settings file the following MUST be
defined in the environment:
* SERVICE_VARIANT - can be either "lms" or "cms"
* CONFIG_ROOT - the directory where the application
yaml config files are located
"""
#... |
import os
from unittest import mock
from conftest import (
create_plugin_config,
create_project_config,
dir_contents
)
from datakit.utils import read_json
from datakit_data import Init
def test_project_buildout(caplog, fake_project, monkeypatch, tmpdir):
"""
Init should auto-generate directories... |
from __future__ import print_function
import argparse
import json
import logging
import numbers
import os
import time
from six.moves import xrange
from grpc.beta import implementations
from kubernetes import client as k8s_client
import requests
import tensorflow as tf
from tensorflow_serving.apis import predict_pb2
... |
# -*- coding: utf-8 -*-
from Screen import Screen
from Components.BlinkingPixmap import BlinkingPixmapConditional
from Components.Pixmap import Pixmap
from Components.config import config, ConfigInteger
from Components.Sources.Boolean import Boolean
from Components.Label import Label
from Components.ProgressBar import ... |
DEFAULT_COMMENT = 'configured by junos_template'
def main():
argument_spec = dict(
src=dict(required=True, type='path'),
confirm=dict(default=0, type='int'),
comment=dict(default=DEFAULT_COMMENT),
action=dict(default='merge', choices=['merge', 'overwrite', 'replace']),
conf... |
import threading
from flask import Flask
import tornado.web
import tornado.wsgi
from tornado.websocket import WebSocketHandler
from tornado.ioloop import IOLoop
from multiprocessing.pool import ThreadPool
from utilities import *
import queue
from web.picoweb import picoweb as pw
import chess.pgn as pgn
import json
imp... |
from pyflink.java_gateway import get_gateway
from pyflink.table import EnvironmentSettings
from pyflink.testing.test_case_utils import PyFlinkTestCase, get_private_field
class EnvironmentSettingsTests(PyFlinkTestCase):
def test_planner_selection(self):
gateway = get_gateway()
CLASS_NAME = gate... |
import sale_make_invoice
import sale_line_invoice
import sale_make_invoice_advance
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
import unittest
import pytest
from selenium.webdriver.common.by import By
class RenderedWebElementTests(unittest.TestCase):
@pytest.mark.ignore_chrome
def testShouldPickUpStyleOfAnElement(self):
self._loadPage("javascriptPage")
element = self.driver.find_element(by=By.ID, value="green-paren... |
#!/usr/bin/env python
"""
This script is similiar to modemake.pl.
The script will generate DIMER_VECTOR in CP2K.
"""
from XYZFile import *
import sys, copy
def GetDiffXYZ(XYZ1, XYZ2):
"""
Get the difference of two XYZ file.
A DIMER VECTOR or MODECAR is made from this difference.
"""
DiffXYZ = XYZ()... |
import copy
from openstack.cloud import exc
from openstack.tests.unit import base
class TestQosPolicy(base.TestCase):
policy_name = 'qos test policy'
policy_id = '881d1bb7-a663-44c0-8f9f-ee2765b74486'
project_id = 'c88fc89f-5121-4a4c-87fd-496b5af864e9'
mock_policy = {
'id': policy_id,
... |
# -*- coding: utf-8 -*-
"""
requests.session
~~~~~~~~~~~~~~~~
This module provides a Session object to manage and persist settings across
requests (cookies, auth, proxies).
"""
import os
from datetime import datetime
from .compat import cookielib
from .cookies import cookiejar_from_dict
from .models import Request,... |
import sys
from idl_log import ErrOut, InfoOut, WarnOut
from idl_option import GetOption, Option, ParseOptions
from idl_parser import ParseFiles
GeneratorList = []
Option('out', 'List of output files', default='')
Option('release', 'Which release to generate.', default='')
Option('range', 'Which ranges in the form o... |
# -*- coding: utf-8 -*-
"""
pygments.lexers.special
~~~~~~~~~~~~~~~~~~~~~~~
Special lexers.
:copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
import cStringIO
from pygments.lexer import Lexer
from pygments.token import Token,... |
#!/usr/bin/env python
# (C) 2010 Norbert Nemec
#
# USAGE: src-normal.py < input.f90 > output.f90
#
# Script to normalize Fortran source code:
# a) expand tabs to spaces (tab width 8 characters
# b) remove trailing space
# c) normalize multiword keywords
# d) normalize capitalization of keywords and intrinsics
... |
from telemetry.page import page as page_module
from telemetry.page import page_set as page_set_module
from page_sets import key_mobile_sites_pages
from page_sets import repaint_helpers
def _CreatePageClassWithRepaintInteractions(page_cls, mode, height, width):
class DerivedRepaintPage(page_cls): # pylint: disabl... |
"""
===========================================================
A demo of K-Means clustering on the handwritten digits data
===========================================================
In this example with compare the various initialization strategies for
K-means in terms of runtime and quality of the results.
As the ... |
import datetime
import pickle
import pprint
import argparse
import time
from alert.corpus_importer.lawbox.import_law_box import (
get_judge, get_court_object, get_html_from_raw_text,
)
from alert.search.models import Court
DEBUG = 4
##########################################
# This variable is used to do statis... |
"""Creation of Windows shortcuts.
Requires win32all.
"""
from win32com.shell import shell
import pythoncom
import os
def open(filename):
"""Open an existing shortcut for reading.
@return: The shortcut object
@rtype: Shortcut
"""
sc=Shortcut()
sc.load(filename)
return sc
class Shortcu... |
# This file is part of Rubber and thus covered by the GPL
# (c) Emmanuel Beffara, 2008
# vim: noet:ts=4
"""
General-purpose classes for reading TeX code.
Classes and functions from this module can be used without Rubber.
"""
import re
from io import StringIO
# The catcodes
EOF = -2
CSEQ = -1
ESCAPE = 0
OPEN = 1
CLOS... |
""" Shared Utilities """
from functools import wraps
from uuid import UUID
import warnings
import six
from jwkest import JWKESTException
from ..exceptions import InvalidIssuerFormat, InvalidIssuerVersion, \
JWTValidationFailure, InvalidJWTResponse, WebhookAuthorizationError, \
XiovJWTValidationFailure, XiovJ... |
"File-based cache backend"
import errno
import glob
import hashlib
import io
import os
import random
import tempfile
import time
import zlib
from django.core.cache.backends.base import DEFAULT_TIMEOUT, BaseCache
from django.core.files.move import file_move_safe
from django.utils.encoding import force_bytes
try:
f... |
"""
Provider related utilities
"""
from libcloud.types import Provider
DRIVERS = {
Provider.DUMMY:
('libcloud.drivers.dummy', 'DummyNodeDriver'),
Provider.EC2_US_EAST:
('libcloud.drivers.ec2', 'EC2NodeDriver'),
Provider.EC2_EU_WEST:
('libcloud.drivers.ec2', 'EC2EUNodeDriver'),
... |
EXAMPLES = r"""
- name: insert/update "Match User" configuation block in /etc/ssh/sshd_config
blockinfile:
dest: /etc/ssh/sshd_config
block: |
Match User ansible-agent
PasswordAuthentication no
- name: insert/update eth0 configuration stanza in /etc/network/interfaces
(it might be better ... |
import json
class Led:
def __init__(self):
self.x_start = 0
self.x_end = 0
self.y_start = 0
self.y_end = 0
self.position = 0
self.color = bytearray([0,0,0])
def setCoordinates(self, in_x_start, in_x_end, in_y_start,in_y_end):
self.x_start = in_x_start
self.x_end = in_x_end
self.y_st... |
from gslib.help_provider import HELP_NAME
from gslib.help_provider import HELP_NAME_ALIASES
from gslib.help_provider import HELP_ONE_LINE_SUMMARY
from gslib.help_provider import HelpProvider
from gslib.help_provider import HELP_TEXT
from gslib.help_provider import HelpType
from gslib.help_provider import HELP_TYPE
_de... |
"""This code example gets all orders. To create orders, run create_orders.py."""
__author__ = '<EMAIL> (Jeff Sham)'
# Locate the client library. If module was installed via "setup.py" script, then
# the following two lines are not needed.
import os
import sys
sys.path.insert(0, os.path.join('..', '..', '..', '..'))
... |
"""
Audible Alert plugin plays a sound after each breaks to notify the user that the break has end.
"""
import logging
from safeeyes import utility
context = None
pre_break_alert = False
post_break_alert = False
def play_sound(resource_name):
"""Play the audio resource.
Arguments:
resource_name {st... |
"""Utilties for HTML generation
"""
import subprocess
from gwsumm import version
__author__ = 'Duncan Macleod <<EMAIL>>'
__version__ = version.version
def highlight_syntax(filepath, format_):
"""Return an HTML-formatted copy of the file with syntax highlighting
"""
highlight = ['highlight', '--out-form... |
ANSIBLE_METADATA = {'status': ['preview'],
'supported_by': 'community',
'version': '1.0'}
from ansible.module_utils.basic import get_exception
from ansible.module_utils.netcli import CommandRunner, FailedConditionsError
from ansible.module_utils.network import NetworkModule, Net... |
from django.contrib.auth import get_user_model
from django.test import TestCase
from django.urls import reverse
User = get_user_model()
class TestViews(TestCase):
"""
tests for django_netjsonconfig.views
"""
def setUp(self):
User.objects.create_superuser(
username='admin', passwo... |
# -*- coding: utf-8 -*-
"""
Created on Fri Sep 23 10:49:39 2016
@author: adam
"""
import pytest
from rickshaw.simspec import SimSpec, def_niches, def_commodities
from rickshaw.generate import random_niches, choose_commodity, choose_commodities
@pytest.mark.parametrize("i", range(100))
def test_random_niches(i):
s... |
"""
================================================================
Plot the decision surface of a decision tree on the iris dataset
================================================================
Plot the decision surface of a decision tree trained on pairs
of features of the iris dataset.
See :ref:`decision tree ... |
# -*- coding: utf-8 -*-
"""
***************************************************************************
lasgrid.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
---------------------
D... |
"""
Django settings for mcfinance project.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.7/ref/settings/
"""
from mongoengine import connect
# Build paths inside the project like t... |
from django import template
from django.conf import settings
from django.contrib.flatpages.models import FlatPage
from django.contrib.sites.models import get_current_site
register = template.Library()
class FlatpageNode(template.Node):
def __init__(self, context_name, starts_with=None, user=None):
self.... |
"""
This module is for inspecting OGR data sources and generating either
models for GeoDjango and/or mapping dictionaries for use with the
`LayerMapping` utility.
"""
from django.contrib.gis.gdal import DataSource
from django.contrib.gis.gdal.field import (
OFTDate, OFTDateTime, OFTInteger, OFTInteger64, OFTReal, O... |
from __future__ import unicode_literals
import logging
import logging.config # needed when logging_config doesn't start with logging.config
import sys
import warnings
from copy import copy
from django.conf import settings
from django.core import mail
from django.core.mail import get_connection
from django.utils.depr... |
from django.contrib.messages import constants
from django.contrib.messages.storage import default_storage
__all__ = (
'add_message', 'get_messages',
'get_level', 'set_level',
'debug', 'info', 'success', 'warning', 'error',
)
class MessageFailure(Exception):
pass
def add_message(request, level, mess... |
# coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
determine_ext,
clean_html,
get_element_by_attribute,
ExtractorError,
)
class TVPIE(InfoExtractor):
IE_NAME = 'tvp'
IE_DESC = 'Telewizja Polska'
_VALID_URL = r'https?:... |
from HTMLParser import HTMLParser
import simplejson as json
import celery
from celery import Celery
from flask import render_template
from flask.ext.gzip import Gzip
from celery import task
from flask import Flask
import datetime
import urllib2
import string
import math
import sys
import os
celery = Celery("flasktasks... |
# coding=utf-8
from __future__ import print_function, unicode_literals
import os
import posixpath
from libtrakt.exceptions import traktException
from libtrakt.trakt import TraktAPI
import sickbeard
from sickbeard import helpers, logger
from sickbeard.indexers.indexer_config import INDEXER_TVDB
from sickrage.helper.... |
import unittest
from hearthbreaker.cards import Wisp, WarGolem, BloodfenRaptor, RiverCrocolisk, AbusiveSergeant, ArgentSquire
from tests.agents.trade.test_helpers import TestHelpers
from tests.agents.trade.test_case_mixin import TestCaseMixin
from hearthbreaker.agents.trade.possible_play import PossiblePlays
class Te... |
import sys
from ansible.compat.tests.mock import patch, Mock
from units.modules.utils import AnsibleExitJson, AnsibleFailJson, ModuleTestCase
base_modules_mock = Mock()
nitro_service_mock = Mock()
nitro_exception_mock = Mock()
base_modules_to_mock = {
'nssrc': base_modules_mock,
'nssrc.com': base_modules_mo... |
# -*- coding: utf-8 -*-
from Test_Column_ObjFnc import tac_column
import time
"""
% -------------------------------------------------------------------------
% SIMULATION-BASED OPTIMIZATION OF A SINGLE CONVENTIONAL DISTILLATION
% COLUMN USING THE PARTICLE SWARM OPTIMIZATION ALGORITHM
%-----------------------... |
# -*- coding: utf-8 -*-
"""Regression test for issue #51."""
import unittest
import os.path
from xml.etree import ElementTree as ET
from statik.generator import generate
class TestStaticPagesFromProjectDynamicContext(unittest.TestCase):
def test_issue(self):
test_path = os.path.dirname(os.path.realpath... |
"""
Verifies the use of the environment during regeneration when the gyp file
changes, specifically via build of an executable with C preprocessor
definition specified by CFLAGS.
In this test, gyp and build both run in same local environment.
"""
import TestGyp
# CPPFLAGS works in ninja but not make; CFLAGS works in... |
"""
ROS Service Description Language Spec
Implements http://ros.org/wiki/srv
"""
import os
import sys
from . names import is_legal_resource_name, is_legal_resource_base_name, package_resource_name, resource_name
class SrvSpec(object):
def __init__(self, request, response, text, full_name = '', s... |
"""Convenience wrapper for starting an appengine tool."""
import os
import sys
import time
sys_path = sys.path
try:
sys.path = [os.path.dirname(__file__)] + sys.path
import wrapper_util
finally:
sys.path = sys_path
wrapper_util.reject_old_python_versions((2, 5))
if sys.version_info < (2, 6):
sys.stderr.w... |
"""
System users
============
"""
from fabtools.files import is_file
from fabtools.user import *
import fabtools.require
def user(name, comment=None, home=None, group=None, extra_groups=None,
create_home=False, skeleton_dir=None, password=None, system=False,
shell=None, uid=None):
"""
Require a user ... |
import re
import os
import logging
import time
from autotest.client.shared import error
from virttest import virsh
from virttest import utils_libvirtd
from virttest import data_dir
from virttest.utils_test import libvirt
from virttest import utils_misc
from virttest.libvirt_xml import vm_xml
def manipulate_domain(vm_... |
# -*- coding: utf-8 -*-
'''
Poseidon Add-on
Copyright (C) 2016 Poseidon
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) a... |
import ipaddress
from django.core.exceptions import ValidationError
from django.utils.translation import gettext_lazy as _
def clean_ipv6_address(ip_str, unpack_ipv4=False,
error_message=_("This is not a valid IPv6 address.")):
"""
Clean an IPv6 address string.
Raise ValidationErr... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.