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 |
|---|---|---|---|---|---|
gizatt/director | src/python/ddapp/consoleapp.py | 6 | 5832 | import os
import sys
import argparse
import PythonQt
from PythonQt import QtCore, QtGui
import ddapp
from ddapp import applogic
from ddapp import objectmodel as om
from ddapp import vtkAll as vtk
from ddapp import vtkNumpy as vnp
from ddapp import viewbehaviors
from ddapp import visualization as vis
from ddapp.timerca... | bsd-3-clause |
xujun10110/pth-toolkit | lib/python2.7/site-packages/samba/external/testtools/tests/test_compat.py | 5 | 15403 | # Copyright (c) 2010 testtools developers. See LICENSE for details.
"""Tests for miscellaneous compatibility functions"""
import linecache
import os
import sys
import tempfile
import traceback
import testtools
from testtools.compat import (
_b,
_detect_encoding,
_get_source_encoding,
_u,
str_is_... | bsd-2-clause |
SSJohns/osf.io | admin/pre_reg/serializers.py | 22 | 3026 | from furl import furl
from datetime import datetime
from framework.utils import iso8601format
from dateutil import parser
from website.project.metadata.utils import serialize_meta_schema
from website.settings import DOMAIN as OSF_DOMAIN
EMBARGO = 'embargo'
IMMEDIATE = 'immediate'
def serialize_user(user):
ret... | apache-2.0 |
pepeportela/edx-platform | common/djangoapps/django_comment_common/migrations/0002_forumsconfig.py | 24 | 1173 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('django_c... | agpl-3.0 |
iemejia/incubator-beam | sdks/python/apache_beam/runners/interactive/testing/integration/notebook_executor.py | 1 | 5119 | #
# 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 |
userzimmermann/robotframework-python3 | src/robot/tidy.py | 1 | 12057 | #!/usr/bin/env python
# Copyright 2008-2014 Nokia Solutions and Networks
#
# 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 r... | apache-2.0 |
abhishekgahlot/pybrain | pybrain/rl/environments/mazes/tasks/maze4x3.py | 6 | 1557 | __author__ = 'Tom Schaul, tom@idsia.ch'
from random import random, choice
from scipy import array, zeros
from maze import MazeTask
class FourByThreeMaze(MazeTask):
"""
######
# *#
# # -#
# #
######
The '-' spot if absorbing, and giving negative reward.
"""
discount = 0.95
... | bsd-3-clause |
icomms/rapidsms | apps/blaster/models.py | 3 | 3127 | from django.db import models
from reporters.models import Reporter
from schools.utils import get_location_filter_params
from schools.models import School
class BlastableMessage(models.Model):
"""A message that can be blasted."""
text = models.CharField(max_length=160)
# Bare bones handling/validation... | lgpl-3.0 |
kiwicopple/MyMDb | venv/build/sphinx/tests/test_intersphinx.py | 22 | 6234 | # -*- coding: utf-8 -*-
"""
test_intersphinx
~~~~~~~~~~~~~~~~
Test the intersphinx extension.
:copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import zlib
import posixpath
try:
from io import BytesIO
except ImportError:
from cStr... | mit |
pamoakoy/invenio | modules/bibcirculation/web/admin/bibcirculationadmin.py | 1 | 43512 | ## This file is part of Invenio.
## Copyright (C) 2008, 2009, 2010, 2011 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 later ... | gpl-2.0 |
PersianWikipedia/pywikibot-core | scripts/spamremove.py | 2 | 5090 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Script to remove links that are being or have been spammed.
Usage:
python pwb.py spamremove www.spammedsite.com
It will use Special:Linksearch to find the pages on the wiki that link to
that site, then for each page make a proposed change consisting of removing
all t... | mit |
FFMG/myoddweb.piger | monitor/api/python/Python-3.7.2/Lib/test/test_gettext.py | 3 | 33913 | import os
import base64
import gettext
import locale
import unittest
from test import support
# TODO:
# - Add new tests, for example for "dgettext"
# - Remove dummy tests, for example testing for single and double quotes
# has no sense, it would have if we were testing a parser (i.e. pygettext)
# - Tests shoul... | gpl-2.0 |
honnibal/spaCy | spacy/lang/ur/stop_words.py | 1 | 4780 | # encoding: utf8
from __future__ import unicode_literals
# Source: collected from different resource on internet
STOP_WORDS = set(
"""
ثھی
خو
گی
اپٌے
گئے
ثہت
طرف
ہوبری
پبئے
اپٌب
دوضری
گیب
کت
گب
ثھی
ضے
ہر
پر
اش
دی
گے
لگیں
ہے
ثعذ
ضکتے
تھی
اى
دیب
لئے
والے
یہ
ثدبئے
ضکتی
تھب
اًذر
رریعے
لگی
ہوبرا
ہوًے
ثبہر
ضکتب
ًہیں
تو
... | mit |
reyha/zulip | zerver/lib/cache_helpers.py | 5 | 5153 | from __future__ import absolute_import
from six import text_type, binary_type
from typing import Any, Dict, Callable, Tuple
# This file needs to be different from cache.py because cache.py
# cannot import anything from zerver.models or we'd have an import
# loop
from django.conf import settings
from zerver.models imp... | apache-2.0 |
buguen/pylayers | pylayers/antprop/tests/test_reciprocity.py | 2 | 1761 | from pylayers.antprop.rays import *
from pylayers.gis.layout import *
from pylayers.antprop.signature import Signatures
import pylayers.signal.bsignal as bs
import pylayers.signal.waveform as wvf
from pylayers.simul.link import *
import matplotlib.pyplot as plt
import time
print "======================="
print " start... | lgpl-3.0 |
domob1812/huntercore | test/functional/mempool_spend_coinbase.py | 23 | 2228 | #!/usr/bin/env python3
# Copyright (c) 2014-2017 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test spending coinbase transactions.
The coinbase transaction in block N can appear in block
N+100... ... | mit |
dwaynebailey/pootle | pootle/apps/pootle_statistics/views.py | 7 | 3287 | # -*- coding: utf-8 -*-
#
# Copyright (C) Pootle contributors.
#
# This file is a part of the Pootle project. It is distributed under the GPL3
# or later license. See the LICENSE file for a copy of the license and the
# AUTHORS file for copyright and authorship information.
from django.forms import ValidationError
fro... | gpl-3.0 |
eval1749/elang | build/android/gn/zip.py | 25 | 1117 | #!/usr/bin/env python
#
# 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.
"""Archives a set of files.
"""
import ast
import optparse
import os
import sys
sys.path.append(os.path.join(os.path.dirname(__file... | apache-2.0 |
csdev/datacheck | tests/functional_tests/test_list.py | 1 | 1657 | from __future__ import (absolute_import, division,
print_function, unicode_literals)
import unittest
from datacheck import validate
from datacheck.exceptions import TypeValidationError
class TestList(unittest.TestCase):
def test_list_ok(self):
input = [123, 456]
result = ... | mit |
bluechiptechnology/linux-bctrx3 | tools/perf/python/twatch.py | 1565 | 1316 | #! /usr/bin/python
# -*- python -*-
# -*- coding: utf-8 -*-
# twatch - Experimental use of the perf python interface
# Copyright (C) 2011 Arnaldo Carvalho de Melo <acme@redhat.com>
#
# This application is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License... | gpl-2.0 |
shubhdev/edxOnBaadal | common/test/acceptance/tests/lms/test_lms_course_discovery.py | 69 | 2455 | """
Test course discovery.
"""
import datetime
import json
from bok_choy.web_app_test import WebAppTest
from ..helpers import remove_file
from ...pages.common.logout import LogoutPage
from ...pages.studio.auto_auth import AutoAuthPage
from ...pages.lms.discovery import CourseDiscoveryPage
from ...fixtures.course impor... | agpl-3.0 |
angelapper/edx-platform | lms/djangoapps/certificates/management/commands/fix_ungraded_certs.py | 5 | 1741 | """
Management command which fixes ungraded certificates for students
"""
import logging
from optparse import make_option
from django.core.management.base import BaseCommand
from certificates.models import GeneratedCertificate
from courseware import courses
from lms.djangoapps.grades.new.course_grade_factory import C... | agpl-3.0 |
keisuke-umezawa/chainer | chainer/_environment_check.py | 3 | 3396 | from __future__ import absolute_import
import os
import sys
import warnings
import numpy.distutils.system_info
import pkg_resources
import chainer
def _check_python_350():
if sys.version_info[:3] == (3, 5, 0):
if not int(os.getenv('CHAINER_PYTHON_350_FORCE', '0')):
msg = """
Chainer does... | mit |
melven/tixi | bindings/matlab/make_tixi_matlab.py | 1 | 1189 | # -*-# coding: utf-8 -*-
"""
Created on Wed May 01 11:44:49 2013
@author: Martin Siggel <martin.siggel@dlr.de>
"""
import sys, os, shutil, glob
filepath = os.path.dirname(os.path.realpath(__file__))
tixipath = filepath + '/../..'
sys.path.append(tixipath + '/bindings')
import bindings_generator.matlab_generator as ... | apache-2.0 |
NSLS-II-XPD/ipython_ophyd | archived/profile_collection-dev/ipython_config.py | 2 | 23016 | # Configuration file for ipython.
#------------------------------------------------------------------------------
# Configurable configuration
#------------------------------------------------------------------------------
#------------------------------------------------------------------------------
# InteractiveSh... | bsd-2-clause |
Azure/azure-sdk-for-python | sdk/eventhub/azure-eventhub/stress/azure_eventhub_consumer_stress_async.py | 1 | 12671 | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | mit |
cooper-software/python-10000ft | tests/test_dates.py | 1 | 1590 | import unittest
from mock import Mock
from tenthousandfeet import HTTPClient, CollectionClient, date_parse
from datetime import date, datetime
from dateutil.tz import tzutc
from . import make_mock_response_obj
class TestDates(unittest.TestCase):
def setUp(self):
self.http = HTTPClient('abc123', 'http... | mit |
gst/alignak | test/test_module_on_module.py | 2 | 2691 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2015-2015: Alignak team, see AUTHORS.txt file for contributors
#
# This file is part of Alignak.
#
# Alignak is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free So... | agpl-3.0 |
googleads/google-ads-python | google/ads/googleads/v7/resources/types/webpage_view.py | 1 | 1203 | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | apache-2.0 |
grapesmoker/regulations-core | regcore/migrations/0009_auto__add_field_regulation_marker.py | 2 | 3898 | # -*- 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 field 'Regulation.marker'
db.add_column(u'regcore_regulation', '... | cc0-1.0 |
shajoezhu/server | tests/unit/test_avrotools.py | 1 | 1843 | """
Tests the avrotools module
"""
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import unittest
import ga4gh.avrotools as avrotools
import ga4gh.protocol as protocol
class TestAvrotools(unittest.TestCase):
"""
Tests avrotools creator and valid... | apache-2.0 |
mxOBS/deb-pkg_trusty_chromium-browser | third_party/protobuf/python/google/protobuf/internal/wire_format_test.py | 571 | 10848 | #! /usr/bin/python
#
# Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
# http://code.google.com/p/protobuf/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# ... | bsd-3-clause |
kayhayen/Nuitka | nuitka/tools/release/msi_create/__main__.py | 1 | 1159 | # Copyright 2021, Kay Hayen, mailto:kay.hayen@gmail.com
#
# Part of "Nuitka", an optimizing Python compiler that is compatible and
# integrates with CPython, but also works on its own.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in complianc... | apache-2.0 |
CodingCat/mxnet | python/mxnet/contrib/text/embedding.py | 12 | 34598 | # 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 u... | apache-2.0 |
anntzer/scipy | scipy/spatial/_spherical_voronoi.py | 5 | 13698 | """
Spherical Voronoi Code
.. versionadded:: 0.18.0
"""
#
# Copyright (C) Tyler Reddy, Ross Hemsley, Edd Edmondson,
# Nikolai Nowaczyk, Joe Pitt-Francis, 2015.
#
# Distributed under the same BSD license as SciPy.
#
import warnings
import numpy as np
import scipy
from . import _voronoi
from scipy.spat... | bsd-3-clause |
rueckstiess/mtools | mtools/mlogfilter/filters/logline_filter.py | 1 | 6012 | from .base_filter import BaseFilter
from mtools.util.logevent import LogEvent
from mtools.util.pattern import json2pattern
def custom_parse_array(value):
return list(set(value.split()))
class LogLineFilter(BaseFilter):
"""LogLineFilter class."""
filterArgs = [
('--component', {
'nar... | apache-2.0 |
sjperkins/tensorflow | tensorflow/python/training/proximal_gradient_descent_test.py | 102 | 8096 | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
junhuac/MQUIC | src/tools/isolate_driver.py | 19 | 10785 | #!/usr/bin/env python
# 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.
"""Adaptor script called through build/isolate.gypi.
Creates a wrapping .isolate which 'includes' the original one, that can be
consum... | mit |
neumerance/cloudloon2 | horizon/tables/__init__.py | 10 | 1651 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 Nebula, 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
#
# ... | apache-2.0 |
theflofly/tensorflow | tensorflow/contrib/boosted_trees/python/ops/stats_accumulator_ops.py | 7 | 10250 | # 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 |
kosz85/django | django/db/backends/sqlite3/introspection.py | 9 | 12866 | import re
import warnings
from django.db.backends.base.introspection import (
BaseDatabaseIntrospection, FieldInfo, TableInfo,
)
from django.db.models.indexes import Index
from django.utils.deprecation import RemovedInDjango21Warning
field_size_re = re.compile(r'^\s*(?:var)?char\s*\(\s*(\d+)\s*\)\s*$')
def get_... | bsd-3-clause |
bratsche/Neutron-Drive | google_appengine/lib/django_1_3/django/contrib/admin/validation.py | 153 | 19088 | from django.core.exceptions import ImproperlyConfigured
from django.db import models
from django.db.models.fields import FieldDoesNotExist
from django.forms.models import (BaseModelForm, BaseModelFormSet, fields_for_model,
_get_foreign_key)
from django.contrib.admin.util import get_fields_from_path, NotRelationFiel... | bsd-3-clause |
cyli/volatility | volatility/plugins/connscan.py | 1 | 2954 | # Volatility
# Copyright (C) 2008-2013 Volatility Foundation
# Copyright (c) 2008 Brendan Dolan-Gavitt <bdolangavitt@wesleyan.edu>
#
# This file is part of Volatility.
#
# Volatility 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... | gpl-2.0 |
gaddman/ansible | lib/ansible/modules/windows/win_stat.py | 28 | 8215 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2017, Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# this is a windows documentation stub. actual code lives in the .ps1
# file of the same name
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | gpl-3.0 |
sean-/ansible | v1/ansible/runner/lookup_plugins/etcd.py | 153 | 2238 | # (c) 2013, Jan-Piet Mens <jpmens(at)gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later ver... | gpl-3.0 |
Etwigg/Examples | Group Project Website/venv/Lib/site-packages/click/_termui_impl.py | 136 | 16395 | """
click._termui_impl
~~~~~~~~~~~~~~~~~~
This module contains implementations for the termui module. To keep the
import time of Click down, some infrequently used functionality is placed
in this module and only imported as needed.
:copyright: (c) 2014 by Armin Ronacher.
:license: BSD, se... | mit |
grap/OCB | addons/hr_timesheet_invoice/tests/test_multi_company.py | 8 | 5627 | # -*- 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 |
letouriste001/SmartForest_2.0 | python3.4Smartforest/lib/python3.4/site-packages/django/core/mail/message.py | 1 | 17138 | from __future__ import unicode_literals
import mimetypes
import os
import random
import time
from email import (
charset as Charset, encoders as Encoders, generator, message_from_string,
)
from email.header import Header
from email.message import Message
from email.mime.base import MIMEBase
from email.mime.message... | mit |
nvoron23/scikit-learn | examples/semi_supervised/plot_label_propagation_digits.py | 268 | 2723 | """
===================================================
Label Propagation digits: Demonstrating performance
===================================================
This example demonstrates the power of semisupervised learning by
training a Label Spreading model to classify handwritten digits
with sets of very few labels.... | bsd-3-clause |
poldracklab/pydeface | tests/test_utils.py | 1 | 1419 | import pydeface.utils as pdu
from shutil import which
import tempfile
import os
import pytest
from pathlib import Path
import urllib.request
def test_cleanup_files():
files = []
for p in range(3):
files.append(tempfile.mkstemp()[1])
pdu.cleanup_files(files[0])
pdu.cleanup_files(*files[1:])
... | mit |
qqbuby/redmine_book | redmine_book/packages/redmine/packages/requests/packages/chardet/langcyrillicmodel.py | 2762 | 17725 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client 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 R... | mit |
windedge/odoo | addons/crm_project_issue/project_issue.py | 380 | 2373 |
from openerp.osv import osv, fields
class crm_lead_to_project_issue_wizard(osv.TransientModel):
""" wizard to convert a Lead into a Project Issue and move the Mail Thread """
_name = "crm.lead2projectissue.wizard"
_inherit = 'crm.partner.binding'
_columns = {
"lead_id": fields.many2one("crm.... | agpl-3.0 |
jordiclariana/ansible | lib/ansible/modules/cloud/ovirt/ovirt_clusters_facts.py | 15 | 3423 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2016 Red Hat, Inc.
#
# 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
#... | gpl-3.0 |
TheKnowledgeOrientedArchitecture/oks | ap/migrations/tmp/0002.py | 1 | 6082 | # -*- coding: utf-8 -*-
# Subject to the terms of the GNU AFFERO GENERAL PUBLIC LICENSE, v. 3.0. If a copy of the AGPL was not
# distributed with this file, You can obtain one at http://www.gnu.org/licenses/agpl.txt
#
# Author: Davide Galletti davide ( at ) c4k.it
from __future__ import unicode_lite... | agpl-3.0 |
f3r/scikit-learn | examples/linear_model/lasso_dense_vs_sparse_data.py | 348 | 1862 | """
==============================
Lasso on dense and sparse data
==============================
We show that linear_model.Lasso provides the same results for dense and sparse
data and that in the case of sparse data the speed is improved.
"""
print(__doc__)
from time import time
from scipy import sparse
from scipy ... | bsd-3-clause |
tfroehlich82/koalixcrm | international/models.py | 1 | 24198 | # -*- coding: utf-8 -*-
"""
This file is part of django-international.
Copyright (c) 2012 Monwara LLC.
All rights reserved.
Licensed under BSD license. See LICENSE file for more details.
"""
from __future__ import unicode_literals
from django.db import models
from django.utils.translation import ugettext_lazy as _
... | bsd-3-clause |
squidpie/somn | src/somnPkt.py | 1 | 10961 | #!/bin/python
import struct
from somnLib import *
class SomnPacketType():
Unknown = "Unknown"
Message = "Message"
RouteRequest = "RouteRequest"
BadRoute = "BadRoute"
AddConnection = "AddConnection"
DropConnection = "DropConnection"
NodeEnrollment = "NodeEnrollment"
class SomnPacket:
... | mit |
kingvuplus/ee | lib/python/Components/NimManager.py | 8 | 64884 | from Tools.HardwareInfo import HardwareInfo
from Tools.BoundFunction import boundFunction
from config import config, ConfigSubsection, ConfigSelection, ConfigFloat, \
ConfigSatlist, ConfigYesNo, ConfigInteger, ConfigSubList, ConfigNothing, \
ConfigSubDict, ConfigOnOff, ConfigDateTime, ConfigText
from enigma import ... | gpl-2.0 |
eonpatapon/neutron | neutron/plugins/brocade/NeutronPlugin.py | 24 | 20615 | # Copyright 2013 Brocade Communications System, 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
#
#... | apache-2.0 |
MisterPup/Ceilometer-Juno-Extension | ceilometer/tests/publisher/test_messaging_publisher.py | 4 | 14772 | #
# Copyright 2012 New Dream Network, LLC (DreamHost)
#
# Author: Doug Hellmann <doug.hellmann@dreamhost.com>
# Julien Danjou <julien@danjou.info>
#
# 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... | apache-2.0 |
bguillot/OpenUpgrade | addons/procurement/__openerp__.py | 61 | 2482 | # -*- 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 |
Neuvoo/legacy-portage | pym/portage/cache/fs_template.py | 2 | 2595 | # Copyright: 2005 Gentoo Foundation
# Author(s): Brian Harring (ferringb@gentoo.org)
# License: GPL2
import sys
from portage.cache import template
from portage import os
from portage.proxy.lazyimport import lazyimport
lazyimport(globals(),
'portage.data:portage_gid',
'portage.exception:PortageException',
'portage.... | gpl-2.0 |
EduPepperPD/pepper2013 | lms/djangoapps/courseware/models.py | 9 | 8233 | """
WE'RE USING MIGRATIONS!
If you make changes to this model, be sure to create an appropriate migration
file and check it in at the same time as your model changes. To do that,
1. Go to the edx-platform dir
2. ./manage.py schemamigration courseware --auto description_of_your_change
3. Add the migration file created... | agpl-3.0 |
Tesi-Luca-Davide/ryu | ryu/services/protocols/bgp/info_base/ipv6.py | 47 | 2988 | # Copyright (C) 2014 Nippon Telegraph and Telephone Corporation.
#
# 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 |
tonylukasavage/ticonf-us-alloy-preso | code/conditionals/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.... | mit |
pombredanne/MOG | nova/keymgr/key.py | 11 | 2630 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2013 The Johns Hopkins University/Applied Physics Laboratory
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the ... | apache-2.0 |
sinoz/boat-wars | src/screens/game/cards.py | 1 | 3949 | import pygame
import play.card
import widget.button
CardPositions = [(39, 46), (319, 47), (604, 46), (37, 330), (319, 329), (602, 326)]
class CardScreen:
def __init__(self, canvas, session, prev=None):
self.canvas = canvas
self.session = session
self.prev = prev
self.image = pygam... | apache-2.0 |
patricklaw/pants | src/python/pants/help/help_integration_test.py | 4 | 4970 | # Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
import json
import re
import textwrap
from pants.testutil.pants_integration_test import run_pants
def test_help() -> None:
pants_run = run_pants(["help"])
pants_run.assert_succe... | apache-2.0 |
asedunov/intellij-community | python/lib/Lib/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py | 71 | 8207 | import os
import sys
import shutil
from optparse import make_option
from django.conf import settings
from django.core.files.storage import get_storage_class
from django.core.management.base import CommandError, NoArgsCommand
from django.contrib.staticfiles import finders
class Command(NoArgsCommand):
"""
Com... | apache-2.0 |
CodeWingX/yowsup | yowsup/layers/auth/test_keystream.py | 67 | 2309 | import unittest
from yowsup.layers.auth.keystream import KeyStream
class KeyStreamTest(unittest.TestCase):
def setUp(self):
self.password = bytearray(list(map(ord,"password")))
self.salt = bytearray(list(map(ord,"salt")))
self.keysTarget = [
bytearray(b'>\xd5\x8a\xecB\xdb\... | gpl-3.0 |
gplib/gplib | gplib/apps/extauth/models.py | 10 | 2712 | # -*- coding: utf-8 -*-
# Este archivo es parte de GPLib - http://gplib.org/
#
# GPlib es software libre desarrollado en la Facultad de Filosofía y Letras de
# la Universidad de Buenos Aires y liberado bajo los términos de la licencia
# GPLIB FILO www.gplib.org/licencia bajo los términos de GPL de GNU. Usted
# puede ... | gpl-3.0 |
davy39/eric | Graphics/UMLItem.py | 1 | 7199 | # -*- coding: utf-8 -*-
# Copyright (c) 2004 - 2014 Detlev Offenbach <detlev@die-offenbachs.de>
#
"""
Module implementing the UMLItem base class.
"""
from __future__ import unicode_literals
from PyQt5.QtCore import Qt, QSizeF
from PyQt5.QtWidgets import QGraphicsItem, QGraphicsRectItem, QStyle
import Preferences
... | gpl-3.0 |
jnsebgosselin/WHAT | gwhat/meteo/merge_weather_data.py | 1 | 11920 | # -*- coding: utf-8 -*-
# Copyright © 2014-2018 GWHAT Project Contributors
# https://github.com/jnsebgosselin/gwhat
#
# This file is part of GWHAT (Ground-Water Hydrograph Analysis Toolbox).
# Licensed under the terms of the GNU General Public License.
# ---- Imports: standard libraries
import os
import csv
# ---- ... | gpl-3.0 |
shivgarg/TizenRT | tools/ttrace_parser/scripts/ttrace.py | 14 | 19465 | #!/usr/bin/env python
###########################################################################
#
# Copyright 2017 Samsung Electronics 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 ... | apache-2.0 |
simbha/mAngE-Gin | lib/django/db/backends/mysql/validation.py | 65 | 1311 | from django.core import checks
from django.db.backends import BaseDatabaseValidation
class DatabaseValidation(BaseDatabaseValidation):
def check_field(self, field, **kwargs):
"""
MySQL has the following field length restriction:
No character (varchar) fields can have a length exceeding 255... | mit |
cpaulik/scipy | scipy/weave/tests/test_scxx_sequence.py | 91 | 13199 | """ Test refcounting and behavior of SCXX.
"""
from __future__ import absolute_import, print_function
import time
import sys
from numpy.testing import (TestCase, assert_, assert_raises,
run_module_suite)
from scipy.weave import inline_tools
from weave_test_utils import debug_print, dec
... | bsd-3-clause |
DirtyUnicorns/android_external_chromium_org | tools/perf/page_sets/mobile_memory.py | 33 | 3546 | # 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.
from telemetry.page import page as page_module
from telemetry.page import page_set as page_set_module
class MobileMemoryPage(page_module.Page):
def __ini... | bsd-3-clause |
ehashman/oh-mainline | vendor/packages/twisted/doc/core/examples/wxdemo.py | 19 | 1552 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""Demo of wxPython integration with Twisted."""
import sys
from wx import Frame, DefaultPosition, Size, Menu, MenuBar, App
from wx import EVT_MENU, EVT_CLOSE
from twisted.python import log
from twisted.internet import wxreactor
wxreactor.insta... | agpl-3.0 |
luckylavish/zamboni | mkt/lookup/tests/test_forms.py | 13 | 2338 | from django.core.files.uploadedfile import SimpleUploadedFile
from nose.tools import eq_, ok_
import mkt.site.tests
from mkt.lookup.forms import (TransactionSearchForm, TransactionRefundForm,
PromoImgForm)
from mkt.site.storage_utils import local_storage
from mkt.site.tests.test_utils_ i... | bsd-3-clause |
chen0510566/MissionPlanner | Lib/site-packages/numpy/f2py/func2subr.py | 51 | 5186 | #!"C:\Users\hog\Documents\Visual Studio 2010\Projects\ArdupilotMega\ArdupilotMega\bin\Debug\ipy.exe"
"""
Rules for building C/API module with f2py2e.
Copyright 1999,2000 Pearu Peterson all rights reserved,
Pearu Peterson <pearu@ioc.ee>
Permission to use, modify, and distribute this software is given under the
terms o... | gpl-3.0 |
nmercier/linux-cross-gcc | linux/lib/python2.7/dist-packages/Crypto/Hash/HMAC.py | 123 | 7302 | # HMAC.py - Implements the HMAC algorithm as described by RFC 2104.
#
# ===================================================================
# Portions Copyright (c) 2001, 2002, 2003 Python Software Foundation;
# All Rights Reserved
#
# This file contains code from the Python 2.2 hmac.py module (the
# "Original Code"), ... | bsd-3-clause |
tareqalayan/ansible | lib/ansible/modules/cloud/amazon/elb_network_lb.py | 8 | 15416 | #!/usr/bin/python
# Copyright: (c) 2018, Rob White (@wimnat)
# 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 = '''
---
... | gpl-3.0 |
gclxry/win-fuzzy-hashing | googletest/googlemock/scripts/fuse_gmock_files.py | 242 | 8631 | #!/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 |
jpetso/libtorrent | tools/parse_test_results.py | 1 | 12352 | #!/usr/bin/env python
# Copyright (c) 2013, Arvid Norberg
# 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... | bsd-3-clause |
gagoncal/Selenium | Selenium with python/Selenium_with_python_config_files/setuptools-12.0.1/setuptools/command/bdist_rpm.py | 1049 | 1508 | import distutils.command.bdist_rpm as orig
class bdist_rpm(orig.bdist_rpm):
"""
Override the default bdist_rpm behavior to do the following:
1. Run egg_info to ensure the name and version are properly calculated.
2. Always run 'install' using --single-version-externally-managed to
disable eggs... | lgpl-2.1 |
aymara/knowledgesrl | src/argguesser.py | 1 | 10255 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
""" Extract frames, predicates and arguments from a corpus, using only syntactic annotations
Defines the class ArgGuesser
"""
from framenetframe import FrameInstance, Predicate, Word, Arg
from verbnetprepclasses import all_preps
from argheuristic import find_args
... | agpl-3.0 |
scs/uclinux | user/python/python-2.4.4/Lib/xml/sax/handler.py | 230 | 13921 | """
This module contains the core classes of version 2.0 of SAX for Python.
This file provides only default classes with absolutely minimum
functionality, from which drivers and applications can be subclassed.
Many of these classes are empty and are included only as documentation
of the interfaces.
$Id$
"""
version ... | gpl-2.0 |
jawilson/home-assistant | tests/components/sensor/test_mfi.py | 5 | 6823 | """The tests for the mFi sensor platform."""
import unittest
import unittest.mock as mock
import requests
from homeassistant.bootstrap import setup_component
import homeassistant.components.sensor as sensor
import homeassistant.components.sensor.mfi as mfi
from homeassistant.const import TEMP_CELSIUS
from tests.comm... | mit |
luken/SpockBot | tests/plugins/core/test_taskmanager.py | 4 | 7381 | import random
from collections import defaultdict
from unittest import TestCase
from spockbot.plugins.core.taskmanager import TaskManager
from spockbot.plugins.tools.task import Task, TaskFailed
class EventMock(object):
def __init__(self):
self.handlers = defaultdict(list)
def reg_event_handler(self... | mit |
raildo/nova | nova/cmd/dhcpbridge.py | 41 | 4778 | # Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# 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 ... | apache-2.0 |
nickvandewiele/RMG-Py | rmgpy/reduction/output.py | 5 | 2015 | #!/usr/bin/python
# -*- coding: utf-8 -*-
################################################################################
#
# RMG - Reaction Mechanism Generator
#
# Copyright (c) 2002-2010 Prof. William H. Green (whgreen@mit.edu) and the
# RMG Team (rmg_dev@mit.edu)
#
# Permission is hereby granted, free of c... | mit |
procamora/Wiki-Personal | pelican-plugins/linker/mailto.py | 26 | 1187 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
import codecs
from pelican import signals
from pelican.generators import Generator
from linker import linker
def encode_mailto_link(mailto):
return 'mailto/' + codecs.encode(mailto, 'rot_13') + '/'
class MailtoLinker(linker.LinkerBase):
command... | gpl-3.0 |
agustinhenze/logbook.debian | logbook/helpers.py | 12 | 7945 | # -*- coding: utf-8 -*-
"""
logbook.helpers
~~~~~~~~~~~~~~~
Various helper functions
:copyright: (c) 2010 by Armin Ronacher, Georg Brandl.
:license: BSD, see LICENSE for more details.
"""
import os
import re
import sys
import errno
import time
import random
from datetime import datetime, timedelta... | bsd-3-clause |
javiergarridomellado/Empresa_django | devcodela/lib/python2.7/site-packages/django/core/management/__init__.py | 99 | 18224 | import collections
import os
import sys
from optparse import OptionParser, NO_DEFAULT
import imp
import warnings
from django.core.exceptions import ImproperlyConfigured
from django.core.management.base import BaseCommand, CommandError, handle_default_options
from django.core.management.color import color_style
from dj... | gpl-2.0 |
nilnvoid/wagtail | wagtail/wagtailadmin/views/pages.py | 1 | 41276 | from __future__ import absolute_import, unicode_literals
from django.contrib.contenttypes.models import ContentType
from django.core.exceptions import PermissionDenied
from django.core.urlresolvers import reverse
from django.db.models import Count
from django.http import Http404, HttpResponse
from django.shortcuts imp... | bsd-3-clause |
shakamunyi/neutron | neutron/plugins/bigswitch/routerrule_db.py | 47 | 1500 | # Copyright 2013, Big Switch Networks
# 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 |
msegado/edx-platform | common/djangoapps/student/tests/test_linkedin.py | 150 | 2265 | # -*- coding: utf-8 -*-
"""Tests for LinkedIn Add to Profile configuration. """
import ddt
from urllib import urlencode
from django.test import TestCase
from opaque_keys.edx.locator import CourseLocator
from student.models import LinkedInAddToProfileConfiguration
@ddt.ddt
class LinkedInAddToProfileUrlTests(TestCase... | agpl-3.0 |
sorenk/ansible | lib/ansible/module_utils/splitter.py | 197 | 9433 | # 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 |
iizukak/nupic-nlp-experiment | src/encoder/vector_test.py | 1 | 3537 | #!/usr/bin/env python
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, 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 |
drjova/zenodo | zenodo/modules/quotas/signals.py | 2 | 1115 | # -*- coding: utf-8 -*-
#
# This file is part of Zenodo.
# Copyright (C) 2015 CERN.
#
# Zenodo 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 v... | gpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.