text
stringlengths
475
200k
""" Parsers for the different streams and fragments found in an OLE2 file. Documents: - goffice source code - Microsoft Office PowerPoint 97-2007 Binary File Format (.ppt) Specification http://download.microsoft.com/download/0/B/E/0BE8BDD7-E5E8-422A-ABFD-4342ED7AD886/PowerPoint97-2007BinaryFileFormat(ppt)Specifi...
#!/usr/bin/env python """ Create application check for v3 """ # We just want to see any exception that happens # don't want the script to die under any cicumstances # script must try to clean itself up # pylint: disable=broad-except # main() function has a lot of setup and error handling # pylint: disable=too-many-st...
#!/usr/bin/python # (c) 2013, Paul Durivage <[EMAIL]> # 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', 'status': ['prev...
# 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 ...
# 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...
# # Copyright (c) 2000-2013 LOGILAB S.A. (Paris, FRANCE). # http://www.logilab.fr/ -- mailto:[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 2 of the License, or (at you...
from django.conf import settings from .. import Tags, Warning, register from ..utils import patch_middleware_message SECRET_KEY_MIN_LENGTH = 50 SECRET_KEY_MIN_UNIQUE_CHARACTERS = 5 W001 = Warning( "You do not have 'django.middleware.security.SecurityMiddleware' " "in your MIDDLEWARE so the SECURE_HSTS_SECOND...
from __future__ import unicode_literals from django.conf import settings from django.utils.encoding import force_text, python_2_unicode_compatible from django.contrib.messages import constants, utils LEVEL_TAGS = utils.get_level_tags() @python_2_unicode_compatible class Message(object): """ Represents an a...
# -*- coding: utf-8 -*- # IDD3 - Propositional Idea Density from Dependency Trees # Copyright (C) 2014-2015 Andre Luiz Verucci da Cunha # # 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 ...
#!/usr/bin/env python3 # ***** BEGIN GPL LICENSE BLOCK ***** # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This...
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals import webnotes import webnotes.defaults @webnotes.whitelist() def get_roles_and_doctypes(): webnotes.only_for(("System Manager", "Administrator")) return { "doctypes": [d...
import json import logging import os import pytz import requests import sys import urllib.request, urllib.parse, urllib.error import time if os.path.dirname(__file__) == "matrixbot/plugins": sys.path.append(os.path.abspath(".")) from matrixbot import utils pp, puts, set_property = utils.pp, utils.puts, utils.set...
from django.core.exceptions import ObjectDoesNotExist from django.db import models from django.contrib.auth.models import User class DmUser(models.Model): user=models.ForeignKey(User,unique=True,related_name='dm_user') last_activity=models.DateTimeField(auto_now_add=True) contacts=models.ManyToManyField(User,rel...
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (C) 2004-2014 OpenERP S.A. (<http://openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms ...
""" Python Character Mapping Codec cp037 generated from 'MAPPINGS/VENDORS/MICSFT/EBCDIC/CP037.TXT' with gencodec.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_table) def decode(self,input...
# # # 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 n...
#!/usr/bin/env python # encoding: utf-8 """ Example of creating a block model using the blockmodel function in NX. Data used is the Hartford, CT drug users network: @article{, title = {Social Networks of Drug Users in {High-Risk} Sites: Finding the Connections}, volume = {6}, shorttitle = {Social Networks of Drug ...
from __future__ import unicode_literals import re import tempfile from django.contrib.gis import gdal from django.contrib.gis.db.models import Extent, MakeLine, Union from django.contrib.gis.geos import ( GeometryCollection, GEOSGeometry, LinearRing, LineString, Point, Polygon, fromstr, ) from django.core.man...
#!/usr/bin/env python # Copyright 2015 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. """Reads, parses, and (optionally) writes as HTML the contents of Markdown files passed as arguments. Intended for rendering network s...
from rest_framework import serializers from models import Condominio, Edificio, Departamento, Servicio, LecturaServicio from models import AdministradorEdificio, Conserje class ConserjeSerializer(serializers.HyperlinkedModelSerializer): class Meta: model = Conserje class AdministradorEdificioSerializer...
# Copyright (c) 2006-2011 Mitch Garnaat http://garnaat.org/ # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modi...
#!/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...
''' Bitcoin base58 encoding and decoding. Based on https://bitcointalk.org/index.php?topic=1026.0 (public domain) ''' import hashlib # for compatibility with following code... class SHA256: new = hashlib.sha256 if str != bytes: # Python 3.x def ord(c): return c def chr(n): return byte...
# -*- coding: utf-8 -*- """ """ from __future__ import absolute_import from ._utils import _cd from ..unitquantity import UnitConstant natural_unit_of_action = UnitConstant( 'natural_unit_of_action', _cd('natural unit of action'), symbol='hbar', u_symbol='ħ' ) natural_unit_of_energy = UnitConstant( ...
# Zeobuilder is an extensible GUI-toolkit for molecular model construction. # Copyright (C) 2007 - 2009 Toon Verstraelen <[EMAIL]>, Center # for Molecular Modeling (CMM), Ghent University, Ghent, Belgium; all rights # reserved unless otherwise stated. # # This file is part of Zeobuilder. # # Zeobuilder is free software...
#!/opt/anaconda1anaconda2anaconda3/bin/python # # Wrapper script for DeepVariant call_variants BINARY_DIR="/opt/anaconda1anaconda2anaconda3/BINARYSUB" MODEL_DIRS= {"wgs": "/opt/anaconda1anaconda2anaconda3/WGSMODELSUB", "wes": "/opt/anaconda1anaconda2anaconda3/WESMODELSUB"} import argparse import os impor...
import json from django.contrib.postgres import forms from django.contrib.postgres.fields.array import ArrayField from django.core import exceptions from django.db.models import Field, Lookup, Transform, TextField from django.utils import six from django.utils.translation import ugettext_lazy as _ __all__ = ['HStore...
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models from askbot.migrations_api import safe_add_column class Migration(SchemaMigration): def forwards(self, orm): """add fields twitter_access_token, twitter_handle, social_sharing...
# -*- coding: utf-8 -*- import re from ..base.xfs_account import XFSAccount class UptoboxCom(XFSAccount): __name__ = "UptoboxCom" __type__ = "account" __version__ = "0.25" __status__ = "testing" __description__ = """Uptobox.com account plugin""" __license__ = "GPLv3" __authors__ = [ ...
# -*- coding: utf-8 -*- """ Unit tests for LMS instructor-initiated background tasks. Runs tasks on answers to course problems to validate that code paths actually work. """ from __future__ import absolute_import, print_function import json from itertools import chain, cycle, repeat from smtplib import SMTPAuthentic...
#!/usr/bin/python # -*- coding: utf-8 -*- # # (c) 2016, René Moser <[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, or # (...
import logging import sys import mock import os from pytest import fixture from mock import patch, call import kiwi from ..test_helper import argv_kiwi_tests from kiwi.tasks.system_build import SystemBuildTask class TestSystemBuildTask: @fixture(autouse=True) def inject_fixtures(self, caplog): self...
#!/usr/bin/python # -*- coding: utf-8 -*- # 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. #...
#!/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. '''Collections of messages and their translations, called cliques. Also collections of cliques (uber-cliques). ''' import re impo...
""" Tests of ModelAdmin system checks logic. """ from django.contrib.contenttypes.fields import GenericForeignKey from django.contrib.contenttypes.models import ContentType from django.db import models from django.utils.encoding import python_2_unicode_compatible class Album(models.Model): title = models.CharFie...
data = ( 'ddwim', # 0x00 'ddwib', # 0x01 'ddwibs', # 0x02 'ddwis', # 0x03 'ddwiss', # 0x04 'ddwing', # 0x05 'ddwij', # 0x06 'ddwic', # 0x07 'ddwik', # 0x08 'ddwit', # 0x09 'ddwip', # 0x0a 'ddwih', # 0x0b 'ddyu', # 0x0c 'ddyug', # 0x0d 'ddyugg', # 0x0e 'ddyugs', # 0x0f 'dd...
# -*- test-case-name: twisted.test.test_persisted -*- # Copyright (c) 2001-2008 Twisted Matrix Laboratories. # See LICENSE for details. """ Utility classes for dealing with circular references. """ from twisted.python import log, reflect try: from new import instancemethod except: from org.python.core impo...
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-today OpenERP SA (<http://www.openerp.com>) # # This program is free software: you can redistribute it and/or modify # it under the terms o...
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from .brightcove import BrightcoveLegacyIE from ..compat import ( compat_parse_qs, compat_urlparse, ) from ..utils import smuggle_url class RMCDecouverteIE(InfoExtractor): _VALID_URL = r'https?://rmcdecou...
"""MovieLens data handling: download, parse, and expose as DataIter """ import os import mxnet as mx def load_mldata_iter(filename, batch_size): """Not particularly fast code to parse the text file and load it into three NDArray's and product an NDArrayIter """ user = [] item = [] score = [] ...
#!/usr/bin/env python import numpy as np import matplotlib.pyplot as plt from matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCanvas from matplotlib.figure import Figure from rompy import rompy, plot_utils, utils map1 = False map2 = False map3 = False map4 = False map5 = False map6 = False map7 = Fa...
# encoding: utf-8 from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'Institute' db.create_table('institute', ( ('gid', self.gf('django.db.models.fields.IntegerField')()), ...
# Copyright (c) 2016 EMC Corporation, 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 ap...
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ The parent class for all the SSH services. Currently implemented services are ssh-userauth and ssh-connection. Maintainer: Paul Swartz """ from twisted.python import log class SSHService(log.Logger): name = None # this is the ssh name...
"""Test date/time type. See http://www.zope.org/Members/fdrake/DateTimeWiki/TestCases """ from __future__ import division import sys import pickle import cPickle import unittest from test import test_support from datetime import MINYEAR, MAXYEAR from datetime import timedelta from datetime import tzinfo from datetim...
# 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/licenses/LICENSE-2.0 # # Unless...
# -*- coding: utf-8 -*- from __future__ import absolute_import, print_function import datetime import json import logging import mock import zlib from django.conf import settings from django.core.urlresolvers import reverse from django.test.utils import override_settings from django.utils import timezone from gzip i...
""" Integration tests for importing courses containing pure XBlocks. """ from django.conf import settings from xblock.core import XBlock from xblock.fields import String from xmodule.modulestore import ModuleStoreEnum from xmodule.modulestore.django import modulestore from xmodule.modulestore.mongo.draft import as_dr...
"""Something just to look at via pydoc.""" import types class A_classic: "A classic class." def A_method(self): "Method defined in A." def AB_method(self): "Method defined in A and B." def AC_method(self): "Method defined in A and C." def AD_method(self): "Method de...
# 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 # d...
# Copyright 1999-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 from __future__ import print_function import logging import textwrap import portage from portage import os from portage.emaint.modules.logs.logs import CleanLogs from portage.news import count_unread_news, disp...
# 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...
#! /usr/bin/python2 import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt import numpy as np import sys first = True s = 2e-5 eta_contour_levels = np.append(np.arange(-1e-4, 0, s), np.arange(s, 1e-4, s)) zoom_lat = True zoom_lat = False zoom_lat = 'eta' in sys.argv[1] fontsize=8 figsize=(9, 3)...
# -*- coding: utf-8 -*- """ pygments.styles.algol_nu ~~~~~~~~~~~~~~~~~~~~~~~~ Algol publication style without underlining of keywords. This style renders source code for publication of algorithms in scientific papers and academic texts, where its format is frequently used. It is based on the ...
#!/usr/bin/env python """ Reorder the integer arguments to the commands in a LAMMPS input file if these arguments violate LAMMPS order requirements. We have to do this because the moltemplate.sh script will automatically assign these integers in a way which may violate these restrictions and the user ha...
#!/usr/bin/env python # # Copyright (C) 2011, 2012 Google Inc. # # This file is part of YouCompleteMe. # # YouCompleteMe 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 # (...
""" Draws dolphins using matplotlib features. From matplotlib documentation: https://matplotlib.org/gallery/shapes_and_collections/dolphin.html#sphx-glr-gallery-shapes-and-collections-dolphin-py """ # Fixing random state for reproducibility import matplotlib.cm as cm import matplotlib.pyplot as plt from matplotlib.pa...
from __future__ import absolute_import import inspect import warnings class RemovedInDjango20Warning(PendingDeprecationWarning): pass class RemovedInDjango110Warning(DeprecationWarning): pass RemovedInNextVersionWarning = RemovedInDjango110Warning class warn_about_renamed_method(object): def __init...
# (c) 2012-2014, Michael DeHaan <[EMAIL]> # (c) 2012, Dag Wieers <[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, or # (at...
# -*- encoding: utf-8 -*- from __future__ import unicode_literals from django.test import TestCase from cms.models import Page from cms.service import init_page class TestService(TestCase): def setUp(self): self.SLUG = 'home' self.HOME = 'Home' def test_init_not(self): try: ...
# -*- coding: utf-8 -*- from __future__ import absolute_import, print_function, unicode_literals import test try: import unittest2 as unittest except ImportError: import unittest import yamlish test_data_list = [ { "name": "Input test", "in": r"""--- bill-to: address: city: "Royal Oak" ...
import os, sys from codecs import EncodedFile from calibre.ebooks.rtf2xml import copy, check_encoding from calibre.ptempfile import better_mktemp public_dtd = 'rtf2xml1.0.dtd' class ConvertToTags: """ Convert file to XML """ def __init__(self, in_file, bug_handler, ...
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2012, Stephen Fromm <[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, or #...
""" Common base classes for devices """ import logging from six import StringIO from virttest import xml_utils from virttest.libvirt_xml import base, xcepts, accessors from virttest.xml_utils import ElementTree class UntypedDeviceBase(base.LibvirtXMLBase): """ Base class implementing common functions for a...
import numpy as np import math import cv2 import itertools as it import sys import time import helping_functs as hf import class_objects as co def detect_corners(): '''function to detects intersection limits of mask with calib_edges''' calib_set = set([tuple(i) for i in np.transpose( np.fliplr(np.non...
# Unix SMB/CIFS implementation. # Copyright (C) Jelmer Vernooij <[EMAIL]> 2007 # # 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 ...
""" Acceptance tests for Studio's Setting pages """ from .base_studio_test import StudioCourseTest from ...pages.studio.settings_certificates import CertificatesPage class CertificatesTest(StudioCourseTest): """ Tests for settings/certificates Page. """ def setUp(self, is_staff=False): super(C...
# @ut.accepts_scalar_input2(argx_list=[1]) # def get_obj(depc, tablename, root_rowids, config=None, ensure=True): # """ Convinience function. Gets data in `tablename` as a list of # objects. """ # print('WARNING EXPERIMENTAL') # try: # if tablename == depc.root: # obj_list = list(de...
#-*- coding: utf-8 -*- try: from django.contrib.auth import get_user_model User = get_user_model() except ImportError: from django.contrib.auth.models import User, Permission # NOQA from django.contrib.auth.models import Group from django.core.files import File as DjangoFile from django.conf import setting...
#!/usr/bin/env python # encoding: utf-8 # Thomas Nagy, 2005-2010 (ita) """ Utilities and platform-specific fixes The portability fixes try to provide a consistent behavior of the Waf API through Python versions 2.3 to 3.X and across different platforms (win32, linux, etc) """ import os, sys, errno, traceback, inspec...
from past.builtins import basestring from pyramid.threadlocal import manager as threadlocal_manager def get_root_request(): if threadlocal_manager.stack: return threadlocal_manager.stack[0]['request'] def ensurelist(value): if isinstance(value, basestring): return [value] return value ...
# 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 # # Copyright 2007 Google 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 o...
import socket from django.core.mail import mail_admins, mail_managers, send_mail from django.core.management.base import BaseCommand from django.utils import timezone class Command(BaseCommand): help = "Sends a test email to the email addresses specified as arguments." missing_args_message = "You must specif...
# -*- coding: utf-8 -*- # Copyright 2013 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 require...
# -*- coding: utf-8 -*- # Copyright: (c) 2017 Ansible Project # 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 from itertools import product import pytest # the module we are actually te...
import io from jinja2 import Template from bokeh.embed import components from bokeh.models import Range1d from bokeh.plotting import figure from bokeh.resources import INLINE from bokeh.util.browser import view # create some data x1 = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12] y1 = [0, 8, 2, 4, 6, 9, 5, 6, 25, 28, 4, 7]...
# -*- coding: utf-8 -*- """ This module contains tests for the pulp.server.db.model.consumer module. """ import unittest import mock from ....base import PulpServerTests from pulp.server.db.model import consumer class TestRepoProfileApplicability(PulpServerTests): """ Test the RepoProfileApplicability Mode...
# -*- coding: utf-8 -*- # this file is released under public domain and you can use without limitations ######################################################################### ## Customize your APP title, subtitle and menus here ######################################################################### response.titl...
""" These are the standard themes that come with Pyflag. """ import pyflag.conf config=pyflag.conf.ConfObject() import pyflag.FlagFramework as FlagFramework import pyflag.Registry as Registry import pyflag.Theme as Theme class BlueTheme(Theme.BasicTheme): """ This class encapsulates the theme elements. The results...
# Copyright 2014-2016 OpenMarket Ltd # # 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 w...
# -*- coding: utf-8 -*- """ pyspecific.py ~~~~~~~~~~~~~ Sphinx extension with Python doc-specific markup. :copyright: 2008-2014 by Georg Brandl. :license: Python license. """ ISSUE_URI = 'http://bugs.python.org/issue%s' SOURCE_URI = 'https://hg.python.org/cpython/file/3.4/%s' from ...
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2015, Joseph Callen <jcallen () csc.com> # # 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 Li...
""" The OGRGeometry is a wrapper for using the OGR Geometry class (see http://www.gdal.org/ogr/classOGRGeometry.html). OGRGeometry may be instantiated when reading geometries from OGR Data Sources (e.g. SHP files), or when given OGC WKT (a string). While the 'full' API is not present yet, the API is "pythonic" u...
#! /usr/bin/python # Tool for visualizing quaternion as rotated cube from OpenGL.GLUT import * from OpenGL.GLU import * from OpenGL.GL import * import sys import math from ivy.std_api import * import logging import getopt import pygame import time import platform import os _NAME = 'attitude_viz' class TelemetryQ...
""" This module is the heart of the upnp support. Device discover, ip discovery and port mappings are implemented here. @author: Raphael Slinckx @author: Anthony Baxter @copyright: Copyright 2005 @license: LGPL @contact: U{[EMAIL]<mailto:[EMAIL]>} @version: 0.1.0 """ __revision__ = "$id" import socket, random, urlpar...
import os, unittest from ctypes import * try: WINFUNCTYPE except NameError: # fake to enable this test on Linux WINFUNCTYPE = CFUNCTYPE import _ctypes_test lib = CDLL(_ctypes_test.__file__) class CFuncPtrTestCase(unittest.TestCase): def test_basic(self): X = WINFUNCTYPE(c_int, c_int, c_int) ...
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright: (c) 2018, F5 Networks Inc. # GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', ...
# coding: utf-8 """ Config, Date, User and Exceptions """ from __future__ import unicode_literals, absolute_import import os import re import sys import codecs import datetime import optparse import StringIO import xmlrpclib import ConfigParser from dateutil.relativedelta import MO as MONDAY from ConfigParser import...
# -*- coding: utf-8 -*- import re from odoo import api, models, _ from odoo.exceptions import UserError, ValidationError def normalize_iban(iban): return re.sub('[\W_]', '', iban or '') def pretty_iban(iban): """ return iban in groups of four characters separated by a single space """ return ' '.join([...
#!/usr/bin/env python from __future__ import print_function import os import re import boto from boto.s3.connection import S3Connection from boto.iam.connection import IAMConnection import inquirer key_policy_json = """{ "Statement": [ { "Action": "iam:*AccessKey*", "Effect": "Allow", "Resour...
#!/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 distribut...
#!/usr/bin/python # -*- coding: utf-8 -*- from __future__ import print_function import argparse import BaseHTTPServer import json import os import os.path import re import subprocess import sys import tempfile import urllib2 # Grab the script path because that is where all the static assets are SCRIPT_DIR = os.path.d...
#!/usr/bin/env python import sys import pmt from gnuradio.ctrlport.GNURadioControlPortClient import GNURadioControlPortClient from optparse import OptionParser parser = OptionParser(usage="%prog: [options]") parser.add_option("-H", "--host", type="string", default="localhost", help="Hostname to conn...
import numba @numba.jit(['f8(f8[:, :])'], nopython=True, nogil=True, cache=True) def polygon_area(vertices): r"""Shoelace formula for computing area of polygon .. math:: A = \sum_{i=1}^{n} x_i \left(y_{i+1} - y_{i-1}\right), \quad i\mod n References: - https://en.wikipedia.org/wiki/Shoel...
#!/usr/bin/env python """ Copyright (c) 2006-2013 sqlmap developers (http://sqlmap.org/) See the file 'doc/COPYING' for copying permission """ from lib.core.common import Backend from lib.core.common import readInput from lib.core.data import logger from lib.core.enums import OS from lib.core.exception import SqlmapU...
"""Execute files of Python code.""" import imp, marshal, os, sys from coverage.backward import exec_code_object, open_source from coverage.misc import ExceptionDuringRun, NoCode, NoSource try: # In Py 2.x, the builtins were in __builtin__ BUILTINS = sys.modules['__builtin__'] except KeyError: # In Py 3....
from django.db import models from django.conf import settings User = getattr(settings, 'AUTH_USER_MODEL', 'auth.User') class PinCard(models.Model): token = models.CharField(max_length=32, db_index=True, editable=False) display_number = models.CharField(max_length=20, editable=False) expiry_month = models...
import unittest from tornado.options import define, options from m2core.utils.tests import RESTTest from m2core.utils.data_helper import DataHelper from m2core import M2Core from m2core.bases import http_statuses from tornado.escape import json_decode from example.models import User # init empty object to pass it thr...
"""Production settings and globals.""" from os import environ from base import * # Normally you should not import ANYTHING from Django directly # into your settings, but ImproperlyConfigured is an exception. from django.core.exceptions import ImproperlyConfigured def get_env_setting(setting): """ Get the envi...