repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
incaser/odoo-odoo | refs/heads/8.0 | addons/l10n_de/__init__.py | 693 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of t... |
garymardell/libgraphqlparser | refs/heads/master | ast/cxx.py | 12 | # Copyright (c) 2015, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same directory.
import cStringIO as StringIO
fr... |
ahmed-mahran/hue | refs/heads/master | desktop/core/ext-py/Paste-2.0.1/tests/test_request.py | 47 | # (c) 2005 Ben Bangert
# This module is part of the Python Paste Project and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
from paste.fixture import *
from paste.request import *
from paste.wsgiwrappers import WSGIRequest
import six
def simpleapp(environ, start_response):
... |
diego1996/subterfuge | refs/heads/master | modules/TunnelBlock/TunnelBlock.py | 25 | #!/usr/bin/python
import os
#SSH Tunnels
os.system("iptables -A FORWARD -p tcp --destination-port 22 -j DROP")
#PPTP Tunnels
os.system("iptables -A FORWARD -p tcp --destination-port 1723 -j DROP")
#L2TP Tunnels
os.system("iptables -A FORWARD -p udp --destination-port 500 -j DROP")
os.system("iptables -A FORWARD -p udp... |
waseem18/oh-mainline | refs/heads/master | vendor/packages/Django/django/contrib/gis/utils/geoip.py | 114 | import warnings
from django.contrib.gis import geoip
HAS_GEOIP = geoip.HAS_GEOIP
if HAS_GEOIP:
BaseGeoIP = geoip.GeoIP
GeoIPException = geoip.GeoIPException
class GeoIP(BaseGeoIP):
def __init__(self, *args, **kwargs):
warnings.warn('GeoIP class has been moved to `django.contrib.gis.geo... |
Victor-Haefner/polyvr | refs/heads/master | extras/analytics/computeIncludeGraph.py | 1 | #!/usr/bin/python
import os, fnmatch, subprocess
import numpy, Gnuplot # sudo apt install python-gnuplot
import datetime
from PIL import Image
from time import sleep
sourceDir = '../../src'
#sourceDir = 'testData'
resolution = '8000, 8000'
def add(L, F, R):
if not F in L: L[F] = R+'/'+F
else: print 'Warning!', F,... |
ihatevim/aetherbot | refs/heads/master | plugins/cryptocurrency.py | 3 | """
cryptocurrency.py
A plugin that uses the CoinMarketCap JSON API to get values for cryptocurrencies.
Created By:
- Luke Rogers <https://github.com/lukeroge>
Special Thanks:
- https://coinmarketcap-nexuist.rhcloud.com/
License:
GPL v3
"""
from urllib.parse import quote_plus
from datetime import dateti... |
basicthinker/Sexain-MemController | refs/heads/master | gem5-stable/src/arch/x86/isa/insts/general_purpose/__init__.py | 91 | # Copyright (c) 2007 The Hewlett-Packard Development Company
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implemen... |
farin/django-enroll | refs/heads/master | enroll/backends.py | 1 | from django.contrib.auth.backends import ModelBackend as DjangoModelBackend
from django.contrib.auth import get_user_model
from django.db.models.query_utils import Q
from django.conf import settings
class ModelBackend(DjangoModelBackend):
"""Extended authentication backend"""
supports_inactive_user = getattr... |
gklyne/annalist | refs/heads/master | src/annalist_root/annalist/tests/test_entityeditdupfield.py | 1 | from __future__ import unicode_literals
from __future__ import absolute_import, division, print_function
"""
Entity editing tests for duplicated fields
"""
__author__ = "Graham Klyne (GK@ACM.ORG)"
__copyright__ = "Copyright 2014, G. Klyne"
__license__ = "MIT (http://opensource.org/licenses/MIT)"
import os... |
steventimberman/masterDebater | refs/heads/master | venv/lib/python2.7/site-packages/django/contrib/sitemaps/management/__init__.py | 12133432 | |
fafaman/django | refs/heads/master | tests/migrations/migrations_test_apps/with_package_model/models/__init__.py | 12133432 | |
vipins/ccccms | refs/heads/master | env/Lib/encodings/utf_32.py | 375 | """
Python 'utf-32' Codec
"""
import codecs, sys
### Codec APIs
encode = codecs.utf_32_encode
def decode(input, errors='strict'):
return codecs.utf_32_decode(input, errors, True)
class IncrementalEncoder(codecs.IncrementalEncoder):
def __init__(self, errors='strict'):
codecs.IncrementalEncoder.__ini... |
ghclara/ProgScripts | refs/heads/master | tekton-master/backend/apps/lingAngular_app/commands.py | 1 | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from gaebusiness.gaeutil import SaveCommand, ModelSearchCommand
from gaeforms.ndb.form import ModelForm
from gaegraph.business_base import UpdateNode
from lingAngular_app.model import LingAngular
class LingAngularPublicForm(ModelForm):
... |
vjmac15/Lyilis | refs/heads/master | lib/youtube_dl/extractor/inc (VJ Washington's conflicted copy 2017-08-29).py | 40 | from __future__ import unicode_literals
from .common import InfoExtractor
from .kaltura import KalturaIE
class IncIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?inc\.com/(?:[^/]+/)+(?P<id>[^.]+).html'
_TESTS = [{
'url': 'http://www.inc.com/tip-sheet/bill-gates-says-these-5-books-will-make-you-s... |
gemmaan/moviesenal | refs/heads/master | Hasil/Lib/site-packages/pip/_vendor/html5lib/html5parser.py | 327 | from __future__ import absolute_import, division, unicode_literals
from pip._vendor.six import with_metaclass, viewkeys, PY3
import types
try:
from collections import OrderedDict
except ImportError:
from pip._vendor.ordereddict import OrderedDict
from . import _inputstream
from . import _tokenizer
from . im... |
Nashenas88/servo | refs/heads/master | tests/wpt/web-platform-tests/websockets/handlers/handshake_no_protocol_wsh.py | 215 | #!/usr/bin/python
from mod_pywebsocket import common, msgutil, util
from mod_pywebsocket.handshake import hybi
def web_socket_do_extra_handshake(request):
request.connection.write('HTTP/1.1 101 Switching Protocols:\x0D\x0AConnection: Upgrade\x0D\x0AUpgrade: WebSocket\x0D\x0ASec-WebSocket-Origin: '+request.ws_orig... |
CallenDevens/Elemetry | refs/heads/master | elemetry-service.py | 1 | from flask import Flask, jsonify,render_template,request
import json
app = Flask(__name__)
@app.route('/policy-groups')
def getPolicyGroup():
groups = [
{"name":"POL1","collector":"COL1","policy":"policy1"},
{"name":"POL2","collector":"COL2","policy":"policy2"},
{"name":"POL3","collector":"COL3","policy":"policy3... |
mcus/SickRage | refs/heads/master | lib/sqlalchemy/orm/interfaces.py | 77 | # orm/interfaces.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
"""
Contains various base classes used throughout the ORM.
Defines the now depreca... |
luistorresm/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... |
tiffanyj41/hermes | refs/heads/master | src/data_prep/wiki_vectorize.py | 3 | from src.utils import article_to_category, glove, remove_templates, clean_categories, clean_links
import string
import numpy as np
class wiki_vectorize():
def __init__(self, user_interactions, content, user_vector_type, content_vector_type, sqlCtx, **support_files):
"""
Class initializer to load t... |
tima/ansible | refs/heads/devel | lib/ansible/modules/network/aci/aci_intf_policy_fc.py | 2 | #!/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'],
... |
OpusVL/odoo | refs/heads/master | addons/sale/sale.py | 1 | # -*- 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... |
zchking/odoo | refs/heads/8.0 | addons/stock/report/report_stock.py | 376 | # -*- 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... |
YouRik/Received | refs/heads/master | qml/components/python/requests/sessions.py | 439 | # -*- coding: utf-8 -*-
"""
requests.session
~~~~~~~~~~~~~~~~
This module provides a Session object to manage and persist settings across
requests (cookies, auth, proxies).
"""
import os
from collections import Mapping
from datetime import datetime
from .auth import _basic_auth_str
from .compat import cookielib, Or... |
rahul67/hue | refs/heads/master | desktop/core/ext-py/Django-1.6.10/tests/validation/test_validators.py | 118 | from __future__ import absolute_import, unicode_literals
from . import ValidationTestCase
from .models import ModelToValidate
class TestModelsWithValidators(ValidationTestCase):
def test_custom_validator_passes_for_correct_value(self):
mtv = ModelToValidate(number=10, name='Some Name', f_with_custom_vali... |
liyy7/scrapy | refs/heads/master | scrapy/http/__init__.py | 207 | """
Module containing all HTTP related classes
Use this module (instead of the more specific ones) when importing Headers,
Request and Response outside this module.
"""
from scrapy.http.headers import Headers
from scrapy.http.request import Request
from scrapy.http.request.form import FormRequest
from scrapy.http.re... |
alanjw/GreenOpenERP-Win-X86 | refs/heads/7.0 | python/Lib/site-packages/win32/lib/regutil.py | 5 | # Some registry helpers.
import win32api
import win32con
import sys
import os
error = "Registry utility error"
# A .py file has a CLSID associated with it (why? - dunno!)
CLSIDPyFile = "{b51df050-06ae-11cf-ad3b-524153480001}"
RegistryIDPyFile = "Python.File" # The registry "file type" of a .py file
Regis... |
barma1309/Kalista | refs/heads/master | .virtualenvs/Kalista/lib/python3.4/site-packages/django/contrib/webdesign/__init__.py | 264 | import warnings
from django.utils.deprecation import RemovedInDjango110Warning
default_app_config = 'django.contrib.webdesign.apps.WebDesignConfig'
warnings.warn(
"django.contrib.webdesign will be removed in Django 1.10. The "
"{% lorem %} tag is now included in the built-in tags.",
RemovedInDjango110Wa... |
slisson/intellij-community | refs/heads/master | python/testData/intentions/beforeTransformConditionalExpression.py | 83 | x = a if <caret>cond else b |
taladar/gnucash | refs/heads/master | src/optional/python-bindings/example_scripts/simple_sqlite_create.py | 1 | #!/usr/bin/env python
from gnucash import Session, Account
from os.path import abspath
from gnucash.gnucash_core_c import ACCT_TYPE_ASSET
s = Session('sqlite3://%s' % abspath('test.blob'), True)
# this seems to make a difference in more complex cases
s.save()
book = s.book
root = book.get_root_account()
a = Account(... |
auduny/home-assistant | refs/heads/dev | tests/components/mailbox/test_init.py | 12 | """The tests for the mailbox component."""
import asyncio
from hashlib import sha1
import pytest
from homeassistant.bootstrap import async_setup_component
import homeassistant.components.mailbox as mailbox
@pytest.fixture
def mock_http_client(hass, hass_client):
"""Start the Hass HTTP component."""
config =... |
OTWillems/GEO1005 | refs/heads/master | SpatialDecision/external/networkx/algorithms/tree/recognition.py | 28 | #-*- coding: utf-8 -*-
"""
Recognition Tests
=================
A *forest* is an acyclic, undirected graph, and a *tree* is a connected forest.
Depending on the subfield, there are various conventions for generalizing these
definitions to directed graphs.
In one convention, directed variants of forest and tree are def... |
dati91/servo | refs/heads/master | tests/wpt/web-platform-tests/tools/lint/lint.py | 3 | from __future__ import print_function, unicode_literals
import abc
import argparse
import ast
import json
import os
import re
import subprocess
import sys
import tempfile
from collections import defaultdict
from . import fnmatch
from .. import localpaths
from ..gitignore.gitignore import PathFilter
from ..wpt import... |
phalt/django | refs/heads/master | tests/template_tests/filter_tests/test_pluralize.py | 430 | from decimal import Decimal
from django.template.defaultfilters import pluralize
from django.test import SimpleTestCase
class FunctionTests(SimpleTestCase):
def test_integers(self):
self.assertEqual(pluralize(1), '')
self.assertEqual(pluralize(0), 's')
self.assertEqual(pluralize(2), 's')... |
pombreda/django-hotclub | refs/heads/master | apps/local_apps/bbauth/urls.py | 5 | from django.conf.urls.defaults import *
urlpatterns = patterns('',
url(r'^login/$', 'bbauth.views.login'),
url(r'^success/$', 'bbauth.views.success'),
url(r'^logout/$', 'bbauth.views.logout'),
) |
lmazuel/ansible | refs/heads/devel | lib/ansible/modules/cloud/amazon/s3_website.py | 50 | #!/usr/bin/python
#
# This is a 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.
#
# This Ansible library is distributed in the hope that i... |
arjclark/cylc | refs/heads/master | lib/cherrypy/_cpwsgi_server.py | 68 | """WSGI server interface (see PEP 333). This adds some CP-specific bits to
the framework-agnostic wsgiserver package.
"""
import sys
import cherrypy
from cherrypy import wsgiserver
class CPWSGIServer(wsgiserver.CherryPyWSGIServer):
"""Wrapper for wsgiserver.CherryPyWSGIServer.
wsgiserver has been designed ... |
troycomi/microMS | refs/heads/master | CoordinateMappers/__init__.py | 1 | '''
Package with all coordinate system mappers and connected instruments
brukerMapper.py: An abstract base class implementing coordinateMapper specific
for bruker type instruments using their fractional distance.
connectedInstrument.py: An abstract base class specifying functions required... |
n0trax/ansible | refs/heads/devel | lib/ansible/modules/database/postgresql/postgresql_db.py | 9 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: 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
ANSIBLE_METADATA = {'metadata_version': '1.1',
... |
boyuegame/kbengine | refs/heads/master | kbe/res/scripts/common/Lib/site-packages/pip/_vendor/html5lib/trie/py.py | 1323 | from __future__ import absolute_import, division, unicode_literals
from pip._vendor.six import text_type
from bisect import bisect_left
from ._base import Trie as ABCTrie
class Trie(ABCTrie):
def __init__(self, data):
if not all(isinstance(x, text_type) for x in data.keys()):
raise TypeError... |
ChenJunor/hue | refs/heads/master | desktop/core/ext-py/guppy-0.1.10/guppy/etc/textView.py | 37 | #._cv_part guppy.etc.textView
# Copied from idlelib/textView
# - I copied it rather than imported since I didn't want
# to have a dependency on idlelib,
# and I can change what I may want.
# For example, I removed the transient and wait window things
# so a help window behaves more like a 'normal' window
"""Si... |
antepsis/anteplahmacun | refs/heads/master | sympy/polys/galoistools.py | 33 | """Dense univariate polynomials with coefficients in Galois fields. """
from __future__ import print_function, division
from random import uniform
from math import ceil as _ceil, sqrt as _sqrt
from sympy.core.compatibility import SYMPY_INTS, range
from sympy.core.mul import prod
from sympy.polys.polyutils import _so... |
outofmem0ry/incubator-hawq | refs/heads/master | tools/bin/pythonSrc/ptyprocess-0.5.1/tests/test_invalid_binary.py | 11 | #!/usr/bin/env python
'''
PEXPECT LICENSE
This license is approved by the OSI and FSF as GPL-compatible.
http://opensource.org/licenses/isc-license.txt
Copyright (c) 2012, Noah Spurrier <noah@noah.org>
PERMISSION TO USE, COPY, MODIFY, AND/OR DISTRIBUTE THIS SOFTWARE FOR ANY
PURPOSE WITH OR WIT... |
xwolf12/django | refs/heads/master | tests/utils_tests/test_http.py | 220 | from __future__ import unicode_literals
import sys
import unittest
from datetime import datetime
from django.utils import http, six
from django.utils.datastructures import MultiValueDict
class TestUtilsHttp(unittest.TestCase):
def test_same_origin_true(self):
# Identical
self.assertTrue(http.sa... |
haiyangd/python-show-me-the-code- | refs/heads/master | agmcs/0014/0014.py | 40 | #coding:utf-8
import json
import xlwt
with open('student.txt','r')as f:
data = f.read().decode('gbk')
data = json.loads(data)
book =xlwt.Workbook(encoding = 'utf-8')
sheet =book.add_sheet('student')
for i in range(len(data)):
d = data[str(i+1)]
sheet.write(i,0,i+1)
for j in range(len(d)):
she... |
alomina007/github | refs/heads/master | main.py | 1 | import telebot
import urllib
from telebot import types
import requests
import json
import sys
reload(sys)
sys.setdefaultencoding("utf-8")
bot = telebot.TeleBot('') # makan token shoma
@bot.message_handler(commands=['start', 'help'])
def m(m):
markup = types.InlineKeyboardMarkup()
markup.add(types.InlineKeyboa... |
raishiv/elasticsearch | refs/heads/master | dev-tools/upload-s3.py | 255 | # Licensed to Elasticsearch under one or more contributor
# license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright
# ownership. Elasticsearch licenses this file to you under
# the Apache License, Version 2.0 (the "License"); you may
# not use this file except... |
SF-Zhou/LeetCode.Solutions | refs/heads/master | solutions/letter_combinations_of_a_phone_number.py | 1 | class Solution(object):
table = {'1': '',
'2': 'abc',
'3': 'def',
'4': 'ghi',
'5': 'jkl',
'6': 'mno',
'7': 'pqrs',
'8': 'tuv',
'9': 'wxyz',
'0': ' '}
def letterCombinations(self, digits):
... |
HumanExposure/factotum | refs/heads/master | factotum/urls/api.py | 1 | from django.conf.urls import url
from django.urls import path, include
from apps_api.core import views as coreviews
from apps_api.api import views as apiviews
from apps_api.core.routers import CustomRelationRouter
from apps_api.openapi import views as docsviews
from factotum import settings
router = CustomRelationRo... |
pchretien/ants | refs/heads/master | python/test.py | 1 | ## ants ##
#
# This program simulates an ants colony.
# Copyright (C) 2008,2009 Philippe Chretien
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License Version 2
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT A... |
dycodedev/taiga-back | refs/heads/master | taiga/front/sitemaps/base.py | 14 | # Copyright (C) 2015 David Barragán <bameda@dbarragan.com>
# Copyright (C) 2015 Taiga Agile LLC <support@taiga.io>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of th... |
synapse-wireless/pyduino-includes | refs/heads/master | pyduinoincludes/__init__.py | 2 | from io import *
|
timovanopstal/nutils | refs/heads/master | tests/ischeme.py | 1 | #!/usr/bin/env python
from nutils import *
from . import register, unittest
def _test( ref, ptype, target_points, target_weights=None ):
points, weights = ref.getischeme( ptype )
assert points.ndim == 2
assert points.shape[1] == ref.ndims
numpy.testing.assert_almost_equal( points, target_points )
if target_... |
slightstone/SickRage | refs/heads/master | sickbeard/metadata/kodi_12plus.py | 3 | # URL: http://code.google.com/p/sickbeard/
#
# This file is part of SickRage.
#
# SickRage 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 versi... |
ajavadia/ScaffCC | refs/heads/master | rkqc/tools/gui/ui/PathBenchmarks.py | 3 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'PathBenchmarks.ui'
#
# Created: Thu Jun 9 13:03:04 2011
# by: PyQt4 UI code generator 4.8.3
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
except ... |
Ecotrust/locus | refs/heads/master | deploy/templates/wsgi.py | 1 | import sys
import site
import os
project = '/usr/local/apps/locus/locus'
ve = '/usr/local/apps/locus/env'
vepath = os.path.join(ve,'lib/python2.7/site-packages')
local_path = os.path.join('/usr/local/lib/python2.7/site-packages')
prev_sys_path = list(sys.path)
# add the site-packages of our virtualenv as a site dir
s... |
GunoH/intellij-community | refs/heads/master | python/testData/editing/unindentTab.before.py | 83 | #// python 3
class C:
def m(self): #// note: TABs instead of spaces
pass
|
chartjes/liesitoldmykids | refs/heads/master | simplejson/tests/test_pass3.py | 261 | from unittest import TestCase
import simplejson as json
# from http://json.org/JSON_checker/test/pass3.json
JSON = r'''
{
"JSON Test Pattern pass3": {
"The outermost value": "must be an object or array.",
"In this test": "It is an object."
}
}
'''
class TestPass3(TestCase):
def test_parse... |
BertRaeymaekers/scrapbook | refs/heads/master | random_projects/pedigree_scripts/pedtodot.py | 1 | #!/usr/bin/python3
from collections import OrderedDict
import os
import sys
def help(rc: int=0):
print("The pedtodot.py script transforms a pedigree file into a dot file that Graphiz can use to create a graph.")
print("")
print("\t-h: This help message.")
print("\t-f --file: ... |
mileswwatkins/billy | refs/heads/master | billy/scrape/utils.py | 2 | import re
import itertools
import subprocess
import collections
def url_xpath(url, path):
import requests
import lxml.html
doc = lxml.html.fromstring(requests.get(url).text)
return doc.xpath(path)
def convert_pdf(filename, type='xml'):
commands = {'text': ['pdftotext', '-layout', filename, '-'],... |
2014cdag11/2014cadg11 | refs/heads/master | wsgi/static/Brython2.1.0-20140419-113919/Lib/site.py | 805 | import sys
|
nicholasserra/sentry | refs/heads/master | src/sentry/migrations/0023_auto__add_field_event_time_spent.py | 36 | # encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Event.time_spent'
db.add_column('sentry_message', 'time_spent', self.gf('django.db.models.fields.F... |
brendanhoran/router-tools | refs/heads/master | python/lib/serial/urlhandler/protocol_hwgrep.py | 11 | #! python
#
# This module implements a special URL handler that uses the port listing to
# find ports by searching the string descriptions.
#
# This file is part of pySerial. https://github.com/pyserial/pyserial
# (C) 2011-2015 Chris Liechti <cliechti@gmx.net>
#
# SPDX-License-Identifier: BSD-3-Clause
#
# URL format... |
linktlh/Toontown-journey | refs/heads/master | toontown/nametag/NametagFloat2d.py | 3 | from pandac.PandaModules import Point3
from toontown.nametag.NametagFloat3d import NametagFloat3d
class NametagFloat2d(NametagFloat3d):
def doBillboardEffect(self):
pass
def update(self):
NametagFloat3d.update(self)
self.updateClickRegion()
def setClickRegionFrame(self, left, r... |
nhenezi/kuma | refs/heads/master | vendor/packages/setuptools/setuptools/command/alias.py | 32 | import distutils, os
from setuptools import Command
from distutils.util import convert_path
from distutils import log
from distutils.errors import *
from setuptools.command.setopt import edit_config, option_base, config_file
def shquote(arg):
"""Quote an argument for later parsing by shlex.split()"""
for c in ... |
jjmiranda/edx-platform | refs/heads/master | cms/djangoapps/contentstore/tests/test_request_event.py | 234 | """Tests for CMS's requests to logs"""
import mock
from django.test import TestCase
from django.core.urlresolvers import reverse
from contentstore.views.helpers import event as cms_user_track
class CMSLogTest(TestCase):
"""
Tests that request to logs from CMS return 204s
"""
def test_post_answers_to... |
maithreyee/python-koans | refs/heads/master | python3/koans/local_module_with_all_defined.py | 130 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
__all__ = (
'Goat',
'_Velociraptor'
)
class Goat:
@property
def name(self):
return "George"
class _Velociraptor:
@property
def name(self):
return "Cuddles"
class SecretDuck:
@property
def name(self):
return "None o... |
luiseduardohdbackup/odoo | refs/heads/8.0 | addons/purchase_double_validation/__openerp__.py | 260 | # -*- 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... |
yfried/ansible | refs/heads/devel | lib/ansible/modules/network/f5/bigip_monitor_https.py | 1 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright: (c) 2017, F5 Networks Inc.
# GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... |
aitormf/JdeRobot | refs/heads/master | src/drivers/MAVLinkServer/MAVProxy/modules/mavproxy_antenna.py | 16 | #!/usr/bin/env python
'''
antenna pointing module
Andrew Tridgell
June 2012
'''
import sys, os, time
from cuav.lib import cuav_util
from MAVProxy.modules.lib import mp_module
class AntennaModule(mp_module.MPModule):
def __init__(self, mpstate):
super(AntennaModule, self).__init__(mpstate, "antenna", "ante... |
oliverlee/sympy | refs/heads/master | sympy/series/series_class.py | 89 | """
Contains the base class for series
Made using sequences in mind
"""
from __future__ import print_function, division
from sympy.core.expr import Expr
from sympy.core.singleton import S
from sympy.core.cache import cacheit
from sympy.core.compatibility import integer_types
class SeriesBase(Expr):
"""Base Clas... |
binbin91/oms | refs/heads/master | asset/tests.py | 24123 | from django.test import TestCase
# Create your tests here.
|
DasIch/django | refs/heads/master | tests/forms_tests/tests/test_fields.py | 64 | # -*- coding: utf-8 -*-
"""
##########
# Fields #
##########
Each Field class does some sort of validation. Each Field has a clean() method,
which either raises django.forms.ValidationError or returns the "clean"
data -- usually a Unicode object, but, in some rare cases, a list.
Each Field's __init__() takes at least... |
leighpauls/k2cro4 | refs/heads/master | third_party/WebKit/Tools/Scripts/webkitpy/tool/steps/createbug.py | 125 | # Copyright (C) 2010 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the ... |
shinichiba/YamadaLabSkinFrictionR7 | refs/heads/master | mainpyqt4uic.py | 1 | import sys
from PyQt4 import QtGui, uic
class MyWindow(QtGui.QMainWindow):
### functions for the buttons to call
def pressedOnButton(self):
print ("Pressed On!")
def pressedOffButton(self):
print ("Pressed Off!")
def __init__(self):
super(MyWindow, self).__init__()... |
rchacon/scofflaw | refs/heads/dev | scrapers/onondaga.py | 1 | """
Scrape Onondaga County warrants.
$ python onondaga.py
"""
import re
from bs4 import BeautifulSoup
import requests
from . import BaseScraper
__county__ = 'onondaga'
__scraper__ = 'OnondagaScraper'
BASE_URL = 'http://psi2.ongov.net'
class OnondagaScraper(BaseScraper):
"""Search for warrants in Onondaga Co... |
cisco-openstack/tempest | refs/heads/proposed | tempest/api/compute/keypairs/test_keypairs_v22.py | 2 | # Copyright 2016 NEC Corporation. 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 ... |
DirtyUnicorns/android_external_chromium_org | refs/heads/lollipop | tools/telemetry/telemetry/web_components/web_component_unittest.py | 45 | # Copyright 2014 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 StringIO
import unittest
from telemetry.web_components import web_component
class SimpleWebComponent(web_component.WebComponent):
def __init__(se... |
rubencabrera/odoo | refs/heads/8.0 | openerp/addons/base/ir/ir_exports.py | 338 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the... |
gannetson/django | refs/heads/master | django/contrib/contenttypes/forms.py | 376 | from __future__ import unicode_literals
from django.contrib.contenttypes.models import ContentType
from django.db import models
from django.forms import ModelForm, modelformset_factory
from django.forms.models import BaseModelFormSet
class BaseGenericInlineFormSet(BaseModelFormSet):
"""
A formset for generic... |
opendaylight/netvirt | refs/heads/master | resources/tools/odltools/odltools/mdsal/models/constants.py | 1 | VIF_TYPE_TO_PREFIX = {
'ovs': 'tap',
'vhost_user': 'vhu'
}
VIF_TYPE = 'neutron-binding:vif-type'
IFACE_PARENT = 'odl-interface:parent-interface'
IFTYPE_VLAN = 'iana-if-type:l2vlan'
IFTYPE_TUNNEL = 'iana-if-type:tunnel'
|
dset0x/inspire-next | refs/heads/master | inspire/modules/workflows/workflows/process_record_arxiv.py | 1 | # -*- coding: utf-8 -*-
#
## This file is part of INSPIRE.
## Copyright (C) 2014 CERN.
##
## INSPIRE 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) an... |
shykes/zerorpc-python | refs/heads/master | zerorpc/patterns.py | 1 | # -*- coding: utf-8 -*-
# Open Source Initiative OSI - The MIT License (MIT):Licensing
#
# The MIT License (MIT)
# Copyright (c) 2012 DotCloud Inc (opensource@dotcloud.com)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Softwa... |
gshivani/ansible-modules-extras | refs/heads/devel | network/f5/bigip_pool_member.py | 4 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, Matt Hite <mhite@hotmail.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 Software Foundation, either version 3 of the License... |
DemokratieInBewegung/abstimmungstool | refs/heads/master | voty/initproc/apps.py | 1 | from django.apps import AppConfig
from django.db.models.signals import post_migrate
from .globals import NOTIFICATIONS
def create_notice_types(sender, **kwargs):
from pinax.notifications.models import NoticeType
print("Creating notices for Initproc")
# Invitations
NoticeType.create(NOTIFICATIONS.IN... |
samedder/azure-cli | refs/heads/master | src/command_modules/azure-cli-consumption/azure/cli/command_modules/consumption/_transformers.py | 5 | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... |
dkubiak789/odoo | refs/heads/8.0 | addons/mass_mailing/wizard/test_mailing.py | 148 | # -*- coding: utf-8 -*-
from openerp import tools
from openerp.osv import osv, fields
class TestMassMailing(osv.TransientModel):
_name = 'mail.mass_mailing.test'
_description = 'Sample Mail Wizard'
_columns = {
'email_to': fields.char('Recipients', required=True,
help='Comma-separate... |
nvbn/python-social-auth | refs/heads/master | social/backends/mailru.py | 1 | """
Mail.ru OAuth2 support
Take a look to http://api.mail.ru/docs/guides/oauth/
You need to register OAuth site here:
http://api.mail.ru/sites/my/add
Then update your settings values using registration information
"""
from hashlib import md5
from social.p3 import unquote
from social.backends.oauth import BaseOAuth... |
Trafire/purchaseorders | refs/heads/master | lib/python2.7/sre_compile.py | 4 | /usr/lib/python2.7/sre_compile.py |
craigderington/studentloan5 | refs/heads/master | studentloan5/Lib/site-packages/django/conf/locale/nl/formats.py | 117 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'j F Y' # '20 ja... |
dfdx2/django | refs/heads/master | tests/check_framework/urls/beginning_with_slash.py | 76 | from django.conf.urls import url
urlpatterns = [
url(r'/starting-with-slash/$', lambda x: x),
]
|
flyfei/python-for-android | refs/heads/master | python3-alpha/python3-src/Lib/test/badsyntax_future6.py | 383 | """This is a test"""
"this isn't a doc string"
from __future__ import nested_scopes
def f(x):
def g(y):
return x + y
return g
result = f(2)(4)
|
SuriyaaKudoIsc/olympia | refs/heads/master | services/theme_update.py | 16 | import base64
import json
import os
import posixpath
import re
from time import time
from wsgiref.handlers import format_date_time
from constants import base
from utils import log_configure, log_exception, mypool
from services.utils import settings, user_media_path, user_media_url
# Configure the log.
log_configure(... |
mattesno1/CouchPotatoServer | refs/heads/master | libs/pyutil/randutil.py | 92 | # Copyright (c) 2002-2012 Zooko Wilcox-O'Hearn
# This file is part of pyutil; see README.rst for licensing terms.
import warnings
import os, random
try:
import hashexpand
class SHA256Random(hashexpand.SHA256Expander, random.Random):
def __init__(self, seed=None, deterministic=True):
warni... |
gugahoi/maraschino | refs/heads/master | lib/flask/testsuite/test_apps/flask_broken/__init__.py | 629 | import flask.ext.broken.b
import missing_module
|
harayz/raspberry_pwn | refs/heads/master | src/pentest/wifitap/wifidns.py | 9 | #! /usr/bin/env python
########################################
#
# wifidns.py --- WiFi injection DNS answering tool based on Wifitap
#
# Copyright (C) 2005 Cedric Blancher <sid@rstack.org>
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License v... |
anishnarang/gswift | refs/heads/master | test/unit/common/test_base_storage_server.py | 26 | # Copyright (c) 2010-2015 OpenStack Foundation
#
# 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... |
teamtuga4/teamtuga4ever.repository | refs/heads/master | script.module.urlresolver/lib/urlresolver/plugins/vidzi.py | 4 | '''
vidzi urlresolver plugin
Copyright (C) 2014 Eldorado
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.
This program is distr... |
sandeepgupta2k4/tensorflow | refs/heads/master | tensorflow/python/framework/file_system_test.py | 36 | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.