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
hynnet/openwrt-mt7620
staging_dir/target-mipsel_r2_uClibc-0.9.33.2/root-ralink/usr/lib/python2.7/encodings/unicode_escape.py
852
1184
""" Python 'unicode-escape' Codec Written by Marc-Andre Lemburg (mal@lemburg.com). (c) Copyright CNRI, All Rights Reserved. NO WARRANTY. """ import codecs ### Codec APIs class Codec(codecs.Codec): # Note: Binding these as C functions will result in the class not # converting them to methods. This is inte...
gpl-2.0
quanghieu/linux-DFI
tools/perf/scripts/python/sctop.py
1996
2102
# system call top # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Periodically displays system-wide system call totals, broken down by # syscall. If a [comm] arg is specified, only syscalls called by # [comm] are displayed. If an [interval] arg is specified,...
gpl-2.0
orymeyer/Flask-Python-GAE-Login-Registration
lib/Werkzeug-0.10.4.dist-info/werkzeug/_reloader.py
116
7938
import os import sys import time import subprocess import threading from itertools import chain from werkzeug._internal import _log from werkzeug._compat import PY2, iteritems, text_type def _iter_module_files(): """This iterates over all relevant Python files. It goes through all loaded files from modules,...
apache-2.0
bslatkin/8-bits
appengine-mapreduce/python/src/mapreduce/lib/pipeline/simplejson/scanner.py
43
2596
#!/usr/bin/env python """JSON token scanner """ import re def _import_c_make_scanner(): try: from mapreduce.lib.simplejson._speedups import make_scanner return make_scanner except ImportError: return None c_make_scanner = _import_c_make_scanner() __all__ = ['make_scanner'] NUMBER_RE = ...
apache-2.0
PGer/incubator-hawq
tools/bin/pythonSrc/PyGreSQL-4.0/tutorial/syscat.py
59
5378
# syscat.py - parses some system catalogs # inspired from the PostgreSQL tutorial # adapted to Python 1995 by Pascal ANDRE print """ __________________________________________________________________ MODULE SYSCAT.PY : PARSES SOME POSTGRESQL SYSTEM CATALOGS This module is designed for being imported from python prom...
apache-2.0
ahmadiga/min_edx
lms/djangoapps/shoppingcart/views.py
64
40908
import logging import datetime import decimal import pytz from ipware.ip import get_ip from django.db.models import Q from django.conf import settings from django.contrib.auth.models import Group from django.shortcuts import redirect from django.http import ( HttpResponse, HttpResponseRedirect, HttpResponseNotFound...
agpl-3.0
vinhlh/bite-project
deps/gdata-python-client/samples/apps/marketplace_sample/gdata/apps/groups/service.py
94
12924
#!/usr/bin/python # # Copyright (C) 2008 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 law...
apache-2.0
firerszd/kbengine
kbe/src/lib/python/Lib/idlelib/AutoCompleteWindow.py
88
17672
""" An auto-completion window for IDLE, used by the AutoComplete extension """ from tkinter import * from idlelib.MultiCall import MC_SHIFT from idlelib.AutoComplete import COMPLETE_FILES, COMPLETE_ATTRIBUTES HIDE_VIRTUAL_EVENT_NAME = "<<autocompletewindow-hide>>" HIDE_SEQUENCES = ("<FocusOut>", "<ButtonPress>") KEYPR...
lgpl-3.0
SivilTaram/edx-platform
common/djangoapps/embargo/migrations/0006_auto__add_field_restrictedcourse_disable_access_check.py
94
7741
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'RestrictedCourse.disable_access_check' db.add_column('emb...
agpl-3.0
Alexey-T/CudaText
app/cudatext.app/Contents/Resources/py/cuda_comments/cd_comments.py
2
17881
''' Plugin for CudaText editor Authors: Andrey Kvichansky (kvichans on github.com) Alexey Torgashin (CudaText) Version: '0.8.9 2021-04-05' ''' import os import cudatext as app from cudatext import ed import cudatext_cmd as cmds import cudax_lib as apx from .cd_p...
mpl-2.0
pbougue/navitia
source/jormungandr/jormungandr/interfaces/v1/Calendars.py
2
4757
# coding=utf-8 # 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 a...
agpl-3.0
TeamBliss-Devices/android_kernel_htc_msm8974
tools/perf/scripts/python/syscall-counts-by-pid.py
11180
1927
# system call counts, by pid # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Displays system-wide system call totals, broken down by syscall. # If a [comm] arg is specified, only syscalls called by [comm] are displayed. import os, sys sys.path.append(os.env...
gpl-2.0
WhySoGeeky/DroidPot
venv/lib/python2.7/site-packages/django/contrib/gis/admin/widgets.py
449
4881
import logging from django.contrib.gis.gdal import GDALException from django.contrib.gis.geos import GEOSException, GEOSGeometry from django.forms.widgets import Textarea from django.template import loader from django.utils import six, translation # Creating a template context that contains Django settings # values n...
mit
ManageIQ/integration_tests
cfme/containers/project.py
3
5378
import attr from navmazing import NavigateToAttribute from navmazing import NavigateToSibling from cfme.common import Taggable from cfme.common import TaggableCollection from cfme.common import TagPageView from cfme.containers.provider import ContainerObjectAllBaseView from cfme.containers.provider import ContainerObj...
gpl-2.0
campbe13/openhatch
vendor/packages/whoosh/src/whoosh/filedb/filestore.py
17
6771
# Copyright 2009 Matt Chaput. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # 1. Redistributions of source code must retain the above copyright notice, # this list of conditions and the...
agpl-3.0
bigswitch/neutron
neutron/tests/fullstack/test_qos.py
1
7375
# 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
sharad/calibre
src/calibre/utils/logging.py
2
5679
from __future__ import with_statement __license__ = 'GPL 3' __copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>' __docformat__ = 'restructuredtext en' 'A simplified logging system' DEBUG = 0 INFO = 1 WARN = 2 ERROR = 3 import sys, traceback, cStringIO from functools import partial from threading import RLock...
gpl-3.0
factorlibre/openerp-server-6.1
openerp/test/__init__.py
14
1099
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2010 OpenERP S.A. http://www.openerp.com # # This program is free software: you can redistribute it and/or modify # it under the terms of the GN...
agpl-3.0
mosbasik/buzhug
javasrc/lib/Jython/Lib/test/test_jsr223.py
23
2151
# XXX Earlier version of this test also tested put, get, eval on the # engine, however this introduced action at a distance where aspects # of the sys state changed (notably sys.stdin.newlines), which then # impacted test_univnewlines later in the regrtest. # # For now, there may be limits in how much we can test Jytho...
bsd-3-clause
joshuamorton/kermit
Course.py
1
5083
""" :Author: Joshua Morton """ class And(object): """ represents a set of prerequisites that must be taken together """ def __init__(self, *components): """ initializes the And object self - the And components: List[Union[Course, Or]] - the set of prerequisites that ...
mit
alsrgv/tensorflow
tensorflow/python/ops/clip_ops_test.py
19
3810
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
raildo/nova
nova/tests/functional/api_sample_tests/test_user_data.py
16
1802
# Copyright 2012 Nebula, Inc. # Copyright 2013 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...
apache-2.0
races1986/SafeLanguage
CEM/wiktionary/meaningtest.py
3
2688
#!/usr/bin/python # -*- coding: utf-8 -*- """Unit tests for meaning.py""" import meaning import unittest class KnownValues(unittest.TestCase): knownParserValues = ( ("*German: [[wichtig]]", [('de','wichtig','',1,False,'')] ), ("*[[Esperanto]]:...
epl-1.0
mcgachey/edx-platform
lms/djangoapps/courseware/tests/test_microsites.py
13
10331
""" Tests related to the Microsites feature """ from django.conf import settings from django.core.urlresolvers import reverse from django.test.utils import override_settings from nose.plugins.attrib import attr from courseware.tests.helpers import LoginEnrollmentTestCase from course_modes.models import CourseMode from...
agpl-3.0
nwchandler/ansible
lib/ansible/module_utils/facts/system/selinux.py
52
3061
# Collect facts related to selinux # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ans...
gpl-3.0
ashutoshvt/psi4
samples/python/mints13/input.py
24
4179
#! test fragment decomposition + to/from_dict import numpy as np import psi4 from psi4.driver import qcdb psi4.set_output_file("output.dat", False) def test_chgmult(expected, cgmpdict, label): rc, rfc, rm, rfm = expected qcdb.compare_integers(rc, cgmpdict['molecular_charge'], label + ': c') qcdb.compare_...
lgpl-3.0
nathanaevitas/odoo
openerp/addons/l10n_hu/__openerp__.py
320
1815
# -*- encoding: utf-8 -*- ############################################################################## # # Copyright (C) 2014 InnOpen Group Kft (<http://www.innopen.eu>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as ...
agpl-3.0
firerszd/kbengine
kbe/res/scripts/common/Lib/multiprocessing/semaphore_tracker.py
100
4820
# # On Unix we run a server process which keeps track of unlinked # semaphores. The server ignores SIGINT and SIGTERM and reads from a # pipe. Every other process of the program has a copy of the writable # end of the pipe, so we get EOF when all other processes have exited. # Then the server process unlinks any remai...
lgpl-3.0
nvl1109/openembeded
recipes/python/python-pyyaml/setup.py
69
1936
NAME = 'PyYAML' VERSION = '3.06' DESCRIPTION = "YAML parser and emitter for Python" LONG_DESCRIPTION = """\ YAML is a data serialization format designed for human readability and interaction with scripting languages. PyYAML is a YAML parser and emitter for Python. PyYAML features a complete YAML 1.1 parser, Unicode s...
mit
olehermanse/sim_game
sim_game/geometry.py
1
2921
import math def limit(number, lower, upper): assert lower < upper or (lower is None or upper is None) if lower and number < lower: number = lower if upper and number > upper: number = upper # TODO: remove these asserts and make tests assert number <= upper or not upper assert nu...
mit
sometallgit/AutoUploader
Python27/Lib/site-packages/tests/test__pkce.py
15
1954
# Copyright 2016 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 ...
mit
ekcs/congress
thirdparty/antlr3-antlr-3.5/runtime/Python/tests/t054main.py
16
7926
# -*- coding: utf-8 -*- import unittest import textwrap import antlr3 import antlr3.tree import testbase import sys from StringIO import StringIO class T(testbase.ANTLRTest): def setUp(self): self.oldPath = sys.path[:] sys.path.insert(0, self.baseDir) def tearDown(self): sys.path = s...
apache-2.0
si618/pi-time
node_modules/grunt-pylint/tasks/lib/pylint/test/functional/inherit_non_class.py
3
1287
"""Test that inheriting from something which is not a class emits a warning. """ # pylint: disable=no-init, import-error, invalid-name # pylint: disable=missing-docstring, too-few-public-methods, no-absolute-import from missing import Missing if 1: Ambiguous = None else: Ambiguous = int class Empty(object):...
gpl-3.0
amyvmiwei/kbengine
kbe/src/lib/python/Lib/gettext.py
90
17661
"""Internationalization and localization support. This module provides internationalization (I18N) and localization (L10N) support for your Python programs by providing an interface to the GNU gettext message catalog library. I18N refers to the operation by which a program is made aware of multiple languages. L10N r...
lgpl-3.0
fernandezcuesta/ansible
test/units/modules/network/netscaler/test_netscaler_lb_vserver.py
7
33531
# Copyright (c) 2017 Citrix Systems # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # ...
gpl-3.0
fmacias64/keras
tests/auto/test_graph_model.py
22
10705
from __future__ import print_function import unittest import numpy as np np.random.seed(1337) from keras.models import Graph, Sequential from keras.layers import containers from keras.layers.core import Dense, Activation from keras.utils.test_utils import get_test_data X = np.random.random((100, 32)) X2 = np.random.r...
mit
pombredanne/rekall
rekall-core/rekall/addrspace_test.py
3
2220
from rekall import addrspace from rekall import obj from rekall import testlib from rekall import session class CustomRunsAddressSpace(addrspace.RunBasedAddressSpace): def __init__(self, runs=None, data=None, **kwargs): super(CustomRunsAddressSpace, self).__init__(**kwargs) self.base = addrspace.B...
gpl-2.0
tux-00/ansible
lib/ansible/modules/system/mount.py
60
21299
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2012, Red Hat, inc # Written by Seth Vidal # based on the mount modules from salt and puppet # # 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 ...
gpl-3.0
erikdejonge/youtube-dl
youtube_dl/extractor/hidive.py
23
4113
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..compat import compat_str from ..utils import ( ExtractorError, int_or_none, url_or_none, urlencode_postdata, ) class HiDiveIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?hidive\.com/s...
unlicense
secondscoin/secondscoin
contrib/pyminer/pyminer.py
385
6434
#!/usr/bin/python # # Copyright (c) 2011 The Bitcoin developers # Distributed under the MIT/X11 software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # import time import json import pprint import hashlib import struct import re import base64 import httplib import...
mit
stefanreuther/bob
test/test_input_recipeset.py
1
41799
# Bob build tool # Copyright (C) 2016 Jan Klötzke # # SPDX-License-Identifier: GPL-3.0-or-later from tempfile import NamedTemporaryFile, TemporaryDirectory from unittest import TestCase from unittest.mock import Mock import os import textwrap import yaml from bob import DEBUG from bob.input import RecipeSet from bob...
gpl-3.0
usc-isi/essex-baremetal-support
nova/db/sqlalchemy/migrate_repo/versions/074_change_flavor_local_gb.py
5
4484
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2011 OpenStack LLC. # 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/...
apache-2.0
bbbLinux/kernel
tools/perf/scripts/python/syscall-counts-by-pid.py
11180
1927
# system call counts, by pid # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Displays system-wide system call totals, broken down by syscall. # If a [comm] arg is specified, only syscalls called by [comm] are displayed. import os, sys sys.path.append(os.env...
gpl-2.0
Antreasgr/ol3
bin/check-whitespace.py
29
1633
import logging import re import sys logging.basicConfig(format='%(asctime)s %(name)s: %(message)s', level=logging.INFO) logger = logging.getLogger('check-whitespace') CR_RE = re.compile(r'\r') LEADING_WHITESPACE_RE = re.compile(r'\s+') TRAILING_WHITESPACE_RE = re.compile(r'\s+\n\Z') NO_NEWLINE_RE...
bsd-2-clause
stuyCTF/stuyCTF-Platform
api/api/common.py
11
5349
""" The common module contains general-purpose functions potentially used by multiple modules in the system.""" import uuid from pymongo import MongoClient from pymongo.errors import ConnectionFailure, InvalidName from werkzeug.contrib.cache import SimpleCache from voluptuous import Invalid, MultipleInvalid from hashl...
mit
liberation/sesql
sesql/management/commands/build_search_query_index.py
1
4441
# -*- coding: utf-8 -*- # Copyright (c) Pilot Systems and Libération, 2011 # This file is part of SeSQL. # SeSQL is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 2 of the License, or # (at you...
gpl-2.0
Antiun/yelizariev-addons
web_sessions_management/main.py
16
3811
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # ThinkOpen Solutions Brasil # Copyright (C) Thinkopen Solutions <http://www.tkobr.com>. # # This...
lgpl-3.0
hieupham007/Titanium_Mobile
apidoc/generators/jsduck_generator.py
1
19686
#!/usr/bin/env python # # Copyright (c) 2011 Appcelerator, Inc. All Rights Reserved. # Licensed under the Apache Public License (version 2) import os, sys, re this_dir = os.path.dirname(os.path.abspath(__file__)) sys.path.append(os.path.abspath(os.path.join(this_dir, ".."))) from common import dict_has_non_empty_mem...
apache-2.0
peoplepower/botengine
com.ppc.Bot/domain.py
1
2296
''' Created on May 25, 2017 This file is subject to the terms and conditions defined in the file 'LICENSE.txt', which is part of this source code package. @author: David Moss ''' # Organization short name, which allows us to send emails to this organization's administrators ORGANIZATION_SHORT_NAME = "family" # NOTE...
apache-2.0
thebongy/MakeMyOutputs
docx/styles/styles.py
12
5625
# encoding: utf-8 """ Styles object, container for all objects in the styles part. """ from __future__ import ( absolute_import, division, print_function, unicode_literals ) from warnings import warn from . import BabelFish from .latent import LatentStyles from ..shared import ElementProxy from .style import Ba...
mit
lubomir/django-rest-framework
setup.py
47
2970
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import re import shutil import sys from setuptools import setup def get_version(package): """ Return package version as listed in `__version__` in `init.py`. """ init_py = open(os.path.join(package, '__init__.py')).read() return re.search("_...
bsd-2-clause
karstenw/nodebox-pyobjc
examples/Extended Application/sklearn/examples/datasets/plot_iris_dataset.py
1
2738
""" ========================================================= The Iris Dataset ========================================================= This data sets consists of 3 different types of irises' (Setosa, Versicolour, and Virginica) petal and sepal length, stored in a 150x4 numpy.ndarray The rows being the samples and t...
mit
le9i0nx/ansible
test/units/modules/network/nxos/test_nxos_config.py
5
5079
#!/usr/bin/env python # # (c) 2016 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 ver...
gpl-3.0
KarolBedkowski/photomagic
photomagick/filters/exposure.py
1
1270
#!usr/bin/python # -*- coding: utf-8 -*- __plugins__ = ('LowContrast', 'HiContrast', 'OverExposed', 'UnderExposed') __version__ = '2011-03-20' __author__ = 'Karol Będkowski' __copyright__ = "Copyright (c) Karol Będkowski, 2011" import ImageEnhance from photomagick.common.base_filter import BaseFilter from photomagic...
gpl-2.0
hasgeek/coaster
coaster/views/classview.py
1
33503
""" Class-based views ----------------- Group related views into a class for easier management. """ from functools import update_wrapper, wraps from typing import Any, Dict, List, Optional, Tuple from urllib.parse import urlsplit, urlunsplit from sqlalchemy.orm.attributes import InstrumentedAttribute from sqlalchemy...
bsd-2-clause
CalHoll/SoundMoose
server/project/conf/base.py
3
5770
import os import sys # Build paths inside the project like this: os.path.join(BASE_DIR, ...) BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) ROOT_DIR = os.path.dirname(BASE_DIR) sys.path.append( os.path.join(BASE_DIR, 'apps') ) # Quick-start development settings - unsuitable for production...
mit
Y3K/django
django/middleware/locale.py
358
2983
"This is the locale selecting middleware that will look at accept headers" from django.conf import settings from django.core.urlresolvers import ( LocaleRegexURLResolver, get_resolver, get_script_prefix, is_valid_path, ) from django.http import HttpResponseRedirect from django.utils import translation from django....
bsd-3-clause
DoubleNegativeVisualEffects/cortex
test/IECoreRI/DoubleSided.py
7
2640
########################################################################## # # Copyright (c) 2008-2013, Image Engine Design Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redis...
bsd-3-clause
vishesh92/redash
old_migrations/0011_migrate_bigquery_to_json.py
20
1391
from base64 import b64encode import json from redash.models import DataSource def convert_p12_to_pem(p12file): from OpenSSL import crypto with open(p12file, 'rb') as f: p12 = crypto.load_pkcs12(f.read(), "notasecret") return crypto.dump_privatekey(crypto.FILETYPE_PEM, p12.get_privatekey()) if __...
bsd-2-clause
lache/RacingKingLee
monitor/engine.win64/2.74/python/lib/site-packages/numpy/f2py/auxfuncs.py
75
19979
#!/usr/bin/env python """ Auxiliary functions for f2py2e. Copyright 1999,2000 Pearu Peterson all rights reserved, Pearu Peterson <pearu@ioc.ee> Permission to use, modify, and distribute this software is given under the terms of the NumPy (BSD style) LICENSE. NO WARRANTY IS EXPRESSED OR IMPLIED. USE AT YOUR OWN RIS...
mit
dfdx2/django
tests/many_to_one/tests.py
12
30596
import datetime from copy import deepcopy from django.core.exceptions import FieldError, MultipleObjectsReturned from django.db import models, transaction from django.db.utils import IntegrityError from django.test import TestCase from django.utils.translation import gettext_lazy from .models import ( Article, Ca...
bsd-3-clause
DrabWeb/iTerm2
tests/esctest/tests/el.py
31
2319
from esc import NUL, blank import escargs import esccmd import escio from esctypes import Point, Rect from escutil import AssertEQ, AssertScreenCharsInRectEqual, GetCursorPosition, knownBug class ELTests(object): def prepare(self): """Initializes the screen to abcdefghij on the first line with the cursor on ...
gpl-2.0
dougwig/x-neutron-lbaas
neutron_lbaas/openstack/common/service.py
2
15276
# Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # Copyright 2011 Justin Santa Barbara # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance wi...
apache-2.0
ioram7/keystone-federado-pgid2013
build/lib.linux-x86_64-2.7/keystone/contrib/ec2/backends/kvs.py
9
1820
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 OpenStack 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 requ...
apache-2.0
TMU-VHDL-team2/sqrt
wiki_data/a_dec.py
1
1269
#!/usr/bin/env python3 def func1(): if j < 0: if (32768 >> (-j-1)) < x1: return y2 else: return x1 << -j else: return x1 >> j def func2(): if j < 0: return y >> -j else: return y << j x1 = int(input()) x0 = 0 a = 0 y = 0 ...
mit
openid/python-openid
examples/djopenid/consumer/views.py
1
8229
from __future__ import unicode_literals import six from django.http import HttpResponseRedirect from django.shortcuts import render from django.urls import reverse from openid.consumer import consumer from openid.consumer.discover import DiscoveryFailure from openid.extensions import ax, pape, sreg from openid.server....
apache-2.0
jgomezdans/KaFKA
kafka/inference/solvers.py
1
5323
#!/usr/bin/env python """Some solvers""" # KaFKA A fast Kalman filter implementation for raster based datasets. # Copyright (c) 2017 J Gomez-Dans. All rights reserved. # # This file is part of KaFKA. # # KaFKA is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public Licens...
gpl-3.0
dllsf/odootest
addons/project_issue/__init__.py
433
1131
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). All Rights Reserved # $Id$ # # This program is free software: you can redistribute it and/or modify # ...
agpl-3.0
hepochen/hoedown_misaka
tests/run_tests.py
4
2663
# -*- coding: utf-8 -*- import importlib import inspect import os import sys from itertools import chain from os.path import dirname, join as jp, splitext CWD = dirname(sys.modules[__name__].__file__) sys.path.insert(0, jp(CWD, '..')) from chibitest import runner, TestCase, Benchmark help_message = """\ Options: ...
mit
praekelt/malaria24-django
malaria24/ona/tests/test_admin.py
1
6051
from django.contrib.auth.models import User from django.core import urlresolvers from django.db.models.signals import post_save from django.test import override_settings from mock import patch from malaria24.ona.models import ( ReportedCase, new_case_alert_ehps, new_case_alert_mis, new_case_alert_jembi) f...
bsd-2-clause
yongshengwang/hue
desktop/core/ext-py/django-extensions-1.5.0/django_extensions/management/commands/find_template.py
35
1196
from django.core.management.base import LabelCommand from django.template import loader from django.template import TemplateDoesNotExist import sys from django_extensions.management.utils import signalcommand def get_template_path(path): try: template = loader.find_template(path) if template[1]: ...
apache-2.0
BigBrother-International/gst-cerbero
cerbero/packages/osx/buildtools.py
3
3083
# cerbero - a multi-platform build system for Open Source software # Copyright (C) 2012 Andoni Morales Alastruey <ylatuya@gmail.com> # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; eit...
lgpl-2.1
hramrach/osc
tests/test_addfiles.py
15
3192
import osc.core import osc.oscerr import os import sys from common import OscTestCase FIXTURES_DIR = os.path.join(os.getcwd(), 'addfile_fixtures') def suite(): import unittest return unittest.makeSuite(TestAddFiles) class TestAddFiles(OscTestCase): def _get_fixtures_dir(self): return FIXTURES_DIR...
gpl-2.0
whitehorse-io/encarnia
pyenv/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/escprober.py
2936
3187
######################## 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...
mit
ubc/edx-platform
common/djangoapps/course_modes/tests/test_views.py
64
15334
import unittest import decimal import ddt from mock import patch from django.conf import settings from django.core.urlresolvers import reverse from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase from util.testing import UrlResetMixin from embargo.test_utils import restrict_course from xmodule.modul...
agpl-3.0
wolfier/incubator-airflow
airflow/sensors/base_sensor_operator.py
5
2739
# -*- coding: utf-8 -*- # # 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 #...
apache-2.0
whitehorse-io/encarnia
pyenv/lib/python2.7/site-packages/twisted/web/test/test_xml.py
10
41831
# -*- test-case-name: twisted.web.test.test_xml -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Some fairly inadequate testcases for Twisted XML support. """ from twisted.trial.unittest import TestCase from twisted.web import sux from twisted.web import microdom from twisted.web import...
mit
CKehl/pylearn2
pylearn2/models/tests/test_s3c_inference.py
44
14386
from __future__ import print_function from pylearn2.models.s3c import S3C from pylearn2.models.s3c import E_Step_Scan from pylearn2.models.s3c import Grad_M_Step from pylearn2.models.s3c import E_Step from pylearn2.utils import contains_nan from theano import function import numpy as np from theano.compat.six.moves im...
bsd-3-clause
dvklopfenstein/PrincetonAlgorithms
tests/test_Selection.py
1
2392
#!/usr/bin/env python import sys from AlgsSedgewickWayne.Selection import Sort from AlgsSedgewickWayne.testcode.ArrayHistory import chk from AlgsSedgewickWayne.testcode.ArrayHistory import ArrayHistory from AlgsSedgewickWayne.testcode.InputArgs import cli_get_array def test_wk2_lec(prt=sys.stdout): """Example fro...
gpl-2.0
svm-zhang/poolseq_tk
poolseq_tk.py
1
12829
import os import sys import argparse import collections import multiprocessing as mp import glob import subprocess import shlex import re import sz_collapse import sz_acount import sz_mergeAC import sz_filter import sz_fisher import sz_cmh import sz_plotting import sz_overlap import sz_prepVCF import sz_view import sz...
gpl-2.0
scottcunningham/ansible
lib/ansible/plugins/action/pause.py
57
5479
# Copyright 2012, Tim Bielawa <tbielawa@redhat.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
SnakeJenny/TensorFlow
tensorflow/python/ops/init_ops.py
23
19144
# 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
Permutatrix/servo
tests/wpt/web-platform-tests/tools/pytest/_pytest/config.py
166
45047
""" command line options, ini-file and conftest.py processing. """ import argparse import shlex import traceback import types import warnings import py # DON't import pytest here because it causes import cycle troubles import sys, os import _pytest._code import _pytest.hookspec # the extension point definitions from ...
mpl-2.0
josephnoir/RIOT
cpu/esp32/gen_esp32part.py
15
17009
#!/usr/bin/env python # # ESP32 partition table generation tool # # Converts partition tables to/from CSV and binary formats. # # See http://esp-idf.readthedocs.io/en/latest/api-guides/partition-tables.html # for explanation of partition table structure and uses. # # Copyright 2015-2016 Espressif Systems (Shanghai) PTE...
lgpl-2.1
mfalcon/edujango
edujango/static/admin/js/compress.py
784
1896
#!/usr/bin/env python import os import optparse import subprocess import sys here = os.path.dirname(__file__) def main(): usage = "usage: %prog [file1..fileN]" description = """With no file paths given this script will automatically compress all jQuery-based files of the admin app. Requires the Google Closure...
apache-2.0
andyraib/data-storage
python_scripts/env/lib/python3.6/site-packages/numpy/distutils/from_template.py
20
7826
#!/usr/bin/python """ process_file(filename) takes templated file .xxx.src and produces .xxx file where .xxx is .pyf .f90 or .f using the following template rules: '<..>' denotes a template. All function and subroutine blocks in a source file with names that contain '<..>' will be replicated according to ...
apache-2.0
Audacity-Team/Audacity
lib-src/lv2/lv2/plugins/eg02-midigate.lv2/waflib/Tools/suncxx.py
134
1459
#! /usr/bin/env python # encoding: utf-8 # WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file import os from waflib import Utils from waflib.Tools import ccroot,ar from waflib.Configure import conf @conf def find_sxx(conf): v=conf.env cc=None if v['CXX']:cc=v['CXX']...
mit
malena/bedrock
scripts/check_calendars.py
18
1596
#!/usr/bin/env python import os from icalendar import Calendar def get_ics(filename): return filename.endswith('ics') def check_if_correct_parse(ics_file): fh = open(ics_file, 'rb') try: # some calendars, such as Austrian ones have multiple # vCalendar entries - we probably don't want ...
mpl-2.0
LLNL/spack
lib/spack/spack/cmd/modules/lmod.py
5
1702
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) import functools import os import llnl.util.filesystem import spack.cmd.common.arguments import spack.cmd.modules def a...
lgpl-2.1
ming0627/foursquared.eclair
util/gen_parser.py
262
4392
#!/usr/bin/python import datetime import sys import textwrap import common from xml.dom import pulldom PARSER = """\ /** * Copyright 2009 Joe LaPenna */ package com.joelapenna.foursquare.parsers; import com.joelapenna.foursquare.Foursquare; import com.joelapenna.foursquare.error.FoursquareError; import com.joel...
apache-2.0
hknyldz/pisitools
pisilinux/pisilinux/cli/listnewest.py
1
2965
# -*- coding:utf-8 -*- # # Copyright (C) 2009, TUBITAK/UEKAE # # 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 the License, or (at your option) # any later version. # # Pleas...
gpl-3.0
dictoon/blenderseed
logger.py
2
1883
# # This source file is part of appleseed. # Visit http://appleseedhq.net/ for additional information and resources. # # This software is released under the MIT license. # # Copyright (c) 2014-2018 The appleseedhq Organization # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this so...
mit
RasPlex/plex-home-theatre
plex/scripts/merge_translations.py
5
2008
#!/usr/bin/env python import sys, os, shutil lang_map = { "af-ZA": "Afrikaans", "cs-CZ": "Czech", "da": "Danish", "de": "German", "en": "English (US)", "es": "Spanish", "es-419" : "Spanish (Argentina)", "fi": "Finnish", "fr": "French", "grk": "Greek", "he": "Hebrew", "hr-HR": "Croatian", "is-IS": "Icelan...
gpl-2.0
jamestwebber/scipy
scipy/integrate/_ode.py
2
48014
# Authors: Pearu Peterson, Pauli Virtanen, John Travers """ First-order ODE integrators. User-friendly interface to various numerical integrators for solving a system of first order ODEs with prescribed initial conditions:: d y(t)[i] --------- = f(t,y(t))[i], d t y(t=0)[i] = y0[i], where:: ...
bsd-3-clause
hubig/CSCI121-Final-Project
poetry_gen.py
1
7225
#the_poetry_generator 2017 import random #needed for random selection of words import tkinter as tk from tkinter import ttk from tkinter import filedialog import os def main(): #"""Opens up one of the two random files.""" poem = open("Poem_Generator.txt","w") #Opens up new file "Poem_Generator.txt" ...
apache-2.0
zstackio/zstack-woodpecker
integrationtest/vm/mini/multiclusters/paths/multi_path270.py
1
2778
import zstackwoodpecker.test_state as ts_header import os TestAction = ts_header.TestAction def path(): return dict(initial_formation="template5", checking_point=1, faild_point=100000, path_list=[ [TestAction.create_mini_vm, 'vm1', 'cluster=cluster2'], [TestAction.destroy_vm, 'vm1'], [TestAction.recover_vm, ...
apache-2.0
britcey/ansible
lib/ansible/modules/cloud/azure/azure_rm_securitygroup.py
36
27324
#!/usr/bin/python # # Copyright (c) 2016 Matt Davis, <mdavis@ansible.com> # Chris Houseknecht, <house@redhat.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 Soft...
gpl-3.0
thomasgilgenast/spqr-nonrel
django/contrib/admindocs/urls.py
336
1089
from django.conf.urls.defaults import * from django.contrib.admindocs import views urlpatterns = patterns('', url('^$', views.doc_index, name='django-admindocs-docroot' ), url('^bookmarklets/$', views.bookmarklets, name='django-admindocs-bookmarklets' ), url('^tags/$...
bsd-3-clause
fastavro/fastavro
fastavro/_validation_py.py
1
11047
import array import numbers from collections.abc import Mapping, Sequence from fastavro.const import INT_MAX_VALUE, INT_MIN_VALUE, LONG_MAX_VALUE, LONG_MIN_VALUE from ._validate_common import ValidationError, ValidationErrorData from .schema import extract_record_type, extract_logical_type, schema_name, parse_schema f...
mit
tamland/xbmc
lib/libUPnP/Neptune/Extras/Tools/Logging/NeptuneLogConsole.py
22
2839
#!/usr/bin/env python from socket import * from optparse import OptionParser UDP_ADDR = "0.0.0.0" UDP_PORT = 7724 BUFFER_SIZE = 65536 #HEADER_KEYS = ['Logger', 'Level', 'Source-File', 'Source-Function', 'Source-Line', 'TimeStamp'] HEADER_KEYS = { 'mini': ('Level'), 'standard': ('Logger', 'Level', 'Source-Func...
gpl-2.0