repo_name
stringlengths
5
100
path
stringlengths
4
375
copies
stringclasses
991 values
size
stringlengths
4
7
content
stringlengths
666
1M
license
stringclasses
15 values
Julian/urwid
examples/input_test.py
11
3001
#!/usr/bin/python # # Urwid keyboard input test app # Copyright (C) 2004-2009 Ian Ward # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the Licens...
lgpl-2.1
vasyarv/edx-platform
lms/djangoapps/instructor_task/tasks.py
12
12056
""" This file contains tasks that are designed to perform background operations on the running state of a course. At present, these tasks all operate on StudentModule objects in one way or another, so they share a visitor architecture. Each task defines an "update function" that takes a module_descriptor, a particula...
agpl-3.0
MaximLich/oppia
core/tests/performance_tests/splash_test.py
16
1597
# Copyright 2016 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 required by applicable ...
apache-2.0
hmgaudecker/econ-project-templates
{{cookiecutter.project_slug}}/.mywaflib/waflib/Tools/cs.py
55
6397
#!/usr/bin/env python # encoding: utf-8 # Thomas Nagy, 2006-2018 (ita) """ C# support. A simple example:: def configure(conf): conf.load('cs') def build(bld): bld(features='cs', source='main.cs', gen='foo') Note that the configuration may compile C# snippets:: FRAG = ''' namespace Moo { public class Test ...
bsd-3-clause
dhruve/spark
examples/src/main/python/ml/string_indexer_example.py
123
1402
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
apache-2.0
piyushroshan/xen-4.3
tools/python/logging/logging-0.4.9.2/logging/handlers.py
42
28606
# Copyright 2001-2004 by Vinay Sajip. All Rights Reserved. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose and without fee is hereby granted, # provided that the above copyright notice appear in all copies and that # both that copyright notice and this permissio...
gpl-2.0
raags/ansible-modules-core
windows/win_ping.py
208
1376
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>, and others # # 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 ...
gpl-3.0
lurch/python-gpiozero
gpiozero/pins/pigpiod.py
1
9761
from __future__ import ( unicode_literals, absolute_import, print_function, division, ) str = type('') import warnings import pigpio import os from . import Pin from .data import pi_info from ..exc import ( PinInvalidFunction, PinSetInput, PinFixedPull, PinInvalidPull, PinInval...
bsd-3-clause
moehle/cvxpy_codegen
cvxpy_codegen/atoms/kron.py
1
1098
""" Copyright 2017 Nicholas Moehle This file is part of CVXPY-CODEGEN. CVXPY-CODEGEN 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. CVXPY...
gpl-3.0
woobe/h2o
py/testdir_single_jvm/test_GLM2_tweedie.py
2
2449
import unittest, time, sys sys.path.extend(['.','..','py']) import h2o, h2o_cmd, h2o_glm, h2o_hosts, h2o_import as h2i, h2o_util class Basic(unittest.TestCase): def tearDown(self): h2o.check_sandbox_for_errors() @classmethod def setUpClass(cls): global localhost localhost = h2o.dec...
apache-2.0
dfalt974/SickRage
lib/github/tests/Issue.py
7
9092
# -*- coding: utf-8 -*- # ########################## Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques <vincent@vincent-jacques.net> # # Copyright 2012 Zearin <zearin@gonk.net> ...
gpl-3.0
tmpgit/intellij-community
python/lib/Lib/encodings/mbcs.py
860
1211
""" Python 'mbcs' Codec for Windows Cloned by Mark Hammond (mhammond@skippinet.com.au) from ascii.py, which was written by Marc-Andre Lemburg (mal@lemburg.com). (c) Copyright CNRI, All Rights Reserved. NO WARRANTY. """ # Import them explicitly to cause an ImportError # on non-Windows systems from codecs import mbcs...
apache-2.0
xen0l/ansible
lib/ansible/modules/windows/win_shell.py
28
4846
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2016, Ansible, inc # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'core'} DOCUMENTATIO...
gpl-3.0
draenog/gitolite-scripts
hooks/post-receive.d/gnome/git.py
1
6496
# Utility functions for git # # Copyright (C) 2008 Owen Taylor # Copyright (C) 2009 Red Hat, 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 2 # of the License, or (at you...
gpl-2.0
shibaniahegde/OpenStak_swift
swift/common/middleware/domain_remap.py
20
6262
# Copyright (c) 2010-2012 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 agree...
apache-2.0
chafique-delli/OpenUpgrade
addons/l10n_ro/__openerp__.py
40
1804
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2012 (<http://www.erpsystems.ro>). All Rights Reserved # # This program is free software: you can redistribute it and/or modify # it under the...
agpl-3.0
git-keeper/git-keeper
git-keeper-server/gkeepserver/log_polling.py
1
9468
# Copyright 2016 Nathan Sommer and Ben Coleman # # 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 dis...
agpl-3.0
ammaradil/fibonacci
Lib/site-packages/django/utils/module_loading.py
145
6290
import copy import os import sys from importlib import import_module from django.utils import six def import_string(dotted_path): """ Import a dotted module path and return the attribute/class designated by the last name in the path. Raise ImportError if the import failed. """ try: module...
mit
Weihonghao/ECM
Vpy34/lib/python3.5/site-packages/pip/_vendor/requests/utils.py
319
24163
# -*- coding: utf-8 -*- """ requests.utils ~~~~~~~~~~~~~~ This module provides utility functions that are used within Requests that are also useful for external consumption. """ import cgi import codecs import collections import io import os import re import socket import struct import warnings from . import __vers...
agpl-3.0
Jordy281/Tic_Tac_Toe_SuperComputer
game.py
1
1938
import numpy as np import copy from random import randrange """ We will check across the diagonal top left to bottom right, This will allow us to check all possible solutions for a win """ def threecheck(board): win=False #Top Left if board[0]!=0: #Row T-L to T-R ...
mit
xme1226/sahara
sahara/tests/unit/db/migration/test_migrations.py
2
13912
# Copyright 2014 OpenStack Foundation # Copyright 2014 Mirantis Inc # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ...
apache-2.0
napalm-automation/napalm-yang
napalm_yang/models/openconfig/network_instances/network_instance/protocols/protocol/ospfv2/areas/area/lsdb/lsa_types/lsa_type/lsas/lsa/opaque_lsa/extended_prefix/tlvs/tlv/state/__init__.py
1
27029
# -*- coding: utf-8 -*- from operator import attrgetter from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType from pyangbind.lib.yangtypes import RestrictedClassType from pyangbind.lib.yangtypes import TypedListType from pyangbind.lib.yangtypes import YANGBool from pyangbind.lib.yangtypes import YANGListTy...
apache-2.0
atosorigin/ansible
test/support/windows-integration/plugins/modules/win_lineinfile.py
68
7333
#!/usr/bin/python # -*- coding: utf-8 -*- # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'community'} DOCUMENTATION = r''' --- module: win_linein...
gpl-3.0
caser789/xuejiao-blog
app/api_1_0/posts.py
1
1747
from flask import jsonify, request, g, abort, url_for, current_app from .. import db from ..models import Post, Permission from . import api from .decorators import permission_required from .errors import forbidden @api.route('/posts/') def get_posts(): page = request.args.get('page', 1, type=int) pagination =...
mit
wbyne/QGIS
python/plugins/processing/algs/qgis/HypsometricCurves.py
2
8209
# -*- coding: utf-8 -*- """ *************************************************************************** HypsometricCurves.py --------------------- Date : November 2014 Copyright : (C) 2014 by Alexander Bruy Email : alexander dot bruy at gmail dot com ******...
gpl-2.0
docker/docker-py
tests/integration/api_swarm_test.py
4
9438
import copy import docker import pytest from ..helpers import force_leave_swarm, requires_api_version from .base import BaseAPIIntegrationTest class SwarmTest(BaseAPIIntegrationTest): def setUp(self): super(SwarmTest, self).setUp() force_leave_swarm(self.client) self._unlock_key = None ...
apache-2.0
sstruct/flasky
tests/test_api.py
23
10686
import unittest import json import re from base64 import b64encode from flask import url_for from app import create_app, db from app.models import User, Role, Post, Comment class APITestCase(unittest.TestCase): def setUp(self): self.app = create_app('testing') self.app_context = self.app.app_conte...
mit
codingforfun/Olena-Mirror
swilena/python/box2d-misc.py
2
1329
#! /usr/bin/env python # Copyright (C) 2009 EPITA Research and Development Laboratory (LRDE) # # This file is part of Olena. # # Olena 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 of the License....
gpl-2.0
Beauhurst/django
django/contrib/admin/migrations/0001_initial.py
95
1893
import django.contrib.admin.models from django.conf import settings from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ('contenttypes', '__first__'), ] operations = [ migratio...
bsd-3-clause
vadimtk/chrome4sdp
tools/telemetry/telemetry/internal/platform/power_monitor/msr_power_monitor_unittest.py
24
1071
# Copyright 2014 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 logging import time import unittest from telemetry import decorators from telemetry.internal.platform.power_monitor import msr_power_monitor from tel...
bsd-3-clause
alexallah/django
django/forms/widgets.py
1
35356
""" HTML Widget classes """ import copy import datetime import re from itertools import chain from django.conf import settings from django.forms.utils import to_current_timezone from django.templatetags.static import static from django.utils import datetime_safe, formats from django.utils.dates import MONTHS from dja...
bsd-3-clause
dcramer/django-compositepks
django/db/models/fields/related.py
13
42537
from django.db import connection, transaction from django.db.models import signals, get_model from django.db.models.fields import AutoField, Field, IntegerField, PositiveIntegerField, PositiveSmallIntegerField, FieldDoesNotExist from django.db.models.related import RelatedObject from django.db.models.query import Query...
bsd-3-clause
Agana/MyBlogAgain
django/utils/synch.py
376
2549
""" Synchronization primitives: - reader-writer lock (preference to writers) (Contributed to Django by eugene@lazutkin.com) """ try: import threading except ImportError: import dummy_threading as threading class RWLock: """ Classic implementation of reader-writer lock with preference to writers....
bsd-3-clause
fernandezcuesta/ansible
contrib/inventory/openstack.py
64
8980
#!/usr/bin/env python # Copyright (c) 2012, Marco Vito Moscaritolo <marco@agavee.com> # Copyright (c) 2013, Jesse Keating <jesse.keating@rackspace.com> # Copyright (c) 2015, Hewlett-Packard Development Company, L.P. # Copyright (c) 2016, Rackspace Australia # # This module is free software: you can redistribute it and...
gpl-3.0
mogoweb/chromium-crosswalk
chrome/test/mini_installer/file_verifier.py
125
1116
# 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. import os import verifier class FileVerifier(verifier.Verifier): """Verifies that the current files match the expectation dictionaries.""" def _Verif...
bsd-3-clause
AmesianX/amoco
amoco/arch/arm/v8/asm64.py
6
15185
# -*- coding: utf-8 -*- # This code is part of Amoco # Copyright (C) 2013 Axel Tillequin (bdcht3@gmail.com) # published under GPLv2 license from amoco.logger import Log logger = Log(__name__) from .env64 import * from .utils import * from amoco.cas.utils import * def i_ADC(i,fmap): fmap[pc] = fmap[pc]+i.length ...
gpl-2.0
akirk/youtube-dl
youtube_dl/extractor/folketinget.py
92
2651
# -*- coding: utf-8 -*- from __future__ import unicode_literals from .common import InfoExtractor from ..compat import compat_parse_qs from ..utils import ( int_or_none, parse_duration, parse_iso8601, xpath_text, ) class FolketingetIE(InfoExtractor): IE_DESC = 'Folketinget (ft.dk; Danish parliame...
unlicense
leemac/JellyfishRss
rss/migrations/0001_initial.py
1
8815
# -*- coding: utf-8 -*- from south.utils import datetime_utils as 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 'Folder' db.create_table(u'rss_folder', ( (u'i...
mit
evilpie/servo
tests/wpt/css-tests/tools/html5lib/html5lib/treebuilders/dom.py
920
8469
from __future__ import absolute_import, division, unicode_literals from xml.dom import minidom, Node import weakref from . import _base from .. import constants from ..constants import namespaces from ..utils import moduleFactoryFactory def getDomBuilder(DomImplementation): Dom = DomImplementation class A...
mpl-2.0
guarddogofww/cs108test
src/jarabe/model/shell.py
3
28033
# Copyright (C) 2006-2007 Owen Williams. # Copyright (C) 2006-2008 Red Hat, 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 late...
gpl-3.0
cwisecarver/osf.io
addons/dropbox/migrations/0001_initial.py
28
1508
# -*- coding: utf-8 -*- # Generated by Django 1.9 on 2017-03-23 20:34 from __future__ import unicode_literals from django.db import migrations, models import osf.models.base import osf.utils.datetime_aware_jsonfield class Migration(migrations.Migration): initial = True dependencies = [ ] operation...
apache-2.0
nuagenetworks/vspk-python
vspk/v5_0/numacfilterprofile.py
1
7688
# -*- coding: utf-8 -*- # # Copyright (c) 2015, Alcatel-Lucent Inc, 2017 Nokia # 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 copyrigh...
bsd-3-clause
teeple/pns_server
work/install/Python-2.7.4/Lib/lib2to3/fixes/fix_itertools.py
148
1549
""" Fixer for itertools.(imap|ifilter|izip) --> (map|filter|zip) and itertools.ifilterfalse --> itertools.filterfalse (bugs 2360-2363) imports from itertools are fixed in fix_itertools_import.py If itertools is imported as something else (ie: import itertools as it; it.izip(spam, eggs)) method calls w...
gpl-2.0
benchisell/photostream-bc
flask/lib/python2.7/site-packages/migrate/versioning/schemadiff.py
52
8741
""" Schema differencing support. """ import logging import sqlalchemy from sqlalchemy.types import Float log = logging.getLogger(__name__) def getDiffOfModelAgainstDatabase(metadata, engine, excludeTables=None): """ Return differences of model against database. :return: object which will evaluate to...
bsd-3-clause
bguillot/OpenUpgrade
addons/sale/sale.py
17
67360
# -*- 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
mmalorni/server-tools
__unported__/fetchmail_attach_from_folder/match_algorithm/email_domain.py
6
1985
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # This module copyright (C) 2013 Therp BV (<http://therp.nl>) # All Rights Reserved # # This program is free software: you can redistribute it and/or modify #...
agpl-3.0
e9wifi-dev/android_kernel_lge_e9wifi-test
tools/perf/scripts/python/syscall-counts.py
11181
1522
# system call counts # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Displays system-wide system call totals, broken down by syscall. # If a [comm] arg is specified, only syscalls called by [comm] are displayed. import os import sys sys.path.append(os.envir...
gpl-2.0
loco-odoo/localizacion_co
openerp/addons/crm_partner_assign/report/crm_partner_report.py
264
3374
# -*- 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
fuselock/odoo
addons/email_template/wizard/email_template_preview.py
377
3851
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2009 Sharoon Thomas # Copyright (C) 2010-Today OpenERP SA (<http://www.openerp.com>) # # This program is free software: you can redistribute it ...
agpl-3.0
fronzbot/blinkpy
blinkpy/blinkpy.py
1
13098
# -*- coding: utf-8 -*- """ blinkpy is an unofficial api for the Blink security camera system. repo url: https://github.com/fronzbot/blinkpy Original protocol hacking by MattTW : https://github.com/MattTW/BlinkMonitorProtocol Published under the MIT license - See LICENSE file for more details. "Blink Wire-Free HS Ho...
mit
butchman0922/gourmet
gourmet/plugins/import_export/plaintext_plugin/plaintext_importer_plugin.py
6
2087
from gourmet.plugin import ImporterPlugin from gourmet.importers.importer import Tester from gourmet.threadManager import get_thread_manager from gourmet.importers.interactive_importer import InteractiveImporter from gourmet import check_encodings import os.path import fnmatch from gettext import gettext as _ MAX_PLAI...
gpl-2.0
GbalsaC/bitnamiP
lms/djangoapps/notes/models.py
100
3156
from django.db import models from django.contrib.auth.models import User from django.core.urlresolvers import reverse from django.core.exceptions import ValidationError from django.utils.html import strip_tags import json from xmodule_django.models import CourseKeyField class Note(models.Model): user = models.Fo...
agpl-3.0
IllusionRom-deprecated/android_platform_external_chromium_org
tools/telemetry/telemetry/page/actions/click_element_unittest.py
23
3183
# 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. from telemetry.core import util from telemetry.page.actions import click_element from telemetry.page.actions import wait from telemetry.unittest import t...
bsd-3-clause
vlegoff/tsunami
src/secondaires/crafting/commandes/__init__.py
1
1676
# -*-coding:Utf-8 -* # Copyright (c) 2010-2017 LE GOFF Vincent # 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 # ...
bsd-3-clause
airqj/ardupilot-raspilot
Tools/autotest/arducopter.py
39
44394
# fly ArduCopter in SITL # Flight mode switch positions are set-up in arducopter.param to be # switch 1 = Circle # switch 2 = Land # switch 3 = RTL # switch 4 = Auto # switch 5 = Loiter # switch 6 = Stabilize import util, pexpect, sys, time, math, shutil, os from common import * from pymavlink import mavut...
gpl-3.0
pap/nupic
tests/unit/nupic/support/consoleprinter_test/consoleprinter_test.py
34
2887
#!/usr/bin/env python # ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2014, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions ...
agpl-3.0
ritchyteam/odoo
addons/l10n_fr_hr_payroll/__openerp__.py
374
2165
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2011 OpenERP SA (<http://openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the G...
agpl-3.0
pgleeson/TestArea
templates/clusterUtils/pullallsims.py
5
1714
# -*- coding: utf-8 -*- ''' This file can be placed in the simulations directory of a neuroConstruct project and when run it will search in all subdirectories for time.dat, and if it doesn't find it, will try running pullsim.sh, which will attempt to retrieve the saved data from a remotely executed simulation ''' im...
gpl-2.0
vitan/hue
desktop/core/ext-py/Django-1.6.10/docs/_ext/applyxrefs.py
132
1842
"""Adds xref targets to the top of files.""" import sys import os testing = False DONT_TOUCH = ( './index.txt', ) def target_name(fn): if fn.endswith('.txt'): fn = fn[:-4] return '_' + fn.lstrip('./').replace('/', '-') def process_file(fn, lines): lines.insert(0, '\n') lines...
apache-2.0
gohin/django
django/http/cookie.py
460
4390
from __future__ import unicode_literals import sys from django.utils import six from django.utils.encoding import force_str from django.utils.six.moves import http_cookies # Some versions of Python 2.7 and later won't need this encoding bug fix: _cookie_encodes_correctly = http_cookies.SimpleCookie().value_encode(';...
bsd-3-clause
witcxc/libpinyin
scripts/pinyin.py
2
13821
# -*- coding: utf-8 -*- # vim:set et sts=4 sw=4: # # libpinyin - Library to deal with pinyin. # # Copyright (c) 2007-2008 Peng Huang <shawn.p.huang@gmail.com> # Copyright (C) 2011 Peng Wu <alexepico@gmail.com> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU Gener...
gpl-2.0
widgetpl/contrib
hack/verify-flags-underscore.py
34
8924
#!/usr/bin/env python # Copyright 2015 The Kubernetes Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
apache-2.0
saimn/astropy
astropy/nddata/_testing.py
11
1605
# Licensed under a 3-clause BSD style license - see LICENSE.rst """Testing utilities. Not part of the public API!""" from astropy.wcs import WCS from astropy.wcs.wcsapi import BaseHighLevelWCS def assert_wcs_seem_equal(wcs1, wcs2): """Just checks a few attributes to make sure wcs instances seem to be equal. ...
bsd-3-clause
mascot6699/Hackapi-Demo
src/core/views.py
1
1412
from . import models, serializers, utils from datetime import datetime, timedelta from rest_framework.views import APIView from rest_framework.response import Response from rest_framework import status, permissions class Process(APIView): """ These apis are for general purpose """ def get(self, re...
mit
altaf-ali/luigi
test/scheduler_visualisation_test.py
49
13542
# -*- coding: utf-8 -*- # # Copyright 2012-2015 Spotify AB # # 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...
apache-2.0
uwevil/namebench
libnamebench/selectors.py
176
3262
#!/usr/bin/env python # Copyright 2009 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...
apache-2.0
TiVoMaker/boto
tests/integration/ec2/autoscale/test_cert_verification.py
126
1575
# Copyright (c) 2012 Mitch Garnaat http://garnaat.org/ # Copyright (c) 2012 Amazon.com, Inc. or its affiliates. # All rights reserved. # # 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 withou...
mit
asutherland/opc-reviewboard
contrib/internal/release.py
1
1785
#!/usr/bin/env python # # Performs a release of Review Board. This can only be run by the core # developers with release permissions. # import os import re import subprocess import sys sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..", "..")) from reviewboard import get_package_version, VERSION PY_VER...
mit
frenkowski/Tyrannus_Kernel_MM_SM-G925F
tools/perf/scripts/python/failed-syscalls-by-pid.py
11180
2058
# failed system call counts, by pid # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Displays system-wide failed system call totals, broken down by pid. # If a [comm] arg is specified, only syscalls called by [comm] are displayed. import os import sys sys.pa...
gpl-2.0
sliz1/servo
tests/wpt/css-tests/css-text-decor-3_dev/xhtml1print/support/generate-text-emphasis-line-height-tests.py
829
3431
#!/usr/bin/env python # - * - coding: UTF-8 - * - """ This script generates tests text-emphasis-line-height-001 ~ 004 except 001z. They test the line height expansion in different directions. This script outputs a list of all tests it generated in the format of Mozilla reftest.list to the stdout. """ from __future__ ...
mpl-2.0
tordans/volunteer_planner
scheduler/management/commands/calculate_volunteer_hours.py
3
1164
# coding: utf-8 import datetime from django.core.management.base import BaseCommand from registration.models import RegistrationProfile from stats.models import ValueStore class Command(BaseCommand): help = 'creates bulk shifts from existing data' args = "" option_list = BaseCommand.option_list d...
agpl-3.0
syedjafri/ThinkStats2
code/chap02soln.py
69
2263
"""This file contains code for use with "Think Stats", by Allen B. Downey, available from greenteapress.com Copyright 2014 Allen B. Downey License: GNU GPLv3 http://www.gnu.org/licenses/gpl.html """ from __future__ import print_function import sys from operator import itemgetter import first import thinkstats2 de...
gpl-3.0
guilhermegm/django-tastypie
tests/core/tests/paginator.py
25
11701
# -*- coding: utf-8 -*- from django.conf import settings from django.test import TestCase from tastypie.exceptions import BadRequest from tastypie.paginator import Paginator from core.models import Note from core.tests.resources import NoteResource from django.db import reset_queries from django.http import QueryDict ...
bsd-3-clause
wroersma/volatility
volatility/scan.py
14
6848
# Volatility # Copyright (C) 2007-2013 Volatility Foundation # # Derived from source in PyFlag developed by: # Copyright 2004: Commonwealth of Australia. # Michael Cohen <scudette@users.sourceforge.net> # David Collett <daveco@users.sourceforge.net> # # This file is part of Volatility. # # Volatility is free software;...
gpl-2.0
hasecbinusr/pysal
pysal/esda/tests/test_geary.py
5
2997
"""Geary Unittest.""" import unittest from ... import open as popen from ... import examples from .. import geary import numpy as np from ...common import pandas PANDAS_EXTINCT = pandas is None class Geary_Tester(unittest.TestCase): """Geary class for unit tests.""" def setUp(self): self.w = popen(ex...
bsd-3-clause
peterbarker/ardupilot-1
Tools/LogAnalyzer/DataflashLog.py
17
29790
# # Code to abstract the parsing of APM Dataflash log files, currently only used by the LogAnalyzer # # Initial code by Andrew Chapman (amchapman@gmail.com), 16th Jan 2014 # from __future__ import print_function import collections import os import numpy import bisect import sys import ctypes from VehicleType import V...
gpl-3.0
DazWorrall/zulip
zilencer/management/commands/profile_request.py
117
1632
from __future__ import absolute_import from optparse import make_option from django.core.management.base import BaseCommand from zerver.models import get_user_profile_by_email, UserMessage from zerver.views.old_messages import get_old_messages_backend import cProfile import logging from zerver.middleware import LogReq...
apache-2.0
hellotomfan/v8-coroutine
build/gyp/test/library/gyptest-shared-obj-install-path.py
289
1180
#!/usr/bin/env python # Copyright (c) 2012 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 that .so files that are order only dependencies are specified by their install location rather than by their alias. """ # Pyth...
gpl-2.0
jereze/scikit-learn
sklearn/preprocessing/data.py
68
57385
# Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr> # Mathieu Blondel <mathieu@mblondel.org> # Olivier Grisel <olivier.grisel@ensta.org> # Andreas Mueller <amueller@ais.uni-bonn.de> # Eric Martin <eric@ericmart.in> # License: BSD 3 clause from itertools import chain, combina...
bsd-3-clause
TNT-Samuel/Coding-Projects
DNS Server/Source/Lib/site-packages/pygments/console.py
27
1809
# -*- coding: utf-8 -*- """ pygments.console ~~~~~~~~~~~~~~~~ Format colored console output. :copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ esc = "\x1b[" codes = {} codes[""] = "" codes["reset"] = esc + "39;49;00m" codes["bold"] = ...
gpl-3.0
aruppen/xwot.py
xwot/device/lightbulb.py
1
4704
#!/usr/bin/env python # -*- coding: utf-8 -*- # # xwot.py - Python tools for the extended Web of Things # Copyright (C) 2015 Alexander Rüedlinger # # 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 Foundatio...
gpl-3.0
pquerna/cloud-init-debian-pkg-dead
cloudinit/config/cc_disk_setup.py
6
25274
# vi: ts=4 expandtab # # Copyright (C) 2009-2010 Canonical Ltd. # Copyright (C) 2012 Hewlett-Packard Development Company, L.P. # # Author: Ben Howard <ben.howard@canonical.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License ...
gpl-3.0
DESHRAJ/fjord
vendor/packages/translate-toolkit/translate/tools/test_pretranslate.py
3
14236
#!/usr/bin/env python # -*- coding: utf-8 -*- import warnings from pytest import mark from translate.tools import pretranslate from translate.convert import test_convert from translate.misc import wStringIO from translate.storage import po from translate.storage import xliff class TestPretranslate: xliff_skele...
bsd-3-clause
lombritz/odoo
addons/base_report_designer/plugin/openerp_report_designer/bin/script/compile_all.py
384
1193
######################################################################### # # Copyright (c) 2003-2004 Danny Brewer d29583@groovegarden.com # Copyright (C) 2004-2010 OpenERP SA (<http://openerp.com>). # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser Gene...
agpl-3.0
40423136/2016fallcadp_hw
plugin/liquid_tags/audio.py
277
2161
""" Audio Tag --------- This implements a Liquid-style audio tag for Pelican, based on the pelican video plugin [1]_ Syntax ------ {% audio url/to/audio [url/to/audio] [/url/to/audio] %} Example ------- {% audio http://example.tld/foo.mp3 http://example.tld/foo.ogg %} Output ------ <audio controls><source src="http:...
agpl-3.0
caisq/tensorflow
tensorflow/contrib/gan/python/features/python/random_tensor_pool.py
55
1552
# Copyright 2017 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
sukwon0709/equip
equip/rewriter/simple.py
1
11974
# -*- coding: utf-8 -*- """ equip.rewriter.simple ~~~~~~~~~~~~~~~~~~~~~ A simplified interface (yet the main one) to handle the injection of instrumentation code. :copyright: (c) 2014 by Romain Gaucher (@rgaucher) :license: Apache 2, see LICENSE for more details. """ import os import copy from ..utils.lo...
apache-2.0
ioos/compliance-checker
compliance_checker/tests/test_feature_detection.py
2
31793
#!/usr/bin/env python # -*- coding: utf-8 -*- """ compliance_checker/tests/test_feature_detection.py """ from unittest import TestCase from netCDF4 import Dataset from compliance_checker import cfutil as util from compliance_checker.tests import resources from compliance_checker.tests.helpers import MockRaggedArrayR...
apache-2.0
wilebeast/FireFox-OS
B2G/external/wpa_supplicant_8/wpa_supplicant/examples/wpas-dbus-new-wps.py
114
2221
#!/usr/bin/python import dbus import sys, os import time import gobject from dbus.mainloop.glib import DBusGMainLoop WPAS_DBUS_SERVICE = "fi.w1.wpa_supplicant1" WPAS_DBUS_INTERFACE = "fi.w1.wpa_supplicant1" WPAS_DBUS_OPATH = "/fi/w1/wpa_supplicant1" WPAS_DBUS_INTERFACES_INTERFACE = "fi.w1.wpa_supplicant1.Interface" ...
apache-2.0
jtyr/ansible-modules-extras
messaging/rabbitmq_queue.py
29
9468
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2015, Manuel Sousa <manuel.sousa@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...
gpl-3.0
hujiajie/chromium-crosswalk
tools/telemetry/telemetry/internal/backends/android_command_line_backend_unittest.py
13
3617
# 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. import logging import unittest from telemetry import decorators from telemetry.internal.backends import android_command_line_backend from telemetry.testing ...
bsd-3-clause
Cinntax/home-assistant
homeassistant/components/lcn/scene.py
7
2167
"""Support for LCN scenes.""" import pypck from homeassistant.components.scene import Scene from homeassistant.const import CONF_ADDRESS from . import LcnDevice from .const import ( CONF_CONNECTIONS, CONF_OUTPUTS, CONF_REGISTER, CONF_SCENE, CONF_TRANSITION, DATA_LCN, OUTPUT_PORTS, ) from ....
apache-2.0
Ultimaker/Uranium
plugins/FileHandlers/STLWriter/STLWriter.py
1
5501
# Copyright (c) 2016 Ultimaker B.V. # Copyright (c) 2013 David Braam # Uranium is released under the terms of the LGPLv3 or higher. import struct import time from UM.Logger import Logger from UM.Mesh.MeshWriter import MeshWriter from UM.i18n import i18nCatalog catalog = i18nCatalog("uranium") class STLWriter(MeshWr...
lgpl-3.0
kevinwilde/WildeBot
src/mybot/Lib/site-packages/requests/packages/chardet/chardetect.py
1786
2504
#!/usr/bin/env python """ Script which takes one or more file paths and reports on their detected encodings Example:: % chardetect somefile someotherfile somefile: windows-1252 with confidence 0.5 someotherfile: ascii with confidence 1.0 If no paths are provided, it takes its input from stdin. """ from...
mit
dati91/servo
tests/wpt/web-platform-tests/xhr/resources/access-control-basic-preflight-cache.py
46
1709
def main(request, response): def fail(message): response.content = "FAIL " + request.method + ": " + str(message) response.status = 400 def getState(token): server_state = request.server.stash.take(token) if not server_state: return "Uninitialized" return ser...
mpl-2.0
magnushiie/geopy
geopy/format.py
24
3013
""" Formatting... """ from geopy import units from geopy.compat import py3k if py3k: unichr = chr # pylint: disable=W0622 # Unicode characters for symbols that appear in coordinate strings. DEGREE = unichr(176) PRIME = unichr(8242) DOUBLE_PRIME = unichr(8243) ASCII_DEGREE = '' ASCII_PRIME = "'" ASCII_DOUBLE_PRIM...
mit
tkaitchuck/nupic
external/darwin64/lib/python2.6/site-packages/numpy/core/tests/test_errstate.py
23
1783
# The following exec statement (or something like it) is needed to # prevent SyntaxError on Python < 2.5. Even though this is a test, # SyntaxErrors are not acceptable; on Debian systems, they block # byte-compilation during install and thus cause the package to fail # to install. import sys if sys.version_info[:2] >=...
gpl-3.0
boone/ansible-modules-core
cloud/rackspace/rax_scaling_policy.py
157
9070
#!/usr/bin/python # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distributed...
gpl-3.0
uni-peter-zheng/tp-libvirt
libvirt/tests/src/virsh_cmd/host/virsh_capabilities.py
7
5687
import logging import re from autotest.client.shared import utils, error from autotest.client import os_dep from virttest import libvirt_vm, virsh, utils_libvirtd, utils_misc from virttest.libvirt_xml import capability_xml def run(test, params, env): """ Test the command virsh capabilities (1) Call virsh...
gpl-2.0
CasparLi/calibre
src/calibre/ebooks/pdf/render/engine.py
10
14304
#!/usr/bin/env python2 # vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:fdm=marker:ai from __future__ import (unicode_literals, division, absolute_import, print_function) __license__ = 'GPL v3' __copyright__ = '2012, Kovid Goyal <kovid at kovidgoyal.net>' __docformat__ = 'restructuredtext en' ...
gpl-3.0