repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
elba7r/lite-system | refs/heads/master | erpnext/hr/doctype/leave_application/leave_application.py | 2 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.utils import cint, cstr, date_diff, flt, formatdate, getdate, get_link_to_form, \
comma_or, get_fullname... |
molobrakos/home-assistant | refs/heads/master | tests/components/threshold/__init__.py | 36 | """Tests for threshold component."""
|
catapult-project/catapult-csm | refs/heads/master | third_party/google-endpoints/endpoints/api_config_manager.py | 7 | # Copyright 2016 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 a... |
epam-mooc/edx-platform | refs/heads/master | common/lib/xmodule/xmodule/tests/test_utils_django.py | 46 | """Tests for methods defined in util/django.py"""
from xmodule.util.django import get_current_request, get_current_request_hostname
from nose.tools import assert_is_none
from unittest import TestCase
class UtilDjangoTests(TestCase):
"""
Tests for methods exposed in util/django
"""
def test_get_current_... |
jmichalicek/django-marshmallow | refs/heads/master | setup.py | 1 | from setuptools import setup, find_packages
package_data = []
dependencies = []
setup(name="django_marshmallow",
version="0.0.1",
description="Basic Django model serializer subclasses for Marshmallow",
author="Justin Michalicek",
author_email="jmichalicek@gmail.com",
license="www.opensour... |
theonion/django-bulbs | refs/heads/master | tests/test_redirects.py | 2 | try:
import urlparse
except ImportError:
import urllib.parse as urlparse
from django.core.urlresolvers import reverse
from django.test import Client
from bulbs.utils.test import BaseIndexableTestCase
from example.testcontent.models import TestContentObj
class RedirectTestCase(BaseIndexableTestCase):
def... |
ybbxk/shadowsocks | refs/heads/master | shadowsocks/common.py | 945 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2013-2015 clowwindy
#
# 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 requi... |
ZhangXinNan/tensorflow | refs/heads/master | tensorflow/contrib/mpi_collectives/__init__.py | 51 | # Copyright 2017 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... |
mhbu50/erpnext | refs/heads/develop | erpnext/portal/doctype/products_settings/test_products_settings.py | 24 | # -*- coding: utf-8 -*-
# Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest
class TestProductsSettings(unittest.TestCase):
pass
|
dhamaniasad/mythbox | refs/heads/master | resources/lib/twisted/twisted/internet/test/__init__.py | 61 | # Copyright (c) 2008 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted.internet}.
"""
|
Jorge-Rodriguez/ansible | refs/heads/devel | lib/ansible/modules/network/netvisor/pn_role.py | 9 | #!/usr/bin/python
# Copyright: (c) 2018, Pluribus Networks
# 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': ['... |
Grirrane/odoo | refs/heads/master | openerp/tools/graph.py | 8 | #!/usr/bin/env python
# -*- 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 unde... |
eugenewong/AirShare | refs/heads/master | boilerplate/external/requests/sessions.py | 14 | # -*- coding: utf-8 -*-
"""
requests.session
~~~~~~~~~~~~~~~~
This module provides a Session object to manage and persist settings across
requests (cookies, auth, proxies).
"""
import os
from datetime import datetime
from .compat import cookielib
from .cookies import cookiejar_from_dict
from .models import Request,... |
clonetwin26/buck | refs/heads/master | test/com/facebook/buck/android/testdata/android_project/scripts/postfilter.py | 6 | #!/usr/bin/env python2
# Copyright 2004-present Facebook. All Rights Reserved.
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import json
import os
import sys
def main():
build_data_path = sys.argv[1]
rjson_... |
syci/OCB | refs/heads/9.0 | openerp/conf/deprecation.py | 50 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
""" Regroup variables for deprecated features.
To keep the OpenERP server backward compatible with older modules, some
additional code is needed throughout the core library. This module keeps
track of those specific mea... |
macks22/scikit-learn | refs/heads/master | examples/svm/plot_iris.py | 225 | """
==================================================
Plot different SVM classifiers in the iris dataset
==================================================
Comparison of different linear SVM classifiers on a 2D projection of the iris
dataset. We only consider the first 2 features of this dataset:
- Sepal length
- Se... |
sunlightlabs/hall-of-justice | refs/heads/master | common/models.py | 2 | from django.db import models
class TimestampedModel(models.Model):
created_at = models.DateTimeField(auto_now_add=True)
updated_at = models.DateTimeField(auto_now=True)
class Meta:
abstract = True
|
agaurav/ansible | refs/heads/devel | v1/tests/TestModuleUtilsBasic.py | 103 | import os
import tempfile
import unittest
from nose.tools import raises
from nose.tools import timed
from ansible import errors
from ansible.module_common import ModuleReplacer
from ansible.module_utils.basic import heuristic_log_sanitize
from ansible.utils import checksum as utils_checksum
TEST_MODULE_DATA = """
fr... |
BlueAeroplane/2345u | refs/heads/master | node_modules/grunt-contrib-nodeunit/node_modules/nodeunit/node_modules/tap/node_modules/yamlish/yamlish-py/test/test_input.py | 157 | # -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
import test
try:
import unittest2 as unittest
except ImportError:
import unittest
import yamlish
test_data_list = [
{
"name": "Input test",
"in": r"""---
bill-to:
address:
city: "Royal Oak"
... |
trenton42/txbalanced | refs/heads/master | txbalanced/exc.py | 1 | from __future__ import unicode_literals
import httplib
import txwac
class BalancedError(Exception):
def __str__(self):
attrs = ', '.join([
'{0}={1}'.format(k, repr(v))
for k, v in self.__dict__.iteritems()
])
return '{0}({1})'.format(self.__class__.__name__, attr... |
richard-shepherd/coding-world-cup | refs/heads/master | AIs/AI_PlanC/classes.py | 1 | from __future__ import division
import logging
# The direction we are playing...
class MarginFactors(object):
CB_OVERLAP_TO_RIGHT_X = 75
CB_OVERLAP_TO_LEFT_X = 25
WB_OVERLAP_TO_RIGHT_X = 50
WB_OVERLAP_TO_LEFT_X = 50
CB_PASS_ANGLE_MARGIN = 5
WB_PASS_ANGLE_MARGIN = 5
FW_PASS_ANGLE_MARGIN =... |
albertomurillo/ansible | refs/heads/devel | lib/ansible/modules/cloud/ovirt/ovirt_scheduling_policy_facts.py | 55 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (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
#... |
xmhubj/selenium | refs/heads/master | py/selenium/webdriver/firefox/webelement.py | 47 | # 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... |
mattclay/ansible | refs/heads/devel | lib/ansible/cli/playbook.py | 28 | # (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
# Copyright: (c) 2018, Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
import stat
from ansible import c... |
tanupoo/cisco-ipsec-health-checker | refs/heads/master | sshcmd.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
import sys
import os
import paramiko
class sshcmd():
def __init__(self, server, username, password, port=22,
hostkey_file="~/.ssh/known_hosts",
mode="pwd", pkey_file="~/.ssh/id_rsa", debug=False)... |
neurosnap/modular-file-storage | refs/heads/master | demo/test_s3.py | 1 | import os
parentdir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
os.sys.path.insert(0,parentdir)
from mfs import loader
from mfs.ext import s3
import test_config as cfg
# Connect to S3
simple = loader(s3.FileStorage,
key=cfg.s3_key,
secret=cfg.s3_secret,
bucket='mfss3')
# Local/Remove file to be... |
frankier/mezzanine | refs/heads/master | mezzanine/blog/urls.py | 4 | from __future__ import unicode_literals
from django.conf.urls import url
from mezzanine.blog import views
from mezzanine.conf import settings
# Trailing slahes for urlpatterns based on setup.
_slash = "/" if settings.APPEND_SLASH else ""
# Blog patterns.
urlpatterns = [
url(r"^feeds/(?P<format>.*)%s$" % _slash... |
RackSec/ansible | refs/heads/devel | lib/ansible/modules/files/fetch.py | 27 | # this is a virtual module that is entirely implemented server side
# 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 op... |
LarryHillyer/PoolHost | refs/heads/master | PoolHost/env/Lib/site-packages/django/apps/__init__.py | 597 | from .config import AppConfig
from .registry import apps
__all__ = ['AppConfig', 'apps']
|
stacycoin/stacycoin | refs/heads/master | share/qt/extract_strings_qt.py | 2945 | #!/usr/bin/python
'''
Extract _("...") strings for translation and convert to Qt4 stringdefs so that
they can be picked up by Qt linguist.
'''
from subprocess import Popen, PIPE
import glob
import operator
OUT_CPP="src/qt/bitcoinstrings.cpp"
EMPTY=['""']
def parse_po(text):
"""
Parse 'po' format produced by x... |
kenshay/ImageScripter | refs/heads/master | ProgramData/SystemFiles/Python/Lib/site-packages/nbformat/v3/convert.py | 13 | """Code for converting notebooks to and from the v2 format."""
# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
from .nbbase import (
new_code_cell, new_text_cell, new_worksheet, new_notebook, new_output,
nbformat, nbformat_minor
)
from nbformat import v2
... |
luke-dixon/django-ebay-accounts | refs/heads/main | ebay_accounts/forms.py | 1 | # -*- coding: utf-8 -*-
"""
Ebay Accounts Forms
"""
from django import forms
from .models import Session
class BeginAccountCreationForm(forms.ModelForm):
class Meta:
model = Session
fields = ('production', 'site_id')
# vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 fileencoding=utf-8
|
mrbcy/OnionsS3C | refs/heads/master | src/shimo_crawer/txt_html.py | 1 | # !/usr/bin/env python3
# -*- coding: utf-8 -*-
import re
import cgi
def shimo_format(text):
if text.startswith("*"):
text = text[1:]
text = split_code_apart(text)
text = add_html_tags(text)
return text
def add_html_tags(text):
lines = text.split('<block>')
html_text = ''
for l... |
theanalyst/cinder | refs/heads/master | cinder/volume/drivers/netapp/eseries/client.py | 1 | # Copyright (c) 2014 NetApp, 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... |
DrMeers/django | refs/heads/master | django/contrib/gis/gdal/tests/test_envelope.py | 12 | import unittest
from unittest import skipUnless
from django.contrib.gis.gdal import HAS_GDAL
if HAS_GDAL:
from django.contrib.gis.gdal import Envelope, OGRException
class TestPoint(object):
def __init__(self, x, y):
self.x = x
self.y = y
@skipUnless(HAS_GDAL, "GDAL is required")
class Enve... |
havatv/QGIS | refs/heads/master | tests/src/python/test_qgsmaplayercombobox.py | 31 | # -*- coding: utf-8 -*-
"""QGIS Unit tests for QgsMapLayerComboBox
.. 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 version 2 of the License, or
(at your option) any later version.
""... |
schleichdi2/OpenNfr_E2_Gui-6.0 | refs/heads/master | lib/python/Plugins/Extensions/MediaPortal/resources/hosters/flyflv.py | 1 | # -*- coding: utf-8 -*-
from Plugins.Extensions.MediaPortal.plugin import _
from Plugins.Extensions.MediaPortal.resources.imports import *
def flyflv(self, data):
parse = re.search('config: "(.*?)"', data, re.I)
if parse:
urlparts = re.findall("http://www.flyflv.com(.*?)\?e=(\d+)&ip=(.*?)$", parse.group(1))
if ... |
chuan9/chromium-crosswalk | refs/heads/master | build/get_syzygy_binaries.py | 20 | #!/usr/bin/env python
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""A utility script for downloading versioned Syzygy binaries."""
import cStringIO
import hashlib
import errno
import json
import logg... |
goddardl/cortex | refs/heads/master | python/IECoreHoudini/__init__.py | 3 | ##########################################################################
#
# Copyright 2010 Dr D Studios Pty Limited (ACN 127 184 954) (Dr. D Studios),
# its affiliates and/or its licensors.
#
# Copyright (c) 2010-2014, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary ... |
codingforentrepreneurs/ecommerce-2-api | refs/heads/master | src/ecommerce2/settings/__init__.py | 44 | from .base import *
try:
from .local import *
except:
pass
try:
from .production import *
except:
pass
try:
from .imac import *
except:
pass
try:
from .macbookpro import *
except:
pass |
petteyg/intellij-community | refs/heads/master | python/lib/Lib/site-packages/django/contrib/sitemaps/models.py | 914 | # This file intentionally left blank |
maclandrol/ete | refs/heads/master | examples/treeview/bubble_map.py | 2 | import random
from ete2 import Tree, TreeStyle, NodeStyle, faces, AttrFace, CircleFace
def layout(node):
if node.is_leaf():
# Add node name to laef nodes
N = AttrFace("name", fsize=14, fgcolor="black")
faces.add_face_to_node(N, node, 0)
if "weight" in node.features:
# Creates a ... |
panfengfeng/spark | refs/heads/master | python/pyspark/sql/dataframe.py | 2 | #
# 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... |
semonte/intellij-community | refs/heads/master | python/helpers/pydev/_pydevd_bundle/pydevd_console.py | 16 | '''An helper file for the pydev debugger (REPL) console
'''
import sys
import traceback
from code import InteractiveConsole
from _pydev_bundle import _pydev_completer
from _pydev_bundle.pydev_console_utils import BaseInterpreterInterface, BaseStdIn
from _pydev_bundle.pydev_imports import Exec
from _pydev_bundle.pydev_... |
waheedahmed/edx-platform | refs/heads/master | lms/djangoapps/mobile_api/users/models.py | 1644 | """
A models.py is required to make this an app (until we move to Django 1.7)
"""
|
valentin-krasontovitsch/ansible | refs/heads/devel | lib/ansible/modules/cloud/rackspace/rax_mon_notification_plan.py | 77 | #!/usr/bin/python
# Copyright: Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... |
Dazzozo/huawei-kernel-3.4 | refs/heads/kitkat | tools/perf/scripts/python/syscall-counts-by-pid.py | 11180 | # system call counts, by pid
# (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, sys
sys.path.append(os.env... |
archen/django | refs/heads/master | django/contrib/admin/filters.py | 70 | """
This encapsulates the logic for displaying filters in the Django admin.
Filters are specified in models with the "list_filter" option.
Each filter subclass knows how to display a filter for a field that passes a
certain test -- e.g. being a DateField or ForeignKey.
"""
import datetime
from django.db import models... |
DirtyPiece/dancestudio | refs/heads/master | Build/Tools/Python27/Lib/json/decoder.py | 43 | """Implementation of JSONDecoder
"""
import re
import sys
import struct
from json import scanner
try:
from _json import scanstring as c_scanstring
except ImportError:
c_scanstring = None
__all__ = ['JSONDecoder']
FLAGS = re.VERBOSE | re.MULTILINE | re.DOTALL
def _floatconstants():
_BYTES = '7FF800000000... |
arpitparmar5739/youtube-dl | refs/heads/master | youtube_dl/extractor/mpora.py | 175 | from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import int_or_none
class MporaIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?mpora\.(?:com|de)/videos/(?P<id>[^?#/]+)'
IE_NAME = 'MPORA'
_TEST = {
'url': 'http://mpora.de/videos/AAdo8okx4wiz/embed?locale... |
kmod/icbd | refs/heads/master | icbd/type_analyzer/tests/polymorphic.py | 1 | d = {1:''} # 0 {int:str}
d2 = dict(d) # 0 {int:str}
print d2
l = [('', 2)] # 0 [(str,int)]
d3 = dict(l) # 0 {str:int}
print d3
l = [('', 2, 3)] # 0 [(str,int,int)]
d4 = dict(l) # e 5 # 0 <unknown>
print d4
|
mnahm5/django-estore | refs/heads/master | Lib/site-packages/pip/_vendor/requests/sessions.py | 355 | # -*- coding: utf-8 -*-
"""
requests.session
~~~~~~~~~~~~~~~~
This module provides a Session object to manage and persist settings across
requests (cookies, auth, proxies).
"""
import os
from collections import Mapping
from datetime import datetime
from .auth import _basic_auth_str
from .compat import cookielib, Ord... |
phamngtuananh/Singaboat_RobotX2016 | refs/heads/master | robotx_nav/nodes/move_base_loiter.py | 1 |
#!/usr/bin/env python
""" movebase loiter
Command a robot to move in a polygon around a centerpoint,
inspired from moos-ivp loiter behavior
borrowed from rbx1 move base square
Ren Ye
2016-09-30
# changelog
@2016-10-19: class inheritate from movebaseutil
"""
import rospy
import action... |
DeltaEpsilon-HackFMI2/FMICalendar-REST | refs/heads/master | venv/lib/python2.7/site-packages/django/core/servers/fastcgi.py | 241 | """
FastCGI (or SCGI, or AJP1.3 ...) server that implements the WSGI protocol.
Uses the flup python package: http://www.saddi.com/software/flup/
This is a adaptation of the flup package to add FastCGI server support
to run Django apps from Web servers that support the FastCGI protocol.
This module can be run standalo... |
MalloyPower/parsing-python | refs/heads/master | front-end/testsuite-python-lib/Python-2.1/Lib/test/test_al.py | 15 | #! /usr/bin/env python
"""Whimpy test script for the al module
Roger E. Masse
"""
import al
from test_support import verbose
alattrs = ['__doc__', '__name__', 'getdefault', 'getminmax', 'getname', 'getparams',
'newconfig', 'openport', 'queryparams', 'setparams']
# This is a very unobtrusive test for the... |
jzoldak/edx-platform | refs/heads/master | openedx/core/lib/tests/test_cache_utils.py | 144 | """
Tests for cache_utils.py
"""
import ddt
from mock import MagicMock
from unittest import TestCase
from openedx.core.lib.cache_utils import memoize_in_request_cache
@ddt.ddt
class TestMemoizeInRequestCache(TestCase):
"""
Test the memoize_in_request_cache helper function.
"""
class TestCache(object)... |
instructure/contests | refs/heads/master | 2011-mebipenny/contest/spelunking/generate_large_cave.py | 7 | #!/usr/bin/env python
import random
levels = 250
caves_per_level = 33
capacity_range = (1, 500)
print caves_per_level * (levels + 1) + 2
print (caves_per_level * 2 - 1) * levels + (caves_per_level * 2)
for cave in xrange(caves_per_level):
print 1, cave + 2, random.randint(*capacity_range)
for level in xrange(level... |
bitospher/chromium-project | refs/heads/master | contrib/testgen/base58.py | 2139 | '''
Bitcoin base58 encoding and decoding.
Based on https://bitcointalk.org/index.php?topic=1026.0 (public domain)
'''
import hashlib
# for compatibility with following code...
class SHA256:
new = hashlib.sha256
if str != bytes:
# Python 3.x
def ord(c):
return c
def chr(n):
return byte... |
rafalo1333/kivy | refs/heads/master | examples/guide/designwithkv/main.py | 22 | import kivy
kivy.require('1.0.5')
from kivy.uix.floatlayout import FloatLayout
from kivy.app import App
from kivy.properties import ObjectProperty, StringProperty
class Controller(FloatLayout):
'''Create a controller that receives a custom widget from the kv lang file.
Add an action to be called from the kv... |
Mirantis/octane | refs/heads/master | octane/commands/prepare.py | 1 | # 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... |
fyfcauc/android_external_chromium-org | refs/heads/du44 | third_party/bintrees/bintrees/bintree.py | 156 | #!/usr/bin/env python
#coding:utf-8
# Author: mozman
# Purpose: binary tree module
# Created: 28.04.2010
# Copyright (c) 2010-2013 by Manfred Moitzi
# License: MIT License
from __future__ import absolute_import
from .treemixin import TreeMixin
__all__ = ['BinaryTree']
class Node(object):
""" Internal object, ... |
WillGuan105/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... |
frt-arch/taiga-back | refs/heads/master | taiga/projects/migrations/0014_userstorystatus_is_archived.py | 29 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('projects', '0013_auto_20141210_1040'),
]
operations = [
migrations.AddField(
model_name='userstorystatus',
... |
stackforge/watcher | refs/heads/master | watcher/objects/efficacy_indicator.py | 2 | # -*- encoding: utf-8 -*-
# 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 required by applicable law or... |
ChromiumWebApps/chromium | refs/heads/master | build/android/gyp/generate_v14_compatible_resources.py | 27 | #!/usr/bin/env python
#
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Convert Android xml resources to API 14 compatible.
There are two reasons that we cannot just use API 17 attributes,
so we are ge... |
nhr/openshift-ansible | refs/heads/master | roles/lib_openshift/src/ansible/oc_scale.py | 86 | # pylint: skip-file
# flake8: noqa
def main():
'''
ansible oc module for scaling
'''
module = AnsibleModule(
argument_spec=dict(
kubeconfig=dict(default='/etc/origin/master/admin.kubeconfig', type='str'),
state=dict(default='present', type='str', choices=['present', 'li... |
xwolf12/androguard | refs/heads/master | elsim/elsim/elsim_x86.py | 35 | #!/usr/bin/env python
# This file is part of Elsim
#
# Copyright (C) 2012, Anthony Desnos <desnos at t0t0.fr>
# All rights reserved.
#
# Elsim 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 Foundation, either ver... |
Panos512/inspire-next | refs/heads/master | inspirehep/modules/workflows/workflows/__init__.py | 2 | # -*- coding: utf-8 -*-
#
# This file is part of INSPIRE.
# Copyright (C) 2016 CERN.
#
# INSPIRE is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (at your option) any later... |
kjempelodott/banan | refs/heads/master | banan/server.py | 1 | import sys, os, signal, fcntl, time, re, socket, traceback
from datetime import date, datetime
from posixpath import splitext
from shutil import copyfileobj
from json import loads, JSONEncoder
from uuid import uuid4
from io import BytesIO
from socketserver import TCPServer
from http.server import BaseHTTPRequestHandle... |
unaizalakain/django | refs/heads/master | tests/generic_inline_admin/models.py | 281 | from django.contrib.contenttypes.fields import (
GenericForeignKey, GenericRelation,
)
from django.contrib.contenttypes.models import ContentType
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
class Episode(models.Model):
name = models.CharField(max_length=100)
... |
home-assistant/home-assistant | refs/heads/dev | script/scaffold/templates/significant_change/integration/significant_change.py | 5 | """Helper to test significant NEW_NAME state changes."""
from __future__ import annotations
from typing import Any
from homeassistant.const import ATTR_DEVICE_CLASS
from homeassistant.core import HomeAssistant, callback
@callback
def async_check_significant_change(
hass: HomeAssistant,
old_state: str,
o... |
iansprice/wagtail | refs/heads/master | wagtail/api/conf.py | 2 | from __future__ import absolute_import, unicode_literals
class APIField(object):
def __init__(self, name, serializer=None):
self.name = name
self.serializer = serializer
def __hash__(self):
return hash(self.name)
def __repr__(self):
return '<APIField {}>'.format(self.name... |
umair-gujjar/chrome-extensions-1 | refs/heads/master | crx-appengine-packager/Crypto/test/test_hashes.py | 2 | #
# Test script for Crypto.Util.randpool.
#
__revision__ = "$Id: test_hashes.py,v 1.4 2004/08/13 22:23:12 akuchling Exp $"
import time, string, binascii
from sancho.unittest import TestScenario, parse_args, run_scenarios
from Crypto.Hash import *
import testdata
tested_modules = [ "Crypto.Hash.MD2", "Crypto.Hash.MD... |
vileopratama/vitech | refs/heads/master | src/addons/payment_buckaroo/__openerp__.py | 18 | # -*- coding: utf-8 -*-
{
'name': 'Buckaroo Payment Acquirer',
'category': 'Accounting',
'summary': 'Payment Acquirer: Buckaroo Implementation',
'version': '1.0',
'description': """Buckaroo Payment Acquirer""",
'depends': ['payment'],
'data': [
'views/buckaroo.xml',
'views/p... |
BT-rmartin/odoo | refs/heads/BT_2900 | openerp/report/render/__init__.py | 381 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... |
robertnishihara/ray | refs/heads/master | python/ray/tune/examples/pbt_transformers/pbt_transformers.py | 1 | import os
import ray
from ray.tune import CLIReporter
from ray.tune.integration.wandb import wandb_mixin # noqa: F401
from ray.tune.schedulers import PopulationBasedTraining
from ray import tune
from ray.tune.examples.pbt_transformers.utils import \
build_compute_metrics_fn, download_data
from ray.tune.examples.... |
kklmn/xrt | refs/heads/master | examples/withRaycing/10_MultipleReflect/__init__.py | 1 | # -*- coding: utf-8 -*-
r"""
Multiple reflections
--------------------
Files in ``\examples\withRaycing\10_MultipleReflect``
.. _montel:
Montel mirror
~~~~~~~~~~~~~
Montel mirror consists of two orthogonal mirrors positioned side-by-side. It is
very similar to a KB mirror but more compact in the longitudinal direc... |
chdecultot/erpnext | refs/heads/develop | erpnext/__init__.py | 1 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import inspect
import frappe
from erpnext.hooks import regional_overrides
from frappe.utils import getdate
__version__ = '10.1.60'
def get_default_company(user=None):
'''Get default company for user'''
from frappe.defaults import get_user_default_as_li... |
zding5/Microblog-Flask | refs/heads/master | flask/lib/python2.7/site-packages/openid/extensions/draft/pape5.py | 156 | """An implementation of the OpenID Provider Authentication Policy
Extension 1.0, Draft 5
@see: http://openid.net/developers/specs/
@since: 2.1.0
"""
__all__ = [
'Request',
'Response',
'ns_uri',
'AUTH_PHISHING_RESISTANT',
'AUTH_MULTI_FACTOR',
'AUTH_MULTI_FACTOR_PHYSICAL',
'LEVELS_NIST',
... |
eonpatapon/nova | refs/heads/master | nova/db/sqlalchemy/types.py | 80 | # Copyright 2011 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... |
jostep/tensorflow | refs/heads/master | tensorflow/contrib/kernel_methods/python/losses_test.py | 29 | # Copyright 2017 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... |
mpampols/directoalartista.com | refs/heads/master | directoalartista/urls/base.py | 1 | from django.conf.urls import patterns, include, url
from django.contrib import admin
from django.contrib.sitemaps import FlatPageSitemap, GenericSitemap
from django.views.generic import TemplateView
from directoalartista.apps.artistprofile.models import ArtistProfile
from directoalartista.apps.artistprofile import vie... |
xoan/Printrun | refs/heads/master | printrun/stlplater.py | 2 | #!/usr/bin/env python3
# This file is part of the Printrun suite.
#
# Printrun 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.
#
# Pri... |
zubron/servo | refs/heads/master | python/tidy/servo_tidy_tests/test_tidy.py | 9 | # Copyright 2013 The Servo Project Developers. See the COPYRIGHT
# file at the top-level directory of this distribution.
#
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
# <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
#... |
xkcd1253/Mimi | refs/heads/master | flask/lib/python2.7/site-packages/flup/server/scgi_base.py | 18 | # Copyright (c) 2005, 2006 Allan Saddi <allan@saddi.com>
# All rights reserved.
#
# 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 above copyright
# notice, this lis... |
vlinhd11/vlinhd11-android-scripting | refs/heads/master | python-build/python-libs/gdata/tests/gdata_tests/health_test.py | 127 | #!/usr/bin/python
#
# Copyright 2009 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... |
mccheung/kbengine | refs/heads/master | kbe/res/scripts/common/Lib/test/test_multibytecodec.py | 72 | #
# test_multibytecodec.py
# Unit test for multibytecodec itself
#
from test import support
from test.support import TESTFN
import unittest, io, codecs, sys, os
import _multibytecodec
ALL_CJKENCODINGS = [
# _codecs_cn
'gb2312', 'gbk', 'gb18030', 'hz',
# _codecs_hk
'big5hkscs',
# _codecs_jp
'cp932', 'shi... |
sev3n85/samsung_s3ve3g_EUR | refs/heads/TW-5.1.1 | 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... |
cyberark-bizdev/ansible | refs/heads/devel | lib/ansible/modules/cloud/amazon/ecs_taskdefinition_facts.py | 34 | #!/usr/bin/python
# Copyright: Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... |
jwhui/openthread | refs/heads/cli | tools/harness-automation/cases_R140/router_5_7_1.py | 18 | #!/usr/bin/env python
#
# Copyright (c) 2016, The OpenThread 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:
# 1. Redistributions of source code must retain the above copyright
# notic... |
xianggong/m2c_unit_test | refs/heads/master | test/operator/divide_uchar8uchar8/compile.py | 1861 | #!/usr/bin/python
import os
import subprocess
import re
def runCommand(command):
p = subprocess.Popen(command,
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT)
p.wait()
return iter(p.stdout.readline, b'')
def dumpRunCommand(command,... |
tobi2006/nomosdb | refs/heads/master | feedback/admin.py | 13848 | from django.contrib import admin
# Register your models here.
|
naousse/odoo | refs/heads/8.0 | addons/resource/faces/task.py | 433 | #@+leo-ver=4
#@+node:@file task.py
#@@language python
#@<< Copyright >>
#@+node:<< Copyright >>
############################################################################
# Copyright (C) 2005, 2006, 2007, 2008 by Reithinger GmbH
# mreithinger@web.de
#
# This file is part of faces.
#
# faces is free software; ... |
beezz/trustpaylib | refs/heads/master | test_trustpaylib.py | 1 | # -*- coding: utf-8 -*-
# vim:fenc=utf-8
import pytest
import trustpaylib
try:
unicode
py3 = False
except NameError:
py3 = True
unicode = lambda s: s
class TestTrustPayCore:
secret_key = "abcd1234"
aid = "9876543210"
pay_request = trustpaylib.build_pay_request(
AID=aid,
... |
goldcoin/gldcoin | refs/heads/master | BuildDeps/deps/boost/tools/build/v2/test/BoostBuild.py | 5 | # Copyright 2002-2005 Vladimir Prus.
# Copyright 2002-2003 Dave Abrahams.
# Copyright 2006 Rene Rivera.
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
import TestCmd
import copy
import fnmatch
import gl... |
nirbheek/cerbero-old | refs/heads/master | test/test_cerbero_packages_osx_info_plist.py | 26 | # cerbero - a multi-platform build system for Open Source software
# Copyright (C) 2012 Andoni Morales Alastruey <ylatuya@gmail.com>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free Software Foundation; eit... |
erkanay/django | refs/heads/master | django/core/servers/fastcgi.py | 170 | """
FastCGI (or SCGI, or AJP1.3 ...) server that implements the WSGI protocol.
Uses the flup python package: http://www.saddi.com/software/flup/
This is an adaptation of the flup package to add FastCGI server support
to run Django apps from Web servers that support the FastCGI protocol.
This module can be run standal... |
quarkonics/zstack-woodpecker | refs/heads/master | integrationtest/vm/virtualrouter/lb/test_create_lb_alone_vr.py | 4 | '''
Test load balance on separated VR VM.
Test step:
1. Create 3 VM with load balance l3 network service.
2. Create a LB with 3 VMs' nic
3. Check the LB
4. Destroy VMs
@author: Youyk
'''
import os
import zstackwoodpecker.test_util as test_util
import zstackwoodpecker.test_lib as test_... |
chongtianfeiyu/kbengine | refs/heads/master | kbe/src/lib/python/Lib/ctypes/test/test_macholib.py | 100 | import os
import sys
import unittest
# Bob Ippolito:
#
# Ok.. the code to find the filename for __getattr__ should look
# something like:
#
# import os
# from macholib.dyld import dyld_find
#
# def find_lib(name):
# possible = ['lib'+name+'.dylib', name+'.dylib',
# name+'.framework/'+name]
# for dylib i... |
siosio/intellij-community | refs/heads/master | python/testData/intentions/convertTripleQuotedString.py | 83 | if True:
if True:
a = ''''Hello'<caret> - said man.\n
Let's go.
And they went out.''' |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.