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 |
|---|---|---|---|---|---|
21winner/namebench | nb_third_party/jinja2/compiler.py | 199 | 61044 | # -*- coding: utf-8 -*-
"""
jinja2.compiler
~~~~~~~~~~~~~~~
Compiles nodes into python code.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
from cStringIO import StringIO
from itertools import chain
from copy import deepcopy
from jinja2 import nodes
from j... | apache-2.0 |
tysonclugg/django | tests/check_framework/test_templates.py | 102 | 3666 | from copy import copy, deepcopy
from django.core.checks.templates import E001, E002
from django.test import SimpleTestCase
from django.test.utils import override_settings
class CheckTemplateSettingsAppDirsTest(SimpleTestCase):
TEMPLATES_APP_DIRS_AND_LOADERS = [
{
'BACKEND': 'django.template.b... | bsd-3-clause |
hslee16/ansible-modules-extras | cloud/cloudstack/cs_pod.py | 27 | 8054 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2016, René Moser <mail@renemoser.net>
#
# 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 Lice... | gpl-3.0 |
tonnrueter/pymca_devel | PyMca/PyMcaPlugins/XASBatchPlugin.py | 1 | 2033 | try:
from PyMca import Plugin1DBase
except ImportError:
from . import Plugin1DBase
try:
from PyMca import XASBatch
except ImportError:
print("XMCDWindow importing from somewhere else")
import XASBatch
class XASBatchPlugin(Plugin1DBase.Plugin1DBase):
def __init__(self, plotWindow, **kw):
... | gpl-2.0 |
vikatory/kbengine | kbe/res/scripts/common/Lib/test/test_base64.py | 86 | 29596 | import unittest
from test import support
import base64
import binascii
import os
import sys
import subprocess
import struct
from array import array
class LegacyBase64TestCase(unittest.TestCase):
# Legacy API is not as permissive as the modern API
def check_type_errors(self, f):
self.assertRaises(Type... | lgpl-3.0 |
sometallgit/AutoUploader | Python27/Lib/msilib/__init__.py | 15 | 17605 | # -*- coding: iso-8859-1 -*-
# Copyright (C) 2005 Martin v. Löwis
# Licensed to PSF under a Contributor Agreement.
from _msi import *
import glob
import os
import re
import string
import sys
AMD64 = "AMD64" in sys.version
Itanium = "Itanium" in sys.version
Win64 = AMD64 or Itanium
# Partially taken from Wine
datasize... | mit |
KyleAMoore/KanjiNani | Android/.buildozer/android/platform/build/build/python-installs/KanjiNani/kivy/modules/keybinding.py | 81 | 1699 | '''Keybinding
==========
This module forces the mapping of some keys to functions:
* F11: Rotate the Window through 0, 90, 180 and 270 degrees
* Shift + F11: Switches between portrait and landscape on desktops
* F12: Take a screenshot
Note: this does't work if the application requests the keyboard beforehand.
Usage... | gpl-3.0 |
invitu/odoomrp-wip | mrp_operations_extension/models/mrp_workcenter.py | 4 | 2159 | # -*- encoding: utf-8 -*-
##############################################################################
#
# 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, either version 3 of the... | agpl-3.0 |
snlpatel001213/algorithmia | bayesian/gaussianNaiveBayes/gaussiannaiveBayes.py | 1 | 7699 | from utils import loadData
from utils import splitToTrainTest
from utils import functionalTesting
import math
# Dataset - https://archive.ics.uci.edu/ml/datasets/Breast+Cancer+Wisconsin+(Diagnostic)
# read - https://web.stanford.edu/~jurafsky/slp3/9.pdf
loadDataInstance = loadData()
functionalTestingInstance = funct... | gpl-3.0 |
yencarnacion/jaikuengine | .google_appengine/lib/django-1.5/django/contrib/gis/geoip/tests.py | 102 | 4766 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import os
from django.conf import settings
from django.contrib.gis.geos import GEOSGeometry
from django.contrib.gis.geoip import GeoIP, GeoIPException
from django.utils import unittest
from django.utils import six
# Note: Requires use of both the GeoIP ... | apache-2.0 |
DirtyUnicorns/android_external_chromium_org | mojo/public/tools/bindings/generators/mojom_python_generator.py | 25 | 10188 | # 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.
"""Generates Python source files from a mojom.Module."""
import re
from itertools import ifilter
import mojom.generate.generator as generator
import mojom.... | bsd-3-clause |
toshywoshy/ansible | lib/ansible/modules/network/fortios/fortios_system_automation_action.py | 7 | 15263 | #!/usr/bin/python
from __future__ import (absolute_import, division, print_function)
# 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 Lic... | gpl-3.0 |
chokribr/invenio | invenio/modules/access/control.py | 5 | 66182 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 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; eith... | gpl-2.0 |
w1ll1am23/home-assistant | homeassistant/components/eddystone_temperature/sensor.py | 5 | 5649 | """
Read temperature information from Eddystone beacons.
Your beacons must be configured to transmit UID (for identification) and TLM
(for temperature) frames.
"""
import logging
# pylint: disable=import-error
from beacontools import BeaconScanner, EddystoneFilter, EddystoneTLMFrame
import voluptuous as vol
from hom... | apache-2.0 |
2013Commons/HUE-SHARK | build/env/lib/python2.7/site-packages/django_extensions-0.5-py2.7.egg/django_extensions/management/modelviz.py | 7 | 9303 | #!/usr/bin/env python
"""Django model to DOT (Graphviz) converter
by Antonio Cavedoni <antonio@cavedoni.org>
Make sure your DJANGO_SETTINGS_MODULE is set to your project or
place this script in the same directory of the project and call
the script like this:
$ python modelviz.py [-h] [-a] [-d] [-g] [-i <model_names>]... | apache-2.0 |
jjscarafia/odoo | openerp/tools/safe_eval.py | 19 | 12057 | # -*- coding: utf-8 -*-
##############################################################################
# Copyright (C) 2004-2014 OpenERP s.a. (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# ... | agpl-3.0 |
sarthfrey/Texty | lib/tests/test_keys.py | 2 | 2303 | from mock import patch, Mock
from twilio.rest.resources.keys import Keys, Key
from tests.tools import create_mock_json
ACCOUNT_SID = "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
AUTH = (ACCOUNT_SID, "token")
BASE_URL = "https://api.twilio.com/2010-04-01/Accounts/{0}".format(ACCOUNT_SID)
KEY_SID = "SKaaaaaaaaaaaaaaaaaaaaaaaaaa... | apache-2.0 |
Dandandan/wikiprogramming | jsrepl/extern/python/unclosured/lib/python2.7/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.
... | mit |
thardie/Diamond | src/diamond/handler/queue.py | 21 | 1152 | # coding=utf-8
"""
This is a meta handler to act as a shim for the new threading model. Please
do not try to use it as a normal handler
"""
from Handler import Handler
class QueueHandler(Handler):
def __init__(self, config=None, queue=None, log=None):
# Initialize Handler
Handler.__init__(self, ... | mit |
resmo/ansible | lib/ansible/modules/cloud/azure/azure_rm_sqlfirewallrule_info.py | 20 | 6319 | #!/usr/bin/python
#
# Copyright (c) 2017 Zim Kalinowski, <zikalino@microsoft.com>
#
# 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 |
JioCloud/nova | nova/tests/unit/test_crypto.py | 15 | 16497 | # Copyright 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 requ... | apache-2.0 |
mikewiebe-ansible/ansible | lib/ansible/modules/network/cnos/cnos_template.py | 52 | 5475 | #!/usr/bin/python
# -*- coding: utf-8 -*-
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
#
# Copyright (C) 2017 Lenovo, 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 Licens... | gpl-3.0 |
tolo137/IHSS | programs/scoreSheet.py | 1 | 32460 | from Tkinter import *
import ttk
import datetime
import teamClass
import playerClass
class Application(Frame):
def __init__(self, master=None):
Frame.__init__(self, master)
self.teamList = []
self.pack()
self.maxTeamPlayers = 2
self.loadData()
self.gameNumber = int... | mit |
tai271828/courses | cs/udacity/cs101-intro-cs/code/lesson3/problem-set/max_depth.py | 4 | 5972 | #
# This question explores a different way (from the previous question)
# to limit the pages that it can crawl.
#
#######
# THREE GOLD STARS #
# Yes, we really mean it! This is really tough (but doable) unless
# you have some previous experience before this course.
# Modify the crawl_web procedure to take a secon... | mit |
smspillaz/pychecker | pychecker2/utest/format.py | 11 | 3277 | from pychecker2 import TestSupport
from pychecker2 import FormatStringChecks
class FormatTestCase(TestSupport.WarningTester):
def testGoodFormats(self):
self.silent('def f(x):\n'
' return "%s" % x\n')
self.silent('def f(x):\n'
" return ('%s' + '%s') % ... | bsd-3-clause |
AnySDK/Sample_Lua | frameworks/cocos2d-x/tools/jenkins-scripts/cocos-console-test.py | 9 | 11174 | #!/usr/bin/python
# create new project by cocos-console
# compile, deploy project and run
# perpose: for autotest cocos2d-console command.
# now support: mac- mac/ios/android
# will add: window-android,linux-android
import os
import subprocess
import sys
import json
import time
import socket
import threading
import sm... | mit |
rlugojr/django | django/middleware/cache.py | 69 | 7573 | """
Cache middleware. If enabled, each Django-powered page will be cached based on
URL. The canonical way to enable cache middleware is to set
``UpdateCacheMiddleware`` as your first piece of middleware, and
``FetchFromCacheMiddleware`` as the last::
MIDDLEWARE = [
'django.middleware.cache.UpdateCacheMiddl... | bsd-3-clause |
tacrow/tacrow | node_modules/node-gyp/gyp/pylib/gyp/generator/xcode.py | 1363 | 58344 | # 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.
import filecmp
import gyp.common
import gyp.xcodeproj_file
import gyp.xcode_ninja
import errno
import os
import sys
import posixpath
import re
import shutil
import... | mit |
avanov/django | tests/custom_pk/models.py | 99 | 1256 | # -*- coding: utf-8 -*-
"""
Using a custom primary key
By default, Django adds an ``"id"`` field to each model. But you can override
this behavior by explicitly adding ``primary_key=True`` to a field.
"""
from __future__ import unicode_literals
from django.db import models
from django.utils.encoding import python_2_... | bsd-3-clause |
zstackio/zstack-woodpecker | integrationtest/vm/mini/multiclusters/paths/multi_path198.py | 1 | 2957 | import zstackwoodpecker.test_state as ts_header
import os
TestAction = ts_header.TestAction
def path():
return dict(initial_formation="template5", checking_point=1, faild_point=100000, path_list=[
[TestAction.create_mini_vm, 'vm1', 'cluster=cluster2'],
[TestAction.change_vm_ha, 'vm1'],
[TestAction.create_vm_... | apache-2.0 |
vlegoff/tsunami | src/primaires/scripting/fonctions/champs.py | 1 | 5366 | # -*-coding:Utf-8 -*
# Copyright (c) 2010-2017 LE GOFF Vincent
# 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 |
GunoH/intellij-community | python/testData/inspections/PyTypeCheckerInspection/ParametrizedBuiltinCollectionsAndTheirTypingAliasesAreEquivalent.py | 10 | 2016 | from typing import Dict, FrozenSet, List, Set, Tuple
def expects_builtin_list(xs: list[int]):
expects_typing_List(xs)
expects_typing_List(<warning descr="Expected type 'list[int]', got 'list[str]' instead">['a']</warning>)
def expects_typing_List(xs: List[int]):
expects_builtin_list(xs)
expects_buil... | apache-2.0 |
madmath/sous-chef | src/member/tests.py | 1 | 69056 | import datetime
import json
from django.test import TestCase, Client
from member.models import Member, Client, User, Address, Referencing
from member.models import Contact, Option, Client_option, Restriction, Route
from member.models import Client_avoid_ingredient, Client_avoid_component
from member.models import Clien... | agpl-3.0 |
diofant/diofant | diofant/tests/series/test_order.py | 1 | 14204 | import pytest
from diofant import (Add, Derivative, Function, I, Integer, Integral, O,
Rational, Symbol, conjugate, cos, digamma, exp, expand,
ln, log, nan, oo, pi, sin, sqrt, symbols, transpose)
from diofant.abc import w, x, y, z
__all__ = ()
def test_caching_bug():
#... | bsd-3-clause |
wengole/eveonline-assistant | eveonline-assistant/config/urls.py | 1 | 1127 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.conf import settings
from django.conf.urls import patterns, include, url
from django.conf.urls.static import static
from django.views.generic import TemplateView
# Uncomment the next two lines to enable the admin:
from django.contrib import a... | bsd-3-clause |
kawamon/hue | desktop/core/ext-py/SQLAlchemy-1.3.17/lib/sqlalchemy/dialects/firebird/fdb.py | 4 | 4079 | # firebird/fdb.py
# Copyright (C) 2005-2020 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:: firebird+fdb
:name: fdb
:dbapi: pyodbc
:connectstring: ... | apache-2.0 |
kalxas/QGIS | tests/src/python/test_qgsserver_accesscontrol_wfs.py | 12 | 25583 | # -*- coding: utf-8 -*-
"""QGIS Unit tests for QgsServer.
From build dir, run: ctest -R PyQgsServerAccessControlWFS -V
.. note:: 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 t... | gpl-2.0 |
jiangzhuo/kbengine | kbe/res/scripts/common/Lib/test/test_site.py | 67 | 19039 | """Tests for 'site'.
Tests assume the initial paths in sys.path once the interpreter has begun
executing have not been removed.
"""
import unittest
import test.support
from test.support import captured_stderr, TESTFN, EnvironmentVarGuard
import builtins
import os
import sys
import re
import encodings
import urllib.re... | lgpl-3.0 |
jatinmistry13/pattern | pattern/server/cherrypy/cherrypy/_cpcompat.py | 37 | 10921 | """Compatibility code for using CherryPy with various versions of Python.
CherryPy 3.2 is compatible with Python versions 2.3+. This module provides a
useful abstraction over the differences between Python versions, sometimes by
preferring a newer idiom, sometimes an older one, and sometimes a custom one.
In particul... | bsd-3-clause |
jeffwidman/ansible-modules-core | cloud/openstack/_quantum_router.py | 41 | 7042 | #!/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 |
tudorvio/tempest | tempest/test_discover/test_discover.py | 17 | 2009 | # Copyright 2013 IBM Corp.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed t... | apache-2.0 |
bzennn/blog_flask | python/lib/python2.7/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... | gpl-3.0 |
Pafcholini/Nadia-kernel-N7100XXUFNI1_SWA_KK_Opensource_Update1 | scripts/tracing/draw_functrace.py | 14676 | 3560 | #!/usr/bin/python
"""
Copyright 2008 (c) Frederic Weisbecker <fweisbec@gmail.com>
Licensed under the terms of the GNU GPL License version 2
This script parses a trace provided by the function tracer in
kernel/trace/trace_functions.c
The resulted trace is processed into a tree to produce a more human
view of the call ... | gpl-2.0 |
cedi4155476/QGIS | python/plugins/processing/script/ScriptUtils.py | 12 | 2741 | # -*- coding: utf-8 -*-
"""
***************************************************************************
ScriptUtils.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
***************************... | gpl-2.0 |
wooga/airflow | docs/exts/docroles.py | 1 | 3913 | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | apache-2.0 |
theonion/bulbs2 | tests/test_managers.py | 2 | 1025 | from datetime import timedelta
from django.utils import timezone
from example.app.models import Headline
from model_mommy import mommy
import pytest
@pytest.mark.django_db
def test_draft():
hl = mommy.make(Headline, published=None)
hl.save()
assert hl in Headline.draft_objects.all()
assert hl not in ... | mit |
drawks/ansible | lib/ansible/modules/cloud/azure/azure_rm_virtualmachinescalesetextension.py | 20 | 10667 | #!/usr/bin/python
#
# Copyright (c) 2019 Zim Kalinowski (@zikalino)
#
# 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 |
Findspire/workflow | workflow/apps/workflow/tests.py | 1 | 19209 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# The MIT License (MIT)
# Copyright (c) 2015 Findspire
from unittest import TestCase
from django.core.urlresolvers import reverse
from django.test import TestCase
from workflow.apps.workflow.models import Project, Workflow, ItemCategory, ItemModel, Item, Comment
class ... | mit |
BenjamenMeyer/openstackinabox | openstackinabox/tests/models/db/test_base.py | 2 | 1380 | import ddt
from openstackinabox.tests.base import TestBase
from openstackinabox.models import base_db
@ddt.ddt
class TestModelBaseDb(TestBase):
def setUp(self):
super(TestModelBaseDb, self).setUp()
self.model = base_db.ModelDbBase
def tearDown(self):
super(TestModelBaseDb, self).te... | apache-2.0 |
zhangqi007/ZQ | Tools/autotest/common.py | 142 | 9612 | import util, pexpect, time, math
from pymavlink import mavwp
# a list of pexpect objects to read while waiting for
# messages. This keeps the output to stdout flowing
expect_list = []
def expect_list_clear():
'''clear the expect list'''
global expect_list
for p in expect_list[:]:
expect_list.remov... | gpl-3.0 |
Azure/azure-sdk-for-python | sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/aio/operations/_disaster_recovery_configs_operations.py | 1 | 36795 | # 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 may ... | mit |
atwoz/vimeko | sources_non_forked/ultisnips/pythonx/UltiSnips/text.py | 29 | 2128 | #!/usr/bin/env python
# encoding: utf-8
"""Utilities to deal with text."""
def unescape(text):
"""Removes '\\' escaping from 'text'."""
rv = ''
i = 0
while i < len(text):
if i + 1 < len(text) and text[i] == '\\':
rv += text[i + 1]
i += 1
else:
rv +=... | mit |
google/in-silico-labeling | isl/util.py | 1 | 10259 | # Copyright 2017 Google 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... | apache-2.0 |
notriddle/servo | tests/wpt/web-platform-tests/tools/lint/lint.py | 4 | 34049 | from __future__ import print_function, unicode_literals
import abc
import argparse
import ast
import json
import logging
import os
import re
import subprocess
import sys
import tempfile
from collections import defaultdict
from . import fnmatch
from . import rules
from .. import localpaths
from ..gitignore.gitignore ... | mpl-2.0 |
tucbill/manila | manila/openstack/common/rootwrap/cmd.py | 2 | 4641 | #!/usr/bin/env python
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# 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
#... | apache-2.0 |
joelpinheiro/safebox-smartcard-auth | Server/veserver/lib/python2.7/site-packages/Crypto/SelfTest/Hash/__init__.py | 116 | 2518 | # -*- coding: utf-8 -*-
#
# SelfTest/Hash/__init__.py: Self-test for hash modules
#
# Written in 2008 by Dwayne C. Litzenberger <dlitz@dlitz.net>
#
# ===================================================================
# The contents of this file are dedicated to the public domain. To
# the extent that dedication to t... | gpl-2.0 |
proxysh/Safejumper-for-Mac | buildmac/Resources/env/lib/python2.7/site-packages/pip/_vendor/distlib/scripts.py | 333 | 15224 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2013-2015 Vinay Sajip.
# Licensed to the Python Software Foundation under a contributor agreement.
# See LICENSE.txt and CONTRIBUTORS.txt.
#
from io import BytesIO
import logging
import os
import re
import struct
import sys
from .compat import sysconfig, detect_encoding, ZipFi... | gpl-2.0 |
alanswanson/webserver | admin/CTK/CTK/ProgressBar.py | 5 | 1975 | # CTK: Cherokee Toolkit
#
# Authors:
# Alvaro Lopez Ortega <alvaro@alobbs.com>
#
# Copyright (C) 2010-2014 Alvaro Lopez Ortega
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of version 2 of the GNU General Public
# License as published by the Free Software Foundation.... | gpl-2.0 |
temasek/android_external_chromium_org | tools/perf/measurements/smoothness.py | 23 | 2414 | # Copyright (c) 2013 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 metrics import smoothness
from metrics import timeline
from telemetry.page import page_measurement
class MissingDisplayFrameRateError(page_measure... | bsd-3-clause |
brenolf/myfriend | dogs/persons_views.py | 1 | 3453 | from django.shortcuts import render, get_object_or_404
from django.http import HttpResponse, HttpResponseNotFound, HttpResponseRedirect
from django.template import RequestContext, loader
from django.contrib.auth.models import User
from django.contrib.auth.decorators import login_required
from dogs.models import *
from... | apache-2.0 |
MaDKaTZe/phantomjs | src/breakpad/src/tools/gyp/test/subdirectory/gyptest-top-all.py | 240 | 1384 | #!/usr/bin/env python
# Copyright (c) 2009 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 building a target and a subsidiary dependent target from a
.gyp file in a subdirectory, without specifying an explicit output b... | bsd-3-clause |
jumpstarter-io/nova | nova/virt/block_device.py | 5 | 16937 | # All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | apache-2.0 |
wangjun/odoo | openerp/service/common.py | 281 | 1873 | # -*- coding: utf-8 -*-
import logging
import openerp.release
import openerp.tools
from openerp.tools.translate import _
import security
_logger = logging.getLogger(__name__)
RPC_VERSION_1 = {
'server_version': openerp.release.version,
'server_version_info': openerp.release.version_info,
's... | agpl-3.0 |
Kami/libcloud | libcloud/common/digitalocean.py | 6 | 7037 | # 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 |
PyCQA/pylint | tests/functional/m/missing/missing_docstring.py | 2 | 1027 | # [missing-module-docstring]
# pylint: disable=too-few-public-methods, useless-object-inheritance
def public_documented():
"""It has a docstring."""
def _private_undocumented():
# Doesn't need a docstring
pass
def _private_documented():
"""It has a docstring."""
class ClassDocumen... | gpl-2.0 |
robertnishihara/ray | doc/source/tune/_tutorials/tune-serve-integration-mnist.py | 2 | 27211 | # flake8: noqa
"""
Model selection and serving with Ray Tune and Ray Serve
=======================================================
This tutorial will show you an end-to-end example how to train a
model using Ray Tune on incrementally arriving data and deploy
the model using Ray Serve.
A machine learning workflow can b... | apache-2.0 |
bayger/kernel_amlogic | scripts/tracing/draw_functrace.py | 14676 | 3560 | #!/usr/bin/python
"""
Copyright 2008 (c) Frederic Weisbecker <fweisbec@gmail.com>
Licensed under the terms of the GNU GPL License version 2
This script parses a trace provided by the function tracer in
kernel/trace/trace_functions.c
The resulted trace is processed into a tree to produce a more human
view of the call ... | gpl-2.0 |
ProfessionalIT/professionalit-webiste | sdk/google_appengine/google/storage/speckle/python/django/backend/client.py | 7 | 1274 | #!/usr/bin/env python
#
# Copyright 2007 Google 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 o... | lgpl-3.0 |
tlatzko/spmcluster | .tox/2.7-cover/lib/python2.7/site-packages/pip/_vendor/html5lib/treebuilders/__init__.py | 1730 | 3405 | """A collection of modules for building different kinds of tree from
HTML documents.
To create a treebuilder for a new type of tree, you need to do
implement several things:
1) A set of classes for various types of elements: Document, Doctype,
Comment, Element. These must implement the interface of
_base.treebuilders... | bsd-2-clause |
chauhanhardik/populo_2 | lms/djangoapps/courseware/tests/test_video_handlers.py | 52 | 35861 | # -*- coding: utf-8 -*-
"""Video xmodule tests in mongo."""
import os
import freezegun
import tempfile
import textwrap
import json
import ddt
from nose.plugins.attrib import attr
from datetime import timedelta, datetime
from webob import Request
from mock import MagicMock, Mock, patch
from xmodule.contentstore.conte... | agpl-3.0 |
chenc10/Spark-PAF | ec2/lib/boto-2.34.0/boto/pyami/launch_ami.py | 153 | 7585 | #!/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... | apache-2.0 |
wetneb/django | django/contrib/gis/utils/ogrinfo.py | 564 | 1984 | """
This module includes some utility functions for inspecting the layout
of a GDAL data source -- the functionality is analogous to the output
produced by the `ogrinfo` utility.
"""
from django.contrib.gis.gdal import DataSource
from django.contrib.gis.gdal.geometries import GEO_CLASSES
def ogrinfo(data_source, num... | bsd-3-clause |
Llona/AJ-sub | main.py | 1 | 28565 | #!/usr/bin/env python3
"""
Ver 1.0 - First version
Ver 2.0 - Uses database for match SUB file name and read Sublist.ini for match Sub string
Ver 3.0 - Uses GUI for parameter input
Ver 4.0 - Re-develop this application by Python3
Ver 4.1 - Add GUI
Ver 4.2 - Add convert Sub file from simple chinese to TW traditional chi... | apache-2.0 |
dan1/horizon-x509 | openstack_dashboard/dashboards/project/overview/views.py | 15 | 2354 | # Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the... | apache-2.0 |
jamesmcm/luigi | test/contrib/hdfs/webhdfs_client_test.py | 3 | 1334 | # -*- coding: utf-8 -*-
#
# Copyright 2015 VNG Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | apache-2.0 |
blaze/distributed | distributed/profile.py | 1 | 13306 | """ This module contains utility functions to construct and manipulate counting
data structures for frames.
When performing statistical profiling we obtain many call stacks. We aggregate
these call stacks into data structures that maintain counts of how many times
each function in that call stack has been called. Be... | bsd-3-clause |
AkademieOlympia/sympy | sympy/physics/vector/tests/test_frame.py | 61 | 7994 | from sympy import sin, cos, pi, zeros, ImmutableMatrix as Matrix
from sympy.physics.vector import (ReferenceFrame, Vector, CoordinateSym,
dynamicsymbols, time_derivative, express)
Vector.simp = True
def test_coordinate_vars():
"""Tests the coordinate variables functionality"""
... | bsd-3-clause |
DeanChan/Lasagne | lasagne/tests/test_theano_extensions.py | 8 | 4248 | import pytest
import numpy as np
import theano.tensor as T
import lasagne
@pytest.mark.parametrize('impl', ['conv1d_sc', 'conv1d_mc0',
'conv1d_mc1', 'conv1d_unstrided',
'conv1d_sd', 'conv1d_md'])
@pytest.mark.parametrize('stride', [1, 2])
def test_co... | mit |
RudoCris/horizon | openstack_dashboard/dashboards/project/access_and_security/floating_ips/tests.py | 29 | 15039 | # Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Nebula, Inc.
# Copyright (c) 2012 X.commerce, a business unit of eBay Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License")... | apache-2.0 |
mqyqlx/deeppy | deeppy/autoencoder/stacked_autoencoder.py | 13 | 2960 | import itertools
from ..base import ParamMixin
from ..loss import Loss
from .autoencoder import Autoencoder
class StackedAutoencoderLayer(Autoencoder):
def __init__(self, ae, prev_layers):
self.ae = ae
self.prev_layers = prev_layers
self._initialized = False
def _setup(self, x_shape):... | mit |
rosmo/ansible | test/units/modules/network/ios/test_ios_bgp.py | 38 | 10658 | #
# (c) 2019, Ansible by Red Hat, inc
# 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
from ansible.module_utils.network.ios.providers.cli.config.bgp.process import Provider
from ansib... | gpl-3.0 |
Oire/TWBlue | src/gui/buffers/panels.py | 1 | 1532 | # -*- coding: utf-8 -*-
############################################################
# Copyright (c) 2014 Manuel Eduardo Cortéz Vallejo <manuel@manuelcortez.net>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published b... | gpl-2.0 |
dkubiak789/odoo | addons/l10n_in_hr_payroll/report/__init__.py | 424 | 1262 | #-*- coding:utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# d$
#
# This program is free software: you can redistribute it and/or modify
# it... | agpl-3.0 |
JTarball/generator-dockerized-django-polymer | app/templates/docker/app/app/backend/apps/_archive/accounts_maybe_good?/migrations/0001_initial.py | 4 | 3236 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django.utils.timezone
import django.core.validators
import django.contrib.auth.models
class Migration(migrations.Migration):
dependencies = [
('auth', '0006_require_contenttypes_0002'),
]
... | gpl-2.0 |
pcrouthers/Framework-One | node_modules/node-gyp/gyp/pylib/gyp/generator/gypsh.py | 2779 | 1665 | # Copyright (c) 2011 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.
"""gypsh output module
gypsh is a GYP shell. It's not really a generator per se. All it does is
fire up an interactive Python session with a few local variables... | mit |
rrrrrr8/vnpy | vnpy/api/xtp/pyscript/generate_struct_common.py | 4 | 2953 | # encoding: UTF-8
__author__ = 'CHENXY'
from xtp_data_type import *
type_dict = {
'uint64_t': 'uint64_t',
'uint32_t': 'uint32_t',
'int64_t': 'int64_t',
'int32_t': 'int32_t',
'char': 'string',
'double': 'float'
}
typedefDict.update(type_dict)
#-----------------------------------------------... | mit |
arokem/nipype | examples/smri_antsregistration_build_template.py | 14 | 7125 | #!/usr/bin/env python
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
"""
======================================================
sMRI: Using new ANTS for creating a T1 template (ITK4)
======================================================
In this tutori... | bsd-3-clause |
fniephaus/SimpleHomeAutomation | server.py | 1 | 3225 | #/usr/bin/env python
import config
import json
import datetime
import time
import hashlib
import atexit
from sets import Set
try:
from flask import Flask
from flask import jsonify, render_template, request
except ImportError:
print '[X] Please install Flask:'
print ' $ pip install flask\n'
exit(... | mit |
moreati/numpy | numpy/core/tests/test_records.py | 4 | 12859 | from __future__ import division, absolute_import, print_function
import sys
import collections
import pickle
from os import path
import numpy as np
from numpy.compat import asbytes
from numpy.testing import (
TestCase, run_module_suite, assert_, assert_equal, assert_array_equal,
assert_array_almost_equal, ass... | bsd-3-clause |
mu-editor/mu | mu/app.py | 1 | 12651 | """
Mu - a "micro" Python editor for beginner programmers.
Copyright (c) 2015-2017 Nicholas H.Tollervey and others (see the AUTHORS file).
Based upon work done for Puppy IDE by Dan Pope, Nicholas Tollervey and Damien
George.
This program is free software: you can redistribute it and/or modify
it under the terms of t... | gpl-3.0 |
arunkuttiyara/Arduino | arduino-core/src/processing/app/i18n/python/requests/packages/charade/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... | lgpl-2.1 |
tianweidut/ChemToolsWebService | chemistry/models.py | 2 | 7092 | # coding: UTF-8
import datetime
import uuid
from django.db import models
from django.conf import settings
from users.models import UserProfile
from chemistry import (MODEL_ORIGIN_CHOICES,
MODEL_CHOICES, STATUS_CHOICES, MOL_ORIGIN_CHOICES,
ORIGIN_UNDEFINED, STATUS_UNDEFINE... | agpl-3.0 |
dct2012/chromeos-3.14 | tools/perf/python/twatch.py | 1565 | 1316 | #! /usr/bin/python
# -*- python -*-
# -*- coding: utf-8 -*-
# twatch - Experimental use of the perf python interface
# Copyright (C) 2011 Arnaldo Carvalho de Melo <acme@redhat.com>
#
# This application is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License... | gpl-2.0 |
guettli/django | django/forms/models.py | 11 | 55823 | """
Helper functions for creating Form classes from Django models
and database field objects.
"""
from __future__ import unicode_literals
from collections import OrderedDict
from itertools import chain
from django.core.exceptions import (
NON_FIELD_ERRORS, FieldError, ImproperlyConfigured, ValidationError,
)
fro... | bsd-3-clause |
walmis/APMLib | Tools/autotest/apmrover2.py | 37 | 5561 | # drive APMrover2 in SITL
import util, pexpect, sys, time, math, shutil, os
from common import *
from pymavlink import mavutil
import random
# get location of scripts
testdir=os.path.dirname(os.path.realpath(__file__))
#HOME=mavutil.location(-35.362938,149.165085,584,270)
HOME=mavutil.location(40.071374969556928,-1... | gpl-3.0 |
havt/odoo | addons/account_anglo_saxon/__openerp__.py | 264 | 2393 | ##############################################################################
#
# 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 GNU Affero General Public L... | agpl-3.0 |
liuzheng712/Misago | misago/threads/tests/test_unreadthreads_view.py | 8 | 2484 | from django.core.urlresolvers import reverse
from django.utils import timezone
from django.utils.translation import ugettext as _
from misago.forums.models import Forum
from misago.users.testutils import UserTestCase, AuthenticatedUserTestCase
from misago.threads import testutils
class AuthenticatedTests(Authentica... | gpl-2.0 |
kidaa/eve | eve/tests/methods/delete.py | 10 | 29272 | from eve.tests import TestBase
from eve.tests.utils import DummyEvent
from eve.tests.test_settings import MONGO_DBNAME
from eve import ETAG
from bson import ObjectId
from eve.utils import ParsedRequest
import simplejson as json
import copy
from eve.methods.delete import deleteitem_internal
class TestDelete(TestBase)... | bsd-3-clause |
caot/intellij-community | python/lib/Lib/xml/Uri.py | 109 | 16394 | # pylint: disable-msg=C0103
#
# backported code from 4Suite with slight modifications, started from r1.89 of
# Ft/Lib/Uri.py, by syt@logilab.fr on 2005-02-09
#
# part if not all of this code should probably move to urlparse (or be used
# to fix some existant functions in this module)
#
#
# Copyright 2004 Fourthought, I... | apache-2.0 |
stewartmiles/flatbuffers | tests/MyGame/Example/Monster.py | 5 | 29683 | # automatically generated by the FlatBuffers compiler, do not modify
# namespace: Example
import flatbuffers
# an example documentation comment: monster object
class Monster(object):
__slots__ = ['_tab']
@classmethod
def GetRootAsMonster(cls, buf, offset):
n = flatbuffers.encode.Get(flatbuffers.... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.