text stringlengths 475 200k |
|---|
import os
import time
from subprocess import PIPE, CalledProcessError
import yaml
from conjureup.utils import run
from .writer import fail, log, success
JUJU_CONTROLLER = os.environ['JUJU_CONTROLLER']
JUJU_MODEL = os.environ['JUJU_MODEL']
JUJU_CM_STR = "{}:{}".format(JUJU_CONTROLLER, JUJU_MODEL)
def status():
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Partially based on AboutMessagePassing in the Ruby Koans
#
from runner.koan import *
class AboutAttributeAccess(Koan):
class TypicalObject:
pass
def test_calling_undefined_functions_normally_results_in_errors(self):
typical = self.TypicalObj... |
# Copyright 2014 Google LLC
#
# 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, s... |
# Author: Trevor Perrin
# See the LICENSE file for legal information regarding use of this file.
"""Pure-Python RSA implementation."""
from .cryptomath import *
from .asn1parser import ASN1Parser
from .rsakey import *
class Python_RSAKey(RSAKey):
def __init__(self, n=0, e=0, d=0, p=0, q=0, dP=0, dQ=0, qInv=0):
... |
from __future__ import with_statement
from unittest import TestCase
from nav.ipdevpoll.neighbor import _get_netbox_macs, CDPNeighbor
from mock import patch, Mock
class IgnoredMacTest(TestCase):
def test_vrrp_addresses_are_ignored(self):
with patch('django.db.connection') as cx:
vrrp1 = '00:00:5... |
# Copyright 2014-2016 Hewlett Packard Enterprise Development Company LP
#
# 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 a... |
#!/usr/bin/python
#
# #################################################################
# ## WARNING : this is a generated file, don't change it !
# #################################################################
#
# \file 1_export.py
# \brief Export swt
# \date 2011-09-28-07-42-GMT
# \author Jan Boon (Kaetemi)
# P... |
# Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
import unittest
from mock import MagicMock, ANY
from flotilla.agent import *
from flotilla.db import DynamoDbLocks
SERVICE = 'mock-service'
ASSIGNED_REVISION = '00000000000000000000000000000000'
class TestFlotillaAgent(unittest.TestCase):
def setUp(self):
self.db = MagicMock(spec=FlotillaAgentDynamo)
... |
# coding=utf-8
from kg.lang.helps.attrs import *
from kg.lang.jondomo import Jondomo
from kg.lang.lang import KyrgyzWord
from kg.lang.san import San
from kg.lang.taandyk import Taandyk
from kg.tests import KGTestCase
attrs_list = [men, sen, al, biz, siler, alar, siz, sizder]
class JondomoChygyshAfterTaandykTest(KGT... |
try:
import json as _json
except ImportError:
import sys
sys.path.append('simplejson-2.3.3')
import simplejson as _json
import requests as _requests
import urlparse as _urlparse
import random as _random
import base64 as _base64
from ConfigParser import ConfigParser as _ConfigParser
import os as _os
_C... |
"""Test the errno module
Roger E. Masse
"""
import errno
import unittest
std_c_errors = frozenset(['EDOM', 'ERANGE'])
class ErrnoAttributeTests(unittest.TestCase):
def test_for_improper_attributes(self):
# No unexpected attributes should be on the module.
for error_code in std_c_errors:
... |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.18 on 2019-08-11 15:55
from __future__ import unicode_literals
from django.db import migrations, models
import jsonfield.fields
class Migration(migrations.Migration):
dependencies = [
('hastexo', '0004_auto_20190715_1053'),
]
operations = [
... |
# -*- coding: utf-8 -*-
# [HARPIA PROJECT]
#
#
# S2i - Intelligent Industrial Systems
# DAS - Automation and Systems Department
# UFSC - Federal University of Santa Catarina
# Copyright: 2007 - 2009 Clovis Peruchi Scotti ([EMAIL]), S2i (www.s2i.das.ufsc.br)
#
#
# This program is free software: you can redistribute i... |
from django.core.urlresolvers import reverse
from tastypie import authorization
from tastypie.authentication import MultiAuthentication
from crits.domains.domain import Domain
from crits.domains.handlers import add_new_domain
from crits.core.api import CRITsApiKeyAuthentication, CRITsSessionAuthentication
from crits.c... |
#
# Solution to Project Euler problem 346
# Copyright (c) Project Nayuki. All rights reserved.
#
# https://www.nayuki.io/page/project-euler-solutions
# https://github.com/nayuki/Project-Euler-solutions
#
import itertools
# 1 is a strong repunit because in every base b >= 2, its representation is "1", which is a r... |
import time
import os
from os import listdir
from os.path import isfile, join
from dotstar import Adafruit_DotStar
import get_freq
FreqAverage=5
povPath="pov/"
freq = get_freq.freqThread(NAverage=FreqAverage) # initialize frequency-thread
if os.path.isdir(povPath)==False:
message= "Pov Path (" + str(povPath) + ") do... |
#!/usr/bin/env python
# coding: utf-8
# Copyright 2012 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# ... |
# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.
#
# 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 Licen... |
# Copyright 2013 OpenStack Foundation.
# All Rights Reserved
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... |
# -*- coding: utf-8 -*-
"""
***************************************************************************
ogrinfo.py
---------------------
Date : November 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
*****************************... |
#!/usr/bin/python3
#
# This is a tool Josh uses on his box serving mailinabox.email to parse the nginx
# access log to see how many people are installing Mail-in-a-Box each day, by
# looking at accesses to the bootstrap.sh script.
import re, glob, gzip, os.path, json
import dateutil.parser
outfn = "/home/user-data/ww... |
#!/usr/bin/env python
#
# ROS node to provide a few joint angle trajectories as default poses
#
# Copyright 2011 Armin Hornung & Daniel Maier University of Freiburg
# http://www.ros.org/wiki/nao
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the follow... |
"""Database control class module."""
# TODO: Use a hash as a track identifier instead of path to allow for path
# changes - maybe use path as backup reference?
# TODO: Add a function to remove the last play record (to undo the play)?
# TODO: Add functions to populate ignore list - possibly now unnecessary.
# TOD... |
# -*- coding: utf-8 -*-
from openerp import api, fields, models, fields
from openerp import _, tools
from openerp.exceptions import UserError
class HrEquipmentStage(models.Model):
""" Model for case stages. This models the main stages of a Maintenance Request management flow. """
_name = 'hr.equipment.stage... |
from datetime import datetime, timedelta
from pytz import timezone, utc
from oncall.utils import gen_link_id
from falcon import HTTPBadRequest
from ujson import dumps as json_dumps
import time
import logging
import operator
logger = logging.getLogger()
UNIX_EPOCH = datetime(1970, 1, 1, tzinfo=utc)
SECONDS_IN_A_DAY = ... |
# -*- coding: UTF-8 -*-
# Copyright 2014 Rumma & Ko Ltd
# License: BSD (see file COPYING for details)
from __future__ import unicode_literals
from __future__ import print_function
from commondata.utils import Place, PlaceGenerator
class PlaceInEstonia(Place):
def __unicode__(self):
return self.name
c... |
#!/usr/bin/env python
"""
Read and convert ODS files created by OpenOffice.org's Calc.
"""
# Copyright (C) 2009-2015 Thomas Aglassinger
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, e... |
#!/usr/bin/env python
# Copyright 2014-2021 The PySCF Developers. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# U... |
# Copyright (C) 2012 Canonical Ltd.
# Copyright (C) 2012 Yahoo! Inc.
# Copyright (C) 2012-2013 CERIT Scientific Cloud
# Copyright (C) 2012-2013 OpenNebula.org
# Copyright (C) 2014 Consejo Superior de Investigaciones Cientificas
#
# Author: Scott Moser <[EMAIL]>
# Author: Joshua Harlow <[EMAIL]>
# Author: Vlastimil Hole... |
# -*- coding: utf-8 -*-
# Copyright 2017 GIG Technology NV
#
# 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... |
import logging
from datetime import datetime
from grano.core import db
from grano.model import Pipeline, LogEntry
from grano.logic.accounts import console_account
def create(project, operation, label=None, config=None, author=None):
""" Create a new pipeline object, in PENDING state. """
pipeline = Pipeline(... |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... |
# -*- coding: utf-8 -*-
from __future__ import print_function
import sys
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import DataMigration
from django.db import models, transaction
from django.utils.encoding import smart_text
class Migration(DataMigration):
def _get_dic... |
#!/usr/bin/env python
import os
import shutil
import sys
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "build")))
import build_utils
script_dir = os.path.abspath(os.path.dirname(__file__))
wxwebkit_dir = os.path.abspath(os.path.join(script_dir, "..", "..", "..", "WebKitBuild", "Debug... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from flask import Flask
from flask.ext.mongoengine import MongoEngine
from flask.ext.babel import Babel, format_date, format_time, format_timedelta
from urlparse import urlparse
from aukro import settings
# init application
app = Flask("aukro", instance_relative_config=T... |
"""
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 later version.
Written (W) 2013 Heiko Strathmann
Written (W) 2013 Dino Sejdinovic
"""
fro... |
#!/usr/bin/python
#
# XBundle class
#
# an xbundle file is an XML format file with element <xbundle>, which
# includes the following sub-elements:
#
# <metadata>
# <policies semester=...>: <policy> and <gradingpolicy>
# each contain the JSON for the corresponding file
# <about>: <file fil... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright: (c) 2018, F5 Networks Inc.
# GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... |
# -*- coding: utf-8 -*-
from pdfminer.pdfparser import PDFParser
from pdfminer.pdfdocument import PDFDocument
from pdfminer.pdfpage import PDFPage
from pdfminer.pdfpage import PDFTextExtractionNotAllowed
from pdfminer.pdfinterp import PDFResourceManager
from pdfminer.pdfinterp import PDFPageInterpreter
from pdfm... |
import pytest
import datetime
from api.base.settings.defaults import API_BASE
from osf_tests.factories import (
AuthUserFactory,
InstitutionFactory
)
from osf.metrics import InstitutionProjectCounts
@pytest.mark.es
@pytest.mark.django_db
class TestInstitutionSummaryMetrics:
@pytest.fixture()
def ins... |
# pylint: disable=protected-access
from datetime import datetime
from unittest import TestCase
import requests_mock
from tools.petscan import PetScan, PetScanException
class TestCatScan(TestCase):
def setUp(self):
self.petscan = PetScan()
def test_add_options(self):
self.petscan.add_options... |
#-- GAUDI jobOptions generated on Mon Jul 20 10:24:27 2015
#-- Contains event types :
#-- 11164012 - 18 files - 254325 events - 55.42 GBytes
#-- Extra information about the data processing phases:
#-- Processing Pass Step-124834
#-- StepId : 124834
#-- StepName : Reco14a for MC
#-- ApplicationName : Bru... |
#!/usr/bin/env python
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "Li... |
def to_curl(request, headers="simple", print_it=True):
"""
Get a curl string from a python request.
:param request: a requests.models.Response or a requests.models.Response.request object
:param headers: headers to include in the curl request (the "-H" args).
Specified by
a {heade... |
"""
Euler deconvolution methods for potential fields.
**Implementations**
* :class:`~fatiando.gravmag.euler.Classic`: The classic 3D solution to Euler's
equation for potential fields (Reid et al., 1990). Runs on the whole dataset.
**Solution selection procedures**
* :class:`~fatiando.gravmag.euler.ExpandingWindow... |
"""
DCSO TIE2MISP Parser
Copyright (c) 2017, DCSO GmbH
"""
from model.attributes import IPv4, DomainName, URLVerbatim, MD5, SHA1, SHA256
from model.misp_event import MISPEvent, MISPAttribute
import logging
class Actor(MISPEvent):
def __init__(self, organisation_name, organisation_uuid, threat_level_id, published... |
# -*- coding: utf-8 -*-
import xbmcgui, urllib
#import demjson3 as json
LIST = 146
class GenreSelectDialog(xbmcgui.WindowXMLDialog):
def __init__(self, *args, **kwargs):
xbmcgui.WindowXMLDialog.__init__(self)
self.MainScreen = kwargs.get('MainScreen')
def onInit(self):
xbmcgui.WindowXMLDialog.onInit... |
# Copyright 2011 Nicholas Bray
#
# 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... |
"""
LLDB AppKit formatters
Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
See https://llvm.org/LICENSE.txt for license information.
SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
"""
# example synthetic children and summary provider for CFString (and related NSString class)
# th... |
# vim: set expandtab sw=4 ts=4:
#
# Unit tests for Travis CI environment variable related functions
#
# Copyright (C) 2014-2016 Dieter Adriaenssens <[EMAIL]>
#
# This file is part of buildtimetrend/python-lib
# <https://github.com/buildtimetrend/python-lib/>
#
# This program is free software: you can redistribute it an... |
# -*- coding: utf-8 -*-
# ####################################################################
# Copyright (C) 2005-2013 by the FIFE team
# http://www.fifengine.net
# This file is part of FIFE.
#
# FIFE is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General ... |
import re
import sys
import sqlite3
if 2 == sys.version_info[0]:
import thread
else:
import _thread as thread
def connect(aDataBase, aCheckSameThread=True):
return sqlite3.connect(aDataBase, check_same_thread=aCheckSameThread)
def disconnect(aConnection):
aConnection.close()
def write(aDataBase,... |
import itertools
import json
import random
import statistics
def arrival_static(time_line: list, time_slice: int, customer_per_slice: int):
for i in range(time_slice, len(time_line), time_slice):
time_line[i] += customer_per_slice
def arrival_random(time_line: list, time_slice: int, customer_per_slice: ... |
"""Tests for tensorflow.ops.nn_ops.Pad."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow.python.platform
import numpy as np
import tensorflow as tf
from tensorflow.python.kernel_tests import gradient_checker as gc
class PadOpTest(tf.... |
#!/usr/bin/python
#
# International Chemical Identifier (InChI)
# Version 1
# Software version 1.04
# September 9, 2011
#
# The InChI library and programs are free software developed under the
# auspices of the International Union of Pure and Applied Chemistry (IUPAC).
# Originally developed at NIST. Modifications and... |
"""uclapi URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.10/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('$', views.home, name='home')
Class-base... |
# encoding: utf-8
import pytest
from marrow.mongo.core.document import Document
from marrow.mongo.field.base import Field
class Person(Document):
name = Field()
age = Field()
@pytest.fixture
def doc(request):
return Person("Alice", 27)
class TestDocumentMapping(object):
def test_getitem(self, doc):
with p... |
# -*- coding: utf-8 -*-
# Define here the models for your spider middleware
#
# See documentation in:
# http://doc.scrapy.org/en/latest/topics/spider-middleware.html
from scrapy import signals
class PycursosSpiderMiddleware(object):
# Not all methods need to be defined. If a method is not defined,
# scrapy ... |
# Copyright 2013 IBM Corp.
# Copyright 2011 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LIC... |
#!/usr/bin/python
#
# Copyright 2016 Red Hat | Ansible
#
# This file is part of Ansible
#
# Ansible 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 la... |
# ICE Revision: $Id$
"""A parsed blockMeshDict"""
from PyFoam.RunDictionary.ParsedParameterFile import ParsedParameterFile
class ParsedBlockMeshDict(ParsedParameterFile):
""" A parsed version of a blockMeshDict-file. Adds some
convenience-methods to access parts of the file"""
def __init__(self,
... |
# coding=utf-8
from collections import Counter
from math import fabs
from re import split as regex_split, sub as regex_sub, UNICODE as REGEX_UNICODE
stopWords = set([
"-", " ", ",", ".", "a", "e", "i", "o", "u", "t", "about", "above",
"above", "across", "after", "afterwards", "again", "against", "all",
"al... |
"""My purpose in life is to harvest the WEPP env (erosion output) files
The arguments to call me require the SCENARIO to be provided, but you can
also do any of the following:
# See usage
python env2database.py -h
"""
import os
import re
import argparse
import datetime
from multiprocessing import Pool
import ... |
# -*- coding: UTF-8 -*-
HMAP = {
' ': u'\u00A0\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F',
'!': u'\uFF01\u01C3\u2D51\uFE15\uFE57',
'"': u'\uFF02',
'#': u'\uFF03\uFE5F',
'$': u'\uFF04\uFE69',
'%': u'\uFF05\u066A\u2052\uFE6A',
'&': u'\uFF06\uFE60',
"'":... |
import unittest, random, sys, time
sys.path.extend(['.','..','py'])
import h2o, h2o_cmd, h2o_hosts, h2o_browse as h2b, h2o_import as h2i, h2o_exec as h2e
def write_syn_dataset(csvPathname, rowCount, colCount, SEED):
r1 = random.Random(SEED)
start = time.time()
dsf = open(csvPathname, "w+")
# write a h... |
#!/usr/bin/python
import os
import json
class JSONHelper(object):
@staticmethod
def read_data(file_path):
filepath = os.path.abspath(file_path)
fileExists = os.path.isfile(filepath)
jsonDataDict = {}
if fileExists:
with open(filepath, "r") as inFile: ... |
"""
The :mod:`sklearn.pipeline` module implements utilities to build a composite
estimator, as a chain of transforms and estimators.
"""
# Author: Edouard Duchesnay
# Gael Varoquaux
# Virgile Fritsch
# Alexandre Gramfort
# Lars Buitinck
# License: BSD
from collections import defaultdict... |
#Example hrdspy usage. determine dispersion in integrated spectrum
#as a function of wavelength for a given mass and age.
import numpy as np
import starmodel
import isochrone
import observate
import cluster
import matplotlib.pyplot as pl
import time
# choose a few filters and load them
filternamelist = ['ctio_mosaic... |
# Copyright 2016 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import multiprocessing
import log
import time
_RealProcess = multiprocessing.Process
__all__ = []
class ProcessSubclass(_RealProcess):
def __init__(self... |
import os
import json
def _id_to_name(id):
return ' '.join(id.split('_'))
def _name_to_id(name):
return '_'.join(name.split(' '))
def ensure_schema_structure(schema):
schema['pages'] = schema.get('pages', [])
schema['title'] = schema['name']
schema['version'] = schema.get('version', 1)
return... |
# Copyright 2012 OpenStack Foundation
# Copyright 2014 Rackspace Hosting
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache... |
# Copyright 2012 the V8 project authors. All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditi... |
from flask import Flask, jsonify, request, render_template, make_response
from datetime import datetime
from elasticsearch import Elasticsearch
es = Elasticsearch()
app = Flask(__name__)
@app.route('/')
def hello_world():
return render_template(
'index.html'
)
@app.route('/buscar', methods = ["POST"... |
"""Support for sending data to Dweet.io."""
import logging
from datetime import timedelta
import voluptuous as vol
from homeassistant.const import (
CONF_NAME, CONF_WHITELIST, EVENT_STATE_CHANGED, STATE_UNKNOWN)
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers import state as state_... |
"""
Ludolph: Monitoring Jabber bot
Copyright (C) 2015-2017 Erigones, s. r. o.
This file is part of Ludolph.
See the file LICENSE for copying permission.
"""
import logging
from shelve import Shelf
try:
import anydbm as dbm
except ImportError:
import dbm
logger = logging.getLogger(__name__)
__all__ = ('Ludol... |
"""Test Home Assistant color util methods."""
import unittest
import homeassistant.util.color as color_util
class TestColorUtil(unittest.TestCase):
"""Test color util methods."""
# pylint: disable=invalid-name
def test_color_RGB_to_xy(self):
"""Test color_RGB_to_xy."""
self.assertEqual((0... |
#!/usr/bin/env python
"""An implementation of an OSX client builder."""
import getpass
import os
import shutil
import subprocess
from grr.lib import build
from grr.lib import config_lib
class DarwinClientBuilder(build.ClientBuilder):
"""Builder class for the Mac OS X (Darwin) client."""
def __init__(self, conte... |
#!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from grit.format.policy_templates.writers import template_writer
NEWLINE = '\r\n'
def GetWriter(config):
'''Factory method f... |
import pickle
import random
import unittest
import d3d11
identity = [
(1, 0, 0, 0),
(0, 1, 0, 0),
(0, 0, 1, 0),
(0, 0, 0, 1)
]
class Test(unittest.TestCase):
def randomMatrix(self):
m = d3d11.Matrix()
for x in range(4):
for y in range(4):
#Test both... |
import unittest
import csv
import random
from amaasutils.random_utils import random_string
from amaascore.csv_upload import Uploader
class CorporateActionUploaderTest(unittest.TestCase):
def setUp(self):
self.longMessage = True # Print complete error message on failure
self.asset_manager_id = se... |
from flask import Flask
from flask import render_template
from flask import render_template_string
from flask import request
from flask import Response
from datetime import date
from datetime import timedelta
from random import randint
import json
APP = Flask(__name__)
# TODO: remove before production
APP.debug = Tru... |
#######################################################################
#
# Renderer for Enigma2
# Coded by shamann (c)2013
#
# 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; eithe... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# articulos.py
#
# Copyright 2010 Jesús Hómez <jesus@jesus-laptop>
#
# 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;... |
# -*- coding: utf-8 -*-
"""
InaSAFE Disaster risk assessment tool developed by AusAid -
**metadata module.**
Contact: [EMAIL]
.. note:: 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; eith... |
# models.py
# Creator: Max Greenwald
# Updated: 3/20/17
# Purpose: Define models and relevant functions for the database with SQLAlchemy
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
db = SQLAlchemy()
class Doctor(db.Model):
id = db.Column(db.Integer, primary_key=True)
name = db.Column(db.St... |
# This file is part of wger Workout Manager.
#
# wger Workout Manager is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# wger W... |
# Copyright (C) 2003-2005 Peter J. Verveer
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following d... |
from uflacs.backends.ufc.generator import ufc_generator, ufc_integral_types
class ufc_integral(ufc_generator):
def __init__(self, integral_type):
assert integral_type in ufc_integral_types
ufc_generator.__init__(self, integral_type + "_integral")
def enabled_coefficients(self, L, ir):
... |
##############################################################################
# Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, [EMAIL], All rights reserved.
# LLNL-CODE-647188
#
# F... |
# -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
#
# FreeType high-level python API - Copyright 2011-2015 Nicolas P. Rougier
# Distributed under the terms of the new BSD license.
#
# -----------------------------------------------------------------------------
""... |
# -*- coding: utf-8 -*-
# Copyright(C) 2013 Julien Veyssier
#
# This file is part of a weboob module.
#
# This weboob module is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the Lice... |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... |
# Copyright (c) 2017 Ultimaker B.V.
# Uranium is released under the terms of the AGPLv3 or higher.
from UM.Settings.ContainerRegistry import ContainerRegistry
from UM.Settings.InstanceContainer import InstanceContainer
from cura.MachineAction import MachineAction
from PyQt5.QtCore import pyqtSlot, pyqtSignal, pyqtProp... |
import logging
import claripy
import archinfo
from .sim_type import SimTypeChar
from .sim_type import SimTypePointer
from .sim_type import SimTypeFixedSizeArray
from .sim_type import SimTypeArray
from .sim_type import SimTypeString
from .sim_type import SimTypeFunction
from .sim_type import SimTypeFloat
from .sim_typ... |
#!/usr/bin/env python
#
# Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... |
"""
.. _misc:
++++++++++++++++++++++
Miscellaneous routines
++++++++++++++++++++++
This contains methods that do not fit into the other sections of the
reference manual.
"""
__all__ = ['try_to_array', 'get_var_from_particle_list',
'multinomial_resample', 'kde']
import numpy as np
from scipy.stats imp... |
# -*- coding: utf-8 -*-
import fauxfactory
import pytest
from cfme.intelligence.reports.widgets.menu_widgets import MenuWidget
from cfme.intelligence.reports.widgets.report_widgets import ReportWidget
from cfme.intelligence.reports.widgets.chart_widgets import ChartWidget
from cfme.intelligence.reports.widgets.rss_wid... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
""" Learning-python3 basic """
__author__ = 'chuck'
NAMES = ['Jordan', 'Kobe', 'Tracy']
SCORES = [95, 75, 85]
for i in range(len(NAMES)):
if NAMES[i] == 'Jordan':
if SCORES[i] == 100:
print("Jordan's score is %03d" % SCORES[i])
else:
... |
#
# IAM AWS messaging tools
#
# sample sns sender
# boto3 version
#
import json
import dateutil.parser
import base64
import string
import time
import re
import os.path
from sys import exit
import signal
from optparse import OptionParser
import threading
import logging
import logging.config
from messagetools.iam_me... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.