repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
jansohn/pyload | refs/heads/stable | module/plugins/hoster/FreeWayMe.py | 3 | # -*- coding: utf-8 -*-
from module.plugins.internal.MultiHoster import MultiHoster, create_getInfo
class FreeWayMe(MultiHoster):
__name__ = "FreeWayMe"
__type__ = "hoster"
__version__ = "0.20"
__status__ = "testing"
__pattern__ = r'https?://(?:www\.)?free-way\.(bz|me)/.+'
__config__... |
loserxc/huhamhire-hosts | refs/heads/master | tui/hostsutil.py | 24 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# hostsutil.py: Start a TUI session of `Hosts Setup Utility`.
#
# Copyleft (C) 2014 - huhamhire <me@huhamhire.com>
# =====================================================================
# Licensed under the GNU General Public License, version 3. You should
# have receiv... |
euphorie/Euphorie | refs/heads/master | src/euphorie/content/tests/test_survey.py | 1 | # coding=utf-8
from ..survey import View
from euphorie.content.module import IModule
from euphorie.content.profilequestion import IProfileQuestion
from euphorie.content.survey import handleSurveyUnpublish
from euphorie.content.survey import Survey
from euphorie.testing import EuphorieIntegrationTestCase
from plone.app.... |
spinellic/Mission-Planner | refs/heads/master | Lib/site-packages/scipy/ndimage/tests/test_ndimage.py | 53 | # Copyright (C) 2003-2005 Peter J. Verveer
#
# 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 the following d... |
RenatoGeh/labprog2 | refs/heads/master | mini-ep3/revdns.py | 1 | class Host:
def __init__(self, domain, header):
self.domain = domain[1:]
self.entries = {}
self.header = header
def add_entry(self, name, ip):
self.entries[int(ip.split('.')[-1])] = name
hosts = []
ignored = False
current = -1
while True:
try:
s = input()
s_ = s
s = s.strip()
spl = s.split()
spl... |
usc-isi/nova | refs/heads/hpc-trunk | nova/tests/console/__init__.py | 210 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 OpenStack LLC.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/... |
dalitun/os_image_factory | refs/heads/master | test-tools/pytesting_os_fe/cloudinit/__init__.py | 3 | import os, paramiko, time
import openstackutils
cwlib = openstackutils.OpenStackUtils()
test_resources = {}
def setup():
global test_resources
start_chrono = int(round(time.time() * 1000))
port= cwlib.create_port_with_sg()
keypair, private_key = cwlib.create_keypair()
floating_ip = cwlib.creat... |
caktus/rapidsms | refs/heads/master | rapidsms/router/db/admin.py | 7 | from django.contrib import admin
from rapidsms.router.db.models import Message, Transmission
class MessageAdmin(admin.ModelAdmin):
search_fields = ('text',)
list_display = ('id', 'date', 'direction', 'text', 'status', 'updated',
'sent', 'delivered')
list_filter = ('direction', 'status'... |
weisongchen/flaskapp | refs/heads/master | venv/lib/python2.7/site-packages/sqlalchemy/dialects/mysql/__init__.py | 32 | # mysql/__init__.py
# Copyright (C) 2005-2017 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
from . import base, mysqldb, oursql, \
pyodbc, zxjdbc, mysqlconnector, pymysql... |
factorlibre/OCB | refs/heads/8.0 | addons/hr_payroll_account/wizard/hr_payroll_payslips_by_employees.py | 337 | # -*- 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... |
mohierf/shinken | refs/heads/master | test/test_parse_logevent.py | 18 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (C) 2014 - Savoir-Faire Linux inc.
#
# This file is part of Shinken.
#
# Shinken 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 version 3 ... |
ccnmtl/lettuce | refs/heads/master | tests/integration/lib/Django-1.2.5/django/conf/locale/tr/formats.py | 80 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
DATE_FORMAT = 'd F Y'
TIME_FORMAT = 'H:i:s'
DATETIME_FORMAT = 'd F Y H:i:s'
YEAR_MONTH_FORMAT = 'F Y'
MONTH_DAY_FORMAT = 'd F'
SHORT_DATE_FORMAT = 'd M Y'
SHORT_DATETIME_FORMAT = 'd M Y H:i:s'
FIRST_DAY_OF_WEEK = 1 # P... |
technologiescollege/s2a_fr | refs/heads/portable | s2a/Python/Lib/test/test_shutil.py | 46 | # Copyright (C) 2003 Python Software Foundation
import unittest
import shutil
import tempfile
import sys
import stat
import os
import os.path
import errno
from os.path import splitdrive
from distutils.spawn import find_executable, spawn
from shutil import (_make_tarball, _make_zipfile, make_archive,
... |
poljeff/odoo | refs/heads/8.0 | openerp/addons/test_impex/models.py | 392 | # -*- coding: utf-8 -*-
from openerp.osv import orm, fields
def selection_fn(obj, cr, uid, context=None):
return list(enumerate(["Corge", "Grault", "Wheee", "Moog"]))
def function_fn(model, cr, uid, ids, field_name, arg, context):
return dict((id, 3) for id in ids)
def function_fn_write(model, cr, uid, id, f... |
DongjunLee/kino-bot | refs/heads/master | kino/skills/fitbit.py | 1 | #!/usr/bin/env python
import fitbit
from hbconfig import Config
from kino.slack.slackbot import SlackerAdapter
from kino.utils.data_handler import DataHandler
class Fitbit:
def __init__(self, slackbot=None):
self.api = fitbit.api.Fitbit(
Config.open_api.fitbit.CLIENT_ID,
Config.... |
philanthropy-u/edx-platform | refs/heads/master | lms/djangoapps/email_marketing/migrations/0010_auto_20180425_0800.py | 13 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.12 on 2018-04-25 12:00
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('email_marketing', '0009_remove_emailmarketingconfiguration_sailthru_activation_template'),
... |
motion2015/a3 | refs/heads/a3 | lms/djangoapps/courseware/features/lti.py | 49 | # pylint: disable=missing-docstring
import datetime
import os
import pytz
from django.conf import settings
from mock import patch
from pytz import UTC
from splinter.exceptions import ElementDoesNotExist
from selenium.common.exceptions import NoAlertPresentException
from nose.tools import assert_true, assert_equal, asse... |
Swall0w/clib | refs/heads/master | tests/utils/test_boolian.py | 1 | import unittest
from clib.utils import randombool
class RandomBoolTest(unittest.TestCase):
def test_randombool(self):
self.assertIsInstance(randombool(), bool)
|
scherroman/mugen | refs/heads/master | mugen/video/sources/VideoSource.py | 1 | import glob as globber
import os
import random
from typing import Union, List, Optional as Opt, NamedTuple, Tuple
from numpy.random import choice
import mugen.utility as util
from mugen import paths
from mugen.constants import TIME_FORMAT
from mugen.utility import convert_time_to_seconds
from mugen.video.segments.Vid... |
KrzysztofCwalina/coreclr | refs/heads/master | tests/scripts/smarty_parser.py | 127 | #!/usr/bin/env python
#
## Licensed to the .NET Foundation under one or more agreements.
## The .NET Foundation licenses this file to you under the MIT license.
## See the LICENSE file in the project root for more information.
#
##
# Title :smarty_parser.py
#
# Notes:
#
# Simple class to parse through the... |
yangming85/lettuce | refs/heads/master | tests/integration/lib/Django-1.3/django/conf/urls/static.py | 156 | import re
from django.conf import settings
from django.conf.urls.defaults import patterns, url
from django.core.exceptions import ImproperlyConfigured
def static(prefix, view='django.views.static.serve', **kwargs):
"""
Helper function to return a URL pattern for serving files in debug mode.
from django.co... |
srajag/contrail-controller | refs/heads/master | src/config/svc-monitor/setup.py | 5 | #
# Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
#
import setuptools, re
def requirements(filename):
with open(filename) as f:
lines = f.read().splitlines()
c = re.compile(r'\s*#.*')
return filter(bool, map(lambda y: c.sub('', y).strip(), lines))
setuptools.setup(
name='svc-... |
xiangel/hue | refs/heads/master | desktop/core/ext-py/python-openid-2.2.5/openid/extensions/sreg.py | 143 | """Simple registration request and response parsing and object representation
This module contains objects representing simple registration requests
and responses that can be used with both OpenID relying parties and
OpenID providers.
1. The relying party creates a request object and adds it to the
C{L{AuthReq... |
tonydebling/pythonExamples | refs/heads/master | Numbers0.py | 1 | # Numbers0.py
#
# Run this program
# Do you get the result that you expect?
# Can you explain why?
print("**** First Example ****")
number1 = input("Enter your first number: ")
number2 = input("Enter your second number: ")
print("Answer = ", number1 + number2)
|
MisterTea/HyperNEAT | refs/heads/master | boost_1_57_0/tools/build/test/using.py | 6 | #!/usr/bin/python
# Copyright (C) Vladimir Prus 2005.
# 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
t = BoostBuild.Tester(use_test_config=False)
t.write("jamroot.jam", "using some_... |
takeshineshiro/nova | refs/heads/master | nova/tests/functional/v3/test_keypairs.py | 3 | # Copyright 2012 Nebula, Inc.
# Copyright 2013 IBM Corp.
#
# 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... |
MatiasBjorling/linux | refs/heads/master | tools/perf/scripts/python/sctop.py | 11180 | # system call top
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Periodically displays system-wide system call totals, broken down by
# syscall. If a [comm] arg is specified, only syscalls called by
# [comm] are displayed. If an [interval] arg is specified,... |
meabsence/python-for-android | refs/heads/master | python-build/python-libs/gdata/tests/gdata_tests/docs_test.py | 89 | #!/usr/bin/python
#
# Copyright (C) 2006 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 ... |
coderb0t/CouchPotatoServer | refs/heads/master | couchpotato/core/media/_base/providers/nzb/newznab.py | 27 | from urlparse import urlparse
import time
import traceback
import re
from couchpotato.core.helpers.encoding import tryUrlencode, toUnicode
from couchpotato.core.helpers.rss import RSS
from couchpotato.core.helpers.variable import cleanHost, splitString, tryInt
from couchpotato.core.logger import CPLog
from couchpotato... |
psfblair/FrameworkBenchmarks | refs/heads/master | frameworks/Python/falcon/app.py | 65 | #!/usr/bin/env python
import json
import falcon
# resource endpoints
class JSONResource(object):
def on_get(self, request, response):
json_data = {'message': "Hello, world!"}
response.body = json.dumps(json_data)
class PlaintextResource(object):
def on_get(self, request, response):
... |
boooka/GeoPowerOff | refs/heads/master | venv/lib/python2.7/site-packages/annoying/middlewares.py | 12 | import re
from django.conf import settings
from django.views.static import serve
from django.shortcuts import redirect
from .exceptions import Redirect
class StaticServe(object):
"""
Django middleware for serving static files instead of using urls.py
"""
regex = re.compile(r'^%s(?P<path>.*)$' % sett... |
Endika/edx-platform | refs/heads/master | lms/djangoapps/course_api/tests/mixins.py | 58 | """
Common mixins for Course API Tests
"""
from datetime import datetime
from student.tests.factories import UserFactory
from xmodule.modulestore.tests.factories import ToyCourseFactory
TEST_PASSWORD = u'edx'
class CourseApiFactoryMixin(object):
"""
Mixin to allow creation of test courses and users.
"... |
carlgao/lenga | refs/heads/master | images/lenny64-peon/usr/share/python-support/python-pygments/pygments/styles/emacs.py | 24 | # -*- coding: utf-8 -*-
"""
pygments.styles.emacs
~~~~~~~~~~~~~~~~~~~~~
A highlighting style for Pygments, inspired by Emacs.
:copyright: 2006-2007 by Georg Brandl.
:license: BSD, see LICENSE for more details.
"""
from pygments.style import Style
from pygments.token import Keyword, Name, Comment,... |
totcoindev/totcoin | refs/heads/master | qa/rpc-tests/receivedby.py | 32 | #!/usr/bin/env python2
# Copyright (c) 2014-2015 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
# Exercise the listreceivedbyaddress API
from test_framework.test_framework import BitcoinTestFramework
... |
sergiohgz/incubator-airflow | refs/heads/master | tests/utils/test_cli_util.py | 15 | # -*- 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
#... |
TNT-Samuel/Coding-Projects | refs/heads/master | DNS Server/Source/Lib/site-packages/urllib3/connectionpool.py | 24 | from __future__ import absolute_import
import errno
import logging
import sys
import warnings
from socket import error as SocketError, timeout as SocketTimeout
import socket
from .exceptions import (
ClosedPoolError,
ProtocolError,
EmptyPoolError,
HeaderParsingError,
HostChangedError,
Locatio... |
TangHao1987/intellij-community | refs/heads/master | python/helpers/pydev/third_party/wrapped_for_pydev/ctypes/macholib/__init__.py | 320 | """
Enough Mach-O to make your head spin.
See the relevant header files in /usr/include/mach-o
And also Apple's documentation.
"""
__version__ = '1.0'
|
indictranstech/buyback-erp | refs/heads/master | erpnext/hr/doctype/designation/test_designation.py | 40 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
import frappe
test_records = frappe.get_test_records('Designation') |
zhengyongbo/phantomjs | refs/heads/master | src/qt/qtwebkit/Tools/Scripts/webkitpy/tool/steps/steps_unittest.py | 121 | # Copyright (C) 2010 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and th... |
chadelofson/vbs2py3 | refs/heads/master | venv/Lib/site-packages/pip/commands/list.py | 84 | from __future__ import absolute_import
import logging
import warnings
from pip.basecommand import Command
from pip.exceptions import DistributionNotFound
from pip.index import PackageFinder
from pip.req import InstallRequirement
from pip.utils import get_installed_distributions, dist_is_editable
from pip.utils.deprec... |
endlessm/chromium-browser | refs/heads/master | tools/perf/core/benchmark_finders.py | 5 | # 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.
import imp
import inspect
import os
import sys
from core import path_util
from core import perf_benchmark
from telemetry import benchmark as benchmark_modul... |
gpapaz/eve-wspace | refs/heads/develop | evewspace/Jabber/models.py | 10 | from django.conf import settings
from Alerts.models import SubscriptionGroup
from django.db import models
# Create your models here.
User = settings.AUTH_USER_MODEL
class JabberSubscription(models.Model):
"""
A registered User / Group combo for jabber.
"""
user = models.ForeignKey(User, related_name=... |
shekkbuilder/scratch | refs/heads/master | graceful_unlisten/client.py | 2 |
import os
import socket
import sys
addr = ('127.1', 6969)
pool_size = 8
def connect_loop(i):
while True:
s = socket.socket()
try:
s.connect(addr)
except socket.error, e:
print '%d: exit due to %s' % (i, e)
return 0
try:
ss = s.recv... |
hoheinzollern/tracker | refs/heads/master | tests/functional-tests/common/utils/applicationstest.py | 3 | #!/usr/bin/env python
#
# Copyright (C) 2010, Nokia <ivan.frade@nokia.com>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later vers... |
radlws/AWS-ElasticBeanstalk-CLI | refs/heads/master | eb/linux/python3/scli/cli_parse.py | 4 | #!/usr/bin/env python
# ==============================================================================
# Copyright 2012 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Amazon Software License (the "License"). You may not use
# this file except in compliance with the License. A copy of th... |
kdeloach/otm-core | refs/heads/develop | opentreemap/treemap/lib/user.py | 3 | # -*- coding: utf-8 -*-
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import division
import urllib
from django.db.models import Q
from treemap.audit import Audit, Authorizable, get_auditable_class
from treemap.models import Instance, MapFeature, InstanceUser, User
fro... |
wsmith323/django | refs/heads/master | tests/migrations/test_graph.py | 99 | import warnings
from django.db.migrations.exceptions import (
CircularDependencyError, NodeNotFoundError,
)
from django.db.migrations.graph import RECURSION_DEPTH_WARNING, MigrationGraph
from django.test import SimpleTestCase
from django.utils.encoding import force_text
class GraphTests(SimpleTestCase):
"""
... |
ashwingoldfish/eddy | refs/heads/master | eddy/core/items/nodes/common/label.py | 2 | # -*- coding: utf-8 -*-
##########################################################################
# #
# Eddy: a graphical editor for the specification of Graphol ontologies #
# Copyright (C) 2015 Daniele Pantaleone <danielepantaleone@me.com> ... |
jjmleiro/hue | refs/heads/master | desktop/core/ext-py/boto-2.38.0/boto/pyami/scriptbase.py | 153 | import os
import sys
from boto.utils import ShellCommand, get_ts
import boto
import boto.utils
class ScriptBase(object):
def __init__(self, config_file=None):
self.instance_id = boto.config.get('Instance', 'instance-id', 'default')
self.name = self.__class__.__name__
self.ts = get_ts()
... |
mjs/juju | refs/heads/master | acceptancetests/assess_mixed_images.py | 2 | #!/usr/bin/env python
"""Assess mixed deployment of images from two sets of simplestreams."""
from __future__ import print_function
import argparse
import logging
import sys
from deploy_stack import (
assess_juju_relations,
BootstrapManager,
)
from jujucharm import (
local_charm_path,
)
from utility impo... |
Y--/root | refs/heads/master | interpreter/llvm/src/tools/clang/tools/scan-build-py/tests/unit/test_compilation.py | 52 | # -*- coding: utf-8 -*-
# The LLVM Compiler Infrastructure
#
# This file is distributed under the University of Illinois Open Source
# License. See LICENSE.TXT for details.
import libscanbuild.compilation as sut
import unittest
class CompilerTest(unittest.TestCase):
def test_is_compiler_call... |
android-legacy/android_kernel_exynos | refs/heads/exybase | tools/perf/scripts/python/failed-syscalls-by-pid.py | 11180 | # 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... |
svn2github/kgyp | refs/heads/master | test/win/gyptest-link-aslr.py | 344 | #!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Make sure aslr setting is extracted properly.
"""
import TestGyp
import sys
if sys.platform == 'win32':
test = TestGyp.TestGyp(form... |
icereval/osf.io | refs/heads/develop | api_tests/waffle/views/test_waffle_list.py | 6 | import pytest
from api.base.settings.defaults import API_BASE
from osf_tests.factories import (
AuthUserFactory,
FlagFactory,
SampleFactory,
SwitchFactory
)
from api.base.pagination import MaxSizePagination
@pytest.mark.django_db
class TestWaffleList:
@pytest.fixture()
def user(self):
... |
GavinCruise/flask | refs/heads/master | flask/cli.py | 136 | # -*- coding: utf-8 -*-
"""
flask.cli
~~~~~~~~~
A simple command line application to run flask apps.
:copyright: (c) 2015 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import os
import sys
from threading import Lock, Thread
from functools import update_wrapper
import click
... |
ltilve/ChromiumGStreamerBackend | refs/heads/master | tools/perf/measurements/memory_multi_tab.py | 22 | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Multi tab memory test.
This test is a multi tab test, but we're interested in measurements for
the entire test rather than each single page.
"""
from te... |
bmos299/fabric | refs/heads/master | bddtests/peer/admin_pb2.py | 2 | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: peer/admin.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _re... |
fontenele/scrapy | refs/heads/master | tests/test_downloadermiddleware_httpcompression.py | 110 | from io import BytesIO
from unittest import TestCase
from os.path import join, abspath, dirname
from gzip import GzipFile
from scrapy.spiders import Spider
from scrapy.http import Response, Request, HtmlResponse
from scrapy.downloadermiddlewares.httpcompression import HttpCompressionMiddleware
from tests import tests_... |
jorpramo/flask | refs/heads/master | setup.py | 141 | """
Flask
-----
Flask is a microframework for Python based on Werkzeug, Jinja 2 and good
intentions. And before you ask: It's BSD licensed!
Flask is Fun
````````````
Save in a hello.py:
.. code:: python
from flask import Flask
app = Flask(__name__)
@app.route("/")
def hello():
return "Hell... |
Xeralux/tensorflow | refs/heads/master | tensorflow/contrib/distributions/python/kernel_tests/bijectors/invert_test.py | 2 | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
habibmasuro/kivy | refs/heads/master | kivy/tests/test_issue_883.py | 70 | import unittest
from kivy.uix.label import Label
class LabelEmptyMarkupTestCase(unittest.TestCase):
def test_empty_markup(self):
label = Label(text='[b][/b]', markup=True)
label.texture_update()
self.assertTrue(label.texture is not None)
self.assertEqual(label.texture.width, 1)
... |
sticksnleaves/ghost-blog | refs/heads/master | node_modules/grunt-docker/node_modules/docker/node_modules/pygmentize-bundled/vendor/pygments/build-2.7/pygments/lexers/_luabuiltins.py | 275 | # -*- coding: utf-8 -*-
"""
pygments.lexers._luabuiltins
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This file contains the names and modules of lua functions
It is able to re-generate itself, but for adding new functions you
probably have to add some callbacks (see function module_callbacks).
Do not edit th... |
kellyschrock/ardupilot | refs/heads/master | Tools/autotest/quadplane.py | 3 | #!/usr/bin/env python
# Fly ArduPlane QuadPlane in SITL
from __future__ import print_function
import os
import pexpect
from pymavlink import mavutil
from common import AutoTest
from common import AutoTestTimeoutException
from pysim import util
from pysim import vehicleinfo
import operator
# get location of scripts... |
sunlianqiang/kbengine | refs/heads/master | kbe/src/lib/python/Lib/idlelib/run.py | 80 | import sys
import io
import linecache
import time
import socket
import traceback
import _thread as thread
import threading
import queue
import tkinter
from idlelib import CallTips
from idlelib import AutoComplete
from idlelib import RemoteDebugger
from idlelib import RemoteObjectBrowser
from idlelib import StackViewe... |
loveshell/volatility | refs/heads/master | volatility/plugins/overlays/windows/win2003_sp12_x64_syscalls.py | 13 | # Volatility
# Copyright (c) 2008-2013 Volatility Foundation
#
# This file is part of Volatility.
#
# Volatility 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 o... |
Andrew-McNab-UK/DIRAC | refs/heads/integration | Interfaces/scripts/dirac-wms-job-logging-info.py | 6 | #!/usr/bin/env python
########################################################################
# $HeadURL$
# File : dirac-wms-job-logging-ingo
# Author : Stuart Paterson
########################################################################
"""
Retrieve history of transitions for a DIRAC job
"""
__RCSID__ = "$I... |
ddnbgroup/ansible | refs/heads/devel | contrib/inventory/cobbler.py | 27 | #!/usr/bin/env python
"""
Cobbler external inventory script
=================================
Ansible has a feature where instead of reading from /etc/ansible/hosts
as a text file, it can query external programs to obtain the list
of hosts, groups the hosts are in, and even variables to assign to each host.
To use t... |
sanjoydesk/FrameworkBenchmarks | refs/heads/master | frameworks/Python/flask/gunicorn_conf.py | 214 | import multiprocessing
import os
import sys
_is_pypy = hasattr(sys, 'pypy_version_info')
_is_travis = os.environ.get('TRAVIS') == 'true'
workers = multiprocessing.cpu_count() * 3
if _is_travis:
workers = 2
bind = "0.0.0.0:8080"
keepalive = 120
errorlog = '-'
pidfile = 'gunicorn.pid'
if _is_pypy:
worker_clas... |
shwinpiocess/redismon | refs/heads/master | redis/connection.py | 7 | from __future__ import with_statement
from distutils.version import StrictVersion
from itertools import chain
from select import select
import os
import socket
import sys
import threading
import warnings
try:
import ssl
ssl_available = True
except ImportError:
ssl_available = False
from redis._compat impo... |
gpmidi/fragforce.org | refs/heads/dev | ffdonations/utils.py | 3 | # from .tasks import *
from django.conf import settings
from django.db.models import Sum
from memoize import memoize
from ffsfdc.models import *
from .models import *
# @memoize(timeout=120)
# def el_num_donations():
# baseq = DonationModel.objects.filter(DonationModel.tracked_q())
# return baseq.count()
#
#... |
sxjscience/tvm | refs/heads/master | python/tvm/contrib/tf_op/module.py | 5 | # 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... |
erdincay/youtube-dl | refs/heads/master | youtube_dl/extractor/ringtv.py | 124 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
class RingTVIE(InfoExtractor):
_VALID_URL = r'http://(?:www\.)?ringtv\.craveonline\.com/(?P<type>news|videos/video)/(?P<id>[^/?#]+)'
_TEST = {
"url": "http://ringtv.craveonline.com/news/310833-luis-collazo-says-victo... |
OCA/purchase-workflow | refs/heads/12.0 | purchase_request/models/purchase_order.py | 1 | # Copyright 2018-2019 Eficent Business and IT Consulting Services S.L.
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl-3.0).
from odoo import _, api, exceptions, fields, models
class PurchaseOrder(models.Model):
_inherit = "purchase.order"
@api.multi
def _purchase_request_confirm_message_c... |
gm-stack/mcproxy | refs/heads/master | mcproxy/log.py | 2 | import logging.config, yaml
logging.config.dictConfig({
'version': 1,
'formatters': {
'brief': {
'format': '[%(levelname)s] %(name)s: %(message)s',
},
'precise': {
'format': '%(asctime)s [%(levelname)-8s] %(name)-15s %(message)s',
},
},
... |
iulian787/spack | refs/heads/develop | var/spack/repos/builtin/packages/xwininfo/package.py | 5 | # Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Xwininfo(AutotoolsPackage, XorgPackage):
"""xwininfo prints information about windows on a... |
amrdraz/kodr | refs/heads/master | app/brython/www/src/Lib/encodings/ptcp154.py | 219 | """ Python Character Mapping Codec generated from 'PTCP154.txt' with gencodec.py.
Written by Marc-Andre Lemburg (mal@lemburg.com).
(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.
(c) Copyright 2000 Guido van Rossum.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,err... |
selecsosi/django-cms | refs/heads/develop | cms/tests/menu.py | 8 | # -*- coding: utf-8 -*-
from __future__ import with_statement
import copy
from django.conf import settings
from django.contrib.auth.models import AnonymousUser, Permission, Group
from django.contrib.sites.models import Site
from django.template import Template, TemplateSyntaxError
from django.utils.translation import ... |
RobertABT/heightmap | refs/heads/master | build/matplotlib/examples/pylab_examples/fill_between_demo.py | 6 | #!/usr/bin/env python
import matplotlib.pyplot as plt
import numpy as np
x = np.arange(0.0, 2, 0.01)
y1 = np.sin(2*np.pi*x)
y2 = 1.2*np.sin(4*np.pi*x)
fig, (ax1, ax2, ax3) = plt.subplots(3,1, sharex=True)
ax1.fill_between(x, 0, y1)
ax1.set_ylabel('between y1 and 0')
ax2.fill_between(x, y1, 1)
ax2.set_ylabel('betwee... |
mendersoftware/integration | refs/heads/master | testutils/api/tenantadm.py | 1 | # Copyright 2021 Northern.tech AS
#
# 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... |
Hardslog/android_kernel_asus_ze551kl | refs/heads/android-5.0 | scripts/build-all.py | 704 | #! /usr/bin/env python
# Copyright (c) 2009-2014, The Linux Foundation. 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
# ... |
insomnia-lab/calibre | refs/heads/master | src/calibre/ebooks/oeb/display/webview.py | 7 | #!/usr/bin/env python
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
from __future__ import (unicode_literals, division, absolute_import,
print_function)
__license__ = 'GPL v3'
__copyright__ = '2012, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
import re
fro... |
dialounke/pylayers | refs/heads/master | pylayers/__init__.py | 3 | """
pylayers
=========
This file is adapted from scikit-learn package
"""
import sys
__version__ = '0.12-git'
try:
__PYLAYERS_SETUP__
except NameError:
__PYLAYERS_SETUP__ = False
if __PYLAYERS_SETUP__:
sys.stderr.write('Partial import of pylayers during the build process.\n')
else:
try:
fro... |
hhsprings/cython | refs/heads/master | Cython/Compiler/CythonScope.py | 27 | from __future__ import absolute_import
from .Symtab import ModuleScope
from .PyrexTypes import *
from .UtilityCode import CythonUtilityCode
from .Errors import error
from .Scanning import StringSourceDescriptor
from . import MemoryView
class CythonScope(ModuleScope):
is_cython_builtin = 1
_cythonscope_initia... |
likelyzhao/mxnet | refs/heads/dev-faster-rcnn | example/ssd/evaluate/evaluate_net.py | 10 | from __future__ import print_function
import os
import sys
import importlib
import mxnet as mx
from dataset.iterator import DetRecordIter
from config.config import cfg
from evaluate.eval_metric import MApMetric, VOC07MApMetric
import logging
def evaluate_net(net, path_imgrec, num_classes, mean_pixels, data_shape,
... |
mark-ignacio/phantomjs | refs/heads/master | src/qt/qtwebkit/Tools/Scripts/webkitpy/common/system/path_unittest.py | 124 | # Copyright (C) 2010 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... |
kyubifire/softlayer-python | refs/heads/master | tests/functional_tests.py | 9 | """
SoftLayer.tests.functional_tests
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:license: MIT, see LICENSE for more details.
"""
import os
import SoftLayer
from SoftLayer import testing
from SoftLayer import transports
class FunctionalTest(testing.TestCase):
def _get_creds(self):
for key in 'SL_USERNA... |
mudbungie/NetExplorer | refs/heads/master | env/lib/python3.4/site-packages/omnijson/packages/simplejson/ordered_dict.py | 1039 | """Drop-in replacement for collections.OrderedDict by Raymond Hettinger
http://code.activestate.com/recipes/576693/
"""
from UserDict import DictMixin
# Modified from original to support Python 2.4, see
# http://code.google.com/p/simplejson/issues/detail?id=53
try:
all
except NameError:
def all(seq):
... |
hvy/chainer | refs/heads/master | tests/chainer_tests/functions_tests/pooling_tests/test_roi_max_pooling_2d.py | 4 | import unittest
import numpy
import chainer
from chainer.backends import cuda
from chainer import functions
from chainer import gradient_check
from chainer import testing
from chainer.testing import attr
from chainer_tests.functions_tests.pooling_tests import pooling_nd_helper
def _pair(x):
if isinstance(x, cha... |
Liyier/learning_log | refs/heads/master | env/Lib/site-packages/django/contrib/gis/forms/fields.py | 504 | from __future__ import unicode_literals
from django import forms
from django.contrib.gis.geos import GEOSException, GEOSGeometry
from django.utils.translation import ugettext_lazy as _
from .widgets import OpenLayersWidget
class GeometryField(forms.Field):
"""
This is the basic form field for a Geometry. A... |
JShadowMan/package | refs/heads/master | python/gui/tcl_tkinter/centering_window.py | 2 | #!/usr/bin/env python3
from tkinter import *
class CenteringWindow(Frame):
def __init__(self, parent):
Frame.__init__(self, parent)
self.parent = parent
self.__init_window_ui()
def __init_window_ui(self):
self.pack(fill = BOTH, expand = 1)
self.parent.t... |
kustodian/ansible | refs/heads/devel | lib/ansible/plugins/action/eos.py | 8 | #
# (c) 2016 Red Hat Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is d... |
yannickcr/CouchPotatoServer | refs/heads/develop | couchpotato/core/media/movie/providers/trailer/youtube_dl/extractor/engadget.py | 18 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from .fivemin import FiveMinIE
from ..utils import (
url_basename,
)
class EngadgetIE(InfoExtractor):
_VALID_URL = r'''(?x)https?://www.engadget.com/
(?:video/5min/(?P<id>\d+)|
[\d/]+/.*?)
'''
... |
fxfitz/ansible | refs/heads/devel | lib/ansible/modules/cloud/ovirt/ovirt_vms_facts.py | 73 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2016 Red Hat, Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
#... |
andrew12/python-coinroll | refs/heads/master | fibonacci.py | 1 | import coinroll
from util import color
import argparse
from decimal import Decimal
parser = argparse.ArgumentParser()
parser.add_argument('user')
parser.add_argument('password')
parser.add_argument('-b', '--base', type=Decimal, default=None)
parser.add_argument('-x', '--max', type=Decimal, default=Decimal('Infinity'))... |
Nikea/VisTrails | refs/heads/master | vistrails/packages/tabledata/common.py | 2 | try:
import numpy
except ImportError: # pragma: no cover
numpy = None
from vistrails.core.modules.basic_modules import List, ListType
from vistrails.core.modules.config import ModuleSettings
from vistrails.core.modules.output_modules import OutputModule, FileMode
from vistrails.core.modules.vistrails_module im... |
mspark93/VTK | refs/heads/master | ThirdParty/Twisted/twisted/python/test/test_util.py | 23 | # -*- test-case-name: twisted.python.test.test_util
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted.python.util}.
"""
from __future__ import division, absolute_import
import os.path, sys
import shutil, errno, warnings
try:
import pwd, grp
except ImportError:
pw... |
OpringaoDoTurno/airflow | refs/heads/master | airflow/operators/sqlite_operator.py | 16 | # -*- coding: utf-8 -*-
#
# 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
... |
maximeh/spiderwave | refs/heads/master | scrappers/scrape_nz.py | 1 | #! /usr/bin/python
# -*- coding: utf-8 -*-
from BeautifulSoup import BeautifulSoup
import db_wrapper
import scrape_mike as ssm
db_wrapper.connect()
url = "http://www.nzradioguide.co.nz/"
soup = ssm.get_page(url)
data = soup.find("table", {"id" : "thetable3"})
ssm.scrape(
data,
name_td_id=0, location... |
gamingrobot/SpockBot | refs/heads/master | spockbot/plugins/core/settings.py | 5 | from spockbot.plugins import default_plugins
from spockbot.plugins.base import get_settings, pl_announce
class PloaderFetch(object):
def __init__(self, plugins, plugin_settings):
self.plugins = plugins
self.plugin_settings = plugin_settings
def get_plugins(self):
return self.plugins
... |
AustinRP/Site-Recommender | refs/heads/master | crawler/crawler/pipelines.py | 1 | # -*- coding: utf-8 -*-
# Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: http://doc.scrapy.org/en/latest/topics/item-pipeline.html
from datasketch import MinHashLSHForest, MinHash
import os.path
import pickle
class MinHashPipeline(object):
pickle_filen... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.