text
stringlengths
475
200k
from __future__ import division from sympy import (Abs, I, Dummy, Rational, Float, S, Symbol, cos, oo, pi, simplify, sin, sqrt, symbols, Derivative, asin, acos) from sympy.geometry import (Circle, Curve, Ellipse, GeometryError, Line, Point, Polygon, Ray, RegularPolygon, S...
import sys,traceback,urllib2,re, urllib,xbmc def createCookie(url,cj=None,agent='Mozilla/5.0 (Windows NT 6.1; rv:32.0) Gecko/20100101 Firefox/32.0'): urlData='' try: import urlparse,cookielib,urllib2 class NoRedirection(urllib2.HTTPErrorProcessor): def http_response(self, reques...
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor from ..utils import int_or_none class R7IE(InfoExtractor): _VALID_URL = r'''(?x) https?:// (?: (?:[a-zA-Z]+)\.r7\.com(?:/[^/]+)+/idmedia/| ...
# -*- coding: utf-8 -*- ## ## This file is part of Invenio. ## Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011 CERN. ## ## Invenio 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 t...
""" PHP date() style date formatting See http://www.php.net/date for format strings Usage: >>> import datetime >>> d = datetime.datetime.now() >>> df = DateFormat(d) >>> print(df.format('jS F Y H:i')) 7th October 2003 11:39 >>> """ from __future__ import unicode_literals import calendar import datetime import re impo...
import unittest import mock import os import os.path from StringIO import StringIO import yaml import copy from textwrap import dedent from lxml import etree from js_test_tool.tests.helpers import TempWorkspaceTestCase from js_test_tool.suite import SuiteDescription, SuiteDescriptionError, \ SuiteRenderer, SuiteR...
# -*- coding: utf-8 -*- """QGIS Unit tests for QgsXmlUtils. .. note:: 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. """ __aut...
# Lint as: python2, python3 # Copyright 2018 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 # ...
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models, transaction class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'ProjectDomain' db.create_table('sentry_projectdomain', ( ('id', self.gf('...
''' 1. Create 1 Test VMs with VR. 2. After 1 VM created, Check VR Appliance VM ha status. @author: Quarkonics ''' import zstackwoodpecker.test_util as test_util import zstackwoodpecker.test_lib as test_lib import zstackwoodpecker.test_state as test_state import zstackwoodpecker.operations.ha_operations as...
import datetime import decimal import importlib import logging import re import sqlalchemy import sqlparse import sys import warnings class SQL(object): """Wrap SQLAlchemy to provide a simple SQL API.""" def __init__(self, url, **kwargs): """ Create instance of sqlalchemy.engine.Engine. ...
from .. import abc from .. import util machinery = util.import_importlib('importlib.machinery') import unittest class FindSpecTests(abc.FinderTests): """Test finding frozen modules.""" def find(self, name, path=None): finder = self.machinery.FrozenImporter return finder.find_spec(name, pat...
#!/usr/bin/python # coding=utf-8 ################################################################################ from test import CollectorTestCase from test import get_collector_config from test import unittest from test import run_only from mock import Mock from mock import patch from diamond.collector import Coll...
#!/usr/bin/python import datetime from sqlalchemy import and_ from turbogears.database import session from bkr.server.util import load_config from bkr.server.model import System, SystemStatus, SystemActivity, \ SystemStatusDuration from bkr.server.test.assertions import assert_durations_not_overlapping, \ ...
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
#!/usr/bin/python # coding: utf-8 -*- # (c) 2017, Wayne Witzel III <[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', ...
"""A library for integrating pyOpenSSL with CherryPy. The OpenSSL module must be importable for SSL functionality. You can obtain it from http://pyopenssl.sourceforge.net/ To use this module, set CherryPyWSGIServer.ssl_adapter to an instance of SSLAdapter. There are two ways to use SSL: Method One ---------- * ``s...
from datetime import datetime import logging import os import shutil from tinydb import TinyDB, Storage, where, Query import yaml from .utils import mkdir_open from .history import Repository from .credential import split_fullname, make_fullname class PasspieStorage(Storage): extension = ".pass" def __init...
# -------------------------------------------------------- # Fast/er R-CNN # Licensed under The MIT License [see LICENSE for details] # Written by Bharath Hariharan # -------------------------------------------------------- import xml.etree.ElementTree as ET import os import cPickle import numpy as np def parse_rec(f...
#!/usr/bin/python # # Copyright (C) 2008 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 ...
""" Module for holding colour code values. """ import os import re import sys try: # pylint: disable=F0401 from colorama import Fore, Style has_colorama = True except ImportError: has_colorama = False mswin = os.name == "nt" if mswin and has_colorama: white = Style.RESET_ALL ul = Style.DIM...
from .util import normalize_dates from .transcriptions import Transcriptions from .base import InstanceResource, ListResource class Recording(InstanceResource): subresources = [Transcriptions] def __init__(self, *args, **kwargs): super(Recording, self).__init__(*args, **kwargs) self.formats...
# Copyright (c) 2013, Frappe Technologies Pvt. Ltd. and contributors # For license information, please see license.txt from __future__ import unicode_literals import frappe from frappe import _ from erpnext.crm.report.campaign_efficiency.campaign_efficiency import get_lead_data def execute(filters=None): columns, da...
#!/usr/bin/env python # Copyright 2013 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Unit tests for the input.py file.""" import gyp.input import unittest import sys class TestFindCycles(unittest.TestCase): def setUp(self...
""" MAIN CLASS FOR TLS LITE (START HERE!). """ from __future__ import generators import socket from utils.compat import formatExceptionTrace from TLSRecordLayer import TLSRecordLayer from Session import Session from constants import * from utils.cryptomath import getRandomBytes from errors import * from messages impor...
# -*- coding: utf-8 -*- ''' Exodus Add-on Copyright (C) 2016 Exodus 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 l...
"""SCons.Tool.lex Tool-specific initialization for lex. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 The SCons Foundation # # Permiss...
from .tabulate import _text_type def pad(field, total, char=u" "): return field + (char * (total - len(field))) def get_separator(num, header_len, data_len): total_len = header_len + data_len + 1 sep = u"-[ RECORD {0} ]".format(num) if len(sep) < header_len: sep = pad(sep, header_len - 1, u"-...
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
# -*- coding: utf-8 -*- # # This file is part of NINJA-IDE (http://ninja-ide.org). # # NINJA-IDE 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 # any later version. # # NIN...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import django.contrib.sites.models class Migration(migrations.Migration): dependencies = [ ] operations = [ migrations.CreateModel( name='Site', fields=[ ...
""" MySQL database backend for Django. Requires mysqlclient: https://pypi.python.org/pypi/mysqlclient/ MySQLdb is supported for Python 2 only: http://sourceforge.net/projects/mysql-python """ from __future__ import unicode_literals import datetime import re import sys import warnings from django.conf import settings...
# # Copyright: Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # Make coding more python3-ish from __future__ import (absolute_import, division, print_function) __metaclass__ = type from units.compat.mock import patch from ansible.modules.network.onyx impor...
import requests from allauth.socialaccount.providers.oauth2.views import (OAuth2Adapter, OAuth2LoginView, OAuth2CallbackView) from .provider import TwitchProvider class TwitchOAuth2Adapter(OAuth2Adapt...
""" Django settings for spameggs project. For more information on this file, see https://docs.djangoproject.com/en/1.7/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.7/ref/settings/ """ # Build paths inside the project like this: os.path.join(BASE_DIR, ...) i...
# Copyright (C) 2008 One Laptop Per Child # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distribu...
"""Build a language detector model The goal of this exercise is to train a linear classifier on text features that represent sequences of up to 3 consecutive characters so as to be recognize natural languages by using the frequencies of short character sequences as 'fingerprints'. """ # Author: Olivier Grisel <[EMAIL...
# Copyright (c) 2009, Rotem Yaari <[EMAIL]> # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of source code must retain the above copyright # notice, this list of cond...
import xml.etree.ElementTree as etree import base64 from struct import unpack, pack import sys import io import os import time import itertools import xbmcaddon import xbmc import urllib2,urllib import traceback import urlparse import posixpath import re import hmac import hashlib import binascii import zlib from hash...
"""A collection of modules for iterating through different kinds of tree, generating tokens identical to those produced by the tokenizer module. To create a tree walker for a new type of tree, you need to do implement a tree walker object (called TreeWalker by convention) that implements a 'serialize' method taking a ...
#!/usr/bin/env python3 # vim: set ts=4 sts=4 sw=4 expandtab cc=80: # Copyright (c) 2014, 2016, chys <[EMAIL]> # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # Redistributions of source code ...
def main(request, response): import simplejson as json f = file('config.json') source = f.read() s = json.JSONDecoder().decode(source) url1 = "http://" + s['host'] + ":" + str(s['ports']['http'][1]) url2 = "http://" + s['host'] + ":" + str(s['ports']['http'][0]) _CSP = "style-src " + url1 ...
""" Use tabs for indentation. This rule check if the each line starts with a space. In addition, it suppresses the violation when the line contains only spaces and tabs. == Violation == void Hello() { [SPACE][SPACE]Hello(); <== Violation. Spaces are used for indentation. } == Good == void Hello()...
# -*- coding: utf-8 -*- import os import re import sys import shlex import subprocess import multiprocessing class NativeLib: def __init__ (self, apiVersion, abiVersion): self.apiVersion = apiVersion self.abiVersion = abiVersion def getPlatform (): if sys.platform.startswith('linux'): return 'linux' else: ...
from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( int_or_none, float_or_none, str_to_int, ) class VidmeIE(InfoExtractor): _VALID_URL = r'https?://vid\.me/(?:e/)?(?P<id>[\da-zA-Z]+)' _TEST = { 'url': 'https://vid.me/QNB', 'md...
# Copyright (c) 2009 Google Inc. All rights reserved. # Copyright (c) 2009 Apple 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 2012 One Laptop Per Child # # 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 program is distributed ...
from django.forms import SelectMultiple from .base import WidgetTest class SelectMultipleTest(WidgetTest): widget = SelectMultiple() numeric_choices = (('0', '0'), ('1', '1'), ('2', '2'), ('3', '3'), ('0', 'extra')) def test_render_selected(self): self.check_html(self.widget, 'beatles', ['J'], c...
#a class for the Kaplan-Meier estimator from statsmodels.compat.python import range import numpy as np from math import sqrt import matplotlib.pyplot as plt class KAPLAN_MEIER(object): def __init__(self, data, timesIn, groupIn, censoringIn): raise RuntimeError('Newer version of Kaplan-Meier class available...
import logging from autotest.client.shared import error from autotest.client import utils @error.context_aware def run(test, params, env): """ Timer device tscwrite test: 1) Check for an appropriate clocksource on host. 2) Boot the guest. 3) Download and compile the newest msr-tools. 4) Execu...
# -*- coding: utf-8 -*- """ catalog ---------------------------------- Tests for `hspfbintoolbox` module. """ import csv import shlex import subprocess import sys from unittest import TestCase from pandas.testing import assert_frame_equal try: from cStringIO import StringIO except: from io import StringIO ...
# This file is part of Buildbot. Buildbot is free software: you can # redistribute it and/or modify it under the terms of the GNU General Public # License as published by the Free Software Foundation, version 2. # # This program is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without eve...
# Copyright 2012 Jaap Karssenberg <[EMAIL]> from gi.repository import Gtk from zim.newfs import LocalFile from zim.newfs.helpers import TrashHelper, TrashNotSupportedError from zim.config import XDG_DATA_HOME, data_file from zim.templates import list_template_categories, list_templates from zim.gui.widgets import D...
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Test cases for dirdbm module. """ import os, shutil, glob from twisted.trial import unittest from twisted.persisted import dirdbm class DirDbmTestCase(unittest.TestCase): def setUp(self): self.path = self.mktemp() sel...
# -*- coding: utf-8 -*- import logging import urlparse import time import lxml.html import openerp import re _logger = logging.getLogger(__name__) class Crawler(openerp.tests.HttpCase): """ Test suite crawling an openerp CMS instance and checking that all internal links lead to a 200 response. If a use...
#!/usr/bin/env python3 # https://github.com/drduh/config/blob/master/lighttpd/upload.py # Simple file uploader # Put into /var/www/cgi-bin/, make executable and enable CGI import cgi import os CHUNK_SIZE = 100000 UPLOAD = "/var/www/upload/" HEADER = """ <html><head><title>%s</title> <style type="text/css"> body { ...
# -*- coding: utf-8 -*- # Comments and reviews for records. # This file is part of Invenio. # Copyright (C) 2008, 2010, 2011 CERN. # # Invenio 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 ...
from django.conf import settings from django.core.urlresolvers import reverse from django.db import models from django.utils.translation import ugettext_lazy as _ from taggit.managers import TaggableManager from ideasbox.models import TimeStampedModel from ideasbox.search.models import SearchableQuerySet, SearchMixin...
""" Testing attribute/function access in a query. """ import unittest class TesetAttrs(unittest.TestCase): def __init__(self, methodName='runTest'): unittest.TestCase.__init__(self, methodName) `Foo(int i, Avg avg) groupby(1). Bar(int i).` def setUp(self): `clear Foo. ...
from astroplan import FixedTarget from astropy.coordinates import SkyCoord from pocs import PanBase class Field(FixedTarget, PanBase): def __init__(self, name, position, equinox='J2000', **kwargs): """ An object representing an area to be observed A `Field` corresponds to an `~astroplan.Observi...
#!/usr/bin/env impala-python # Copyright (c) 2012 Cloudera, 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...
print(int(False)) print(int(True)) print(int(0)) print(int(1)) print(int(+1)) print(int(-1)) print(int('0')) print(int('+0')) print(int('-0')) print(int('1')) print(int('+1')) print(int('-1')) print(int('01')) print(int('9')) print(int('10')) print(int('+10')) print(int('-10')) print(int('12')) print(int('-12')) prin...
"""Support for monitoring the state of Vultr Subscriptions.""" import logging import voluptuous as vol from homeassistant.components.sensor import PLATFORM_SCHEMA, SensorEntity from homeassistant.const import CONF_MONITORED_CONDITIONS, CONF_NAME, DATA_GIGABYTES import homeassistant.helpers.config_validation as cv fr...
# Copyright (c) 2016-present, Facebook, 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 agreed...
# coding=utf-8 """ The SoftInterruptCollector collects metrics on software interrupts from /proc/stat #### Dependencies * /proc/stat """ import platform import os import diamond.collector # Detect the architecture of the system # and set the counters for MAX_VALUES # appropriately. Otherwise, rolling over # coun...
"""Provides access to stored IDLE configuration information. Refer to the comments at the beginning of config-main.def for a description of the available configuration files and the design implemented to update user configuration information. In particular, user configuration choices which duplicate the defaults will...
# Copyright 2006 Google, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. """ Python parse tree definitions. This is a very concrete parse tree; we need to keep every token and even the comments and whitespace between tokens. There's also a pattern matching implementation here. """ __autho...
# 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...
"""Support for HLK-SW16 switches.""" from homeassistant.components.switch import ToggleEntity from . import DATA_DEVICE_REGISTER, SW16Device from .const import DOMAIN PARALLEL_UPDATES = 0 def devices_from_entities(hass, entry): """Parse configuration and add HLK-SW16 switch devices.""" device_client = hass....
from __future__ import unicode_literals import argparse import logging import re logger = logging.getLogger(__name__) def main(log_path): for log_line in yield_train_log_line(log_path): print log_line break class TrainLogLine(object): __slots__ = ('iteration', 'elapsed', 'test_loss', 'tra...
from Numeric import * import LinearAlgebra as la import sys n = 15 m = zeros(((n + 1) * 4, (n + 1) * 4), Float) for i in range(n): m[4 * i + 2][4 * i + 0] = .5 m[4 * i + 2][4 * i + 1] = -1./12 m[4 * i + 2][4 * i + 2] = 1./48 m[4 * i + 2][4 * i + 3] = -1./480 m[4 * i + 2][4 * i + 4] = .5 m[4 * i...
from django.core.exceptions import ImproperlyConfigured # -*- coding: utf-8 -*- import functools try: import urlparse except ImportError: from urllib import parse as urlparse # python3 support from django.core.exceptions import SuspiciousOperation def default_redirect(request, fallback_url, **kwargs): """ E...
# Copyright 2014 Red Hat, 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 ...
# stdlib from copy import deepcopy from datetime import datetime, timedelta from hashlib import md5 from Queue import Empty, Queue import re import time import traceback # 3p from pyVim import connect from pyVmomi import vim # project from checks import AgentCheck from checks.libs.thread_pool import Pool from checks....
# 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 writi...
#!/usr/bin/python # # Copyright (C) 2007 SIOS Technology, 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 appli...
import matplotlib.pyplot as plt import matplotlib.animation as animation import numpy as np import pandas as pd import sklearn.linear_model as lm from sklearn.model_selection import learning_curve from sklearn.metrics import accuracy_score from sklearn.metrics import make_scorer from sklearn.model_selection import Grid...
# 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 __future__ import absolute_import import codecs from uuid import uuid4 from io import BytesIO from .packages import six from .packages.six import b from .fields import RequestField writer = codecs.lookup('utf-8')[3] def choose_boundary(): """ Our embarrassingly-simple replacement for mimetools.choose_...
""" Support for ANEL PwrCtrl switches. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/switch.pwrctrl/ """ import logging import socket from datetime import timedelta import voluptuous as vol import homeassistant.helpers.config_validation as cv from hom...
# # This is a Sphinx documentation tool extension which allows to # automatically exclude from full-text search index document # which are not referenced via toctree::. It's intended to be # used with toctrees conditional on only:: directive, with the # idea being that if you didn't include it in the ToC, you don't # w...
# 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. import sys try: import pygments from pygments.lexers import CppLexer from pygments.formatters import HtmlFormatter PYGMENTS_IMPORTED = True excep...
"""SCons.Tool.BitKeeper.py Tool-specific initialization for the BitKeeper source code control system. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 200...
# 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. from telemetry.page import page as page_module from telemetry import story class MseCasesPage(page_module.Page): def __init__(self, url, page_set): s...
# Copyright 2001-2013 Python Software Foundation; All Rights Reserved """Function signature objects for callables Back port of Python 3.3's function signature tools from the inspect module, modified to be compatible with Python 2.6, 2.7 and 3.2+. """ from __future__ import absolute_import, division, print_function imp...
# -*- coding: utf-8 -*- """ Copyright [2009-2018] EMBL-European Bioinformatics Institute 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...
"Commonly-used date structures" from django.utils.translation import ugettext_lazy as _, pgettext_lazy WEEKDAYS = { 0: _('Monday'), 1: _('Tuesday'), 2: _('Wednesday'), 3: _('Thursday'), 4: _('Friday'), 5: _('Saturday'), 6: _('Sunday') } WEEKDAYS_ABBR = { 0: _('Mon'), 1: _('Tue'), 2: _('Wed'), 3: _('Thu'),...
# Copyright 2017 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...
# (c) 2016 Matt Clay <[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) any later version. # # Ansible...
# Copyright 2009 Canonical Ltd. This software is licensed under the # GNU Affero General Public License version 3 (see the file LICENSE). """Views, menus and traversal related to PersonProducts.""" __metaclass__ = type __all__ = [ 'PersonProductBreadcrumb', 'PersonProductFacets', 'PersonProductNavigation...
# -*- coding: utf-8 -*- """ flask.testsuite.basic ~~~~~~~~~~~~~~~~~~~~~ The basic functionality. :copyright: (c) 2011 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import re import uuid import flask import pickle import unittest from datetime import datetime from threading i...
import random import time class PowerInfo: def __init__(self): self._lastEnergy = 0 self._prevPower = 0 # Use time.perf_counter() instead of time.clock() when using python 3 self._lastTimeStamp = time.perf_counter() @property def current(self): return random.gauss(14, 0.5) @property def voltage(self)...
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2017, Kenneth D. Evensen <[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', ...
# -*- coding: utf-8 -*- """ requests.models ~~~~~~~~~~~~~~~ This module contains the primary objects that power Requests. """ import collections import logging import datetime from io import BytesIO from .hooks import default_hooks from .structures import CaseInsensitiveDict from .auth import HTTPBasicAuth from .c...
# Module 'ntpath' -- common operations on WinNT/Win95 pathnames """Common pathname manipulations, WindowsNT/95 version. Instead of importing this module directly, import os and refer to this module as os.path. """ import os import sys import stat import genericpath import warnings from genericpath import * __all__ ...
"""Utilities for writing code that runs on Python 2 and 3""" # Copyright (c) 2010-2014 Benjamin Peterson # # 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 with...
# # Copyright: Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # Make coding more python3-ish from __future__ import (absolute_import, division, print_function) __metaclass__ = type from ansible.compat.tests.mock import patch from ansible.modules.network.on...
#!/usr/bin/env python # # Copyright 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...
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under t...
from scipy import stats import matplotlib.pyplot as plt nsample = 100 np.random.seed(7654321) # A t distribution with small degrees of freedom: ax1 = plt.subplot(221) x = stats.t.rvs(3, size=nsample) res = stats.probplot(x, plot=plt) # A t distribution with larger degrees of freedom: ax2 = plt.subplot(222) x = stat...