text
stringlengths
475
200k
from distutils.core import setup setup( name="more_collections", packages = ['more_collections'], version="0.3.0", author="Mario Wenzel", author_email="[EMAIL]", url="https://github.com/maweki/more-collections", description="more_collections is a Python library providing more collections (m...
# Copyright 2014 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. import telemetry.timeline.counter as tracing_counter import telemetry.timeline.event as event_module import telemetry.timeline.event_container as event_conta...
# -*- coding: utf-8 -*- """ pygments.formatters.terminal ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Formatter for terminal output with ANSI sequences. :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import sys from pygments.formatter import Format...
r"""Installs files needed for tornado testing on windows. These instructions are compatible with the VMs provided by http://modern.ie. The bootstrapping script works on the WinXP/IE6 and Win8/IE10 configurations, although tornado's tests do not pass on XP. 1) Install virtualbox guest additions (from the device menu i...
# -*- coding: utf-8; -*- # # This file is part of Superdesk. # # Copyright 2013, 2014 Sourcefabric z.u. and contributors. # # For the full copyright and license information, please see the # AUTHORS and LICENSE files distributed with this source code, or # at https://www.sourcefabric.org/superdesk/license from superde...
""" pkgdata is a simple, extensible way for a package to acquire data file resources. The getResource function is equivalent to the standard idioms, such as the following minimal implementation:: import sys, os def getResource(identifier, pkgname=__name__): pkgpath = os.path.dirname(sys.modules[pkgna...
# tests common to dict and UserDict import unittest import collections import sys class BasicTestMappingProtocol(unittest.TestCase): # This base class can be used to check that an object conforms to the # mapping protocol # Functions that can be useful to override to adapt to dictionary # semantics ...
import struct, os, time from config import config, ConfigSelection, ConfigYesNo, ConfigSubsection, ConfigText from enigma import eHdmiCEC, eActionMap from Components.VolumeControl import VolumeControl from Tools.StbHardware import getFPWasTimerWakeup from enigma import eTimer from Screens import Standby from Tools impo...
# -*- coding: utf-8 -*- # Generated by Django 1.11.2 on 2019-01-16 21:57 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('workflow', '0025_merge_20190116_1357'), ] operations = [ migrations.AddFiel...
import os import xapian from djapian.utils.decorators import reopen_if_modified class Database(object): def __init__(self, path): self._path = path def open(self, write=False): """ Opens database for manipulations """ if not os.path.exists(self._path): os.m...
# # Copyright 2013, 2018 Free Software Foundation, Inc. # # This file is part of GNU Radio # # SPDX-License-Identifier: GPL-3.0-or-later # # """ Returns information about a module """ import os from ..tools import get_modname from .base import ModTool, ModToolException class ModToolInfo(ModTool): """ Return in...
import sys import unittest import pywintypes import time from pywin32_testutil import str2bytes, ob2memory import datetime import operator class TestCase(unittest.TestCase): def testPyTimeFormat(self): struct_current = time.localtime() pytime_current = pywintypes.Time(struct_current) # try ...
#!/usr/bin/env python #https://docs.python.org/dev/library/ssl.html import socket, ssl def server(): bindsocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) bindsocket.bind(('127.0.0.1', 10000)) bindsocket.listen(5) print "Listening for a connection" tls_serv = ssl.wrap_socket(bindsocket, ...
""" linguistics module (imdb package). This module provides functions and data to handle in a smart way languages and articles (in various languages) at the beginning of movie titles. Copyright 2009-2012 Davide Alberani <[EMAIL]> 2012 Alberto Malagoli <albemala AT gmail.com> 2009 H. Turgut Uyar <[...
import numpy as np import pytest from sklearn import config_context from sklearn.impute import KNNImputer from sklearn.metrics.pairwise import nan_euclidean_distances from sklearn.metrics.pairwise import pairwise_distances from sklearn.neighbors import KNeighborsRegressor from sklearn.utils._testing import assert_allc...
from distutils.command.build_ext import build_ext as _du_build_ext try: # Attempt to use Pyrex for building extensions, if available from Pyrex.Distutils.build_ext import build_ext as _build_ext except ImportError: _build_ext = _du_build_ext import os, sys from distutils.file_util import copy_file from set...
#encoding: utf-8 import datetime from django.db.models.signals import post_save, pre_delete, post_delete from django.contrib.contenttypes.models import ContentType from planet.models import Feed, Post from actstream import action from actstream.models import Follow from knesset.utils import cannonize, disable_for_loadd...
import random import pytest from learning import DataSet from probabilistic_learning import * random.seed("aima-python") def test_naive_bayes(): iris = DataSet(name='iris') # discrete nbd = NaiveBayesLearner(iris, continuous=False) assert nbd([5, 3, 1, 0.1]) == 'setosa' assert nbd([6, 3, 4, 1.1...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright (c) 2013 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....
#!/usr/bin/python # Copyright (c) 2011 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. import os import signal import subprocess import time class BrowserProcessBase(object): def __init__(self, handle): self.handle...
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # This module copyright (C) 2014 Savoir-faire Linux # (<http://www.savoirfairelinux.com>). # # This program is free software: you can redistribute it and/or m...
import os import unittest from . import TEST_DATA_DIR from FastxIO import fastx class TestFastq(unittest.TestCase): def setUp(self): self.fastq_file = os.path.join(TEST_DATA_DIR, "test.fastq") self.gz_fastq_file = os.path.join(TEST_DATA_DIR, "test.fastq.gz") self.windows_fastq_file = os.p...
# The contents of this file are subject to the BitTorrent Open Source License # Version 1.1 (the License). You may not copy or use this file, in either # source code or executable form, except in compliance with the License. You # may obtain a copy of the License at http://www.bittorrent.com/license/. # # Software di...
#!/usr/bin/env python # encoding: utf-8 # Thomas Nagy, 2006 (ita) """ Batched builds - compile faster instead of compiling object files one by one, c/c++ compilers are often able to compile at once: cc -c ../file1.c ../file2.c ../file3.c Files are output on the directory where the compiler is called, and dependencies...
# Copyright 2016 Mycroft AI, Inc. # # This file is part of Mycroft Core. # # Mycroft Core 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 versio...
# -*- coding: utf-8 -*- ''' Manage PHP pecl extensions. ''' from __future__ import absolute_import # Import python libs import re import logging try: from shlex import quote as _cmd_quote # pylint: disable=E0611 except ImportError: from pipes import quote as _cmd_quote # Import salt libs import salt.utils ...
# -*- encoding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from openerp.osv import fields, osv from openerp.tools.translate import _ from openerp import SUPERUSER_ID from openerp.tools import DEFAULT_SERVER_DATETIME_FORMAT as DF from openerp.addons.website.models.website impor...
# -*- coding: utf-8 -*- import time from module.plugins.internal.Account import Account from module.common.json_layer import json_loads class FileserveCom(Account): __name__ = "FileserveCom" __type__ = "account" __version__ = "0.22" __status__ = "testing" __description__ = """Fileserve.c...
# # Newfies-Dialer License # http://www.newfies-dialer.org # # 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/. # # Copyright (C) 2011-2014 Star2Billing S.L. # # The Initia...
#! /usr/bin/env python # # Implementation of elliptic curves, for cryptographic applications. # # This module doesn't provide any way to choose a random elliptic # curve, nor to verify that an elliptic curve was chosen randomly, # because one can simply use NIST's standard curves. # # Notes from X9.62-1998 (draft): # ...
""" Tests course_creators.admin.py. """ from django.test import TestCase from django.contrib.auth.models import User from django.contrib.admin.sites import AdminSite from django.http import HttpRequest import mock from course_creators.admin import CourseCreatorAdmin from course_creators.models import CourseCreator fr...
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2010-2012 OpenERP s.a. (<http://openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms of ...
from __future__ import unicode_literals, division, absolute_import from builtins import * # noqa pylint: disable=unused-import, redefined-builtin import logging from flexget import plugin from flexget.event import event log = logging.getLogger("archetorrent") class UrlRewriteArchetorrent(object): """Archetorr...
""" Test Suites ----------- Provides a LazySuite, which is a suite whose test list is a generator function, and ContextSuite,which can run fixtures (setup/teardown functions or methods) for the context that contains its tests. """ from __future__ import generators import logging import sys import unittest from nose....
#!/usr/bin/env python # Copyright (c) 2009 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. """ Verifies simple build of a "Hello, world!" program with shared libraries, including verifying that libraries are rebuilt correctly when ...
# Copyright 2015 OpenStack Foundation # # 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 ...
# -*- 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...
"""Misc subprocess tests""" import unittest import os import sys import signal import time from test import test_support from subprocess import PIPE, Popen, _cmdline2list class TerminationAndSignalTest(unittest.TestCase): def setUp(self): program = ''' import signal, sys def print_signal(signum, frame):...
# -*- encoding: utf-8 -*- ############################################################################## # # Tracks Authentication Attempts and Prevents Brute-force Attacks module # Copyright (C) 2015-Today GRAP (http://www.grap.coop) # @author Sylvain LE GAL (https://twitter.com/legalsylvain) # # This prog...
from sympy import Matrix, Tuple, symbols, sympify, Basic, Dict, S, FiniteSet, Integer from sympy.core.containers import tuple_wrapper from sympy.utilities.pytest import raises from sympy.core.compatibility import is_sequence, iterable, u, range def test_Tuple(): t = (1, 2, 3, 4) st = Tuple(*t) assert set(...
# -- coding: utf-8 -- #from ptrace.debugger.child import createChild from os import system, dup2, close, open as fopen, O_RDONLY from sys import stdin from os import ( fork, execv, execve, getpid, close, dup2, devnull, O_RDONLY) from ptrace.binding import ptrace_traceme from ptrace import PtraceError from re...
# # 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...
# -*- coding: utf-8 -*- from django.conf.urls import url, include from django.views.decorators.csrf import csrf_exempt from rest_framework import routers from . import api from . import views api_router = routers.DefaultRouter() api_router.register(r'topics', api.TopicApiView) api_router.register(r'post', api.PostApiV...
#!/usr/bin/python # # Created on Aug 25, 2016 # @author: Gaurav Rastogi ([EMAIL]) # Eric Anderson ([EMAIL]) # module_check: supported # Avi Version: 16.3.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 Licen...
# # 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...
import os.path class CompsIcons: ''' This class manages the access to group name and icons ''' def __init__(self, rpm_groups, icon_path=None): if icon_path: self.icon_path = icon_path if icon_path.endswith("/") else icon_path + "/" else: self.icon_path = "/usr/s...
""" Database models for AI assessment. """ from uuid import uuid4 import json import logging from django.conf import settings from django.core.files.base import ContentFile from django.core.cache import cache, get_cache from django.db import models, transaction, DatabaseError from django.utils.timezone import now from ...
# 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. # This file helps gyp_chromium and landmines correctly set up the gyp # environment from chromium.gyp_env on disk import os SCRIPT_DIR = os.path.dirnam...
# -*- coding: utf-8 -*- """ *************************************************************************** validitycheck.py --------------------- Date : January 2019 Copyright : (C) 2019 by Nyall Dawson Email : nyall dot dawson at gmail dot com ***************...
#! /usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requi...
#!/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...
# -*- coding: utf-8 -*- """ werkzeug.contrib.cache ~~~~~~~~~~~~~~~~~~~~~~ The main problem with dynamic Web sites is, well, they're dynamic. Each time a user requests a page, the webserver executes a lot of code, queries the database, renders templates until the visitor gets the page he sees. ...
from django.contrib.sessions.backends.base import SessionBase, CreateError from django.core.cache import cache KEY_PREFIX = "django.contrib.sessions.cache" class SessionStore(SessionBase): """ A cache-based session store. """ def __init__(self, session_key=None): self._cache = cache s...
import numpy as np import pandas as pd from xray.core import ops, utils from xray.core.pycompat import OrderedDict from . import TestCase class TestSafeCastToIndex(TestCase): def test(self): dates = pd.date_range('2000-01-01', periods=10) x = np.arange(5) td = x * np.timedelta64(1, 'D') ...
# Copyright 2014 IBM 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 ...
"""Constants related to IStorage and related interfaces This file was generated by h2py from d:\msdev\include\objbase.h then hand edited, a few extra constants added, etc. """ STGC_DEFAULT = 0 STGC_OVERWRITE = 1 STGC_ONLYIFCURRENT = 2 STGC_DANGEROUSLYCOMMITMERELYTODISKCACHE = 4 STGC_CONSOLIDATE = 8 S...
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt import unittest import frappe from frappe.utils import today from erpnext.hr.doctype.employee.employee import make_salary_structure from erpnext.hr.doctype.salary_structure.salary_structure...
#!/usr/bin/python import h5py import sys import numpy as np import os import re import random # find the path to my own python function: cur_dir=os.getcwd() sep='test_cases' test_DIR=cur_dir.split(sep,1)[0] scriptDIR=test_DIR+'compare_function' sys.path.append(scriptDIR) # import my own function for color and comparat...
# this is a virtual module that is entirely implemented server side DOCUMENTATION = ''' --- module: template version_added: historical short_description: Templates a file out to a remote server. description: - Templates are processed by the Jinja2 templating language (U(http://jinja.pocoo.org/docs/)) - doc...
""" Testing signals emitted on changing m2m relations. """ from django.db import models from django.test import TestCase from .models import Car, Part, Person, SportsCar class ManyToManySignalsTest(TestCase): def m2m_changed_signal_receiver(self, signal, sender, **kwargs): message = { 'insta...
# coding: utf-8 # BlackSmith mark.2 # exp_name = "muc" # /code.py v.x9 # Id: 05~5c # Code © (2009-2012) by WitcherGeralt [[EMAIL]] class expansion_temp(expansion): def __init__(self, name): expansion.__init__(self, name) def command_subject(self, stype, source, body, disp): if Chats.has_key(source[1]): ...
#-*-coding:utf-8-*- import sys reload(sys) sys.setdefaultencoding('utf-8') from numpy import * def loadDataSet(): dataMat = []; labelMat = [] fr = open('testSet.txt') for line in fr.readlines(): lineArr = line.strip().split() dataMat.append([1.0,float(lineArr[0]),float(lineArr[1])]) ...
# -*- coding: utf-8 -*- """ werkzeug.contrib.fixers ~~~~~~~~~~~~~~~~~~~~~~~ .. versionadded:: 0.5 This module includes various helpers that fix bugs in web servers. They may be necessary for some versions of a buggy web server but not others. We try to stay updated with the status of the bug...
#!/usr/bin/env python2 # # Copyright (c) 2014, 2016 ARM Limited # All rights reserved # # The license below extends only to copyright in the software and shall # not be construed as granting a license to any other intellectual # property including but not limited to intellectual property relating # to a hardware implem...
# Copyright (C) 2001-2006 Python Software Foundation # Author: Barry Warsaw # Contact: [EMAIL] """Class representing message/* MIME documents.""" __all__ = ['MIMEMessage'] from email import message from email.mime.nonmultipart import MIMENonMultipart class MIMEMessage(MIMENonMultipart): """Class representing...
# Copyright (C) 2020 ycmd contributors # # This file is part of ycmd. # # ycmd 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. # # ycmd...
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2018, Kevin Breit (@kbreit) <[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_versio...
#!/usr/bin/env python # Created: Wed May 29 08:07:18 2002 # [EMAIL], [EMAIL] # Copyright 2001 by Thomas Sicheritz-Ponten and Cecilia Alsmark. # All rights reserved. # This code is part of the Biopython distribution and governed by its # license. Please see the LICENSE file that should have been included # as part of t...
# -*- coding: utf-8 -*- import ipaddress __all__ = [ 'config_to_map', 'get_region' ] def config_to_map(topology_config): """ args: topology_config: dict { 'region1': [ '10.1.1.0/24', '10.1.10.0/24', '172.1...
# -*- 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...
from typing import Tuple import h2.config import h2.connection import h2.events from mitmproxy.http import HTTPFlow from mitmproxy.proxy.context import Context from mitmproxy.proxy.layers.http import HTTPMode from mitmproxy.proxy.commands import CloseConnection, OpenConnection, SendData from mitmproxy.connection impo...
#!/usr/bin/env 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. """These functions are executed via gyp-sun-tool when using the Makefile generator.""" import fcntl import os import struct import subproces...
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2012, Michael DeHaan <[EMAIL]> # (c) 2016, Toshio Kuratomi <[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...
import json,glob,os import dicom outdir='/scratch/01329/poldrack/selftracking/ds031/sub00001/ses105/fieldmap' washubase='/scratch/01329/poldrack/selftracking/washu' basedirs=['vc39556','vc39556_2'] fmseries=[[5,10,21],[5,17]] ctr=1 for i in range(2): basedir=os.path.join(washubase,basedirs[i]) for j in range(...
""" Tests for rose. """ import numpy as np import pytest from pygmt import Figure from pygmt.datasets import load_fractures_compilation @pytest.fixture(scope="module", name="data") def fixture_data(): """ Load the sample numpy array data. """ return np.array( [[40, 60], [60, 300], [20, 180], [...
# 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...
# # Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2000-2007 Donald N. Allingham # Copyright (C) 2009 Gary Burton # Copyright (C) 2009-2010 Nick Hall # Copyright (C) 2009 Benny Malengier # # This program is free software; you can redistribute it and/or modify # it under the terms of the G...
""" Python implementation of the fast ICA algorithms. Reference: Tables 8.3 and 8.4 page 196 in the book: Independent Component Analysis, by Hyvarinen et al. """ # Authors: Pierre Lafaye de Micheaux, Stefan van der Walt, Gael Varoquaux, # Bertrand Thirion, Alexandre Gramfort, Denis A. Engemann # License: BS...
#!/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...
# Copyright 2020 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...
""" Utility functions for PyMS wide use """ ############################################################################# # # # PyMS software for processing of metabolomic mass-spectrometry data # # Copyright (C) 2005-2012 V...
# tempfile.py unit tests. import tempfile import os import sys import re import warnings import unittest from test import support if hasattr(os, 'stat'): import stat has_stat = 1 else: has_stat = 0 has_textmode = (tempfile._text_openflags != tempfile._bin_openflags) has_spawnl = hasattr(os, 'spawnl') #...
import datetime from django.db import models from django.db.models.fields.related import \ ReverseSingleRelatedObjectDescriptor from django.utils.encoding import python_2_unicode_compatible from django.utils.translation import get_language @python_2_unicode_compatible class Country(models.Model): # Table Col...
# $Id: fr.py 4564 2006-05-21 20:44:42Z wiemann $ # Authors: David Goodger <[EMAIL]>; William Dode # Copyright: This module has been placed in the public domain. # New language mappings are welcome. Before doing a new translation, please # read <http://docutils.sf.net/docs/howto/i18n.html>. Two files must be # transl...
import platform import os from six import BytesIO def rel_path_to_url(rel_path, url_base="/"): assert not os.path.isabs(rel_path) if url_base[0] != "/": url_base = "/" + url_base if url_base[-1] != "/": url_base += "/" return url_base + rel_path.replace(os.sep, "/") def from_os_path(...
import os import sys from distutils.core import setup from distutils.sysconfig import get_python_lib # Warn if we are installing over top of an existing installation. This can # cause issues where files that were deleted from a more recent Django are # still present in site-packages. See #18115. overlay_warning = Fal...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Simple built-in backend. """ __author__ = "Lluís Vilanova <[EMAIL]>" __copyright__ = "Copyright 2012, Lluís Vilanova <[EMAIL]>" __license__ = "GPL version 2 or (at your option) any later version" __maintainer__ = "Stefan Hajnoczi" __email__ = "[EMAIL]" ...
#!/usr/bin/env python # W.J. van der Laan, 2011 # Make spinning .mng animation from a .png # Requires imagemagick 6.7+ from __future__ import division from os import path from PIL import Image from subprocess import Popen SRC='img/reload_scaled.png' DST='../../src/qt/res/movies/update_spinner.mng' TMPDIR='/tmp' TMPNAM...
import web import logging #import model #import markdown import pymongo from pymongo.code import Code import re from pymongo.objectid import ObjectId import json from datetime import datetime from sets import Set from collections import defaultdict logging.basicConfig(level=logging.INFO) conn = pymongo.Connection() db...
# mad.py # Alf Clement 27-Mar-2014 # zero=0 three=3 print("1") print("2") print(three) print("{}".format(4)) five=25//5 print(int(five)) j=0 for i in range(4): j += i print(j) print(3+4) try: a=4//zero except: print(8) print("xxxxxxxxx".count("x")) def ten(): return 10 print(ten()) a=[] for i in range(13): a.appen...
"""Crypto utilities.""" import contextlib import logging import socket import sys from six.moves import range # pylint: disable=import-error,redefined-builtin import OpenSSL from acme import errors logger = logging.getLogger(__name__) # DVSNI certificate serving and probing is not affected by SSL # vulnerabiliti...
# Copyright 2014 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 req...
from collections import defaultdict from openerp.tools import mute_logger from openerp.tests import common UID = common.ADMIN_USER_ID class TestORM(common.TransactionCase): """ test special behaviors of ORM CRUD functions TODO: use real Exceptions types instead of Exception """ def setUp(self):...
import unittest, random, sys, time sys.path.extend(['.','..','../..','py']) import h2o, h2o_browse as h2b, h2o_exec as h2e, h2o_import as h2i, h2o_cmd initList = [ ('r', 'r=i.hex'), ] exprList = [ "a=c(1,2,3); a = r[r[,1]>2,]", "a=c(1,2,3); a = r[r[,1]>10,]", ] class Basic(unittest.TestCa...
#!/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. """A utility script to help building Syzygy-instrumented Chrome binaries.""" import glob import logging import optparse import os ...
import dataclasses from typing import ClassVar @dataclasses.dataclass class A1: bar1: int <error descr="Fields with a default value must come after any fields without a default.">baz1</error>: int = 1 foo1: int <error descr="Fields with a default value must come after any fields without a default.">ba...
# Copyright 2012 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Copyright 2012 Nebula, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the...
from zipline.assets import Equity from zipline.finance.slippage import SlippageModel from zipline.utils.sentinel import sentinel class TestingSlippage(SlippageModel): """ Slippage model that fills a constant number of shares per tick, for testing purposes. Parameters ---------- filled_per_tic...
#!/usr/bin/python -tt # # Copyright (c) 2009, 2010, 2011 Intel, 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; version 2 of the License # # This program is distributed in the hope that i...
"""This module is for parsing manual pages and extracting necessary information for creating a metaGUI. Needed capabilities: * Retrieve text of a given manpage * Read manpage for a given program and create a list of command-line options, with expected parameters and accompanying paragraph(s) of documentation. """...