repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
lukebakken/riak-python-pbcpp | refs/heads/master | riak/riak_pb2.py | 1 | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: riak.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 _reflecti... |
zqfan/leetcode | refs/heads/master | algorithms/516. Longest Palindromic Subsequence/solution.py | 1 | class Solution(object):
def longestPalindromeSubseq(self, s):
"""
:type s: str
:rtype: int
"""
# based on @jedihy
dp = [1] * len(s)
for end in xrange(len(s)):
for start in reversed(xrange(end)):
if s[start] == s[end]:
... |
SachaMPS/django-cms | refs/heads/develop | cms/utils/decorators.py | 34 | # -*- coding: utf-8 -*-
from django.conf import settings
from django.contrib.auth.views import redirect_to_login
from django.utils.http import urlquote
from cms.page_rendering import _handle_no_page
def cms_perms(func):
def inner(request, *args, **kwargs):
page = request.current_page
if page:
... |
dchaplinsky/pep.org.ua | refs/heads/master | pepdb/cms_pages/migrations/0009_auto_20151025_0116.py | 1 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import wagtail.wagtailcore.fields
class Migration(migrations.Migration):
dependencies = [
('cms_pages', '0008_auto_20151025_0051'),
]
operations = [
migrations.AddField(
... |
airbnb/knowledge-repo | refs/heads/master | knowledge_repo/app/utils/posts.py | 1 | """Functions that interact with posts.
Functions include:
- get_posts
- get_all_post_stats
"""
import math
from flask import current_app
from sqlalchemy import func, distinct, or_
from ..proxies import db_session
from ..models import (Comment, PageView, Post,
Tag, Vote, User)
def get_q... |
mikewiebe-ansible/ansible | refs/heads/devel | lib/ansible/module_utils/parsing/convert_bool.py | 118 | # Copyright: 2017, Ansible Project
# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause )
from ansible.module_utils.six import binary_type, text_type
from ansible.module_utils._text import to_text
BOOLEANS_TRUE = frozenset(('y', 'yes', 'on', '1', 'true', 't', 1, 1... |
alrifqi/django | refs/heads/master | tests/template_tests/filter_tests/test_timesince.py | 207 | from __future__ import unicode_literals
from datetime import datetime, timedelta
from django.template.defaultfilters import timesince_filter
from django.test import SimpleTestCase
from django.test.utils import requires_tz_support
from ..utils import setup
from .timezone_utils import TimezoneTestCase
class Timesinc... |
ayosef/pynet_test | refs/heads/master | class9/ex7/mytest/whatever.py | 27 | '''
Python class on writing reusable code
'''
def func3():
'''Simple test function'''
print "Whatever"
if __name__ == "__main__":
print "Main program - whatever"
|
furious-luke/django-qunit-tests | refs/heads/master | examples/example_site/example_site/wsgi.py | 2 | """
WSGI config for example_site project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/dev/howto/deployment/wsgi/
"""
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "example_site.settings")
from dja... |
nkuhlen/replication-study-financial-macro | refs/heads/nk | .mywaflib/waflib/extras/pgicc.py | 10 | #!/usr/bin/env python
# encoding: utf-8
# Antoine Dechaume 2011
"""
Detect the PGI C compiler
"""
import sys, re
from waflib.Configure import conf
from waflib.Tools.compiler_c import c_compiler
c_compiler['linux'].append('pgicc')
@conf
def find_pgi_compiler(conf, var, name):
"""
Find the program name, and execute ... |
jhjguxin/blogserver | refs/heads/master | apps/about/tests.py | 1940 | """
This file demonstrates two different styles of tests (one doctest and one
unittest). These will both pass when you run "manage.py test".
Replace these with more appropriate tests for your application.
"""
from django.test import TestCase
class SimpleTest(TestCase):
def test_basic_addition(self):
"""
... |
tboyce021/home-assistant | refs/heads/dev | homeassistant/components/rflink/light.py | 7 | """Support for Rflink lights."""
import logging
import voluptuous as vol
from homeassistant.components.light import (
ATTR_BRIGHTNESS,
PLATFORM_SCHEMA,
SUPPORT_BRIGHTNESS,
LightEntity,
)
from homeassistant.const import CONF_NAME, CONF_TYPE
import homeassistant.helpers.config_validation as cv
from . i... |
camptocamp/odoo | refs/heads/master | addons/account_payment/account_invoice.py | 382 | # -*- 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... |
Tivix/wagtail | refs/heads/master | wagtail/tests/testapp/migrations/0011_auto_20151006_2141.py | 4 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import taggit.managers
import wagtail.wagtailadmin.taggable
from django.conf import settings
import wagtail.wagtailimages.models
class Migration(migrations.Migration):
dependencies = [
('taggit', '00... |
cntnboys/410Lab6 | refs/heads/master | build/django/tests/test_runner/valid_app/tests/__init__.py | 5 | import unittest
class SampleTest(unittest.TestCase):
def test_one(self):
pass
|
krismz/Delv | refs/heads/master | examples/code_snippets/qplot_example.py | 1 | # Run from jython started from run.sh
# ie ./jython.sh qplot_example.py
import org.rosuda.JRI.Rengine as Rengine
if __name__ == "__main__":
reng = Rengine(["--vanilla"], False, None)
# set up R library environment
reng.eval('library(ggplot2)') # for qplot
reng.eval('library(gridSVG)') # for SVG annotation and... |
jpmfribeiro/PyCharts | refs/heads/master | build/lib.linux-x86_64-2.7/pycharts/charts/highchart.py | 2 |
class HighChart(object):
def to_javascript(self):
pass
def script_header(self):
# jsc = '''<script src="/home/jpedro/workspace/tools/highcharts/js/highcharts.js"></script>
# <script src="/home/jpedro/workspace/tools/highcharts/js/modules/exporting.js"></script>
# <script src="... |
cgstudiomap/cgstudiomap | refs/heads/develop | main/parts/odoo/addons/procurement/__init__.py | 374 | # -*- 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... |
impl/rbppc-linux | refs/heads/master | tools/perf/util/setup.py | 989 | #!/usr/bin/python2
from distutils.core import setup, Extension
from os import getenv
from distutils.command.build_ext import build_ext as _build_ext
from distutils.command.install_lib import install_lib as _install_lib
class build_ext(_build_ext):
def finalize_options(self):
_build_ext.finalize_optio... |
brianwoo/django-tutorial | refs/heads/master | build/Django/tests/lookup/tests.py | 33 | from __future__ import unicode_literals
from datetime import datetime
from operator import attrgetter
from unittest import skipUnless
from django.core.exceptions import FieldError
from django.db import connection
from django.test import TestCase, TransactionTestCase, skipUnlessDBFeature
from .models import Article, ... |
orbitfp7/horizon | refs/heads/master | horizon/tables/__init__.py | 48 | # Copyright 2012 Nebula, 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 agree... |
ivanbaldo/yowsup | refs/heads/master | yowsup/layers/protocol_receipts/protocolentities/test_receipt_outgoing.py | 68 | from yowsup.layers.protocol_receipts.protocolentities import OutgoingReceiptProtocolEntity
from yowsup.structs.protocolentity import ProtocolEntityTest
import unittest
class OutgoingReceiptProtocolEntityTest(ProtocolEntityTest, unittest.TestCase):
def setUp(self):
self.ProtocolEntity = OutgoingReceiptProto... |
Allow2CEO/browser-ios | refs/heads/master | brave/node_modules/bloom-filter-cpp/vendor/depot_tools/third_party/boto/file/key.py | 82 | # Copyright 2010 Google Inc.
# Copyright (c) 2011, Nexenta Systems Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use... |
Zhongqilong/mykbengineer | refs/heads/master | kbe/src/lib/python/Lib/distutils/tests/test_install_headers.py | 147 | """Tests for distutils.command.install_headers."""
import sys
import os
import unittest
import getpass
from distutils.command.install_headers import install_headers
from distutils.tests import support
from test.support import run_unittest
class InstallHeadersTestCase(support.TempdirManager,
... |
rlanyi/mitro | refs/heads/master | browser-ext/third_party/firefox-addon-sdk/python-lib/cuddlefish/prefs.py | 28 | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
DEFAULT_COMMON_PREFS = {
# allow debug output via dump to be printed to the system console
# (setting it here ju... |
Venturi/oldcms | refs/heads/master | env/lib/python2.7/site-packages/unidecode/x1d7.py | 248 | data = (
'', # 0x00
'', # 0x01
'', # 0x02
'', # 0x03
'', # 0x04
'', # 0x05
'', # 0x06
'', # 0x07
'', # 0x08
'', # 0x09
'', # 0x0a
'', # 0x0b
'', # 0x0c
'', # 0x0d
'', # 0x0e
'', # 0x0f
'', # 0x10
'', # 0x11
'', # 0x12
'', # 0x13
'', # 0x14
'', # 0x15
'',... |
silveregg/moto | refs/heads/master | moto/rds2/__init__.py | 21 | from __future__ import unicode_literals
from .models import rds2_backends
from ..core.models import MockAWS
rds2_backend = rds2_backends['us-west-1']
def mock_rds2(func=None):
if func:
return MockAWS(rds2_backends)(func)
else:
return MockAWS(rds2_backends)
|
bailey1234/hyeri7846 | refs/heads/master | lib/werkzeug/serving.py | 309 | # -*- coding: utf-8 -*-
"""
werkzeug.serving
~~~~~~~~~~~~~~~~
There are many ways to serve a WSGI application. While you're developing
it you usually don't want a full blown webserver like Apache but a simple
standalone one. From Python 2.5 onwards there is the `wsgiref`_ server in
the standa... |
m11s/MissionPlanner | refs/heads/master | Lib/site-packages/numpy/ma/tests/test_regression.py | 60 | from numpy.testing import *
import numpy as np
rlevel = 1
class TestRegression(TestCase):
def test_masked_array_create(self,level=rlevel):
"""Ticket #17"""
x = np.ma.masked_array([0,1,2,3,0,4,5,6],mask=[0,0,0,1,1,1,0,0])
assert_array_equal(np.ma.nonzero(x),[[1,2,6,7]])
def test_masked... |
chriskiehl/Gooey | refs/heads/master | gooey/gui/components/menubar.py | 2 | import webbrowser
from functools import partial
import wx
from gooey.gui import three_to_four
class MenuBar(wx.MenuBar):
"""
Wx.MenuBar handles converting the users list of Menu Groups into
concrete wx.Menu instances.
"""
def __init__(self, buildSpec, *args, **kwargs):
su... |
isyippee/nova | refs/heads/master | nova/db/sqlalchemy/api_models.py | 43 | # 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
# d... |
SeungGiJeong/SK_FastIR | refs/heads/master | filecatcher/windows2008ServerFiles.py | 1 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import os
from fileCatcher import _FileCatcher
from utils.vss import _VSS
class Windows2008ServerFiles(_FileCatcher):
def __init__(self, params):
super(Windows2008ServerFiles, self).__init__(params)
drive, p = os.path.splitdrive(sel... |
apache/incubator-superset | refs/heads/master | superset/annotation_layers/commands/delete.py | 3 | # 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... |
Evil-Green/Lonas_KL-GT-I9300 | refs/heads/master | tools/perf/scripts/python/netdev-times.py | 11271 | # Display a process of packets and processed time.
# It helps us to investigate networking or network device.
#
# options
# tx: show only tx chart
# rx: show only rx chart
# dev=: show only thing related to specified device
# debug: work with debug mode. It shows buffer status.
import os
import sys
sys.path.append(os... |
karger/nbproject | refs/heads/master | apps/base/forms.py | 5 | from django.forms import Form, ModelForm, ValidationError
from base import models as M
from django.forms.fields import CharField
from django.forms.widgets import PasswordInput
class EnterYourNameUserForm(ModelForm):
def clean_firstname(self):
data = self.cleaned_data["firstname"].strip()
if da... |
hybrideagle/django | refs/heads/master | django/db/backends/base/schema.py | 339 | import hashlib
import logging
from django.db.backends.utils import truncate_name
from django.db.transaction import atomic
from django.utils import six
from django.utils.encoding import force_bytes
logger = logging.getLogger('django.db.backends.schema')
def _related_non_m2m_objects(old_field, new_field):
# Filte... |
julian-seward1/servo | refs/heads/master | tests/wpt/web-platform-tests/tools/py/py/_process/killproc.py | 278 | import py
import os, sys
if sys.platform == "win32" or getattr(os, '_name', '') == 'nt':
try:
import ctypes
except ImportError:
def dokill(pid):
py.process.cmdexec("taskkill /F /PID %d" %(pid,))
else:
def dokill(pid):
PROCESS_TERMINATE = 1
handle ... |
wimnat/ansible | refs/heads/devel | test/units/module_utils/common/validation/test_check_type_bits.py | 83 | # -*- coding: utf-8 -*-
# Copyright (c) 2019 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
import pytest
from ansible.module_utils._text import to_native
from ansible.m... |
rdkit/rdkit-orig | refs/heads/master | rdkit/ML/DecTree/QuantTree.py | 2 | # $Id$
#
# Copyright (C) 2001, 2003 greg Landrum and Rational Discovery LLC
# All Rights Reserved
#
""" Defines the class _QuantTreeNode_, used to represent decision trees with automatic
quantization bounds
_QuantTreeNode_ is derived from _DecTree.DecTreeNode_
"""
from rdkit.ML.DecTree import DecTree,Tree
cla... |
apache/incubator-airflow | refs/heads/master | tests/api_connexion/endpoints/test_event_log_endpoint.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... |
MattCCS/PyVault | refs/heads/master | site-packages/pip/_vendor/cachecontrol/caches/file_cache.py | 762 | import hashlib
import os
from pip._vendor.lockfile import LockFile
from pip._vendor.lockfile.mkdirlockfile import MkdirLockFile
from ..cache import BaseCache
from ..controller import CacheController
def _secure_open_write(filename, fmode):
# We only want to write to this file, so open it in write only mode
... |
khushboo9293/mailman3 | refs/heads/develop | src/mailman/database/transaction.py | 7 | # Copyright (C) 2006-2015 by the Free Software Foundation, Inc.
#
# This file is part of GNU Mailman.
#
# GNU Mailman 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 you... |
CybOXProject/python-cybox | refs/heads/master | cybox/test/objects/network_route_test.py | 1 | # Copyright (c) 2017, The MITRE Corporation. All rights reserved.
# See LICENSE.txt for complete terms.
import unittest
from mixbox.vendor.six import u
from cybox.objects.network_route_object import NetRoute
from cybox.test.objects import ObjectTestCase
from cybox.test.objects.network_route_entry_test import TestNe... |
ramadhane/odoo | refs/heads/8.0 | addons/mail/report/__init__.py | 438 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2009-Today OpenERP SA (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms ... |
krig/beets | refs/heads/master | test/test_library.py | 7 | # This file is part of beets.
# Copyright 2013, Adrian Sampson.
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, ... |
Pennebaker/wagtail | refs/heads/master | wagtail/wagtailsearch/urls/__init__.py | 40 | from wagtail.wagtailsearch.urls.frontend import urlpatterns # noqa
|
GNS3/gns3-server | refs/heads/master | gns3server/controller/topology.py | 1 | #!/usr/bin/env python
#
# Copyright (C) 2016 GNS3 Technologies Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
... |
cts2/rf2service | refs/heads/master | server/converters/tojson.py | 1 | # -*- coding: utf-8 -*-
# Copyright (c) 2013, Mayo Clinic
# 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
# ... |
dustinblake/polactions | refs/heads/master | Support/googlecode_upload.py | 2 | #!/usr/bin/env python
#
# Copyright 2006, 2007 Google Inc. All Rights Reserved.
# Author: [email protected] (David Anderson)
#
# Script for uploading files to a Google Code project.
#
# This is intended to be both a useful script for people who want to
# streamline project uploads and a reference implementation for
... |
doheekim/chuizonetest | refs/heads/master | lib/sqlalchemy/event/legacy.py | 33 | # event/legacy.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
"""Routines to handle adaption of legacy call signatures,
generation of deprecation ... |
fayf/pyload | refs/heads/stable | module/plugins/hoster/CrockoCom.py | 3 | # -*- coding: utf-8 -*-
import re
import urlparse
from module.plugins.captcha.ReCaptcha import ReCaptcha
from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
class CrockoCom(SimpleHoster):
__name__ = "CrockoCom"
__type__ = "hoster"
__version__ = "0.21"
__status__ = "t... |
jchevin/MissionPlanner-master | refs/heads/master | packages/IronPython.StdLib.2.7.4/content/Lib/timeit.py | 76 | #! /usr/bin/env python
"""Tool for measuring execution time of small code snippets.
This module avoids a number of common traps for measuring execution
times. See also Tim Peters' introduction to the Algorithms chapter in
the Python Cookbook, published by O'Reilly.
Library usage: see the Timer class.
Command line ... |
parkera/swift | refs/heads/master | benchmark/scripts/perf_test_driver/perf_test_driver.py | 22 | #!/usr/bin/env python
# ===--- perf_test_driver.py ---------------------------------------------===//
#
# This source file is part of the Swift.org open source project
#
# Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
# Licensed under Apache License v2.0 with Runtime Library Exception
#
# See ... |
grrr2/Flexget | refs/heads/master | flexget/plugins/output/pushover.py | 2 | from __future__ import unicode_literals, division, absolute_import
import logging
from requests.exceptions import RequestException
from flexget import plugin
from flexget.event import event
from flexget.utils import json
from flexget.utils.template import RenderError
from flexget.config_schema import one_or_more
log ... |
karek314/bitcoin | refs/heads/master | qa/rpc-tests/getchaintips.py | 140 | #!/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... |
rgreinho/molecule | refs/heads/master | molecule/driver/dockerdriver.py | 1 | # Copyright (c) 2015-2016 Cisco Systems, Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge... |
quanvm009/codev7 | refs/heads/master | openerp/addons/survey/survey.py | 23 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-TODAY OpenERP S.A. <http://www.openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms... |
niavlys/kivy | refs/heads/master | kivy/uix/rst.py | 1 | '''
reStructuredText renderer
=========================
.. versionadded:: 1.1.0
`reStructuredText <http://docutils.sourceforge.net/rst.html>`_ is an
easy-to-read, what-you-see-is-what-you-get plaintext markup syntax and parser
system.
.. warning::
This widget is highly experimental. The whole styling and
im... |
madgik/exareme | refs/heads/master | Exareme-Docker/src/exareme/exareme-tools/madis/src/lib/pyreadline/modes/basemode.py | 1 | # -*- coding: utf-8 -*-
# *****************************************************************************
# Copyright (C) 2003-2006 Gary Bishop.
# Copyright (C) 2006 Jorgen Stenarson. <[email protected]>
#
# Distributed under the terms of the BSD License. The full license is in
# the file COPYI... |
azunite/chrome_build | refs/heads/master | third_party/boto/file/key.py | 82 | # Copyright 2010 Google Inc.
# Copyright (c) 2011, Nexenta Systems Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use... |
gonboy/sl4a | refs/heads/master | python/src/Lib/lib2to3/fixes/fix_raise.py | 53 | """Fixer for 'raise E, V, T'
raise -> raise
raise E -> raise E
raise E, V -> raise E(V)
raise E, V, T -> raise E(V).with_traceback(T)
raise (((E, E'), E''), E'''), V -> raise E(V)
raise "foo", V, T -> warns about string exceptions
CAVEATS:
1) "raise E, V" will be incorrectly translate... |
ArcherSys/ArcherSys | refs/heads/master | Lib/test/test_class.py | 1 | <<<<<<< HEAD
<<<<<<< HEAD
"Test the functionality of Python classes implementing operators."
import unittest
from test import support
testmeths = [
# Binary operations
"add",
"radd",
"sub",
"rsub",
"mul",
"rmul",
"truediv",
"rtruediv",
"mod",
"rmod",
"divmod",
"rdivmo... |
indro/t2c | refs/heads/master | libs/external_libs/Pygments-0.11.1/scripts/check_sources.py | 5 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Checker for file headers
~~~~~~~~~~~~~~~~~~~~~~~~
Make sure each Python file has a correct file header
including copyright and license information.
:copyright: 2006-2007 by Georg Brandl.
:license: GNU GPL, see LICENSE for more details.
"""
imp... |
dotpmrcunha/gnuradio | refs/heads/master | gr-atsc/python/atsc/atsc_rx.py | 45 | #!/usr/bin/env /usr/bin/python
#
# Copyright 2004, 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 2, or (at ... |
ayepezv/GAD_ERP | refs/heads/master | addons/hr_gamification/__openerp__.py | 2 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': 'HR Gamification',
'version': '1.0',
'category': 'Human Resources',
'website': 'https://www.odoo.com/page/employees',
'depends': ['gamification', 'hr'],
'description': """Use the HR resou... |
havard024/prego | refs/heads/master | crm/lib/python2.7/site-packages/unidecode/x06e.py | 252 | data = (
'Ben ', # 0x00
'Yuan ', # 0x01
'Wen ', # 0x02
'Re ', # 0x03
'Fei ', # 0x04
'Qing ', # 0x05
'Yuan ', # 0x06
'Ke ', # 0x07
'Ji ', # 0x08
'She ', # 0x09
'Yuan ', # 0x0a
'Shibui ', # 0x0b
'Lu ', # 0x0c
'Zi ', # 0x0d
'Du ', # 0x0e
'[?] ', # 0x0f
'Jian ', # 0x10
'Mi... |
veltri/DLV2 | refs/heads/master | tests/parser/bug.03.test.py | 1 | input = """
a.
b.
c.
q :- p, not a.
q :- not p.
p :- c.
"""
output = """
a.
b.
c.
q :- p, not a.
q :- not p.
p :- c.
"""
|
hackerbot/DjangoDev | refs/heads/master | django/contrib/auth/context_processors.py | 514 | # PermWrapper and PermLookupDict proxy the permissions system into objects that
# the template system can understand.
class PermLookupDict(object):
def __init__(self, user, app_label):
self.user, self.app_label = user, app_label
def __repr__(self):
return str(self.user.get_all_permissions())
... |
ProfessorX/Emacs-Laptop | refs/heads/master | elpa/anaconda-mode-20140901.1158/jedi/api/keywords.py | 20 | import pydoc
import keyword
from jedi._compatibility import is_py3
from jedi import common
from jedi.evaluate import compiled
try:
from pydoc_data import topics as pydoc_topics
except ImportError:
# Python 2.6
import pydoc_topics
if is_py3:
keys = keyword.kwlist
else:
keys = keyword.kwlist + ['No... |
JiYouMCC/python | refs/heads/master | burness/0008/html_extract_text.py | 40 | # #-*- coding: utf-8-*-
# # Source:https://github.com/Show-Me-the-Code/show-me-the-code
# # Author:Burness Duan
# # Date:2014-12-28
# # Python 2.7
from HTMLParser import HTMLParser
from re import sub
from sys import stderr
from traceback import print_exc
import urllib2
class _DeHTMLParser(HTMLParser):
def __ini... |
kartikp1995/gnuradio | refs/heads/master | grc/core/Config.py | 17 | """
Copyright 2016 Free Software Foundation, Inc.
This file is part of GNU Radio
GNU Radio Companion 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 ... |
j00bar/ansible | refs/heads/devel | lib/ansible/modules/network/nxos/nxos_static_route.py | 21 | #!/usr/bin/python
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distribut... |
MadCat34/Sick-Beard | refs/heads/development | sickbeard/SentFTPChecker.py | 35 | # Author: Arnaud Dartois
# URL: http://code.google.com/p/sickbeard/
#
# This file is part of Sick Beard.
#
# Sick Beard 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... |
nolanelena/MyProjectSite- | refs/heads/master | node_modules/node-sass/node_modules/node-gyp/gyp/tools/pretty_sln.py | 1831 | #!/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.
"""Prints the information in a sln file in a diffable way.
It first outputs each projects in alphabetical order with their
dependenci... |
tellesnobrega/horizon | refs/heads/master | horizon/conf/panel_template/views.py | 93 | from horizon import views
class IndexView(views.APIView):
# A very simple class-based view...
template_name = '{{ dash_name }}/{{ panel_name }}/index.html'
def get_data(self, request, context, *args, **kwargs):
# Add data to the context here...
return context
|
Beramos/QuestionHistCrit | refs/heads/master | questenv/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/langbulgarianmodel.py | 2964 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights R... |
kumarshubham/xhtml2pdf | refs/heads/master | setup_version.py | 91 | # -*- coding: utf-8 -*-
# Copyright 2010 Dirk Holtwick, holtwick.it
#
# 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 ... |
tictakk/servo | refs/heads/ticbranch | tests/wpt/web-platform-tests/XMLHttpRequest/resources/auth5/auth.py | 556 | def main(request, response):
if request.auth.username == 'usr' and request.auth.password == 'secret':
response.headers.set('Content-type', 'text/plain')
content = ""
else:
response.status = 401
response.headers.set('Status', '401 Authorization required')
response.headers.... |
chipaca/snapcraft | refs/heads/master | snapcraft/plugins/v1/catkin.py | 2 | # -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
#
# Copyright (C) 2015-2020 Canonical Ltd
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3 as
# published by the Free Software Foundation.
#
# This program is distributed in ... |
mdaniel/intellij-community | refs/heads/master | python/testData/codeInsight/controlflow/ForReturn.py | 83 | for start, end, name in self.talks:
if hour >= start and hour < end: return name |
lberruti/ansible-modules-core | refs/heads/maint1.99 | windows/win_feature.py | 62 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2014, Paul Durivage <[email protected]>, Trond Hindenes <[email protected]> and others
#
# 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
#... |
Prashant-Surya/addons-server | refs/heads/master | src/olympia/api/tests/test_permissions.py | 1 | from django.contrib.auth.models import AnonymousUser
from django.test import RequestFactory
from mock import Mock
from rest_framework.authentication import SessionAuthentication
from rest_framework.permissions import AllowAny, BasePermission
from rest_framework.response import Response
from rest_framework.views import... |
tuxfux-hlp-notes/python-batches | refs/heads/master | archieves/batch-59/databases/create_table.py | 2 | #!/usr/bin/python
import MySQLdb as mq
con = mq.connect('localhost','user58','user58','batch58')
cur = con.cursor()
cur.execute('create table student(name varchar(25),gender varchar(6))')
con.close()
'''
mysql> help create table;
mysql> use batch58;
Reading table information for completion of table and column names... |
noinil/euler_pysolution | refs/heads/master | python_solutions/p062_Cubic_permutations.py | 1 | #!/usr/bin/env python3
def cube_digi_score(n):
s = str(n*n*n)
return sum([10**int(i) for i in s[:]])
def main():
score_list = [cube_digi_score(i) for i in range(1, 10000)]
printed_numbers = set()
for j in score_list:
if j in printed_numbers:
continue
if score_list.count... |
jsg7440/jQuery-ToDo | refs/heads/master | node_modules/node-gyp/gyp/tools/pretty_sln.py | 1831 | #!/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.
"""Prints the information in a sln file in a diffable way.
It first outputs each projects in alphabetical order with their
dependenci... |
alexforencich/python-ivi | refs/heads/master | ivi/agilent/agilentMSO6034A.py | 2 | """
Python Interchangeable Virtual Instrument Library
Copyright (c) 2012-2017 Alex Forencich
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... |
Aravinthu/odoo | refs/heads/master | addons/l10n_us/models/res_partner_bank.py | 3 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import fields, models
class ResPartnerBank(models.Model):
_inherit = 'res.partner.bank'
aba_routing = fields.Integer(string="ABA/Routing", help="American Bankers Association Routing Number")
|
chineyting/project4-Info3180 | refs/heads/master | server/lib/werkzeug/local.py | 310 | # -*- coding: utf-8 -*-
"""
werkzeug.local
~~~~~~~~~~~~~~
This module implements context-local objects.
:copyright: (c) 2013 by the Werkzeug Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from functools import update_wrapper
from werkzeug.wsgi import ClosingIt... |
leiferikb/bitpop | refs/heads/master | build/third_party/buildbot_8_4p1/buildbot/test/util/connector_component.py | 8 | # 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... |
nzavagli/UnrealPy | refs/heads/master | UnrealPyEmbed/Source/Python/Lib/python27/encodings/undefined.py | 860 | """ Python 'undefined' Codec
This codec will always raise a ValueError exception when being
used. It is intended for use by the site.py file to switch off
automatic string to Unicode coercion.
Written by Marc-Andre Lemburg ([email protected]).
(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.
"""
impo... |
choldrim/jumpserver | refs/heads/zhenai | config_docker.py | 1 | """
jumpserver.config
~~~~~~~~~~~~~~~~~
Jumpserver project setting file
:copyright: (c) 2014-2016 by Jumpserver Team.
:license: GPL v2, see LICENSE for more details.
"""
import os
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
LOG_DIR = os.path.join(BASE_DIR, 'logs')
class Config:
# ... |
rledisez/shinken | refs/heads/master | shinken/objects/satellitelink.py | 8 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2009-2014:
# Gabes Jean, [email protected]
# Gerhard Lausser, [email protected]
# Gregory Starck, [email protected]
# Hartmut Goebel, [email protected]
#
# This file is part of Shinken.
#
# Shinken is free software: you c... |
jmcarbo/openerp7 | refs/heads/master | openerp/addons/base_report_designer/__init__.py | 421 | # -*- 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... |
sysadminmatmoz/ingadhoc | refs/heads/8.0 | project_task_contract/project.py | 8 | # -*- coding: utf-8 -*-
##############################################################################
# For copyright and license notices, see __openerp__.py file in module root
# directory
##############################################################################
from openerp import models, fields, api
class ac... |
with-git/tensorflow | refs/heads/master | tensorflow/contrib/opt/python/training/moving_average_optimizer.py | 84 | # 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... |
uprare/p2pool | refs/heads/master | p2pool/bitcoin/script.py | 282 | from p2pool.util import math, pack
def reads_nothing(f):
return None, f
def protoPUSH(length):
return lambda f: pack.read(f, length)
def protoPUSHDATA(size_len):
def _(f):
length_str, f = pack.read(f, size_len)
length = math.string_to_natural(length_str[::-1].lstrip(chr(0)))
data, f... |
Sweetgrassbuffalo/ReactionSweeGrass-v2 | refs/heads/master | .meteor/local/dev_bundle/python/Lib/test/test_ftplib.py | 18 | """Test script for ftplib module."""
# Modified by Giampaolo Rodola' to test FTP class, IPv6 and TLS
# environment
import ftplib
import asyncore
import asynchat
import socket
import StringIO
import errno
import os
try:
import ssl
except ImportError:
ssl = None
from unittest import TestCase, SkipTest, skipUnl... |
Beauhurst/django | refs/heads/master | tests/utils_tests/test_termcolors.py | 134 | import unittest
from django.utils.termcolors import (
DARK_PALETTE, DEFAULT_PALETTE, LIGHT_PALETTE, NOCOLOR_PALETTE, PALETTES,
colorize, parse_color_setting,
)
class TermColorTests(unittest.TestCase):
def test_empty_string(self):
self.assertEqual(parse_color_setting(''), PALETTES[DEFAULT_PALETTE... |
gauribhoite/personfinder | refs/heads/master | env/google_appengine/lib/django-1.4/django/contrib/sitemaps/tests/urls/http.py | 109 | from datetime import datetime
from django.conf.urls import patterns, url
from django.contrib.sitemaps import Sitemap, GenericSitemap, FlatPageSitemap, views
from django.contrib.auth.models import User
from django.views.decorators.cache import cache_page
class SimpleSitemap(Sitemap):
changefreq = "never"
priori... |
BackupGGCode/python-for-android | refs/heads/master | python3-alpha/python3-src/Lib/distutils/tests/test_dir_util.py | 49 | """Tests for distutils.dir_util."""
import unittest
import os
import stat
import shutil
import sys
from distutils.dir_util import (mkpath, remove_tree, create_tree, copy_tree,
ensure_relative)
from distutils import log
from distutils.tests import support
from test.support import run_un... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.