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
arrow-/simQuad
ground_station/gyro_scope.py
2
5471
''' -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= IMPORTANT!! It is suggested you run this script with mpu_level2.ino first to see and understand its operation. Basically this script EXPECTS: Arduino is providing space separated gyro readings @ ~5ms intervals (via MPU Interrupt). * Ea...
gpl-2.0
tectronics/mythbox
resources/test/mythboxtest/mythtv/test_inject_conn.py
7
5223
# # MythBox for XBMC - http://mythbox.googlecode.com # Copyright (C) 2011 analogue@yahoo.com # # 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 yo...
gpl-2.0
dfunckt/django
tests/model_fields/test_decimalfield.py
49
2895
from decimal import Decimal from django.core import validators from django.core.exceptions import ValidationError from django.db import models from django.test import TestCase from .models import BigD, Foo class DecimalFieldTests(TestCase): def test_to_python(self): f = models.DecimalField(max_digits=4...
bsd-3-clause
jorik041/scikit-learn
doc/sphinxext/github_link.py
314
2661
from operator import attrgetter import inspect import subprocess import os import sys from functools import partial REVISION_CMD = 'git rev-parse --short HEAD' def _get_git_revision(): try: revision = subprocess.check_output(REVISION_CMD.split()).strip() except subprocess.CalledProcessError: ...
bsd-3-clause
hernandito/SickRage
sickbeard/providers/generic.py
1
26015
# coding=utf-8 # Author: Nic Wolfe <nic@wolfeden.ca> # URL: http://code.google.com/p/sickbeard/ # # This file is part of SickRage. # # SickRage 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 ...
gpl-3.0
ressu/SickGear
lib/hachoir_parser/audio/midi.py
90
7912
""" Musical Instrument Digital Interface (MIDI) audio file parser. Documentation: - Standard MIDI File Format, Dustin Caldwell (downloaded on wotsit.org) Author: Victor Stinner Creation: 27 december 2006 """ from lib.hachoir_parser import Parser from lib.hachoir_core.field import (FieldSet, Bits, ParserError, S...
gpl-3.0
uzumaxy/pyprimes
src/pyprimes/strategic.py
3
5593
# -*- coding: utf-8 -*- ## Part of the pyprimes.py package. ## ## Copyright © 2014 Steven D'Aprano. ## See the file __init__.py for the licence terms for this software. """The module implements various prime generating and testing functions using the Strategy design pattern, allowing the caller to easily experimen...
mit
diefans/ferment
src/ferment/scripts.py
1
2313
import click import docker from wheezy.template.engine import Engine from wheezy.template.ext.core import CoreExtension from wheezy.template.ext.code import CodeExtension from wheezy.template.loader import DictLoader from . import templates import logging LOG = logging.getLogger(__name__) LOG_LEVELS = { "info...
apache-2.0
tedsunnyday/SE-Server
server/lib/passlib/utils/pbkdf2.py
23
14682
"""passlib.pbkdf2 - PBKDF2 support this module is getting increasingly poorly named. maybe rename to "kdf" since it's getting more key derivation functions added. """ #============================================================================= # imports #==============================================================...
apache-2.0
eclee25/flu-SDI-exploratory-age
scripts/create_fluseverity_figs/export_zOR_classif.py
1
10068
#!/usr/bin/python ############################################## ###Python template ###Author: Elizabeth Lee ###Date: 6/18/14 ###Function: Export zOR retrospective and early warning classifications into csv file format (SDI and ILINet, national and regional for SDI) ### Use nation-level peak-based retrospective classi...
mit
kamenim/samba-old
python/samba/descriptor.py
36
27268
# Unix SMB/CIFS implementation. # backend code for provisioning a Samba4 server # Copyright (C) Jelmer Vernooij <jelmer@samba.org> 2007-2010 # Copyright (C) Andrew Bartlett <abartlet@samba.org> 2008-2009 # Copyright (C) Oliver Liebel <oliver@itc.li> 2008-2009 # Copyright (C) Amitay Isaacs <amitay@samba.org> 2011 # # ...
gpl-3.0
anorfleet/kaggle-titanic
Python Examples/agc_embark_class_gender.py
6
3506
# A model for prediction survival on the Titanic based on where an # individual Embarked, their gender, or the class they traveled in. # AGC 2013 # # # Here Will will run generate predictions of who survived and who did not # from our basic Least Squares Regression model. # Our Formula is : # survived_prediction = ...
apache-2.0
DVSBA/ajenti
ajenti/plugins/recovery/main.py
17
4216
from ajenti.api import * from ajenti.ui import * from api import Manager class RecoveryPlugin(CategoryPlugin): text = 'Recovery' icon = '/dl/recovery/icon.png' folder = 'bottom' def on_init(self): self.manager = Manager(self.app) self.providers = self.app.grab_plugins(IConfigurable) ...
lgpl-3.0
yanheven/neutron
neutron/tests/tempest/common/generator/valid_generator.py
34
2931
# Copyright 2014 Deutsche Telekom AG # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requi...
apache-2.0
geky/mbed
tools/host_tests/host_tests_plugins/module_reset_mps2.py
73
2576
""" mbed SDK Copyright (c) 2011-2013 ARM Limited 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 wr...
apache-2.0
pbrod/scipy
scipy/io/mmio.py
23
27443
""" Matrix Market I/O in Python. See http://math.nist.gov/MatrixMarket/formats.html for information about the Matrix Market format. """ # # Author: Pearu Peterson <pearu@cens.ioc.ee> # Created: October, 2004 # # References: # http://math.nist.gov/MatrixMarket/ # from __future__ import division, print_function, a...
bsd-3-clause
RoboCupULaval/StrategyIA
ai/GameDomainObjects/ball.py
1
1041
# Under MIT License, see LICENSE.txt from typing import Dict from Util import Position class Ball: def __init__(self, position=Position()): self._position = position self._velocity = Position() def update(self, new_dict: Dict): self.position = new_dict['position'] self.velo...
mit
dkubiak789/odoo
addons/website_blog/__init__.py
373
1036
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2013-Today OpenERP SA (<http://www.openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms ...
agpl-3.0
GhostThrone/django
tests/gis_tests/distapp/tests.py
5
34623
from __future__ import unicode_literals from django.contrib.gis.db.models.functions import ( Area, Distance, Length, Perimeter, Transform, ) from django.contrib.gis.geos import GEOSGeometry, LineString, Point from django.contrib.gis.measure import D # alias for Distance from django.db import connection from djang...
bsd-3-clause
archetipo/stock-logistics-workflow
stock_picking_backorder_strategy/models/stock.py
15
1995
# -*- coding: utf-8 -*- ############################################################################## # # Authors: Laetitia Gangloff # Copyright (c) 2015 Acsone SA/NV (http://www.acsone.eu) # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero Gener...
agpl-3.0
aliyun/oss-ftp
python27/win32/Lib/email/iterators.py
415
2202
# Copyright (C) 2001-2006 Python Software Foundation # Author: Barry Warsaw # Contact: email-sig@python.org """Various types of useful iterators and generators.""" __all__ = [ 'body_line_iterator', 'typed_subpart_iterator', 'walk', # Do not include _structure() since it's part of the debugging API. ...
mit
LIS/lis-tempest
tempest/tests/lib/services/compute/test_server_groups_client.py
3
3290
# Copyright 2015 IBM Corp. # # 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 t...
apache-2.0
ericbaze/continuum_code_2012
pydata/moin/pythonenv/local/lib/python2.7/encodings/iso8859_11.py
593
12591
""" Python Character Mapping Codec iso8859_11 generated from 'MAPPINGS/ISO8859/8859-11.TXT' with gencodec.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_table) def decode(self,input,errors...
gpl-2.0
bdoner/SickRage
sickbeard/subtitles.py
3
10951
# Author: Nyaran <nyayukko@gmail.com>, based on Antoine Bertin <diaoulael@gmail.com> work # URL: http://code.google.com/p/sickbeard/ # # This file is part of SickRage. # # SickRage 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 S...
gpl-3.0
shahar-stratoscale/nova
nova/tests/objects/test_network.py
10
8757
# Copyright 2014 Red Hat, 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 a...
apache-2.0
zchking/odoo
addons/payment_buckaroo/controllers/main.py
325
1270
# -*- coding: utf-8 -*- try: import simplejson as json except ImportError: import json import logging import pprint import werkzeug from openerp import http, SUPERUSER_ID from openerp.http import request _logger = logging.getLogger(__name__) class BuckarooController(http.Controller): _return_url = '/pa...
agpl-3.0
RogerRueegg/lvw-young-talents
src/profiles/views.py
1
2796
from __future__ import unicode_literals from django.views import generic from django.shortcuts import get_object_or_404, redirect from django.contrib import messages from django.contrib.auth.mixins import LoginRequiredMixin from . import forms from . import models import datetime class ShowProfile(LoginRequiredMixin,...
mit
hsluo/youtube-dl
youtube_dl/extractor/rtvnh.py
84
1589
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor from ..utils import ExtractorError class RTVNHIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?rtvnh\.nl/video/(?P<id>[0-9]+)' _TEST = { 'url': 'http://www.rtvnh.nl/video/131946', 'md5': '6e1d0ab079e...
unlicense
wcb2/wcb2
docs/ekg2book/txt2docbook.py
2
7088
#!/usr/bin/python # -*- encoding: iso-8859-2 -*- import re import sys import getopt msg_session_vars = "Zmienne sesyjne" msg_vars = "Zmienne" msg_commands = "Polecenia" str_type = "typ" msg_type = "Typ" str_def_val = "domy¶lna warto¶æ" msg_def_val = "Domy¶lna warto¶æ" str_params = "parametry" msg_params = "Parametry"...
gpl-2.0
adoosii/edx-platform
cms/djangoapps/xblock_config/migrations/0001_initial.py
110
4856
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'StudioConfig' db.create_table('xblock_config_studioconfig', ( ('id', self.gf('dj...
agpl-3.0
Erotemic/ibeis
super_setup.py
1
26677
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Requirements: pip install gitpython click ubelt """ import re from os.path import exists from os.path import join from os.path import dirname from os.path import abspath import ubelt as ub import functools class ShellException(Exception): """ Raised when s...
apache-2.0
Zlash65/erpnext
erpnext/accounts/doctype/accounting_dimension/test_accounting_dimension.py
6
3500
# -*- coding: utf-8 -*- # Copyright (c) 2019, Frappe Technologies Pvt. Ltd. and Contributors # See license.txt from __future__ import unicode_literals import frappe import unittest from erpnext.accounts.doctype.sales_invoice.test_sales_invoice import create_sales_invoice from erpnext.accounts.doctype.journal_entry.tes...
gpl-3.0
caseylucas/ansible-modules-core
commands/command.py
6
8459
#!/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
xbmc/atv2
xbmc/lib/libPython/Python/Lib/plat-mac/lib-scriptpackages/Netscape/Required_suite.py
8
3414
"""Suite Required suite: Level 0, version 0 Generated from /Volumes/Sap/Applications (Mac OS 9)/Netscape Communicator\xe2\x84\xa2 Folder/Netscape Communicator\xe2\x84\xa2 AETE/AEUT resource version 1/0, language 0, script 0 """ import aetools import MacOS _code = 'reqd' from StdSuites.Required_Suite import * class ...
gpl-2.0
ToonTownInfiniteRepo/ToontownInfinite
toontown/toon/GroupPanel.py
1
18189
from direct.directnotify import DirectNotifyGlobal from toontown.toonbase import ToontownGlobals from toontown.toonbase import TTLocalizer from otp.nametag import NametagGlobals from direct.gui.DirectGui import * from pandac.PandaModules import * from direct.showbase import DirectObject from toontown.toon import ToonAv...
mit
carsonmcdonald/selenium
py/test/selenium/webdriver/common/form_handling_tests.py
65
9908
# Licensed to the Software Freedom Conservancy (SFC) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The SFC licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
apache-2.0
asadziach/tensorflow
tensorflow/python/debug/__init__.py
15
2169
# 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
futurulus/scipy
scipy/sparse/tests/test_extract.py
122
1388
"""test sparse matrix construction functions""" from __future__ import division, print_function, absolute_import from numpy.testing import TestCase, assert_equal from scipy.sparse import csr_matrix import numpy as np from scipy.sparse import extract class TestExtract(TestCase): def setUp(self): self.ca...
bsd-3-clause
kenorb/BitTorrent
twisted/conch/ui/ansi.py
2
7259
# Copyright (c) 2001-2004 Twisted Matrix Laboratories. # See LICENSE for details. # """Module to parse ANSI escape sequences Maintainer: U(Jean-Paul Calderone <exarkun@twistedmatrix.com> """ import string # Twisted imports from twisted.python import log class ColorText: """ Represents an element of text al...
gpl-3.0
nephomaniac/nephoria
nephoria/testcases/boto/ec2/network/net_tests_classic.py
1
95035
#!/usr/bin/python # Software License Agreement (BSD License) # # Copyright (c) 2009-2011, Eucalyptus Systems, Inc. # All rights reserved. # # Redistribution and use of this software in source and binary forms, with or # without modification, are permitted provided that the following conditions # are met: # # Redistri...
bsd-2-clause
ilastikdev/ilastik
ilastik/applets/dataSelection/dataLaneSummaryTableModel.py
4
7961
############################################################################### # ilastik: interactive learning and segmentation toolkit # # Copyright (C) 2011-2014, the ilastik developers # <team@ilastik.org> # # This program is free software; you can redistribute it and/or # mod...
gpl-3.0
endlessm/chromium-browser
third_party/chromite/scripts/cros_oobe_autoconfig_unittest.py
1
6578
# -*- coding: utf-8 -*- # Copyright 2018 The Chromium OS Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Unittests for cros_oobe_autoconfig.py""" from __future__ import print_function import json import os import pwd import sys f...
bsd-3-clause
AndroidOpenDevelopment/android_external_chromium_org
tools/memory_inspector/memory_inspector/core/symbol.py
107
1870
# 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. class Symbols(object): """A dictionary of symbols indexed by the key 'exec_path+0xoffset'.""" def __init__(self): self.symbols = {} # 'foo.so+0x12...
bsd-3-clause
dhuang/incubator-airflow
dags/test_dag.py
23
1333
# -*- coding: utf-8 -*- # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software ...
apache-2.0
Godmaster49/mtasa-blue
vendor/google-breakpad/src/testing/gtest/test/gtest_help_test.py
2968
5856
#!/usr/bin/env python # # Copyright 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...
gpl-3.0
coderbone/SickRage-alt
lib/bs4/tests/test_docs.py
607
1067
"Test harness for doctests." # pylint: disable-msg=E0611,W0142 __metaclass__ = type __all__ = [ 'additional_tests', ] import atexit import doctest import os #from pkg_resources import ( # resource_filename, resource_exists, resource_listdir, cleanup_resources) import unittest DOCTEST_FLAGS = ( doctes...
gpl-3.0
jonberliner/keras
keras/optimizers.py
1
7022
from __future__ import absolute_import import theano import theano.tensor as T import numpy as np from .utils.theano_utils import shared_zeros, shared_scalar from six.moves import zip def clip_norm(g, c, n): if c > 0: g = T.switch(T.ge(n, c), g * c / n, g) return g def kl_divergence(p, p_hat): ...
mit
dims/heat
heat/api/middleware/ssl.py
4
1575
# # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under...
apache-2.0
bgxavier/nova
nova/virt/vmwareapi/read_write_util.py
73
2238
# Copyright (c) 2011 Citrix Systems, Inc. # 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...
apache-2.0
SlimRoms/kernel_motorola_shamu
scripts/rt-tester/rt-tester.py
11005
5307
#!/usr/bin/python # # rt-mutex tester # # (C) 2006 Thomas Gleixner <tglx@linutronix.de> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as # published by the Free Software Foundation. # import os import sys import getopt import sh...
gpl-2.0
errikos/amtt
amtt/exporter/isograph/__init__.py
1
2915
"""Exporter module for Isograph Availability Workbench.""" import logging import networkx as nx from itertools import count from amtt.translator.ir import component_basename from amtt.exporter import Exporter from amtt.exporter.isograph.emitter.xml import XmlEmitter from amtt.exporter.isograph.rbd import Rbd from amtt...
gpl-3.0
catapult-project/catapult-csm
third_party/google-endpoints/cachetools/ttl.py
8
6050
import collections import time from .cache import Cache class _Link(object): __slots__ = ('key', 'expire', 'next', 'prev') def __init__(self, key=None, expire=None): self.key = key self.expire = expire def __reduce__(self): return _Link, (self.key, self.expire) def unlink(...
bsd-3-clause
corredD/upy
autodeskmaya/mayaHelper.py
1
118218
""" Copyright (C) <2010> Autin L. TSRI This file git_upy/autodeskmaya/mayaHelper.py is part of upy. upy 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, ...
gpl-3.0
phenoxim/nova
nova/tests/json_ref.py
1
2271
# 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 agreed to in...
apache-2.0
florentchandelier/keras
examples/mnist_irnn.py
70
3041
from __future__ import absolute_import from __future__ import print_function import numpy as np np.random.seed(1337) # for reproducibility from keras.datasets import mnist from keras.models import Sequential from keras.layers.core import Dense, Activation from keras.initializations import normal, identity from keras....
mit
noironetworks/nova
nova/scheduler/weights/__init__.py
95
1386
# Copyright (c) 2011 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 ...
apache-2.0
jathak/ok-client
demo/ok_test/tests/q1.py
2
1670
test = { 'name': 'Question 1', 'points': 3, 'suites': [ { 'type': 'concept', 'cases': [ { 'answer': 'Domain is numbers. Range is numbers', 'choices': [ 'Domain is numbers. Range is numbers', 'Domain is numbers. Range is strings', 'Dom...
apache-2.0
katrid/django
django/contrib/staticfiles/management/commands/collectstatic.py
149
13955
from __future__ import unicode_literals import os from collections import OrderedDict from django.contrib.staticfiles.finders import get_finders from django.contrib.staticfiles.storage import staticfiles_storage from django.core.files.storage import FileSystemStorage from django.core.management.base import BaseComman...
bsd-3-clause
sparkslabs/kamaelia_
Sketches/AM/KPIPackage/Kamaelia/Community/AM/Kamaelia/KPIFramework/KPI/Client/Authenticatee.py
3
8627
#!/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 Apach...
apache-2.0
UstadMobile/eXePUB
twisted/cred/error.py
19
2213
# Copyright (c) 2001-2004 Twisted Matrix Laboratories. # See LICENSE for details. """Cred errors.""" class Unauthorized(Exception): """Standard unauthorized error.""" class DuplicateIdentity(KeyError): """There already exists an identity with that name.""" # Descends from KeyError for backwards compatib...
gpl-2.0
rofehr/enigma2
lib/python/Components/Converter/ServiceTime.py
42
1119
from Converter import Converter from Components.Element import cached, ElementError from enigma import iServiceInformation class ServiceTime(Converter, object): STARTTIME = 0 ENDTIME = 1 DURATION = 2 def __init__(self, type): Converter.__init__(self, type) if type == "EndTime": self.type = self.ENDTIME e...
gpl-2.0
rversteegen/commandergenius
project/jni/python/src/Demo/comparisons/sortingtest.py
38
1374
#! /usr/bin/env python # 2) Sorting Test # # Sort an input file that consists of lines like this # # var1=23 other=14 ditto=23 fred=2 # # such that each output line is sorted WRT to the number. Order # of output lines does not change. Resolve collisions using the # variable name. e.g. # # ...
lgpl-2.1
alexthered/kienhoc-platform
common/lib/xmodule/xmodule/mixin.py
70
2601
""" Reusable mixins for XBlocks and/or XModules """ from xblock.fields import Scope, String, XBlockMixin # Make '_' a no-op so we can scrape strings. Using lambda instead of # `django.utils.translation.ugettext_noop` because Django cannot be imported in this file _ = lambda text: text class LicenseMixin(XBlockMixin...
agpl-3.0
hurrinico/account-invoice-reporting
__unported__/invoice_print_report_balance_payment/partner.py
11
1850
# -*- encoding: utf-8 -*- ############################################################################### # # OpenERP, Open Source Management Solution # Copyright (C) 2013 Savoir-faire Linux (<http://www.savoirfairelinux.com>). # # This program is free software: you can redistribute it and/or modify # it un...
agpl-3.0
pidah/st2contrib
packs/dimensiondata/actions/lib/actions.py
6
1043
from libcloud.compute.drivers.dimensiondata import DimensionDataNodeDriver from libcloud.loadbalancer.drivers.dimensiondata import DimensionDataLBDriver from dimensiondata_parsers import ResultSets from st2actions.runners.pythonrunner import Action __all__ = [ 'BaseAction', ] class BaseAction(Action): def _...
apache-2.0
dumbringer/ns-3-dev-ndnSIM
waf-tools/clang_compilation_database.py
99
1830
#!/usr/bin/env python # encoding: utf-8 # Christoph Koke, 2013 """ Writes the c and cpp compile commands into build/compile_commands.json see http://clang.llvm.org/docs/JSONCompilationDatabase.html Usage: def configure(conf): conf.load('compiler_cxx') ... conf.load('clang_compilation_data...
gpl-2.0
shubhdev/openedx
openedx/core/djangoapps/content/course_structures/models.py
6
2232
import json import logging from collections import OrderedDict from model_utils.models import TimeStampedModel from util.models import CompressedTextField from xmodule_django.models import CourseKeyField logger = logging.getLogger(__name__) # pylint: disable=invalid-name class CourseStructure(TimeStampedModel): ...
agpl-3.0
pombredanne/brisk-hadoop-common
src/examples/org/apache/hadoop/examples/terasort/job_history_summary.py
323
3444
#!/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 # "...
apache-2.0
SouWilliams/selenium
py/selenium/webdriver/firefox/webdriver.py
44
3810
# Licensed to the Software Freedom Conservancy (SFC) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The SFC licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
apache-2.0
jakirkham/bokeh
bokeh/core/property/tests/test_datetime.py
3
3301
#----------------------------------------------------------------------------- # Copyright (c) 2012 - 2018, Anaconda, Inc. All rights reserved. # # Powered by the Bokeh Development Team. # # The full license is in the file LICENSE.txt, distributed with this software. #---------------------------------------------------...
bsd-3-clause
polyval/CNC
flask/Lib/encodings/palmos.py
647
2936
""" Python Character Mapping Codec for PalmOS 3.5. Written by Sjoerd Mullender (sjoerd@acm.org); based on iso8859_15.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,inp...
apache-2.0
fnaum/rez
src/rez/vendor/amqp/basic_message.py
38
3954
"""Messages for AMQP""" # Copyright (C) 2007-2008 Barry Pederson <bp@barryp.org> # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option)...
lgpl-3.0
Insoleet/mirage
example.py
1
1205
import asyncio import logging from duniterpy.documents import BlockUID from mirage import Node, User async def example(lp): node = await Node.start(4444, "testnet", "12356", "123456", lp) alice = User.create("testnet", "alice", "alicesalt", "alicepassword", BlockUID.empty()) bob = User.create("testnet", "b...
gpl-3.0
claytantor/coinbase4py
webapp/settings.py
1
4533
import os from ConfigParser import RawConfigParser BASE_DIR = os.path.dirname(os.path.dirname(__file__)) PROJECT_DIR = os.path.dirname(__file__) CONF_DIR = os.path.dirname(os.path.dirname(os.path.dirname(__file__))) here = lambda x: os.path.join(os.path.abspath(os.path.dirname(__file__)), x) # you will need to copy...
apache-2.0
whitkirkchurch/baltimore
venv/lib/python2.7/site-packages/pip/_vendor/requests/structures.py
1160
2977
# -*- coding: utf-8 -*- """ requests.structures ~~~~~~~~~~~~~~~~~~~ Data structures that power Requests. """ import collections class CaseInsensitiveDict(collections.MutableMapping): """ A case-insensitive ``dict``-like object. Implements all methods and operations of ``collections.MutableMapping...
mit
lazaronixon/enigma2
lib/python/Tools/GetEcmInfo.py
23
3729
import os import time ECM_INFO = '/tmp/ecm.info' EMPTY_ECM_INFO = '','0','0','0' old_ecm_time = time.time() info = {} ecm = '' data = EMPTY_ECM_INFO class GetEcmInfo: def pollEcmData(self): global data global old_ecm_time global info global ecm try: ecm_time = os.stat(ECM_INFO).st_mtime except: ec...
gpl-2.0
KeplerGO/kadenza
setup.py
1
1430
#!/usr/bin/env python import os import sys from setuptools import setup # Prepare and send a new release to PyPI if "release" in sys.argv[-1]: os.system("python setup.py sdist") os.system("twine upload dist/*") os.system("rm -rf dist/kadenza*") sys.exit() # Load the __version__ variable without import...
mit
tclose/python-neo
neo/core/event.py
7
1955
# -*- coding: utf-8 -*- ''' This module defines :class:`Event`, an event occuring at a particular point in time. :class:`Event` derives from :class:`BaseNeo`, from :module:`neo.core.baseneo`. ''' # needed for python 3 compatibility from __future__ import absolute_import, division, print_function import quantities as...
bsd-3-clause
zephirefaith/AI_Fall15_Assignments
A2/lib/networkx/classes/graph.py
13
59103
"""Base class for undirected graphs. The Graph class allows any hashable object as a node and can associate key/value attribute pairs with each undirected edge. Self-loops are allowed but multiple edges are not (see MultiGraph). For directed graphs see DiGraph and MultiDiGraph. """ # Copyright (C) 2004-2015 by # ...
mit
ckuethe/gnuradio
gr-wxgui/python/wxgui/plot.py
74
71781
#----------------------------------------------------------------------------- # Name: wx.lib.plot.py # Purpose: Line, Bar and Scatter Graphs # # Author: Gordon Williams # # Created: 2003/11/03 # RCS-ID: $Id$ # Copyright: (c) 2002,2007,2010 # Licence: Use as you wish. #-------------------...
gpl-3.0
2014cdbg6/cdbg6
wsgi/static/Brython2.1.0-20140419-113919/Lib/_sre.py
54
51333
# NOT_RPYTHON """ A pure Python reimplementation of the _sre module from CPython 2.4 Copyright 2005 Nik Haldimann, licensed under the MIT license This code is based on material licensed under CNRI's Python 1.6 license and copyrighted by: Copyright (c) 1997-2001 by Secret Labs AB """ MAXREPEAT = 2147483648 #import ar...
gpl-2.0
rockyzhang/zhangyanhit-python-for-android-mips
python-build/python-libs/gdata/build/lib/gdata/tlslite/integration/TLSSocketServerMixIn.py
320
2203
"""TLS Lite + SocketServer.""" from gdata.tlslite.TLSConnection import TLSConnection class TLSSocketServerMixIn: """ This class can be mixed in with any L{SocketServer.TCPServer} to add TLS support. To use this class, define a new class that inherits from it and some L{SocketServer.TCPServer} (wi...
apache-2.0
rddim/Notepad-plus-plus
scintilla/qt/ScintillaEdit/WidgetGen.py
5
8222
#!/usr/bin/env python3 # WidgetGen.py - regenerate the ScintillaWidgetCpp.cpp and ScintillaWidgetCpp.h files # Check that API includes all gtkscintilla2 functions import sys import os import getopt scintillaDirectory = "../.." scintillaScriptsDirectory = os.path.join(scintillaDirectory, "scripts") sys.path....
gpl-3.0
mahak/spark
python/pyspark/storagelevel.py
23
2785
# # 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
almeidapaulopt/frappe
frappe/core/doctype/communication/comment.py
8
5243
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals, absolute_import import frappe from frappe import _ import json from frappe.core.doctype.user.user import extract_mentions from frappe.utils import get_fullname, get_link_to_form ...
mit
wpoely86/easybuild-easyblocks
easybuild/easyblocks/c/cufflinks.py
3
2181
## # This file is an EasyBuild reciPY as per https://github.com/hpcugent/easybuild # # Copyright:: Copyright 2012-2016 Uni.Lu/LCSB, NTUA # Authors:: Cedric Laczny <cedric.laczny@uni.lu>, Fotis Georgatos <fotis@cern.ch>, Kenneth Hoste # License:: MIT/GPL # $Id$ # # This work implements a part of the HPCBIOS project...
gpl-2.0
whereismyjetpack/ansible
lib/ansible/module_utils/network_common.py
60
6138
# This code is part of Ansible, but is an independent component. # This particular file snippet, and this file snippet only, is BSD licensed. # Modules you write using this snippet, which is embedded dynamically by Ansible # still belong to the author of the module, and may assign their own license # to the complete wo...
gpl-3.0
rsvip/Django
django/contrib/sessions/backends/db.py
49
2944
import logging from django.contrib.sessions.backends.base import CreateError, SessionBase from django.core.exceptions import SuspiciousOperation from django.db import IntegrityError, router, transaction from django.utils import timezone from django.utils.encoding import force_text class SessionStore(SessionBase): ...
bsd-3-clause
freeworldxbmc/pluging.video.Jurassic.World.Media
resources/lib/sources/iwatchonline_mv_tv.py
7
7369
# -*- coding: utf-8 -*- ''' Genesis Add-on Copyright (C) 2015 lambda 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 ...
gpl-3.0
pulinagrawal/nupic
external/linux32/lib/python2.6/site-packages/matplotlib/projections/__init__.py
69
2179
from geo import AitoffAxes, HammerAxes, LambertAxes from polar import PolarAxes from matplotlib import axes class ProjectionRegistry(object): """ Manages the set of projections available to the system. """ def __init__(self): self._all_projection_types = {} def register(self, *projections)...
agpl-3.0
projecthamster/hamster
src/hamster/widgets/__init__.py
2
3157
# - coding: utf-8 - # Copyright (C) 2007-2009 Toms Bauģis <toms.baugis at gmail.com> # This file is part of Project Hamster. # Project Hamster is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version ...
gpl-3.0
MarsCarl/ucore_lab
related_info/ostep/ostep2-segmentation.py
54
6613
#! /usr/bin/env python import sys from optparse import OptionParser import random import math def convert(size): length = len(size) lastchar = size[length-1] if (lastchar == 'k') or (lastchar == 'K'): m = 1024 nsize = int(size[0:length-1]) * m elif (lastchar == 'm') or (lastchar == 'M'...
gpl-2.0
JeremiasE/KFormula
kspread/plugins/scripting/scripts/myorca.py
3
7630
#!/usr/bin/env kross import urllib, Kross, KSpread class MyConfig: def __init__(self): self.url = "http://127.0.0.1:20433" self.sheetRange = "A1:F50" self.cellNameOnSelectionChanged = True self.cellValueOnSelectionChanged = True #TODO self.sheetNameOnSheetChanged = True c...
gpl-2.0
pbhd/xbmc
tools/EventClients/lib/python/zeroconf.py
181
4874
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (C) 2008-2013 Team XBMC # # 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 your opti...
gpl-2.0
ProfessionalIT/professionalit-webiste
sdk/google_appengine/lib/cherrypy/cherrypy/test/benchmark.py
36
12830
"""CherryPy Benchmark Tool Usage: benchmark.py --null --notests --help --cpmodpy --modpython --ab=path --apache=path --null: use a null Request object (to bench the HTTP server only) --notests: start the server but do not run the tests; this allows you to check th...
lgpl-3.0
Alpistinho/FreeCAD
src/Mod/Inspection/Init.py
58
1873
# FreeCAD init script of the Inspection module # (c) 2001 Juergen Riegel #*************************************************************************** #* (c) Juergen Riegel (juergen.riegel@web.de) 2002 * #* * #* Thi...
lgpl-2.1
gauribhoite/personfinder
env/google_appengine/lib/django-1.5/django/contrib/gis/tests/test_measure.py
221
8307
""" Distance and Area objects to allow for sensible and convienient calculation and conversions. Here are some tests. """ from django.contrib.gis.measure import Distance, Area, D, A from django.utils import unittest class DistanceTest(unittest.TestCase): "Testing the Distance object" def testInit(self): ...
apache-2.0
CasparLi/calibre
src/calibre/ebooks/tweak.py
14
5485
#!/usr/bin/env python2 # vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai from __future__ import (unicode_literals, division, absolute_import, print_function) __license__ = 'GPL v3' __copyright__ = '2012, Kovid Goyal <kovid@kovidgoyal.net>' __docformat__ = 'restructuredtext en' import sys, o...
gpl-3.0
rdmorganiser/rdmo
rdmo/projects/tests/test_view_project_update_import.py
1
14683
import os import re from pathlib import Path import pytest from django.urls import reverse from rdmo.core.constants import VALUE_TYPE_FILE from ..models import Project, Value users = ( ('owner', 'owner'), ('manager', 'manager'), ('author', 'author'), ('guest', 'guest'), ('user', 'user'), ('s...
apache-2.0
BubuLK/sfepy
sfepy/discrete/structural/mappings.py
5
2861
""" Finite element reference mappings for structural elements. """ import numpy as nm from sfepy.linalg import dot_sequences as ddot from sfepy.discrete.common.mappings import Mapping, PhysicalQPs import sfepy.mechanics.shell10x as shell10x class Shell10XMapping(Mapping): """ The reference mapping for the she...
bsd-3-clause