repo_name
stringlengths
5
100
path
stringlengths
4
294
copies
stringclasses
990 values
size
stringlengths
4
7
content
stringlengths
666
1M
license
stringclasses
15 values
pchauncey/ansible
test/units/modules/network/ios/test_ios_ping.py
20
2742
# # (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...
gpl-3.0
kkochubey1/docker-sikuli-novnc
web/log/config.py
15
3429
#!/usr/bin/env python import sys import logging import logging.handlers #The terminal has 8 colors with codes from 0 to 7 BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, WHITE = range(8) #These are the sequences need to get colored ouput RESET_SEQ = "\033[0m" COLOR_SEQ = "\033[1;%dm" BOLD_SEQ = "\033[1m" #The backg...
apache-2.0
tkinz27/ansible-modules-core
cloud/linode/linode.py
142
18004
#!/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...
gpl-3.0
babycaseny/poedit
deps/boost/libs/python/pyste/src/Pyste/HeaderExporter.py
54
3065
# Copyright Bruno da Silva de Oliveira 2003. Use, modification and # distribution is subject to the Boost Software License, Version 1.0. # (See accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) from Exporter import Exporter from ClassExporter import ClassExporter from FunctionExpor...
mit
necessary129/GitFetcher
cronjob.py
1
1771
#!/usr/bin/python3 # Copyright (C) 2015 Muhammed Shamil K # # 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. # # ...
gpl-3.0
kingvuplus/b-p
lib/python/Screens/Scart.py
126
1771
from Screen import Screen from MessageBox import MessageBox from Components.AVSwitch import AVSwitch from Tools import Notifications class Scart(Screen): def __init__(self, session, start_visible=True): Screen.__init__(self, session) self.msgBox = None self.notificationVisible = None self.avswitch = AVSwitch...
gpl-2.0
ar4s/django
django/db/backends/postgresql_psycopg2/version.py
12
1502
""" Extracts the version of the PostgreSQL server. """ import re # This reg-exp is intentionally fairly flexible here. # Needs to be able to handle stuff like: # PostgreSQL 8.3.6 # EnterpriseDB 8.3 # PostgreSQL 8.3 beta4 # PostgreSQL 8.4beta1 VERSION_RE = re.compile(r'\S+ (\d+)\.(\d+)\.?(\d+)?') def _parse_...
bsd-3-clause
luzfcb/django-simple-history
simple_history/registry_tests/tests.py
1
5594
from __future__ import unicode_literals import unittest from datetime import datetime, timedelta import django from django.contrib.auth import get_user_model from django.core import management from django.test import TestCase from simple_history import exceptions, register from six.moves import cStringIO as StringIO ...
bsd-3-clause
ChengXiaoZ/MariaDBserver
storage/tokudb/mysql-test/tokudb/t/change_column_text.py
54
1409
import sys def main(): print "# this test is generated by change_text.py" print "# generate hot text expansion test cases" print "--disable_warnings" print "DROP TABLE IF EXISTS t;" print "--enable_warnings" print "SET SESSION DEFAULT_STORAGE_ENGINE=\"TokuDB\";" print "SET SESSION TOKUDB_DIS...
gpl-2.0
smartforceplus/SmartForceplus
addons/project/report/project_report.py
279
5789
# -*- 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...
agpl-3.0
KaranToor/MA450
google-cloud-sdk/lib/surface/meta/debug.py
6
1629
# Copyright 2016 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 ag...
apache-2.0
chhao91/QGIS
python/ext-libs/pygments/styles/friendly.py
364
2515
# -*- coding: utf-8 -*- """ pygments.styles.friendly ~~~~~~~~~~~~~~~~~~~~~~~~ A modern style based on the VIM pyte theme. :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ from pygments.style import Style from pygments.token import Keyw...
gpl-2.0
abhishek-ch/hue
desktop/core/ext-py/tablib-0.10.0/tablib/packages/odf3/presentation.py
56
2716
# -*- coding: utf-8 -*- # Copyright (C) 2006-2007 Søren Roug, European Environment Agency # # 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 you...
apache-2.0
abloomston/sympy
sympy/core/tests/test_arit.py
14
57459
from __future__ import division from sympy import (Basic, Symbol, sin, cos, exp, sqrt, Rational, Float, re, pi, sympify, Add, Mul, Pow, Mod, I, log, S, Max, symbols, oo, Integer, sign, im, nan, Dummy, factorial, comp ) from sympy.core.compatibility import long, range from sympy.utilities.iterables impo...
bsd-3-clause
jemmyw/ansible
lib/ansible/plugins/action/copy.py
10
12996
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) an...
gpl-3.0
listamilton/supermilton.repository
plugin.video.efilmes/bs4/element.py
438
61538
import collections import re import sys import warnings from bs4.dammit import EntitySubstitution DEFAULT_OUTPUT_ENCODING = "utf-8" PY3K = (sys.version_info[0] > 2) whitespace_re = re.compile("\s+") def _alias(attr): """Alias one attribute name to another for backward compatibility""" @property def alias...
gpl-2.0
blitzmann/Pyfa
scripts/dump_data.py
3
3214
#!/usr/bin/env python """ This script bootstraps Phobos from a supplied path and feeds it information regarding EVE data paths and where to dump data. It then imports some other scripts and uses them to convert the json data into a SQLite database and then compare the new database to the existing one, producing a diff ...
gpl-3.0
miguelpalacio/python-for-android
python-build/python-libs/gdata/src/gdata/Crypto/Util/number.py
232
5495
# # number.py : Number-theoretic functions # # Part of the Python Cryptography Toolkit # # Distribute and use freely; there are no restrictions on further # dissemination and usage except those imposed by the laws of your # country of residence. This software is provided "as is" without # warranty of fitness for us...
apache-2.0
cinnamoncoin/eloipool-1
jsonrpcserver.py
8
11072
# Eloipool - Python Bitcoin pool server # Copyright (C) 2011-2013 Luke Dashjr <luke-jr+eloipool@utopios.org> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the # L...
agpl-3.0
huzq/scikit-learn
examples/svm/plot_separating_hyperplane_unbalanced.py
44
2463
""" ================================================= SVM: Separating hyperplane for unbalanced classes ================================================= Find the optimal separating hyperplane using an SVC for classes that are unbalanced. We first find the separating plane with a plain SVC and then plot (dashed) the ...
bsd-3-clause
zhaojiedi1992/pm
pm/pipelines.py
1
3614
# -*- coding: utf-8 -*- # Define your item pipelines here # # Don't forget to add your pipeline to the ITEM_PIPELINES setting # See: http://doc.scrapy.org/en/latest/topics/item-pipeline.html import json import csv import codecs from collections import OrderedDict #from pm.comm.log import * from pm.items import PmIte...
apache-2.0
whuang001/cts
gui/Interest.py
1
2153
""" shwo user who share similar interest """ from PyQt5.QtWidgets import QWidget, QTableWidgetItem from PyQt5 import QtCore, QtGui, QtWidgets class Interest(QWidget): def __init__(self, parent=None): super(Interest, self).__init__(parent) self.setupUi(self) def setupUi(self, Form): F...
mit
sunils34/buffer-django-nonrel
django/contrib/flatpages/models.py
410
1134
from django.db import models from django.contrib.sites.models import Site from django.utils.translation import ugettext_lazy as _ class FlatPage(models.Model): url = models.CharField(_('URL'), max_length=100, db_index=True) title = models.CharField(_('title'), max_length=200) content = models.TextField(_(...
bsd-3-clause
postfix/viper-1
modules/clamav.py
3
2365
# This file is part of Viper - https://github.com/viper-framework/viper # See the file 'LICENSE' for copying permission. try: import pyclamd HAVE_CLAMD = True except ImportError: HAVE_CLAMD = False from viper.common.abstracts import Module from viper.core.session import __sessions__ class ClamAV(Module)...
bsd-3-clause
mydongistiny/external_chromium_org
ui/resources/resource_check/resource_scale_factors.py
81
4858
# 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. """Presubmit script for Chromium browser resources. See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts for more details about t...
bsd-3-clause
zchking/odoo
addons/anonymization/anonymization.py
77
28690
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved # $Id$ # # This program is free software: you can redistribute it and/or modify # ...
agpl-3.0
hbenniou/trunk
examples/not-working/insertion-sort-collider.py
8
1378
""" NOTE Needs yade compiled with CGAL feature """ O.engines=[ ForceResetter(), InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Box_Aabb(),Bo1_Facet_Aabb()]), InteractionLoop([Ig2_Facet_Sphere_ScGeom()],[Ip2_FrictMat_FrictMat_FrictPhys()],[Law2_ScGeom_FrictPhys_CundallStrack()],), NewtonIntegrator(damping=0.01,gravi...
gpl-2.0
jmartinm/invenio
modules/websubmit/lib/functions/Mail_Approval_Request_to_Referee.py
33
20233
## This file is part of Invenio. ## Copyright (C) 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 the ## License, or (at your option) any later ...
gpl-2.0
brakhane/python-mode
pymode/libs2/rope/refactor/move.py
30
26601
"""A module containing classes for move refactoring `create_move()` is a factory for creating move refactoring objects based on inputs. """ from rope.base import pyobjects, codeanalyze, exceptions, pynames, taskhandle, evaluate, worder from rope.base.change import ChangeSet, ChangeContents, MoveResource from rope.ref...
lgpl-3.0
yhe39/crosswalk-test-suite
webapi/tct-filewriterapi-w3c-tests/inst.apk.py
1996
3186
#!/usr/bin/env python import os import shutil import glob import time import sys import subprocess from optparse import OptionParser, make_option SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__)) PARAMETERS = None ADB_CMD = "adb" def doCMD(cmd): # Do not need handle timeout in this short script, let tool...
bsd-3-clause
noba3/KoTos
addons/plugin.video.mega/resources/lib/platform_libraries/Xbox/Crypto/Protocol/AllOrNothing.py
226
10952
"""This file implements all-or-nothing package transformations. An all-or-nothing package transformation is one in which some text is transformed into message blocks, such that all blocks must be obtained before the reverse transformation can be applied. Thus, if any blocks are corrupted or lost, the original message...
gpl-2.0
tkasp/osmose-backend
analysers/analyser_osmosis_relation_open.py
4
3760
#!/usr/bin/env python #-*- coding: utf-8 -*- ########################################################################### ## ## ## Copyrights Frédéric Rodrigo 2020 ## ## ...
gpl-3.0
PRIMEDesigner15/PRIMEDesigner15
dependencies/Lib/test/unittests/test_nntplib.py
23
56030
import io import socket import datetime import textwrap import unittest import functools import contextlib from test import support from nntplib import NNTP, GroupInfo, _have_ssl import nntplib if _have_ssl: import ssl TIMEOUT = 30 # TODO: # - test the `file` arg to more commands # - test error conditions # - tes...
bsd-3-clause
Ophiuchus1312/enigma2-master
lib/python/Screens/TimerEntry.py
1
22034
# -*- coding: utf-8 -*- from Screens.Screen import Screen import ChannelSelection from ServiceReference import ServiceReference from Components.config import config, ConfigSelection, ConfigText, ConfigSubList, ConfigDateTime, ConfigClock, ConfigYesNo, getConfigListEntry from Components.ActionMap import NumberActionMap ...
gpl-2.0
mistercrunch/airflow
airflow/providers/apache/hive/transfers/hive_to_samba.py
7
2867
# # 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...
apache-2.0
faribas/RMG-Py
mergeModels.py
4
4047
#!/usr/bin/env python # encoding: utf-8 """ This script enables the automatic merging of two or more Chemkin files (and associated species dictionaries) into a single unified Chemkin file. Simply pass the paths of the Chemkin files and species dictionaries on the command-line, e.g. $ python mergeModels.py /path/...
mit
lixiangning888/whole_project
analyzer/windows/modules/packages/html.py
1
1174
# Copyright (C) 2010-2015 Cuckoo Foundation. # This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org # See the file 'docs/LICENSE' for copying permission. import shutil import logging from lib.common.abstracts import Package log = logging.getLogger(__name__) class HTML(Package): """HTML file analys...
lgpl-3.0
AltarBeastiful/qt-creator
tests/system/suite_APTW/tst_APTW03/test.py
4
7796
############################################################################# ## ## Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ## Contact: http://www.qt-project.org/legal ## ## This file is part of Qt Creator. ## ## Commercial License Usage ## Licensees holding valid commercial Qt licenses may use this f...
lgpl-2.1
MKTCloud/MKTCloud
openstack_dashboard/dashboards/admin/images_and_snapshots/snapshots/views.py
10
2163
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Copyright 2012 Nebula, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # no...
apache-2.0
fedorpatlin/ansible
lib/ansible/modules/cloud/openstack/os_user.py
26
9043
#!/usr/bin/python # Copyright (c) 2015 Hewlett-Packard Development Company, L.P. # # This module 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...
gpl-3.0
shepdelacreme/ansible
test/units/modules/network/f5/test_bigip_cli_script.py
8
3465
# -*- coding: utf-8 -*- # # Copyright: (c) 2018, F5 Networks Inc. # GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import (absolute_import, division, print_function) __metaclass__ = type import os import json import pytest import sys from nose.plugins.skip i...
gpl-3.0
astaninger/speakout
venv/lib/python3.6/site-packages/flask_pymongo/tests/test_gridfs.py
2
3039
from hashlib import md5 from io import BytesIO from bson.objectid import ObjectId from gridfs import GridFS from werkzeug.exceptions import NotFound import pytest from flask_pymongo.tests.util import FlaskPyMongoTest class GridFSCleanupMixin(object): def tearDown(self): gridfs = GridFS(self.mongo.db) ...
mit
aitoehigie/gidimagic
venv/lib/python2.7/site-packages/setuptools/archive_util.py
409
6601
"""Utilities for extracting common archive formats""" __all__ = [ "unpack_archive", "unpack_zipfile", "unpack_tarfile", "default_filter", "UnrecognizedFormat", "extraction_drivers", "unpack_directory", ] import zipfile, tarfile, os, shutil, posixpath from pkg_resources import ensure_directory from distutils....
mit
ahmetdaglarbas/e-commerce
oscar/apps/analytics/migrations/0002_auto_20140827_1705.py
49
1091
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations from django.conf import settings class Migration(migrations.Migration): dependencies = [ ('analytics', '0001_initial'), ('catalogue', '0001_initial'), migrations.swappable_dependency(...
bsd-3-clause
halexus/Uno
src/main.py
1
4228
#TODO: KI """ Uno: A clone of the cardgame UNO (C) Copyright (C) 2011 Alexander Thaller <alex.t@gmx.at> 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 (a...
gpl-3.0
ryfx/modrana
core/platform_detection.py
1
2696
# modRana current-platform detection import os import sys from core import qrc DEFAULT_DEVICE_MODULE_ID = "pc" DEFAULT_GUI_MODULE_ID = "GTK" import logging log = logging.getLogger("core.platform_detection") def getBestDeviceModuleId(): log.info("** detecting current device **") result = _check() if re...
gpl-3.0
shifter/rekall
rekall-core/rekall/plugins/addrspaces/elfcore.py
3
9619
# Rekall Memory Forensics # # Copyright 2012 Philippe Teuwen, Thorsten Sick, Michael Cohen # Copyright 2013 Google Inc. All Rights Reserved. # # 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; eit...
gpl-2.0
mcella/django
django/contrib/sessions/models.py
347
1298
from __future__ import unicode_literals from django.contrib.sessions.base_session import ( AbstractBaseSession, BaseSessionManager, ) class SessionManager(BaseSessionManager): use_in_migrations = True class Session(AbstractBaseSession): """ Django provides full support for anonymous sessions. The s...
bsd-3-clause
drinkssu/YourVoiceAlarmBackend
lib/werkzeug/contrib/atom.py
311
15281
# -*- coding: utf-8 -*- """ werkzeug.contrib.atom ~~~~~~~~~~~~~~~~~~~~~ This module provides a class called :class:`AtomFeed` which can be used to generate feeds in the Atom syndication format (see :rfc:`4287`). Example:: def atom_feed(request): feed = AtomFeed("My Blog", feed...
apache-2.0
citrix-openstack-build/tempest
tempest/services/compute/json/images_client.py
6
5332
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apach...
apache-2.0
rugk/letsencrypt
letsencrypt/constants.py
10
2636
"""Let's Encrypt constants.""" import os import logging from acme import challenges SETUPTOOLS_PLUGINS_ENTRY_POINT = "letsencrypt.plugins" """Setuptools entry point group name for plugins.""" CLI_DEFAULTS = dict( config_files=[ "/etc/letsencrypt/cli.ini", # http://freedesktop.org/wiki/Software/x...
apache-2.0
shastikk/youtube-dl
youtube_dl/extractor/mitele.py
18
2942
from __future__ import unicode_literals from .common import InfoExtractor from ..compat import compat_urllib_parse from ..utils import ( encode_dict, get_element_by_attribute, int_or_none, ) class MiTeleIE(InfoExtractor): IE_DESC = 'mitele.es' _VALID_URL = r'http://www\.mitele\.es/[^/]+/[^/]+/[^/...
unlicense
zstackio/zstack-woodpecker
integrationtest/vm/perf/sg/test_crt_sg_with_max_threads.py
4
5749
''' New Perf Test for creating SG and other SG rules related operations. The created number will depends on the environment variable: ZSTACK_TEST_NUM The default max threads are 1000. It could be modified by env variable: ZSTACK_THREAD_THRESHOLD This case might need to run in KVM simulator environemnt, if t...
apache-2.0
40223101/2015final2
static/Brython3.1.1-20150328-091302/Lib/browser/markdown.py
623
13060
# -*- coding: utf-8 -*- try: import _jsre as re except: import re import random import time letters = 'abcdefghijklmnopqrstuvwxyz' letters += letters.upper()+'0123456789' class URL: def __init__(self,src): elts = src.split(maxsplit=1) self.href = elts[0] self.alt = '' if ...
gpl-3.0
zakuro9715/lettuce
tests/integration/lib/Django-1.2.5/tests/regressiontests/admin_widgets/tests.py
38
15241
# encoding: utf-8 from datetime import datetime from unittest import TestCase from django import forms from django.conf import settings from django.contrib import admin from django.contrib.admin import widgets from django.contrib.admin.widgets import FilteredSelectMultiple, AdminSplitDateTime from django.contrib.admi...
gpl-3.0
Mercy-Nekesa/sokoapp
sokoapp/trending/managers.py
2
1033
import datetime from django.core.exceptions import ObjectDoesNotExist from django.db import models from django.db.models import Sum from django.contrib.contenttypes.models import ContentType class TrendingManager(models.Manager): def trending(self, model, days=30, kind=""): views = self.filter( ...
mit
40223137/w1717
wsgi.py
1
50394
# coding=utf-8 # 上面的程式內容編碼必須在程式的第一或者第二行才會有作用 ################# (1) 模組導入區 # 導入 cherrypy 模組, 為了在 OpenShift 平台上使用 cherrypy 模組, 必須透過 setup.py 安裝 import cherrypy # 導入 Python 內建的 os 模組, 因為 os 模組為 Python 內建, 所以無需透過 setup.py 安裝 import os # 導入 random 模組 import random import math from cherrypy.lib.static import serve_file # ...
gpl-3.0
Osndok/zim-desktop-wiki
zim/export/__init__.py
1
2943
# -*- coding: utf-8 -*- # Copyright 2008-2014 Jaap Karssenberg <jaap.karssenberg@gmail.com> '''This module contains the framework for exporting data from zim. The main API for exporting from the application is the L{Exporter} object. There are subclasses of Exporter to export to multiple files, to a single file or t...
gpl-2.0
mitdrc/director
src/python/director/switchplanner.py
5
12264
import os import sys import vtkAll as vtk import math import time import types import functools import numpy as np from director import transformUtils from director import lcmUtils from director.timercallback import TimerCallback from director.asynctaskqueue import AsyncTaskQueue from director import objectmodel as om...
bsd-3-clause
Eric89GXL/scikit-learn
examples/applications/wikipedia_principal_eigenvector.py
41
7742
""" =============================== Wikipedia principal eigenvector =============================== A classical way to assert the relative importance of vertices in a graph is to compute the principal eigenvector of the adjacency matrix so as to assign to each vertex the values of the components of the first eigenvect...
bsd-3-clause
UXE/local-edx
common/test/acceptance/pages/lms/dashboard.py
17
3339
# -*- coding: utf-8 -*- """ Student dashboard page. """ from bok_choy.page_object import PageObject from bok_choy.promise import EmptyPromise from . import BASE_URL class DashboardPage(PageObject): """ Student dashboard, where the student can view courses she/he has registered for. """ url = BAS...
agpl-3.0
ValvePython/vdf
tests/test_binary_vdf.py
1
6876
import sys import unittest import vdf from io import BytesIO from collections import OrderedDict u = str if sys.version_info >= (3,) else unicode class BinaryVDF(unittest.TestCase): def test_BASE_INT(self): repr(vdf.BASE_INT()) def test_simple(self): pairs = [ ('a', 'test'), ...
mit
alash3al/rethinkdb
external/gtest_1.6.0/test/gtest_list_tests_unittest.py
1068
5415
#!/usr/bin/env python # # Copyright 2006, 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...
agpl-3.0
40223240/cadb_g3_0420
static/Brython3.1.1-20150328-091302/Lib/xml/dom/__init__.py
873
4019
"""W3C Document Object Model implementation for Python. The Python mapping of the Document Object Model is documented in the Python Library Reference in the section on the xml.dom package. This package contains the following modules: minidom -- A simple implementation of the Level 1 DOM with namespace sup...
gpl-3.0
varunnaganathan/django
tests/validation/test_picklable.py
576
2010
import pickle from unittest import TestCase from django.core.exceptions import ValidationError class PickableValidationErrorTestCase(TestCase): def test_validationerror_is_picklable(self): original = ValidationError('a', code='something') unpickled = pickle.loads(pickle.dumps(original)) ...
bsd-3-clause
manuelnaranjo/LightBlue---Mac
src/mac/_IOBluetooth.py
1
3556
# Copyright (c) 2009 Bea Lam. All rights reserved. # # This file is part of LightBlue. # # LightBlue 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...
gpl-3.0
willemneal/Docky
lib/unidecode/x075.py
253
4675
data = ( 'Zhui ', # 0x00 'Ping ', # 0x01 'Bian ', # 0x02 'Zhou ', # 0x03 'Zhen ', # 0x04 'Senchigura ', # 0x05 'Ci ', # 0x06 'Ying ', # 0x07 'Qi ', # 0x08 'Xian ', # 0x09 'Lou ', # 0x0a 'Di ', # 0x0b 'Ou ', # 0x0c 'Meng ', # 0x0d 'Zhuan ', # 0x0e 'Peng ', # 0x0f 'Lin ', ...
mit
andrejb/leap_mail
src/leap/mail/_version.py
2
16747
# This file helps to compute a version number in source trees obtained from # git-archive tarball (such as those provided by githubs download-from-tag # feature). Distribution tarballs (built by setup.py sdist) and build # directories (produced by setup.py build) will contain a much shorter file # that just contains t...
gpl-3.0
demarle/VTK
ThirdParty/Twisted/twisted/internet/_pollingfile.py
32
8894
# -*- test-case-name: twisted.internet.test.test_pollingfile -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Implements a simple polling interface for file descriptors that don't work with select() - this is pretty much only useful on Windows. """ from zope.interface import implements ...
bsd-3-clause
chouseknecht/ansible
lib/ansible/modules/cloud/google/gcp_sql_user_info.py
5
5031
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (C) 2017 Google # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # ---------------------------------------------------------------------------- # # *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** # ...
gpl-3.0
40223136/2015cdag1man
static/Brython3.1.3-20150514-095342/Lib/site-packages/pygame/surface.py
603
3844
from browser import document, html, window from javascript import console, JSConstructor from .rect import Rect #import pygame.rect canvas_ID=1 _canvas_id=None class Surface: def __init__(self, dim=[], depth=16, surf=None): if surf is None: self._depth=depth self._canvas=html.CANVAS(width=...
gpl-3.0
sunqm/pyscf
pyscf/pbc/tdscf/test/test_rhf_slow.py
2
3697
from pyscf.pbc.gto import Cell from pyscf.pbc.scf import RHF from pyscf.pbc.tdscf import TDHF from pyscf.pbc.tdscf.rhf_slow import PhysERI, PhysERI4, PhysERI8, TDRHF from pyscf.tdscf.common_slow import eig from test_common import retrieve_m, retrieve_m_hf, assert_vectors_close import unittest from numpy import testin...
apache-2.0
alexandrujuncu/sos
sos/plugins/kimchi.py
14
1619
# Copyright IBM, Corp. 2014, Christy Perez <christy@linux.vnet.ibm.com> # 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....
gpl-2.0
sztanko/hadoop-common
src/contrib/hod/testing/testModule.py
182
2187
#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 thi...
apache-2.0
adelton/origin
cmd/service-catalog/go/src/github.com/kubernetes-incubator/service-catalog/vendor/k8s.io/kubernetes/cluster/juju/layers/kubernetes-worker/lib/charms/kubernetes/flagmanager.py
182
4599
#!/usr/bin/env python # Copyright 2015 The Kubernetes Authors. # # 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...
apache-2.0
aleju/imgaug
checks/check_visually.py
2
8145
""" Tests to visually inspect the results of the library's functionality. Run checks via python check_visually.py """ from __future__ import print_function, division import argparse import numpy as np from skimage import data import imgaug as ia from imgaug import augmenters as iaa def main(): parser = arg...
mit
andrewmoses/ssquiz
flask/lib/python2.7/site-packages/coverage/html.py
159
13097
"""HTML reporting for Coverage.""" import os, re, shutil, sys import coverage from coverage.backward import pickle from coverage.misc import CoverageException, Hasher from coverage.phystokens import source_token_lines, source_encoding from coverage.report import Reporter from coverage.results import Numbers from cove...
bsd-3-clause
Philippe12/external_chromium_org
tools/telemetry/telemetry/core/platform/__init__.py
23
6350
# 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 from telemetry.core.platform import linux_platform_backend from telemetry.core.platform import mac_platform_backend from telemetry.core.platf...
bsd-3-clause
MarineLasbleis/GrowYourIC
notebooks/WD11.py
1
2954
# import statements import numpy as np import matplotlib.pyplot as plt #for figures from mpl_toolkits.basemap import Basemap #to render maps import math import json #to write dict with parameters from GrowYourIC import positions, geodyn, geodyn_trg, geodyn_static, plot_data, data plt.rcParams['figure.figsize'] = (8.0...
mit
gerald-yang/ubuntu-iotivity-demo
snappy/grovepi/python-env/local/lib/python2.7/encodings/iso8859_10.py
593
13845
""" Python Character Mapping Codec iso8859_10 generated from 'MAPPINGS/ISO8859/8859-10.TXT' with gencodec.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_table) def decode(self,input,errors...
apache-2.0
mika76/Wox
PythonHome/Lib/site-packages/pip/_vendor/requests/packages/chardet/langcyrillicmodel.py
2762
17725
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Communicator client 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 R...
mit
luotao1/Paddle
python/paddle/dataset/movielens.py
1
9031
# 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...
apache-2.0
vecnet/vnetsource
djorm-ext-pgbytea/djorm_pgbytea/lobject.py
4
2813
# -*- coding: utf-8 -*- import types import sys import six from django.db import models, connections from psycopg2.extensions import lobject as lobject_class class LargeObjectFile(object): """ Proxy class over psycopg2 large object file instance. """ def __init__(self, oid=0, field=None, instance=No...
mpl-2.0
abarthakur/voice_assistant
src/movieModule.py
1
1920
from os import system import pyttsx #Setting up the speaker def onStart(name): print "" def onWord(name, location, length): print "" def onEnd(name, completed): print "" engine = pyttsx.init() rate = engine.getProperty('rate') engine.setProperty('rate', rate-50) engine.connect('started-utterance', onStart) e...
gpl-3.0
aliyun/oss-ftp
python27/win32/Lib/test/test_htmllib.py
133
1978
import formatter import unittest from test import test_support htmllib = test_support.import_module('htmllib', deprecated=True) class AnchorCollector(htmllib.HTMLParser): def __init__(self, *args, **kw): self.__anchors = [] htmllib.HTMLParser.__init__(self, *args, **kw) def get_anchor_info(s...
mit
Creworker/FreeCAD
src/Tools/MakeNewBuildNbr.py
16
2546
# FreeCAD MakeNewBuildNbr script # (c) 2002 Jürgen Riegel # # Increase the Build Number in Version.h #*************************************************************************** #* (c) Jürgen Riegel (juergen.riegel@web.de) 2002 * #* ...
lgpl-2.1
gc3-uzh-ch/ganglia
gmetad-python/Gmetad/gmetad_element.py
15
5497
#/******************************************************************************* #* Portions Copyright (C) 2008 Novell, 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: #* #* - Redistributi...
bsd-3-clause
Tony-Wang/YaYaNLP
test/test_organization_recognition.py
1
2674
# coding=utf-8 __author__ = 'tony' from unittest import TestCase from yaya.config import Config from yaya.recognition import person_recognition from yaya.recognition import place_recognition from yaya.recognition import organization_recognition from yaya.seg.viterbi import viterbi from yaya.seg.wordnet import WordNet,...
apache-2.0
codervince/flashingredlight
env/lib/python2.7/site-packages/gunicorn/six.py
320
27344
"""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...
mit
lihui7115/ChromiumGStreamerBackend
infra/scripts/legacy/site_config/config_default.py
6
7736
# Copyright 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. """Seeds a number of variables defined in chromium_config.py. The recommended way is to fork this file and use a custom DEPS forked from config/XXX/DEPS wit...
bsd-3-clause
ivan-fedorov/intellij-community
python/lib/Lib/pawt/colors.py
112
4500
from java.awt import Color aliceblue = Color(240, 248, 255) antiquewhite = Color(250, 235, 215) aqua = Color(0, 255, 255) aquamarine = Color(127, 255, 212) azure = Color(240, 255, 255) beige = Color(245, 245, 220) bisque = Color(255, 228, 196) black = Color(0, 0, 0) blanchedalmond = Color(255, 235, 205) blue = Color(0...
apache-2.0
kynikos/outspline
src/outspline/conf/plugins/wxdbsearch.py
1
1334
# Outspline - A highly modular and extensible outliner. # Copyright (C) 2011 Dario Giovannetti <dev@dariogiovannetti.net> # # This file is part of Outspline. # # Outspline 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 F...
gpl-3.0
t794104/ansible
lib/ansible/modules/network/dellos6/dellos6_facts.py
50
15435
#!/usr/bin/python # # (c) 2015 Peter Sprygada, <psprygada@ansible.com> # Copyright (c) 2016 Dell 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_versio...
gpl-3.0
lunafeng/django
django/contrib/admin/templatetags/admin_modify.py
342
2505
from django import template register = template.Library() @register.inclusion_tag('admin/prepopulated_fields_js.html', takes_context=True) def prepopulated_fields_js(context): """ Creates a list of prepopulated_fields that should render Javascript for the prepopulated fields for both the admin form and i...
bsd-3-clause
nanolearningllc/edx-platform-cypress-2
cms/djangoapps/contentstore/features/course-export.py
58
2706
# pylint: disable=missing-docstring # pylint: disable=redefined-outer-name # pylint: disable=unused-argument from lettuce import world, step from component_settings_editor_helpers import enter_xml_in_advanced_problem from nose.tools import assert_true, assert_equal from contentstore.utils import reverse_usage_url @s...
agpl-3.0
ebonymarieb/django-calaccess-raw-data
example/toolbox/management/commands/createfielddocissues.py
29
5833
import os import time import calculate from github import Github from django.conf import settings from calaccess_raw import get_model_list from calaccess_raw.management.commands import CalAccessCommand from django.contrib.humanize.templatetags.humanize import intcomma class Command(CalAccessCommand): help = 'Crea...
mit
rustychris/stompy
docs/conf.py
1
5704
# -*- coding: utf-8 -*- # # stompy documentation build configuration file, created by # sphinx-quickstart on Mon Jun 19 14:24:20 2017. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # Al...
mit
akaariai/django
django/conf/locale/cs/formats.py
504
1702
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # from __future__ import unicode_literals # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'j. E Y' TIME_FORMAT = 'G:i' DATET...
bsd-3-clause
jandebleser/django-wiki
tests/plugins/attachments/test_views.py
1
5144
from __future__ import print_function, unicode_literals from io import BytesIO from django.core.files.uploadedfile import InMemoryUploadedFile from django.core.urlresolvers import reverse from ...base import ArticleWebTestBase class AttachmentTests(ArticleWebTestBase): def setUp(self): super(Attachmen...
gpl-3.0
nashve/mythbox
resources/test/mythboxtest/test_util.py
7
20061
# # MythBox for XBMC - http://mythbox.googlecode.com # Copyright (C) 2011 analogue@yahoo.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at you...
gpl-2.0