text
stringlengths
475
200k
""" Signal handlers for invalidating cached data. """ from django.conf import settings from django.dispatch.dispatcher import receiver from xmodule.modulestore.django import SignalHandler from .api import clear_course_from_cache from .tasks import update_course_in_cache @receiver(SignalHandler.course_published) def...
import btk import unittest import _TDDConfigure import numpy class SeparateKnownVirtualMarkersFilterTest(unittest.TestCase): def test_Constructor(self): skvm = btk.btkSeparateKnownVirtualMarkersFilter() labels = skvm.GetVirtualReferenceFrames() num = 19 self.assertEqual(labels.size(...
from sulley import * s_initialize("INVITE_VALID") s_static('\r\n'.join(['INVITE sip:[EMAIL] SIP/2.0', 'CSeq: 1 INVITE', 'Via: SIP/2.0/UDP 192.168.3.102:5068;branch=z9hG4bKlm4zshdowki1t8c7ep6j0yavq2ug5r3x;rport', 'From: "nnp" <sip:[EMAIL]>;tag=so08p5k39wuv1dczfnij7bet4l2m6hrq', 'Call-ID: rzxd6tm98v0eal1cifg2py7sj3wk54...
from __future__ import unicode_literals from django.core.exceptions import FieldError from django.test import TestCase from .models import Choice, Poll, User class ReverseLookupTests(TestCase): def setUp(self): john = User.objects.create(name="John Doe") jim = User.objects.create(name="Jim Bo")...
# Django settings for DjangoAnalysisTestApp project. DEBUG = True TEMPLATE_DEBUG = DEBUG ADMINS = ( # ('Your Name', '[EMAIL]'), ) MANAGERS = ADMINS DATABASES = { 'default': { 'ENGINE': 'django.db.backends.', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'. 'NAME': '...
import numpy as np from sklearn import cross_validation from sklearn import metrics from sklearn import preprocessing def multiclass_roc_auc_score(y_true, y_score, label_binarizer=None, **kwargs): """Compute ROC AUC score for multiclass. :param y_true: true multiclass predictions [n_samples] :param y_scor...
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2012-today OpenERP SA (<http://www.openerp.com>) # # This program is free software: you can redistribute it and/or modify # it under the terms o...
"""Extract reference documentation from the NumPy source tree. """ import inspect import textwrap import re import pydoc from StringIO import StringIO from warnings import warn class Reader(object): """A line-based string reader. """ def __init__(self, data): """ Parameters -----...
# # Copyright (c) 2008--2015 Red Hat, Inc. # # This software is licensed to you under the GNU General Public License, # version 2 (GPLv2). There is NO WARRANTY for this software, express or # implied, including the implied warranties of MERCHANTABILITY or FITNESS # FOR A PARTICULAR PURPOSE. You should have received a c...
# -*- 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...
#!/usr/bin/env python3 # Copyright (C) 2018 Freie Universität Berlin # # This file is subject to the terms and conditions of the GNU Lesser # General Public License v2.1. See the file LICENSE in the top level # directory for more details. import sys from testrunner import run # The default timeout is not enough for...
"""<rst> Allows to send commands to FS20 receivers. | |fS20Image|_ `Direct shop link <http://www.elv.de/output/controller.aspx?cid=74&detail=10&detail2=27743>`__ .. |fS20Image| image:: picture.jpg .. _fS20Image: http://www.elv.de/ """ import time eg.RegisterPlugin( name = "ELV FS20 PCS", author = "Bartman"...
# -*- coding: utf-8 -*- # Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and contributors # For license information, please see license.txt import frappe from frappe.model.document import Document from frappe.contacts.address_and_contact import load_address_and_contact from erpnext.accounts.party import validate_pa...
#!/usr/bin/env python # Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Constrained Network Server. Serves files with supplied network constraints. The CNS exposes a web based API allowing network co...
from __future__ import unicode_literals from django.db import models from django.db.models import signals from django.dispatch import receiver from django.test import TestCase from django.utils import six from .models import Author, Book, Car, Person class BaseSignalTest(TestCase): def setUp(self): # Sa...
# 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...
#!/usr/bin/env python # -*- encoding: utf-8 -*- # 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...
#Copyright ReportLab Europe Ltd. 2000-2012 #see license.txt for license details """Tests for context-dependent indentation """ __version__='''$Id: test_platypus_indents.py 3660 2010-02-08 18:17:33Z damian $''' from reportlab.lib.testutils import setOutDir,makeSuiteForClasses, outputfile, printLocation setOutDir(__name_...
import socket import subprocess as sp import sys from app import app class Components(): def __init__(self): self._binaries = (app.config['CHECKSYS_DICT']["IPTABLES"], app.config['CHECKSYS_DICT']["CONNTRACK"]) self._services = None if app.config['TEST_MODE']: self._services =...
# Copyright (c) 2014 Hewlett-Packard Development Company, L.P. # # 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...
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe from frappe import _ from frappe.utils import flt from erpnext.accounts.report.financial_statements import (get_period_list, get_columns, ...
import re, socket, string, sys if __name__ == "__main__": if len(sys.argv) < 3: sys.exit(2) target_address = (sys.argv[1]) target_port = int(sys.argv[2]) s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.connect((target_address, target_port)) ssl_sock = socket.ssl(s) # print the cert info #pr...
# 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 t...
# -*- coding: utf-8 -*- from __future__ import unicode_literals import os import unittest import warnings from unittest import skipUnless from django.conf import settings from django.contrib.gis.geoip import HAS_GEOIP from django.contrib.gis.geos import HAS_GEOS, GEOSGeometry from django.test import ignore_warnings f...
import numpy as np import pandas import cv2 def cargar_imagen(archivo): ''' Carga en variables dos matrices de la imágen, una gris y otra a color, devuelve un diccionario con las dos versiones. ''' imagen = {} imagen['gris'] = cv2.imread(archivo,0) imagen['color'] = cv2.imread(archivo) ...
from django.shortcuts import get_object_or_404 from django.template import Context, loader as template_loader from django.conf import settings from django.core.context_processors import csrf from rest_framework import decorators, permissions from rest_framework.renderers import JSONPRenderer, JSONRenderer, BrowsableAP...
""" This module implements a transaction manager that can be used to define transaction handling in a request or view function. It is used by transaction control middleware and decorators. The transaction manager can be in managed or in auto state. Auto state means the system is using a commit-on-save strategy (actual...
import os import shutil import tempfile from contextlib import contextmanager from importlib import import_module from django.apps import apps from django.db import connection from django.db.migrations.recorder import MigrationRecorder from django.test import TransactionTestCase from django.test.utils import extend_sy...
""" GDAL - Constant definitions """ from ctypes import ( c_byte, c_double, c_float, c_int16, c_int32, c_uint16, c_uint32, ) # See http://www.gdal.org/gdal_8h.html#a22e22ce0a55036a96f652765793fb7a4 GDAL_PIXEL_TYPES = { 0: 'GDT_Unknown', # Unknown or unspecified type 1: 'GDT_Byte', # Eight bit unsigned int...
import unittest from scrapy.contrib.downloadermiddleware.redirect import RedirectMiddleware, MetaRefreshMiddleware from scrapy.spider import Spider from scrapy.exceptions import IgnoreRequest from scrapy.http import Request, Response, HtmlResponse from scrapy.utils.test import get_crawler class RedirectMiddlewareTes...
from django.db import connection from django.contrib.gis.tests.utils import mysql, no_mysql, oracle, postgis, spatialite from django.utils import unittest test_srs = ({'srid' : 4326, 'auth_name' : ('EPSG', True), 'auth_srid' : 4326, 'srtext' : 'GEOGCS["WGS 84",DATUM["WGS...
from abc import ABCMeta, abstractmethod import struct import binascii, os, sys class HexFileFormat(object): """Parses out Hex File format into a byte stream""" def __init__(self, path=None, file=None): self.path = path self.file = file pass def get_bytes(self): with open(se...
from ns_portal.core.resources import ( MetaEndPointResource ) from marshmallow import ( Schema, fields, EXCLUDE, ValidationError ) from ns_portal.database.main_db import ( TUsers ) from sqlalchemy import ( and_ ) from sqlalchemy.orm.exc import ( MultipleResultsFound ) from pyramid.securi...
# Licensed under a 3-clause BSD style license - see LICENSE.rst from __future__ import absolute_import, division, print_function, unicode_literals import os import subprocess import sys import pytest def test_wcsapi_extension(tmpdir): # Test that we can build a simple C extension with the astropy.wcs C API ...
# Copyright (c) 2021, NVIDIA CORPORATION. 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 applic...
#! /usr/bin/env python3 import sys import matplotlib matplotlib.use('Agg') import numpy as np import matplotlib.pyplot as plt import matplotlib.colors as colors from matplotlib.lines import Line2D from mule.postprocessing.JobsData import * from mule.postprocessing.JobsDataConsolidate import * if len(sys.argv) > ...
from __future__ import with_statement from pybench import Test class WithFinally(Test): version = 2.0 operations = 20 rounds = 80000 class ContextManager(object): def __enter__(self): pass def __exit__(self, exc, val, tb): pass def test(self): cm ...
# -*- coding: utf-8 -*- # Copyright 2007-2011 The HyperSpy developers # # This file is part of HyperSpy. # # HyperSpy 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...
# Copyright (C) 2017 Johnny Vestergaard <[EMAIL]> # # 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 program is d...
""" test utils """ from nose.plugins.attrib import attr from ccx.models import ( # pylint: disable=import-error CcxMembership, CcxFutureMembership, ) from ccx.tests.factories import ( # pylint: disable=import-error CcxFactory, CcxMembershipFactory, CcxFutureMembershipFactory, ) from student.roles...
# -*- 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...
import copy import os import sys from importlib import import_module from django.utils import six def import_string(dotted_path): """ Import a dotted module path and return the attribute/class designated by the last name in the path. Raise ImportError if the import failed. """ try: module...
#------------------------------------------------------------------------- # CxxTest: A lightweight C++ unit testing library. # Copyright (c) 2008 Sandia Corporation. # This software is distributed under the LGPL License v3 # For more information, see the COPYING file in the top CxxTest directory. # Under the terms of ...
# Copyright 2019 Fortinet, 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 3 of the License, or # (at your option) any later version. # # This program is distributed in the...
import sys, psutil, os, stat, tempfile, argparse, time, datetime sys.path.extend(['.','..','../..','py']) import h2o_sandbox # Stripped down, similar to h2o.py has for these functions # Possible to do this in bash, but the code becomes cryptic. # You can execute this as sh2junit.py <bash command string> # sh2junit ru...
#------------------------------------------------------------------------- # Copyright (c) Microsoft. 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.apac...
# Copyright 2015 NEC Corporation. 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 l...
#!/usr/local/bin/python2 # Ex7.1.py Python 2 version # Script to parse an XML file and enumerate tags import sys from xml.parsers import expat # Allow user to provide a filename, or default to books.xml filename = sys.argv[1] if sys.argv[1:] else 'books.xml' Tags = 0 tags = {} class ExpatError(Exception): pass...
import valkyrie import struct class GeometryWriter: GT_GeometryMesh = 0 GT_GeometryCollection = 1 GT_GeometryLOD = 2 DM_Internal = 0 DM_Exteral = 1 def __init__(self): self.stream = [] self.material_map = {} def write(self, multi_mesh): self.stream += struct.pack('<I', GeometryWriter.GT_Geometry...
from LogAnalyzer import Test,TestResult import DataflashLog from math import sqrt class TestIMUMatch(Test): '''test for empty or near-empty logs''' def __init__(self): Test.__init__(self) self.name = "IMU Mismatch" def run(self, logdata, verbose): #tuning parameters: war...
""" Futures tools for threadly """ import threading import time class ListenableFuture(object): """ This class i used to make a Future that can have listeners and callbacks added to it. Once setter(object) is called all listeners/callbacks are also called. Callbacks will be given the set object, an...
#!/usr/bin/env python3 # Copyright (c) 2018 The Bitcoin developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test the finalizeblock RPC calls.""" import time from test_framework.test_framework import BitcoinTestFramework...
# -*- test-case-name: twisted.words.test.test_jabberjid -*- # # Copyright (c) 2001-2008 Twisted Matrix Laboratories. # See LICENSE for details. """ Jabber Identifier support. This module provides an object to represent Jabber Identifiers (JIDs) and parse string representations into them with proper checking for illeg...
# -*- coding: utf-8 -*- # Copyright: (c) 2015, Peter Sprygada <[EMAIL]> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) class ModuleDocFragment(object): # Standard files documentation fragment DOCUMENTATION = r''' options: provider: description: - B(D...
# 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...
from __future__ import absolute_import from __future__ import print_function import keras from keras.datasets import mnist import keras.models from keras.models import Sequential from keras.layers.core import Dense, Dropout, Activation from keras.regularizers import l2, l1 from keras.constraints import maxnorm, nonneg ...
# -*- coding: utf-8 -*- import os import uuid import codecs import django.contrib.gis.db.models.fields from django.core import management from django.contrib.postgres.fields import JSONField from django.db import migrations, models from arches.db.migration_operations.extras import CreateExtension, CreateAutoPopulateU...
import pygame from pygame.locals import * pygame.display.init() pygame.display.set_mode((80,80),32) def prep(name): fname = name+".png" img = pygame.image.load(fname) w,h = img.get_width()/2,img.get_height()/2 out = pygame.Surface((w*3,h*3),SWSURFACE|SRCALPHA,32) out.fill((0,0,0,0)) out.bl...
#!/usr/bin/env python # Copyright 2015 The Kubernetes Authors. # # 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 appli...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Copyright 2012, Nachi Ueno, NTT MCL, 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://ww...
from twisted.internet import defer from twisted.python import log import p2pool from p2pool.bitcoin import data as bitcoin_data from p2pool.util import deferral, forest, jsonrpc, variable class HeaderWrapper(object): __slots__ = 'hash previous_hash'.split(' ') @classmethod def from_header(cls, header...
import os import unittest import urllib2 import json import uuid import wptserve from wptserve.router import any_method from base import TestUsingServer, doc_root class TestResponseSetCookie(TestUsingServer): def test_put_take(self): @wptserve.handlers.handler def handler(request, response): ...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright (c) 2010 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.ap...
# Copyright (C) 2016 Christopher M. Biwer # 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 program is distribute...
# Barcode Example # # This example shows off how easy it is to detect bar codes using the # OpenMV Cam M7. Barcode detection does not work on the M4 Camera. import sensor, image, time, math sensor.reset() sensor.set_pixformat(sensor.GRAYSCALE) sensor.set_framesize(sensor.VGA) # High Res! sensor.set_windowing((640, 80...
# Copyright (c) 2014 Rackspace Hosting # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless req...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Type-transformation rules. """ __author__ = "Lluís Vilanova <[EMAIL]>" __copyright__ = "Copyright 2012-2014, Lluís Vilanova <[EMAIL]>" __license__ = "GPL version 2 or (at your option) any later version" __maintainer__ = "Stefan Hajnoczi" __email__ = "[EM...
# -*- coding: utf-8 -*- """ security.py ~~~~~~~~~~~~ This module implements Settings HP OneView REST API """ from __future__ import unicode_literals from __future__ import print_function from __future__ import division from __future__ import absolute_import from future import standard_library standard_library.install...
"""Exception classes raised by urllib. The base exception class is URLError, which inherits from IOError. It doesn't define any behavior of its own, but is the base class for all exceptions defined in this package. HTTPError is an exception class that is also a valid HTTP response instance. It behaves this way beca...
# Copyright 2010 Google Inc. # Copyright (c) 2011, Nexenta Systems Inc. # # 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...
""" Django settings for mysite project. Generated by 'django-admin startproject' using Django 1.8.2. For more information on this file, see https://docs.djangoproject.com/en/1.8/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.8/ref/settings/ """ # Build paths...
# -*- coding: utf-8 -*- # Import the PyQt and QGIS libraries from PyQt4.QtCore import * from PyQt4.QtGui import * from qgis.core import * class HelloWorld: def __init__(self, iface): # Save reference to the QGIS interface self.iface = iface self.canvas = iface.mapCanvas() def initGui...
# # 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...
#!/usr/bin/env python # Copyright (c) 2012 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 StringIO import unittest import gyp.MSVSSettings as MSVSSettings class TestSequence...
# This code is part of Ansible, but is an independent component. # This particular file snippet, and this file snippet only, is BSD licensed. # Modules you write using this snippet, which is embedded dynamically by Ansible # still belong to the author of the module, and may assign their own license # to the complete wo...
# -*- coding: utf-8 -*- # # test_connect_pairwise_bernoulli.py # # This file is part of NEST. # # Copyright (C) 2004 The NEST Initiative # # NEST 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 ...
from PySide.QtGui import * import timeit #import camera import cv2 import os import sys import numpy as np def generate_crop_indexes_3d(width, height, crop_width, crop_height): idxs = [] for row in xrange(0, height, crop_height): for col in xrange(0, width / crop_width): indexes = [] ...
# Checks whether the isuser() function works as it should # Stubs the cloud_request() functions for these tests from xclib.sigcloud import sigcloud from xclib import xcauth from xclib.check import assertEqual def setup_module(): global xc, sc xc = xcauth(domain_db={ b'xdomain': b'99999\thttps://rem...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ sipa.py ~~~~~~~~~~~~~~ This file shall be used to start the Flask app. Specific things are handled in the `sipa` package. """ import argparse import logging from sipa import create_app from sipa.utils import support_hotline_available logger = loggi...
import decimal import json import unittest import uuid from django import forms from django.core import exceptions, serializers, validators from django.core.management import call_command from django.db import IntegrityError, connection, models from django.test import TransactionTestCase, override_settings from django...
from ._split import BaseCrossValidator from ._split import KFold from ._split import LabelKFold from ._split import StratifiedKFold from ._split import LeaveOneLabelOut from ._split import LeaveOneOut from ._split import LeavePLabelOut from ._split import LeavePOut from ._split import ShuffleSplit from ._split import L...
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the...
""" The welcome message. This is displayed when the editor opens without any files. """ from __future__ import unicode_literals from prompt_toolkit.formatted_text.utils import fragment_list_len import prompt_toolkit import pyvim import platform import sys version = sys.version_info pyvim_version = pyvim.__version__ _...
#!/usr/bin/env python # Copyright (c) 2012 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. """ Verify that building an object file correctly depends on running actions in dependent targets, but not the targets themselves. """ impo...
# -*- coding: utf-8 -*- import os import shutil import tempfile from datetime import timedelta from django.conf import settings from django.core.files.storage import default_storage as storage from django.utils import translation import pytest import six from freezegun import freeze_time from unittest import mock fr...
# 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...
# Copyright (c) 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...
# # (c) 2015, Peter Sprygada <[EMAIL]> # # Copyright (c) 2016 Dell Inc. # # 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 yo...
from django.conf import settings from django.contrib.messages import constants from django.contrib.messages.storage.base import BaseStorage, Message from django.http import CompatCookie from django.utils import simplejson as json from django.utils.crypto import salted_hmac, constant_time_compare class MessageEncoder(...
import datetime import sys import socket from socket import timeout as SocketTimeout import warnings from .packages import six try: # Python 3 from http.client import HTTPConnection as _HTTPConnection, HTTPException except ImportError: from httplib import HTTPConnection as _HTTPConnection, HTTPException cla...
# 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 in the hope that ...
''' Google Movie Showtimes parser class for Python. This script provides a Python class that can be used to parse Google Movie Showtimes (www.google.com/movies) pages into dictionary objects. @author Vaidik Kapoor @version 0.1 ''' import httplib, urllib, BeautifulSoup, re from copy import deepcopy from BeautifulSoup...
from openerp.osv import osv, fields class crm_lead_to_project_issue_wizard(osv.TransientModel): """ wizard to convert a Lead into a Project Issue and move the Mail Thread """ _name = "crm.lead2projectissue.wizard" _inherit = 'crm.partner.binding' _columns = { "lead_id": fields.many2one("crm....
''' IDE: Eclipse (PyDev) Python version: 2.7 Operating system: Windows 8.1 @author: Emil Carlsson @copyright: 2015 Emil Carlsson @license: This program is distributed under the terms of the GNU General Public License ''' from View import GlobalFunc from View.Board import Board class GameView(object): __root ...
#!/usr/bin/env python import json import time import xml.etree.ElementTree as ET import argparse import sys import subprocess import requests from decimal import Decimal from gomatic.gocd.pipelines import Pipeline, PipelineGroup from gomatic.gocd.agents import Agent from gomatic.xml_operations import Ensurance, Possi...
import unittest from test import test_support import base64 class LegacyBase64TestCase(unittest.TestCase): def test_encodestring(self): eq = self.assertEqual eq(base64.encodestring("www.python.org"), "d3d3LnB5dGhvbi5vcmc=\n") eq(base64.encodestring("a"), "YQ==\n") eq(base64.encod...
# Copyright (C) 2016 University of Zurich. All rights reserved. # # This file is part of MSRegistry Backend. # # MSRegistry Backend is free software: you can redistribute it and/or # modify it under the terms of the version 3 of the GNU Affero General # Public License as published by the Free Software Foundation, or a...
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt # For license information, please see license.txt from __future__ import unicode_literals import frappe @frappe.whitelist() def get_time_log_list(doctype, txt, searchfield, start, page_le...
""" Settings used when generating static assets for use in tests. For example, Bok Choy uses two different settings files: 1. test_static_optimized is used when invoking collectstatic 2. bok_choy is used when running CMS and LMS Note: it isn't possible to have a single settings file, because Django doesn't support bo...
#!/usr/bin/python # # Copyright (c) 2019 Zim Kalinowski, (@zikalino) # # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', ...