repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
futurecolors/django-httplog | refs/heads/master | httplog/utils.py | 3 | # coding: utf-8
import json
import itertools
from django.core.exceptions import ValidationError
from django.core.validators import validate_ipv46_address
from django.utils.encoding import force_text
def pretty_data(request):
if request.META.get('CONTENT_TYPE', None) == 'application/json':
# json encoded ... |
blacklin/kbengine | refs/heads/master | kbe/src/lib/python/Tools/scripts/fixps.py | 112 | #!/usr/bin/env python3
# Fix Python script(s) to reference the interpreter via /usr/bin/env python.
# Warning: this overwrites the file without making a backup.
import sys
import re
def main():
for filename in sys.argv[1:]:
try:
f = open(filename, 'r')
except IOError as msg:
... |
adereis/avocado | refs/heads/master | selftests/functional/test_replay_failfast.py | 2 | #!/usr/bin/env python
import glob
import os
import sys
import tempfile
import shutil
if sys.version_info[:2] == (2, 6):
import unittest2 as unittest
else:
import unittest
from avocado.core import exit_codes
from avocado.utils import process
basedir = os.path.join(os.path.dirname(os.path.abspath(__file__)),... |
tanayseven/Voix | refs/heads/master | flask/lib/python2.7/site-packages/whoosh/support/relativedelta.py | 116 | """
Copyright (c) 2003-2010 Gustavo Niemeyer <gustavo@niemeyer.net>
This module offers extensions to the standard python 2.3+
datetime module.
"""
__author__ = "Gustavo Niemeyer <gustavo@niemeyer.net>"
__license__ = "PSF License"
import datetime
import calendar
__all__ = ["relativedelta", "MO", "TU", "WE", "TH", "F... |
dashea/pykickstart | refs/heads/master | pykickstart/handlers/f18.py | 9 | #
# Vratislav Podzimek <vpodzime@redhat.com>
#
# Copyright 2012 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use, modify,
# copy, or redistribute it subject to the terms and conditions of the GNU
# General Public License v.2. This program is distributed in the hope that it
# will ... |
eemirtekin/edx-platform | refs/heads/master | common/lib/xmodule/xmodule/tests/test_imageannotation.py | 92 | # -*- coding: utf-8 -*-
"""Test for Image Annotation Xmodule functional logic."""
import unittest
from mock import Mock
from lxml import etree
from xblock.field_data import DictFieldData
from xblock.fields import ScopeIds
from xmodule.imageannotation_module import ImageAnnotationModule
from . import get_test_system... |
philoniare/horizon | refs/heads/master | openstack_dashboard/enabled/_1920_project_containers_panel.py | 27 | # The slug of the panel to be added to HORIZON_CONFIG. Required.
PANEL = 'containers'
# The slug of the dashboard the PANEL associated with. Required.
PANEL_DASHBOARD = 'project'
# The slug of the panel group the PANEL is associated with.
PANEL_GROUP = 'object_store'
# Python panel class of the PANEL to be added.
ADD_... |
Varentsov/servo | refs/heads/master | tests/wpt/web-platform-tests/css/tools/w3ctestlib/__init__.py | 80 |
__all__ = ['Sources', 'Groups', 'Indexer', 'Suite', 'OutputFormats', 'HTMLSerializer'] |
GrandPrime/android_kernel_samsung_msm8916-caf | refs/heads/cm-12.1 | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Core.py | 11088 | # Core.py - Python extension for perf script, core functions
#
# 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.
from collections import defaultdict
def aut... |
rbiswas4/ObsCond | refs/heads/master | tests/test_bandpasses.py | 1 | from obscond import AirmassDependentBandpass
from lsst.sims.photUtils import BandpassDict
from numpy.testing import assert_allclose
def test_airmassdep_bandpass_shape():
adb = AirmassDependentBandpass.fromThroughputs()
bp = adb.bandpassForAirmass(bandname='r', airmass=1.2)
num = len(bp.wavelen)
assert... |
MarconiMediaGroup/JobTrak | refs/heads/master | web/code/mmg/jobtrak/help/__init__.py | 1 | default_app_config = 'mmg.jobtrak.help.apps.LocalConfig' |
lmazuel/azure-sdk-for-python | refs/heads/master | azure-cognitiveservices-vision-face/azure/cognitiveservices/vision/face/models/accessory.py | 2 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... |
ravsa/python-for-android | refs/heads/master | src/buildlib/markupsafe/_native.py | 1243 | # -*- coding: utf-8 -*-
"""
markupsafe._native
~~~~~~~~~~~~~~~~~~
Native Python implementation the C module is not compiled.
:copyright: (c) 2010 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
from markupsafe import Markup
from markupsafe._compat import text_type
def escape(... |
JiaminXuan/leetcode-python | refs/heads/master | combinations/solution.py | 5 | class Solution:
# @return a list of lists of integers
def combine(self, n, k):
a = range(1, n + 1)
return self.combine_aux(a, k)
def combine_aux(self, a, k):
if k == 0:
return [[]]
else:
res = []
for i, e in enumerate(a):
r... |
fujita/ryu | refs/heads/master | ryu/tests/unit/lib/test_mrtlib.py | 4 | # Copyright (C) 2016 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... |
plxaye/chromium | refs/heads/master | src/third_party/protobuf/python/google/__init__.py | 13048 | __import__('pkg_resources').declare_namespace(__name__)
|
da1z/intellij-community | refs/heads/master | python/testData/completion/isInstance.after.py | 83 | class Foo:
def xyzzy(self): pass
def x(p):
if isinstance(p, Foo):
p.xyzzy()
|
seijim/cloud-robotics-azure-platform-v1-sdk | refs/heads/master | CloudRoboticsApi/ClientCode_Pepper/JBS/PepperCode1/lib/cloudrobotics/message.py | 4 | # -*- coding: utf-8 -*-
#
# Cloud Robotics FX メッセージ
#
# @author: Hiroki Wakabayashi <hiroki.wakabayashi@jbs.com>
# @version: 0.0.1
import json
import datetime
ROUTING_TYPE_D2D = 'D2D';
ROUTING_TYPE_LOG = 'LOG';
ROUTING_TYPE_CALL = 'CALL';
API_APP_ID = 'SbrApiServices';
class CRFXMessage(object):
def __init__(se... |
metadirective/GPicSync | refs/heads/master | src/gpx.py | 1 | #!/usr/bin/python
###############################################################################
# (c) francois.schnell francois.schnell@gmail.com
# http://francois.schnell.free.fr
#
# This script is released under the GPL v2 license
#
########################################################... |
tundebabzy/frappe | refs/heads/develop | frappe/website/doctype/web_form_field/web_form_field.py | 73 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class WebFormField(Document):
pass
|
mitocw/edx-platform | refs/heads/master | openedx/core/djangoapps/password_policy/apps.py | 4 | """
Configuration for password_policy Django app
"""
import logging
import six
from dateutil.parser import parse as parse_date
from django.apps import AppConfig
from django.conf import settings
from django.utils.translation import ugettext_lazy as _
from openedx.core.djangoapps.plugins.constants import PluginSettings... |
EasonYi/zulip | refs/heads/master | confirmation/migrations/0001_initial.py | 167 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('contenttypes', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='Confirmation',
fields... |
destruct0r/ainol_aurora_2_kernel | refs/heads/master | tools/perf/scripts/python/futex-contention.py | 11261 | # futex contention
# (c) 2010, Arnaldo Carvalho de Melo <acme@redhat.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Translation of:
#
# http://sourceware.org/systemtap/wiki/WSFutexContention
#
# to perf python scripting.
#
# Measures futex contention
import os, sys
sys.path.append(os.environ['PER... |
janslow/boto | refs/heads/develop | boto/auth_handler.py | 150 | # 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... |
Zlash65/erpnext | refs/heads/develop | erpnext/patches/v9_2/set_item_name_in_production_order.py | 11 | from __future__ import unicode_literals
import frappe
def execute():
frappe.db.sql("""
update `tabBOM Item` bom, `tabWork Order Item` po_item
set po_item.item_name = bom.item_name,
po_item.description = bom.description
where po_item.item_code = bom.item_code
and (po_item.item_name is null or po_item.desc... |
fentas/phantomjs | refs/heads/master | src/qt/qtwebkit/Tools/Scripts/webkitpy/style/error_handlers.py | 178 | # Copyright (C) 2010 Chris Jerdonek (cjerdonek@webkit.org)
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and... |
sestrella/ansible | refs/heads/devel | lib/ansible/plugins/become/machinectl.py | 26 | # -*- coding: utf-8 -*-
# Copyright: (c) 2018, Ansible Project
# 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
DOCUMENTATION = """
become: machinectl
short_description: Systemd's... |
mezz64/home-assistant | refs/heads/dev | tests/components/risco/test_alarm_control_panel.py | 7 | """Tests for the Risco alarm control panel device."""
import pytest
from homeassistant.components.alarm_control_panel import DOMAIN as ALARM_DOMAIN
from homeassistant.components.alarm_control_panel.const import (
SUPPORT_ALARM_ARM_AWAY,
SUPPORT_ALARM_ARM_CUSTOM_BYPASS,
SUPPORT_ALARM_ARM_HOME,
SUPPORT_A... |
mglukhikh/intellij-community | refs/heads/master | python/testData/quickFixes/PyAddMethodQuickFixTest/addInitAfterDocstring.py | 83 | __author__ = 'ktisha'
class <caret>A:
""" class docstring"""
def foo(self):
self.b = 1
|
sdlBasic/sdlbrt | refs/heads/master | win32/mingw/opt/lib/python2.7/unittest/test/test_break.py | 106 | import gc
import os
import sys
import signal
import weakref
from cStringIO import StringIO
import unittest
@unittest.skipUnless(hasattr(os, 'kill'), "Test requires os.kill")
@unittest.skipIf(sys.platform =="win32", "Test cannot run on Windows")
@unittest.skipIf(sys.platform == 'freebsd6', "Test kills regrtest on f... |
overcastcloud/suds-jurko | refs/heads/master | suds/xsd/sxbase.py | 7 | # This program is free software; you can redistribute it and/or modify it under
# the terms of the (LGPL) GNU Lesser General Public License as published by the
# Free Software Foundation; either version 3 of the License, or (at your
# option) any later version.
#
# This program is distributed in the hope that it will b... |
commshare/APE_Server | refs/heads/master | deps/js/src/metrics/gc/gc-test.py | 8 | # Works with python2.6
import datetime, os, re, sys, traceback
import math, string, copy
import subprocess
from subprocess import *
from operator import itemgetter
class Test:
def __init__(self, path, name):
self.path = path
self.name = name
@classmethod
def from_file(cls, path, name, opt... |
JulienPalard/wicd | refs/heads/master | gtk/prefs.py | 1 | #!/usr/bin/python
""" prefs -- Wicd Preferences Dialog.
Displays the main settings dialog window for wicd and
handles recieving/sendings the settings from/to the daemon.
"""
#
# Copyright (C) 2008-2009 Adam Blackburn
# Copyright (C) 2008-2009 Dan O'Reilly
#
# This program is free software; you can redistribut... |
maftieu/CouchPotatoServer | refs/heads/master | libs/apscheduler/jobstores/mongodb_store.py | 132 | """
Stores jobs in a MongoDB database.
"""
import logging
from apscheduler.jobstores.base import JobStore
from apscheduler.job import Job
try:
import cPickle as pickle
except ImportError: # pragma: nocover
import pickle
try:
from bson.binary import Binary
from pymongo.connection import Connection
ex... |
numerigraphe/sale-workflow | refs/heads/8.0 | sale_exception_nostock/__openerp__.py | 18 | # -*- coding: utf-8 -*-
#
#
# Author: Nicolas Bessi, Yannick Vaucher, Leonardo Pistone
# Copyright 2014 Camptocamp SA
#
# 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, eith... |
Angelinas1/script.skin.helper.service | refs/heads/master | resources/lib/ConditionalBackgrounds.py | 2 | from xml.dom.minidom import parse
from operator import itemgetter
from Utils import *
cachePath = os.path.join(ADDON_DATA_PATH,"conditionalbackgrounds.json")
dateFormat = "%Y-%m-%d"
class ConditionalBackgrounds(xbmcgui.WindowXMLDialog):
backgroundsList = None
allBackgrounds = []
def __init__(self, *... |
rschnapka/bank-payment | refs/heads/7.0 | account_banking/parsers/models.py | 1 | # -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2009 EduSense BV (<http://www.edusense.nl>).
# All Rights Reserved
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public... |
rabipanda/tensorflow | refs/heads/master | tensorflow/python/tools/strip_unused_lib.py | 104 | # pylint: disable=g-bad-file-header
# 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/LICENS... |
anandpdoshi/erpnext | refs/heads/develop | erpnext/controllers/queries.py | 1 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.desk.reportview import get_match_cond
from frappe.model.db_query import DatabaseQuery
from frappe.utils import nowdate
def ge... |
kool79/intellij-community | refs/heads/master | python/lib/Lib/site-packages/django/utils/log.py | 71 | import logging
import sys
from django.core import mail
# Make sure a NullHandler is available
# This was added in Python 2.7/3.2
try:
from logging import NullHandler
except ImportError:
class NullHandler(logging.Handler):
def emit(self, record):
pass
# Make sure that dictConfig is availabl... |
hujiajie/chromium-crosswalk | refs/heads/master | third_party/cython/src/Cython/Build/BuildExecutable.py | 98 | """
Compile a Python script into an executable that embeds CPython and run it.
Requires CPython to be built as a shared library ('libpythonX.Y').
Basic usage:
python cythonrun somefile.py [ARGS]
"""
DEBUG = True
import sys
import os
from distutils import sysconfig
def get_config_var(name, default=''):
retu... |
wweiradio/django | refs/heads/master | django/contrib/auth/apps.py | 472 | from django.apps import AppConfig
from django.contrib.auth.checks import check_user_model
from django.core import checks
from django.db.models.signals import post_migrate
from django.utils.translation import ugettext_lazy as _
from .management import create_permissions
class AuthConfig(AppConfig):
name = 'django... |
Venturi/cms | refs/heads/master | env/lib/python2.7/site-packages/django_select2/templatetags/django_select2_tags.py | 13 | # -*- coding:utf-8 -*-
from __future__ import absolute_import, unicode_literals
from django import template
from django_select2.media import (get_select2_css_libs,
get_select2_heavy_js_libs,
get_select2_js_libs)
register = template.Library()
def l... |
farhaanbukhsh/sympy | refs/heads/master | sympy/physics/quantum/tests/test_qasm.py | 121 | from sympy.physics.quantum.qasm import Qasm, prod, flip_index, trim,\
get_index, nonblank, fullsplit, fixcommand, stripquotes, read_qasm
from sympy.physics.quantum.gate import X, Z, H, S, T
from sympy.physics.quantum.gate import CNOT, SWAP, CPHASE, CGate, CGateS
from sympy.physics.quantum.circuitplot import Mz, Cr... |
chokribr/inveniocnudst | refs/heads/master | modules/bibrank/lib/bibrank_selfcites_searcher.py | 12 | # -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2013 CERN.
##
## Invenio 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) a... |
andyraib/data-storage | refs/heads/master | python_scripts/env/lib/python3.6/site-packages/numpy/matrixlib/tests/test_numeric.py | 167 | from __future__ import division, absolute_import, print_function
import numpy as np
from numpy.testing import assert_equal, TestCase, run_module_suite
class TestDot(TestCase):
def test_matscalar(self):
b1 = np.matrix(np.ones((3, 3), dtype=complex))
assert_equal(b1*1.0, b1)
def test_diagonal():
... |
michaelarnauts/home-assistant | refs/heads/master | homeassistant/remote.py | 13 | """
homeassistant.remote
~~~~~~~~~~~~~~~~~~~~
A module containing drop in replacements for core parts that will interface
with a remote instance of home assistant.
If a connection error occurs while communicating with the API a
HomeAssistantError will be raised.
"""
import threading
import logging
import json
import... |
mahendra-r/edx-platform | refs/heads/master | common/test/acceptance/tests/studio/test_studio_container.py | 55 | """
Acceptance tests for Studio related to the container page.
The container page is used both for displaying units, and
for displaying containers within units.
"""
from nose.plugins.attrib import attr
from unittest import skip
from ...fixtures.course import XBlockFixtureDesc
from ...pages.studio.component_editor impo... |
hovsepm/AutoRest | refs/heads/master | src/generator/AutoRest.Python.Azure.Tests/Expected/AcceptanceTests/AzureBodyDuration/autorestdurationtestservice/version.py | 1003 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... |
ifduyue/sentry | refs/heads/master | src/social_auth/fields.py | 4 | from __future__ import absolute_import
import simplejson
import six
from django.core.exceptions import ValidationError
from django.db import models
from django.utils.encoding import smart_text
@six.add_metaclass(models.SubfieldBase)
class JSONField(models.TextField):
"""Simple JSON field that stores python stru... |
Shao-Feng/crosswalk-test-suite | refs/heads/master | webapi/webapi-simd-nonw3c-tests/inst.apk.py | 1996 | #!/usr/bin/env python
import os
import shutil
import glob
import time
import sys
import subprocess
from optparse import OptionParser, make_option
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
PARAMETERS = None
ADB_CMD = "adb"
def doCMD(cmd):
# Do not need handle timeout in this short script, let tool... |
vrsource/mapproxy | refs/heads/master | mapproxy/test/system/test_util_wms_capabilities.py | 2 | # This file is part of the MapProxy project.
# Copyright (C) 2010 Omniscale <http://omniscale.de>
#
# 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... |
xwolf12/django | refs/heads/master | tests/migrations/test_loader.py | 165 | from __future__ import unicode_literals
from unittest import skipIf
from django.db import connection, connections
from django.db.migrations.exceptions import AmbiguityError, NodeNotFoundError
from django.db.migrations.loader import MigrationLoader
from django.db.migrations.recorder import MigrationRecorder
from djang... |
cartertech/odoo-hr-ng | refs/heads/master | hr_labour_union/hr.py | 1 | #-*- coding:utf-8 -*-
##############################################################################
#
# Copyright (C) 2015 One Click Software (http://oneclick.solutions)
# and Copyright (C) 2013 Michael Telahun Makonnen <mmakonnen@gmail.com>.
# All Rights Reserved.
#
# This program is free software: you ca... |
Argon-Zhou/django | refs/heads/master | tests/resolve_url/tests.py | 199 | from __future__ import unicode_literals
from django.contrib.auth.views import logout
from django.core.urlresolvers import NoReverseMatch, reverse_lazy
from django.shortcuts import resolve_url
from django.test import SimpleTestCase, ignore_warnings, override_settings
from django.utils import six
from django.utils.depre... |
ewerybody/a2 | refs/heads/master | ui/a2qt/QtNetwork.py | 1 | """
a2qt Qt for Python wrapper.
"""
import a2qt
if a2qt.QT_VERSION == 6:
from PySide6.QtNetwork import *
else:
from PySide2.QtNetwork import *
|
lokeshjindal15/gem5_transform | refs/heads/master | ext/ply/test/yacc_error3.py | 174 | # -----------------------------------------------------------------------------
# yacc_error3.py
#
# Bad p_error() function
# -----------------------------------------------------------------------------
import sys
if ".." not in sys.path: sys.path.insert(0,"..")
import ply.yacc as yacc
from calclex import tokens
# ... |
zerok/pyconde-website-mirror | refs/heads/develop | pyconde/reviews/migrations/0001_initial.py | 2 | # 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 model 'ProposalMetaData'
db.create_table('reviews_proposalmetadata', (
('id', self.gf... |
google/sagetv | refs/heads/master | third_party/codecs/xvidcore/src/dct/ia64_asm/genidct.py | 43 | #! /usr/bin/python
# generate the linzer-feig multiply-add idct for ia64
# (c) 2002 Christian Schwarz <schwarz@ira.uka.de>,
# Haiko Gaisser <haiko@gaisser.de>,
# Sebastian Hack <mail@s-hack.de>
import math
pre_shuffle = [ 0, 4, 2, 6, 1, 7, 3, 5 ]
post_shuffle = [ 0, 1, 6, 3, 7, 2, 5, 4 ]
constant... |
DanielArnett/vimba-mjpeg | refs/heads/master | pymba/__init__.py | 2 | # -*- coding: utf-8 -*-
from vimba import Vimba
from vimbaexception import VimbaException
|
CottageLabs/OpenArticleGauge | refs/heads/dev | openarticlegauge/tests/plugins/test_workflow/test_08/test_08.py | 2 | from openarticlegauge import plugin, models
class mock_doi_type(plugin.Plugin):
_short_name="mock_doi"
def capabilities(self):
return {
"type_detect_verify" : True,
"canonicalise" : [],
"detect_provider" : [],
"license_detect" : False
}
def ty... |
berny6969/enigma2 | refs/heads/master | lib/python/Screens/NetworkSetup.py | 4 | from Screens.Screen import Screen
from Screens.MessageBox import MessageBox
from Screens.InputBox import InputBox
from Screens.Standby import *
from Screens.VirtualKeyBoard import VirtualKeyBoard
from Screens.HelpMenu import HelpableScreen
from Components.Network import iNetwork
from Components.Sources.StaticText impor... |
razrqcom-dev-team/android_kernel_motorola_msm8960dt-common | refs/heads/cm-11.0 | tools/perf/scripts/python/check-perf-trace.py | 11214 | # perf script event handlers, generated by perf script -g python
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# This script tests basic functionality such as flag and symbol
# strings, common_xxx() calls back into perf, begin, end, unhandled
# events, etc. ... |
hychrisli/PyAlgorithms | refs/heads/master | src/basics/merge_sort.py | 1 |
class MergeSort:
def __init__(self, lst):
self.lst = lst
def sort(self):
self.merge_sort(0, len(self.lst) - 1)
def merge_sort(self, i, j):
if i < j:
mid = (i+j) / 2
self.merge_sort(i, mid)
self.merge_sort(mid+1, j)
self.merge(i, ... |
efargas/doxygen | refs/heads/master | doc/translator.py | 14 | """Script to generate reports on translator classes from Doxygen sources.
The main purpose of the script is to extract the information from sources
related to internationalization (the translator classes). It uses the
information to generate documentation (language.doc,
translator_report.txt) from templat... |
ProjectSWGCore/NGECore2 | refs/heads/master | scripts/object/draft_schematic/armor/armor_appearance_ithorian_guardian_chest.py | 85615 | import sys
def setup(core, object):
return |
ProjectSWGCore/NGECore2 | refs/heads/master | scripts/object/draft_schematic/armor/armor_appearance_rebel_battle_bracer_l_gcw.py | 85615 | import sys
def setup(core, object):
return |
ProjectSWGCore/NGECore2 | refs/heads/master | scripts/object/mobile/azure_cabal_mystril_assault_02.py | 85615 | import sys
def setup(core, object):
return |
pabigot/pyxb | refs/heads/next | doc/conf.py | 1 | # -*- coding: utf-8 -*-
#
# PyXB documentation build configuration file, created by
# sphinx-quickstart on Tue May 19 03:28:52 2009.
#
# 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 co... |
jmesteve/openerp | refs/heads/master | openerp/cli/server.py | 20 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... |
nephila/cmsplugin-filer | refs/heads/develop | cmsplugin_filer_link/models.py | 1 | from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.conf import settings
from cms.models import CMSPlugin
from cms.models.fields import PageField
from filer.fields.file import FilerFileField
from filer.utils.compatibility import python_2_unicode_compatible
DEFULT_LINK_STYLE... |
letsencrypt/letsencrypt | refs/heads/master | certbot/client.py | 1 | """Certbot client API."""
import datetime
import logging
import os
import platform
import OpenSSL
import josepy as jose
import zope.component
from cryptography.hazmat.backends import default_backend
# https://github.com/python/typeshed/blob/master/third_party/
# 2/cryptography/hazmat/primitives/asymmetric/rsa.pyi
from... |
colinnewell/odoo | refs/heads/8.0 | addons/base_import_module/__init__.py | 3964 | import controllers
import models
|
praekelt/sideloader2 | refs/heads/develop | sideloader.build/sideloader/build/cli.py | 1 | import click
from sideloader import Sideloader
@click.command()
@click.argument('git-url')
@click.option('--branch', help='Git branch')
@click.option('--build', help='Build version', default=0)
@click.option('--id', help='Workspace ID')
@click.option('--deploy-file', help='Deploy YAML file', default='.deploy.yaml')
... |
bikale/support-tools | refs/heads/master | googlecode-issues-exporter/bitbucket_issue_converter.py | 51 | # 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 a... |
garbled1/ansible | refs/heads/devel | lib/ansible/modules/cloud/vmware/vmware_target_canonical_facts.py | 47 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2015, Joseph Callen <jcallen () csc.com>
# 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',
... |
holmes/intellij-community | refs/heads/master | python/lib/Lib/site-packages/django/contrib/gis/tests/urls.py | 121 | from django.conf.urls.defaults import *
urlpatterns = patterns('',
(r'^geoapp/', include('django.contrib.gis.tests.geoapp.urls')),
)
|
storytellers/zerorpc-python | refs/heads/master | tests/test_middleware_client.py | 102 | # -*- coding: utf-8 -*-
# Open Source Initiative OSI - The MIT License (MIT):Licensing
#
# The MIT License (MIT)
# Copyright (c) 2012 DotCloud Inc (opensource@dotcloud.com)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Softwa... |
belltailjp/scikit-learn | refs/heads/master | sklearn/metrics/__init__.py | 52 | """
The :mod:`sklearn.metrics` module includes score functions, performance metrics
and pairwise metrics and distance computations.
"""
from .ranking import auc
from .ranking import average_precision_score
from .ranking import coverage_error
from .ranking import label_ranking_average_precision_score
from .ranking imp... |
djgoku/box-python-sdk | refs/heads/master | docs/source/conf.py | 8 | # -*- coding: utf-8 -*-
#
# boxsdk documentation build configuration file, created by
# sphinx-quickstart on Tue Dec 16 01:10:30 2014.
#
# 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.
#
# Al... |
koobs/Cactus | refs/heads/master | cactus/utils/packaging.py | 9 | import posixpath
import pkg_resources
def pkg_walk(package, top):
"""
Walk the package resources. Implementation from os.walk.
"""
names = pkg_resources.resource_listdir(package, top)
dirs, nondirs = [], []
for name in names:
# Forward slashes with pkg_resources
if pkg_resou... |
tweemeterjop/thug | refs/heads/master | thug/DOM/Console.py | 1 | #!/usr/bin/env python
#
# Console.py
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; w... |
KohlsTechnology/ansible | refs/heads/devel | lib/ansible/modules/network/nxos/nxos_udld.py | 16 | #!/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... |
casanovainformationservices/LazyLibrarian | refs/heads/master | cherrypy/test/test_iterator.py | 7 | import six
import cherrypy
class IteratorBase(object):
created = 0
datachunk = 'butternut squash' * 256
@classmethod
def incr(cls):
cls.created += 1
@classmethod
def decr(cls):
cls.created -= 1
class OurGenerator(IteratorBase):
def __iter__(self):
self.incr()
... |
UNR-AERIAL/scikit-learn | refs/heads/master | sklearn/cluster/spectral.py | 233 | # -*- coding: utf-8 -*-
"""Algorithms for spectral clustering"""
# Author: Gael Varoquaux gael.varoquaux@normalesup.org
# Brian Cheung
# Wei LI <kuantkid@gmail.com>
# License: BSD 3 clause
import warnings
import numpy as np
from ..base import BaseEstimator, ClusterMixin
from ..utils import check_rand... |
vipulroxx/kivy | refs/heads/master | kivy/uix/__init__.py | 52 | '''
Widgets
=======
Widgets are elements of a graphical user interface that form part of the
`User Experience <http://en.wikipedia.org/wiki/User_experience>`_.
The `kivy.uix` module contains classes for creating and managing Widgets.
Please refer to the :doc:`api-kivy.uix.widget` documentation for further
information.... |
eResearchSA/dynamiccluster | refs/heads/master | dynamiccluster/utilities.py | 1 | """
Utility methods
"""
import logging
import sys
import random
import string
import socket
import datetime
def getLogger(name):
"""Get logging.Logger instance with logger name convention
"""
if "." in name:
name = "dynamiccluster.%s" % name.rpartition(".")[-1]
return logging.getLogger(name)
d... |
valintinr/opennode-management | refs/heads/master | opennode/__init__.py | 5 | """
OpenNode top level module.
"""
__import__('pkg_resources').declare_namespace(__name__)
|
cornell-cs5220-f15/management | refs/heads/master | github_scripts.py | 1 | from github import Github, UnknownObjectException
import getpass
import yaml
import smtplib
import sys
###
# Scripts for interacting with Github programmatically.
#
# This relies on the PyGithub module, with can be installed with
# easy_install PyGithub
# or
# pip install PyGithub
#
# Source: http://jacquev6.net/PyGit... |
sheep0x/py-intro-for-gconeice | refs/heads/master | datagen.py | 1 | #! /usr/bin/env python
# encoding: UTF-8
# To the extent possible under law, Chen Ruichao has waived all copyright and
# related or neighboring rights to this work.
from random import randint
# N 为 1~100 之间的随机整数
T = randint(1, 50000)
print T
# i 取 0, 1, 2, ..., T-1
for i in range(T):
print randint(1, 2**23-1)
|
2ndQuadrant/ansible | refs/heads/master | lib/ansible/modules/network/f5/bigip_ssl_key.py | 38 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright: (c) 2017, F5 Networks Inc.
# GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... |
pydcs/dcs | refs/heads/master | dcs/unittype.py | 1 | import dcs.lua as lua
from dcs.payloads import PayloadDirectories
import re
import sys
from typing import Any, Dict, Optional, Type
class UnitType:
id = None
name = None
class VehicleType(UnitType):
eplrs = False
class ShipType(UnitType):
helicopter_num = 0
plane_num = 0
parking = 0
clas... |
kz26/uchicago-hvz | refs/heads/master | uchicagohvz/users/views.py | 1 | from django.shortcuts import *
from django.contrib.auth import views as auth_views
from django.contrib.auth.decorators import *
from django.contrib.auth.forms import PasswordResetForm
from django.utils.decorators import method_decorator
from django.contrib import messages
from django.shortcuts import render_to_response... |
coldmind/django | refs/heads/master | tests/admin_scripts/management/commands/app_command.py | 531 | from django.core.management.base import AppCommand
class Command(AppCommand):
help = 'Test Application-based commands'
requires_system_checks = False
def handle_app_config(self, app_config, **options):
print('EXECUTE:AppCommand name=%s, options=%s' % (app_config.name, sorted(options.items())))
|
duowing/HTC10 | refs/heads/stock | tools/perf/scripts/python/futex-contention.py | 1997 | # futex contention
# (c) 2010, Arnaldo Carvalho de Melo <acme@redhat.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Translation of:
#
# http://sourceware.org/systemtap/wiki/WSFutexContention
#
# to perf python scripting.
#
# Measures futex contention
import os, sys
sys.path.append(os.environ['PER... |
acsone/server-tools | refs/heads/8.0 | letsencrypt/controllers/main.py | 15 | # -*- coding: utf-8 -*-
# © 2016 Therp BV <http://therp.nl>
# © 2016 Antonio Espinosa <antonio.espinosa@tecnativa.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
import os
from openerp import http
from openerp.http import request
from ..models.letsencrypt import get_challenge_dir
class Letse... |
nicklhy/mxnet | refs/heads/master | tools/caffe_converter/test_converter.py | 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
# "License"); you may not u... |
nuncjo/odoo | refs/heads/8.0 | addons/hr_holidays/report/hr_holidays_report.py | 341 | # -*- 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... |
brokenjacobs/ansible | refs/heads/devel | lib/ansible/modules/network/net_interface.py | 2 | #!/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... |
funkring/fdoo | refs/heads/8.0-fdoo | addons/mrp/stock.py | 25 | # -*- 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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.