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
mindnervestech/mnrp
addons/crm_claim/crm_claim.py
333
10079
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-today OpenERP SA (<http://www.openerp.com>) # # This program is free software: you can redistribute it and/or modify # it under the terms o...
agpl-3.0
JianfengXu/crosswalk-test-suite
stability/stability-lowresource-android-tests/lowresource/TestApp.py
3
6765
#!/usr/bin/env python # coding=utf-8 # # Copyright (c) 2015 Intel Corporation. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of works must retain the original copyright notice, this # list of c...
bsd-3-clause
calfonso/ansible
contrib/inventory/scaleway.py
20
7196
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' External inventory script for Scaleway ==================================== Shamelessly copied from an existing inventory script. This script generates an inventory that Ansible can understand by making API requests to Scaleway API Requires some python libraries, en...
gpl-3.0
kirca/odoo
addons/account_voucher/report/__init__.py
378
1083
# -*- 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
lucidbard/NewsBlur
vendor/oauth2client/anyjson.py
302
1044
# Copyright (C) 2010 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writ...
mit
yi719/python-driver
cassandra/murmur3.py
15
2387
from six.moves import range import struct def body_and_tail(data): l = len(data) nblocks = l // 16 tail = l % 16 if nblocks: return struct.unpack_from('qq' * nblocks, data), struct.unpack_from('b' * tail, data, -tail), l else: return tuple(), struct.unpack_from('b' * tail, data, -t...
apache-2.0
littlstar/chromium.src
chrome/common/extensions/docs/server2/github_file_system_provider.py
121
1611
# Copyright 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. from caching_file_system import CachingFileSystem from empty_dir_file_system import EmptyDirFileSystem from github_file_system import GithubFileSystem as Old...
bsd-3-clause
errordeveloper/fe-devel
Native/ThirdParty/Private/Python/js_beautifier.py
4
22785
import sys import os import exceptions import glob fileTypes = ['.js','.kl','.html'] controls = ['case', 'default', 'do', 'else','for', 'if','while','throw', 'switch', 'catch'] keywords = ['break', 'continue', 'finally', 'return', 'try', 'var', 'with', 'delete', 'new', 'typeof', 'instanceof', '#include'] f...
agpl-3.0
krishna-pandey-git/django
django/contrib/gis/shortcuts.py
388
1209
import zipfile from io import BytesIO from django.conf import settings from django.http import HttpResponse from django.template import loader # NumPy supported? try: import numpy except ImportError: numpy = False def compress_kml(kml): "Returns compressed KMZ from the given KML string." kmz = Bytes...
bsd-3-clause
boompieman/iim_project
project_python2/lib/python2.7/site-packages/pip/_vendor/retrying.py
934
9972
## Copyright 2013-2014 Ray Holder ## ## 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 ...
gpl-3.0
aasiutin/electrum
gui/qt/qrtextedit.py
12
1913
from electrum.i18n import _ from electrum.plugins import run_hook from PyQt4.QtGui import * from PyQt4.QtCore import * from util import ButtonsTextEdit, MessageBoxMixin class ShowQRTextEdit(ButtonsTextEdit): def __init__(self, text=None): ButtonsTextEdit.__init__(self, text) self.setReadOnly(1) ...
mit
ahupowerdns/pdns
regression-tests.api/test_Servers.py
13
1661
from test_helper import ApiTestCase, is_auth, is_recursor class Servers(ApiTestCase): def test_list_servers(self): r = self.session.get(self.url("/api/v1/servers")) self.assert_success_json(r) lst = r.json() self.assertEquals(len(lst), 1) # only localhost allowed in there ...
gpl-2.0
Lujeni/ansible
lib/ansible/modules/cloud/vmware/vmware_guest.py
1
150199
#!/usr/bin/python # -*- coding: utf-8 -*- # # This module is also sponsored by E.T.A.I. (www.etai.fr) # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version...
gpl-3.0
nexiles/odoo
addons/account/report/account_general_journal.py
381
7669
# -*- 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
jblackburne/scikit-learn
sklearn/tree/tests/test_tree.py
7
55471
""" Testing for the tree module (sklearn.tree). """ import pickle from functools import partial from itertools import product import struct import numpy as np from scipy.sparse import csc_matrix from scipy.sparse import csr_matrix from scipy.sparse import coo_matrix from sklearn.random_projection import sparse_random...
bsd-3-clause
ChronoMonochrome/android_external_chromium_org
tools/valgrind/valgrind_test.py
24
46017
# 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. """Runs an exe through Valgrind and puts the intermediate files in a directory. """ import datetime import glob import logging import optparse import os...
bsd-3-clause
QuantScientist/Deep-Learning-Boot-Camp
Kaggle-PyTorch/PyTorch-Ensembler/nnmodels/simplenet.py
1
3522
import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim from torchvision import datasets, transforms from torch.autograd import Variable import math use_gpu = torch.cuda.is_available() # class SimpleNet(nn.Module): # def __init__(self, num_classes=1, n_dim=3): # sup...
mit
showerst/openstates
openstates/ma/bills.py
1
5391
import re import time import itertools from datetime import datetime import lxml.html from billy.scrape.bills import BillScraper, Bill from .actions import Categorizer class MABillScraper(BillScraper): jurisdiction = 'ma' categorizer = Categorizer() def __init__(self, *args, **kwargs): super(M...
gpl-3.0
peterjoel/servo
tests/wpt/web-platform-tests/tools/third_party/html5lib/html5lib/tests/test_encoding.py
30
4801
from __future__ import absolute_import, division, unicode_literals import os import pytest from .support import get_data_files, test_dir, errorMessage, TestData as _TestData from html5lib import HTMLParser, _inputstream def test_basic_prescan_length(): data = "<title>Caf\u00E9</title><!--a--><meta charset='utf...
mpl-2.0
Novasoft-India/OperERP-AM-Motors
openerp/tools/misc.py
16
39088
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # Copyright (C) 2010-2013 OpenERP s.a. (<http://openerp.com>). # # This program is free software: you ca...
agpl-3.0
vetu11/piloco
telegram/inlinequeryresultcontact.py
1
3739
#!/usr/bin/env python # # A library that provides a Python interface to the Telegram Bot API # Copyright (C) 2015-2016 # Leandro Toledo de Souza <devs@python-telegram-bot.org> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser Public License as published by #...
gpl-3.0
ddurst/zamboni
mkt/features/tests/test_utils_.py
6
2321
from django.test.client import RequestFactory import mock from nose.tools import eq_ import mkt.site.tests from mkt.constants.features import FeatureProfile from mkt.features.utils import load_feature_profile class TestLoadFeatureProfile(mkt.site.tests.TestCase): def setUp(self): super(TestLoadFeaturePr...
bsd-3-clause
RanadeepPolavarapu/kuma
vendor/packages/pygments/lexers/php.py
72
9769
# -*- coding: utf-8 -*- """ pygments.lexers.php ~~~~~~~~~~~~~~~~~~~ Lexers for PHP and related languages. :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re from pygments.lexer import RegexLexer, include, bygroups, default, us...
mpl-2.0
windofthesky/ansible
contrib/inventory/spacewalk.py
24
8569
#!/bin/env python """ Spacewalk external inventory script ================================= Ansible has a feature where instead of reading from /etc/ansible/hosts as a text file, it can query external programs to obtain the list of hosts, groups the hosts are in, and even variables to assign to each host. To use thi...
gpl-3.0
failys/CAIRIS
cairis/test/test_TraceAPI.py
1
4597
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may...
apache-2.0
sunilghai/avahi-llmnr
avahi-python/avahi-discover/SimpleGladeApp.py
14
11794
""" SimpleGladeApp.py Module that provides an object oriented abstraction to pygtk and libglade. Copyright (C) 2004 Sandino Flores Moreno """ # 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 Found...
lgpl-2.1
edx/ansible
v2/ansible/utils/path.py
14
1306
# (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
RiccardoPecora/MP
Lib/distutils/bcppcompiler.py
59
15335
"""distutils.bcppcompiler Contains BorlandCCompiler, an implementation of the abstract CCompiler class for the Borland C++ compiler. """ # This implementation by Lyle Johnson, based on the original msvccompiler.py # module and using the directions originally published by Gordon Williams. # XXX looks like th...
gpl-3.0
hs634/algorithms
python/test.py
1
1435
# # inputs outputs # single sin # simple sim # solution so # a a # class Node: def __init__(self, val): self.val = val self.children = [0] * 26 self.is_end = False self.word_count = 1 def get_unique_prefixes(words): root = Node(0) root.word_count += 1 ...
mit
credativ/pulp
server/test/unit/plugins/file/test_distributor.py
4
13411
from os import readlink import copy import csv import errno import os import shutil import tempfile import unittest from mock import Mock, MagicMock, patch from pulp.common.plugins.distributor_constants import MANIFEST_FILENAME from pulp.devel.mock_distributor import get_publish_conduit from pulp.plugins.file.distrib...
gpl-2.0
imcsk8/origin
vendor/github.com/ugorji/go/codec/test.py
1516
4019
#!/usr/bin/env python # This will create golden files in a directory passed to it. # A Test calls this internally to create the golden files # So it can process them (so we don't have to checkin the files). # Ensure msgpack-python and cbor are installed first, using: # sudo apt-get install python-dev # sudo apt-g...
apache-2.0
pacoqueen/ginn
extra/patches/upgrade_db_etiquetas_norma13.py
1
8959
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Crea los campos y actualiza los productos para las nuevas etiquetas de la norma del 1 de julio de 2013. """ import os, sys sys.path.insert(0, (os.path.join(os.path.abspath(os.path.dirname(__file__)), "..", "..", "ginn"))) os.chdir(os.path.join(os...
gpl-2.0
code-for-india/sahana_shelter_worldbank
tests/unit_tests/modules/s3/s3gis/LayerFailures.py
43
3905
import unittest s3gis = local_import("s3.s3gis") test_utils = local_import("test_utils") s3gis_tests = load_module("tests.unit_tests.modules.s3.s3gis") class FailingMethod(object): def __init__(self, method_spec, method): self.LayerClass, self.method_name = method_spec self.method = method ...
mit
embeddedarm/android_external_chromium_org
chrome/common/extensions/docs/server2/caching_file_system.py
25
4645
# 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 posixpath import sys from file_system import FileSystem, StatInfo, FileNotFoundError from future import Future class _AsyncUncachedFuture(objec...
bsd-3-clause
saram-kon/beepmusic
midi_to_beep/midi_to_beep.py
1
8039
#! python # COPYRIGHT: BALTHASAR SCHLOTMANN 2017 # LICENSED UNDER THE GNU GENERAL PUBLIC LICENSE VERSION 3 import sys import notedict as nd filename = sys.argv[1] # from here: https://github.com/bspaans/python-mingus/blob/master/mingus/midi/midi_file_in.py def parse_varbyte_as_int( array, i): """Read a variable l...
gpl-3.0
abetkin/django-qfilter
qfilters/exotic_types.py
1
5664
# -*- coding: utf-8 -*- from itertools import groupby from functools import reduce from . import QuerySetFilter, ValuesDictFilter from .utils import CallablesList class QuerysetIterationHook(QuerySetFilter): def __init__(self, hook_function): self.hook_function = hook_function def __and__(...
mit
eloquence/unisubs
apps/videos/migrations/0148_set_video_title.py
5
31537
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models from django.core.exceptions import ObjectDoesNotExist class Migration(SchemaMigration): def forwards(self, orm): if not db.dry_run: for video in orm.Video.objects.al...
agpl-3.0
jnewland/home-assistant
homeassistant/components/bom/weather.py
8
3320
"""Support for Australian BOM (Bureau of Meteorology) weather service.""" import logging import voluptuous as vol from homeassistant.components.weather import PLATFORM_SCHEMA, WeatherEntity from homeassistant.const import ( CONF_LATITUDE, CONF_LONGITUDE, CONF_NAME, TEMP_CELSIUS) from homeassistant.helpers import ...
apache-2.0
theblacklion/diamond-framework
tools/hotshot2calltree.py
3
14127
#!/usr/bin/env python # _*_ coding: latin1 _*_ # # Copyright (c) 2003 by WEB.DE, Karlsruhe # Autor: Jörg Beyer <job@webde-ag.de> # # hotshot2cachegrind 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 ...
mit
Andrey-Pavlov/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/layout_tests/models/test_expectations_unittest.py
118
37734
# 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 the ...
bsd-3-clause
schmidtc/pysal
pysal/weights/Wsets.py
7
18482
""" Set-like manipulation of weights matrices. """ __author__ = "Sergio J. Rey <srey@asu.edu>, Charles Schmidt <schmidtc@gmail.com>, David Folch <david.folch@asu.edu>, Dani Arribas-Bel <darribas@asu.edu>" import pysal import copy from scipy.sparse import isspmatrix_csr from numpy import ones __all__ = ['w_union', 'w...
bsd-3-clause
deandunbar/html2bwml
venv/lib/python2.7/site-packages/django/core/files/move.py
103
3164
""" Move a file in the safest way possible:: >>> from django.core.files.move import file_move_safe >>> file_move_safe("/tmp/old_file", "/tmp/new_file") """ import os from django.core.files import locks try: from shutil import copystat except ImportError: import stat def copystat(src, dst): ...
mit
haad/ansible
test/units/modules/network/f5/test_bigip_iapp_service.py
28
12006
# -*- coding: utf-8 -*- # # Copyright (c) 2017 F5 Networks Inc. # GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import (absolute_import, division, print_function) __metaclass__ = type import os import json import sys from nose.plugins.skip import SkipTest i...
gpl-3.0
valkjsaaa/sl4a
python/src/Lib/encodings/cp863.py
593
34508
""" Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP863.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_map) def decode(self,input,errors='strict'): ...
apache-2.0
dlew/joda-time-android
utils/resource_extractor.py
9
2399
#!/usr/bin/env python """ Extracts selected resources from resources directories. Useful for grabbing translations from AOSP. Point towards base files in the library (in /res/values) and it will find all the alternate versions in other directories. """ import os import shutil from optparse import Op...
apache-2.0
frankvdp/django
tests/filtered_relation/tests.py
43
16742
from django.db import connection, transaction from django.db.models import Case, Count, F, FilteredRelation, Q, When from django.test import TestCase from django.test.testcases import skipUnlessDBFeature from .models import Author, Book, Borrower, Editor, RentalSession, Reservation class FilteredRelationTests(TestCa...
bsd-3-clause
anbangr/trusted-nova
nova/api/openstack/compute/contrib/flavormanage.py
8
3129
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # 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...
apache-2.0
andaag/scikit-learn
examples/semi_supervised/plot_label_propagation_versus_svm_iris.py
286
2378
""" ===================================================================== Decision boundary of label propagation versus SVM on the Iris dataset ===================================================================== Comparison for decision boundary generated on iris dataset between Label Propagation and SVM. This demon...
bsd-3-clause
yanchen036/tensorflow
tensorflow/contrib/distributions/python/kernel_tests/wishart_test.py
15
15481
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
bzennn/blog_flask
python/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/codingstatemachine.py
2931
2318
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is mozilla.org code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights Reserved. # # Con...
gpl-3.0
levkar/odoo-addons
stock_remit/wizard/stock_print_remit.py
1
2063
# -*- coding: utf-8 -*- from openerp.osv import fields, osv class stock_print_remit(osv.osv_memory): _name = 'stock.print_remit' _description = "Print Remit" _columns = { 'remit_number': fields.char('Remit Number'), } def default_get(self, cr, uid, fields, context=None): res = su...
agpl-3.0
arupiot/deskcontrol
deskcontrol/config.py
1
4175
import os NAME_AUTHORITY = os.environ.get("NAME_AUTHORITY", "eightfitzroy.arupiot.com") DEVICE_NAME = os.environ.get("DEVICE_NAME", "TST-1") HOST = os.environ.get("BRICKD_HOST", "localhost") PORT = int(os.environ.get("BRICKD_PORT", "4223")) SHORT_IDENT = os.environ.get("SHORT_IDENT", "test") MODULES = [] MENU_MODUL...
mit
Robpol86/coveralls-multi-ci
tests/test_git_stats_detached.py
1
2466
import subprocess from coveralls_multi_ci import git_stats def test_master(repo_dir, hashes): hex_sha = hashes['master'] assert 0 == subprocess.check_call(['git', 'checkout', '-qf', hex_sha], cwd=repo_dir) actual = git_stats(repo_dir) expected = dict( branch='master', remotes=[dict(n...
mit
BT-ojossen/l10n-switzerland
l10n_ch_bank/migrations/8.0.9.0.0/pre-migration.py
10
1402
# -*- coding: utf-8 -*- ############################################################################## # # Author: Guewen Baconnier # Copyright 2014 Camptocamp SA # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # pu...
agpl-3.0
romankagan/DDBWorkbench
plugins/hg4idea/testData/bin/hgext/largefiles/basestore.py
92
7659
# Copyright 2009-2010 Gregory P. Ward # Copyright 2009-2010 Intelerad Medical Systems Incorporated # Copyright 2010-2011 Fog Creek Software # Copyright 2010-2011 Unity Technologies # # This software may be used and distributed according to the terms of the # GNU General Public License version 2 or any later version. '...
apache-2.0
zenodo/invenio
invenio/modules/deposit/types/simplerecord.py
1
3085
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2014, 2015 CERN. # # Invenio is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of the # License, or (at your option) any...
gpl-2.0
takeflight/cookiecutter
tests/replay/test_load.py
8
1855
# -*- coding: utf-8 -*- """ test_load ----------- """ import json import os import pytest from cookiecutter import replay @pytest.fixture def template_name(): """Fixture to return a valid template_name.""" return 'cookiedozer_load' @pytest.fixture def replay_file(replay_test_dir, template_name): """F...
bsd-3-clause
gonboy/python-for-android
src/buildlib/jinja2.egg/jinja2/exceptions.py
17
4424
# -*- coding: utf-8 -*- """ jinja2.exceptions ~~~~~~~~~~~~~~~~~ Jinja exceptions. :copyright: (c) 2010 by the Jinja Team. :license: BSD, see LICENSE for more details. """ from jinja2._compat import imap, text_type, PY2, implements_to_string class TemplateError(Exception): """Baseclass for al...
mit
uclouvain/osis
ddd/logic/application/use_case/read/get_attributions_about_to_expire_service.py
1
3140
############################################################################## # # OSIS stands for Open Student Information System. It's an application # designed to manage the core business of higher education institutions, # such as universities, faculties, institutes and professional schools. # The core ...
agpl-3.0
sebrandon1/nova
nova/tests/unit/api/openstack/compute/test_flavorextradata.py
1
3374
# Copyright 2012 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requ...
apache-2.0
jashank/rust
src/etc/unicode.py
15
24287
#!/usr/bin/env python # # Copyright 2011-2013 The Rust Project Developers. See the COPYRIGHT # file at the top-level directory of this distribution and at # http://rust-lang.org/COPYRIGHT. # # Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or # http://www.apache.org/licenses/LICENSE-2.0> or the MIT lice...
apache-2.0
riolet/rioauth
provider/pages/login_github.py
1
4700
import web import oauthlib.oauth2.rfc6749 import constants import common import base import logging import pprint from models import oauth_consumer class Login(base.Page): def __init__(self): base.Page.__init__(self, "Riolet Login") self.redirect_uri = unicode(constants.config.get('github', 'redir...
gpl-3.0
sagark123/coala
tests/results/result_actions/ApplyPatchActionTest.py
16
6917
import unittest import os from os.path import isfile from coala_utils.ContextManagers import make_temp from coalib.results.Diff import Diff from coalib.results.Result import Result from coalib.results.result_actions.ApplyPatchAction import ApplyPatchAction from coalib.settings.Section import Section class ApplyPatch...
agpl-3.0
selam/retopy
run.py
1
4143
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2015 Timu EREN # # 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 requir...
apache-2.0
Jeebeevee/DouweBot_JJ15
plugins_org/twitter.py
10
3194
import random import re from time import strptime, strftime from urllib import quote from util import hook, http @hook.api_key('twitter') @hook.command def twitter(inp, api_key=None): ".twitter <user>/<user> <n>/<id>/#<search>/#<search> <n> -- " \ "get <user>'s last/<n>th tweet/get tweet <id>/do <search>...
unlicense
EqAfrica/machinekit
src/hal/user_comps/hal_storage.py
8
3146
#!/usr/bin/python # encoding: utf-8 """ Storage.py Created by Alexander Rössler on 2015-01-03. """ import time import sys import os import argparse import ConfigParser import hal class Pin: def __init__(self): self.halPin = 0 self.halName = '' self.section = '' self.name = '' ...
lgpl-2.1
rockyzhang/zhangyanhit-python-for-android-mips
python3-alpha/python3-src/Lib/encodings/euc_kr.py
816
1027
# # euc_kr.py: Python Unicode Codec for EUC_KR # # Written by Hye-Shik Chang <perky@FreeBSD.org> # import _codecs_kr, codecs import _multibytecodec as mbc codec = _codecs_kr.getcodec('euc_kr') class Codec(codecs.Codec): encode = codec.encode decode = codec.decode class IncrementalEncoder(mbc.MultibyteIncrem...
apache-2.0
ujenmr/ansible
lib/ansible/modules/cloud/vmware/vmware_host_ssl_facts.py
56
4683
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2018, Abhijeet Kasurde <akasurde@redhat.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = { 'metadat...
gpl-3.0
Sonicbids/django
django/contrib/gis/geos/linestring.py
9
5808
from django.contrib.gis.geos.base import numpy from django.contrib.gis.geos.coordseq import GEOSCoordSeq from django.contrib.gis.geos.error import GEOSException from django.contrib.gis.geos.geometry import GEOSGeometry from django.contrib.gis.geos.point import Point from django.contrib.gis.geos import prototypes as cap...
bsd-3-clause
ToonTownInfiniteRepo/ToontownInfinite
toontown/hood/GZHood.py
2
2614
from pandac.PandaModules import * import ToonHood from toontown.safezone import GZSafeZoneLoader from toontown.toonbase.ToontownGlobals import * from toontown.racing import DistributedVehicle import SkyUtil class GZHood(ToonHood.ToonHood): def __init__(self, parentFSM, doneEvent, dnaStore, hoodId): ToonHo...
mit
Pythonify/awesome
venv/lib/python2.7/site-packages/pip/_vendor/ipaddress.py
339
80176
# Copyright 2007 Google Inc. # Licensed to PSF under a Contributor Agreement. """A fast, lightweight IPv4/IPv6 manipulation library in Python. This library is used to create/poke/manipulate IPv4 and IPv6 addresses and networks. """ from __future__ import unicode_literals import itertools import struct __version...
gpl-3.0
jianghuaw/nova
nova/tests/unit/notifications/objects/test_flavor.py
2
7601
# 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 # d...
apache-2.0
serviceagility/boto
boto/sdb/domain.py
153
14351
# Copyright (c) 2006,2007 Mitch Garnaat http://garnaat.org/ # # 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, modi...
mit
bplancher/odoo
openerp/service/report.py
56
5118
# -*- coding: utf-8 -*- import base64 import logging import sys import threading import openerp import openerp.report from openerp import tools from openerp.exceptions import UserError import security _logger = logging.getLogger(__name__) # TODO: set a maximum report number per user to avoid DOS attacks # # Report...
agpl-3.0
Lilykos/invenio
invenio/legacy/bibrank/adminlib.py
13
43633
# This file is part of Invenio. # Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015 CERN. # # Invenio is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of the ...
gpl-2.0
abdullah2891/remo
remo/profiles/helpers.py
3
2078
import urlparse from datetime import timedelta from django.utils import timezone from django.conf import settings from funfactory.helpers import urlparams from jingo import register from libravatar import libravatar_url from remo.profiles.models import FunctionalArea, UserAvatar from remo.reports.utils import get_...
bsd-3-clause
TridevGuha/django
tests/utils_tests/test_regex_helper.py
448
1784
from __future__ import unicode_literals import unittest from django.utils import regex_helper class NormalizeTests(unittest.TestCase): def test_empty(self): pattern = r"" expected = [('', [])] result = regex_helper.normalize(pattern) self.assertEqual(result, expected) def te...
bsd-3-clause
DevinDewitt/pyqt5
examples/webkit/fancybrowser/fancybrowser.py
3
7927
#!/usr/bin/env python ############################################################################# ## ## Copyright (C) 2013 Riverbank Computing Limited ## Copyright (C) 2010 Hans-Peter Jansen <hpj@urpla.net>. ## Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ## All rights reserved. ## ## This file ...
gpl-3.0
nexusriot/cinder
cinder/openstack/common/scheduler/filters/availability_zone_filter.py
26
1256
# Copyright (c) 2011-2012 OpenStack Foundation. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # U...
apache-2.0
KohlsTechnology/ansible
lib/ansible/playbook/play.py
11
12526
# (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
Plain-Andy-legacy/android_external_chromium_org
build/android/pylib/device/adb_wrapper_test.py
36
2716
# Copyright 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. """Tests for the AdbWrapper class.""" import os import tempfile import time import unittest from pylib.device import adb_wrapper from pylib.device import d...
bsd-3-clause
trademob/boto
boto/ec2/autoscale/request.py
152
1549
# Copyright (c) 2009 Reza Lotun http://reza.lotun.name/ # # 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, ...
mit
extremewaysback/django
tests/forms_tests/tests/test_formsets.py
128
57919
# -*- coding: utf-8 -*- from __future__ import unicode_literals import datetime from django.forms import ( CharField, DateField, FileField, Form, IntegerField, SplitDateTimeField, ValidationError, formsets, ) from django.forms.formsets import BaseFormSet, formset_factory from django.forms.utils import ErrorLi...
bsd-3-clause
mcepl/youtube-dl
test/test_iqiyi_sdk_interpreter.py
16
1103
#!/usr/bin/env python from __future__ import unicode_literals # Allow direct execution import os import sys import unittest sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) from test.helper import FakeYDL from youtube_dl.extractor import IqiyiIE class IqiyiIEWithCredentials(IqiyiIE):...
unlicense
seiji56/rmaze-2016
logic_code/last_ver/phys/movement.py
1
6199
import herkulex import time import thread import RPi.GPIO as gpio import sensory as sn herkulex.connect("/dev/ttyAMA0", 115200) FR = herkulex.servo(0xfd) FL = herkulex.servo(16) BR = herkulex.servo(10) BL = herkulex.servo(20) DROP = herkulex.servo(50) ALL = herkulex.servo(0xfe) ALL.torque_on() def align(to...
gpl-3.0
inspyration/odoo
addons/event/__openerp__.py
5
1447
# -*- coding: utf-8 -*- { 'name': 'Events Organisation', 'version': '0.1', 'website': 'https://www.odoo.com/page/events', 'category': 'Tools', 'summary': 'Trainings, Conferences, Meetings, Exhibitions, Registrations', 'description': """ Organization and management of Events. ====================...
agpl-3.0
buckket/twtxt
twtxt/helper.py
1
5887
""" twtxt.helper ~~~~~~~~~~~~ This module implements various helper for use in twtxt. :copyright: (c) 2016-2017 by buckket. :license: MIT, see LICENSE for more details. """ import shlex import subprocess import sys import textwrap import click import pkg_resources from twtxt.mentions import for...
mit
ghsr/android_kernel_samsung_i9152
tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/SchedGui.py
12980
5411
# SchedGui.py - Python extension for perf script, basic GUI code for # traces drawing and overview. # # Copyright (C) 2010 by Frederic Weisbecker <fweisbec@gmail.com> # # This software is distributed under the terms of the GNU General # Public License ("GPL") version 2 as published by the Free Software # Foundation. ...
gpl-2.0
fabian4/trove
trove/limits/views.py
7
1896
# Copyright 2013 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requ...
apache-2.0
berendkleinhaneveld/VTK
ThirdParty/Twisted/twisted/web/test/test_wsgi.py
33
54989
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Tests for L{twisted.web.wsgi}. """ __metaclass__ = type from sys import exc_info from urllib import quote from thread import get_ident import StringIO, cStringIO, tempfile from zope.interface.verify import verifyObject from twisted.python....
bsd-3-clause
aurofable/medhack-server
venv/lib/python2.7/encodings/punycode.py
586
6813
# -*- coding: iso-8859-1 -*- """ Codec for the Punicode encoding, as specified in RFC 3492 Written by Martin v. Löwis. """ import codecs ##################### Encoding ##################################### def segregate(str): """3.1 Basic code point segregation""" base = [] extended = {} for c in st...
mit
ryneeverett/cartridge
cartridge/shop/translation.py
5
1121
from modeltranslation.translator import translator, TranslationOptions from mezzanine.conf import settings from mezzanine.core.translation import (TranslatedDisplayable, TranslatedRichText) from cartridge.shop.models import (Category, Product, ProductOption, ...
bsd-2-clause
FBRTMaka/ooi-ui-services
ooiservices/tests/test_routes.py
2
7359
#!/usr/bin/env python ''' Specific testing of routes. ''' __author__ = 'Edna Donoughe' import unittest import json from base64 import b64encode from flask import url_for from ooiservices.app import create_app, db from ooiservices.app.models import PlatformDeployment, InstrumentDeployment, Stream, StreamParameter from...
apache-2.0
devinbalkind/eden
models/00_db.py
4
6534
# -*- coding: utf-8 -*- """ Import Modules Configure the Database Instantiate Classes """ if settings.get_L10n_languages_readonly(): # Make the Language files read-only for improved performance T.is_writable = False get_vars = request.get_vars # Are we running in debug mode? request_debug = get_...
mit
playingaround2017/test123
gamera/pixmaps/img2img.py
2
2515
# # This file has been taken from wxpython (see the file # wx/tools/img2img.py in the wxpython source distribution) # # Copyright (c) 1998 Julian Smart, Robert Roebling et al # # This program may be freely used, copied and distributed under # the terms of the wxWindows Library Licence, Version 3. See # the file "copyri...
gpl-2.0
topiaruss/django-filer
filer/migrations/0012_renaming_folderpermissions.py
49
10617
# -*- 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): db.rename_column('filer_folderpermission', 'can_edit_new', 'can_edit') db.rename_column('filer_folderpermiss...
bsd-3-clause
ogenstad/ansible
lib/ansible/modules/cloud/google/gcp_healthcheck.py
48
15302
#!/usr/bin/python # Copyright 2017 Google Inc. # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], ...
gpl-3.0
goodwinnk/intellij-community
python/lib/Lib/site-packages/django/contrib/admin/views/template.py
88
3255
from django import template, forms from django.contrib.admin.views.decorators import staff_member_required from django.template import loader from django.shortcuts import render_to_response from django.contrib.sites.models import Site from django.conf import settings from django.utils.importlib import import_module fro...
apache-2.0
percipient/django-two-factor-auth
two_factor/forms.py
4
5418
from binascii import unhexlify from time import time from django import forms from django.forms import ModelForm, Form from django.utils.translation import ugettext_lazy as _ from django_otp.forms import OTPAuthenticationFormMixin from django_otp.oath import totp from django_otp.plugins.otp_totp.models import TOTPDev...
mit
ponnam/ESAT-131226
plugins/ti.alloy/plugin.py
1729
5251
import os, sys, subprocess, hashlib import subprocess def check_output(*popenargs, **kwargs): r"""Run command with arguments and return its output as a byte string. Backported from Python 2.7 as it's implemented as pure python on stdlib. >>> check_output(['/usr/bin/python', '--version']) Python 2.6....
apache-2.0