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
3dfxmadscientist/cbss-server
addons/account_bank_statement_extensions/res_partner_bank.py
52
1601
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # # Copyright (c) 2011 Noviat nv/sa (www.noviat.be). All rights reserved. # # This program is free software: you can redistribute it and/or modify # it under ...
agpl-3.0
spantaleev/sijax-python
sijax/core.py
1
16018
# -*- coding: utf-8 -* from __future__ import (absolute_import, unicode_literals) """ sijax.core ~~~~~~~~~~ Implements the main Sijax class, an instance of which is used to register callbacks, invoke callbacks, setup events handlers, etc. :copyright: (c) 2011 by Slavi Pantaleev. :license: BS...
bsd-3-clause
epam/DLab
infrastructure-provisioning/src/general/scripts/azure/edge_configure.py
1
20304
#!/usr/bin/python # ***************************************************************************** # # Copyright (c) 2016, EPAM SYSTEMS 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 # #...
apache-2.0
hlt-mt/tensorflow
tensorflow/python/kernel_tests/random_shuffle_queue_test.py
9
37302
# Copyright 2015 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
apache-2.0
Russell-IO/ansible
test/units/modules/net_tools/test_nmcli.py
41
12890
# Copyright: (c) 2017 Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) import json import pytest from ansible.modules.net_tools import nmcli pytestmark = pytest.mark.usefixtures('patch_ansible_module') TESTCASE_CONNECTION = [ { 'type': 'ethern...
gpl-3.0
NewVadim/django-sphinx
djangosphinx/management/commands/generate_sphinx_config.py
2
2124
from __future__ import unicode_literals import itertools from optparse import make_option from django.core.management.base import BaseCommand, CommandError from django.conf import settings from django.db import models class Command(BaseCommand): help = "Prints generic configuration for any models which use a st...
bsd-3-clause
tecan/xchat-rt
plugins/scripts/encryption/supybot-code-6361b1e856ebbc8e14d399019e2c53a35f4e0063/plugins/Web/config.py
5
3381
### # Copyright (c) 2005, Jeremiah Fincher # 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
tersmitten/ansible-modules-extras
network/openvswitch_db.py
112
3761
#!/usr/bin/python # coding: utf-8 -*- # pylint: disable=C0111 # # (c) 2015, Mark Hamilton <mhamilton@vmware.com> # # Portions copyright @ 2015 VMware, Inc. # # This file is part of Ansible # # This module is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as...
gpl-3.0
dreamsxin/kbengine
kbe/src/lib/python/Lib/test/test_importlib/test_util.py
84
22567
from importlib import util from . import util as test_util frozen_init, source_init = test_util.import_importlib('importlib') frozen_machinery, source_machinery = test_util.import_importlib('importlib.machinery') frozen_util, source_util = test_util.import_importlib('importlib.util') import os import sys from test imp...
lgpl-3.0
markwal/Cura
plugins/CuraEngineBackend/CuraEngineBackend.py
1
10593
# Copyright (c) 2015 Ultimaker B.V. # Cura is released under the terms of the AGPLv3 or higher. from UM.Backend.Backend import Backend from UM.Application import Application from UM.Scene.SceneNode import SceneNode from UM.Scene.Iterator.DepthFirstIterator import DepthFirstIterator from UM.Preferences import Preferenc...
agpl-3.0
bbc/kamaelia
Code/Python/Apps/GSOC_JMB/App/PersonalWsgiServer/plugins/WsgiApps/django_app.py
3
2060
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2010 British Broadcasting Corporation and Kamaelia Contributors(1) # # (1) Kamaelia Contributors are listed in the AUTHORS file and at # http://www.kamaelia.org/AUTHORS - please extend this file, # not this notice. # # Licensed under the Apache License...
apache-2.0
misaochan/apps-android-commons
data-client/scripts/generate_wiki_languages.py
7
4031
#!/usr/bin/env python # coding=utf-8 from datetime import datetime, timedelta import lxml import lxml.builder as lb import json import requests QUERY_SITEMATRIX = 'https://www.mediawiki.org/w/api.php?action=sitematrix' \ '&format=json&formatversion=2&smtype=language&smstate=all' QUERY_ALLUSERS = '/w/api.php?act...
apache-2.0
loco-odoo/localizacion_co
openerp/addons-extra/odoo-pruebas/odoo-server/addons/analytic_contract_hr_expense/__openerp__.py
312
1637
# -*- 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
ActionAdam/osmc
package/mediacenter-addon-osmc/src/script.module.elementtree/lib/elementtree/SgmlopXMLTreeBuilder.py
24
3209
# # ElementTree # $Id$ # # A simple XML tree builder, based on the sgmlop library. # # Note that this version does not support namespaces. This may be # changed in future versions. # # history: # 2004-03-28 fl created # # Copyright (c) 1999-2004 by Fredrik Lundh. All rights reserved. # # fredrik@pythonware.com # ht...
gpl-2.0
adamsumm/CausalMario
HiddenCauses/irm/Mario/parse.py
1
2165
import sys import re import random vevent = re.compile("V\s+([\-\d\w]+)\s+(\w+)") sevent = re.compile("S\s+([\-\d\w]+)\s+([\-\d\w]+)") aevent = re.compile("A\s+([\-\d\w]+)") devent = re.compile("D\s+([\-\d\w]{2,})") cevent = re.compile("C\s+([\-\d\w]+)\s+[\-\d]*\s*([\-\d\w]+)\s+([\-\d\w]+)") animate = ["Goomba","Mario"...
mit
mazvv/travelcrm
travelcrm/lib/qb/services.py
1
1097
# -*coding: utf-8-*- from collections import Iterable from . import ResourcesQueryBuilder from ...models.resource_type import ResourceType from ...models.resource import Resource from ...models.service import Service class ServicesQueryBuilder(ResourcesQueryBuilder): def __init__(self, context): super(S...
gpl-3.0
mscherer/ansible
v1/ansible/runner/lookup_plugins/subelements.py
174
2860
# (c) 2013, Serge van Ginderachter <serge@vanginderachter.be> # # 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)...
gpl-3.0
KaranToor/MA450
google-cloud-sdk/.install/.backup/lib/surface/sql/flags/list.py
2
1913
# Copyright 2013 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
mchristopher/PokemonGo-DesktopMap
app/pylibs/shared/pgoapi/protos/POGOProtos/Enums/PokemonType_pb2.py
16
5000
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: POGOProtos/Enums/PokemonType.proto import sys _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf.internal import enum_type_wrapper from google.protobuf import descriptor as _descriptor from google.protobuf...
mit
teochenglim/ansible-modules-extras
web_infrastructure/jboss.py
153
4897
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2013, Jeroen Hoekx <jeroen.hoekx@dsquare.be> # # 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 th...
gpl-3.0
dnozay/lettuce
tests/integration/lib/Django-1.2.5/tests/modeltests/test_client/views.py
91
7858
from xml.dom.minidom import parseString from django.core import mail from django.template import Context, Template from django.http import HttpResponse, HttpResponseRedirect, HttpResponseNotFound from django.contrib.auth.decorators import login_required, permission_required from django.forms.forms import Form from dja...
gpl-3.0
moble/sympy
sympy/polys/tests/test_densearith.py
98
39537
"""Tests for dense recursive polynomials' arithmetics. """ from sympy.polys.densebasic import ( dup_normal, dmp_normal, ) from sympy.polys.densearith import ( dup_add_term, dmp_add_term, dup_sub_term, dmp_sub_term, dup_mul_term, dmp_mul_term, dup_add_ground, dmp_add_ground, dup_sub_ground, dmp...
bsd-3-clause
yoer/hue
desktop/core/ext-py/pyasn1-0.1.8/test/type/test_constraint.py
53
8746
from pyasn1.type import constraint, error from pyasn1.error import PyAsn1Error from sys import version_info if version_info[0:2] < (2, 7) or \ version_info[0:2] in ( (3, 0), (3, 1) ): try: import unittest2 as unittest except ImportError: import unittest else: import unittest class Single...
apache-2.0
Beyond-Imagination/BlubBlub
ChatbotServer/ChatbotEnv/Lib/site-packages/numpy/core/tests/test_scalarmath.py
9
25033
from __future__ import division, absolute_import, print_function import sys import warnings import itertools import operator import numpy as np from numpy.testing.utils import _gen_alignment_data from numpy.testing import ( TestCase, run_module_suite, assert_, assert_equal, assert_raises, assert_almost_equal,...
gpl-3.0
darktears/chromium-crosswalk
tools/code_coverage/croc_scan.py
178
4383
# Copyright (c) 2011 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Crocodile source scanners.""" import re class Scanner(object): """Generic source scanner.""" def __init__(self): """Constructor.""" ...
bsd-3-clause
koditr/xbmc-tr-team-turkish-addons
script.module.urlresolver/lib/urlresolver/plugins/debrid_link.py
6
5630
""" urlresolver XBMC Addon Copyright (C) 2013 Bstrdsmkr 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-2.0
DazWorrall/ansible
lib/ansible/plugins/connection/jail.py
44
8237
# Based on local.py (c) 2012, Michael DeHaan <michael.dehaan@gmail.com> # and chroot.py (c) 2013, Maykel Moya <mmoya@speedyrails.com> # (c) 2013, Michael Scherer <misc@zarb.org> # (c) 2015, Toshio Kuratomi <tkuratomi@ansible.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it...
gpl-3.0
ostrokach/bioconda-recipes
recipes/circularmapper/realignsamfile.py
14
2657
#!/usr/bin/env python # # Wrapper script for Java Conda packages that ensures that the java runtime # is invoked with the right options. Adapted from the bash script (http://stackoverflow.com/questions/59895/can-a-bash-script-tell-what-directory-its-stored-in/246128#246128). # # # Program Parameters # import os import...
mit
arenaoftitans/arena-of-titans-api
aot/game/cards/deck.py
1
4174
################################################################################ # Copyright (C) 2015-2020 by Last Run Contributors. # # This file is part of Arena of Titans. # # Arena of Titans is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as publ...
agpl-3.0
aldatsa/Cinnamon
files/usr/lib/cinnamon-screensaver-lock-dialog/cinnamon-screensaver-lock-dialog.py
12
2402
#!/usr/bin/env python2 import sys import os import gettext from gi.repository import Gtk import pwd import socket # i18n gettext.install("cinnamon", "/usr/share/locale") class MainWindow: ''' Create the UI ''' def __init__(self): user_id = os.getuid() username = pwd.getpwuid(user_id).pw_...
gpl-2.0
kawasaki2013/python-for-android-x86
python-modules/twisted/twisted/internet/wxsupport.py
61
1455
# Copyright (c) 2001-2004 Twisted Matrix Laboratories. # See LICENSE for details. # """Old method of wxPython support for Twisted. twisted.internet.wxreactor is probably a better choice. To use:: | # given a wxApp instance called myWxAppInstance: | from twisted.internet import wxsupport | wxsupport.ins...
apache-2.0
ratnania/pyccel
doc/scripts/scripts/classes_4.py
2
1292
#An example of a class #$ header class Shape(public) #$ header method __init__(Shape, double, double) #$ header method area(Shape) results(double) #$ header method perimeter(Shape) results(double) #$ header method describe(Shape,str) #$ header method authorName(Shape,str) #$ header method scaleSize(Shape, double) clas...
mit
petebachant/CFT-vectors
cft_vectors.py
1
18584
#!/usr/bin/env python """ This script generates a force and velocity vector diagram for a cross-flow turbine. """ from __future__ import division, print_function import numpy as np import matplotlib import matplotlib.pyplot as plt import pandas as pd from scipy.interpolate import interp1d import seaborn as sns from px...
mit
Sidney84/pa-chromium
build/android/pylib/utils/report_results.py
8
4507
# Copyright (c) 2013 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. """Module containing utility functions for reporting results.""" import logging import os import re from pylib import buildbot_report from pylib import...
bsd-3-clause
UpYou/relay
my_gnuradio/gr/qa_pipe_fittings.py
6
4181
#!/usr/bin/env python # # Copyright 2005,2007 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio 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, or (at your opt...
gpl-3.0
Kast0rTr0y/ansible
lib/ansible/utils/hashing.py
197
3180
# (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
jepler/linuxcnc-mirror
configs/sim/gmoccapy/gmoccapy_plasma/signals.py
10
1930
#!/usr/bin/env python # -*- coding:UTF-8 -*- """ This file will control some options of the gmoccapy plasma screen and demonstrats at the same time the possibilities you have introducing your own handler files and functions to that screen, showing the possibilities to modify the layout and behavior ...
lgpl-2.1
bluecube/codecad
codecad/rendering/svg.py
1
1105
from . import polygon2d def render_svg(obj, filename): polygons = polygon2d.polygon(obj) with open(filename, "w") as fp: box = obj.bounding_box() box_size = box.size() fp.write('<svg xmlns="http://www.w3.org/2000/svg" ') fp.write('width="{}mm" height="{}mm" '.format(box_size....
gpl-3.0
ktsaou/netdata
collectors/python.d.plugin/web_log/web_log.chart.py
3
47869
# -*- coding: utf-8 -*- # Description: web log netdata python.d module # Author: ilyam8 # SPDX-License-Identifier: GPL-3.0-or-later import bisect import os import re from collections import namedtuple, defaultdict from copy import deepcopy try: from itertools import filterfalse except ImportError: from iterto...
gpl-3.0
jmwenda/hypermap
hypermap/aggregator/tasks.py
1
5215
from __future__ import absolute_import from django.conf import settings from celery import shared_task @shared_task(bind=True) def check_all_services(self): from aggregator.models import Service service_to_processes = Service.objects.filter(active=True) total = service_to_processes.count() count = 0...
mit
habnabit/pip
pip/exceptions.py
1
1260
"""Exceptions used throughout package""" from __future__ import absolute_import class PipError(Exception): """Base pip exception""" class InstallationError(PipError): """General exception during installation""" class UninstallationError(PipError): """General exception during uninstallation""" class ...
mit
nharraud/b2share
invenio/modules/formatter/format_elements/bfe_aid_authors.py
13
12487
# -*- coding: utf-8 -*- # # $Id$ # # This file is part of Invenio. # Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2014 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...
gpl-2.0
handroissuazo/tensorflow
tensorflow/python/framework/proto_test.py
178
1704
# 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
ilo10/scikit-learn
examples/applications/svm_gui.py
287
11161
""" ========== Libsvm GUI ========== A simple graphical frontend for Libsvm mainly intended for didactic purposes. You can create data points by point and click and visualize the decision region induced by different kernels and parameter settings. To create positive examples click the left mouse button; to create neg...
bsd-3-clause
georgyberdyshev/ascend
pygtk/selftest.py
1
7384
# Sort of an experiment in thread programming. This script locates all # ASCEND files in the ASCENDLIBRARY path, then for any that contain 'self_test' # methods, it loads them and solves them and runs the self test. It's not # very good at checking the results just yet: probably there needs to be a # 'TestReporter' hoo...
gpl-2.0
yosukesuzuki/deep-link-app
project/api/tests/__init__.py
1
4097
# -*- coding: utf-8 -*- from kay.ext.testutils.gae_test_base import GAETestBase from api.shorturls import URLShorten from core.models import ShortURL, ShortURLUser class URLShortenTest(GAETestBase): CLEANUP_USED_KIND = True USE_PRODUCTION_STUBS = True def test_get(self): user = ShortURLUser(key_...
mit
justinpotts/mozillians
vendor-local/lib/python/unidecode/x077.py
252
4675
data = ( 'Ming ', # 0x00 'Sheng ', # 0x01 'Shi ', # 0x02 'Yun ', # 0x03 'Mian ', # 0x04 'Pan ', # 0x05 'Fang ', # 0x06 'Miao ', # 0x07 'Dan ', # 0x08 'Mei ', # 0x09 'Mao ', # 0x0a 'Kan ', # 0x0b 'Xian ', # 0x0c 'Ou ', # 0x0d 'Shi ', # 0x0e 'Yang ', # 0x0f 'Zheng ', # 0...
bsd-3-clause
Neil741/ryu-master
ryu/tests/unit/lib/test_import_module.py
47
2443
# Copyright (C) 2013 Nippon Telegraph and Telephone Corporation. # Copyright (C) 2013 YAMAMOTO Takashi <yamamoto at valinux co jp> # # 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:...
apache-2.0
marc-sensenich/ansible
test/units/modules/system/interfaces_file/test_interfaces_file.py
21
13761
# (c) 2017, Roman Belyakovsky <ihryamzik () 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) any la...
gpl-3.0
nicktendo64/brady-vs-grey
oauth2client/util.py
174
5670
#!/usr/bin/env python # # Copyright 2010 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
mit
klenks/jobsportal
venv/lib/python2.7/site-packages/django/core/management/commands/sendtestemail.py
126
1518
import socket from django.core.mail import mail_admins, mail_managers, send_mail from django.core.management.base import BaseCommand from django.utils import timezone class Command(BaseCommand): help = "Sends a test email to the email addresses specified as arguments." missing_args_message = "You must specif...
mit
MasterFacilityList/mfl_api
common/tests/test_tasks.py
1
1419
from mock import patch from requests.exceptions import ConnectionError from django.test import TestCase from django.test.utils import override_settings from ..tasks import backup_db, refresh_material_views class S3BucketMock(object): pass class S3Mock(object): def __init__(self, *args, **kwargs): s...
mit
flewrain/flewrain-dolphin
Externals/scons-local/scons-local-2.0.1/SCons/Node/__init__.py
61
47529
"""SCons.Node The Node package for the SCons software construction utility. This is, in many ways, the heart of SCons. A Node is where we encapsulate all of the dependency information about any thing that SCons can build, or about any thing which SCons can use to build some other thing. The canonical "thing," of co...
gpl-2.0
HyperBaton/ansible
test/units/modules/network/fortios/test_fortios_wireless_controller_global.py
20
10688
# Copyright 2019 Fortinet, 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 program is distributed in the...
gpl-3.0
laurenrevere/osf.io
osf/models/private_link.py
4
2210
from django.db import models from django.dispatch import receiver from django.core.exceptions import ValidationError from framework.utils import iso8601format from website.util import sanitize from osf.models.base import BaseModel, ObjectIDMixin class PrivateLink(ObjectIDMixin, BaseModel): key = models.CharFiel...
apache-2.0
geodrinx/gearthview
ext-libs/zope/interface/common/sequence.py
50
4735
############################################################################## # # Copyright (c) 2001, 2002 Zope Foundation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # TH...
gpl-3.0
slzatz/esp8266
iot_generic.py
1
2478
''' The basic setup here is to have an Adafruit Feather HUZZAH ESP8266 plus a Featherwing OLED SSD1306 This is a non-specific script that writes the MQTT message to the OLED display. The MQTT broker is running on an EC2 instance. The esp8266+OLED that subscribes to the topic can be used to turn on and off a Data Logg...
mit
brianwoo/django-tutorial
ENV/lib/python2.7/site-packages/django/db/models/signals.py
112
2936
from django.apps import apps from django.dispatch import Signal from django.utils import six class_prepared = Signal(providing_args=["class"]) class ModelSignal(Signal): """ Signal subclass that allows the sender to be lazily specified as a string of the `app_label.ModelName` form. """ def __in...
gpl-3.0
suraj-deshmukh/myCodes
crout.py
1
1270
#!/usr/bin/python2.7 import numpy as num import sys import csv def crout(A): n = A.shape if(n[0]!=n[1]): print("Give matrix is not square matrix. Code Terminated") sys.exit() n=n[0] A = num.mat(A,dtype=float) U = num.matrix(A*0) L = num.matrix(U) for i in range(0,n): L[i,0] = A[i,0] U[i,i] = 1 ...
mit
halvertoluke/edx-platform
lms/djangoapps/certificates/tests/test_views.py
11
15721
"""Tests for certificates views. """ import json import ddt from uuid import uuid4 from nose.plugins.attrib import attr from mock import patch from django.conf import settings from django.core.cache import cache from django.core.urlresolvers import reverse from django.test import TestCase from django.test.client impo...
agpl-3.0
robobrobro/ballin-octo-shame
lib/Python-3.4.3/Lib/sre_parse.py
17
30445
# # Secret Labs' Regular Expression Engine # # convert re-style regular expression to sre pattern # # Copyright (c) 1998-2001 by Secret Labs AB. All rights reserved. # # See the sre.py file for information on usage and redistribution. # """Internal support module for sre""" # XXX: show string offset and offending ch...
mit
zhukaixy/kbengine
kbe/src/lib/python/Lib/concurrent/futures/_base.py
88
19638
# Copyright 2009 Brian Quinlan. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. __author__ = 'Brian Quinlan (brian@sweetapp.com)' import collections import logging import threading import time FIRST_COMPLETED = 'FIRST_COMPLETED' FIRST_EXCEPTION = 'FIRST_EXCEPTION' ALL_COMPLETED = 'ALL_COMPLETED...
lgpl-3.0
kristofferkoch/Balsa
extra/scintilla-wrapper/scintilla/include/Face.py
12
3360
# Module for reading and parsing Scintilla.iface file import string def sanitiseLine(line): if line[-1:] == '\n': line = line[:-1] if string.find(line, "##") != -1: line = line[:string.find(line, "##")] line = string.strip(line) return line def decodeFunction(featureVal): retType, rest = string.spl...
gpl-2.0
bloomark/python-bitcoinlib
examples/spend-p2sh-txout.py
19
3931
#!/usr/bin/env python3 # Copyright (C) 2014 The python-bitcoinlib developers # # This file is part of python-bitcoinlib. # # It is subject to the license terms in the LICENSE file found in the top-level # directory of this distribution. # # No part of python-bitcoinlib, including this file, may be copied, modified, # ...
lgpl-3.0
gauribhoite/personfinder
env/site-packages/sphinx/search/en.py
5
6059
# -*- coding: utf-8 -*- """ sphinx.search.en ~~~~~~~~~~~~~~~~ English search language: includes the JS porter stemmer. :copyright: Copyright 2007-2015 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ from sphinx.search import SearchLanguage try: # http://bitbucket...
apache-2.0
Yuriy-Leonov/nova
nova/api/openstack/compute/contrib/rescue.py
12
3532
# Copyright 2011 OpenStack Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
apache-2.0
slisson/intellij-community
python/lib/Lib/distutils/version.py
90
11482
# # distutils/version.py # # Implements multiple version numbering conventions for the # Python Module Distribution Utilities. # # $Id: version.py 29687 2002-11-14 02:25:42Z akuchling $ # """Provides classes to represent module version numbers (one class for each style of version numbering). There are currently two s...
apache-2.0
CasparLi/shadowsocks
shadowsocks/crypto/rc4_md5.py
15
1393
#!/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
gsehub/edx-platform
lms/djangoapps/discussion/tests/test_signals.py
9
4324
from django.test import TestCase import mock from django_comment_common import signals, models from lms.djangoapps.discussion.signals.handlers import ENABLE_FORUM_NOTIFICATIONS_FOR_SITE_KEY import openedx.core.djangoapps.request_cache as request_cache from openedx.core.djangoapps.site_configuration.tests.factories imp...
agpl-3.0
Geosyntec/wqio
docs/conf.py
2
10120
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # wqio documentation build configuration file, created by # sphinx-quickstart on Sun May 22 14:36:00 2016. # # 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 # autog...
bsd-3-clause
resmo/ansible
setup.py
7
12900
from __future__ import print_function import json import os import os.path import re import sys import warnings from collections import defaultdict from distutils.command.build_scripts import build_scripts as BuildScripts from distutils.command.sdist import sdist as SDist try: from setuptools import setup, find...
gpl-3.0
def-/commandergenius
project/jni/python/src/Lib/re.py
56
12966
# # Secret Labs' Regular Expression Engine # # re-compatible interface for the sre matching engine # # Copyright (c) 1998-2001 by Secret Labs AB. All rights reserved. # # This version of the SRE library can be redistributed under CNRI's # Python 1.6 license. For any other use, please contact Secret Labs # AB (info@py...
lgpl-2.1
daeseokyoun/youtube-dl
youtube_dl/extractor/fivemin.py
79
1917
from __future__ import unicode_literals from .common import InfoExtractor class FiveMinIE(InfoExtractor): IE_NAME = '5min' _VALID_URL = r'(?:5min:|https?://(?:[^/]*?5min\.com/|delivery\.vidible\.tv/aol)(?:(?:Scripts/PlayerSeed\.js|playerseed/?)?\?.*?playList=)?)(?P<id>\d+)' _TESTS = [ { ...
unlicense
hazelcast-incubator/hazelcast-python-client
hzclient/codec/transactionalmultimapcodec.py
2
1449
__author__ = 'Jonathan Brodie' import ctypes from hzclient.clientmessage import ClientMessage from util import util ''' PUT ''' def putEncode(): msg=ClientMessage() msg.optype=0x1101 util.raiseNotDefined() def putDecode(bytesobject): servermsg=ClientMessage.decodeMessage(bytesobject) util.raiseNotDe...
apache-2.0
anuradhakarunamuni/private-paas-cartridges
wso2esb/4.8.1/plugins/wso2esb-481-startup-handler.py
3
12404
# ------------------------------------------------------------------------ # # Copyright 2005-2015 WSO2, Inc. (http://wso2.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-2.0
DevinDewitt/pyqt5
examples/activeqt/webbrowser/ui_mainwindow.py
4
7277
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'mainwindow.ui' # # Created: Fri Jul 26 06:46:58 2013 # by: PyQt5 UI code generator 5.0.1-snapshot-2a99e59669ee # # WARNING! All changes made in this file will be lost! from PyQt5 import QtCore, QtGui, QtWidgets class Ui_MainWindow(obj...
gpl-3.0
joergdietrich/astropy
astropy/cosmology/core.py
2
100572
# Licensed under a 3-clause BSD style license - see LICENSE.rst from __future__ import (absolute_import, division, print_function, unicode_literals) from ..extern import six from ..extern.six.moves import map import sys from math import sqrt, pi, exp, log, floor from abc import ABCMeta, abstra...
bsd-3-clause
pexip/os-buildbot-slave
buildslave/test/__init__.py
3
2091
# 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
mrclro/kbxrec
project/people/migrations/0001_initial.py
1
4164
# -*- coding: utf-8 -*- # Generated by Django 1.11 on 2017-04-22 19:46 from __future__ import unicode_literals import django.core.validators from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ('events', '0...
mit
glovebx/odoo
addons/account/report/account_report.py
144
12839
# -*- 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
bmildner/SQLiteCpp
cpplint.py
3
184573
#!/usr/bin/python # # Copyright (c) 2009 Google Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of ...
mit
rahuldhote/odoo
addons/portal/__openerp__.py
250
2271
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2012 OpenERP S.A (<http://www.openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms ...
agpl-3.0
classicsxdx/puzzlecoin
contrib/bitrpc/bitrpc.py
1
7844
from jsonrpc import ServiceProxy import sys import string # ===== BEGIN USER SETTINGS ===== # if you do not set these you will be prompted for a password for every command rpcuser = "" rpcpass = "" # ====== END USER SETTINGS ====== if rpcpass == "": access = ServiceProxy("http://127.0.0.1:11814") else: access = Se...
mit
midnightradio/gerrit
tools/pack_war.py
1
1943
#!/usr/bin/python # Copyright (C) 2013 The Android Open Source Project # # 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 ap...
apache-2.0
nnethercote/servo
tests/wpt/web-platform-tests/tools/third_party/py/testing/code/test_assertion.py
55
7796
import pytest, py import re def exvalue(): import sys return sys.exc_info()[1] def f(): return 2 def test_assert(): try: assert f() == 3 except AssertionError: e = exvalue() s = str(e) assert s.startswith('assert 2 == 3\n') def test_assert_within_finally(): e...
mpl-2.0
dabrahams/zeroinstall
zeroinstall/injector/trust.py
1
8662
""" Records who we trust to sign feeds. Trust is divided up into domains, so that it is possible to trust a key in some cases and not others. @var trust_db: Singleton trust database instance. """ # Copyright (C) 2009, Thomas Leonard # See the README file for details, or visit http://0install.net. from zeroinstall i...
lgpl-2.1
jpurma/Kataja
plugins/TreesAreMemory/TreesAreMemoryParser.py
1
9791
from itertools import chain try: # When this is imported in Kataja context from plugins.TreesAreMemory.Constituent import Constituent from plugins.TreesAreMemory.Feature import Feature from kataja.syntax.SyntaxState import SyntaxState from plugins.TreesAreMemory.utils import simple_bracket_tree_...
gpl-3.0
agoravoting/agora-tools
import_election_csv.py
1
18454
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # This file is part of agora-tools. # Copyright (C) 2014-2016 Agora Voting SL <agora@agoravoting.com> # agora-tools 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...
agpl-3.0
radicalbit/ambari
ambari-server/src/main/resources/stacks/BIGTOP/0.8/services/HBASE/package/scripts/hbase_decommission.py
4
2241
#!/usr/bin/env python """ Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License");...
apache-2.0
shhong/Probabilistic-Programming-and-Bayesian-Methods-for-Hackers
Chapter3_MCMC/github_pull.py
95
2327
#github data scrapper """ variables of interest: indp. variables - language, given as a binary variable. Need 4 positions for 5 langagues - #number of days created ago, 1 position - has wiki? Boolean, 1 position - followers, 1 position - following, 1 position - constant dep. variab...
mit
tigersirvine/occtigerscricket
django/utils/daemonize.py
452
1907
import os import sys if os.name == 'posix': def become_daemon(our_home_dir='.', out_log='/dev/null', err_log='/dev/null', umask=022): "Robustly turn into a UNIX daemon, running in our_home_dir." # First fork try: if os.fork() > 0: sys.exit(0...
bsd-3-clause
techdragon/django
tests/test_discovery_sample/doctests.py
471
1245
""" Doctest example from the official Python documentation. https://docs.python.org/3/library/doctest.html """ def factorial(n): """Return the factorial of n, an exact integer >= 0. >>> [factorial(n) for n in range(6)] [1, 1, 2, 6, 24, 120] >>> factorial(30) # doctest: +ELLIPSIS 2652528598121910...
bsd-3-clause
hxxft/lynx-native
Core/build/jni_generator.py
1
52358
#!/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. """Extracts native methods from a Java file and generates the JNI bindings. If you change this, please run and update the tests."""...
mit
chandlercr/aima-python
submissions/Dickenson/mygames.py
18
5431
from collections import namedtuple from games import (Game) #Different board configurations can be declared here. The standard board (3 on top, 5 through the middle, 3 on bottom) #is the "basicBoard". basicBoard = {(0,1):[(1,2),(1,1),(1,0)], (1,2):[(1,1),(0,1),(2,1),(2,2)], (1,1):[(1,2),(0,1...
mit
gnumdk/eolie
eolie/art.py
1
6729
# Copyright (c) 2017 Cedric Bellegarde <cedric.bellegarde@adishatz.org> # 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
djs55/planex
planex/debiancontrol.py
1
3069
""" Utility functions for generating Debian control files from RPM spec files. """ from planex.tree import Tree from planex import mappkgname import textwrap STANDARDS_VERSION = "3.9.3" def control_from_spec(spec): """ Create the contents of the debian/control file from spec. """ res = Tree() s...
lgpl-2.1
CodigoSur/cyclope
cyclope/apps/social/urls.py
2
1230
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2013 Código Sur Sociedad Civil. # All rights reserved. # # This file is part of Cyclope. # # Cyclope 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, ...
gpl-3.0
hiway/micropython
tests/basics/namedtuple1.py
2
1432
try: try: from collections import namedtuple except ImportError: from ucollections import namedtuple except ImportError: print("SKIP") raise SystemExit T = namedtuple("Tup", ["foo", "bar"]) # CPython prints fully qualified name, what we don't bother to do so far #print(T) for t in T(1, ...
mit
uvemas/ViTables
vitables/csv/export_csv.py
1
11064
# Copyright (C) 2008-2019 Vicent Mas. 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, either version 3 of the License, or # (at your option) a...
gpl-3.0
darmaa/odoo
addons/website_crm/controllers/main.py
12
3940
# -*- coding: utf-8 -*- import base64 from openerp.addons.web import http from openerp.addons.web.http import request from openerp import SUPERUSER_ID import werkzeug.urls class contactus(http.Controller): def generate_google_map_url(self, street, city, city_zip, country_name): url = "http://maps.googl...
agpl-3.0