text
stringlengths
475
200k
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2013, Chatham Financial <[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, ...
# 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/. import os import re import subprocess from .. import vcs from ..vcs import bind_to_repo, git, hg def get_unique_name(...
# ---------------------------------------------------------------------------- # Copyright 2014 Nervana Systems 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.o...
from __future__ import unicode_literals from django.contrib.auth.views import logout from django.core.urlresolvers import NoReverseMatch, reverse_lazy from django.shortcuts import resolve_url from django.test import SimpleTestCase, ignore_warnings, override_settings from django.utils import six from django.utils.depre...
#!/usr/bin/python try: from PyQt4 import QtCore, QtGui QtCore.Signal = QtCore.pyqtSignal QtCore.Slot = QtCore.pyqtSlot except ImportError: try: from PySide import QtCore, QtGui QtCore.QString = str except ImportError: raise ImportError("Cannot load either PyQt or PySide") ...
import data_utils import pandas as pd import numpy as np import tensorflow as tf import math, random, itertools import pickle import time import json import os import math import data_utils import pickle from sklearn.ensemble import RandomForestClassifier from sklearn.metrics import accuracy_score, precision_score, rec...
""" Python-Markdown Extra Extension =============================== A compilation of various Python-Markdown extensions that imitates [PHP Markdown Extra](http://michelf.com/projects/php-markdown/extra/). Note that each of the individual extensions still need to be available on your PYTHONPATH. This extension simply ...
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'CarouselItem.button_title' db.add_column(u'cmsplugin_boot...
# -*- coding: utf-8 -*- # # Copyright (c) 2017, 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 import re try: from library.module_utils.network.f5.common import F5M...
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is mozilla.org code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights Reserved. # # Con...
# -*- coding: utf-8 -*- """ Lift ckernels to their appropriate rank so they always consume the full array arguments. """ from __future__ import absolute_import, division, print_function from pykit.ir import transform, Op #------------------------------------------------------------------------ # Run #--------------...
# Copyright (c) 2013 Intel, Inc. # Copyright (c) 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/li...
# -*- 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...
# -*- coding: utf-8 -*- # #START_LICENSE########################################################### # # # This file is part of the Environment for Tree Exploration program # (ETE). http://etetoolkit.org # # ETE is free software: you can redistribute it and/or modify it # under the terms of the GNU General Public Licen...
fname=r'h:\tmp.txt' import win32security,win32file,win32api,ntsecuritycon,win32con new_privs = ((win32security.LookupPrivilegeValue('',ntsecuritycon.SE_SECURITY_NAME),win32con.SE_PRIVILEGE_ENABLED), (win32security.LookupPrivilegeValue('',ntsecuritycon.SE_SHUTDOWN_NAME),win32con.SE_PRIVILEGE_ENABLED), ...
# 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. """Top-level presubmit script for Chromium media component. See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts for more details abo...
#!/usr/bin/env python import re, sys, operator, Queue, threading # Two data spaces word_space = Queue.Queue() freq_space = Queue.Queue() stopwords = set(open('../stop_words.txt').read().split(',')) # Worker function that consumes words from the word space # and sends partial results to the frequency space def proces...
# 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 required by applicable law or a...
from __future__ import absolute_import from . import backend as K class Regularizer(object): def set_param(self, p): self.p = p def set_layer(self, layer): self.layer = layer def __call__(self, loss): return loss def get_config(self): return {'name': self.__class__._...
from django.contrib.auth import authenticate from django.contrib.auth.models import User from django.contrib.auth.tokens import PasswordResetTokenGenerator from django.contrib.auth.views import ( password_change, password_change_done, password_reset, password_reset_complete, password_reset_confirm, password_res...
""" Blind Source Separation using the Jade Algorithm with Shogun Based on the example from scikit-learn http://scikit-learn.org/ Kevin Hughes 2013 """ import numpy as np import pylab as pl from modshogun import RealFeatures from modshogun import Jade # Generate sample data np.random.seed(0) n_samples = 2000 time...
# -*- coding: utf-8 -*- # (C) 2015, 2016 Daniel Lobato <[EMAIL]> # 2016 Guido Günther <[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...
#!/usr/bin/env python """ mbed Copyright (c) 2017-2017 ARM Limited Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicab...
from __future__ import absolute_import from operator import attrgetter import sys import os import shlex from six import StringIO from mock import patch from .testcases import DockerClientTestCase from compose.cli.main import TopLevelCommand from compose.project import NoSuchService class CLITestCase(DockerClientTe...
"""Support for Meteo-France weather data.""" import datetime import logging import voluptuous as vol from homeassistant.const import CONF_MONITORED_CONDITIONS, TEMP_CELSIUS import homeassistant.helpers.config_validation as cv from homeassistant.helpers.discovery import load_platform from homeassistant.util import Thr...
#!/usr/bin/env python # -*- encoding: utf-8 -*- # vim: set et sw=4 ts=4 sts=4 ff=unix fenc=utf8: # Author: Binux<[EMAIL]> # http://binux.me # Created on 2014-02-08 22:37:13 from __future__ import unicode_literals, division import os import six import time import unittest2 as unittest from pyspider import dat...
# 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 required by applicable ...
#!/usr/bin/env python from setuptools import setup, find_packages from nodeshot import get_version def get_install_requires(): """ parse requirements.txt, ignore links, exclude comments """ requirements = [] for line in open('requirements.txt').readlines(): # skip to next iteration if comm...
# Copyright 2015 Cloudbase Solutions Srl # 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 r...
# 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 -*- # Copyright (C) 2006-2007 Søren Roug, European Environment Agency # # This library 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; either # version 2.1 of the License, or (at you...
# -*- coding: utf-8 -*- """ ************ Vertex Cover ************ Given an undirected graph `G = (V, E)` and a function w assigning nonnegative weights to its vertices, find a minimum weight subset of V such that each edge in E is incident to at least one vertex in the subset. http://en.wikipedia.org/wiki/Vertex_cov...
""" Provide a mock light platform. Call init before using it in your tests to ensure clean test data. """ from homeassistant.components.light import LightEntity from homeassistant.const import STATE_OFF, STATE_ON from tests.common import MockToggleEntity ENTITIES = [] def init(empty=False): """Initialize the p...
import asyncio import discord import sys import traceback from discord.ext import commands from discord import errors from Cogs import Message def setup(bot): bot.add_cog(Errors()) class Errors(commands.Cog): def __init__(self): pass @commands.Cog.listener() async def on_command_error(s...
"""Largest Prime Factor The prime factors of 13195 are 5, 7, 13 and 29. What is the largest prime factor of the number 600851475143 ? """ from collections import OrderedDict def find_next_prime(primes): last = primes[-1] candidates = OrderedDict((k, 1) for k in range(last + 1, last * 2 + 1)) for p in ...
# 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/LICENSE-2.0 # # Unless requ...
# Copyright 2019 Verily Life Sciences 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed t...
#!/usr/bin/env python # -*- coding: utf-8 -*- ############################################################################### # Copyright Kitware 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 ...
''' Audio tests =========== ''' import unittest import os SAMPLE_FILE = os.path.join(os.path.dirname(__file__), 'sample1.ogg') SAMPLE_LENGTH = 1.402 DELTA = SAMPLE_LENGTH * 0.01 DELAY = 0.2 class AudioTestCase(unittest.TestCase): def get_sound(self): import os assert os.path.exists(SAMPLE_FILE)...
''' Created on Mar 17, 2011 @author: jsalvatier ''' from theano import scalar, tensor import numpy from scipy import special, misc from .dist_math import * __all__ = ['gammaln', 'multigammaln', 'psi', 'trigamma', 'factln'] class GammaLn(scalar.UnaryScalarOp): """ Compute gammaln(x) """ @staticmethod...
#!/usr/bin/env python # Copyright (c) 2015 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. ''' This checks if all command line args are documented. Return value is 0 to indicate no error. Author: @Marc...
# Copyright 2014 Cloudbase Solutions Srl # # 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 l...
"""Append module search paths for third-party packages to sys.path. **************************************************************** * This module is automatically imported during initialization. * **************************************************************** In earlier versions of Python (up to 1.5a3), scripts or...
from django.db import models import random import math from race.models import Race class GameSize(models.Model): name = models.CharField(max_length=50) numsystems = models.IntegerField(default=10) max_x = models.IntegerField(default=20) max_y = models.IntegerField(default=20) class Game(models.Mode...
# -*- coding: utf-8 -*- """ Example from robust test_rlm, fails on Mac Created on Sun Mar 27 14:36:40 2011 """ from __future__ import print_function import numpy as np import statsmodels.api as sm RLM = sm.RLM DECIMAL_4 = 4 DECIMAL_3 = 3 DECIMAL_2 = 2 DECIMAL_1 = 1 from statsmodels.datasets.stackloss import load d...
import os import sys from functools import partial from twisted.trial.unittest import TestCase, SkipTest from scrapy.downloadermiddlewares.httpproxy import HttpProxyMiddleware from scrapy.exceptions import NotConfigured from scrapy.http import Response, Request from scrapy.spiders import Spider from scrapy.crawler imp...
import unittest from StringIO import StringIO import simplejson as json class TestTuples(unittest.TestCase): def test_tuple_array_dumps(self): t = (1, 2, 3) expect = json.dumps(list(t)) # Default is True self.assertEqual(expect, json.dumps(t)) self.assertEqual(expect, json....
#!/usr/bin/python # -*- coding: utf-8 -*- import subprocess import json import re import urllib2 from datetime import datetime COMMAND_PATTERN = "nsenter --target %s --mount --uts --ipc --net --pid -- %s" def execute(command): p = subprocess.Popen(command, shell=True, stdin=subprocess.PIPE, stdout=subprocess.PIP...
import json from tornado import web, gen from ..base.handlers import APIHandler, json_errors from ..utils import url_path_join class TerminalRootHandler(APIHandler): @web.authenticated @json_errors def get(self): tm = self.terminal_manager terms = [{'name': name} for name in tm.terminals] ...
# Copyright (C) 2001-2007 Python Software Foundation # Author: Barry Warsaw # Contact: [EMAIL] """Basic message object for the email package object model.""" __all__ = ['Message'] import re import uu import quopri import warnings from io import BytesIO, StringIO # Intrapackage imports from email import utils from e...
#!/usr/bin/env python # - * - coding: UTF-8 - * - """ This script generates tests text-emphasis-ruby-001 ~ 004 which tests emphasis marks with ruby in four directions. It outputs a list of all tests it generated in the format of Mozilla reftest.list to the stdout. """ from __future__ import unicode_literals TEST_FIL...
def WebIDLTest(parser, harness): threw = False try: parser.parse(""" interface I { [PutForwards=B] readonly attribute long A; }; """) results = parser.finish() except: threw = True harness.ok(threw, "Should have thrown.") parse...
# -*- coding: utf-8 -*- import time from datetime import datetime from dateutil.relativedelta import relativedelta from openerp import api, fields, models, _ from openerp.exceptions import UserError class AccountAgedTrialBalance(models.TransientModel): _name = 'account.aged.trial.balance' _inherit = 'accoun...
# -*- coding: utf-8 -*- """ pygments.lexers.dotnet ~~~~~~~~~~~~~~~~~~~~~~ Lexers for .net languages. :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re from pygments.lexer import RegexLexer, DelegatingLexer, bygroups, include, ...
# mako/pygen.py # Copyright (C) 2006-2016 the Mako authors and contributors <see AUTHORS file> # # This module is part of Mako and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """utilities for generating and formatting literal Python code.""" import re from mako import excep...
######################## BEGIN LICENSE BLOCK ######################## # Contributor(s): # Ian Cordasco - port to Python # # This library 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; either # versio...
# coding: utf-8 from __future__ import unicode_literals import re import json from .common import InfoExtractor from ..compat import compat_urllib_parse_unquote_plus class YnetIE(InfoExtractor): _VALID_URL = r'https?://(?:.+?\.)?ynet\.co\.il/(?:.+?/)?0,7340,(?P<id>L(?:-[0-9]+)+),00\.html' _TESTS = [ ...
import json from psycopg2.extras import DateRange, DateTimeTZRange, NumericRange, Range from django.contrib.postgres import forms, lookups from django.db import models from django.utils import six from .utils import AttributeSetter __all__ = [ 'RangeField', 'IntegerRangeField', 'BigIntegerRangeField', 'Floa...
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'AgencyProfile' db.create_table('submissions_agencyprofile', ( ('id', self.gf('...
# -*- coding: utf-8 -*- ############################################################################## # # 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, either version 3 of the L...
from peewee import Node from peewee import * from playhouse.tests.base import PeeweeTestCase class TestNodeAPI(PeeweeTestCase): def test_extend(self): @Node.extend() def add(self, lhs, rhs): return lhs + rhs n = Node() self.assertEqual(n.add(4, 2), 6) delattr(N...
#!/usr/bin/env python3 from flask import Flask from flask import jsonify from flask import render_template from flask.ext.cors import CORS from firebase import firebase app = Flask(__name__) CORS(app) firebase = firebase.FirebaseApplication('https://tvhack.firebaseio.com', None) _calling = False @app.route('/') ...
#!/usr/env python from error import SaveError,LoadError,CompressedError from zipfs import fsopen,isZip,GetFileNameInZip import os import pygame class TextureConverter: def __init__(self,palette=None): if palette is not None: self.palette_surf=palette else: self.palette_surf=pygame.image.load('code/palette.bm...
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Communicator client code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights R...
from .base_function import read_enum, build_function_input_dict from simpy.core.result.container import ResultContainer, Result class TestConfiguration(object): def __init__(self, name, enable, config_name, overwrite): if not isinstance(enable, bool): raise Exception('enable must be a boolean'...
# Copyright (C) 2011 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 the f...
""" Django settings for ResumeView project. For more information on this file, see https://docs.djangoproject.com/en/1.6/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.6/ref/settings/ """ # Build paths inside the project like this: os.path.join(BASE...
from setuptools import setup, find_packages try: fo = open('README.rst') long_description = fo.read() except: long_description="""OFS - provides plugin-orientated low-level blobstore. """, finally: fo.close() setup( name="ofs", version="0.4.3", description="OFS - provides plugin-orientated...
# -*- coding: utf-8 -*- """ Flow based connectivity algorithms """ import itertools import networkx as nx __author__ = '\n'.join(['Jordi Torrents <[EMAIL]>']) __all__ = [ 'average_node_connectivity', 'local_node_connectivity', 'node_connectivity', 'local_edge_connectivity', ...
# # Copyright (C) 2008 The Android Open Source Project # # 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 la...
from openid.test import datadriven import unittest from openid.message import Message, BARE_NS, OPENID_NS, OPENID2_NS from openid import association import time from openid import cryptutil import warnings class AssociationSerializationTest(unittest.TestCase): def test_roundTrip(self): issued = int(time....
from bson import Code from django.core.management.base import BaseCommand from optparse import make_option from crits.emails.email import Email from crits.targets.target import Target class Command(BaseCommand): option_list = BaseCommand.option_list + ( make_option('--delete', '-d', ...
# # 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 # ...
# Copyright (c) 2007, Robert Coup <[EMAIL]> # All rights reserved. # # 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 cond...
# Copyright 2021 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...
# coding=utf-8 """ Unit tests for ``octoprint.server.util.flask``. """ from __future__ import absolute_import __author__ = "Gina Häußge <[EMAIL]>" __license__ = 'GNU Affero General Public License http://www.gnu.org/licenses/agpl.html' __copyright__ = "Copyright (C) 2016 The OctoPrint Project - Released under terms of...
# pylint: disable=W0223 from pandas.core.index import Index, MultiIndex from pandas.compat import range, zip import pandas.compat as compat import pandas.core.common as com from pandas.core.common import (is_bool_indexer, is_integer_dtype, _asarray_tuplesafe, is_list_like, isnull, ...
from sympy import (diff, trigsimp, expand, sin, cos, solve, Symbol, sympify, eye, ImmutableMatrix as Matrix) from sympy.core.compatibility import string_types, u from sympy.physics.vector.vector import Vector, _check_vector __all__ = ['CoordinateSym', 'ReferenceFrame'] class CoordinateSym(Symbol):...
# Copyright 2011 Justin Santa Barbara # 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 django.utils.translation import ugettext as _ from django.db.models import Q from orgs.utils import set_to_root_org from ..models import DatabaseAppPermission from common.tree import TreeNode from applications.models import DatabaseApp from assets.models import SystemUser __all__ = [ 'Dat...
# # 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...
from unittest import TestCase import simplejson as json class TestBigintAsString(TestCase): # Python 2.5, at least the one that ships on Mac OS X, calculates # 2 ** 53 as 0! It manages to calculate 1 << 53 correctly. values = [(200, 200), ((1 << 53) - 1, 9007199254740991), ((1...
# Copyright (C) 2014-2016 Andrey Antukh <[EMAIL]> # Copyright (C) 2014-2016 Jesús Espino <[EMAIL]> # Copyright (C) 2014-2016 David Barragán <[EMAIL]> # Copyright (C) 2014-2016 Alejandro Alonso <[EMAIL]> # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General...
""" Classes and functions to handle storage devices. This exports: - two functions for get image/blkdebug filename - class for image operates and basic parameters """ import logging import os import shutil import re from autotest.client import utils try: from virttest import iscsi except ImportError: from ...
#!/usr/bin/python #coding:utf-8 #Filename: test.py #Created: 2014-01-02 02:45:15 #Author: Myon, [EMAIL] from PyQt4 import QtGui,QtCore from mainwindow import Ui_MainWindow from PyQt4.QtCore import * from filter import filterImages class Widget(QtGui.QMainWindow, Ui_MainWindow): """QtGui.QWidget和界面设计时选择的类型一致""" def...
"""Hue sensor entities.""" from aiohue.sensors import ( TYPE_ZLL_LIGHTLEVEL, TYPE_ZLL_ROTARY, TYPE_ZLL_SWITCH, TYPE_ZLL_TEMPERATURE, ) from homeassistant.components.sensor import STATE_CLASS_MEASUREMENT, SensorEntity from homeassistant.const import ( DEVICE_CLASS_BATTERY, DEVICE_CLASS_ILLUMINAN...
import sublime, sublime_plugin, locale, datetime import calendar,locale,sys # view.run_command("dr_calendar_insert_month") def add_month(y,m,x): r_m = m + x r_y = y if (r_m < 1): r_y -= 1 r_m = 12 if (r_m > 12): r_m = 1 r_y += 1 r...
#!/usr/bin/python # Copyright (c) 2011 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Unit tests for the MSVSSettings.py file. """ import sys import unittest import MSVSSettings import StringIO class TestSequenceFunctions(...
# This file is part of Buildbot. Buildbot 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 2. # # This program is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without eve...
#!/usr/bin/python # # @author: Gaurav Rastogi ([EMAIL]) # Eric Anderson ([EMAIL]) # module_check: supported # # Copyright: (c) 2017 Gaurav Rastogi, <[EMAIL]> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # ANSIBLE_METADATA = {'metadata_version': '1.1', ...
from __future__ import with_statement __license__ = 'GPL v3' __copyright__ = '2008, Kovid Goyal <kovid at kovidgoyal.net>' # Imports {{{ import os, traceback, Queue, time, cStringIO, re, sys, weakref from threading import Thread, Event from PyQt5.Qt import ( QMenu, QAction, QActionGroup, QIcon, Qt, pyqtSignal, ...
# based on jail.py (c) 2013, Michael Scherer <[EMAIL]> # (c) 2015, Toshio Kuratomi <[EMAIL]> # (c) 2016, Stephan Lohse <[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...
#!/usr/bin/env python """ The simplest TF-IDF library imaginable. Add your documents as two-element lists `[docname, [list_of_words_in_the_document]]` with `addDocument(docname, list_of_words)`. Get a list of all the `[docname, similarity_score]` pairs relative to a document by calling `similarities([list_of_words])`....
# This source file is part of the Swift.org open source project # # Copyright (c) 2014 - 2015 Apple Inc. and the Swift project authors # Licensed under Apache License v2.0 with Runtime Library Exception # # See http://swift.org/LICENSE.txt for license information # See http://swift.org/CONTRIBUTORS.txt for the list of ...
# 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/LICENSE-2.0 # # Unless requ...
""" Tests to verify correct number of MongoDB calls during course import/export and traversal when using the Split modulestore. """ from tempfile import mkdtemp from shutil import rmtree from unittest import TestCase, skip import ddt from xmodule.modulestore.xml_importer import import_course_from_xml from xmodule.mod...
# -*- coding: utf-8 -*- # # Copyright (c) 2009-2015 Tom Keffer <[EMAIL]> # # See the file LICENSE.txt for your full rights. # """Test tag notation for template generation.""" from __future__ import with_statement import os.path import shutil import sys import syslog import unittest import configobj os.environ['...
#!/usr/bin/env python3 # Copyright 2012-2019 The Meson development team # 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...
#!/usr/bin/env python # Copyright (c) 2009, Giampaolo Rodola'. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """POSIX specific tests. These are implicitly run by test_psutil.py.""" import datetime import os import subprocess import sys imp...
import sqblUI from SQBLutil import * # Dont like this, need to fix later. from PyQt4 import QtGui, QtCore import isoLangCodes from lxml import etree def languagePickerDialog(title = "Enter Language", default = None): lang,success = QtGui.QInputDialog.getItem(None, title, """Enter a <a href='http://...