repo_name
stringlengths
5
100
path
stringlengths
4
375
copies
stringclasses
991 values
size
stringlengths
4
7
content
stringlengths
666
1M
license
stringclasses
15 values
yosinv/anyway
localization.py
2
8011
#!/usr/bin/env python # -*- coding: utf-8 -*- import csv import os import field_names _tables = { "SUG_DEREH": { 1: "ืขื™ืจื•ื ื™ ื‘ืฆื•ืžืช", 2: "ืขื™ืจื•ื ื™ ืœื ื‘ืฆื•ืžืช", 3: "ืœื ืขื™ืจื•ื ื™ ื‘ืฆื•ืžืช", 4: "ืœื ืขื™ืจื•ื ื™ ืœื ื‘ืฆื•ืžืช", }, "YEHIDA": { 11: "ืžืจื—ื‘ ื—ื•ืฃ (ื—ื™ืคื”)", 12: "ืžืจื—ื‘ ื’ืœื™ืœ", ...
bsd-3-clause
Kryz/sentry
src/sentry/management/commands/export.py
23
4653
from __future__ import absolute_import, print_function import sys from django.core import serializers from django.core.management.base import BaseCommand from django.db.models import get_apps def sort_dependencies(app_list): """ Similar to Django's except that we discard the important of natural keys wh...
bsd-3-clause
rschnapka/commission
sale_commission/partner.py
3
1581
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2011 Pexego Sistemas Informรกticos (<http://www.pexego.es>). All Rights Reserved # $Id$ # # This program is free software: you can redistribute i...
agpl-3.0
routeflow/AutomaticConfigurationRouteFlow
POX_CONTROLLER/tests/unit/module_load_test.py
46
1777
#!/usr/bin/env python # # Copyright 2011-2012 Andreas Wundsam # # 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 applic...
apache-2.0
joker946/nova
nova/tests/unit/api/openstack/test_api_version_request.py
48
4954
# Copyright 2014 IBM Corp. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed t...
apache-2.0
webnotes/wnframework
webnotes/widgets/page.py
34
1572
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals import webnotes import webnotes.model.doc import webnotes.model.code @webnotes.whitelist() def get(name): """ Return the :term:`doclist` of the `Page` specified by `name...
mit
mattrobenolt/django
tests/model_formsets/test_uuid.py
45
1295
from django.forms.models import inlineformset_factory from django.test import TestCase from .models import UUIDPKChild, UUIDPKParent class InlineFormsetTests(TestCase): def test_inlineformset_factory_nulls_default_pks(self): """ #24377 - If we're adding a new object, a parent's auto-generated pk ...
bsd-3-clause
shipEZ/flaskApp
lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/chardetect.py
1786
2504
#!/usr/bin/env python """ Script which takes one or more file paths and reports on their detected encodings Example:: % chardetect somefile someotherfile somefile: windows-1252 with confidence 0.5 someotherfile: ascii with confidence 1.0 If no paths are provided, it takes its input from stdin. """ from...
mit
tshi04/machine-learning-codes
SVM-SMO/smo_svm2.py
1
4990
''' Created on Mar 10, 2017 @author: Tian Shi ''' import numpy as np import matplotlib.pyplot as plt np.random.seed(10) class SMOSVM(object): ''' SMO SVM ''' def __init__(self, data, C=10.0, max_iter=1000, err=1e-8): ''' Constructor ''' self.data = data self.C ...
gpl-3.0
boumenot/azure-linux-extensions
VMBackup/main/backuplogger.py
2
3155
#!/usr/bin/env python # # VM Backup extension # # Copyright 2014 Microsoft Corporation # # 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 # # U...
apache-2.0
blackoutjack/jamweaver
util/resultsutil.py
1
4333
class Section: # properties: # name # info # headers # rows # total # errors def __init__(self, name, info): self.name = name self.info = info self.headers = None self.rows = {} self.total = None self.errors = [] def addData(self, data): assert len(data) > 0, ...
bsd-3-clause
tempbottle/kbengine
kbe/src/lib/python/Lib/test/test_largefile.py
96
6554
"""Test largefile support on system where this makes sense. """ import os import stat import sys import unittest from test.support import TESTFN, requires, unlink import io # C implementation of io import _pyio as pyio # Python implementation of io # size of file to create (>2GB; 2GB == 2147483648 bytes) size = 2500...
lgpl-3.0
herrniemand/KiwiPycon2015
parser.py
1
3197
from bs4 import BeautifulSoup import re def clean( content, form ): expressions = { 'tabs' : r'[\n|\t|\r]', 'numbers' : r'[^0-9\.]' } regex = re.compile(expressions[form]) return regex.sub('', content) def prepare( data ): soup = BeautifulSoup(data, 'html.parser') if not 'Site...
mit
Datera/cinder
cinder/volume/drivers/vmware/volumeops.py
3
82850
# Copyright (c) 2013 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...
apache-2.0
tiagocardosos/stoq
stoqlib/reporting/report.py
2
10857
# -*- coding: utf-8 -*- # vi:si:et:sw=4:sts=4:ts=4 ## ## Copyright (C) 2012 Async Open Source ## ## 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 2 ## of the License, or ...
gpl-2.0
chromium/chromium
third_party/blink/tools/blinkpy/tool/commands/copy_existing_baselines_unittest.py
7
6922
# Copyright 2017 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 optparse from blinkpy.tool.commands.rebaseline_unittest import BaseTestCase from blinkpy.tool.commands.copy_existing_baselines import CopyExistingBas...
bsd-3-clause
protatremy/buildbot
master/buildbot/util/httpclientservice.py
5
7451
# 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 even...
gpl-2.0
googleapis/python-bigtable
tests/unit/test_cluster.py
1
22563
# Copyright 2015 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 agreed to in writing, s...
apache-2.0
airbnb/airflow
airflow/contrib/hooks/gcp_sql_hook.py
7
1779
# # 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...
apache-2.0
jor-/scipy
scipy/io/tests/test_idl.py
26
19683
from __future__ import division, print_function, absolute_import from os import path import warnings DATA_PATH = path.join(path.dirname(__file__), 'data') import numpy as np from numpy.testing import (assert_equal, assert_array_equal, assert_) from scipy._lib._numpy_compat import suppress_warnings from scipy.io...
bsd-3-clause
varunarya10/boto
tests/integration/cloudsearch/test_cert_verification.py
126
1577
# Copyright (c) 2012 Mitch Garnaat http://garnaat.org/ # 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 withou...
mit
bratsche/Neutron-Drive
google_appengine/lib/django_1_2/django/utils/simplejson/scanner.py
928
2227
"""JSON token scanner """ import re try: from simplejson._speedups import make_scanner as c_make_scanner except ImportError: c_make_scanner = None __all__ = ['make_scanner'] NUMBER_RE = re.compile( r'(-?(?:0|[1-9]\d*))(\.\d+)?([eE][-+]?\d+)?', (re.VERBOSE | re.MULTILINE | re.DOTALL)) def py_make_scan...
bsd-3-clause
Weihonghao/ECM
Vpy34/lib/python3.5/site-packages/tensorflow/contrib/learn/python/learn/estimators/estimator_test_utils.py
11
2081
# 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...
agpl-3.0
Sorsly/subtle
google-cloud-sdk/lib/surface/logging/metrics/delete.py
6
2018
# Copyright 2015 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...
mit
zhwa/thunder
thunder/rdds/timeseries.py
7
10869
from numpy import sqrt, pi, angle, fft, fix, zeros, roll, dot, mean, \ array, size, asarray, polyfit, polyval, arange, \ percentile, ceil, float64, where, floor from thunder.rdds.series import Series from thunder.utils.common import loadMatVar, checkParams class TimeSeries(Series): """ Distributed co...
apache-2.0
makermade/arm_android-19_arm-linux-androideabi-4.8
share/gdb/python/gdb/command/frame_filters.py
126
16605
# Frame-filter commands. # Copyright (C) 2013-2014 Free Software Foundation, Inc. # 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 late...
gpl-2.0
yvaucher/l10n-italy
__unported__/l10n_it_bill_of_entry/__openerp__.py
3
2507
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2013 Agile Business Group sagl (<http://www.agilebg.com>) # Copyright (C) 2013 # Associazione OpenERP Italia (<http://www.openerp-italia.org>) # # This program is free software: you can r...
agpl-3.0
alfa-jor/addon
plugin.video.alfa/lib/sambatools/pyasn1/codec/cer/encoder.py
2
5130
# CER encoder from pyasn1 import error from pyasn1.codec.ber import encoder from pyasn1.compat.octets import int2oct, str2octs, null from pyasn1.type import univ from pyasn1.type import useful class BooleanEncoder(encoder.IntegerEncoder): def encodeValue(self, encodeFun, client, defMode, maxChunkSize): ...
gpl-3.0
kyvinh/home-assistant
homeassistant/components/litejet.py
22
1594
"""Allows the LiteJet lighting system to be controlled by Home Assistant. For more details about this component, please refer to the documentation at https://home-assistant.io/components/litejet/ """ import logging import voluptuous as vol from homeassistant.helpers import discovery from homeassistant.const import C...
apache-2.0
alephu5/Soundbyte
environment/lib/python3.3/site-packages/pandas/io/gbq.py
1
18985
""" Pandas module to interface with Google BigQuery. """ import os import sys import tempfile import csv import logging from datetime import datetime import pkg_resources from distutils.version import LooseVersion import pandas as pd import numpy as np from pandas.core.common import PandasError from pandas.core.frame...
gpl-3.0
cyberden/CouchPotatoServer
libs/gntp/notifier.py
122
8299
# Copyright: 2013 Paul Traylor # These sources are released under the terms of the MIT license: see LICENSE """ The gntp.notifier module is provided as a simple way to send notifications using GNTP .. note:: This class is intended to mostly mirror the older Python bindings such that you should be able to replace in...
gpl-3.0
VigTech/Vigtech-Services
env/lib/python2.7/site-packages/setuptools/command/build_py.py
301
7915
from glob import glob from distutils.util import convert_path import distutils.command.build_py as orig import os import sys import fnmatch import textwrap try: from setuptools.lib2to3_ex import Mixin2to3 except ImportError: class Mixin2to3: def run_2to3(self, files, doctests=True): "do not...
lgpl-3.0
Godiyos/python-for-android
python3-alpha/extra_modules/atom/client.py
46
7854
#!/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 ...
apache-2.0
kaarl/pyload
pyLoadCore.py
34
22485
#!/usr/bin/env python # -*- coding: utf-8 -*- """ 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. This prog...
gpl-3.0
jolyonb/edx-platform
lms/djangoapps/mobile_api/tests/test_context_processor.py
2
1087
""" Tests for Django template context processors. """ from __future__ import absolute_import from django.conf import settings from django.test import TestCase from django.test.client import RequestFactory from lms.djangoapps.mobile_api.context_processor import is_from_mobile_app class MobileContextProcessorTests(Te...
agpl-3.0
msebire/intellij-community
python/lib/Lib/email/_parseaddr.py
92
14987
# Copyright (C) 2002-2007 Python Software Foundation # Contact: email-sig@python.org """Email address parsing code. Lifted directly from rfc822.py. This should eventually be rewritten. """ __all__ = [ 'mktime_tz', 'parsedate', 'parsedate_tz', 'quote', ] import time SPACE = ' ' EMPTYSTRING = ''...
apache-2.0
AM-SL/python-codes
Python-Chaptering/Chapter-2/3-sshBrute.py
2
1854
import pxssh import optparse import time from threading import * maxConnections = 5 connection_lock = BoundedSemaphore(value=maxConnections) Found = False Fails = 0 def connect(host, user, password, release): global Found global Fails try: s = pxssh.pxssh() s.login(host, user, password) ...
mit
MrSprigster/script.module.python.twitch
resources/lib/twitch/scraper.py
1
4491
# -*- encoding: utf-8 -*- """ Copyright (C) 2012-2016 python-twitch (https://github.com/ingwinlu/python-twitch) Copyright (C) 2016-2018 script.module.python.twitch This file is part of script.module.python.twitch SPDX-License-Identifier: GPL-3.0-only See LICENSES/GPL-3.0-only for more information...
gpl-3.0
jjffryan/pymtl
pclib/ifcs/MemMsg.py
7
5823
#========================================================================= # MemMsg #========================================================================= # Contains memory request and response messages. from pymtl import * import math #------------------------------------------------------------------------- # ...
bsd-3-clause
mcsosa121/cafa
cafaenv/lib/python2.7/site-packages/django/utils/translation/trans_real.py
35
28112
"""Translation helper functions.""" from __future__ import unicode_literals import gettext as gettext_module import os import re import sys import warnings from collections import OrderedDict from threading import local from django.apps import apps from django.conf import settings from django.conf.locale import LANG_...
mit
pierce403/EmpirePanel
lib/modules/credentials/enum_cred_store.py
1
1940
from lib.common import helpers class Module: def __init__(self, mainMenu, params=[]): self.info = { 'Name': 'enum_cred_store', 'Author': ['BeetleChunks'], 'Description': ('Dumps plaintext credentials from the Windows Credential Manager for the current interactive ...
bsd-3-clause
apanju/odoo
openerp/addons/test_inherits/models.py
295
1141
# -*- coding: utf-8 -*- from openerp import models, fields, api, osv # We just create a new model class Unit(models.Model): _name = 'test.unit' _columns = { 'name': osv.fields.char('Name', required=True), 'state': osv.fields.selection([('a', 'A'), ('b', 'B')], ...
agpl-3.0
adw0rd/lettuce
tests/integration/lib/Django-1.2.5/django/db/transaction.py
45
12689
""" This module implements a transaction manager that can be used to define transaction handling in a request or view function. It is used by transaction control middleware and decorators. The transaction manager can be in managed or in auto state. Auto state means the system is using a commit-on-save strategy (actual...
gpl-3.0
StevenBlack/phantomjs
src/qt/qtwebkit/Tools/QueueStatusServer/handlers/updatebase.py
143
1902
# 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...
bsd-3-clause
sultanoid/Gabriel
server/gabriel/common/protocol.py
1
2299
#!/usr/bin/env python # # Cloudlet Infrastructure for Mobile Computing # # Author: Kiryong Ha <krha@cmu.edu> # Zhuo Chen <zhuoc@cs.cmu.edu> # # Copyright (C) 2011-2013 Carnegie Mellon University # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in com...
apache-2.0
OCA/partner-contact
partner_second_lastname/tests/test_name.py
1
7044
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). # Copyright 2015 Grupo ESOC Ingenierรญa de Servicios, S.L.U. # Copyright 2015 Antiun Ingenieria S.L. - Antonio Espinosa from odoo.tests.common import TransactionCase from odoo.addons.partner_firstname.tests.base import MailInstalled class CompanyCa...
agpl-3.0
GNOME/orca
test/keystrokes/gtk3-demo/role_column_header.py
1
5313
#!/usr/bin/python """Test of column header output.""" from macaroon.playback import * import utils sequence = MacroSequence() sequence.append(KeyComboAction("End")) sequence.append(KeyComboAction("<Shift>Right")) sequence.append(KeyComboAction("Down")) sequence.append(KeyComboAction("Down")) sequence.append(KeyComb...
lgpl-2.1
KenjiTakahashi/td
setup.py
1
1625
# -*- coding: utf-8 -*- # This is a part of td @ http://github.com/KenjiTakahashi/td # Karol "Kenji Takahashi" Woลบniak ยฉ 2012 - 2013 # # 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 vers...
gpl-3.0
agreen/scrapy
tests/test_spidermiddleware_httperror.py
125
6935
from unittest import TestCase from testfixtures import LogCapture from twisted.trial.unittest import TestCase as TrialTestCase from twisted.internet import defer from scrapy.utils.test import get_crawler from tests.mockserver import MockServer from scrapy.http import Response, Request from scrapy.spiders import Spide...
bsd-3-clause
PoisonBOx/jieba
test/test_whoosh_file.py
65
1089
# -*- coding: UTF-8 -*- from __future__ import unicode_literals import sys import os sys.path.append("../") from whoosh.index import create_in from whoosh.fields import * from whoosh.qparser import QueryParser from jieba.analyse import ChineseAnalyzer analyzer = ChineseAnalyzer() schema = Schema(title=TEXT(stored=Tr...
mit
winklerand/pandas
setup.py
1
31821
#!/usr/bin/env python """ Parts of this file were taken from the pyzmq project (https://github.com/zeromq/pyzmq) which have been permitted for use under the BSD license. Parts are from lxml (https://github.com/lxml/lxml) """ import os from os.path import join as pjoin import sys import shutil from distutils.version ...
bsd-3-clause
mbeyeler/pulse2percept
pulse2percept/percepts/tests/test_base.py
1
6272
import os import numpy as np import pytest import numpy.testing as npt import matplotlib.pyplot as plt from matplotlib.axes import Subplot from matplotlib.animation import FuncAnimation from imageio import mimread from skimage import img_as_float from skimage.io import imread from pulse2percept.percepts import Percept...
bsd-3-clause
nealtodd/wagtail
wagtail/admin/edit_handlers.py
2
28509
import functools import re from django import forms from django.core.exceptions import ImproperlyConfigured from django.db.models.fields import FieldDoesNotExist from django.forms.formsets import DELETION_FIELD_NAME, ORDERING_FIELD_NAME from django.forms.models import fields_for_model from django.template.loader impor...
bsd-3-clause
bussiere/pypyjs
website/demo/home/rfk/repos/pypy/lib-python/2.7/encodings/gb2312.py
816
1027
# # gb2312.py: Python Unicode Codec for GB2312 # # Written by Hye-Shik Chang <perky@FreeBSD.org> # import _codecs_cn, codecs import _multibytecodec as mbc codec = _codecs_cn.getcodec('gb2312') class Codec(codecs.Codec): encode = codec.encode decode = codec.decode class IncrementalEncoder(mbc.MultibyteIncrem...
mit
low-sky/pyspeckit
pyspeckit/spectrum/moments.py
4
4902
from __future__ import print_function import numpy as np def moments(Xax, data, vheight=True, estimator=np.mean, negamp=None, veryverbose=False, nsigcut=None, noise_estimate=None, **kwargs): """ Returns the gaussian parameters of a 1D distribution by calculating its moments. Depending on the ...
mit
rubacalypse/voc
tests/structures/test_import.py
2
13038
import os from ..utils import TranspileTestCase class ImportTests(TranspileTestCase): def test_import_java_module_static_method(self): "You can invoke a static method from a native Java namespace" self.assertJavaExecution( """ from java import lang props = la...
bsd-3-clause
MenZil/kuma
settings.py
2
35192
# Django settings for kuma project. from collections import namedtuple import json import logging import os import platform from django.utils.functional import lazy from django.utils.translation import ugettext_lazy as _ from django.core.urlresolvers import reverse_lazy _Language = namedtuple(u'Language', u'english n...
mpl-2.0
petecummings/django
django/core/checks/messages.py
319
2383
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.utils.encoding import force_str, python_2_unicode_compatible # Levels DEBUG = 10 INFO = 20 WARNING = 30 ERROR = 40 CRITICAL = 50 @python_2_unicode_compatible class CheckMessage(object): def __init__(self, level, msg, hint=None, obj=Non...
bsd-3-clause
yjacolin/qgis-geoserver-plugin
src/geoserverexplorer/gui/dialogs/catalogdialog.py
1
6939
from PyQt4 import QtGui, QtCore from qgis.gui import * from qgis.core import * from geoserverexplorer.geoserver import pem class DefineCatalogDialog(QtGui.QDialog): def __init__(self, catalogs, parent = None): super(DefineCatalogDialog, self).__init__(parent) self.catalogs = catalogs self....
gpl-2.0
Rona111/sale_commission
__unported__/production_costs/fixed_cost.py
3
2109
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). All Rights Reserved. # # This program is free software: you can redistribute it and/or modify # it...
agpl-3.0
zacoxicompton/damnvid
dCore.py
12
3195
# -*- coding: utf-8 -*- def DamnUnicode(s): if type(s) is type(u''): return s if type(s) is type(''): try: return unicode(s) except: try: return unicode(s.decode('utf8')) except: try: return unicode(s.decode('windows-1252')) # Windows file paths with accents and weird characters excep...
gpl-3.0
h0nIg/ansible-modules-extras
packaging/os/zypper.py
20
11010
#!/usr/bin/python -tt # -*- coding: utf-8 -*- # (c) 2013, Patrick Callahan <pmc@patrickcallahan.com> # based on # openbsd_pkg # (c) 2013 # Patrik Lundin <patrik.lundin.swe@gmail.com> # # yum # (c) 2012, Red Hat, Inc # Written by Seth Vidal <skvidal at fedoraproject.org> # # This...
gpl-3.0
waseem18/oh-mainline
vendor/packages/celery/celery/concurrency/eventlet.py
18
3457
# -*- coding: utf-8 -*- from __future__ import absolute_import import os import sys from time import time if not os.environ.get("EVENTLET_NOPATCH"): import eventlet import eventlet.debug eventlet.monkey_patch() eventlet.debug.hub_prevent_multiple_readers(False) from .. import signals from ..utils im...
agpl-3.0
Dark-Passenger/Top_websites_content_filtering_test
website_access_single_user_no_report.py
1
2327
from __future__ import print_function, division from requests import get from lxml.html import fromstring from datetime import datetime from requests.exceptions import ConnectionError from csv import reader from itertools import islice from os import system, name filename = "top-1m.csv" websites = reader(open(filename...
gpl-3.0
maestro-hybrid-cloud/ceilometer
ceilometer/alarm/evaluator/__init__.py
5
4879
# # Copyright 2013 eNovance <licensing@enovance.com> # # Authors: Mehdi Abaakouk <mehdi.abaakouk@enovance.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/l...
apache-2.0
jazkarta/edx-platform
common/lib/xmodule/xmodule/tests/test_import_static.py
208
1949
""" Tests that check that we ignore the appropriate files when importing courses. """ import unittest from mock import Mock from xmodule.modulestore.xml_importer import import_static_content from opaque_keys.edx.locations import SlashSeparatedCourseKey from xmodule.tests import DATA_DIR class IgnoredFilesTestCase(uni...
agpl-3.0
chyeh727/django
tests/template_tests/filter_tests/test_escape.py
324
1495
from django.template.defaultfilters import escape from django.test import SimpleTestCase from django.utils.safestring import mark_safe from ..utils import setup class EscapeTests(SimpleTestCase): """ The "escape" filter works the same whether autoescape is on or off, but it has no effect on strings alrea...
bsd-3-clause
SnappleCap/oh-mainline
vendor/packages/docutils/test/test_parsers/test_rst/test_TableParser.py
18
6100
#! /usr/bin/env python # coding: utf-8 # $Id: test_TableParser.py 7668 2013-06-04 12:46:30Z milde $ # Author: David Goodger <goodger@python.org> # Copyright: This module has been placed in the public domain. """ Tests for states.py. """ from __init__ import DocutilsTestSupport def suite(): s = DocutilsTestSuppo...
agpl-3.0
simonpatrick/bite-project
deps/gdata-python-client/tests/gdata_tests/apps/organization/live_client_test.py
22
5786
#!/usr/bin/python2.4 # # Copyright 2011 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 require...
apache-2.0
jarn0ld/gnuradio
gnuradio-runtime/python/gnuradio/gr/hier_block2.py
34
5656
# # Copyright 2006,2007,2014 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio 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, or (at your option) # any later ve...
gpl-3.0
jerry-sc/zookeeper-learning
src/contrib/huebrowser/zkui/src/zkui/views.py
114
4712
# 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 ...
apache-2.0
jonashaag/django-nonrel-nohistory
tests/regressiontests/datatypes/tests.py
50
4250
import datetime from django.conf import settings from django.db import DEFAULT_DB_ALIAS from django.test import TestCase, skipIfDBFeature from django.utils import tzinfo from models import Donut, RumBaba class DataTypesTestCase(TestCase): def test_boolean_type(self): d = Donut(name='Apple Fritter') ...
bsd-3-clause
40323144/2015cdb_g7
static/Brython3.1.1-20150328-091302/Lib/tempfile.py
728
22357
"""Temporary files. This module provides generic, low- and high-level interfaces for creating temporary files and directories. The interfaces listed as "safe" just below can be used without fear of race conditions. Those listed as "unsafe" cannot, and are provided for backward compatibility only. This module also pr...
gpl-3.0
valentin-krasontovitsch/ansible
test/units/modules/network/ios/test_ios_logging.py
30
2538
# # (c) 2016 Red Hat Inc. # (c) 2017 Paul Neumann # # 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 v...
gpl-3.0
muupan/chainer
tests/cupy_tests/manipulation_tests/test_transpose.py
2
1416
import unittest import cupy from cupy import testing @testing.gpu class TestTranspose(unittest.TestCase): _multiprocess_can_split_ = True @testing.numpy_cupy_array_equal() def test_rollaxis(self, xp): a = testing.shaped_arange((2, 3, 4), xp) return xp.rollaxis(a, 2) def test_rollax...
mit
ppoile/athletica-adapter
main/migrations/0001_squashed_0005_auto_20150304_0020.py
1
44968
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import datetime class Migration(migrations.Migration): replaces = [(b'main', '0001_initial'), (b'main', '0002_auto_20150303_1207'), (b'main', '0003_auto_20150303_1321'), (b'main', '0004_auto_20150303_1413'),...
gpl-2.0
amohanta/miasm
test/core/interval.py
7
3822
#!/usr/bin/env python #-*- coding:utf-8 -*- from miasm2.core.interval import * from random import randint from pdb import pm i1 = interval([(1, 3)]) i2 = interval([(2, 5)]) i3 = interval([(3, 5)]) i4 = interval([(5, 8)]) i5 = interval([(1, 5)]) i6 = interval([(1, 3), (5, 8)]) i7 = interval([(2, 8)]) i8 = interval([(...
gpl-2.0
maelnor/cinder
cinder/brick/local_dev/lvm.py
1
13620
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # 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.apac...
apache-2.0
kylepjohnson/cltk
src/cltk/corpora/grc/tlg/id_author.py
4
63335
ID_AUTHOR = { "2434": "Aelius Dius Hist.", "2035": "Athanasius Theol.", "2012": "Acta Eupli", "1578": "Phaenias Phil.", "1220": "Batrachomyomachia", "1222": "Beros(s)us Astrol. et Hist.", "0474": "Magnes Comic.", "0559": "Heron Mech.", "4138": "Ephraem Syrus Theol.", "1639": "Pse...
mit
hsuchie4/TACTIC
src/pyasm/prod/web/artist_view_wdg.py
6
5064
########################################################### # # 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 without written permi...
epl-1.0
eXcomm/cjdns
node_build/dependencies/libuv/build/gyp/test/copies/gyptest-default.py
264
1268
#!/usr/bin/env python # Copyright (c) 2009 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Verifies file copies using the build tool default. """ import TestGyp test = TestGyp.TestGyp() test.run_gyp('copies.gyp', chdir='src'...
gpl-3.0
mezz64/home-assistant
homeassistant/components/smhi/weather.py
12
6669
"""Support for the Swedish weather institute weather service.""" import asyncio from datetime import timedelta import logging from typing import Dict, List import aiohttp import async_timeout from smhi import Smhi from smhi.smhi_lib import SmhiForecastException from homeassistant.components.weather import ( ATTR_...
apache-2.0
DecisionSystemsGroup/DSGos
airootfs/usr/share/DSGos-Installer/DSGos_Installer/installation/systemd_networkd.py
2
4641
#!/usr/bin/env python # -*- coding: utf-8 -*- # # systemd_networkd.py # # Copyright ยฉ 2013-2015 DSGos # # This file is part of DSGos_Installer. # # DSGos_Installer 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 Fou...
mit
google-code-export/pyglet
pyglet/image/codecs/gdiplus.py
28
12535
# ---------------------------------------------------------------------------- # pyglet # Copyright (c) 2006-2008 Alex Holkner # 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
aidanlister/django
django/db/models/lookups.py
194
16328
import inspect from copy import copy from django.utils.functional import cached_property from django.utils.six.moves import range from .query_utils import QueryWrapper class RegisterLookupMixin(object): def _get_lookup(self, lookup_name): try: return self.class_lookups[lookup_name] e...
bsd-3-clause
apixandru/intellij-community
plugins/hg4idea/testData/bin/mercurial/url.py
91
17489
# url.py - HTTP handling for mercurial # # Copyright 2005, 2006, 2007, 2008 Matt Mackall <mpm@selenic.com> # Copyright 2006, 2007 Alexis S. L. Carvalho <alexis@cecm.usp.br> # Copyright 2006 Vadim Gelfer <vadim.gelfer@gmail.com> # # This software may be used and distributed according to the terms of the # GNU General Pu...
apache-2.0
xiaokeng/robotframework
atest/testdata/standard_libraries/remote/remoteserver.py
22
2143
import inspect import sys from SimpleXMLRPCServer import SimpleXMLRPCServer class RemoteServer(SimpleXMLRPCServer): def __init__(self, library, port=8270, port_file=None): SimpleXMLRPCServer.__init__(self, ('127.0.0.1', int(port))) self.library = library self._shutdown = False sel...
apache-2.0
omegix/ML256-Door-Auth
lib/quick2wire/i2c_ctypes.py
3
1763
# Warning: not part of the published Quick2Wire API. # # Converted from i2c.h and i2c-dev.h # I2C only, no SMB definitions from ctypes import c_int, c_uint16, c_ushort, c_short, c_ubyte, c_char, POINTER, Structure # /usr/include/linux/i2c-dev.h: 38 class i2c_msg(Structure): """<linux/i2c-dev.h> struct i2c_msg""" ...
gpl-2.0
int19h/PTVS
Python/Product/Miniconda/Miniconda3-x64/Tools/scripts/byext.py
15
3904
#! /usr/bin/env python3 """Show file statistics by extension.""" import os import sys class Stats: def __init__(self): self.stats = {} def statargs(self, args): for arg in args: if os.path.isdir(arg): self.statdir(arg) elif os.path.isfile(arg): ...
apache-2.0
timopulkkinen/BubbleFish
tools/json_schema_compiler/json_schema_test.py
8
1595
#!/usr/bin/env python # 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. import json_schema import json_schema_test import unittest class JsonSchemaUnittest(unittest.TestCase): def testNocompile(self):...
bsd-3-clause
ypwalter/fxos-certsuite
mcts/web-platform-tests/tests/tools/wptserve/wptserve/router.py
10
5745
import itertools import logging import re import types logger = logging.getLogger("wptserve") logger.setLevel(logging.DEBUG) any_method = object() class RouteTokenizer(object): def literal(self, scanner, token): return ("literal", token) def slash(self, scanner, token): return ("slash", None...
mpl-2.0
maxalbert/bokeh
bokeh/compat/mplexporter/renderers/vincent_renderer.py
64
1922
import warnings from .base import Renderer from ..exporter import Exporter class VincentRenderer(Renderer): def open_figure(self, fig, props): self.chart = None self.figwidth = int(props['figwidth'] * props['dpi']) self.figheight = int(props['figheight'] * props['dpi']) def draw_line(...
bsd-3-clause
skg-net/ansible
lib/ansible/modules/storage/netapp/netapp_e_asup.py
4
11216
#!/usr/bin/python # (c) 2018, NetApp, 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 ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], ...
gpl-3.0
clumsy/intellij-community
python/lib/Lib/site-packages/django/contrib/gis/shortcuts.py
317
1161
import cStringIO, zipfile from django.conf import settings from django.http import HttpResponse from django.template import loader def compress_kml(kml): "Returns compressed KMZ from the given KML string." kmz = cStringIO.StringIO() zf = zipfile.ZipFile(kmz, 'a', zipfile.ZIP_DEFLATED) zf.writestr('doc....
apache-2.0
xq262144/hue
desktop/core/ext-py/pycrypto-2.6.1/lib/Crypto/SelfTest/Protocol/__init__.py
116
1751
# -*- coding: utf-8 -*- # # SelfTest/Protocol/__init__.py: Self-tests for Crypto.Protocol # # Written in 2008 by Dwayne C. Litzenberger <dlitz@dlitz.net> # # =================================================================== # The contents of this file are dedicated to the public domain. To # the extent that dedicat...
apache-2.0
zdary/intellij-community
plugins/hg4idea/testData/bin/mercurial/extensions.py
91
10949
# extensions.py - extension handling for mercurial # # Copyright 2005-2007 Matt Mackall <mpm@selenic.com> # # This software may be used and distributed according to the terms of the # GNU General Public License version 2 or any later version. import imp, os import util, cmdutil, error from i18n import _, gettext _ext...
apache-2.0
tam10/nmr
nmr.py
1
33679
# -*- coding: utf-8 -*- """ Created on Thu Jul 6 11:50:10 2017 @author: Tristan Mackenzie QNMR 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...
gpl-3.0
kennethgillen/ansible
lib/ansible/modules/network/eos/eos_banner.py
1
5522
#!/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
ProfessorX/Config
.PyCharm30/system/python_stubs/-1247971765/PyQt4/QtGui/QTextList.py
1
1994
# encoding: utf-8 # module PyQt4.QtGui # from /usr/lib/python3/dist-packages/PyQt4/QtGui.cpython-34m-x86_64-linux-gnu.so # by generator 1.135 # no doc # imports import PyQt4.QtCore as __PyQt4_QtCore from .QTextBlockGroup import QTextBlockGroup class QTextList(QTextBlockGroup): """ QTextList(QTextDocument) """ ...
gpl-2.0
shriker/sublime
Packages/backrefs/st3/backrefs/common_tokens.py
2
1495
""" Common tokens shared between the different regex modules. Licensed under MIT Copyright (c) 2015 - 2016 Isaac Muse <isaacmuse@gmail.com> """ import re # Unicode string related references utokens = { "replace_tokens": set("cCElL"), "verbose_tokens": set("# "), "empty": "", "ls_bracket": "[", "rs...
mit