repo_name stringlengths 5 100 | path stringlengths 4 294 | copies stringclasses 990
values | size stringlengths 4 7 | content stringlengths 666 1M | license stringclasses 15
values |
|---|---|---|---|---|---|
upgradeadvice/fofix-grisly-virtualenv | FoFiX/VFS.py | 1 | 14383 | #####################################################################
# -*- coding: iso-8859-1 -*- #
# #
# Frets on Fire X (FoFiX) #
# Copyright (C) 2009-2010 John Stumpo ... | gpl-2.0 |
openstack/horizon | openstack_dashboard/dashboards/project/volumes/forms.py | 1 | 38443 | # Copyright 2012 Nebula, Inc.
# All rights reserved.
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | apache-2.0 |
pharos3d/tundra | tools/Converters/tundra2-txml-converter.py | 6 | 6763 | import sys
import os
"""
For this script to work you need the jack.mesh from /media/models in /data/assets
You will have to manually put your txml file name down in the __main__ func to:
--> fileName = "putFileNameHere.txml" <--
1. Run this script on your tundra 1.x txml
2. This will create a... | apache-2.0 |
zepheira/amara | demo/7days/day1.py | 1 | 1051 | import sys, datetime
from amara.writers.struct import *
from amara.namespaces import *
tags = [u"xml", u"python", u"atom"]
w = structwriter(indent=u"yes")
w.feed(
ROOT(
E((ATOM_NAMESPACE, u'feed'), {(XML_NAMESPACE, u'xml:lang'): u'en'},
E(u'id', u'urn:bogus:myfeed'),
E(u'title', u'MyFeed'),
... | apache-2.0 |
jmmv/markdown2social | markdown2social/__init__.py | 1 | 1225 | # Copyright 2015 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 or agreed to in writing... | apache-2.0 |
manaschaturvedi/oscarbuddy | html5lib/treebuilders/_base.py | 715 | 13699 | from __future__ import absolute_import, division, unicode_literals
from six import text_type
from ..constants import scopingElements, tableInsertModeElements, namespaces
# The scope markers are inserted when entering object elements,
# marquees, table cells, and table captions, and are used to prevent formatting
# fr... | mit |
seeminglee/pyglet64 | contrib/toys/thrust.py | 29 | 5162 | '''
Code by Richard Jones, released into the public domain.
Beginnings of something like http://en.wikipedia.org/wiki/Thrust_(video_game)
'''
import sys
import math
import euclid
import primitives
import pyglet
from pyglet.window import key
from pyglet.gl import *
window = pyglet.window.Window(fullscreen='-fs' in ... | bsd-3-clause |
sssemil/cjdns | node_build/dependencies/libuv/build/gyp/test/msvs/missing_sources/gyptest-missing.py | 315 | 1413 | #!/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 missing 'sources' files are treated as fatal errors when the
the generator flag 'msvs_error_on_missing_sources' is set.
""... | gpl-3.0 |
allenlavoie/tensorflow | tensorflow/python/data/kernel_tests/sequence_dataset_op_test.py | 18 | 7947 | # 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 |
nhicher/ansible | lib/ansible/modules/storage/netapp/_na_cdot_license.py | 8 | 9278 | #!/usr/bin/python
# (c) 2017, NetApp, 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
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['deprecated'],
... | gpl-3.0 |
reviewboard/reviewboard | reviewboard/scmtools/tests/test_cvs.py | 2 | 34597 | # coding=utf-8
from __future__ import unicode_literals
import os
import nose
from django.core.exceptions import ValidationError
from djblets.testing.decorators import add_fixtures
from reviewboard.diffviewer.parser import DiffParserError
from reviewboard.scmtools.core import PRE_CREATION, Revision
from reviewboard.s... | mit |
jiangzhuo/kbengine | kbe/src/lib/python/Lib/test/test_posixpath.py | 68 | 23737 | import itertools
import os
import posixpath
import sys
import unittest
import warnings
from posixpath import realpath, abspath, dirname, basename
from test import support, test_genericpath
try:
import posix
except ImportError:
posix = None
# An absolute path to a temporary filename for testing. We can't rely ... | lgpl-3.0 |
jaysonsantos/servo | components/script/dom/bindings/codegen/parser/tests/test_arraybuffer.py | 158 | 4183 | import WebIDL
def WebIDLTest(parser, harness):
parser.parse("""
interface TestArrayBuffer {
attribute ArrayBuffer bufferAttr;
void bufferMethod(ArrayBuffer arg1, ArrayBuffer? arg2, ArrayBuffer[] arg3, sequence<ArrayBuffer> arg4);
attribute ArrayBufferView viewAttr;
... | mpl-2.0 |
GitAngel/django | django/contrib/auth/decorators.py | 356 | 3049 | from functools import wraps
from django.conf import settings
from django.contrib.auth import REDIRECT_FIELD_NAME
from django.core.exceptions import PermissionDenied
from django.shortcuts import resolve_url
from django.utils import six
from django.utils.decorators import available_attrs
from django.utils.six.moves.urll... | bsd-3-clause |
EmreAtes/spack | var/spack/repos/builtin/packages/xorg-sgml-doctools/package.py | 5 | 1781 | ##############################################################################
# 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 |
v-zhongz/azure-linux-extensions | OSPatching/azure/http/__init__.py | 52 | 2502 | #-------------------------------------------------------------------------
# Copyright (c) Microsoft. 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.apac... | apache-2.0 |
JLBoor/eagles-hackathon | node_modules/node-gyp/gyp/pylib/gyp/flock_tool.py | 1835 | 1748 | #!/usr/bin/env python
# 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.
"""These functions are executed via gyp-flock-tool when using the Makefile
generator. Used on systems that don't have a built-in flock."""
... | mit |
rghe/ansible | lib/ansible/plugins/action/eos_config.py | 56 | 4248 | #
# Copyright 2015 Peter Sprygada <psprygada@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 version 3 of the License, or
# (at your option) any... | gpl-3.0 |
OpenSoccerManager/opensoccermanager-editor | uigtk/dialogs.py | 1 | 4445 | #!/usr/bin/env python3
# This file is part of OpenSoccerManager-Editor.
#
# OpenSoccerManager 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 la... | gpl-3.0 |
aequitas/home-assistant | homeassistant/components/discovery/__init__.py | 1 | 7474 | """
Starts a service to scan in intervals for new devices.
Will emit EVENT_PLATFORM_DISCOVERED whenever a new service has been discovered.
Knows which components handle certain types, will make sure they are
loaded before the EVENT_PLATFORM_DISCOVERED is fired.
"""
import json
from datetime import timedelta
import lo... | apache-2.0 |
WeblateOrg/weblate | weblate/gitexport/apps.py | 1 | 1433 | #
# Copyright © 2012 - 2021 Michal Čihař <michal@cihar.com>
#
# This file is part of Weblate <https://weblate.org/>
#
# 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 Lice... | gpl-3.0 |
JPFrancoia/scikit-learn | sklearn/cluster/k_means_.py | 4 | 59475 | """K-means clustering"""
# Authors: Gael Varoquaux <gael.varoquaux@normalesup.org>
# Thomas Rueckstiess <ruecksti@in.tum.de>
# James Bergstra <james.bergstra@umontreal.ca>
# Jan Schlueter <scikit-learn@jan-schlueter.de>
# Nelle Varoquaux
# Peter Prettenhofer <peter.prettenh... | bsd-3-clause |
gskachkov/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/style/checkers/python.py | 120 | 5538 | # Copyright (C) 2010 Chris Jerdonek (cjerdonek@webkit.org)
#
# 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 must retain the above copyright
# notice, this list of conditions and... | bsd-3-clause |
mrquim/repository.mrquim | plugin.video.salts/scrapers/pubfilmto_scraper.py | 6 | 4875 | """
SALTS XBMC Addon
Copyright (C) 2014 tknorris
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
T... | gpl-2.0 |
square/pants | tests/python/pants_test/targets/test_python_binary.py | 2 | 3271 | # coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (nested_scopes, generators, division, absolute_import, with_statement,
print_function, unicode_literals)
import pytest
from ... | apache-2.0 |
powerlim2/project_free_insight | data_api/venv/lib/python2.7/site-packages/pip/_vendor/pyparsing.py | 75 | 158096 | # module pyparsing.py
#
# Copyright (c) 2003-2015 Paul T. McGuire
#
# 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, cop... | bsd-3-clause |
ai0/sanic | examples/exception_monitoring.py | 1 | 1791 | """
Example intercepting uncaught exceptions using Sanic's error handler framework.
This may be useful for developers wishing to use Sentry, Airbrake, etc.
or a custom system to log and monitor unexpected errors in production.
First we create our own class inheriting from Handler in sanic.exceptions,
and pass in an i... | mit |
RockinRoel/FrameworkBenchmarks | toolset/benchmark/fortune_html_parser.py | 20 | 7205 | # -*- coding: utf-8
import re
from HTMLParser import HTMLParser
from difflib import unified_diff
class FortuneHTMLParser(HTMLParser):
body = []
valid = '''<!doctype html><html>
<head><title>Fortunes</title></head>
<body><table>
<tr><th>id</th><th>message</th></tr>
<tr><td>11</td><td><script>alert("This... | bsd-3-clause |
jordanemedlock/psychtruths | temboo/Library/Zendesk/IncrementalTickets/ExportIncrementalTickets.py | 5 | 4063 | # -*- coding: utf-8 -*-
###############################################################################
#
# ExportIncrementalTickets
# Returns a lightweight representation of what changed in the ticket "since you last asked".
#
# Python versions 2.6, 2.7, 3.x
#
# Copyright 2014, Temboo Inc.
#
# Licensed under the Apac... | apache-2.0 |
omoju/Fundamentals | Data/twitterDataAnalysis/info_gain.py | 1 | 3353 |
import os
import sys
import numpy as np
import math
def findBinIndexFor(aFloatValue, binsList):
#print "findBinIndexFor: %s" % aFloatValue
returnIndex = -1
for i in range(len(binsList)):
thisBin = binsList[i]
if (aFloatValue >= thisBin[0]) and (aFloatValue < thisBin[1]):
returnIndex = i
break
return ... | gpl-3.0 |
nash-x/hws | neutron/common/constants.py | 1 | 5802 | # Copyright (c) 2012 OpenStack Foundation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | apache-2.0 |
AversivePlusPlus/AversivePlusPlus | tools/conan/conans/test/integration/order_libs_test.py | 3 | 2031 | import unittest
from conans.test.tools import TestClient
from conans.paths import CONANFILE
from conans.util.files import load
import os
class OrderLibsTest(unittest.TestCase):
def setUp(self):
self.client = TestClient()
def _export(self, name, deps=None, export=True):
def _libs():
... | bsd-3-clause |
yfried/ansible | lib/ansible/plugins/terminal/vyos.py | 191 | 1700 | #
# (c) 2016 Red Hat Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is d... | gpl-3.0 |
PredictionGuru/pgurin | models.py | 1 | 1214 | """Models / Schema of pgur.in"""
from google.appengine.ext import ndb
class Accounts(ndb.Model):
"""Stores registration information."""
playstore_url = ndb.StringProperty()
appstore_url = ndb.StringProperty()
winstore_url = ndb.StringProperty()
default_url = ndb.StringProperty()
title = ndb.... | mit |
jhoos/django | django/core/management/__init__.py | 39 | 13130 | from __future__ import unicode_literals
import collections
from importlib import import_module
import os
import pkgutil
import sys
import django
from django.apps import apps
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.core.management.base import (BaseCommand, C... | bsd-3-clause |
linked67/p2pool-500 | SOAPpy/Types.py | 289 | 52214 | from __future__ import nested_scopes
"""
################################################################################
# Copyright (c) 2003, Pfizer
# Copyright (c) 2001, Cayce Ullman.
# Copyright (c) 2001, Brian Matthews.
#
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or withou... | gpl-3.0 |
GoodRx/fwffr | fwffr.py | 1 | 7288 | #!/usr/bin/env python
"""
Utilities related to parsing files
"""
from collections import OrderedDict
import sys
PY3 = sys.version_info[0] == 3
__all__ = [
'FixedLengthError',
'FixedLengthUnknownRecordTypeError',
'FixedLengthSeparatorError',
'FixedLengthJustificationError',
'FixedLengthFieldParser... | mit |
gaddman/ansible | lib/ansible/modules/remote_management/ucs/ucs_vhba_template.py | 64 | 11155 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# 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',
'status': ['preview'],
... | gpl-3.0 |
alxgu/ansible | lib/ansible/modules/storage/netapp/netapp_e_ldap.py | 31 | 15914 | #!/usr/bin/python
# (c) 2018, NetApp, 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
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... | gpl-3.0 |
inveniosoftware/invenio-collections | invenio_collections/ext.py | 3 | 5519 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2015, 2016 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 |
mrfawy/ModernEnigma | test/testUtil.py | 1 | 2635 | import unittest
from Util import Util
class TestUtil(unittest.TestCase):
def testConvertTupleListToMap(self):
tupleList=[]
tupleList.append((0,0))
tupleList.append((0,1))
tupleList.append((1,0))
tupleList.append((1,2))
tupleList.append((2,2))
wiringMap=Util.c... | mit |
fti7/ansible-modules-core | cloud/rax.py | 7 | 24940 | #!/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 distributed... | gpl-3.0 |
amwelch/a10sdk-python | a10sdk/core/cm/cm_ut_list_entry_2.py | 2 | 3168 | from a10sdk.common.A10BaseClass import A10BaseClass
class EntryCfg(A10BaseClass):
"""This class does not support CRUD Operations please use parent.
:param distance: {"minimum": 1, "type": "number", "maximum": 255, "format": "number"}
:param protocol: {"enum": ["any", "static", "dynamic"], "type": "s... | apache-2.0 |
rikima/spark | python/pyspark/streaming/listener.py | 75 | 2333 | #
# 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 |
MSA-Argentina/relojito_project | relojito/app/api_views.py | 1 | 1715 | from datetime import datetime
from rest_framework import generics, viewsets
from rest_framework.exceptions import ParseError
from rest_framework.response import Response
from .models import Project, Task, TaskType
from .serializers import ProjectSerializer, TaskSerializer, TaskTypeSerializer
class TaskViewSet(views... | mit |
hugs/django | django/contrib/flatpages/admin.py | 82 | 1072 | from django import forms
from django.contrib import admin
from django.contrib.flatpages.models import FlatPage
from django.utils.translation import ugettext_lazy as _
class FlatpageForm(forms.ModelForm):
url = forms.RegexField(label=_("URL"), max_length=100, regex=r'^[-\w/]+$',
help_text = _("Example: '/a... | bsd-3-clause |
torchingloom/edx-platform | lms/djangoapps/verify_student/ssencrypt.py | 55 | 7001 | """
NOTE: Anytime a `key` is passed into a function here, we assume it's a raw byte
string. It should *not* be a string representation of a hex value. In other
words, passing the `str` value of
`"32fe72aaf2abb44de9e161131b5435c8d37cbdb6f5df242ae860b283115f2dae"` is bad.
You want to pass in the result of calling .decode... | agpl-3.0 |
taozhijiang/linux | tools/perf/python/twatch.py | 625 | 2726 | #! /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 |
t0in4/django | django/db/backends/postgresql/version.py | 632 | 1517 | """
Extracts the version of the PostgreSQL server.
"""
import re
# This reg-exp is intentionally fairly flexible here.
# Needs to be able to handle stuff like:
# PostgreSQL #.#.#
# EnterpriseDB #.#
# PostgreSQL #.# beta#
# PostgreSQL #.#beta#
VERSION_RE = re.compile(r'\S+ (\d+)\.(\d+)\.?(\d+)?')
def _parse_... | bsd-3-clause |
SivilTaram/edx-platform | common/lib/xmodule/xmodule/modulestore/split_mongo/split.py | 12 | 147531 | """
Provides full versioning CRUD and representation for collections of xblocks (e.g., courses, modules, etc).
Representation:
* course_index: a dictionary:
** '_id': a unique id which cannot change,
** 'org': the org's id. Only used for searching not identity,
** 'course': the course's catalog number
... | agpl-3.0 |
open-craft/opencraft | playbooks/collect_activity/stats.py | 1 | 4868 | #!/edx/app/edxapp/venvs/edxapp/bin/python
# pylint: skip-file
from __future__ import print_function
from argparse import ArgumentParser
from datetime import datetime, timedelta
import gzip
import os
import re
import sys
import django
from django.utils import timezone
from six.moves.configparser import ConfigParser
... | agpl-3.0 |
florentx/OpenUpgrade | addons/sale/report/__init__.py | 370 | 1086 | # -*- 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 |
jkonecki/autorest | AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/Http/autoresthttpinfrastructuretestservice/operations/http_server_failure.py | 5 | 7493 | # 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 |
davygeek/vitess | test/topo_flavor/zk2.py | 3 | 3694 | #!/usr/bin/env python
# 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | apache-2.0 |
rotofly/odoo | addons/marketing_campaign_crm_demo/__openerp__.py | 260 | 1623 | # -*- 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 |
damianam/easybuild-framework | easybuild/scripts/fix_broken_easyconfigs.py | 3 | 5630 | #!/usr/bin/env python
# Copyright 2015-2017 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
# with support of Ghent University (http://ugent.be/hpc),
# the Flemish Supercomputer Centre (VSC) (https://www.vscentrum.be),
# Flemish Res... | gpl-2.0 |
wendlers/edubot-snap | ext/requests/packages/urllib3/contrib/appengine.py | 360 | 7937 | from __future__ import absolute_import
import logging
import os
import warnings
from ..exceptions import (
HTTPError,
HTTPWarning,
MaxRetryError,
ProtocolError,
TimeoutError,
SSLError
)
from ..packages.six import BytesIO
from ..request import RequestMethods
from ..response import HTTPResponse
... | mit |
cfei18/incubator-airflow | airflow/operators/check_operator.py | 5 | 9941 | # -*- 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 |
maxamillion/ansible | test/lib/ansible_test/_internal/ci/__init__.py | 21 | 8224 | """Support code for CI environments."""
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import abc
import base64
import json
import os
import tempfile
from .. import types as t
from ..encoding import (
to_bytes,
to_text,
)
from ..io import (
read_text_file,
w... | gpl-3.0 |
jmr0/servo | tests/wpt/css-tests/css-text-decor-3_dev/xhtml1print/reference/support/generate-text-emphasis-line-height-tests.py | 829 | 3431 | #!/usr/bin/env python
# - * - coding: UTF-8 - * -
"""
This script generates tests text-emphasis-line-height-001 ~ 004 except
001z. They test the line height expansion in different directions. This
script outputs a list of all tests it generated in the format of Mozilla
reftest.list to the stdout.
"""
from __future__ ... | mpl-2.0 |
skuda/client-python | kubernetes/client/models/v1_node_selector.py | 1 | 3415 | # coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.6.1
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re
... | apache-2.0 |
andreesg/bda.plone.payment | src/bda/plone/payment/__init__.py | 1 | 2636 | # -*- coding: utf-8 -*-
from bda.plone.payment.interfaces import IPayment
from bda.plone.payment.interfaces import IPaymentEvent
from bda.plone.payment.interfaces import IPaymentFailedEvent
from bda.plone.payment.interfaces import IPaymentSettings
from bda.plone.payment.interfaces import IPaymentSuccessEvent
from zope.... | bsd-3-clause |
jianran/spark | examples/src/main/python/ml/quantile_discretizer_example.py | 123 | 1707 | #
# 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 |
sandhujasmine/conda-build | conda_build/exceptions.py | 8 | 1182 | import textwrap
SEPARATOR = "-" * 70
indent = lambda s: textwrap.fill(textwrap.dedent(s))
class CondaBuildException(Exception):
pass
class YamlParsingError(CondaBuildException):
pass
class UnableToParse(YamlParsingError):
def __init__(self, original, *args, **kwargs):
super(UnableToParse, sel... | bsd-3-clause |
tmpgit/intellij-community | python/lib/Lib/socket.py | 73 | 54596 | """
This is an updated socket module for use on JVMs > 1.5; it is derived from the old jython socket module.
It is documented, along with known issues and workarounds, on the jython wiki.
http://wiki.python.org/jython/NewSocketModule
"""
_defaulttimeout = None
import errno
import jarray
import string
import struct
im... | apache-2.0 |
katfang/django-guardian | guardian/admin.py | 37 | 15993 | from __future__ import unicode_literals
from django import forms
from django.conf import settings
from guardian.compat import url, patterns
from django.contrib import admin
from django.contrib import messages
from django.contrib.admin.widgets import FilteredSelectMultiple
from django.core.urlresolvers import reverse
f... | bsd-2-clause |
chris-chris/tensorflow | tensorflow/contrib/slim/python/slim/nets/resnet_v2_test.py | 49 | 18547 | # Copyright 2016 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 |
hubo1016/vlcp | doc/source/ext/gendoc.py | 1 | 4701 | '''
Created on 2017/1/13
:author: hubo
'''
from configlist import list_config
from listmodules import list_modules, list_proxy
import jinja2
import os
import os.path
import shutil
from pkgutil import walk_packages
from vlcp.event import Event
def _merge_all(func):
def _func():
result = func('vlcp')
... | apache-2.0 |
ByteInternet/libcloud | libcloud/test/test_types.py | 68 | 3681 | # 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 |
saydulk/horizon | openstack_dashboard/dashboards/project/volumes/volumes/tables.py | 17 | 19481 | # Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... | apache-2.0 |
sklnet/beyonwiz-enigma2 | lib/python/Screens/WizardLanguage.py | 6 | 1151 | from Screens.Wizard import Wizard
from Components.Label import Label
from Components.Language import language
from os import system
class WizardLanguage(Wizard):
def __init__(self, session, showSteps = True, showStepSlider = True, showList = True, showConfig = True):
Wizard.__init__(self, session, showSteps, showSt... | gpl-2.0 |
Simran-B/arangodb | 3rdParty/V8-4.3.61/third_party/python_26/Lib/encodings/euc_jisx0213.py | 816 | 1051 | #
# euc_jisx0213.py: Python Unicode Codec for EUC_JISX0213
#
# Written by Hye-Shik Chang <perky@FreeBSD.org>
#
import _codecs_jp, codecs
import _multibytecodec as mbc
codec = _codecs_jp.getcodec('euc_jisx0213')
class Codec(codecs.Codec):
encode = codec.encode
decode = codec.decode
class IncrementalEncoder(m... | apache-2.0 |
alanbowman/home-assistant | homeassistant/components/switch/__init__.py | 4 | 4104 | """
homeassistant.components.switch
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Component to interface with various switches that can be controlled remotely.
"""
from datetime import timedelta
import logging
import os
from homeassistant.config import load_yaml_config_file
from homeassistant.helpers.entity_component import EntityC... | mit |
kaste/waterf | tests/enqueue_test.py | 1 | 5368 | import pytest
from _helper import consume, tick, count_tasks
notimplemented = xfail = pytest.mark.xfail
beforeEach = pytest.mark.usefixtures
import datetime
from waterf import queue, task, snake
messages = []
@pytest.fixture
def clear_messages():
while messages:
messages.pop()
def P(message='P'):
... | bsd-2-clause |
andela-earinde/bellatrix-py | app/js/lib/lib/modules/test/test_fileio.py | 8 | 16500 | # Adapted from test_file.py by Daniel Stutzbach
from __future__ import unicode_literals
import sys
import os
import errno
import unittest
from array import array
from weakref import proxy
from functools import wraps
from UserList import UserList
from test.test_support import TESTFN, check_warnings, run_unittest, mak... | mit |
bixbydev/Bixby | google/dist/gdata-2.0.18/tests/gdata_tests/spreadsheets/live_client_test.py | 23 | 10326 | #!/usr/bin/env python
#
# Copyright (C) 2009 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 ... | gpl-3.0 |
SNoiraud/gramps | gramps/plugins/db/dbapi/test/db_test.py | 8 | 33651 | #
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2016 Nick Hall
#
# 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 your option) a... | gpl-2.0 |
atruberg/django-custom | tests/mail/tests.py | 48 | 36821 | # coding: utf-8
from __future__ import unicode_literals
import asyncore
from email.mime.text import MIMEText
import os
import shutil
import smtpd
import sys
import tempfile
import threading
from django.core import mail
from django.core.mail import (EmailMessage, mail_admins, mail_managers,
EmailMultiAlternati... | bsd-3-clause |
jmservera/connectthedots | Devices/GatewayConnectedDevices/BLEMoisture/SensorAgent.py | 12 | 4093 | '''
Copyright (c) Microsoft Open Technologies, Inc. All rights reserved.
The MIT License (MIT)
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 limitati... | mit |
minhphung171093/OpenERP_V8 | openerp/addons/event/report/report_event_registration.py | 310 | 4079 | # -*- 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 |
Jgarcia-IAS/ReporsitorioVacioOdoo | openerp/addons/product_extended/wizard/__init__.py | 374 | 1078 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# This program is free software: you can redistribute it and/or modify
#... | agpl-3.0 |
MontyThibault/Force-Sensor-Integration | MayaIntegration/SixAxis.py | 1 | 2895 | from ctypes import *
import maya.cmds as cmds
import Calibration as C
import unittest
class SixAxis(object):
def __init__(self, device, channels, name, load = True):
""" Maps a single six-axis sensor to a Maya transform
Device: An instance of PAIO.AIODevice()
Channels: The channel indicies for the sensor in th... | mit |
akaszynski/vtkInterface | examples/00-load/create-geometric-objects.py | 1 | 1356 | """
.. _ref_geometric_example:
Geometric Objects
~~~~~~~~~~~~~~~~~
The "Hello, world!" of VTK
"""
import pyvista as pv
###############################################################################
# This runs through several of the available geomoetric objects available in
# VTK which PyVista provides simple conve... | mit |
akornatskyy/sample-blog-api | src/config.py | 1 | 4285 | """
"""
import logging
import os
import sys
from datetime import timedelta
try: # pragma: nocover
from ConfigParser import ConfigParser
config = ConfigParser()
except ImportError: # pragma: nocover
from configparser import ConfigParser
config = ConfigParser(strict=False)
from wheezy.caching.logging... | mit |
ahelsing/geni-ch | tools/guard_utils.py | 1 | 29623 | #----------------------------------------------------------------------
# Copyright (c) 2011-2015 Raytheon BBN Technologies
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and/or hardware specification (the "Work") to
# deal in the Work without restriction, including ... | mit |
elky/django | django/middleware/http.py | 39 | 1636 | from django.utils.cache import (
cc_delim_re, get_conditional_response, set_response_etag,
)
from django.utils.deprecation import MiddlewareMixin
from django.utils.http import parse_http_date_safe
class ConditionalGetMiddleware(MiddlewareMixin):
"""
Handle conditional GET operations. If the response has a... | bsd-3-clause |
pandeyop/tempest | tempest/api/image/v2/test_images.py | 6 | 10418 | # Copyright 2013 OpenStack Foundation
# Copyright 2013 IBM Corp
# 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/LICE... | apache-2.0 |
pchauncey/ansible | lib/ansible/constants.py | 11 | 4431 | # Copyright (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
# Copyright (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Make coding more python3-ish
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
... | gpl-3.0 |
sposs/DIRAC | WorkloadManagementSystem/JobWrapper/WatchdogFactory.py | 7 | 2208 | ########################################################################
# $HeadURL$
# File : WatchdogFactory.py
# Author : Stuart Paterson
########################################################################
""" The Watchdog Factory instantiates a given Watchdog based on a quick
determination of the local... | gpl-3.0 |
RadiumBot/Radium_tomato | tools/perf/scripts/python/check-perf-trace.py | 11214 | 2503 | # perf script event handlers, generated by perf script -g python
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# This script tests basic functionality such as flag and symbol
# strings, common_xxx() calls back into perf, begin, end, unhandled
# events, etc. ... | gpl-2.0 |
bigdatauniversity/edx-platform | common/test/acceptance/tests/studio/test_studio_bad_data.py | 173 | 3970 | from base_studio_test import ContainerBase
from ...fixtures.course import XBlockFixtureDesc
from ...pages.studio.utils import verify_ordering
class BadComponentTest(ContainerBase):
"""
Tests that components with bad content do not break the Unit page.
"""
__test__ = False
def get_bad_html_content... | agpl-3.0 |
PaoloCifariello/Node-Raspberry-GMusic | src/py_modules/url_getter.py | 1 | 1438 | import pygame, StringIO, sys, socket, os
from gmusicapi import Webclient, exceptions
class UrlGetter:
def __init__(self, sck_path, user, passwd):
pygame.init()
pygame.mixer.init()
self.sck_path = sck_path
self.webapi = Webclient()
self.socket = socket.socket(socket.AF... | mit |
Pointedstick/ReplicatorG | skein_engines/skeinforge-40/fabmetheus_utilities/miscellaneous/fabricate/example.py | 23 | 3740 | #!/usr/bin/python
try:
import serial
except:
print('You do not have pySerial installed, which is needed to control the serial port.')
print('Information on pySerial is at:\nhttp://pyserial.wiki.sourceforge.net/pySerial')
import reprap, time, sys
#reprap.snap.printOutgoingPackets = True
#reprap.snap.printIncomingPa... | gpl-2.0 |
Reinis/openbabel | test/testfastsearch.py | 2 | 1907 | """Test OpenBabel executables from Python
Note: Python bindings not used
On Windows or Linux, you can run these tests at the commandline
in the build folder with:
"C:\Program Files\CMake 2.6\bin\ctest.exe" -C CTestTestfile.cmake
-R pytest -VV
You could also "chdir" into bui... | gpl-2.0 |
naresh21/synergetics-edx-platform | lms/djangoapps/certificates/migrations/0003_data__default_modes.py | 54 | 1388 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
# Converted from the original South migration 0002_default_rate_limit_config.py
from django.db import migrations, models
from django.conf import settings
from django.core.files import File
def forwards(apps, schema_editor):
"""Add default modes"""
... | agpl-3.0 |
slipperyhank/pyphi | pyphi/models/fmt.py | 1 | 12680 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# models/fmt.py
"""
Helper functions for formatting pretty representations of PyPhi models.
"""
from itertools import chain
from .. import config, utils
# TODO: will these print correctly on all terminals?
SMALL_PHI = "\u03C6"
BIG_PHI = "\u03D5"
# repr verbosity leve... | gpl-3.0 |
musically-ut/statsmodels | statsmodels/graphics/tests/test_dotplot.py | 26 | 15330 | import numpy as np
from statsmodels.graphics.dotplots import dot_plot
import pandas as pd
from numpy.testing import dec
# If true, the output is written to a multi-page pdf file.
pdf_output = False
try:
import matplotlib.pyplot as plt
import matplotlib
have_matplotlib = True
except ImportError:
have_m... | bsd-3-clause |
jonathanmarvens/jeeves | test/gallery/location/confidentiality/Location.py | 3 | 2705 | '''
Location example for Jeeves with confidentiality policies.
'''
from abc import ABCMeta, abstractmethod
from macropy.case_classes import macros, enum
import JeevesLib
from sourcetrans.macro_module import macros, jeeves
class InternalError(Exception):
def __init__(self, message):
self.message = message
# De... | mit |
bakins/kubernetes | vendor/github.com/ugorji/go/codec/test.py | 1138 | 3876 | #!/usr/bin/env python
# This will create golden files in a directory passed to it.
# A Test calls this internally to create the golden files
# So it can process them (so we don't have to checkin the files).
# Ensure msgpack-python and cbor are installed first, using:
# sudo apt-get install python-dev
# sudo apt-g... | apache-2.0 |
xkmato/tracpro | tracpro/baseline/tests/test_charts.py | 2 | 5235 | from __future__ import unicode_literals
import datetime
from dateutil.relativedelta import relativedelta
import pytz
from tracpro.test import factories
from tracpro.test.cases import TracProTest
from ..charts import chart_baseline
from ..forms import BaselineTermFilterForm
from ..models import BaselineTerm
class... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.