repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
savoirfairelinux/django
refs/heads/master
tests/custom_methods/__init__.py
12133432
AniruddhaSAtre/dd-agent
refs/heads/master
checks.d/hdfs.py
29
# 3rd party import snakebite.client import snakebite.version # project from checks import AgentCheck # This is only available on snakebite >= 2.2.0 # but snakebite 2.x is only compatible with hadoop >= 2.2.0 # So we bundle snakebite 1.3.9 and let the possibility to upgrade to a newer version # if people want to use H...
maciekcc/tensorflow
refs/heads/master
tensorflow/contrib/distributions/python/kernel_tests/distribution_util_test.py
9
# 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...
Zenol/absynth
refs/heads/master
src/wordmap.py
1
from PIL import Image, ImageDraw, ImageFont font = None def build_text_block(w, h, msg, color=(0, 0, 0), bg_color=(255, 255, 255)): # Create a temporary image tmp = Image.new("RGB", font.getsize(msg), bg_color) # Draw msg on this image draw = ImageDraw.Draw(tmp) draw.text((0, 0), msg, color, font=...
mayblue9/bokeh
refs/heads/master
bokeh/models/tests/test_renderers.py
10
from __future__ import absolute_import import unittest from bokeh.models.renderers import GlyphRenderer from bokeh.plotting import ColumnDataSource, figure from bokeh.models.ranges import DataRange1d class TestGlyphRenderer(unittest.TestCase): def test_warning_about_colons_in_column_labels(self): invali...
davidhdz/crits
refs/heads/master
crits/actors/__init__.py
12133432
gonboy/sl4a
refs/heads/master
python/gdata/tests/gdata_tests/apps/migration/__init__.py
12133432
doismellburning/edx-platform
refs/heads/master
lms/djangoapps/dashboard/management/commands/__init__.py
12133432
patcon/open-cabinet
refs/heads/master
venv/lib/python2.7/site-packages/django/db/backends/postgresql/__init__.py
12133432
fangxingli/hue
refs/heads/master
desktop/core/ext-py/Pygments-1.3.1/pygments/lexers/text.py
56
# -*- coding: utf-8 -*- """ pygments.lexers.text ~~~~~~~~~~~~~~~~~~~~ Lexers for non-source code file types. :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re from bisect import bisect from pygments.lexer import Lexer, LexerC...
ACOKing/ArcherVMPeridot
refs/heads/master
nodechip/node_modules/cordova/node_modules/cordova-lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/input.py
64
# 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. from compiler.ast import Const from compiler.ast import Dict from compiler.ast import Discard from compiler.ast import List from compiler.ast import Module from co...
neilhan/tensorflow
refs/heads/master
tensorflow/contrib/factorization/python/ops/gmm_test.py
22
# 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...
mastak/Spirit
refs/heads/master
spirit/comment/flag/forms.py
12
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django import forms from django.utils.translation import ugettext_lazy as _ from django.db import IntegrityError from django.utils import timezone from .models import Flag, CommentFlag class FlagForm(forms.ModelForm): class Meta: mod...
jaechoon2/FPGA-Imaging-Library
refs/heads/Publish
LocalFilter/ThresholdLocal/SoftwareSim/MeanFilter.py
8
""" Project FPGA-Imaging-Library Design MeanFilter Function Local filter - Mean filter, it always used for smoothing images. Module Software simulation. Version 1.0 Modified 2015-05-19 Copyright (C) 2015 Tianyu Dai (dtysky) <dtysky@outlook.com> This library is free software; you can redistribute it and/or modif...
omakk/servo
refs/heads/master
tests/wpt/web-platform-tests/fetch/api/resources/preflight.py
25
def main(request, response): headers = [("Content-Type", "text/plain")] stashed_data = {'control_request_headers': "", 'preflight': "0", 'preflight_referrer': ""} token = None if "token" in request.GET: token = request.GET.first("token") if "origin" in request.GET: for origin in re...
imsparsh/python-for-android
refs/heads/master
python-modules/twisted/twisted/names/test/test_dns.py
49
# test-case-name: twisted.names.test.test_dns # Copyright (c) 2001-2010 Twisted Matrix Laboratories. # See LICENSE for details. """ Tests for twisted.names.dns. """ try: from cStringIO import StringIO except ImportError: from StringIO import StringIO import struct from twisted.python.failure import Failure ...
markeTIC/OCB
refs/heads/8.0
openerp/addons/base/res/res_partner.py
1
# -*- 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 GNU...
jeffery9/mixprint_addons
refs/heads/master
project_timesheet/__init__.py
441
# -*- 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...
Sinar/mapit
refs/heads/master
mapit_gb/management/__init__.py
12133432
ayesandarmoe/microblog_flask_tutorial
refs/heads/master
flask/lib/python2.7/site-packages/migrate/versioning/templates/repository/pylons/versions/__init__.py
12133432
flotre/sickbeard-vfvo
refs/heads/master
lib/tidysub/__init__.py
12133432
pathway27/servo
refs/heads/master
tests/wpt/css-tests/tools/sslutils/openssl.py
253
import functools import os import shutil import subprocess import tempfile from datetime import datetime class OpenSSL(object): def __init__(self, logger, binary, base_path, conf_path, hosts, duration, base_conf_path=None): """Context manager for interacting with OpenSSL. Creates a...
MaximeBiset/care4care
refs/heads/master
news/models.py
1
# -*- coding: utf-8 -*- from django.db import models from main.models import User from django.template.defaultfilters import slugify from django.utils.translation import ugettext as _ from django.utils.translation import ugettext_lazy as __ # Create your models here. class News(models.Model): """ Model descriptin...
tinkerinestudio/Tinkerine-Suite
refs/heads/master
TinkerineSuite/python/Lib/lib2to3/fixes/fix_exec.py
326
# Copyright 2006 Google, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. """Fixer for exec. This converts usages of the exec statement into calls to a built-in exec() function. exec code in ns1, ns2 -> exec(code, ns1, ns2) """ # Local imports from .. import pytree from .. import fixer_bas...
astrofra/amiga-memories
refs/heads/master
app/3rd_parties/marytts-5.0/doc/examples/client/maryclient-http.py
1
#!/usr/bin/env python import httplib, urllib # A basic mary client in Python, # kindly donated to the MARY TTS project # by Hugh Sasse. Thanks Hugh! # A very basic Python class for accessing # the MARY TTS system using the modern # HTTP server. # Warning, this is probably ghastly Python, # most of my time...
pduval/jmjproj
refs/heads/master
jmproj/views.py
1
from pyramid.response import Response from pyramid.view import view_config from pyramid.httpexceptions import HTTPMovedPermanently from sqlalchemy.exc import DBAPIError from .models import ( DBSession, CompteRendu, ) import datetime @view_config(route_name="home", renderer='jmproj:templates/all_cr.mako')...
ptroja/spark2014
refs/heads/master
testsuite/gnatprove/tests/TU__type_declarations_illegal/test.py
10
from test_support import * prove_all(opt=["-cargs", "-gnatf"])
paolodedios/tensorflow
refs/heads/master
tensorflow/python/ops/nccl_ops_test.py
8
# 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...
kornicameister/ansible-modules-extras
refs/heads/monasca
web_infrastructure/ejabberd_user.py
42
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (C) 2013, Peter Sprygada <sprygada@gmail.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at ...
memtoko/django
refs/heads/master
tests/proxy_models/__init__.py
12133432
sodafree/backend
refs/heads/master
build/lib.linux-i686-2.7/django/utils/encoding.py
37
import types import urllib import locale import datetime import codecs from decimal import Decimal from django.utils.functional import Promise class DjangoUnicodeDecodeError(UnicodeDecodeError): def __init__(self, obj, *args): self.obj = obj UnicodeDecodeError.__init__(self, *args) def __str_...
alangwansui/mtl_ordercenter
refs/heads/master
openerp/addons/product/wizard/product_price.py
49
# -*- 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...
cmidt-veasna/SwiftFlatbuffer
refs/heads/master
flatbuffers/tests/namespace_test/NamespaceA/SecondTableInA.py
28
# automatically generated by the FlatBuffers compiler, do not modify # namespace: NamespaceA import flatbuffers class SecondTableInA(object): __slots__ = ['_tab'] @classmethod def GetRootAsSecondTableInA(cls, buf, offset): n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) ...
gdesmott/politube
refs/heads/master
videos_tools/forms.py
236
from django import forms # place form definition here
kawamon/hue
refs/heads/master
desktop/core/ext-py/ply-3.11/test/yacc_error6.py
10
# ----------------------------------------------------------------------------- # yacc_error6.py # # Panic mode recovery test # ----------------------------------------------------------------------------- import sys if ".." not in sys.path: sys.path.insert(0,"..") import ply.yacc as yacc from calclex import tokens ...
nvoron23/socialite
refs/heads/master
jython/Lib/test/crashers/recursion_limit_too_high.py
87
# The following example may crash or not depending on the platform. # E.g. on 32-bit Intel Linux in a "standard" configuration it seems to # crash on Python 2.5 (but not 2.4 nor 2.3). On Windows the import # eventually fails to find the module, possibly because we run out of # file handles. # The point of this exampl...
alvarofe/sdb
refs/heads/master
bindings/benchmark/python.py
4
#!/usr/bin/python import json str = """ {"glossary":{"title":"example glossary","page":1,"GlossDiv":{"title":"First gloss title","GlossList":{"GlossEntry":{"ID":"SGML","SortAs":"SGML","GlossTerm":"Standard Generalized Markup Language","Acronym":"SGML","Abbrev":"ISO 8879:1986","GlossDef":{"para":"A meta-markup languag...
MasonM/hssonline-conference
refs/heads/master
django_conference/templatetags/money_format.py
1
from decimal import Decimal from django import template register = template.Library() @register.filter def money_format(value): """ Display float in money-style format with specified decimal places and comma-grouped thousands. Adapted from https://docs.python.org/2/library/decimal.html#recipes ""...
krieger-od/nwjs_chromium.src
refs/heads/master
chrome/third_party/chromevox/third_party/closure-library/closure/bin/build/source.py
166
# Copyright 2009 The Closure Library 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 a...
coreos/depot_tools
refs/heads/master
third_party/colorama/ansitowin32.py
287
# Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file. import re import sys from .ansi import AnsiFore, AnsiBack, AnsiStyle, Style from .winterm import WinTerm, WinColor, WinStyle from .win32 import windll if windll is not None: winterm = WinTerm() def is_a_tty(stream): return hasattr(s...
akretion/stock-logistics-workflow
refs/heads/8.0
stock_picking_package_preparation/__init__.py
17
# -*- coding: utf-8 -*- ############################################################################## # # Author: Guewen Baconnier # Copyright 2015 Camptocamp SA # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # pu...
akazakov/ansible-modules-core
refs/heads/devel
web_infrastructure/django_manage.py
55
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2013, Scott Anderson <scottanderson42@gmail.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 o...
jeezybrick/django
refs/heads/master
tests/migrations/test_migrations_squashed_complex_multi_apps/app1/4_auto.py
385
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [("app1", "3_auto")] operations = [ migrations.RunPython(migrations.RunPython.noop) ]
sirchristian/v8DOM.NET
refs/heads/master
v8-read-only/tools/presubmit.py
1
#!/usr/bin/env python # # Copyright 2011 the V8 project authors. 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 # ...
KamilWo/bestja
refs/heads/master
addons/message_template/models.py
2
# -*- coding: utf-8 -*- from urlparse import urljoin from openerp import models, fields, api, tools from openerp.addons.email_template.email_template import mako_template_env class MessageTemplate(models.Model): _name = 'message_template' subject = fields.Char() body = fields.Text() model = fields.C...
Sergiy-DBX/pynet_test-
refs/heads/master
Strings/Ex_2.py
1
#!/usr/bin/env python from __future__ import print_function try: ip_input = raw_input("Enter IP address: ") except NameError: ip_input = input("Enter IP address: ") digits = ip_input.split('.') for i in digits: print("{:>12}".format(i))
GbalsaC/bitnamiP
refs/heads/master
venv/lib/python2.7/site-packages/oauthlib/oauth2/rfc6749/endpoints/authorization.py
71
# -*- coding: utf-8 -*- """ oauthlib.oauth2.rfc6749 ~~~~~~~~~~~~~~~~~~~~~~~ This module is an implementation of various logic needed for consuming and providing OAuth 2.0 RFC6749. """ from __future__ import absolute_import, unicode_literals import logging from oauthlib.common import Request from .base import BaseEn...
ltilve/ChromiumGStreamerBackend
refs/heads/master
third_party/tlslite/tlslite/constants.py
11
# Authors: # Trevor Perrin # Google - defining ClientCertificateType # Google (adapted by Sam Rushing) - NPN support # Dimitris Moraitis - Anon ciphersuites # Dave Baggett (Arcode Corporation) - canonicalCipherName # Yngve Pettersen (ported by Paul Sokolovsky) - TLS 1.2 # # See the LICENSE file for legal i...
eunchong/build
refs/heads/master
third_party/buildbot_8_4p1/buildbot/test/unit/test_db_changes.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...
jhawkesworth/ansible
refs/heads/devel
lib/ansible/modules/cloud/amazon/ec2_snapshot.py
71
#!/usr/bin/python # 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', 'status': ['preview'], ...
WeZZard/ShadowVPN
refs/heads/master
tools/gen_foreign_sh.py
169
#!/usr/bin/env python3 # # Copyright (c) 2014 clowwindy # # 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, ...
allenai/allennlp
refs/heads/master
allennlp/modules/token_embedders/empty_embedder.py
1
import torch from allennlp.modules.token_embedders.token_embedder import TokenEmbedder @TokenEmbedder.register("empty") class EmptyEmbedder(TokenEmbedder): """ Assumes you want to completely ignore the output of a `TokenIndexer` for some reason, and does not return anything when asked to embed it. Yo...
jjmiranda/edx-platform
refs/heads/master
openedx/core/djangoapps/theming/core.py
10
""" Core logic for Comprehensive Theming. """ from django.conf import settings from .helpers import get_themes from logging import getLogger logger = getLogger(__name__) # pylint: disable=invalid-name def enable_theming(): """ Add directories and relevant paths to settings for comprehensive theming. ""...
kevin-coder/tensorflow-fork
refs/heads/master
tensorflow/python/kernel_tests/sparse_ops_test.py
10
# 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...
henryfjordan/django
refs/heads/master
django/utils/autoreload.py
295
# Autoreloading launcher. # Borrowed from Peter Hunt and the CherryPy project (http://www.cherrypy.org). # Some taken from Ian Bicking's Paste (http://pythonpaste.org/). # # Portions copyright (c) 2004, CherryPy Team (team@cherrypy.org) # All rights reserved. # # Redistribution and use in source and binary forms, with ...
Cito/DBUtils
refs/heads/main
dbutils/persistent_pg.py
1
"""PersistentPg - persistent classic PyGreSQL connections. Implements steady, thread-affine persistent connections to a PostgreSQL database using the classic (not DB-API 2 compliant) PyGreSQL API. This should result in a speedup for persistent applications such as the application server of "Webware for Python," witho...
Zhongqilong/mykbengineer
refs/heads/master
kbe/res/scripts/common/Lib/site-packages/pip/status_codes.py
408
SUCCESS = 0 ERROR = 1 UNKNOWN_ERROR = 2 VIRTUALENV_NOT_FOUND = 3 PREVIOUS_BUILD_DIR_ERROR = 4 NO_MATCHES_FOUND = 23
dims/neutron
refs/heads/master
neutron/agent/l3_agent.py
5
# Copyright (c) 2015 OpenStack Foundation. # # 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...
rabernat/PyTables
refs/heads/develop
examples/table2.py
13
# This shows how to use the cols accessors for table columns from __future__ import print_function import tables class Particle(tables.IsDescription): name = tables.StringCol(16, pos=1) # 16-character String lati = tables.Int32Col(pos=2) # integer longi = tables.Int32Col(pos=3) ...
sirex/Misago
refs/heads/master
misago/markup/templatetags/__init__.py
12133432
scifiswapnil/Project-LoCatr
refs/heads/master
lib/python2.7/site-packages/django/conf/locale/el/__init__.py
12133432
japeto/Vigtech-Services
refs/heads/master
env/lib/python2.7/site-packages/django/conf/locale/nl/__init__.py
12133432
macs03/demo-cms
refs/heads/master
cms/lib/python2.7/site-packages/djangocms_style/migrations_django/__init__.py
12133432
peguin40/zulip
refs/heads/master
zerver/tests/webhooks/__init__.py
12133432
yotchang4s/cafebabepy
refs/heads/develop
src/main/python/test/test_regrtest.py
2
""" Tests of regrtest.py. Note: test_regrtest cannot be run twice in parallel. """ import contextlib import faulthandler import io import os.path import platform import re import subprocess import sys import sysconfig import tempfile import textwrap import unittest from test import libregrtest from test import suppor...
airbnb/superset
refs/heads/master
setup.py
1
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
andcor02/mbed-os
refs/heads/master
tools/host_tests/serial_nc_tx_auto.py
74
""" mbed SDK Copyright (c) 2011-2013 ARM Limited 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 wr...
s20121035/rk3288_android5.1_repo
refs/heads/master
ndk/sources/host-tools/gdb-pretty-printers/stlport/gppfs-0.2/stlport/printers.py
17
# GDB pretty printers for STLport. # # Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc. # Copyright (C) 2010 Joachim Reichel # # 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...
shiminasai/ciat_plataforma
refs/heads/master
mapeo/migrations/0009_auto__add_composicionfamiliar__add_productorgranosbasicos__add_usosuel.py
3
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'ComposicionFamiliar' db.create_table(u'mapeo_composicionf...
odoobgorg/odoo
refs/heads/9.0
addons/l10n_mx/__openerp__.py
18
# -*- encoding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. # Coded by: Alejandro Negrin anegrin@vauxoo.com, # Planified by: Alejandro Negrin, Humberto Arocha, Moises Lopez # Finance by: Vauxoo. # Audited by: Humberto Arocha (hbto@vauxoo.com) y Moises Lopez (moylop26...
ITURO/ituro
refs/heads/master
ituro/sumo/management/commands/__init__.py
12133432
bop/hybrid
refs/heads/master
lib/python2.6/site-packages/django/conf/locale/de_CH/__init__.py
12133432
arivarton/multi-torrent-downloader
refs/heads/master
mtorrentd/site-modules/__init__.py
12133432
yagoulas/OpenBazaar
refs/heads/master
test/test_ec.py
3
import unittest import pyelliptic as ec from node import crypto_util class TestPyellipticSymmetric(unittest.TestCase): @classmethod def setUpClass(cls): cls.ciphername = "aes-256-cfb" cls.secret_key = "YELLOW SUBMARINE" def test_symmetric_one_pass(self): encrypt, decrypt = 1, 0...
bitcity/django-allauth
refs/heads/master
test_settings.py
26
# -*- coding: utf-8 -*- import django SECRET_KEY = 'psst' SITE_ID = 1 DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': ':memory:', 'USER': '', 'PASSWORD': '', 'HOST': '', 'PORT': '', } } ROOT_URLCONF = 'allauth.urls' if django.VERSIO...
domenicosolazzo/practice-django
refs/heads/master
venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/euckrfreq.py
3120
######################## 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...
abhidrona/gn-osc-custom
refs/heads/master
oscar/apps/offer/custom.py
6
from django.core import exceptions from oscar.apps.offer.models import Range, Condition, Benefit def _class_path(klass): return '%s.%s' % (klass.__module__, klass.__name__) def create_range(range_class): """ Create a custom range instance """ if not hasattr(range_class, 'name'): raise e...
nelmiux/CarnotKE
refs/heads/master
jyhton/lib-python/2.7/lib-tk/tkFileDialog.py
196
# # Instant Python # $Id: tkFileDialog.py 36560 2004-07-18 06:16:08Z tim_one $ # # tk common file dialogues # # this module provides interfaces to the native file dialogues # available in Tk 4.2 and newer, and the directory dialogue available # in Tk 8.3 and newer. # # written by Fredrik Lundh, May 1997. # # # options...
hgl888/chromium-crosswalk
refs/heads/master
chrome/test/chromedriver/client/webelement.py
15
# Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from command_executor import Command class WebElement(object): """Represents an HTML element.""" def __init__(self, chromedriver, id_): self._chrom...
sinpantuflas/aubio
refs/heads/master
python.old/aubio/task/task.py
13
from aubio.aubioclass import * from params import taskparams class task(taskparams): """ default template class to apply tasks on a stream """ def __init__(self,input,output=None,params=None): """ open the input file and initialize default argument parameters should be set *before* calling this method. """ ...
babraham123/deepdriving
refs/heads/master
alexnet_reduced.py
1
from keras.models import Sequential, Model from keras.layers import Flatten, Dense, Dropout, Reshape, Permute, Activation, Input #, merge from keras.layers.convolutional import Convolution2D, MaxPooling2D, ZeroPadding2D from keras.layers.normalization import LRN2D from keras.optimizers import SGD import numpy as np fro...
edulramirez/nova
refs/heads/master
nova/scheduler/filters/num_instances_filter.py
56
# Copyright (c) 2012 OpenStack Foundation # 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 ...
hottwaj/django
refs/heads/master
tests/gis_tests/geos_tests/test_mutable_list.py
173
# Copyright (c) 2008-2009 Aryeh Leib Taurog, http://www.aryehleib.com # All rights reserved. # # Modified from original contribution by Aryeh Leib Taurog, which was # released under the New BSD license. import unittest from django.contrib.gis.geos.mutable_list import ListMixin from django.utils import six class Use...
davecranwell/wagtail
refs/heads/master
wagtail/wagtailembeds/embeds.py
4
from datetime import datetime from wagtail.wagtailembeds.models import Embed from wagtail.wagtailembeds.finders import get_default_finder def get_embed(url, max_width=None, finder=None): # Check database try: return Embed.objects.get(url=url, max_width=max_width) except Embed.DoesNotExist: ...
vktr/CouchPotatoServer
refs/heads/master
couchpotato/core/media/movie/providers/nzb/newznab.py
73
from couchpotato.core.helpers.encoding import tryUrlencode from couchpotato.core.helpers.variable import getIdentifier from couchpotato.core.logger import CPLog from couchpotato.core.media._base.providers.nzb.newznab import Base from couchpotato.core.media.movie.providers.base import MovieProvider log = CPLog(__name__...
sYnfo/samba-1
refs/heads/master
python/samba/tests/ntacls.py
32
# Unix SMB/CIFS implementation. Tests for ntacls manipulation # Copyright (C) Matthieu Patou <mat@matws.net> 2009-2010 # Copyright (C) Andrew Bartlett 2012 # # 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 ...
jk1/intellij-community
refs/heads/master
python/testData/inspections/PyCompatibilityInspection/noWarningAboutStarredExpressionsInFunctionTypeComments.py
30
def create_instance(self, task_config, **kwargs): # type: (TaskConfig, **Text) -> TaskInstance pass
alexlo03/ansible
refs/heads/devel
lib/ansible/modules/cloud/amazon/dynamodb_table.py
15
#!/usr/bin/python # 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', 'status': ['preview'], ...
ranog/simplemooc
refs/heads/master
simplemooc/accounts/views.py
1
from django.shortcuts import render, redirect # Create your views here. from django.contrib.auth.forms import UserCreationForm, PasswordChangeForm from django.conf import settings from django.contrib.auth import authenticate, login from django.contrib.auth.decorators import login_required from .forms import RegisterF...
vinegret/youtube-dl
refs/heads/master
youtube_dl/extractor/drtuber.py
20
from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( int_or_none, NO_DEFAULT, parse_duration, str_to_int, ) class DrTuberIE(InfoExtractor): _VALID_URL = r'https?://(?:(?:www|m)\.)?drtuber\.com/(?:video|embed)/(?P<id>\d+)(?:/(?P<display_id>[\w-...
nzjrs/cerbero
refs/heads/binary-windows
cerbero/commands/package.py
15
# cerbero - a multi-platform build system for Open Source software # Copyright (C) 2012 Andoni Morales Alastruey <ylatuya@gmail.com> # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; eit...
syhpoon/xyzcmd
refs/heads/master
plugins/ui/vixyz/main.py
1
#-*- coding: utf8 -* # # Max E. Kuznecov <mek@mek.uz.ua> 2010 # from libxyz.core.utils import is_func from libxyz.core.plugins import BasePlugin from libxyz.ui import Shortcut from libxyz.core.dsl import XYZ class XYZPlugin(BasePlugin): "Plugin vixyz" NAME = u"vixyz" AUTHOR = u"Max E. Kuznecov <mek@mek.u...
Bawhoppen/-tg-station
refs/heads/master
tools/midi2piano/pyperclip/__init__.py
110
""" Pyperclip A cross-platform clipboard module for Python. (only handles plain text for now) By Al Sweigart al@inventwithpython.com BSD License Usage: import pyperclip pyperclip.copy('The text to be copied to the clipboard.') spam = pyperclip.paste() if not pyperclip.copy: print("Copy functionality unav...
nickpack/django-oscar
refs/heads/master
src/oscar/apps/analytics/models.py
27
from oscar.core.loading import is_model_registered from oscar.apps.analytics.abstract_models import ( AbstractProductRecord, AbstractUserRecord, AbstractUserProductView, AbstractUserSearch) __all__ = [] if not is_model_registered('analytics', 'ProductRecord'): class ProductRecord(AbstractProductRecord): ...
friedrich420/S4-GPE-AEL-Kernel-4.4.3
refs/heads/master
scripts/gcc-wrapper.py
364
#! /usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2011-2012, The Linux Foundation. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of source code must retain th...
dpac-vlsi/SynchroTrace
refs/heads/master
src/python/m5/util/terminal.py
83
# Copyright (c) 2011 Advanced Micro Devices, 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...
xmission/d-note
refs/heads/master
venv/lib/python2.7/site-packages/Naked/commands/locate.py
1
#!/usr/bin/env python # encoding: utf-8 import os from Naked.toolshed.system import stderr, exit_success class Locator: def __init__(self, needle): self.needle = needle self.location = self._display_location() def _display_location(self): if self.needle == 'main': main_pat...
shumik/skencil-c
refs/heads/master
Sketch/UI/palette.py
1
# Sketch - A Python-based interactive drawing program # Copyright (C) 1997, 1998, 2001, 2003 by Bernhard Herzog # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of th...
buskjan/inetradio
refs/heads/master
lib/python3.5/site-packages/pip/_vendor/requests/packages/urllib3/util/connection.py
365
from __future__ import absolute_import import socket try: from select import poll, POLLIN except ImportError: # `poll` doesn't exist on OSX and other platforms poll = False try: from select import select except ImportError: # `select` doesn't exist on AppEngine. select = False def is...
TRex22/Sick-Beard
refs/heads/master
sickbeard/version.py
17
SICKBEARD_VERSION = "master"