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
onlynone/Yumpy
yum/fssnapshots.py
3
8990
import os import fnmatch import time import subprocess try: import lvm # Check that lvm2 is at least 2.2.99... In theory hacked versions of # .98 work, but meh. _ver = lvm.getVersion() # Looks liks: 2.02.84(2) (2011-02-09) _ver = _ver.split()[0] _ver = _ver.split('(')[0] _ver = tu...
gpl-2.0
neiljdo/readysaster-icannhas-web
readysaster-icannhas-web/users/views.py
1
2241
# -*- coding: utf-8 -*- # Import the reverse lookup function from django.core.urlresolvers import reverse # view imports from django.views.generic import DetailView from django.views.generic import RedirectView from django.views.generic import UpdateView from django.views.generic import ListView # Only authenticated ...
bsd-3-clause
rpavlik/chromium
state_tracker/state_get.py
4
5827
# Copyright (c) 2001, Stanford University # All rights reserved. # # See the file LICENSE.txt for information on redistributing this software. import sys, re, string sys.path.append( "../glapi_parser" ) import apiutil line_re = re.compile (r'^(\S+)\s+(GL_\S+)\s+(.*)\s*$') extensions_line_re = re.compile(r'^...
bsd-3-clause
XiaodunServerGroup/xiaodun-platform
common/lib/capa/capa/customrender.py
8
3033
""" This has custom renderers: classes that know how to render certain problem tags (e.g. <math> and <solution>) to html. These tags do not have state, so they just get passed the system (for access to render_template), and the xml element. """ from .registry import TagRegistry import logging import re from lxml im...
agpl-3.0
LarsFronius/ansible
lib/ansible/playbook/role/definition.py
11
9059
# (c) 2014 Michael DeHaan, <michael@ansible.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 ve...
gpl-3.0
oasiswork/odoo
addons/hr_recruitment/report/hr_recruitment_report.py
325
4836
# -*- 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
chris-chris/tensorflow
tensorflow/python/util/deprecation.py
6
15050
# 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
grehx/spark-tk
integration-tests/tests/setup.py
12
2347
# vim: set encoding=utf-8 # Copyright (c) 2016 Intel 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 # # Unless require...
apache-2.0
SKIRT/PTS
magic/plot/imagegrid.py
1
106384
# -*- coding: utf8 -*- # ***************************************************************** # ** PTS -- Python Toolkit for working with SKIRT ** # ** © Astronomical Observatory, Ghent University ** # ***************************************************************** ## \package pts.magic.pl...
agpl-3.0
jalonsob/Informes
vizGrimoireJS/utils.py
3
5609
#!/usr/bin/env python # Copyright (C) 2014 Bitergia # # 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 program ...
gpl-3.0
glamp/coffe2py
main.py
1
1282
import sys from IPython.core.interactiveshell import InteractiveShell import pandasjson as json import StringIO if __name__=="__main__": mode = "ipython" line = sys.stdin.readline() shell = InteractiveShell() while line: # explicitly write to stdout sys.stdout.write(line) sys.st...
bsd-2-clause
javachengwc/hue
desktop/core/ext-py/guppy-0.1.10/guppy/heapy/Classifiers.py
37
39160
#._cv_part guppy.heapy.Classifiers class Classifier: def __init__(self, mod, name, cli=None, supers=(), depends=(), with_referrers=False): self.mod = mod self.name = name if cli is not None: self.cli = cli # Set of all super-classifiers (including self). # The partial order is defined in Notes Aug 30 200...
apache-2.0
capntransit/carfree-council
cfcensus2010.py
1
1828
import sys, os, json, time import pandas as pd BOROCODE = {'61' : '1', '05' : '2', '47': '3', '81' : '4', '85': '5'} if (len(sys.argv) < 2): print ("Usage: cfcensus.py census.csv districts.json") exit() censusfile = sys.argv[1] councilfile = sys.argv[2] TRACTCOL = 'BoroCT' # rename this for 2000 census ...
gpl-3.0
immenz/pyload
module/plugins/accounts/SimplyPremiumCom.py
2
1650
# -*- coding: utf-8 -*- from module.common.json_layer import json_loads from module.plugins.Account import Account class SimplyPremiumCom(Account): __name__ = "SimplyPremiumCom" __type__ = "account" __version__ = "0.05" __description__ = """Simply-Premium.com account plugin""" __license__ ...
gpl-3.0
eharney/cinder
cinder/scheduler/filters/capacity_filter.py
1
8982
# Copyright (c) 2012 Intel # Copyright (c) 2012 OpenStack Foundation # Copyright (c) 2015 EMC Corporation # # 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 # #...
apache-2.0
fighterCui/L4ReFiascoOC
l4/pkg/python/contrib/Lib/distutils/cygwinccompiler.py
3
17292
"""distutils.cygwinccompiler Provides the CygwinCCompiler class, a subclass of UnixCCompiler that handles the Cygwin port of the GNU C compiler to Windows. It also contains the Mingw32CCompiler class which handles the mingw32 port of GCC (same as cygwin in no-cygwin mode). """ # problems: # # * if you use a msvc com...
gpl-2.0
lukauskas/scipy
scipy/interpolate/setup.py
106
1596
#!/usr/bin/env python from __future__ import division, print_function, absolute_import from os.path import join def configuration(parent_package='',top_path=None): from numpy.distutils.misc_util import Configuration from numpy.distutils.system_info import get_info lapack_opt = get_info('lapack_opt', not...
bsd-3-clause
hchen1202/django-react
virtualenv/lib/python3.6/site-packages/django/core/mail/backends/console.py
696
1477
""" Email backend that writes messages to console instead of sending them. """ import sys import threading from django.core.mail.backends.base import BaseEmailBackend from django.utils import six class EmailBackend(BaseEmailBackend): def __init__(self, *args, **kwargs): self.stream = kwargs.pop('stream',...
mit
mganeva/mantid
Framework/PythonInterface/test/python/plugins/algorithms/GetNegMuMuonicXRDTest.py
1
7298
# Mantid Repository : https://github.com/mantidproject/mantid # # Copyright &copy; 2018 ISIS Rutherford Appleton Laboratory UKRI, # NScD Oak Ridge National Laboratory, European Spallation Source # & Institut Laue - Langevin # SPDX - License - Identifier: GPL - 3.0 + from __future__ import (absolute_import, divi...
gpl-3.0
komsas/OpenUpgrade
addons/payment_buckaroo/models/buckaroo.py
102
8291
# -*- coding: utf-'8' "-*-" from hashlib import sha1 import logging import urlparse from openerp.addons.payment.models.payment_acquirer import ValidationError from openerp.addons.payment_buckaroo.controllers.main import BuckarooController from openerp.osv import osv, fields from openerp.tools.float_utils import float_...
agpl-3.0
vorushin/FamilyFeed
sources/facebook.py
1
1748
from datetime import datetime import json from urllib2 import urlopen, HTTPError from django.db.models import Max from sources.models import FacebookPost def time(s): return datetime.strptime(s, '%Y-%m-%dT%H:%M:%S+0000') def post_text(item): return item.get('message', u'') + item.get('description', u'') de...
mit
Carpetsmoker/qutebrowser
tests/end2end/features/test_editor_bdd.py
2
2233
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et: # Copyright 2016-2017 Florian Bruhin (The Compiler) <mail@qutebrowser.org> # # This file is part of qutebrowser. # # qutebrowser 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 S...
gpl-3.0
dethos/cloudroutes-service
src/actions/actions/aws-ec2stop/__init__.py
6
1495
#!/usr/bin/python ###################################################################### # Cloud Routes Bridge # ------------------------------------------------------------------- # Actions Module ###################################################################### import boto.ec2 import time def action(**kwargs):...
agpl-3.0
JCBarahona/edX
lms/djangoapps/certificates/views/support.py
52
5649
""" Certificate end-points used by the student support UI. See lms/djangoapps/support for more details. """ import logging from functools import wraps from django.http import ( HttpResponse, HttpResponseBadRequest, HttpResponseForbidden, HttpResponseServerError ) from django.views.decorators.http imp...
agpl-3.0
ESOedX/edx-platform
openedx/core/djangoapps/api_admin/tests/test_models.py
2
6637
# pylint: disable=missing-docstring from __future__ import absolute_import from smtplib import SMTPException import ddt import mock import six from django.db import IntegrityError from django.test import TestCase from openedx.core.djangoapps.api_admin.models import ApiAccessConfig, ApiAccessRequest from openedx.core...
agpl-3.0
davidyezsetz/kuma
vendor/packages/Werkzeug/werkzeug/http.py
6
26015
# -*- coding: utf-8 -*- """ werkzeug.http ~~~~~~~~~~~~~ Werkzeug comes with a bunch of utilties that help Werkzeug to deal with HTTP data. Most of the classes and functions provided by this module are used by the wrappers, but they are useful on their own, too, especially if the response and r...
mpl-2.0
jhawkesworth/ansible
lib/ansible/modules/network/eos/eos_interface.py
23
15169
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2017, Ansible by Red Hat, 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', ...
gpl-3.0
lkorigin/laniakea
src/web/lkweb/decorators.py
4
1120
# -*- coding: utf-8 -*- # # Copyright (C) 2018-2019 Matthias Klumpp <matthias@tenstral.net> # # Licensed under the GNU Lesser General Public License Version 3 # # 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...
gpl-3.0
perkinslr/pypyjs
website/js/pypy.js-0.2.0/lib/modules/distutils/cygwinccompiler.py
8
17829
"""distutils.cygwinccompiler Provides the CygwinCCompiler class, a subclass of UnixCCompiler that handles the Cygwin port of the GNU C compiler to Windows. It also contains the Mingw32CCompiler class which handles the mingw32 port of GCC (same as cygwin in no-cygwin mode). """ # problems: # # * if you use a msvc com...
mit
srajag/nova
nova/api/openstack/compute/plugins/v3/cells.py
3
11616
# Copyright 2011-2012 OpenStack Foundation # All Rights Reserved. # Copyright 2013 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/lic...
apache-2.0
bytedance/fedlearner
web_console_v2/api/test/fedlearner_webconsole/utils/file_manager_test.py
1
9062
# Copyright 2021 The FedLearner 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
HLFH/CouchPotatoServer
couchpotato/core/media/movie/providers/trailer/youtube_dl/extractor/mpora.py
22
1990
from __future__ import unicode_literals import json import re from .common import InfoExtractor from ..utils import int_or_none class MporaIE(InfoExtractor): _VALID_URL = r'^https?://(www\.)?mpora\.(?:com|de)/videos/(?P<id>[^?#/]+)' IE_NAME = 'MPORA' _TEST = { 'url': 'http://mpora.de/videos/AAd...
gpl-3.0
Logicalmars/appengine-keeptrack
pytz/zoneinfo/America/Grand_Turk.py
9
5297
'''tzinfo timezone information for America/Grand_Turk.''' from pytz.tzinfo import DstTzInfo from pytz.tzinfo import memorized_datetime as d from pytz.tzinfo import memorized_ttinfo as i class Grand_Turk(DstTzInfo): '''America/Grand_Turk timezone definition. See datetime.tzinfo for details''' zone = 'America/G...
bsd-3-clause
dya2/python-for-android
python-modules/twisted/twisted/python/dxprofile.py
61
1528
# Copyright (c) 2001-2007 Twisted Matrix Laboratories. # See LICENSE for details. """ DEPRECATED since Twisted 8.0. Utility functions for reporting bytecode frequencies to Skip Montanaro's stat collector. This module requires a version of Python build with DYNAMIC_EXCUTION_PROFILE, and optionally DXPAIRS, defined to...
apache-2.0
maniteja123/sympy
sympy/physics/vector/__init__.py
116
1123
__all__ = [] # The following pattern is used below for importing sub-modules: # # 1. "from foo import *". This imports all the names from foo.__all__ into # this module. But, this does not put those names into the __all__ of # this module. This enables "from sympy.physics.vector import ReferenceFrame" to # w...
bsd-3-clause
Phixyn/ZoeyBot
modules/utils.py
1
1119
""" utils.py - Utilities module ZoeyBot - Python IRC Bot Copyright 2012-2014 (c) Phixyn This file is part of ZoeyBot. ZoeyBot is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or ...
gpl-3.0
tangyiyong/odoo
addons/website/controllers/main.py
43
20211
# -*- coding: utf-8 -*- import cStringIO import datetime from itertools import islice import json import xml.etree.ElementTree as ET import logging import re import werkzeug.utils import urllib2 import werkzeug.wrappers from PIL import Image import openerp from openerp.addons.web.controllers.main import WebClient fr...
agpl-3.0
doraemonext/DEOnlineJudge
lib/tools/validator.py
1
1501
# -*- coding: utf-8 -*- import re from django.core.validators import validate_email from django.core.exceptions import ValidationError class MinValue(object): """ 最小长度验证 """ def __init__(self, name, length): self.name = name self.length = length def __call__(self, value, *args, ...
mit
vhaupert/mitmproxy
mitmproxy/proxy/config.py
1
3244
import os import re import typing from OpenSSL import crypto from mitmproxy import certs from mitmproxy import exceptions from mitmproxy import options as moptions from mitmproxy.net import server_spec class HostMatcher: def __init__(self, handle, patterns=tuple()): self.handle = handle self.pat...
mit
hrayr-artunyan/shuup
shuup/reports/admin_module/views.py
2
2404
# -*- coding: utf-8 -*- # This file is part of Shuup. # # Copyright (c) 2012-2016, Shoop Ltd. All rights reserved. # # This source code is licensed under the AGPLv3 license found in the # LICENSE file in the root directory of this source tree. import six from django import forms from django.utils.translation import uge...
agpl-3.0
wagtail/wagtail
wagtail/core/hooks.py
5
2848
from contextlib import ContextDecorator from operator import itemgetter from wagtail.utils.apps import get_app_submodules _hooks = {} def register(hook_name, fn=None, order=0): """ Register hook for ``hook_name``. Can be used as a decorator:: @register('hook_name') def my_hook(...): ...
bsd-3-clause
ppries/tensorflow
tensorflow/python/kernel_tests/edit_distance_op_test.py
21
7875
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
fjbatresv/odoo
addons/mail/mail_message.py
141
47462
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2010-today OpenERP SA (<http://www.openerp.com>) # # This program is free software: you can redistribute it and/or modify # it under the terms o...
agpl-3.0
Omegaphora/external_chromium_org
chrome/test/nacl_test_injection/buildbot_chrome_nacl_stage.py
35
11261
#!/usr/bin/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. """Do all the steps required to build and test against nacl.""" import optparse import os.path import re import shutil import subproc...
bsd-3-clause
hwroitzsch/DayLikeTodayClone
venv/lib/python3.5/site-packages/pip/vcs/bazaar.py
280
4427
from __future__ import absolute_import import logging import os import tempfile import re # TODO: Get this into six.moves.urllib.parse try: from urllib import parse as urllib_parse except ImportError: import urlparse as urllib_parse from pip.utils import rmtree, display_path from pip.vcs import vcs, VersionC...
mit
jjo31/ATHAM-Fluidity
python/fluidity/microphysics/FortranMicrophysicsWrapper.py
1
4818
import os path=os.path.dirname(__file__) def MakeWrapperFiles(field_dict,call_str,pointwise): write_to_file(field_dict,call_str,pointwise) def allocate_str(field_dict): s=""" subroutine allocate_storage(number_of_tracers,n) integer :: n !f2py integer, intent(hide), depend(number_of_tracers) :: n=shape(n...
lgpl-2.1
kubeflow/kfp-tekton
third_party/metadata_envoy/dependency_helper.py
2
1639
# Copyright 2019 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, ...
apache-2.0
ProfessionalIT/maxigenios-website
sdk/google_appengine/lib/django-0.96/django/core/serializers/xml_serializer.py
32
8651
""" XML serializer. """ from django.conf import settings from django.core.serializers import base from django.db import models from django.utils.xmlutils import SimplerXMLGenerator from xml.dom import pulldom class Serializer(base.Serializer): """ Serializes a QuerySet to XML. """ def indent(self...
mit
CartoDB/cartoframes
cartoframes/io/managers/context_manager.py
1
22518
import time import pandas as pd from warnings import warn from carto.auth import APIKeyAuthClient from carto.datasets import DatasetManager from carto.exceptions import CartoException, CartoRateLimitException from carto.sql import SQLClient, BatchSQLClient, CopySQLClient from pyrestcli.exceptions import NotFoundExce...
bsd-3-clause
jlspyaozhongkai/Uter
third_party_backup/Python-2.7.9/Lib/test/test_weakref.py
23
50681
import gc import sys import unittest import UserList import weakref import operator import contextlib import copy from test import test_support # Used in ReferencesTestCase.test_ref_created_during_del() . ref_from_del = None class C: def method(self): pass class Callable: bar = None def __call...
gpl-3.0
mrkn/iTerm2
tools/ply/ply-3.4/test/yacc_badprec3.py
174
1530
# ----------------------------------------------------------------------------- # yacc_badprec3.py # # Bad precedence # ----------------------------------------------------------------------------- import sys if ".." not in sys.path: sys.path.insert(0,"..") import ply.yacc as yacc from calclex import tokens # Parsin...
gpl-2.0
hwjworld/xiaodun-platform
lms/djangoapps/wechat/views.py
1
47459
import logging import urllib from collections import defaultdict from lxml import html from django.conf import settings from django.core.context_processors import csrf from django.core.exceptions import PermissionDenied from django.core.urlresolvers import reverse from django.contrib.auth.models import User, Anonymo...
agpl-3.0
Gustry/inasafe
safe/utilities/resources.py
2
3495
# coding=utf-8 """This module contains utilities for locating application resources (img etc). """ import os import codecs # This import is to enable SIP API V2 # noinspection PyUnresolvedReferences import qgis # pylint: disable=unused-import from PyQt4 import QtCore, uic __copyright__ = "Copyright 2016, The InaSAFE...
gpl-3.0
aboganas/frappe
frappe/commands/translate.py
6
2622
from __future__ import unicode_literals, absolute_import import click import frappe from frappe.commands import pass_context, get_site # translation @click.command('build-message-files') @pass_context def build_message_files(context): "Build message files for translation" import frappe.translate for site in context...
mit
Venturi/cms
env/lib/python2.7/site-packages/phonenumbers/shortdata/region_IL.py
11
1057
"""Auto-generated file, do not edit by hand. IL metadata""" from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata PHONE_METADATA_IL = PhoneMetadata(id='IL', country_code=None, international_prefix=None, general_desc=PhoneNumberDesc(national_number_pattern='1\\d{2,4}', possible_number_pattern='\\...
gpl-2.0
aapav01/android_kernel_samsung_ms013g-2
tools/perf/util/setup.py
4998
1330
#!/usr/bin/python2 from distutils.core import setup, Extension from os import getenv from distutils.command.build_ext import build_ext as _build_ext from distutils.command.install_lib import install_lib as _install_lib class build_ext(_build_ext): def finalize_options(self): _build_ext.finalize_optio...
gpl-2.0
justasabc/python_tutorials
module/beautifulsoup4-4.3.1/bs4/tests/test_builder_registry.py
485
5374
"""Tests of the builder registry.""" import unittest from bs4 import BeautifulSoup from bs4.builder import ( builder_registry as registry, HTMLParserTreeBuilder, TreeBuilderRegistry, ) try: from bs4.builder import HTML5TreeBuilder HTML5LIB_PRESENT = True except ImportError: HTML5LIB_PRESENT =...
gpl-3.0
ovnicraft/openerp-restaurant
hr_timesheet/__openerp__.py
6
2425
# -*- 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
CamelBackNotation/CarnotKE
jyhton/Lib/test/test_inspect.py
10
33875
import re import sys import types import unittest import inspect import linecache import datetime from UserList import UserList from UserDict import UserDict from test.test_support import run_unittest, check_py3k_warnings, is_jython with check_py3k_warnings( ("tuple parameter unpacking has been removed", Synt...
apache-2.0
sahutd/youtube-dl
youtube_dl/extractor/common.py
3
47316
from __future__ import unicode_literals import base64 import datetime import hashlib import json import netrc import os import re import socket import sys import time import xml.etree.ElementTree from ..compat import ( compat_cookiejar, compat_HTTPError, compat_http_client, compat_urllib_error, co...
unlicense
marespiaut/ndifloss
python-twitter/tests/test_trend.py
16
1648
import twitter import unittest import json class TrendTest(unittest.TestCase): SAMPLE_JSON = '''{"name": "Kesuke Miyagi", "query": "Kesuke Miyagi"}''' def _GetSampleTrend(self): return twitter.Trend(name='Kesuke Miyagi', query='Kesuke Miyagi', ...
mit
indrajitr/ansible-modules-extras
cloud/rackspace/rax_mon_check.py
153
11151
#!/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
beni55/edx-platform
common/djangoapps/track/views/segmentio.py
17
10452
"""Handle events that were forwarded from the segment.io webhook integration""" import datetime import json import logging from django.conf import settings from django.contrib.auth.models import User from django.http import HttpResponse from django.views.decorators.http import require_POST from django_future.csrf imp...
agpl-3.0
huntxu/neutron
neutron/tests/unit/agent/linux/openvswitch_firewall/test_rules.py
2
21027
# Copyright 2015 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 # # Unless required by applicable law or agre...
apache-2.0
liangazhou/django-rdp
packages/PyDev/plugins/org.python.pydev.jython_4.4.0.201510052309/Lib/encodings/cp037.py
593
13377
""" Python Character Mapping Codec cp037 generated from 'MAPPINGS/VENDORS/MICSFT/EBCDIC/CP037.TXT' with gencodec.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_table) def decode(self,input...
apache-2.0
google/deepvariant
deepvariant/make_examples_test.py
1
90136
# Copyright 2020 Google LLC. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # 1. Redistributions of source code must retain the above copyright notice, # this list of conditions and the following disclaimer. # #...
bsd-3-clause
mapr/hue
desktop/core/ext-py/Django-1.6.10/django/forms/util.py
107
3776
from __future__ import unicode_literals from django.conf import settings from django.utils.html import format_html, format_html_join from django.utils.encoding import force_text, python_2_unicode_compatible from django.utils import timezone from django.utils.translation import ugettext_lazy as _ from django.utils impo...
apache-2.0
eddiep1101/django-oscar
src/oscar/apps/catalogue/reviews/app.py
58
1122
from django.conf.urls import url from django.contrib.auth.decorators import login_required from oscar.core.application import Application from oscar.core.loading import get_class class ProductReviewsApplication(Application): name = None hidable_feature_name = "reviews" detail_view = get_class('catalogue...
bsd-3-clause
apanju/GMIO_Odoo
addons/website_customer/__openerp__.py
313
1571
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2013-Today OpenERP S.A. (<http://www.openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the term...
agpl-3.0
orangeduck/PyAutoC
Python27/Lib/test/test_weakref.py
35
42138
import gc import sys import unittest import UserList import weakref import operator from test import test_support # Used in ReferencesTestCase.test_ref_created_during_del() . ref_from_del = None class C: def method(self): pass class Callable: bar = None def __call__(self, x): self.bar ...
bsd-2-clause
bzbarsky/servo
tests/wpt/web-platform-tests/css/vendor-imports/mozilla/mozilla-central-reftests/text-decor-3/support/generate-text-emphasis-style-property-tests.py
841
3434
#!/usr/bin/env python # - * - coding: UTF-8 - * - """ This script generates tests text-emphasis-style-property-011 ~ 020 which cover all possible values of text-emphasis-style property, except none and <string>, with horizontal writing mode. It outputs a list of all tests it generated in the format of Mozilla reftest....
mpl-2.0
gdooper/scipy
scipy/fftpack/tests/test_import.py
49
1352
"""Test possibility of patching fftpack with pyfftw. No module source outside of scipy.fftpack should contain an import of the form `from scipy.fftpack import ...`, so that a simple replacement of scipy.fftpack by the corresponding fftw interface completely swaps the two FFT implementations. Because this simply inspe...
bsd-3-clause
mancoast/CPythonPyc_test
cpython/261_test_module.py
51
2085
# Test the module type import unittest from test.test_support import run_unittest import sys ModuleType = type(sys) class ModuleTests(unittest.TestCase): def test_uninitialized(self): # An uninitialized module has no __dict__ or __name__, # and __doc__ is None foo = ModuleType.__new__(Modu...
gpl-3.0
rohit12/opencog
opencog/python/pygephi.py
36
1507
import urllib2 import json class JSONClient(object): def __init__(self, url='http://127.0.0.1:8080/workspace0', autoflush=False): self.url = url self.data = "" self.autoflush = autoflush def flush(self): if len(self.data) > 0: self.__send(self.data) ...
agpl-3.0
camilonos77/bootstrap-form-python-generator
enviroment/lib/python2.7/site-packages/pip/_vendor/html5lib/filters/optionaltags.py
1727
10500
from __future__ import absolute_import, division, unicode_literals from . import _base class Filter(_base.Filter): def slider(self): previous1 = previous2 = None for token in self.source: if previous1 is not None: yield previous2, previous1, token previous2...
gpl-2.0
axbaretto/beam
sdks/python/.tox/docs/lib/python2.7/site-packages/markupsafe/__init__.py
701
10338
# -*- coding: utf-8 -*- """ markupsafe ~~~~~~~~~~ Implements a Markup string. :copyright: (c) 2010 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import re import string from collections import Mapping from markupsafe._compat import text_type, string_types, int_types, \ u...
apache-2.0
Peddle/hue
desktop/core/ext-py/py4j-0.9/src/py4j/tests/java_set_test.py
18
3061
""" Created on Mar 26, 2010 @author: Barthelemy Dagenais """ from __future__ import unicode_literals, absolute_import import unittest from py4j.java_gateway import JavaGateway, GatewayParameters from py4j.tests.java_gateway_test import ( start_example_app_process, safe_shutdown, sleep) class AutoConvertTest(un...
apache-2.0
haad/ansible-modules-extras
system/seport.py
33
9002
#!/usr/bin/python # (c) 2014, Dan Keder <dan.keder@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...
gpl-3.0
jimi-c/ansible
lib/ansible/utils/module_docs_fragments/cnos.py
33
3747
# Copyright (C) 2017 Lenovo, 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. # # Ansi...
gpl-3.0
Klozz/aircrack-ng
scripts/airgraph-ng/graphviz/libOuiParse.py
89
7562
#!/usr/bin/env python __author__ = 'Ben "TheX1le" Smith, Marfi' __email__ = 'thex1le@gmail.com' __website__= '' __date__ = '04/26/2011' __version__ = '2011.4.26' __file__ = 'ouiParse.py' __data__ = 'a class for dealing with the oui txt file' """ ######################################## # # This program and its support...
gpl-2.0
Perferom/android_external_chromium_org
third_party/npapi/npspy/analyze_streams.py
127
3162
# A script for analyzing the output of NPSPY and merging data about streams. import sys def ReadFile(filename, flags='rb'): """Returns the contents of a file.""" file = open(filename, flags) result = file.read() file.close() return result def WriteFile(filename, contents): """Overwrites t...
bsd-3-clause
taliax/easybuild-easyblocks
easybuild/easyblocks/t/tbb.py
5
4276
## # Copyright 2009-2015 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), # with support of Ghent University (http://ugent.be/hpc), # the Flemish Supercomputer Centre (VSC) (https://vscentrum.be/nl/en), # the Hercules foundation (htt...
gpl-2.0
slohse/ansible
lib/ansible/modules/network/f5/bigip_firewall_port_list.py
9
17550
#!/usr/bin/python # -*- 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 ANSIBLE_METADATA = {'metadata_version': '1.1', ...
gpl-3.0
DirtyPiece/dancestudio
Build/Tools/Python27/Lib/idlelib/ParenMatch.py
113
6713
"""ParenMatch -- An IDLE extension for parenthesis matching. When you hit a right paren, the cursor should move briefly to the left paren. Paren here is used generically; the matching applies to parentheses, square brackets, and curly braces. """ from idlelib.HyperParser import HyperParser from idlelib.configHandler...
mit
kbrebanov/ansible
lib/ansible/plugins/cliconf/ironware.py
19
2749
# # (c) 2017 Red Hat 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. # # Ansible is d...
gpl-3.0
LinguList/pyjs-seminar
website/code/align.py
2
2136
# author : Johann-Mattis List # email : mattis.list@uni-marburg.de # created : 2015-07-11 09:19 # modified : 2015-07-11 09:19 """ Wagner-Fisher Algorithmus in Python """ __author__="Johann-Mattis List" __date__="2015-07-11" def wf_align(seqA, seqB): """ Align two sequences using the Wagner-Fisher algori...
gpl-2.0
TimofeyFox/S7270_kernel
tools/perf/scripts/python/check-perf-trace.py
11214
2503
# perf script event handlers, generated by perf script -g python # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # This script tests basic functionality such as flag and symbol # strings, common_xxx() calls back into perf, begin, end, unhandled # events, etc. ...
gpl-2.0
drod2169/Linux-3.10.x
scripts/rt-tester/rt-tester.py
11005
5307
#!/usr/bin/python # # rt-mutex tester # # (C) 2006 Thomas Gleixner <tglx@linutronix.de> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as # published by the Free Software Foundation. # import os import sys import getopt import sh...
gpl-2.0
malayaleecoder/servo
tests/wpt/web-platform-tests/tools/pytest/_pytest/python.py
167
89406
""" Python test discovery, setup and run of test functions. """ import fnmatch import functools import inspect import re import types import sys import py import pytest from _pytest._code.code import TerminalRepr from _pytest.mark import MarkDecorator, MarkerError try: import enum except ImportError: # pragma: n...
mpl-2.0
jhiswin/idiil-closure-library
closure/bin/labs/code/generate_jsdoc.py
222
4318
#!/usr/bin/env python # # Copyright 2013 The Closure Library 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 ...
apache-2.0
aaltinisik/OCBAltinkaya
addons/account_followup/tests/test_account_followup.py
247
10222
import datetime from openerp import tools from openerp.tests.common import TransactionCase from openerp.osv import fields class TestAccountFollowup(TransactionCase): def setUp(self): """ setUp ***""" super(TestAccountFollowup, self).setUp() cr, uid = self.cr, self.uid self...
agpl-3.0
ubirch/aws-tools
virtual-env/lib/python2.7/site-packages/boto/elastictranscoder/exceptions.py
184
1595
# Copyright (c) 2013 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 ...
apache-2.0
bgris/ODL_bgris
lib/python3.5/site-packages/prompt_toolkit/styles/from_dict.py
23
4579
""" Tool for creating styles from a dictionary. This is very similar to the Pygments style dictionary, with some additions: - Support for reverse and blink. - Support for ANSI color names. (These will map directly to the 16 terminal colors.) """ from collections import Mapping from .base import Style, DEFAULT_ATTRS...
gpl-3.0
krader1961/python-mode
pymode/lint.py
6
2211
"""Pylama integration.""" from .environment import env from .utils import silence_stderr import os.path from pylama.lint.extensions import LINTERS try: from pylama.lint.pylama_pylint import Linter LINTERS['pylint'] = Linter() except Exception: # noqa pass def code_check(): """Run pylama and check...
lgpl-3.0
ClearCorp/server-tools
base_import_match/tests/test_import.py
2
2691
# -*- coding: utf-8 -*- # Copyright 2016 Grupo ESOC Ingeniería de Servicios, S.L.U. - Jairo Llopis # Copyright 2016 Tecnativa - Vicent Cubells # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from os import path from openerp.tests.common import TransactionCase PATH = path.join(path.dirname(__file...
agpl-3.0
guschmue/tensorflow
tensorflow/python/tools/optimize_for_inference_test.py
34
13033
# pylint: disable=g-bad-file-header # Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENS...
apache-2.0
mancoast/CPythonPyc_test
cpython/223_test_descr.py
1
90901
# Test enhancements related to descriptors and new-style classes from test_support import verify, vereq, verbose, TestFailed, TESTFN, get_original_stdout from copy import deepcopy import warnings warnings.filterwarnings("ignore", r'complex divmod\(\), // and % are deprecated$', DeprecationWarning, r...
gpl-3.0
hsuantien/scikit-learn
examples/covariance/plot_sparse_cov.py
300
5078
""" ====================================== Sparse inverse covariance estimation ====================================== Using the GraphLasso estimator to learn a covariance and sparse precision from a small number of samples. To estimate a probabilistic model (e.g. a Gaussian model), estimating the precision matrix, t...
bsd-3-clause
louisLouL/pair_trading
capstone_env/lib/python3.6/site-packages/matplotlib/tests/test_collections.py
2
21231
""" Tests specific to the collections module. """ from __future__ import (absolute_import, division, print_function, unicode_literals) import io import numpy as np from numpy.testing import ( assert_array_equal, assert_array_almost_equal, assert_equal) import pytest import matplotlib.pypl...
mit
sthyme/ZFSchizophrenia
BehaviorAnalysis/Alternative_Analyses/Correlation_between_genes/correlations_DISTANCE_betweengenes.py
1
5605
import matplotlib matplotlib.use('Agg') import matplotlib.pylab as plt import matplotlib.colors as mat_col from matplotlib.colors import LinearSegmentedColormap import scipy import scipy.cluster.hierarchy as sch from scipy.cluster.hierarchy import set_link_color_palette import numpy as np import pandas as pd import glo...
mit