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 |
|---|---|---|---|---|---|
jhbsz/OSI-OS | crypto/heimdal/lib/wind/UnicodeData.py | 82 | 2167 | #!/usr/local/bin/python
# -*- coding: iso-8859-1 -*-
# $Id$
# Copyright (c) 2004 Kungliga Tekniska Högskolan
# (Royal Institute of Technology, Stockholm, Sweden).
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following... | bsd-3-clause |
jmartinezchaine/OpenERP | openerp/addons/base_calendar/__openerp__.py | 9 | 2127 | # -*- 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 |
bzennn/blog_flask | python/lib/python3.5/site-packages/gunicorn/workers/sync.py | 40 | 7153 | # -*- coding: utf-8 -
#
# This file is part of gunicorn released under the MIT license.
# See the NOTICE for more information.
#
from datetime import datetime
import errno
import os
import select
import socket
import ssl
import sys
import gunicorn.http as http
import gunicorn.http.wsgi as wsgi
import gunicorn.util as... | gpl-3.0 |
tesidroni/mp | Lib/encodings/unicode_escape.py | 852 | 1184 | """ Python 'unicode-escape' 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 inte... | gpl-3.0 |
ryangallen/django | django/contrib/gis/geos/prepared.py | 328 | 2445 | from .base import GEOSBase
from .error import GEOSException
from .libgeos import geos_version_info
from .prototypes import prepared as capi
class PreparedGeometry(GEOSBase):
"""
A geometry that is prepared for performing certain operations.
At the moment this includes the contains covers, and intersects
... | bsd-3-clause |
absoludity/servo | tests/wpt/web-platform-tests/tools/pytest/testing/code/test_excinfo.py | 165 | 30814 | # -*- coding: utf-8 -*-
import _pytest
import py
import pytest
from _pytest._code.code import FormattedExcinfo, ReprExceptionInfo
queue = py.builtin._tryimport('queue', 'Queue')
failsonjython = pytest.mark.xfail("sys.platform.startswith('java')")
from test_source import astonly
try:
import importlib
except Impo... | mpl-2.0 |
lancelote/banneret | tests/conftest.py | 1 | 1955 | import logging
import sys
import pytest
from click.testing import CliRunner
from banneret import Banneret, Docker
from banneret.cli import LINUX, MACOS
only_mac = pytest.mark.skipif(sys.platform not in MACOS, reason='Not macOS')
only_linux = pytest.mark.skipif(sys.platform not in LINUX, reason='Not Linux')
@pytest... | mit |
blacklin/kbengine | kbe/src/lib/python/Lib/ctypes/test/test_frombuffer.py | 70 | 2481 | from ctypes import *
import array
import gc
import unittest
class X(Structure):
_fields_ = [("c_int", c_int)]
init_called = False
def __init__(self):
self._init_called = True
class Test(unittest.TestCase):
def test_fom_buffer(self):
a = array.array("i", range(16))
x = (c_int * ... | lgpl-3.0 |
Balannen/LSMASOMM | atom3/Kernel/GraphicEditor/testGraphics.py | 1 | 27361 | import unittest
import Tkinter
import Graphics
import Geometry
# python2.2 testGraphics.py -v
def testOperationsLeafGF(tester, operations):
for op in operations:
apply(op[1], op[2])
tuples = map(None, op[0].xy, op[3])
for tup in tuples:
tester.failIf(tup[0] <= tup[1] - tester.e)
... | gpl-3.0 |
notmyname/swift | test/unit/proxy/controllers/test_info.py | 12 | 12321 | # Copyright (c) 2010-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 agree... | apache-2.0 |
mortada/tensorflow | tensorflow/contrib/distributions/python/kernel_tests/bijectors/sigmoid_test.py | 72 | 2402 | # 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 |
betoesquivel/fil2014 | build/django/django/core/servers/basehttp.py | 62 | 6111 | """
HTTP server that implements the Python WSGI protocol (PEP 333, rev 1.21).
Based on wsgiref.simple_server which is part of the standard library since 2.5.
This is a simple server for use in testing or debugging Django apps. It hasn't
been reviewed for security issues. DON'T USE IT FOR PRODUCTION USE!
"""
from __f... | mit |
nicolashainaux/mathmakerlib | tests/03_calculus/03_unit_test.py | 1 | 3736 | # -*- coding: utf-8 -*-
# Mathmaker Lib offers lualatex-printable mathematical objects.
# Copyright 2006-2017 Nicolas Hainaux <nh.techn@gmail.com>
# This file is part of Mathmaker Lib.
# Mathmaker Lib is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as pu... | gpl-3.0 |
thechampanurag/django-oscar | src/oscar/test/factories/offer.py | 23 | 1385 | import factory
from oscar.core.loading import get_model
__all__ = [
'RangeFactory', 'ConditionFactory', 'BenefitFactory',
'ConditionalOfferFactory',
]
class RangeFactory(factory.DjangoModelFactory):
name = factory.Sequence(lambda n: 'Range %d' % n)
slug = factory.Sequence(lambda n: 'range-%d' % n)
... | bsd-3-clause |
EmreAtes/spack | var/spack/repos/builtin/packages/r-pbdzmq/package.py | 5 | 2114 | ##############################################################################
# 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 |
eickenberg/scikit-learn | sklearn/metrics/cluster/unsupervised.py | 10 | 8104 | """ Unsupervised evaluation metrics. """
# Authors: Robert Layton <robertlayton@gmail.com>
#
# License: BSD 3 clause
import numpy as np
from ...utils import check_random_state
from ..pairwise import pairwise_distances
def silhouette_score(X, labels, metric='euclidean', sample_size=None,
random... | bsd-3-clause |
bqbn/addons-server | src/olympia/scanners/migrations/0004_auto_20191018_0740.py | 7 | 1115 | from django.db import migrations
from olympia.constants.scanners import YARA
class Migration(migrations.Migration):
dependencies = [
('scanners', '0003_auto_20191017_1514'),
('yara', '0003_auto_20191010_1446'),
]
operations = [
migrations.RunSQL(
[
(
... | bsd-3-clause |
MobinRanjbar/hue | desktop/core/ext-py/boto-2.38.0/boto/ec2/placementgroup.py | 150 | 2002 | # Copyright (c) 2010 Mitch Garnaat http://garnaat.org/
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, m... | apache-2.0 |
Architektor/PySnip | venv/lib/python2.7/site-packages/pip/download.py | 143 | 31722 | from __future__ import absolute_import
import cgi
import email.utils
import getpass
import json
import logging
import mimetypes
import os
import platform
import re
import shutil
import sys
import tempfile
try:
import ssl # noqa
HAS_TLS = True
except ImportError:
HAS_TLS = False
from pip._vendor.six.move... | gpl-3.0 |
tpoisot/tammy | tests/services.py | 1 | 1229 | #! /usr/bin/env python3
import sys, os
import unittest
import yaml
import json
sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
import tammy
class PeerJ(unittest.TestCase):
def test_pubtype(self):
self.assertRaises(ValueError, tammy.from_peerj, 200, 'paper')
def test_argtype(self):
... | bsd-2-clause |
jahantech/Python | information_system.py | 1 | 9855 | #!/usr/bin/python
import webbrowser
import os
import datetime
def stringchecker (orig,v1):
ret = True
x = len(v1)
j=0
for j in range(0,x,1):
if(len(v1)<=len(orig)):
if orig[j].capitalize() == v1[j] or orig[j]==v1[j]:
ret = ret and True
elif orig[j] != v1[j]:
ret = ret and False
... | apache-2.0 |
dufferzafar/mitmproxy | mitmproxy/contrib/wbxml/ASWBXMLCodePage.py | 47 | 1781 | #!/usr/bin/env python
'''
@author: David Shaw, david.shaw.aw@gmail.com
Inspired by EAS Inspector for Fiddler
https://easinspectorforfiddler.codeplex.com
----- The MIT License (MIT) -----
Filename: ASWBXMLCodePage.py
Copyright (c) 2014, David P. Shaw
Permission is hereby granted, free of charge, to any person obtain... | mit |
meteorcloudy/tensorflow | tensorflow/python/training/tensorboard_logging.py | 165 | 5328 | # 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 |
openstack/octavia | octavia/amphorae/backends/utils/haproxy_query.py | 1 | 4759 | # Copyright 2015 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 |
tastynoodle/django | django/views/csrf.py | 235 | 3802 | from django.http import HttpResponseForbidden
from django.template import Context, Template
from django.conf import settings
# We include the template inline since we need to be able to reliably display
# this error message, especially for the sake of developers, and there isn't any
# other way of making it available ... | bsd-3-clause |
zsiciarz/django | django/template/loader.py | 129 | 2054 | from . import engines
from .exceptions import TemplateDoesNotExist
def get_template(template_name, using=None):
"""
Load and return a template for the given name.
Raise TemplateDoesNotExist if no such template exists.
"""
chain = []
engines = _engine_list(using)
for engine in engines:
... | bsd-3-clause |
ping/youtube-dl | youtube_dl/extractor/sportdeutschland.py | 53 | 3779 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
parse_iso8601,
sanitized_Request,
)
class SportDeutschlandIE(InfoExtractor):
_VALID_URL = r'https?://sportdeutschland\.tv/(?P<sport>[^/?#]+)/(?P<id>[^?#/]+)(?:$|[?#])'
_TESTS = [... | unlicense |
djt5019/tornado | tornado/testing.py | 19 | 27280 | #!/usr/bin/env python
"""Support classes for automated testing.
* `AsyncTestCase` and `AsyncHTTPTestCase`: Subclasses of unittest.TestCase
with additional support for testing asynchronous (`.IOLoop` based) code.
* `ExpectLog` and `LogTrapTestCase`: Make test logs less spammy.
* `main()`: A simple test runner (wra... | apache-2.0 |
murusu/shadowsocks | shadowsocks/crypto/table.py | 1044 | 8108 | # !/usr/bin/env python
#
# Copyright 2015 clowwindy
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | apache-2.0 |
Eseoghene/bite-project | deps/gdata-python-client/tests/atom_tests/url_test.py | 41 | 3378 | #!/usr/bin/python
#
# Copyright (C) 2008 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 ... | apache-2.0 |
gmm001/android_kernel_zte_nx503a-1 | scripts/rt-tester/rt-tester.py | 11005 | 5307 | #!/usr/bin/python
#
# rt-mutex tester
#
# (C) 2006 Thomas Gleixner <tglx@linutronix.de>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
import os
import sys
import getopt
import sh... | gpl-2.0 |
tvotyakov/codeeval | easy/beautiful-strings/code.py | 1 | 1499 | #!python3
def max_beauty_of_string(in_str):
'''(string) -> int
Calculates maximum beauty of the in_str string.
The beauty of the string is the sum of the beauty of the
letters in it. The beauty of each letter is an integer
between 1 and 26, inclusive, and no two letters have the
same be... | gpl-2.0 |
domyam97/airlights | slack/venv/lib/python2.7/site-packages/chardet/sbcsgroupprober.py | 273 | 3546 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2001
# the Initial Developer. All R... | mit |
waseem18/oh-mainline | vendor/packages/kombu/docs/_ext/literals_to_xrefs.py | 29 | 4801 | """
Runs through a reST file looking for old-style literals, and helps replace them
with new-style references.
"""
import re
import sys
import shelve
try:
input = input
except NameError:
input = raw_input # noqa
refre = re.compile(r'``([^`\s]+?)``')
ROLES = (
'attr',
'class',
"djadmin",
'da... | agpl-3.0 |
huguesv/PTVS | Python/Product/Miniconda/Miniconda3-x64/Lib/site-packages/win32/Demos/security/sspi/fetch_url.py | 6 | 5429 | """
Fetches a URL from a web-server supporting NTLM authentication
eg, IIS.
If no arguments are specified, a default of http://localhost/localstart.asp
is used. This script does follow simple 302 redirections, so pointing at the
root of an IIS server is should work.
"""
import sys
import urllib.request, urllib.parse... | apache-2.0 |
shawnrice/alfred-bundler | tests/python/test_wrappers.py | 1 | 7239 | #!/usr/bin/env python
# encoding: utf-8
#
# Copyright © 2014 The Alfred Bundler Team
# MIT Licence. See http://opensource.org/licenses/MIT
from __future__ import print_function, unicode_literals
import os
import imp
import sys
import time
import types
import inspect
import logging
import unittest
from common import ... | mit |
Machtan/M3 | PyGame/main.py | 1 | 11435 |
from simplegame import Game, Transform, Axis, Animation, Sprite
from simplegame import Loader, MouseListener, Clear, Jukebox, KeyHandler
from simplegame import Vector
from upgrade import Upgrade
from rotation import Rotatable
import random
import pygame
import os
import math
class DestructibleBlock(Sprite):
def... | mit |
judecalvillo/pyinotify | python2/examples/stats_threaded.py | 9 | 1360 | # Example: prints statistics (threaded version).
#
import time
import pyinotify
# Do the same thing than stats.py but with a ThreadedNotifier's
# instance.
# This example illustrates the use of this class but the recommanded
# implementation is whom of stats.py
class Identity(pyinotify.ProcessEvent):
def process_... | mit |
Oefenweb/python-untraceables | untraceables/utilities/mysql.py | 1 | 3852 | # -*- coding: utf-8 -*-
"""
MySQL utility functions.
"""
from __future__ import absolute_import
from warnings import filterwarnings
import MySQLdb
import MySQLdb.cursors
from untraceables.utilities import query as query_utility
filterwarnings('ignore', category=MySQLdb.Warning)
def get_connection(host, user, passw... | mit |
jeffbryner/MozDef | scripts/ingest/insert_loginput.py | 3 | 1168 | #!/usr/bin/env python
import time
import optparse
import mozdef_client as mozdef
parser = optparse.OptionParser()
parser.add_option('--loginput_host', help='MozDef Loginput host (default: http://127.0.0.1:8080)', default='http://127.0.0.1:8080')
parser.add_option('--num_times', help='Number of times event is sent to... | mpl-2.0 |
sasukeh/neutron | neutron/plugins/ml2/extensions/port_security.py | 18 | 3867 | # Copyright 2015 Intel Corporation.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... | apache-2.0 |
Tyler2004/pychess | lib/pychess/Utils/Board.py | 20 | 15130 | from __future__ import absolute_import
from __future__ import print_function
from copy import copy
from pychess.compat import basestring
from .lutils.LBoard import LBoard
from .lutils.bitboard import iterBits
from .lutils.lmove import RANK, FILE, FCORD, FLAG, PROMOTE_PIECE, toAN
from .Piece import Piece
from .Cord imp... | gpl-3.0 |
chouseknecht/ansible | lib/ansible/module_utils/facts/hardware/base.py | 172 | 2736 | # This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by Ansible
# still belong to the author of the module, and may assign their own license
# to the complete wo... | gpl-3.0 |
ericjpj/ns-3-dev | .waf-1.7.13-5a064c2686fe54de4e11018d22148cfc/waflib/Tools/vala.py | 276 | 7966 | #! /usr/bin/env python
# encoding: utf-8
# WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file
import os.path,shutil,re
from waflib import Context,Task,Utils,Logs,Options,Errors
from waflib.TaskGen import extension,taskgen_method
from waflib.Configure import conf
class ... | gpl-2.0 |
major/os-ansible-deployment | releasenotes/source/conf.py | 8 | 9227 | # -*- coding: utf-8 -*-
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software... | apache-2.0 |
jason-z-hang/airflow | airflow/contrib/plugins/metastore_browser/main.py | 42 | 5126 | from datetime import datetime
import json
from flask import Blueprint, request
from flask.ext.admin import BaseView, expose
import pandas as pd
from airflow.hooks import HiveMetastoreHook, MySqlHook, PrestoHook, HiveCliHook
from airflow.plugins_manager import AirflowPlugin
from airflow.www import utils as wwwutils
M... | apache-2.0 |
houlixin/BBB-TISDK | linux-devkit/sysroots/i686-arago-linux/usr/lib/python2.7/sysconfig.py | 2 | 25753 | """Provide access to Python's configuration information.
"""
import sys
import os
from os.path import pardir, realpath
_INSTALL_SCHEMES = {
'posix_prefix': {
'stdlib': '{base}/'+sys.lib+'/python{py_version_short}',
'platstdlib': '{platbase}/'+sys.lib+'/python{py_version_short}',
'purelib':... | gpl-2.0 |
zhengbomo/python_practice | project/ProjectScaner/ImageScanner.py | 1 | 4897 | #!/usr/bin/python
# -*- coding:utf-8 -*-
import os
# 扫描资源引用
import re
class ImageScanner(object):
def __init__(self, path):
self.path = path
def scan_image_name(self):
# 扫描所有图片资源,遇到.imageset结尾的文件夹,则返回
files = self.__class__.__get_all_files(self.path, r'.png|.jpg|.pdf')
image_... | mit |
mjudsp/Tsallis | examples/classification/plot_digits_classification.py | 34 | 2409 | """
================================
Recognizing hand-written digits
================================
An example showing how the scikit-learn can be used to recognize images of
hand-written digits.
This example is commented in the
:ref:`tutorial section of the user manual <introduction>`.
"""
print(__doc__)
# Autho... | bsd-3-clause |
airbnb/airflow | tests/providers/jenkins/hooks/test_jenkins.py | 5 | 2658 | #
# 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... | apache-2.0 |
costingalan/ltp | testcases/network/nfsv4/acl/test_acl.py | 27 | 3315 | '''
Access Control Lists testing based on newpynfs framework
Aurelien Charbon - Bull SA
'''
from random_gen import *
import commands
import os
import threading
import time
import random
alphabet='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ123456789_-() ~'
t_alphabet=len(alphabet)
def test_acl_default(path)... | gpl-2.0 |
seanli9jan/tensorflow | tensorflow/python/tools/freeze_graph_test.py | 9 | 13561 | # 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 |
bencer/sd-agent-plugins | Nagios/Nagios.py | 1 | 5559 | """
Server Density Nagios plugin
"""
import sys
import re
import logging
import json
import time
import subprocess
METRICS = [
'Total Services',
'Services Checked',
'Services Scheduled',
'Services Actively Checked',
'Services Passively Checked',
'Services Flapping',
'Services In Downtime',... | bsd-3-clause |
rexshihaoren/scikit-learn | examples/linear_model/plot_sgd_penalties.py | 249 | 1563 | """
==============
SGD: Penalties
==============
Plot the contours of the three penalties.
All of the above are supported by
:class:`sklearn.linear_model.stochastic_gradient`.
"""
from __future__ import division
print(__doc__)
import numpy as np
import matplotlib.pyplot as plt
def l1(xs):
return np.array([np.... | bsd-3-clause |
bcroq/kansha | kansha/validator.py | 2 | 4635 | # -*- coding:utf-8 -*-
#--
# Copyright (c) 2012-2014 Net-ng.
# All rights reserved.
#
# This software is licensed under the BSD License, as described in
# the file LICENSE.txt, which you should have received as part of
# this distribution.
#--
import re
import string
import ntpath
from lxml import html
from nagare im... | bsd-3-clause |
bwhite/hadoopy | hadoopy/thirdparty/pyinstaller/PyInstaller/lib/macholib/MachOGraph.py | 1 | 3783 | """
Utilities for reading and writing Mach-O headers
"""
from pkg_resources import require
require("altgraph")
import os
import sys
from altgraph.Graph import Graph
from altgraph.ObjectGraph import ObjectGraph
from macholib.mach_o import *
from macholib.dyld import dyld_find
from macholib.MachO import MachO
from ma... | gpl-3.0 |
shail2810/nova | nova/virt/vmwareapi/network_util.py | 23 | 8643 | # Copyright (c) 2012 VMware, Inc.
# Copyright (c) 2011 Citrix Systems, Inc.
# Copyright 2011 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://w... | apache-2.0 |
maemo-foss/meego-cellular-telepathy-ring | tools/glib-errors-enum-body-gen.py | 14 | 1770 | #!/usr/bin/python
import sys
import xml.dom.minidom
from libglibcodegen import NS_TP, camelcase_to_upper, get_docstring, \
get_descendant_text
class Generator(object):
def __init__(self, dom):
self.dom = dom
self.errors = self.dom.getElementsByTagNameNS(NS_TP, 'errors')[0]
def do_hea... | lgpl-2.1 |
willzhang05/postgrestesting1 | postgrestesting1/lib/python3.5/site-packages/pip/_vendor/html5lib/sanitizer.py | 283 | 17660 | from __future__ import absolute_import, division, unicode_literals
import re
from xml.sax.saxutils import escape, unescape
from six.moves import urllib_parse as urlparse
from .tokenizer import HTMLTokenizer
from .constants import tokenTypes
content_type_rgx = re.compile(r'''
^
... | mit |
slevenhagen/odoo-npg | addons/sale_mrp/__openerp__.py | 262 | 1912 | # -*- 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 |
ArtsiomCh/tensorflow | tensorflow/contrib/distributions/python/ops/normal_conjugate_posteriors.py | 120 | 5530 | # 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 |
Mj258/weiboapi | srapyDemo/envs/Lib/site-packages/twisted/spread/jelly.py | 8 | 36158 | # -*- test-case-name: twisted.test.test_jelly -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
S-expression-based persistence of python objects.
It does something very much like L{Pickle<pickle>}; however, pickle's main goal
seems to be efficiency (both in space and time); jelly's main ... | mit |
goliveirab/odoo | addons/l10n_in_hr_payroll/report/report_payroll_advice.py | 374 | 3442 | #-*- coding:utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2011 OpenERP SA (<http://openerp.com>). All Rights Reserved
# d$
#
# This program is free software: you can redistribute it and/or modify
# it... | agpl-3.0 |
ashemedai/ansible | lib/ansible/playbook/__init__.py | 83 | 4214 | # (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 |
biotcm/PICheM | CPIs/DrugBank_4.3/drugbank_xml_demo.py | 1 | 2101 | #!/usr/bin/python
# Extract drugs and experimental compounds.
# Songpeng Zu
# 2014-12-30
import os
import xml.sax
class DrugBankHandler(xml.sax.ContentHandler):
def __int__(self):
self.CurrentData = ""
self.DrugBankID = ""
self.smallmolecule = ""
self.drugbank = ""
self.pa... | mit |
rxuriguera/bibtexIndexMaker | src/bibim/rce/extraction.py | 1 | 4634 | # Copyright 2010 Ramon Xuriguera
#
# This file is part of BibtexIndexMaker RCE.
#
#
# BibtexIndexMaker RCE 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... | gpl-3.0 |
Ghini/ghini.desktop | bauble/utils/web.py | 1 | 2060 | # -*- coding: utf-8 -*-
#
# Copyright 2008-2010 Brett Adams
# Copyright 2014-2017 Mario Frasca <mario@anche.no>.
# Copyright 2016 Ross Demuth <rossdemuth123@gmail.com>
#
# This file is part of ghini.desktop.
#
# ghini.desktop is free software: you can redistribute it and/or modify
# it under the terms of the GNU Genera... | gpl-2.0 |
arborh/tensorflow | tensorflow/python/platform/self_check.py | 6 | 2436 | # 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 |
R4stl1n/allianceauth | allianceauth/groupmanagement/admin.py | 5 | 2012 | from django.contrib import admin
from django.contrib.auth.models import Group as BaseGroup
from django.db.models.signals import pre_save, post_save, pre_delete, post_delete, m2m_changed
from django.dispatch import receiver
from .models import AuthGroup
from .models import GroupRequest
class AuthGroupInlineAdmin(admin... | gpl-2.0 |
agentfog/qiime | tests/test_validate_mapping_file.py | 15 | 84978 | #!/usr/bin/env python
__author__ = "William Walters"
__copyright__ = "Copyright 2011, The QIIME Project" # consider project name
__credits__ = ["Rob Knight", "William Walters"] # remember to add yourself
__license__ = "GPL"
__version__ = "1.9.1-dev"
__maintainer__ = "William Walters"
__email__ = "william.a.walters@c... | gpl-2.0 |
ruud-v-a/servo | etc/servo_gdb.py | 20 | 4281 | # Copyright 2013 The Servo Project Developers. See the COPYRIGHT
# file at the top-level directory of this distribution.
#
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
# <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
#... | mpl-2.0 |
Averroes/autokey | src/lib/gtkui/settingsdialog.py | 46 | 9114 | # -*- coding: utf-8 -*-
# Copyright (C) 2011 Chris Dekter
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This pr... | gpl-3.0 |
matthewoliver/swift | swift/common/middleware/s3api/controllers/obj.py | 1 | 5246 | # Copyright (c) 2010-2014 OpenStack Foundation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agre... | apache-2.0 |
Samsung/skia | third_party/externals/jsoncpp/scons-tools/globtool.py | 256 | 1667 | import fnmatch
import os
def generate( env ):
def Glob( env, includes = None, excludes = None, dir = '.' ):
"""Adds Glob( includes = Split( '*' ), excludes = None, dir = '.')
helper function to environment.
Glob both the file-system files.
includes: list of file name pattern included i... | bsd-3-clause |
paulrouget/servo | tests/wpt/web-platform-tests/cors/resources/status.py | 26 | 1209 | def main(request, response):
response.headers.set("Access-Control-Allow-Origin", request.headers.get("origin"))
response.headers.set("Access-Control-Expose-Headers", "X-Request-Method")
if request.method == 'OPTIONS':
response.headers.set("Access-Control-Allow-Methods", "GET, CHICKEN, HEAD, POST, ... | mpl-2.0 |
dgarciam/Sick-Beard | lib/hachoir_core/field/basic_field_set.py | 90 | 4762 | from lib.hachoir_core.field import Field, FieldError
from lib.hachoir_core.stream import InputStream
from lib.hachoir_core.endian import BIG_ENDIAN, LITTLE_ENDIAN
from lib.hachoir_core.event_handler import EventHandler
class ParserError(FieldError):
"""
Error raised by a field set.
@see: L{FieldError}
... | gpl-3.0 |
heke123/chromium-crosswalk | third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/breakpad/dump_reader_multipart_unittest.py | 7 | 5181 | # Copyright (C) 2013 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 ... | bsd-3-clause |
mioann47/mobile-app-privacy-analyzer | mypythonscripts/tools/modified/androguard/decompiler/dad/control_flow.py | 7 | 15440 | # This file is part of Androguard.
#
# Copyright (c) 2012 Geoffroy Gueguen <geoffroy.gueguen@gmail.com>
# 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://... | gpl-3.0 |
olethanh/django-gcaltemplatetag | gcaltemplatetag/templatetags/gcal.py | 1 | 4419 | """
Tags which can retrieve events from a public google calendar Atom feed,
and return the results for use in templates.
Copyright (c) 2011, Olivier Le Thanh Duong <olivier@lethanh.be>
Based on django-template-utils :
Copyright (c) 2009, James Bennett & Justin Quick
Based, in part, on the original idea by user b... | bsd-3-clause |
takis/odoo | addons/base_iban/__init__.py | 447 | 1073 | # -*- 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 |
mhaberler/machinekit | lib/python/gladevcp/hal_meter.py | 39 | 9330 | # vim: sts=4 sw=4 et
# GladeVcp Widgets
#
# Copyright (c) 2010 Pavel Shramov <shramov@mexmat.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 by
# the Free Software Foundation, either version 2 of the License, or
# (at you... | lgpl-2.1 |
jaharkema/loljournal | apps/match/views.py | 1 | 2968 | from django.contrib.auth.mixins import LoginRequiredMixin
from django.core.urlresolvers import reverse_lazy
from django.views.generic import FormView
from django.views.generic.edit import UpdateView
from django.views.generic.list import ListView
from apps.api.models import RiotGame, RiotChampion
from apps.core.forms i... | mit |
hunger/cleanroom | tests/test_exceptions.py | 1 | 1862 | #!/usr/bin/python
"""Test for the exceptions of cleanroom.
@author: Tobias Hunger <tobias.hunger@gmail.com>
"""
import os
import sys
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
import cleanroom.exceptions as ex
import cleanroom.location as location
def test_base_exceptions(... | gpl-3.0 |
bacontext/mopidy | mopidy/mpd/protocol/playback.py | 11 | 13933 | from __future__ import absolute_import, unicode_literals
from mopidy.core import PlaybackState
from mopidy.internal import deprecation
from mopidy.mpd import exceptions, protocol
@protocol.commands.add('consume', state=protocol.BOOL)
def consume(context, state):
"""
*musicpd.org, playback section:*
... | apache-2.0 |
mapr/hue | desktop/libs/indexer/src/indexer/urls.py | 14 | 1784 | #!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... | apache-2.0 |
tawfiqeee/ROS | ros_workspace/SpartonCompass/src/SpartonCompass.py | 3 | 5404 | #!/usr/bin/env python
# Software License Agreement (BSD License)
# Sparton Digital Compass ROS Driver for SP3003D/AHRS-8/GEDC-6
# Copyright (c) 2012, Cheng-Lung Lee, University of Detroit Mercy.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted ... | mit |
isandlaTech/cohorte-demos | led/dump/led-demo-yun/cohorte/dist/cohorte-1.0.0-20141216.234517-57-python-distribution/repo/sleekxmpp/plugins/xep_0325/device.py | 9 | 4559 | """
SleekXMPP: The Sleek XMPP Library
Implementation of xeps for Internet of Things
http://wiki.xmpp.org/web/Tech_pages/IoT_systems
Copyright (C) 2013 Sustainable Innovation, Joachim.lindborg@sust.se, bjorn.westrom@consoden.se
This file is part of SleekXMPP.
See the file LICENSE for copying per... | apache-2.0 |
obnoxxx/samba | python/samba/netcmd/testparm.py | 31 | 8540 | # Unix SMB/CIFS implementation.
# Test validity of smb.conf
# Copyright (C) 2010-2011 Jelmer Vernooij <jelmer@samba.org>
#
# Based on the original in C:
# Copyright (C) Karl Auer 1993, 1994-1998
# Extensively modified by Andrew Tridgell, 1995
# Converted to popt by Jelmer Vernooij (jelmer@nl.linux.org), 200... | gpl-3.0 |
deokjinkim/servo | components/script/dom/bindings/codegen/parser/tests/test_nullable_equivalency.py | 106 | 3835 | import WebIDL
def WebIDLTest(parser, harness):
parser.parse("""
interface TestNullableEquivalency1 {
attribute long a;
attribute long? b;
};
interface TestNullableEquivalency2 {
attribute ArrayBuffer a;
attribute ArrayBuffer? b;
};
... | mpl-2.0 |
freynaud/selenium | py/test/selenium/webdriver/support/event_firing_webdriver_tests.py | 9 | 8182 | #!/usr/bin/python
# Copyright 2011 Software Freedom Conservancy.
#
# 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 app... | apache-2.0 |
axelspringer/ansible-modules-core | cloud/openstack/os_object.py | 58 | 4111 | #!/usr/bin/python
# Copyright (c) 2015 Hewlett-Packard Development Company, L.P.
# Copyright (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 vers... | gpl-3.0 |
aricchen/openHR | openerp/addons/hr_holidays/hr_holidays.py | 14 | 31505 | # -*- coding: utf-8 -*-
##################################################################################
#
# Copyright (c) 2005-2006 Axelor SARL. (http://www.axelor.com)
# and 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# $Id: hr.py 4656 2006-11-24 09:58:42Z Cyp $
#
# This program is free software: you can redistri... | agpl-3.0 |
SidSachdev/pycrunchbase | tests/test_node.py | 3 | 1070 | from unittest import TestCase
import json
from pycrunchbase.resource.node import Node
from pycrunchbase.resource.utils import parse_date
class TestNode(Node):
KNOWN_PROPERTIES = ['property1', 'property2']
def _coerce_values(self):
# intentionally coerce bad values for test purposes
attr = '... | mit |
1haodian/eagle | eagle-external/eagle-ambari/lib/EAGLE/package/scripts/eagle_hive_topology.py | 21 | 3252 | #!/usr/bin/python
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "Licen... | apache-2.0 |
espena/terminal | test/node_modules/testem/node_modules/js-yaml/support/pyyaml-src/representer.py | 238 | 13528 |
__all__ = ['BaseRepresenter', 'SafeRepresenter', 'Representer',
'RepresenterError']
from .error import *
from .nodes import *
import datetime, sys, copyreg, types, base64
class RepresenterError(YAMLError):
pass
class BaseRepresenter:
yaml_representers = {}
yaml_multi_representers = {}
def __i... | mit |
MultiRRomero/manhattan-map | lib/geopy-1.4.0-py2.6.egg/geopy/geocoders/bing.py | 3 | 7138 | """
:class:`.Bing` geocoder.
"""
from geopy.compat import urlencode
from geopy.geocoders.base import Geocoder, DEFAULT_FORMAT_STRING, \
DEFAULT_TIMEOUT, DEFAULT_SCHEME
from geopy.location import Location
from geopy.util import logger, join_filter
__all__ = ("Bing", )
class Bing(Geocoder):
"""
Geocoder ... | mit |
defzzd/UserDataBase-Heroku | venv/Lib/site-packages/pip/_vendor/requests/packages/chardet/gb2312freq.py | 3132 | 36011 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights R... | mit |
simonwydooghe/ansible | test/lib/ansible_test/_data/sanity/code-smell/future-import-boilerplate.py | 67 | 1646 | #!/usr/bin/env python
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import ast
import sys
def main():
for path in sys.argv[1:] or sys.stdin.read().splitlines():
with open(path, 'rb') as path_fd:
lines = path_fd.read().splitlines()
missing = T... | gpl-3.0 |
adfernandes/pcp | src/pmdas/bpftrace/bpftrace/utils.py | 4 | 1073 | from typing import Optional, Tuple
import sys
import re
import subprocess
import asyncio
def get_bpftrace_version(bpftrace_path: str) -> Optional[Tuple]:
version_str = subprocess.check_output([bpftrace_path, '--version'], encoding='utf8').strip()
version_str = version_str[version_str.find(' ')+1:] # remove '... | lgpl-2.1 |
gtrensch/nest-simulator | pynest/examples/clopath_synapse_small_network.py | 8 | 7493 | # -*- coding: utf-8 -*-
#
# clopath_synapse_small_network.py
#
# This file is part of NEST.
#
# Copyright (C) 2004 The NEST Initiative
#
# NEST 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 ... | gpl-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.