repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
camptocamp/odoo
refs/heads/master
addons/hr_payroll_account/__openerp__.py
120
#-*- coding:utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved # d$ # # This program is free software: you can redistribute it and/or modify # it ...
2ndy/RaspIM
refs/heads/master
usr/lib/python2.6/encodings/cp1257.py
593
""" Python Character Mapping Codec cp1257 generated from 'MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1257.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,in...
edmorley/django
refs/heads/master
tests/gis_tests/maps/__init__.py
12133432
dutwfk/pytest
refs/heads/master
leetcode/py/100.py
12133432
dims/neutron
refs/heads/master
neutron/tests/unit/db/quota/__init__.py
12133432
reckbo/ppl
refs/heads/master
config/axis_align_nrrd.py
1
#!/usr/bin/env python # # How does this compare to `unu unorient`? import sys import os from os.path import basename, splitext, abspath, exists import argparse import tempfile from subprocess import Popen, PIPE import re import numpy from numpy import matrix, identity, diag from numpy import linalg from numpy.linalg i...
onceuponatimeforever/oh-mainline
refs/heads/master
vendor/packages/twisted/twisted/test/test_randbytes.py
18
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Test cases for L{twisted.python.randbytes}. """ import os from twisted.trial import unittest from twisted.python import randbytes class SecureRandomTestCaseBase(object): """ Base class for secureRandom test cases. """ def...
ypwalter/fxos-certsuite
refs/heads/master
mcts/webapi_tests/telephony/test_telephony_incoming_hold_outgoing.py
3
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this file, # You can obtain one at http://mozilla.org/MPL/2.0/. import time from marionette_driver.wait import Wait from mcts.webapi_tests.semiauto import TestCase from mcts.webapi_te...
Rhizi/rhizi
refs/heads/master
rhizi/rz_feedback.py
1
# This file is part of rhizi, a collaborative knowledge graph editor. # Copyright (C) 2014-2015 Rhizi # # 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...
pombredanne/pythran
refs/heads/master
pythran/tests/cases/scrabble.py
4
#from http://stackoverflow.com/questions/18345202/functional-vs-imperative-style-in-python #pythran export scrabble_fun_score(str, str: int dict) #pythran export scrabble_imp_score(str, str: int dict) #runas scrabble_fun_score('tralala', {'t': 1, 'r': 2, 'a': 3, 'l': 4}) #runas scrabble_fun_score('tralala', {'t': 1, 'r...
natanlailari/PennApps2015-Heartmates
refs/heads/master
venv/lib/python2.7/site-packages/pip/_vendor/requests/__init__.py
327
# -*- coding: utf-8 -*- # __ # /__) _ _ _ _ _/ _ # / ( (- (/ (/ (- _) / _) # / """ requests HTTP library ~~~~~~~~~~~~~~~~~~~~~ Requests is an HTTP library, written in Python, for human beings. Basic GET usage: >>> import requests >>> r = requests.get('http://python.org') >>> r.sta...
gurneyalex/OpenUpgrade
refs/heads/master
addons/account_followup/report/account_followup_print.py
40
# -*- 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...
arnavd96/Cinemiezer
refs/heads/master
myvenv/lib/python3.4/site-packages/unidecode/x0ff.py
252
data = ( '[?]', # 0x00 '!', # 0x01 '"', # 0x02 '#', # 0x03 '$', # 0x04 '%', # 0x05 '&', # 0x06 '\'', # 0x07 '(', # 0x08 ')', # 0x09 '*', # 0x0a '+', # 0x0b ',', # 0x0c '-', # 0x0d '.', # 0x0e '/', # 0x0f '0', # 0x10 '1', # 0x11 '2', # 0x12 '3', # 0x13 '4', ...
CuonDeveloper/cuon
refs/heads/master
cuon_server/src/cuon/CuonFuncs.py
3
import xmlrpclib from twisted.web import xmlrpc #from twisted.internet import defer #from twisted.internet import reactor #from twisted.web import server import os import sys import time import random import xmlrpclib class CuonFuncs(xmlrpc.XMLRPC ): #def __init__(self): # pass def xmlr...
eerimoq/cantools
refs/heads/master
tests/test_plot_without_mock.py
1
#!/usr/bin/env python3 import os import sys import unittest from unittest import mock from io import StringIO import cantools import matplotlib.pyplot as plt class CanToolsPlotTest(unittest.TestCase): DBC_FILE = os.path.join(os.path.split(__file__)[0], 'files/dbc/abs.dbc') FN_OUT = "out.pdf" def test_p...
kvesteri/sqlalchemy-json-api
refs/heads/master
tests/test_select_one.py
2
import json import pytest @pytest.mark.usefixtures('table_creator', 'dataset') class TestSelectOne(object): def test_with_from_obj(self, query_builder, session, user_cls): query = query_builder.select_one( user_cls, 1, fields={'users': ['all_friends']}, fro...
calfonso/ansible
refs/heads/devel
test/integration/targets/setup_rpm_repo/files/create-repo.py
67
#!/usr/bin/env python import sys from collections import namedtuple import rpmfluff RPM = namedtuple('RPM', ['name', 'version', 'release', 'epoch']) SPECS = [ RPM('foo', '1.0', '1', None), RPM('foo', '1.0', '2', '1'), RPM('foo', '1.1', '1', '1'), ] def main(): try: arch = sys.argv[1] ...
mancoast/CPythonPyc_test
refs/heads/master
cpython/211_test_compare.py
5
import sys from test_support import * class Empty: def __repr__(self): return '<Empty>' class Coerce: def __init__(self, arg): self.arg = arg def __repr__(self): return '<Coerce %s>' % self.arg def __coerce__(self, other): if isinstance(other, Coerce): re...
webmasterraj/GaSiProMo
refs/heads/master
flask/lib/python2.7/site-packages/boto/ec2/spotdatafeedsubscription.py
18
# Copyright (c) 2006-2009 Mitch Garnaat http://garnaat.org/ # # 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, modi...
40223249-1/0622W17
refs/heads/master
static/Brython3.1.3-20150514-095342/Lib/multiprocessing/dummy/__init__.py
693
# # Support for the API of the multiprocessing package using threads # # multiprocessing/dummy/__init__.py # # Copyright (c) 2006-2008, R Oudkerk # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: ...
eedf/jeito
refs/heads/master
accounting/migrations/0016_transaction_reconciliation.py
1
# -*- coding: utf-8 -*- # Generated by Django 1.11.2 on 2017-07-27 15:35 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('accounting', '0015_bankstatement_number'), ] operations = [ migrations.AddF...
juangj/selenium
refs/heads/master
py/test/selenium/webdriver/chrome/__init__.py
2454
# Licensed to the Software Freedom Conservancy (SFC) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The SFC licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
googleapis/sphinx-docfx-yaml
refs/heads/master
docfx_yaml/writer.py
1
# Copyright 2021 Google LLC # # 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, ...
rebost/django
refs/heads/master
tests/regressiontests/generic_inline_admin/tests.py
8
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals from django.conf import settings from django.contrib import admin from django.contrib.admin.sites import AdminSite from django.contrib.contenttypes.generic import ( generic_inlineformset_factory, GenericTabularInline) from django.form...
rlugojr/rekall
refs/heads/master
rekall-agent/rekall_agent/policies/files.py
1
#!/usr/bin/env python2 # Rekall Memory Forensics # Copyright 2016 Google Inc. All Rights Reserved. # # Author: Michael Cohen scudette@google.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...
FireWRT/OpenWrt-Firefly-Libraries
refs/heads/master
staging_dir/host/lib/python2.7/test/test_unary.py
137
"""Test compiler changes for unary ops (+, -, ~) introduced in Python 2.2""" import unittest from test.test_support import run_unittest, have_unicode class UnaryOpTestCase(unittest.TestCase): def test_negative(self): self.assertTrue(-2 == 0 - 2) self.assertTrue(-0 == 0) self.assertTrue(--...
h3biomed/ansible
refs/heads/h3
lib/ansible/modules/network/fortios/fortios_vpn_ipsec_forticlient.py
21
#!/usr/bin/python from __future__ import (absolute_import, division, print_function) # Copyright 2019 Fortinet, Inc. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the Lic...
alexdzul/myPage
refs/heads/master
myPage/apps/social/tests.py
24123
from django.test import TestCase # Create your tests here.
mdanielwork/intellij-community
refs/heads/master
python/testData/resolve/AttributeAssignedNearby.py
83
def foo(bar): bar.xyzzy = 1 print bar.xyzzy # <ref>
HealthAPI/helmet
refs/heads/develop
node_modules/grunt-sass/node_modules/node-sass/node_modules/pangyp/gyp/pylib/gyp/input_test.py
604
#!/usr/bin/env python # Copyright 2013 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. """Unit tests for the input.py file.""" import gyp.input import unittest import sys class TestFindCycles(unittest.TestCase): def setUp(self...
kamni/nodonuts
refs/heads/master
nodonuts/urls.py
1
from constance import config from django.conf import settings from django.conf.urls import patterns, include, url from django.contrib import admin from django.views.generic import TemplateView from organizations.forms import NoDonutsAuthForm admin.autodiscover() urlpatterns = patterns('', url(r'', include('reci...
ACJTeam/enigma2
refs/heads/master
lib/python/Tools/Notifications.py
12
notifications = [ ] notificationAdded = [ ] # notifications which are currently on screen (and might be closed by similiar notifications) current_notifications = [ ] def __AddNotification(fnc, screen, id, *args, **kwargs): if ".MessageBox'>" in `screen`: kwargs["simple"] = True if ".Standby'>" in `screen`: re...
escattone/kuma
refs/heads/master
kuma/core/migrations/0006_create_l10n_survey_banner_flag.py
1
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations def create_l10n_survey_banner_flag(apps, schema_editor): Flag = apps.get_model("waffle", "Flag") if not Flag.objects.filter(name="l10n_survey").exists(): Flag.objects.create( name="l10n_survey...
Southpaw-TACTIC/TACTIC
refs/heads/4.7
src/tactic/ui/app/diagnostics_wdg.py
1
########################################################### # # Copyright (c) 2005, Southpaw Technology # All Rights Reserved # # PROPRIETARY INFORMATION. This software is proprietary to # Southpaw Technology, and is not to be reproduced, transmitted, # or disclosed in any way without written permi...
cabrer7/PyWignerCUDA
refs/heads/master
GPU_Wigner2D_GPitaevskii.py
1
#!/usr/local/epd/bin/python #----------------------------------------------------------------------------- # Time independent Quantum propagator by FFT Split operator # #----------------------------------------------------------------------------- import numpy as np import matplotlib.pyplot import s...
kenshay/ImageScripter
refs/heads/master
ProgramData/SystemFiles/Python/Lib/site-packages/sphinx/__init__.py
3
# -*- coding: utf-8 -*- """ Sphinx ~~~~~~ The Sphinx documentation toolchain. :copyright: Copyright 2007-2016 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ # Keep this file executable as-is in Python 3! # (Otherwise getting the version out of it from setup.py is imp...
arjunaari/tweater
refs/heads/master
py/yaml/serializer.py
561
__all__ = ['Serializer', 'SerializerError'] from error import YAMLError from events import * from nodes import * class SerializerError(YAMLError): pass class Serializer(object): ANCHOR_TEMPLATE = u'id%03d' def __init__(self, encoding=None, explicit_start=None, explicit_end=None, version=No...
ilyes14/scikit-learn
refs/heads/master
sklearn/gaussian_process/gaussian_process.py
78
# -*- coding: utf-8 -*- # Author: Vincent Dubourg <vincent.dubourg@gmail.com> # (mostly translation, see implementation details) # Licence: BSD 3 clause from __future__ import print_function import numpy as np from scipy import linalg, optimize from ..base import BaseEstimator, RegressorMixin from ..metrics...
mbernasocchi/QGIS
refs/heads/master
tests/src/python/test_qgsserver_wms_getprint_extra.py
29
# -*- coding: utf-8 -*- """QGIS Unit tests for QgsServer WMS GetPrint. From build dir, run: ctest -R PyQgsServerWMSGetPrintExtra -V .. note:: 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 ...
denizdemir/presto
refs/heads/master
presto-docs/src/main/sphinx/conf.py
44
# # 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 ...
kenshay/ImageScripter
refs/heads/master
ProgramData/Android/ADB/platform-tools/systrace/catapult/telemetry/third_party/web-page-replay/third_party/dns/rdtypes/ANY/PTR.py
248
# Copyright (C) 2003-2007, 2009, 2010 Nominum, Inc. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose with or without fee is hereby granted, # provided that the above copyright notice and this permission notice # appear in all copies. # # THE SOFTWARE IS PROVIDED ...
sontek/rethinkdb
refs/heads/next
external/v8_3.30.33.16/tools/push-to-trunk/git_recipes.py
36
#!/usr/bin/env python # Copyright 2014 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 # notice...
DarKnight24/owtf
refs/heads/develop
plugins/web/passive/Testing_for_Captcha@OWTF-AT-008.py
2
""" PASSIVE Plugin for Testing for Captcha (OWASP-AT-008) """ from framework.dependency_management.dependency_resolver import ServiceLocator DESCRIPTION = "Google Hacking for CAPTCHA" def run(PluginInfo): resource = ServiceLocator.get_component("resource").GetResources('PassiveCAPTCHALnk') Content = Servic...
afonsoduarte/gardensquareproject-site
refs/heads/master
templates/node_modules/node-sass/node_modules/pangyp/gyp/pylib/gyp/MSVSToolFile.py
2736
# Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Visual Studio project reader/writer.""" import gyp.common import gyp.easy_xml as easy_xml class Writer(object): """Visual Studio XML tool file writer.""" ...
nishad-jobsglobal/odoo-marriot
refs/heads/master
addons/website_forum/models/res_users.py
281
# -*- coding: utf-8 -*- from datetime import datetime from urllib import urlencode import hashlib from openerp import SUPERUSER_ID from openerp.osv import osv, fields class Users(osv.Model): _inherit = 'res.users' def __init__(self, pool, cr): init_res = super(Users, self).__init__(pool, cr) ...
Uli1/mapnik
refs/heads/master
scons/scons-local-2.4.0/SCons/Tool/386asm.py
1
"""SCons.Tool.386asm Tool specification for the 386ASM assembler for the Phar Lap ETS embedded operating system. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001 - 2015 The SCons Founda...
invisiblek/python-for-android
refs/heads/master
python3-alpha/python3-src/Lib/lib2to3/tests/__init__.py
308
"""Make tests/ into a package. This allows us to "import tests" and have tests.all_tests be a TestSuite representing all test cases from all test_*.py files in tests/.""" # Author: Collin Winter import os import os.path import unittest import types from . import support all_tests = unittest.TestSuite() tests_dir = ...
botswana-harvard/bcpp-interview
refs/heads/develop
bcpp_interview/model_to_dataframe.py
1
import pandas as pd import numpy as np class EdcModelToDataFrame(object): """ e = EdcModelToDataFrame(ClinicVlResult, add_columns_for='clinic_visit') my_df = e.dataframe """ def __init__(self, model=None, queryset=None, query_filter=None, add_columns_for=None): self._columns = [] ...
jhawkesworth/ansible
refs/heads/devel
test/runner/lib/target.py
14
"""Test target identification, iteration and inclusion/exclusion.""" from __future__ import absolute_import, print_function import collections import os import re import errno import itertools import abc import sys from lib.util import ( ApplicationError, display, read_lines_without_comments, ) MODULE_E...
vladikr/nova_drafts
refs/heads/master
nova/tests/api/openstack/compute/plugins/v3/test_lock_server.py
28
# Copyright 2011 OpenStack Foundation # Copyright 2013 IBM Corp. # # 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 ...
KolevDarko/flasky-extended
refs/heads/master
app/auth/views.py
1
from flask import render_template, redirect, request, url_for, flash, session, make_response from flask.ext.login import login_user, logout_user, login_required, \ current_user from . import auth from .. import db, socketio from ..models import User from ..email import send_email from .forms import LoginForm, Regis...
maggienj/ActiveData
refs/heads/es5
mo_json/typed_encoder.py
1
# encoding: utf-8 # # # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this file, # You can obtain one at http://mozilla.org/MPL/2.0/. # # Author: Kyle Lahnakoski (kyle@lahnakoski.com) # from __future__ import absolute_import from __f...
tpodowd/boto
refs/heads/master
boto/configservice/__init__.py
6
# Copyright (c) 2015 Amazon.com, Inc. or its affiliates. # All Rights Reserved # # 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...
ryanpitts/source
refs/heads/master
source/base/urls.py
1
from django.conf import settings from django.conf.urls.defaults import * from django.views.decorators.cache import cache_page from .feeds import ArticleFeed from .views import SourceSearchView, HomepageView from haystack.forms import SearchForm from haystack.query import SearchQuerySet from haystack.views import searc...
melmothx/jsonbot
refs/heads/master
jsb/lib/socklib/irc/ircevent.py
1
# gozerbot/ircevent.py # # # http://www.irchelp.org/irchelp/rfc/rfc2812.txt """ an ircevent is extracted from the IRC string received from the server. """ ## jsb imports from jsb.utils.generic import toenc, fromenc, strippedtxt from jsb.lib.socklib.utils.generic import fix_format, stripident, makeargrest from jsb.li...
insiderr/insiderr-app
refs/heads/master
app/modules/requests/packages/chardet/chardistribution.py
2
# ####################### 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 ...
marco-lancini/Showcase
refs/heads/master
django/contrib/admin/media/js/compress.py
784
#!/usr/bin/env python import os import optparse import subprocess import sys here = os.path.dirname(__file__) def main(): usage = "usage: %prog [file1..fileN]" description = """With no file paths given this script will automatically compress all jQuery-based files of the admin app. Requires the Google Closure...
ancho85/pylint-playero-plugin
refs/heads/master
tests/test_tools.py
1
# -*- coding: utf-8 -*- import unittest from libs.tools import * class TestTools(unittest.TestCase): def test_latinToAscii(self): assert latinToAscii(u"Hönig") == "Honig" assert latinToAscii(u"€") == "" def test_embeddedImport(self): button = embeddedImport("Embedded_ButtonObj") ...
kamarush/android_kernel_lge_hammerhead
refs/heads/nougat-mr1
scripts/rt-tester/rt-tester.py
11005
#!/usr/bin/python # # rt-mutex tester # # (C) 2006 Thomas Gleixner <tglx@linutronix.de> # # 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. # import os import sys import getopt import sh...
TimofeyFox/GT-S7270_kernel
refs/heads/master
scripts/rt-tester/rt-tester.py
11005
#!/usr/bin/python # # rt-mutex tester # # (C) 2006 Thomas Gleixner <tglx@linutronix.de> # # 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. # import os import sys import getopt import sh...
Microsoft/PTVS
refs/heads/master
Python/Product/Miniconda/Miniconda3-x64/Lib/site-packages/win32/lib/mmsystem.py
24
# Generated by h2py from d:/msdev/include/mmsystem.h MAXPNAMELEN = 32 MAXERRORLENGTH = 256 MAX_JOYSTICKOEMVXDNAME = 260 MM_MICROSOFT = 1 MM_MIDI_MAPPER = 1 MM_WAVE_MAPPER = 2 MM_SNDBLST_MIDIOUT = 3 MM_SNDBLST_MIDIIN = 4 MM_SNDBLST_SYNTH = 5 MM_SNDBLST_WAVEOUT = 6 MM_SNDBLST_WAVEIN = 7 MM_ADLIB = 9 MM_MPU401_MIDIOUT = 1...
hudokkow/kodi-cmake
refs/heads/master
lib/libUPnP/Neptune/Extras/Scripts/GenTrustAnchorsTables.py
264
#! /usr/bin/env python ### ### Generate trust anchor tables from a text file ### like, for example, TLS-Trust-Anchors-base.crt ## and TLS-Trust-Anchors-extended.crt located under Extras/Data ### ### imports import sys import base64 ### generate a C file with bult-in TLS trust anchors FILE_HEADER = """/**************...
mindnervestech/mnrp
refs/heads/master
addons/website_forum_doc/models/__init__.py
432
# -*- coding: utf-8 -*- import documentation
misttechnologies/selenium
refs/heads/master
py/test/selenium/webdriver/firefox/ff_select_support_class_tests.py
29
#!/usr/bin/python # # Copyright 2011 Software Freedom Conservancy. # # 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 ap...
edx-solutions/edx-platform
refs/heads/master
common/djangoapps/student/middleware.py
4
""" Middleware that checks user standing for the purpose of keeping users with disabled accounts from accessing the site. """ from django.conf import settings from django.http import HttpResponseForbidden from django.utils.deprecation import MiddlewareMixin from django.utils.translation import ugettext as _ from ope...
Leila20/django
refs/heads/master
tests/select_related/__init__.py
12133432
ngageoint/scale
refs/heads/master
scale/storage/brokers/__init__.py
12133432
RDXT/django-userena
refs/heads/master
userena/contrib/umessages/templatetags/__init__.py
12133432
sfrenza/test-for-bot
refs/heads/master
venv/Lib/site-packages/pip/_vendor/packaging/markers.py
324
# This file is dual licensed under the terms of the Apache License, Version # 2.0, and the BSD License. See the LICENSE file in the root of this repository # for complete details. from __future__ import absolute_import, division, print_function import operator import os import platform import sys from pip._vendor.pyp...
savkov/randhy
refs/heads/master
setup.py
1
from setuptools import setup version = open('VERSION').read() long_description = open('README.md').read() __author__ = 'Sasho Savkov' __credits__ = ["William Morgan"] __license__ = "MIT" __version__ = version __email__ = "me@sasho.io" __status__ = "Production" setup( name='randhy', version=version, desc...
sharhar/USB-Thing
refs/heads/master
UpdaterFiles/Lib/python-3.5.1.amd64/Lib/unittest/test/test_case.py
8
import contextlib import difflib import pprint import pickle import re import sys import logging import warnings import weakref import inspect from copy import deepcopy from test import support import unittest from unittest.test.support import ( TestEquality, TestHashing, LoggingResult, LegacyLoggingResult, ...
firstopinion/prom
refs/heads/master
prom/interface/__init__.py
1
# -*- coding: utf-8 -*- from __future__ import unicode_literals, division, print_function, absolute_import import dsnparse from ..config import DsnConnection interfaces = {} """holds all the configured interfaces""" def configure_environ(dsn_env_name='PROM_DSN', connection_class=DsnConnection): """ config...
joachimmetz/l2tdevtools
refs/heads/main
tests/update.py
2
#!/usr/bin/env python # -*- coding: utf-8 -*- """Tests for the update tool.""" import sys import unittest from tools import update from tests import test_lib class GithubRepoDownloadHelperTest(test_lib.BaseTestCase): """Tests for the GitHub repo download helper class.""" # pylint: disable=protected-access ...
sivaprakashniet/push_pull
refs/heads/master
p2p/lib/python2.7/site-packages/django/middleware/gzip.py
478
import re from django.utils.cache import patch_vary_headers from django.utils.text import compress_sequence, compress_string re_accepts_gzip = re.compile(r'\bgzip\b') class GZipMiddleware(object): """ This middleware compresses content if the browser allows gzip compression. It sets the Vary header acco...
xavierwu/scikit-learn
refs/heads/master
sklearn/gaussian_process/correlation_models.py
230
# -*- coding: utf-8 -*- # Author: Vincent Dubourg <vincent.dubourg@gmail.com> # (mostly translation, see implementation details) # Licence: BSD 3 clause """ The built-in correlation models submodule for the gaussian_process module. """ import numpy as np def absolute_exponential(theta, d): """ Abs...
entoo/portage-src
refs/heads/master
pym/portage/util/_async/FileDigester.py
12
# Copyright 2013 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 from portage import os from portage.checksum import perform_multiple_checksums from portage.util._async.ForkProcess import ForkProcess from _emerge.PipeReader import PipeReader class FileDigester(ForkProcess): """ ...
shaunbrady/boto
refs/heads/develop
boto/beanstalk/wrapper.py
153
"""Wraps layer1 api methods and converts layer1 dict responses to objects.""" from boto.beanstalk.layer1 import Layer1 import boto.beanstalk.response from boto.exception import BotoServerError import boto.beanstalk.exception as exception def beanstalk_wrapper(func, name): def _wrapped_low_level_api(*args, **kwarg...
nugget/home-assistant
refs/heads/dev
homeassistant/components/harmony/__init__.py
17
"""Support for Harmony devices."""
sutartmelson/girder
refs/heads/master
plugins/google_analytics/plugin_tests/__init__.py
12133432
lihui7115/ChromiumGStreamerBackend
refs/heads/master
tools/telemetry/telemetry/internal/testing/__init__.py
12133432
vankrajnova/test_python
refs/heads/master
model/__init__.py
12133432
Alwnikrotikz/l5rcm
refs/heads/master
widgets/cknumwidget.py
3
# Copyright (C) 2011 Daniele Simonetti # # 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 dist...
virtualopensystems/nova
refs/heads/bp/vif-vhostuser
nova/compute/monitors/virt/cpu_monitor.py
13
# Copyright 2013 Intel 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 requir...
vmayoral/basic_reinforcement_learning
refs/heads/master
tutorial2/cliff_S.py
1
import cellular import sarsa import time import sys startCell = None class Cell(cellular.Cell): def __init__(self): self.cliff = False self.goal = False self.wall = False def colour(self): if self.cliff: return 'red' if self.goal: ...
tomkins/django-pipeline
refs/heads/master
tests/tests/test_glob.py
40
from __future__ import unicode_literals import os import shutil from django.core.files.base import ContentFile from django.core.files.storage import FileSystemStorage from django.test import TestCase from pipeline import glob local_path = lambda path: os.path.join(os.path.dirname(__file__), path) class GlobTest(T...
sublime1809/django
refs/heads/master
django/middleware/clickjacking.py
185
""" Clickjacking Protection Middleware. This module provides a middleware that implements protection against a malicious site loading resources from your site in a hidden frame. """ from django.conf import settings class XFrameOptionsMiddleware(object): """ Middleware that sets the X-Frame-Options HTTP head...
newerthcom/savagerebirth
refs/heads/master
libs/python-2.72/Lib/sre_parse.py
156
# # Secret Labs' Regular Expression Engine # # convert re-style regular expression to sre pattern # # Copyright (c) 1998-2001 by Secret Labs AB. All rights reserved. # # See the sre.py file for information on usage and redistribution. # """Internal support module for sre""" # XXX: show string offset and offending ch...
fgouget/spice-common
refs/heads/master
python_modules/__init__.py
12133432
cweems/api-timeline-js
refs/heads/master
website/core/settings/__init__.py
12133432
fredhusser/scikit-learn
refs/heads/master
sklearn/preprocessing/tests/__init__.py
12133432
jss-emr/openerp-7-src
refs/heads/master
openerp/addons/base/ir/ir_default.py
73
# -*- 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...
arthur-wsw/pinax-messages
refs/heads/master
pinax/messages/models.py
1
from __future__ import unicode_literals from django.conf import settings from django.core.urlresolvers import reverse from django.db import models from django.utils import timezone from django.utils.encoding import python_2_unicode_compatible from .signals import message_sent from .utils import cached_attribute @py...
HiSPARC/station-software
refs/heads/master
user/python/Lib/site-packages/pip/_internal/cli/base_command.py
7
"""Base Command class, and related routines""" from __future__ import absolute_import import logging import logging.config import optparse import os import sys from pip._internal.cli import cmdoptions from pip._internal.cli.parser import ( ConfigOptionParser, UpdatingDefaultsHelpFormatter, ) from pip._internal.cl...
rczajka/infoscreen
refs/heads/master
infoscreen/settings.d/50-static.py
1
MEDIA_ROOT = path.join(PROJECT_DIR, 'media/') MEDIA_URL = '/media/' STATIC_ROOT = path.join(PROJECT_DIR, 'static/') STATIC_URL = '/static/' STATICFILES_FINDERS = ( 'django.contrib.staticfiles.finders.FileSystemFinder', 'django.contrib.staticfiles.finders.AppDirectoriesFinder', # 'django.contrib.staticfiles....
stephendade/ardupilot
refs/heads/master
Tools/scripts/check_firmware_version.py
27
#!/usr/bin/env python ''' check firmware-version.txt in binaries directory ''' import os VEHICLES = ['AntennaTracker', 'Copter', 'Plane', 'Rover', 'Sub'] def parse_git_version(gfile): '''parse git-version.txt, producing a firmware-version.txt''' gv = open(gfile).readlines() vline = gv[-1] if not vlin...
korsimoro/indy-sdk
refs/heads/init-node-wrapper
wrappers/python/tests/conftest.py
1
import asyncio import json import logging from os import environ, makedirs from os.path import dirname from pathlib import Path from shutil import rmtree from tempfile import gettempdir import pytest from indy import wallet, pool, signus, ledger logging.basicConfig(level=logging.DEBUG) @pytest.fixture(scope="sessi...
mrbox/django
refs/heads/master
django/utils/ipv6.py
208
# This code was mostly based on ipaddr-py # Copyright 2007 Google Inc. https://github.com/google/ipaddr-py # Licensed under the Apache License, Version 2.0 (the "License"). from django.core.exceptions import ValidationError from django.utils.six.moves import range from django.utils.translation import ugettext_lazy as _...
ArneBab/pypyjs
refs/heads/master
website/demo/home/rfk/repos/pypy/lib-python/2.7/binhex.py
216
"""Macintosh binhex compression/decompression. easy interface: binhex(inputfilename, outputfilename) hexbin(inputfilename, outputfilename) """ # # Jack Jansen, CWI, August 1995. # # The module is supposed to be as compatible as possible. Especially the # easy interface should work "as expected" on any platform. # XXX...
zhukaixy/kbengine
refs/heads/master
kbe/src/lib/python/Lib/poplib.py
74
"""A POP3 client class. Based on the J. Myers POP3 draft, Jan. 96 """ # Author: David Ascher <david_ascher@brown.edu> # [heavily stealing from nntplib.py] # Updated: Piers Lauder <piers@cs.su.oz.au> [Jul '97] # String method conversion and test jig improvements by ESR, February 2001. # Added the POP3_SSL clas...
dongguangming/pexpect
refs/heads/master
examples/script.py
22
#!/usr/bin/env python '''This spawns a sub-shell (bash) and gives the user interactive control. The entire shell session is logged to a file called script.log. This behaves much like the classic BSD command 'script'. ./script.py [-a] [-c command] {logfilename} logfilename : This is the name of the log file. Defa...