repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
IronLanguages/ironpython3 | refs/heads/master | Src/StdLib/Lib/test/sample_doctest.py | 203 | """This is a sample module that doesn't really test anything all that
interesting.
It simply has a few tests, some of which succeed and some of which fail.
It's important that the numbers remain constant as another test is
testing the running of these tests.
>>> 2+2
4
"""
def foo():
"""
>>> 2+2
5
... |
gabrielbdsantos/BJ_Sickrage | refs/heads/master | dailysearch_cron.py | 1 | #!/usr/bin/env python
import argparse
import json
import urllib
def main(url, port, apiKey):
backlog = urllib.urlopen(
"{}/api/{}/?cmd=backlog".format("http://" + url + ":" + port, apiKey)
)
jsonBacklog = json.loads(backlog.read())
for tvshow in jsonBacklog['data']:
indexerid = tvshow['... |
GiovanniConserva/TestDeploy | refs/heads/master | venv/Lib/site-packages/pip/commands/completion.py | 143 | from __future__ import absolute_import
import sys
from pip.basecommand import Command
BASE_COMPLETION = """
# pip %(shell)s completion start%(script)s# pip %(shell)s completion end
"""
COMPLETION_SCRIPTS = {
'bash': """
_pip_completion()
{
COMPREPLY=( $( COMP_WORDS="${COMP_WORDS[*]}" \\
CO... |
JianfuLi/shadowsocks | refs/heads/master | tests/graceful_server.py | 977 | #!/usr/bin/python
import socket
if __name__ == '__main__':
s = socket.socket()
s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
s.bind(('127.0.0.1', 8001))
s.listen(1024)
c = None
while True:
c = s.accept()
|
acsone/project | refs/heads/8.0 | service_desk/project.py | 23 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2013 Daniel Reis
#
# 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... |
drnextgis/QGIS | refs/heads/master | python/ext-libs/yaml/emitter.py | 388 |
# Emitter expects events obeying the following grammar:
# stream ::= STREAM-START document* STREAM-END
# document ::= DOCUMENT-START node DOCUMENT-END
# node ::= SCALAR | sequence | mapping
# sequence ::= SEQUENCE-START node* SEQUENCE-END
# mapping ::= MAPPING-START (node node)* MAPPING-END
__all__ = ['Emitter', 'Emi... |
codrut3/tensorflow | refs/heads/master | tensorflow/contrib/eager/python/metrics.py | 30 | # Copyright 2017 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... |
jbzdak/data-base-checker | refs/heads/master | bdcheckerapp/registration/backend/__init__.py | 1349 | # -*- coding: utf-8 -*- |
zacandcheese/Keyboard-Biometric-Project | refs/heads/master | Project_Tuples/oldMain.py | 1 | #cmd /K "$(FULL_CURRENT_PATH)"
"""
Author: Zachary Nowak
Date:11/3/2017
Program Description: This code can record the
Press Time and Flight Time of a tuple as a user
types a passage and it saves a matrix to a file.
"""
#TO-DO
"""
PRESS TIME
STORING DATA
MAKING A SIGNATURE
"""
"""PYTHON/SITE PACKAGES"""
import win3... |
sergiocorato/odoomrp-wip | refs/heads/8.0 | stock_quant_name_search/models/__init__.py | 18 | # -*- coding: utf-8 -*-
# © 2016 Oihane Crucelaegui - AvanzOSC
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
from . import stock_quant
|
jhoos/django | refs/heads/master | tests/migrations/test_migrations_no_changes/0002_second.py | 439 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("migrations", "0001_initial"),
]
operations = [
migrations.DeleteModel("Tribble"),
migrations.RemoveField("Author",... |
simudream/PyDev.Debugger | refs/heads/development | pydev_imports.py | 53 | from pydevd_constants import USE_LIB_COPY, izip
try:
try:
if USE_LIB_COPY:
from _pydev_imps import _pydev_xmlrpclib as xmlrpclib
else:
import xmlrpclib
except ImportError:
import xmlrpc.client as xmlrpclib
except ImportError:
from _pydev_imps import _pydev_x... |
evz/illuminator | refs/heads/master | tif/wsgi.py | 1 | """
WSGI config for tif project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICATION`` sett... |
devs1991/test_edx_docmode | refs/heads/master | venv/lib/python2.7/site-packages/Crypto/SelfTest/Protocol/__init__.py | 116 | # -*- coding: utf-8 -*-
#
# SelfTest/Protocol/__init__.py: Self-tests for Crypto.Protocol
#
# Written in 2008 by Dwayne C. Litzenberger <dlitz@dlitz.net>
#
# ===================================================================
# The contents of this file are dedicated to the public domain. To
# the extent that dedicat... |
Matir/pwnableweb | refs/heads/master | pwnableapp/client.py | 1 | # Copyright 2014 David Tomaschik <david@systemoverlord.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
#
# Unless required by applic... |
nwchandler/ansible | refs/heads/devel | lib/ansible/modules/network/aos/__init__.py | 12133432 | |
PyCon/pycon | refs/heads/master | symposion/proposals/management/commands/__init__.py | 12133432 | |
alexandrucoman/vbox-nova-driver | refs/heads/master | nova/conductor/tasks/__init__.py | 12133432 | |
mwiebe/numpy | refs/heads/master | numpy/lib/format.py | 33 | """
Define a simple format for saving numpy arrays to disk with the full
information about them.
The ``.npy`` format is the standard binary file format in NumPy for
persisting a *single* arbitrary NumPy array on disk. The format stores all
of the shape and dtype information necessary to reconstruct the array
correctly... |
boompieman/iim_project | refs/heads/master | project_python2/lib/python2.7/site-packages/pip/__init__.py | 57 | #!/usr/bin/env python
from __future__ import absolute_import
import locale
import logging
import os
import optparse
import warnings
import sys
import re
from pip.exceptions import InstallationError, CommandError, PipError
from pip.utils import get_installed_distributions, get_prog
from pip.utils import deprecation, ... |
denny820909/builder | refs/heads/master | lib/python2.7/site-packages/buildbot-0.8.8-py2.7.egg/buildbot/status/web/baseweb.py | 4 | # This file is part of Buildbot. Buildbot 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, version 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without eve... |
popazerty/SDG-e2 | refs/heads/master | lib/python/Screens/TimeDateInput.py | 72 | from Screen import Screen
from Components.config import ConfigClock, ConfigDateTime, getConfigListEntry
from Components.ActionMap import NumberActionMap
from Components.ConfigList import ConfigListScreen
from Components.Label import Label
from Components.Pixmap import Pixmap
import time
import datetime
class TimeDateI... |
MediaKraken/MediaKraken_Deployment | refs/heads/master | source/common/common_serial.py | 1 | """
Copyright (C) 2015 Quinn D Granfor <spootdev@gmail.com>
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... |
klahnakoski/cloc | refs/heads/master | cloc/util/vendor/dateutil/tzwin.py | 227 | # This code was originally contributed by Jeffrey Harris.
import datetime
import struct
import winreg
__all__ = ["tzwin", "tzwinlocal"]
ONEWEEK = datetime.timedelta(7)
TZKEYNAMENT = r"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones"
TZKEYNAME9X = r"SOFTWARE\Microsoft\Windows\CurrentVersion\Time Zones"
TZLOC... |
payal97/portal | refs/heads/develop | systers_portal/community/urls.py | 2 | from django.conf.urls import url
from .views import (CommunityLandingView, EditCommunityProfileView,
ViewCommunityProfileView, CommunityPageView,
AddCommunityPageView, EditCommunityPageView,
DeleteCommunityPageView, CommunityUsersView,
Use... |
mollstam/UnrealPy | refs/heads/master | UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/Python-2.7.10/Lib/encodings/utf_16_le.py | 860 | """ Python 'utf-16-le' Codec
Written by Marc-Andre Lemburg (mal@lemburg.com).
(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.
"""
import codecs
### Codec APIs
encode = codecs.utf_16_le_encode
def decode(input, errors='strict'):
return codecs.utf_16_le_decode(input, errors, True)
class IncrementalEncod... |
knifenomad/django | refs/heads/master | django/contrib/gis/db/backends/mysql/operations.py | 328 | from django.contrib.gis.db.backends.base.adapter import WKTAdapter
from django.contrib.gis.db.backends.base.operations import \
BaseSpatialOperations
from django.contrib.gis.db.backends.utils import SpatialOperator
from django.contrib.gis.db.models import aggregates
from django.db.backends.mysql.operations import D... |
stefan-andritoiu/upm | refs/heads/master | examples/python/light.py | 6 | #!/usr/bin/env python
# Author: Sarah Knepper <sarah.knepper@intel.com>
# Copyright (c) 2014 Intel Corporation.
#
# 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, includin... |
sestrella/ansible | refs/heads/devel | lib/ansible/modules/remote_management/ucs/ucs_vlans.py | 64 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# 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',
'status': ['preview'],
... |
Fab7c4/paparazzi | refs/heads/highwind | select_conf.py | 1 | start.py |
adlnet-archive/edx-platform | refs/heads/master | common/djangoapps/edxmako/template.py | 20 | # Copyright (c) 2008 Mikeal Rogers
#
# 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 agre... |
thaim/ansible | refs/heads/fix-broken-link | lib/ansible/modules/cloud/azure/azure_rm_rediscache.py | 18 | #!/usr/bin/python
#
# Copyright (c) 2018 Yunge Zhu, <yungez@microsoft.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',
... |
jiangzhuo/kbengine | refs/heads/master | kbe/src/lib/python/Lib/test/test_importlib/source/test_source_encoding.py | 81 | from .. import util
from . import util as source_util
machinery = util.import_importlib('importlib.machinery')
import codecs
import importlib.util
import re
import sys
import types
# Because sys.path gets essentially blanked, need to have unicodedata already
# imported for the parser to use.
import unicodedata
import... |
pombredanne/cpe | refs/heads/master | docs/conf.py | 2 | # -*- coding: utf-8 -*-
#
# CPE documentation build configuration file, created by
# sphinx-quickstart on Wed Jun 26 01:11:34 2013.
#
# 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 con... |
Tejal011089/osmosis_erpnext | refs/heads/develop | erpnext/buying/report/purchase_order_trends/__init__.py | 12133432 | |
mushtaqak/edx-platform | refs/heads/master | lms/djangoapps/instructor/tests/views/__init__.py | 12133432 | |
scotthartbti/android_external_chromium_org | refs/heads/kk44 | tools/telemetry/telemetry/page/page_measurement_unittest_base.py | 24 | # Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import unittest
from telemetry.core import util
from telemetry.page import page_runner
from telemetry.page import page as page_module
from telemetry.pag... |
ssorgatem/pulsar | refs/heads/master | test/manager_drmaa_test.py | 4 | from .test_utils import (
BaseManagerTestCase,
skip_unless_module
)
from pulsar.managers.queued_drmaa import DrmaaQueueManager
class DrmaaManagerTest(BaseManagerTestCase):
def setUp(self):
super(DrmaaManagerTest, self).setUp()
self._set_manager()
def tearDown(self):
super(Dr... |
blakfeld/ansible-modules-extras | refs/heads/devel | packaging/os/homebrew_tap.py | 66 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, Daniel Jaouen <dcj24@cornell.edu>
# Based on homebrew (Andrew Dunham <andrew@du.nham.ca>)
#
# 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
# t... |
xujb/odoo | refs/heads/8.0 | addons/payment_adyen/models/adyen.py | 165 | # -*- coding: utf-'8' "-*-"
import base64
try:
import simplejson as json
except ImportError:
import json
from hashlib import sha1
import hmac
import logging
import urlparse
from openerp.addons.payment.models.payment_acquirer import ValidationError
from openerp.addons.payment_adyen.controllers.main import Adye... |
Danath/gyp | refs/heads/master | test/mac/gyptest-loadable-module.py | 34 | #!/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.
"""
Tests that a loadable_module target is built correctly.
"""
import TestGyp
import os
import struct
import sys
if sys.platform == 'dar... |
jarshwah/django | refs/heads/master | tests/i18n/test_compilation.py | 16 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import gettext as gettext_module
import os
import stat
import unittest
from subprocess import Popen
from django.core.management import (
CommandError, call_command, execute_from_command_line,
)
from django.core.management.commands.makemessages import... |
jacek99/corepost | refs/heads/master | corepost/test/home_resource.py | 1 | '''
Server tests
@author: jacekf
'''
from corepost.web import RESTResource, route
from corepost.enums import Http, MediaType, HttpHeader
from twisted.internet import defer
from xml.etree import ElementTree
import json, yaml
class HomeApp():
def __init__(self,*args,**kwargs):
self.issue1 = "issue 1"
... |
public-ink/public-ink | refs/heads/master | server/appengine-staging/lib/unidecode/x07b.py | 252 | data = (
'Mang ', # 0x00
'Zhu ', # 0x01
'Utsubo ', # 0x02
'Du ', # 0x03
'Ji ', # 0x04
'Xiao ', # 0x05
'Ba ', # 0x06
'Suan ', # 0x07
'Ji ', # 0x08
'Zhen ', # 0x09
'Zhao ', # 0x0a
'Sun ', # 0x0b
'Ya ', # 0x0c
'Zhui ', # 0x0d
'Yuan ', # 0x0e
'Hu ', # 0x0f
'Gang ', # 0x10
... |
Distrotech/intellij-community | refs/heads/master | python/testData/refactoring/invertBoolean/parameter.before.py | 83 | def foo(v<caret>ar=True):
var1 = True
return var |
tinkerthaler/odoo | refs/heads/8.0 | openerp/tests/common.py | 60 | # -*- coding: utf-8 -*-
"""
The module :mod:`openerp.tests.common` provides unittest2 test cases and a few
helpers and classes to write tests.
"""
import errno
import glob
import json
import logging
import os
import select
import subprocess
import threading
import time
import unittest2
import urllib2
import xmlrpclib
... |
RAtechntukan/CouchPotatoServer | refs/heads/develop | couchpotato/core/media/movie/providers/trailer/mechanize/_util.py | 123 | """Utility functions and date/time routines.
Copyright 2002-2006 John J Lee <jjl@pobox.com>
This code is free software; you can redistribute it and/or modify it
under the terms of the BSD or ZPL 2.1 licenses (see the file
COPYING.txt included with the distribution).
"""
import re
import time
import warnings
class... |
xiaoyaozi5566/DiamondCache | refs/heads/master | tests/configs/tsunami-simple-atomic.py | 14 | # Copyright (c) 2006-2007 The Regents of The University of Michigan
# 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 ... |
pozdnyakov/chromium-crosswalk | refs/heads/master | tools/telemetry/telemetry/core/possible_browser.py | 33 | # Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
class PossibleBrowser(object):
"""A browser that can be controlled.
Call Create() to launch the browser and begin manipulating it..
"""
def __in... |
RitwikGupta/pattern | refs/heads/master | pattern/server/cherrypy/cherrypy/wsgiserver/__init__.py | 238 | __all__ = ['HTTPRequest', 'HTTPConnection', 'HTTPServer',
'SizeCheckWrapper', 'KnownLengthRFile', 'ChunkedRFile',
'MaxSizeExceeded', 'NoSSLError', 'FatalSSLAlert',
'WorkerThread', 'ThreadPool', 'SSLAdapter',
'CherryPyWSGIServer',
'Gateway', 'WSGIGateway', 'WSGIGate... |
robertmattmueller/sdac-compiler | refs/heads/master | sympy/plotting/plot_implicit.py | 12 | """Implicit plotting module for SymPy
The module implements a data series called ImplicitSeries which is used by
``Plot`` class to plot implicit plots for different backends. The module,
by default, implements plotting using interval arithmetic. It switches to a
fall back algorithm if the expression cannot be plotted ... |
mickburgs/taxi-sam | refs/heads/master | node_modules/node-gyp/gyp/pylib/gyp/MSVSToolFile.py | 2736 | # 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.
"""Visual Studio project reader/writer."""
import gyp.common
import gyp.easy_xml as easy_xml
class Writer(object):
"""Visual Studio XML tool file writer."""
... |
sharkykh/SickRage | refs/heads/develop | lib/twilio/rest/resources/trunking/trunks.py | 24 | from .. import NextGenInstanceResource, NextGenListResource
class Trunk(NextGenInstanceResource):
"""
A Trunk resource.
See the `TaskRouter API reference
<https://www.twilio.com/docs/sip-trunking/rest/trunks>_`
for more information.
.. attribute:: sid
The unique ID for this Trunk.
... |
blademainer/intellij-community | refs/heads/master | python/lib/Lib/distutils/ccompiler.py | 81 | """distutils.ccompiler
Contains CCompiler, an abstract base class that defines the interface
for the Distutils compiler abstraction model."""
# This module should be kept compatible with Python 2.1.
__revision__ = "$Id: ccompiler.py 46331 2006-05-26 14:07:23Z bob.ippolito $"
import sys, os, re
from types import *
f... |
minhphung171093/GreenERP_V7 | refs/heads/master | openerp/addons/account_check_writing/account_voucher.py | 33 | # -*- 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... |
gcode-mirror/audacity | refs/heads/master | lib-src/lv2/lv2/plugins/eg01-amp.lv2/waflib/Options.py | 330 | #! /usr/bin/env python
# encoding: utf-8
# WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file
import os,tempfile,optparse,sys,re
from waflib import Logs,Utils,Context
cmds='distclean configure build install clean uninstall check dist distcheck'.split()
options={}
comma... |
xdegenne/cloudify-plugins-common | refs/heads/wfworks | cloudify/manager.py | 2 | ########
# Copyright (c) 2014 GigaSpaces Technologies Ltd. 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... |
TheKK/Shedskin | refs/heads/master | examples/com/github/tarsa/tarsalzp/prelude/Long.py | 6 | #
# Copyright (c) 2012, Piotr Tarsa
# 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 fol... |
jeremyh/agdc | refs/heads/master | src/abstract_ingester/tile_record.py | 4 | #!/usr/bin/env python
#===============================================================================
# Copyright (c) 2014 Geoscience Australia
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
... |
fvcproductions/dotfiles | refs/heads/master | bin/sketch/Plugins/WakaTime.sketchplugin/Contents/Resources/wakatime/packages/pygments/styles/rrt.py | 31 | # -*- coding: utf-8 -*-
"""
pygments.styles.rrt
~~~~~~~~~~~~~~~~~~~
pygments "rrt" theme, based on Zap and Emacs defaults.
:copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.style import Style
from pygments.token import Com... |
neumerance/cloudloon2 | refs/heads/master | .venv/lib/python2.7/site-packages/django/contrib/localflavor/in_/in_states.py | 197 | """
A mapping of state misspellings/abbreviations to normalized abbreviations, and
an alphabetical list of states for use as `choices` in a formfield.
This exists in this standalone file so that it's only imported into memory
when explicitly needed.
"""
STATE_CHOICES = (
('KA', 'Karnataka'),
('AP', 'Andhra Pr... |
utopiaprince/micropython | refs/heads/master | tests/float/string_format.py | 21 | # Change the following to True to get a much more comprehensive set of tests
# to run, albeit, which take considerably longer.
full_tests = False
def test(fmt, *args):
print('{:8s}'.format(fmt) + '>' + fmt.format(*args) + '<')
test("{:10.4}", 123.456)
test("{:10.4e}", 123.456)
test("{:10.4e}", -123.456)
test("{... |
owlzhou/ttornado | refs/heads/master | env/Lib/site-packages/pip/_vendor/html5lib/trie/__init__.py | 1735 | from __future__ import absolute_import, division, unicode_literals
from .py import Trie as PyTrie
Trie = PyTrie
try:
from .datrie import Trie as DATrie
except ImportError:
pass
else:
Trie = DATrie
|
suxinde2009/thefuck | refs/heads/master | tests/rules/test_django_south_merge.py | 20 | import pytest
from thefuck.rules.django_south_merge import match, get_new_command
from tests.utils import Command
@pytest.fixture
def stderr():
return '''Running migrations for app:
! Migration app:0003_auto... should not have been applied before app:0002_auto__add_field_query_due_date_ but was.
Traceback (most ... |
kelvin13/shifty-octocat | refs/heads/master | pygments/lexers/_cocoa_builtins.py | 25 | # -*- coding: utf-8 -*-
"""
pygments.lexers._cocoa_builtins
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This file defines a set of types used across Cocoa frameworks from Apple.
There is a list of @interfaces, @protocols and some other (structs, unions)
File may be also used as standalone generator for aboves... |
austinhartzheim/gravel | refs/heads/master | account/migrations/__init__.py | 12133432 | |
RuralIndia/pari | refs/heads/master | pari/album/__init__.py | 12133432 | |
marchon/poker | refs/heads/master | tests/handhistory/conftest.py | 2 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals, absolute_import, division, print_function
import pytest
from poker.room.pokerstars import PokerStarsHandHistory
from . import stars_hands
# get every variable starting with 'HAND' from hand_data module
all_test_hands = [getattr(stars_hands, hand_text)
... |
amadeusproject/amadeuslms | refs/heads/master | chat/serializers.py | 1 | """
Copyright 2016, 2017 UFPE - Universidade Federal de Pernambuco
Este arquivo é parte do programa Amadeus Sistema de Gestão de Aprendizagem, ou simplesmente Amadeus LMS
O Amadeus LMS é um software livre; você pode redistribui-lo e/ou modifica-lo dentro dos termos da Licença Pública Geral GNU como publicada pela ... |
LK/advent-of-code | refs/heads/master | 2016/10-2.py | 1 | import re
class Bot(object):
def __init__(self, id, start, low, high):
self.id = id
self.chips = start
self.low = low
self.high = high
def give_chip(self, chip, bots):
self.chips.append(chip)
if len(self.chips) == 2:
min_chip = min(self.chips)
max_chip = max(self.chips)
self.chips = []
bots... |
gorhill/uMatrix | refs/heads/master | dist/chromium/publish-beta.py | 1 | #!/usr/bin/env python3
import datetime
import json
import jwt
import os
import re
import requests
import shutil
import subprocess
import sys
import tempfile
import time
import zipfile
from distutils.version import StrictVersion
from string import Template
# - Download target (raw) uMatrix.chromium.zip from GitHub
# ... |
netcon-source/OpenClimateGIS | refs/heads/master | src/openclimategis/util/ncconv/experimental/ocg_dataset/sub.py | 7 | from util.ncconv.experimental.helpers import *
from shapely import prepared
from shapely.ops import cascaded_union
from util.ncconv.experimental.ocg_dataset.todb import sub_to_db
from util.ncconv.experimental.ordered_dict import OrderedDict
from warnings import warn
class SubOcgDataset(object):
__attrs__ = ['geom... |
joone/chromium-crosswalk | refs/heads/2016.04.css-round-display-edtior-draft-1 | tools/site_compare/scrapers/ie/__init__.py | 179 | #!/usr/bin/env python
# Copyright (c) 2011 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.
"""Selects the appropriate scraper for Internet Explorer."""
def GetScraper(version):
"""Returns the scraper module for the giv... |
colinnewell/odoo | refs/heads/8.0 | addons/website/tests/test_views.py | 144 | # -*- coding: utf-8 -*-
import itertools
import unittest2
from lxml import etree as ET, html
from lxml.html import builder as h
from openerp.tests import common
def attrs(**kwargs):
return dict(('data-oe-%s' % key, str(value)) for key, value in kwargs.iteritems())
class TestViewSaving(common.TransactionCase):
... |
was4444/chromium.src | refs/heads/nw15 | third_party/libxslt/win32/runtests.py | 1 | import io
import os
import sys
import difflib
from os import path
from subprocess import Popen, PIPE
xsltproc = path.join(os.getcwd(), "win32", "bin.msvc", "xsltproc.exe")
if not path.isfile(xsltproc):
raise FileNotFoundError(xsltproc)
def runtests(xsl_dir, xml_dir="."):
old_dir = os.getcwd()
os.chdir(xs... |
merzlyakov-me/merzlyakov-me-blog | refs/heads/master | merzlyakov/seo/models.py | 1 | from django.db import models
class PostExcerpt(models.Model):
"""
Excerpt to generate meta description
"""
class Meta:
abstract = True
def verify_title_seo(self):
title_length = len(self.title)
title_words = len(self.title.split(' '))
error_msgs = []
if ti... |
andaluri/rootio_web | refs/heads/master | scheduler/test_scripts/env.py | 7 | import re, os, sys
def read_env(from_file):
"""Read and set environment variables from a file
https://gist.github.com/bennylope/2999704"""
try:
with open(from_file) as f:
content = f.read()
except IOError:
print "IOError: unable to open",from_file
sys.exit(-1)
n... |
fuselock/odoo | refs/heads/8.0 | openerp/tools/misc.py | 62 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
# Copyright (C) 2010-2014 OpenERP s.a. (<http://openerp.com>).
#
# This program is free software: you ca... |
joernhees/scikit-learn | refs/heads/master | sklearn/manifold/mds.py | 20 | """
Multi-dimensional Scaling (MDS)
"""
# author: Nelle Varoquaux <nelle.varoquaux@gmail.com>
# License: BSD
import numpy as np
import warnings
from ..base import BaseEstimator
from ..metrics import euclidean_distances
from ..utils import check_random_state, check_array, check_symmetric
from ..externals.joblib impo... |
intirix/LedManager | refs/heads/master | Pi/bin/SendCommand.py | 1 | #!/usr/bin/python
import serial
import os
import sys
dev = "/dev/ttyACM0"
if not os.path.exists( dev ):
dev = "/dev/ttyACM1"
if not os.path.exists( dev ):
print( "Could not find a device to use" )
sys.exit(1)
print( "Using device " + dev )
ser = serial.Serial( dev )
cmd = ' '.join( sys.argv[ 1 : ] )
print( "Send... |
benjamindeleener/odoo | refs/heads/master | addons/account_budget/wizard/account_budget_report.py | 47 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import time
from openerp.osv import fields, osv
class account_budget_report(osv.osv_memory):
_name = "account.budget.report"
_description = "Account Budget report for analytic account"
_columns = {
... |
kieferbonk/xbmc-finnish-tv | refs/heads/master | plugin.video.yleareena/win32/Crypto/SelfTest/Protocol/test_rfc1751.py | 132 | #
# Test script for Crypto.Util.RFC1751.
#
# Part of the Python Cryptography Toolkit
#
# Written by Andrew Kuchling and others
#
# ===================================================================
# The contents of this file are dedicated to the public domain. To
# the extent that dedication to the public domain is ... |
takeflight/wagtail | refs/heads/master | wagtail/search/tests/test_related_fields.py | 24 | from django.test import TestCase
from wagtail.search import index
from wagtail.tests.search.models import Book, Novel
from wagtail.tests.testapp.models import Advert, ManyToManyBlogPage
class TestSelectOnQuerySet(TestCase):
def test_select_on_queryset_with_foreign_key(self):
fields = index.RelatedFields(... |
sarantapichos/faircoop-market | refs/heads/master | addons/base_import/test_models.py | 399 | from openerp.osv import orm, fields
def name(n): return 'base_import.tests.models.%s' % n
class char(orm.Model):
_name = name('char')
_columns = {
'value': fields.char('unknown')
}
class char_required(orm.Model):
_name = name('char.required')
_columns = {
'value': fields.char('u... |
pyQode/pyqode.python | refs/heads/master | examples/modes/calltips.py | 3 | """
Minimal example showing the use of the CalltipsMode.
"""
import logging
logging.basicConfig(level=logging.DEBUG)
import sys
from pyqode.qt import QtWidgets
from pyqode.core.api import CodeEdit
from pyqode.python.backend import server
from pyqode.python.modes import CalltipsMode
if __name__ == '__main__':
app... |
SpaceVim/SpaceVim | refs/heads/master | bundle/defx.nvim/rplugin/python3/defx/column/__init__.py | 12133432 | |
vsporeddy/bigbang | refs/heads/master | tests/__init__.py | 12133432 | |
edx/lettuce | refs/heads/master | tests/integration/django/cucumber/settings.py | 20 | # Django settings for cucumber project.
DEBUG = True
TEMPLATE_DEBUG = DEBUG
# Make this unique, and don't share it with anybody.
SECRET_KEY = '3c=9-_@gug3+!j*o*b$1!g8e7037(ghrns8pqygog1gs1f^zqu'
ROOT_URLCONF = 'cucumber.urls'
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3', # Add 'postg... |
ElementalAlchemist/txircd | refs/heads/master | txircd/modules/extra/sapart.py | 1 | from twisted.plugin import IPlugin
from twisted.words.protocols import irc
from txircd.module_interface import ICommand, IModuleData, Command, ModuleData
from zope.interface import implements
class SapartCommand(ModuleData, Command):
implements(IPlugin, IModuleData, ICommand)
name = "SapartCommand"
def userComman... |
JackGavin13/octoprint-test-not-finished | refs/heads/master | src/octoprint/util/platform/__init__.py | 1 | # coding=utf-8
from __future__ import absolute_import, division, print_function
__license__ = 'GNU Affero General Public License http://www.gnu.org/licenses/agpl.html'
__copyright__ = "Copyright (C) 2017 The OctoPrint Project - Released under terms of the AGPLv3 License"
import sys
try:
import fcntl
except ImportEr... |
Azure/azure-sdk-for-python | refs/heads/sync-eng/common-js-nightly-docs-2-1768-ForTestPipeline | sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_service_tags_operations.py | 1 | # 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 may ... |
fengbeihong/tempest_automate_ironic | refs/heads/master | tempest/api/compute/admin/test_floating_ips_bulk.py | 3 | # Copyright 2014 NEC Technologies India Ltd.
# 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
#
# Unle... |
ric2b/Vivaldi-browser | refs/heads/master | chromium/third_party/blink/web_tests/external/wpt/tools/wptrunner/wptrunner/browsers/edge_webdriver.py | 31 | from .base import inherit
from . import edge
from ..executors.executorwebdriver import (WebDriverTestharnessExecutor, # noqa: F401
WebDriverRefTestExecutor) # noqa: F401
inherit(edge, globals(), "edge_webdriver")
# __wptrunner__ magically appears from inherit, F821 is un... |
obi-two/Rebelion | refs/heads/master | data/scripts/templates/object/tangible/lair/base/shared_poi_all_lair_thicket_small_fog_red.py | 2 | #### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Tangible()
result.template = "object/tangible/lair/base/shared_poi_all_lair_thicket_small_fog_red.iff"
result.att... |
Absimpl/Abstream | refs/heads/master | kivytest_version2_12_windows/kivy/multistroke.py | 43 | '''
Multistroke gesture recognizer
==============================
.. versionadded::
1.9.0
.. warning::
This is experimental and subject to change as long as this warning notice
is present.
See :file:`kivy/examples/demo/multistroke/main.py` for a complete application
example.
Conceptual Overview
-------... |
jswope00/GAI | refs/heads/master | lms/djangoapps/instructor/management/commands/dump_grades.py | 18 | #!/usr/bin/python
#
# django management command: dump grades to csv files
# for use by batch processes
import csv
from instructor.views.legacy import get_student_grade_summary_data
from courseware.courses import get_course_by_id
from xmodule.modulestore.django import modulestore
from django.core.management.base impo... |
vjmac15/Lyilis | refs/heads/master | lib/youtube_dl/extractor/pornhd (VJ Washington's conflicted copy 2017-08-29).py | 2 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
ExtractorError,
int_or_none,
js_to_json,
)
class PornHdIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?pornhd\.com/(?:[a-z]{2,4}/)?videos/(?P<id>\d+)(?:/(?P<display_id>.+))?'
_TESTS = [... |
Metaswitch/pjsip-upstream | refs/heads/master | tests/pjsua/scripts-recvfrom/235_reg_good_tel_uri_enocredential.py | 57 | # $Id: 235_reg_good_tel_uri_enocredential.py 3323 2010-09-28 07:43:18Z bennylp $
import inc_sip as sip
import inc_sdp as sdp
pjsua = "--null-audio --id=tel:+12345 --registrar sip:127.0.0.1:$PORT"
req1 = sip.RecvfromTransaction("", 401,
include=["REGISTER sip"],
exclude=["Authorization"],
resp_hdr=["WWW-A... |
webOS-ports/qtwebkit | refs/heads/webOS-ports/master | Tools/Scripts/webkitpy/common/message_pool.py | 129 | # Copyright (C) 2011 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 ... |
pablomuri/Engine | refs/heads/python-core2 | libraries/netip/python/__init__.py | 12133432 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.