repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
⌀
MonsieurLuge/minecrafttools
refs/heads/master
minecrafttools/server.py
2
# -*- coding: utf-8 -*- from minecrafttools.properties import Properties from minecrafttools.whitelist import Whitelist from minecrafttools.world import World import os class Server: def __init__(self, minecraftDirectory): self.__properties = Properties(os.path.join(minecraftDirectory, 'server.pro...
tchellomello/home-assistant
refs/heads/dev
homeassistant/components/owntracks/const.py
26
"""Constants for OwnTracks.""" DOMAIN = "owntracks"
eljefe6a/incubator-beam
refs/heads/master
sdks/python/apache_beam/examples/complete/tfidf.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 us...
BorisJeremic/Real-ESSI-Examples
refs/heads/master
valgrind_test/test_cases/8NodeBrick/circular_plate_clamped/2layer/side_length_05/compare_txt.py
202
#!/usr/bin/python import h5py import sys import numpy as np import os import re import random # find the path to my own python function: cur_dir=os.getcwd() sep='test_cases' test_DIR=cur_dir.split(sep,1)[0] scriptDIR=test_DIR+'compare_function' sys.path.append(scriptDIR) # import my own function for color and comparat...
DivineHime/seishirou
refs/heads/master
lib/imgurpython/helpers/format.py
22
from ..helpers import Comment from ..helpers import GalleryAlbum from ..helpers import GalleryImage from ..helpers import Notification def build_comment_tree(children): children_objects = [] for child in children: to_insert = Comment(child) to_insert.children = build_comment_tree(to_insert.chi...
darkryder/django
refs/heads/master
django/db/backends/base/operations.py
4
import datetime import decimal import warnings from importlib import import_module from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.db.backends import utils from django.utils import six, timezone from django.utils.dateparse import parse_duration from django.utils.dep...
rch/wsgi-seed
refs/heads/master
wsgi/container/core/message/__init__.py
4
from api import DirectRequest, parse
TeamSWAP/swap
refs/heads/master
external/pyinstaller/tests/import/relimp3a/aa/a1.py
7
#----------------------------------------------------------------------------- # Copyright (c) 2013, PyInstaller Development Team. # # Distributed under the terms of the GNU General Public License with exception # for distributing bootloader. # # The full license is in the file COPYING.txt, distributed with this softwa...
pseudonym117/Riot-Watcher
refs/heads/master
tests/test_ValWatcher.py
1
import pytest from riotwatcher import ValWatcher @pytest.mark.val @pytest.mark.usefixtures("reset_globals") class TestValWatcher: def test_require_api_key(self): with pytest.raises(ValueError): ValWatcher(None) def test_allows_positional_api_key(self): ValWatcher("RGAPI-this-is-a...
marty3d/djangocms-blog
refs/heads/develop
djangocms_blog/feeds.py
8
# -*- coding: utf-8 -*- from django.contrib.sites.models import Site from django.contrib.syndication.views import Feed from django.core.urlresolvers import reverse from django.utils.translation import ugettext as _ from .models import Post from .settings import get_setting class LatestEntriesFeed(Feed): def lin...
antonio78952/clase-29-agosto
refs/heads/master
encoding.py
1
import json data = [ { 'a':'A', 'b':(2, 4), 'c':3.0 } ] data_string = json.dumps(data) print 'ENCODED:', data_string decoded = json.loads(data_string) print 'DECODED:', decoded print 'ORIGINAL:', type(data[0]['b']) print 'DECODED :', type(decoded[0]['b'])
klmitch/neutron
refs/heads/master
neutron/tests/unit/plugins/ml2/drivers/openvswitch/agent/fake_oflib.py
28
# Copyright (C) 2014 VA Linux Systems Japan K.K. # Copyright (C) 2014 Fumihiko Kakuma <kakuma at valinux co jp> # Copyright (C) 2014 YAMAMOTO Takashi <yamamoto at valinux co jp> # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in complia...
keishi/chromium
refs/heads/master
tools/heapcheck/suppressions.py
51
#!/usr/bin/env python # Copyright (c) 2011 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Valgrind-style suppressions for heapchecker reports. Suppressions are defined as follows: # optional one-line comments anywher...
nvie/python-mode
refs/heads/develop
pymode/libs2/rope/base/__init__.py
115
"""Base rope package This package contains rope core modules that are used by other modules and packages. """ __all__ = ['project', 'libutils', 'exceptions']
cristian69/KernotekV3
refs/heads/master
venv/lib/python2.7/site-packages/werkzeug/testsuite/contrib/wrappers.py
102
# -*- coding: utf-8 -*- """ werkzeug.testsuite.contrib.wrappers ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Added tests for the sessions. :copyright: (c) 2013 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ from __future__ import with_statement import unittest from werkzeug.testsuit...
nlevitt/youtube-dl
refs/heads/master
youtube_dl/extractor/gamekings.py
122
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor from ..utils import ( xpath_text, xpath_with_ns, ) class GamekingsIE(InfoExtractor): _VALID_URL = r'http://www\.gamekings\.tv/(?:videos|nieuws)/(?P<id>[^/]+)' _TESTS = [{ 'url': 'http://www.gamekings.tv/...
Jet-Streaming/gyp
refs/heads/master
test/rename/gyptest-filecase.py
1
#!/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. """ Checks that files whose file case changes get rebuilt correctly. """ import os import TestGyp test = TestGyp.TestGyp() C...
liangjiaxing/sympy
refs/heads/master
sympy/polys/orderings.py
123
"""Definitions of monomial orderings. """ from __future__ import print_function, division __all__ = ["lex", "grlex", "grevlex", "ilex", "igrlex", "igrevlex"] from sympy.core import Symbol from sympy.core.compatibility import iterable class MonomialOrder(object): """Base class for monomial orderings. """ al...
gfyoung/scipy
refs/heads/master
scipy/special/tests/test_round.py
27
from __future__ import division, print_function, absolute_import import numpy as np import pytest from scipy.special import _test_round @pytest.mark.skipif(not _test_round.have_fenv(), reason="no fenv()") def test_add_round_up(): np.random.seed(1234) _test_round.test_add_round(10**5, 'up') @pytest.mark.sk...
ConsenSys/eth-testrpc
refs/heads/master
tests/client/test_get_balance.py
3
def test_deploying_contract(client, hex_accounts): pre_balance = client.get_balance(hex_accounts[1]) client.send_transaction( _from=hex_accounts[0], to=hex_accounts[1], value=1234, ) post_balance = client.get_balance(hex_accounts[1]) assert post_balance - pre_balance == 12...
gregpuzzles1/Sandbox
refs/heads/master
Example Programs/Ch_03_Student_Files/newton.py
1
""" Program: newton.py Author: Ken Compute the square root of a number. 1. The input is a number. 2. The outputs are the program's estimate of the square root using Newton's method of successive approximations, and Python's own estimate using math.sqrt. """ import math # Receive the input number from the use...
fedorpatlin/ansible
refs/heads/devel
lib/ansible/modules/cloud/openstack/os_user_role.py
49
#!/usr/bin/python # Copyright (c) 2016 IBM # # This module 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 software is distrib...
doselect/django-tastypie
refs/heads/master
tastypie/admin.py
57
from __future__ import unicode_literals from django.conf import settings from django.contrib import admin if 'django.contrib.auth' in settings.INSTALLED_APPS: from tastypie.models import ApiKey class ApiKeyInline(admin.StackedInline): model = ApiKey extra = 0 ABSTRACT_APIKEY = getattr(se...
psykidellic/appengine-flask-skeleton
refs/heads/master
lib/googleapiclient/discovery.py
14
# Copyright 2014 Google Inc. 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 applicable law or ...
IceCubeDev/SpaceOrNot
refs/heads/master
psycopg2/tests/test_bugX000.py
81
#!/usr/bin/env python # bugX000.py - test for DateTime object allocation bug # # Copyright (C) 2007-2011 Federico Di Gregorio <fog@debian.org> # # psycopg2 is free software: you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published # by the Free Software Foundati...
nitzmahone/ansible
refs/heads/devel
lib/ansible/modules/network/aci/aci_contract.py
15
#!/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'], ...
rcrowder/pycapnp
refs/heads/develop
setup.py
2
#!/usr/bin/env python from __future__ import print_function use_cython = False from distutils.core import setup import os import sys from buildutils import test_build, fetch_libcapnp, build_libcapnp, info from distutils.errors import CompileError from distutils.extension import Extension _this_dir = os.path.dirname(...
lociii/googleads-python-lib
refs/heads/master
examples/adspygoogle/dfp/v201302/get_users_by_statement.py
3
#!/usr/bin/python # # Copyright 2013 Google Inc. 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 b...
mvaled/sentry
refs/heads/master
src/sentry/mediators/sentry_app_installations/creator.py
2
from __future__ import absolute_import import six from sentry import analytics from sentry.constants import SentryAppInstallationStatus from sentry.mediators import Mediator, Param, service_hooks from sentry.models import AuditLogEntryEvent, ApiGrant, SentryApp, SentryAppInstallation from sentry.utils.cache import me...
RJVB/audacity
refs/heads/master
lib-src/lv2/lv2/plugins/eg04-sampler.lv2/waflib/Tools/gas.py
331
#! /usr/bin/env python # encoding: utf-8 # WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file import waflib.Tools.asm from waflib.Tools import ar def configure(conf): conf.find_program(['gas','gcc'],var='AS') conf.env.AS_TGT_F=['-c','-o'] conf.env.ASLNK_TGT_F=['-o']...
calculuscowboy/cookiecutter-django
refs/heads/master
docs/__init__.py
887
# Included so that Django's startproject comment runs against the docs directory
nelmiux/CarnotKE
refs/heads/master
jyhton/Lib/xml/__init__.py
29
"""Core XML support for Jython. This package contains two sub-packages: dom -- The W3C Document Object Model. This supports DOM Level 1 + Namespaces. sax -- The Simple API for XML, developed by XML-Dev, led by David Megginson and ported to Python by Lars Marius Garshol. This supports the SAX 2...
purpleidea/macaronic-net
refs/heads/master
django/contrib/comments/admin.py
361
from django.contrib import admin from django.contrib.comments.models import Comment from django.utils.translation import ugettext_lazy as _, ungettext from django.contrib.comments import get_model from django.contrib.comments.views.moderation import perform_flag, perform_approve, perform_delete class CommentsAdmin(adm...
sashabaranov/everware
refs/heads/master
etc/github_reloading_whitelist.py
3
# This adds the ability to modify the GithHub username whitelist # without having to restart the hub. Use this together # with GitHubOAuthenticator # Create whitelist.txt in the top level directory, listing one allowed # username per line import everware authenticator = everware.GitHubOAuthenticator whitelist_file = ...
MarishaYasko/interactive-stories-stands
refs/heads/master
InteractiveStands/Lib/encodings/cp1125.py
213
""" Python Character Mapping Codec for CP1125 """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_map) def decode(self,input,errors='strict'): return codecs.charmap_decode(input,errors,deco...
jorisvandenbossche/numpy
refs/heads/master
numpy/distutils/npy_pkg_config.py
4
from __future__ import division, absolute_import, print_function import sys import re import os if sys.version_info[0] < 3: from ConfigParser import RawConfigParser else: from configparser import RawConfigParser __all__ = ['FormatError', 'PkgNotFound', 'LibraryInfo', 'VariableSet', 'read_config', 'pa...
consbio/seedsource-core
refs/heads/master
seedsource_core/django/accounts/forms.py
1
from django import forms from django.utils.translation import ugettext as _ from .models import PasswordResetToken class PasswordResetForm(forms.Form): token = forms.CharField() password = forms.CharField() confirm = forms.CharField() def clean_token(self): data = self.cleaned_data.get('toke...
Jaccorot/django-cms
refs/heads/develop
cms/south_migrations/0005_mptt_added_to_plugins.py
1680
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models try: from django.contrib.auth import get_user_model except ImportError: # django < 1.5 from django.contrib.auth.models import User else: User = get_user_model() user_orm_label...
shackra/thomas-aquinas
refs/heads/stable-branch
summa/path.py
1
# ---------------------------------------------------------------------------- # cocos2d # Copyright (c) 2008-2012 Daniel Moisset, Ricardo Quesada, Rayentray Tappa, # Lucio Torre # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the...
yaroslav-tarasov/OpenShadingLanguage
refs/heads/master
testsuite/layers-lazy/run.py
13
#!/usr/bin/env python command += testshade("-g 2 2 -layer alayer a -layer blayer b --layer clayer c --connect alayer f_out clayer f_in --connect alayer c_out clayer c_in --connect blayer out clayer unused")
geektophe/shinken
refs/heads/master
shinken/check.py
3
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (C) 2009-2014: # Gabes Jean, naparuba@gmail.com # Gerhard Lausser, Gerhard.Lausser@consol.de # Gregory Starck, g.starck@gmail.com # Hartmut Goebel, h.goebel@goebel-consult.de # # This file is part of Shinken. # # Shinken is free software: you can r...
alinbalutoiu/tempest
refs/heads/master
tempest/api/compute/test_live_block_migration_negative.py
8
# Copyright 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 requ...
RafaelRMachado/qtwebkit
refs/heads/dev
Tools/Scripts/webkitpy/style/checkers/changelog_unittest.py
122
# Copyright (C) 2010 Apple Inc. All rights reserved. # Copyright (C) 2011 Patrick Gansterer <paroga@paroga.com> # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the abov...
t0in4/django
refs/heads/master
django/templatetags/future.py
136
import warnings from django.template import Library, defaulttags from django.utils.deprecation import RemovedInDjango110Warning register = Library() @register.tag def cycle(parser, token): """ This is the future version of `cycle` with auto-escaping. The deprecation is now complete and this version is n...
75651/kbengine_cloud
refs/heads/master
kbe/src/lib/python/Lib/distutils/config.py
91
"""distutils.pypirc Provides the PyPIRCCommand class, the base class for the command classes that uses .pypirc in the distutils.command package. """ import os from configparser import ConfigParser from distutils.cmd import Command DEFAULT_PYPIRC = """\ [distutils] index-servers = pypi [pypi] username:%s passwor...
amondot/QGIS
refs/heads/master
python/plugins/MetaSearch/dialogs/__init__.py
102
# -*- coding: utf-8 -*- ############################################################################### # # Copyright (C) 2014 Tom Kralidis (tomkralidis@gmail.com) # # This source 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 # So...
DavidPurcell/murano_temp
refs/heads/master
murano/tests/functional/integration/integration_base.py
4
# Copyright (c) 2015 OpenStack Foundation, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed ...
frankiecjunle/yunblog
refs/heads/master
venv/lib/python2.7/site-packages/pygments/lexers/parsers.py
363
# -*- coding: utf-8 -*- """ pygments.lexers.parsers ~~~~~~~~~~~~~~~~~~~~~~~ Lexers for parser generators. :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re from pygments.lexer import RegexLexer, DelegatingLexer, \ include...
ksthesis/gatk
refs/heads/master
scripts/funcotator/data_sources/sortClinvarHgmd.py
6
#!/usr/bin/env python # This script sorts the Clinvar/HGMD dataset to be in ascending order by chromosome, position. ######################################################################## # Imports: import csv import sys from GenericTsvReader import GenericTsvReader ###############################################...
heisencoder/route-finder
refs/heads/master
third_party/lib/python/django/db/backends/oracle/compiler.py
105
from django.db.models.sql import compiler from django.utils.six.moves import zip_longest class SQLCompiler(compiler.SQLCompiler): def resolve_columns(self, row, fields=()): # If this query has limit/offset information, then we expect the # first column to be an extra "_RN" column that we need to t...
muskanbararia/Hacker_Earth-Solutions-using-python
refs/heads/master
BitManipulation/monk_and_friend.py
1
# -*- coding: utf-8 -*- """ Created on Wed Sep 07 01:23:39 2016 @author: acer """ def binary(num): ret=0 while (num!=0): bit=num%2 if bit==1: ret=ret+1 num=num/2 return ret t=int(raw_input()) for a in range(0,t): a=[] a = [int(z) for z in raw_input().split()...
40223240/2015cdb_g3
refs/heads/master
static/Brython3.1.0-20150301-090019/Lib/ui/dialog.py
607
from . import widget from browser import html, document class Dialog(widget.DraggableWidget): def __init__(self, id=None): self._div_shell=html.DIV( Class="ui-dialog ui-widget ui-widget-content ui-corner-all ui-front ui-draggable ui-resizable", style={'position': 'absolute', 'height': 'auto',...
hernandito/SickRage
refs/heads/master
lib/pyasn1/type/char.py
220
# ASN.1 "character string" types from pyasn1.type import univ, tag class UTF8String(univ.OctetString): tagSet = univ.OctetString.tagSet.tagImplicitly( tag.Tag(tag.tagClassUniversal, tag.tagFormatSimple, 12) ) encoding = "utf-8" class NumericString(univ.OctetString): tagSet = univ.OctetStri...
Reflexe/doc_to_pdf
refs/heads/master
Windows/program/python-core-3.5.0/lib/enum.py
6
import sys from collections import OrderedDict from types import MappingProxyType, DynamicClassAttribute __all__ = ['Enum', 'IntEnum', 'unique'] def _is_descriptor(obj): """Returns True if obj is a descriptor, False otherwise.""" return ( hasattr(obj, '__get__') or hasattr(obj, '__set...
ProjectSWGCore/NGECore2
refs/heads/master
scripts/object/intangible/pet/dwarf_spider_droid.py
85615
import sys def setup(core, object): return
muslih/alfanous
refs/heads/master
src/alfanous/QueryProcessing.py
2
#!/usr/bin/env python2 # coding: utf-8 # # Copyright (C) 2009-2012 Assem Chelli <assem.ch [at] gmail.com> # # 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 ve...
tjanez/bup
refs/heads/master
lib/bup/index.py
1
import metadata, os, stat, struct, tempfile from bup import xstat from bup.helpers import * EMPTY_SHA = '\0'*20 FAKE_SHA = '\x01'*20 INDEX_HDR = 'BUPI\0\0\0\6' # Time values are handled as integer nanoseconds since the epoch in # memory, but are written as xstat/metadata timespecs. This behavior # matches the exist...
raf-programmer/django-biblioteka
refs/heads/master
shelf/migrations/0004_auto_20150419_0850.py
1
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('shelf', '0003_auto_20150213_0113'), ] operations = [ migrations.AlterField( model_name='author', nam...
jeking3/thrift
refs/heads/master
lib/py/src/protocol/TCompactProtocol.py
15
# # 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...
postlund/home-assistant
refs/heads/dev
homeassistant/components/aqualogic/sensor.py
7
"""Support for AquaLogic sensors.""" import logging import voluptuous as vol from homeassistant.components.sensor import PLATFORM_SCHEMA from homeassistant.const import CONF_MONITORED_CONDITIONS, TEMP_CELSIUS, TEMP_FAHRENHEIT from homeassistant.core import callback import homeassistant.helpers.config_validation as cv...
mateusz880/mtasa-blue
refs/heads/master
vendor/google-breakpad/src/tools/gyp/test/configurations/invalid/gyptest-configurations.py
261
#!/usr/bin/env python # Copyright (c) 2010 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. """ Verifies build of an executable in three different configurations. """ import TestGyp # Keys that do not belong inside a configuration...
openstack/congress
refs/heads/master
congress/tests/test_benchmark_updates.py
2
# Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the...
j-carpentier/nova
refs/heads/master
nova/api/openstack/compute/legacy_v2/contrib/flavormanage.py
63
# 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...
agaurav/ansible
refs/heads/devel
v1/ansible/inventory/dir.py
134
# (c) 2013, Daniel Hokka Zakrisson <daniel@hozac.com> # (c) 2014, Serge van Ginderachter <serge@vanginderachter.be> # # 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, ...
crioux/SpeedDemon-Profiler
refs/heads/master
wxscintilla/src/scintilla/src/LexGen.py
1
# LexGen.py - implemented 2002 by Neil Hodgson neilh@scintilla.org # Released to the public domain. # Regenerate the Scintilla and SciTE source files that list # all the lexers and all the properties files. # Should be run whenever a new lexer is added or removed. # Requires Python 2.1 or later # Most files are regene...
percyfal/ratatosk
refs/heads/master
ratatosk/lib/utils/cutadapt.py
1
# Copyright (c) 2013 Per Unneberg # # 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,...
thedrow/django
refs/heads/master
django/utils/html_parser.py
348
import re import sys from django.utils import six from django.utils.six.moves import html_parser as _html_parser current_version = sys.version_info use_workaround = current_version < (2, 7, 3) try: HTMLParseError = _html_parser.HTMLParseError except AttributeError: # create a dummy class for Python 3.5+ whe...
bop/rango
refs/heads/master
lib/python2.7/site-packages/django/utils/unittest/__init__.py
571
""" unittest2 unittest2 is a backport of the new features added to the unittest testing framework in Python 2.7. It is tested to run on Python 2.4 - 2.6. To use unittest2 instead of unittest simply replace ``import unittest`` with ``import unittest2``. Copyright (c) 1999-2003 Steve Purcell Copyright (c) 2003-2010 P...
pradyunsg/pip
refs/heads/update-to-libera
src/pip/_vendor/chardet/metadata/languages.py
20
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Metadata about languages used by our model training code for our SingleByteCharSetProbers. Could be used for other things in the future. This code is based on the language metadata from the uchardet project. """ from __future__ import absolute_import, print_function ...
beeftornado/sentry
refs/heads/master
src/sentry/api/endpoints/user_organizations.py
3
from __future__ import absolute_import from django.db.models import Q from sentry.api.bases.user import UserEndpoint from sentry.api.paginator import OffsetPaginator from sentry.api.serializers import serialize class UserOrganizationsEndpoint(UserEndpoint): def get(self, request, user): queryset = user....
PyCQA/pylint
refs/heads/main
tests/functional/ext/docparams.py
2
"""Fixture for testing missing documentation in docparams.""" def _private_func(param1): # [missing-return-doc, missing-return-type-doc] if param1: raise Exception('Example') return param1 def _private_func2(param1): # [missing-yield-doc, missing-yield-type-doc] yield param1
chokribr/invenio
refs/heads/master
invenio/legacy/websubmit/functions/Move_CKEditor_Files_to_Storage.py
13
# This file is part of Invenio. # Copyright (C) 2009, 2010, 2011 CERN. # # Invenio is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of the # License, or (at your option) any later version. # # ...
sodafree/backend
refs/heads/master
build/selenium/build/lib.linux-i686-2.7/selenium/webdriver/remote/remote_connection.py
3
# Copyright 2008-2009 WebDriver committers # Copyright 2008-2009 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requ...
jcrafts/sos
refs/heads/master
sos/plugins/devices.py
12
# This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # This program is distributed in the hope that it will be useful, # but...
PopCap/GameIdea
refs/heads/master
Engine/Source/ThirdParty/HTML5/emsdk/Win64/python/2.7.5.3_64bit/Lib/ssl.py
48
# Wrapper module for _ssl, providing some additional facilities # implemented in Python. Written by Bill Janssen. """\ This module provides some more Pythonic support for SSL. Object types: SSLSocket -- subtype of socket.socket which does SSL over the socket Exceptions: SSLError -- exception raised for I/O er...
t3dev/odoo
refs/heads/master
addons/mail/wizard/invite.py
1
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from lxml import etree from lxml.html import builder as html from odoo import _, api, fields, models class Invite(models.TransientModel): """ Wizard to invite partners (or channels) and make them followers. """ ...
openstack/horizon
refs/heads/master
openstack_dashboard/test/integration_tests/tests/test_volumetypes.py
4
# 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...
stefanseifert/redash
refs/heads/master
redash/query_runner/url.py
13
import requests from redash.query_runner import BaseQueryRunner, register class Url(BaseQueryRunner): @classmethod def configuration_schema(cls): return { 'type': 'object', 'properties': { 'url': { 'type': 'string', 'title...
lululau/autojump
refs/heads/master
bin/autojump_utils.py
18
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import print_function import errno from itertools import islice import os import platform import re import shutil import sys import unicodedata if sys.version_info[0] == 3: imap = map os.getcwdu = os.getcwd else: from itertools import imap d...
xuanyuanking/spark
refs/heads/master
python/pyspark/sql/tests/test_serde.py
23
# # 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 us...
bregman-arie/ansible
refs/heads/devel
lib/ansible/modules/network/cloudengine/ce_bgp_neighbor_af.py
43
#!/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...
gunan/tensorflow
refs/heads/master
tensorflow/python/kernel_tests/losses_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...
priyankadeswal/network-address-translator
refs/heads/master
src/core/examples/sample-simulator.py
43
# -*- Mode:Python; -*- # /* # * Copyright (c) 2010 INRIA # * # * This program is free software; you can redistribute it and/or modify # * it under the terms of the GNU General Public License version 2 as # * published by the Free Software Foundation; # * # * This program is distributed in the hope that it will b...
KoketsoMabuela92/titanium_mobile
refs/heads/master
support/iphone/pbxproj.py
36
# # This is a little class that will parse out an XCode project.pbxproj file # which is the proprietary metadata file for XCode projects # # Author: Jeff Haynie <jhaynie@appcelerator.com> # import os, uuid, sys, types, re import StringIO class PBXProj(object): def __init__(self): self.static_libs = [] def ge...
ThomasFeher/audacity
refs/heads/master
lib-src/lv2/serd/waflib/Tools/ifort.py
330
#! /usr/bin/env python # encoding: utf-8 # WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file import re from waflib import Utils from waflib.Tools import fc,fc_config,fc_scan,ar from waflib.Configure import conf @conf def find_ifort(conf): fc=conf.find_program('ifort'...
garg10may/youtube-dl
refs/heads/master
youtube_dl/extractor/dropbox.py
236
# coding: utf-8 from __future__ import unicode_literals import os.path import re from .common import InfoExtractor from ..compat import compat_urllib_parse_unquote from ..utils import url_basename class DropboxIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?dropbox[.]com/sh?/(?P<id>[a-zA-Z0-9]{15})/.*' ...
aptivate/ckanext-mapactiontheme
refs/heads/master
ckanext/mapactiontheme/tests/helpers.py
1
import ckan.tests.helpers as helpers import ckan.plugins as plugins class FunctionalTestBaseClass(helpers.FunctionalTestBase): @classmethod def setup_class(cls): super(FunctionalTestBaseClass, cls).setup_class() plugins.load('mapactiontheme') @classmethod def teardown_class(cls): ...
Cocosoft/bitcoin
refs/heads/master
qa/rpc-tests/mempool_limit.py
31
#!/usr/bin/env python3 # Copyright (c) 2014-2016 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # Test mempool limiting together/eviction with the wallet from test_framework.test_framework import Bitc...
grepme/CMPUT410Lab01
refs/heads/master
virt_env/virt1/lib/python2.7/site-packages/nose-1.3.4-py2.7.egg/nose/plugins/plugintest.py
69
""" Testing Plugins =============== The plugin interface is well-tested enough to safely unit test your use of its hooks with some level of confidence. However, there is also a mixin for unittest.TestCase called PluginTester that's designed to test plugins in their native runtime environment. Here's a simple example ...
hfp/tensorflow-xsmm
refs/heads/master
tensorflow/python/kernel_tests/fractional_avg_pool_op_test.py
35
# 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...
dongguangming/youtube-dl
refs/heads/master
youtube_dl/downloader/external.py
55
from __future__ import unicode_literals import os.path import subprocess from .common import FileDownloader from ..utils import ( cli_option, cli_valueless_option, cli_bool_option, cli_configuration_args, encodeFilename, encodeArgument, ) class ExternalFD(FileDownloader): def real_downlo...
fangxingli/hue
refs/heads/master
desktop/core/ext-py/Django-1.6.10/django/core/management/commands/runserver.py
47
from __future__ import unicode_literals from optparse import make_option from datetime import datetime import errno import os import re import sys import socket from django.core.management.base import BaseCommand, CommandError from django.core.servers.basehttp import run, get_internal_wsgi_application from django.uti...
trlsmax/rk3188_kernel_tinyastro
refs/heads/master
tools/perf/scripts/python/syscall-counts.py
11181
# system call counts # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Displays system-wide system call totals, broken down by syscall. # If a [comm] arg is specified, only syscalls called by [comm] are displayed. import os import sys sys.path.append(os.envir...
crossroadchurch/paul
refs/heads/master
openlp/plugins/custom/forms/editcustomdialog.py
1
# -*- coding: utf-8 -*- # vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4 ############################################################################### # OpenLP - Open Source Lyrics Projection # # ------------------------------------------------------...
kubaszostak/gdal-dragndrop
refs/heads/master
osgeo/apps/Python27/Lib/encodings/iso8859_14.py
93
""" Python Character Mapping Codec iso8859_14 generated from 'MAPPINGS/ISO8859/8859-14.TXT' with gencodec.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_table) def decode(self...
mantrarush/InterviewPrep
refs/heads/master
InterviewQuestions/Arrays/DistInArrays.py
1
# https://leetcode.com/problems/maximum-distance-in-arrays/description/ # Given m arrays, and each array is sorted in ascending order. Now you can pick up two integers from two different arrays (each array picks one) and calculate the distance. We define the distance between two integers a and b to be their absolute di...
otger/PubSubTest
refs/heads/master
entropyfw/dealer/playermanager.py
2
#!/usr/bin/python # -*- coding: utf-8 -*- from .logger import log __author__ = 'otger' class PlayerManager(object): def __init__(self): self._players = {} self._players_count = 0 log.debug("Created players manager") def add_player(self, player): if player.name in self._player...
dacjames/mara-lang
refs/heads/develop
bootstrap/mara/__main__.py
1
import interpreter shell = interpreter.Interpreter(shell=True) shell.loop()
lucidbard/NewsBlur
refs/heads/master
apps/rss_feeds/migrations/0053_known_good.py
18
# 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 'Feed.known_good' db.add_column('feeds', 'known_good', self.gf('django.db.models.fields.Boo...
wfxiang08/django190
refs/heads/master
django/conf/app_template/admin.py
13848
from django.contrib import admin # Register your models here.