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 |
|---|---|---|---|---|---|
moijes12/oh-mainline | vendor/packages/mechanize/test/test_pullparser.py | 22 | 13277 | #!/usr/bin/env python
from unittest import TestCase
def peek_token(p):
tok = p.get_token()
p.unget_token(tok)
return tok
class PullParserTests(TestCase):
from mechanize._pullparser import PullParser, TolerantPullParser
PARSERS = [(PullParser, False), (TolerantPullParser, True)]
def data_and... | agpl-3.0 |
philsch/ansible | lib/ansible/modules/storage/netapp/sf_volume_access_group_manager.py | 69 | 9488 | #!/usr/bin/python
# (c) 2017, NetApp, 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
# (at your option) any later version.... | gpl-3.0 |
geminy/aidear | oss/qt/qt-everywhere-opensource-src-5.9.0/qtwebengine/src/3rdparty/chromium/third_party/WebKit/Tools/Scripts/webkitpy/tool/grammar.py | 217 | 2313 | # Copyright (c) 2009 Google Inc. All rights reserved.
# Copyright (c) 2009 Apple 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... | gpl-3.0 |
alkadis/vcv | src/adhocracy/migration/versions/009_Make_final_polling_optional.py | 4 | 1117 | from datetime import datetime
from sqlalchemy import *
from migrate import *
import migrate.changeset
meta = MetaData()
def upgrade(migrate_engine):
meta.bind = migrate_engine
instance_table = Table('instance', meta,
Column('id', Integer, primary_key=True),
Column('key', Unicode(20), nullabl... | agpl-3.0 |
SlateScience/MozillaJS | js/src/testing/mozbase/mozdevice/mozdevice/dmcli.py | 3 | 16149 | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
"""
Command-line client to control a device
"""
import errno
import os
import posixpath
import StringIO
import sys
impo... | mpl-2.0 |
tkarna/cofs | thetis/forcing.py | 1 | 35873 | """
Routines for interpolating forcing fields for the 3D solver.
"""
from firedrake import *
import numpy as np
import scipy.spatial.qhull as qhull
import thetis.timezone as timezone
import thetis.interpolation as interpolation
import thetis.coordsys as coordsys
from .log import *
import netCDF4
import thetis.physical_... | mit |
syci/ingadhoc-odoo-addons | product_catalog_aeroo_report/report/product_catalog_parser.py | 1 | 3894 | # -*- coding: utf-8 -*-
import time
from openerp.tools.translate import _
from openerp.report import report_sxw
from openerp.report.report_sxw import rml_parse
class Parser(report_sxw.rml_parse):
def __init__(self, cr, uid, name, context):
super(Parser, self).__init__(cr, uid, name, context)
la... | agpl-3.0 |
MartinHjelmare/home-assistant | homeassistant/components/arest/sensor.py | 7 | 6406 | """Support for an exposed aREST RESTful API of a device."""
import logging
from datetime import timedelta
import requests
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.const import (
CONF_UNIT_OF_MEASUREMENT, CONF_VALUE_TEMPLATE, CONF_RESOURCE,
CONF_MO... | apache-2.0 |
nchammas/spark | python/pyspark/mllib/__init__.py | 11 | 1372 | #
# 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 |
peterlauri/django | django/contrib/admin/checks.py | 13 | 39299 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from itertools import chain
from django.apps import apps
from django.conf import settings
from django.contrib.admin.utils import (
NotRelationField, flatten, get_fields_from_path,
)
from django.core import checks
from django.core.exceptions import Fi... | bsd-3-clause |
leilihh/nova | nova/tests/objects/test_external_event.py | 28 | 1751 | # 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 |
linmajia/dlbench | tools/mxnet/symbols/lenet.py | 12 | 1385 | """
LeCun, Yann, Leon Bottou, Yoshua Bengio, and Patrick Haffner.
Gradient-based learning applied to document recognition.
Proceedings of the IEEE (1998)
"""
import mxnet as mx
def get_symbol(num_classes=10, add_stn=False, **kwargs):
data = mx.symbol.Variable('data')
if(add_stn):
data = mx.sym.SpatialT... | mit |
fernandog/osmc | package/mediacenter-skin-osmc/files/usr/share/kodi/addons/script.module.unidecode/lib/unidecode/x0d6.py | 253 | 4765 | data = (
'hyeo', # 0x00
'hyeog', # 0x01
'hyeogg', # 0x02
'hyeogs', # 0x03
'hyeon', # 0x04
'hyeonj', # 0x05
'hyeonh', # 0x06
'hyeod', # 0x07
'hyeol', # 0x08
'hyeolg', # 0x09
'hyeolm', # 0x0a
'hyeolb', # 0x0b
'hyeols', # 0x0c
'hyeolt', # 0x0d
'hyeolp', # 0x0e
'hyeolh', # 0x... | gpl-2.0 |
yuewko/neutron | neutron/db/migration/alembic_migrations/versions/2eeaf963a447_floatingip_status.py | 15 | 1460 | # Copyright 2014 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 ... | apache-2.0 |
nkgilley/home-assistant | tests/components/august/test_binary_sensor.py | 3 | 4944 | """The binary_sensor tests for the august platform."""
from homeassistant.components.lock import DOMAIN as LOCK_DOMAIN
from homeassistant.const import (
ATTR_ENTITY_ID,
SERVICE_LOCK,
SERVICE_UNLOCK,
STATE_OFF,
STATE_ON,
STATE_UNAVAILABLE,
)
from tests.components.august.mocks import (
_crea... | apache-2.0 |
kitallis/rvhouse | site_scons/site_tools/qt4/test/qrc/manual/sconstest-manualwflags.py | 6 | 1599 | #!/usr/bin/env python
#
# Copyright (c) 2001-2010 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use,... | gpl-2.0 |
nguyentran/openviber | tools/scons-local/scons-local-2.0.1/SCons/Tool/pdf.py | 61 | 3033 | """SCons.Tool.pdf
Common PDF Builder definition for various other Tool modules that use it.
Add an explicit action to run epstopdf to convert .eps files to .pdf
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 The SCons Foundation
#
# Permission is hereby granted, free of charge, to a... | mit |
carolFrohlich/nipype | nipype/interfaces/afni/tests/test_auto_Detrend.py | 12 | 1115 | # AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from ....testing import assert_equal
from ..preprocess import Detrend
def test_Detrend_inputs():
input_map = dict(args=dict(argstr='%s',
),
environ=dict(nohash=True,
usedefault=True,
),
ignore_exception=dict(nohash=True,
usedefault=True... | bsd-3-clause |
ubuntustudio-kernel/ubuntu-raring-lowlatency | 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 |
mikemccann/stoqs | stoqs/static/OpenLayers-2.11/tools/mergejs.py | 42 | 7820 | #!/usr/bin/env python
#
# Merge multiple JavaScript source code files into one.
#
# Usage:
# This script requires source files to have dependencies specified in them.
#
# Dependencies are specified with a comment of the form:
#
# // @requires <file path>
#
# e.g.
#
# // @requires Geo/DataSource.js
#
# This scri... | gpl-3.0 |
ryansnowboarder/zulip | zerver/filters.py | 124 | 1058 | from __future__ import absolute_import
from django.views.debug import SafeExceptionReporterFilter
from django.http import build_request_repr
class ZulipExceptionReporterFilter(SafeExceptionReporterFilter):
def get_post_parameters(self, request):
filtered_post = SafeExceptionReporterFilter.get_post_paramet... | apache-2.0 |
cyberplant/scrapy | scrapy/responsetypes.py | 6 | 4781 | """
This module implements a class which returns the appropriate Response class
based on different criteria.
"""
from __future__ import absolute_import
from mimetypes import MimeTypes
from pkgutil import get_data
from io import StringIO
import six
from scrapy.http import Response
from scrapy.utils.misc import load_obj... | bsd-3-clause |
AnhellO/DAS_Sistemas | Ago-Dic-2017/Enrique Castillo/Ordinario/test/Lib/site-packages/pip/commands/freeze.py | 342 | 2835 | from __future__ import absolute_import
import sys
import pip
from pip.compat import stdlib_pkgs
from pip.basecommand import Command
from pip.operations.freeze import freeze
from pip.wheel import WheelCache
DEV_PKGS = ('pip', 'setuptools', 'distribute', 'wheel')
class FreezeCommand(Command):
"""
Output ins... | mit |
vmanoria/bluemix-hue-filebrowser | hue-3.8.1-bluemix/desktop/core/ext-py/Django-1.6.10/tests/comment_tests/tests/test_comment_form.py | 53 | 3001 | from __future__ import absolute_import
import time
from django.conf import settings
from django.contrib.comments.forms import CommentForm
from django.contrib.comments.models import Comment
from . import CommentTestCase
from ..models import Article
class CommentFormTests(CommentTestCase):
def testInit(self):
... | gpl-2.0 |
wndias/bc.repository | script.module.youtube.dl/lib/youtube_dl/extractor/newgrounds.py | 150 | 1261 | from __future__ import unicode_literals
import json
import re
from .common import InfoExtractor
class NewgroundsIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?newgrounds\.com/audio/listen/(?P<id>[0-9]+)'
_TEST = {
'url': 'http://www.newgrounds.com/audio/listen/549479',
'md5': 'fe6033d2... | gpl-2.0 |
40223240/2015cdb_g3 | static/Brython3.1.0-20150301-090019/Lib/xml/dom/minidom.py | 727 | 66854 | """Simple implementation of the Level 1 DOM.
Namespaces and other minor Level 2 features are also supported.
parse("foo.xml")
parseString("<foo><bar/></foo>")
Todo:
=====
* convenience methods for getting elements and text.
* more testing
* bring some of the writer and linearizer code into conformance with this
... | gpl-3.0 |
JavML/django | tests/flatpages_tests/test_csrf.py | 290 | 4819 | from django.contrib.auth.models import User
from django.contrib.flatpages.models import FlatPage
from django.contrib.sites.models import Site
from django.test import Client, TestCase, modify_settings, override_settings
from .settings import FLATPAGES_TEMPLATES
@modify_settings(INSTALLED_APPS={'append': 'django.contr... | bsd-3-clause |
rmetzger/flink | flink-python/pyflink/table/table_result.py | 5 | 11562 | ################################################################################
# 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... | apache-2.0 |
qitta/libhugin | hugin/harvest/provider/omdb/omdbmovie.py | 1 | 5772 | #!/usr/bin/env python
# encoding: utf-8
# stdlib
from parse import parse
from urllib.parse import urlencode, quote_plus
import json
#hugin
from hugin.utils.stringcompare import string_similarity_ratio
from hugin.harvest.provider.genrenorm import GenreNormalize
import hugin.harvest.provider as provider
class OMDBMov... | gpl-3.0 |
poljeff/odoo | openerp/addons/base/ir/ir_exports.py | 338 | 1672 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the... | agpl-3.0 |
dylanlesko/youtube-dl | youtube_dl/extractor/escapist.py | 98 | 3384 | from __future__ import unicode_literals
import json
from .common import InfoExtractor
from ..compat import compat_urllib_request
from ..utils import (
determine_ext,
clean_html,
int_or_none,
float_or_none,
)
def _decrypt_config(key, string):
a = ''
i = ''
r = ''
while len(a) < (len... | unlicense |
berrange/nova | nova/scheduler/filters/aggregate_multitenancy_isolation.py | 20 | 1972 | # Copyright (c) 2011-2013 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Un... | apache-2.0 |
cashtag/cashtag | contrib/spendfrom/spendfrom.py | 792 | 10053 | #!/usr/bin/env python
#
# Use the raw transactions API to spend bitcoins received on particular addresses,
# and send any change back to that same address.
#
# Example usage:
# spendfrom.py # Lists available funds
# spendfrom.py --from=ADDRESS --to=ADDRESS --amount=11.00
#
# Assumes it will talk to a bitcoind or Bit... | mit |
ArchiFleKs/magnum | api-ref/source/conf.py | 2 | 6595 | # -*- 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, softwa... | apache-2.0 |
danche354/Sequence-Labeling | ner_BIOES/senna-hash-2-pos-chunk-gazetteer-BIOES-128-64.py | 1 | 7837 | from keras.models import Model
from keras.layers import Input, Masking, Dense, LSTM
from keras.layers import Dropout, TimeDistributed, Bidirectional, merge
from keras.layers.embeddings import Embedding
from keras.utils import np_utils
import numpy as np
import pandas as pd
import sys
import math
import os
from dateti... | mit |
oasiswork/odoo | addons/mail/tests/test_message_read.py | 199 | 14584 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2012-TODAY OpenERP S.A. <http://openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of ... | agpl-3.0 |
yinghuocho/firefly-proxy | DEPRECATED_PYTHON_SRC/gsocks/socks_relay.py | 6 | 4538 | # a relay forward local socks to remote socks,
import logging
from gevent import socket
from relay import RelayFactory, RelaySession, RelaySessionError
from utils import pipe_tcp, bind_local_udp, request_fail, send_request, \
sock_addr_info, read_reply, request_success, pipe_udp, read_init_request, \
read_init_reply... | bsd-2-clause |
odicraig/kodi2odi | addons/plugin.video.salts/scrapers/solar_scraper.py | 1 | 4876 | """
SALTS XBMC Addon
Copyright (C) 2014 tknorris
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.
T... | gpl-3.0 |
mabseher/htd | test/googletest/googletest-release-1.10.0/googlemock/scripts/generator/cpp/gmock_class_test.py | 69 | 11712 | #!/usr/bin/env python
#
# Copyright 2009 Neal Norwitz All Rights Reserved.
# Portions 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
#
# ... | gpl-3.0 |
goldsborough/.emacs | .emacs.d/.python-environments/default/lib/python3.5/site-packages/pip/_vendor/requests/packages/chardet/utf8prober.py | 2919 | 2652 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Con... | mit |
axm108/CPWResonator | cpwprop/cpw_resonator.py | 1 | 8789 | from scipy.special import ellipk
from scipy.constants import epsilon_0, mu_0, pi
import numpy as np
import pandas as pd
from .materials import *
class CPWResonator:
"""
Coplanar wave-guide resonator class
"""
def __init__(self, length, conductorWidth, gapWidth, conductorThickness, resonatorType,
... | mit |
vFense/vFenseAgent-nix | agent/deps/rpm-32/Python-2.7.5/lib/python2.7/test/sortperf.py | 232 | 4746 | """Sort performance test.
See main() for command line syntax.
See tabulate() for output format.
"""
import sys
import time
import random
import marshal
import tempfile
import os
td = tempfile.gettempdir()
def randfloats(n):
"""Return a list of n random floats in [0, 1)."""
# Generating floats is expensive,... | lgpl-3.0 |
tpatil2/ConnectX | googletest/test/gtest_list_tests_unittest.py | 1898 | 6515 | #!/usr/bin/env python
#
# Copyright 2006, 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... | unlicense |
iabdalkader/openmv | scripts/examples/12-Thermopile-Shield/MLX90640_overlay.py | 1 | 1712 | # MLX90640 Overlay Demo
#
# This example shows off how to overlay a heatmap onto your OpenMV Cam's
# live video output from the main camera.
import sensor, image, time, fir
ALT_OVERLAY = False # Set to True to allocate a second ir image.
sensor.reset()
sensor.set_pixformat(sensor.RGB565)
sensor.set_framesize(sensor.... | mit |
reddymeghraj/showroom | erpnext/controllers/selling_controller.py | 10 | 9656 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.utils import cint, flt, cstr, comma_or
from erpnext.setup.utils import get_company_currency
from frappe import _, throw
from e... | agpl-3.0 |
AlanZatarain/cortex-vfx | test/IECore/CamelCaseTest.py | 12 | 5185 | ##########################################################################
#
# Copyright (c) 2010, John Haddon. All rights reserved.
# Copyright (c) 2011, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that ... | bsd-3-clause |
codeforeurope/Change-By-Us | controllers/project.py | 3 | 20727 | """
:copyright: (c) 2011 Local Projects, all rights reserved
:license: Affero GNU GPL v3, see LICENSE for more details.
"""
from framework.controller import *
import framework.util as util
import giveaminute.project as mProject
import giveaminute.idea as mIdea
import giveaminute.projectResource as mProjectReso... | agpl-3.0 |
grupoprog3/proyecto_final | proyecto/flask/Lib/site-packages/wtforms/ext/appengine/fields.py | 177 | 7574 | from __future__ import unicode_literals
import decimal
import operator
from wtforms import fields, widgets
from wtforms.compat import text_type, string_types
class ReferencePropertyField(fields.SelectFieldBase):
"""
A field for ``db.ReferenceProperty``. The list items are rendered in a
select.
:par... | apache-2.0 |
sharkykh/SickRage | sickbeard/providers/t411.py | 1 | 7414 | # coding=utf-8
# Author: djoole <bobby.djoole@gmail.com>
#
# URL: https://sickrage.github.io
#
# 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 of ... | gpl-3.0 |
tengteng/learning-spark | src/python/MLlib.py | 42 | 2787 | #
# 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... | mit |
wdzhou/mantid | scripts/reduction/instruments/reflectometer/wks_utility.py | 2 | 62637 | #pylint: disable=too-many-lines,invalid-name,too-many-arguments, too-many-locals, unused-argument
from __future__ import (absolute_import, division, print_function)
from numpy import zeros, arctan2, arange, shape, sqrt, fliplr, asfarray, mean, sum, NAN
from mantid.simpleapi import *
import math
import os.path
from six.... | gpl-3.0 |
davelab6/nototools | nototools/extract_ohchr_attributions.py | 4 | 8886 | #!/usr/bin/python
#
# Copyright 2015 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by... | apache-2.0 |
Celedhrim/persomov | libs/html5lib/treewalkers/dom.py | 1229 | 1457 | from __future__ import absolute_import, division, unicode_literals
from xml.dom import Node
import gettext
_ = gettext.gettext
from . import _base
class TreeWalker(_base.NonRecursiveTreeWalker):
def getNodeDetails(self, node):
if node.nodeType == Node.DOCUMENT_TYPE_NODE:
return _base.DOCTYP... | gpl-3.0 |
patelb10/RackHD | test/tests/api/v2_0/os_install_tests.py | 19 | 21614 | from config.api2_0_config import *
from config.settings import *
from modules.logger import Log
from workflows_tests import WorkflowsTests as workflows
from proboscis.asserts import assert_equal
from proboscis import test
from proboscis import after_class
from proboscis import before_class
from proboscis.asserts import... | apache-2.0 |
wbinventor/openmc | examples/python/reflective/build-xml.py | 4 | 2845 | import numpy as np
import openmc
###############################################################################
# Simulation Input File Parameters
###############################################################################
# OpenMC simulation parameters
batches = 500
inactive = 10
particles ... | mit |
valentin-krasontovitsch/ansible | lib/ansible/modules/network/fortios/fortios_firewall_ippool6.py | 7 | 8049 | #!/usr/bin/python
from __future__ import (absolute_import, division, print_function)
# Copyright 2018 Fortinet, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the Lic... | gpl-3.0 |
trnewman/VT-USRP-daughterboard-drivers | gnuradio-examples/python/digital/pick_bitrate.py | 12 | 5999 | #
# Copyright 2005,2006 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later versi... | gpl-3.0 |
lotube/lotube | lotube/videos/abstract_models.py | 1 | 3269 | from django.db import models
from django.db.models import OneToOneField
from config import constants as globalConstants
from core.fields import RestrictedNonAnimatedImageField, RestrictedVideoField
from core.models import LowerCaseCharField
from core.validators import Common
from users.models import User
from .manager... | mit |
tellapart/Diamond | src/diamond/handler/rabbitmq_pubsub.py | 3 | 6682 | # coding=utf-8
"""
Output the collected values to RabitMQ pub/sub channel
"""
from Handler import Handler
import time
try:
import pika
pika # Pyflakes
except ImportError:
pika = None
class rmqHandler (Handler):
"""
Implements the abstract Handler class
Sending data to a RabbitMQ pub/su... | mit |
Karosuo/Linux_tools | xls_handlers/xls_sum_venv/lib/python3.6/site-packages/pip/_internal/vcs/subversion.py | 8 | 7081 | from __future__ import absolute_import
import logging
import os
import re
from pip._internal.utils.logging import indent_log
from pip._internal.utils.misc import (
display_path, make_vcs_requirement_url, rmtree, split_auth_from_netloc,
)
from pip._internal.vcs import VersionControl, vcs
_svn_xml_url_re = re.comp... | gpl-3.0 |
gauravbose/digital-menu | django/contrib/gis/gdal/prototypes/generation.py | 122 | 4122 | """
This module contains functions that generate ctypes prototypes for the
GDAL routines.
"""
from ctypes import c_char_p, c_double, c_int, c_void_p
from functools import partial
from django.contrib.gis.gdal.prototypes.errcheck import (
check_arg_errcode, check_const_string, check_errcode, check_geom,
check_... | bsd-3-clause |
felipsmartins/namebench | libnamebench/base_ui.py | 172 | 10284 | # 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 by applicable law or ... | apache-2.0 |
WillisXChen/django-oscar | oscar/lib/python2.7/site-packages/PIL/ImageMode.py | 47 | 1306 | #
# The Python Imaging Library.
# $Id$
#
# standard mode descriptors
#
# History:
# 2006-03-20 fl Added
#
# Copyright (c) 2006 by Secret Labs AB.
# Copyright (c) 2006 by Fredrik Lundh.
#
# See the README file for information on usage and redistribution.
#
# mode descriptor cache
_modes = {}
##
# Wrapper for mode s... | bsd-3-clause |
WhireCrow/openwrt-mt7620 | staging_dir/target-mipsel_r2_uClibc-0.9.33.2/usr/lib/python2.7/idlelib/OutputWindow.py | 38 | 4392 | from Tkinter import *
from idlelib.EditorWindow import EditorWindow
import re
import tkMessageBox
from idlelib import IOBinding
class OutputWindow(EditorWindow):
"""An editor window that can serve as an output file.
Also the future base class for the Python shell window.
This class has no input facilitie... | gpl-2.0 |
lekston/ardupilot | libraries/AP_HAL_ChibiOS/hwdef/scripts/embed.py | 3 | 1467 | #!/usr/bin/env python
'''
script to create embedded.c from a set of static files
Andrew Tridgell
May 2017
'''
import os
def write_encode(out, s):
out.write(s.encode())
def embed_file(out, f, idx):
'''embed one file'''
contents = open(f,'rb').read()
write_encode(out, 'static const uint8_t ap_romfs_%... | gpl-3.0 |
Pulgama/supriya | supriya/examples/grey_wash/synthdefs/allpass.py | 1 | 2011 | from supriya import synthdefs, ugens
from .. import project_settings
def signal_block_pre(builder, source, state):
source *= ugens.Line.kr(duration=0.1) # protect against clicks
return source
def signal_block(builder, source, state):
allpasses = []
maximum_delay = 1
iterations = state.get("ite... | mit |
vbannai/neutron | neutron/tests/unit/nec/test_security_group.py | 7 | 4054 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright 2013, NEC Corporation
# 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.o... | apache-2.0 |
xuleiboy1234/autoTitle | tensorflow/tensorflow/python/training/evaluation_test.py | 59 | 6429 | # 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 applicable ... | mit |
buzztroll/cloudinit.d | cloudinitd/nosetests/__init__.py | 2 | 1238 |
import cloudinitd
import os
dir = os.path.dirname(os.path.abspath(cloudinitd.__file__))
dir = os.path.dirname(dir)
g_plans_dir = os.path.join(dir, "tests/plans/")
if 'CLOUDINITD_IAAS_ACCESS_KEY' not in os.environ and 'CLOUDINITD_IAAS_SECRET_KEY' not in os.environ:
os.environ['CLOUDINITD_TESTENV'] = "1"
os.e... | apache-2.0 |
bhcopeland/ansible-modules-extras | system/alternatives.py | 29 | 5333 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Ansible module to manage symbolic link alternatives.
(c) 2014, Gabe Mulley <gabe.mulley@gmail.com>
(c) 2015, David Wittman <dwittman@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 Gene... | gpl-3.0 |
peastman/msmbuilder | msmbuilder/preprocessing/__init__.py | 9 | 3185 | # Author: Carlos Xavier Hernandez <cxh@stanford.edu>
# Contributors:
# Copyright (c) 2016, Stanford University and the Authors
# All rights reserved.
from __future__ import print_function, division, absolute_import
from sklearn import preprocessing
from .base import (MultiSequencePreprocessingMixin,
... | lgpl-2.1 |
vitan/hue | desktop/libs/hadoop/gen-py/hadoop/api/hdfs/Namenode.py | 37 | 155600 | #
# Autogenerated by Thrift Compiler (0.9.0)
#
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
#
# options string: py:new_style
#
from thrift.Thrift import TType, TMessageType, TException, TApplicationException
import hadoop.api.common.HadoopServiceBase
from ttypes import *
from thrift.Thrift impor... | apache-2.0 |
willthames/ansible | lib/ansible/utils/color.py | 32 | 3891 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... | gpl-3.0 |
rdio/sentry | src/sentry/migrations/0103_ensure_non_empty_slugs.py | 1 | 26406 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import DataMigration
from django.db import models
class Migration(DataMigration):
def forwards(self, orm):
from sentry.constants import RESERVED_TEAM_SLUGS
from sentry.models import slugify_instance
for team in ... | bsd-3-clause |
damdam-s/hr | __unported__/hr_policy_presence/hr_policy_presence.py | 27 | 3008 | # -*- coding:utf-8 -*-
#
#
# Copyright (C) 2013 Michael Telahun Makonnen <mmakonnen@gmail.com>.
# All Rights Reserved.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, eit... | agpl-3.0 |
kaplun/ops | modules/bibfield/lib/functions/get_number_of_reviews.py | 24 | 1049 | # -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2013 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) a... | gpl-2.0 |
allanino/nupic | nupic/data/generators/pattern_machine.py | 13 | 5172 | # ----------------------------------------------------------------------
# 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 apply:
#
# This progra... | agpl-3.0 |
buguen/pylayers | pylayers/location/geometric/constraints/exclude.py | 1 | 3165 | # -*- coding:Utf-8 -*-
#####################################################################
#This file is part of RGPA.
#Foobar 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, ... | lgpl-3.0 |
toshywoshy/ansible | lib/ansible/modules/cloud/vultr/vultr_startup_script.py | 21 | 7337 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2018, René Moser <mail@renemoser.net>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version':... | gpl-3.0 |
askulkarni2/ansible-modules-core | windows/win_file.py | 42 | 2574 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2015, Jon Hawkesworth (@jhawkesworth) <figs@unity.demon.co.uk>
#
# 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, eith... | gpl-3.0 |
ckirby/django | tests/auth_tests/test_tokens.py | 297 | 2551 | import unittest
from datetime import date, timedelta
from django.conf import settings
from django.contrib.auth.models import User
from django.contrib.auth.tokens import PasswordResetTokenGenerator
from django.test import TestCase
from django.utils.six import PY3
class TokenGeneratorTest(TestCase):
def test_make... | bsd-3-clause |
evancich/apm_motor | modules/waf/waflib/extras/fsc.py | 4 | 1899 | #!/usr/bin/env python
# encoding: utf-8
# Thomas Nagy, 2011 (ita)
"""
Experimental F# stuff
FSC="mono /path/to/fsc.exe" waf configure build
"""
from waflib import Utils, Task
from waflib.TaskGen import before_method, after_method, feature
from waflib.Tools import ccroot, cs
ccroot.USELIB_VARS['fsc'] = set(['CSFLAGS... | gpl-3.0 |
yuchuanzhen/shadowsocks | shadowsocks/manager.py | 925 | 9692 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2015 clowwindy
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | apache-2.0 |
IONISx/edx-platform | common/lib/calc/calc/tests/test_preview.py | 257 | 8723 | # -*- coding: utf-8 -*-
"""
Unit tests for preview.py
"""
import unittest
from calc import preview
import pyparsing
class LatexRenderedTest(unittest.TestCase):
"""
Test the initializing code for LatexRendered.
Specifically that it stores the correct data and handles parens well.
"""
def test_sim... | agpl-3.0 |
yephper/django | tests/template_tests/filter_tests/test_iriencode.py | 1 | 1646 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.template.defaultfilters import iriencode, urlencode
from django.test import SimpleTestCase
from django.utils.safestring import mark_safe
from ..utils import setup
class IriencodeTests(SimpleTestCase):
"""
Ensure iriencod... | bsd-3-clause |
sanketdjain/box-python-sdk | boxsdk/client.py | 4 | 11505 | # coding: utf-8
from __future__ import unicode_literals
import json
from .config import API
from .session.box_session import BoxSession
from .network.default_network import DefaultNetwork
from .object.user import User
from .object.folder import Folder
from .object.search import Search
from .object.events import Event... | apache-2.0 |
NikolayChesnokov/webgsrp3 | local/webviewmodelmanager.py | 2 | 1390 | # --*-- coding: utf-8 --*--
from os.path import join as opj
import os
from lxml import etree
from local.manager import Manager
class webviewModelManager(Manager):
"""
Загрузка view
"""
_name = 'webviewModelManager'
_alias = 'model'
_allow = {}
_inherit = 'web.view'
_list_methods = ('load', 'save')
def load(... | agpl-3.0 |
eduardomartins/ProjectEuler | Python/problem14.py | 1 | 2101 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# problem14.py
#
# Copyright 2017 Eduardo Sant'Anna Martins <eduardo@eduardomartins.site>
#
# 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; e... | gpl-2.0 |
etherkit/OpenBeacon2 | client/linux-x86/venv/lib/python3.8/site-packages/_pyinstaller_hooks_contrib/hooks/stdhooks/hook-shapely.py | 3 | 2470 | # ------------------------------------------------------------------
# Copyright (c) 2020 PyInstaller Development Team.
#
# This file is distributed under the terms of the GNU General Public
# License (version 2.0 or later).
#
# The full license is available in LICENSE.GPL.txt, distributed with
# this software.
#
# SPD... | gpl-3.0 |
NewProggie/Cpp-Project-Template | thirdparty/gtest-1.7.0/test/gtest_color_test.py | 3259 | 4911 | #!/usr/bin/env python
#
# Copyright 2008, 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... | mit |
comiconomenclaturist/libretime | python_apps/airtime_analyzer/airtime_analyzer/airtime_analyzer.py | 2 | 3322 | """Contains the main application class for airtime_analyzer.
"""
import logging
import logging.handlers
import sys
import signal
import traceback
import config_file
from functools import partial
from metadata_analyzer import MetadataAnalyzer
from replaygain_analyzer import ReplayGainAnalyzer
from status_reporter import... | agpl-3.0 |
Lemma1/MAC-POSTS | doc_builder/sphinx-contrib/argdoc/sphinxcontrib/argdoc/test/cases/c5_with_epilog.py | 1 | 2878 | #!/usr/bin/env python
"""Subcommands, each having its own epilog
An epilog should appear at the bottom of each command-group section
"""
import argparse
import sys
main_epilog = """This is a multi-line epilog which should appear at the bottom of the module
docstring and also follow all of the options, arguments, et c... | mit |
nzavagli/UnrealPy | UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/boto-2.38.0/boto/services/result.py | 153 | 5596 | #!/usr/bin/env python
# Copyright (c) 2006,2007 Mitch Garnaat http://garnaat.org/
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rig... | mit |
obnam-mirror/obnam | obnamlib/fmt_ga/format.py | 1 | 4838 | # Copyright 2015-2016 Lars Wirzenius
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed ... | gpl-3.0 |
JioEducation/edx-platform | common/djangoapps/edxmako/paths.py | 23 | 4914 | """
Set up lookup paths for mako templates.
"""
import hashlib
import contextlib
import os
import pkg_resources
from django.conf import settings
from mako.lookup import TemplateLookup
from mako.exceptions import TopLevelLookupException
from . import LOOKUP
from openedx.core.djangoapps.theming.helpers import (
ge... | agpl-3.0 |
unicri/edx-platform | common/test/acceptance/pages/studio/settings_group_configurations.py | 74 | 10062 | """
Course Group Configurations page.
"""
from bok_choy.promise import EmptyPromise
from .course_page import CoursePage
from .utils import confirm_prompt
class GroupConfigurationsPage(CoursePage):
"""
Course Group Configurations page.
"""
url_path = "group_configurations"
experiment_groups_css = ... | agpl-3.0 |
ironbox360/django | django/core/checks/urls.py | 110 | 2727 | from __future__ import unicode_literals
from . import Tags, Warning, register
@register(Tags.urls)
def check_url_config(app_configs, **kwargs):
from django.core.urlresolvers import get_resolver
resolver = get_resolver()
return check_resolver(resolver)
def check_resolver(resolver):
"""
Recursive... | bsd-3-clause |
ghandiosm/Test | addons/l10n_be_invoice_bba/partner.py | 47 | 1364 | # -*- encoding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
# Copyright (c) 2011 Noviat nv/sa (www.noviat.be). All rights reserved.
from openerp.osv import fields, osv
import time
from openerp.tools.translate import _
class res_partner(osv.osv):
""" add field to indicat... | gpl-3.0 |
iamgreaser/pysnip | pyspades/collision.py | 8 | 1431 | # Copyright (c) Mathias Kaerlev 2011-2012.
# This file is part of pyspades.
# pyspades is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version... | gpl-3.0 |
cul-it/Invenio | modules/bibsort/web/admin/bibsortadmin.py | 2 | 3766 | ## This file is part of Invenio.
## Copyright (C) 2011, 2012 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 version.
##
... | gpl-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.