repo_name stringlengths 6 100 | path stringlengths 4 294 | copies stringlengths 1 5 | size stringlengths 4 6 | content stringlengths 606 896k | license stringclasses 15
values |
|---|---|---|---|---|---|
NullSoldier/django | tests/delete/models.py | 208 | 3759 | from __future__ import unicode_literals
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class R(models.Model):
is_default = models.BooleanField(default=False)
def __str__(self):
return "%s" % self.pk
def get_default_r():
r... | bsd-3-clause |
jspargo/AneMo | thermo/flask/lib/python2.7/site-packages/jinja2/testsuite/ext.py | 402 | 18086 | # -*- coding: utf-8 -*-
"""
jinja2.testsuite.ext
~~~~~~~~~~~~~~~~~~~~
Tests for the extensions.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
import re
import unittest
from jinja2.testsuite import JinjaTestCase
from jinja2 import Environment, DictLoader... | gpl-2.0 |
YingHsuan/termite_data_server | bin/train_malletN.py | 7 | 2566 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import argparse
import logging
import os
from modellers.MalletLDA import BuildMultipleLDAs
def TrainMalletN( corpus_path, model_path, token_regex, num_topics, num_iters, num_models, is_quiet, force_overwrite ):
logger = logging.getLogger( 'termite' )
logger.addHandler( ... | bsd-3-clause |
akikoskinen/androidtestxmlgenerator | instrumentationtotestresulttransformer.py | 1 | 1055 | # Copyright (c) 2011 Aki Koskinen
# Licensed under the MIT license. See LICENSE file for details.
from testresult import TestSuite, TestCase
TEST_COMPLETED_OK = 0
TEST_COMPLETED_ERROR = -1
TEST_COMPLETED_FAIL = -2
INTERESTING_CODES = (TEST_COMPLETED_OK, TEST_COMPLETED_ERROR, TEST_COMPLETED_FAIL)
def Transform(instru... | mit |
nazeehshoura/crawler | env/lib/python2.7/site-packages/django/contrib/sessions/backends/db.py | 113 | 2930 | import logging
from django.contrib.sessions.backends.base import SessionBase, CreateError
from django.core.exceptions import SuspiciousOperation
from django.db import IntegrityError, transaction, router
from django.utils import timezone
from django.utils.encoding import force_text
class SessionStore(SessionBase):
... | mit |
JBonsink/GSOC-2013 | core/real/jedie_python_ping/tests.py | 3 | 4326 | #!/usr/bin/env python
# coding: utf-8
"""
python-ping unittests
~~~~~~~~~~~~~~~~~~~~~
Note that ICMP messages can only be send from processes running as root.
So you must run this tests also as root, e.g.:
.../python-ping$ sudo python tests.py
:homepage: https://github.com/je... | gpl-3.0 |
mfherbst/spack | var/spack/repos/builtin/packages/kaldi/package.py | 2 | 4824 | ##############################################################################
# Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | lgpl-2.1 |
KhalidGit/flask | Work/Trivia - Module 5/env/Lib/site-packages/werkzeug/contrib/wrappers.py | 295 | 10331 | # -*- coding: utf-8 -*-
"""
werkzeug.contrib.wrappers
~~~~~~~~~~~~~~~~~~~~~~~~~
Extra wrappers or mixins contributed by the community. These wrappers can
be mixed in into request objects to add extra functionality.
Example::
from werkzeug.wrappers import Request as RequestBase
fr... | apache-2.0 |
jlegendary/pybrain | pybrain/structure/parametercontainer.py | 31 | 3092 | __author__ = 'Daan Wierstra and Tom Schaul'
from scipy import size, zeros, ndarray, array
from numpy.random import randn
from pybrain.structure.evolvables.evolvable import Evolvable
class ParameterContainer(Evolvable):
""" A common interface implemented by all classes which
contains data that can change dur... | bsd-3-clause |
galak/zephyr | scripts/coredump/parser/elf_parser.py | 6 | 2756 | #!/usr/bin/env python3
#
# Copyright (c) 2020 Intel Corporation
#
# SPDX-License-Identifier: Apache-2.0
import logging
import elftools
from elftools.elf.elffile import ELFFile
# ELF section flags
SHF_WRITE = 0x1
SHF_ALLOC = 0x2
SHF_EXEC = 0x4
SHF_WRITE_ALLOC = SHF_WRITE | SHF_ALLOC
SHF_ALLOC_EXEC = SHF_ALLOC | SHF_... | apache-2.0 |
varunarya10/ironic | ironic/db/migration.py | 2 | 1500 | # Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# 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 ... | apache-2.0 |
TathagataChakraborti/resource-conflicts | PLANROB-2015/seq-sat-lama/Python-2.5.2/Mac/Modules/ah/ahsupport.py | 39 | 1522 | # This script generates a Python interface for an Apple Macintosh Manager.
# It uses the "bgen" package to generate C code.
# The function specifications are generated by scanning the mamager's header file,
# using the "scantools" package (customized for this particular manager).
import string
# Declarations that cha... | mit |
RPI-OPENEDX/edx-platform | cms/envs/devstack.py | 8 | 4604 | """
Specific overrides to the base prod settings to make development easier.
"""
from os.path import abspath, dirname, join
from .aws import * # pylint: disable=wildcard-import, unused-wildcard-import
# Don't use S3 in devstack, fall back to filesystem
del DEFAULT_FILE_STORAGE
MEDIA_ROOT = "/edx/var/edxapp/uploads"... | agpl-3.0 |
vnsofthe/odoo-dev | addons/hr/res_users.py | 303 | 3192 | from openerp import api
from openerp.osv import fields, osv
class res_users(osv.Model):
""" Update of res.users class
- if adding groups to an user, check if base.group_user is in it
(member of 'Employee'), create an employee form linked to it.
"""
_name = 'res.users'
_inherit = ['res.... | agpl-3.0 |
danakj/chromium | mojo/public/tools/bindings/pylib/mojom/parse/translate.py | 3 | 9030 | # 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.
"""Translates parse tree to Mojom IR."""
import re
from . import ast
def _DuplicateName(values):
"""Returns the 'name' of the first entry in |values| w... | bsd-3-clause |
eneldoserrata/marcos_openerp | addons/base_gengo/__openerp__.py | 53 | 2146 | # -*- 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... | agpl-3.0 |
staranjeet/fjord | bin/peep-2.4.py | 27 | 33526 | #!/usr/bin/env python
"""peep ("prudently examine every package") verifies that packages conform to a
trusted, locally stored hash and only then installs them::
peep install -r requirements.txt
This makes your deployments verifiably repeatable without having to maintain a
local PyPI mirror or use a vendor lib. Ju... | bsd-3-clause |
OSSESAC/odoopubarquiluz | openerp/tools/config.py | 8 | 34763 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
# Copyright (C) 2010-2012 OpenERP s.a. (<http://openerp.com>).
#
# This program is free software: you ca... | agpl-3.0 |
wgapl/deepdive | examples/tutorial_example/step3-more-data/labeling/compute-recall.py | 15 | 1043 | #! /usr/bin/env python
'''
This script is used to compute the recall based on labels, if you
label all candidates that express marriage relation as "true",
and all others as "false". This is not the case for the tutorial
(where you should ignore candidates that do not express marriage), but
the case for ./spouse_examp... | apache-2.0 |
dezelin/virtualbox | src/VBox/GuestHost/OpenGL/spu_loader/glloader.py | 6 | 14723 | # Copyright (c) 2001, Stanford University
# All rights reserved.
#
# See the file LICENSE.txt for information on redistributing this software.
import sys
import apiutil
keys = apiutil.GetDispatchedFunctions(sys.argv[1]+"/APIspec.txt")
apiutil.CopyrightC()
print """
/* DO NOT EDIT - THIS FILE GENERATED BY THE gllo... | gpl-2.0 |
albertomurillo/ansible | test/units/modules/conftest.py | 47 | 1189 | # Copyright (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
import json
import pytest
from ansible.module_utils.six import string_types
from ansible.module_utils._text import to_bytes
from ansible.module_utils.common._collections_compat import Mut... | gpl-3.0 |
scotthartbti/samsung_kernel_d2att | tools/perf/scripts/python/futex-contention.py | 11261 | 1486 | # 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... | gpl-2.0 |
Yoric/servo | tests/wpt/update/__init__.py | 194 | 1110 | # 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/.
#!/usr/bin/env python
import os
import subprocess
import sys
from mozlog.structured import structuredlog
here = os.pat... | mpl-2.0 |
Serag8/Bachelor | google_appengine/lib/django-1.3/django/db/backends/postgresql/base.py | 241 | 7448 | """
PostgreSQL database backend for Django.
Requires psycopg 1: http://initd.org/projects/psycopg1
"""
import sys
from django.db import utils
from django.db.backends import *
from django.db.backends.signals import connection_created
from django.db.backends.postgresql.client import DatabaseClient
from django.db.backe... | mit |
flyingk/mavlink | pymavlink/generator/mavgen_wlua.py | 46 | 9787 | #!/usr/bin/env python
'''
parse a MAVLink protocol XML file and generate a Wireshark LUA dissector
Copyright Holger Steinhaus 2012
Released under GNU GPL version 3 or later
Instructions for use:
1. python -m pymavlink.generator.mavgen --lang=wlua mymavlink.xml -o ~/.wireshark/plugins/mymavlink.lua
2. convert binary ... | lgpl-3.0 |
DavidAndreev/indico | indico/web/forms/jinja_helpers.py | 1 | 4705 | # This file is part of Indico.
# Copyright (C) 2002 - 2016 European Organization for Nuclear Research (CERN).
#
# Indico 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 (a... | gpl-3.0 |
walteranderson/python-koans | python3/koans/about_classes.py | 68 | 4778 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from runner.koan import *
class AboutClasses(Koan):
class Dog:
"Dogs need regular walkies. Never, ever let them drive."
def test_instances_of_classes_can_be_created_adding_parentheses(self):
# NOTE: The .__name__ attribute will convert the class
... | mit |
nwjs/chromium.src | tools/metrics/histograms/update_use_counter_css.py | 10 | 2761 | #!/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.
"""Scans the Chromium source of UseCounter, formats the Feature enum for
histograms.xml and merges it. This script can also generate a ... | bsd-3-clause |
arraystream/fftoptionlib | tests/test_cosine_pricer.py | 1 | 3955 | import unittest
from fftoptionlib.cosine_pricer import (
cosin_vanilla_call,
interval_a_and_b,
)
from fftoptionlib.moment_generating_funs import (
cumulants_from_mgf,
general_log_moneyness_mgf,
)
from fftoptionlib.process_class import (
BlackScholes,
Heston,
VarianceGamma,
)
class TestCos... | bsd-3-clause |
amir-qayyum-khan/edx-platform | common/test/acceptance/pages/lms/dashboard.py | 9 | 7183 | # -*- coding: utf-8 -*-
"""
Student dashboard page.
"""
from bok_choy.page_object import PageObject
from common.test.acceptance.pages.lms import BASE_URL
class DashboardPage(PageObject):
"""
Student dashboard, where the student can view
courses she/he has registered for.
"""
def __init__(self, bro... | agpl-3.0 |
victormwenda/dbcrudgen-cpp | include/google-benchmark/mingw.py | 4 | 10346 | #! /usr/bin/env python
# encoding: utf-8
import argparse
import errno
import logging
import os
import platform
import re
import sys
import subprocess
import tempfile
try:
import winreg
except ImportError:
import _winreg as winreg
try:
import urllib.request as request
except ImportError:
import urllib ... | mit |
baigk/compass-core | compass/hdsdiscovery/vendors/ovswitch/plugins/mac.py | 2 | 2787 | # Copyright 2014 Huawei Technologies Co. Ltd
#
# 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... | apache-2.0 |
dora40323106/2014cpa_final_project | std/a40323142.py | 1 | 8795 | #@+leo-ver=5-thin
#@+node:lee.20141224110313.61: * @file example2.py
#@@language python
#@@tabwidth -4
import cherrypy
import random
from std.asciisymbol import asciiImage
#@+others
#@+node:lee.20141223114246.41: ** class Application
class Application(object):
#@+others
#@+node:lee.20141223114246.42: *3* def i... | gpl-3.0 |
niun/pyoscope | tests/display_wr.py | 2 | 1164 | #!/usr/bin/env python
#
# PyUSBtmc
# display_channel.py
#
# Copyright (c) 2011 Mike Hadmack
# Copyright (c) 2010 Matt Mets
# This code is distributed under the MIT license
#
# This script is just to test waverunner functionality as a module
#
import numpy
from matplotlib import pyplot
import sys
import os
sys.path.app... | mit |
socialpercon/anki-1 | oldanki/sync.py | 20 | 44635 | # -*- coding: utf-8 -*-
# Copyright: Damien Elmes <oldanki@ichi2.net>
# License: GNU GPL, version 3 or later; http://www.gnu.org/copyleft/gpl.html
"""\
Synchronisation
==============================
Support for keeping two decks synchronized. Both local syncing and syncing
over HTTP are supported.
Server implements ... | agpl-3.0 |
darkleons/lama | openerp/addons/base/tests/test_orm.py | 14 | 17431 | from collections import defaultdict
from openerp.tools import mute_logger
from openerp.tests import common
UID = common.ADMIN_USER_ID
DB = common.DB
class TestORM(common.TransactionCase):
""" test special behaviors of ORM CRUD functions
TODO: use real Exceptions types instead of Exception """
d... | agpl-3.0 |
40223137/2015cd_midterm | gear.py | 204 | 19237 | #@+leo-ver=5-thin
#@+node:office.20150407074720.1: * @file gear.py
#@@language python
#@@tabwidth -4
#@+<<declarations>>
#@+node:office.20150407074720.2: ** <<declarations>> (application)
#@@language python
import cherrypy
import os
import sys
# 這個程式要計算正齒輪的齒面寬, 資料庫連結希望使用 pybean 與 SQLite
# 導入 pybean 模組與所要使用的 Store 及 S... | gpl-3.0 |
SOKP/external_chromium_org | build/android/update_verification.py | 57 | 5660 | #!/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.
"""Runs semi-automated update testing on a non-rooted device."""
import logging
import optparse
import os
import shutil
import sys
im... | bsd-3-clause |
ironbox360/PyCV-time | opencv-official-samples/3.0.0/turing.py | 8 | 1684 | #!/usr/bin/env python
'''
Multiscale Turing Patterns generator
====================================
Inspired by http://www.jonathanmccabe.com/Cyclic_Symmetric_Multi-Scale_Turing_Patterns.pdf
'''
import numpy as np
import cv2
from common import draw_str
import getopt, sys
from itertools import count
help_message = '... | mit |
seocam/django | django/template/engine.py | 11 | 10337 | import warnings
from django.core.exceptions import ImproperlyConfigured
from django.utils import lru_cache, six
from django.utils.deprecation import RemovedInDjango20Warning
from django.utils.functional import cached_property
from django.utils.module_loading import import_string
from .base import Context, Lexer, Pars... | bsd-3-clause |
gcd0318/django | tests/gis_tests/geoapp/test_serializers.py | 245 | 3731 | from __future__ import unicode_literals
import json
from django.contrib.gis.geos import LinearRing, Point, Polygon
from django.core import serializers
from django.test import TestCase, mock, skipUnlessDBFeature
from django.utils import six
from .models import City, MultiFields, PennsylvaniaCity
@skipUnlessDBFeatur... | bsd-3-clause |
HydrelioxGitHub/home-assistant | homeassistant/components/hive/sensor.py | 2 | 2953 | """Support for the Hive sensors."""
from homeassistant.components.hive import DATA_HIVE, DOMAIN
from homeassistant.const import TEMP_CELSIUS
from homeassistant.helpers.entity import Entity
DEPENDENCIES = ['hive']
FRIENDLY_NAMES = {
'Hub_OnlineStatus': 'Hive Hub Status',
'Hive_OutsideTemperature': 'Outside Tem... | apache-2.0 |
Microsoft/PTVS | Python/Product/Miniconda/Miniconda3-x64/Lib/ctypes/macholib/dyld.py | 4 | 5065 | """
dyld emulation
"""
import os
from ctypes.macholib.framework import framework_info
from ctypes.macholib.dylib import dylib_info
from itertools import *
__all__ = [
'dyld_find', 'framework_find',
'framework_info', 'dylib_info',
]
# These are the defaults as per man dyld(1)
#
DEFAULT_FRAMEWORK_FALLBACK = [
... | apache-2.0 |
raycarnes/bank-statement-reconcile | account_bank_statement_period_from_line_date/model/__init__.py | 10 | 1258 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2015 Therp BV - http://therp.nl.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# cons... | agpl-3.0 |
FluxIX/pyShellScript | src/pyshell/environment.py | 1 | 7462 | from .tee_output_file import TeeOutputFile
class Environment( object ):
class CloneOptions( object ):
InheritVariables = "inherit_vars"
InheritStreams = "inherit_streams"
MakeParentLink = "parent_link"
def __init__( self, starting_directory = None, parent = None, starting_variables = N... | lgpl-3.0 |
hankcs/HanLP | plugins/hanlp_demo/hanlp_demo/zh/tf/train_ptb_dep_sa_bert.py | 2 | 1789 | # -*- coding:utf-8 -*-
# Author: hankcs
# Date: 2020-03-07 23:48
from hanlp.metrics.parsing import conllx_eval
from hanlp.datasets.parsing.ptb import PTB_SD330_DEV, PTB_SD330_TRAIN, PTB_SD330_TEST, PTB_TOKEN_MAPPING
from hanlp.components.parsers.biaffine_parser_tf import BiaffineTransformerDependencyParserTF, \
St... | apache-2.0 |
qxsch/QXSConsolas | examples/CopyThat/copyThat/sqlalchemy/engine/reflection.py | 27 | 28590 | # engine/reflection.py
# Copyright (C) 2005-2016 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
"""Provides an abstraction for obtaining database schema information.
Usage No... | gpl-3.0 |
jameslegg/boto | tests/integration/datapipeline/test_layer1.py | 136 | 5445 | #!/usr/bin/env python
# Copyright (c) 2012 Amazon.com, Inc. or its affiliates. All Rights Reserved
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without ... | mit |
pacoqueen/ginn | extra/install/ipython2/ipython-5.10.0/IPython/core/tests/test_magic_arguments.py | 33 | 4609 | #-----------------------------------------------------------------------------
# Copyright (C) 2010-2011, IPython Development Team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed with this software.
#---------------------------------------------... | gpl-2.0 |
Iepoev/vsc-mympirun | lib/vsc/mympirun/mpi/mpi.py | 1 | 41888 | #
# Copyright 2011-2016 Ghent University
#
# This file is part of vsc-mympirun,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
# with support of Ghent University (http://ugent.be/hpc),
# the Flemish Supercomputer Centre (VSC) (https://www.vscentrum.be),
# the Flemish Research Foundat... | gpl-2.0 |
marcsans/cnn-physics-perception | phy/lib/python2.7/site-packages/scipy/odr/models.py | 113 | 4659 | """ Collection of Model instances for use with the odrpack fitting package.
"""
from __future__ import division, print_function, absolute_import
import numpy as np
from scipy.odr.odrpack import Model
__all__ = ['Model', 'exponential', 'multilinear', 'unilinear', 'quadratic',
'polynomial']
def _lin_fcn(B,... | mit |
LernaProject/Lerna | users/admin.py | 3 | 5024 | from django import forms
from django.contrib import admin, auth
from django.db.models import F
from django.utils.translation import ugettext as _
from .models import User
class RightsFilter(admin.SimpleListFilter):
title = _('rights')
parameter_name = 'rights'
def lo... | gpl-2.0 |
ozgurgunes/django-manifest | tests/test_mixins.py | 1 | 3125 | # -*- coding: utf-8 -*-
""" Manifest View Mixin Tests
"""
from django.core import mail
from django.core.exceptions import ImproperlyConfigured
from django.urls import reverse
from manifest import messages
from manifest.views import EmailChangeView
from tests import data_dicts
from tests.base import ManifestTestCase
... | mit |
shakamunyi/beam | sdks/python/apache_beam/io/gcp/datastore/v1/util.py | 9 | 3662 | #
# 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... | apache-2.0 |
ogenstad/ansible | test/units/modules/packaging/os/test_apk.py | 137 | 1157 | from ansible.compat.tests import mock
from ansible.compat.tests import unittest
from ansible.modules.packaging.os import apk
class TestApkQueryLatest(unittest.TestCase):
def setUp(self):
self.module_names = [
'bash',
'g++',
]
@mock.patch('ansible.modules.packaging.os... | gpl-3.0 |
anirudhSK/chromium | tools/telemetry/telemetry/core/platform/profiler/v8_profiler.py | 26 | 1625 | # 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.
import re
import tempfile
from telemetry.core.platform import profiler
class V8Profiler(profiler.Profiler):
_V8_ARG = '--js-flags=--logfile=%s --prof --... | bsd-3-clause |
ngokevin/zamboni | mkt/stats/tests/test_views.py | 2 | 9848 | import json
import mock
import requests
from nose.tools import eq_, ok_
from rest_framework.reverse import reverse
from django.conf import settings
import amo
from mkt.purchase.models import Contribution
from mkt.api.tests.test_oauth import RestOAuth
from mkt.site.fixtures import fixture
from mkt.stats.views import... | bsd-3-clause |
hmen89/odoo | addons/report_webkit/__openerp__.py | 26 | 4030 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2010 Camptocamp SA (http://www.camptocamp.com)
# All Right Reserved
#
# Author : Nicolas Bessi (Camptocamp)
#
# WARNING: This program as such is intended to be used by professional
# programmers who ... | agpl-3.0 |
robovm/robovm-studio | python/lib/Lib/site-packages/django/contrib/contenttypes/management.py | 315 | 2458 | from django.contrib.contenttypes.models import ContentType
from django.db.models import get_apps, get_models, signals
from django.utils.encoding import smart_unicode
def update_contenttypes(app, created_models, verbosity=2, **kwargs):
"""
Creates content types for models in the given app, removing any model
... | apache-2.0 |
fredericlepied/ansible | lib/ansible/modules/identity/ipa/ipa_dnsrecord.py | 23 | 8076 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2017, Abhijeet Kasurde (akasurde@redhat.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... | gpl-3.0 |
jesramirez/odoo | addons/l10n_si/__openerp__.py | 430 | 1826 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright: (C) 2012 - Mentis d.o.o., Dravograd
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affe... | agpl-3.0 |
CloudComputingCourse/django-oidc | django_rp/wsgi.py | 4 | 1630 | """
WSGI config for MAGE project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICATION`` set... | apache-2.0 |
podemos-info/odoo | addons/account_voucher/__openerp__.py | 9 | 2927 | # -*- 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... | agpl-3.0 |
setsulla/owanimo | lib/puyo/util/log.py | 1 | 2199 | import os
import logging
import logging.config
import define
from system import FILE as f
from system import DIRECTORY as d
CONF_FILE = "logging.conf"
BASE_NAME = "Puyopuyo.Owanimo"
BASE_LEVEL = logging.DEBUG
BASE_FORMAT = '%(processName)s.%(name)s ( PID %(process)d ) : %(asctime)s - %(levelname)s - %(message)s'
c... | mit |
CelineBoudier/rapid-router | game/tests/test_scoreboard.py | 1 | 14455 | # -*- coding: utf-8 -*-
# Code for Life
#
# Copyright (C) 2016, Ocado Innovation Limited
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your o... | agpl-3.0 |
GDGLima/contentbox | third_party/unidecode/x1d7.py | 4 | 3903 | data = (
'', # 0x00
'', # 0x01
'', # 0x02
'', # 0x03
'', # 0x04
'', # 0x05
'', # 0x06
'', # 0x07
'', # 0x08
'', # 0x09
'', # 0x0a
'', # 0x0b
'', # 0x0c
'', # 0x0d
'', # 0x0e
'', # 0x0f
'', # 0x10
'', # 0x11
'', # 0x12
'', # 0x13
'', # 0... | apache-2.0 |
jjscarafia/odoo | addons/l10n_cn/__openerp__.py | 79 | 2115 | # -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2008-2008 凯源吕鑫 lvxin@gmail.com <basic chart data>
# 维智众源 oldrev@gmail.com <states data>
# Copyright (C) 2012-2012 南京盈通 ccdos@intoerp.com <small business chart>
#... | agpl-3.0 |
sam-tsai/django-old | tests/regressiontests/forms/localflavor/za.py | 33 | 1256 | tests = r"""
# ZAIDField #################################################################
ZAIDField validates that the date is a valid birthdate and that the value
has a valid checksum. It allows spaces and dashes, and returns a plain
string of digits.
>>> from django.contrib.localflavor.za.forms import ZAIDField
>>... | bsd-3-clause |
punalpatel/st2 | st2api/tests/integration/test_gunicorn_configs.py | 7 | 2972 | # Licensed to the StackStorm, Inc ('StackStorm') 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 use th... | apache-2.0 |
insiderr/insiderr-app | ios-patches/basemodules/twisted/web/test/test_error.py | 42 | 5415 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
HTTP errors.
"""
from twisted.trial import unittest
from twisted.web import error
class ErrorTestCase(unittest.TestCase):
"""
Tests for how L{Error} attributes are initialized.
"""
def test_noMessageValidStatus(self):
... | gpl-3.0 |
openhumanoids/oh-distro | software/models/common_components/multisense_sl/mit_modifications/multisense_sl.py | 1 | 1937 | import os
drc_base_path = os.getenv("DRC_BASE")
import sys
sys.path.append(os.path.join(drc_base_path, "software", "models",
"model_transformation"))
import mitUrdfUtils as mit
from jointNameMap import jointNameMap
from lxml import etree
import tempfile
from glob import glob
os.chdir(os.... | bsd-3-clause |
gkotton/neutron | neutron/db/servicetype_db.py | 17 | 3495 | # Copyright 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 req... | apache-2.0 |
icomms/rapidsms | lib/rapidsms/backends/spomc.py | 12 | 1101 | #!/usr/bin/env python
# vim: ai ts=4 sts=4 et sw=4
from rapidsms.message import Message
from rapidsms.connection import Connection
import backend
import spomsky
import re
class Backend(backend.Backend):
_title = "SPOMC"
def configure(self, host="localhost", port=8100, **kwargs):
self.client = spo... | lgpl-3.0 |
bratsche/Neutron-Drive | google_appengine/lib/webob_1_1_1/webob/exc.py | 21 | 33075 | """
HTTP Exception
--------------
This module processes Python exceptions that relate to HTTP exceptions
by defining a set of exceptions, all subclasses of HTTPException.
Each exception, in addition to being a Python exception that can be
raised and caught, is also a WSGI application and ``webob.Response``
object.
Thi... | bsd-3-clause |
zxsted/scipy | scipy/sparse/csgraph/tests/test_graph_laplacian.py | 79 | 4188 | # Author: Gael Varoquaux <gael.varoquaux@normalesup.org>
# Jake Vanderplas <vanderplas@astro.washington.edu>
# License: BSD
from __future__ import division, print_function, absolute_import
import numpy as np
from numpy.testing import (run_module_suite, assert_allclose,
assert_array_almost_equal, assert... | bsd-3-clause |
CenturylinkTechnology/ansible-modules-extras | web_infrastructure/jenkins_plugin.py | 11 | 25547 | #!/usr/bin/python
# encoding: utf-8
# (c) 2016, Jiri Tyr <jiri.tyr@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
#... | gpl-3.0 |
mancoast/CPythonPyc_test | fail/321_test_univnewlines.py | 70 | 3821 | # Tests universal newline support for both reading and parsing files.
import io
import _pyio as pyio
import unittest
import os
import sys
from test import support
if not hasattr(sys.stdin, 'newlines'):
raise unittest.SkipTest(
"This Python does not have universal newline support")
FATX = 'x' * (2**14)
DA... | gpl-3.0 |
criteo-forks/tcollector | tests.py | 7 | 10095 | #!/usr/bin/python
# This file is part of tcollector.
# Copyright (C) 2013 The tcollector Authors.
#
# This program 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 version 3 of the License, or (a... | gpl-3.0 |
technologiescollege/Blockly-rduino-communication | scripts_XP/Lib/site-packages/jinja2/nativetypes.py | 88 | 7308 | import sys
from ast import literal_eval
from itertools import islice, chain
from jinja2 import nodes
from jinja2._compat import text_type
from jinja2.compiler import CodeGenerator, has_safe_repr
from jinja2.environment import Environment, Template
from jinja2.utils import concat, escape
def native_concat(nodes):
... | gpl-3.0 |
BozhkoAlexander/mtasa-blue | vendor/google-breakpad/src/tools/gyp/test/msvs/missing_sources/gyptest-missing.py | 315 | 1413 | #!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Verifies that missing 'sources' files are treated as fatal errors when the
the generator flag 'msvs_error_on_missing_sources' is set.
""... | gpl-3.0 |
asmaps/nsupdate.info | nsupdate/nsupdate/wsgi.py | 1 | 1425 | """
WSGI config for nsupdate project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICATION``... | bsd-3-clause |
TylerB24890/flask | flask/wrappers.py | 142 | 7532 | # -*- coding: utf-8 -*-
"""
flask.wrappers
~~~~~~~~~~~~~~
Implements the WSGI wrappers (request and response).
:copyright: (c) 2015 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
from werkzeug.wrappers import Request as RequestBase, Response as ResponseBase
from werkzeug.exce... | bsd-3-clause |
kawamon/hue | desktop/core/ext-py/django-extensions-1.8.0/django_extensions/jobs/daily/cache_cleanup.py | 8 | 1993 | # -*- coding: utf-8 -*-
"""
Daily cleanup job.
Can be run as a cronjob to clean out old data from the database (only expired
sessions at the moment).
"""
from contextlib import contextmanager
import six
from django.utils import timezone
from django_extensions.management.jobs import DailyJob
class Job(DailyJob):
... | apache-2.0 |
kennethlove/django | tests/regressiontests/localflavor/de/tests.py | 14 | 1885 | from __future__ import unicode_literals
from django.contrib.localflavor.de.forms import (DEZipCodeField, DEStateSelect,
DEIdentityCardNumberField)
from django.test import SimpleTestCase
class DELocalFlavorTests(SimpleTestCase):
def test_DEStateSelect(self):
f = DEStateSelect()
out = '''<sele... | bsd-3-clause |
heyavery/lopenr | venv/lib/python2.7/site-packages/django/utils/deconstruct.py | 502 | 2047 | from importlib import import_module
from django.utils.version import get_docs_version
def deconstructible(*args, **kwargs):
"""
Class decorator that allow the decorated class to be serialized
by the migrations subsystem.
Accepts an optional kwarg `path` to specify the import path.
"""
path =... | mit |
gavioto/rethinkdb | external/v8_3.30.33.16/build/gyp/gyptest.py | 525 | 7988 | #!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
__doc__ = """
gyptest.py -- test runner for GYP tests.
"""
import os
import optparse
import subprocess
import sys
class CommandRunner:
"... | agpl-3.0 |
GustavoHennig/ansible | lib/ansible/modules/network/nxos/nxos_ping.py | 78 | 7715 | #!/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... | gpl-3.0 |
theflofly/tensorflow | tensorflow/python/training/saving/functional_saver.py | 6 | 5615 | # 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... | apache-2.0 |
kevgathuku/py-mysql2pgsql | mysql2pgsql/mysql2pgsql.py | 6 | 1636 | from __future__ import absolute_import
import codecs
from .lib import print_red
from .lib.mysql_reader import MysqlReader
from .lib.postgres_file_writer import PostgresFileWriter
from .lib.postgres_db_writer import PostgresDbWriter
from .lib.converter import Converter
from .lib.config import Config
from .lib.errors i... | mit |
youprofit/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/common/config/committervalidator_unittest.py | 120 | 2649 | # Copyright (C) 2010 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... | bsd-3-clause |
eunchong/build | third_party/buildbot_slave_8_4/buildslave/commands/bzr.py | 4 | 7393 | # 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... | bsd-3-clause |
chaosblog/pyload | module/plugins/hoster/DebridItaliaCom.py | 13 | 1689 | # -*- coding: utf-8 -*-
import re
from module.plugins.internal.MultiHoster import MultiHoster, create_getInfo
class DebridItaliaCom(MultiHoster):
__name__ = "DebridItaliaCom"
__type__ = "hoster"
__version__ = "0.19"
__status__ = "testing"
__pattern__ = r'https?://(?:www\.|s\d+\.)?debridi... | gpl-3.0 |
b1-systems/kiwi | kiwi/tasks/result_bundle.py | 1 | 7145 | # Copyright (c) 2015 SUSE Linux GmbH. All rights reserved.
#
# This file is part of kiwi.
#
# kiwi 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 la... | gpl-3.0 |
losnikitos/googleads-python-lib | examples/dfp/v201411/order_service/create_orders.py | 4 | 1772 | #!/usr/bin/python
#
# Copyright 2014 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | apache-2.0 |
wangyum/tensorflow | tensorflow/python/kernel_tests/as_string_op_test.py | 119 | 8652 | # 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... | apache-2.0 |
Arno-Nymous/pyload | module/plugins/captcha/ReCaptcha.py | 5 | 12283 | # -*- coding: utf-8 -*-
import os
import re
import urllib
import urlparse
from StringIO import StringIO
from ..internal.CaptchaService import CaptchaService
try:
no_pil = False
from PIL import Image
from PIL import ImageDraw
from PIL import ImageFont
except ImportError:
try:
import Image... | gpl-3.0 |
MSOpenTech/edx-platform | lms/djangoapps/django_comment_client/tests/test_middleware.py | 14 | 1824 | import django.http
from django.test import TestCase
import json
import lms.lib.comment_client
import django_comment_client.middleware as middleware
class AjaxExceptionTestCase(TestCase):
def setUp(self):
super(AjaxExceptionTestCase, self).setUp()
self.a = middleware.AjaxExceptionMiddleware()
... | agpl-3.0 |
pducks32/intergrala | python/sympy/sympy/mpmath/ctx_mp_python.py | 18 | 37192 | #from ctx_base import StandardBaseContext
from .libmp.backend import basestring, exec_
from .libmp import (MPZ, MPZ_ZERO, MPZ_ONE, int_types, repr_dps,
round_floor, round_ceiling, dps_to_prec, round_nearest, prec_to_dps,
ComplexResult, to_pickable, from_pickable, normalize,
from_int, from_float, from_str,... | mit |
loulich/Couchpotato | couchpotato/core/media/movie/providers/trailer/youtube_dl/extractor/ninegag.py | 110 | 2838 | from __future__ import unicode_literals
import re
import json
from .common import InfoExtractor
from ..utils import str_to_int
class NineGagIE(InfoExtractor):
IE_NAME = '9gag'
_VALID_URL = r'''(?x)^https?://(?:www\.)?9gag\.tv/
(?:
v/(?P<numid>[0-9]+)|
p/(?P<id>[a-zA-Z0-9]+)/(... | gpl-3.0 |
jeonghoonkang/BerePi | apps/lcd_berepi/16x2_LCD_RGB.py | 1 | 6266 | #!/usr/bin/python
#-*- coding: utf-8 -*-
# Author : Matt Hawkins
# : ipmstyle, https://github.com/ipmstyle
# : jeonghoonkang, https://github.com/jeonghoonkang
# The wiring for the LCD is as follows:
# 1 : GND
# 2 : 5V
# 3 : Contrast (0-5V)*
# 4 : RS (Register Select)
# 5 : R/W (Read Write) - GROUND... | bsd-2-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.