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
Elico-Corp/odoo_OCB
addons/fetchmail/res_config.py
46
4279
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from openerp.osv import fields, osv class fetchmail_config_settings(osv.osv_memory): """ This wizard can be inherited in conjunction with 'res.config.settings', in order to define fields that configure a fet...
agpl-3.0
dcroc16/skunk_works
google_appengine/lib/django-1.4/django/contrib/messages/storage/__init__.py
393
1183
from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.utils.importlib import import_module def get_storage(import_path): """ Imports the message storage class described by import_path, where import_path is the full Python path to the class. """ try: ...
mit
tghosgor/libarmmcu
gyp/pylib/gyp/__init__.py
19
22047
#!/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. import copy import gyp.input import optparse import os.path import re import shlex import sys import traceback from gyp.common import GypErr...
gpl-3.0
AMOboxTV/AMOBox.LegoBuild
plugin.video.salts/scrapers/izlemeyedeger_scraper.py
1
3982
""" SALTS XBMC Addon Copyright (C) 2014 tknorris This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. T...
gpl-2.0
atosatto/ansible
lib/ansible/parsing/vault/__init__.py
14
28241
# (c) 2014, James Tanner <tanner.jc@gmail.com> # (c) 2016, Adrian Likins <alikins@redhat.com> # (c) 2016, Toshio Kuratomi <tkuratomi@ansible.com> # # 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, eit...
gpl-3.0
runekaagaard/django-contrib-locking
django/contrib/auth/handlers/modwsgi.py
115
1344
from django.contrib import auth from django import db from django.utils.encoding import force_bytes def check_password(environ, username, password): """ Authenticates against Django's auth database mod_wsgi docs specify None, True, False as return value depending on whether the user exists and authen...
bsd-3-clause
jabesq/home-assistant
homeassistant/components/sensibo/climate.py
1
12181
"""Support for Sensibo wifi-enabled home thermostats.""" import asyncio import logging import aiohttp import async_timeout import voluptuous as vol import pysensibo from homeassistant.components.climate import PLATFORM_SCHEMA, ClimateDevice from homeassistant.components.climate.const import ( HVAC_MODE_HEAT_COOL...
apache-2.0
Shao-Feng/crosswalk-test-suite
cordova/cordova-webapp-android-tests/webapp/webapp_uninstall.py
18
2009
#!/usr/bin/env python # # Copyright (c) 2015 Intel Corporation. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of works must retain the original copyright notice, this # list of conditions and t...
bsd-3-clause
CongSmile/virt-test
virttest/libvirt_xml/nwfilter_protocols/esp.py
26
5664
""" esp protocl support class(es) http://libvirt.org/formatnwfilter.html#nwfelemsRulesProtoMisc """ from virttest.libvirt_xml import accessors, xcepts from virttest.libvirt_xml.nwfilter_protocols import base class Esp(base.TypedDeviceBase): """ Create new Esp xml instances Properties: attrs: l...
gpl-2.0
dbertha/odoo
openerp/report/report_sxw.py
91
27265
# -*- 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...
agpl-3.0
foyzur/gpdb
gpMgmt/bin/gppylib/test/behave_utils/utils.py
4
64021
#!/usr/bin/env python import re, os, signal, time, filecmp, stat, fileinput import yaml from gppylib.commands.gp import GpStart, chk_local_db_running from gppylib.commands.base import Command, ExecutionError, REMOTE from gppylib.db import dbconn from gppylib.gparray import GpArray, MODE_SYNCHRONIZED from gppylib.operat...
apache-2.0
sadanandb/pmt
src/pyasm/search/upgrade/sql_parser.py
6
10354
#!/usr/bin/python ########################################################### # # Copyright (c) 2005, Southpaw Technology # All Rights Reserved # # PROPRIETARY INFORMATION. This software is proprietary to # Southpaw Technology, and is not to be reproduced, transmitted, # or disclosed in any way wit...
epl-1.0
zaccoz/odoo
addons/account/__openerp__.py
190
7542
# -*- 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
rlr/fjord
vendor/packages/requests-2.7.0/requests/status_codes.py
926
3200
# -*- coding: utf-8 -*- from .structures import LookupDict _codes = { # Informational. 100: ('continue',), 101: ('switching_protocols',), 102: ('processing',), 103: ('checkpoint',), 122: ('uri_too_long', 'request_uri_too_long'), 200: ('ok', 'okay', 'all_ok', 'all_okay', 'all_good', '\\o/'...
bsd-3-clause
lreis2415/AutoFuzSlpPos
autofuzslppos/Util.py
2
2315
# -*- coding: utf-8 -*- """Utility Classes and Functions @author : Liangjun Zhu @changelog: - 15-07-31 lj - initial implementation - 17-07-21 lj - reorganize and incorporate with pygeoc """ from __future__ import absolute_import, unicode_literals import os from io import open import numpy from py...
gpl-2.0
foodszhang/kbengine
kbe/src/lib/python/Lib/http/cookies.py
63
20859
#### # Copyright 2000 by Timothy O'Malley <timo@alum.mit.edu> # # All Rights Reserved # # Permission to use, copy, modify, and distribute this software # and its documentation for any purpose and without fee is hereby # granted, provided that the above copyright notice appear in all # copies and that bot...
lgpl-3.0
nhazekam/cctools
chirp/src/bindings/python/chirp.binding.py
1
22645
## @package ChirpPython # # Python Chirp bindings. # # The objects and methods provided by this package correspond to the native # C API in @ref chirp_reli.h and chirp_swig_wrap.h # # The SWIG-based Python bindings provide a higher-level interface that # revolves around: # # - @ref Chirp.Client # - @ref Chirp.Stat imp...
gpl-2.0
mlperf/training_results_v0.6
Google/benchmarks/transformer/implementations/tpu-v3-1024-transformer/dataset_preproc/data_generators/dna_encoder.py
7
4020
# coding=utf-8 # Copyright 2018 The Tensor2Tensor Authors. # # 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...
apache-2.0
mlperf/training_results_v0.6
Google/benchmarks/transformer/implementations/tpu-v3-32-transformer/dataset_preproc/data_generators/translate_test.py
7
2761
# coding=utf-8 # Copyright 2018 The Tensor2Tensor Authors. # # 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...
apache-2.0
ahamilton55/ansible
lib/ansible/modules/network/fortios/fortios_ipv4_policy.py
28
11209
#!/usr/bin/python # # Ansible module to manage IPv4 policy objects in fortigate devices # (c) 2017, Benjamin Jolivot <bjolivot@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...
gpl-3.0
sv-dev1/odoo
addons/project_issue_sheet/__init__.py
442
1105
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). All Rights Reserved # $Id$ # # This program is free software: you can redistribute it and/or modify # ...
agpl-3.0
matbu/ansible-modules-extras
packaging/os/pkgin.py
11
11808
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (c) 2013 Shaun Zinck <shaun.zinck at gmail.com> # Copyright (c) 2015 Lawrence Leonard Gilbert <larry@L2G.to> # Copyright (c) 2016 Jasper Lievisse Adriaanse <j at jasper.la> # # Written by Shaun Zinck # Based on pacman module written by Afterburn <http://github.com/...
gpl-3.0
havard024/prego
venv/lib/python2.7/site-packages/unidecode/x09f.py
252
4509
data = ( 'Cu ', # 0x00 'Qu ', # 0x01 'Chao ', # 0x02 'Wa ', # 0x03 'Zhu ', # 0x04 'Zhi ', # 0x05 'Mang ', # 0x06 'Ao ', # 0x07 'Bie ', # 0x08 'Tuo ', # 0x09 'Bi ', # 0x0a 'Yuan ', # 0x0b 'Chao ', # 0x0c 'Tuo ', # 0x0d 'Ding ', # 0x0e 'Mi ', # 0x0f 'Nai ', # 0x10 'Ding ...
mit
broadinstitute/PyGithub
github/CommitStats.py
74
3093
# -*- coding: utf-8 -*- # ########################## Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques <vincent@vincent-jacques.net> # # Copyright 2012 Zearin <zearin@gonk.net> ...
gpl-3.0
sharma1nitish/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/style/checkers/png_unittest.py
124
5663
# Copyright (C) 2012 Balazs Ankes (bank@inf.u-szeged.hu) University of Szeged # # 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...
bsd-3-clause
koobonil/Boss2D
Boss2D/addon/tensorflow-1.2.1_for_boss/tensorflow/contrib/opt/python/training/lazy_adam_optimizer_test.py
104
6037
# 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...
mit
sajeeshcs/nested_projects_keystone
keystone/common/validation/validators.py
24
2735
# 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 the Li...
apache-2.0
yohanko88/gem5-DC
src/python/m5/SimObject.py
13
57534
# Copyright (c) 2012 ARM Limited # All rights reserved. # # The license below extends only to copyright in the software and shall # not be construed as granting a license to any other intellectual # property including but not limited to intellectual property relating # to a hardware implementation of the functionality ...
bsd-3-clause
coreynicholson/youtube-dl
youtube_dl/extractor/ted.py
8
11869
from __future__ import unicode_literals import json import re from .common import InfoExtractor from ..compat import compat_str from ..utils import ( int_or_none, try_get, ) class TEDIE(InfoExtractor): IE_NAME = 'ted' _VALID_URL = r'''(?x) (?P<proto>https?://) (?P<type>www|embed(?:-...
unlicense
bramalingam/bioformats
components/xsd-fu/xslt/xsltbasic.py
2
20326
#!/usr/bin/env python # encoding: utf-8 """ ... """ # # Copyright (C) 2009 - 2016 Open Microscopy Environment. 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 ...
gpl-2.0
kralf/morsel
python/lib/morsel/nodes/ode/solids/mesh.py
1
1092
from morsel.panda import * from morsel.nodes.node import Node from morsel.nodes.ode.object import Object from morsel.nodes.facade import Mesh as _Mesh from morsel.nodes.ode.solid import Solid #------------------------------------------------------------------------------- class Mesh(Solid): def __init__(self, **kar...
gpl-2.0
alexhilton/miscellaneous
python/pygrep.py
1
3334
#!/usr/bin/env python """A Python version of grep utility. Search one or more named input files against one ore more given patterns. Print the line containing the match, if there are any. """ from optparse import OptionParser; import re; import fileinput; import os.path; FILENAME = '\033[92m'; LINENO = '\033...
apache-2.0
tejal29/pants
src/python/pants/base/exceptions.py
1
1226
# coding=utf-8 # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) class TaskError(Exc...
apache-2.0
jmarcelino/pycom-micropython
tests/wipy/pin.py
65
4862
""" This test need a set of pins which can be set as inputs and have no external pull up or pull down connected. GP12 and GP17 must be connected together """ from machine import Pin import os mch = os.uname().machine if 'LaunchPad' in mch: pin_map = ['GP24', 'GP12', 'GP14', 'GP15', 'GP16', 'GP17', 'GP28', 'GP8'...
mit
etkirsch/legends-of-erukar
erukar/content/inventory/weapons/standard/Focus.py
1
1029
import numpy as np from erukar.system.engine.inventory import ArcaneWeapon class Focus(ArcaneWeapon): Probability = 1 BaseName = "Focus" EssentialPart = "devotion" AttackRange = 3 RangePenalty = 3 BaseWeight = 1.0 # Damage DamageRange = [2, 5] DamageType = 'force' DamageModifi...
agpl-3.0
leighpauls/k2cro4
native_client/build/directory_storage.py
3
2418
#!/usr/bin/python # Copyright (c) 2012 The Native Client Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Implement directory storage on top of file only storage. Given a storage object capable of storing and retrieving files, embel...
bsd-3-clause
agx/git-buildpackage
tests/component/deb/__init__.py
1
1200
# vim: set fileencoding=utf-8 : # # (C) 2012 Intel Corporation <markus.lehtonen@linux.intel.com> # (C) 2013 Guido Günther <agx@sigxcpu.org> # # 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 Foundat...
gpl-2.0
hradec/cortex
test/IECoreGL/BufferTest.py
12
2568
########################################################################## # # Copyright (c) 2012, Image Engine Design 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: # # * Redistribu...
bsd-3-clause
nke001/attention-lvcsr
libs/Theano/theano/gof/tests/test_graph.py
2
14643
from __future__ import print_function import pickle import unittest import numpy from itertools import count from theano import ( sparse, shared, tensor) from theano.gof.graph import ( Apply, as_string, clone, general_toposort, inputs, io_toposort, is_same_graph, Variable) from theano.gof.op impor...
mit
fishroot/qdeep
lib/qdeep/objects/script/__init__.py
1
6352
# -*- coding: utf-8 -*- __author__ = 'Patrick Michl' __email__ = 'patrick.michl@gmail.com' __license__ = 'GPLv3' import nemoa import qdeep.objects.common from PySide import QtGui, QtCore class Editor(qdeep.objects.common.Editor): objType = 'script' def createCentralWidget(self): self.textArea = Q...
gpl-3.0
ak2703/edx-platform
common/djangoapps/dark_lang/migrations/0001_initial.py
114
4801
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'DarkLangConfig' db.create_table('dark_lang_darklangconfig', ( ('id', self.gf('dj...
agpl-3.0
bobeirasa/virtualenvs
pyzabbixhue/lib/python2.7/site-packages/pip/commands/bundle.py
80
2156
import textwrap from pip.locations import build_prefix, src_prefix from pip.util import display_path, backup_dir from pip.log import logger from pip.exceptions import InstallationError from pip.commands.install import InstallCommand class BundleCommand(InstallCommand): """Create pybundles (archives containing mul...
mit
sileht/deb-openstack-nova
nova/tests/integrated/test_servers.py
5
16693
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2011 Justin Santa Barbara # 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.apach...
apache-2.0
defionscode/ansible
lib/ansible/modules/cloud/azure/azure_rm_storageaccount_facts.py
17
5827
#!/usr/bin/python # # Copyright (c) 2016 Matt Davis, <mdavis@ansible.com> # Chris Houseknecht, <house@redhat.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSI...
gpl-3.0
ramanajee/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/common/system/user.py
128
6864
# Copyright (c) 2009, 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 t...
bsd-3-clause
tedder/ansible-modules-core
cloud/digital_ocean/digital_ocean_sshkey.py
31
5129
#!/usr/bin/python # -*- coding: utf-8 -*- # 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. #...
gpl-3.0
assefay/inasafe
realtime/rt_exceptions.py
3
2599
# coding=utf-8 """ InaSAFE Disaster risk assessment tool developed by AusAid - **Realtime Exception Classes.** Custom exception classes for the IS application. Contact : ole.moller.nielsen@gmail.com .. note:: This program is free software; you can redistribute it and/or modify it under the terms of the GNU Gene...
gpl-3.0
Just-D/chromium-1
tools/cr/cr/base/arch.py
113
1544
# 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 module for the basic architectures supported by cr.""" import cr DEFAULT = cr.Config.From( CR_ENVSETUP_ARCH='{CR_ARCH}', ) class Arch(cr.Plugin,...
bsd-3-clause
AEgisTG/jsbsim
tests/TestModelLoading.py
3
7762
# TestModelLoading.py # # A regression test that checks if the model inclusion with the attribute # 'file=' is working. # # Copyright (c) 2014 Bertrand Coconnier # # 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 Softw...
lgpl-2.1
fabianfreyer/ansible
lib/ansible/plugins/lookup/redis_kv.py
69
2504
# (c) 2012, Jan-Piet Mens <jpmens(at)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) any later ver...
gpl-3.0
renhaoqi/gem5-stable
util/checkpoint_aggregator.py
64
6198
# Copyright (c) 2009 The Regents of The University of Michigan # Copyright (c) 2011 Advanced Micro Devices, Inc. # Copyright (c) 2013 Mark D. Hill and David A. Wood # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following con...
bsd-3-clause
google-research/language
language/conpono/reconstruct/model_builder.py
1
9078
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors. # # 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 ...
apache-2.0
AkihikoITOH/capybara
capybara/virtualenv/lib/python2.7/site-packages/werkzeug/exceptions.py
148
18577
# -*- coding: utf-8 -*- """ werkzeug.exceptions ~~~~~~~~~~~~~~~~~~~ This module implements a number of Python exceptions you can raise from within your views to trigger a standard non-200 response. Usage Example ------------- :: from werkzeug.wrappers import BaseRequest ...
mit
quantosauros/cppyProject
cppy/cybosPlus/cpRqRp/StockOrderCash.py
1
1827
# coding=utf-8 ''' Created on 2016. 8. 14. @author: Jay ''' from cppy.adaptor import CpRqRpClass import win32com.client @CpRqRpClass('CpTrade.CpTd0311') class StockOrderCash(object): ''' 장내주식/코스닥주식/ELW 주문(현금주문) 데이터를 요청하고 수신한다. ''' def __init__(self): self.instCpTdUtil = win32c...
mit
jakew02/sp3-linux
tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/EventClass.py
4653
3596
# EventClass.py # # This is a library defining some events types classes, which could # be used by other scripts to analyzing the perf samples. # # Currently there are just a few classes defined for examples, # PerfEvent is the base class for all perf event sample, PebsEvent # is a HW base Intel x86 PEBS event, and use...
gpl-2.0
CubicERP/geraldo
site/newsite/site-geraldo/gae_wiki/models.py
9
1607
from appengine_django.models import BaseModel from google.appengine.ext import db from django.core.urlresolvers import reverse from django.template.defaultfilters import slugify from django.core.cache import cache from django.template.loader import render_to_string from utils.custom_models import CustomModel import ...
lgpl-3.0
mancoast/CPythonPyc_test
fail/323_test_pty.py
2
11063
from test.support import verbose, run_unittest, import_module, reap_children #Skip these tests if either fcntl or termios is not available fcntl = import_module('fcntl') import_module('termios') import errno import pty import os import sys import select import signal import socket import unittest TEST_STRING_1 = b"I...
gpl-3.0
WillisXChen/django-oscar
oscar/lib/python2.7/site-packages/IPython/kernel/zmq/eventloops.py
4
8652
# encoding: utf-8 """Event loop integration for the ZeroMQ-based kernels. """ #----------------------------------------------------------------------------- # Copyright (C) 2011 The IPython Development Team # Distributed under the terms of the BSD License. The full license is in # the file COPYING, distributed a...
bsd-3-clause
ACS-Community/ACS
LGPL/CommonSoftware/acspycommon/src/Acspy/Util/NamingService.py
3
4456
# @(#) $Id: NamingService.py,v 1.1.1.1 2012/03/07 17:40:45 acaproni Exp $ # # ALMA - Atacama Large Millimiter Array # (c) Associated Universities, Inc. Washington DC, USA, 2001 # (c) European Southern Observatory, 2002 # Copyright by ESO (in the framework of the ALMA collaboration) # and Cosylab 2002, A...
lgpl-2.1
karllessard/tensorflow
tensorflow/python/data/experimental/ops/writers.py
16
4486
# Copyright 2018 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
programadorjc/django
tests/expressions/models.py
261
1925
""" Tests for F() query expression syntax. """ from __future__ import unicode_literals from django.db import models from django.utils.encoding import python_2_unicode_compatible @python_2_unicode_compatible class Employee(models.Model): firstname = models.CharField(max_length=50) lastname = models.CharField...
bsd-3-clause
rcarrillocruz/ansible
lib/ansible/modules/windows/win_dsc.py
22
3414
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2015, Trond Hindenes <trond@hindenes.com>, and others # # 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 versio...
gpl-3.0
MakeHer/edx-platform
lms/djangoapps/verify_student/tests/test_fake_software_secure.py
35
2724
""" Tests for the fake software secure response. """ from django.test import TestCase from mock import patch from student.tests.factories import UserFactory from util.testing import UrlResetMixin from lms.djangoapps.verify_student.models import SoftwareSecurePhotoVerification class SoftwareSecureFakeViewTest(UrlRes...
agpl-3.0
jieter/f-engrave
application/settings.py
1
9320
import os def cast_boolean(value): if type(value) is bool: return bool(value) elif len(value) > 1: return value == 'True' else: return bool(int(value)) def cast_string(value): value = str(value).strip() value = value.replace('\\n', '\n') # unquote string if value...
gpl-3.0
iamaziz/simpleai
simpleai/machine_learning/reinforcement_learning.py
5
6345
# -*- coding: utf-8 -*- from collections import defaultdict, Counter import math import random from simpleai.search.utils import argmax import pickle try: import matplotlib.pyplot as plt import numpy except: plt = None # lint:ok numpy = None # lint:ok def make_at_least_n_times(optimistic_reward, min...
mit
wd5/jangr
_django/utils/log.py
152
3494
import logging import sys from django.core import mail # Make sure a NullHandler is available # This was added in Python 2.7/3.2 try: from logging import NullHandler except ImportError: class NullHandler(logging.Handler): def emit(self, record): pass # Make sure that dictConfig is availabl...
bsd-3-clause
CumulusNetworks/ansible-modules-extras
database/postgresql/postgresql_lang.py
116
9789
#!/usr/bin/python # -*- coding: utf-8 -*- # # (c) 2014, Jens Depuydt <http://www.jensd.be> # # 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 L...
gpl-3.0
ic-labs/django-icekit
icekit/api/images/serializers.py
1
2783
from django.apps import apps from rest_framework import serializers from rest_framework.settings import api_settings from drf_queryfields import QueryFieldsMixin from icekit.api.base_serializers import WritableSerializerHelperMixin, \ WritableRelatedFieldSettings Image = apps.get_model('icekit_plugins_image.Ima...
mit
tayfun/django
django/contrib/gis/db/backends/oracle/introspection.py
539
1977
import sys import cx_Oracle from django.db.backends.oracle.introspection import DatabaseIntrospection from django.utils import six class OracleIntrospection(DatabaseIntrospection): # Associating any OBJECTVAR instances with GeometryField. Of course, # this won't work right on Oracle objects that aren't MDS...
bsd-3-clause
pianomania/scikit-learn
sklearn/externals/joblib/_memory_helpers.py
303
3605
try: # Available in Python 3 from tokenize import open as open_py_source except ImportError: # Copied from python3 tokenize from codecs import lookup, BOM_UTF8 import re from io import TextIOWrapper, open cookie_re = re.compile("coding[:=]\s*([-\w.]+)") def _get_normal_name(orig_enc): ...
bsd-3-clause
rmcauley/rainwave
rainwave/playlist_objects/artist.py
1
5684
from libs import db from libs import config from rainwave.playlist_objects.metadata import ( AssociatedMetadata, MetadataUpdateError, make_searchable_string, ) class Artist(AssociatedMetadata): select_by_name_query = "SELECT artist_id AS id, artist_name AS name FROM r4_artists WHERE lower(artist_name...
gpl-2.0
roryk/bipy
bipy/toolbox/cutadapt_tool.py
1
5658
"""This module provides an interface to cutadapt with a set of commonly used adapters for trimming """ from bipy.utils import flatten_options, append_stem, flatten, which import subprocess import os from bcbio.utils import safe_makedir, file_exists import sh import yaml import bcbio.provenance.do as do # adapter sequ...
mit
kadel/kedge
vendor/github.com/openshift/origin/cmd/cluster-capacity/go/src/github.com/kubernetes-incubator/cluster-capacity/vendor/k8s.io/kubernetes/examples/selenium/selenium-test.py
497
1089
#!/usr/bin/env python # Copyright 2015 The Kubernetes Authors. # # 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 appli...
apache-2.0
ledinhphuong/electron-builder
packages/dmg-builder/vendor/ds_store/buddy.py
17
14412
# -*- coding: utf-8 -*- import os import bisect import struct import binascii try: {}.iterkeys iterkeys = lambda x: x.iterkeys() except AttributeError: iterkeys = lambda x: x.keys() try: unicode except NameError: unicode = str class BuddyError(Exception): pass class Block(object): def __i...
mit
rbaindourov/v8-inspector
Source/chrome/tools/telemetry/telemetry/page/shared_page_state_unittest.py
5
3340
# 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. import tempfile import unittest from telemetry.core import wpr_modes from telemetry.internal import story_runner from telemetry.page import page from teleme...
bsd-3-clause
valentin-krasontovitsch/ansible
test/units/modules/network/f5/test_bigip_firewall_address_list.py
21
4606
# -*- coding: utf-8 -*- # # Copyright: (c) 2017, F5 Networks Inc. # 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 json import pytest import sys if sys.version_info < (2...
gpl-3.0
dgjnpr/py-junos-eznc
lib/jnpr/junos/factory/view.py
1
8729
import warnings from contextlib import contextmanager from copy import deepcopy from lxml import etree from jnpr.junos.factory.viewfields import ViewFields class View(object): """ View is the base-class that makes extracting values from XML data appear as objects with attributes. """ ITEM_NAME_...
apache-2.0
aferr/TimingCompartments
src/mem/slicc/ast/ChipComponentAccessAST.py
16
6784
# Copyright (c) 1999-2008 Mark D. Hill and David A. Wood # Copyright (c) 2009 The Hewlett-Packard Development Company # 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 co...
bsd-3-clause
etherkit/OpenBeacon2
client/win/venv/Lib/site-packages/pip/_vendor/html5lib/treebuilders/dom.py
74
8925
from __future__ import absolute_import, division, unicode_literals try: from collections.abc import MutableMapping except ImportError: # Python 2.7 from collections import MutableMapping from xml.dom import minidom, Node import weakref from . import base from .. import constants from ..constants import name...
gpl-3.0
kobejean/tensorflow
tensorflow/python/compat/compat_test.py
31
2573
# Copyright 2018 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
infoxchange/lettuce
tests/integration/lib/Django-1.3/django/contrib/gis/tests/test_spatialrefsys.py
154
6782
from django.db import connection from django.contrib.gis.gdal import GDAL_VERSION from django.contrib.gis.tests.utils import mysql, no_mysql, oracle, postgis, spatialite from django.utils import unittest test_srs = ({'srid' : 4326, 'auth_name' : ('EPSG', True), 'auth_srid' : 4326, ...
gpl-3.0
eckucukoglu/arm-linux-gnueabihf
lib/python2.7/encodings/iso2022_jp_3.py
816
1061
# # iso2022_jp_3.py: Python Unicode Codec for ISO2022_JP_3 # # Written by Hye-Shik Chang <perky@FreeBSD.org> # import _codecs_iso2022, codecs import _multibytecodec as mbc codec = _codecs_iso2022.getcodec('iso2022_jp_3') class Codec(codecs.Codec): encode = codec.encode decode = codec.decode class Incrementa...
gpl-2.0
TrampolineRTOS/GTL
build/libpm/python-makefiles/mingw32_on_macosx_gcc_tools.py
2
2932
#! /usr/bin/env python # -*- coding: UTF-8 -*- #----------------------------------------------------------------------------------------------------------------------* import sys, time, os, json import makefile, default_build_options import generic_galgas_makefile import tool_chain_installation_path import cross_comp...
gpl-2.0
2baOrNot2ba/AntPat
scripts/viewJonespat_dual.py
1
2897
#!/usr/bin/env python """A simple viewer for Jones patterns for dual-polarized representations. """ import argparse import numpy import matplotlib.pyplot as plt from antpat.reps.sphgridfun.pntsonsphere import ZenHemisphGrid from antpat.dualpolelem import DualPolElem, jones2gIXR, IXRJ2IXRM from antpat.reps.hamaker impo...
isc
sv1jsb/dwitter
auth/management/commands/createsuperuser.py
2
5401
""" Management utility to create superusers. """ import getpass import re import sys from optparse import make_option from auth.models import User from auth.management import get_default_username from django.core import exceptions from django.core.management.base import BaseCommand, CommandError from django.db import...
bsd-3-clause
sanjeevtripurari/hue
desktop/core/ext-py/Django-1.6.10/tests/model_regress/models.py
134
2195
# coding: utf-8 from django.db import models from django.utils.encoding import python_2_unicode_compatible CHOICES = ( (1, 'first'), (2, 'second'), ) @python_2_unicode_compatible class Article(models.Model): headline = models.CharField(max_length=100, default='Default headline') pub_date = models.Da...
apache-2.0
kelvindk/Video-Stabilization
boost_1_42_0/tools/build/v2/test/indirect_conditional.py
20
1389
#!/usr/bin/python # Copyright (C) Vladimir Prus 2006. # 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 BoostBuild t = BoostBuild.Tester() t.write("jamroot.jam", """ exe a1 : a1.cpp : <conditional>@a1-rule ...
gpl-3.0
MalloyPower/parsing-python
front-end/testsuite-python-lib/Python-2.7.2/Lib/hashlib.py
110
5013
# $Id$ # # Copyright (C) 2005 Gregory P. Smith (greg@krypto.org) # Licensed to PSF under a Contributor Agreement. # __doc__ = """hashlib module - A common interface to many hash functions. new(name, string='') - returns a new hash object implementing the given hash function; initializing th...
mit
metaml/nupic
external/linux32/lib/python2.6/site-packages/matplotlib/lines.py
69
48233
""" This module contains all the 2D line class which can draw with a variety of line styles, markers and colors. """ # TODO: expose cap and join style attrs from __future__ import division import numpy as np from numpy import ma from matplotlib import verbose import artist from artist import Artist from cbook import ...
agpl-3.0
chirilo/remo
vendor-local/lib/python/south/utils.py
32
1969
""" Generally helpful utility functions. """ def _ask_for_it_by_name(name): "Returns an object referenced by absolute path." bits = name.split(".") ## what if there is no absolute reference? if len(bits)>1: modulename = ".".join(bits[:-1]) else: modulename=bits[0] mod...
bsd-3-clause
cluckmaster/MissionPlanner
Lib/abc.py
88
7330
# Copyright 2007 Google, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. """Abstract Base Classes (ABCs) according to PEP 3119.""" import types from _weakrefset import WeakSet # Instance of old-style class class _C: pass _InstanceType = type(_C()) def abstractmethod(funcob...
gpl-3.0
sumanthha/kannadaflix
django/core/mail/__init__.py
80
4678
""" Tools for sending email. """ from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.utils.importlib import import_module # Imported for backwards compatibility, and for the sake # of a cleaner namespace. These symbols used to be in # django/core/mail.py before the int...
bsd-3-clause
bgmerrell/desmod
tests/test_timescale.py
1
1953
import pytest from desmod.timescale import parse_time, scale_time @pytest.mark.parametrize('test_input, expected', [ ('12 s', (12, 's')), ('12s', (12, 's')), ('+12s', (12, 's')), ('-12s', (-12, 's')), ('12.0 s', (12.0, 's')), ('12. s', (12.0, 's')), ('+12.0 s', (12.0, 's')), ('-12.0 s...
mit
bourguet/operator_precedence_parsing
operator_precedence.py
1
7999
#! /usr/bin/env python3 import sys import lexer from tree import Node, CompositeNode class SymbolDesc: def __init__(self, symbol, lprio, rprio, evaluator): self.symbol = symbol self.lprio = lprio self.rprio = rprio self.evaluator = evaluator self.value = None def __re...
bsd-2-clause
ansible/ansible-modules-core
packaging/os/rhn_register.py
25
15623
#!/usr/bin/python # (c) James Laska # # 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. # # A...
gpl-3.0
khkaminska/bokeh
bokeh/_legacy_charts/builder/tests/test_histogram_builder.py
6
4247
""" This is the Bokeh charts testing interface. """ #----------------------------------------------------------------------------- # Copyright (c) 2012 - 2014, Continuum Analytics, Inc. All rights reserved. # # Powered by the Bokeh Development Team. # # The full license is in the file LICENSE.txt, distributed with thi...
bsd-3-clause
tszym/ansible
lib/ansible/modules/network/avi/avi_applicationprofile.py
50
6539
#!/usr/bin/python # # Created on Aug 25, 2016 # @author: Gaurav Rastogi (grastogi@avinetworks.com) # Eric Anderson (eanderson@avinetworks.com) # module_check: supported # Avi Version: 17.1.1 # # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the te...
gpl-3.0
gianrubio/prometheus-operator
contrib/kube-prometheus/assets/grafana/statefulset.dashboard.py
2
15125
import sys import os.path sys.path.insert(0, os.path.dirname(__file__)) from _grafanalib import * dashboard = Dashboard( title='StatefulSet', version=1, graphTooltip=1, time=Time(start='now-6h'), templating=Templating(list=[ { 'allValue': '.*', 'current': {}, ...
apache-2.0
sda2b/youtube-dl
youtube_dl/extractor/eighttracks.py
121
5868
# coding: utf-8 from __future__ import unicode_literals import json import random from .common import InfoExtractor from ..compat import ( compat_str, ) from ..utils import ( ExtractorError, ) class EightTracksIE(InfoExtractor): IE_NAME = '8tracks' _VALID_URL = r'https?://8tracks\.com/(?P<user>[^/]+...
unlicense
bl4ckdu5t/registron
PyInstaller/lib/unittest2/test/test_loader.py
11
49503
import sys import types import unittest2 if sys.version_info[:2] == (2,3): from sets import Set as set from sets import ImmutableSet as frozenset class Test_TestLoader(unittest2.TestCase): ### Tests for TestLoader.loadTestsFromTestCase ################################################################...
mit