repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
saurabh6790/OFF-RISAPP | refs/heads/master | projects/doctype/__init__.py | 37694 | from __future__ import unicode_literals
|
Adward-R/Info-Retrieval-Project | refs/heads/master | djcode/mysite/views.py | 1 | from django.shortcuts import render_to_response
from django.shortcuts import render
from django.template.loader import get_template
from django.template import Context
from django.http import HttpResponse
from django.http import HttpResponseRedirect
from django.core.files import File
import math
import re
from... |
RockchipOpensourceCommunity/popmetal-android-kernel-3.10 | refs/heads/master | tools/perf/scripts/python/futex-contention.py | 11261 | # futex contention
# (c) 2010, Arnaldo Carvalho de Melo <acme@redhat.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Translation of:
#
# http://sourceware.org/systemtap/wiki/WSFutexContention
#
# to perf python scripting.
#
# Measures futex contention
import os, sys
sys.path.append(os.environ['PER... |
elektito/pybtracker | refs/heads/master | test.py | 1 | import asyncio
import struct
import logging
import pybtracker
import asynctest
from ipaddress import ip_address
from datetime import datetime, timedelta
from asynctest.mock import patch, Mock, CoroutineMock
logger = logging.getLogger(__name__)
class TrackerServerProtocolTest(asynctest.TestCase):
async def setUp(s... |
jamesthechamp/zamboni | refs/heads/master | mkt/developers/tests/test_views_payments.py | 9 | # -*- coding: utf-8 -*-
import json
from django.conf import settings
from django.core.exceptions import ObjectDoesNotExist
from django.core.urlresolvers import reverse
import mock
from mock import ANY
from nose.tools import eq_, ok_
from pyquery import PyQuery as pq
from slumber.exceptions import HttpClientError
from... |
junmin-zhu/chromium-rivertrail | refs/heads/v8-binding | third_party/protobuf/python/google/protobuf/internal/containers.py | 261 | # Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
# http://code.google.com/p/protobuf/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions o... |
phoad/rsocket-cpp | refs/heads/master | build/fbcode_builder/specs/wangle.py | 4 | #!/usr/bin/env python
# Copyright (c) Facebook, Inc. and its affiliates.
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import specs.folly as folly
import specs.fizz as fizz
import specs.sodium as sodium
def fbcode_... |
inercia/candelabra | refs/heads/master | candelabra/command/destroy/plugin.py | 3 | #
# Candelabra
#
# Copyright Alvaro Saurin 2013 - All right Reserved
#
from .command import command as command_instance
def register(registry_instance):
registry_instance.register(command_instance.NAME, command_instance)
|
aristotle-tek/cuny-bdif | refs/heads/master | AWS/ec2/lib/boto-2.34.0/boto/glacier/writer.py | 153 | # -*- coding: utf-8 -*-
# Copyright (c) 2012 Thomas Parslow http://almostobsolete.net/
# Copyright (c) 2012 Robie Basak <robie@justgohome.co.uk>
# Tree hash implementation from Aaron Brady bradya@gmail.com
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated... |
jeremiah-c-leary/vhdl-style-guide | refs/heads/master | vsg/token/selected_variable_assignment.py | 1 |
from vsg import parser
class with_keyword(parser.keyword):
'''
unique_id = selected_variable_assignment : with_keyword
'''
def __init__(self, sString):
parser.keyword.__init__(self, sString)
class select_keyword(parser.keyword):
'''
unique_id = selected_variable_assignment : select... |
heke123/chromium-crosswalk | refs/heads/master | third_party/WebKit/Source/bindings/scripts/v8_globals.py | 73 | # Copyright (C) 2013 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the ... |
jtk54/spinnaker | refs/heads/master | pylib/yaml/constructor.py | 392 |
__all__ = ['BaseConstructor', 'SafeConstructor', 'Constructor',
'ConstructorError']
from error import *
from nodes import *
import datetime
import binascii, re, sys, types
class ConstructorError(MarkedYAMLError):
pass
class BaseConstructor(object):
yaml_constructors = {}
yaml_multi_constructors =... |
rschiang/shedskin | refs/heads/master | shedskin/lib/collections.py | 6 | # Copyright 2005-2011 Mark Dufour and contributors; License Expat (See LICENSE)
class deque(pyiter):
def __init__(self, iterable=None):
self.unit = iterable.unit
def append(self, x):
self.unit = x
def appendleft(self, x):
self.unit = x
def extend(self, b):
self.unit = b... |
wakamori/GoForIt | refs/heads/master | 1/1-2.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import datetime
import random
import sys
class DayLife:
"""Life in a day."""
def __init__(self, date, life):
"""Set birth datetime and life."""
self.birthdate = date
self.life = life
finalyear = self.birthdate.year + self.life
... |
brbsix/icon-library | refs/heads/master | iconlibrary/searchentry.py | 1 | #!/usr/bin/env python
# Filename: searchentry.py
"""
coding: utf-8
SearchEntry - An enhanced search entry with alternating background colouring
and timeout support
Copyright (C) 2007 Sebastian Heinlein
2007-2009 Canonical Ltd.
Authors:
Sebastian Heinlein <glatzor@ubuntu.com>
This progr... |
gaddman/ansible | refs/heads/devel | lib/ansible/modules/network/nxos/nxos_gir_profile_management.py | 50 | #!/usr/bin/python
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distribut... |
BhupeshGupta/frappe | refs/heads/develop | frappe/website/website_generator.py | 9 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.utils import now
from frappe.model.document import Document
from frappe.model.naming import append_number_if_name_exists
from frappe.website.utils imp... |
nesdis/djongo | refs/heads/master | tests/django_tests/tests/v22/tests/order_with_respect_to/models.py | 133 | """
Tests for the order_with_respect_to Meta attribute.
"""
from django.db import models
class Question(models.Model):
text = models.CharField(max_length=200)
class Answer(models.Model):
text = models.CharField(max_length=200)
question = models.ForeignKey(Question, models.CASCADE)
class Meta:
... |
zerobatu/edx-platform | refs/heads/master | common/test/acceptance/tests/lms/test_lms_courseware_search.py | 36 | """
Test courseware search
"""
import json
from nose.plugins.attrib import attr
from ..helpers import UniqueCourseTest, remove_file
from ...pages.common.logout import LogoutPage
from ...pages.studio.utils import add_html_component, click_css, type_in_codemirror
from ...pages.studio.auto_auth import AutoAuthPage
from ... |
gosquadron/squadron | refs/heads/master | tests/test_status.py | 1 | from mock import MagicMock
import requests
from squadron import status
import ssl
import uuid
import hmac
import hashlib
import json
def test_basic():
session = requests.session()
session.mount = MagicMock()
session.post = MagicMock()
response = requests.Response()
response.raise_for_status = Magic... |
andresailer/DIRAC | refs/heads/rel-v6r22 | AccountingSystem/DB/test/Test_AccountingDB.py | 2 | """ Test class for AccountingDB
"""
# pylint: disable=protected-access
# imports
import unittest
from mock import MagicMock
import DIRAC.AccountingSystem.DB.AccountingDB as moduleTested
class TestCase(unittest.TestCase):
""" Base class for the EmailAction / EmailAgent test cases
"""
def setUp(self):
se... |
webmaven/appengine-python-morepath-skeleton | refs/heads/master | appengine_config.py | 123 | """`appengine_config` gets loaded when starting a new application instance."""
import vendor
# insert `lib` as a site directory so our `main` module can load
# third-party libraries, and override built-ins with newer
# versions.
vendor.add('lib')
|
sajuptpm/neutron-ipam | refs/heads/stable/icehouse | neutron/plugins/brocade/db/__init__.py | 62 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright 2013 Brocade Communications System, 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
#
# ... |
Zimbra-Community/python-zimbra | refs/heads/master | pythonzimbra/response_json.py | 3 | """ JSON-Response format """
import json
from pythonzimbra.response import Response
class ResponseJson(Response):
response_dict = None
""" The dictionary we'll be working on """
response_type = "json"
def clean(self):
super(ResponseJson, self).clean()
self.response_dict = None
... |
mabushadi/dpxdt | refs/heads/master | dependencies/WTForms/wtforms/ext/django/templatetags/wtforms.py | 104 | """
Template tags for easy WTForms access in Django templates.
"""
from __future__ import unicode_literals
import re
from django import template
from django.conf import settings
from django.template import Variable
from ....compat import iteritems
register = template.Library()
class FormFieldNode(template.Node):
... |
BT-fgarbely/account-invoicing | refs/heads/8.0 | account_invoice_line_description/res_config.py | 27 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2015 Agile Business Group sagl
# (<http://www.agilebg.com>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public ... |
FlyRabbit/WeRoBot | refs/heads/develop | tests/test_client.py | 2 | import os
from werobot.config import Config
from werobot.client import Client
basedir = os.path.dirname(os.path.abspath(__file__))
APP_ID = "123"
APP_SECRET = "321"
def test_id_and_secret():
config = Config()
config.from_pyfile(os.path.join(basedir, "test_client.py"))
client = Client(config)
assert... |
adamhaney/airflow | refs/heads/master | tests/contrib/sensors/test_qubole_sensor.py | 5 | # -*- coding: utf-8 -*-
#
# 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
#... |
rgayon/plaso | refs/heads/master | tests/cli/helpers/storage_file.py | 1 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Tests for the storage file CLI arguments helper."""
from __future__ import unicode_literals
import argparse
import unittest
from plaso.cli import tools
from plaso.cli.helpers import storage_file
from plaso.lib import errors
from tests.cli import test_lib as cli_test... |
nikhilsaraf/Twitter-Analytics | refs/heads/master | venv/lib/python2.7/site-packages/pip/vcs/subversion.py | 170 | from __future__ import absolute_import
import logging
import os
import re
from pip._vendor.six.moves.urllib import parse as urllib_parse
from pip.index import Link
from pip.utils import rmtree, display_path
from pip.utils.logging import indent_log
from pip.vcs import vcs, VersionControl
_svn_xml_url_re = re.compile... |
Pafcholini/Nadia-kernel-LL-N910F-EUR-LL-OpenSource | refs/heads/master | 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... |
gtaylor/ansible | refs/heads/devel | lib/ansible/errors.py | 111 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... |
marcoantoniooliveira/labweb | refs/heads/master | oscar/lib/python2.7/site-packages/IPython/testing/tests/test_tools.py | 2 | # encoding: utf-8
"""
Tests for testing.tools
"""
#-----------------------------------------------------------------------------
# Copyright (C) 2008-2011 The IPython Development Team
#
# Distributed under the terms of the BSD License. The full license is in
# the file COPYING, distributed as part of this softwar... |
credativUK/OCB | refs/heads/7.0-local | addons/crm_profiling/__init__.py | 438 | # -*- 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... |
sweaterr/BanditsBook | refs/heads/master | python/arms/adversarial.py | 6 | class AdversarialArm():
def __init__(self, t, active_start, active_end):
self.t = t
self.active_start = active_start
self.active_end = active_end
def draw(self):
self.t = self.t + 1
if self.active_start <= self.t <= self.active_end:
return 1.0
else:
return 0.0
|
etherkit/OpenBeacon2 | refs/heads/master | client/linux-arm/venv/lib/python3.5/site-packages/PyInstaller/hooks/hook-numba.py | 2 | #-----------------------------------------------------------------------------
# Copyright (c) 2013-2019, PyInstaller Development Team.
#
# Distributed under the terms of the GNU General Public License with exception
# for distributing bootloader.
#
# The full license is in the file COPYING.txt, distributed with this s... |
yiqingj/airflow | refs/heads/master | airflow/minihivecluster.py | 8 | # -*- coding: utf-8 -*-
# Copyright (c) 2016 Bolke de Bruin
#
# 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 la... |
DolphinDream/sverchok | refs/heads/master | utils/sv_transform_helper.py | 1 | # ##### BEGIN GPL LICENSE BLOCK #####
#
# 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 distrib... |
jonieli/flask | refs/heads/master | flask/exthook.py | 142 | # -*- coding: utf-8 -*-
"""
flask.exthook
~~~~~~~~~~~~~
Redirect imports for extensions. This module basically makes it possible
for us to transition from flaskext.foo to flask_foo without having to
force all extensions to upgrade at the same time.
When a user does ``from flask.ext.foo import... |
Krugercoin/krugercoins | refs/heads/master | BuildDeps/deps/boost/libs/python/test/bienstman4.py | 46 | # Copyright David Abrahams 2004. 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)
'''
>>> from bienstman4_ext import *
>>> t1 = T1()
>>> e = Expression()
>>> e.add(t1)
'''
def run(args = None):
import sys
impor... |
tlatzko/spmcluster | refs/heads/master | .tox/clean/lib/python2.7/site-packages/pip/_vendor/distlib/locators.py | 223 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2012-2015 Vinay Sajip.
# Licensed to the Python Software Foundation under a contributor agreement.
# See LICENSE.txt and CONTRIBUTORS.txt.
#
import gzip
from io import BytesIO
import json
import logging
import os
import posixpath
import re
try:
import threading
except Impo... |
ligovirgo/gwdetchar | refs/heads/master | gwdetchar/saturation/tests/test_saturation.py | 1 | # -*- coding: utf-8 -*-
# Copyright (C) Joshua Smith (2016-)
#
# This file is part of the GW DetChar python package.
#
# gwdetchar 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 Licens... |
severin31/suplemon | refs/heads/master | suplemon/linelight/html.py | 2 | from suplemon import helpers
class Syntax:
def get_comment(self):
return ("<!--", "-->")
def get_color(self, raw_line):
color = 7
line = raw_line.strip()
if helpers.starts(line, ["#", "//", "/*", "*/", "<!--"]):
color = 5 # Magenta
elif helpers.ends(line... |
ppries/tensorflow | refs/heads/master | tensorflow/contrib/distributions/python/ops/relaxed_onehot_categorical.py | 3 | # 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... |
scop/bash-completion | refs/heads/master | test/t/test_gnatmake.py | 2 | import pytest
class TestGnatmake:
@pytest.mark.complete("gnatmake ")
def test_1(self, completion):
assert completion
|
ESOedX/edx-platform | refs/heads/master | lms/djangoapps/courseware/tests/test_favicon.py | 1 | """
Tests of the courseware favicon
"""
from __future__ import absolute_import
from django.test import TestCase
from django.test.utils import override_settings
from util.testing import UrlResetMixin
class FaviconTestCase(UrlResetMixin, TestCase):
"""
Tests of the courseware favicon.
"""
def test_f... |
MilhouseVH/xbmc | refs/heads/master | tools/EventClients/examples/python/example_simple.py | 228 | #!/usr/bin/python
# This is a simple example showing how you can send a key press event
# to XBMC using the XBMCClient class
import sys
sys.path.append("../../lib/python")
import time
from xbmcclient import XBMCClient
def main():
host = "localhost"
port = 9777
# Create an XBMCClient object and con... |
chokribr/inveniocnudst | refs/heads/master | modules/bibformat/lib/elements/bfe_webauthorpage_data.py | 18 | # -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2011 CERN.
##
## Invenio is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## published by the Free Software Foundation; either version 2 of the
## License, or (at your option) a... |
garnertb/geonode | refs/heads/master | geonode/layers/forms.py | 7 | # -*- coding: utf-8 -*-
#########################################################################
#
# Copyright (C) 2012 OpenPlans
#
# 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 versio... |
nburn42/tensorflow | refs/heads/master | tensorflow/contrib/estimator/python/estimator/logit_fns.py | 20 | # 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... |
mrry/tensorflow | refs/heads/windows | tensorflow/python/ops/tensor_array_ops.py | 14 | # 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... |
a0c/odoo | refs/heads/master | addons/mail/wizard/invite.py | 28 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2012-Today OpenERP SA (<http://www.openerp.com>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms o... |
betoesquivel/fil2014 | refs/heads/master | build/django/tests/decorators/tests.py | 52 | from functools import wraps
from django.contrib.admin.views.decorators import staff_member_required
from django.contrib.auth.decorators import login_required, permission_required, user_passes_test
from django.http import HttpResponse, HttpRequest, HttpResponseNotAllowed
from django.middleware.clickjacking import XFram... |
DR08/mxnet | refs/heads/stable | example/rcnn/rcnn/processing/bbox_transform.py | 41 | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... |
zhangtuoparis13/Vintageous | refs/heads/master | ex/parser/scanner_command_unabbreviate.py | 9 | from .state import EOF
from .tokens import TokenEof
from .tokens_base import TOKEN_COMMAND_UNABBREVIATE
from .tokens_base import TokenOfCommand
from Vintageous import ex
@ex.command('unabbreviate', 'una')
class TokenUnabbreviate(TokenOfCommand):
def __init__(self, params, *args, **kwargs):
super().__init_... |
apanju/odoo | refs/heads/8.0 | addons/l10n_ec/__openerp__.py | 260 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2010-2012 Cristian Salamea Gnuthink Software Labs Cia. Ltda
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public Lic... |
teamfx/openjfx-9-dev-rt | refs/heads/master | modules/javafx.web/src/main/native/Tools/Scripts/webkitpy/common/find_files_unittest.py | 3 | # Copyright (C) 2011 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... |
ftomassetti/intellij-community | refs/heads/master | python/testData/codeInsight/controlflow/forif.py | 83 | for line in lines:
if line == '@':
head = 'zzz' |
szha/mxnet | refs/heads/master | python/mxnet/symbol/symbol.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 u... |
kshitijgoel007/ardupilot | refs/heads/master | mk/PX4/Tools/genmsg/test/test_genmsg_msg_loader.py | 215 | # Software License Agreement (BSD License)
#
# Copyright (c) 2009, Willow Garage, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must retain the above... |
da2ce7/cjdns | refs/heads/master | node_build/dependencies/libuv/build/gyp/test/toolsets/gyptest-toolsets.py | 262 | #!/usr/bin/env python
# Copyright (c) 2009 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Verifies that toolsets are correctly applied
"""
import os
import sys
import TestGyp
if sys.platform.startswith('linux'):
test = Tes... |
nmc-probe/utils | refs/heads/master | site-packages/nmc_probe/log.py | 1 | # Copyright (c) 2015 The New Mexico Consortium
#
# {{{NMC-LICENSE
#
# 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... |
brain-tec/l10n-switzerland | refs/heads/11.0 | l10n_ch_states/models/res_country.py | 2 | # Copyright 2015 Mathias Neef copadoMEDIA UG
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import fields, models
class CountryState(models.Model):
_inherit = 'res.country.state'
name = fields.Char(translate=True)
|
sugarmanz/ctypeslib | refs/heads/master | ctypeslib/test/winapi.py | 2 | import os
from ctypeslib.dynamic_module import include
from ctypes import *
_gen_basename = include("#include <windows.h>",
persist=False,
compilerflags=["-c", "-DWIN32_LEAN_AND_MEAN"])
|
ecosoft-odoo/odoo | refs/heads/8.0 | addons/account_payment/account_payment.py | 212 | # -*- 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... |
IllusionRom-deprecated/android_platform_external_chromium_org | refs/heads/illusion-4.4 | remoting/tools/build/remoting_localize.py | 48 | #!/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.
"""
localize.py -- Generates an output file from the given template replacing
variables and localizing strings.
The script uses Jinja2... |
michaelkuty/django-oscar | refs/heads/master | tests/unit/core/prices_tests.py | 48 | from decimal import Decimal as D
from itertools import product
from django.test import TestCase
from oscar.core.prices import Price
class TestPriceObject(TestCase):
def test_can_be_instantiated_with_tax_amount(self):
price = Price('USD', D('10.00'), tax=D('2.00'))
self.assertTrue(price.is_tax_kn... |
caoning1985/sqt | refs/heads/master | src/strategy_py/google/protobuf/empty_pb2.py | 44 | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/protobuf/empty.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.protobuf import reflec... |
alanjw/GreenOpenERP-Win-X86 | refs/heads/7.0 | openerp/addons/idea/__openerp__.py | 52 | # -*- 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... |
laperry1/android_external_chromium_org | refs/heads/cm-12.1 | native_client_sdk/src/tools/nacl_config.py | 46 | #!/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.
"""A helper script to print paths of NaCl binaries, includes, libs, etc.
It is similar in behavior to pkg-config or sdl-config.
"""
i... |
iqas/e2gui | refs/heads/master | lib/python/Components/Renderer/Pixmap.py | 125 | from Renderer import Renderer
from enigma import ePixmap
class Pixmap(Renderer):
def __init__(self):
Renderer.__init__(self)
GUI_WIDGET = ePixmap
def postWidgetCreate(self, instance):
self.changed((self.CHANGED_DEFAULT,))
def changed(self, what):
if what[0] != self.CHANGED_CLEAR:
if self.source and ha... |
tyb0807/angr | refs/heads/master | angr/procedures/libc/sprintf.py | 1 | import logging
from angr.procedures.stubs.format_parser import FormatParser
l = logging.getLogger("angr.procedures.libc.sprintf")
######################################
# sprintf
######################################
class sprintf(FormatParser):
ARGS_MISMATCH = True
#pylint:disable=arguments-differ
... |
ageron/tensorflow | refs/heads/master | tensorflow/python/eager/imperative_grad.py | 13 | # 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... |
postlund/home-assistant | refs/heads/dev | homeassistant/components/config/customize.py | 23 | """Provide configuration end points for Customize."""
from homeassistant.components.homeassistant import SERVICE_RELOAD_CORE_CONFIG
from homeassistant.config import DATA_CUSTOMIZE
from homeassistant.core import DOMAIN
import homeassistant.helpers.config_validation as cv
from . import EditKeyBasedConfigView
CONFIG_PAT... |
SamYaple/neutron | refs/heads/master | neutron/plugins/ml2/drivers/type_gre.py | 28 | # Copyright (c) 2013 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 ... |
stiartsly/pjsip | refs/heads/master | tests/pjsua/scripts-call/350_prack_b.py | 59 | # $Id: 350_prack_b.py 2392 2008-12-22 18:54:58Z bennylp $
#
from inc_cfg import *
# TCP call
test_param = TestParam(
"Caller requires PRACK",
[
InstanceParam("callee", "--null-audio --max-calls=1"),
InstanceParam("caller", "--null-audio --max-calls=1 --use-100rel")
]
)
|
skycucumber/Messaging-Gateway | refs/heads/master | webapp/venv/lib/python2.7/site-packages/sqlalchemy/util/_collections.py | 11 | # util/_collections.py
# Copyright (C) 2005-2014 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
"""Collection classes and helpers."""
from __future__ import absolute_import
i... |
wagnerand/olympia | refs/heads/master | src/olympia/signing/views.py | 1 | import functools
from django import forms
from django.utils.translation import ugettext
from rest_framework import status
from rest_framework.permissions import IsAuthenticated
from rest_framework.response import Response
from rest_framework.views import APIView
import olympia.core.logger
from olympia import amo
fr... |
noroutine/ansible | refs/heads/devel | lib/ansible/modules/network/netscaler/netscaler_lb_vserver.py | 101 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) 2017 Citrix Systems
# 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',
... |
openstack/barbican | refs/heads/master | barbican/model/migration/alembic_migrations/secrets_init_ops.py | 1 | # Copyright 2015 OpenStack Foundation
#
# 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 ... |
luniv/servo | refs/heads/master | components/script/dom/bindings/codegen/parser/tests/test_callback_interface.py | 134 | import WebIDL
def WebIDLTest(parser, harness):
parser.parse("""
callback interface TestCallbackInterface {
attribute boolean bool;
};
""")
results = parser.finish()
iface = results[0]
harness.ok(iface.isCallback(), "Interface should be a callback")
parser = parser.... |
yfried/ansible | refs/heads/devel | lib/ansible/modules/network/netvisor/pn_ospf.py | 32 | #!/usr/bin/python
""" PN-CLI vrouter-ospf-add/remove """
#
# 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... |
foss-transportationmodeling/rettina-server | refs/heads/master | flask/lib/python2.7/site-packages/distribute-0.6.24-py2.7.egg/setuptools/tests/test_build_ext.py | 423 | """build_ext tests
"""
import os, shutil, tempfile, unittest
from distutils.command.build_ext import build_ext as distutils_build_ext
from setuptools.command.build_ext import build_ext
from setuptools.dist import Distribution
class TestBuildExtTest(unittest.TestCase):
def test_get_ext_filename(self):
# se... |
ajaali/django | refs/heads/master | tests/admin_changelist/admin.py | 247 | from django.contrib import admin
from django.contrib.auth.admin import UserAdmin
from django.contrib.auth.models import User
from django.core.paginator import Paginator
from .models import Child, Event, Parent, Swallow
site = admin.AdminSite(name="admin")
site.register(User, UserAdmin)
class CustomPaginator(Pagina... |
dimkal/mne-python | refs/heads/master | examples/connectivity/plot_sensor_connectivity.py | 17 | """
===============================================
Compute all-to-all connectivity in sensor space
===============================================
Computes the Phase Lag Index (PLI) between all gradiometers and shows the
connectivity in 3D using the helmet geometry. The left visual stimulation data
are used which pro... |
INNUENDOCON/INNUca | refs/heads/master | src/SPAdes-3.11.0-Linux/share/spades/joblib2/func_inspect.py | 13 | """
My own variation on function-specific inspect-like features.
"""
# Author: Gael Varoquaux <gael dot varoquaux at normalesup dot org>
# Copyright (c) 2009 Gael Varoquaux
# License: BSD Style, 3 clauses.
from itertools import islice
import inspect
import warnings
import os
def get_func_code(func):
""" Attempt... |
flotre/sickbeard-vfvo | refs/heads/master | lib/simplejson/encoder.py | 91 | """Implementation of JSONEncoder
"""
import re
try:
from lib.simplejson._speedups import encode_basestring_ascii as c_encode_basestring_ascii
except ImportError:
c_encode_basestring_ascii = None
try:
from lib.simplejson._speedups import make_encoder as c_make_encoder
except ImportError:
c_make_encoder ... |
sbidoul/buildbot | refs/heads/master | master/buildbot/test/unit/test_reporter_http.py | 9 | # This file is part of Buildbot. Buildbot is free software: you can
# redistribute it and/or modify it under the terms of the GNU General Public
# License as published by the Free Software Foundation, version 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without eve... |
guorendong/iridium-browser-ubuntu | refs/heads/ubuntu/precise | third_party/pyelftools/elftools/construct/debug.py | 24 | """
Debugging utilities for constructs
"""
from __future__ import print_function
import sys
import traceback
import pdb
import inspect
from .core import Construct, Subconstruct
from .lib import HexString, Container, ListContainer
class Probe(Construct):
"""
A probe: dumps the context, stack frames, and stream... |
S0S-90/geoHelper | refs/heads/master | src/user_io.py | 2 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""This file contains the user interface."""
import ownfunctions
import geocache
import os
PATH = [r"E:/Garmin", r"F:/Garmin", r"G:/Garmin", r"H:/Garmin", r"/media/{}/GARMIN/garmin/".format(os.environ["USER"])]
CODING = "cp1252" # coding of cmd (cp1252 recommended)
EDITOR... |
coderbone/SickRage-alt | refs/heads/master | lib/hachoir_parser/archive/cab.py | 74 | """
Microsoft Cabinet (CAB) archive.
Author: Victor Stinner, Robert Xiao
Creation date: 31 january 2007
- Microsoft Cabinet SDK
http://msdn2.microsoft.com/en-us/library/ms974336.aspx
"""
from __future__ import absolute_import
from hachoir_parser import Parser
from hachoir_core.field import (FieldSet, Enum,
CStr... |
FrozenCow/msm | refs/heads/android-msm-hammerhead-3.4-lollipop-release-cdrom | 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... |
BIT-SYS/gem5-spm-module | refs/heads/master | configs/topologies/Mesh.py | 47 | # Copyright (c) 2010 Advanced Micro Devices, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met: redistributions of source code must retain the above copyright
# notice, this list of conditions... |
etmdb/facebookbot | refs/heads/master | messengerbot/views.py | 1 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
"""
Ethiopian Movie Database.
"""
__author__ = "EtMDB Developers (developers@etmdb.com)"
__date__ = "Date: 25/05/2017"
__version__ = "Version: 1.0"
__Copyright__ = "Copyright: @etmdb"
from django.http.response import HttpResponse
def index(request):
... |
HiroIshikawa/21playground | refs/heads/master | microblog/flask/lib/python3.5/site-packages/whoosh/fields.py | 30 | # Copyright 2007 Matt Chaput. 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 list of conditions and the... |
int19h/PTVS | refs/heads/master | Python/Product/Miniconda/Miniconda3-x64/Lib/site-packages/pycparser/lextab.py | 38 | # lextab.py. This file automatically created by PLY (version 3.10). Don't edit!
_tabversion = '3.10'
_lextokens = set(('VOID', 'LBRACKET', 'WCHAR_CONST', 'FLOAT_CONST', 'MINUS', 'RPAREN', 'LONG', 'PLUS', 'ELLIPSIS', 'GT', 'GOTO', 'ENUM', 'PERIOD', 'GE', 'INT_CONST_DEC', 'ARROW', '__INT128', 'HEX_FLOAT_CONST', 'DOU... |
cognitiveclass/edx-platform | refs/heads/master | common/lib/xmodule/xmodule/word_cloud_module.py | 42 | """Word cloud is ungraded xblock used by students to
generate and view word cloud.
On the client side we show:
If student does not yet answered - `num_inputs` numbers of text inputs.
If student have answered - words he entered and cloud.
"""
import json
import logging
from pkg_resources import resource_string
from x... |
squidsoup/snapcraft | refs/heads/master | integration_tests/test_store_close.py | 5 | # -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
#
# Copyright (C) 2016 Canonical Ltd
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3 as
# published by the Free Software Foundation.
#
# This program is distributed in the h... |
perrygeo/rio-plugin-example | refs/heads/master | tests/test_cli.py | 2 | import os.path
from click.testing import CliRunner
from metasay.scripts.cli import metasay
def test_cli_dtype():
filename = os.path.join(os.path.dirname(__file__), 'data/float.tif')
runner = CliRunner()
result = runner.invoke(metasay, [filename, '--item', 'dtype'])
assert result.exit_code == 0
a... |
appsembler/edx-platform | refs/heads/appsembler/tahoe/master | openedx/core/djangoapps/ccxcon/models.py | 64 | """
Models for the ccxcon
"""
from django.db import models
class CCXCon(models.Model):
"""
The definition of the CCXCon model.
This will store the url and the oauth key to access the REST APIs
on the CCX Connector.
"""
url = models.URLField(unique=True, db_index=True)
oauth_client_id = mo... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.