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 |
|---|---|---|---|---|---|
dursk/django | django/contrib/gis/sitemaps/kml.py | 398 | 2544 | from django.apps import apps
from django.contrib.gis.db.models.fields import GeometryField
from django.contrib.sitemaps import Sitemap
from django.core import urlresolvers
from django.db import models
class KMLSitemap(Sitemap):
"""
A minimal hook to produce KML sitemaps.
"""
geo_format = 'kml'
de... | bsd-3-clause |
40223209/test1 | static/Brython3.1.3-20150514-095342/Lib/_imp.py | 625 | 2115 | """(Extremely) low-level import machinery bits as used by importlib and imp."""
class __loader__(object):pass
def _fix_co_filename(*args,**kw):
raise NotImplementedError("%s:not implemented" % ('_imp.py:_fix_co_filename'))
def acquire_lock(*args,**kw):
"""acquire_lock() -> None Acquires the interpreter's... | agpl-3.0 |
mhotwagner/abackend | abackend-env/lib/python3.5/site-packages/psycopg2/tests/test_dates.py | 10 | 24102 | #!/usr/bin/env python
# test_dates.py - unit test for dates handling
#
# Copyright (C) 2008-2011 James Henstridge <james@jamesh.id.au>
#
# psycopg2 is free software: you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, eith... | mit |
jbedorf/tensorflow | tensorflow/python/data/kernel_tests/memory_cleanup_test.py | 7 | 4151 | # Copyright 2018 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 |
terbolous/SickRage | lib/rebulk/rules.py | 29 | 11353 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Abstract rule class definition and rule engine implementation
"""
from abc import ABCMeta, abstractmethod
import inspect
from itertools import groupby
from logging import getLogger
import six
from .utils import is_iterable
from .toposort import toposort
from . import... | gpl-3.0 |
aerospike/aerospike-client-python | test/old_tests/_test_scan.py | 1 | 11528 | # -*- coding: utf-8 -*-
import pytest
import sys
from .test_base_class import TestBaseClass
from aerospike import exception as e
aerospike = pytest.importorskip("aerospike")
try:
import aerospike
except:
print("Please install aerospike python client.")
sys.exit(1)
class TestScan(TestBaseClass):
def... | apache-2.0 |
openturns/otsvm | python/test/t_SVMClassification_std.py | 1 | 1116 | #! /usr/bin/env python
from __future__ import print_function, division
from openturns import *
from otsvm import *
import os
# we retreive the sample from the file sample.csv
path = os.path.abspath(os.path.dirname(__file__))
dataInOut = Sample().ImportFromCSVFile(path + '/sample.csv', ',')
dataIn = Sample(861, 2)
da... | lgpl-3.0 |
mahak/keystone | keystone/assignment/role_backends/sql_model.py | 2 | 4495 | # 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
# distributed under t... | apache-2.0 |
iniverno/RnR-LLC | simics-3.0-install/simics-3.0.31/amd64-linux/lib/python2.4/formatter.py | 13 | 15105 | """Generic output formatting.
Formatter objects transform an abstract flow of formatting events into
specific output events on writer objects. Formatters manage several stack
structures to allow various properties of a writer object to be changed and
restored; writers need not be able to handle relative changes nor an... | gpl-2.0 |
mosquito/construct | tests/test_overwrite.py | 1 | 1876 | import unittest
from construct import Struct, Byte, Embedded, OverwriteError
from construct.lib.py3compat import b
class TestOverwrite(unittest.TestCase):
def test_overwrite(self):
s = Struct("s",
Byte("a"),
Byte("a"),
allow_overwrite=True
... | mit |
endlessm/chromium-browser | third_party/catapult/telemetry/telemetry/internal/backends/chrome_inspector/devtools_client_backend_unittest.py | 1 | 3127 | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from telemetry import decorators
from telemetry.testing import browser_test_case
class DevToolsClientBackendTest(browser_test_case.BrowserTestCase):
@pro... | bsd-3-clause |
sambitgaan/nupic | src/nupic/algorithms/anomaly.py | 31 | 7322 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2014, Numenta, Inc. Unless you have purchased from
# Numenta, Inc. a separate commercial license for this software code, the
# following terms and conditions apply:
#
# This pro... | agpl-3.0 |
mlufei/depot_tools | third_party/boto/services/servicedef.py | 103 | 3341 | # 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 rights to use, copy, modi... | bsd-3-clause |
emonty/deb-vhd-util | tools/python/xen/xend/server/netif2.py | 43 | 5574 | #============================================================================
# This library is free software; you can redistribute it and/or
# modify it under the terms of version 2.1 of the GNU Lesser General Public
# License as published by the Free Software Foundation.
#
# This library is distributed in the hope th... | gpl-2.0 |
py-geek/City-Air | venv/lib/python2.7/site-packages/django/core/cache/backends/memcached.py | 104 | 7065 | "Memcached cache backend"
import time
import pickle
from threading import local
from django.core.cache.backends.base import BaseCache, DEFAULT_TIMEOUT
from django.utils import six
from django.utils.encoding import force_str
class BaseMemcachedCache(BaseCache):
def __init__(self, server, params, library, value_n... | mit |
jtrobec/pants | tests/python/pants_test/backend/jvm/tasks/test_junit_tests_integration.py | 1 | 10421 | # coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import os
from pant... | apache-2.0 |
ksmaheshkumar/weevely3 | modules/file/read.py | 16 | 1210 | from core.vectors import PhpCode, ShellCmd, ModuleExec, Os
from core.module import Module
from core import modules
import tempfile
class Read(Module):
"""Read remote file from the remote filesystem."""
aliases = [ 'cat' ]
def init(self):
self.register_info(
{
'author... | gpl-3.0 |
mujiansu/arangodb | 3rdParty/V8-4.3.61/third_party/python_26/Lib/fileinput.py | 224 | 14143 | """Helper class to quickly write a loop over all standard input files.
Typical use is:
import fileinput
for line in fileinput.input():
process(line)
This iterates over the lines of all files listed in sys.argv[1:],
defaulting to sys.stdin if the list is empty. If a filename is '-' it
is also replace... | apache-2.0 |
viniciusgama/blog_gae | django/core/management/commands/createcachetable.py | 313 | 2307 | from optparse import make_option
from django.core.management.base import LabelCommand
from django.db import connections, transaction, models, DEFAULT_DB_ALIAS
class Command(LabelCommand):
help = "Creates the table needed to use the SQL cache backend."
args = "<tablename>"
label = 'tablename'
option_l... | bsd-3-clause |
PythonCharmers/orange3 | Orange/widgets/classify/owclassificationtreegraph.py | 2 | 18846 | import sys
import numpy
from sklearn.tree._tree import TREE_LEAF
from Orange.widgets.classify.owtreeviewer2d import *
from Orange.data import Table
from Orange.classification.tree import TreeClassifier
from Orange.preprocess.transformation import Indicator
from Orange.widgets.utils.colorpalette import ColorPaletteD... | gpl-3.0 |
ojake/django | tests/migrations/test_loader.py | 165 | 13346 | from __future__ import unicode_literals
from unittest import skipIf
from django.db import connection, connections
from django.db.migrations.exceptions import AmbiguityError, NodeNotFoundError
from django.db.migrations.loader import MigrationLoader
from django.db.migrations.recorder import MigrationRecorder
from djang... | bsd-3-clause |
Sing-Li/go-buildpack | builds/runtimes/python-2.7.6/lib/python2.7/test/test_multibytecodec.py | 81 | 10863 | #!/usr/bin/env python
#
# test_multibytecodec.py
# Unit test for multibytecodec itself
#
from test import test_support
from test.test_support import TESTFN
import unittest, StringIO, codecs, sys, os
import _multibytecodec
ALL_CJKENCODINGS = [
# _codecs_cn
'gb2312', 'gbk', 'gb18030', 'hz',
# _codecs_hk
'big5... | mit |
NEricN/RobotCSimulator | Python/App/Lib/site-packages/pip/_vendor/requests/packages/chardet/mbcssm.py | 982 | 19608 | ######################## 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... | apache-2.0 |
kizniche/Mycodo | mycodo/inputs/anyleaf_ph.py | 1 | 10478 | # coding=utf-8
import copy
from flask_babel import lazy_gettext
from mycodo.inputs.base_input import AbstractInput
from mycodo.utils.constraints_pass import constraints_pass_positive_value
# Measurements
measurements_dict = {
0: {
'measurement': 'ion_concentration',
'unit': 'pH'
},
}
# Input... | gpl-3.0 |
simongoffin/my_odoo_tutorial | addons/account/wizard/account_chart.py | 70 | 5175 | # -*- 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 |
Magicked/crits | crits/objects/views.py | 1 | 18793 | import json
from django.contrib.auth.decorators import user_passes_test
from django.http import HttpResponse
from django.shortcuts import render
from django.template.loader import render_to_string
from crits.core.form_consts import get_source_field_for_class
from crits.core.class_mapper import class_from_id
from crit... | mit |
StefanRijnhart/odoomrp-wip | purchase_landed_cost/__init__.py | 34 | 1087 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
# Copyright (C) 2010-2012 OpenERP s.a. (<http://openerp.com>).
#
# This program is free software: you ca... | agpl-3.0 |
sagiss/sardana | src/sardana/tango/pool/test/__init__.py | 1 | 1111 | #!/usr/bin/env python
##############################################################################
##
## This file is part of Sardana
##
## http://www.sardana-controls.org/
##
## Copyright 2011 CELLS / ALBA Synchrotron, Bellaterra, Spain
##
## Sardana is free software: you can redistribute it and/or modify
## it und... | lgpl-3.0 |
ningchi/scikit-learn | examples/cluster/plot_mini_batch_kmeans.py | 265 | 4081 | """
====================================================================
Comparison of the K-Means and MiniBatchKMeans clustering algorithms
====================================================================
We want to compare the performance of the MiniBatchKMeans and KMeans:
the MiniBatchKMeans is faster, but give... | bsd-3-clause |
bzbarsky/servo | tests/wpt/css-tests/tools/html5lib/html5lib/treebuilders/etree.py | 721 | 12609 | from __future__ import absolute_import, division, unicode_literals
from six import text_type
import re
from . import _base
from .. import ihatexml
from .. import constants
from ..constants import namespaces
from ..utils import moduleFactoryFactory
tag_regexp = re.compile("{([^}]*)}(.*)")
def getETreeBuilder(Elemen... | mpl-2.0 |
SysCompass/compass-core | compass/api/util.py | 4 | 10149 | """Utils for API usage"""
import logging
from flask import make_response
from flask.ext.restful import Api
import re
from netaddr import IPAddress
import simplejson as json
from compass.api import app
api = Api(app)
def make_json_response(status_code, data):
"""Wrap json format to the reponse object"""
r... | apache-2.0 |
yongshengwang/builthue | desktop/core/src/desktop/lib/i18n.py | 38 | 3186 | #!/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 |
sarakha63/persomov | libs/oauthlib/oauth1/rfc5849/utils.py | 112 | 4269 | # -*- coding: utf-8 -*-
"""
oauthlib.utils
~~~~~~~~~~~~~~
This module contains utility methods used by various parts of the OAuth
spec.
"""
import string
import time
import urllib2
from random import getrandbits, choice
from oauthlib.common import quote, unquote
UNICODE_ASCII_CHARACTER_SET = (string.ascii_letters.... | gpl-3.0 |
MattFaus/CrowdTube-Connector | lib/gdata-2.0.18/tests/gdata_tests/books/service_test.py | 127 | 2096 | #!/usr/bin/python
__author__ = "James Sams <sams.james@gmail.com>"
import unittest
import getpass
import atom
import gdata.books
import gdata.books.service
from gdata import test_data
username = ""
password = ""
class BookCRUDTests(unittest.TestCase):
def setUp(self):
self.service = gdata.books.s... | mit |
felipet/wrcalibration | calibration/wrcalibration.py | 1 | 24954 | #! /usr/bin/env python3
# -*- coding: utf-8 -*
'''
Main class for WR Calibration procedure.
@file
@date Created on Apr 23, 2015
@author Felipe Torres (torresfelipex1<AT>gmail.com)
@copyright LGPL v2.1
@see http://www.ohwr.org/projects/white-rabbit/wiki/Calibration
@ingroup calibration
'''
#-----------------------... | gpl-2.0 |
edisonlz/MysqlConsistenceHashRing | consistent.py | 1 | 6315 | #coding=utf-8
#
# you are right in this statement
# http://www.tokutek.com/2010/07/why-insert-on-duplicate-key-update-may-be-slow-by-incurring-disk-seeks/
#
import bisect
import hashlib
import MySQLdb
import time
import logging
import json
class ConsistentHashRing(object):
"""Implement a consistent hashing ring... | apache-2.0 |
lumig242/Hue-Integration-with-CDAP | desktop/core/ext-py/guppy-0.1.10/guppy/heapy/pbhelp.py | 37 | 15757 | # AUTOMATICALLY GENERATED BY GENGUPPY
about="(iguppy.gsl.Text\nRecordingInter\np1\n(dp2\nS'tag_configs'\np3\n(dp4\nI0\n((S'spacing1'\np5\nI11\ntp6\n(S'font'\np7\n(S'times'\np8\nI24\nS'bold'\ntttp9\nsI1\n(g6\n(S'tabs'\np10\n(F23.5\nS'center'\np11\nF57\nS'left'\np12\nttp13\n(g7\n(g8\nI12\nS'bold'\ntp14\ntp15\ntp16\nsI2\... | apache-2.0 |
lidan-fnst/samba | python/samba/tests/get_opt.py | 52 | 1905 | # Unix SMB/CIFS implementation.
# Copyright (C) Jelmer Vernooij <jelmer@samba.org> 2011
#
# 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) a... | gpl-3.0 |
lilbowza1985/s6eng2 | tools/perf/scripts/python/sched-migration.py | 11215 | 11670 | #!/usr/bin/python
#
# Cpu task migration overview toy
#
# Copyright (C) 2010 Frederic Weisbecker <fweisbec@gmail.com>
#
# perf script event handlers have been generated by perf script -g python
#
# This software is distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Fre... | gpl-2.0 |
skmezanul/easyengine | ee/cli/plugins/stack_migrate.py | 4 | 5336 | from cement.core.controller import CementBaseController, expose
from cement.core import handler, hook
from ee.core.mysql import EEMysql
from ee.core.logging import Log
from ee.core.variables import EEVariables
from ee.core.aptget import EEAptGet
from ee.core.shellexec import EEShellExec
from ee.core.apt_repo import EER... | mit |
LazyCodingCat/gyp | test/library/gyptest-shared-obj-install-path.py | 53 | 1098 | #!/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 .so files that are order only dependencies are specified by
their install location rather than by their alias.
"""
# Pyth... | bsd-3-clause |
bpshetty/erpnext | erpnext/hr/doctype/leave_block_list/test_leave_block_list.py | 85 | 1490 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
import unittest
from frappe.utils import getdate
from erpnext.hr.doctype.leave_block_list.leave_block_list import get_applicable_block_da... | gpl-3.0 |
marc-sensenich/ansible | lib/ansible/modules/network/aci/aci_epg.py | 12 | 10462 | #!/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 |
sauloal/pycluster | pypy-1.9_64/lib-python/2.7/plat-irix5/GET.py | 132 | 1025 | # Symbols from <gl/get.h>
from warnings import warnpy3k
warnpy3k("the GET module has been removed in Python 3.0", stacklevel=2)
del warnpy3k
BCKBUFFER = 0x1
FRNTBUFFER = 0x2
DRAWZBUFFER = 0x4
DMRGB = 0
DMSINGLE = 1
DMDOUBLE = 2
DMRGBDOUBLE = 5
HZ30 = 0
HZ60 = 1
NTSC = 2
HDTV = 3
VGA = 4
IRIS3K = 5
PR60 = 6
PAL = 9
HZ3... | mit |
erdincay/pjsip-project | pjsip-apps/src/pygui/call.py | 26 | 3368 | # $Id$
#
# pjsua Python GUI Demo
#
# Copyright (C)2013 Teluu Inc. (http://www.teluu.com)
#
# 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) ... | gpl-2.0 |
marvin8/PremiumizeBlackhole | Premiumize.py | 1 | 4557 | #!/usr/bin/python
import glob
import json
import requests
import os
import sys
import urllib
import zipfile
# Check for command line options
command = ""
if len(sys.argv) != 2:
print "Please specifiy what you'd like " + sys.argv[0] + " to do"
print "Valid options are, 'upload', 'check', and 'download'"
exit()
e... | mit |
ChanderG/scipy | scipy/fftpack/tests/gen_fftw_ref.py | 73 | 1533 | from __future__ import division, print_function, absolute_import
from subprocess import Popen, PIPE, STDOUT
import numpy as np
SZ = [2, 3, 4, 8, 12, 15, 16, 17, 32, 64, 128, 256, 512, 1024]
def gen_data(dt):
arrays = {}
if dt == np.double:
pg = './fftw_double'
elif dt == np.float32:
pg... | bsd-3-clause |
ryosuzuki/crowdsource-platform | crowdsourcing/migrations/0016_auto_20150709_0201.py | 16 | 1121 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('crowdsourcing', '0015_auto_20150709_0149'... | mit |
tersmitten/ansible | test/units/modules/storage/netapp/test_na_ontap_user.py | 16 | 11027 | # (c) 2018, NetApp, Inc
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
''' unit tests ONTAP Ansible module: na_ontap_user '''
from __future__ import print_function
import json
import pytest
from units.compat import unittest
from units.compat.mock import patch
from ansibl... | gpl-3.0 |
ningchi/scikit-learn | sklearn/metrics/tests/test_classification.py | 15 | 49665 | from __future__ import division, print_function
import numpy as np
from scipy import linalg
from functools import partial
from itertools import product
import warnings
from sklearn import datasets
from sklearn import svm
from sklearn.datasets import make_multilabel_classification
from sklearn.preprocessing import La... | bsd-3-clause |
lalinsky/picard | picard/ui/options/__init__.py | 2 | 3083 | # -*- coding: utf-8 -*-
#
# Picard, the next-generation MusicBrainz tagger
# Copyright (C) 2006 Lukáš Lalinský
#
# 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... | gpl-2.0 |
fxfitz/ansible | lib/ansible/module_utils/network/nso/nso.py | 43 | 27045 | # -*- coding: utf-8 -*-
# Copyright (c) 2017 Cisco and/or its affiliates.
#
# 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... | gpl-3.0 |
lixun910/pysal | pysal/explore/pointpats/centrography.py | 1 | 9115 | """
Centrographic measures for point patterns
TODO
- testing
- documentation
"""
__author__ = "Serge Rey sjsrey@gmail.com"
__all__ = ['mbr', 'hull', 'mean_center', 'weighted_mean_center',
'manhattan_median', 'std_distance', 'euclidean_median', 'ellipse',
'skyum', 'dtot',"_circle"]
import sys... | bsd-3-clause |
DiptoDas8/Biponi | src/posts/views.py | 1 | 3350 | try:
from urllib import quote_plus #python 2
except:
pass
try:
from urllib.parse import quote_plus #python 3
except:
pass
from django.contrib import messages
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
from django.db.models import Q
from django.http import HttpResponse, H... | mit |
B-MOOC/edx-platform | lms/djangoapps/psychometrics/psychoanalyze.py | 63 | 11519 | #
# File: psychometrics/psychoanalyze.py
#
# generate pyschometrics plots from PsychometricData
from __future__ import division
import datetime
import logging
import json
import math
import numpy as np
from opaque_keys.edx.locator import BlockUsageLocator
from scipy.optimize import curve_fit
from django.conf impor... | agpl-3.0 |
AnonymousBee/anonymousbee.github.io | libs/jsonrpc/__init__.py | 67 | 1125 |
"""
Copyright (c) 2007 Jan-Klaas Kollhof
This file is part of jsonrpc.
jsonrpc is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later... | gpl-3.0 |
weiawe/django | tests/settings_tests/tests.py | 24 | 18796 | import os
import sys
import unittest
import warnings
from types import ModuleType
from django.conf import LazySettings, Settings, settings
from django.core.exceptions import ImproperlyConfigured
from django.http import HttpRequest
from django.test import (
SimpleTestCase, TestCase, TransactionTestCase, modify_sett... | bsd-3-clause |
liefdiy/bite-project | deps/gdata-python-client/samples/apps/marketplace_sample/gdata/tlslite/utils/codec.py | 361 | 2771 | """Classes for reading/writing binary data (such as TLS records)."""
from compat import *
class Writer:
def __init__(self, length=0):
#If length is zero, then this is just a "trial run" to determine length
self.index = 0
self.bytes = createByteArrayZeros(length)
def add(self, x, lengt... | apache-2.0 |
gagoncal/Selenium | Selenium with python/Selenium_with_python_config_files/setuptools-12.0.1/setuptools/command/build_py.py | 155 | 8644 | from glob import glob
from distutils.util import convert_path
import distutils.command.build_py as orig
import os
import sys
import fnmatch
import textwrap
try:
from setuptools.lib2to3_ex import Mixin2to3
except ImportError:
class Mixin2to3:
def run_2to3(self, files, doctests=True):
"do not... | lgpl-2.1 |
ppke-nlpg/AnaGramma-Parser | ling_rules/mainActions.py | 1 | 41681 | #!/usr/bin/python3
# -*- coding: utf-8, vim: expandtab:ts=4 -*-
import re
import sys
from nltk.featstruct import FeatStruct
from engine.searcher import Searcher
from engine.token_rep import Token
from engine.utils import unify_till_pass, nested_frozen_fs, update_nested_frozen_fs, UnifiableSet
from .verbDictionary im... | lgpl-3.0 |
pedrovanzella/bstar-tree | table.py | 1 | 4136 | import attr
from buffer import Buffer
from record import Record
from btree import BTree
@attr.s
class Table:
BTREE_ROOT_DEFAULT = 16300
buffer = attr.ib(validator=attr.validators.instance_of(Buffer))
btree = attr.ib(default=None)
@classmethod
def init(cls, datafile):
buffer = Buffer.init(... | lgpl-3.0 |
prutseltje/ansible | test/units/modules/network/nxos/test_nxos_system.py | 57 | 6294 | #
# (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 |
AlphaStaxLLC/docker-compose-ui | main.py | 3 | 6463 | """
Docker Compose UI, flask based application
"""
from flask import Flask, jsonify, request
from scripts.bridge import ps_, get_project, get_container_from_id
from scripts.find_yml import find_yml_files
from scripts.requires_auth import requires_auth, authentication_enabled, \
disable_authentication, set_authentica... | mit |
nmercier/linux-cross-gcc | linux/lib/python2.7/lib2to3/fixes/fix_import.py | 63 | 3260 | """Fixer for import statements.
If spam is being imported from the local directory, this import:
from spam import eggs
Becomes:
from .spam import eggs
And this import:
import spam
Becomes:
from . import spam
"""
# Local imports
from .. import fixer_base
from os.path import dirname, join, exists, sep
f... | bsd-3-clause |
Byron/bdep-pyside | 1.2.2/centos-6.5_x86-64/lib/python2.6/site-packages/pysideuic/Compiler/compiler.py | 8 | 3434 | # This file is part of the PySide project.
#
# Copyright (C) 2009-2011 Nokia Corporation and/or its subsidiary(-ies).
# Copyright (C) 2010 Riverbank Computing Limited.
# Copyright (C) 2009 Torsten Marek
#
# Contact: PySide team <pyside@openbossa.org>
#
# This program is free software; you can redistribute it and/or
# m... | lgpl-3.0 |
fritz-k/django-wiki | wiki/plugins/links/mdx/urlize.py | 16 | 3384 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import unicode_literals
"""
Code modified from:
https://github.com/r0wb0t/markdown-urlize
A more liberal autolinker
Inspired by Django's urlize function.
Positive examples:
>>> import markdown
>>> md = markdown.Markdown(extensions=['urli... | gpl-3.0 |
davisein/jitsudone | django/django/contrib/gis/geos/prototypes/coordseq.py | 624 | 3112 | from ctypes import c_double, c_int, c_uint, POINTER
from django.contrib.gis.geos.libgeos import GEOM_PTR, CS_PTR
from django.contrib.gis.geos.prototypes.errcheck import last_arg_byref, GEOSException
from django.contrib.gis.geos.prototypes.threadsafe import GEOSFunc
## Error-checking routines specific to coordinate seq... | bsd-3-clause |
mrquim/repository.mrquim | repo/script.module.livestreamer/lib/livestreamer/cache.py | 35 | 2396 | import json
import os
import shutil
import tempfile
from time import time
from .compat import is_win32
if is_win32:
xdg_cache = os.environ.get("APPDATA",
os.path.expanduser("~"))
else:
xdg_cache = os.environ.get("XDG_CACHE_HOME",
os.path.expanduser... | gpl-2.0 |
dannyman/ganeti_webmgr | ganeti_webmgr/ganeti_web/migrations/0009_version_0_8.py | 3 | 25365 | # encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Job.processed'
db.add_column('ganeti_web_job', 'processed', self.gf('django.db.models.fields.Boole... | gpl-2.0 |
todaychi/hue | desktop/core/ext-py/Django-1.6.10/django/template/loaders/eggs.py | 111 | 1205 | # Wrapper for loading templates from eggs via pkg_resources.resource_string.
from __future__ import unicode_literals
try:
from pkg_resources import resource_string
except ImportError:
resource_string = None
from django.conf import settings
from django.template.base import TemplateDoesNotExist
from django.temp... | apache-2.0 |
jejimenez/django | tests/queryset_pickle/models.py | 281 | 1904 | import datetime
from django.db import DJANGO_VERSION_PICKLE_KEY, models
from django.utils import six
from django.utils.translation import ugettext_lazy as _
def standalone_number():
return 1
class Numbers(object):
@staticmethod
def get_static_number():
return 2
class PreviousDjangoVersionQuer... | bsd-3-clause |
resmo/ansible | lib/ansible/modules/network/f5/bigip_dns_cache_resolver.py | 38 | 16802 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright: (c) 2018, F5 Networks 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',
... | gpl-3.0 |
jaredly/pyjamas | doc/gendocs.py | 5 | 4157 |
"""
Usage:
epydoc [--html|--pdf] [-o DIR] [--parse-only|--introspect-only] [-v|-q]
[--name NAME] [--url URL] [--docformat NAME] [--graph GRAPHTYPE]
[--inheritance STYLE] [--config FILE] OBJECTS...
OBJECTS...
A list of the Python objects that should be documented. Objects can be specified using d... | apache-2.0 |
KontorConsulting/odoo | addons/hw_escpos/controllers/main.py | 50 | 13334 | # -*- coding: utf-8 -*-
import commands
import logging
import simplejson
import os
import os.path
import io
import base64
import openerp
import time
import random
import math
import md5
import openerp.addons.hw_proxy.controllers.main as hw_proxy
import pickle
import re
import subprocess
import traceback
try:
from... | agpl-3.0 |
Jackysonglanlan/devops | IDEs/sublime/shared-pkgs/Packages/pygments/all/pygments/formatters/bbcode.py | 50 | 3314 | # -*- coding: utf-8 -*-
"""
pygments.formatters.bbcode
~~~~~~~~~~~~~~~~~~~~~~~~~~
BBcode formatter.
:copyright: Copyright 2006-2015 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.formatter import Formatter
from pygments.util import get_bool_opt
__al... | mit |
benfinke/ns_python | build/lib/nssrc/com/citrix/netscaler/nitro/resource/stat/appfw/appfwpolicy_stats.py | 3 | 4339 | #
# Copyright (c) 2008-2015 Citrix Systems, 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 l... | apache-2.0 |
lluxury/P_U_S_A | 14_pragmatic/ftp_mirror.py | 1 | 1786 | #!/usr/bin/env python
import ftplib
import os
class FTPSync(object):
def __init__(self, host, username, password, ftp_base_dir,
local_base_dir, delete=False):
self.host = host
self.username = username
self.password = password
self.ftp_base_dir = ftp_... | mit |
goodwinnk/intellij-community | python/lib/Lib/site-packages/django/utils/simplejson/decoder.py | 409 | 11952 | """Implementation of JSONDecoder
"""
import re
import sys
import struct
from django.utils.simplejson.scanner import make_scanner
c_scanstring = None
__all__ = ['JSONDecoder']
FLAGS = re.VERBOSE | re.MULTILINE | re.DOTALL
def _floatconstants():
_BYTES = '7FF80000000000007FF0000000000000'.decode('hex')
if sys... | apache-2.0 |
monaca/chrome-devtools-app | build/Chrome DevTools/osx/Chrome DevTools.app/Contents/Resources/app.nw/devtools/scripts/generate_protocol_externs.py | 8 | 11129 | #!/usr/bin/env python
# Copyright (c) 2011 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 ... | mit |
bossmido/tag-surfer | autoload/tsurf/finder.py | 1 | 13366 | # -*- coding: utf-8 -*-
"""
tsurf.finder
~~~~~~~~~~~~
This module defines the Finder class. This class is responsible for
generating and searching tags for the current file, open buffers or project.
"""
import os
import vim
import shlex
import tempfile
import subprocess
from itertools import imap
from datetime import... | mit |
kippandrew/tornado | demos/websocket/chatdemo.py | 83 | 3171 | #!/usr/bin/env python
#
# Copyright 2009 Facebook
#
# 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 a... | apache-2.0 |
Anonymouslemming/ansible | lib/ansible/modules/packaging/language/bundler.py | 70 | 7587 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2015, Tim Hoiberg <tim.hoiberg@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 L... | gpl-3.0 |
xin3liang/platform_external_chromium_org_third_party_WebKit | Tools/Scripts/webkitpy/w3c/test_converter_unittest.py | 13 | 14449 | # Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above
# copyright notice, this list of con... | bsd-3-clause |
jcoady9/beets | test/test_the.py | 1 | 2799 | # -*- coding: utf-8 -*-
"""Tests for the 'the' plugin"""
from __future__ import division, absolute_import, print_function
from test._common import unittest
from test import _common
from beets import config
from beetsplug.the import ThePlugin, PATTERN_A, PATTERN_THE, FORMAT
class ThePluginTest(_common.TestCase):
... | mit |
HeraclesHX/scikit-learn | doc/sphinxext/numpy_ext/docscrape.py | 298 | 15441 | """Extract reference documentation from the NumPy source tree.
"""
import inspect
import textwrap
import re
import pydoc
from warnings import warn
# Try Python 2 first, otherwise load from Python 3
try:
from StringIO import StringIO
except:
from io import StringIO
class Reader(object):
"""A line-based s... | bsd-3-clause |
jaysonsantos/servo | tests/wpt/web-platform-tests/tools/html5lib/html5lib/filters/optionaltags.py | 1727 | 10500 | from __future__ import absolute_import, division, unicode_literals
from . import _base
class Filter(_base.Filter):
def slider(self):
previous1 = previous2 = None
for token in self.source:
if previous1 is not None:
yield previous2, previous1, token
previous2... | mpl-2.0 |
tiagocardosos/stoq | stoqlib/gui/test/test_client_slave.py | 2 | 5701 | # -*- coding: utf-8 -*-
# vi:si:et:sw=4:sts=4:ts=4
##
## Copyright (C) 2012 Async Open Source <http://www.async.com.br>
## All rights reserved
##
## 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 Foundati... | gpl-2.0 |
yes7rose/maya_utils | python/maya_utils/api_utils.py | 1 | 2347 | # encoding:utf-8
import logging
import maya.api.OpenMaya as om
# fast convenience tests on API objects
def isValidMObjectHandle(obj):
if isinstance(obj, om.MObjectHandle):
return obj.isValid() and obj.isAlive()
else:
return False
def isValidMObject(obj):
if isinstance(obj, om.MObject):
... | mit |
nikolas/lettuce | tests/integration/lib/Django-1.2.5/tests/regressiontests/introspection/tests.py | 49 | 4743 | from django.conf import settings
from django.db import connection, DEFAULT_DB_ALIAS
from django.test import TestCase
from django.utils import functional
from models import Reporter, Article
#
# The introspection module is optional, so methods tested here might raise
# NotImplementedError. This is perfectly acceptable... | gpl-3.0 |
sileht/deb-openstack-nova | nova/db/sqlalchemy/migrate_repo/versions/025_add_uuid_to_instances.py | 5 | 1414 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 OpenStack LLC.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
... | apache-2.0 |
isnnn/Sick-Beard-TPB | lib/hachoir_parser/program/java.py | 90 | 57999 | """
Compiled Java classes parser.
Author: Thomas de Grenier de Latour (TGL) <degrenier@easyconnect.fr>
Creation: 2006/11/01
Last-update: 2006/11/06
Introduction:
* This parser is for compiled Java classes, aka .class files. What is nice
with this format is that it is well documented in the official Java VM specs... | gpl-3.0 |
endlessm/chromium-browser | tools/linux/PRESUBMIT.py | 72 | 1405 | # Copyright 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.
"""Top-level presubmit script for linux.
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
for more details on the presubmit API b... | bsd-3-clause |
goddino/libjingle | trunk/talk/site_scons/site_tools/talk_linux.py | 22 | 11731 | # Copyright 2010 Google Inc.
# All Rights Reserved.
# Author: tschmelcher@google.com (Tristan Schmelcher)
"""Tool for helpers used in linux building process."""
import os
import SCons.Defaults
import subprocess
def _OutputFromShellCommand(command):
process = subprocess.Popen(command, shell=True, stdout=subprocess... | bsd-3-clause |
robertnishihara/ray | python/ray/dashboard/interface.py | 1 | 4036 | import aiohttp
from abc import ABC, abstractmethod
class BaseDashboardController(ABC):
"""Set of APIs to interact with a Dashboard class and routes.
Make sure you run start_collecting_metrics function before using
get_[stats]_info methods.
"""
@abstractmethod
def get_ray_config(self):
... | apache-2.0 |
Just-D/chromium-1 | tools/telemetry/third_party/gsutilz/third_party/boto/boto/handler.py | 150 | 2382 | # 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 rights to use, copy, modi... | bsd-3-clause |
zouzhberk/ambaridemo | demo-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/status_params.py | 4 | 1533 | #!/usr/bin/env python
"""
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License");... | apache-2.0 |
mancoast/CPythonPyc_test | fail/324_test_wave.py | 64 | 1875 | from test.support import TESTFN, run_unittest
import os
import wave
import struct
import unittest
nchannels = 2
sampwidth = 2
framerate = 8000
nframes = 100
class TestWave(unittest.TestCase):
def setUp(self):
self.f = None
def tearDown(self):
if self.f is not None:
self.f.close()... | gpl-3.0 |
flyfei/python-for-android | python3-alpha/python3-src/Lib/urllib/request.py | 45 | 89577 | """An extensible library for opening URLs using a variety of protocols
The simplest way to use this module is to call the urlopen function,
which accepts a string containing a URL or a Request object (described
below). It opens the URL and returns the results as file-like
object; the returned object has some extra me... | apache-2.0 |
calfonso/ansible | lib/ansible/modules/cloud/docker/docker_container.py | 8 | 79321 | #!/usr/bin/python
#
# Copyright 2016 Red Hat | Ansible
# 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': ['prev... | gpl-3.0 |
nisse3000/pymatgen | pymatgen/io/tests/test_phonopy.py | 7 | 5883 | from __future__ import division, unicode_literals
import os
import unittest
from pymatgen.core.periodic_table import Element
from pymatgen.util.testing import PymatgenTest
from pymatgen.io.phonopy import *
import sys
if sys.version_info >= (3, 0):
try:
from phonopy import Phonopy
from phonopy.stru... | mit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.