src stringlengths 721 1.04M |
|---|
from nose.tools import eq_, ok_, raises
from wtforms import fields
from flask.ext.admin import form
from flask.ext.admin._compat import as_unicode
from flask.ext.admin._compat import iteritems
from flask.ext.admin.contrib.sqla import ModelView
from . import setup
class CustomModelView(ModelView):
def __init__(... |
import sys
import math
import time
import random
from bzrc import BZRC, Command
class PigeonAgent(object):
def __init__(self, bzrc, mode, time):
self.bzrc = bzrc
self.mode = mode
self.num_tanks = 1
self.cur_time = time
self.const_velocity = .5
... |
####################################################################################################
#
# Musica - A Music Theory package for Python
# Copyright (C) 2017 Salvaire Fabrice
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as pub... |
"""distutils.command.bdist_dumb
Implements the Distutils 'bdist_dumb' command (create a "dumb" built
distribution -- i.e., just an archive to be unpacked under $prefix or
$exec_prefix)."""
__revision__ = "$Id$"
import os
from distutils.core import Command
from distutils.util import get_platform
from distu... |
# -*- coding: utf-8 -*-
# Copyright 2020 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... |
# Copyright 2012 Grid Dynamics
# Copyright 2013 Inktank Storage, Inc.
# Copyright 2014 Mirantis, Inc.
#
# 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.or... |
# Copyright 2015 Rackspace 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 required by applicable law ... |
from flask.ext.mysql import MySQL
from flask import Flask, request, session, g, redirect, url_for, abort, render_template, flash, jsonify
from contextlib import closing
# configuration
DEBUG = True
# variables for database access
HOST = 'sql3.freemysqlhosting.net'
USER = 'sql3114361'
PASSWD = 'zZl9FPvPV9'
DATABASE = ... |
# Copyright 2019 Zadara Storage, Inc.
# Originally authored by Jeremy Brown - https://github.com/jwbrown77
#
# 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... |
from Behaviour import MessageTemplate, OneShotBehaviour
from xmpp.protocol import *
from xmpp.simplexml import Node
import uuid
def gen_id():
return str(uuid.uuid4())
#def PubSubMessageTemplate():
# msgs = []
# for ns in (NS_PUBSUB, NS_PUBSUB_OWNER):
# msg = Iq()
# msg.addChild(name='pubsub',... |
import random
class Nodo(object):
"""docstring for Nodo"""
def __init__(self, palabra):
super(Nodo, self).__init__()
self.nodosConectados = {}
self.palabra = palabra
def setConexo(self, nodo):
#peso = random.random() - 0.5
peso = 0.1
palabra = nodo.getPalabra()
self.nodosConectados[palabra] = peso
... |
from __future__ import absolute_import
from typing import Any, Dict, Optional, Text
# This file is adapted from samples/shellinabox/ssh-krb-wrapper in
# https://github.com/davidben/webathena, which has the following
# license:
#
# Copyright (c) 2013 David Benjamin and Alan Huang
#
# Permission is hereby granted, free ... |
#Copyright (C) 2017 Paolo Galeone <nessuno@nerdz.eu>
#
#This Source Code Form is subject to the terms of the Mozilla Public
#License, v. 2.0. If a copy of the MPL was not distributed with this
#file, you can obtain one at http://mozilla.org/MPL/2.0/.
#Exhibit B is not attached; this software is compatible with the
#lic... |
from leonardo.base import default
EMAIL = {
'HOST': 'mail.domain.com',
'PORT': '25',
'USER': 'username',
'PASSWORD': 'pwd',
'SECURITY': True,
}
RAVEN_CONFIG = {}
ALLOWED_HOSTS = ['*']
USE_TZ = True
DEBUG = True
ADMINS = (
('admin', 'mail@leonardo.cz'),
)
# month
LEONARDO_CACHE_TIMEOUT = ... |
#!/usr/bin/env python
'''
A script to demonstrate the various SPARQL filter query components by
determining the relationship between Michelle and Barack Obama
'''
from sparqllib import *
from rdflib import BNode, Literal
from rdflib.namespace import FOAF
from pprint import pprint
def main():
# Create the necessa... |
# ELBE - Debian Based Embedded Rootfilesystem Builder
# Copyright (C) 2013 Linutronix GmbH
#
# This file is part of ELBE.
#
# ELBE 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 Licen... |
#!/usr/bin/env python3
# author: greyshell
# description: find safe return address
import argparse
import sys
from colorama import Fore
# global constant variable
PROGRAM_LOGO = """
___ __ __ ___ ___ __ __ __ ___ __ __
|__ | |\ | | \ /__` /\ |__ |__ /\ | \ | ... |
#
# Copyright 2013-2015 BloomReach, Inc.
#
# 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 ... |
import scipy
from glob import glob
import numpy as np
from keras.datasets import mnist
from skimage.transform import resize as imresize
import pickle
import os
import urllib
import gzip
class DataLoader():
"""Loads images from MNIST (domain A) and MNIST-M (domain B)"""
def __init__(self, img_res=(128, 128)):
... |
# coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.6.1
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re
... |
#coding:utf-8
import wsgiref.handlers
import os
from functools import wraps
from google.appengine.ext import webapp
from google.appengine.ext.webapp import template
from google.appengine.api import users
import methods,logging
from django.utils import simplejson
adminFlag=True
class AdminControl(webapp.RequestHandler... |
import config.settings
prefix = config.settings.main.get('prefix')
main_help = '```md\nÉstos son todos los comandos funcionales que \
tengo implementados por ahora. Uso "{p}" de prefijo.\n\n# {p}{help}\n# \
{p}{info}\n# \
{p}{echo}\n# {p}{eight_ball}\n# {p}{random} \n# {p}{suggestions} \n# \
{p}{isup}\n# ... |
import re
quote_match = re.compile(r'(([\"\']).*?\2)')
double_quote = re.compile(r'(\A|[^\\])\"')
single_quote = re.compile(r"(\A|[^\\])\'")
doc_name = re.compile(r'^[A-Za-z_][A-Za-z0-9_/]*$')
token_separators=r'(?P<sep1>[\s]+)|[\s](?P<sep2>2>)[^&][^1]|[\s](?P<sep3>!>)[\s]|[\s](?P<sep4>2>&1)|(?P<sep5>(?<![2!])>)|(?P<se... |
import datetime
import os
import sys
from constants import CATEGORIES, DIRECT_DEBIT_PAYMENT, ROOT_DIR
def sum_total_expenses(data_dict):
expenses_sum = 0
transaction_nb = 0
for i in data_dict:
if DIRECT_DEBIT_PAYMENT.lower() not in i['description'].lower() and i['amount'] < 0 and not i['amount'] ==... |
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the... |
from django.contrib.sites.models import Site
from django.db import models
from django.utils.translation import pgettext_lazy
from ..core.utils.translations import TranslationProxy
from ..core.weight import WeightUnits
from . import AuthenticationBackends
from .patch_sites import patch_contrib_sites
patch_contrib_site... |
# Implementation of Extensible Dependency Grammar, as described in
# Debusmann, R. (2007). Extensible Dependency Grammar: A modular
# grammar formalism based on multigraph description. PhD Dissertation:
# Universität des Saarlandes.
#
########################################################################
#
# ... |
from uvscada import k2750
from uvscada import ber225
import time
import json
def run(dmm, ps, f=None, tsleep=1.0):
print
print 'Init DMM'
dmm.volt_dc()
print
print 'Init PS'
# Turn down HV
ps.off()
ps.set_volt(0.0)
ps.apply()
print 'Stabalizing...'
time.sleep(3.0)
... |
"""
Author: Denis Nutiu <denis.nutiu@gmail.com>
This file is part of scoreboard-benchmark.
scoreboard-benchmark 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... |
import os
import json
import collections
import datetime
from flask import Flask, request, current_app, make_response, session, escape, Response, jsonify
from flask_jwt_extended import JWTManager, jwt_required, create_access_token, get_jwt_identity
from flask_socketio import SocketIO
from neo4j.v1 import GraphDatabase,... |
# Copyright (c) 2015–2016 Molly White
#
# 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 without
# restriction, including without limitation the rights to use, copy, modify, merge, publish,
# di... |
from io import BytesIO
import weasyprint
from django.conf import settings
from django.core.mail import EmailMessage
from django.shortcuts import get_object_or_404
from django.template.loader import render_to_string
from paypal.standard.ipn.signals import valid_ipn_received
from paypal.standard.models import ST_PP_COMP... |
# -*- coding: utf-8 -*-
''' Checks for ruby and rubygem packages.'''
import re
import rpm
from FedoraReview import CheckBase, Mock, RegistryBase
_GUIDELINES_URI = 'http://fedoraproject.org/wiki/Packaging:Ruby'
_GUIDELINES_SECTION_URI = '%(uri)s#%%(section)s' % {'uri': _GUIDELINES_URI}
def _is_nongem(spec):
"""... |
#!/usr/bin/env python
import sys
import os
import glob
import decimal
import argparse
parser = argparse.ArgumentParser(
description="Prints out results of FPTaylor experiments (from the log directory)")
parser.add_argument('--prec', type=int, default=2,
help="precision of printed results")
p... |
from st_create_session import create_session
from xdrdef.nfs4_const import *
from environment import check, checklist, fail, create_file, open_file
from xdrdef.nfs4_type import open_owner4, openflag4, createhow4, open_claim4
import nfs_ops
op = nfs_ops.NFS4ops()
import threading
import rpc
def testDestroy(t, env):
... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# GNU General Public Licence (GPL)
#
# 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 2 of the License, or (at your option) any later
# v... |
import logging
import time
import boto.exception
import dateutil.parser
import requests
from boto.ec2 import elb
from requests.exceptions import (
ConnectionError,
Timeout,
RequestException,
)
from simpledb import models
from neckbeard.output import fab_out_opts
NODE_AWS_TYPES = ['ec2', 'rds', 'elb']
EC2... |
# -*- coding: utf-8 -*-
#
# cons2_Python documentation build configuration file, created by
# sphinx-quickstart on Fri Nov 7 15:56:33 2014.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
... |
import pytest
from pinkerton.linker import EntityLinker
from pinkerton.extractor import EntityExtractor
from pinkerton.similarity import LDASimilarity
from pinkerton.providers import WikipediaProvider
@pytest.fixture
def history_text():
return '''
Иван Васильевич, царь всея руси, по историческим данным, был... |
import unittest
import pytest
from brown.core import brown
from brown.core.brush import Brush
from brown.core.invisible_object import InvisibleObject
from brown.core.path import Path
from brown.core.path_element_type import PathElementType
from brown.core.pen import Pen
from brown.utils.point import Point
class Tes... |
#--------------------------------------------------------------------------
# Scrapy Settings
#--------------------------------------------------------------------------
BOT_NAME = 'example'
SPIDER_MODULES = ['example.spiders']
NEWSPIDER_MODULE = 'example.spiders'
HTTPCACHE_ENABLED = True
REDIRECT_ENABLED = True
COOK... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2010-2011 Zuza Software Foundation
#
# This file is part of Virtaal.
#
# 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 ... |
# Copyright 2018-present MongoDB, Inc.
#
# 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 wri... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2010-2012 Associazione OpenERP Italia
# (<http://www.openerp-italia.org>).
# Copyright(c)2008-2010 SIA "KN dati".(http://kndati.lv) All Rights Reserved.
# Ge... |
# encoding: utf-8
"""
Test suite for pptx.oxml.__init__.py module, primarily XML parser-related.
"""
from __future__ import print_function, unicode_literals
import pytest
from lxml import etree
from pptx.oxml import oxml_parser, parse_xml, register_element_cls
from pptx.oxml.ns import qn
from pptx.oxml.xmlchemy im... |
#!/usr/bin/env python3
# A wrapper script to make it easier to use wpa_cli to connect.
# https://wiki.archlinux.org/index.php/WPA_supplicant#Connecting_with_wpa_cli
# was very helpful.
#
# For extending this to eth0, browse /etc/dhcpcd.conf
# and /usr/share/dhcpcd/hooks/10-wpa_supplicant on raspbian,
# where dhcpcd is... |
__author__ = 'Charlie'
"""Image coloring by fully convolutional networks - incomplete """
import numpy as np
import tensorflow as tf
import os, sys, inspect
from datetime import datetime
import scipy.misc as misc
lib_path = os.path.realpath(
os.path.abspath(os.path.join(os.path.split(inspect.getfile(inspect.curren... |
"""
Automatically saves the contents of the Messages window when a
compilation has finished.
The output is saved in a file called "messages.txt" (or some other name set in
the preferences) in the root project's object directory. If there is no object
directory for the root project, then the file is saved in the direct... |
import json as _json_io
import textwrap
import typing
from datetime import timedelta
import cauldron as _cd
from cauldron import environ
from cauldron import render
from cauldron.render import plots as render_plots
from cauldron.render import texts as render_texts
from cauldron.session import report
def _get_report(... |
import json
import pytest
import glob
import val
schema = json.load(open('schema.json'))
@pytest.mark.parametrize("template", glob.glob('tests/examples-*/*.template'))
def test_template(template):
if 'troposphere/EMR_Cluster' in template:
pytest.skip('troposphere/EMR_Cluster uses undocumented AWS::EMR::... |
"""Tests for assess_endpoint_bindings module."""
import logging
from mock import (
Mock,
patch,
)
import os
import StringIO
from assess_endpoint_bindings import (
bootstrap_and_test,
create_test_charms,
ensure_spaces,
parse_args,
machine_spaces_for_bundle,
main,
)
from jujupy.clien... |
import numpy as np
import matplotlib.pyplot as plt
import gym
import time
import copy
from keras.models import Sequential, Model
from keras.layers import Dense, Activation, Flatten, Lambda, Input, Reshape, concatenate, Merge
from keras.optimizers import Adam, RMSprop
from keras.callbacks import History
from keras imp... |
# encoding: utf-8
"""
A base Application class for Jupyter applications.
All Jupyter applications should inherit from this.
"""
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
from __future__ import print_function
from copy import deepcopy
import logging
import o... |
import boto3
from decEncoder import *
from fuzzywuzzy import fuzz
from DynamoTable import *
def handler(event, context):
"""Scan dynamo table"""
buildingTable = DynamoTable('Buildings')
return getBuildings(event, buildingTable)
"""Lambda handler function for /buildings API call
Returns all the building... |
from androguard.core.bytecodes.apk import APK
from androguard.core.bytecodes.dvm import DalvikVMFormat
from androguard.core.analysis.analysis import Analysis
from androguard.decompiler.dad.decompile import DvMethod
import logging
import traceback
import sys
import os
"""
This is a script to call several functions on ... |
# /usr/bin/python
'''
Based on
Representing a chess set in Python
Part 2
Brendan Scott
https://python4kids.brendanscott.com/2013/04/28/a-different-view-on-our-chess-model/
'''
import Tkinter as tk
from Tkinter import PhotoImage
import os.path
import os
# column_reference = "1 2 3 4 5 6 7 8".split(" ")
column_refere... |
import server
import unittest
import requests
from unittest.mock import MagicMock, ANY, patch
from flask import json
from gif2html5.config_parser import get_config
from gif2html5.s3_manager import S3Manager
from tests.test_context import TestContext
class JsonPayloadAttachmentIdMatcher(object):
def __init__(sel... |
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2015 ADHOC SA (http://www.adhoc.com.ar)
# All Rights Reserved.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Pu... |
import os
import unittest
import re
import intent
from intent.alignment.Alignment import Alignment
from intent.igt.rgxigt import RGWordTier
from intent.scripts.basic.corpus_stats import pos_stats, CONLL_TYPE
from intent.trees import IdTree, project_ps, TreeMergeError, DepTree, Terminal, TreeError, project_ds, get_dep_... |
#
# 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 "License"); you may not us... |
# Copyright (c) 2007 Ruben Reifenberg
#
# 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 without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, d... |
#!/usr/bin/env python
#
# hardware.py - OVFHardware class
#
# June 2016, Glenn F. Matthews
# Copyright (c) 2013-2016, 2019 the COT project developers.
# See the COPYRIGHT.txt file at the top-level directory of this distribution
# and at https://github.com/glennmatthews/cot/blob/master/COPYRIGHT.txt.
#
# This file is pa... |
# -*- coding: utf-8 -*-
"""Copyright (C) 2009,2010 Wolfgang Rohdewald <wolfgang@rohdewald.de>
kajongg is free software you can redistribute it and/or modifys
it under the terms of the GNU General Public License as published by
the Free Software Foundation either version 2 of the License, or
(at your option) any later... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations, connections
def create_views(apps, schema_editor):
connection = connections['trac']
cursor = connection.cursor()
# revision_view
cursor.execute('''
CREATE OR REPLACE VIEW revision_view ... |
import StringIO
import bottle
import base64
import vision_definitions
from PIL import Image
from bottle import view, static_file, auth_basic
from naoqi import ALProxy
from NaoService import check_auth
app = bottle.Bottle()
name = 'NaoStreamModule'
path = '/stream'
sub = ['/image_latest/1', '/image_stream... |
# Copyright 2018 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 applicab... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('lizard_efcis', '0066_auto_20150821_1131'),
]
operations = [
migrations.AlterField(
model_name='importmapping',
... |
"""Exceptions used throughout package"""
from __future__ import absolute_import
class PipError(Exception):
"""Base pip exception"""
class InstallationError(PipError):
"""General exception during installation"""
class UninstallationError(PipError):
"""General exception during uninstallation"""
class ... |
# -*- coding: utf-8 -*-
# This file is part of Shuup.
#
# Copyright (c) 2012-2019, Shoop Commerce Ltd. All rights reserved.
#
# This source code is licensed under the OSL-3.0 license found in the
# LICENSE file in the root directory of this source tree.
import hashlib
import logging
import os
from datetime import datet... |
import logging
from pyvisdk.exceptions import InvalidArgumentError
########################################
# Automatically generated, do not edit.
########################################
log = logging.getLogger(__name__)
def CustomizationCustomIpGenerator(vim, *args, **kwargs):
'''Use a command-line program c... |
import copy
from random import randint
from chromosome import Chromosome
from config import GAConfig as config
'''
fileName: Mating.py
Authors: Jacob Krantz, Max Dulin
Date Modified: 9/7/17
Contains the workings for mating together the population.
- retains the top 50% fit chromosomes and removes the ... |
import pickle
import datetime
import numpy as np
from skopt.space import Real, Integer, Categorical, Dimension, Identity
from skopt.utils import use_named_args
from skopt import gp_minimize
from skopt import dump, load
# Requires the latest version:
# pip3 install git+https://github.com/scikit-optimize/scikit-optimize... |
from model.contact import Contact
import random
import string
import os.path
import jsonpickle
import getopt
import sys
try:
opts, args = getopt.getopt(sys.argv[1:], "n:f:", ["number of contacts", 'file'])
except getopt.GetoptError as err:
getopt.usage()
sys.exit(2)
n = 5
f = "data/contacts.json"
for o, ... |
from PyQt4 import QtCore
from qgis.core import *
from geoserverexplorer.qgis import layers as qgislayers
from geoserverexplorer.qgis.catalog import CatalogWrapper
from geoserverexplorer.gui.confirm import publishLayer
from geoserverexplorer.gui.dialogs.projectdialog import PublishProjectDialog
from geoserver.catalog im... |
# ----------------------------------------------------------------------
# Copyright (c) 2009 Tristam MacDonald
# 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... |
"""
QUESTION:
One way to serialize a binary tree is to use pre-oder traversal. When we encounter a non-null node, we record the
node's value. If it is a null node, we record using a sentinel value such as #.
_9_
/ \
3 2
/ \ / \
4 1 # 6
/ \ / \ / \
# # # # # #
For example, the above binar... |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
"""
To convert from mdeg to molar elipticity (deg*cm2*dmol-1):
m.e. = mdeg / (10*l*(C/MW)*Rn)
where
l = light path in cm
C = concentration in mg/ml
MW = molecular weight
Rn = number of residue of the protein
"""
import pygtk
pygtk.require("2.0")
import gtk
import gobject... |
import numpy as np
import bpy
from bpy.props import FloatProperty, EnumProperty, BoolProperty, IntProperty
from mathutils import Matrix
from mathutils.kdtree import KDTree
import sverchok
from sverchok.node_tree import SverchCustomTreeNode
from sverchok.data_structure import updateNode, zip_long_repeat, ensure_nestin... |
# -*-coding:Utf-8 -*
# Copyright (c) 2010 LE GOFF Vincent
# 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
# lis... |
import re
#import sys
#import getopt
#import glob
import string
from cxxtest_misc import *
# Global variables
suites = []
suite = None
inBlock = 0
options=None
def scanInputFiles(files, _options):
'''Scan all input files for test suites'''
global options
options=_options
for file in files:
sca... |
""" Utility functions used in writing files"""
import filecmp
import logging
import os
import tempfile
logger = logging.getLogger(__name__)
def make_dir_for(file_path):
"""makes directories for file_path if they don't already exist"""
directory = os.path.dirname(file_path)
if directory != "":
os... |
import pytest
from pynamodb.attributes import DiscriminatorAttribute
from pynamodb.attributes import DynamicMapAttribute
from pynamodb.attributes import ListAttribute
from pynamodb.attributes import MapAttribute
from pynamodb.attributes import NumberAttribute
from pynamodb.attributes import UnicodeAttribute
from pynam... |
from __future__ import print_function, division, absolute_import, unicode_literals
from fontTools.misc.py23 import *
from fontTools import ttLib
from .woff2 import (WOFF2Reader, woff2DirectorySize, woff2DirectoryFormat,
woff2FlagsSize, woff2UnknownTagSize, woff2Base128MaxSize, WOFF2DirectoryEntry,
getKnownTagIndex, p... |
# usage:
# findfonts.py -d <directory> -f [font1] -f [font2] ....
#
# <directory> is a folder, with subfolders, containing .svg files. In each svg file in the directory or its children
# look for fonts that aren't in the list
import getopt, sys, os, re
def usage():
print """
usage:
droid.py ... |
#!/usr/bin/env python
# -*- test-case-name: calendarserver.tools.test.test_agent -*-
##
# Copyright (c) 2013-2017 Apple 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 ... |
import unittest
import mock
import wiremockmanager.wmm as wmm
from wiremockmanager.workspace import WorkspaceError
from wiremockmanager.wiremock import WireMockError
class WmmMockTest(unittest.TestCase):
def _setup_mocks(self, workspace_mock, wiremock_mock):
# mock methods
workspace_mock.is_valid... |
#!/usr/bin/env python
from __future__ import print_function
import sys
from os import path, getenv
from time import sleep
# if PAPARAZZI_SRC not set, then assume the tree containing this
# file is a reasonable substitute
PPRZ_SRC = getenv("PAPARAZZI_SRC", path.normpath(path.join(path.dirname(path.abspath(__file__)),... |
# -*- coding: utf-8 -*-
"""
:copyright: (c) 2011 by Tobias Heinzen
:license: BSD, see LICENSE for more details
"""
import time
html_escape_table = {
"&": "&",
'"': """,
"'": "'",
">": ">",
"<": "<",
}
def force_unicode(txt):
try:
return unicode(txt)
ex... |
#!/usr/bin/env python
import os
import sys
# Conditional import to ensure we can run without non-stdlib on py2k.
if sys.version_info.major > 2:
from builtins import str
from builtins import zip
from builtins import object
import json
import subprocess
import logging
from cargoport.utils import (package_to_... |
from toee import *
def OnBeginSpellCast( spell ):
print "Frozen Breath OnBeginSpellCast"
print "spell.target_list=", spell.target_list
print "spell.caster=", spell.caster, " caster.level= ", spell.caster_level
game.particles( "sp-evocation-conjure", spell.caster )
def OnSpellEffect ( spell ):
print "Frozen Breat... |
import sys, os
import subprocess
import re
import select
"""
Runs an instance of make, echoing the stdout and storing the stderr
line by line.
"""
def run_make(args):
p = subprocess.Popen(["make"] + args,
stdout = subprocess.PIPE, stderr = subprocess.PIPE)
stderr = []
while p.poll() == None:
reads = [p.s... |
# Copyright (C) 2015 Red Hat, Inc.
# 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 2 of the License, or
# (at your option) any later version.
# This program is distributed in th... |
# Copyright 2015 PLUMgrid, 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 required by ... |
from os import path, walk, close, unlink
from tempfile import mkstemp
import shutil
from docstash import util
from docstash.document import Document
class Collection(object):
def __init__(self, stash, name):
self.stash = stash
self.name = name
@property
def path(self):
return pa... |
import random
class Transport:
def __init__(self, name, speed = 0, wheel_count = 0, mass = 0, color = (0,0,0)):
self.name = name
self.speed = speed
self.wheel_count = wheel_count
self.mass = mass
self.color = color
self.pos = 0
def drive(self, time):
self.pos += self.speed * time
#return self.po... |
#!/usr/bin/env python
# Copyright (c) 2014 The Diamond Core developers
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
# Base class for RPC testing
# Add python-diamondrpc to module search path:
import os
import sys
sys.path.... |
#!/usr/bin/env python3
##############################################################################
# HPCC SYSTEMS software Copyright (C) 2015 HPCC Systems.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtai... |
'''
Copyright 2014 Travel Modelling Group, Department of Civil Engineering, University of Toronto
This file is part of the TMG Toolbox.
The TMG Toolbox 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 Fou... |
import settings
from django import template
from django.contrib.comments.templatetags.comments import BaseCommentNode, CommentFormNode
register = template.Library()
DEFAULT_UNAUTH_COMMENT_MESSAGE = getattr(settings, 'DEFAULT_UNAUTH_COMMENT_MESSAGE', None) or \
"""<p>Please register/si... |
###############################################################################
#
# file: constants.py
#
# Purpose: refer to module documentation for details
#
# Note: This file is part of Termsaver-Example plugin, and should not be
# used or executed separately.
#
###################################... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.