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 |
|---|---|---|---|---|---|
xaviercobain88/framework-python | openerp/addons/project_gtd/__openerp__.py | 57 | 2512 | # -*- 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 |
OptiPop/external_chromium_org | components/policy/tools/syntax_check_policy_template_json.py | 34 | 19621 | #!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
'''
Checks a policy_templates.json file for conformity to its syntax specification.
'''
import json
import optparse
import os
impo... | bsd-3-clause |
Ujjwal29/ansible | lib/ansible/executor/task_queue_manager.py | 52 | 9846 | # (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 |
cgeoffroy/son-analyze | son-scikit/tests/unit/son_scikit/hl_prometheus_test.py | 1 | 2358 | # Copyright (c) 2015 SONATA-NFV, Thales Communications & Security
# 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 |
apporc/cinder | cinder/scheduler/weights/__init__.py | 4 | 1307 | # Copyright (c) 2011 OpenStack Foundation.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless... | apache-2.0 |
fnurl/alot | docs/source/generate_commands.py | 1 | 4877 | from __future__ import absolute_import
import sys
import os
HERE = os.path.dirname(__file__)
sys.path.insert(0, os.path.join(HERE, '..', '..'))
from alot.commands import *
from alot.commands import COMMANDS
import alot.buffers
from argparse import HelpFormatter, SUPPRESS, OPTIONAL, ZERO_OR_MORE, ONE_OR_MORE, PARSER, RE... | gpl-3.0 |
AmericanResearchInstitute/poweru-server | cmis_storage/amara/flextyper.py | 1 | 5781 | #!/usr/bin/env python
"""
Python compiler from DTLL (ISO DSDL Part 5: Datatypes) to a Python data types script
"""
import os
import re
import sys
import codecs
import optparse
import cStringIO
from xml import sax
from amara import domtools
from Ft.Xml.Domlette import GetAllNs
from Ft.Xml.Domlette import NonvalidatingR... | bsd-3-clause |
ghickman/django | django/contrib/staticfiles/utils.py | 335 | 1976 | import fnmatch
import os
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
def matches_patterns(path, patterns=None):
"""
Return True or False depending on whether the ``path`` should be
ignored (if it matches any pattern in ``ignore_patterns``).
"""
if patt... | bsd-3-clause |
kikokubo/Sick-Beard-TPB | lib/hachoir_parser/image/gif.py | 90 | 8192 | """
GIF picture parser.
Author: Victor Stinner
"""
from lib.hachoir_parser import Parser
from lib.hachoir_core.field import (FieldSet, ParserError,
Enum, UInt8, UInt16,
Bit, Bits, NullBytes,
String, PascalString8, Character,
NullBits, RawBytes)
from lib.hachoir_parser.image.common import PaletteRGB
fr... | gpl-3.0 |
andrewfu0325/gem5-aladdin | tests/quick/se/50.vortex/test.py | 83 | 1742 | # Copyright (c) 2006-2007 The Regents of The University of Michigan
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met: redistributions of source code must retain the above copyright
# notice, this ... | bsd-3-clause |
bhavishya235/Smart-Email-Client | libsvm-3.12/tools/easy.py | 152 | 2699 | #!/usr/bin/env python
import sys
import os
from subprocess import *
if len(sys.argv) <= 1:
print('Usage: {0} training_file [testing_file]'.format(sys.argv[0]))
raise SystemExit
# svm, grid, and gnuplot executable files
is_win32 = (sys.platform == 'win32')
if not is_win32:
svmscale_exe = "../svm-scale"
svmtrain_... | apache-2.0 |
Pythonify/awesome | venv/lib/python2.7/site-packages/pip/_vendor/distlib/util.py | 327 | 52991 | #
# Copyright (C) 2012-2016 The Python Software Foundation.
# See LICENSE.txt and CONTRIBUTORS.txt.
#
import codecs
from collections import deque
import contextlib
import csv
from glob import iglob as std_iglob
import io
import json
import logging
import os
import py_compile
import re
import shutil
import socket
try:
... | gpl-3.0 |
ndemir/scrapy | scrapy/utils/python.py | 3 | 7621 | """
This module contains essential stuff that should've come with Python itself ;)
It also contains functions (or functionality) which is in Python versions
higher than 2.5 which used to be the lowest version supported by Scrapy.
"""
import os
import re
import inspect
import weakref
from functools import wraps
from s... | bsd-3-clause |
orlenko/bccf | src/mezzanine/generic/templatetags/disqus_tags.py | 3 | 1872 | import base64
import hashlib
import hmac
import time
try:
import json
except ImportError: # Python 2.6
from django.utils import simplejson as json
from mezzanine import template
register = template.Library()
@register.simple_tag
def disqus_id_for(obj):
"""
Returns a unique identifier for the obje... | unlicense |
Toshakins/wagtail | wagtail/tests/modeladmintest/models.py | 4 | 1462 | from __future__ import absolute_import, unicode_literals
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
from wagtail.wagtailcore.models import Page
from wagtail.wagtailsearch import index
@python_2_unicode_compatible
class Author(models.Model):
name = models.CharField... | bsd-3-clause |
matthiasdiener/spack | var/spack/repos/builtin/packages/libxml2/package.py | 4 | 2749 | ##############################################################################
# Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | lgpl-2.1 |
exhacking/TKinter | jam.py | 1 | 1891 | # file: digital.py
# versi: python 2.7
# Program Jam Digital dengan Tkinter
# created by Exhacking.net
# update: 02/08/2012 12.13 AM
# memanggil modul Tkinter
from Tkinter import *
# memanggil modul time (untuk mengakses waktu saat ini)
import time
class JamDigital:
""" Kelas Jam Digital"""
def __init... | gpl-3.0 |
jjmiranda/edx-platform | lms/djangoapps/bulk_email/tests/test_tasks.py | 3 | 21353 | # -*- coding: utf-8 -*-
"""
Unit tests for LMS instructor-initiated background tasks.
Runs tasks on answers to course problems to validate that code
paths actually work.
"""
import json
from uuid import uuid4
from itertools import cycle, chain, repeat
from mock import patch, Mock
from nose.plugins.attrib import attr
... | agpl-3.0 |
developerinlondon/ansible-modules-core | cloud/openstack/quantum_router_gateway.py | 99 | 7512 | #!/usr/bin/python
#coding: utf-8 -*-
# (c) 2013, Benno Joy <benno@ansible.com>
#
# This module 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 ... | gpl-3.0 |
PlanetHunt/satgen | config_step.py | 1 | 3618 | #!/bin/env python
# -*- coding: utf-8 -*-
"""
This class is menat to read step configurations
for the different parameters related to the satelite.
the syntax of the step parameters should be like this
[Parameter Name]
Start Value = float / int
Step = float / int
End Value = float / int
...
...
...
This configuratio... | mit |
RealImpactAnalytics/airflow | airflow/contrib/hooks/qubole_hook.py | 3 | 8738 | # -*- coding: utf-8 -*-
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
#... | apache-2.0 |
schets/scikit-learn | sklearn/decomposition/tests/test_nmf.py | 14 | 6123 | import numpy as np
from scipy import linalg
from sklearn.decomposition import nmf
from sklearn.utils.testing import assert_true
from sklearn.utils.testing import assert_false
from sklearn.utils.testing import raises
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import assert_gr... | bsd-3-clause |
Spleen64/Sick-Beard | sickbeard/notifiers/nmjv2.py | 35 | 7880 | # Author: Jasper Lanting
# Based on nmj.py by Nico Berlee: http://nico.berlee.nl/
# URL: http://code.google.com/p/sickbeard/
#
# This file is part of Sick Beard.
#
# Sick Beard is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Fr... | gpl-3.0 |
fillycheezstake/MissionPlanner | Lib/calendar.py | 53 | 23815 | """Calendar printing functions
Note when comparing these calendars to the ones printed by cal(1): By
default, these calendars have Monday as the first day of the week, and
Sunday as the last (the European convention). Use setfirstweekday() to
set the first day of the week (0=Monday, 6=Sunday)."""
import sys
i... | gpl-3.0 |
projectweekend/raspberry-pi-io | raspberry_pi_io/io.py | 1 | 1595 | import yaml
from api import DeviceConfig
from gpio import PinManager
from rabbit import AsyncConsumer
class IOService(object):
def __init__(self, config_file):
with open(config_file) as file:
self.config = yaml.safe_load(file)
self.load_device_config()
self.initialize_pin_man... | mit |
nateberman/Python_Koans | python2/libs/colorama/ansi.py | 527 | 1039 | # Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file.
'''
This module generates ANSI character codes to printing colors to terminals.
See: http://en.wikipedia.org/wiki/ANSI_escape_code
'''
CSI = '\033['
def code_to_chars(code):
return CSI + str(code) + 'm'
class AnsiCodes(object):
def __... | mit |
gangadhar-kadam/helpdesk-erpnext | erpnext/patches/v4_0/set_naming_series_property_setter.py | 90 | 3220 | # 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.custom.doctype.property_setter.property_setter import make_property_setter
doctype_series_map = {
'Attendance': 'ATT-',
'C... | agpl-3.0 |
tempbottle/ironpython3 | Src/StdLib/Lib/test/test_getpass.py | 9 | 6094 | import getpass
import os
import unittest
from io import BytesIO, StringIO
from unittest import mock
from test import support
try:
import termios
except ImportError:
termios = None
try:
import pwd
except ImportError:
pwd = None
@mock.patch('os.environ')
class GetpassGetuserTest(unittest.TestCase):
... | apache-2.0 |
jlopezmalla/spark | examples/src/main/python/sql/streaming/structured_kafka_wordcount.py | 71 | 3207 | #
# 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 |
0k/odoo | addons/im_chat/im_chat.py | 10 | 20595 | # -*- coding: utf-8 -*-
import base64
import datetime
import logging
import time
import uuid
import random
import simplejson
import openerp
from openerp.http import request
from openerp.osv import osv, fields
from openerp.tools.misc import DEFAULT_SERVER_DATETIME_FORMAT
from openerp.addons.bus.bus import TIMEOUT
_lo... | agpl-3.0 |
robbiet480/home-assistant | tests/components/rflink/test_init.py | 6 | 11189 | """Common functions for RFLink component tests and generic platform tests."""
import pytest
from voluptuous.error import MultipleInvalid
from homeassistant.bootstrap import async_setup_component
from homeassistant.components.rflink import (
CONF_RECONNECT_INTERVAL,
DATA_ENTITY_LOOKUP,
EVENT_KEY_COMMAND,
... | apache-2.0 |
nicholasserra/sentry | src/sentry/models/eventerror.py | 2 | 1935 | from __future__ import absolute_import
class EventError(object):
INVALID_DATA = 'invalid_data'
INVALID_ATTRIBUTE = 'invalid_attribute'
VALUE_TOO_LONG = 'value_too_long'
UNKNOWN_ERROR = 'unknown_error'
SECURITY_VIOLATION = 'security_violation'
RESTRICTED_IP = 'restricted_ip'
JS_GENERIC_FET... | bsd-3-clause |
adamwiggins/cocos2d | test/test_menu_centered.py | 2 | 1158 | #
# Cocos
# http://code.google.com/p/los-cocos/
#
import sys
import os
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
from pyglet import image
from pyglet.gl import *
from pyglet import font
from cocos.director import *
from cocos.menu import *
from cocos.scene import *
from cocos.layer import *
... | bsd-3-clause |
odootr/odoo | addons/account/account_financial_report.py | 339 | 7636 | # -*- 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 |
vstoykov/django-cms | cms/tests/navextender.py | 27 | 3475 | # -*- coding: utf-8 -*-
from __future__ import with_statement
from cms.models import Page
from cms.test_utils.fixtures.navextenders import NavextendersFixture
from cms.test_utils.testcases import SettingsOverrideTestCase
from cms.test_utils.util.menu_extender import TestMenu
from django.conf import settings
from django... | bsd-3-clause |
newswangerd/ansible | test/units/plugins/connection/test_local.py | 47 | 1355 | #
# (c) 2020 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
# (at your option) any later version.
#
# Ansible is d... | gpl-3.0 |
40223214/20150622 | static/Brython3.1.1-20150328-091302/Lib/bisect.py | 1261 | 2595 | """Bisection algorithms."""
def insort_right(a, x, lo=0, hi=None):
"""Insert item x in list a, and keep it sorted assuming a is sorted.
If x is already in a, insert it to the right of the rightmost x.
Optional args lo (default 0) and hi (default len(a)) bound the
slice of a to be searched.
"""
... | gpl-3.0 |
halberom/ansible | lib/ansible/plugins/callback/log_plays.py | 64 | 3212 | # (C) 2012, 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) any lat... | gpl-3.0 |
ryanmockabee/golfr | flask/lib/python3.6/site-packages/sqlalchemy/testing/exclusions.py | 9 | 12647 | # testing/exclusions.py
# Copyright (C) 2005-2017 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
import operator
from ..util import decorator
from . import config
from .. imp... | mit |
durante987/nonogram_solver | nonogram_solver.py | 1 | 1269 | #!/usr/bin/env python3.8
"""
A program that tries to solve nonograms.
"""
import argparse
import logging
import sys
from nonogram.raster import Raster
from nonogram import solver
def main(args=None):
"""
Read the puzzle from the input file and start solving it.
"""
logging.basicConfig(format='%(mess... | mit |
binoculars/osf.io | addons/base/apps.py | 14 | 5524 | import os
import glob
import mimetypes
from django.apps import AppConfig
from mako.lookup import TemplateLookup
from framework.routing import process_rules
from framework.flask import app
from website import settings
from website.util import rubeus
def _is_image(filename):
mtype, _ = mimetypes.guess_type(filena... | apache-2.0 |
bklang/GO2 | babel/localtime/_win32.py | 82 | 2801 | try:
import _winreg as winreg
except ImportError:
try:
import winreg
except ImportError:
winreg = None
from babel.core import get_global
import pytz
tz_names = get_global('windows_zone_mapping')
def valuestodict(key):
"""Convert a registry key's values to a dictionary."""
dict =... | gpl-3.0 |
kalkin/qubes-core-admin | tests/regressions.py | 2 | 2861 | #!/usr/bin/python2 -O
# coding=utf-8
#
# The Qubes OS Project, https://www.qubes-os.org/
#
# Copyright (C) 2014-2015
# Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
# Copyright (C) 2015 Wojtek Porczyk <woju@invisiblethingslab.com>
#
# This program is free software; you can redistribute it and/or ... | gpl-2.0 |
surround-io/grpc | src/python/grpcio/grpc/framework/interfaces/__init__.py | 1496 | 1530 | # Copyright 2015, 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 conditions and the f... | bsd-3-clause |
SUSE-Cloud/nova | nova/tests/api/openstack/compute/contrib/test_flavorextradata.py | 9 | 3714 | # Copyright 2012 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | apache-2.0 |
gangadhar-kadam/prjapp | accounts/doctype/budget_distribution/test_budget_distribution.py | 30 | 2071 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
test_records = [
[{
"doctype": "Budget Distribution",
"distribution_id": "_Test Distribution",
"fiscal_year": "_Test Fiscal Year 2013",
}, {
"doctype": "Budget Distribution Detail... | agpl-3.0 |
szopu/django | django/conf/locale/ko/formats.py | 115 | 2320 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'Y년 n월 j일'
TIME_FORMAT = 'A g:i'
D... | bsd-3-clause |
v-iam/azure-sdk-for-python | azure-mgmt-web/azure/mgmt/web/models/site_instance.py | 3 | 1851 | # 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 |
etkirsch/scikit-learn | sklearn/decomposition/tests/test_pca.py | 199 | 10949 | import numpy as np
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import assert_true
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_greater
from sklearn.utils.testing import assert_rai... | bsd-3-clause |
dherrera/revolutioncontribution | node_modules/meanio/node_modules/npm/node_modules/node-gyp/gyp/PRESUBMIT.py | 496 | 3373 | # Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Top-level presubmit script for GYP.
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
for more details about the presubmit API built... | mit |
globau/servo | tests/wpt/css-tests/tools/html5lib/html5lib/treebuilders/dom.py | 920 | 8469 | from __future__ import absolute_import, division, unicode_literals
from xml.dom import minidom, Node
import weakref
from . import _base
from .. import constants
from ..constants import namespaces
from ..utils import moduleFactoryFactory
def getDomBuilder(DomImplementation):
Dom = DomImplementation
class A... | mpl-2.0 |
sankhesh/VTK | Filters/Modeling/Testing/Python/contour2DAll.py | 26 | 3621 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
=========================================================================
Program: Visualization Toolkit
Module: TestNamedColorsIntegration.py
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.... | bsd-3-clause |
Springerle/hovercraft-slides | {{cookiecutter.repo_name}}/setup.py | 1 | 1618 | """A setup shim for 'rituals'"""
import os
import re
import sys
import subprocess
from datetime import datetime
try:
url = subprocess.check_output('git remote get-url origin',
stderr=subprocess.STDOUT, shell=True)
except subprocess.CalledProcessError:
url = '{{ cookiecutter.ur... | cc0-1.0 |
gitromand/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/tool/steps/commit.py | 124 | 5399 | # Copyright (C) 2010 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 conditions and th... | bsd-3-clause |
angyukai/boulderactive2016-landing-page | node_modules/node-gyp/gyp/pylib/gyp/common_test.py | 2542 | 1970 | #!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Unit tests for the common.py file."""
import gyp.common
import unittest
import sys
class TestTopologicallySorted(unittest.TestCase):
... | mit |
jmesteve/openerpseda | openerp/addons/web/controllers/main.py | 12 | 68371 | # -*- coding: utf-8 -*-
import ast
import base64
import csv
import glob
import itertools
import logging
import operator
import datetime
import hashlib
import os
import re
import simplejson
import time
import urllib
import urllib2
import urlparse
import xmlrpclib
import zlib
from xml.etree import ElementTree
from cStri... | agpl-3.0 |
luskaner/wps-dict | wps_dict/wps_dict/interface/gui/bootstrap.py | 1 | 3244 |
from os.path import dirname, abspath
from .SignalHandler import *
from ...providers.online.downloadable.list import online_downloadable_providers
from ...providers.online.queryable.list import online_queryable_providers
from ...providers.offline.list import offline_providers
from ...tools.list import tools
gi.requir... | gpl-3.0 |
jscissr/djangae | djangae/db/utils.py | 3 | 11970 | #STANDARD LIB
from datetime import datetime
from decimal import Decimal
from itertools import chain
import warnings
#LIBRARIES
from django.apps import apps
from django.conf import settings
from django.db.backends.utils import format_number
from django.db import IntegrityError
from django.utils import timezone
from go... | bsd-3-clause |
huntxu/neutron-qos | neutron_qos/services/qos/common/htb.py | 2 | 14687 | # Copyright (c) 2015 Eayun, Inc.
# All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required ... | apache-2.0 |
Nitaco/ansible | lib/ansible/plugins/action/copy.py | 5 | 25466 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
# (c) 2017 Toshio Kuratomi <tkuraotmi@ansible.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... | gpl-3.0 |
dohamann/paparazzi | sw/ground_segment/python/ivytoredis/ivy_to_redis.py | 39 | 2358 | #!/usr/bin/env python
from __future__ import print_function
import redis
import time
import signal
import argparse
import sys
import os
# if PAPARAZZI_SRC not set, then assume the tree containing this
# file is a reasonable substitute
PPRZ_SRC = os.getenv("PAPARAZZI_SRC", os.path.normpath(os.path.join(os.path.dirnam... | gpl-2.0 |
jymannob/CouchPotatoServer | libs/requests/packages/chardet/escprober.py | 2936 | 3187 | ######################## 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... | gpl-3.0 |
nathanaevitas/odoo | openerp/addons/multi_company/__init__.py | 886 | 1054 | # -*- 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... | agpl-3.0 |
Team-SennyC2/android_kernel_htc_villec2 | scripts/gcc-wrapper.py | 501 | 3410 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2011-2012, Code Aurora Forum. 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 a... | gpl-2.0 |
g8os/grid | templates/storagepool/actions.py | 2 | 5466 | from JumpScaler import j
def input(job):
service = job.service
for notempty in ['metadataProfile', 'dataProfile', 'devices']:
if job.model.args.get(notempty, "") == "":
raise j.exceptions.Input("{} argument cannot be empty, cannot continue init of {}".format(notempty, service))
def insta... | apache-2.0 |
ykaneko/quantum | quantum/extensions/portbindings.py | 1 | 3587 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2012 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-2.0 |
2013Commons/HUE-SHARK | desktop/core/ext-py/Django-1.2.3/tests/regressiontests/model_fields/models.py | 49 | 5401 | import os
import tempfile
# Try to import PIL in either of the two ways it can end up installed.
# Checking for the existence of Image is enough for CPython, but for PyPy,
# you need to check for the underlying modules.
try:
from PIL import Image, _imaging
except ImportError:
try:
import Image, _imagi... | apache-2.0 |
ntymtsiv/tempest | tempest/services/compute/v3/json/quotas_client.py | 1 | 2980 | # Copyright 2012 NTT Data
# 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 appl... | apache-2.0 |
shyamalschandra/scikit-learn | sklearn/preprocessing/__init__.py | 268 | 1319 | """
The :mod:`sklearn.preprocessing` module includes scaling, centering,
normalization, binarization and imputation methods.
"""
from ._function_transformer import FunctionTransformer
from .data import Binarizer
from .data import KernelCenterer
from .data import MinMaxScaler
from .data import MaxAbsScaler
from .data ... | bsd-3-clause |
koss822/misc | Linux/MySettings/myvim/vim/bundle/jedi-vim/pythonx/jedi/test/completion/decorators.py | 1 | 5367 | # -----------------
# normal decorators
# -----------------
def decorator(func):
def wrapper(*args):
return func(1, *args)
return wrapper
@decorator
def decorated(a,b):
return a,b
exe = decorated(set, '')
#? set
exe[1]
#? int()
exe[0]
# more complicated with args/kwargs
def dec(func):
def ... | gpl-3.0 |
matthiasdiener/spack | var/spack/repos/builtin/packages/r-dirichletmultinomial/package.py | 3 | 2070 | ##############################################################################
# Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | lgpl-2.1 |
jmagnusson/raven-python | tests/contrib/flask/tests.py | 11 | 9341 | import logging
from exam import before, fixture
from mock import patch
from flask import Flask, current_app, g
from flask.ext.login import LoginManager, AnonymousUserMixin, login_user
from raven.base import Client
from raven.contrib.flask import Sentry
from raven.utils.testutils import TestCase
class TempStoreClie... | bsd-3-clause |
odahoda/noisicaa | noisicaa/music/project_client.py | 1 | 15366 | #!/usr/bin/python3
# @begin:license
#
# Copyright (c) 2015-2019, Benjamin Niemann <pink@odahoda.de>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at y... | gpl-2.0 |
pFernbach/hpp-rbprm-corba | src/hpp/corbaserver/rbprm/client.py | 1 | 1639 | #!/usr/bin/env python
#
# Copyright (c) 2014 CNRS
# Author: Steve Tonneau
#
# This file is part of hpp-rbprm-corba.
# hpp-rbprm-corba is free software: you can redistribute it
# and/or modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation, either version
# 3 o... | lgpl-3.0 |
kezabelle/clastic | clastic/tests/test_render.py | 1 | 4396 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import os
from nose.tools import eq_, ok_
from werkzeug.test import Client
from werkzeug.wrappers import BaseResponse
from clastic import Application
from clastic.render import (JSONRender,
JSONPRender,
... | bsd-3-clause |
FCP-INDI/nipype | nipype/interfaces/minc/tests/test_auto_Calc.py | 4 | 4670 | # AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from ....testing import assert_equal
from ..minc import Calc
def test_Calc_inputs():
input_map = dict(args=dict(argstr='%s',
),
check_dimensions=dict(argstr='-check_dimensions',
xor=('check_dimensions', 'no_check_dimensions'),
),
clobber=di... | bsd-3-clause |
lwbrooke/slackbot | fangorn/utils.py | 1 | 1541 | import click
def merge_many_dicts(*configs):
config = {}
for c in configs:
config = merge_dicts(config, c)
return config
def merge_dicts(a, b):
if isinstance(a, dict) and isinstance(b, dict):
for k, v in b.items():
if k not in a:
a[k] = v
els... | apache-2.0 |
dcroc16/skunk_works | google_appengine/lib/antlr3/antlr3/dfa.py | 117 | 7631 | """ANTLR3 runtime package"""
# begin[licence]
#
# [The "BSD licence"]
# Copyright (c) 2005-2008 Terence Parr
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code ... | mit |
ClearcodeHQ/mirakuru | tests/executors/test_http_executor.py | 1 | 6031 | """HTTP Executor tests."""
import sys
import socket
from functools import partial
from http.client import HTTPConnection, OK
from typing import Dict, Any, Union
from unittest.mock import patch
import pytest
from mirakuru import HTTPExecutor, TCPExecutor
from mirakuru import TimeoutExpired, AlreadyRunning
from tests i... | lgpl-3.0 |
mobify/python-driver | benchmarks/future_full_pipeline.py | 11 | 1313 | # Copyright 2013-2015 DataStax, 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 agreed to in writi... | apache-2.0 |
ewitz/PhotoHaus | venv/lib/python2.7/site-packages/pip-1.1-py2.7.egg/pip/commands/bundle.py | 80 | 1522 | from pip.locations import build_prefix, src_prefix
from pip.util import display_path, backup_dir
from pip.log import logger
from pip.exceptions import InstallationError
from pip.commands.install import InstallCommand
class BundleCommand(InstallCommand):
name = 'bundle'
usage = '%prog [OPTIONS] BUNDLE_NAME.pyb... | mit |
xen0l/ansible | test/integration/targets/module_precedence/multiple_roles/foo/library/ping.py | 480 | 2146 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
# (c) 2016, Toshio Kuratomi <tkuratomi@ansible.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... | gpl-3.0 |
franklongford/alias | alias/src/tests/test_intrinsic_sampling_method.py | 1 | 1910 | from unittest import TestCase
import numpy as np
from alias.src.intrinsic_surface import xi, dxy_dxi, ddxy_ddxi
class TestISM(TestCase):
def setUp(self):
self.qm = 8
self.qu = 5
self.n_waves = 2 * self.qm + 1
self.coeff = np.ones(self.n_waves ** 2) * 0.5
self.dim = [10.,... | bsd-2-clause |
piffey/ansible | lib/ansible/modules/network/cloudengine/ce_snmp_contact.py | 43 | 6786 | #!/usr/bin/python
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distribut... | gpl-3.0 |
TheMOOCAgency/edx-platform | common/djangoapps/terrain/stubs/tests/test_lti_stub.py | 172 | 4269 | """
Unit tests for stub LTI implementation.
"""
from mock import Mock, patch
import unittest
import urllib2
import requests
from terrain.stubs.lti import StubLtiService
class StubLtiServiceTest(unittest.TestCase):
"""
A stub of the LTI provider that listens on a local
port and responds with pre-defined gr... | agpl-3.0 |
Gagaro/django | tests/template_tests/filter_tests/test_rjust.py | 521 | 1030 | from django.template.defaultfilters import rjust
from django.test import SimpleTestCase
from django.utils.safestring import mark_safe
from ..utils import setup
class RjustTests(SimpleTestCase):
@setup({'rjust01': '{% autoescape off %}.{{ a|rjust:"5" }}. .{{ b|rjust:"5" }}.{% endautoescape %}'})
def test_rju... | bsd-3-clause |
alexmogavero/home-assistant | homeassistant/components/knx.py | 1 | 12903 | """
Support for KNX components.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/knx/
"""
import logging
import voluptuous as vol
import homeassistant.helpers.config_validation as cv
from homeassistant.const import (
EVENT_HOMEASSISTANT_STOP, CONF_H... | apache-2.0 |
DavidNorman/tensorflow | tensorflow/python/keras/layers/convolutional_recurrent.py | 4 | 43681 | # 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 |
ches/openxenmanager | put.py | 6 | 7871 | #!/usr/bin/env python
"""
put.py - Python HTTP PUT Client
Copyright 2006, Sean B. Palmer, inamidst.com
Licensed under the Eiffel Forum License 2.
Basic API usage, once with optional auth:
import put
put.putname('test.txt', 'http://example.org/test')
f = open('test.txt', 'rb')
put.putfile(f, 'http://example.org/test... | gpl-2.0 |
cmccoy/codon-sw | deps/seqan/util/py_lib/clang/cindex.py | 36 | 57281 | #===- cindex.py - Python Indexing Library Bindings -----------*- python -*--===#
#
# The LLVM Compiler Infrastructure
#
# This file is distributed under the University of Illinois Open Source
# License. See LICENSE.TXT for details.
#
#===--------------------------------------------------------------... | bsd-3-clause |
gtest-org/test12 | jenkins_jobs/modules/zuul.py | 7 | 6120 | # Copyright 2012 Hewlett-Packard Development Company, L.P.
#
# 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 |
TylerKirby/cltk | cltk/stop/classical_hindi/stops.py | 2 | 3663 | """ Classical Hindi Stopwords
This list is composed from 100 most frequently occuring words in classical_hindi corpus <https://github.com/cltk/hindi_text_ltrc> in CLTK.
source code : <https://gist.github.com/inishchith/ad4bc0da200110de638f5408c64bb14c>
"""
__author__ = 'Nishchith Shetty <inishchith[at]gmail[.]com>'
ST... | mit |
hectorip/DIM-web | node_modules/node-gyp/gyp/pylib/gyp/ninja_syntax.py | 2485 | 5536 | # This file comes from
# https://github.com/martine/ninja/blob/master/misc/ninja_syntax.py
# Do not edit! Edit the upstream one instead.
"""Python module for generating .ninja files.
Note that this is emphatically not a required piece of Ninja; it's
just a helpful utility for build-file-generation systems that alr... | mit |
HidinMTA/mtasa-blue | vendor/google-breakpad/src/tools/gyp/test/compiler-override/gyptest-compiler-global-settings.py | 137 | 2020 | #!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Verifies that make_global_settings can be used to override the
compiler settings.
"""
import TestGyp
import os
import copy
import sys
fro... | gpl-3.0 |
nitzmahone/ansible | lib/ansible/modules/cloud/vultr/vultr_firewall_group.py | 27 | 5529 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2017, 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': '1.1',
... | gpl-3.0 |
cbeloni/pychronesapp | backend/venv/lib/python2.7/site-packages/unidecode/x077.py | 252 | 4675 | data = (
'Ming ', # 0x00
'Sheng ', # 0x01
'Shi ', # 0x02
'Yun ', # 0x03
'Mian ', # 0x04
'Pan ', # 0x05
'Fang ', # 0x06
'Miao ', # 0x07
'Dan ', # 0x08
'Mei ', # 0x09
'Mao ', # 0x0a
'Kan ', # 0x0b
'Xian ', # 0x0c
'Ou ', # 0x0d
'Shi ', # 0x0e
'Yang ', # 0x0f
'Zheng ', # 0... | mit |
wangcy6/storm_app | frame/kafka-0.11.0/kafka-0.11.0.1-src/tests/kafkatest/tests/connect/connect_rest_test.py | 6 | 9997 | # 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 |
JCBarahona/edX | lms/djangoapps/teams/migrations/0002_auto__add_field_courseteam_discussion_id.py | 57 | 5864 | # -*- 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 'CourseTeam.discussion_topic_id'
db.add_column('teams_cour... | agpl-3.0 |
Big-B702/python-for-android | python3-alpha/python3-src/Lib/encodings/ascii.py | 858 | 1248 | """ Python 'ascii' Codec
Written by Marc-Andre Lemburg (mal@lemburg.com).
(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.
"""
import codecs
### Codec APIs
class Codec(codecs.Codec):
# Note: Binding these as C functions will result in the class not
# converting them to methods. This is intended.
... | apache-2.0 |
skirsdeda/django | django/contrib/gis/db/backends/oracle/schema.py | 608 | 4050 | from django.contrib.gis.db.models.fields import GeometryField
from django.db.backends.oracle.schema import DatabaseSchemaEditor
from django.db.backends.utils import truncate_name
class OracleGISSchemaEditor(DatabaseSchemaEditor):
sql_add_geometry_metadata = ("""
INSERT INTO USER_SDO_GEOM_METADATA
... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.