text
stringlengths
475
200k
# 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...
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # 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. E Y' TIME_FORMAT = 'G:i' DATET...
# Copyright 2012 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 -*- from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( ExtractorError, compat_parse_qs, compat_urllib_request, ) class ScreencastIE(InfoExtractor): _VALID_URL = r'https?://www\.screencast\.com/t/(?P<id>[a-zA-Z0-9]+)' _TES...
""" Rdio OAuth1 and OAuth2 backends, docs at: http://psa.matiasaguirre.net/docs/backends/rdio.html """ from social.backends.oauth import BaseOAuth1, BaseOAuth2, OAuthAuth RDIO_API = 'https://www.rdio.com/api/1/' class BaseRdio(OAuthAuth): ID_KEY = 'key' def get_user_details(self, response): ful...
# # 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 u...
import pygame as gameapi import pygame.midi as piano import sys, random import pygame.locals as apiVar gameapi.init() fpsClock = gameapi.time.Clock() windowSurfaceObj = gameapi.display.set_mode((640, 480)) gameapi.display.set_caption('set_caption') redColor = gameapi.Color(255,0,0) greenColor = gameapi.Color(0,255,0...
from a10sdk.common.A10BaseClass import A10BaseClass class Host(A10BaseClass): """Class Description:: Set remote syslog host DNS name or ip address. Class host supports CRUD Operations and inherits from `common/A10BaseClass`. This class is the `"PARENT"` class for this module.` :param ipv6ad...
# Copyright (c) 2014-2016 Moxie Marlinspike, Marcello Salvati # # 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. # # This...
# Software License Agreement (BSD License) # # Copyright (c) 2011, Willow Garage, Inc. # 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 ...
''' Created on 19/2/2015 @author: PC29 ''' from app import app from ec.edu.itsae.dao import PersonaDAO from flask import render_template, request, redirect, url_for @app.route("/mainPersona") def personamain(): objR=PersonaDAO.PersonaDAO().reportarPersona() return render_template("prueba.html"...
from mapproxy import grid as mapproxy_grid from eventkit_cloud.tasks.models import ExportRun import logging import json import math logger = logging.getLogger(__name__) _dbg_geom_cache_misses = 0 def _create_cache_geom_entry(job): """ Constructs a geometry cache entry :param job: job contains the geomet...
# -*- coding: utf-8 -*- # Copyright (C) 2008-2013 Team XBMC # # 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. ...
# # Copyright © 2012 - 2021 Michal Čihař <[EMAIL]> # # This file is part of Weblate <https://weblate.org/> # # 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 #...
# -*- coding: utf-8 -*- #----------------------------------------------------------------------------- # Copyright (c) 2011, Evan Leis # # Distributed under the terms of the Lesser GNU General Public License (LGPL) #----------------------------------------------------------------------------- ''' Created on May 5, 2011...
"""Test cltk.morphology.""" import unittest from cltk.core.exceptions import CLTKException from cltk.morphology.lat import CollatinusDecliner class TestMorphology(unittest.TestCase): def test_collatinus_decline(self): """ Ensure lemmatization works well """ decliner = CollatinusDeclin...
# -*- coding: utf-8 -*- """ pythoncompat """ from .packages import chardet import sys # ------- # Pythons # ------- # Syntax sugar. _ver = sys.version_info #: Python 2.x? is_py2 = (_ver[0] == 2) #: Python 3.x? is_py3 = (_ver[0] == 3) try: import simplejson as json except (ImportError, SyntaxError): # si...
from ROOT import TCanvas, TF1, TPaveLabel, TPad, TText from ROOT import gROOT nut = TCanvas( 'nut', 'FirstSession', 100, 10, 700, 900 ) nut.Range( 0, 0, 20, 24 ) nut.SetFillColor( 10 ) nut.SetBorderSize( 2 ) pl = TPaveLabel( 3, 22, 17, 23.7, 'My first PyROOT interactive session', 'br' ) pl.SetFillColor( 18 ) pl.Draw...
# PermWrapper and PermLookupDict proxy the permissions system into objects that # the template system can understand. class PermLookupDict: def __init__(self, user, app_label): self.user, self.app_label = user, app_label def __repr__(self): return str(self.user.get_all_permissions()) def...
# 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 applica...
# Copyright (c) 2012 ARM Limited # All rights reserved. # # The license below extends only to copyright in the software and shall # not be construed as granting a license to any other intellectual # property including but not limited to intellectual property relating # to a hardware implementation of the functionality ...
# -*- coding: utf-8 -*- """Tools for working with groups This provides several functions to work with groups and a Group class that keeps track of the different representations and has methods to work more easily with groups. Author: Josef Perktold, Author: Nathaniel Smith, recipe for sparse_dummies on scipy user ma...
# Copyright 2015 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.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, so...
# -*- coding: utf-8 -*- """ sockjs.tornado.transports.jsonp ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ JSONP transport implementation. """ import logging from tornado.web import asynchronous from sockjs.tornado import proto from sockjs.tornado.transports import pollingbase from sockjs.tornado.util import bytes_to_s...
# Copyright (C) 2014 Andrey Antukh <[EMAIL]> # Copyright (C) 2014 Jesús Espino <[EMAIL]> # Copyright (C) 2014 David Barragán <[EMAIL]> # This program 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, eith...
#!/usr/bin/env vpython # # [VPYTHON:BEGIN] # wheel: < # name: "infra/python/wheels/freetype-py/${vpython_platform}" # version: "version:2.1.0.post1" # > # [VPYTHON:END] # Copyright 2019 The ANGLE Project Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found ...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations from django.conf import settings import django_extensions.db.fields class Migration(migrations.Migration): dependencies = [ ('jury', '__first__'), migrations.swappable_dependency(settings.AUT...
"""Utilities for fast persistence of big data, with optional compression.""" # Author: Gael Varoquaux <gael dot varoquaux at normalesup dot org> # Copyright (c) 2009 Gael Varoquaux # License: BSD Style, 3 clauses. import pickle import os import sys import warnings try: from pathlib import Path except ImportError:...
from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( int_or_none, parse_duration, remove_end, xpath_element, xpath_text, ) class DigitallySpeakingIE(InfoExtractor): _VALID_URL = r'https?://(?:s?evt\.dispeak|events\.digitallyspeaking)\.com/...
## # Copyright 2014-2015 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), # with support of Ghent University (http://ugent.be/hpc), # the Flemish Supercomputer Centre (VSC) (https://www.vscentrum.be), # the Hercules foundation (http:...
# Copyright 2013 Hardcoded Software (http://www.hardcoded.net) # This software is licensed under the "BSD" License as described in the "LICENSE" file, # which should be included with this package. The terms are also available at # http://www.hardcoded.net/licenses/bsd_license from __future__ import unicode_literals ...
# -*- coding: utf-8 -*- # Requires Python 2.7 or later from __future__ import with_statement from __future__ import unicode_literals import codecs, ctypes, os, sys, unittest if sys.platform == "win32": import XiteWin as Xite else: import XiteQt as Xite class TestSimple(unittest.TestCase): def setUp(self): sel...
# coding=utf-8 import os from lxml import etree from django.test import TestCase from corehq.apps.app_manager.models import Application from corehq.apps.app_manager.tests.util import SuiteMixin from corehq.apps.app_manager.translations import escape_output_value import commcare_translations class AppManagerTransla...
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor from ..utils import ( parse_duration, int_or_none, determine_protocol, ) class SWRMediathekIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?swrmediathek\.de/(?:content/)?player\.htm\?show=(?P<id>[\da-f]{8}-[...
"""The tests for the REST sensor platform.""" import unittest from pytest import raises from unittest.mock import patch, Mock import requests from requests.exceptions import Timeout, MissingSchema, RequestException import requests_mock from homeassistant.exceptions import PlatformNotReady from homeassistant.setup imp...
# -*- coding: UTF-8 -*- ## Copyright 2011-2013 Luc Saffre ## This file is part of the Lino project. ## Lino 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 y...
#--------------------------------------------------------------------------- # Copyright 2012-2019 The Open Source Electronic Health Record Alliance # # 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...
# -*- test-case-name: twisted.web.test.test_domhelpers -*- # Copyright (c) 2001-2009 Twisted Matrix Laboratories. # See LICENSE for details. """ Specific tests for (some of) the methods in L{twisted.web.domhelpers}. """ from xml.dom import minidom from twisted.trial.unittest import TestCase from twisted.web import ...
"""Implementation of JSONEncoder """ import re try: from _json import encode_basestring_ascii as c_encode_basestring_ascii except ImportError: c_encode_basestring_ascii = None try: from _json import make_encoder as c_make_encoder except ImportError: c_make_encoder = None ESCAPE = re.compile(r'[\x00-\x...
# mysql/mysqlconnector.py # Copyright (C) 2005-2015 the SQLAlchemy authors and contributors # <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """ .. dialect:: mysql+mysqlconnector :name: MySQL Connector/Python ...
import warnings from eventsourcing.domain.model.entity import EventSourcedEntity from eventsourcing.domain.model.entity import entity_mutator from eventsourcing.domain.model.entity import singledispatch from eventsourcing.domain.model.decorators import subscribe_to from eventsourcing.domain.model.events import publish...
import copy import csv import os class Gate: def __init__(self, Sockets): self.Sockets = Sockets self.Inputs = [] self.UniqueInputs = "" def canPass(self): return(True) def getInput(self, I): if( (type(I) == Input) & (I.sym().casefold() not ...
""" ======================================== Comparison of Calibration of Classifiers ======================================== Well calibrated classifiers are probabilistic classifiers for which the output of the predict_proba method can be directly interpreted as a confidence level. For instance a well calibrated (bi...
from twisted.web import client from twisted.internet import reactor, defer from twisted.python import failure class HTTPProgressDownloader(client.HTTPDownloader): def __init__(self, url, outfile, headers=None): client.HTTPDownloader.__init__(self, url, outfile, headers=headers, agent="STB_BOX HTTP Downloader") se...
# Copyright (C) 2003-2017 Nominum, Inc. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose with or without fee is hereby granted, # provided that the above copyright notice and this permission notice # appear in all copies. # # THE SOFTWARE IS PROVIDED "AS IS" AND ...
# -*- coding: utf-8 -*- ######################################################################### # # Copyright (C) 2016 OSGeo # # 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 ...
# Class for reading .emd file by Velox. # This code was written based on FormatSER.py from https://github.com/cctbx/dxtbx/blob/master/format/FormatSER.py from __future__ import absolute_import, division, print_function import struct import h5py import numpy import os import json from scitbx.array_family import flex f...
"""test_scenarios.py End-end-end tests for the Harvester. """ import sys import os import RDF from glharvest import jobs, registry, void def test_can_update_a_provider_with_a_new_resource(repository): """This test tests the case where a provider gives informationa about one resource at time t0 then, at tim...
"""Event Decorators for custom components.""" import functools import logging # pylint: disable=unused-import from typing import Optional # NOQA from homeassistant.core import HomeAssistant # NOQA from homeassistant.helpers import event HASS = None # type: Optional[HomeAssistant] _LOGGER = logging.getLogger(__nam...
# 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. """Defines a set of constants shared by test runners and other scripts.""" import os import subprocess import sys DIR_SOURCE_ROOT = os.path.abspath(os...
# 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 u...
# Nomenclature # Copyright (C) 2015 BOUVIN Valentin, HONNORATY Vincent, LEVY-FALK Hugo # 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 opti...
# dialog.py -- Tkinter interface to the tk_dialog script. from Tkinter import * from Tkinter import _cnfmerge if TkVersion <= 3.6: DIALOG_ICON = 'warning' else: DIALOG_ICON = 'questhead' class Dialog(Widget): def __init__(self, master=None, cnf={}, **kw): cnf = _cnfmerge((cnf, kw)) self....
#!/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 # "L...
import os BASE_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__))) # Quick-start development settings - unsuitable for production # See https://docs.djangoproject.com/en/1.6/howto/deployment/checklist/ # SECURITY WARNING: keep the secret key used in production secret! SECRET_KEY = '))%*y#of%4cnju5=$-1sab!k...
def main(request, response): import simplejson as json f = file('config.json') source = f.read() s = json.JSONDecoder().decode(source) url1 = "http://" + s['host'] + ":" + str(s['ports']['http'][1]) url2 = "http://" + s['host'] + ":" + str(s['ports']['http'][0]) _CSP = "object-src " + url2 +...
# -*- coding: utf-8 -*- # Generated by Django 1.10.8 on 2018-04-24 15:15 from __future__ import unicode_literals from django.db import migrations, models def populate_thesis_providers(apps, schema_editor): ThesisProvider = apps.get_model("erudit", "ThesisProvider") Collection = apps.get_model("erudit", "Coll...
# -*- coding: utf-8 -*- # ########################## Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques <[EMAIL]> # # Copyright 2012 Zearin <[EMAIL]> #...
from django.forms import CheckboxSelectMultiple from .base import WidgetTest class CheckboxSelectMultipleTest(WidgetTest): widget = CheckboxSelectMultiple def test_render_value(self): self.check_html(self.widget(choices=self.beatles), 'beatles', ['J'], html=( """<ul> <li><lab...
"""Decorators for API access management.""" from functools import wraps from django.core.urlresolvers import reverse from django.http import HttpResponseNotFound from django.shortcuts import redirect from openedx.core.djangoapps.api_admin.models import ApiAccessRequest, ApiAccessConfig def api_access_enabled_or_404...
""" Tests for the gating API """ import unittest import six from completion.models import BlockCompletion from ddt import data, ddt, unpack from django.conf import settings from milestones import api as milestones_api from milestones.tests.utils import MilestonesTestCaseMixin from mock import Mock, patch from lms.d...
#!/usr/bin/env python # -*- coding: utf-8 -*- class PodiumVenue(object): """ Object that represents a Venue. **Attributes:** **venue_id** (int): Venue Id **uri** (string): URI for the Venue. **name** (string): The Venue's name. """ def __init__(self, venue_i...
# Copyright (C) 2010 Google Inc. 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 conditions and th...
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (c) 2010 Camptocamp SA (http://www.camptocamp.com) # All Right Reserved # # Author : Nicolas Bessi (Camptocamp) # # WARNING: This program as such is intended to be used by professional # programmers who...
# 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 ...
# Copyright (C) 2011 Canonical # # Authors: # Matthew McGowan # Michael Vogt # # 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; version 3. # # This program is distributed in the hope that it wi...
#!/usr/bin/env python #coding:utf-8 from toughradius.tools.secret import gen_secret def echo_radiusd_cnf(): return '''[DEFAULT] debug = 0 tz = CST-8 secret = %s ssl = 1 privatekey = /var/toughradius/privkey.pem certificate = /var/toughradius/cacert.pem [database] dbtype = mysql dburl = mysql://radiusd:[EMAIL]/tou...
# Sketch - A Python-based interactive drawing program # Copyright (C) 1998, 1999, 2000, 2002 by Bernhard Herzog # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of th...
# -*- coding: utf-8 -*- ############################################################################### # # XMLToXLS # Converts an XML file to a Base64 encoded Excel file. # # Python versions 2.6, 2.7, 3.x # # Copyright 2014, Temboo Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not...
from unittest import TestCase import simplejson as json # Fri Dec 30 18:57:26 2005 JSONDOCS = [ # http://json.org/JSON_checker/test/fail1.json '"A JSON payload should be an object or array, not a string."', # http://json.org/JSON_checker/test/fail2.json '["Unclosed array"', # http://json.org/JSON_...
import WebIDL def WebIDLTest(parser, harness): def checkArgument(argument, QName, name, type, optional, variadic): harness.ok(isinstance(argument, WebIDL.IDLArgument), "Should be an IDLArgument") harness.check(argument.identifier.QName(), QName, "Argument has the right QName") ...
# -*- coding: utf-8 -*- ############################################################################## # This file is part of account_invoice_shipping_address, an Odoo module. # # Copyright (c) 2015 ACSONE SA/NV (<http://acsone.eu>) # # account_invoice_line_sort is free software: you can redistribute it # ...
import pytest import uqbar.strings import supriya def test_do_not_coerce_arguments(): synth = supriya.realtime.Synth() group = supriya.realtime.Group() assert synth.node_id is None assert group.node_id is None request = supriya.commands.SynthNewRequest( node_id=synth, synthdef=synth.synth...
# Copyright 2012 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...
from __future__ import absolute_import, division, unicode_literals import os import sys import traceback import warnings import re warnings.simplefilter("error") from .support import get_data_files from .support import TestData, convert, convertExpected, treeTypes from html5lib import html5parser, constants # Run t...
from __future__ import division from io import BytesIO import math import numpy from PIL import Image from six import PY3 try: from ._image import window_batch_bchw window_batch_bchw_available = True except ImportError: window_batch_bchw_available = False from . import ExpectsAxisLabels, SourcewiseTransfo...
# $Id$ # # Copyright (C) 2006 Greg Landrum # # @@ All Rights Reserved @@ # This file is part of the RDKit. # The contents are covered by the terms of the BSD license # which is included in the file license.txt, found at the root # of the RDKit source tree. # from rdkit import Geometry from rdkit.Chem.FeatMaps imp...
"""A module proxy for delayed importing of modules. From http://barnesc.blogspot.com/2006/06/automatic-python-imports-with-autoimp.html, in the public domain. """ import sys class LazyModule(object): """A lazy module proxy.""" def __init__(self, modname): self.__dict__['__name__'] = modname ...
from django.contrib.gis import feeds from django.contrib.gis.tests.utils import mysql from models import City, Country class TestGeoRSS1(feeds.Feed): link = '/city/' title = 'Test GeoDjango Cities' def items(self): return City.objects.all() def item_link(self, item): return '/city/%s/...
# 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 use ...
""" This command exports a course from CMS to a git repository. It takes as arguments the course id to export (i.e MITx/999/2020 ) and the repository to commit too. It takes username as an option for identifying the commit, as well as a directory path to place the git repository. By default it will use settings.GIT_R...
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (c) 2012-TODAY OpenERP S.A. <http://openerp.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of ...
import asyncio import datetime import logging from contextlib import suppress from aiohttp import web logger = logging.getLogger(__file__) class Periodic: def __init__(self, func, time): self.func = func self.time = time self.is_started = False self._task = None async def st...
""" Common terminal messages used across Empire. Titles, agent displays, listener displays, etc. """ import os import time import textwrap # Empire imports import helpers ############################################################### # # Messages # ###############################################################...
# # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 The SCons Foundation # # 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 li...
# Copyright 2016 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 os, sys import random import time import feedparser import itertools import HTMLParser from feed import Feed if os.getcwd().rstrip(os.sep).endswith('feeds'): os.chdir('..') sys.path.insert(0, os.getcwd()) from gui_client import new_rpc import web import reddit class RSSFeed(Feed): def __init__(se...
"""Tests for functions in special_matrices.py.""" from __future__ import division, print_function, absolute_import import numpy as np from numpy import arange, add, array, eye, copy, sqrt from numpy.testing import (TestCase, run_module_suite, assert_raises, assert_equal, assert_array_equal, assert_array_almost_eq...
#!/usr/bin/python # 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 later version. # # Ansible is distributed...
# -*- coding: utf-8 -*- """ The MIT License (MIT) Copyright (c) 2015-2016 Rapptz 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 u...
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2013, Hiroaki Nakamura <[EMAIL]> # # 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, o...
# Copyright 2013 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. class Verifier: """Verifies that the current machine states match the expectation.""" def VerifyInput(self, verifier_input, variable_expander): """...
#!/usr/bin/env python # Copyright (c) 2014 Intel Corporation. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import re from collections import OrderedDict from string import Template def ConvertClassExpressionToClassType(class_name): """ ...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models from django.conf import settings class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ('contenttypes', '0002_remove_content_type_...
import os from datetime import datetime from disco.test import TestCase from disco.util import flatten, iterify, urlsplit def function(x): return x + 0 sequence = 0, [1, [2, 3], [[4, [5, [6]]]]] class UtilTestCase(TestCase): def test_flatten(self): self.assertEquals(list(range(7)), list(flatten(sequ...
class Vocab: def __init__(self, vocabFile=None): self.nextId = 1 self.word2id = {} self.id2word = {} if vocabFile: for line in open(vocabFile): line = line.rstrip('\n') (word, wid) = line.split('\t') self.word2id[word] = int...
# coding: utf-8 # # Copyright 2014 The Oppia 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 requi...
from basetest import BaseToscaTest from core.models import Instance, Slice class ComputeTest(BaseToscaTest): tests = [ # "create_compute_m1_tiny", XXX m1.tiny does not exist on cloudlab "create_compute_m1_small", "create_compute_m1_large_8192MB", "create_compute_m1_large_8GB...
from jsonrpc import ServiceProxy import sys import string # ===== BEGIN USER SETTINGS ===== # if you do not set these you will be prompted for a password for every command rpcuser = "" rpcpass = "" # ====== END USER SETTINGS ====== if rpcpass == "": access = ServiceProxy("http://127.0.0.1:8332") else: access = Ser...
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Tests for L{twisted.web.static}. """ import inspect import mimetypes import os import re import StringIO from zope.interface.verify import verifyObject from twisted.internet import abstract, interfaces from twisted.python.runtime import plat...