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
eiginn/coreemu
daemon/src/setup.py
11
1148
# Copyright (c)2010-2012 the Boeing Company. # See the LICENSE file included in this distribution. import os, glob from distutils.core import setup, Extension netns = Extension("netns", sources = ["netnsmodule.c", "netns.c"]) vcmd = Extension("vcmd", sources = ["vcmdmodule.c", ...
bsd-2-clause
aavanian/bokeh
bokeh/tests/test_layouts.py
5
2610
import bokeh.layouts as lyt import pytest from bokeh.core.enums import SizingMode from bokeh.plotting import figure from bokeh.layouts import gridplot from bokeh.models import Column, Row, Spacer def test_gridplot_merge_tools_flat(): p1, p2, p3, p4 = figure(), figure(), figure(), figure() lyt.gridplot([[p1, ...
bsd-3-clause
PetrDlouhy/django
tests/template_tests/filter_tests/test_date.py
207
2534
from datetime import datetime, time from django.template.defaultfilters import date from django.test import SimpleTestCase from django.utils import timezone from ..utils import setup from .timezone_utils import TimezoneTestCase class DateTests(TimezoneTestCase): @setup({'date01': '{{ d|date:"m" }}'}) def t...
bsd-3-clause
icemac/pytest
testing/test_runner_xunit.py
202
7133
# # test correct setup/teardowns at # module, class, and instance level def test_module_and_function_setup(testdir): reprec = testdir.inline_runsource(""" modlevel = [] def setup_module(module): assert not modlevel module.modlevel.append(42) def teardown_module(modu...
mit
davidl1/hortonworks-extension
build/contrib/hod/testing/testTypes.py
182
7386
#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 use thi...
apache-2.0
thehyve/variant
eggs/django-1.3.1-py2.7.egg/django/core/files/temp.py
536
1819
""" The temp module provides a NamedTemporaryFile that can be re-opened on any platform. Most platforms use the standard Python tempfile.TemporaryFile class, but MS Windows users are given a custom class. This is needed because in Windows NT, the default implementation of NamedTemporaryFile uses the O_TEMPORARY flag, ...
apache-2.0
v-iam/azure-sdk-for-python
azure-batch/azure/batch/models/certificate_list_options.py
3
2161
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
mit
jsaponara/opentaxforms
opentaxforms/ut.py
1
14660
from __future__ import print_function import logging import os import pkg_resources import re import six import sys from collections import ( namedtuple as ntuple, defaultdict as ddict, OrderedDict as odict) from datetime import datetime from os.path import join as pathjoin, exists from pint import UnitRegi...
agpl-3.0
youprofit/django-cms
cms/utils/urlutils.py
46
2683
# -*- coding: utf-8 -*- import re from django.conf import settings from django.core.urlresolvers import reverse from django.utils.encoding import force_text from django.utils.http import urlencode from django.utils.six.moves.urllib.parse import urlparse from cms.utils.conf import get_cms_setting # checks validity of...
bsd-3-clause
SnabbCo/neutron
neutron/openstack/common/rpc/impl_zmq.py
6
26443
# Copyright 2011 Cloudscaling Group, 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 applicabl...
apache-2.0
l0b0/cds-invenio-vengmark
modules/bibharvest/lib/oai_repository_admin.py
4
30974
## This file is part of CDS Invenio. ## Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 CERN. ## ## CDS 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 (...
gpl-2.0
sbailey/redrock
py/redrock/fitz.py
1
7113
""" redrock.fitz ============ Functions for fitting minima of chi^2 results. """ from __future__ import absolute_import, division, print_function import numpy as np import scipy.constants import scipy.special from . import constants from .rebin import rebin_template from .zscan import calc_zchi2_one, spectral_dat...
bsd-3-clause
ludobox/ludobox
server/ludobox/history.py
2
5286
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Record and manage file changes and keep track of history. Key concepts are : - events : everytime somethin is changed, we use this event - history : the whole thread of events that applies to a page For each event, a unique SHA id is created (like git https://stackove...
agpl-3.0
pgmcd/ansible
lib/ansible/compat/tests/mock.py
258
1241
# (c) 2014, Toshio Kuratomi <tkuratomi@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...
gpl-3.0
sysadmind/ansible-modules-extras
cloud/openstack/os_user_role.py
24
6078
#!/usr/bin/python # Copyright (c) 2016 IBM # # This module 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 software is distrib...
gpl-3.0
potsmaster/cinder
cinder/volume/drivers/dothill/dothill_client.py
1
12318
# Copyright 2014 Objectif Libre # Copyright 2015 DotHill Systems # # 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
sgtsi-jenny/sales_and_inventory
ionicons-2.0.1/builder/scripts/eotlitetool.py
374
17505
#!/usr/bin/env python # ***** BEGIN LICENSE BLOCK ***** # Version: MPL 1.1/GPL 2.0/LGPL 2.1 # # The contents of this file are subject to the Mozilla Public License Version # 1.1 (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.mozil...
mit
bettiolo/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/common/system/stack_utils_unittest.py
124
2709
# Copyright (C) 2011 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
ttsirkia/a-plus
exercise/tests_cache.py
2
9577
from lib.testdata import CourseTestCase from course.models import CourseModule, LearningObjectCategory from .cache.content import CachedContent from .cache.hierarchy import PreviousIterator from .cache.points import CachedPoints from .models import BaseExercise, StaticExercise, Submission class CachedContentTest(Cour...
gpl-3.0
BeATz-UnKNoWN/python-for-android
python3-alpha/python3-src/Lib/ctypes/test/test_array_in_pointer.py
170
1738
import unittest from ctypes import * from binascii import hexlify import re def dump(obj): # helper function to dump memory contents in hex, with a hyphen # between the bytes. h = hexlify(memoryview(obj)).decode() return re.sub(r"(..)", r"\1-", h)[:-1] class Value(Structure): _fields_ = [("val", ...
apache-2.0
cbitstech/Purple-Robot-Django
management/commands/extractors/builtin_rawlocationprobeeventlog.py
1
2943
# pylint: disable=line-too-long import datetime import psycopg2 import pytz CREATE_PROBE_TABLE_SQL = 'CREATE TABLE builtin_rawlocationprobeeventlog(id SERIAL PRIMARY KEY, user_id TEXT, guid TEXT, timestamp BIGINT, utc_logged TIMESTAMP, provider_status TEXT, log_event TEXT, satellites BIGINT);' CREATE_PROBE_USER_ID_IN...
gpl-3.0
shubhamgupta123/erpnext
erpnext/config/non_profit.py
8
1775
from __future__ import unicode_literals from frappe import _ def get_data(): return [ { "label": _("Chapter"), "icon": "fa fa-star", "items": [ { "type": "doctype", "name": "Chapter", "description": _("Chapter information."), } ] }, { "label": _("Membership"), "items": [...
gpl-3.0
ryansb/boto
boto/sqs/bigmessage.py
170
4729
# Copyright (c) 2013 Mitch Garnaat http://garnaat.org/ # Copyright (c) 2013 Amazon.com, Inc. or its affiliates. # # 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, includin...
mit
remynguyen96/webpack-layout
Carmen/node_modules/node-gyp/gyp/pylib/gyp/easy_xml.py
1558
4945
# Copyright (c) 2011 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import re import os def XmlToString(content, encoding='utf-8', pretty=False): """ Writes the XML content to disk, touching the file only if it has changed. ...
mit
thesuperzapper/tensorflow
tensorflow/python/training/gradient_descent.py
99
2907
# 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
qwefi/nova
tools/regression_tester.py
14
3537
#!/usr/bin/env python # vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright (c) 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 # ...
apache-2.0
cloudnull/eventlet_wsgi
example_app/app.py
1
3150
# ============================================================================= # Copyright [2014] [Kevin Carter] # License Information : # This software has no warranty, it is provided 'as is'. It is your # responsibility to validate the behavior of the routines and its accuracy # using the code provided. Consult the ...
gpl-3.0
HousekeepLtd/django
django/core/management/commands/runserver.py
203
7383
from __future__ import unicode_literals import errno import os import re import socket import sys from datetime import datetime from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.core.management.base import BaseCommand, CommandError from django.core.servers.basehttp i...
bsd-3-clause
Codepoints/unidump
unidump/__init__.py
1
1861
#!/usr/bin/env python3 """ hexdump(1) for Unicode data """ from typing import IO from unidump.output import sanitize_char, print_line, fill_and_print from unidump.env import Env VERSION = '1.1.3' def unidump(inbytes: IO[bytes], env: Env) -> None: """take a list of bytes and print their Unicode codepoints ...
mit
tianon/hy
tests/compilers/test_ast.py
1
14265
# Copyright (c) 2013 Paul Tagliamonte <paultag@debian.org> # Copyright (c) 2013 Julien Danjou <julien@danjou.info> # # 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, inclu...
mit
burjorjee/evolve-parities
evolveparities.py
1
5098
from contextlib import closing from matplotlib.pyplot import plot, figure, hold, axis, ylabel, xlabel, savefig, title from numpy import sort, logical_xor, transpose, logical_not from numpy.numarray.functions import cumsum, zeros from numpy.random import rand, shuffle from numpy import mod, floor import time import clou...
gpl-3.0
mtp1376/youtube-dl
youtube_dl/extractor/imgur.py
9
3559
from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( int_or_none, js_to_json, mimetype2ext, ExtractorError, ) class ImgurIE(InfoExtractor): _VALID_URL = r'https?://(?:i\.)?imgur\.com/(?P<id>[a-zA-Z0-9]+)(?:\.mp4|\.gifv)?' _TESTS = [{ ...
unlicense
ahmadiga/min_edx
common/test/acceptance/performance/test_studio_performance.py
139
3307
""" Single page performance tests for Studio. """ from bok_choy.web_app_test import WebAppTest, with_cache from ..pages.studio.auto_auth import AutoAuthPage from ..pages.studio.overview import CourseOutlinePage from nose.plugins.attrib import attr @attr(har_mode='explicit') class StudioPagePerformanceTest(WebAppTest)...
agpl-3.0
davipeterlini/routeflow_tcc
pox/tests/unit/openflow/switch_impl_test.py
23
6728
#!/usr/bin/env python import unittest import sys import os.path from copy import copy sys.path.append(os.path.dirname(__file__) + "/../../..") from pox.openflow.libopenflow_01 import * from pox.datapaths.switch import * class MockConnection(object): def __init__(self): self.received = [] @property def la...
apache-2.0
whatsthehubbub/rippleeffect
nousernameregistration/models.py
1
10449
from django.conf import settings try: from django.contrib.auth import get_user_model User = get_user_model() except: pass from django.db import models from django.db import transaction from django.template.loader import render_to_string from django.utils.translation import ugettext_lazy as _ import datet...
mit
patilsangram/erpnext
erpnext/templates/pages/help.py
17
1260
from __future__ import unicode_literals import frappe, json import requests def get_context(context): context.no_cache = 1 settings = frappe.get_doc("Support Settings", "Support Settings") s = settings # Get Started sections sections = json.loads(s.get_started_sections) context.get_started_sections = sections ...
gpl-3.0
xaviercobain88/framework-python
openerp/addons/base/ir/workflow/__init__.py
79
1093
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the...
agpl-3.0
terkaa/linuxcnc
src/hal/user_comps/pyvcp.py
32
3152
#!/usr/bin/env python # This is a component of emc # Copyright 2007 Anders Wallin <anders.wallin@helsinki.fi> # # # 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 versio...
gpl-2.0
who-emro/meerkat_frontend
meerkat_frontend/views/messaging.py
1
15049
""" messaging.py A Flask Blueprint module for Meerkat messaging services. """ from flask.ext.babel import gettext from flask import Blueprint, render_template from flask import redirect, flash, request, current_app, g, jsonify import random from meerkat_frontend import app, auth import meerkat_libs as libs from .. imp...
mit
Royal-Society-of-New-Zealand/NZ-ORCID-Hub
orcid_api_v3/models/funding_v30.py
1
16706
# coding: utf-8 """ ORCID Member No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 OpenAPI spec version: Latest Generated by: https://github.com/swagger-api/swagger-codegen.git """ import pprint import re # noqa: F401 import six fr...
mit
tvibliani/odoo
addons/note_pad/__openerp__.py
312
1691
# -*- 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
tensorflow/models
official/nlp/transformer/transformer_forward_test.py
1
6052
# Copyright 2021 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
repotvsupertuga/tvsupertuga.repository
plugin.video.playlistLoader/resources/lib/chardet/euckrprober.py
2931
1675
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is mozilla.org code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights Reserved. # # Con...
gpl-2.0
andreif/django
tests/template_tests/filter_tests/test_escapejs.py
324
2055
from __future__ import unicode_literals from django.template.defaultfilters import escapejs_filter from django.test import SimpleTestCase from ..utils import setup class EscapejsTests(SimpleTestCase): @setup({'escapejs01': '{{ a|escapejs }}'}) def test_escapejs01(self): output = self.engine.render_...
bsd-3-clause
babycaseny/poedit
deps/boost/tools/build/test/direct_request_test.py
44
1396
#!/usr/bin/python import BoostBuild t = BoostBuild.Tester(use_test_config=False) # First check some startup. t.write("jamroot.jam", "") t.write("jamfile.jam", """\ exe a : a.cpp b ; lib b : b.cpp ; """) t.write("a.cpp", """\ void # ifdef _WIN32 __declspec(dllimport) # endif foo(); int main() { foo(); } """) t.wri...
mit
ryangallen/django
django/contrib/gis/sitemaps/views.py
341
2421
from __future__ import unicode_literals from django.apps import apps from django.contrib.gis.db.models.fields import GeometryField from django.contrib.gis.db.models.functions import AsKML, Transform from django.contrib.gis.shortcuts import render_to_kml, render_to_kmz from django.core.exceptions import FieldDoesNotExi...
bsd-3-clause
PrincetonUniversity/pox
pox/lib/packet/eapol.py
47
3220
# Copyright 2011 James McCauley # Copyright 2008 (C) Nicira, 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 ap...
apache-2.0
chand3040/cloud_that
common/test/acceptance/fixtures/base.py
148
6165
""" Common code shared by course and library fixtures. """ import re import requests import json from lazy import lazy from . import STUDIO_BASE_URL class StudioApiLoginError(Exception): """ Error occurred while logging in to the Studio API. """ pass class StudioApiFixture(object): """ Base...
agpl-3.0
coursemdetw/2014c2
w2/static/Brython2.0.0-20140209-164925/Lib/signal.py
743
1646
"""This module provides mechanisms to use signal handlers in Python. Functions: alarm() -- cause SIGALRM after a specified time [Unix only] setitimer() -- cause a signal (described below) after a specified float time and the timer may restart then [Unix only] getitimer() -- get current value of timer [...
gpl-2.0
jelly/calibre
src/calibre/utils/resources.py
1
3853
#!/usr/bin/env python2 # vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai from __future__ import with_statement __license__ = 'GPL v3' __copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>' __docformat__ = 'restructuredtext en' import __builtin__, sys, os from calibre import config_dir class PathResolver(ob...
gpl-3.0
midospan/profitpy
profit/session/collection.py
18
4963
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright 2007 Troy Melhase, Yichun Wei # Distributed under the terms of the GNU General Public License v2 # Author: Troy Melhase <troy@gci.net> # Yichun Wei <yichun.wei@gmail.com> import os from cPickle import PicklingError, UnpicklingError, dump, load from P...
gpl-2.0
areeda/gwpy
gwpy/timeseries/io/core.py
3
4692
# -*- coding: utf-8 -*- # Copyright (C) Duncan Macleod (2018-2020) # # This file is part of GWpy. # # GWpy 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
andmos/ansible
test/units/modules/network/ingate/test_ig_config.py
50
8319
# -*- coding: utf-8 -*- # Copyright (c) 2018, Ingate Systems AB # # 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 opti...
gpl-3.0
goldsborough/.emacs
.emacs.d/.python-environments/default/lib/python3.5/site-packages/setuptools/command/install_scripts.py
505
2231
from distutils import log import distutils.command.install_scripts as orig import os from pkg_resources import Distribution, PathMetadata, ensure_directory class install_scripts(orig.install_scripts): """Do normal script install, plus any egg_info wrapper scripts""" def initialize_options(self): ori...
mit
sarvex/django
django/test/utils.py
14
20974
import logging import re import sys import time import warnings from contextlib import contextmanager from functools import wraps from unittest import skipIf, skipUnless from xml.dom.minidom import Node, parseString from django.apps import apps from django.conf import UserSettingsHolder, settings from django.core impo...
bsd-3-clause
molgun/oclapi
django-nonrel/ocl/mappings/views.py
4
15934
from django.core.exceptions import ValidationError from django.db.models import Q from django.http import HttpResponse from rest_framework import mixins, status from rest_framework.generics import RetrieveAPIView, ListAPIView, CreateAPIView, UpdateAPIView, DestroyAPIView from rest_framework.response import Response fro...
mpl-2.0
nicky-ji/edx-nicky
lms/lib/comment_client/models.py
27
5994
import logging from .utils import extract, perform_request, CommentClientRequestError log = logging.getLogger(__name__) class Model(object): accessible_fields = ['id'] updatable_fields = ['id'] initializable_fields = ['id'] base_url = None default_retrieve_params = {} metric_tag_fields = [...
agpl-3.0
gymnasium/edx-platform
common/lib/xmodule/xmodule/conditional_module.py
8
15152
"""Conditional module is the xmodule, which you can use for disabling some xmodules by conditions. """ import json import logging from lazy import lazy from lxml import etree from pkg_resources import resource_string from six import text_type from opaque_keys.edx.locator import BlockUsageLocator from web_fragments.f...
agpl-3.0
thaines/rfam
bin/prman_AlfParser.py
1
9166
import pyparsing as pp import re import copy class prman_AlfParser: def __init__(self): self.keywords = ['Job', 'Task', 'RemoteCmd'] def parseFile(self, fileText): commands = self.__parseCommandStructure(fileText, 0, isStart = True) #print(commands) textureCmds, Cmds, frames ...
gpl-3.0
gshivani/ansible-modules-extras
cloud/misc/virt.py
8
14024
#!/usr/bin/python # -*- coding: utf-8 -*- """ Virt management features Copyright 2007, 2012 Red Hat, Inc Michael DeHaan <michael.dehaan@gmail.com> Seth Vidal <skvidal@fedoraproject.org> This software may be freely redistributed under the terms of the GNU general public license. You should have received a copy of th...
gpl-3.0
Tribler/decentralized-mortgage-market
market/models/investment.py
2
2937
from enum import Enum as PyEnum from base64 import urlsafe_b64encode from storm.properties import Int, Float, RawStr from storm.references import ReferenceSet from protobuf_to_dict import dict_to_protobuf, protobuf_to_dict from market.community.market.conversion_pb2 import Investment as InvestmentPB from market.datab...
gpl-3.0
sy0302/lammps_qtb
python/examples/viz_atomeye.py
25
1913
#!/usr/bin/env python -i # preceeding line should have path for Python on your machine # viz_atomeye.py # Purpose: viz running LAMMPS simulation via AtomEye # Syntax: viz_atomeye.py in.lammps Nfreq Nsteps # in.lammps = LAMMPS input script # Nfreq = dump and viz shapshot every this many steps # ...
gpl-2.0
neerajvashistha/pa-dude
lib/python2.7/site-packages/docutils/readers/pep.py
136
1555
# $Id: pep.py 7320 2012-01-19 22:33:02Z milde $ # Author: David Goodger <goodger@python.org> # Copyright: This module has been placed in the public domain. """ Python Enhancement Proposal (PEP) Reader. """ __docformat__ = 'reStructuredText' from docutils.readers import standalone from docutils.transforms import pep...
mit
jokajak/itweb
data/env/lib/python2.6/site-packages/MarkupSafe-0.11-py2.6-linux-x86_64.egg/markupsafe/tests.py
24
2610
import gc import unittest from markupsafe import Markup, escape, escape_silent class MarkupTestCase(unittest.TestCase): def test_markup_operations(self): # adding two strings should escape the unsafe one unsafe = '<script type="application/x-some-script">alert("foo");</script>' safe = Mar...
gpl-3.0
xjnny/NRPhoto
node_modules/node-gyp/gyp/pylib/gyp/__init__.py
1524
22178
#!/usr/bin/env python # Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import copy import gyp.input import optparse import os.path import re import shlex import sys import traceback from gyp.common import GypErr...
gpl-2.0
Joergen/olympia
apps/pages/views.py
15
2236
from collections import defaultdict from django.conf import settings from django.shortcuts import render from devhub.models import ActivityLog from users.models import UserProfile def credits(request): developers = (UserProfile.objects .exclude(display_name=None) .filter(gro...
bsd-3-clause
trishnaguha/ansible
lib/ansible/modules/cloud/google/gcp_spanner_instance_facts.py
4
5935
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (C) 2017 Google # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # ---------------------------------------------------------------------------- # # *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** # ...
gpl-3.0
resmo/ansible
test/units/config/test_data.py
113
1266
# Make coding more python3-ish from __future__ import (absolute_import, division, print_function) __metaclass__ = type from units.compat import unittest from ansible.config.data import ConfigData from ansible.config.manager import Setting mykey = Setting('mykey', 'myvalue', 'test', 'string') mykey2 = Setting('mykey...
gpl-3.0
rainysia/dotfiles
doc/python/test/selenium_localchromeff_remoteIE.py
1
1961
#!/usr/bin/env python # coding=utf-8 #chrome localhost ''' import os from selenium import webdriver chromedriver = "/home/softs/selenium/chromedriver" os.environ["webdriver.chrome.driver"] = chromedriver driver = webdriver.Chrome(chromedriver) driver.get("http://baidu.com") driver.quit() ''' #firefox(iceweasel) localh...
mit
CanalTP/navitia
source/jormungandr/jormungandr/scenarios/tests/journey_compare_tests.py
1
43791
# Copyright (c) 2001-2014, Canal TP and/or its affiliates. All rights reserved. # # This file is part of Navitia, # the software to build cool stuff with public transport. # # Hope you'll enjoy and contribute to this project, # powered by Canal TP (www.canaltp.fr). # Help us simplify mobility and open public tr...
agpl-3.0
frankito9999/Ecommerce-OAuth-Stripe-Bitcoin
node_modules/laravel-elixir/node_modules/gulp-sass/node_modules/node-sass/node_modules/pangyp/gyp/pylib/gyp/MSVSToolFile.py
2736
1804
# 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. """Visual Studio project reader/writer.""" import gyp.common import gyp.easy_xml as easy_xml class Writer(object): """Visual Studio XML tool file writer.""" ...
mit
jatinmistry13/pattern
pattern/web/pdf/pdfdevice.py
56
5319
#!/usr/bin/env python2 import sys from utils import mult_matrix, translate_matrix from utils import enc, bbox2str from pdffont import PDFUnicodeNotDefined ## PDFDevice ## class PDFDevice(object): debug = 0 def __init__(self, rsrcmgr): self.rsrcmgr = rsrcmgr self.ctm = None return ...
bsd-3-clause
ami/lob-python
lob/api_requestor.py
1
2714
import requests import lob import json import resource from lob import error from version import VERSION def _is_file_like(obj): """ Checks if an object is file-like enough to be sent to requests. In particular, file, StringIO and cStringIO objects are file-like. Refs http://stackoverflow.com/question...
mit
jupierce/openshift-tools
openshift/installer/vendored/openshift-ansible-3.4.40/lookup_plugins/oo_option.py
37
2602
#!/usr/bin/env python2 # -*- coding: utf-8 -*- # vim: expandtab:tabstop=4:shiftwidth=4 ''' oo_option lookup plugin for openshift-ansible Usage: - debug: msg: "{{ lookup('oo_option', '<key>') | default('<default_value>', True) }}" This returns, by order of priority: * if it exists, the `cli_<key>` ansible...
apache-2.0
igemsoftware/SYSU-Software2013
project/Python27_32/Lib/tabnanny.py
394
11336
#! /usr/bin/env python """The Tab Nanny despises ambiguous indentation. She knows no mercy. tabnanny -- Detection of ambiguous indentation For the time being this module is intended to be called as a script. However it is possible to import it into an IDE and use the function check() described below. Warning: The ...
mit
eerwitt/tensorflow
tensorflow/contrib/learn/python/learn/utils/saved_model_export_utils_test.py
20
29102
# 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
castedo/celauth
celauth/providers.py
1
4151
import urlparse from openid.consumer import consumer from openid.extensions import sreg, ax from celauth import OpenIDCase from celauth.dj.celauth.openid_store import DjangoOpenIDStore class OpenIDChoices(object): def __init__(self, data): self.data = data def ids(self, id_prefix=''): return [...
mit
ganescoo/Django-facebook
docs/docs_env/Lib/encodings/iso8859_1.py
593
13432
""" Python Character Mapping Codec iso8859_1 generated from 'MAPPINGS/ISO8859/8859-1.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,errors='...
bsd-3-clause
gisce/OCB
addons/google_base_account/google_base_account.py
53
1297
# -*- 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
hassanabidpk/django
tests/queries/models.py
91
17678
""" Various complex queries that have been problematic in the past. """ from __future__ import unicode_literals import threading from django.db import models from django.utils import six from django.utils.encoding import python_2_unicode_compatible class DumbCategory(models.Model): pass class ProxyCategory(Du...
bsd-3-clause
IXgnas/dixcovery_kernel
tools/perf/scripts/python/netdev-times.py
11271
15048
# Display a process of packets and processed time. # It helps us to investigate networking or network device. # # options # tx: show only tx chart # rx: show only rx chart # dev=: show only thing related to specified device # debug: work with debug mode. It shows buffer status. import os import sys sys.path.append(os...
gpl-3.0
shahar-stratoscale/nova
nova/tests/objects/test_instance_group.py
8
13653
# Copyright (c) 2013 OpenStack Foundation # # 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
mjames-upc/python-awips
dynamicserialize/dstypes/com/raytheon/uf/common/site/notify/SiteActivationNotification.py
1
1716
## ## # # SOFTWARE HISTORY # # Date Ticket# Engineer Description # ------------ ---------- ----------- -------------------------- # 09/10/14 #3623 randerso Manually created, do not regenerate # ## class SiteActivationNotification(object): def __ini...
bsd-3-clause
Ratheronfire/YouTube-Playlist-Manager---Kodi
lib/requests/packages/chardet/euctwfreq.py
3133
34872
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Communicator client code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights R...
gpl-2.0
maheshp/novatest
nova/virt/baremetal/base.py
10
2335
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright (c) 2012 NTT DOCOMO, INC. # Copyright (c) 2011 University of Southern California / ISI # 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 obta...
apache-2.0
kustodian/ansible-modules-core
commands/shell.py
60
2743
# There is actually no actual shell module source, when you use 'shell' in ansible, # it runs the 'command' module with special arguments and it behaves differently. # See the command source and the comment "#USE_SHELL". DOCUMENTATION = ''' --- module: shell short_description: Execute commands in nodes. description: ...
gpl-3.0
reybalgs/PyRecipe-4-U
models/recipemodel.py
1
3188
############################################################################### # # recipemodel.py # # Provides the class model for a recipe. The class model is passed around in # the application proper. # ############################################################################### import simplejson as json class ...
gpl-3.0
Entropy512/libsigrokdecode
decoders/eeprom93xx/__init__.py
7
1168
## ## This file is part of the libsigrokdecode project. ## ## Copyright (C) 2017 Kevin Redon <kingkevin@cuvoodoo.info> ## ## 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 2 of t...
gpl-3.0
rbuffat/pyidf
tests/test_controllerwatercoil.py
1
2641
import os import tempfile import unittest import logging from pyidf import ValidationLevel import pyidf from pyidf.idf import IDF from pyidf.controllers import ControllerWaterCoil log = logging.getLogger(__name__) class TestControllerWaterCoil(unittest.TestCase): def setUp(self): self.fd, self.path = tem...
apache-2.0
zabracks/sshuttle
src/ssnet.py
7
18201
import struct import socket import errno import select import os if not globals().get('skip_imports'): from helpers import log, debug1, debug2, debug3, Fatal MAX_CHANNEL = 65535 # these don't exist in the socket module in python 2.3! SHUT_RD = 0 SHUT_WR = 1 SHUT_RDWR = 2 HDR_LEN = 8 CMD_EXIT = 0x4200 CMD_PING...
lgpl-2.1
goanpeca/mongokit
tests/test_versioned.py
3
15067
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2009-2011, Nicolas Clairon # 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 abov...
bsd-3-clause
collective/eden
modules/s3db/doc.py
2
32300
# -*- coding: utf-8 -*- """ Sahana Eden Document Library @copyright: 2011-2014 (c) Sahana Software Foundation @license: MIT 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 wi...
mit
Jonekee/chromium.src
tools/telemetry/telemetry/user_story/shared_user_story_state.py
15
2183
# Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. class SharedUserStoryState(object): """A class that manages the test state across multiple user stories. It's styled on unittest.TestCase for handling t...
bsd-3-clause
openstack/sahara
sahara/service/api/v2/data_sources.py
4
1194
# Copyright (c) 2016 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 agreed to in writ...
apache-2.0
evansd/django
django/template/base.py
15
38221
""" This is the Django template system. How it works: The Lexer.tokenize() function converts a template string (i.e., a string containing markup with custom template tags) to tokens, which can be either plain text (TOKEN_TEXT), variables (TOKEN_VAR) or block statements (TOKEN_BLOCK). The Parser() class takes a list ...
bsd-3-clause
sloria/sphinx-issues
test_sphinx_issues.py
1
4598
from tempfile import mkdtemp from shutil import rmtree try: from unittest.mock import Mock except ImportError: from unittest.mock import Mock from sphinx.application import Sphinx from sphinx_issues import ( issue_role, user_role, pr_role, cve_role, commit_role, setup as issues_setup, ...
mit
Ichag/odoo
addons/account_asset/wizard/__init__.py
445
1122
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of t...
agpl-3.0
pavelchristof/gomoku-ai
third_party/llvm/expand_cmake_vars.py
168
2679
# 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
JackonYang/shadowsocks
shadowsocks/crypto/sodium.py
1032
3778
#!/usr/bin/env python # # Copyright 2015 clowwindy # # 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
hyperized/ansible
test/units/parsing/yaml/test_loader.py
55
17407
# coding: utf-8 # (c) 2015, Toshio Kuratomi <tkuratomi@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 o...
gpl-3.0