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
chekunkov/scrapy
tests/test_proxy_connect.py
15
3897
import json import os import time from threading import Thread from libmproxy import controller, proxy from netlib import http_auth from twisted.internet import defer from twisted.trial.unittest import TestCase from scrapy.utils.test import get_testlog, get_crawler from scrapy.http import Request from tests.spiders i...
bsd-3-clause
jlegendary/orange
Orange/orng/orngDimRed.py
6
4948
# # Module Orange Dimension Reduction # --------------------------------- # # CVS Status: $Id$ # # Author: Aleks Jakulin (jakulin@acm.org) # (Copyright (C)2004 Aleks Jakulin) # # Purpose: Dimension reduction # # Bibliography: Tom Minka, "36-350: Data Mining, Fall 2003", Lecture Notes, Carnegie Mellon University. # # Ch...
gpl-3.0
SatoshiNXSimudrone/sl4a-damon-clone
python-build/python-libs/gdata/tests/run_data_tests.py
87
1858
#!/usr/bin/python import sys import unittest import module_test_runner import getopt import getpass # Modules whose tests we will run. import gdata_test import atom_test import atom_tests.http_interface_test import atom_tests.mock_http_test import atom_tests.token_store_test import atom_tests.url_test import atom_test...
apache-2.0
JioEducation/edx-platform
lms/djangoapps/lti_provider/tests/test_views.py
9
7546
""" Tests for the LTI provider views """ from django.core.urlresolvers import reverse from django.test import TestCase from django.test.client import RequestFactory from mock import patch, MagicMock from nose.plugins.attrib import attr from courseware.testutils import RenderXBlockTestMixin from lti_provider import vi...
agpl-3.0
foospidy/DbDat
plugins/mysql/check_privilege_super.py
1
1062
class check_privilege_super(): """ check_privilege_super: The following accounts have the SUPER privilege. Do not grant to non Admin users. """ # References: # https://benchmarks.cisecurity.org/downloads/show-single/index.cfm?file=mysql.102 TITLE = 'SUPER Privilege' CATEGORY = 'Privi...
gpl-2.0
spudmind/parlparse
members/wikipedia-commons.py
1
2989
#!/usr/bin/env python # -*- coding: latin-1 -*- # $Id: bbcconv.py,v 1.4 2005/03/25 23:33:35 theyworkforyou Exp $ # Screen scrape list of links to Lords on Wikipedia, so we can link to the articles. # The Public Whip, Copyright (C) 2003 Francis Irving and Julian Todd # This is free software, and you are welcome to red...
agpl-3.0
zeaphoo/cocopot
tests/test_response.py
2
6988
import pytest from cocopot.response import Response, make_response, redirect, jsonify from cocopot.datastructures import MultiDict from cocopot.http import parse_date from cocopot.exceptions import BadRequest from cocopot.utils import json import copy import datetime def test_basic_response(): r = make_response(...
mit
vmthunder/nova
nova/virt/libvirt/dmcrypt.py
55
2226
# Copyright (c) 2014 The Johns Hopkins University/Applied Physics Laboratory # 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/l...
apache-2.0
ysekky/GPy
GPy/testing/kernel_tests.py
3
33410
# Copyright (c) 2012, 2013 GPy authors (see AUTHORS.txt). # Licensed under the BSD 3-clause license (see LICENSE.txt) import unittest from unittest.case import skip import GPy from GPy.core.parameterization.param import Param import numpy as np from ..util.config import config verbose = 0 try: from ..util imp...
bsd-3-clause
iw3hxn/server
openerp/report/render/rml2txt/rml2txt.py
14
17786
#!/usr/bin/env python # -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009, P. Christeas, Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or ...
agpl-3.0
silkyar/570_Big_Little
src/arch/x86/isa/insts/x87/control/clear_exceptions.py
91
2159
# Copyright (c) 2007 The Hewlett-Packard Development Company # 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 implemen...
bsd-3-clause
Ballz0fSteel/Umeko
lib/youtube_dl/extractor/worldstarhiphop.py
57
1344
from __future__ import unicode_literals from .common import InfoExtractor class WorldStarHipHopIE(InfoExtractor): _VALID_URL = r'https?://(?:www|m)\.worldstar(?:candy|hiphop)\.com/(?:videos|android)/video\.php\?.*?\bv=(?P<id>[^&]+)' _TESTS = [{ 'url': 'http://www.worldstarhiphop.com/videos/video.php?...
gpl-3.0
uni-peter-zheng/tp-libvirt
libvirt/tests/src/numa/numa_capabilities.py
4
1976
import logging from virttest import libvirt_xml from virttest import utils_libvirtd from virttest import utils_misc from autotest.client.shared import error def run(test, params, env): """ Test capabilities with host numa node topology """ libvirtd = utils_libvirtd.Libvirtd() libvirtd.start() ...
gpl-2.0
frankenjoe/pyabp
python/gui_init.py
1
4202
import sys import os import warnings import shutil import glob import logging from PyQt5.QtGui import (QIcon, QFont, QStandardItemModel, QPixmap) from PyQt5.QtCore import (QDate, QDateTime, QRegExp, QSortFilterProxyModel, Qt, QTime, QEvent, QSize) from PyQt5.QtWidgets import (qApp, QApplication, QCheckBox, Q...
gpl-3.0
cackharot/fbeazt
src/test/test_order.py
1
3860
import os import unittest from random import randint from bson import json_util from bson.objectid import ObjectId from foodbeazt import fapp from foodbeazt import initdb as fdb from foodbeazt.service.ProductService import ProductService from foodbeazt.service.StoreService import StoreService class CreateOrderTestCa...
apache-2.0
django-nonrel/django-nonrel
django/core/management/commands/loaddata.py
250
11042
import sys import os import gzip import zipfile from optparse import make_option from django.conf import settings from django.core import serializers from django.core.management.base import BaseCommand from django.core.management.color import no_style from django.db import connections, router, transaction, DEFAULT_DB_...
bsd-3-clause
OndinaHQ/Tracker
markdown/extensions/extra.py
130
1761
#!/usr/bin/env python """ Python-Markdown Extra Extension =============================== A compilation of various Python-Markdown extensions that imitates [PHP Markdown Extra](http://michelf.com/projects/php-markdown/extra/). Note that each of the individual extensions still need to be available on your PYTHONPATH. ...
gpl-3.0
drawquest/drawquest-web
website/canvas/migrations/0101_auto__chg_field_usermoderationlog_moderator__chg_field_commentmoderati.py
2
16002
# 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): # Changing field 'UserModerationLog.moderator' db.alter_column('canvas_usermoderationlog', 'moderator_id',...
bsd-3-clause
tareqalayan/ansible
test/integration/targets/connection/plugin/dummy.py
56
1089
from __future__ import (absolute_import, division, print_function) __metaclass__ = type DOCUMENTATION = """ author: - John Doe connection: dummy short_description: defective connection plugin description: - defective connection plugin version_added: "2.0" options: {} """ import ...
gpl-3.0
gunesacar/tor-browser-bundle-testsuite
selenium-tests/test_fp_screen_coords.py
2
1032
#!/usr/bin/python import tbbtest class Test(tbbtest.TBBTest): def test_screen_coords(self): # https://gitweb.torproject.org/torbrowser.git/blob/HEAD:/src/current-patches/firefox/0021-Do-not-expose-physical-screen-info.-via-window-and-w.patch driver = self.driver js = driver.execute_script ...
cc0-1.0
zestrada/nova-cs498cc
nova/tests/api/openstack/compute/contrib/test_used_limits.py
9
4910
# vim: tabstop=5 shiftwidth=4 softtabstop=4 # 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.apach...
apache-2.0
Endika/odoo-grupoesoc-addons
important_fields_lead/__openerp__.py
2
1168
# -*- encoding: utf-8 -*- # Odoo, Open Source Management Solution # Copyright (C) 2014-2015 Grupo ESOC <www.grupoesoc.es> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either versio...
agpl-3.0
vritant/subscription-manager
src/subscription_manager/i18n.py
3
1255
# Copyright (c) 2011 Red Hat, Inc. # # This software is licensed to you under the GNU General Public License, # version 2 (GPLv2). There is NO WARRANTY for this software, express or # implied, including the implied warranties of MERCHANTABILITY or FITNESS # FOR A PARTICULAR PURPOSE. You should have received a copy of G...
gpl-2.0
antontsv/r2d2
sound_manager.py
1
2110
#!/usr/bin/env python import sys import os import time import random import alsaaudio import pyttsx from subprocess import call # # Our sound coordinator # class SoundManager (): SOUND_PLAYER = 'mpg123' SOUNDS_DIR = os.path.dirname(__file__) + '/sounds' SOUND_FILE_EXT = 'mp3' sound_list = [] ...
mit
msmbuilder/msmbuilder
msmbuilder/decomposition/kernel_approximation.py
9
4210
# Author: Carlos Xavier Hernandez <cxh@stanford.edu> # Contributors: Muneeb Sultan <msultan@stanford.edu>, Evan Feinberg <enf@stanford.edu> # Copyright (c) 2015, Stanford University and the Authors # All rights reserved. from __future__ import absolute_import import numpy as np from scipy.linalg import svd from skle...
lgpl-2.1
manahl/PythonTrainingExercises
Beginners/strings/solution/strings.py
1
2019
"""With this string: 'monty pythons flying circus' Create a function that returns a sorted string with no duplicate characters (keep any whitespace): Example: ' cfghilmnoprstuy' Create a function that returns the words in reverse order: Example: ['circus', 'flying', 'pythons', 'monty'] Create a function that returns...
bsd-3-clause
JianyuWang/nova
nova/virt/diagnostics.py
103
7609
# Copyright (c) 2014 VMware, 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...
apache-2.0
M4sse/chromium.src
tools/chrome_proxy/integration_tests/chrome_proxy_pagesets/smoke.py
9
2496
# 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.page import page as page_module from telemetry.page import page_set as page_set_module class SmokePage(page_module.Page): def __init__(se...
bsd-3-clause
cogeorg/black_rhino
examples/firesales_simple/networkx/algorithms/boundary.py
49
2604
""" Routines to find the boundary of a set of nodes. Edge boundaries are edges that have only one end in the set of nodes. Node boundaries are nodes outside the set of nodes that have an edge to a node in the set. """ __author__ = """Aric Hagberg (hagberg@lanl.gov)\nPieter Swart (swart@lanl.gov)\nDan Schult (dschu...
gpl-3.0
glibin/tortik
tortik_tests/postprocessor_test.py
1
1248
# -*- coding: utf-8 -*- import tornado.web import tornado.ioloop from tornado.testing import AsyncHTTPTestCase from tortik.page import RequestHandler import tornado.curl_httpclient def first_postprocessor(handler, data, callback): callback(handler, data.replace('Hello,', 'Good')) def second_postprocessor(handle...
mit
AgileInstitute/GtestSpike
GtestSpike/gtest-1.7.0/test/gtest_test_utils.py
1100
10812
#!/usr/bin/env python # # Copyright 2006, 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
fenglu-g/incubator-airflow
airflow/hooks/presto_hook.py
5
4772
# -*- coding: utf-8 -*- # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the #...
apache-2.0
antoinearnoud/openfisca-france
openfisca_france/scripts/parameters/baremes_ipp/convert_ipp_xlsx_to_openfisca_xml.py
1
5031
#! /usr/bin/env python # -*- coding: utf-8 -*- """ Convertit les barèmes de l'IPP au format XLSX vers le format XML des paramètres d'OpenFisca. Nécessite l'installation de : - ssconvert : - Debian : `apt install gnumeric` - macOS : `brew install gnumeric` - xlrd : `pip install xlrd` """ import argparse imp...
agpl-3.0
analyseuc3m/ANALYSE-v1
common/lib/xmodule/xmodule/modulestore/store_utilities.py
64
4611
import re import logging from collections import namedtuple import uuid from xblock.core import XBlock DETACHED_XBLOCK_TYPES = set(name for name, __ in XBlock.load_tagged_classes("detached")) def _prefix_only_url_replace_regex(pattern): """ Match urls in quotes pulling out the fields from pattern """ ...
agpl-3.0
vivianli32/TravelConnect
flask/lib/python3.4/site-packages/babel/numbers.py
80
19693
# -*- coding: utf-8 -*- """ babel.numbers ~~~~~~~~~~~~~ Locale dependent formatting and parsing of numeric data. The default locale for the functions in this module is determined by the following environment variables, in that order: * ``LC_NUMERIC``, * ``LC_ALL``, and * ``LANG`` ...
mit
geekboxzone/lollipop_external_chromium_org_third_party_WebKit
Tools/Scripts/webkitpy/layout_tests/controllers/layout_test_runner_unittest.py
31
15091
# Copyright (C) 2012 Google Inc. All rights reserved. # Copyright (C) 2010 Gabor Rapcsanyi (rgabor@inf.u-szeged.hu), University of Szeged # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of so...
bsd-3-clause
jrgdiz/iria
main.py
1
2878
#!/usr/bin/env python3 # Based on echobot2.py import logging from telegram.ext import Updater, CommandHandler, MessageHandler, Filters from modules.gifsapm import GifsApmHandler from modules.estraviz import EstravizHandler from modules.dice import DiceHandler ######################## # LOGGING ##################...
mit
marshall007/rethinkdb
test/rql_test/connections/http_support/jinja2/nodes.py
623
28875
# -*- coding: utf-8 -*- """ jinja2.nodes ~~~~~~~~~~~~ This module implements additional nodes derived from the ast base node. It also provides some node tree helper functions like `in_lineno` and `get_nodes` used by the parser and translator in order to normalize python and jinja nodes. :...
agpl-3.0
horczech/coala-bears
bears/python/requirements/PySafetyBear.py
18
3252
from collections import namedtuple import pkg_resources import re from safety import safety from coalib.bears.LocalBear import LocalBear from dependency_management.requirements.PipRequirement import PipRequirement from coalib.results.Result import Result from coalib.results.SourceRange import SourceRange from coalib....
agpl-3.0
junhuac/MQUIC
depot_tools/external_bin/gsutil/gsutil_4.15/gsutil/third_party/boto/tests/integration/gs/test_resumable_uploads.py
101
25789
# Copyright 2010 Google Inc. # # 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, merge, publish, dis- # trib...
mit
binhqnguyen/lena-local
src/antenna/bindings/modulegen__gcc_LP64.py
48
75162
from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers import pybindgen.settings import warnings class ErrorHandler(pybindgen.settings.ErrorHandler): def handle_error(self, wrapper, exception, traceback_): warnings.warn("exception %r in wrapper %s" % (exception, wrapper)) ...
gpl-2.0
ylatuya/Flumotion
flumotion/common/i18n.py
4
9380
# -*- Mode: Python; test-case-name: flumotion.test.test_i18n.py -*- # vi:si:et:sw=4:sts=4:ts=4 # # Flumotion - a streaming media server # Copyright (C) 2004,2005,2006,2007,2008 Fluendo, S.L. (www.fluendo.com). # All rights reserved. # This file may be distributed and/or modified under the terms of # the GNU General Pu...
gpl-2.0
haad/ansible
test/units/modules/network/nuage/test_nuage_vspk.py
50
49284
# -*- coding: utf-8 -*- # (c) 2017, Nokia # 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. #...
gpl-3.0
vtSpot/linux
scripts/gdb/linux/tasks.py
630
2892
# # gdb helper commands and functions for Linux kernel debugging # # task & thread tools # # Copyright (c) Siemens AG, 2011-2013 # # Authors: # Jan Kiszka <jan.kiszka@siemens.com> # # This work is licensed under the terms of the GNU GPL version 2. # import gdb from linux import utils task_type = utils.CachedType(...
gpl-2.0
NinjaMSP/crossbar
crossbar/controller/test/test_cleanup.py
1
3048
##################################################################################### # # Copyright (c) Crossbar.io Technologies GmbH # # Unless a separate license agreement exists between you and Crossbar.io GmbH (e.g. # you have purchased a commercial license), the license terms below apply. # # Should you enter ...
agpl-3.0
mancoast/CPythonPyc_test
fail/334_test_threading_local.py
167
6339
import unittest from doctest import DocTestSuite from test import support import weakref import gc # Modules under test _thread = support.import_module('_thread') threading = support.import_module('threading') import _threading_local class Weak(object): pass def target(local, weaklist): weak = Weak() lo...
gpl-3.0
printedheart/micropsi2
micropsi_server/tests/test_json_api.py
2
48914
import pytest import json import re def assert_success(response): assert response.json_body['status'] == 'success' assert 'data' in response.json_body def assert_failure(response): assert response.json_body['status'] == 'error' assert 'data' in response.json_body def test_generate_uid(app): r...
mit
grounduphq/stexchange
stexchange/stexchange/migrations/0002_auto__add_field_member_member_number.py
1
4201
# -*- coding: 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 'Member.member_number' db.add_column(u'stexchange_member', 'member_number', ...
mit
lombritz/odoo
addons/project_issue/report/project_issue_report.py
303
4652
# -*- 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 GN...
agpl-3.0
doduytrung/odoo-8.0
addons/account/report/account_general_journal.py
381
7669
# -*- 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
harshvardhanmalpani/googlepersonfinder
app/importer.py
7
14996
#!/usr/bin/python2.7 # Copyright 2010 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
apache-2.0
Turupawn/website
games/tests/test_api.py
1
3519
import json from django.test import TestCase from django.urls import reverse from . import factories class TestGameApi(TestCase): def setUp(self): self.num_games = 10 self.games = [] for n in range(self.num_games): self.games.append( factories.GameFactory(name...
agpl-3.0
dsqmoore/0install
tests/testrecipe.py
9
2325
#!/usr/bin/env python from __future__ import with_statement import unittest import sys import os import tempfile import shutil from basetest import BaseTest sys.path.insert(0, '..') from zeroinstall import SafeException from zeroinstall.injector.fetch import StepRunner from zeroinstall.injector.model import RenameSte...
lgpl-2.1
unindented/streamcode
client/static/jsrepl/extern/python/closured/lib/python2.7/_LWPCookieJar.py
267
6553
"""Load / save to libwww-perl (LWP) format files. Actually, the format is slightly extended from that used by LWP's (libwww-perl's) HTTP::Cookies, to avoid losing some RFC 2965 information not recorded by LWP. It uses the version string "2.0", though really there isn't an LWP Cookies 2.0 format. This indicates that ...
mit
jzoldak/edx-platform
lms/djangoapps/branding/__init__.py
21
2946
""" EdX Branding package. Provides a way to retrieve "branded" parts of the site. This module provides functions to retrieve basic branded parts such as the site visible courses, university name and logo. """ from xmodule.modulestore.django import modulestore from xmodule.course_module import CourseDescriptor from d...
agpl-3.0
iychoi/syndicate
python/syndicate/ag/fs_driver_common/metadata.py
2
7583
#!/usr/bin/env python """ Copyright 2014 The Trustees of Princeton University 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 Unle...
apache-2.0
DemocracyClub/yournextrepresentative
ynr/apps/people/tests/test_age.py
1
1996
from datetime import date from django.test import TestCase from mock import patch from people.models import Person @patch("people.models.date") class TestAgeCalculation(TestCase): def test_age_full_obvious(self, mock_date): mock_date.today.return_value = date(1977, 9, 3) mock_date.side_effect = ...
agpl-3.0
OpenData-NC/open-data-nc
opendata/catalog/migrations/0007_auto__del_field_urlimage_url.py
2
12816
# -*- coding: 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): # Deleting field 'UrlImage.url' db.delete_column(u'catalog_urlimage', 'url_id') def backwards(self, or...
mit
daoluan/decode-Django
Django-1.5.1/django/contrib/gis/gdal/tests/test_geom.py
104
20864
import json from binascii import b2a_hex try: from django.utils.six.moves import cPickle as pickle except ImportError: import pickle from django.contrib.gis.gdal import (OGRGeometry, OGRGeomType, OGRException, OGRIndexError, SpatialReference, CoordTransform, GDAL_VERSION) from django.contrib.gis.geometry.t...
gpl-2.0
aweinstock314/servo
tests/wpt/web-platform-tests/webdriver/element_state/visibility_test.py
58
14831
import os import sys import unittest sys.path.insert(1, os.path.abspath(os.path.join(__file__, "../.."))) import base_test from webdriver import exceptions class NaturalNonVisibleElementsTest(base_test.WebDriverBaseTest): def test_0x0_pixel_element_is_not_visible(self): self.driver.get(self.webserver.whe...
mpl-2.0
iFighting/flask
docs/flaskext.py
2228
4875
# flasky extensions. flasky pygments style based on tango style from pygments.style import Style from pygments.token import Keyword, Name, Comment, String, Error, \ Number, Operator, Generic, Whitespace, Punctuation, Other, Literal class FlaskyStyle(Style): background_color = "#f8f8f8" default_style = "...
bsd-3-clause
baoboa/pizza-lammps
src/DEFAULTS.py
4
3366
# Pizza.py toolkit, www.cs.sandia.gov/~sjplimp/pizza.html # Steve Plimpton, sjplimp@sandia.gov, Sandia National Laboratories # # Copyright (2005) Sandia Corporation. Under the terms of Contract # DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains # certain rights in this software. This software is...
gpl-2.0
SachaMPS/django-cms
cms/page_rendering.py
1
2562
# -*- coding: utf-8 -*- from django.conf import settings from django.core.urlresolvers import resolve, Resolver404 from django.http import Http404 from django.template import RequestContext from django.template.response import TemplateResponse from cms import __version__ from cms.cache.page import set_page_cache from ...
bsd-3-clause
rclmenezes/sqlalchemy
test/orm/test_eager_relations.py
1
109760
"""tests of joined-eager loaded attributes""" from sqlalchemy.testing import eq_, is_, is_not_ import sqlalchemy as sa from sqlalchemy import testing from sqlalchemy.orm import joinedload, deferred, undefer, \ joinedload_all, backref, eagerload, Session, immediateload from sqlalchemy import Integer, String, Date, ...
mit
zml312570140/XperiaKernel
tools/perf/scripts/python/failed-syscalls-by-pid.py
11180
2058
# failed system call counts, by pid # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Displays system-wide failed system call totals, broken down by pid. # If a [comm] arg is specified, only syscalls called by [comm] are displayed. import os import sys sys.pa...
gpl-2.0
rogerwang/chromium
media/tools/layout_tests/layouttest_analyzer_helpers_unittest.py
9
9249
#!/usr/bin/env python # Copyright (c) 2012 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 copy from datetime import datetime import os import pickle import time import unittest import layouttest_analyzer_helpers ...
bsd-3-clause
LuaDist/scite
scripts/CheckMentioned.py
1
1510
#!/usr/bin/env python3 # CheckMentioned.py # Find all the symbols in scintilla/include/Scintilla.h and check if they # are mentioned in scintilla/doc/ScintillaDoc.html. import string uninteresting = { "SCINTILLA_H", "SCI_START", "SCI_LEXER_START", "SCI_OPTIONAL_START", # These archaic names are #defined to the Sci_...
isc
schleichdi2/OPENNFR-6.0-CORE
bitbake/lib/bb/ui/uievent.py
4
5163
# ex:ts=4:sw=4:sts=4:et # -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- # # Copyright (C) 2006 - 2007 Michael 'Mickey' Lauer # Copyright (C) 2006 - 2007 Richard Purdie # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License versi...
gpl-2.0
pfnet/chainercv
chainercv/utils/testing/assertions/assert_is_point.py
3
2196
import numpy as np def assert_is_point(point, visible=None, size=None, n_point=None): """Checks if points satisfy the format. This function checks if given points satisfy the format and raises an :class:`AssertionError` when the points violate the convention. Args: point (~numpy.ndarray): Po...
mit
vslavik/poedit
deps/boost/tools/build/test/libzstd.py
6
3903
#!/usr/bin/python # Copy-paste-modify from zlib.py # Copyright (C) 2013 Steven Watanabe # Distributed under the Boost Software License, Version 1.0. # (See accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) import BoostBuild import MockToolset t = BoostBuild.Tester(arguments=['tools...
mit
mgit-at/ansible
lib/ansible/plugins/filter/network.py
7
15679
# # {c) 2017 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 ...
gpl-3.0
dbaxa/django
django/conf/locale/hu/formats.py
504
1117
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # from __future__ import unicode_literals # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'Y. F j.' TIME_FORMAT = 'G.i' DATE...
bsd-3-clause
ionomy/ion
test/functional/p2p-leaktests.py
2
5147
#!/usr/bin/env python3 # Copyright (c) 2017 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test message sending before handshake completion. A node should never send anything other than VERSION/VERA...
mit
CM-Tab-S/stock_chagalllte
tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Util.py
12527
1935
# Util.py - Python extension for perf script, miscellaneous utility code # # Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com> # # This software may be distributed under the terms of the GNU General # Public License ("GPL") version 2 as published by the Free Software # Foundation. import errno, os FUTEX_WAIT = 0...
gpl-2.0
KaranToor/MA450
google-cloud-sdk/lib/googlecloudsdk/third_party/appengine/datastore/entity_v4_pb.py
7
52044
# Copyright 2016 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 ag...
apache-2.0
cogeorg/BlackRhino
examples/Georg2012/production/networkx/algorithms/centrality/tests/test_current_flow_betweenness_centrality.py
89
7721
#!/usr/bin/env python from nose.tools import * from nose import SkipTest import networkx from nose.plugins.attrib import attr from networkx import edge_current_flow_betweenness_centrality \ as edge_current_flow from networkx import approximate_current_flow_betweenness_centrality \ as approximate_cfbc class T...
gpl-3.0
Fedik/gramps
gramps/gui/widgets/expandcollapsearrow.py
10
3458
# # Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2000-2006 Donald N. Allingham # # 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...
gpl-2.0
kenwang815/KodiPlugins
script.module.youtube.dl/lib/youtube_dl/extractor/allocine.py
21
3546
# -*- coding: utf-8 -*- from __future__ import unicode_literals import re import json from .common import InfoExtractor from ..compat import compat_str from ..utils import ( qualities, unescapeHTML, xpath_element, ) class AllocineIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?allocine\.fr/(?P<...
gpl-2.0
yoer/hue
desktop/core/ext-py/boto-2.38.0/boto/cloudhsm/exceptions.py
135
1347
# Copyright (c) 2015 Amazon.com, Inc. or its affiliates. All Rights Reserved # # 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 ...
apache-2.0
40123210/w17b_exam
static/Brython3.1.3-20150514-095342/Lib/copyreg.py
749
6611
"""Helper to provide extensibility for pickle. This is only useful to add pickle support for extension types defined in C, not for instances of user-defined classes. """ __all__ = ["pickle", "constructor", "add_extension", "remove_extension", "clear_extension_cache"] dispatch_table = {} def pickle(ob_typ...
agpl-3.0
roidelapluie/GitPython
git/test/test_docs.py
13
24177
#-*-coding:utf-8-*- # test_git.py # Copyright (C) 2008, 2009 Michael Trier (mtrier@gmail.com) and contributors # # This module is part of GitPython and is released under # the BSD License: http://www.opensource.org/licenses/bsd-license.php import os from git.test.lib import TestBase from gitdb.test.lib import with_rw_...
bsd-3-clause
shanot/imp
modules/isd/examples/ubiquitin/replica_exchange.py
2
8389
#!/usr/bin/env python from __future__ import print_function import sys import os import errno import atexit import random # Comment either this line or the following to attain different communication schemes: # to start pyro try: from IMP.isd.PyroGrid import PyroGrid as Grid # from IMP.isd.FileBasedGrid import ...
gpl-3.0
ibm-security-intelligence/api-samples
custom_actions/04_postCustomActions.py
1
12475
#!/usr/bin/env python3 # This sample demonstrates how to use various POST /custom_actions/ endpoints # available REST API. # # WARNING: This sample makes changes to the QRadar system and it is # recommended that it is not run against a production system. # # This script can be run once as custom actions require their n...
apache-2.0
rickmendes/ansible-modules-core
cloud/docker/docker_network.py
19
13023
#!/usr/bin/python # # Copyright 2016 Red Hat | Ansible # # 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 la...
gpl-3.0
stefanv/aandete
app/lib/pygments/lexers/apl.py
25
3167
# -*- coding: utf-8 -*- """ pygments.lexers.apl ~~~~~~~~~~~~~~~~~~~ Lexers for APL. :copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ from pygments.lexer import RegexLexer from pygments.token import Text, Comment, Operator, Keyword, Nam...
bsd-3-clause
Syrcon/servo
tests/wpt/web-platform-tests/tools/pywebsocket/src/mod_pywebsocket/xhr_benchmark_handler.py
415
3944
# Copyright 2014 Google Inc. All rights reserved. # # Use of this source code is governed by a BSD-style # license that can be found in the COPYING file or at # https://developers.google.com/open-source/licenses/bsd from mod_pywebsocket import util class XHRBenchmarkHandler(object): def __init__(self, headers, ...
mpl-2.0
trendels/rhino
rhino/util.py
1
3960
from __future__ import absolute_import import functools import inspect import sys __all__ = [ 'apply_ctx', 'sse_event', ] def _sse_encode(k, v): # splitlines() discards the last trailing newline. Append an unambiguous # newline so that the presence or absence of a trailing newline in the # input...
mit
drexly/tonginBlobStore
lib/django/contrib/admin/views/main.py
327
16684
import sys from collections import OrderedDict from django.contrib.admin import FieldListFilter from django.contrib.admin.exceptions import ( DisallowedModelAdminLookup, DisallowedModelAdminToField, ) from django.contrib.admin.options import ( IS_POPUP_VAR, TO_FIELD_VAR, IncorrectLookupParameters, ) from djang...
bsd-3-clause
zlorb/mitmproxy
mitmproxy/tools/console/master.py
3
6745
import asyncio import mailcap import mimetypes import os import os.path import shlex import signal import stat import subprocess import sys import tempfile import typing # noqa import contextlib import urwid from mitmproxy import addons from mitmproxy import master from mitmproxy import log from mitmproxy.addons imp...
mit
tomriddle1234/dgsCalc
dgsCheckFileExists.py
1
2776
# encoding=utf8 #input is a csv file path, and a search target folder import fixutf8 import sys,os import logging import fnmatch import argparse import collections from dgsUtil import * parser = argparse.ArgumentParser(description='This program is to check file existence for DGS. Also generating a log file with the n...
gpl-3.0
pektin/jam
compiler/llvm/builtins.py
1
7773
import logging from functools import partial from .state import State from .util import * from .. import lekvar from . import bindings as llvm def builtins(logger = logging.getLogger()): global printf printf = None string = LLVMType("String") size = LLVMType("Int64") ints = [ LLVMType("In...
mit
Obus/scikit-learn
examples/semi_supervised/plot_label_propagation_structure.py
247
2432
""" ============================================== Label Propagation learning a complex structure ============================================== Example of LabelPropagation learning a complex internal structure to demonstrate "manifold learning". The outer circle should be labeled "red" and the inner circle "blue". Be...
bsd-3-clause
RealTimeWeb/wikisite
MoinMoin/script/migration/data.py
1
2861
# -*- coding: iso-8859-1 -*- """ MoinMoin - data_dir migration main script (new style) You can use this script to migrate your wiki's data_dir to the format expected by the current MoinMoin code. It will read data/meta to determine what needs to be done and call other migration scripts as needed. ...
apache-2.0
CMDann/oppia
extensions/interactions/Continue/Continue.py
9
1168
# coding: utf-8 # # Copyright 2014 The Oppia 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 requi...
apache-2.0
coolbombom/CouchPotatoServer
libs/enzyme/language.py
180
15146
# -*- coding: utf-8 -*- # enzyme - Video metadata parser # Copyright 2011-2012 Antoine Bertin <diaoulael@gmail.com> # Copyright 2003-2006 Dirk Meyer <dischi@freevo.org> # # This file is part of enzyme. # # enzyme is free software; you can redistribute it and/or modify it under # the terms of the GNU General Public Lice...
gpl-3.0
inares/edx-platform
openedx/core/djangoapps/credit/tests/test_tasks.py
62
13643
""" Tests for credit course tasks. """ import mock from datetime import datetime, timedelta from pytz import UTC from openedx.core.djangoapps.credit.api import get_credit_requirements from openedx.core.djangoapps.credit.exceptions import InvalidCreditRequirements from openedx.core.djangoapps.credit.models import Cred...
agpl-3.0
Joneyviana/todolist-django-angular
todolist/users/migrations/0002_auto_20160728_2311.py
1
1044
# -*- coding: utf-8 -*- # Generated by Django 1.9.8 on 2016-07-28 23:11 from __future__ import unicode_literals import django.contrib.auth.models import django.core.validators from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('users', '0001_initial'), ...
mit
vega123/enigma2
lib/python/Components/ParentalControlList.py
32
2252
from MenuList import MenuList from Components.ParentalControl import IMG_WHITESERVICE, IMG_WHITEBOUQUET, IMG_BLACKSERVICE, IMG_BLACKBOUQUET from Tools.Directories import SCOPE_SKIN_IMAGE, resolveFilename from enigma import eListboxPythonMultiContent, gFont, RT_HALIGN_LEFT from Tools.LoadPixmap import LoadPixmap #Now ...
gpl-2.0
vitalikp/yum
yum/failover.py
12
5125
#!/usr/bin/python # 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) any later version. # # This program is distributed in the hope that it wi...
gpl-2.0
chafique-delli/OpenUpgrade
scripts/migrate.py
13
10127
#!/usr/bin/python import os import sys import StringIO import psycopg2 import psycopg2.extensions from optparse import OptionParser from ConfigParser import SafeConfigParser from bzrlib.branch import Branch from bzrlib.repository import Repository from bzrlib.workingtree import WorkingTree import bzrlib.plugin import ...
agpl-3.0