repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
BambooL/jeeves
refs/heads/master
test/web/calendar/test_Jcal.py
3
# -*- coding: iso-8859-15 -*- """Conf FunkLoad test $Id$ """ import unittest from random import random from funkload.FunkLoadTestCase import FunkLoadTestCase class Jcal(FunkLoadTestCase): """This test use a configuration file Conf.conf.""" def setUp(self): """Setting up test.""" self.server_u...
ofir123/CouchPotatoServer
refs/heads/master
libs/chardet/jisfreq.py
3130
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Communicator client code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights R...
rogalski/pylint
refs/heads/master
pylint/reporters/__init__.py
4
# Copyright (c) 2006, 2010, 2012-2014 LOGILAB S.A. (Paris, FRANCE) <[email protected]> # Copyright (c) 2013-2014 Google, Inc. # Copyright (c) 2014-2016 Claudiu Popa <[email protected]> # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/b...
PaytonShaw/shadowsocks1
refs/heads/master
shadowsocks/encrypt_rc4_md5.py
31
#!/usr/bin/env python # Copyright (c) 2014 clowwindy # # 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, me...
wakatime/wakatime
refs/heads/master
wakatime/packages/py26/pygments/lexers/eiffel.py
31
# -*- coding: utf-8 -*- """ pygments.lexers.eiffel ~~~~~~~~~~~~~~~~~~~~~~ Lexer for the Eiffel language. :copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ from pygments.lexer import RegexLexer, include, words from pygments.token import ...
puckipedia/youtube-dl
refs/heads/master
youtube_dl/extractor/ehow.py
195
from __future__ import unicode_literals from .common import InfoExtractor from ..compat import compat_urllib_parse_unquote class EHowIE(InfoExtractor): IE_NAME = 'eHow' _VALID_URL = r'https?://(?:www\.)?ehow\.com/[^/_?]*_(?P<id>[0-9]+)' _TEST = { 'url': 'http://www.ehow.com/video_12245069_hardwoo...
jayceyxc/hue
refs/heads/master
desktop/core/ext-py/django-nose-1.3/django_nose/runner.py
26
"""Django test runner that invokes nose. You can use... :: NOSE_ARGS = ['list', 'of', 'args'] in settings.py for arguments that you want always passed to nose. """ from __future__ import print_function import os import sys from optparse import make_option from types import MethodType import django from django....
rosmo/aurora
refs/heads/master
src/main/python/apache/aurora/client/api/restarter.py
5
# # 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 ...
iw3hxn/LibrERP
refs/heads/master
office_automation/gap_analysis/__init__.py
6
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (c) 2010-2013 Elico Corp. All Rights Reserved. # Author: Yannick Gouin <[email protected]> # # This program is free software: you can red...
go-lab/appcomposer
refs/heads/master
appcomposer/cdata.py
3
import xml.etree.ElementTree as ET # Don't sort things (so the order is preserved) ET.sorted = lambda x, *args, **kwargs: x # Code from: # http://stackoverflow.com/questions/1091945/what-characters-do-i-need-to-escape-in-xml-documents def CDATA(text=None): element = ET.Element('![CDATA[') element.text = text...
hsiaoyi0504/scikit-learn
refs/heads/master
sklearn/feature_extraction/setup.py
314
import os def configuration(parent_package='', top_path=None): import numpy from numpy.distutils.misc_util import Configuration config = Configuration('feature_extraction', parent_package, top_path) libraries = [] if os.name == 'posix': libraries.append('m') config.add_extension('_ha...
base2Services/alfajor
refs/heads/master
scripts/stale_snapshot_cleanup.py
1
import sys import os pwd = os.environ['PWD'] alfajor_path = "{0}".format(pwd) # if running from alfajor root alfajor_path2 = "{0}/..".format(pwd) # if running from scripts folder alfajor_path3 = "{0}/alfajor".format(pwd) # if running from folder above alfajor for path in [alfajor_path, alfajor_path2, alfajor_path3...
ondra-novak/chromium.src
refs/heads/nw
tools/valgrind/unused_suppressions.py
187
#!/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 sys import urllib2 import suppressions def main(): supp = suppressions.GetSuppressions() all_supps = [] for supps ...
Ssawa/Diamond
refs/heads/master
src/collectors/ksm/test/testksm.py
31
#!/usr/bin/python # coding=utf-8 ########################################################################## import os from test import CollectorTestCase from test import get_collector_config from test import unittest from mock import Mock from mock import patch from diamond.collector import Collector from ksm import...
elena/django
refs/heads/master
tests/view_tests/tests/test_specials.py
133
from django.test import SimpleTestCase, override_settings @override_settings(ROOT_URLCONF='view_tests.generic_urls') class URLHandling(SimpleTestCase): """ Tests for URL handling in views and responses. """ redirect_target = "/%E4%B8%AD%E6%96%87/target/" def test_nonascii_redirect(self): ...
abhishek-ch/hue
refs/heads/master
desktop/core/ext-py/Django-1.6.10/django/__init__.py
38
VERSION = (1, 6, 10, 'final', 0) def get_version(*args, **kwargs): # Don't litter django/__init__.py with all the get_version stuff. # Only import if it's actually called. from django.utils.version import get_version return get_version(*args, **kwargs)
wuhengzhi/chromium-crosswalk
refs/heads/master
build/android/pylib/utils/run_tests_helper.py
24
# Copyright 2015 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. # pylint: disable=unused-wildcard-import # pylint: disable=wildcard-import from devil.utils.run_tests_helper import *
w1ll1am23/home-assistant
refs/heads/dev
homeassistant/components/cloud/__init__.py
5
"""Component to integrate the Home Assistant cloud.""" from hass_nabucasa import Cloud import voluptuous as vol from homeassistant.components.alexa import const as alexa_const from homeassistant.components.google_assistant import const as ga_c from homeassistant.const import ( CONF_DESCRIPTION, CONF_MODE, ...
ewandor/home-assistant
refs/heads/dev
homeassistant/components/alarm_control_panel/demo.py
8
""" Demo platform that has two fake alarm control panels. For more details about this platform, please refer to the documentation https://home-assistant.io/components/demo/ """ import datetime import homeassistant.components.alarm_control_panel.manual as manual from homeassistant.const import ( STATE_ALARM_ARMED_A...
sander76/home-assistant
refs/heads/dev
homeassistant/helpers/typing.py
6
"""Typing Helpers for Home Assistant.""" from enum import Enum from typing import Any, Dict, Mapping, Optional, Tuple, Union import homeassistant.core GPSType = Tuple[float, float] ConfigType = Dict[str, Any] ContextType = homeassistant.core.Context DiscoveryInfoType = Dict[str, Any] EventType = homeassistant.core.Ev...
alqfahad/odoo
refs/heads/8.0
addons/website_forum/models/res_users.py
281
# -*- coding: utf-8 -*- from datetime import datetime from urllib import urlencode import hashlib from openerp import SUPERUSER_ID from openerp.osv import osv, fields class Users(osv.Model): _inherit = 'res.users' def __init__(self, pool, cr): init_res = super(Users, self).__init__(pool, cr) ...
lindsayad/sympy
refs/heads/master
sympy/crypto/__init__.py
38
from sympy.crypto.crypto import (cycle_list, encipher_shift, encipher_affine, encipher_substitution, check_and_join, encipher_vigenere, decipher_vigenere, bifid5_square, bifid6_square, encipher_hill, decipher_hill, encipher_bifid5, encipher_bifid6, decipher_bifid5, decipher_bifid...
VladKha/CodeWars
refs/heads/master
7 kyu/Insert dashes/solve.py
1
def insert_dash(num): odd = '13579' s = str(num) result = s[0] for i in range(1, len(s)): if s[i-1] in odd and s[i] in odd: result += '-' result += s[i] return result
Drooids/odoo
refs/heads/8.0
openerp/addons/base/tests/test_search.py
290
import unittest2 import openerp.tests.common as common class test_search(common.TransactionCase): def test_00_search_order(self): registry, cr, uid = self.registry, self.cr, self.uid # Create 6 partners with a given name, and a given creation order to # ensure the order of their ID. So...
superdesk/Live-Blog
refs/heads/master
documentor/libraries/docutils-0.9.1-py3.2/docutils/writers/xetex/__init__.py
2
#!/usr/bin/env python # -*- coding: utf8 -*- # :Author: Günter Milde <[email protected]> # :Revision: $Revision: 7389 $ # :Date: $Date: 2012-03-30 13:58:21 +0200 (Fre, 30 Mär 2012) $ # :Copyright: © 2010 Günter Milde. # :License: Released under the terms of the `2-Clause BSD license`_, in short: # # Copy...
GdZ/scriptfile
refs/heads/master
software/googleAppEngine/lib/ipaddr/ipaddr/__init__.py
92
#!/usr/bin/python # # Copyright 2007 Google Inc. # Licensed to PSF under a Contributor Agreement. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICE...
locaweb/leela
refs/heads/master
try/src/try_leela/suites/smoke/test_make.py
1
# -*- coding: utf-8 -*- import unittest from try_leela import env from try_leela import helpers class TestMake(unittest.TestCase): def setUp(self): self.driver = env.driver() def test_make_returns_name(self): with self.driver.session("smoke/test_make") as session: session.execute...
X-ROM/android_external_skia
refs/heads/jb3
PRESUBMIT.py
13
# Copyright (c) 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 Skia. See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts for more details about the presubmi...
dpaleino/bootchart2
refs/heads/master
pybootchartgui/main.py
2
# This file is part of pybootchartgui. # pybootchartgui 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. # pybootchartgui is dis...
dd00/commandergenius
refs/heads/dd00
project/jni/python/src/Lib/encodings/mac_turkish.py
593
""" Python Character Mapping Codec mac_turkish generated from 'MAPPINGS/VENDORS/APPLE/TURKISH.TXT' with gencodec.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_table) def decode(self,input...
joelstanner/learning_journal
refs/heads/master
features/steps.py
1
from lettuce import before, after, world, step import os from contextlib import closing from journal import connect_db from journal import DB_SCHEMA import pytest TEST_DSN = 'dbname=test_learning_journal user=postgres' settings = {'db': TEST_DSN} INPUT_BTN = "<input class='display-block' type='submit' value='Add post...
shownomercy/django
refs/heads/master
django/contrib/sites/shortcuts.py
615
from __future__ import unicode_literals from django.apps import apps def get_current_site(request): """ Checks if contrib.sites is installed and returns either the current ``Site`` object or a ``RequestSite`` object based on the request. """ # Imports are inside the function because its point is ...
brandond/ansible
refs/heads/devel
lib/ansible/modules/network/vyos/vyos_l3_interface.py
56
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2017, Ansible by Red Hat, inc # # This file is part of Ansible by Red Hat # # 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 Li...
edx/lettuce
refs/heads/master
tests/integration/lib/Django-1.3/django/core/management/commands/sqlreset.py
313
from optparse import make_option from django.core.management.base import AppCommand from django.core.management.sql import sql_reset from django.db import connections, DEFAULT_DB_ALIAS class Command(AppCommand): help = "Prints the DROP TABLE SQL, then the CREATE TABLE SQL, for the given app name(s)." option_...
Lekanich/intellij-community
refs/heads/master
python/testData/inspections/PyStringFormatInspection1/test.py
39
my_dict = {'class': 3} my_dict['css_class'] = "" if my_dict['class']: my_dict['css_class'] = 'class %(class)s' % my_dict my_dict['tmp'] = 'classes %(css_class)s' % my_dict my_dict['tmp'] = 'classes %(claz)s' % <warning descr="Key 'claz' has no following argument">my_dict</warning> #PY-4647 argument_pattern = re.c...
netgroup/dreamer-ryu
refs/heads/master
ryu/services/protocols/bgp/rtconf/neighbors.py
3
# Copyright (C) 2014 Nippon Telegraph and Telephone Corporation. # # 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 appli...
levilucio/SyVOLT
refs/heads/master
GM2AUTOSAR_MM/merge_inter_layer_rules/Himesis/HFindTwoApplyElementsWithTraceLHS.py
2
from core.himesis import Himesis, HimesisPreConditionPatternLHS import cPickle as pickle from uuid import UUID class HFindTwoApplyElementsWithTraceLHS(HimesisPreConditionPatternLHS): def __init__(self): """ Creates the himesis graph representing the AToM3 model HFindTwoApplyElementsWithTraceLHS. ...
lexionbear/mlmodels
refs/heads/master
tensorflow/libs/caffe-tensorflow/kaffe/caffe/__init__.py
13
from .resolver import get_caffe_resolver, has_pycaffe
2015fallproject/2015fallcase1
refs/heads/master
static/Brython3.2.0-20150701-214155/Lib/test/unittests/subprocessdata/fd_status.py
90
"""When called as a script, print a comma-separated list of the open file descriptors on stdout.""" import errno import os try: _MAXFD = os.sysconf("SC_OPEN_MAX") except: _MAXFD = 256 if __name__ == "__main__": fds = [] for fd in range(0, _MAXFD): try: st = os.fstat(fd) ex...
roninek/python101
refs/heads/master
docs/podstawy/przyklady/05_oceny_03.py
2
#! /usr/bin/env python # -*- coding: utf-8 -*- # importujemy funkcje z modułu ocenyfun zapisanego w pliku ocenyfun.py from ocenyfun import drukuj from ocenyfun import srednia from ocenyfun import mediana from ocenyfun import odchylenie przedmioty = set(['polski', 'angielski']) # definicja zbioru drukuj(przedmioty, "...
mbj36/Python-Flask
refs/heads/master
db_migrate.py
47
#!flask/bin/python import imp from migrate.versioning import api from app import db from config import SQLALCHEMY_DATABASE_URI from config import SQLALCHEMY_MIGRATE_REPO v = api.db_version(SQLALCHEMY_DATABASE_URI, SQLALCHEMY_MIGRATE_REPO) migration = SQLALCHEMY_MIGRATE_REPO + ('/versions/%03d_migration.py' % (v+1)) tmp...
Yelp/pootle
refs/heads/master
pootle/apps/pootle_app/management/commands/retry_failed_jobs.py
1
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) Pootle contributors. # # This file is a part of the Pootle project. It is distributed under the GPL3 # or later license. See the LICENSE file for a copy of the license and the # AUTHORS file for copyright and authorship information. import os # This must...
oberstet/autobahn-python
refs/heads/master
examples/twisted/websocket/reconnecting/client.py
3
############################################################################### # # The MIT License (MIT) # # Copyright (c) Crossbar.io Technologies GmbH # # 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 ...
RegulatoryGenomicsUPF/pyicoteo
refs/heads/pyicoteo
old_docs/conf.py
1
# -*- coding: utf-8 -*- # # pyicos documentation build configuration file, created by # sphinx-quickstart on Sat Apr 3 10:47:10 2010. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All ...
UITools/saleor
refs/heads/master
saleor/dashboard/seo/utils.py
1
from django.utils.translation import pgettext_lazy from ...core.utils.text import strip_html_and_truncate from ..widgets import CharsLeftWidget MIN_TITLE_LENGTH = 25 MIN_DESCRIPTION_LENGTH = 120 SEO_HELP_TEXTS = { 'seo_description': pgettext_lazy( 'Form field help text', ( 'If empty, t...
anhstudios/swganh
refs/heads/develop
data/scripts/templates/object/tangible/loot/loot_schematic/shared_tanning_hide_s01_schematic.py
2
#### NOTICE: THIS FILE IS AUTOGENERATED #### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY #### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES from swgpy.object import * def create(kernel): result = Tangible() result.template = "object/tangible/loot/loot_schematic/shared_tanning_hide_s01_schematic.iff" result.a...
nsol-nmsu/ns3-smartgrid
refs/heads/ndnSIM-v2
src/wave/test/examples-to-run.py
102
#! /usr/bin/env python ## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*- # A list of C++ examples to run in order to ensure that they remain # buildable and runnable over time. Each tuple in the list contains # # (example_name, do_run, do_valgrind_run). # # See test.py for more i...
mrnamingo/enigma2-test
refs/heads/master
lib/python/Screens/EpgSelection.py
1
from time import localtime, time, strftime, mktime from enigma import eServiceReference, eTimer, eServiceCenter, ePoint from Screen import Screen from Screens.HelpMenu import HelpableScreen from Components.About import about from Components.ActionMap import HelpableActionMap, HelpableNumberActionMap from Components.B...
vasyarv/edx-platform
refs/heads/master
lms/djangoapps/django_comment_client/tests/factories.py
149
from factory.django import DjangoModelFactory from django_comment_common.models import Role, Permission class RoleFactory(DjangoModelFactory): FACTORY_FOR = Role name = 'Student' course_id = 'edX/toy/2012_Fall' class PermissionFactory(DjangoModelFactory): FACTORY_FOR = Permission name = 'create_...
jdnier/rexlib
refs/heads/master
tokens.py
1
""" XML token classes representing mark up and text. The property idiom used in this module is discussed here: http://docs.python.org/release/3.2/library/functions.html#property """ import re import sys from collections import OrderedDict from .rex import XML_SPE_, ElemTagRE_, AttRE_ __all__ = [ 'Cdata', ...
geosolutions-it/geonode
refs/heads/master
geonode/api/views.py
4
# -*- coding: utf-8 -*- ######################################################################### # # Copyright (C) 2016 OSGeo # # 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 ...
opendesk/pyramid_torque_engine
refs/heads/master
src/pyramid_torque_engine/action.py
1
# -*- coding: utf-8 -*- """Including this module sets up a configuration system for specifying which actions are valid for a given resource (which will be in a given state). Register valid actions using: config.add_engine_action( IFoo, # context 'a.DECLINE', # action (verb)...
pradyu1993/scikit-learn
refs/heads/master
sklearn/manifold/tests/test_isomap.py
31
from itertools import product import numpy as np from numpy.testing import assert_almost_equal, assert_array_almost_equal from sklearn import datasets from sklearn import manifold from sklearn import neighbors from sklearn import pipeline from sklearn import preprocessing from sklearn.utils.testing import assert_less ...
dga4654dan/UTM-Demo
refs/heads/master
V_1_0_1/UtmDemo_Sfs_2.9.0/UtmDemo_Sfs_2.9.0_Server/lib/Lib/Cookie.py
8
#!/usr/bin/env python # #### # Copyright 2000 by Timothy O'Malley <[email protected]> # # All Rights Reserved # # Permission to use, copy, modify, and distribute this software # and its documentation for any purpose and without fee is hereby # granted, provided that the above copyright notice appear in ...
jbuchbinder/youtube-dl
refs/heads/master
youtube_dl/extractor/tv3.py
69
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor class TV3IE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?tv3\.co\.nz/(?P<id>[^/]+)/tabid/\d+/articleID/\d+/MCat/\d+/Default\.aspx' _TEST = { 'url': 'http://www.tv3.co.nz/MOTORSPORT-SRS-SsangYong-Hampton-Dow...
stevenewey/django
refs/heads/master
tests/template_tests/filter_tests/test_truncatechars_html.py
390
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.template.defaultfilters import truncatechars_html from django.test import SimpleTestCase class FunctionTests(SimpleTestCase): def test_truncate_zero(self): self.assertEqual(truncatechars_html('<p>one <a href="#">two - three <br>...
vmax-feihu/hue
refs/heads/master
desktop/core/ext-py/Pygments-1.3.1/pygments/lexers/__init__.py
72
# -*- coding: utf-8 -*- """ pygments.lexers ~~~~~~~~~~~~~~~ Pygments lexers. :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import sys import types import fnmatch from os.path import basename from pygments.lexers._mapping import LEX...
lochiiconnectivity/exabgp
refs/heads/master
lib/exabgp/configuration/bgp/process.py
1
# encoding: utf-8 """ process.py Created by Thomas Mangin on 2014-06-22. Copyright (c) 2014-2015 Exa Networks. All rights reserved. """ from exabgp.configuration.engine.location import Location from exabgp.configuration.engine.raised import Raised from exabgp.configuration.engine.section import Section from exabgp.co...
andyneff/voxel-globe
refs/heads/master
voxel_globe/main/tests.py
24123
from django.test import TestCase # Create your tests here.
nemesisdesign/django
refs/heads/master
tests/utils_tests/test_archive.py
372
import os import shutil import tempfile import unittest from django.utils._os import upath from django.utils.archive import Archive, extract TEST_DIR = os.path.join(os.path.dirname(upath(__file__)), 'archives') class ArchiveTester(object): archive = None def setUp(self): """ Create temporar...
sunyanHub/myfirst
refs/heads/master
hzlu-github.py
150
print "hello, thank you for your GIT Tutorial."
baylee-d/osf.io
refs/heads/develop
addons/mendeley/api.py
77
from mendeley.session import MendeleySession class APISession(MendeleySession): def request(self, *args, **kwargs): kwargs['params'] = {'view': 'all', 'limit': '500'} return super(APISession, self).request(*args, **kwargs)
diegosarmentero/ninja-ide
refs/heads/master
ninja_ide/resources.py
6
# -*- coding: utf-8 -*- # # This file is part of NINJA-IDE (http://ninja-ide.org). # # NINJA-IDE 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 # any later version. # # NIN...
marrybird/flask-admin
refs/heads/master
examples/rediscli/app.py
36
from flask import Flask from redis import Redis import flask_admin as admin from flask_admin.contrib import rediscli # Create flask app app = Flask(__name__) # Flask views @app.route('/') def index(): return '<a href="/admin/">Click me to get to Admin!</a>' if __name__ == '__main__': # Create admin inter...
theshadowx/enigma2
refs/heads/master
lib/python/Components/Renderer/FrontpanelLed.py
30
from Components.Element import Element # this is not a GUI renderer. class FrontpanelLed(Element): def __init__(self, which = 0, patterns = [(20, 0, 0xffffffff),(20, 0x55555555, 0x84fc8c04)], boolean = True): self.which = which self.boolean = boolean self.patterns = patterns Element.__init__(self) def chang...
yrobla/nova
refs/heads/debian/unstable
nova/tests/integrated/test_xml.py
14
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2011 Justin Santa Barbara # 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...
unisport/thumblr
refs/heads/master
thumblr/templatetags/thumblr_tags.py
1
from django import template from django.contrib.contenttypes.models import ContentType from django.forms import HiddenInput from django.template.base import TemplateSyntaxError from thumblr.services.url import get_image_instance_url from thumblr.dto import ImageMetadata, ImageUrlSpec from thumblr.forms import ImageSiz...
buchwj/xvector
refs/heads/master
xVLib/xVLib/__init__.py
1
# xVector Engine Core Library # Copyright (c) 2010 James Buchwald # # 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. # # ...
chouseknecht/ansible
refs/heads/devel
hacking/build_library/build_ansible/command_plugins/collection_meta.py
26
# coding: utf-8 # Copyright: (c) 2019, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # Make coding more python3-ish from __future__ import (absolute_import, division, print_function) __metaclass__ = type import os import os.path import pathlib import yam...
ytjiang/thefuck
refs/heads/master
tests/test_logs.py
4
from mock import Mock from thefuck import logs def test_color(): assert logs.color('red', Mock(no_colors=False)) == 'red' assert logs.color('red', Mock(no_colors=True)) == ''
uahic/nest-simulator
refs/heads/master
examples/nest/plot_tsodyks_depr_fac.py
13
# -*- coding: utf-8 -*- # # plot_tsodyks_depr_fac.py # # This file is part of NEST. # # Copyright (C) 2004 The NEST Initiative # # NEST is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 2 of the L...
bsmr-eve/Pyfa
refs/heads/master
eos/effects/shiparmorknresistanceaf1.py
2
# shipArmorKNResistanceAF1 # # Used by: # Ship: Astero # Ship: Malice # Ship: Punisher type = "passive" def handler(fit, ship, context): fit.ship.boostItemAttr("armorKineticDamageResonance", ship.getModifiedItemAttr("shipBonusAF"), skill="Amarr Frigate")
cassinius/mlhi-ass2-anonymization
refs/heads/master
test/rangeGenHierarchyTests.py
1
import unittest import src.rangeGenHierarchy as RGH class ExtendedTestCase(unittest.TestCase): def assertRaisesWithMessage(self, msg, func, *args, **kwargs): try: func(*args, **kwargs) self.assertFail() except Exception as inst: self.assertEqual(inst.message, msg) # test_ prefix for me...
r0balo/pelisalacarta
refs/heads/develop
python/main-classic/lib/sambatools/pyasn1/codec/cer/encoder.py
10
# CER encoder from pyasn1 import error from pyasn1.codec.ber import encoder from pyasn1.compat.octets import int2oct, str2octs, null from pyasn1.type import univ from pyasn1.type import useful class BooleanEncoder(encoder.IntegerEncoder): def encodeValue(self, encodeFun, client, defMode, maxChunkSize): if...
chuntielin/Blog_Yeoman_Fullstack
refs/heads/master
node_modules/node-gyp/gyp/tools/graphviz.py
2679
#!/usr/bin/env python # Copyright (c) 2011 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Using the JSON dumped by the dump-dependency-json generator, generate input suitable for graphviz to render a dependency graph of targets...
Dhivyap/ansible
refs/heads/devel
lib/ansible/modules/cloud/amazon/iam_password_policy.py
7
#!/usr/bin/python # Copyright: (c) 2018, Aaron Smith <[email protected]> # 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', ...
yahman72/robotframework
refs/heads/master
src/robot/htmldata/htmlfilewriter.py
27
# Copyright 2008-2015 Nokia Solutions and Networks # # 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...
cbrunet/fibermodes
refs/heads/master
tests/fiber/material/test_sio2geo2.py
2
# This file is part of FiberModes. # # FiberModes 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. # # FiberModes is distributed in the ...
krkhan/azure-linux-extensions
refs/heads/dev
RDMAUpdate/main/patch/SuSEPatching.py
13
#!/usr/bin/python # # Copyright 2015 Microsoft Corporation # # 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...
maelnor/nova
refs/heads/master
nova/api/openstack/compute/plugins/v3/hosts.py
15
# Copyright (c) 2011 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 ...
mlperf/inference_results_v0.7
refs/heads/master
closed/Nettrix/code/rnnt/tensorrt/preprocessing/convert_rnnt_data.py
12
# Copyright (c) 2020, NVIDIA 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 by ...
ventilooo/nit
refs/heads/master
contrib/neo_doxygen/tests/python-def/src/foo.py
16
# This file is part of NIT ( http://www.nitlanguage.org ). # # 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...
gnufede/results
refs/heads/master
results/goals/urls.py
1
from django.conf.urls import patterns, url urlpatterns = patterns('goals.views', url(r'^users/me$', 'myself'), url(r'^categories$', 'category_list'), url(r'^wins$', 'win_list'), url(r'^wins/(?P<pk>[0-9]+)$', 'win_detail'), url(r'^wins/tag/$', 'win_tag'), url(r'^goals$', 'goal_list'), url(r'...
scalable-networks/ext
refs/heads/master
gnuradio-3.7.0.1/gnuradio-runtime/python/gnuradio/gru/os_read_exactly.py
78
# # Copyright 2005 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 option) # any later version. # #...
chrish42/pylearn
refs/heads/master
pylearn2/packaged_dependencies/theano_linear/unshared_conv/test_unshared_conv.py
44
import unittest import numpy import theano from theano.tests.unittest_tools import verify_grad from .unshared_conv import FilterActs from .unshared_conv import WeightActs from .unshared_conv import ImgActs def rand(shp, dtype): return numpy.random.rand(*shp).astype(dtype) def assert_linear(f, pt, mode=None): ...
demonchild2112/travis-test
refs/heads/master
grr/client/grr_response_client/client_actions/file_fingerprint.py
2
#!/usr/bin/env python """Action to fingerprint files on the client.""" from __future__ import absolute_import from __future__ import division from __future__ import unicode_literals import hashlib from grr_response_client import vfs from grr_response_client.client_actions import standard from grr_response_core.lib im...
ProjectSWGCore/NGECore2
refs/heads/master
scripts/mobiles/dynamicgroups/tatooine_desert_demon.py
2
# Spawn Group file created with PSWG Planetary Spawn Tool import sys from java.util import Vector from services.spawn import DynamicSpawnGroup from services.spawn import MobileTemplate def addDynamicGroup(core): dynamicGroup = DynamicSpawnGroup() mobileTemplates = Vector() mobileTemplates.add('desert_demon') mobil...
Samuel-Ferreira/django-pizza
refs/heads/master
pizzaria/pizza/views.py
1
from django.http import HttpResponse from django.shortcuts import render from .models import Pizza def menu(request): #import ipdb; ipdb.set_trace() pizzas = Pizza.objects.all() context = {'pizzas': pizzas} return render(request, 'pizza/menu.html', context)
aYukiSekiguchi/ACCESS-Chromium
refs/heads/master
third_party/libxml/src/regressions.py
360
#!/usr/bin/python -u import glob, os, string, sys, thread, time # import difflib import libxml2 ### # # This is a "Work in Progress" attempt at a python script to run the # various regression tests. The rationale for this is that it should be # possible to run this on most major platforms, including those (such as # ...
sankha93/servo
refs/heads/master
python/servo/devenv_commands.py
5
# Copyright 2013 The Servo Project Developers. See the COPYRIGHT # file at the top-level directory of this distribution. # # Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or # http://www.apache.org/licenses/LICENSE-2.0> or the MIT license # <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your #...
yousseb/django_pytds
refs/heads/master
tests/mssql_regress/tests.py
1
from __future__ import absolute_import from django.core.exceptions import ImproperlyConfigured from django.db import connection from django.test import TestCase from .models import AutoPkPlusOne, PkPlusOne, TextPkPlusOne class ConnectionStringTestCase(TestCase): def assertInString(self, conn_string, pattern): ...
titienmiami/mmc.repository
refs/heads/master
plugin.video.SportsDevil/lib/utils/github/Tag.py
7
# -*- coding: utf-8 -*- # Copyright 2012 Vincent Jacques # [email protected] # This file is part of PyGithub. http://vincent-jacques.net/PyGithub # PyGithub 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 Softwar...
usc-isi/horizon-old
refs/heads/hpc-horizon
horizon/horizon/dashboards/nova/containers/urls.py
1
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2011 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Copyright 2011 Nebula, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # no...
bigbadhacker/google-diff-match-patch
refs/heads/master
python2/diff_match_patch_test.py
319
#!/usr/bin/python2.4 """Test harness for diff_match_patch.py Copyright 2006 Google Inc. http://code.google.com/p/google-diff-match-patch/ 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://...
matthiasdiener/spack
refs/heads/develop
var/spack/repos/builtin/packages/ftgl/package.py
2
############################################################################## # Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, [email protected], All rights reserved. # LLNL-CODE-64...
artdent/mingus-python3
refs/heads/python3
unittest/test_notes.py
2
#!/usr/bin/python # -*- coding: utf-8 -*- import sys sys.path = ['../'] + sys.path import mingus.core.notes as notes from mingus.core.mt_exceptions import RangeError import unittest class test_notes(unittest.TestCase): def setUp(self): self.base_notes = [ 'C', 'D', 'E'...
shaunbrady/boto
refs/heads/develop
boto/mashups/server.py
153
# 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...
stackforge/solum-dashboard
refs/heads/master
solumdashboard/languagepacks/views.py
1
# Copyright (c) 2014 Rackspace Hosting. # # 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...
drnextgis/QGIS
refs/heads/master
python/plugins/processing/script/snippets.py
20
##Iterate over the features of a layer. feats = processing.features(layer) n = len(feats) for i, feat in enumerate(feats): progress.setPercentage(int(100 * i / n)) #do something with 'feat' ##Create a new layer from another one, with an extra field fields = processing.fields(layer) # int, float and bool can be...
ammarkhann/FinalSeniorCode
refs/heads/master
lib/python2.7/site-packages/IPython/utils/tests/test_tokenutil.py
15
"""Tests for tokenutil""" # Copyright (c) IPython Development Team. # Distributed under the terms of the Modified BSD License. import nose.tools as nt from IPython.utils.tokenutil import token_at_cursor, line_at_cursor def expect_token(expected, cell, cursor_pos): token = token_at_cursor(cell, cursor_pos) of...