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
sarthakmeh03/django
django/conf/locale/__init__.py
100
12442
# -*- encoding: utf-8 -*- from __future__ import unicode_literals """ LANG_INFO is a dictionary structure to provide meta information about languages. About name_local: capitalize it as if your language name was appearing inside a sentence in your language. The 'fallback' key can be used to specify a special fallback...
bsd-3-clause
rwl/muntjac
muntjac/data/validators/composite_validator.py
1
6530
# @MUNTJAC_COPYRIGHT@ # @MUNTJAC_LICENSE@ """Allows you to chain (compose) many validators to validate one field.""" from muntjac.data.validators.abstract_validator import AbstractValidator from muntjac.data.validator import InvalidValueException class CompositeValidator(AbstractValidator): """The C{CompositeVa...
apache-2.0
tutumcloud/django-registration
registration/backends/default/urls.py
57
2265
""" URLconf for registration and activation, using django-registration's default backend. If the default behavior of these views is acceptable to you, simply use a line like this in your root URLconf to set up the default URLs for registration:: (r'^accounts/', include('registration.backends.default.urls')), Thi...
bsd-3-clause
pjryan126/solid-start-careers
store/api/glassdoor/venv/lib/python2.7/site-packages/pip/_vendor/colorama/win32.py
196
4911
# Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file. # from winbase.h STDOUT = -11 STDERR = -12 import ctypes from ctypes import LibraryLoader try: windll = LibraryLoader(ctypes.WinDLL) from ctypes import wintypes except (AttributeError, ImportError): windll = None SetConsoleTex...
gpl-2.0
tedlaz/pyted
ted17/ted17/dec.py
1
3802
# -*- coding: utf-8 -*- import decimal from collections import OrderedDict import textwrap def isNum(val): # is val number or not ? """Check if val is number or not :param val: value to check :return: Boolean """ try: float(val) except ValueError: return False ...
gpl-3.0
morreene/tradenews
venv/Lib/site-packages/sqlalchemy/orm/collections.py
34
53549
# orm/collections.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 """Support for collections of mapped entities. The collections package supplies ...
bsd-3-clause
djdduty/mongo
marrow/mongo/core/field.py
1
2849
# encoding: utf-8 from inspect import isroutine from marrow.schema import Attribute from marrow.schema.transform import BaseTransform from marrow.schema.validate import Validator from ..query import Queryable from ..util import adjust_attribute_sequence from ..util.compat import py3 @adjust_attribute_sequence(1000,...
mit
shiblon/pytour
static/js/pypyjs/pypy-nojit.js-0.3.1/lib/modules/test/test_deque.py
8
25614
from collections import deque import unittest from test import test_support, seq_tests import gc import weakref import copy import cPickle as pickle import random import struct BIG = 100000 def fail(): raise SyntaxError yield 1 class BadCmp: def __eq__(self, other): raise RuntimeError class Muta...
apache-2.0
TeutoNet-Netzdienste/ansible
v2/ansible/plugins/action/group_by.py
16
1313
# Copyright 2012, Jeroen Hoekx <jeroen@hoekx.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 License, or # (at your option) any later ve...
gpl-3.0
googleapis/python-webrisk
tests/unit/gapic/webrisk_v1/test_web_risk_service.py
1
67484
# -*- coding: utf-8 -*- # Copyright 2020 Google LLC # # 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...
apache-2.0
ydirson/serna-free
serna/docutils/migration/check-text.py
5
2973
## ## Copyright(c) 2009 Syntext, Inc. All Rights Reserved. ## Contact: info@syntext.com, http://www.syntext.com ## ## This file is part of Syntext Serna XML Editor. ## ## COMMERCIAL USAGE ## Licensees holding valid Syntext Serna commercial licenses may use this file ## in accordance with the Syntext Serna Commercial...
gpl-3.0
kcompher/topik
topik/tokenizers.py
1
12129
from __future__ import absolute_import, print_function import logging import itertools import re from textblob import TextBlob import gensim from gensim.parsing.preprocessing import STOPWORDS from topik.utils import collocations, entities # imports used only for doctests from topik.tests import test_data_path from ...
bsd-3-clause
restran/api-gateway-dashboard
accounts/backends.py
1
1096
# !/usr/bin/env python # -*- coding: utf-8 -*- # created by restran on 2016/1/2 from __future__ import unicode_literals, absolute_import from .models import SiteUser class EmailAuthBackend(object): """ Email Authentication Backend Allows a user to sign in using an email/password pair rather than ...
mit
caphrim007/ansible
test/units/modules/network/slxos/test_slxos_linkagg.py
23
4950
# # (c) 2018 Extreme Networks Inc. # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ans...
gpl-3.0
tksarah/ansible-modules-core
system/group.py
81
13394
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2012, Stephen Fromm <sfromm@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 Lice...
gpl-3.0
dezelin/virtualbox
src/VBox/HostServices/SharedOpenGL/unpacker/unpack.py
11
10222
# Copyright (c) 2001, Stanford University # All rights reserved. # # See the file LICENSE.txt for information on redistributing this software. import sys import apiutil apiutil.CopyrightC() print """/* DO NOT EDIT! THIS CODE IS AUTOGENERATED BY unpack.py */ #include "unpacker.h" #include "cr_opcodes.h" #include ...
gpl-2.0
sudheesh001/oh-mainline
vendor/packages/gdata/tests/gdata_tests/projecthosting/data_test.py
41
6526
#!/usr/bin/env python # # Copyright (C) 2009 Google Inc. # # 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 ...
agpl-3.0
handroissuazo/tensorflow
tensorflow/python/kernel_tests/losses_test.py
21
54130
# 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
18padx08/PPTex
PPTexEnv_x86_64/lib/python2.7/site-packages/numpy/compat/py3k.py
35
2009
""" Python 3 compatibility tools. """ from __future__ import division, absolute_import, print_function __all__ = ['bytes', 'asbytes', 'isfileobj', 'getexception', 'strchar', 'unicode', 'asunicode', 'asbytes_nested', 'asunicode_nested', 'asstr', 'open_latin1', 'long', 'basestring', 'sixu', ...
mit
victorkeophila/alien4cloud-cloudify3-provider
src/test/resources/outputs/blueprints/amazon/lamp/plugins/custom_wf_plugin/plugin/workflows.py
1
36447
from cloudify.decorators import workflow from cloudify.workflows import ctx from cloudify.workflows import tasks as workflow_tasks from utils import set_state_task from utils import operation_task from utils import link_tasks from utils import CustomContext from utils import generate_native_node_workflows from utils im...
apache-2.0
bitcity/django
tests/many_to_one_null/tests.py
142
6484
from __future__ import unicode_literals from django.test import TestCase from .models import Article, Car, Driver, Reporter class ManyToOneNullTests(TestCase): def setUp(self): # Create a Reporter. self.r = Reporter(name='John Smith') self.r.save() # Create an Article. se...
bsd-3-clause
bosstb/HaberPush
youtube_dl/extractor/sprout.py
59
1923
# coding: utf-8 from __future__ import unicode_literals from .adobepass import AdobePassIE from ..utils import ( extract_attributes, update_url_query, smuggle_url, ) class SproutIE(AdobePassIE): _VALID_URL = r'https?://(?:www\.)?sproutonline\.com/watch/(?P<id>[^/?#]+)' _TEST = { 'url': 'h...
mit
MicroMagnum/MicroMagnum
src/magnum/micromagnetics/stephandler/fancy_screen_log.py
1
1782
# Copyright 2012, 2013 by the Micromagnum authors. # # This file is part of MicroMagnum. # # MicroMagnum 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) a...
gpl-3.0
colinligertwood/odoo
addons/crm/validate_email.py
462
5978
# RFC 2822 - style email validation for Python # (c) 2012 Syrus Akbary <me@syrusakbary.com> # Extended from (c) 2011 Noel Bush <noel@aitools.org> # for support of mx and user check # This code is made available to you under the GNU LGPL v3. # # This module provides a single method, valid_email_address(), # which return...
agpl-3.0
loco-odoo/localizacion_co
openerp/addons/l10n_in_hr_payroll/report/report_hr_yearly_salary_detail.py
374
6855
#-*- coding:utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2011 OpenERP SA (<http://openerp.com>). All Rights Reserved # # This program is free software: you can redistribute it and/or modify # it under th...
agpl-3.0
tectronics/arsenalsuite
cpp/lib/PyQt4/examples/mainwindows/mdi/mdi.py
14
16495
#!/usr/bin/env python ############################################################################# ## ## Copyright (C) 2010 Riverbank Computing Limited. ## Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ## All rights reserved. ## ## This file is part of the examples of PyQt. ## ## $QT_BEGIN_LICENS...
gpl-2.0
VinceZK/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/tool/steps/update.py
124
2342
# 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 th...
bsd-3-clause
bbockelm/htcondor
src/condor_contrib/aviary/test/setattr.py
5
2536
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2009-2011 Red Hat, Inc. # # 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 # # Unle...
apache-2.0
TangXT/GreatCatMOOC
lms/djangoapps/courseware/migrations/0006_create_student_module_history.py
80
8157
# -*- 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 'StudentModuleHistory' db.create_table('courseware_studentmodulehistory', ( ('id'...
agpl-3.0
bitcoinclassic/bitcoinclassic
qa/rpc-tests/httpbasics.py
4
4809
#!/usr/bin/env python2 # Copyright (c) 2014-2015 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # # Test rpc http basics # from test_framework.test_framework import BitcoinTestFramework from test_fram...
mit
Mj258/weiboapi
srapyDemo/envs/Lib/site-packages/pip/_vendor/_markerlib/markers.py
1769
3979
# -*- coding: utf-8 -*- """Interpret PEP 345 environment markers. EXPR [in|==|!=|not in] EXPR [or|and] ... where EXPR belongs to any of those: python_version = '%s.%s' % (sys.version_info[0], sys.version_info[1]) python_full_version = sys.version.split()[0] os.name = os.name sys.platform = sys.platfo...
mit
yland/coala
tests/parsing/CliParsingTest.py
18
2415
import argparse import unittest from coalib.parsing.CliParsing import parse_cli, check_conflicts class CliParserTest(unittest.TestCase): def setUp(self): self.test_arg_parser = argparse.ArgumentParser() self.test_arg_parser.add_argument('-t', nargs='+', dest='test') self.test_arg_parser....
agpl-3.0
microsoft/ANCE
data/process_fn.py
1
5115
import torch def pad_ids(input_ids, attention_mask, token_type_ids, max_length, pad_token, mask_padding_with_zero, pad_token_segment_id, pad_on_left=False): padding_length = max_length - len(input_ids) if pad_on_left: input_ids = ([pad_token] * padding_length) + input_ids attention_mask...
mit
bckwltn/SickRage
sickbeard/webserve.py
1
202304
# Author: Nic Wolfe <nic@wolfeden.ca> # URL: http://code.google.com/p/sickbeard/ # # This file is part of SickRage. # # SickRage 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,...
gpl-3.0
cjhak/b2share
invenio/modules/workflows/tasks/logic_tasks.py
15
10445
# -*- coding: utf-8 -*- # This file is part of Invenio. # Copyright (C) 2013, 2014 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) any l...
gpl-2.0
rohithpr/py-web-search
pws/google.py
1
7518
#coding=utf-8 from bs4 import BeautifulSoup from time import sleep as wait import re import requests try: from html.parser import HTMLParser except ImportError: from HTMLParser import HTMLParser ################################################## # Copied code #################################################...
mit
40223245/w16b_test
static/Brython3.1.1-20150328-091302/Lib/xml/etree/ElementPath.py
785
9477
# # ElementTree # $Id: ElementPath.py 3375 2008-02-13 08:05:08Z fredrik $ # # limited xpath support for element trees # # history: # 2003-05-23 fl created # 2003-05-28 fl added support for // etc # 2003-08-27 fl fixed parsing of periods in element names # 2007-09-10 fl new selection engine # 2007-09-12 fl fix...
gpl-3.0
unlimitedcoin-dev/unlimited-core
qa/rpc-tests/listtransactions.py
1
10129
#!/usr/bin/env python2 # Copyright (c) 2014-2015 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # Exercise the listtransactions API from test_framework.test_framework import BitcoinTestFramework from ...
mit
SAP/pyhdb
tests/test_dummy_sql.py
8
3703
# Copyright 2014, 2015 SAP SE. # # 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, #...
apache-2.0
trankmichael/scipy
scipy/linalg/matfuncs.py
46
19913
# # Author: Travis Oliphant, March 2002 # from __future__ import division, print_function, absolute_import __all__ = ['expm','expm2','expm3','cosm','sinm','tanm','coshm','sinhm', 'tanhm','logm','funm','signm','sqrtm', 'expm_frechet', 'expm_cond', 'fractional_matrix_power'] from numpy import (In...
bsd-3-clause
richm/designate
designate/cmd/api.py
1
1217
# Copyright 2013 Hewlett-Packard Development Company, L.P. # # Author: Kiall Mac Innes <kiall@hp.com> # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/L...
apache-2.0
mambocab/python-driver
tests/integration/cqlengine/model/test_equality_operations.py
3
2190
# Copyright DataStax, Inc. # # 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, softwa...
apache-2.0
jwlawson/tensorflow
tensorflow/tools/ci_build/update_version.py
16
12706
#!/usr/bin/python # 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 r...
apache-2.0
stefanv/aandete
app/lib/webhelpers/pylonslib/minify.py
3
7510
#!/usr/bin/env python # -*- coding: utf-8 -*- # vim: sw=4 ts=4 fenc=utf-8 """Minification helpers. This module provides enhanced versions of the ``javascript_link`` and ``stylesheet_link`` helpers in ``webhelpers.html.tags``. These versions add three additional arguments: * **minified**: If true, reduce the file siz...
bsd-3-clause
jumpstarter-io/neutron
neutron/agent/linux/ovs_lib.py
5
22667
# Copyright 2011 VMware, Inc. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ...
apache-2.0
chadrosenquist/logging-test-case
examples/assertnologs_example1.py
1
2548
""" MIT License Copyright (c) 2018 Chad Rosenquist 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 limitation the rights to use, copy, modify, merge, publis...
mit
josrolgil/exjobbCalvin
calvin/actorstore/systemactors/text/Format.py
3
1940
# -*- coding: utf-8 -*- # Copyright (c) 2015 Ericsson AB # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable ...
apache-2.0
mhahn/stacker
stacker/commands/stacker/diff.py
1
1480
""" Diffs the config against the currently running CloudFormation stacks Sometimes small changes can have big impacts. Run "stacker diff" before "stacker build" to detect bad things(tm) from happening in advance! """ from .base import BaseCommand from ...actions import diff class Diff(BaseCommand): name = "dif...
bsd-2-clause
willl4/Final-Project
ggame/pygamedeps.py
228
12266
def module_exists(module_name): try: __import__(module_name) except ImportError: return False else: return True # PYTHON 3 and PYGAME DEPENDENCIES if module_exists('pygame'): import pygame class _body(object): def __init__(self): self.events = {} def appe...
mit
conan-io/conan
conans/client/remover.py
1
11380
import os from conans.client.cache.remote_registry import Remote from conans.errors import ConanException, PackageNotFoundException, RecipeNotFoundException from conans.errors import NotFoundException from conans.model.ref import ConanFileReference, PackageReference, check_valid_ref from conans.paths import SYSTEM_REQ...
mit
valkyriesavage/gasustainability
django/conf/locale/pl/formats.py
238
1288
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'j E Y' TIME_FORMAT = 'H:i:s' DATETIME_FORMAT = 'j E Y H:i:s' YEAR_MONTH_F...
bsd-3-clause
mccheung/kbengine
kbe/res/scripts/common/Lib/test/test_code.py
94
3626
"""This module includes tests of the code object representation. >>> def f(x): ... def g(y): ... return x + y ... return g ... >>> dump(f.__code__) name: f argcount: 1 kwonlyargcount: 0 names: () varnames: ('x', 'g') cellvars: ('x',) freevars: () nlocals: 2 flags: 3 consts: ('None', '<code object g>',...
lgpl-3.0
crosswalk-project/chromium-crosswalk-efl
third_party/google_appengine_cloudstorage/cloudstorage/errors.py
102
3860
# Copyright 2012 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
bsd-3-clause
Jovennan/curso-rails
node_modules/node-gyp/gyp/pylib/gyp/generator/android.py
960
45344
# 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. # Notes: # # This generates makefiles suitable for inclusion into the Android build system # via an Android.mk file. It is based on make.py, the standard makefile ...
mit
songmonit/CTTMSONLINE
addons/decimal_precision/tests/test_qweb_float.py
103
2000
# -*- coding: utf-8 -*- from openerp.tests import common class TestFloatExport(common.TransactionCase): def setUp(self): super(TestFloatExport, self).setUp() self.Model = self.registry('decimal.precision.test') def get_converter(self, name): converter = self.registry('ir.qweb.field.flo...
agpl-3.0
camptocamp/ngo-addons-backport
addons/membership/wizard/__init__.py
432
1071
# -*- 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
fitermay/intellij-community
python/helpers/profiler/thriftpy/protocol/multiplex.py
33
1145
# -*- coding: utf-8 -*- from thriftpy.thrift import TMultiplexedProcessor, TMessageType class TMultiplexedProtocol(object): """Multiplex the protocol by prepend service name to api for every api call. Can be used together with all original protocols. """ def __init__(self, proto, service_name): ...
apache-2.0
pedropena/iteexe
exe/engine/lom/test/lomclassification.py
11
6720
#!/usr/bin/env python # -*- coding: utf-8 -*- import unittest from exe.engine.lom.lomclassification import Classification class TestLOM(unittest.TestCase): def setUp(self): pass def test_lomClassificationAccesibilidad(self): results = [{u'10': u'TIPO DE CONTADOR DE EJECUCI\xd3N', u'1': u'DEC...
gpl-2.0
elsonrodriguez/madhatter
cobbler/modules/manage_isc.py
4
6674
""" This is some of the code behind 'cobbler sync'. Copyright 2006-2009, Red Hat, Inc Michael DeHaan <mdehaan@redhat.com> John Eckersberg <jeckersb@redhat.com> 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 Fo...
gpl-2.0
openstack/mistral-dashboard
mistraldashboard/workbooks/views.py
1
4166
# Copyright 2014 - StackStorm, Inc. # # 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 writin...
apache-2.0
TeamEOS/external_chromium_org
build/android/pylib/base/base_test_runner.py
8
7557
# Copyright (c) 2012 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. """Base class for running tests on a single device.""" import logging import time from pylib import ports from pylib.chrome_test_server_spawner import ...
bsd-3-clause
darkwing/kuma
vendor/packages/translate/lang/test_fa.py
33
2840
#!/usr/bin/env python # -*- coding: utf-8 -*- from translate.lang import factory def test_punctranslate(): """Tests that we can translate punctuation.""" language = factory.getlanguage('fa') assert language.punctranslate(u"") == u"" assert language.punctranslate(u"abc efg") == u"abc efg" assert l...
mpl-2.0
orangeduck/PyAutoC
Python27/Lib/idlelib/keybindingDialog.py
89
12407
""" Dialog for building Tkinter accelerator key bindings """ from Tkinter import * import tkMessageBox import string class GetKeysDialog(Toplevel): def __init__(self,parent,title,action,currentKeySequences): """ action - string, the name of the virtual event these keys will be mapp...
bsd-2-clause
CMUSV-VisTrails/WorkflowRecommendation
vistrails/packages/spreadsheet/widgets/imageviewer/imageviewer_rc.py
1
33804
############################################################################### ## ## Copyright (C) 2006-2011, University of Utah. ## All rights reserved. ## Contact: contact@vistrails.org ## ## This file is part of VisTrails. ## ## "Redistribution and use in source and binary forms, with or without ## modification, ...
bsd-3-clause
wrouesnel/ansible
test/units/modules/network/f5/test_bigip_monitor_https.py
24
13803
# -*- 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 sys import pytest from nose.plugins.skip imp...
gpl-3.0
rtucker-mozilla/inventory
scripts/seamicro_warranty_fixes.py
2
2640
__import__('inventory_context') from systems.models import System import datetime updates = [ #["management.seamicro.phx1.mozilla.com", "3410NU000302000034", "1/6/2014"], # noqa 512 atom nodes ["seamicro-a.r101-7.console.phx1.mozilla.com", "0112NU003401000632", "2/14/2015", '1/1/2013'], # noqa 64 xeon nodes...
bsd-3-clause
hfaran/ubc-timetabler
timetabler/schedule.py
1
4430
import tempfile import os from uuid import uuid4 from prettytable import PrettyTable from timetabler.util import iter_time, DAY_LIST class Schedule(object): def __init__(self, sched): """Schedule e.g. for ``sched``: ((Lab<status='Restricted', section='EECE 381 L2A', term='2', days='[u'T...
mit
agry/NGECore2
scripts/mobiles/naboo/plains_hunter.py
2
1623
import sys from services.spawn import MobileTemplate from services.spawn import WeaponTemplate from resources.datatables import WeaponType from resources.datatables import Difficulty from resources.datatables import Options from java.util import Vector def addTemplate(core): mobileTemplate = MobileTemplate() mobi...
lgpl-3.0
fernandojunior/searching-techniques
python/lib/python3.4/site-packages/pip/_vendor/requests/packages/urllib3/fields.py
1007
5833
import email.utils import mimetypes from .packages import six def guess_content_type(filename, default='application/octet-stream'): """ Guess the "Content-Type" of a file. :param filename: The filename to guess the "Content-Type" of using :mod:`mimetypes`. :param default: If no "Cont...
mit
alexmogavero/home-assistant
homeassistant/components/cover/mysensors.py
6
3857
""" Support for MySensors covers. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/cover.mysensors/ """ import logging from homeassistant.components import mysensors from homeassistant.components.cover import CoverDevice, ATTR_POSITION from homeassistant....
apache-2.0
kamilion/customizer
src/actions/rebuild.py
1
16706
#!/usr/bin/python2.7 import sys, os, glob, shutil, re import lib.misc as misc import lib.config as config import lib.message as message import actions.common as common def detect_boot(): global initrd, vmlinuz, mt86plus, xen_kernel, xen_efi, ipxe_kernel, ipxe_efi initrd = None vmlinuz = None mt86plus...
gpl-2.0
dhruvagarwal/django
tests/get_object_or_404/models.py
409
1133
""" DB-API Shortcuts ``get_object_or_404()`` is a shortcut function to be used in view functions for performing a ``get()`` lookup and raising a ``Http404`` exception if a ``DoesNotExist`` exception was raised during the ``get()`` call. ``get_list_or_404()`` is a shortcut function to be used in view functions for per...
bsd-3-clause
redixin/paramiko
paramiko/_winapi.py
3
8241
""" Windows API functions implemented as ctypes functions and classes as found in jaraco.windows (2.10). If you encounter issues with this module, please consider reporting the issues in jaraco.windows and asking the author to port the fixes back here. """ import ctypes import ctypes.wintypes from paramiko.py3compat ...
lgpl-2.1
esparta/logilab_common3
test/unittest_graph.py
14
3196
# unit tests for the cache module # copyright 2003-2011 LOGILAB S.A. (Paris, FRANCE), all rights reserved. # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr # # This file is part of logilab-common. # # logilab-common is free software: you can redistribute it and/or modify it under # the terms of the GNU Les...
gpl-2.0
tghosgor/libarmmcu
gyp/pylib/gyp/generator/make.py
19
90986
# Copyright (c) 2013 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. # Notes: # # This is all roughly based on the Makefile system used by the Linux # kernel, but is a non-recursive make -- we put the entire dependency # graph in fr...
gpl-3.0
okanasik/JdeRobot
src/tools/visualStates/samples/goforward/goforward.py
2
4201
#!/usr/bin/python # -*- coding: utf-8 -*- import easyiceconfig as EasyIce import jderobotComm as comm import sys, signal sys.path.append('/usr/local/share/jderobot/python/visualHFSM_py') import traceback, threading, time from automatagui import AutomataGui, QtGui, GuiSubautomata from jderobot import MotorsPrx from jd...
gpl-3.0
kelle/astropy
astropy/table/tests/test_index.py
1
16394
# Licensed under a 3-clause BSD style license - see LICENSE.rst import pytest import numpy as np from .test_table import SetupData from ..bst import BST, FastRBT from ..sorted_array import SortedArray from ..table import QTable, Row from ... import units as u from ...time import Time from ..column import BaseColumn f...
bsd-3-clause
lzambella/Qyoutube-dl
youtube_dl/extractor/npo.py
19
18401
from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( fix_xml_ampersands, parse_duration, qualities, strip_jsonp, unified_strdate, ) class NPOBaseIE(InfoExtractor): def _get_token(self, video_id): token_page = self._download_webpage...
gpl-3.0
alex/warehouse
tests/unit/test_raven.py
3
4219
# 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
hjfreyer/pledgeservice
lib/validictory/tests/test_disallow_unknown_properties.py
22
2676
from unittest import TestCase import validictory class TestDisallowUnknownProperties(TestCase): def setUp(self): self.data_simple = {"name": "john doe", "age": 42} self.schema_simple = { "type": "object", "properties": { "name": {"type": "string"}, ...
agpl-3.0
Jorge-Rodriguez/ansible
lib/ansible/modules/cloud/openstack/os_router.py
52
17853
#!/usr/bin/python # # Copyright: Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'],...
gpl-3.0
AlanZatarain/pysal
pysal/weights/Distance.py
5
14395
""" Distance based spatial weights """ __author__ = "Sergio J. Rey <srey@asu.edu> " import pysal import scipy.spatial from pysal.common import * from pysal.weights import W from scipy import sparse __all__ = ["knnW", "Kernel", "DistanceBand"] def knnW(data, k=2, p=2, ids=None): """ Creates nearest neighbo...
bsd-3-clause
gingi99/research_dr
python/MLEM2/discrimination.py
1
12551
# coding: utf-8 # python 3.5 import sys import os sys.path.append('/Users/ooki/git/research_dr/python/MLEM2') sys.path.append(os.path.dirname(os.path.abspath("__file__"))+'/../MLEM2') from sklearn.metrics import accuracy_score import copy import importlib import mlem2 import LERS importlib.reload(mlem2) importlib.rel...
mit
TriOptima/tri.form
tests/test_forms.py
1
63759
from __future__ import unicode_literals, absolute_import import re from collections import defaultdict from datetime import date, time from datetime import datetime from decimal import Decimal from tri_form.compat import ( ValidationError, field_defaults_factory, ) from bs4 import BeautifulSoup import pytest...
bsd-3-clause
lthall/Leonard_ardupilot
libraries/AP_InertialSensor/examples/coning.py
21
10515
#!/usr/bin/env python from math import * from pymavlink.rotmat import Vector3, Matrix3 from numpy import linspace from visual import * class Quat: def __init__(self,w=1.0,x=0.0,y=0.0,z=0.0): self.w = w self.x = x self.y = y self.z = z def to_euler(self): roll = (atan2(...
gpl-3.0
jdramani/servo
tests/wpt/web-platform-tests/cors/resources/cors-makeheader.py
79
2139
import json def main(request, response): origin = request.GET.first("origin", request.headers.get('origin')) if "check" in request.GET: token = request.GET.first("token") value = request.server.stash.take(token) if value is not None: if request.GET.first("check", None) == "...
mpl-2.0
zahodi/ansible
lib/ansible/modules/cloud/amazon/route53_zone.py
25
7289
#!/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 distributed...
gpl-3.0
CarlosCondor/pelisalacarta-xbmc-plus
pelisalacarta/channels/peliculasmx.py
3
17288
# -*- coding: utf-8 -*- #------------------------------------------------------------ # pelisalacarta - XBMC Plugin # Canal para peliculasmx # http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/ #------------------------------------------------------------ import urlparse,urllib2,urllib,re import os, sys from core...
gpl-3.0
DESHRAJ/fjord
vendor/packages/translate-toolkit/translate/convert/test_po2php.py
3
6856
#!/usr/bin/env python # -*- coding: utf-8 -*- from pytest import mark from translate.convert import po2php from translate.convert import test_convert from translate.misc import wStringIO from translate.storage import po class TestPO2Php: def po2php(self, posource): """helper that converts po source to ...
bsd-3-clause
nikchu/hello-world
repo/pager.py
34
2008
# # Copyright (C) 2008 The Android Open Source Project # # 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...
apache-2.0
michael-berlin/vitess
py/vtdb/db_object_lookup.py
6
1698
"""Module containing base class for lookup database tables. LookupDBObject defines the base class for lookup tables and defines relevant methods. LookupDBObject inherits from DBObjectUnsharded and extends the functionality for getting, creating, updating and deleting the lookup relationship. """ import functools impor...
bsd-3-clause
catapult-project/catapult
third_party/gsutil/gslib/vendored/boto/tests/integration/route53/domains/test_route53domains.py
113
1887
# Copyright (c) 2014 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 limitation the rights ...
bsd-3-clause
sebrandon1/bitcoin
test/functional/wallet_resendwallettransactions.py
45
1328
#!/usr/bin/env python3 # Copyright (c) 2017 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test resendwallettransactions RPC.""" from test_framework.test_framework import BitcoinTestFramework from t...
mit
major/supernova
supernova/executable.py
2
12789
# # Copyright 2014 Major Hayden # # 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...
apache-2.0
CYBAI/servo
tests/wpt/web-platform-tests/tools/third_party/pytest/src/_pytest/reports.py
11
19104
from io import StringIO from pprint import pprint from typing import Any from typing import cast from typing import Dict from typing import Iterable from typing import Iterator from typing import List from typing import Optional from typing import Tuple from typing import TypeVar from typing import Union import attr i...
mpl-2.0
flyher/pymo
android/pgs4a-0.9.6/python-install/lib/python2.7/json/__init__.py
40
13818
r"""JSON (JavaScript Object Notation) <http://json.org> is a subset of JavaScript syntax (ECMA-262 3rd edition) used as a lightweight data interchange format. :mod:`json` exposes an API familiar to users of the standard library :mod:`marshal` and :mod:`pickle` modules. It is the externally maintained version of the :m...
mit
knabar/openmicroscopy
components/tools/OmeroPy/src/omero/install/versions.py
15
3456
#!/usr/bin/env python # -*- coding: utf-8 -*- # # $Id$ # # Copyright 2009 Glencoe Software, Inc. All rights reserved. # Use is subject to license terms supplied in LICENSE.txt # # Version comparison functionality import re import logging # Regex copied from ome.api.IConfig.VERSION_REGEX REGEX = re.compile("^.*?[-]?(\...
gpl-2.0
tobspr/panda3d
direct/src/p3d/ppatcher.py
10
3172
#! /usr/bin/env python usageText = """ This script generates the patches required to support incremental download of Panda3D packages. It can be run as a post-process on a directory hierarchy created by ppackage; it will examine the directory hierarchy, and create any patches that appear to be missing. You may run ...
bsd-3-clause
andgoldschmidt/iEBE-old
EBE-Node/iSS/for_paraview/lib152/__init__.py
9
6568
#!/usr/bin/env python """ PyVTK provides tools for manipulating VTK files in Python. VtkData - create VTK files from Python objects. """ """ Copyright 2001 Pearu Peterson all rights reserved, Pearu Peterson <pearu@ioc.ee> Permission to use, modify, and distribute this software is given under the terms of th...
gpl-3.0
lildadou/Flexget
flexget/plugins/output/rapidpush.py
16
6376
from __future__ import unicode_literals, division, absolute_import import logging from requests import RequestException from flexget import plugin from flexget.event import event from flexget.utils import json from flexget.utils.template import RenderError from flexget.config_schema import one_or_more log = logging....
mit