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 |
|---|---|---|---|---|---|
RudoCris/horizon | openstack_dashboard/dashboards/project/vpn/tables.py | 12 | 12217 | # Copyright 2013, Mirantis Inc
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agre... | apache-2.0 |
SoftwareKing/zstack-woodpecker | zstackwoodpecker/zstackwoodpecker/operations/tag_operations.py | 1 | 1832 | '''
Tag related operations
@author: Youyk
'''
import apibinding.api_actions as api_actions
import zstackwoodpecker.test_util as test_util
import account_operations
import apibinding.inventory as inventory
def create_system_tag(resourceType, resourceUuid, tag, session_uuid=None):
action = api_action... | apache-2.0 |
pshchelo/ironic | doc/source/conf.py | 3 | 4390 | # -*- 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, s... | apache-2.0 |
jingjidejuren/kafka | tests/kafkatest/tests/benchmark_test.py | 21 | 9596 | # 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 use ... | apache-2.0 |
agaldona/odoomrp-utils | product_cost_utilities/models/product.py | 4 | 1581 | # -*- coding: utf-8 -*-
# © 2015 Esther Martín - AvanzOSC
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
from openerp import api, models, fields
import openerp.addons.decimal_precision as dp
class ProductProduct(models.Model):
_inherit = 'product.product'
@api.multi
@api.depends('list_... | agpl-3.0 |
nexusz99/boto | boto/ec2/elb/policies.py | 152 | 3856 | # Copyright (c) 2010 Reza Lotun http://reza.lotun.name
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, m... | mit |
mspark93/VTK | ThirdParty/Twisted/twisted/trial/_dist/test/test_workerreporter.py | 35 | 3765 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted.trial._dist.workerreporter}.
"""
from twisted.python.failure import Failure
from twisted.trial.unittest import TestCase, Todo
from twisted.trial._dist.workerreporter import WorkerReporter
from twisted.trial._dist import ma... | bsd-3-clause |
michalliu/OpenWrt-Firefly-Libraries | staging_dir/target-mipsel_1004kc+dsp_uClibc-0.9.33.2/usr/lib/python2.7/gettext.py | 202 | 19859 | """Internationalization and localization support.
This module provides internationalization (I18N) and localization (L10N)
support for your Python programs by providing an interface to the GNU gettext
message catalog library.
I18N refers to the operation by which a program is made aware of multiple
languages. L10N r... | gpl-2.0 |
tiangolo/ansible | contrib/inventory/proxmox.py | 43 | 5558 | #!/usr/bin/env python
# Copyright (C) 2014 Mathieu GAUTHIER-LAFAYE <gauthierl@lapth.cnrs.fr>
#
# 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 op... | gpl-3.0 |
SuperStarPL/mopidy | tests/models/test_legacy.py | 17 | 5428 | from __future__ import absolute_import, unicode_literals
import unittest
from mopidy.models import ImmutableObject
class Model(ImmutableObject):
uri = None
name = None
models = frozenset()
def __init__(self, *args, **kwargs):
self.__dict__['models'] = frozenset(kwargs.pop('models', None) or... | apache-2.0 |
dcroc16/skunk_works | google_appengine/lib/django-1.3/django/contrib/gis/tests/geoapp/tests.py | 155 | 35125 | import re
from django.db import connection
from django.contrib.gis import gdal
from django.contrib.gis.geos import fromstr, GEOSGeometry, \
Point, LineString, LinearRing, Polygon, GeometryCollection
from django.contrib.gis.measure import Distance
from django.contrib.gis.tests.utils import \
no_mysql, no_oracle,... | mit |
laperry1/android_external_chromium_org | build/win/reorder-imports.py | 103 | 1807 | #!/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.
import glob
import optparse
import os
import shutil
import subprocess
import sys
def reorder_imports(input_dir, output_dir, architectu... | bsd-3-clause |
Lilykos/invenio | invenio/modules/deposit/testsuite/test_deposit_models.py | 12 | 2304 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2014, 2015 CERN.
#
# Invenio is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (at your option) any... | gpl-2.0 |
rileychapman/roscopter-1 | mavlink/pymavlink/tools/mavgpslock.py | 11 | 2090 | #!/usr/bin/env python
'''
show GPS lock events in a MAVLink log
'''
import sys, time, os
from optparse import OptionParser
parser = OptionParser("gpslock.py [options]")
parser.add_option("--condition", default=None, help="condition for packets")
(opts, args) = parser.parse_args()
from pymavlink import mavutil
if ... | bsd-3-clause |
luongtphu/thrift-delphi2007 | contrib/fb303/py/fb303_scripts/fb303_simple_mgmt.py | 171 | 5961 | #!/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
# "L... | apache-2.0 |
jaw20/Crunchyroll-XML-Decoder | crunchy-xml-decoder/requests/packages/chardet/langbulgarianmodel.py | 2965 | 12784 | ######################## 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... | gpl-2.0 |
divergence-kernel/d2lte-kernel | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/SchedGui.py | 12980 | 5411 | # SchedGui.py - Python extension for perf script, basic GUI code for
# traces drawing and overview.
#
# Copyright (C) 2010 by Frederic Weisbecker <fweisbec@gmail.com>
#
# This software is distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Free Software
# Foundation.
... | gpl-2.0 |
rafalo1333/kivy | kivy/core/camera/camera_gi.py | 21 | 5752 | '''
Gi Camera
=========
Implement CameraBase with Gi / Gstreamer, working on both Python 2 and 3
'''
__all__ = ('CameraGi', )
from gi.repository import Gst
from kivy.clock import Clock
from kivy.graphics.texture import Texture
from kivy.core.camera import CameraBase
from kivy.support import install_gobject_iteration... | mit |
ZJaffee/compose | tests/unit/progress_stream_test.py | 32 | 1252 | from __future__ import absolute_import
from __future__ import unicode_literals
from six import StringIO
from compose import progress_stream
from tests import unittest
class ProgressStreamTestCase(unittest.TestCase):
def test_stream_output(self):
output = [
b'{"status": "Downloading", "progre... | apache-2.0 |
denniss17/charm | charm/schemes/protocol_a01.py | 2 | 8762 | '''
:Blind Signature Scheme
| From: "M. Abe A Secure Three-move Blind Signature Scheme for Polynomially
| Many Signatures"
| Published in: EUROCRYPT 2001
| Available from: http://www.iacr.org/archive/eurocrypt2001/20450135.pdf
* type: signature
* setting: integer groups
:Authors: Antonio de l... | lgpl-3.0 |
MER-GROUP/intellij-community | python/helpers/pydev/pydevd_attach_to_process/winappdbg/compat.py | 102 | 5230 | # Partial copy of https://bitbucket.org/gutworth/six/src/8e634686c53a35092dd705172440a9231c90ddd1/six.py?at=default
# With some differences to take into account that the iterXXX version may be defined in user code.
# Original __author__ = "Benjamin Peterson <benjamin@python.org>"
# Base __version__ = "1.7.3"
# Copyri... | apache-2.0 |
belokop/indico_bare | indico/testing/fixtures/smtp.py | 2 | 1261 | # This file is part of Indico.
# Copyright (C) 2002 - 2016 European Organization for Nuclear Research (CERN).
#
# Indico 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 (a... | gpl-3.0 |
chenjun0210/tensorflow | tensorflow/tensorboard/plugins/projector/projector_plugin_test.py | 7 | 27312 | # -*- coding: utf-8 -*-
# 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
#
# Un... | apache-2.0 |
participedia/pontoon | pontoon/base/migrations/0080_auto_20170127_0159.py | 2 | 1320 | # -*- coding: utf-8 -*-
# Generated by Django 1.9.10 on 2017-01-27 01:59
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('base', '0079_auto_20170216_2320'),
]
operations = [
migrations.AddField(
... | bsd-3-clause |
xiangke/pycopia | aid/pycopia/words.py | 1 | 1795 | #!/usr/bin/python2.4
# vim:ts=4:sw=4:softtabstop=4:smarttab:expandtab
#
# $Id$
#
# Copyright (C) 1999-2006 Keith Dart <keith@kdart.com>
#
# 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... | lgpl-2.1 |
lenstr/rethinkdb | external/v8_3.30.33.16/testing/gmock/gtest/test/gtest_shuffle_test.py | 3023 | 12549 | #!/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 of... | agpl-3.0 |
Edraak/edx-platform | openedx/core/djangoapps/credit/migrations/0001_initial.py | 48 | 12567 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import openedx.core.djangoapps.credit.models
import model_utils.fields
import xmodule_django.models
import jsonfield.fields
import django.db.models.deletion
import django.utils.timezone
from django.conf import sett... | agpl-3.0 |
achang97/YouTunes | lib/python2.7/site-packages/pip/utils/logging.py | 516 | 3327 | from __future__ import absolute_import
import contextlib
import logging
import logging.handlers
import os
try:
import threading
except ImportError:
import dummy_threading as threading
from pip.compat import WINDOWS
from pip.utils import ensure_dir
try:
from pip._vendor import colorama
# Lots of differen... | mit |
skylarker/jasper-client | client/modules/Joke.py | 34 | 1472 | # -*- coding: utf-8-*-
import random
import re
from client import jasperpath
WORDS = ["JOKE", "KNOCK KNOCK"]
def getRandomJoke(filename=jasperpath.data('text', 'JOKES.txt')):
jokeFile = open(filename, "r")
jokes = []
start = ""
end = ""
for line in jokeFile.readlines():
line = line.replac... | mit |
lecaoquochung/ddnb.django | django/contrib/contenttypes/forms.py | 93 | 3837 | from __future__ import unicode_literals
from django.db import models
from django.forms import ModelForm, modelformset_factory
from django.forms.models import BaseModelFormSet
from django.contrib.contenttypes.models import ContentType
class BaseGenericInlineFormSet(BaseModelFormSet):
"""
A formset for generic... | bsd-3-clause |
bartsidee/bartsidee-boxee | sources/tv/system/win32/lxml/cssselect.py | 35 | 28750 | """CSS Selectors based on XPath.
This module supports selecting XML/HTML tags based on CSS selectors.
See the `CSSSelector` class for details.
"""
import re
from lxml import etree
__all__ = ['SelectorSyntaxError', 'ExpressionError',
'CSSSelector']
try:
_basestring = basestring
except NameError:
_... | gpl-3.0 |
clumsy/intellij-community | python/lib/Lib/UserList.py | 104 | 3539 | """A more or less complete user-defined wrapper around list objects."""
class UserList:
def __init__(self, initlist=None):
self.data = []
if initlist is not None:
# XXX should this accept an arbitrary sequence?
if type(initlist) == type(self.data):
self.data[... | apache-2.0 |
mudler/entropy | client/solo/commands/query.py | 4 | 55481 | # -*- coding: utf-8 -*-
"""
@author: Fabio Erculiani <lxnay@sabayon.org>
@contact: lxnay@sabayon.org
@copyright: Fabio Erculiani
@license: GPL-2
B{Entropy Command Line Client}.
"""
import os
import sys
import re
import argparse
from entropy.const import etpConst, const_convert_to_unicode, \
... | gpl-2.0 |
drbild/boto | tests/integration/s3/__init__.py | 761 | 1104 | # Copyright (c) 2006-2011 Mitch Garnaat http://garnaat.org/
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modi... | mit |
bittner/django-cms | cms/test_utils/project/sampleapp/views.py | 50 | 2452 | # Create your views here.
from django.http import Http404
from django.shortcuts import render
from django.utils.translation import ugettext_lazy as _
from django.views.decorators.csrf import csrf_exempt
from django.views.generic.base import TemplateView
from cms.test_utils.project.sampleapp.models import Category
from... | bsd-3-clause |
iShoto/testpy | codes/20200113_pytorch_cifar10_arcface/src/metrics.py | 4 | 5450 | from __future__ import print_function
from __future__ import division
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.nn import Parameter
import math
class ArcMarginProduct(nn.Module):
r"""Implement of large margin arc distance: :
Args:
in_features: size of each input sample
out... | mit |
aleksandar-mitrevski/robot_simulation | localisation/scripts/motion_model.py | 1 | 2619 | from math import cos, sin, atan2, exp, sqrt, pi
from random import uniform
from copy import copy
from pose import Pose
from velocity import Velocity
from filter_parameters import MotionModelNoiseParameters
class MotionModel(object):
'''Defines a utility for sampling a motion model.
Author -- Aleksandar Mitre... | mit |
TexasLAN/texaslan.org | texaslan/users/migrations/0007_auto_20170115_1721.py | 1 | 1682 | # -*- coding: utf-8 -*-
# Generated by Django 1.10 on 2017-01-15 23:21
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('users', '0006_auto_20160822_0840'),
]
operations = [
migrations.AddField(
... | mit |
Anonymous-X6/django | django/template/library.py | 348 | 12752 | import functools
import warnings
from importlib import import_module
from django.utils import six
from django.utils.deprecation import RemovedInDjango20Warning
from django.utils.html import conditional_escape
from django.utils.inspect import getargspec
from django.utils.itercompat import is_iterable
from .base import... | bsd-3-clause |
johnkit/vtk-dev | ThirdParty/Twisted/twisted/internet/test/test_abstract.py | 47 | 1631 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted.internet.abstract}, a collection of APIs for implementing
reactors.
"""
from __future__ import division, absolute_import
from twisted.trial.unittest import SynchronousTestCase
from twisted.internet.abstract import isIPv6... | bsd-3-clause |
drpngx/tensorflow | tensorflow/python/layers/core.py | 9 | 12586 | # 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 |
7kbird/chrome | tools/telemetry/telemetry/core/platform/power_monitor/__init__.py | 69 | 1150 | # 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.core import exceptions
class PowerMonitor(object):
"""A power profiler.
Provides an interface to register power consumption during a te... | bsd-3-clause |
apdjustino/DRCOG_Urbansim | src/opus_gui/main/controllers/opus_gui_configuration.py | 1 | 6695 | # Opus/UrbanSim urban simulation software.
# Copyright (C) 2010-2011 University of California, Berkeley, 2005-2009 University of Washington
# See opus_core/LICENSE
import os
from lxml.etree import ElementTree, SubElement
from PyQt4.QtCore import Qt
from PyQt4.QtGui import QSplashScreen, QPixmap
from opus_core.misc i... | agpl-3.0 |
runarberg/servo | tests/wpt/web-platform-tests/tools/pywebsocket/src/mod_pywebsocket/xhr_benchmark_handler.py | 415 | 3944 | # Copyright 2014 Google Inc. All rights reserved.
#
# Use of this source code is governed by a BSD-style
# license that can be found in the COPYING file or at
# https://developers.google.com/open-source/licenses/bsd
from mod_pywebsocket import util
class XHRBenchmarkHandler(object):
def __init__(self, headers, ... | mpl-2.0 |
cgvarela/Impala | thirdparty/avro-c-1.7.4/jansson/doc/ext/refcounting.py | 61 | 1715 | """
refcounting
~~~~~~~~~~~
Reference count annotations for C API functions. Has the same
result as the sphinx.ext.refcounting extension but works for all
functions regardless of the signature, and the reference counting
information is written inline with the documentation instead of a
sepa... | apache-2.0 |
bigdatauniversity/edx-platform | lms/djangoapps/courseware/tests/test_course_info.py | 20 | 6029 | """
Test the course_info xblock
"""
import mock
from nose.plugins.attrib import attr
from urllib import urlencode
from django.conf import settings
from django.core.urlresolvers import reverse
from django.test.utils import override_settings
from opaque_keys.edx.locations import SlashSeparatedCourseKey
from util.date_u... | agpl-3.0 |
funkyfuture/docker-py | docker/models/volumes.py | 14 | 2848 | from ..api import APIClient
from .resource import Model, Collection
class Volume(Model):
"""A volume."""
id_attribute = 'Name'
@property
def name(self):
"""The name of the volume."""
return self.attrs['Name']
def remove(self, force=False):
"""
Remove this volume.
... | apache-2.0 |
kevinlondon/sentry | src/sentry/migrations/0112_auto__chg_field_option_value__chg_field_useroption_value__chg_field_pr.py | 36 | 23895 | # -*- 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):
pass
def backwards(self, orm):
pass
models = {
'sentry.accessgroup': {
'Meta':... | bsd-3-clause |
sstone/bitcoin | contrib/linearize/linearize-hashes.py | 47 | 5110 | #!/usr/bin/env python3
#
# linearize-hashes.py: List blocks in a linear, no-fork version of the chain.
#
# Copyright (c) 2013-2019 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
from http.client imp... | mit |
fireball-x/node-freetype2 | vendor/freetype/src/tools/docmaker/utils.py | 515 | 3063 | # Utils (c) 2002, 2004, 2007, 2008 David Turner <david@freetype.org>
#
import string, sys, os, glob
# current output directory
#
output_dir = None
# This function is used to sort the index. It is a simple lexicographical
# sort, except that it places capital letters before lowercase ones.
#
def index_sort( s1, ... | mit |
ftl/dxpad | tests/test.py | 1 | 8396 | #! /usr/bin/env python3
# -*- coding: utf-8 -*-
import sys
import os
import unittest
sys.path.insert(0, os.path.abspath('..'))
import dxpad._location as _location
import dxpad._grid as _grid
import dxpad._notepad as _notepad
import dxpad._callinfo as _callinfo
class TestLatLon(unittest.TestCase):
def test_neigh... | mit |
SamYaple/neutron | neutron/plugins/nuage/nuage_models.py | 47 | 3092 | # Copyright 2014 Alcatel-Lucent USA 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 r... | apache-2.0 |
videetssinghai/Blog-Rest-Api | lib/python2.7/site-packages/pip/vcs/mercurial.py | 514 | 3472 | from __future__ import absolute_import
import logging
import os
import tempfile
from pip.utils import display_path, rmtree
from pip.vcs import vcs, VersionControl
from pip.download import path_to_url
from pip._vendor.six.moves import configparser
logger = logging.getLogger(__name__)
class Mercurial(VersionControl... | mit |
starkdee/courseware | userprofile/views.py | 1 | 1274 | from django.shortcuts import render, redirect
from django.contrib.auth.models import User
from django.contrib.auth.decorators import login_required
from django.forms.models import model_to_dict
from userprofile.models import UserProfile
from userprofile.forms import EditUserForm, EditUserProfileForm
@login_required
... | mit |
petosegan/scikit-learn | sklearn/calibration.py | 137 | 18876 | """Calibration of predicted probabilities."""
# Author: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
# Balazs Kegl <balazs.kegl@gmail.com>
# Jan Hendrik Metzen <jhm@informatik.uni-bremen.de>
# Mathieu Blondel <mathieu@mblondel.org>
#
# License: BSD 3 clause
from __future__ impo... | bsd-3-clause |
darkleons/BE | addons/website/tests/test_crawl.py | 89 | 3321 | # -*- coding: utf-8 -*-
import logging
import urlparse
import unittest2
import urllib2
import time
import werkzeug.urls
import lxml.html
import openerp
from openerp import tools
_logger = logging.getLogger(__name__)
class Crawler(openerp.tests.HttpCase):
""" Test suite crawling an openerp CMS instance and check... | agpl-3.0 |
MNie/ComparisonOfOpenCLOpenMPMPI | src/Libraries/C++/cxxtest-4.4/test/test_cxxtest.py | 44 | 35206 | #-------------------------------------------------------------------------
# CxxTest: A lightweight C++ unit testing library.
# Copyright (c) 2008 Sandia Corporation.
# This software is distributed under the LGPL License v3
# For more information, see the COPYING file in the top CxxTest directory.
# Under the terms of ... | apache-2.0 |
t11e/django | django/utils/safestring.py | 392 | 3812 | """
Functions for working with "safe strings": strings that can be displayed safely
without further escaping in HTML. Marking something as a "safe string" means
that the producer of the string has already turned characters that should not
be interpreted by the HTML engine (e.g. '<') into the appropriate entities.
"""
f... | bsd-3-clause |
ArcherSys/ArcherSys | Lib/site-packages/django/db/backends/sqlite3/introspection.py | 42 | 11044 | import re
from django.db.backends.base.introspection import (
BaseDatabaseIntrospection, FieldInfo, TableInfo,
)
field_size_re = re.compile(r'^\s*(?:var)?char\s*\(\s*(\d+)\s*\)\s*$')
def get_field_size(name):
""" Extract the size number from a "varchar(11)" type name """
m = field_size_re.search(name)
... | mit |
CopeX/odoo | addons/report/models/report.py | 168 | 26320 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2014-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 |
HSAnet/glimpse_client | 3rdparty/breakpad/src/third_party/protobuf/protobuf/python/google/protobuf/internal/generator_test.py | 252 | 10129 | #! /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 |
pbchou/trafficserver | tests/gold_tests/remap/remap_https.test.py | 6 | 4974 | '''
'''
# 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");... | apache-2.0 |
lociii/googleads-python-lib | examples/adspygoogle/dfp/v201208/get_team.py | 4 | 1511 | #!/usr/bin/python
#
# Copyright 2012 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 b... | apache-2.0 |
AllYarnsAreBeautiful/knittingpattern | knittingpattern/test/test_dump_json.py | 1 | 1049 | from pytest import fixture
from unittest.mock import MagicMock
from knittingpattern.Dumper import JSONDumper
import json
from knittingpattern.ParsingSpecification import ParsingSpecification
@fixture
def obj():
return ["123", 123]
@fixture
def dumper(obj):
def dump():
return obj
return JSONDumpe... | lgpl-3.0 |
barbarubra/Don-t-know-What-i-m-doing. | python/src/Demo/curses/xmas.py | 34 | 25499 | # asciixmas
# December 1989 Larry Bartz Indianapolis, IN
#
# $Id: xmas.py 46623 2006-06-03 22:59:23Z andrew.kuchling $
#
# I'm dreaming of an ascii character-based monochrome Christmas,
# Just like the ones I used to know!
# Via a full duplex communications channel,
# At 9600 bits per second,
# Ev... | apache-2.0 |
kobejean/tensorflow | tensorflow/contrib/estimator/python/estimator/extenders_test.py | 6 | 15351 | # 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 |
stephane-martin/salt-debian-packaging | salt-2016.3.2/salt/utils/msazure.py | 3 | 5979 | # -*- coding: utf-8 -*-
'''
.. versionadded:: 2015.8.0
Utilities for accessing storage container blogs on Azure
'''
# Import python libs
from __future__ import absolute_import
import logging
# Import azure libs
HAS_LIBS = False
try:
import azure
HAS_LIBS = True
except ImportError:
pass
# Import salt lib... | apache-2.0 |
GiovanniConserva/TestDeploy | venv/Lib/site-packages/pip/commands/install.py | 156 | 14971 | from __future__ import absolute_import
import logging
import operator
import os
import tempfile
import shutil
import warnings
try:
import wheel
except ImportError:
wheel = None
from pip.req import RequirementSet
from pip.basecommand import RequirementCommand
from pip.locations import virtualenv_no_global, dis... | bsd-3-clause |
40223117cda/w16cdaa | static/Brython3.1.1-20150328-091302/Lib/datetime.py | 628 | 75044 | """Concrete date/time and related types.
See http://www.iana.org/time-zones/repository/tz-link.html for
time zone and DST data sources.
"""
import time as _time
import math as _math
def _cmp(x, y):
return 0 if x == y else 1 if x > y else -1
MINYEAR = 1
MAXYEAR = 9999
_MAXORDINAL = 3652059 # date.max.toordinal()... | gpl-3.0 |
sudosurootdev/external_chromium_org | build/android/pylib/utils/parallelizer_test.py | 96 | 5158 | # 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.
"""Unit tests for the contents of parallelizer.py."""
# pylint: disable=W0212
# pylint: disable=W0613
import os
import tempfile
import time
import unittest... | bsd-3-clause |
MalloyPower/parsing-python | front-end/testsuite-python-lib/Python-2.7/Lib/distutils/command/register.py | 4 | 11630 | """distutils.command.register
Implements the Distutils 'register' command (register with the repository).
"""
# created 2002/10/21, Richard Jones
__revision__ = "$Id: register.py 77717 2010-01-24 00:33:32Z tarek.ziade $"
import urllib2
import getpass
import urlparse
import StringIO
from warnings import warn
from d... | mit |
sgraf812/Celero | test/gtest-1.7.0/test/gtest_env_var_test.py | 2408 | 3487 | #!/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... | apache-2.0 |
orlenko/bccf | src/bccf/migrations/0020_auto__add_field_userprofile_membership_order_free.py | 1 | 45167 | # -*- 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 field 'UserProfile.membership_order_free'
db.add_column(u'bccf_userprofile', 'membership_order_free... | unlicense |
andrewleech/SickRage | lib/sqlalchemy/orm/mapper.py | 75 | 108686 | # orm/mapper.py
# Copyright (C) 2005-2014 the SQLAlchemy authors and contributors <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""Logic to map Python classes to and from selectables.
Defines the :class:`~sqlalchemy... | gpl-3.0 |
kater169/libcloud | libcloud/test/compute/test_gandi.py | 36 | 14727 | # 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 use ... | apache-2.0 |
McNetic/CouchPotatoServer-de | libs/synchronousdeluge/client.py | 151 | 5078 | import os
import platform
from collections import defaultdict
from itertools import imap
from synchronousdeluge.exceptions import DelugeRPCError
from synchronousdeluge.protocol import DelugeRPCRequest, DelugeRPCResponse
from synchronousdeluge.transfer import DelugeTransfer
__all__ = ["DelugeClient"]
RPC_RESPONSE =... | gpl-3.0 |
jessrosenfield/pants | tests/python/pants_test/backend/jvm/tasks/jvm_compile/java/test_zinc_compile_integration.py | 2 | 6031 | # coding=utf-8
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
from pants.util.cont... | apache-2.0 |
aurelieladier/openturns | python/test/t_KrigingAlgorithm_std.py | 1 | 2901 | #! /usr/bin/env python
from __future__ import print_function
from openturns import *
from openturns.testing import *
TESTPREAMBLE()
# Test 1
sampleSize = 6
dimension = 1
f = NumericalMathFunction(['x0'], ['y'], ['x0 * sin(x0)'])
X = NumericalSample(sampleSize, dimension)
X2 = NumericalSample(sampleSize, dimension... | lgpl-3.0 |
sszlm/MissionPlanner | Lib/encodings/cp858.py | 85 | 34969 | """ Python Character Mapping Codec for CP858, modified from cp850.
"""
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_map)
def decode(self,input,errors='strict'):
return codecs... | gpl-3.0 |
bicephale/OctoPrint | src/octoprint/plugins/softwareupdate/version_checks/github_commit.py | 1 | 1955 | # coding=utf-8
from __future__ import absolute_import, division, print_function
__author__ = "Gina Häußge <osd@foosel.net>"
__license__ = 'GNU Affero General Public License http://www.gnu.org/licenses/agpl.html'
__copyright__ = "Copyright (C) 2014 The OctoPrint Project - Released under terms of the AGPLv3 License"
im... | agpl-3.0 |
jantman/RPyMostat-sensor | rpymostat_sensor/version.py | 1 | 1930 | """
The latest version of this package is available at:
<http://github.com/jantman/RPyMostat-sensor>
##################################################################################
Copyright 2016 Jason Antman <jason@jasonantman.com> <http://www.jasonantman.com>
This file is part of RPyMostat-sensor, also known... | agpl-3.0 |
overtherain/scriptfile | software/googleAppEngine/lib/django_1_3/django/contrib/gis/tests/geoapp/feeds.py | 326 | 1856 | from django.contrib.gis import feeds
from django.contrib.gis.tests.utils import mysql
from models import City, Country
class TestGeoRSS1(feeds.Feed):
link = '/city/'
title = 'Test GeoDjango Cities'
def items(self):
return City.objects.all()
def item_link(self, item):
return '/city/%s/... | mit |
kingvuplus/b-p | lib/python/Components/Renderer/Pig.py | 13 | 1178 | ##
## P(icture)i(n)g(raphics) renderer
##
from Renderer import Renderer
from enigma import eVideoWidget, eSize, eRect, ePoint, getDesktop
from Screens.PictureInPicture import PipPigMode
class Pig(Renderer):
def __init__(self):
Renderer.__init__(self)
self.Position = self.Size = None
self.hidePip = True
GUI_WI... | gpl-2.0 |
jalilm/ryu | ryu/services/protocols/vrrp/event.py | 29 | 9621 | # Copyright (C) 2013 Nippon Telegraph and Telephone Corporation.
# Copyright (C) 2013 Isaku Yamahata <yamahata at private email ne jp>
#
# 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
#
# h... | apache-2.0 |
Aaron0927/xen-4.2.1 | tools/python/xen/xend/server/udevevent.py | 43 | 3613 | import socket
from xen.web import protocol, unix
from xen.xend.XendLogging import log
from xen.xend import XendNode
from xen.xend import XendOptions
UDEV_EVENT_PATH = '\0/org/xen/xend/udev_event'
class UdevEventProtocol(protocol.Protocol):
def __init__(self):
protocol.Protocol.__init__(self)
def d... | gpl-2.0 |
toshywoshy/ansible | test/units/modules/network/fortios/test_fortios_vpn_ipsec_phase2_interface.py | 12 | 22813 | # Copyright 2019 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 License, or
# (at your option) any later version.
#
# This program is distributed in the... | gpl-3.0 |
jianghuaw/nova | nova/tests/unit/virt/libvirt/volume/test_disco.py | 3 | 2961 | # Copyright (c) 2015 Industrial Technology Research Institute.
# 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... | apache-2.0 |
2013Commons/HUE-SHARK | desktop/core/ext-py/Django-1.2.3/django/contrib/gis/tests/test_geoip.py | 30 | 4253 | import os, unittest
from django.db import settings
from django.contrib.gis.geos import GEOSGeometry
from django.contrib.gis.utils import GeoIP, GeoIPException
# Note: Requires use of both the GeoIP country and city datasets.
# The GEOIP_DATA path should be the only setting set (the directory
# should contain links or ... | apache-2.0 |
jeffrey4l/nova | nova/tests/unit/scheduler/weights/test_weights_ioopsweight.py | 73 | 2785 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | apache-2.0 |
chengjf/database-interface-doc-management | flask-demo/flask/Lib/site-packages/sqlalchemy/dialects/sqlite/pysqlite.py | 80 | 14980 | # sqlite/pysqlite.py
# Copyright (C) 2005-2015 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""
.. dialect:: sqlite+pysqlite
:name: pysqlite
:dbapi: sqlite3
:con... | apache-2.0 |
AutorestCI/azure-sdk-for-python | azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/operations/backup_storage_configs_operations.py | 2 | 7606 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | mit |
VukDukic/elasticsearch | dev-tools/upload-s3.py | 255 | 2375 | # Licensed to Elasticsearch under one or more contributor
# license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright
# ownership. Elasticsearch licenses this file to you under
# the Apache License, Version 2.0 (the "License"); you may
# not use this file except... | apache-2.0 |
40223141/lego | static/Brython3.1.1-20150328-091302/Lib/stat.py | 765 | 4304 | """Constants/functions for interpreting results of os.stat() and os.lstat().
Suggested usage: from stat import *
"""
# Indices for stat struct members in the tuple returned by os.stat()
ST_MODE = 0
ST_INO = 1
ST_DEV = 2
ST_NLINK = 3
ST_UID = 4
ST_GID = 5
ST_SIZE = 6
ST_ATIME = 7
ST_MTIME = 8
ST_CTIME = 9
... | agpl-3.0 |
jalilyacob/jna | native/libffi/generate-osx-source-and-headers.py | 84 | 5184 | #!/usr/bin/env python
import subprocess
import re
import os
import errno
import collections
import sys
class Platform(object):
pass
sdk_re = re.compile(r'.*-sdk ([a-zA-Z0-9.]*)')
def sdkinfo(sdkname):
ret = {}
for line in subprocess.Popen(['xcodebuild', '-sdk', sdkname, '-version'], stdout=subprocess.PIP... | lgpl-2.1 |
bertucho/epic-movie-quotes-quiz | dialogos/build/Twisted/twisted/web/_auth/basic.py | 66 | 1635 | # -*- test-case-name: twisted.web.test.test_httpauth -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
HTTP BASIC authentication.
@see: U{http://tools.ietf.org/html/rfc1945}
@see: U{http://tools.ietf.org/html/rfc2616}
@see: U{http://tools.ietf.org/html/rfc2617}
"""
import binascii
from... | mit |
NadineKroher/essentia | src/examples/tutorial/extractor_bpmhistogram.py | 7 | 1101 | import sys
from essentia.streaming import *
try:
audiofile = sys.argv[1]
except:
print "usage:", sys.argv[0], "<audiofile>"
sys.exit()
pool = essentia.Pool()
loader = MonoLoader(filename = audiofile)
bt = RhythmExtractor2013()
bpm_histogram = BpmHistogramDescriptors()
centroid = Centroid(range=250) # BPM histog... | agpl-3.0 |
kakunbsc/enigma2.2 | lib/python/Components/Sources/List.py | 3 | 2812 | from Source import Source
from Components.Element import cached
class List(Source, object):
"""The datasource of a listbox. Currently, the format depends on the used converter. So
if you put a simple string list in here, you need to use a StringList converter, if you are
using a "multi content list styled"-list, you ... | gpl-2.0 |
cvsuser-chromium/native_client | pnacl/driver/pnacl-ranlib.py | 5 | 1296 | #!/usr/bin/python
# Copyright (c) 2012 The Native Client Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
#
# IMPORTANT NOTE: If you make local mods to this file, you must run:
# % pnacl/build.sh driver
# in order for them to take eff... | bsd-3-clause |
kreatorkodi/repository.torrentbr | plugin.video.youtube/resources/lib/youtube_plugin/youtube/client/__config__.py | 1 | 10980 | # -*- coding: utf-8 -*-
from base64 import b64decode
from hashlib import md5
from ...kodion.json_store import APIKeyStore, LoginTokenStore
from ...kodion import Context as __Context
from ... import key_sets
DEFAULT_SWITCH = 1
__context = __Context(plugin_id='plugin.video.youtube')
__settings = __context.get_settings... | gpl-2.0 |
makkalot/func | func/yaml/ypath.py | 12 | 14465 | """
pyyaml legacy
Copyright (c) 2001 Steve Howell and Friends; All Rights Reserved
(see open source license information in docs/ directory)
"""
from types import ListType, StringType, IntType, DictType, InstanceType
import re
from urllib import quote
from timestamp import unquote
noTarget = object()
d... | gpl-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.