text
stringlengths
475
200k
# -*- coding: utf-8 *-* import pyglet from . import util from . import resources from . import physicalobject from . import ship as ship_ import random def asteroid(player_pos=(-1000,-1000), screensize=(800,600), score=0, *args, **kwargs): """spawns an asteroid at random position""" pos = util.random_pos(sc...
import numpy as np import theano import theano.tensor as T import lasagne as nn import data import load import nn_plankton import dihedral import dihedral_fast import tmp_dnn import tta validation_split_path = "splits/bagging_split_17.pkl" patch_sizes = [(95, 95), (47, 47)] augmentation_params = { 'zoom_ran...
import network import time from umqtt.simple import MQTTClient from lights import * from traffic import * # Config wifi_ssid = "HaSi-Kein-Internet-Legacy" wifi_psk = "bugsbunny" mqtt_server = "mqtt.hasi" mqtt_client_name = "traffic_light" mqtt_topic = "hasi/lights/traffic_light" # State lights_on = True mqtt_client =...
# -*- coding: utf-8 -*- """ Tests for tipfyext.mako """ import os import sys import unittest from tipfy import RequestHandler, Request, Response, Tipfy from tipfy.app import local from tipfyext.mako import Mako, MakoMixin import test_utils current_dir = os.path.abspath(os.path.dirname(__file__)) templates_dir = ...
''' Tesselate Demonstration ======================= This demonstrates the experimental library for tesselating polygons. You should see a hollow square with some buttons below it. You can click and drag to create additional shapes, watching the number of vertexes and elements at the top of the screen. The 'debug' butt...
# Copyright 2012 Hewlett-Packard Development Company, L.P. # # 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...
import httplib import myparser import time import sys class search_baidu: def __init__(self, word, limit): self.word = word self.total_results = "" self.server = "www.baidu.com" self.hostname = "www.baidu.com" self.userAgent = "(Mozilla/5.0 (Windows; U; Windows NT 6.0;en-U...
from io import StringIO from django.core.management import call_command from django.test import TestCase from django.utils import timezone from geotrek.feedback.models import Report from geotrek.feedback.factories import ReportFactory class TestRemoveEmailsOlders(TestCase): """Test command erase_emails, if olde...
# Part of Odoo. See LICENSE file for full copyright and licensing details. import time from openerp import api, fields, models, _ import openerp.addons.decimal_precision as dp from openerp.exceptions import UserError class SaleAdvancePaymentInv(models.TransientModel): _name = "sale.advance.payment.inv" _desc...
# Licensed to the StackStorm, Inc ('StackStorm') 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 th...
from tests.unit import unittest from tests.compat import mock from boto.ec2.elb import ELBConnection from boto.ec2.elb import LoadBalancer from boto.ec2.elb.attributes import LbAttributes ATTRIBUTE_GET_TRUE_CZL_RESPONSE = b"""<?xml version="1.0" encoding="UTF-8"?> <DescribeLoadBalancerAttributesResponse xmlns="http:...
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is mozilla.org code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights Reserved. ...
import urlparse try: from functools import wraps except ImportError: from django.utils.functional import wraps # Python 2.4 fallback. from django.conf import settings from django.contrib.auth import REDIRECT_FIELD_NAME from django.utils.decorators import available_attrs def user_passes_test(test_func, login...
# Copyright (C) 2014 Nippon Telegraph and Telephone Corporation. # # 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...
# 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...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Copyright (c) 2013 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 # # ...
import urwid import blinker import textwrap from mitmproxy.tools.console import layoutwidget from mitmproxy.tools.console import signals HELP_HEIGHT = 5 command_focus_change = blinker.Signal() class CommandItem(urwid.WidgetWrap): def __init__(self, walker, cmd, focused): self.walker, self.cmd, self.focu...
"""Python 'uu_codec' Codec - UU content transfer encoding. This codec de/encodes from bytes to bytes and is therefore usable with bytes.transform() and bytes.untransform(). Written by Marc-Andre Lemburg ([EMAIL]). Some details were adapted from uu.py which was written by Lance Ellinghouse and modified by Jack Jansen ...
# # Copyright (c) 2015 Intel Corporation # # Author: Alberto Murillo <[EMAIL]> # Author: Victor Morales <[EMAIL]> # # 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.or...
"""Views fo the node settings page.""" # -*- coding: utf-8 -*- import logging import httplib as http from dropbox.rest import ErrorResponse from dropbox.client import DropboxClient from urllib3.exceptions import MaxRetryError from framework.exceptions import HTTPError from website.addons.dropbox.serializer import Dro...
#!/usr/bin/env python """Some multiclient flows aka hunts.""" import threading import logging from grr.lib import aff4 from grr.lib import config_lib from grr.lib import data_store from grr.lib import flow from grr.lib import rdfvalue from grr.lib import registry from grr.lib import stats from grr.lib import utils...
from django.core.management.base import BaseCommand, CommandError class Command(BaseCommand): help = "Useless command." def add_arguments(self, parser): parser.add_argument('args', metavar='app_label', nargs='*', help='Specify the app label(s) to works on.') parser.add_argument('-...
# # Copyright 2012-2013 eNovance <[EMAIL]> # # Author: Julien Danjou <[EMAIL]> # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless r...
# coding=utf-8 from __future__ import unicode_literals from .. import Provider as AddressProvider class Provider(AddressProvider): """ Korean Address Provider ======================= Korea has two address and postal code system. Address ------- - Address based on land parcel numbers ...
#!/usr/bin/env python3 import shutil, os, argparse, sys, stat,errno import CppHeaderParser from string import replace from argparse import Action sys.path.append(os.path.join(os.path.dirname(os.path.dirname(__file__)), "pyUtils")) from color_text import ColorText as CT from headInGraph import * testerBodyTemplate = "...
# Copyright (C) 2009 Google Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the...
"""Temporary files. This module provides generic, low- and high-level interfaces for creating temporary files and directories. The interfaces listed as "safe" just below can be used without fear of race conditions. Those listed as "unsafe" cannot, and are provided for backward compatibility only. This module also pr...
# -*- coding: utf-8 -*- # # 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, softw...
from setuptools import setup def read(path): """ Read the contents of a file. """ with open(path) as f: return f.read() setup( classifiers=[ 'Intended Audience :: Developers', 'License :: OSI Approved :: Apache Software License', 'Operating System :: OS Independen...
#!/usr/bin/python # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distributed...
# -*- coding: utf-8 -*- # (c) 2016, James Cammarata <[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 your option)...
# # 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 ...
from itertools import izip from django.db.backends.util import truncate_name from django.db.models.sql import compiler from django.db.models.sql.constants import TABLE_NAME from django.db.models.sql.query import get_proxied_model SQLCompiler = compiler.SQLCompiler class GeoSQLCompiler(compiler.SQLCompiler): def ...
# 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...
""" Tests for utility functions in external_auth module """ from django.test import TestCase from external_auth.views import _safe_postlogin_redirect class ExternalAuthHelperFnTest(TestCase): """ Unit tests for the external_auth.views helper function """ def test__safe_postlogin_redirect(self): ...
# -*- coding: utf-8 -*- """ requests.auth ~~~~~~~~~~~~~ This module contains the authentication handlers for Requests. """ import os import re import time import hashlib import logging from base64 import b64encode from .compat import urlparse, str from .utils import parse_dict_header log = logging.getLogger(__nam...
#!/usr/bin/env python # # Copyright (c) 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Updates the Chrome reference builds. Use -r option to update a Chromium reference build, or -b option for Chrome official bui...
# 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 ...
# -*- 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 django.http import HttpResponse, Http404 from django.template import loader from django.contrib.sites.models import Site from django.core import urlresolvers from django.utils.encoding import smart_str from django.core.paginator import EmptyPage, PageNotAnInteger def index(request, sitemaps): current_site = S...
# Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use ...
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
from django.contrib.contenttypes.fields import ( GenericForeignKey, GenericRelation, ) from django.contrib.contenttypes.models import ContentType from django.db import models class Episode(models.Model): name = models.CharField(max_length=100) length = models.CharField(max_length=100, blank=True) auth...
""" Windows/OS2 Bitmap (BMP) this could have been a perfect show-case file format, but they had to make it ugly (all sorts of alignment or """ from construct import * #=============================================================================== # pixels: uncompressed #==============================================...
from nose.tools import ok_, eq_ from elasticsearch_dsl import query from kuma.wiki.models import Document from kuma.wiki.search import WikiDocumentType from . import ElasticTestCase class WikiDocumentTypeTests(ElasticTestCase): fixtures = ElasticTestCase.fixtures + ['wiki/documents.json'] def test_get_exc...
"""Basic checks for HomeKitclimate.""" from aiohomekit.model.characteristics import ( ActivationStateValues, CharacteristicsTypes, CurrentHeaterCoolerStateValues, SwingModeValues, TargetHeaterCoolerStateValues, ) from aiohomekit.model.services import ServicesTypes from homeassistant.components.clim...
# Copyright (C) 2019 The ESPResSo project # # This file is part of ESPResSo. # # ESPResSo 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...
# # spyne - Copyright (C) Spyne contributors. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This libra...
# -*- coding: utf-8 -*- # Copyright 2011-2012 Antoine Bertin <[EMAIL]> # # This file is part of subliminal. # # subliminal is free software; you can redistribute it and/or modify it under # the terms of the GNU Lesser General Public License as published by # the Free Software Foundation; either version 3 of the License...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # GuessIt - A library for guessing information from filenames # Copyright (c) 2013 Nicolas Wack <[EMAIL]> # # GuessIt is free software; you can redistribute it and/or modify it under # the terms of the Lesser GNU General Public License as published by # the Free Software ...
"""Test the cross_validation module""" from __future__ import division import warnings import numpy as np from scipy.sparse import coo_matrix from scipy import stats from sklearn.utils.testing import assert_true from sklearn.utils.testing import assert_false from sklearn.utils.testing import assert_equal from sklearn...
""" 17. Custom column/table names If your database column name is different than your model attribute, use the ``db_column`` parameter. Note that you'll use the field's name, not its column name, in API usage. If your database table name is different than your model name, use the ``db_table`` Meta attribute. This has...
#!/usr/bin/env python import sys for i in range(0, len(sys.argv)): if sys.argv[i] == '-A' and i < len(sys.argv)-1: sys.path = sys.path + [sys.argv[i+1]] import vtk from vtk.util.misc import vtkRegressionTestImage, vtkGetDataRoot # create planes # Create the RenderWindow, Renderer # ren = vtk.vtkRenderer...
import collections import ctypes import itertools import logging import multiprocessing import os import pickle import textwrap import unittest from importlib import import_module from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.db import DEFAULT_DB_ALIAS, connection...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright (c) 2015 Midokura Europe SARL, All Rights Reserved. # 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://w...
# Protocol Buffers - Google's data interchange format # Copyright 2008 Google Inc. All rights reserved. # http://code.google.com/p/protobuf/ # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions o...
from __future__ import unicode_literals import json from django.contrib.gis.geos import LinearRing, Point, Polygon from django.core import serializers from django.test import TestCase, mock, skipUnlessDBFeature from django.utils import six from .models import City, MultiFields, PennsylvaniaCity @skipUnlessDBFeatur...
""" The Ramer-Douglas-Peucker algorithm roughly ported from the pseudo-code provided by http://en.wikipedia.org/wiki/Ramer-Douglas-Peucker_algorithm """ from math import sqrt def distance(a, b): return sqrt((a[0] - b[0]) ** 2 + (a[1] - b[1]) ** 2) def point_line_distance(point, start, end): if (start == en...
#!/usr/bin/env python # -*- coding: utf8 -*- # ***************************************************************** # ** PTS -- Python Toolkit for working with SKIRT ** # ** © Astronomical Observatory, Ghent University ** # ***************************************************************** ##...
# Copyright 2013 Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agre...
#!/usr/bin/env python -u ############################################################################## # # Copyright (c) 2007 Agendaless Consulting and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the BSD-like license at # http://www.repoze.org/LICENSE.txt. A copy of the lice...
from __future__ import print_function import signal import subprocess import sys import logging from datetime import datetime from threading import Thread from Queue import Queue, Empty # # This code comes from Honcho. Didn't need the whole Honcho # setup, so I just swiped this part which is what the build # pa...
from kolekto.commands import Command from kolekto.printer import printer from kolekto.helpers import get_hash class FlagCommand(Command): flags = [] # Flags to set when this flag is set unset_flags = [] # Flags to unset when this flag is set unflag_unset_flags = [] # Flags to unset when this flag is u...
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2014, Brian Coca <[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', ...
#!/usr/bin/env python # coding: utf8 # (c) 2014 Dominic Springer # File licensed under GNU GPL (see HARP_License.txt) from Imports_Basic import * #||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| class Base_Encoder(object): #||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| #Name ...
import unittest from mock import * from rabbit import settings from rabbit.app import App from rabbit.config import Config from rabbit.command import Command from rabbit.group import Group class TestApp(unittest.TestCase): def test_it_creates_CONFIG_FILE_global(self): self.assertNotEqual(settings.CONFIG_FILE, Non...
# Copyright (c) 2014 Museum Victoria # This software is released under the MIT license (see license.txt for details) '''This node demonstrates a simple udp controller.''' import socket # Functions used by this node def send_udp_string(msg): #open socket sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) t...
# Copyright 2008 (C) Nicira, Inc. # # This file is part of NOX. # # NOX 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. # # NOX is d...
# vim:ts=4:sw=4:sts=4:et # -*- coding: utf-8 -*- """ Statistics related stuff in igraph """ import math __all__ = ( "FittedPowerLaw", "Histogram", "RunningMean", "mean", "median", "percentile", "quantile", "power_law_fit", ) class FittedPowerLaw(object): """Result of fitting a po...
"""Locally Linear Embedding""" # Author: Fabian Pedregosa -- <[EMAIL]> # Jake Vanderplas -- <[EMAIL]> # License: BSD 3 clause (C) INRIA 2011 import numpy as np from scipy.linalg import eigh, svd, qr, solve from scipy.sparse import eye, csr_matrix from scipy.sparse.linalg import eigsh from ..base import Base...
from django.conf import settings from django.test import TestCase from django.test.utils import override_settings import track.tracker as tracker from track.backends import BaseBackend SIMPLE_SETTINGS = { 'default': { 'ENGINE': 'track.tests.test_tracker.DummyBackend', 'OPTIONS': { 'fl...
"""Test the customize helper.""" import homeassistant.helpers.customize as customize from voluptuous import MultipleInvalid import pytest class MockHass(object): """Mock object for HassAssistant.""" data = {} class TestHelpersCustomize(object): """Test homeassistant.helpers.customize module.""" de...
""" >>> from django.core.paginator import Paginator >>> from pagination.templatetags.pagination_tags import paginate >>> from django.template import Template, Context >>> p = Paginator(range(15), 2) >>> paginate({'paginator': p, 'page_obj': p.page(1)})['pages'] [1, 2, 3, 4, 5, 6, 7, 8] >>> p = Paginator(range(17), 2)...
"""distutils.fancy_getopt Wrapper around the standard getopt module that provides the following additional features: * short and long options are tied together * options have help strings, so fancy_getopt could potentially create a complete usage summary * options set attributes of a passed-in object """ im...
from __future__ import absolute_import, division, print_function import os import re import shutil import stat def ensure_directory(directory, *args, **kwargs): # Fail if the destination exists and it's not a directory if not os.path.isdir(directory): os.makedirs(directory, *args, **kwargs) def cop...
# Brownian motion -- an example of a NON multi-threaded Tkinter program ;) # By Michele Simoniato, inspired by brownian.py from Tkinter import * import random import sys WIDTH = 400 HEIGHT = 300 SIGMA = 10 BUZZ = 2 RADIUS = 2 LAMBDA = 10 FILL = 'red' stop = 0 # Set when main loop exits...
# 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 2011 OpenStack Foundation # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance wi...
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright 2015 clowwindy # # 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 b...
# -*- coding: utf-8 -*- """ The rrule module offers a small, complete, and very fast, implementation of the recurrence rules documented in the `iCalendar RFC <http://www.ietf.org/rfc/rfc2445.txt>`_, including support for caching of results. """ import itertools import datetime import calendar import sys try: from ...
"""recipeIdentifier.py This module contains code for creating hashes to identify recipes based on title & instructions (recipe hash) or based on ingredients (ingredient hash). The hash_recipe function is a convenience function that provide both a recipe hash and an ingredient hash. For individual hashes, use the get...
#!/usr/bin/env python # Copyright (c) 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import sys import os import unittest SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__)) BUILD_TOOLS_DIR = os.path.dirname(SCRI...
""" Tests for the rss_proxy views """ from django.test import TestCase from django.core.urlresolvers import reverse from mock import patch, Mock from rss_proxy.models import WhitelistedRssUrl class RssProxyViewTests(TestCase): """ Tests for the rss_proxy views """ def setUp(self): super(RssProxyViewT...
# -*- coding: utf-8 -*- # # gPodder - A media aggregator and podcast client # Copyright (c) 2005-2010 Thomas Perl and the gPodder Team # # gPodder 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...
""" CodeHilite Extension for Python-Markdown ======================================== Adds code/syntax highlighting to standard Python-Markdown code blocks. Copyright 2006-2008 [Waylan Limberg](http://achinghead.com/). Project website: <http://packages.python.org/Markdown/extensions/code_hilite.html> Contact: [EMAIL...
# -*- coding: utf-8 -*- from openerp.osv import osv class account_invoice(osv.Model): _inherit = 'account.invoice' def invoice_validate_send_email(self, cr, uid, ids, context=None): Composer = self.pool['mail.compose.message'] for invoice in self.browse(cr, uid, ids, context=context): ...
data = ( 'Cu ', # 0x00 'Qu ', # 0x01 'Chao ', # 0x02 'Wa ', # 0x03 'Zhu ', # 0x04 'Zhi ', # 0x05 'Mang ', # 0x06 'Ao ', # 0x07 'Bie ', # 0x08 'Tuo ', # 0x09 'Bi ', # 0x0a 'Yuan ', # 0x0b 'Chao ', # 0x0c 'Tuo ', # 0x0d 'Ding ', # 0x0e 'Mi ', # 0x0f 'Nai ', # 0x10 'Ding ...
# Copyright: (c) 2013, James Cammarata <[EMAIL]> # Copyright: (c) 2018-2021, 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 import json import os.path import re import ...
# Copyright (c) 2001-2004 Twisted Matrix Laboratories. # See LICENSE for details. """The Finger User Information Protocol (RFC 1288)""" from twisted.protocols import basic import string class Finger(basic.LineReceiver): def lineReceived(self, line): parts = string.split(line) if not parts: ...
"""Date and time functions Refactored from Cufflinks' 'date_tools.py' module. Credits to @jorgesantos. """ import datetime as dt def get_date_from_today(delta, strfmt='%Y%m%d'): """ Returns a string that represents a date n numbers of days from today. Parameters ---------- delta : int ...
#!/usr/bin/env python2 # Copyright (c) 2014 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # Exercise the getchaintips API. We introduce a network split, work # on chains of different lengths, and joi...
# Copyright 2017 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agree...
#!/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. """ """ import TestGyp test = TestGyp.TestGyp() test.run_gyp('build/all.gyp', chdir='src') test.relocate('src', 'relocate/src') test.bu...
# -*- coding: utf-8 -*- """ Tablib - YAML Support. """ import sys try: import yaml except ImportError: if sys.version_info[0] > 2: import tablib.packages.yaml3 as yaml else: import tablib.packages.yaml as yaml import tablib title = 'yaml' extentions = ('yaml', 'yml') def export_se...
"""MIME-Type Parser This module provides basic functions for handling mime-types. It can handle matching mime-types against a list of media-ranges. See section 14.1 of the HTTP specification [RFC 2616] for a complete explaination. http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.1 Contents: - par...
# -*- coding: utf-8 -*- from openerp import SUPERUSER_ID from openerp.osv import osv, fields import openerp.addons.decimal_precision as dp from openerp.tools.translate import _ class ProcurementOrder(osv.Model): _inherit = "procurement.order" def create(self, cr, user, vals, context=None): if contex...
#!/usr/bin/env python #-*- coding: utf-8 -*- #This software is distributed under the Creative Commons license (CC0) version 1.0. A copy of this license should have been distributed with this software. #The license can also be read online: <https://creativecommons.org/publicdomain/zero/1.0/>. If this online license dif...
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
import copy import json import logging import os import pprint import subprocess import tempfile, shutil import time from bson.objectid import ObjectId from django.core.mail import send_mail from django.core.urlresolvers import reverse from django.http import HttpResponse from django.shortcuts import render_to_respons...
# # This file is part of the LibreOffice project. # # 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/. # # This file incorporates work covered by the following license noti...