repo_name
stringlengths
6
100
path
stringlengths
4
294
copies
stringlengths
1
5
size
stringlengths
4
6
content
stringlengths
606
896k
license
stringclasses
15 values
thawatchai/mrkimontour
appengine-django/lib/django/forms/forms.py
141
19457
""" Form classes """ from __future__ import unicode_literals import copy from collections import OrderedDict from django.core.exceptions import NON_FIELD_ERRORS, ValidationError # BoundField is imported for backwards compatibility in Django 1.9 from django.forms.boundfield import BoundField # NOQA from django.forms...
gpl-2.0
yanaice/AllGrailsProject
source/accident1/web-app/js/OpenLayers-2.13.1/tools/exampleparser.py
131
7756
#!/usr/bin/env python import sys import os import re import time from xml.dom.minidom import Document try: import xml.etree.ElementTree as ElementTree except ImportError: try: import cElementTree as ElementTree except ImportError: try: import elementtree.ElementTree as Element...
mit
Juanlu001/pfc
demo/plot_h.py
1
6084
#****************************************************************************** # * # * ** * * * * * # * * * * * * * * * * ...
gpl-3.0
sodo13/openpli-gls
lib/python/Components/Sources/Boolean.py
162
1264
from Source import Source from Components.Element import cached from enigma import eTimer # a small warning: # you can use that boolean well to express screen-private # conditional expressions. # # however, if you think that there is ANY interest that another # screen could use your expression, please put your calcula...
gpl-2.0
Open-Plus/opgui
lib/python/Plugins/Extensions/CutListEditor/ui.py
58
12859
import bisect from enigma import getDesktop, iPlayableService from Screens.Screen import Screen from Screens.MessageBox import MessageBox from Components.ServicePosition import ServicePositionGauge from Components.ActionMap import HelpableActionMap from Components.ServiceEventTracker import ServiceEventTracker, InfoB...
gpl-2.0
bearicc/004
venv/lib/python3.4/site-packages/pip/_vendor/html5lib/treebuilders/etree.py
915
12621
from __future__ import absolute_import, division, unicode_literals from pip._vendor.six import text_type import re from . import _base from .. import ihatexml from .. import constants from ..constants import namespaces from ..utils import moduleFactoryFactory tag_regexp = re.compile("{([^}]*)}(.*)") def getETreeBu...
gpl-3.0
mpdehaan/interfacer
lib/interfacer/base_module.py
1
4701
# # Copyright (c) rPath, 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 rights # to use, copy, modify, merge, publish, distribute...
mit
40223211/cadpbtest0615
static/Brython3.1.1-20150328-091302/Lib/_string.py
625
1112
"""string helper module""" import re class __loader__(object): pass def formatter_field_name_split(fieldname): """split the argument as a field name""" _list=[] for _name in fieldname: _parts = _name.split('.') for _item in _parts: is_attr=False #fix me if re....
agpl-3.0
sander76/home-assistant
homeassistant/components/lyric/__init__.py
3
5660
"""The Honeywell Lyric integration.""" from __future__ import annotations import asyncio from datetime import timedelta import logging from typing import Any from aiolyric import Lyric from aiolyric.objects.device import LyricDevice from aiolyric.objects.location import LyricLocation import async_timeout import volup...
apache-2.0
dspt/scriptaroonies
github/repo-edit.py
2
1359
# A simple github interaction script for editing your repos # `pip install pygithub` # You'll need to set GH_TOKEN and GH_USER environment variables # You can make your token here: https://github.com/settings/tokens from github import Github import argparse, os, sys access_token = os.environ['GH_TOKEN'] username = os...
gpl-2.0
darren-rogan/CouchPotatoServer
libs/pyutil/odict.py
106
20991
# Copyright (c) 2002-2009 Zooko "Zooko" Wilcox-O'Hearn """ This module offers a Ordered Dict, which is a dict that preserves insertion order. See PEP 372 for description of the problem. This implementation uses a linked-list to get good O(1) asymptotic performance. (Actually it is O(hashtable-update-cost), but wha...
gpl-3.0
pf4d/dolfin-adjoint
dolfin_adjoint/functionassigner.py
1
8559
import backend import utils import adjglobals import solving import libadjoint import adjlinalg if hasattr(backend, 'FunctionAssigner'): class FunctionAssigner(backend.FunctionAssigner): def __init__(self, *args, **kwargs): super(FunctionAssigner, self).__init__(*args, **kwargs) #...
lgpl-3.0
benjaminer82/threejs
utils/converters/msgpack/msgpack/__init__.py
659
1385
# coding: utf-8 from msgpack._version import version from msgpack.exceptions import * from collections import namedtuple class ExtType(namedtuple('ExtType', 'code data')): """ExtType represents ext type in msgpack.""" def __new__(cls, code, data): if not isinstance(code, int): raise TypeE...
mit
crawln45/Flexget
flexget/plugins/services/myepisodes.py
7
9954
from __future__ import unicode_literals, division, absolute_import from builtins import * # noqa pylint: disable=unused-import, redefined-builtin import logging import re from datetime import datetime from sqlalchemy import Column, Integer, String, DateTime from flexget import plugin from flexget.event import event...
mit
wogsland/QSTK
build/lib.linux-x86_64-2.7/QSTK/qstkstudy/Events.py
5
1878
# (c) 2011, 2012 Georgia Tech Research Corporation # This source code is released under the New BSD license. Please see # http://wiki.quantsoftware.org/index.php?title=QSTK_License # for license details. #Created on October <day>, 2011 # #@author: Vishal Shekhar #@contact: mailvishalshekhar@gmail.com #@summary: Examp...
bsd-3-clause
pwnieexpress/pwn_plug_sources
src/set/src/webattack/harvester/scraper.py
6
2358
#!/usr/bin/env python import os import sys import re import subprocess import urlparse import shutil # # Scraper will grab the cloned website and try defining post parameters # # grab ipaddr fileopen=file("src/program_junk/ipaddr.file","r").readlines() for line in fileopen: ipaddr=line.rstrip() # end ipaddr # set ...
gpl-3.0
bluec0re/cvss-calculator
cvsscalc/cvsscalc.py
2
7239
#!/usr/bin/env python2 import inspect import sys def get_user_attributes(cls): """ Keyword arguments: cls -- """ boring = dir(type('dummy', (object,), {})) return [item for item in inspect.getmembers(cls, lambda x: not inspect....
isc
adrpar/incubator-airflow
tests/core.py
1
101537
# -*- coding: utf-8 -*- # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software ...
apache-2.0
magic0704/oslo.messaging
oslo_messaging/notify/log_handler.py
6
1762
# 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 the Li...
apache-2.0
pythonegrove/django-paypal-advanced
paypal_advanced/simple/satchmo_store/shop/urls.py
1
2010
from django.conf.urls import patterns, include from django.views.generic.base import TemplateView from product.urls import urlpatterns as productpatterns from satchmo_store import shop from satchmo_store.shop.views.sitemaps import sitemaps from signals_ahoy.signals import collect_urls urlpatterns = shop.get_satchmo_se...
gpl-2.0
roman-verchikov/CloudFerry
cloudferrylib/utils/utils.py
2
15603
# Copyright (c) 2014 Mirantis 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 writing, so...
apache-2.0
cdgallahue/atomic-turbine
web/lib/python2.7/site-packages/flask/config.py
76
9905
# -*- coding: utf-8 -*- """ flask.config ~~~~~~~~~~~~ Implements the configuration related objects. :copyright: (c) 2015 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import os import types import errno from werkzeug.utils import import_string from ._compat import string_ty...
mit
ArthurGarnier/SickRage
lib/pgi/cffilib/_utils.py
19
3187
# Copyright 2013 Christoph Reiter # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. import re import os import...
gpl-3.0
madan96/sympy
sympy/plotting/pygletplot/plot_interval.py
94
5432
from __future__ import print_function, division from sympy import Symbol, Integer, sympify from sympy.core.compatibility import range class PlotInterval(object): """ """ _v, _v_min, _v_max, _v_steps = None, None, None, None def require_all_args(f): def check(self, *args, **kwargs): ...
bsd-3-clause
dwdm/shadowsocks
shadowsocks/crypto/sodium.py
1032
3778
#!/usr/bin/env python # # Copyright 2015 clowwindy # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
apache-2.0
abtreece/ansible
lib/ansible/playbook/attribute.py
8
2065
# (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...
mit
jmartu/testing
venv/lib/python3.6/site-packages/pip/_vendor/requests/cookies.py
355
18208
# -*- coding: utf-8 -*- """ requests.cookies ~~~~~~~~~~~~~~~~ Compatibility code to be able to use `cookielib.CookieJar` with requests. requests.utils imports from here, so be careful with imports. """ import copy import time import calendar import collections from .compat import cookielib, urlparse, urlunparse, Mo...
mit
ftomassetti/polito_information_systems_python
forms/example_2.py
1
1451
from flask import Flask,request app = Flask("My app with forms") app.debug = True @app.route('/register') def show_registration_form(): # VIEW response = '<html>' response += ' <h1>Registration form</h1>' response += ' <form name="registration" action="submit_registration_form" method="post">' response += ' ...
mit
vine/uwsgi
t/cachebitmap.py
6
5698
import uwsgi import unittest import random import string class BitmapTest(unittest.TestCase): __caches__ = ['items_1', 'items_2', 'items_3', 'items_4', 'items_17', 'items_4_10', 'items_1_100000', 'items_non_bitmap', 'items_lru'] def setUp(self): for cache in self.__caches__: uwsgi.cache_c...
gpl-2.0
adhoc-dev/odoo-support
database_tools/controllers/db.py
1
3497
# -*- coding: utf-8 -*- ############################################################################## # For copyright and license notices, see __openerp__.py file in module root # directory ############################################################################## import openerp.http as http import base64 from ope...
lgpl-3.0
orione7/Italorione
channels/italiafilm.py
1
10226
# -*- coding: iso-8859-1 -*- # ------------------------------------------------------------ # streamondemand.- XBMC Plugin # Canal para italiafilm # http://blog.tvalacarta.info/plugin-xbmc/streamondemand. # ------------------------------------------------------------ import re import sys import urlparse from core impo...
gpl-3.0
ingokegel/intellij-community
plugins/hg4idea/testData/bin/hgext/churn.py
90
6836
# churn.py - create a graph of revisions count grouped by template # # Copyright 2006 Josef "Jeff" Sipek <jeffpc@josefsipek.net> # Copyright 2008 Alexander Solovyov <piranha@piranha.org.ua> # # This software may be used and distributed according to the terms of the # GNU General Public License version 2 or any later ve...
apache-2.0
stefanofontanelli/xhtml2pdf
xhtml2pdf/context.py
7
34895
# -*- coding: utf-8 -*- from reportlab.lib.enums import TA_LEFT from reportlab.lib.fonts import addMapping from reportlab.lib.pagesizes import landscape, A4 from reportlab.lib.styles import ParagraphStyle from reportlab.pdfbase import pdfmetrics from reportlab.pdfbase.ttfonts import TTFont from reportlab.platypus.frame...
apache-2.0
SRabbelier/Melange
thirdparty/google_appengine/google/appengine/datastore/datastore_index.py
5
16161
#!/usr/bin/env python # # Copyright 2007 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 o...
apache-2.0
joshbohde/xbmc-notify-mqtt
script.service.notify-mqtt/resources/lib/mosquitto.py
1
80746
# Copyright (c) 2012,2013 Roger Light <roger@atchoo.org> # 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 notice, # this lis...
gpl-3.0
YathishReddy/Robust_ECN_Signalling_With_Nonces
src/buildings/bindings/modulegen__gcc_ILP32.py
28
373233
from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers import pybindgen.settings import warnings class ErrorHandler(pybindgen.settings.ErrorHandler): def handle_error(self, wrapper, exception, traceback_): warnings.warn("exception %r in wrapper %s" % (exception, wrapper)) ...
gpl-2.0
CenterForOpenScience/osf.io
osf/management/commands/restore_deleted_root_folders.py
8
1583
# -*- coding: utf-8 -*- import logging import datetime from bulk_update.helper import bulk_update from django.core.management.base import BaseCommand from osf.models import BaseFileNode logger = logging.getLogger(__name__) def restore_deleted_root_folders(dry_run=False): deleted_roots = BaseFileNode.objects.fil...
apache-2.0
rowinggolfer/openmolar2
src/lib_openmolar/admin/db_orm/admin_treatment_fills.py
1
2596
#! /usr/bin/env python # -*- coding: utf-8 -*- ############################################################################### ## ## ## Copyright 2010-2012, Neil Wallace <neil@openmolar.com> ## ## ...
gpl-3.0
transt/cloud-init-0.7.5
cloudinit/stages.py
6
27944
# vi: ts=4 expandtab # # Copyright (C) 2012 Canonical Ltd. # Copyright (C) 2012, 2013 Hewlett-Packard Development Company, L.P. # Copyright (C) 2012 Yahoo! Inc. # # Author: Scott Moser <scott.moser@canonical.com> # Author: Juerg Haefliger <juerg.haefliger@hp.com> # Author: Joshua Harlow <harlowja@yaho...
gpl-3.0
leighpauls/k2cro4
third_party/python_26/Lib/lib2to3/tests/support.py
51
1940
"""Support code for test_*.py files""" # Author: Collin Winter # Python imports import unittest import sys import os import os.path import re from textwrap import dedent #sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..")) # Local imports from .. import pytree from .. import refactor from ..pgen2 impor...
bsd-3-clause
rue89-tech/edx-platform
common/test/acceptance/tests/studio/test_studio_settings_details.py
13
7409
""" Acceptance tests for Studio's Settings Details pages """ from unittest import skip from acceptance.tests.studio.base_studio_test import StudioCourseTest from ...fixtures.course import CourseFixture from ...pages.studio.settings import SettingsPage from ...pages.studio.overview import CourseOutlinePage from ...test...
agpl-3.0
udacity/ggplot
ggplot/tests/test_stat.py
12
2584
from __future__ import (absolute_import, division, print_function, unicode_literals) from nose.tools import (assert_equal, assert_is, assert_is_not, assert_raises) from ggplot import * from ggplot.geoms.geom import geom from ggplot.stats.stat import stat from ggplot.util...
bsd-2-clause
fxtentacle/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/style/error_handlers.py
178
6909
# Copyright (C) 2010 Chris Jerdonek (cjerdonek@webkit.org) # # 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 # notice, this list of conditions and...
bsd-3-clause
cmouse/buildbot
master/buildbot/test/integration/interop/test_setpropertyfromcommand.py
6
2470
# 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...
gpl-2.0
Glorf/servo
tests/wpt/web-platform-tests/fetch/api/resources/preflight.py
79
2473
def main(request, response): headers = [("Content-Type", "text/plain")] stashed_data = {'control_request_headers': "", 'preflight': "0", 'preflight_referrer': ""} if "origin" in request.GET: for origin in request.GET['origin'].split(", "): headers.append(("Access-Control-Allow-Origin", ...
mpl-2.0
hsorby/mapclient
src/mapclient/tools/pmr/ui_authoriseapplicationdialog.py
3
2669
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'qt/authoriseapplicationdialog.ui' # # Created: Mon Dec 23 19:31:45 2013 # by: pyside-uic 0.2.14 running on PySide 1.1.2 # # WARNING! All changes made in this file will be lost! from PySide import QtCore, QtGui class Ui_AuthoriseApplic...
gpl-3.0
micadeyeye/Blongo
django/contrib/gis/gdal/prototypes/errcheck.py
404
4207
""" This module houses the error-checking routines used by the GDAL ctypes prototypes. """ from ctypes import c_void_p, string_at from django.contrib.gis.gdal.error import check_err, OGRException, SRSException from django.contrib.gis.gdal.libgdal import lgdal # Helper routines for retrieving pointers and/or values f...
bsd-3-clause
microcom/odoo
addons/l10n_be_invoice_bba/invoice.py
16
11035
# -*- 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 ...
agpl-3.0
tafia/servo
tests/wpt/css-tests/tools/pywebsocket/src/test/mux_client_for_testing.py
457
25761
#!/usr/bin/env python # # Copyright 2012, 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...
mpl-2.0
igorcompuff/ns-3.26
src/energy/bindings/modulegen__gcc_ILP32.py
38
314509
from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers import pybindgen.settings import warnings class ErrorHandler(pybindgen.settings.ErrorHandler): def handle_error(self, wrapper, exception, traceback_): warnings.warn("exception %r in wrapper %s" % (exception, wrapper)) ...
gpl-2.0
alikins/ansible
test/units/modules/network/nxos/test_nxos_config.py
31
5819
#!/usr/bin/env python # # (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 ver...
gpl-3.0
Carreau/pip
tests/functional/test_install_reqs.py
6
5142
import os.path import textwrap import pytest from tests.lib import (pyversion, path_to_url, _create_test_package_with_subdirectory) from tests.lib.local_repos import local_checkout def test_requirements_file(script): """ Test installing from a requirements file. """ other_lib...
mit
Newman101/hamster
src/hamster/storage/storage.py
8
5112
# - coding: utf-8 - # Copyright (C) 2007 Patryk Zawadzki <patrys at pld-linux.org> # Copyright (C) 2007-2012 Toms Baugis <toms.baugis@gmail.com> # This file is part of Project Hamster. # Project Hamster is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as ...
gpl-3.0
jordanemedlock/psychtruths
temboo/core/Library/Salesforce/Passwords/ChangePassword.py
5
5470
# -*- coding: utf-8 -*- ############################################################################### # # ChangePassword # Changes a user's password. # # Python versions 2.6, 2.7, 3.x # # Copyright 2014, Temboo Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file excep...
apache-2.0
Zhongqilong/kbengine
kbe/src/lib/python/Lib/distutils/command/upload.py
59
7409
"""distutils.command.upload Implements the Distutils 'upload' subcommand (upload package to PyPI).""" import sys import os, io import socket import platform from base64 import standard_b64encode from urllib.request import urlopen, Request, HTTPError from urllib.parse import urlparse from distutils.errors import Distu...
lgpl-3.0
sparcs-kaist/otlplus
apps/timetable/models.py
1
2296
# -*- coding: utf-8 from django.db import models from apps.subject.models import * from apps.session.models import * class Timetable(models.Model): lectures = models.ManyToManyField(Lecture) user = models.ForeignKey(UserProfile, related_name="timetables", on_delete=models.CASCADE, db_index=True) year = mo...
mit
slevenhagen/odoo-npg
addons/base_report_designer/wizard/__init__.py
421
1081
# -*- 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
s3nk4s/flaskTutorials
FlaskApp/FlaskApp/venv/local/lib/python2.7/encodings/cp1250.py
593
13942
""" Python Character Mapping Codec cp1250 generated from 'MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1250.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,in...
mit
ToontownUprising/src
toontown/toon/DistributedNPCBankerAI.py
3
3381
from otp.ai.AIBaseGlobal import * from direct.task.Task import Task from pandac.PandaModules import * from DistributedNPCToonBaseAI import * from toontown.estate import BankGlobals class DistributedNPCBankerAI(DistributedNPCToonBaseAI): FourthGagVelvetRopeBan = config.GetBool('want-ban-fourth-gag-velvet-rope', 0) ...
mit
IvanAli/powerline
powerline/bindings/zsh/__init__.py
23
5553
# vim:fileencoding=utf-8:noet from __future__ import (unicode_literals, division, absolute_import, print_function) import atexit from weakref import WeakValueDictionary, ref import zsh from powerline.shell import ShellPowerline from powerline.lib.overrides import parsedotval, parse_override_var from powerline.lib.u...
mit
dpetzold/django
tests/signals/tests.py
13
10279
from __future__ import unicode_literals from django.db import models from django.db.models import signals from django.dispatch import receiver from django.test import TestCase from django.utils import six from .models import Author, Book, Car, Person class BaseSignalTest(TestCase): def setUp(self): # Sa...
bsd-3-clause
stewartpark/django
django/contrib/admin/templatetags/admin_urls.py
553
1812
from django import template from django.contrib.admin.utils import quote from django.core.urlresolvers import Resolver404, get_script_prefix, resolve from django.utils.http import urlencode from django.utils.six.moves.urllib.parse import parse_qsl, urlparse, urlunparse register = template.Library() @register.filter ...
bsd-3-clause
ygol/odoo
addons/payment_paypal/controllers/main.py
27
5224
# -*- coding: utf-8 -*- try: import simplejson as json except ImportError: import json import logging import pprint import urllib import urllib2 import werkzeug from openerp import http, SUPERUSER_ID from openerp.http import request _logger = logging.getLogger(__name__) class PaypalController(http.Controll...
agpl-3.0
mattzjack/zumazuma
ball.py
1
3069
import pygame, math class Ball(pygame.sprite.Sprite): SPEED = 50 @staticmethod def load_images(): Ball.images = list() for filename in ['red', 'blue', 'green', 'purple']: img = pygame.image.load('./imgs/%s.png' % filename).convert_alpha() w = h = 50 scal...
mit
pimier15/PyGUI
Kivy/Kivy/Bk_Interractive/Kivy-Interractive application/sample/Chapter_06_code/10 - Search - query the TED Developer API/actiontextinput.py
2
1242
import kivy kivy.require('1.9.0') from kivy.uix.textinput import TextInput from kivy.uix.actionbar import ActionItem from kivy.core.window import Window from kivy.lang import Builder Builder.load_string(""" <ActionTextInput>: background_color: 0.2,0.2,0.2,1 foreground_color: 1,1,1,1 cursor_color: 1,1,1,1...
mit
GuLinux/PySpectrum
object_properties_dialog.py
1
4596
from astroquery.simbad import Simbad from PyQt5.QtWidgets import QDialog, QDialogButtonBox, QMessageBox from pyui.object_properties_dialog import Ui_ObjectPropertiesDialog import re from PyQt5.QtCore import Qt, QObject, pyqtSignal, QDateTime from astropy.coordinates import SkyCoord from astropy import units as u from o...
gpl-3.0
wimnat/ansible-modules-extras
monitoring/datadog_monitor.py
7
12561
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2015, Sebastian Kornehl <sebastian.kornehl@asideas.de> # # 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 versi...
gpl-3.0
stotch/voldemort
bin/generate_cluster_xml.py
2
8434
#!/usr/bin/python # # Copyright 2013 LinkedIn, 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 applicab...
apache-2.0
awlange/brainsparks
src/calrissian/layers/octree/octree.py
1
10430
from .box import Box import numpy as np from numba import jit class Octree(object): """ Octree implementation to be used in particle dipole networks """ def __init__(self, max_level=3, p=0, n_particle_min=20, mac=0.0, cut=1000.0): self.max_level = max_level self.p = p self.n_...
mit
flashycud/timestack
django/db/backends/mysql/validation.py
392
1309
from django.db.backends import BaseDatabaseValidation class DatabaseValidation(BaseDatabaseValidation): def validate_field(self, errors, opts, f): """ There are some field length restrictions for MySQL: - Prior to version 5.0.3, character fields could not exceed 255 characters in...
mit
bachelorwhc/Valkyrie
third_party/tbb/python/tbb/test.py
2
6490
#!/usr/bin/env python # # Copyright (c) 2016-2017 Intel Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by a...
mit
SitiBanc/1061_NCTU_IOMDS
1025/Homework 5/HW5_5.py
1
5472
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Thu Oct 26 21:05:37 2017 @author: sitibanc """ import pandas as pd import numpy as np import matplotlib.pyplot as plt # ============================================================================= # Read CSV # =============================================...
apache-2.0
dhomeier/astropy
astropy/io/votable/tests/tree_test.py
3
1853
# Licensed under a 3-clause BSD style license - see LICENSE.rst from astropy.io.votable import exceptions from astropy.io.votable import tree from astropy.io.votable.table import parse from astropy.tests.helper import raises from astropy.utils.data import get_pkg_data_filename @raises(exceptions.W07) def test_check_...
bsd-3-clause
smi96/django-blog_website
lib/python2.7/site-packages/django/contrib/gis/gdal/geometries.py
337
24056
""" The OGRGeometry is a wrapper for using the OGR Geometry class (see http://www.gdal.org/ogr/classOGRGeometry.html). OGRGeometry may be instantiated when reading geometries from OGR Data Sources (e.g. SHP files), or when given OGC WKT (a string). While the 'full' API is not present yet, the API is "pythonic" u...
mit
chiara-paci/baskerville
baskervilleweb/classification/migrations/0001_initial.py
1
9739
# Generated by Django 3.0.2 on 2020-02-21 10:11 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ('contenttypes', '0002_remove_content_type_name'), ] operations = [ migrations.CreateMode...
gpl-3.0
jimmsta/namebench-1
nb_third_party/dns/rdtypes/ANY/NSEC3.py
248
6716
# Copyright (C) 2004-2007, 2009, 2010 Nominum, Inc. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose with or without fee is hereby granted, # provided that the above copyright notice and this permission notice # appear in all copies. # # THE SOFTWARE IS PROVIDED ...
apache-2.0
igabr/Metis_Projects_Chicago_2017
03-Project-McNulty/web_app/src/flask-lesscss/setup.py
4
1200
""" flask-lesscss ---------- A small Flask extension that makes it easy to use LessCSS with your Flask application. Links ````` * `documentation <http://sjl.bitbucket.org/flask-lesscss/>`_ * `development version <http://bitbucket.org/sjl/flask-lesscss/get/tip.gz#egg=flask-lesscss-dev`_ """ from setuptools import...
mit
unreal666/outwiker
plugins/webpage/webpage/libs/email/base64mime.py
45
3558
# Copyright (C) 2002-2007 Python Software Foundation # Author: Ben Gertzfield # Contact: email-sig@python.org """Base64 content transfer encoding per RFCs 2045-2047. This module handles the content transfer encoding method defined in RFC 2045 to encode arbitrary 8-bit data using the three 8-bit bytes in four 7-bit ch...
gpl-3.0
jeremiahmarks/sl4a
python/src/Lib/lib2to3/fixes/fix_sys_exc.py
53
1030
"""Fixer for sys.exc_{type, value, traceback} sys.exc_type -> sys.exc_info()[0] sys.exc_value -> sys.exc_info()[1] sys.exc_traceback -> sys.exc_info()[2] """ # By Jeff Balogh and Benjamin Peterson # Local imports from .. import fixer_base from ..fixer_util import Attr, Call, Name, Number, Subscript, Node, syms clas...
apache-2.0
dslomov/intellij-community
python/lib/Lib/encodings/iso8859_2.py
593
13660
""" Python Character Mapping Codec iso8859_2 generated from 'MAPPINGS/ISO8859/8859-2.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
smartforceplus/SmartForceplus
addons/survey/test/test_survey.py
188
1403
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (c) 2014-TODAY OpenERP S.A. <http://openerp.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of ...
agpl-3.0
zonk1024/moto
tests/test_ec2/test_network_acls.py
19
3846
from __future__ import unicode_literals import boto import sure # noqa from moto import mock_ec2 @mock_ec2 def test_default_network_acl_created_with_vpc(): conn = boto.connect_vpc('the_key', 'the secret') vpc = conn.create_vpc("10.0.0.0/16") all_network_acls = conn.get_all_network_acls() all_netwo...
apache-2.0
prasoon007/DroidX
node_modules/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/analyzer.py
1382
30567
# Copyright (c) 2014 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. """ This script is intended for use as a GYP_GENERATOR. It takes as input (by way of the generator flag config_path) the path of a json file that dictates the file...
apache-2.0
razvanphp/arangodb
3rdParty/V8-3.31.74.1/third_party/python_26/Lib/site-packages/pythonwin/pywin/framework/bitmap.py
17
4652
import win32ui import win32con import win32api import string import os import app import sys from pywin.mfc import docview, window bStretch = 1 class BitmapDocument(docview.Document): "A bitmap document. Holds the bitmap data itself." def __init__(self, template): docview.Document.__init__(self, template) sel...
apache-2.0
mattseymour/django
tests/forms_tests/tests/test_forms.py
1
169808
import copy import datetime import json import uuid from django.core.exceptions import NON_FIELD_ERRORS from django.core.files.uploadedfile import SimpleUploadedFile from django.core.validators import MaxValueValidator, RegexValidator from django.forms import ( BooleanField, CharField, CheckboxSelectMultiple, Choi...
bsd-3-clause
AndrewGrossman/django
django/template/loaders/base.py
137
3887
import warnings from django.template import Origin, Template, TemplateDoesNotExist from django.utils.deprecation import RemovedInDjango20Warning from django.utils.inspect import func_supports_parameter class Loader(object): # Only used to raise a deprecation warning. Remove in Django 1.10. is_usable = False ...
bsd-3-clause
verleihtool/verleihtool
rental/models.py
1
4155
import uuid from datetime import datetime from django.db import models from django.core.exceptions import ValidationError from django.contrib.auth.models import User from django.utils.translation import ugettext_lazy as _ from depot.models import Depot, Item class Rental(models.Model): """ A rental defines th...
agpl-3.0
sxhao/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/tool/steps/abstractstep.py
129
3437
# Copyright (C) 2010 Google Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and th...
bsd-3-clause
jelugbo/tundex
common/lib/capa/capa/customrender.py
40
4429
""" This has custom renderers: classes that know how to render certain problem tags (e.g. <math> and <solution>) to html. These tags do not have state, so they just get passed the system (for access to render_template), and the xml element. """ from .registry import TagRegistry import logging import re from cgi imp...
agpl-3.0
wpgallih/servo
tests/wpt/web-platform-tests/html/tools/update_html5lib_tests.py
125
5358
import sys import os import hashlib import urllib import itertools import re import json import glob import shutil try: import genshi from genshi.template import MarkupTemplate from html5lib.tests import support except ImportError: print """This script requires the Genshi templating library and html5l...
mpl-2.0
MalloyPower/parsing-python
front-end/testsuite-python-lib/Python-3.2/Lib/test/test_queue.py
51
13039
# Some simple queue module tests, plus some failure conditions # to ensure the Queue locks remain stable. import queue import time import unittest from test import support threading = support.import_module('threading') QUEUE_SIZE = 5 def qfull(q): return q.maxsize > 0 and q.qsize() == q.maxsize # A thread to run...
mit
connorimes/servo
tests/wpt/css-tests/tools/html5lib/setup.py
418
1694
from distutils.core import setup import os import codecs classifiers=[ 'Development Status :: 5 - Production/Stable', 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Programming Language :: Pyt...
mpl-2.0
alex1818/OctoPrint
src/octoprint/plugins/virtual_printer/__init__.py
35
1390
# coding=utf-8 from __future__ import absolute_import __author__ = "Gina Häußge <osd@foosel.net>" __license__ = 'GNU Affero General Public License http://www.gnu.org/licenses/agpl.html' __copyright__ = "Copyright (C) 2015 The OctoPrint Project - Released under terms of the AGPLv3 License" import octoprint.plugin cla...
agpl-3.0
timohtey/mediadrop_copy
mediacore_env/Lib/site-packages/distribute-0.7.3/setup.py
2
1879
#!/usr/bin/env python """Distutils setup file, used to install or test 'setuptools'""" import textwrap import sys try: import setuptools except ImportError: sys.stderr.write("Distribute 0.7 may only upgrade an existing " "Distribute 0.6 installation") raise SystemExit(1) long_description = textwr...
gpl-3.0
pleaseproject/python-for-android
python3-alpha/python3-src/Lib/netrc.py
54
4462
"""An object-oriented interface to .netrc files.""" # Module and documentation by Eric S. Raymond, 21 Dec 1998 import io, os, shlex __all__ = ["netrc", "NetrcParseError"] class NetrcParseError(Exception): """Exception raised on syntax errors in the .netrc file.""" def __init__(self, msg, filename=None, lin...
apache-2.0
napalm-automation/napalm-yang
napalm_yang/models/openconfig/network_instances/network_instance/protocols/protocol/isis/levels/level/link_state_database/lsp/tlvs/tlv/ipv6_interface_addresses/state/__init__.py
1
109611
# -*- coding: utf-8 -*- from operator import attrgetter from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType from pyangbind.lib.yangtypes import RestrictedClassType from pyangbind.lib.yangtypes import TypedListType from pyangbind.lib.yangtypes import YANGBool from pyangbind.lib.yangtypes import YANGListTy...
apache-2.0
Unidata/MetPy
v0.12/_downloads/7b1d8e864fd4783fdaff1a83cdf9c52f/Find_Natural_Neighbors_Verification.py
6
2521
# Copyright (c) 2016 MetPy Developers. # Distributed under the terms of the BSD 3-Clause License. # SPDX-License-Identifier: BSD-3-Clause """ Find Natural Neighbors Verification =================================== Finding natural neighbors in a triangulation A triangle is a natural neighbor of a point if that point i...
bsd-3-clause
franklingu/leetcode-solutions
questions/k-diff-pairs-in-an-array/Solution.py
1
1244
""" Given an array of integers nums and an integer k, return the number of unique k-diff pairs in the array. A k-diff pair is an integer pair (nums[i], nums[j]), where the following are true: 0 <= i, j < nums.length i != j a <= b b - a == k Example 1: Input: nums = [3,1,4,1,5], k = 2 Output: 2 Explanation: There ...
mit
chenjun0210/tensorflow
tensorflow/python/training/session_manager.py
45
20277
# 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...
apache-2.0
GUBotDev/mavlink
pymavlink/generator/lib/genxmlif/xmlifUtils.py
82
12485
# # genxmlif, Release 0.9.0 # file: xmlifUtils.py # # utility module for genxmlif # # history: # 2005-04-25 rl created # 2008-08-01 rl encoding support added # # Copyright (c) 2005-2008 by Roland Leuthe. All rights reserved. # # -------------------------------------------------------------------- # Th...
lgpl-3.0