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 |
|---|---|---|---|---|---|
albertomurillo/ansible | lib/ansible/playbook/role/definition.py | 10 | 9503 | # (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 |
fastcoinproject/fastcoin | contrib/spendfrom/spendfrom.py | 1 | 10059 | #!/usr/bin/env python
#
# Use the raw transactions API to spend bitcoins received on particular addresses,
# and send any change back to that same address.
#
# Example usage:
# spendfrom.py # Lists available funds
# spendfrom.py --from=ADDRESS --to=ADDRESS --amount=11.00
#
# Assumes it will talk to a bitcoind or Bit... | mit |
Tranzystorek/servo | tests/wpt/web-platform-tests/tools/html5lib/html5lib/tests/tokenizertotree.py | 483 | 1965 | from __future__ import absolute_import, division, unicode_literals
import sys
import os
import json
import re
import html5lib
from . import support
from . import test_tokenizer
p = html5lib.HTMLParser()
unnamespaceExpected = re.compile(r"^(\|\s*)<html ([^>]+)>", re.M).sub
def main(out_path):
if not os.path.ex... | mpl-2.0 |
execunix/vinos | crypto/external/bsd/heimdal/dist/lib/wind/gen-normalize.py | 2 | 5753 | #!/usr/local/bin/python
# -*- coding: iso-8859-1 -*-
# Id
# Copyright (c) 2004 Kungliga Tekniska Högskolan
# (Royal Institute of Technology, Stockholm, Sweden).
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following c... | apache-2.0 |
andrei987/services | src/releng_tooltool/releng_tooltool/aws.py | 1 | 4871 | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from __future__ import absolute_import
import boto
import boto.s3
import boto.sqs
import importlib
import json
from bac... | mpl-2.0 |
musicbrainz/picard | test/test_plugins.py | 4 | 8739 | # -*- coding: utf-8 -*-
#
# Picard, the next-generation MusicBrainz tagger
#
# Copyright (C) 2019-2020 Laurent Monin
# Copyright (C) 2019-2020 Philipp Wolfer
#
# 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 Softwar... | gpl-2.0 |
thomasem/nova | nova/scheduler/filters/compute_filter.py | 58 | 1778 | # Copyright (c) 2012 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... | apache-2.0 |
elssar/calibre | src/calibre/utils/ipc/__init__.py | 11 | 2045 | #!/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 os, errno
from threading import Thread
from calibre.constants import iswindo... | gpl-3.0 |
MoRgUiJu/morguiju.repo | plugin.video.pelisalacarta/channels/pelisadicto.py | 1 | 10054 | # -*- coding: utf-8 -*-
#------------------------------------------------------------
# pelisalacarta - XBMC Plugin
# Canal para cuevana
# http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/
#------------------------------------------------------------
import re
import sys
import urlparse
from core import config
f... | gpl-2.0 |
danking/hail | datasets/load/load.1000_Genomes_phase3_chrX.GRCh37.py | 3 | 2433 |
import hail as hl
ht_samples = hl.read_table('gs://hail-datasets-hail-data/1000_Genomes_phase3_samples.ht')
ht_relationships = hl.read_table('gs://hail-datasets-hail-data/1000_Genomes_phase3_sample_relationships.ht')
mt = hl.import_vcf(
'gs://hail-datasets-raw-data/1000_Genomes/1000_Genomes_phase3_chrX_GRCh37.vc... | mit |
Inspq/ansible | lib/ansible/plugins/action/fetch.py | 1 | 8462 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@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) an... | gpl-3.0 |
darkonie/dcos | dcos_installer/config_util.py | 6 | 4082 | import logging
import os
import subprocess
import sys
import gen
import gen.build_deploy.bash
import pkgpanda
from dcos_installer.constants import ARTIFACT_DIR, CLUSTER_PACKAGES_PATH, SERVE_DIR
log = logging.getLogger(__name__)
def onprem_generate(config):
return gen.generate(config.as_gen_format(), extra_sourc... | apache-2.0 |
MikeAmy/django-webtest | setup.py | 1 | 1559 | #!/usr/bin/env python
from distutils.core import setup
for cmd in ('egg_info', 'develop'):
import sys
if cmd in sys.argv:
from setuptools import setup
version='1.7.4'
setup(
name='django-webtest',
version=version,
author='Mikhail Korobov',
author_email='kmike84@gmail.com',
packag... | mit |
NetEaseGame/AutomatorX | atx/record/draft_editor.py | 3 | 4282 | #-*- encoding: utf-8 -*-
import os
import os.path
import json
import socket
import webbrowser
import tornado.ioloop
import tornado.web
import tornado.websocket
import traceback
import time
from tornado.web import StaticFileHandler
import atx
from atx.record.android import AndroidRecorder
__dir__ = os.path.dirname(o... | apache-2.0 |
40223138/2015cd_midterm | static/Brython3.1.1-20150328-091302/Lib/_markupbase.py | 891 | 14598 | """Shared support for scanning document type declarations in HTML and XHTML.
This module is used as a foundation for the html.parser module. It has no
documented public API and should not be used directly.
"""
import re
_declname_match = re.compile(r'[a-zA-Z][-_.a-zA-Z0-9]*\s*').match
_declstringlit_match = re.com... | gpl-3.0 |
rbtcollins/pip | pip/_vendor/requests/packages/chardet/euctwprober.py | 2994 | 1676 | ######################## 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 |
omtinez/micropython | tests/basics/with_return.py | 82 | 1239 | class CtxMgr:
def __init__(self, id):
self.id = id
def __enter__(self):
print("__enter__", self.id)
return self
def __exit__(self, a, b, c):
print("__exit__", self.id, repr(a), repr(b))
# simple case
def foo():
with CtxMgr(1):
return 4
print(foo())
# for loop ... | mit |
kevinr/750book-web | 750book-web-env/lib/python2.7/site-packages/django/contrib/gis/geos/prototypes/geom.py | 311 | 4465 | from ctypes import c_char_p, c_int, c_size_t, c_ubyte, c_uint, POINTER
from django.contrib.gis.geos.libgeos import CS_PTR, GEOM_PTR, PREPGEOM_PTR, GEOS_PREPARE
from django.contrib.gis.geos.prototypes.errcheck import \
check_geom, check_minus_one, check_sized_string, check_string, check_zero
from django.contrib.gis.... | mit |
tcheehow/MissionPlanner | Lib/encodings/iso8859_16.py | 93 | 14120 | """ Python Character Mapping Codec iso8859_16 generated from 'MAPPINGS/ISO8859/8859-16.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... | gpl-3.0 |
polyaxon/polyaxon | sdks/python/http_client/v1/polyaxon_sdk/models/v1_compiled_operation.py | 1 | 21129 | #!/usr/bin/python
#
# Copyright 2018-2021 Polyaxon, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | apache-2.0 |
mzdaniel/pycon | pycon_project/apps/symposion/proposals/actions.py | 5 | 1307 | import csv
from django.http import HttpResponse
def export_as_csv_action(description="Export selected objects as CSV file",
fields=None, exclude=None, header=True):
"""
This function returns an export csv action
'fields' and 'exclude' work like in django ModelForm
'header' is... | bsd-3-clause |
flavour/cedarbluff | models/01_menu.py | 3 | 1342 | # -*- coding: utf-8 -*-
"""
Global menus
"""
if auth.permission.format in ("html"):
# =========================================================================
# Application main menu
# -> To customize, replace the standard components by the desired items
# -> Put right-hand menu options in rever... | mit |
lmazuel/azure-sdk-for-python | azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/troubleshooting_details.py | 1 | 1830 | # 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 |
saratang/servo | tests/wpt/css-tests/css21_dev/xhtml1print/reference/support/fonts/makegsubfonts.py | 820 | 14309 |
import os
import textwrap
from xml.etree import ElementTree
from fontTools.ttLib import TTFont, newTable
from fontTools.misc.psCharStrings import T2CharString
from fontTools.ttLib.tables.otTables import GSUB,\
ScriptList, ScriptRecord, Script, DefaultLangSys,\
FeatureList, FeatureRecord, Feature,\
LookupLi... | mpl-2.0 |
anubhav929/eden | cron/sms_handler_modem.py | 9 | 3710 | # -*- coding: utf-8 -*-
# vim: ai ts=4 sts=4 et sw=4 encoding=utf-8
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, co... | mit |
sahiljain/catapult | telemetry/third_party/web-page-replay/third_party/dns/rdtypes/ANY/GPOS.py | 248 | 5304 | # Copyright (C) 2003-2007, 2009, 2010 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
# provided that the above copyright notice and this permission notice
# appear in all copies.
#
# THE SOFTWARE IS PROVIDED ... | bsd-3-clause |
minhtuancn/odoo | addons/auth_signup/res_config.py | 445 | 2860 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2012-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 |
Mathew/psychoanalysis | psychoanalysis/apps/pa/aggregation.py | 1 | 6791 | from south.db import db
from south.v2 import SchemaMigration
from django.db import models
from itertools import chain
def make_query(query_dict):
query_type = 0
if 'result type' in query_dict:
if query_dict['result type'] == 'percent':
query_type = 1
data_set = 0
if 'data set' in ... | mit |
kaplun/ops | modules/bibexport/lib/bibexport_method_fieldexporter_unit_tests.py | 16 | 3227 | # -*- coding: utf-8 -*-
##
## $Id: search_engine_tests.py,v 1.20 2008/08/11 12:49:27 kaplun Exp $
##
## This file is part of Invenio.
## Copyright (C) 2009, 2010, 2011 CERN.
##
## Invenio is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## published by t... | gpl-2.0 |
cherokee/webserver | doc/test_links.py | 5 | 1904 | #!/usr/bin/env python2
# Cherokee Doc: Link checker
#
# Authors:
# Taher Shihadeh <taher@unixwars.com>
#
# Copyright (C) 2001-2014 Alvaro Lopez Ortega
# This file is distributed under the GPL2 license.
import os
import sys
import re
def get_link_refs():
link_refs = {}
for f in filter(lambda x: x.endswit... | gpl-2.0 |
mohierf/shinken | contrib/nsca/nsca_client.py | 21 | 7256 | # This is a very quick and dirty code for David so he can work on its
# sikuli agent and report as nsca the results.
#
# This need to be clean a lot, it's still a server and should be a
# client class :) I can do it after my "new baby holidays" are
# finished ;)
#
# J. Gabes
import time
import select
import socket
imp... | agpl-3.0 |
rolando-contrib/scrapy | scrapy/downloadermiddlewares/httpcompression.py | 17 | 2605 | import zlib
from scrapy.utils.gz import gunzip
from scrapy.http import Response, TextResponse
from scrapy.responsetypes import responsetypes
from scrapy.exceptions import NotConfigured
ACCEPTED_ENCODINGS = [b'gzip', b'deflate']
try:
import brotli
ACCEPTED_ENCODINGS.append(b'br')
except ImportError:
pass... | bsd-3-clause |
chitr/neutron | neutron/cmd/netns_cleanup.py | 1 | 6192 | # Copyright (c) 2012 OpenStack Foundation.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless... | apache-2.0 |
danithaca/mxnet | example/ssd/dataset/iterator.py | 15 | 11046 | import mxnet as mx
import numpy as np
import cv2
from tools.rand_sampler import RandSampler
class DetRecordIter(mx.io.DataIter):
"""
The new detection iterator wrapper for mx.io.ImageDetRecordIter which is
written in C++, it takes record file as input and runs faster.
Supports various augment operation... | apache-2.0 |
ktan2020/legacy-automation | win/Lib/idlelib/configDialog.py | 3 | 54392 | """IDLE Configuration Dialog: support user customization of IDLE by GUI
Customize font faces, sizes, and colorization attributes. Set indentation
defaults. Customize keybindings. Colorization and keybindings can be
saved as user defined sets. Select startup options including shell/editor
and default window si... | mit |
mhnatiuk/phd_sociology_of_religion | scrapper/lib/python2.7/site-packages/twisted/mail/mail.py | 36 | 22889 | # -*- test-case-name: twisted.mail.test.test_mail -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Mail service support.
"""
# Twisted imports
from twisted.internet import defer
from twisted.application import service, internet
from twisted.python import util
from twisted.python import... | gpl-2.0 |
jindongh/boto | boto/opsworks/layer1.py | 132 | 129869 | # Copyright (c) 2014 Amazon.com, Inc. or its affiliates. All Rights Reserved
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights ... | mit |
apanju/odoo | addons/hr_payroll/report/report_payslip.py | 377 | 1982 | #-*- coding:utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# d$
#
# This program is free software: you can redistribute it and/or modify
# it... | agpl-3.0 |
zbo9269/linux | 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 |
kernelci/lava-ci-staging | lib/test_configs.py | 1 | 15454 | # Copyright (C) 2018 Collabora Limited
# Author: Guillaume Tucker <guillaume.tucker@collabora.com>
#
# This module is free software; you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by the Free
# Software Foundation; either version 2.1 of the License, or (... | lgpl-2.1 |
hroncok/freeipa | ipatests/test_ipalib/test_backend.py | 2 | 9759 | # Authors:
# Jason Gerard DeRose <jderose@redhat.com>
#
# Copyright (C) 2008 Red Hat
# see file 'COPYING' for use and warranty information
#
# 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, ei... | gpl-3.0 |
christoph-buente/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/port/base.py | 113 | 69315 | # Copyright (C) 2010 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the ... | bsd-3-clause |
ahmetabdi/SickRage | lib/sqlalchemy/util/langhelpers.py | 75 | 37513 | # util/langhelpers.py
# Copyright (C) 2005-2014 the SQLAlchemy authors and contributors <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""Routines to help with the creation, loading and introspection of
modules, class... | gpl-3.0 |
IronLanguages/ironpython3 | Src/StdLib/Lib/encodings/iso8859_7.py | 272 | 12844 | """ Python Character Mapping Codec iso8859_7 generated from 'MAPPINGS/ISO8859/8859-7.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='... | apache-2.0 |
caolan/js-yaml | support/pyyaml-src/__init__.py | 96 | 9607 |
from .error import *
from .tokens import *
from .events import *
from .nodes import *
from .loader import *
from .dumper import *
__version__ = '3.10'
try:
from .cyaml import *
__with_libyaml__ = True
except ImportError:
__with_libyaml__ = False
import io
def scan(stream, Loader=Loader):
"""
S... | mit |
gregpuzzles1/Sandbox | Example Programs/Ch_07_Student_Files/pilimages.py | 1 | 4982 | """
images.py
This module, writtn by Kenneth Lambert, supports simple image processing.
The Image class represents either an image loaded from a GIF file or a
blank image.
To instantiate an image from a file, enter
image = Image(aGifFileName)
To instantiate a blank image, enter
image = Ima... | gpl-3.0 |
suqinhuang/virt-test | qemu/tests/block_mirror.py | 1 | 5705 | import re, os, logging, time
from autotest.client.shared import utils, error
from virttest import qemu_monitor, storage, env_process, data_dir, utils_misc
@error.context_aware
def run_block_mirror(test, params, env):
"""
Test block mirroring functionality
Test consists of two subtests:
1) Mirror the... | gpl-2.0 |
wjr1005/p2pool | p2pool/util/logging.py | 287 | 2995 | import codecs
import datetime
import os
import sys
from twisted.python import log
class EncodeReplacerPipe(object):
def __init__(self, inner_file):
self.inner_file = inner_file
self.softspace = 0
def write(self, data):
if isinstance(data, unicode):
try:
data... | gpl-3.0 |
gspilio/nova | nova/tests/servicegroup/test_db_servicegroup.py | 13 | 5301 | # Copyright 2012 IBM Corp.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed t... | apache-2.0 |
anshumang/picongpu-evpath | examples/ThermalTest/tools/dispersion.py | 11 | 2689 | #!/usr/bin/env python
#
# Copyright 2013 Heiko Burau, Axel Huebl
#
# This file is part of PIConGPU.
#
# PIConGPU 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 |
TEAM-Gummy/platform_external_chromium_org | tools/find_runtime_symbols/PRESUBMIT.py | 116 | 1425 | # 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.
"""Top-level presubmit script for find_runtime_symbols.
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts for
details on the p... | bsd-3-clause |
ernstblecha/gen.sh | waitforstring.py | 1 | 1698 | #!/usr/bin/python3 -u
# using -u here to make stdin unbuffered
# This file is part of gen.sh.
#
# gen.sh 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 |
synsun/robotframework | src/robot/model/imports.py | 27 | 1999 | # Copyright 2008-2015 Nokia Solutions and Networks
#
# 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 l... | apache-2.0 |
longmen21/edx-platform | common/lib/xmodule/xmodule/tests/test_conditional.py | 131 | 12910 | import json
import unittest
from fs.memoryfs import MemoryFS
from mock import Mock, patch
from xblock.field_data import DictFieldData
from xblock.fields import ScopeIds
from xmodule.error_module import NonStaffErrorDescriptor
from opaque_keys.edx.locations import SlashSeparatedCourseKey, Location
from xmodule.modules... | agpl-3.0 |
ropable/statdev | ledger/accounts/migrations/0004_auto_20160907_1507.py | 3 | 3430 | # -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2016-09-07 07:07
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
from django.core.management import call_command
import zlib
from ledger.accounts.models import Profi... | apache-2.0 |
VizGrimoire/GrimoireLib | vizgrimoire/metrics/eventizer_metrics.py | 4 | 10704 | ## 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 is distributed ... | gpl-3.0 |
google/google-ctf | third_party/edk2/AppPkg/Applications/Python/Python-2.7.2/Lib/test/test__locale.py | 11 | 5944 | from test.test_support import run_unittest
from _locale import (setlocale, LC_NUMERIC, localeconv, Error)
try:
from _locale import (RADIXCHAR, THOUSEP, nl_langinfo)
except ImportError:
nl_langinfo = None
import unittest
import sys
from platform import uname
if uname()[0] == "Darwin":
maj, min,... | apache-2.0 |
Big-B702/python-for-android | python3-alpha/python3-src/Lib/test/test_getopt.py | 173 | 6968 | # test_getopt.py
# David Goodger <dgoodger@bigfoot.com> 2000-08-19
from test.support import verbose, run_doctest, run_unittest, EnvironmentVarGuard
import unittest
import getopt
sentinel = object()
class GetoptTests(unittest.TestCase):
def setUp(self):
self.env = EnvironmentVarGuard()
if "POSIXL... | apache-2.0 |
kost/volatility | volatility/plugins/mac/mount.py | 12 | 2374 | # Volatility
# Copyright (C) 2007-2013 Volatility Foundation
#
# This file is part of Volatility.
#
# Volatility 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 o... | gpl-2.0 |
bq/bitbloq-offline | app/res/web2board/linux/res/Scons/sconsFiles/SCons/Tool/masm.py | 6 | 2975 | """SCons.Tool.masm
Tool-specific initialization for the Microsoft Assembler.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# Copyright (c) 2001 - 2015 The SCons Foundation
#
# Permission is hereby grante... | gpl-3.0 |
klmitch/nova | nova/tests/functional/notification_sample_tests/test_compute_task.py | 1 | 5997 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | apache-2.0 |
Charley-fan/metaArray | metaFunc.py | 1 | 10584 | # 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.
#
# This program is distributed in ... | gpl-3.0 |
liqd/adhocracy | src/adhocracy/lib/event/notification/__init__.py | 4 | 1922 | import logging
from time import time
from itertools import chain
from adhocracy import config
from sources import watchlist_source, vote_source, instance_source
from sources import delegation_source, tag_source, comment_source
from filters import self_filter, duplicates_filter, comment_filter
from filters import hidde... | agpl-3.0 |
amith01994/intellij-community | python/testData/MockSdk3.4/python_stubs/_io.py | 41 | 52669 | # encoding: utf-8
# module _io calls itself io
# from (built-in)
# by generator 1.135
"""
The io module provides the Python interfaces to stream handling. The
builtin open function is defined in this module.
At the top of the I/O hierarchy is the abstract base class IOBase. It
defines the basic interface to a stream. ... | apache-2.0 |
mveitas/metrics | docs/source/conf.py | 1 | 9611 | # -*- coding: utf-8 -*-
#
# Dropwizard documentation build configuration file, created by
# sphinx-quickstart on Mon Feb 13 11:29:49 2012.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# ... | apache-2.0 |
piranha/firepython | firepython/mini_graphviz.py | 3 | 2129 | import sys
import optparse
import tempfile
import subprocess
__all__ = [
'main',
]
DEFAULT_DOT = 'dot'
DEFAULT_VIEWER = 'eog'
USAGE = "%prog [options]"
OPTIONS = (
(('-D', '--dot-exe'),
dict(dest='dot', action='store', default=DEFAULT_DOT,
help='dot executable to use for making png, '
... | bsd-3-clause |
dulems/hue | desktop/core/ext-py/Pygments-1.3.1/external/rst-directive.py | 47 | 2597 | # -*- coding: utf-8 -*-
"""
The Pygments reStructuredText directive
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This fragment is a Docutils_ 0.5 directive that renders source code
(to HTML only, currently) via Pygments.
To use it, adjust the options below and copy the code into a module
that you i... | apache-2.0 |
yfdyh000/kuma | kuma/authkeys/views.py | 31 | 1786 | from django.core.exceptions import PermissionDenied
from django.shortcuts import get_object_or_404, render, redirect
from django.contrib.auth.decorators import login_required, permission_required
from kuma.core.utils import paginate
from .models import Key
from .forms import KeyForm
ITEMS_PER_PAGE = 15
@login_req... | mpl-2.0 |
makinacorpus/Geotrek | geotrek/diving/migrations/0003_auto_20200302_0759.py | 2 | 2739 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.14 on 2020-03-02 06:59
from __future__ import unicode_literals
import colorfield.fields
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('diving', '0002_auto_20200211_1523'),
]
operations = [
... | bsd-2-clause |
MiLk/ansible | lib/ansible/modules/network/f5/bigip_gtm_wide_ip.py | 30 | 16572 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2017 F5 Networks Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# ... | gpl-3.0 |
eljefe6a/kafka | tests/kafkatest/services/security/security_config.py | 6 | 8391 | # 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 ... | apache-2.0 |
ABaldwinHunter/django-clone-classic | tests/model_validation/models.py | 260 | 1346 | from django.db import models
class ThingItem(object):
def __init__(self, value, display):
self.value = value
self.display = display
def __iter__(self):
return (x for x in [self.value, self.display])
def __len__(self):
return 2
class Things(object):
def __iter__(se... | bsd-3-clause |
rajiteh/taiga-back | taiga/projects/migrations/0016_fix_json_field_not_null.py | 26 | 1630 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django_pgjson.fields import JsonField
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('projects', '0015_auto_20141230_1212'),
]
operations = [
migrations.RunSQL(
... | agpl-3.0 |
elainenaomi/sciwonc-dataflow-examples | dissertation2017/Experiment 2/instances/9_0_wikiflow_1sh_1s_noannot_prim/longestsession_0/LongestSession_0.py | 18 | 2031 | #!/usr/bin/env python
from sciwonc.dataflow.DataStoreClient import DataStoreClient
import ConfigDB_Longest_0
import pprint
import datetime
# connector and config
client = DataStoreClient("mongodb", ConfigDB_Longest_0)
config = ConfigDB_Longest_0
# according to config
dataList = client.getData() # return an array of d... | gpl-3.0 |
xmission/d-note | venv/lib/python2.7/site-packages/requests/packages/urllib3/_collections.py | 666 | 10553 | from __future__ import absolute_import
from collections import Mapping, MutableMapping
try:
from threading import RLock
except ImportError: # Platform-specific: No threads available
class RLock:
def __enter__(self):
pass
def __exit__(self, exc_type, exc_value, traceback):
... | agpl-3.0 |
matmutant/sl4a | python/src/Lib/plat-mac/lib-scriptpackages/Finder/Standard_Suite.py | 73 | 12423 | """Suite Standard Suite: Common terms that most applications should support
Level 1, version 1
Generated from /System/Library/CoreServices/Finder.app
AETE/AEUT resource version 0/144, language 0, script 0
"""
import aetools
import MacOS
_code = 'CoRe'
from StdSuites.Standard_Suite import *
class Standard_Suite_Even... | apache-2.0 |
msegado/edx-platform | common/test/acceptance/pages/lms/certificate_page.py | 110 | 1582 | # -*- coding: utf-8 -*-
"""
Module for Certificates pages.
"""
from bok_choy.page_object import PageObject
from . import BASE_URL
class CertificatePage(PageObject):
"""
Certificate web view page.
"""
url_path = "certificates"
def __init__(self, browser, user_id, course_id):
"""Initializ... | agpl-3.0 |
elan17/irc-terminal | client/Library/desurveil/basemath.py | 2 | 5033 | #!/usr/bin/env python3
# desurveil: a cryptography tool with support for RSA and OAEP
# Copyright (C) 2011 Niels Serup
# This file is part of desurveil.
#
# desurveil is free software: you can redistribute it and/or modify it under
# the terms of the GNU Affero General Public License as published by the Free
# Softwa... | gpl-3.0 |
hendradarwin/ITK | Modules/ThirdParty/GDCM/src/gdcm/Source/DataDictionary/txt2xml.py | 17 | 16348 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import re,os
"""
GEMS
This parser parse a table formatted like this:
Attribute Name Tag VR VM
"""
class TextParser:
def __init__(self, inputfilename, outputfilename):
self._InputFilename = ''
self._OutputFilename = ''
def Parse(self):
infile = file(inputfi... | apache-2.0 |
tutumcloud/python-social-auth | social/storage/django_orm.py | 9 | 4495 | """Django ORM models for Social Auth"""
import base64
import six
from social.storage.base import UserMixin, AssociationMixin, NonceMixin, \
CodeMixin, BaseStorage
class DjangoUserMixin(UserMixin):
"""Social Auth association model"""
@classmethod
def changed(cls, user):
... | bsd-3-clause |
wuzhenda/gaedav | pyxml/dom/html/HTMLDirectoryElement.py | 4 | 1409 | ########################################################################
#
# File Name: HTMLDirectoryElement
#
#
### This file is automatically generated by GenerateHtml.py.
### DO NOT EDIT!
"""
WWW: http://4suite.com/4DOM e-mail: support@4suite.com
Copyright (c) 2000 Fourthought Inc, USA. All R... | lgpl-2.1 |
fafaman/django | tests/humanize_tests/tests.py | 336 | 13163 | from __future__ import unicode_literals
import datetime
from decimal import Decimal
from unittest import skipIf
from django.contrib.humanize.templatetags import humanize
from django.template import Context, Template, defaultfilters
from django.test import TestCase, modify_settings, override_settings
from django.utils... | bsd-3-clause |
solashirai/edx-platform | openedx/core/djangoapps/safe_sessions/middleware.py | 32 | 18903 | """
This module defines SafeSessionMiddleware that makes use of a
SafeCookieData that cryptographically binds the user to the session id
in the cookie.
The implementation is inspired by the proposal in the following paper:
http://www.cse.msu.edu/~alexliu/publications/Cookie/cookie.pdf
Note: The proposed protocol prot... | agpl-3.0 |
andsor/numpy | numpy/lib/user_array.py | 111 | 7764 | """
Standard container-class for easy multiple-inheritance.
Try to inherit from the ndarray instead of using this class as this is not
complete.
"""
from __future__ import division, absolute_import, print_function
from numpy.core import (
array, asarray, absolute, add, subtract, multiply, divide,
remainder, p... | bsd-3-clause |
philanthropy-u/edx-platform | common/djangoapps/student/management/commands/create_user.py | 5 | 3833 | from __future__ import print_function
from django.conf import settings
from django.contrib.auth.models import User
from django.utils import translation
from opaque_keys.edx.keys import CourseKey
from six import text_type
from student.forms import AccountCreationForm
from student.helpers import do_create_account
from... | agpl-3.0 |
alenickwork/python_training | fixture/orm.py | 1 | 4159 | from pony.orm import *
from datetime import datetime
from model.group import Group
from model.contact import Contact
from pymysql.converters import decoders
from pymysql.converters import encoders, decoders, convert_mysql_timestamp
conv = encoders
conv.update(decoders)
conv[datetime] = convert_mysql_timestamp
clas... | apache-2.0 |
VaibhavAgarwalVA/sympy | sympy/stats/tests/test_rv.py | 42 | 5064 | from sympy import (EmptySet, FiniteSet, S, Symbol, Interval, exp, erf, sqrt,
symbols, simplify, Eq, cos, And, Tuple, integrate, oo, sin, Sum, Basic,
DiracDelta)
from sympy.stats import (Die, Normal, Exponential, P, E, variance, covariance,
skewness, density, given, independent, dependent, where,... | bsd-3-clause |
Den1al/JSShell | web/content/routes.py | 1 | 1400 | from flask import render_template, url_for, Response
from common.config import read_config
from common.utils import concat_url_path
from web.content import content
@content.route('/jquery', methods=['GET'])
def get_jquery():
""" Returns the jQuery.js file """
return render_template('javascript/jquery.js')
... | mit |
Workday/OpenFrame | tools/cr/cr/base/context.py | 103 | 6668 | # 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.
"""Application context management for the cr tool.
Contains all the support code to enable the shared context used by the cr tool.
This includes the configu... | bsd-3-clause |
buzzer/tams_pr2 | robot_motion_param/nodes/get_motion_param.py | 1 | 1163 | #!/usr/bin/env python
#
# 2014-08-04 Sebastian Rockel (rockel@informatik.uni-hamburg.de)
# Provides a service interface to read the robot motion parameters
# uses the dynamic_reconfigure client
#
import roslib; roslib.load_manifest('robot_motion_param')
from robot_motion_param.srv import *
import rospy
import dynamic_r... | bsd-2-clause |
DreamerKing/LightweightHtmlWidgets | publish-rc/v1.1/files/Ipy.Lib/wsgiref/headers.py | 229 | 5879 | """Manage HTTP Response Headers
Much of this module is red-handedly pilfered from email.message in the stdlib,
so portions are Copyright (C) 2001,2002 Python Software Foundation, and were
written by Barry Warsaw.
"""
from types import ListType, TupleType
# Regular expression that matches `special' characters in para... | gpl-3.0 |
tobiasKaminsky/android | scripts/metadata/generate_metadata.py | 5 | 4208 | #!/usr/bin/env python3
# Author: Torsten Grote
# License: GPLv3 or later
# copied on 2017/11/06 from https://github.com/grote/Transportr/blob/master/fastlane/generate_metadata.py
# adapted by Tobias Kaminsky
import codecs
import os
import shutil
from xml.etree import ElementTree
XML_PATH = '../../src/main/res'
METAD... | gpl-2.0 |
direvus/ansible | lib/ansible/modules/network/a10/a10_server_axapi3.py | 50 | 8970 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2014, Mischa Peters <mpeters@a10networks.com>
# (c) 2016, Eric Chou <ericc@a10networks.com>
#
# 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__ = ty... | gpl-3.0 |
osvalr/odoo | addons/portal_project_issue/tests/__init__.py | 260 | 1086 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2013-TODAY OpenERP S.A. <http://openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of ... | agpl-3.0 |
rcarrillocruz/ansible | lib/ansible/modules/network/dellos6/dellos6_config.py | 60 | 10282 | #!/usr/bin/python
#
# (c) 2015 Peter Sprygada, <psprygada@ansible.com>
#
# Copyright (c) 2016 Dell 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 versi... | gpl-3.0 |
c0hen/django-venv | lib/python3.4/site-packages/setuptools/tests/test_easy_install.py | 9 | 15508 | """Easy install Tests
"""
import sys
import os
import shutil
import tempfile
import unittest
import site
import contextlib
import textwrap
import tarfile
import logging
import distutils.core
from setuptools.compat import StringIO, BytesIO, next, urlparse
from setuptools.sandbox import run_setup, SandboxViolation
from ... | gpl-3.0 |
openstack/cinder | cinder/tests/unit/api/contrib/test_snapshot_actions.py | 2 | 5777 | # 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/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed ... | apache-2.0 |
zulip/django | tests/auth_tests/test_auth_backends.py | 200 | 23799 | from __future__ import unicode_literals
from datetime import date
from django.contrib.auth import (
BACKEND_SESSION_KEY, SESSION_KEY, authenticate, get_user,
)
from django.contrib.auth.backends import ModelBackend
from django.contrib.auth.hashers import MD5PasswordHasher
from django.contrib.auth.models import Ano... | bsd-3-clause |
andrewklau/openshift-tools | ansible/roles/lib_openshift_3.2/build/lib/volume.py | 13 | 1653 | # pylint: skip-file
class Volume(object):
''' Class to wrap the oc command line tools '''
volume_mounts_path = {"pod": "spec.containers[0].volumeMounts",
"dc": "spec.template.spec.containers[0].volumeMounts",
"rc": "spec.template.spec.containers[0].volumeMo... | apache-2.0 |
loulich/Couchpotato | couchpotato/core/media/movie/providers/trailer/youtube_dl/extractor/yourupload.py | 35 | 1566 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
class YourUploadIE(InfoExtractor):
_VALID_URL = r'''(?x)https?://(?:www\.)?
(?:yourupload\.com/watch|
embed\.yourupload\.com|
embed\.yucache\.net
)/(?P<id>[A-Za-z0-9]+)
... | gpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.