repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
ansible/ansible | refs/heads/devel | lib/ansible/plugins/netconf/__init__.py | 15 | #
# (c) 2017 Red Hat Inc.
#
# 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 d... |
peterlauri/django | refs/heads/master | tests/timezones/admin.py | 146 | from django.contrib import admin
from .models import Event, Timestamp
class EventAdmin(admin.ModelAdmin):
list_display = ('dt',)
class TimestampAdmin(admin.ModelAdmin):
readonly_fields = ('created', 'updated')
site = admin.AdminSite(name='admin_tz')
site.register(Event, EventAdmin)
site.register(Timestam... |
gangadharkadam/office_erp | refs/heads/develop | erpnext/setup/page/setup_wizard/install_fixtures.py | 35 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
def install(country=None):
records = [
# address template
{'doctype':"Address Template", "country": count... |
samsu/neutron | refs/heads/master | tests/unit/services/metering/test_metering_plugin.py | 6 | # Copyright (C) 2013 eNovance SAS <licensing@enovance.com>
#
# 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 applicabl... |
stonegithubs/odoo | refs/heads/8.0 | addons/account_check_writing/wizard/account_check_batch_printing.py | 339 | # -*- 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... |
salguarnieri/intellij-community | refs/heads/master | python/testData/formatter/spaceWithinDeclarationParentheses.py | 54 | def foo(x, y):
pass
|
denys-duchier/Scolar | refs/heads/master | sco_page_etud.py | 1 | # -*- mode: python -*-
# -*- coding: iso8859-15 -*-
##############################################################################
#
# Gestion scolarite IUT
#
# Copyright (c) 2001 - 2013 Emmanuel Viennet. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the term... |
BigDataforYou/movie_recommendation_workshop_1 | refs/heads/master | big_data_4_you_demo_1/venv/lib/python2.7/site-packages/flask/__init__.py | 42 | # -*- coding: utf-8 -*-
"""
flask
~~~~~
A microframework based on Werkzeug. It's extensively documented
and follows best practice patterns.
:copyright: (c) 2015 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
__version__ = '0.11.1'
# utilities we import from Werkzeug and... |
neilpelow/wmap-django | refs/heads/master | venv/lib/python3.5/site-packages/django_extensions/management/mysql.py | 8 | # -*- coding: utf-8 -*-
from six.moves import configparser
def parse_mysql_cnf(dbinfo):
"""
Attempt to parse mysql database config file for connection settings.
Ideally we would hook into django's code to do this, but read_default_file is handled by the mysql C libs
so we have to emulate the behaviour... |
spryle/james.spry-leverton.com | refs/heads/master | setup.py | 1 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import os
import re
from collections import namedtuple
from pip.req import parse_requirements
from setuptools import setup, find_packages
options = requirements = list(parse_requirements(
os.path.join(os.path.dirname(__file__), 'requirements.txt'),
... |
clessg/linux | refs/heads/master | scripts/gdb/linux/lists.py | 630 | #
# gdb helper commands and functions for Linux kernel debugging
#
# list tools
#
# Copyright (c) Thiebaud Weksteen, 2015
#
# Authors:
# Thiebaud Weksteen <thiebaud@weksteen.fr>
#
# This work is licensed under the terms of the GNU GPL version 2.
#
import gdb
from linux import utils
list_head = utils.CachedType("st... |
marc-sensenich/ansible | refs/heads/devel | lib/ansible/modules/network/fortios/fortios_config.py | 9 | #!/usr/bin/python
#
# Ansible module to manage configuration on fortios devices
# (c) 2016, Benjamin Jolivot <bjolivot@gmail.com>
# 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_... |
kmonsoor/python-for-android | refs/heads/master | python-modules/twisted/twisted/test/test_stringtransport.py | 56 | # Copyright (c) 2009-2010 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted.test.proto_helpers}.
"""
from zope.interface.verify import verifyObject
from twisted.internet.interfaces import (ITransport, IPushProducer, IConsumer,
IReactorTCP, IReactorSSL, IReactorUNIX, IAddress, IListe... |
allenp/odoo | refs/heads/9.0 | openerp/addons/base/res/__init__.py | 44 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import res_country
import res_lang
import res_partner
import res_bank
import res_config
import res_currency
import res_font
import res_company
import res_users
import res_request
import res_lang
import ir_property
|
pawaranand/phrerp | refs/heads/develop | erpnext/accounts/doctype/pricing_rule/pricing_rule.py | 31 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
import json
import copy
from frappe import throw, _
from frappe.utils import flt, cint
from frappe.model.docume... |
BoltzmannBrain/nupic | refs/heads/master | tests/swarming/nupic/swarming/__init__.py | 175 | #! /usr/bin/env python
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions... |
sacnayak/ssnayak-viz | refs/heads/master | lib/jinja2/exceptions.py | 977 | # -*- coding: utf-8 -*-
"""
jinja2.exceptions
~~~~~~~~~~~~~~~~~
Jinja exceptions.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
from jinja2._compat import imap, text_type, PY2, implements_to_string
class TemplateError(Exception):
"""Baseclass for al... |
SujaySKumar/django | refs/heads/master | tests/messages_tests/test_fallback.py | 330 | from django.contrib.messages import constants
from django.contrib.messages.storage.fallback import (
CookieStorage, FallbackStorage,
)
from django.test import SimpleTestCase
from .base import BaseTests
from .test_cookie import set_cookie_data, stored_cookie_messages_count
from .test_session import set_session_data... |
pizzapanther/HoverMom | refs/heads/master | hovermom/django/contrib/redirects/middleware.py | 215 | from __future__ import unicode_literals
from django.conf import settings
from django.contrib.redirects.models import Redirect
from django.contrib.sites.models import get_current_site
from django.core.exceptions import ImproperlyConfigured
from django import http
class RedirectFallbackMiddleware(object):
def __in... |
Vixionar/django | refs/heads/master | tests/migrations/test_migrations_no_ancestor/0001_initial.py | 2995 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
operations = [
migrations.CreateModel(
"Author",
[
("id", models.AutoField(primary_key=True)),
("name",... |
cea-sec/miasm | refs/heads/master | miasm/arch/x86/jit.py | 2 | from builtins import range
import logging
from miasm.jitter.jitload import Jitter, named_arguments
from miasm.arch.x86.sem import Lifter_X86_16, Lifter_X86_32, Lifter_X86_64
from miasm.jitter.codegen import CGen
from miasm.ir.translators.C import TranslatorC
log = logging.getLogger('jit_x86')
hnd = logging.StreamHand... |
Zhongqilong/kbengine | refs/heads/master | kbe/src/lib/python/Lib/encodings/cp424.py | 272 | """ Python Character Mapping Codec cp424 generated from 'MAPPINGS/VENDORS/MISC/CP424.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,input,errors='... |
LethusTI/supportcenter | refs/heads/master | vendor/django/django/contrib/admindocs/models.py | 634 | # Empty models.py to allow for specifying admindocs as a test label.
|
seanli9jan/tensorflow | refs/heads/master | tensorflow/python/lib/io/file_io_test.py | 13 | # This Python file uses the following encoding: utf-8
# 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.o... |
EliasTouil/simpleBlog | refs/heads/master | simpleBlog/Lib/site-packages/dateutil/tz/win.py | 48 | # This code was originally contributed by Jeffrey Harris.
import datetime
import struct
from six.moves import winreg
from six import text_type
try:
import ctypes
from ctypes import wintypes
except ValueError:
# ValueError is raised on non-Windows systems for some horrible reason.
raise ImportError("Ru... |
m-wichmann/miscStuff | refs/heads/master | BV_1/opencv.py | 1 | #!/usr/bin/python2.7
# -*- coding: utf-8 -*-
"""this script does an analysis of the video and outputs the direction of the street"""
# Notes:
# cv.ShowImage( "My Video Window", frame)
# cv.WaitKey(50)
#
# pixel access:
# frame[row,column]
#
# cv.SaveImage("bilder/bild" + str(f).zfill(4) + ".png", frame... |
structRecomputation/computations | refs/heads/master | _modules/auxiliary_shared.py | 1 | from string import Formatter
import pandas as pd
import numpy as np
import subprocess
import argparse
import shutil
import socket
import errno
import shlex
import copy
import os
from clsMail import MailCls
from respy.python.simulate.simulate_auxiliary import write_out
import respy
PROJECT_DIR = os.path.dirname(os.p... |
dd00/commandergenius | refs/heads/dd00 | project/jni/python/src/Lib/plat-mac/applesingle.py | 31 | r"""Routines to decode AppleSingle files
"""
from warnings import warnpy3k
warnpy3k("In 3.x, the applesingle module is removed.", stacklevel=2)
import struct
import sys
try:
import MacOS
import Carbon.File
except:
class MacOS:
def openrf(path, mode):
return open(path + '.rsrc', mode)
... |
cainiaocome/ssbc | refs/heads/master | search/admin.py | 26 | from django.contrib import admin
from search.models import Hash, FileList, StatusReport, RecKeywords
# Register your models here.
admin.site.register(Hash)
admin.site.register(FileList)
admin.site.register(StatusReport)
admin.site.register(RecKeywords)
|
public-ink/public-ink | refs/heads/master | server/appengine/lib/numpy/polynomial/_polybase.py | 13 | """
Abstract base class for the various polynomial Classes.
The ABCPolyBase class provides the methods needed to implement the common API
for the various polynomial classes. It operates as a mixin, but uses the
abc module from the stdlib, hence it is only available for Python >= 2.6.
"""
from __future__ import divisi... |
person142/scipy | refs/heads/master | scipy/special/tests/test_spfun_stats.py | 9 | import numpy as np
from numpy.testing import (assert_array_equal,
assert_array_almost_equal_nulp, assert_almost_equal)
from pytest import raises as assert_raises
from scipy.special import gammaln, multigammaln
class TestMultiGammaLn(object):
def test1(self):
# A test of the identity
# ... |
zhangpanrobot/myblog | refs/heads/master | node_modules/testem/node_modules/tap/node_modules/yamlish/yamlish-py/test/__init__.py | 161 | # -*- coding: utf-8 -*- IGNORE:C0111
from __future__ import absolute_import, print_function, unicode_literals
import logging
import yamlish
import yaml
import tempfile
import textwrap
INPUT = 1
OUTPUT = 2
if yamlish.py3k:
unicode = str
#logging.basicConfig(level=logging.DEBUG)
def _generate_test_name(source):... |
louyihua/edx-platform | refs/heads/master | lms/djangoapps/email_marketing/tasks.py | 7 | """
This file contains celery tasks for email marketing signal handler.
"""
import logging
import time
from celery import task
from django.core.cache import cache
from email_marketing.models import EmailMarketingConfiguration
from student.models import EnrollStatusChange
from sailthru.sailthru_client import Sailthru... |
bertucho/epic-movie-quotes-quiz | refs/heads/master | dialogos/build/Twisted/twisted/protocols/ident.py | 51 | # -*- test-case-name: twisted.test.test_ident -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Ident protocol implementation.
"""
import struct
from twisted.internet import defer
from twisted.protocols import basic
from twisted.python import log, failure
_MIN_PORT = 1
_MAX_PORT = 2 **... |
dtebbs/turbulenz_engine | refs/heads/master | scripts/utils.py | 7 | import platform
import sys
import os
import os.path
import re
import errno
import stat
from subprocess import Popen, PIPE, STDOUT
from shutil import rmtree, copy, Error as ShError
#######################################################################################################################
SYSNAME = platform... |
MarcJoan/django | refs/heads/master | tests/expressions/tests.py | 43 | from __future__ import unicode_literals
import datetime
import uuid
from copy import deepcopy
from django.core.exceptions import FieldError
from django.db import DatabaseError, connection, models, transaction
from django.db.models import TimeField, UUIDField
from django.db.models.aggregates import (
Avg, Count, M... |
bac/horizon | refs/heads/master | openstack_dashboard/dashboards/identity/identity_providers/protocols/tables.py | 8 | # Copyright (C) 2015 Yahoo! 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... |
shubhamdhama/zulip | refs/heads/master | zerver/migrations/0099_index_wildcard_mentioned_user_messages.py | 7 | from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('zerver', '0098_index_has_alert_word_user_messages'),
]
operations = [
migrations.RunSQL(
'''
CREATE INDEX IF NOT EXISTS zerver_usermessage_wildcard_mentioned_message_id
... |
rooi/CouchPotatoServer | refs/heads/master | libs/sqlalchemy/dialects/sqlite/pysqlite.py | 18 | # sqlite/pysqlite.py
# Copyright (C) 2005-2013 the SQLAlchemy authors and contributors <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""Support for the SQLite database via pysqlite.
Note that pysqlite is the same dr... |
jorik041/scikit-learn | refs/heads/master | sklearn/tests/test_grid_search.py | 68 | """
Testing for grid search module (sklearn.grid_search)
"""
from collections import Iterable, Sized
from sklearn.externals.six.moves import cStringIO as StringIO
from sklearn.externals.six.moves import xrange
from itertools import chain, product
import pickle
import sys
import numpy as np
import scipy.sparse as sp
... |
Luindil/Glassure | refs/heads/develop | glassure/gui/widgets/control/soller.py | 1 | # -*- coding: utf-8 -*-
from ...qt import QtGui, QtWidgets, Signal
from ..custom import HorizontalLine, ValueLabelTxtPair
class SollerWidget(QtWidgets.QWidget):
soller_parameters_changed = Signal()
def __init__(self, *args):
super(SollerWidget, self).__init__(*args)
self.create_layout_and_... |
ict-felix/stack | refs/heads/master | modules/resource/utilities/rspecs/tnrm/request_formatter.py | 2 | from rspecs.commons import DEFAULT_XMLNS, DEFAULT_XS, DEFAULT_SCHEMA_LOCATION,\
DSL_PREFIX
from rspecs.commons_tn import DEFAULT_SHARED_VLAN, generate_unique_link_id
from rspecs.formatter_base import FormatterBase
from lxml import etree
DEFAULT_REQ_SCHEMA_LOCATION = DEFAULT_SCHEMA_LOCATION
DEFAULT_REQ_SCHEMA_LOCAT... |
r0e/servo | refs/heads/master | python/mach/mach/decorators.py | 96 | # 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/.
from __future__ import absolute_import, unicode_literals
import argparse
import collections
import inspect
import types... |
UOMx/edx-platform | refs/heads/master | cms/djangoapps/contentstore/tests/test_export_git.py | 189 | """
Test the ability to export courses to xml from studio
"""
import copy
import os
import shutil
import subprocess
from uuid import uuid4
from django.conf import settings
from django.test.utils import override_settings
from .utils import CourseTestCase
import contentstore.git_export_utils as git_export_utils
from x... |
indashnet/InDashNet.Open.UN2000 | refs/heads/master | android/external/clang/tools/clang-format/clang-format-sublime.py | 1 | # This file is a minimal clang-format sublime-integration. To install:
# - Change 'binary' if clang-format is not on the path (see below).
# - Put this file into your sublime Packages directory, e.g. on Linux:
# ~/.config/sublime-text-2/Packages/User/clang-format-sublime.py
# - Add a key binding:
# { "keys": ["... |
kingvuplus/italysat-enigma2 | refs/heads/master | lib/python/Plugins/Extensions/SocketMMI/SocketMMI.py | 150 | from Screens.Ci import MMIDialog
import socketmmi
class SocketMMIMessageHandler:
def __init__(self):
self.session = None
self.dlgs = { }
socketmmi.getSocketStateChangedCallbackList().append(self.socketStateChanged)
def setSession(self, session):
self.session = session
def connected(self):
return socketm... |
robodasha/research_papers | refs/heads/master | setup.py | 1 | """A setuptools based setup module.
"""
from setuptools import setup
__author__ = 'robodasha'
__email__ = 'damirah@live.com'
with open('README.md') as fp:
description = fp.read()
setup(
name='research_papers',
version='0.1.2',
description='Numerous tools for working with research papers',
long... |
TomAugspurger/pandas | refs/heads/master | pandas/tests/series/methods/test_rename_axis.py | 4 | import pytest
from pandas import Index, MultiIndex, Series
import pandas._testing as tm
class TestSeriesRenameAxis:
def test_rename_axis_mapper(self):
# GH 19978
mi = MultiIndex.from_product([["a", "b", "c"], [1, 2]], names=["ll", "nn"])
ser = Series(list(range(len(mi))), index=mi)
... |
okolisny/integration_tests | refs/heads/master | cfme/tests/infrastructure/test_advanced_search_providers.py | 1 | # -*- coding: utf-8 -*-
"""This testing module tests the behaviour of the search box in the Provider section
It does not check for filtering results so far."""
import fauxfactory
import pytest
from selenium.common.exceptions import NoSuchElementException
from cfme.infrastructure.provider import InfraProvider
from fix... |
melgor/melgor.github.io | refs/heads/master | node_modules/pygmentize-bundled/vendor/pygments/pygments/util.py | 269 | # -*- coding: utf-8 -*-
"""
pygments.util
~~~~~~~~~~~~~
Utility functions.
:copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
import sys
import codecs
split_path_re = re.compile(r'[/\\ ]')
doctype_lookup_re = re.compile(r'''(... |
fluxer/spm | refs/heads/master | nuitka/nuitka/PythonVersions.py | 1 | # Copyright 2016, Kay Hayen, mailto:kay.hayen@gmail.com
#
# Part of "Nuitka", an optimizing Python compiler that is compatible and
# integrates with CPython, but also works on its own.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in complianc... |
hustodemon/spacewalk | refs/heads/master | java/scripts/api/configchannel.py | 12 | #!/usr/bin/python
import xmlrpclib
import unittest
from random import randint
from config import *
class ConfigChannel(RhnTestCase):
def setUp(self):
RhnTestCase.setUp(self)
def tearDown(self):
RhnTestCase.tearDown(self)
def test_schedule_file_comparisons(self):
random_int = ... |
rwakulszowa/poradnia | refs/heads/master | poradnia/contrib/sites/migrations/0004_auto_20160409_2334.py | 3 | # Generated by Django 1.9.4 on 2016-04-09 21:34
import django.contrib.sites.models
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("sites", "0003_auto_20151217_2355")]
operations = [
migrations.AlterField(
model_name="site",
nam... |
karlalopez/Authentise-Store | refs/heads/master | app.py | 2 | from flask import Flask
from flask.ext.sqlalchemy import SQLAlchemy
from werkzeug import secure_filename
from flask.ext.login import LoginManager
import os
from itsdangerous import URLSafeTimedSerializer
# Enter here your shop name and tagline
shop_name = "Shop name"
shop_tagline = "Best shop tagline ever"
APP_ROOT ... |
ctu-geoforall-lab/qgis-pu-plugin | refs/heads/master | __init__.py | 1 | # -*- coding: utf-8 -*-
"""
/***************************************************************************
puPlugin
A QGIS plugin
Plugin pro pozemkové úpravy
-------------------
begin : 2016-09-01
copyright : (C) 201... |
imsparsh/python-for-android | refs/heads/master | python-modules/pybluez/examples/advanced/inquiry-with-rssi.py | 47 | # performs a simple device inquiry, followed by a remote name request of each
# discovered device
import os
import sys
import struct
import bluetooth._bluetooth as bluez
def printpacket(pkt):
for c in pkt:
sys.stdout.write("%02x " % struct.unpack("B",c)[0])
print
def read_inquiry_mode(sock):
""... |
jcfr/mystic | refs/heads/master | examples_UQ/TEST3b.py | 1 | #!/usr/bin/env python
#
# Author: Mike McKerns (mmckerns @caltech and @uqfoundation)
# Copyright (c) 2009-2015 California Institute of Technology.
# License: 3-clause BSD. The full license text is available at:
# - http://trac.mystic.cacr.caltech.edu/project/mystic/browser/mystic/LICENSE
############################... |
jpakkane/meson | refs/heads/master | test cases/windows/8 find program/test-script-ext.py | 14 | #!/usr/bin/env python3
print('ext/noext')
|
rdeheele/odoo | refs/heads/master | addons/web/controllers/__init__.py | 1214 | from . import main
|
OCA/reporting-engine | refs/heads/12.0 | report_context/__manifest__.py | 1 | # Copyright 2019 Creu Blanca
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
'name': 'Report Context',
'summary': """
Adding context to reports""",
'version': '12.0.1.0.0',
'license': 'AGPL-3',
'author': 'Creu Blanca,Odoo Community Association (OCA)',
'website': 'https... |
nikste/tensorflow | refs/heads/master | tensorflow/contrib/rnn/python/ops/core_rnn_cell.py | 44 | # 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... |
tjandy/work | refs/heads/master | robot/socket/google/protobuf/internal/more_extensions_pb2.py | 4 | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/protobuf/internal/more_extensions.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.pro... |
csmengwan/autorest | refs/heads/master | AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyNumber/autorestnumbertestservice/models/error.py | 104 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... |
mvaled/sentry | refs/heads/master | src/sentry/mediators/sentry_app_installation_tokens/destroyer.py | 3 | from __future__ import absolute_import
from sentry.utils.cache import memoize
from sentry.mediators import Mediator, Param
from sentry.models import AuditLogEntryEvent, SentryAppInstallationToken
class Destroyer(Mediator):
api_token = Param("sentry.models.ApiToken")
generate_audit = Param(bool, default=False... |
FireWRT/OpenWrt-Firefly-Libraries | refs/heads/master | staging_dir/target-mipsel_1004kc+dsp_uClibc-0.9.33.2/usr/lib/python3.4/asyncio/constants.py | 127 | """Constants."""
# After the connection is lost, log warnings after this many write()s.
LOG_THRESHOLD_FOR_CONNLOST_WRITES = 5
# Seconds to wait before retrying accept().
ACCEPT_RETRY_DELAY = 1
|
amoennin/elastalert | refs/heads/master | elastalert/kibana.py | 13 | # -*- coding: utf-8 -*-
import urllib
from util import EAException
dashboard_temp = {'editable': True,
u'failover': False,
u'index': {u'default': u'NO_TIME_FILTER_OR_INDEX_PATTERN_NOT_MATCHED',
u'interval': u'none',
u'patte... |
ctrlaltdel/neutrinator | refs/heads/master | vendor/openstack/tests/unit/database/v1/test_instance.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 t... |
Azure/azure-sdk-for-python | refs/heads/sync-eng/common-js-nightly-docs-2-1768-ForTestPipeline | sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2017_06_01_preview/aio/_policy_client.py | 1 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... |
axelmagn/metrics | refs/heads/master | ai-metrics/aimetrics/metrics.py | 1 | import json
import numpy as np
from sklearn.cross_validation import (StratifiedShuffleSplit, StratifiedKFold,
KFold)
from sklearn.preprocessing import binarize, normalize
from sklearn.metrics import (accuracy_score, roc_curve, roc_auc_score,
f1_score, classification_report)
from tor... |
guptaadhip/fast | refs/heads/master | tests/unit/lib/mock_socket_test.py | 45 | #!/usr/bin/env python
#
# Copyright 2011-2012 Andreas Wundsam
#
# 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 applic... |
ridfrustum/lettuce | refs/heads/master | tests/integration/lib/Django-1.3/django/template/loaders/filesystem.py | 229 | """
Wrapper for loading templates from the filesystem.
"""
from django.conf import settings
from django.template.base import TemplateDoesNotExist
from django.template.loader import BaseLoader
from django.utils._os import safe_join
class Loader(BaseLoader):
is_usable = True
def get_template_sources(self, temp... |
ppanczyk/ansible | refs/heads/devel | lib/ansible/module_utils/netcfg.py | 42 | # This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by Ansible
# still belong to the author of the module, and may assign their own license
# to the complete wo... |
stuartsale/iso_lib | refs/heads/master | isolib/__init__.py | 1 | import math
import numpy as np
import scipy.interpolate as si
from iso_grid import iso_grid
from iso_grid_tg import iso_grid_tefflogg
from padova_isomake import iso_interp, padova_interpolated_isomake
|
OpenDataNode/odn-ckancommons | refs/heads/master | odn_ckancommons/ckan_helper.py | 1 | '''
@author: jmc, mvi
'''
import json
import urllib2
import urllib
import requests
import ssl
import sys
def is_python_in_2_7_9():
return sys.version[:5] >= "2.7.9"
if is_python_in_2_7_9():
ssl_ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
ssl_ctx.verify_mode = ssl.CERT_REQUIRED
CERTS="/etc/ssl/certs/... |
Wesalius/EloBot | refs/heads/master | pywikibot/tools/chars.py | 2 | # -*- coding: utf-8 -*-
"""Character based helper functions(not wiki-dependent)."""
#
# (C) Pywikibot team, 2015
#
# Distributed under the terms of the MIT license.
#
from __future__ import absolute_import, unicode_literals
import sys
from pywikibot.tools import LazyRegex
if sys.version_info[0] > 2:
unicode = s... |
pointhi/kicad-footprint-generator | refs/heads/master | scripts/Connector/Connector_Hirose/conn_hirose_df12e_dp_smd_top.py | 1 | #!/usr/bin/env python3
'''
kicad-footprint-generator 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.
kicad-footprint-generator is distribut... |
MalloyPower/parsing-python | refs/heads/master | front-end/testsuite-python-lib/Python-3.5.0/Lib/test/test_contains.py | 8 | from collections import deque
import unittest
class base_set:
def __init__(self, el):
self.el = el
class myset(base_set):
def __contains__(self, el):
return self.el == el
class seq(base_set):
def __getitem__(self, n):
return [self.el][n]
class TestContains(unittest.TestCase):
... |
harveyxia/luigi | refs/heads/master | test/worker_parallel_scheduling_test.py | 7 | # -*- coding: utf-8 -*-
#
# Copyright 2012-2015 Spotify AB
#
# 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... |
111pontes/ydk-py | refs/heads/master | cisco-ios-xr/ydk/models/__init__.py | 179 | import pkg_resources
pkg_resources.declare_namespace(__name__)
|
zhoffice/minos | refs/heads/master | supervisor/supervisor/tests/test_process.py | 5 | import os
import signal
import time
import unittest
import sys
import errno
from mock import Mock, patch, sentinel
from supervisor.tests.base import DummyOptions
from supervisor.tests.base import DummyPConfig
from supervisor.tests.base import DummyProcess
from supervisor.tests.base import DummyPGroupConfig
from superv... |
pmoravec/sos | refs/heads/master | tests/report_tests/plugin_tests/networking.py | 2 | # This file is part of the sos project: https://github.com/sosreport/sos
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# version 2 of the GNU General Public License.
#
# See the LICENSE file in the source distribution ... |
cjcjameson/gpdb | refs/heads/master | src/test/tinc/tincrepo/mpp/gpdb/tests/package/oid_inconsistency/test_oid_inconsistency.py | 9 | """
Copyright (c) 2004-Present Pivotal Software, Inc.
This program and the accompanying materials are made available under
the terms of the 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.... |
Kryz/sentry | refs/heads/master | src/sentry/models/groupassignee.py | 23 | """
sentry.models.groupassignee
~~~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
from django.conf import settings
from django.db import models
from django.utils import timezon... |
cortedeltimo/SickRage | refs/heads/master | lib/hachoir_parser/archive/bzip2_parser.py | 74 | """
BZIP2 archive file
Author: Victor Stinner, Robert Xiao
"""
from hachoir_parser import Parser
from hachoir_core.tools import paddingSize
from hachoir_core.field import (Field, FieldSet, GenericVector,
ParserError, String,
PaddingBits, Bit, Bits, Character,
UInt32, Enum, CompressedField)
from hachoir_co... |
fengbaicanhe/intellij-community | refs/heads/master | plugins/hg4idea/testData/bin/mercurial/mpatch.py | 96 | # mpatch.py - Python implementation of mpatch.c
#
# Copyright 2009 Matt Mackall <mpm@selenic.com> and others
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
import struct
try:
from cStringIO import StringIO
except ImportError:... |
mzdaniel/oh-mainline | refs/heads/master | vendor/packages/typecheck/tests/test_bwcompat_1-6.py | 16 | import support
from support import TODO, TestCase
if __name__ == '__main__':
support.adjust_path()
### /Bookkeeping ###
import types
import typecheck.doctest_support
from typecheck import typecheck, TypeCheckException, Any
class _TestSuite(TestCase):
def testCreateTypeCheckedMethod(self):
@typecheck... |
suninsky/ReceiptOCR | refs/heads/master | Python/server/lib/python2.7/site-packages/PIL/EpsImagePlugin.py | 21 | #
# The Python Imaging Library.
# $Id$
#
# EPS file handling
#
# History:
# 1995-09-01 fl Created (0.1)
# 1996-05-18 fl Don't choke on "atend" fields, Ghostscript interface (0.2)
# 1996-08-22 fl Don't choke on floating point BoundingBox values
# 1996-08-23 fl Handle files from Macintosh (0.3)
# 2001-02-17 fl ... |
noam-stratoscale/rackattack-api | refs/heads/master | test/twistedserver_publishperiodically.py | 3 | from twisted.internet import reactor
from rackattack.tcp import publish
import threading
import sys
import time
class Do(threading.Thread):
def __init__(self, pub):
self._pub = pub
threading.Thread.__init__(self)
self.daemon = True
threading.Thread.start(self)
def run(self):
... |
MarcdeFalco/dagger | refs/heads/master | knowledge/migrations/0010_atomrelationshiptype_fuse_into.py | 1 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('knowledge', '0009_atomtype_important'),
]
operations = [
migrations.AddField(
model_name='atomrelationshiptype',... |
pkubatrh/s2i-python-container | refs/heads/master | examples/npm-virtualenv-uwsgi-test-app/wsgi.py | 25 | from flask import Flask
application = Flask(__name__)
@application.route('/')
def hello():
return b'Hello World from uWSGI hosted WSGI application!'
if __name__ == '__main__':
application.run()
|
jantman/biweeklybudget | refs/heads/master | biweeklybudget/tests/acceptance/flaskapp/views/test_reconcile.py | 1 | """
The latest version of this package is available at:
<http://github.com/jantman/biweeklybudget>
################################################################################
Copyright 2016 Jason Antman <jason@jasonantman.com> <http://www.jasonantman.com>
This file is part of biweeklybudget, also known as bi... |
iuliat/nova | refs/heads/master | nova/db/sqlalchemy/migrate_repo/versions/276_vcpu_model.py | 81 | # 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... |
Sonicbids/django | refs/heads/master | django/bin/unique-messages.py | 67 | #!/usr/bin/env python
import os
import sys
def unique_messages():
basedir = None
if os.path.isdir(os.path.join('conf', 'locale')):
basedir = os.path.abspath(os.path.join('conf', 'locale'))
elif os.path.isdir('locale'):
basedir = os.path.abspath('locale')
else:
print("This scr... |
fritz-k/django-wiki | refs/heads/master | wiki/apps.py | 18 | from __future__ import absolute_import
from __future__ import unicode_literals
from django.apps import AppConfig
from django.utils.translation import ugettext_lazy as _
class NotifcationsConfig(AppConfig):
name = 'wiki.plugins.notifications'
verbose_name = _("Wiki notifications")
label = 'wiki_notificatio... |
ibmsoe/tensorflow | refs/heads/master | tensorflow/contrib/factorization/python/ops/factorization_ops_test.py | 32 | # 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... |
johnardavies/scrapy | refs/heads/master | scrapy/core/downloader/handlers/http11.py | 113 | """Download handlers for http and https schemes"""
import re
import logging
from io import BytesIO
from time import time
from six.moves.urllib.parse import urldefrag
from zope.interface import implements
from twisted.internet import defer, reactor, protocol
from twisted.web.http_headers import Headers as TxHeaders
fr... |
gmuldoon/google-python-exercises | refs/heads/master | basic/solution/string1.py | 210 | #!/usr/bin/python -tt
# Copyright 2010 Google Inc.
# Licensed under the Apache License, Version 2.0
# http://www.apache.org/licenses/LICENSE-2.0
# Google's Python Class
# http://code.google.com/edu/languages/google-python-class/
# Basic string exercises
# Fill in the code for the functions below. main() is already se... |
redhat-cip/horizon | refs/heads/master | openstack_dashboard/dashboards/admin/hypervisors/urls.py | 66 | # Copyright 2013 B1 Systems GmbH
#
# 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 ag... |
jillson/chrononaut | refs/heads/master | adventure/migrations/0004_auto_20151112_0419.py | 1 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('adventure', '0003_load_initial_data'),
]
operations = [
migrations.AlterField(
model_name='adventure',
... |
microcosm-cc/microweb | refs/heads/master | huddles/models.py | 10644 | from django.db import models
# Create your models here.
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.