repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
Kerbas-ad-astra/KerbalStuff | refs/heads/master | alembic/versions/3b5f1c92dda_add_background_offset_to_mods.py | 5 | """Add background offset to mods
Revision ID: 3b5f1c92dda
Revises: 2182d60340d
Create Date: 2014-06-30 00:14:36.303925
"""
# revision identifiers, used by Alembic.
revision = '3b5f1c92dda'
down_revision = '2182d60340d'
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto generated b... |
QianBIG/odoo | refs/heads/8.0 | addons/account/account_bank_statement.py | 5 | # -*- 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... |
neudesk/neucloud | refs/heads/master | horizon/test/test_dashboards/dogs/puppies/panel.py | 102 | # 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 t... |
guerrerocarlos/fiware-IoTAgent-Cplusplus | refs/heads/develop | third_party/mosquitto-1.3.5/test/mosq_test.py | 18 | import socket
import struct
def expect_packet(sock, name, expected):
if len(expected) > 0:
rlen = len(expected)
else:
rlen = 1
packet_recvd = sock.recv(rlen)
return packet_matches(name, packet_recvd, expected)
def packet_matches(name, recvd, expected):
if recvd != expected:
... |
agry/NGECore2 | refs/heads/master | scripts/object/mobile/dressed_diplomat_human_male_01.py | 85615 | import sys
def setup(core, object):
return |
faarwa/EngSocP5 | refs/heads/master | zxing/cpp/scons/scons-local-2.0.0.final.0/SCons/Tool/pdflatex.py | 34 | """SCons.Tool.pdflatex
Tool-specific initialization for pdflatex.
Generates .pdf files from .latex or .ltx files
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005... |
nagyistoce/edx-platform | refs/heads/master | common/djangoapps/track/backends/django.py | 55 | """
Event tracker backend that saves events to a Django database.
"""
# TODO: this module is very specific to the event schema, and is only
# brought here for legacy support. It should be updated when the
# schema changes or eventually deprecated.
from __future__ import absolute_import
import logging
from django.d... |
rex-xxx/mt6572_x201 | refs/heads/master | external/webkit/Tools/Scripts/webkitpy/thirdparty/simplejson/jsonfilter.py | 178 | import simplejson
import cgi
class JSONFilter(object):
def __init__(self, app, mime_type='text/x-json'):
self.app = app
self.mime_type = mime_type
def __call__(self, environ, start_response):
# Read JSON POST input to jsonfilter.json if matching mime type
response = {'status': ... |
ahhda/sympy | refs/heads/master | sympy/solvers/recurr.py | 48 | """
This module is intended for solving recurrences or, in other words,
difference equations. Currently supported are linear, inhomogeneous
equations with polynomial or rational coefficients.
The solutions are obtained among polynomials, rational functions,
hypergeometric terms, or combinations of hypergeometric term ... |
arborh/tensorflow | refs/heads/master | tensorflow/python/debug/cli/debugger_cli_common_test.py | 40 | # 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... |
jamespcole/home-assistant | refs/heads/master | homeassistant/components/emby/media_player.py | 4 | """
Support to interface with the Emby API.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/media_player.emby/
"""
import logging
import voluptuous as vol
from homeassistant.components.media_player import (
MediaPlayerDevice, PLATFORM_SCHEMA)
from h... |
wolfmuel/ctdb | refs/heads/master | lib/tdb/python/tdbdump.py | 26 | #!/usr/bin/python
# Trivial reimplementation of tdbdump in Python
import tdb, sys
if len(sys.argv) < 2:
print "Usage: tdbdump.py <tdb-file>"
sys.exit(1)
db = tdb.Tdb(sys.argv[1])
for (k, v) in db.iteritems():
print "{\nkey(%d) = %r\ndata(%d) = %r\n}" % (len(k), k, len(v), v)
|
Bitaltyn-project/bitaltyn | refs/heads/master | contrib/seeds/makeseeds.py | 2 | #!/usr/bin/env python
#
# Generate seeds.txt from Pieter's DNS seeder
#
NSEEDS=512
MAX_SEEDS_PER_ASN=2
MIN_BLOCKS = 337600
# These are hosts that have been observed to be behaving strangely (e.g.
# aggressively connecting to every node).
SUSPICIOUS_HOSTS = set([
"130.211.129.106", "178.63.107.226",
"83.81.1... |
Team3574/2013VisionCode | refs/heads/master | src/Point.py | 1 | # This file is part of the project High Tekerz 2013 Vision Code.
#
# the project High Tekerz 2013 Vision Code 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 opti... |
yarshure/shadowsocks | refs/heads/master | shadowsocks/common.py | 945 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2013-2015 clowwindy
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... |
kans/birgo | refs/heads/master | tools/gyp/pylib/gyp/generator/scons.py | 2 | # 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.
import gyp
import gyp.common
import gyp.SCons as SCons
import os.path
import pprint
import re
import string
# TODO: remove when we delete the last WriteList() c... |
axbaretto/beam | refs/heads/master | sdks/python/.tox/lint/lib/python2.7/site-packages/pylint/test/functional/too_many_nested_blocks.py | 7 | """Checks the maximum block level is smaller than 6 in function definitions"""
#pylint: disable=using-constant-test, missing-docstring, too-many-return-statements
def my_function():
if 1: # [too-many-nested-blocks]
for i in range(10):
if i == 2:
while True:
... |
detiber/ansible | refs/heads/devel | lib/ansible/modules/cloud/amazon/ec2_facts.py | 27 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# 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.
#... |
ecesena/oscars2016 | refs/heads/master | twitter-kafka/twitter-kafka.py | 1 | import datetime
import json
import queue
import subprocess
import threading
from kafka.client import KafkaClient
from kafka.producer import SimpleProducer
from tweepy.streaming import StreamListener
from tweepy import OAuthHandler
from tweepy import Stream
from settings import *
queue = queue.Queue()
class StdOutL... |
Distrotech/qtwebkit | refs/heads/distrotech-qtwebkit | Tools/Scripts/webkitpy/common/checkout/changelog_unittest.py | 121 | # Copyright (C) 2009 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... |
paulondc/gaffer | refs/heads/master | python/GafferUI/DeferredPathPreview.py | 5 | ##########################################################################
#
# Copyright (c) 2012, Image Engine Design 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:
#
# * Red... |
sknepneklab/SAMoS | refs/heads/development | configurations/MakeConfigurations/plane_from_file.py | 1 | # * *************************************************************
# *
# * Soft Active Mater on Surfaces (SAMoS)
# *
# * Author: Rastko Sknepnek
# *
# * Division of Physics
# * School of Engineering, Physics and Mathematics
# * University of Dundee
# *
# * (c) 2013, 2014
# *
# * School of Scienc... |
tb0hdan/voiceplay | refs/heads/master | voiceplay/player/tasks/locallibrary.py | 1 | #-*- coding: utf-8 -*-
""" Local library playback module """
import os
import random
random.seed()
from voiceplay.webapp.baseresource import APIV1Resource
from voiceplay.utils.helpers import SingleQueueDispatcher
from .basetask import BasePlayerTask
class LocalLibrary(APIV1Resource):
"""
Local file library A... |
mahendra-r/edx-platform | refs/heads/master | lms/djangoapps/mobile_api/social_facebook/models.py | 1644 | """
A models.py is required to make this an app (until we move to Django 1.7)
"""
|
zengenti/ansible | refs/heads/devel | lib/ansible/module_utils/splitter.py | 91 | # This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by Ansible
# still belong to the author of the module, and may assign their own license
# to the complete wo... |
rfdickerson/CS241 | refs/heads/master | final/circularbuffer.py | 2 | class CircularBuffer (object):
def __init__(self, size):
# data is an array of zeros
self.data = [0] * size
# s is the index of the beginning of the buffer
self.s = 0
# num is the number of elements stored in the buffer
self.num = 0
def push (self, value... |
guijomatos/SickRage | refs/heads/master | autoProcessTV/lib/requests/packages/chardet/mbcsgroupprober.py | 2768 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2001
# the Initial Developer. All R... |
mavit/ansible | refs/heads/devel | lib/ansible/modules/network/slxos/slxos_linkagg.py | 83 | #!/usr/bin/python
#
# (c) 2018 Extreme Networks 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 late... |
Carmezim/tensorflow | refs/heads/master | tensorflow/python/training/summary_io.py | 165 | # 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... |
kimjaejoong/nova | refs/heads/master | nova/scheduler/rpcapi.py | 51 | # Copyright 2013, Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... |
anas-taji/sale-workflow | refs/heads/8.0 | sale_last_price_info/tests/__init__.py | 27 | # -*- encoding: utf-8 -*-
##############################################################################
# For copyright and license notices, see __openerp__.py file in root directory
##############################################################################
from . import test_sale_last_price_info
|
ropable/statdev | refs/heads/master | ledger/address/migrations/0002_useraddress_profile_address.py | 3 | # -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2016-07-18 05:21
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('accounts', '0001_initial'),
('address', '0001_initia... |
earies/exabgp | refs/heads/master | lib/exabgp/bgp/message/open/capability/ms.py | 6 | # encoding: utf-8
"""
ms.py
Created by Thomas Mangin on 2012-07-17.
Copyright (c) 2009-2015 Exa Networks. All rights reserved.
"""
from exabgp.bgp.message.open.capability.capability import Capability
# ================================================================= MultiSession
#
@Capability.register()
@Capabili... |
okami-1/django-rrd | refs/heads/master | test_project/test_project/settings.py | 1 | """
Django settings for test_project project.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.7/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ..... |
pyjobs/web | refs/heads/master | pyjobs_web/pyjobsweb/commands/crawl.py | 1 | # -*- coding: utf-8 -*-
from pyjobs_crawlers.run import start_crawlers
from crawlers import PyJobsWebConnector
from pyjobsweb.commands import AppContextCommand
class CrawlCommand(AppContextCommand):
"""
Start job boards crawlers to feed the PostgreSQL database
"""
def get_parser(self, prog_name):
... |
wanghongjuan/crosswalk-test-suite | refs/heads/master | webapi/tct-csp-w3c-tests/csp-py/csp_font-src_cross-origin_multi_allowed_two-manual.py | 30 | def main(request, response):
import simplejson as json
f = file('config.json')
source = f.read()
s = json.JSONDecoder().decode(source)
url1 = "http://" + s['host'] + ":" + str(s['ports']['http'][1])
url2 = "http://" + s['host'] + ":" + str(s['ports']['http'][0])
_CSP = "font-src " + url1 + "... |
hpe-storage/horizon-hpe-storage-ui | refs/heads/master | horizon_hpe_storage/storage_panel/urls.py | 2 | # (c) Copyright [2015] Hewlett Packard Enterprise Development LP
#
# 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 r... |
kennedyshead/home-assistant | refs/heads/dev | tests/components/camera/test_init.py | 2 | """The tests for the camera component."""
import asyncio
import base64
import io
from unittest.mock import Mock, PropertyMock, mock_open, patch
import pytest
from homeassistant.components import camera
from homeassistant.components.camera.const import DOMAIN, PREF_PRELOAD_STREAM
from homeassistant.components.camera.p... |
kingthorin/zap-extensions | refs/heads/main | addOns/jython/src/main/zapHomeFiles/scripts/templates/variant/Input Vector default template.py | 7 | """A script that provides custom input vectors that can be used during active
scans.
The option Enable Script Input Vectors must be enabled before starting the
scans.
Note that new scripts will initially be disabled, right click the script in the
Scripts tree and select Enable Script.
"""
import urllib
def parsePara... |
mikemhenry/arcade | refs/heads/master | arcade/color/__init__.py | 2 | """
This module pre-defines several colors.
"""
AERO_BLUE = (201, 255, 229)
AFRICAN_VIOLET = (178, 132, 190)
AIR_FORCE_BLUE = (93, 138, 168)
AIR_SUPERIORITY_BLUE = (114, 160, 193)
ALABAMA_CRIMSON = (175, 0, 42)
ALICE_BLUE = (240, 248, 255)
ALIZARIN_CRIMSON = (227, 38, 54)
ALLOY_ORANGE = (196, 98, 16)
ALMOND = (239, 222... |
surligas/gnuradio | refs/heads/master | gr-blocks/python/blocks/qa_affinity.py | 57 | #!/usr/bin/env python
#
# Copyright 2013 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# ... |
bmorris3/numpy | refs/heads/master | numpy/core/shape_base.py | 69 | from __future__ import division, absolute_import, print_function
__all__ = ['atleast_1d', 'atleast_2d', 'atleast_3d', 'vstack', 'hstack',
'stack']
from . import numeric as _nx
from .numeric import asanyarray, newaxis
def atleast_1d(*arys):
"""
Convert inputs to arrays with at least one dimension.
... |
pyKy/kivy-doc-ja | refs/heads/master | examples/canvas/texture.py | 21 | '''
Texture Wrapping and Coordinates Example
========================================
This example changes texture properties and the properties
of its containing rectangle. You should see some a multicolored
texture with sliders to the left and below and buttons at the
bottom of the screen. The image texture_example_... |
tequa/ammisoft | refs/heads/master | ammimain/WinPython-64bit-2.7.13.1Zero/python-2.7.13.amd64/Lib/site-packages/matplotlib/__init__.py | 4 | """
This is an object-oriented plotting library.
A procedural interface is provided by the companion pyplot module,
which may be imported directly, e.g.::
import matplotlib.pyplot as plt
or using ipython::
ipython
at your terminal, followed by::
In [1]: %matplotlib
In [2]: import matplotlib.pyplot... |
samthor/intellij-community | refs/heads/master | python/testData/resolve/ClassRedefinedField.py | 83 | class Foo(object):
pass
class Bar(object):
Foo = Foo
# <ref>
|
eagleamon/home-assistant | refs/heads/dev | homeassistant/components/alexa.py | 15 | """
Support for Alexa skill service end point.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/alexa/
"""
import asyncio
import copy
import enum
import logging
import uuid
from datetime import datetime
import voluptuous as vol
from homeassistant.core i... |
lynx-r/django-admin-uploads | refs/heads/master | setup.py | 2 | import os
import sys
from fnmatch import fnmatchcase
from distutils.util import convert_path
from setuptools import setup, find_packages
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
# Provided as an attribute, so you can append to these instead
# of replicating them:
standar... |
r-lyeh/scriptorium | refs/heads/master | python/micropython/tests/basics/fun_largestate.py | 115 | # test large function (stack) state
# this function creates 127 locals
def f():
x0 = 1
x1 = 1
x2 = 1
x3 = 1
x4 = 1
x5 = 1
x6 = 1
x7 = 1
x8 = 1
x9 = 1
x10 = 1
x11 = 1
x12 = 1
x13 = 1
x14 = 1
x15 = 1
x16 = 1
x17 = 1
x18 = 1
x19 = 1
x20 =... |
rebroad/bitcoin | refs/heads/core-master | qa/rpc-tests/replace-by-fee.py | 6 | #!/usr/bin/env python3
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Test replace by fee code
#
from test_framework.test_framework import BitcoinTestFramework
from test_... |
hlzz/dotfiles | refs/heads/master | graphics/VTK-7.0.0/Rendering/Volume/Testing/Python/volRCCropRegions.py | 2 | #!/usr/bin/env python
import vtk
from vtk.test import Testing
from vtk.util.misc import vtkGetDataRoot
VTK_DATA_ROOT = vtkGetDataRoot()
# Simple volume rendering example.
reader = vtk.vtkSLCReader()
reader.SetFileName(VTK_DATA_ROOT + "/Data/sphere.slc")
# Create transfer functions for opacity and color
opa... |
dr1ll/hostname | refs/heads/master | .hostname.py | 1 | #!/usr/bin/python
#-*- coding: utf-8 -*-
#######################################################
# Changing hostname - hostname.py #
# #
# - tested for: #
# Python 2.7.3 ... |
jjm2473/AMLOGIC_M8 | refs/heads/master | Documentation/networking/cxacru-cf.py | 14668 | #!/usr/bin/env python
# Copyright 2009 Simon Arlott
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the Free
# Software Foundation; either version 2 of the License, or (at your option)
# any later version.
#
# This program i... |
raycarnes/partner-contact | refs/heads/8.0 | base_continent/__init__.py | 34 | # -*- encoding: utf-8 -*-
##############################################################################
#
# Author: Romain Deheele
# Copyright 2014 Camptocamp SA
#
# 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
#... |
ntonjeta/iidea-Docker | refs/heads/master | examples/sobel/src/boost_1_63_0/libs/compute/perf/perf.py | 26 | #!/usr/bin/python
# Copyright (c) 2014 Kyle Lutz <kyle.r.lutz@gmail.com>
# 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
#
# See http://boostorg.github.com/compute for more information.
# driver script for boost.comp... |
TkkrLab/py-ledart | refs/heads/master | Ledart/Tools/Controllers/__init__.py | 2 | from Ledart.Tools.Controllers.Controllers import *
from Ledart.Tools.Controllers.PygameController import *
from Ledart.Tools.Controllers.SoundControllers import * |
0Chencc/CTFCrackTools | refs/heads/master | Lib/encodings/big5.py | 816 | #
# big5.py: Python Unicode Codec for BIG5
#
# Written by Hye-Shik Chang <perky@FreeBSD.org>
#
import _codecs_tw, codecs
import _multibytecodec as mbc
codec = _codecs_tw.getcodec('big5')
class Codec(codecs.Codec):
encode = codec.encode
decode = codec.decode
class IncrementalEncoder(mbc.MultibyteIncrementalE... |
ohduran/CrowdFinanceInfographic | refs/heads/master | virtualenv/lib/python3.5/site-packages/pkg_resources/_vendor/pyparsing.py | 107 | # module pyparsing.py
#
# Copyright (c) 2003-2015 Paul T. McGuire
#
# 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 u... |
neversun/sailfish-hackernews | refs/heads/master | pyPackages/requests-noarch/requests/packages/urllib3/packages/__init__.py | 1093 | from __future__ import absolute_import
from . import ssl_match_hostname
__all__ = ('ssl_match_hostname', )
|
TangHao1987/intellij-community | refs/heads/master | python/testData/inspections/importFromModuleStar/target.py | 83 | __all__ = ['shazam']
def shazam(): pass
def xyzzy(): pass
|
the-duck/that-startpage-rocks | refs/heads/master | lib/jinja2/optimizer.py | 1401 | # -*- coding: utf-8 -*-
"""
jinja2.optimizer
~~~~~~~~~~~~~~~~
The jinja optimizer is currently trying to constant fold a few expressions
and modify the AST in place so that it should be easier to evaluate it.
Because the AST does not contain all the scoping information and the
compiler has to ... |
HousekeepLtd/django | refs/heads/master | tests/flatpages_tests/test_middleware.py | 290 | from django.conf import settings
from django.contrib.auth.models import User
from django.contrib.flatpages.models import FlatPage
from django.contrib.sites.models import Site
from django.test import TestCase, modify_settings, override_settings
from .settings import FLATPAGES_TEMPLATES
class TestDataMixin(object):
... |
40223220/w16b_test | refs/heads/master | static/Brython3.1.1-20150328-091302/Lib/unittest/signals.py | 1016 | import signal
import weakref
from functools import wraps
__unittest = True
class _InterruptHandler(object):
def __init__(self, default_handler):
self.called = False
self.original_handler = default_handler
if isinstance(default_handler, int):
if default_handler == signal.SIG_D... |
Mutnick/nicotine-plus | refs/heads/master | plugins/memory-debugger/__init__.py | 2 | # -*- coding: utf-8 -*-
import gc
from pynicotine.pluginsystem import BasePlugin, returncode
def enable(plugins):
global PLUGIN
PLUGIN = Plugin(plugins)
def disable(plugins):
global PLUGIN
PLUGIN = None
class Plugin(BasePlugin):
__name__ = "Memory Debugger"
#settings = {'maxpubliclines':4,
... |
MisterPup/Ceilometer-Juno-Extension | refs/heads/master | ceilometer/storage/__init__.py | 4 | #
# Copyright 2012 New Dream Network, LLC (DreamHost)
#
# Author: Doug Hellmann <doug.hellmann@dreamhost.com>
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/li... |
rfguri/vimfiles | refs/heads/master | bundle/ycm/third_party/ycmd/third_party/python-future/src/future/moves/http/server.py | 82 | from __future__ import absolute_import
from future.utils import PY3
if PY3:
from http.server import *
else:
__future_module__ = True
from BaseHTTPServer import *
from CGIHTTPServer import *
from SimpleHTTPServer import *
try:
from CGIHTTPServer import _url_collapse_path # needed for... |
saurabh6790/test-erp | refs/heads/develop | erpnext/selling/doctype/customer/__init__.py | 37694 | from __future__ import unicode_literals
|
Dyhzy/selector-shell | refs/heads/master | main.py | 4 | # Copyright 2008 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
lahosken/pants | refs/heads/master | contrib/go/src/python/pants/contrib/go/subsystems/imported_repo.py | 14 | # coding=utf-8
# Copyright 2016 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
from collections imp... |
azurestandard/django | refs/heads/master | tests/regressiontests/localflavor/au/models.py | 47 | from django.contrib.localflavor.au.models import AUStateField, AUPostCodeField
from django.db import models
class AustralianPlace(models.Model):
state = AUStateField(blank=True)
state_required = AUStateField()
state_default = AUStateField(default="NSW", blank=True)
postcode = AUPostCodeField(blank=True... |
ericjang/cryptocurrency_arbitrage | refs/heads/master | cryptsy_test.py | 2 | # testing the Cryptsy API
from Exchanges.Cryptsy import Cryptsy
import config
xchg = Cryptsy(config.CRYPTSY_API_KEY, config.CRYPTSY_SECRET)
pair = ('DOGE', 'BTC')
base, alt = pair
# tradeable pairs
print(xchg.tradeable_pairs)
# get highest bid
print('Highest bid for %r', pair)
bid = xchg.get_highest_bid(base, alt)... |
skulbrane/metagoofil | refs/heads/master | pdfminer/arcfour.py | 56 | #!/usr/bin/env python2
""" Python implementation of Arcfour encryption algorithm.
This code is in the public domain.
"""
## Arcfour
##
class Arcfour(object):
"""
>>> Arcfour('Key').process('Plaintext').encode('hex')
'bbf316e8d940af0ad3'
>>> Arcfour('Wiki').process('pedia').encode('hex')
'1021b... |
mbirtwell/babel | refs/heads/master | babel/dates.py | 8 | # -*- coding: utf-8 -*-
"""
babel.dates
~~~~~~~~~~~
Locale dependent formatting and parsing of dates and times.
The default locale for the functions in this module is determined by the
following environment variables, in that order:
* ``LC_TIME``,
* ``LC_ALL``, and
* ``LANG``
... |
Greennut/ostproject | refs/heads/master | django/views/generic/detail.py | 78 | from django.core.exceptions import ImproperlyConfigured, ObjectDoesNotExist
from django.http import Http404
from django.utils.encoding import smart_str
from django.utils.translation import ugettext as _
from django.views.generic.base import TemplateResponseMixin, View
class SingleObjectMixin(object):
"""
Prov... |
bitifirefly/edx-platform | refs/heads/master | lms/djangoapps/django_comment_client/utils.py | 43 | from collections import defaultdict
from datetime import datetime
import json
import logging
import pytz
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from django.db import connection
from django.http import HttpResponse
from django.utils.timezone import UTC
import pystache_c... |
lrnt/beets-syncpl | refs/heads/master | beetsplug/syncpl.py | 1 | from beets.plugins import BeetsPlugin
from beets import ui, config, library
from os import fsync
from os.path import isdir, isfile, join, relpath
from tempfile import NamedTemporaryFile
from subprocess import Popen, STDOUT, PIPE
from shlex import split as shsplit
def syncpl(lib, opts, args):
config['syncpl'].set_... |
Semersterprojekt/Server | refs/heads/master | node_modules/node-gyp/gyp/pylib/gyp/input_test.py | 1841 | #!/usr/bin/env python
# Copyright 2013 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.
"""Unit tests for the input.py file."""
import gyp.input
import unittest
import sys
class TestFindCycles(unittest.TestCase):
def setUp(self... |
Omegaphora/external_chromium_org | refs/heads/lp5.1 | tools/telemetry/telemetry/core/gpu_info_unittest.py | 33 | # 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.
import unittest
from telemetry.core import gpu_device
from telemetry.core import gpu_info
class TestGPUInfo(unittest.TestCase):
def testConstruction(self... |
mconstantin/watchdog | refs/heads/master | tests/test_delayed_queue.py | 7 | # -*- coding: utf-8 -*-
#
# Copyright 2014 Thomas Amland <thomas.amland@gmail.com>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unles... |
nlphacker/qemu-study | refs/heads/master | tests/qemu-iotests/iotests.py | 36 | # Common utilities and Python wrappers for qemu-iotests
#
# Copyright (C) 2012 IBM Corp.
#
# 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) ... |
marinkaz/orange3 | refs/heads/master | Orange/preprocess/discretize.py | 4 | import numpy as np
from Orange.data import DiscreteVariable, Domain
from Orange.data.sql.table import SqlTable
from Orange.statistics import distribution, contingency
from Orange.statistics.basic_stats import BasicStats
from .transformation import Transformation
from . import _discretize
__all__ = ["EqualFreq", "Equa... |
ahua/pythondotorg | refs/heads/master | jobs/migrations/0008_auto_20150316_1205.py | 13 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('jobs', '0007_auto_20150227_2223'),
]
operations = [
migrations.AddField(
model_name='jobcategory',
n... |
simartin/servo | refs/heads/master | tests/wpt/web-platform-tests/tools/third_party/py/testing/log/test_warning.py | 55 | import sys
from distutils.version import LooseVersion
import pytest
import py
mypath = py.path.local(__file__).new(ext=".py")
win = sys.platform.startswith('win')
pytestmark = pytest.mark.skipif(win and LooseVersion(pytest.__version__) >= LooseVersion('3.1'),
reason='apiwarn is not ... |
EvgenijM86/emercoin | refs/heads/master | qa/rpc-tests/getchaintips.py | 162 | #!/usr/bin/env python2
# Copyright (c) 2014 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 getchaintips API. We introduce a network split, work
# on chains of different lengths, and joi... |
dmlc/tvm | refs/heads/main | python/tvm/relay/build_module.py | 1 | # 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... |
ColinIanKing/autotest | refs/heads/master | tko/migrations/011_rename_JOB_to_CLIENT_JOB.py | 11 | JOB_TO_CLIENT_JOB = """UPDATE tests SET test='CLIENT_JOB' WHERE test='JOB';"""
CLIENT_JOB_TO_JOB = """UPDATE tests SET test='JOB' WHERE test='CLIENT_JOB';"""
def migrate_up(manager):
manager.execute_script(JOB_TO_CLIENT_JOB)
def migrate_down(manager):
manager.execute_script(CLIENT_JOB_TO_JOB)
|
b0ttl3z/SickRage | refs/heads/master | lib/sqlalchemy/ext/automap.py | 75 | # ext/automap.py
# Copyright (C) 2005-2014 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
"""Define an extension to the :mod:`sqlalchemy.ext.declarative` system
which automatica... |
juliosueiras/atlas-vim | refs/heads/master | vim/plugged/UltiSnips/test_all.py | 2 | #!/usr/bin/env python
# encoding: utf-8
#
# To execute this test requires two terminals, one for running Vim and one
# for executing the test script. Both terminals should have their current
# working directories set to this directory (the one containing this
# test_all.py script).
#
# In one terminal, launch a tmux se... |
vfonov/scoop | refs/heads/master | scoop/launch/__init__.py | 5 | #
# This file is part of Scalable COncurrent Operations in Python (SCOOP).
#
# SCOOP 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 Software Foundation, either version 3 of
# the License, or (at your option)... |
cherrydocker/minos | refs/heads/master | client/supervisor_client.py | 5 | import socket
import xmlrpclib
class SupervisorClient:
'''
The supervisor client.
'''
def __init__(self, host, port, user, passwd, service, cluster, job, instance_id):
self.proxy = xmlrpclib.ServerProxy('http://%s:%s@%s:%d' % (
user, passwd, host, port))
self.service = service
self.cluster = ... |
PyCQA/pylint | refs/heads/main | tests/functional/m/member/member_checks_inference_improvements.py | 2 | # pylint: disable=missing-docstring
def test_oserror_has_strerror():
# https://github.com/PyCQA/pylint/issues/2553
try:
raise OSError()
except OSError as exc:
if exc.strerror is not None:
return exc.strerror.lower()
return None
|
BaiGang/recomm_engine | refs/heads/master | debug/decode.py | 3 | #!/usr/local/bin/python
import redis
import json
import mysql.connector
import urllib
import hashlib
import sys
print urllib.unquote(sys.argv[1].encode('utf-8'))
|
realms-team/solmanager | refs/heads/master | libs/smartmeshsdk-REL-1.3.0.1/libs/dustUI/dustFrameNotifications.py | 2 | #!/usr/bin/python
#============================ adjust path =====================================
import sys
import os
if __name__ == '__main__':
here = sys.path[0]
sys.path.insert(0, os.path.join(here, '..'))
#============================ imports =========================================
import Tkinter... |
kmonsoor/python-for-android | refs/heads/master | python3-alpha/extra_modules/gdata/Crypto/PublicKey/RSA.py | 45 | #
# RSA.py : RSA encryption/decryption
#
# Part of the Python Cryptography Toolkit
#
# Distribute and use freely; there are no restrictions on further
# dissemination and usage except those imposed by the laws of your
# country of residence. This software is provided "as is" without
# warranty of fitness for use or... |
markeTIC/l10n-spain | refs/heads/8.0 | account_balance_reporting/report/__init__.py | 9 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP - Account balance reporting engine
# Copyright (C) 2009 Pexego Sistemas Informáticos. All Rights Reserved
#
# This program is free software: you can redistribute it and/or modify
# it under t... |
n0m4dz/odoo | refs/heads/8.0 | addons/sale_journal/__openerp__.py | 262 | # -*- 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... |
erikradio/rossetti | refs/heads/master | rosetti_pages/rosetti_addPage.py | 1 | #!/usr/bin/python2
import sys
import copy
import xml.etree.ElementTree as ET
xmlFile = sys.argv[1]
tree = ET.parse(xmlFile)
root = tree.getroot()
xmlData = open(xmlFile,'r')
records=root.findall('{http://www.loc.gov/mods/v3}mods')
for record in records:
for identifier in record.findall('{http://www.loc.... |
40223220/worktogether | refs/heads/master | static/Brython3.1.1-20150328-091302/Lib/test/test_re.py | 718 | # FIXME: brython: implement test.support
#from test.support import verbose, run_unittest, gc_collect, bigmemtest, _2G, \
# cpython_only
verbose = True
# FIXME: brython: Not used in this module ?
#import io
import re
# FIXME: brython: implement re.Scanner
#from re import Scanner
import sre_constants
import sys... |
jamiefolsom/edx-platform | refs/heads/master | lms/djangoapps/instructor/services.py | 41 | """
Implementation of "Instructor" service
"""
import logging
from opaque_keys import InvalidKeyError
from opaque_keys.edx.keys import CourseKey, UsageKey
from courseware.models import StudentModule
from instructor.views.tools import get_student_from_identifier
from django.core.exceptions import ObjectDoesNotExist
im... |
Tatsh-ansible/ansible-modules-core | refs/heads/devel | cloud/azure/azure_rm_networkinterface_facts.py | 50 | #!/usr/bin/python
#
# Copyright (c) 2016 Matt Davis, <mdavis@ansible.com>
# Chris Houseknecht, <house@redhat.com>
#
# 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 Soft... |
OpenSDUT/mirror | refs/heads/master | mirror/__init__.py | 3 | """Mirror for mirror.bjtu.edu.cn"""
# this is a namespace package
# import pkg_resources
# pkg_resources.declare_namespace(__name__)
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.