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 |
|---|---|---|---|---|---|
FoxerLee/iOS_sitp | Pods/AVOSCloudCrashReporting/Breakpad/src/tools/gyp/test/mac/gyptest-installname.py | 244 | 2512 | #!/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 LD_DYLIB_INSTALL_NAME and DYLIB_INSTALL_NAME_BASE are handled
correctly.
"""
import TestGyp
import re
import subprocess
... | mit |
libvirt/autotest | frontend/migrations/046_merge_databases.py | 1 | 1604 | try:
import autotest.common as common
except ImportError:
import common
from autotest_lib.database import db_utils, migrate
TKO_MIGRATION_NAME = '031_rename_tko_tables'
migrations_module = __import__('autotest_lib.tko.migrations', globals(),
locals(), [TKO_MIGRATION_NAME])
tko_mi... | gpl-2.0 |
tvalacarta/tvalacarta | python/main-classic/lib/youtube_dl/extractor/ro220.py | 64 | 1452 | from __future__ import unicode_literals
from .common import InfoExtractor
from ..compat import compat_urllib_parse_unquote
class Ro220IE(InfoExtractor):
IE_NAME = '220.ro'
_VALID_URL = r'(?x)(?:https?://)?(?:www\.)?220\.ro/(?P<category>[^/]+)/(?P<shorttitle>[^/]+)/(?P<id>[^/]+)'
_TEST = {
'url': ... | gpl-3.0 |
ARL-UTEP-OC/emubox | workshop-creator/python27-64bit-gtk3/Lib/site-packages/setuptools/command/alias.py | 455 | 2426 | from distutils.errors import DistutilsOptionError
from setuptools.extern.six.moves import map
from setuptools.command.setopt import edit_config, option_base, config_file
def shquote(arg):
"""Quote an argument for later parsing by shlex.split()"""
for c in '"', "'", "\\", "#":
if c in arg:
... | gpl-2.0 |
alexteodor/odoo | addons/sale_layout/__openerp__.py | 322 | 1793 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2014-Today OpenERP SA (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms ... | agpl-3.0 |
bud4/samba | selftest/perf_tests.py | 5 | 4081 | #!/usr/bin/python
# This script generates a list of testsuites that should be run to
# test Samba performance.
#
# These tests are not intended to exercise aspect of Samba, but
# perform common simple functions or to ascertain performance.
#
# The syntax for a testsuite is "-- TEST --" on a single line, followed
# by... | gpl-3.0 |
AZtheAsian/zulip | zerver/lib/str_utils.py | 13 | 3652 | """
String Utilities:
This module helps in converting strings from one type to another.
Currently we have strings of 3 semantic types:
1. text strings: These strings are used to represent all textual data,
like people's names, stream names, content of messages, etc.
These strings can contain non-ASCII chara... | apache-2.0 |
mnahm5/django-estore | Lib/site-packages/django/db/backends/mysql/schema.py | 20 | 4566 | from django.db.backends.base.schema import BaseDatabaseSchemaEditor
from django.db.models import NOT_PROVIDED
class DatabaseSchemaEditor(BaseDatabaseSchemaEditor):
sql_rename_table = "RENAME TABLE %(old_table)s TO %(new_table)s"
sql_alter_column_null = "MODIFY %(column)s %(type)s NULL"
sql_alter_column_... | mit |
rsvip/Django | tests/gis_tests/gis_migrations/test_operations.py | 284 | 7957 | from __future__ import unicode_literals
from django.contrib.gis.db.models import fields
from django.core.exceptions import ImproperlyConfigured
from django.db import connection, migrations, models
from django.db.migrations.migration import Migration
from django.db.migrations.state import ProjectState
from django.test ... | bsd-3-clause |
CodigoSur/cyclope | cyclope/apps/dynamicforms/tests.py | 2 | 1484 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2010-2013 Código Sur Sociedad Civil
# All rights reserved.
#
# This file is part of Cyclope.
#
# Cyclope 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-3.0 |
zencodex/csip | CSipSimple/jni/pjsip/sources/tests/pjsua/runall.py | 26 | 6052 | # $Id: runall.py 4183 2012-06-28 09:16:03Z nanang $
import os
import sys
import time
import re
import shutil
PYTHON = os.path.basename(sys.executable)
# Usage:
# runall.py [test-to-resume]
# Initialize test list
tests = []
# Excluded tests (because they fail?)
excluded_tests = [ "svn",
"pyc",
"scripts-c... | gpl-3.0 |
camradal/ansible | lib/ansible/modules/network/junos/junos_package.py | 50 | 5163 | #!/usr/bin/python
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distribut... | gpl-3.0 |
AustP/Gitso | ArgsParser.py | 1 | 6563 | #! /usr/bin/env python
"""
Gisto - Gitso is to support others
Gitso is a utility to facilitate the connection of VNC
@author: Aaron Gerber ('gerberad') <gerberad@gmail.com>
@author: Derek Buranen ('burner') <derek@buranen.info>
@author: AustP
@copyright: 2008 - 2014
Gitso is free software: you can redistribute it a... | gpl-3.0 |
googleapis/python-bigquery | tests/unit/helpers.py | 1 | 2391 | # Copyright 2018 Google 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
#
# Unless required by applicable law or agreed to in writing, s... | apache-2.0 |
0x7678/SJKernel-gn2 | scripts/tracing/draw_functrace.py | 14676 | 3560 | #!/usr/bin/python
"""
Copyright 2008 (c) Frederic Weisbecker <fweisbec@gmail.com>
Licensed under the terms of the GNU GPL License version 2
This script parses a trace provided by the function tracer in
kernel/trace/trace_functions.c
The resulted trace is processed into a tree to produce a more human
view of the call ... | gpl-2.0 |
houshengbo/nova_vmware_compute_driver | nova/scheduler/weights/ram.py | 4 | 1604 | # Copyright (c) 2011 OpenStack, LLC.
# 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 requi... | apache-2.0 |
thanhacun/odoo | addons/l10n_vn/__init__.py | 425 | 1067 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# This module is Copyright (c) 2009-2013 General Solutions (http://gscom.vn) All Rights Reserved.
#
# This program is free software: you can redistribute it and/or... | agpl-3.0 |
nvazquez/Turtlebots | plugins/xevents/Xlib/keysymdef/cyrillic.py | 14 | 2540 | XK_Serbian_dje = 0x6a1
XK_Macedonia_gje = 0x6a2
XK_Cyrillic_io = 0x6a3
XK_Ukrainian_ie = 0x6a4
XK_Ukranian_je = 0x6a4
XK_Macedonia_dse = 0x6a5
XK_Ukrainian_i = 0x6a6
XK_Ukranian_i = 0x6a6
XK_Ukrainian_yi = 0x6a7
XK_Ukranian_yi = 0x6a7
XK_Cyrillic_je = 0x6a8
XK_Serbian_je = 0x6a8
XK_Cyrillic_lje = 0x6a9
XK_Serbian_lje =... | mit |
openthread/openthread | tests/scripts/thread-cert/test_route_table.py | 3 | 2943 | #!/usr/bin/env python3
#
# Copyright (c) 2019, The OpenThread Authors.
# 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
# ... | bsd-3-clause |
marios-zindilis/musicbrainz-django-models | musicbrainz_django_models/models/l_release_group_url.py | 1 | 2149 | """
.. module:: l_release_group_url
The **L Release Group Url** Model.
PostgreSQL Definition
---------------------
The :code:`l_release_group_url` table is defined in the MusicBrainz Server as:
.. code-block:: sql
CREATE TABLE l_release_group_url ( -- replicate
id SERIAL,
link ... | gpl-2.0 |
copasi/COPASI | copasi/bindings/python/examples/add_optitems.py | 2 | 3275 | #!/bin/env python
# This script reads a COPASI file, as well as a tab delimited file, and creates optimization items (that is
# parameters that COPASI might vary during an optimization / parameter estimation task) for the entries contained
# therein. The resulting file will be written into an output file that is provi... | artistic-2.0 |
HarryElSuzio/ShaniXBMCWork | other/jsunpackMM.py | 12 | 5644 | """
urlresolver XBMC Addon
Copyright (C) 2011 t0mm0
Updated by Shani_08 for muchmovies, here they have done the double encrypt.
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 Founda... | gpl-2.0 |
Cynerd/linux-conf-perf | scripts/database.py | 1 | 4605 | import os
import datetime
import postgresql
import collections
import utils
import exceptions
from conf import conf
from conf import sf
def __git_describe__():
return utils.callsubprocess('git_describe',
conf.git_describe_cmd, False, True)[0]
def __git_commit__():
return utils.callsubprocess('git_rev_parse',
... | gpl-2.0 |
AkA84/edx-platform | common/lib/xmodule/xmodule/tests/test_util_duedate.py | 244 | 1645 | """
Tests for extended due date utilities.
"""
import mock
import unittest
from ..util import duedate
class TestGetExtendedDueDate(unittest.TestCase):
"""
Test `get_extended_due_date` function.
"""
def call_fut(self, node):
"""
Call function under test.
"""
fut = dued... | agpl-3.0 |
gregoil/rotest | src/rotest/cli/discover.py | 1 | 2610 | # pylint: disable=protected-access
from __future__ import absolute_import
import os
import unittest
from fnmatch import fnmatch
from collections import OrderedDict
import py
from rotest.common import core_log
from rotest.core.case import TestCase
from rotest.core.flow import TestFlow
from rotest.common.config import ... | mit |
testmana2/profitpy | profit/lib/breadfan.py | 18 | 8109 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2007 Troy Melhase
# Distributed under the terms of the GNU General Public License v2
# Author: Troy Melhase <troy@gci.net>
ffnet = NN = inf = None
try:
from ffnet import ffnet, mlgraph, loadnet, savenet, savenet, loadnet
from scipy import inf
except (... | gpl-2.0 |
mydongistiny/external_chromium_org | tools/valgrind/memcheck/PRESUBMIT.py | 33 | 3382 | # Copyright (c) 2011 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.
"""
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
for more details on the presubmit API built into gcl.
"""
import re
def... | bsd-3-clause |
rickhurst/Django-non-rel-blog | django/contrib/gis/db/backends/util.py | 377 | 1749 | """
A collection of utility routines and classes used by the spatial
backends.
"""
def gqn(val):
"""
The geographic quote name function; used for quoting tables and
geometries (they use single rather than the double quotes of the
backend quotename function).
"""
if isinstance(val, basestring):
... | bsd-3-clause |
SerpentCS/odoo | addons/lunch/wizard/lunch_validation.py | 440 | 1296 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2012 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the G... | agpl-3.0 |
7kbird/chrome | build/android/pylib/symbols/elf_symbolizer_unittest.py | 108 | 5692 | #!/usr/bin/env python
# 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.
import functools
import logging
import os
import sys
import unittest
sys.path.insert(0, os.path.dirname(__file__))
import elf_symboliz... | bsd-3-clause |
ismir/conference-archive | tests/test_zen_api.py | 1 | 1981 | import pytest
import os
import zen.api
OFFLINE = not zen.api._is_online()
OFFLINE_REASON = 'Not online, skipping integration tests'
@pytest.mark.skipif(OFFLINE, reason=OFFLINE_REASON)
def test_zen_api_create_id():
assert zen.api.create_id(stage=zen.api.DEV) is not None
@pytest.fixture()
def pdf_file(resource... | mit |
aifeiasdf/Template-tookit | template/constants.py | 3 | 1976 | #
# The Template-Python distribution is Copyright (C) Sean McAfee 2007-2008,
# derived from the Perl Template Toolkit Copyright (C) 1996-2007 Andy
# Wardley. All Rights Reserved.
#
# The file "LICENSE" at the top level of this source distribution describes
# the terms under which this file may be distributed.
#
... | artistic-2.0 |
sankha93/servo | tests/wpt/css-tests/tools/pywebsocket/src/test/testdata/handlers/blank_wsh.py | 499 | 1557 | # Copyright 2009, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... | mpl-2.0 |
hynnet/hiwifi-openwrt-HC5661-HC5761 | staging_dir/host/lib/python2.7/lib2to3/fixes/fix_idioms.py | 327 | 4889 | """Adjust some old Python 2 idioms to their modern counterparts.
* Change some type comparisons to isinstance() calls:
type(x) == T -> isinstance(x, T)
type(x) is T -> isinstance(x, T)
type(x) != T -> not isinstance(x, T)
type(x) is not T -> not isinstance(x, T)
* Change "while 1:" into "while True:".... | gpl-2.0 |
VerstandInvictus/PatternsEmerge | backend/mdcore.py | 1 | 2290 | import codecs
import config
import unidecode
from pyvirtualdisplay import Display
from time import sleep
from selenium import webdriver, common
user_agent = 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36' \
' (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36'
class mdLogger:
def __init... | mit |
tonyli71/tempest | tempest/api_schema/response/compute/v2_1/keypairs.py | 38 | 3928 | # Copyright 2014 NEC 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 required ... | apache-2.0 |
xmyth/rt-thread | bsp/efm32/rtconfig.py | 35 | 2289 | import os
# toolchains options
ARCH = 'arm'
CPU = 'cortex-m3'
CROSS_TOOL = 'gcc'
if os.getenv('RTT_CC'):
CROSS_TOOL = os.getenv('RTT_CC')
if CROSS_TOOL == 'gcc':
PLATFORM = 'gcc'
EXEC_PATH = 'C:\Program Files (x86)\CodeSourcery\Sourcery G++ Lite\bin'
#EXEC_PATH = 'C:\Program Files ... | gpl-2.0 |
lanyuwen/openthread | tests/scripts/thread-cert/Cert_7_1_02_BorderRouterAsRouter.py | 2 | 4084 | #!/usr/bin/env python3
#
# Copyright (c) 2016, The OpenThread Authors.
# 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
# ... | bsd-3-clause |
clumsy/intellij-community | python/helpers/pydev/third_party/pep8/lib2to3/lib2to3/pgen2/tokenize.py | 115 | 19125 | # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006 Python Software Foundation.
# All rights reserved.
"""Tokenization help for Python programs.
generate_tokens(readline) is a generator that breaks a stream of
text into Python tokens. It accepts a readline-like method which is called
repeatedly to get the next line o... | apache-2.0 |
alrifqi/django | django/utils/jslex.py | 251 | 7779 | """JsLex: a lexer for Javascript"""
# Originally from https://bitbucket.org/ned/jslex
from __future__ import unicode_literals
import re
class Tok(object):
"""
A specification for a token class.
"""
num = 0
def __init__(self, name, regex, next=None):
self.id = Tok.num
Tok.num += 1... | bsd-3-clause |
reviewboard/rbtools | rbtools/utils/console.py | 1 | 5835 | from __future__ import print_function, unicode_literals
import getpass
import logging
import os
import subprocess
import sys
from distutils.util import strtobool
from six.moves import input
from rbtools.utils.encoding import force_unicode
from rbtools.utils.errors import EditorError
from rbtools.utils.filesystem imp... | mit |
tejasnikumbh/ThesisCode | lib/python2.7/site-packages/numpy/distutils/fcompiler/absoft.py | 229 | 5612 |
# http://www.absoft.com/literature/osxuserguide.pdf
# http://www.absoft.com/documentation.html
# Notes:
# - when using -g77 then use -DUNDERSCORE_G77 to compile f2py
# generated extension modules (works for f2py v2.45.241_1936 and up)
from __future__ import division, absolute_import, print_function
import os
from... | mit |
tracierenea/gnuradio | gr-channels/python/channels/qa_fading_model.py | 47 | 1949 | #!/usr/bin/env python
#
# Copyright 2012,2013 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio 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, or (at your optio... | gpl-3.0 |
dpapathanasiou/cmdline-news | cmdlinenews.py | 1 | 10334 | #!/usr/bin/env python
"""
This module uses feedparser to get item titles and links from any rss
feed, and presents the results as simple command-line output.
It's great for browsing your favorite sites unobtrusively, without having
to open a browser window.
Feeds are memoized for feed_memoize_interval seconds after ... | mit |
mwalter416/mse | mse.py | 1 | 3866 | import json
import urllib2
mseServers=[
'1.2.3.4',
'5.6.7.8',
'9.10.11.12'
]
def getClients(server, user, password):
passwordManager = urllib2.HTTPPasswordMgrWithDefaultRealm()
passwordManager.add_password(None,"https://"+server+"/",user,password)
authHandler = urlli... | gpl-3.0 |
vectorijk/servo | tests/wpt/web-platform-tests/tools/pywebsocket/src/mod_pywebsocket/extensions.py | 489 | 31780 | # Copyright 2012, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... | mpl-2.0 |
asm666/sympy | examples/advanced/pyglet_plotting.py | 92 | 7199 | #!/usr/bin/env python
"""
Plotting Examples
Suggested Usage: python -i plotting.py
"""
from sympy import symbols
from sympy.plotting.pygletplot import PygletPlot
from sympy import sin, cos, pi, sqrt, exp
from sympy.core.compatibility import range
from time import sleep, clock
def main():
x, y, z = symbols... | bsd-3-clause |
117111302/PyGithub | github/tests/Framework.py | 25 | 11595 | # -*- coding: utf-8 -*-
# ########################## Copyrights and license ############################
# #
# Copyright 2012 Vincent Jacques <vincent@vincent-jacques.net> #
# Copyright 2012 Zearin <zearin@gonk.net> ... | gpl-3.0 |
pawelmhm/AutobahnPython | autobahn/autobahn/websocket/compress_snappy.py | 18 | 15573 | ###############################################################################
##
## Copyright 2013 Tavendo GmbH
##
## Licensed under the Apache License, Version 2.0 (the "License");
## you may not use this file except in compliance with the License.
## You may obtain a copy of the License at
##
## http://www... | apache-2.0 |
chromium/chromium | mojo/public/tools/bindings/concatenate-files.py | 12 | 1556 | #!/usr/bin/env python
# Copyright 2019 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.
#
# This utility concatenates several files into one. On Unix-like systems
# it is equivalent to:
# cat file1 file2 file3 ...files... ... | bsd-3-clause |
hosseinmh/Django_learning | djmod/.venv/lib/python3.5/site-packages/pip/_vendor/requests/packages/urllib3/poolmanager.py | 359 | 13092 | from __future__ import absolute_import
import collections
import functools
import logging
try: # Python 3
from urllib.parse import urljoin
except ImportError:
from urlparse import urljoin
from ._collections import RecentlyUsedContainer
from .connectionpool import HTTPConnectionPool, HTTPSConnectionPool
from ... | mit |
kirca/odoo | openerp/report/pyPdf/filters.py | 123 | 9847 | # vim: sw=4:expandtab:foldmethod=marker
#
# Copyright (c) 2006, Mathieu Fenniak
# 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 abov... | agpl-3.0 |
jango2015/three.js | utils/converters/msgpack/msgpack/__init__.py | 659 | 1385 | # coding: utf-8
from msgpack._version import version
from msgpack.exceptions import *
from collections import namedtuple
class ExtType(namedtuple('ExtType', 'code data')):
"""ExtType represents ext type in msgpack."""
def __new__(cls, code, data):
if not isinstance(code, int):
raise TypeE... | mit |
popazerty/zde-e2 | lib/python/Components/ActionMap.py | 45 | 2560 | from enigma import eActionMap
class ActionMap:
def __init__(self, contexts = [ ], actions = { }, prio=0):
self.actions = actions
self.contexts = contexts
self.prio = prio
self.p = eActionMap.getInstance()
self.bound = False
self.exec_active = False
self.enabled = True
def setEnabled(self, enabled):
... | gpl-2.0 |
alivecor/tensorflow | tensorflow/contrib/data/python/framework/function.py | 10 | 10870 | # 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 |
sanandrea/ofnic_R3.3 | src/nox/coreapps/coretests/test_packet.py | 10 | 2714 |
from nox.lib.core import *
from nox.coreapps.testharness.testdefs import *
from nox.lib.packet.t.dhcp_parse_test import test_fullDHCPPacket
from nox.lib.packet.t.dns_parse_test import test_dns_1
from nox.lib.packet.t.dns_parse_test import test_dns_2
from nox.lib.packet.t.eap_parse_test import testEAPOL
from no... | gpl-3.0 |
gtara/or-tools | examples/python/magic_square_and_cards.py | 32 | 2950 | # Copyright 2010 Hakan Kjellerstrand hakank@bonetmail.com
#
# 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 ... | apache-2.0 |
undoware/neutron-drive | google_appengine/google/appengine/ext/ndb/prospective_search.py | 20 | 6294 | """Prospective Search for NDB.
This reimplements all of the standard APIs with the following changes:
- A document_class argument must be an NDB Model class.
- A document must be an NDB Model instance.
- get_document() always returns an NDB Model instance.
The exceptions and public constants exported by the standard... | bsd-3-clause |
rmboggs/django | django/utils/tree.py | 372 | 4883 | """
A class for storing a tree graph. Primarily used for filter constructs in the
ORM.
"""
import copy
class Node(object):
"""
A single internal node in the tree graph. A Node should be viewed as a
connection (the root) with the children being either leaf nodes or other
Node instances.
"""
# ... | bsd-3-clause |
jaraco/aspen | aspen/http/__init__.py | 1 | 1364 | """
aspen.http
++++++++++
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
status_strings = {
100 : "Continue",
101 : "Switching Protocols",
200 : "OK",
201 : "Created",
202 : "Accepted",
2... | mit |
doot/CouchPotatoServer | couchpotato/core/media/__init__.py | 11 | 3572 | import os
import traceback
from couchpotato import CPLog, md5
from couchpotato.core.event import addEvent, fireEvent, fireEventAsync
from couchpotato.core.helpers.encoding import toUnicode
from couchpotato.core.helpers.variable import getExt
from couchpotato.core.plugins.base import Plugin
import six
log = CPLog(__n... | gpl-3.0 |
tjcsl/ion | intranet/apps/groups/views.py | 1 | 1335 | import logging
from django.contrib.auth import get_user_model
from django.contrib.auth.decorators import login_required
from django.shortcuts import render
from ..auth.decorators import admin_required, deny_restricted
from .forms import GroupForm
from .models import Group
logger = logging.getLogger(__name__)
# thi... | gpl-2.0 |
Lab603/PicEncyclopedias | jni-build/jni/include/tensorflow/python/kernel_tests/sparse_reorder_op_test.py | 8 | 3294 | # 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... | mit |
cntnboys/410Lab6 | v1/lib/python2.7/site-packages/django/contrib/admin/__init__.py | 72 | 1175 | # ACTION_CHECKBOX_NAME is unused, but should stay since its import from here
# has been referenced in documentation.
from django.contrib.admin.decorators import register
from django.contrib.admin.helpers import ACTION_CHECKBOX_NAME
from django.contrib.admin.options import (HORIZONTAL, VERTICAL,
ModelAdmin, StackedI... | apache-2.0 |
lixt/lily2-gem5 | configs/common/Simulation.py | 2 | 19873 | # Copyright (c) 2012-2013 ARM Limited
# All rights reserved
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implementation of the functiona... | bsd-3-clause |
dchilds7/Deysha-Star-Formation | vispy/scene/widgets/colorbar.py | 10 | 5184 | # -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Copyright (c) 2015, Vispy Development Team. All Rights Reserved.
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
# -------------------------------------------------------------------------... | bsd-3-clause |
alexm92/sentry | src/sentry/south_migrations/0057_auto__add_field_group_active_at.py | 36 | 18071 | # 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 'Group.active_at'
db.add_column('sentry_groupedmessage', 'active_at', self.gf('django.db.models.fie... | bsd-3-clause |
kreatorkodi/repository.torrentbr | plugin.video.elementum/resources/site-packages/bjsonrpc/jsonlib.py | 11 | 2695 | """
bjson/jsonlib.py
Asynchronous Bidirectional JSON-RPC protocol implementation over TCP/IP
Copyright (c) 2010 David Martinez Marti
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
a... | gpl-2.0 |
atupal/ffbird | werkzeug/useragents.py | 317 | 5300 | # -*- coding: utf-8 -*-
"""
werkzeug.useragents
~~~~~~~~~~~~~~~~~~~
This module provides a helper to inspect user agent strings. This module
is far from complete but should work for most of the currently available
browsers.
:copyright: (c) 2013 by the Werkzeug Team, see AUTHORS for more deta... | apache-2.0 |
gskachkov/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/common/net/resultsjsonparser.py | 123 | 7067 | # Copyright (c) 2010, Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the... | bsd-3-clause |
benfinkelcbt/CPD200 | CPD200-Lab12-Python/googleapiclient/discovery_cache/appengine_memcache.py | 50 | 1562 | # Copyright 2014 Google 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 or ... | gpl-3.0 |
305120262/ArcGISServerManageTools | GetServerLog.py | 1 | 3475 | #coding=utf-8
"""
-------------------------------------------------------------------------------
Name: getsvrlog.py
Purpose: Collect ArcGIS Server Site Logs
Author: Sean.L (luwl@esrichina.com.cn)
Created: 8/25/16
Copyright: (c) Sean.L 2016
---------------------------------------------------------... | apache-2.0 |
apporc/neutron | neutron/db/address_scope_db.py | 1 | 5406 | # Copyright (c) 2015 Huawei Technologies Co.,LTD.
#
# 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 |
anythingrandom/eclcli | eclcli/interconnectivity/interconnectivityclient/common/command.py | 16 | 1059 | # Copyright 2012 OpenStack Foundation.
# All Rights Reserved
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | apache-2.0 |
allevato/swift | utils/update_checkout/tests/scheme_mock.py | 12 | 5419 | # ===--- SchemeMock.py ----------------------------------------------------===#
#
# This source file is part of the Swift.org open source project
#
# Copyright (c) 2014 - 2018 Apple Inc. and the Swift project authors
# Licensed under Apache License v2.0 with Runtime Library Exception
#
# See https:#swift.org/LICENS... | apache-2.0 |
filipenf/ansible | test/units/playbook/test_attribute.py | 219 | 1824 | # (c) 2015, Marius Gedminas <marius@gedmin.as>
#
# 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 vers... | gpl-3.0 |
swastikit/swastikcoin | contrib/testgen/gen_base58_test_vectors.py | 1064 | 4344 | #!/usr/bin/env python
'''
Generate valid and invalid base58 address and private key test vectors.
Usage:
gen_base58_test_vectors.py valid 50 > ../../src/test/data/base58_keys_valid.json
gen_base58_test_vectors.py invalid 50 > ../../src/test/data/base58_keys_invalid.json
'''
# 2012 Wladimir J. van der Laan
# R... | mit |
gustawho/faba-colors | render-verd.py | 2 | 6308 | #!/usr/bin/python3
#
import os
import sys
import xml.sax
import subprocess
INKSCAPE = '/usr/bin/inkscape'
OPTIPNG = '/usr/bin/optipng'
MAINDIR = 'Faba-Verd'
SRC = os.path.join('.', 'src/Verd')
inkscape_process = None
def main(SRC):
def optimize_png(png_file):
if os.path.exists(OPTIPNG):
p... | gpl-3.0 |
rahul-c1/scikit-learn | benchmarks/bench_lasso.py | 297 | 3305 | """
Benchmarks of Lasso vs LassoLars
First, we fix a training set and increase the number of
samples. Then we plot the computation time as function of
the number of samples.
In the second benchmark, we increase the number of dimensions of the
training set. Then we plot the computation time as function of
the number o... | bsd-3-clause |
heeraj123/oh-mainline | vendor/packages/twisted/twisted/web/http.py | 18 | 59989 | # -*- test-case-name: twisted.web.test.test_http -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
HyperText Transfer Protocol implementation.
This is the basic server-side protocol implementation used by the Twisted
Web server. It can parse HTTP 1.0 requests and supports many HTTP 1.1
... | agpl-3.0 |
r4vi/open-ihm | src/openihm/gui/interface/frmhousehold_addincome_employment.py | 3 | 4830 | #!/usr/bin/env python
"""
This file is part of open-ihm.
open-ihm 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.
open-ihm is di... | lgpl-3.0 |
matrix65536/kosmosfs | scripts.solaris/kfssetup.py | 15 | 16413 | #!/usr/bin/env python
#
# $Id: kfssetup.py 36 2007-11-12 02:43:36Z sriramsrao $
#
# Copyright 2007 Kosmix Corp.
#
# This file is part of Kosmos File System (KFS).
#
# 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 cop... | apache-2.0 |
mhugo/QGIS | python/plugins/processing/algs/qgis/ExtentFromLayer.py | 7 | 5806 | # -*- coding: utf-8 -*-
"""
***************************************************************************
ExtentFromLayer.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
***********************... | gpl-2.0 |
michaldaniel/Ebook-Viewer | src/main.py | 1 | 3097 | #!/usr/bin/env python3
# Easy eBook Viewer by Michal Daniel
# Easy eBook Viewer is free software; you can redistribute it and/or modify it under the terms
# of the GNU General Public Licence as published by the Free Software Foundation.
# Easy eBook Viewer is distributed in the hope that it will be useful, but WITHO... | gpl-3.0 |
empireryan/director | src/python/ddapp/tasks/descriptions/drillTask.py | 6 | 5717 | from ddapp.tasks import robottasks as rt
side = 'Left'
mirror = 1 if side == 'Right' else -1
drillTaskRight = [
['drill wall', [
['fit wall targets', [
[rt.SnapshotMultisensePointcloud, {}],
[rt.UserAnnotatePointCloud, {'Annotation name':'wall annotation', 'Number of points':3}],
... | bsd-3-clause |
jarshwah/django | tests/template_tests/syntax_tests/test_comment.py | 521 | 3667 | from django.test import SimpleTestCase
from ..utils import setup
class CommentSyntaxTests(SimpleTestCase):
@setup({'comment-syntax01': '{# this is hidden #}hello'})
def test_comment_syntax01(self):
output = self.engine.render_to_string('comment-syntax01')
self.assertEqual(output, 'hello')
... | bsd-3-clause |
supermanheng21/twilio-python | twilio/rest/resources/task_router/workspaces.py | 38 | 3347 | from .. import NextGenInstanceResource, NextGenListResource
from .statistics import Statistics
class Workspace(NextGenInstanceResource):
"""
A Workspace resource.
See the `TaskRouter API reference
<https://www.twilio.com/docs/taskrouter/workspaces>_`
for more information.
.. attribute:: sid
... | mit |
Arvedui/i3pystatus | i3pystatus/gpu_temp.py | 10 | 1150 | from i3pystatus import IntervalModule
from .utils import gpu
class GPUTemperature(IntervalModule):
"""
Shows GPU temperature
Currently Nvidia only and nvidia-smi required
.. rubric:: Available formatters
* `{temp}` — the temperature in integer degrees celsius
"""
settings = (
... | mit |
gersteinlab/AlleleDB | alleledb_pipeline/fasta.py | 1 | 1219 |
import sys
class fastaReader:
def __init__(self, fn):
self.done=False
self.ifile=open(fn)
self.hdr=self.ifile.readline().rstrip()
def __iter__(self):
return self
def next(self):
if self.done:
raise StopIteration
body=''
while True:
... | cc0-1.0 |
k3nnyfr/s2a_fr-nsis | s2a/Python/Lib/modulefinder.py | 31 | 24283 | """Find modules used by a script, using introspection."""
# This module should be kept compatible with Python 2.2, see PEP 291.
from __future__ import generators
import dis
import imp
import marshal
import os
import sys
import types
import struct
if hasattr(sys.__stdout__, "newlines"):
READ_MODE = "U" # universa... | gpl-3.0 |
atomic83/youtube-dl | youtube_dl/extractor/cbs.py | 19 | 2818 | from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
sanitized_Request,
smuggle_url,
)
class CBSIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?(?:cbs\.com/shows/[^/]+/(?:video|artist)|colbertlateshow\.com/(?:video|podcasts))/[^/]+/(?P<id>[^/]+)'
_TEST... | unlicense |
mishravikas/geonode-cas | geonode/api/api.py | 1 | 6609 | from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from django.contrib.contenttypes.models import ContentType
from geonode.base.models import TopicCategory
from geonode.layers.models import Layer
from geonode.maps.models import Map
from geonode.documents.models import Document
fro... | gpl-3.0 |
bikong2/django | tests/middleware_exceptions/tests.py | 119 | 44368 | import sys
from django.conf import settings
from django.core.exceptions import MiddlewareNotUsed
from django.core.signals import got_request_exception
from django.http import HttpResponse
from django.template import engines
from django.template.response import TemplateResponse
from django.test import RequestFactory, S... | bsd-3-clause |
sudheesh001/oh-mainline | vendor/packages/twisted/twisted/web/test/test_resource.py | 20 | 4660 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted.web.resource}.
"""
from twisted.trial.unittest import TestCase
from twisted.web import error
from twisted.web.http import NOT_FOUND, FORBIDDEN
from twisted.web.resource import ErrorPage, NoResource, ForbiddenResource
from ... | agpl-3.0 |
thezbyg/gpick | tools/gpick.py | 1 | 5990 | import os, time, re, string, glob, subprocess
from .gettext import *
from .resource_template import *
from .ragel import *
from .template import *
from SCons.Script import Chmod, Flatten
from SCons.Util import NodeList
from SCons.Script.SConscript import SConsEnvironment
def MatchFiles (files, path, repath, dir_exclud... | bsd-3-clause |
halfcrazy/sqlalchemy | test/orm/test_bind.py | 25 | 14697 | from sqlalchemy.testing import assert_raises_message
from sqlalchemy import MetaData, Integer, ForeignKey
from sqlalchemy.testing.schema import Table
from sqlalchemy.testing.schema import Column
from sqlalchemy.orm import mapper, create_session
import sqlalchemy as sa
from sqlalchemy import testing
from sqlalchemy.test... | mit |
mindbender-studio/core | avalon/vendor/jsonschema/tests/test_jsonschema_test_suite.py | 62 | 9644 | """
Test runner for the JSON Schema official test suite
Tests comprehensive correctness of each draft's validator.
See https://github.com/json-schema/JSON-Schema-Test-Suite for details.
"""
from contextlib import closing
from decimal import Decimal
import glob
import json
import io
import itertools
import os
import... | mit |
illicitonion/givabit | lib/sdks/google_appengine_1.7.1/google_appengine/lib/django_1_2/django/contrib/localflavor/pl/pl_administrativeunits.py | 433 | 13194 | # -*- coding: utf-8 -*-
"""
Polish administrative units as in http://pl.wikipedia.org/wiki/Podzia%C5%82_administracyjny_Polski
"""
ADMINISTRATIVE_UNIT_CHOICES = (
('wroclaw', u'Wrocław'),
('jeleniagora', u'Jelenia Góra'),
('legnica', u'Legnica'),
('boleslawiecki', u'bolesławiecki'),
('dzierzoniows... | apache-2.0 |
mikewiebe-ansible/ansible | test/lib/ansible_test/_internal/cloud/nios.py | 17 | 5475 | """NIOS plugin for integration tests."""
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
from . import (
CloudProvider,
CloudEnvironment,
CloudEnvironmentConfig,
)
from ..util import (
find_executable,
display,
)
from ..docker_util import (
d... | gpl-3.0 |
browseinfo/odoo_saas3_nicolas | addons/gamification_sale_crm/__openerp__.py | 67 | 1369 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013 OpenERP SA (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | agpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.