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
endolith/pyeq2
Services/OutputSourceCodeService.py
3
45973
from __future__ import print_function from __future__ import unicode_literals from __future__ import absolute_import # pyeq2 is a collection of equations expressed as Python classes # # Copyright (C) 2013 James R. Phillips # 2548 Vera Cruz Drive # Birmingham, AL 35235 USA # # email: zunzun@zunzun.com # ...
bsd-2-clause
sorig/shogun
examples/undocumented/python/features_io.py
6
2739
#!/usr/bin/env python from tools.load import LoadMatrix lm=LoadMatrix() data=lm.load_numbers('../data/fm_train_real.dat') label=lm.load_numbers('../data/label_train_twoclass.dat') parameter_list=[[data,label]] def features_io (fm_train_real, label_train_twoclass): import numpy from shogun import SparseRealFeatures,...
bsd-3-clause
jamesylgan/szechuantech
python-scripts/cryptography/hazmat/primitives/kdf/pbkdf2.py
70
2185
# This file is dual licensed under the terms of the Apache License, Version # 2.0, and the BSD License. See the LICENSE file in the root of this repository # for complete details. from __future__ import absolute_import, division, print_function from cryptography import utils from cryptography.exceptions import ( ...
mit
patrickm/chromium.src
chrome/common/extensions/docs/server2/future.py
1
1238
# 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 _no_value = object() def Collect(futures): '''Creates a Future which returns a list of results from each Future in |futures|. ''' r...
bsd-3-clause
ruiting/opencog
opencog/python/pln_old/examples/interactive_agent.py
32
2461
from opencog.atomspace import AtomSpace, TruthValue, types __author__ = 'Cosmo Harrigan' class InteractiveAgent: """ Helper class that wraps a PLN Agent object with functionality to display inference steps as they occur for testing purposes @param atomspace Provide the AtomSpace from the context ...
agpl-3.0
gojomo/gensim
gensim/models/translation_matrix.py
4
18044
#!/usr/bin/env python # encoding: utf-8 """Produce a translation matrix to translate words from one language to another, using either a standard nearest neighbour method or a globally corrected neighbour retrieval method [1]_. This method can be used to augment the existing phrase tables with more candidate translati...
lgpl-2.1
cloudbase/nova
nova/signature_utils.py
6
12887
# Copyright (c) The Johns Hopkins University/Applied Physics Laboratory # 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/licen...
apache-2.0
joopert/home-assistant
homeassistant/components/radarr/sensor.py
4
7329
"""Support for Radarr.""" import logging import time from datetime import datetime, timedelta import requests import voluptuous as vol import homeassistant.helpers.config_validation as cv from homeassistant.const import ( CONF_API_KEY, CONF_HOST, CONF_PORT, CONF_MONITORED_CONDITIONS, CONF_SSL, ) f...
apache-2.0
maggrey/cherrymusic
cherrymusicserver/useroptiondb.py
4
6077
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # CherryMusic - a standalone music server # Copyright (c) 2012 - 2014 Tom Wallroth & Tilman Boerner # # Project page: # http://fomori.org/cherrymusic/ # Sources on github: # http://github.com/devsnd/cherrymusic/ # # CherryMusic is based on # jPlayer (GPL/MIT licens...
gpl-3.0
jounex/hue
desktop/core/ext-py/python-openid-2.2.5/openid/yadis/xrires.py
157
4268
# -*- test-case-name: openid.test.test_xrires -*- """XRI resolution. """ from urllib import urlencode from openid import fetchers from openid.yadis import etxrd from openid.yadis.xri import toURINormal from openid.yadis.services import iterServices DEFAULT_PROXY = 'http://proxy.xri.net/' class ProxyResolver(object):...
apache-2.0
amondot/QGIS
python/plugins/processing/algs/exampleprovider/ExampleAlgorithm.py
9
4786
# -*- coding: utf-8 -*- """ *************************************************************************** __init__.py --------------------- Date : July 2013 Copyright : (C) 2013 by Victor Olaya Email : volayaf at gmail dot com ********************************...
gpl-2.0
weigj/django-multidb
django/contrib/gis/forms/fields.py
5
1855
from django import forms from django.contrib.gis.db.backend import SpatialBackend from django.utils.translation import ugettext_lazy as _ class GeometryField(forms.Field): """ This is the basic form field for a Geometry. Any textual input that is accepted by SpatialBackend.Geometry is accepted by this for...
bsd-3-clause
paulfitz/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/common/checkout/scm/scm_unittest.py
119
71750
# Copyright (C) 2009 Google Inc. All rights reserved. # Copyright (C) 2009 Apple Inc. All rights reserved. # Copyright (C) 2011 Daniel Bates (dbates@intudata.com). All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following condit...
bsd-3-clause
nfco/netforce
netforce_stock/netforce_stock/models/report_stock_summary.py
2
15222
# Copyright (c) 2012-2015 Netforce Co. Ltd. # # 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, publ...
mit
Danielhiversen/home-assistant
homeassistant/components/cloudflare.py
5
2351
""" Update the IP addresses of your Cloudflare DNS records. For more details about this component, please refer to the documentation at https://home-assistant.io/components/cloudflare/ """ from datetime import timedelta import logging import voluptuous as vol from homeassistant.const import CONF_API_KEY, CONF_EMAIL,...
mit
tastynoodle/django
django/core/checks/compatibility/django_1_6_0.py
4
2414
from __future__ import unicode_literals from django.db import models def check_test_runner(): """ Checks if the user has *not* overridden the ``TEST_RUNNER`` setting & warns them about the default behavior changes. If the user has overridden that setting, we presume they know what they're doing &...
bsd-3-clause
stevenmizuno/QGIS
src/plugins/grass/scripts/r.external.all.py
17
3351
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ *************************************************************************** r.external.all.py --------------------- Date : July 2009 Copyright : (C) 2009 by Lorenzo Masini Email : rugginoso at develer dot c...
gpl-2.0
stephaniemertz/flask
flask/_compat.py
176
2490
# -*- coding: utf-8 -*- """ flask._compat ~~~~~~~~~~~~~ Some py2/py3 compatibility support based on a stripped down version of six so we don't have to depend on a specific version of it. :copyright: (c) 2015 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import sys PY...
bsd-3-clause
Mj258/weiboapi
srapyDemo/envs/Lib/site-packages/pip/_vendor/requests/packages/chardet/hebrewprober.py
2929
13359
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Shy Shalom # Portions created by the Initial Developer are Copyright (C) 2005 # the Initial Developer. All Rights Reserved. #...
mit
cliali/py2
a.py
1
1578
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Simple Bot to reply to Telegram messages. This is built on the API wrapper, see # echobot2.py to see the same example built on the telegram.ext bot framework. # This program is dedicated to the public domain under the CC0 license. import logging import telegram from tel...
apache-2.0
GodBlessPP/2015cd_midterm2
static/Brython3.1.1-20150328-091302/Lib/_csv.py
639
21705
"""CSV parsing and writing. [Copied from PyPy https://bitbucket-assetroot.s3.amazonaws.com/pypy/pypy/1400171824.19/641/_csv.py?Signature=cc%2Bc8m06cBMbsxt2e15XXXUDACk%3D&Expires=1404136251&AWSAccessKeyId=0EMWEFSGA12Z1HF1TZ82 and adapted to Python 3 syntax for Brython] This module provides classes that assist in the ...
agpl-3.0
chalasr/Flask-P2P
venv/lib/python2.7/site-packages/pip/compat/dictconfig.py
921
23096
# This is a copy of the Python logging.config.dictconfig module, # reproduced with permission. It is provided here for backwards # compatibility for Python versions prior to 2.7. # # Copyright 2009-2010 by Vinay Sajip. All Rights Reserved. # # Permission to use, copy, modify, and distribute this software and its # docu...
mit
stokarz1/resume
node_modules/utf8/tests/generate-test-data.py
1788
1435
#!/usr/bin/env python import re import json # https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae # http://stackoverflow.com/a/13436167/96656 def unisymbol(codePoint): if codePoint >= 0x0000 and codePoint <= 0xFFFF: return unichr(codePoint) elif codePoint >= 0x010000 and codePoint <= 0x10FFFF: ...
mit
lavajumper/sexcoin
test/functional/p2p-leaktests.py
14
8131
#!/usr/bin/env python3 # Copyright (c) 2017 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test message sending before handshake completion. A node should never send anything other than VERSION/VERA...
mit
ziima/django-multilingual-ds9
multilingual/tests/base.py
2
1536
# -*- coding: utf-8 -*- import os import sys from django.conf import settings from django.core.management import call_command from django.db.models.loading import cache, load_app from django.test.utils import override_settings # All tests using ml_test_app need the same LANGUAGES settings. Define it here. TEST_LANGU...
mit
DiPi22/kaira
ptp/gencpp/checker.py
10
7739
# # Copyright (C) 2013 Stanislav Bohm # # This file is part of Kaira. # # Kaira 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 3 of the License, or # (at your option) any later versi...
gpl-3.0
wesleye2003/pick-mobile
node_modules/node-gyp/gyp/pylib/gyp/easy_xml_test.py
2698
3270
#!/usr/bin/env python # Copyright (c) 2011 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Unit tests for the easy_xml.py file. """ import gyp.easy_xml as easy_xml import unittest import StringIO class TestSequenceFunctions(...
mit
flavoi/diventi
diventi/landing/views.py
1
3927
from itertools import chain from django.shortcuts import render, redirect, resolve_url from django.views.generic.detail import DetailView from django.views.generic import ListView, TemplateView from django.views.generic.edit import CreateView from django.utils.translation import ugettext_lazy as _ from django.c...
apache-2.0
Uberi/botty-bot-bot-bot
src/plugins/timezones.py
1
5164
#!/usr/bin/env python3 import re from datetime import datetime, date import pytz from .utilities import BasePlugin from .utilities import clockify, untag_word timezone_abbreviations = { "est": pytz.timezone("Canada/Eastern"), "edt": pytz.timezone("Canada/Eastern"), "atlantic": pytz.timez...
mit
takeshineshiro/django
django/core/cache/backends/db.py
480
8628
"Database cache backend." import base64 from datetime import datetime from django.conf import settings from django.core.cache.backends.base import DEFAULT_TIMEOUT, BaseCache from django.db import DatabaseError, connections, models, router, transaction from django.utils import six, timezone from django.utils.encoding i...
bsd-3-clause
jsilhan/dnf-plugins-core
plugins/debuginfo-install.py
2
5087
# debuginfo-install.py # Install the debuginfo of packages and their dependencies to debug this package. # # Copyright (C) 2014 Igor Gnatenko # Copyright (C) 2014 Red Hat # # This copyrighted material is made available to anyone wishing to use, # modify, copy, or redistribute it subject to the terms and conditions of #...
gpl-2.0
oscarolar/odoo
addons/product_extended/wizard/wizard_price.py
104
2687
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # Copyright (C) 2010-2011 OpenERP S.A. (<http://www.openerp.com>). # $Id$ # # This program is free...
agpl-3.0
stephenjoe1/pay-link-set-up
node_modules/node-gyp/gyp/pylib/gyp/MSVSUtil.py
1812
9537
# Copyright (c) 2013 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Utility functions shared amongst the Windows generators.""" import copy import os # A dictionary mapping supported target types to extensions. TARGET_TYPE_EX...
mit
devendermishrajio/nova_test_latest
nova/db/sqlalchemy/migrate_repo/versions/245_add_mtu_and_dhcp_server.py
79
2132
# Copyright (c) 2014 Nebula, 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 ...
apache-2.0
unseenlaser/python-for-android
python-modules/twisted/twisted/words/test/test_xishutil.py
54
9385
# Copyright (c) 2001-2008 Twisted Matrix Laboratories. # See LICENSE for details. """ Test cases for twisted.words.xish.utility """ from twisted.trial import unittest from twisted.python.util import OrderedDict from twisted.words.xish import utility from twisted.words.xish.domish import Element from twisted.words.xi...
apache-2.0
muttiopenbts/fusion
fusion_level02_4.py
1
1932
#!/usr/bin/python ''' Simple script to interact with fusion level 02 challenge network daemon, #!/usr/bin/python mkocbayi@gmail.com ''' from pwn import * import sys #Use this hexdump lib because pwntools hexdump is too slow from hexdump import * def doMode(mode): # Either E or Q print 'Sending mode call: {}'.forma...
gpl-3.0
milinbhakta/flaskmaterialdesign
venv/Lib/encodings/iso8859_7.py
272
12844
""" Python Character Mapping Codec iso8859_7 generated from 'MAPPINGS/ISO8859/8859-7.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='...
gpl-2.0
xiaonanln/myleetcode-python
src/Sudoku Solver.py
1
2697
class Solution: # @param board, a 9x9 2D array # Solve the Sudoku by modifying the input board in-place. # Do not return any value. def solveSudoku(self, board): rowUsable = [set(xrange(1, 10)) for i in xrange(9)] colUsable = [set(xrange(1, 10)) for i in xrange(9)] blockUsable = ...
apache-2.0
kennethreitz/pipenv
pipenv/patched/notpip/_internal/network/download.py
1
6458
"""Download files with progress indicators. """ import cgi import logging import mimetypes import os from pipenv.patched.notpip._vendor import requests from pipenv.patched.notpip._vendor.requests.models import CONTENT_CHUNK_SIZE from pipenv.patched.notpip._internal.models.index import PyPI from pipenv.patched.notpip....
mit
Pexego/odoo
addons/website_gengo/controllers/main.py
24
1783
# -*- coding: utf-8 -*- import openerp from openerp import http from openerp.http import request import time GENGO_DEFAULT_LIMIT = 20 class website_gengo(http.Controller): @http.route('/website/get_translated_length', type='json', auth='user', website=True) def get_translated_length(self, translated_ids, la...
agpl-3.0
anistark/mozillians
mozillians/phonebook/forms.py
3
14348
import re from cStringIO import StringIO from datetime import datetime from django import forms from django.conf import settings from django.contrib.auth.models import User from django.core.files.uploadedfile import UploadedFile from django.forms.models import BaseInlineFormSet, inlineformset_factory import django_fi...
bsd-3-clause
kalev/anaconda
tests/kickstart_test/commands_test.py
2
3238
#!/usr/bin/python # # Copyright (C) 2010 Red Hat, Inc. # # This program 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. # # T...
gpl-2.0
krafczyk/spack
var/spack/repos/builtin/packages/mxnet/package.py
5
4568
############################################################################## # 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, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
lgpl-2.1
sbuss/qotr
qotr/handlers/base.py
4
1120
import logging from fnmatch import fnmatch from tornado import web from qotr.config import config L = logging.getLogger(__name__) ALLOWED_ORIGINS = [o.strip() for o in config.allowed_origins.split(',')] def set_cors_headers(handler): ''' Given a handler, set the CORS headers on it. ''' origin = han...
agpl-3.0
FlipperPA/wagtail
wagtail/admin/views/pages/unpublish.py
4
2111
from django.core.exceptions import PermissionDenied from django.shortcuts import get_object_or_404, redirect from django.template.response import TemplateResponse from django.urls import reverse from django.utils.translation import gettext as _ from wagtail.admin import messages from wagtail.admin.views.pages.utils im...
bsd-3-clause
smartdata-x/robots
pylib/Twisted/twisted/words/protocols/jabber/xmpp_stringprep.py
39
7148
# -*- test-case-name: twisted.words.test.test_jabberxmppstringprep -*- # # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. import stringprep from encodings import idna # We require Unicode version 3.2. from unicodedata import ucd_3_2_0 as unicodedata from twisted.python.versions import Version ...
apache-2.0
163gal/Time-Line
timelinelib/wxgui/components/canvas/scrolldrag.py
2
3660
# Copyright (C) 2009, 2010, 2011, 2012, 2013, 2014, 2015 Rickard Lindberg, Roger Lindberg # # This file is part of Timeline. # # Timeline 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 th...
gpl-3.0
Chilledheart/chromium
tools/telemetry/third_party/gsutilz/third_party/oauth2client/tests/test_crypt.py
17
2865
# 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 ...
bsd-3-clause
farhaanbukhsh/sympy
sympy/solvers/tests/test_polysys.py
104
3834
"""Tests for solvers of systems of polynomial equations. """ from sympy import flatten, I, Integer, Poly, QQ, Rational, S, sqrt, symbols from sympy.abc import x, y, z from sympy.polys import PolynomialError from sympy.solvers.polysys import solve_poly_system, solve_triangulated from sympy.utilities.pytest import raise...
bsd-3-clause
fengshao0907/redis-py
docs/conf.py
48
7829
# -*- coding: utf-8 -*- # # redis-py documentation build configuration file, created by # sphinx-quickstart on Fri Feb 8 00:47:08 2013. # # 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. # # ...
mit
PatrickChrist/scikit-learn
examples/svm/plot_svm_anova.py
250
2000
""" ================================================= SVM-Anova: SVM with univariate feature selection ================================================= This example shows how to perform univariate feature before running a SVC (support vector classifier) to improve the classification scores. """ print(__doc__) import...
bsd-3-clause
npuichigo/ttsflow
third_party/tensorflow/tensorflow/contrib/framework/python/ops/prettyprint_ops.py
165
6654
# 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
hamzehd/edx-platform
lms/djangoapps/survey/views.py
79
4127
""" View endpoints for Survey """ import logging import json from django.contrib.auth.decorators import login_required from django.http import ( HttpResponse, HttpResponseRedirect, HttpResponseNotFound ) from django.core.urlresolvers import reverse from django.views.decorators.http import require_POST from django...
agpl-3.0
stefanopanella/xapi-storage-plugins
libs/losetup.py
1
1260
import os.path from xapi.storage.common import call # Use Linux "losetup" to create block devices from files class Loop: """An active loop device""" def __init__(self, path, loop): self.path = path self.loop = loop def destroy(self, dbg): call(dbg, ["losetup", "-d", self.loop])...
lgpl-2.1
a0c/odoo
addons/account/wizard/account_report_common_account.py
371
1922
# -*- 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
mosarg/gestione_scuola
backend/migrations/0001_initial.py
1
2074
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'Backend' db.create_table(u'backend_backend', ( ('created', self.gf('django.db.mo...
gpl-3.0
SlimRoms/android_external_chromium_org
native_client_sdk/src/build_tools/tests/sdktools_test.py
76
8922
#!/usr/bin/env python # 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 os import re import subprocess import sys import tarfile import tempfile import test_server import unittest import zipfile ...
bsd-3-clause
mbayon/TFG-MachineLearning
venv/lib/python3.6/site-packages/django/db/migrations/state.py
36
27146
from __future__ import unicode_literals import copy import warnings from collections import OrderedDict from contextlib import contextmanager from django.apps import AppConfig from django.apps.registry import Apps, apps as global_apps from django.conf import settings from django.db import models from django.db.models...
mit
oarriaga/spatial_transformer_networks
src/models/layers.py
1
5049
from keras import backend as K from keras.engine.topology import Layer if K.backend() == 'tensorflow': import tensorflow as tf def K_meshgrid(x, y): return tf.meshgrid(x, y) def K_linspace(start, stop, num): return tf.linspace(start, stop, num) else: raise Exception("Only 'tensorflow...
mit
rbbratta/virt-test
tools/reindent.py
17
10422
#! /usr/bin/env python # Released to the public domain, by Tim Peters, 03 October 2000. """reindent [-d][-r][-v] [ path ... ] -d (--dryrun) Dry run. Analyze, but don't make any changes to, files. -r (--recurse) Recurse. Search for all .py files in subdirectories too. -n (--nobackup) No backup. Does not make a...
gpl-2.0
squared9/Robotics
Robotic_PR2_3D_Perception_Pick_And_Place/sensor_stick/src/sensor_stick/marker_tools.py
2
1455
#!/usr/bin/env python # Copyright (C) 2017 Electric Movement Inc. # # This file is part of Robotic Arm: Pick and Place project for Udacity # Robotics nano-degree program # # All Rights Reserved. # Author: Brandon Kinman import rospy from visualization_msgs.msg import Marker def make_label(text, position, id = 0 ,d...
mit
RobertoMalatesta/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/thirdparty/mock.py
148
9681
# mock.py # Test tools for mocking and patching. # Copyright (C) 2007-2009 Michael Foord # E-mail: fuzzyman AT voidspace DOT org DOT uk # mock 0.6.0 # http://www.voidspace.org.uk/python/mock/ # Released subject to the BSD License # Please see http://www.voidspace.org.uk/python/license.shtml # 2009-11-25: Licence dow...
bsd-3-clause
yum-kvn/kenja
kenja/git/diff.py
2
4894
from __future__ import absolute_import import re from kenja.historage import get_org_commit from git import Repo from logging import getLogger logger = getLogger(__name__) class GitDiffParser: # header_regex = re.compile(r'^diff --git (a/)+(.*) (b/)+(.*)$') header_a_blob_regex = re.compile(r'^--- (a/)?(.*)$...
mit
mattgemmell/DOT-MGTextEntry
mgtext.py
1
12149
#! /usr/bin/python """ MGText Text-entry plugin for Pimoroni's menu system for the Raspberry Pi Display-O-Tron. Code and info: https://github.com/mattgemmell/DOT-MGTextEntry By: Matt Gemmell http://mattgemmell.com/ http://twitter.com/mattgemmell """ from dot3k.menu import MenuOption _UP = 0 _DOWN = 1 _LEFT = 2 _...
mit
thatknitter/GlobalGameJam2016
node_modules/lite-server/node_modules/browser-sync/node_modules/socket.io/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/engine.io-parser/node_modules/utf8/tests/generate-test-data.py
1788
1435
#!/usr/bin/env python import re import json # https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae # http://stackoverflow.com/a/13436167/96656 def unisymbol(codePoint): if codePoint >= 0x0000 and codePoint <= 0xFFFF: return unichr(codePoint) elif codePoint >= 0x010000 and codePoint <= 0x10FFFF: ...
mit
atul-bhouraskar/django
tests/str/models.py
409
1300
# -*- coding: utf-8 -*- """ Adding __str__() or __unicode__() to models Although it's not a strict requirement, each model should have a ``_str__()`` or ``__unicode__()`` method to return a "human-readable" representation of the object. Do this not only for your own sanity when dealing with the interactive prompt, but...
bsd-3-clause
akopytov/sysbench
third_party/cram/cram/_test.py
2
7959
"""Utilities for running individual tests""" import itertools import os import re import time from cram._encoding import b, bchr, bytestype, envencode, unicodetype from cram._diff import esc, glob, regex, unified_diff from cram._process import PIPE, STDOUT, execute __all__ = ['test', 'testfile'] _needescape = re.co...
gpl-2.0
punalpatel/st2
st2reactor/tests/unit/test_sensor_wrapper.py
4
5359
import os import unittest2 import mock import st2tests.config as tests_config from st2tests.base import TESTS_CONFIG_PATH from st2common.models.db.trigger import TriggerDB from st2reactor.container.sensor_wrapper import SensorWrapper from st2reactor.sensor.base import Sensor, PollingSensor CURRENT_DIR = os.path.absp...
apache-2.0
google-code-export/django-hotclub
libs/external_libs/python-twitter-0.5/examples/tweet.py
5
3050
#!/usr/bin/python '''Post a message to twitter''' __author__ = 'dewitt@google.com' import ConfigParser import getopt import os import sys import twitter USAGE = '''Usage: tweet [options] message This script posts a message to Twitter. Options: -h --help : print this help --username : the twitter use...
mit
mathspace/django
django/contrib/gis/utils/ogrinspect.py
391
9090
""" This module is for inspecting OGR data sources and generating either models for GeoDjango and/or mapping dictionaries for use with the `LayerMapping` utility. """ from django.contrib.gis.gdal import DataSource from django.contrib.gis.gdal.field import ( OFTDate, OFTDateTime, OFTInteger, OFTInteger64, OFTReal, O...
bsd-3-clause
opencloudinfra/orchestrator
venv/Lib/site-packages/pip/_vendor/distlib/_backport/sysconfig.py
765
26958
# -*- coding: utf-8 -*- # # Copyright (C) 2012 The Python Software Foundation. # See LICENSE.txt and CONTRIBUTORS.txt. # """Access to Python's configuration information.""" import codecs import os import re import sys from os.path import pardir, realpath try: import configparser except ImportError: import Conf...
gpl-3.0
saebyn/nwgui
nwgui/gui.py
1
2263
import pygame from nwgui.container import AbsoluteContainer class AbstractGUI(object): def __init__(self, game): raise NotImplementedError def getGameObject(self): raise NotImplementedError def get(self, widgetName): raise NotImplementedError def setName(self, name, widget...
gpl-3.0
HAYASAKA-Ryosuke/faker
faker/providers/ssn/nl_NL/__init__.py
17
1438
# coding=utf-8 from __future__ import unicode_literals from .. import Provider as SsnProvider from faker.generator import random class Provider(SsnProvider): @classmethod def ssn(cls): """ Returns a 9 digits Dutch SSN called "burgerservicenummer (BSN)". the Dutch "burgerservicenumme...
mit
VictoriaRoux/oppia
extensions/gadgets/base_test.py
7
7993
# coding: utf-8 # # Copyright 2014 The Oppia 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 requi...
apache-2.0
kyrias/cjdns
node_build/dependencies/libuv/build/gyp/test/subdirectory/gyptest-top-all.py
261
1373
#!/usr/bin/env python # Copyright (c) 2009 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. """ Verifies building a target and a subsidiary dependent target from a .gyp file in a subdirectory, without specifying an explicit output b...
gpl-3.0
Metaswitch/calico-neutron
neutron/tests/unit/db/test_l3_ha_db.py
3
18346
# Copyright (C) 2014 eNovance SAS <licensing@enovance.com> # # 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 applicabl...
apache-2.0
BibMartin/python-nvd3
nvd3/multiBarHorizontalChart.py
13
3680
#!/usr/bin/python # -*- coding: utf-8 -*- """ Python-nvd3 is a Python wrapper for NVD3 graph library. NVD3 is an attempt to build re-usable charts and chart components for d3.js without taking away the power that d3.js gives you. Project location : https://github.com/areski/python-nvd3 """ from .NVD3Chart import NVD...
mit
andriisoldatenko/Django-facebook
docs/docs_env/Lib/ntpath.py
32
16576
# Module 'ntpath' -- common operations on WinNT/Win95 pathnames """Common pathname manipulations, WindowsNT/95 version. Instead of importing this module directly, import os and refer to this module as os.path. """ import os import stat import sys __all__ = ["normcase","isabs","join","splitdrive","split","splitext", ...
bsd-3-clause
ylow/SFrame
oss_src/unity/python/sframe/cython/python_printer_callback.py
5
1136
''' Copyright (C) 2016 Turi All rights reserved. This software may be modified and distributed under the terms of the BSD license. See the LICENSE file for details. ''' import sys try: import IPython from IPython.core.interactiveshell import InteractiveShell have_ipython = True except ImportError: have...
bsd-3-clause
changlong/uber_gdb
gdb/testsuite/gdb.perf/lib/perftest/perftest.py
41
2768
# Copyright (C) 2013-2014 Free Software Foundation, Inc. # 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 progr...
gpl-2.0
ybellavance/python-for-android
python3-alpha/python3-src/Lib/test/test_with.py
83
26527
#!/usr/bin/env python3 """Unit tests for the with statement specified in PEP 343.""" __author__ = "Mike Bland" __email__ = "mbland at acm dot org" import sys import unittest from collections import deque from contextlib import _GeneratorContextManager, contextmanager from test.support import run_unittest class Mo...
apache-2.0
doganov/edx-platform
common/djangoapps/third_party_auth/tests/test_settings.py
53
2347
"""Unit tests for settings.py.""" from third_party_auth import provider, settings from third_party_auth.tests import testutil import unittest _ORIGINAL_AUTHENTICATION_BACKENDS = ('first_authentication_backend',) _ORIGINAL_INSTALLED_APPS = ('first_installed_app',) _ORIGINAL_MIDDLEWARE_CLASSES = ('first_middleware_cla...
agpl-3.0
pwong-mapr/private-hue
apps/oozie/src/oozie/migrations/0008_auto__add_distcp.py
40
20889
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'DistCp' db.create_table('oozie_distcp', ( ('prepares', self.gf('django.db.models.field...
apache-2.0
algorhythms/LeetCode
673 Number of Longest Increasing Subsequence.py
1
1796
#!/usr/bin/python3 """ Given an unsorted array of integers, find the number of longest increasing subsequence. Example 1: Input: [1,3,5,4,7] Output: 2 Explanation: The two longest increasing subsequence are [1, 3, 4, 7] and [1, 3, 5, 7]. Example 2: Input: [2,2,2,2,2] Output: 5 Explanation: The length of longest contin...
mit
mou4e/zirconium
third_party/tlslite/tlslite/utils/openssl_rsakey.py
200
4670
# Author: Trevor Perrin # See the LICENSE file for legal information regarding use of this file. """OpenSSL/M2Crypto RSA implementation.""" from .cryptomath import * from .rsakey import * from .python_rsakey import Python_RSAKey #copied from M2Crypto.util.py, so when we load the local copy of m2 #we can still use i...
bsd-3-clause
pearu/sympycore
sympycore/functions/algebra.py
1
2063
""" Implementes functions ring support. """ # # Author: Pearu Peterson # Created: April, 2008 # __all__ = ['FunctionRing'] from ..core import classes, objects, init_module from ..basealgebra import Verbatim, Algebra from ..ring import CommutativeRing init_module.import_heads() class FunctionRing(CommutativeRing): ...
bsd-3-clause
Dingmatt/AMSA
Plug-ins/Amsa.bundle/Contents/Libraries/Shared/urllib3/util/wait.py
226
1451
from .selectors import ( HAS_SELECT, DefaultSelector, EVENT_READ, EVENT_WRITE ) def _wait_for_io_events(socks, events, timeout=None): """ Waits for IO events to be available from a list of sockets or optionally a single socket if passed in. Returns a list of sockets that can be interacted ...
gpl-3.0
jor-/scipy
scipy/io/matlab/tests/test_pathological.py
26
1125
""" Test reading of files not conforming to matlab specification We try and read any file that matlab reads, these files included """ from __future__ import division, print_function, absolute_import from os.path import dirname, join as pjoin from numpy.testing import assert_ from pytest import raises as assert_raise...
bsd-3-clause
cstan11/Sick-Beard
lib/pysrt/commands.py
18
8470
#!/usr/bin/env python # -*- coding: utf-8 -*- # pylint: disable-all import os import re import sys import codecs import shutil import argparse from textwrap import dedent from chardet import detect from pysrt import SubRipFile, SubRipTime, VERSION_STRING def underline(string): return "\033[4m%s\033[0m" % string ...
gpl-3.0
NEONScience/NEON-Data-Skills
tutorials/Python/Lidar/lidar-biomass/calc-biomass_py/calc-biomass_py.py
1
20510
#!/usr/bin/env python # coding: utf-8 # --- # syncID: e6ccf19a4b454ca594388eeaa88ebe12 # title: "Calculate Vegetation Biomass from LiDAR Data in Python" # description: "Learn to calculate the biomass of standing vegetation using a canopy height model data product." # dateCreated: 2017-06-21 # authors: Tristan Goulde...
agpl-3.0
abstractfactory/openmetadata-mk1
transaction.py
1
5900
"""Convenience module for the end-user The goal of this module is to provide as high-level utilities as possible for users who wish to have as little knowledge as possible about Open Folder. Target audience leans towards Technical Directors or fellow scripters in any DCC. """ from __future__ import absolute_import ...
mit
Ifetayo/alt1
qa/rpc-tests/test_framework/socks5.py
182
5701
# Copyright (c) 2015 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. ''' Dummy Socks5 server for testing. ''' from __future__ import print_function, division, unicode_literals import socket, threading, Q...
mit
mchels/FolderBrowser
plotcontrols.py
1
6028
from PyQt5 import QtWidgets from PyQt5.QtWidgets import QSizePolicy class PlotControls(QtWidgets.QWidget): """ Control bar for controlling how plots are shown. Parameters ---------- cmap_names : list List of colormap names to show in the colormap dropdown menu. plot_2D_types : list ...
mit
herilalaina/scikit-learn
sklearn/feature_selection/tests/test_rfe.py
15
11812
""" Testing Recursive feature elimination """ import numpy as np from numpy.testing import assert_array_almost_equal, assert_array_equal from scipy import sparse from sklearn.feature_selection.rfe import RFE, RFECV from sklearn.datasets import load_iris, make_friedman1 from sklearn.metrics import zero_one_loss from sk...
bsd-3-clause
teeple/pns_server
work/install/node-v0.10.25/deps/v8/tools/testrunner/local/testsuite.py
9
6174
# Copyright 2012 the V8 project authors. 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 conditi...
gpl-2.0
tarzan0820/odoo-saas-tools
saas_utils/connector.py
13
1300
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010, 2014 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of t...
lgpl-3.0
AlexProfi/django-cms
cms/cms_menus.py
1
16191
# -*- coding: utf-8 -*- from django.utils.translation import get_language from cms import constants from cms.apphook_pool import apphook_pool from cms.utils.permissions import load_view_restrictions, has_global_page_permission from cms.utils import get_language_from_request from cms.utils.conf import get_cms_setting f...
bsd-3-clause
kevenli/Flowy
runtime/demo_receive.py
7
2026
#!/usr/bin/env python """ Test AMQP library. Repeatedly receive messages from the demo_send.py script, until it receives a message with 'quit' as the body. 2007-11-11 Barry Pederson <bp@barryp.org> """ from optparse import OptionParser import amqplib.client_0_8 as amqp def callback(msg): for key, val in msg.p...
apache-2.0
hadware/lexicographer
epub-parser/src/epub_to_json/epub_to_json.py
1
5101
import sys from epub import open_epub import simplejson as json from bs4 import BeautifulSoup, Tag class SimpleChapter(object): def __init__(self, name, text): self.name = name self.text = text class Parser(object): def __init__(self, epub_path): self.epub_file = open_epub(epub_path,...
gpl-2.0
julien78910/CouchPotatoServer
libs/subliminal/subtitles.py
136
5252
# -*- coding: utf-8 -*- # Copyright 2011-2012 Antoine Bertin <diaoulael@gmail.com> # # This file is part of subliminal. # # subliminal is free software; you can redistribute it and/or modify it under # the terms of the GNU Lesser General Public License as published by # the Free Software Foundation; either version 3 of...
gpl-3.0