text
stringlengths
475
200k
# -*- coding: utf-8 -*- """ pygments.lexers.rust ~~~~~~~~~~~~~~~~~~~~ Lexers for the Rust language. :copyright: Copyright 2006-2020 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ from pygments.lexer import RegexLexer, include, bygroups, words, default from pygments...
from django.conf import settings from django.contrib import auth from django.contrib.auth.decorators import login_required from django.core.exceptions import ImproperlyConfigured from django.http import HttpResponse from django.shortcuts import redirect from django.utils.decorators import method_decorator fr...
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals import json import logging import traceback import time from google.appengine.api import app_identity, mail, capabilities from google.appengine.runtime import DeadlineExceededError from tekton.router import PathNotFound def get_apis_st...
import ui import graphics import time import contextlib from ui import stream from ui import ctrl from client import freeciv SELECT_POPUP = 0 class MapWidget(ui.Widget): def __init__(self, client): self.client = client self.size = (0, 0) self.drawer = TileDrawer(client) self.tile_...
from django.db import connection from django.contrib.gis.tests.utils import mysql, no_mysql, oracle, postgis, spatialite from django.utils import unittest test_srs = ({'srid' : 4326, 'auth_name' : ('EPSG', True), 'auth_srid' : 4326, 'srtext' : 'GEOGCS["WGS 84",DATUM["WGS_1984",S...
"""This demo program computes the value of the functional M(v) = int v^2 + (grad v)^2 dx on the unit square for v = sin(x) + cos(y). The exact value of the functional is M(v) = 2 + 2*sin(1)*(1 - cos(1)) The functional M corresponds to the energy norm for a simple reaction-diffusion equation.""" # Copyright (C) ...
# Copyright 2010 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 or agreed to in writi...
# Copyright (c) 2016 PaddlePaddle 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 applic...
from __future__ import unicode_literals from django.db import models from django.db.migrations.operations.base import Operation from django.db.migrations.state import ModelState from django.db.models.options import normalize_together from django.utils import six from django.utils.functional import cached_property fro...
import ckan.plugins as plugins import ckan.plugins.toolkit as toolkit import ckanext.resourceproxy.plugin as proxy import ckan.lib.datapreview as datapreview from ckan.common import json class GeojsonviewPlugin(plugins.SingletonPlugin): plugins.implements(plugins.IConfigurer, inherit=True) plugins.implements(...
def getSocialData(post): # Get Thread Object threadObject = post["thread"] domain_rank = threadObject["domain_rank"] #domain_rank #print 'domain_rank:' + str(domain_rank) socialObject = threadObject["social"] #social data object facebookData = socialObject["facebook"] #facebook data #print 'facebook data...
# -*- coding: utf-8 -*- """ Unit tests for preview.py """ import unittest from calc import preview import pyparsing class LatexRenderedTest(unittest.TestCase): """ Test the initializing code for LatexRendered. Specifically that it stores the correct data and handles parens well. """ def test_sim...
# coding=utf-8 """ This module holds the standard implementation of the :class:`PrinterInterface` and it helpers. """ from __future__ import absolute_import __author__ = "Gina Häußge <[EMAIL]>" __license__ = 'GNU Affero General Public License http://www.gnu.org/licenses/agpl.html' __copyright__ = "Copyright (C) 2014 ...
# # (c) 2016 Red Hat Inc. # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is d...
# -*- coding: utf-8 -*- """ content.py ~~~~~~ :copyright: (c) 2014 by @zizzamia :license: BSD (See LICENSE for details) """ from flask import (Blueprint, abort, request, session, g, current_app, render_template, send_from_directory) # Imports inside Bombolone import bombolone.model.pa...
#!/usr/bin/env python # 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 argparse import re import sys USAGE = """find_used_resources.py [-h] [-i INPUT] [-o OUTPUT] Outputs the sorted list of resourc...
# 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...
from __future__ import unicode_literals import json from django.test import TestCase from django.test.client import RequestFactory from rest_framework import generics, status, serializers from rest_framework.compat import patterns, url from rest_framework.tests.models import Anchor, BasicModel, ManyToManyModel, BlogPos...
import multiprocessing from six.moves import queue DEBUG = True LOGGING = { 'version': 1, 'disable_existing_loggers': False, 'formatters': { 'simple': { 'format': '%(levelname)s %(message)s' }, 'standard': { 'format': '[%(asctime)s] %(levelname)s [%(name)s:%...
#!/usr/bin/env python # Copyright 2014 RethinkDB, all rights reserved. """The `interface.table_wait` test checks that waiting for a table returns when the table is available for writing.""" from __future__ import print_function import multiprocessing, os, sys, time, traceback, pprint startTime = time.time() sys.pa...
import datetime import json import os from random import random from time import sleep from time import time import requests import shortuuid from sickle import Sickle, oaiexceptions from sickle.iterator import OAIItemIterator from sickle.models import ResumptionToken from sickle.oaiexceptions import NoRecordsMatch, B...
import logging import pretend import pytest from pip._internal.cli.status_codes import NO_MATCHES_FOUND, SUCCESS from pip._internal.commands import create_command from pip._internal.commands.search import ( highest_version, print_results, transform_hits, ) from tests.lib import pyversion if pyversion >= ...
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright 2014 Benjamin Curtis <[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', ...
"""Extended file operations available in POSIX. f = posixfile.open(filename, [mode, [bufsize]]) will create a new posixfile object f = posixfile.fileopen(fileobject) will create a posixfile object from a builtin file object f.file() will return the original builtin file object f.dup() will r...
#!/usr/bin/env python # Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # 1. Redistributions of source code must retain the above # copyright n...
""" Author: James Ma Email stuff here: [EMAIL] """ """ API doumentation: https://www.interactivebrokers.com/en/software/api/apiguide/java/reqhistoricaldata.htm https://www.interactivebrokers.com/en/software/api/apiguide/tables/tick_types.htm """ FIELD_BID_SIZE = 0 FIELD_BID_PRICE = 1 FIELD_ASK_PRICE = 2 FIELD_ASK_SIZ...
""" This module contains generic base85 encoding and decoding functions. The whoosh.util.numeric module contains faster variants for encoding and decoding integers. Modified from: http://paste.lisp.org/display/72815 """ import struct from whoosh.compat import xrange # Instead of using the character set from the as...
#!/usr/bin/env python # cerbero - a multi-platform build system for Open Source software # Copyright (C) 2012 Andoni Morales Alastruey <[EMAIL]> # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Fou...
#!/usr/bin/env python3 """calculate BLEU scores script taken from https://github.com/vikasnar/Bleu and adjusted by Jörg Tiedemann """ import sys import codecs import os import math import operator import json import functools def fetch_data(cand, ref): """ Store each reference and candidate sentences as a lis...
#!/usr/bin/python # -*- coding: utf-8 -*- # # (c) 2015, Darren Worrall <[EMAIL]> # (c) 2015, René Moser <[EMAIL]> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, ei...
# 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. """GDB support for Chrome types. Add this to your gdb by amending your ~/.gdbinit as follows: python import sys sys.path.insert(0, "/path/to/tools...
# -*- encoding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. # Copyright (c) 2011 Noviat nv/sa (www.noviat.be). All rights reserved. import re, time, random from openerp import api from openerp.osv import fields, osv from openerp.tools.translate import _ import logging ...
# coding=utf-8 # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) import os class Re...
# import the basic python packages we need import os import sys import tempfile import pprint import traceback # disable python from generating a .pyc file sys.dont_write_bytecode = True # change me to the path of pytan if this script is not running from EXAMPLES/PYTAN_API pytan_loc = "~/gh/pytan" pytan_static_path =...
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2017, Ansible by Red Hat, inc # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', ...
#!/usr/bin/env python # -*- coding: utf-8 -*- from logging import getLogger from HTTPRequest import HTTPRequest from HTTPDownload import HTTPDownload class Browser(object): __slots__ = ("log", "options", "bucket", "cj", "_size", "http", "dl") def __init__(self, bucket=None, options={}): self.log = ...
#!/usr/bin/python # -*- coding: utf-8 -*- # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], ...
#!/usr/bin/env python # 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 "Licen...
import re BATCH_QUERY_REGEX = re.compile(r'Item\.(\d+)\.(.*)') PUT_ATTRIBUTE_QUERY_REGEX = re.compile(r'Attribute\.(\d+)\.(Name|Value|Replace)') DELETE_QUERY_ARG_REGEX = re.compile(r'Attribute\.(\d+)\.(Name|Value)') EXPECTED_QUERY_ARG_REGEX = re.compile(r'Expected\.(\d+)\.(Name|Value|Exists)') def extract_numbered_ar...
############################################################################## # Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, [EMAIL], All rights reserved. # LLNL-CODE-647188 # # F...
import numpy as np import scipy.sparse as sp from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_almost_equal from sklearn.utils.testing import assert_true from sklearn.utils.testing import assert_false from sklearn.utils.testing ...
# Copyright 2014 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 a...
import simplejson as json from mongrel2 import handler import wsutil import sys import time import re sender_id = "82209006-86FF-4982-B5EA-D1E29E55D480" conn = handler.Connection(sender_id, "tcp://127.0.0.1:9990", "tcp://127.0.0.1:9989") CONNECTION_TIMEOUT=5 closingMessages={} badUnicode=...
# 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 required by applicable law o...
import os,sys,pdb import argparse ap = argparse.ArgumentParser() ap.add_argument('--height','-H',help='input height',type=int) ap.add_argument('--width','-W',help='input width',type=int) ap.add_argument('--layers','-F',help='layer info txt with each line for one layer') ap.add_argument('--deconv','-D',help='0 for con...
import os import subprocess script_path = os.getcwd() + "/" + os.path.splitext(__file__)[0] + ".tcl" script_file = open(script_path, "w+") os.chdir("..") project_path = os.getcwd() script_file.write( "######################################################\n" + "# Generated file to open the virtual logic analyyer\...
#!/usr/bin/env python # -*- coding: UTF-8 -* import os from app import create_app, db from app.models import User, Role, Permission, Coupon, SecKill, Datemark from flask_script import Manager, Shell from flask_migrate import Migrate, MigrateCommand app = create_app(os.getenv('ATH_CONFIG') or 'default') manager = Manag...
# 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 # # Unless required by applica...
from __future__ import absolute_import import six from collections import OrderedDict from django.db.models import F from rest_framework.response import Response from sentry import tsdb from sentry.api.base import StatsMixin from sentry.api.bases.project import ProjectEndpoint from sentry.api.exceptions import Resou...
# file openpyxl/shared/password_hasher.py # Copyright (c) 2010 openpyxl # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to us...
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ A release-automation toolkit. Don't use this outside of Twisted. Maintainer: Christopher Armstrong """ import os # errors class DirectoryExists(OSError): """ Some directory exists when it shouldn't. """ pass class Dire...
"Misc. utility functions/classes for admin documentation generator." import re from email.parser import HeaderParser from email.errors import HeaderParseError from django.utils.safestring import mark_safe from django.core.urlresolvers import reverse from django.utils.encoding import force_bytes try: import docuti...
""" lockfile.py - Platform-independent advisory file locks. Requires Python 2.5 unless you apply 2.4.diff Locking is done on a per-thread basis instead of a per-process basis. Usage: >>> lock = FileLock('somefile') >>> try: ... lock.acquire() ... except AlreadyLocked: ... print 'somefile', 'is locked alread...
#!/usr/bin/python # coding: utf8 ############################################################ # Author Bachar Wehbi <[EMAIL]> # Copyright (c) 2013-2014 Beebotte <[EMAIL]> # This program is published under the MIT License # Check http://opensource.org/licenses/MIT for details. # # This code uses the Beebotte API, you...
#!/usr/bin/python """ PN CLI vlan-create/vlan-delete """ # # 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...
# 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...
# 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 agreed to in...
class RevealAccess(object): """ A data descriptor that sets and returns values normally and prints a message logging their access. """ def __init__(self, initval=None, name='var'): self.val = initval self.name = name def __get__(self, obj, objtype): print('Retrieving', s...
import sys import os import re import time import base64 import tempfile import subprocess import threading if __name__ == '__main__': print 'Please do not launch this file directly.' sys.exit(0) def module_path(): if hasattr(sys, "frozen"): return os.path.dirname(sys.executable) return os.path.dirname(__file__...
# Copyright 2014 Cloudbase Solutions Srl # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable l...
"""Extract, format and print information about Python stack traces.""" import linecache import sys import operator __all__ = ['extract_stack', 'extract_tb', 'format_exception', 'format_exception_only', 'format_list', 'format_stack', 'format_tb', 'print_exc', 'format_exc', 'print_exception', ...
# # tiutils.py is a Titanium function library for use with the SpiralArm Titanium plug-in for Sublime Text 3 # # developed by Steve Rogers, SpiralArm Consulting Ltd (www.spiralarm.uk) # @sarmcon # # import sublime, subprocess,os from os.path import expanduser # read in our default Titanium settings settings = subl...
from tendrl.commons.flows.exceptions import FlowExecutionFailedError from tendrl.commons.utils import log_utils as logger def get_node_ips(parameters): node_ips = [] for node, config in parameters["Cluster.node_configuration"].iteritems(): node_ips.append(config["provisioning_ip"]) return node_ips...
# coding: utf-8 import os try: from PIL import Image except: pass from deworld.map_colors import HeightColorMap, RGBColorMap from deworld.layers import VEGETATION_TYPE def draw_image(turn, catalog, layer, power_points, colorizer): if not os.path.exists(catalog): os.makedirs(catalog) img = ...
''' This module supports commandline functionality ''' import argparse import sys, os from psiturk.version import version_number from psiturk.psiturk_org_services import ExperimentExchangeServices def process(): ''' Figure out how we were invoked ''' invoked_as = os.path.basename(sys.argv[0]) if invoked...
# This code lifted from the mod_wsgi docs. from __future__ import print_function from future import standard_library standard_library.install_aliases() import os from pathlib import Path from typing import Sequence import sys import signal import threading import atexit import queue _interval = 1.0 _times = {} _files ...
# Copyright (C) 2003-2007 Robey Pointer <[EMAIL]> # # This file is part of paramiko. # # Paramiko 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) ...
import win32api, mmapfile import winerror import tempfile, os from pywin32_testutil import str2bytes system_info=win32api.GetSystemInfo() page_size=system_info[1] alloc_size=system_info[7] fname=tempfile.mktemp() mapping_name=os.path.split(fname)[1] fsize=8*page_size print fname, fsize, mapping_name m1...
#!/usr/bin/python # # Copyright (c) 2019 Hai Cao, <[EMAIL]> # # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status':...
# This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # bu...
import os import sys import warnings # opcode is not a virtualenv module, so we can use it to find the stdlib # Important! To work on pypy, this must be a module that resides in the # lib-python/modified-x.y.z directory import opcode dirname = os.path.dirname distutils_path = os.path.join(os.path.dirname(opcode.__fi...
import sys import os import Queue import StringIO import urlparse import mimetypes import pkgutil import itertools try: from PyQt4 import QtCore, QtGui, QtWebKit, QtNetwork except ImportError: from PySide import QtCore, QtGui, QtWebKit, QtNetwork HTTP_STATUS = { 200: 'OK', 301: 'Moved Permanently', ...
""" This code was Ported from CPython's sha512module.c """ import struct SHA_BLOCKSIZE = 128 SHA_DIGESTSIZE = 64 def new_shaobject(): return { 'digest': [0]*8, 'count_lo': 0, 'count_hi': 0, 'data': [0]* SHA_BLOCKSIZE, 'local': 0, 'digestsize': 0 } ROR64 = lam...
#!/usr/bin/env python import io import os from setuptools import setup, Extension def read(fname, encoding='utf-8'): here = os.path.dirname(__file__) with io.open(os.path.join(here, fname), encoding=encoding) as f: return f.read() setup ( name='PPeg', version='0.9.4', description="A Py...
#!/usr/bin/env python # # A module to analyze and identify any common problems which can be determined from log files # # Initial code by Andrew Chapman ([EMAIL]), 16th Jan 2014 # # some logging oddities noticed while doing this, to be followed up on: # - tradheli MOT labels Mot1,Mot2,Mot3,Mot4,GGain # - Pixhawk ...
# -*- 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...
""" Author: Chase Coleman Filename: test_lqcontrol Tests for lqcontrol.py file """ import sys import os import unittest import numpy as np from scipy.linalg import LinAlgError from numpy.testing import assert_allclose from quantecon.lqcontrol import LQ class TestLQControl(unittest.TestCase): def setUp(self): ...
from snovault import ( upgrade_step, ) @upgrade_step('file_fastq', '1', '2') @upgrade_step('file_calibration', '1', '2') @upgrade_step('file_microscopy', '1', '2') @upgrade_step('file_processed', '1', '2') @upgrade_step('file_reference', '1', '2') def file_1_2(value, system): file_format = value.get('file_for...
# -*- coding: utf-8 -*- # # Copyright 2015 Twitter 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 ...
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (c) 2012-TODAY 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 division, absolute_import, print_function from numpy import (logspace, linspace, geomspace, dtype, array, sctypes, arange, isnan, ndarray, sqrt, nextafter) from numpy.testing import ( TestCase, run_module_suite, assert_, assert_equal, assert_raises, assert_array_equal,...
import pygame from pygame.locals import * from player import Player from stagegenerator import StageGenerator from gamestatus import GameStatus from gameconfig import GameConfig class GameEngine(): def __init__(self, modes=None): pygame.init() self.screen = pygame.display.set_mode((800, 600)) ...
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
# # Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2000-2006 Donald N. Allingham # Copyright (C) 2007-2009 Brian G. Matherly # Copyright (C) 2009 Gary Burton # Copyright (C) 2010 Peter Landgren # Copyright (C) 2011 Adam Stein <[EMAIL]> # # This program is free software; you can redi...
"""A dumb and slow but simple dbm clone. For database spam, spam.dir contains the index (a text file), spam.bak *may* contain a backup of the index (also a text file), while spam.dat contains the data (a binary file). XXX TO DO: - seems to contain a bug when updating... - reclaim free space (currently, sp...
class Wind(object): """ Current forecast information about the wind. Attributes: chill: Wind chill in degrees (integer). If a value for wind chill is not found, chill will be None. direction: Wind direction in degrees (integer). If a value for wind direction is not...
from setuptools import setup import os.path __license__ = """ Copyright (c) 2015 ScientiaMobile Inc. The WURFL Cloud Client is intended to be used in both open-source and commercial environments. To allow its use in as many situations as possible, the WURFL Cloud Client is dual-licensed. You may choose to use th...
from datetime import datetime from django.conf.urls import patterns, url from django.contrib.sitemaps import Sitemap, GenericSitemap, FlatPageSitemap, views from django.contrib.auth.models import User from django.views.decorators.cache import cache_page from django.contrib.sitemaps.tests.base import TestModel class ...
from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( int_or_none, js_to_json, mimetype2ext, ExtractorError, ) class ImgurIE(InfoExtractor): _VALID_URL = r'https?://(?:i\.)?imgur\.com/(?!(?:a|gallery|(?:t(?:opic)?|r)/[^/]+)/)(?P<id>[a-zA-Z0-9]+...
#!/usr/bin/env python import os.path import re import sys import tempfile import zipfile import wheel.bdist_wheel import shutil import distutils.dist from distutils.archive_util import make_archive from argparse import ArgumentParser from glob import iglob egg_info_re = re.compile(r'''(?P<name>.+?)-(?P<ver>.+?) (-...
import unittest, re, sys, random sys.path.extend(['.','..','../..','py']) import h2o, h2o_cmd, h2o_import as h2i def writeRows(csvPathname,row,eol,repeat): f = open(csvPathname, 'w') for r in range(repeat): f.write(row + eol) class Basic(unittest.TestCase): def tearDown(self): h2o.check_sa...
# -*- test-case-name: twisted.internet.test.test_endpoints -*- # Copyright (c) 2007-2010 Twisted Matrix Laboratories. # See LICENSE for details. """ Implementations of L{IStreamServerEndpoint} and L{IStreamClientEndpoint} that wrap the L{IReactorTCP}, L{IReactorSSL}, and L{IReactorUNIX} interfaces. This also implement...
#!/usr/bin/env python # Copyright 2008-2011 Nokia Siemens Networks Oyj # # 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 couchpotato.core.helpers.variable import splitString from couchpotato.core.logger import CPLog from couchpotato.core.notifications.base import Notification from pynmwp import PyNMWP import six log = CPLog(__name__) autoload = 'NotifyMyWP' class NotifyMyWP(Notification): def notify(self, message = '', data...
from bok_choy.page_object import PageObject, PageLoadError, unguarded from bok_choy.promise import BrokenPromise from .course_page import CoursePage from ...tests.helpers import disable_animations from selenium.webdriver.common.action_chains import ActionChains class NoteChild(PageObject): url = None BODY_SEL...
# Copyright 2013 NEC Corporation. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required ...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright © 2012-2014 Zulip, Inc. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rig...
# Copyright 2013 Mellanox Technologies, Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed t...
from __future__ import (absolute_import, division, print_function, unicode_literals) import logging import datetime import time import socket import json import multiprocessing from contextlib import contextmanager import sys import os HOSTNAME = socket.gethostname() metric_log_file = None plugin_params = None keepal...