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
eg-zhang/h2o-2
py/testdir_multi_jvm/test_GLM2_covtype_exec.py
9
2344
import unittest, time, sys, random sys.path.extend(['.','..','../..','py']) import h2o, h2o_cmd, h2o_glm, h2o_import as h2i class Basic(unittest.TestCase): def tearDown(self): h2o.check_sandbox_for_errors() @classmethod def setUpClass(cls): h2o.init(3,java_heap_GB=4) @classmethod ...
apache-2.0
avneesh91/django
tests/auth_tests/test_forms.py
15
34291
import datetime import re from unittest import mock from django import forms from django.contrib.auth.forms import ( AdminPasswordChangeForm, AuthenticationForm, PasswordChangeForm, PasswordResetForm, ReadOnlyPasswordHashField, ReadOnlyPasswordHashWidget, SetPasswordForm, UserChangeForm, UserCreationForm, ...
bsd-3-clause
vipulsabhaya/cue
cue/openstack/common/policy.py
1
28680
# 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
JioCloud/nova_test_latest
nova/pci/whitelist.py
35
4103
# Copyright (c) 2013 Intel, Inc. # 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 # # http://www.apache.org/li...
apache-2.0
cloudera/hue
desktop/core/ext-py/dnspython-1.15.0/tests/test_rdtypeanyeui.py
4
9292
# Copyright (C) 2015 Red Hat, Inc. # Author: Petr Spacek <pspacek@redhat.com> # # 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. # #...
apache-2.0
mgraupe/acq4
acq4/filetypes/ImageFile.py
4
5498
# -*- coding: utf-8 -*- from PIL import Image ## Install support for 16-bit images in PIL if Image.VERSION == '1.1.7': Image._MODE_CONV["I;16"] = ('%su2' % Image._ENDIAN, None) Image._fromarray_typemap[((1, 1), "<u2")] = ("I", "I;16") if Image.VERSION == '1.1.6': Image._MODE_CONV["I;16"] = ('%su2' % Image...
mit
valentin-krasontovitsch/ansible
lib/ansible/plugins/action/nxos.py
12
7412
# # (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 version. # # Ansible is d...
gpl-3.0
ubc/edx-platform
common/djangoapps/course_action_state/migrations/0002_add_rerun_display_name.py
129
5409
# -*- coding: utf-8 -*- import 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 'CourseRerunState.display_name' db.add_column('course_action_state_coursererunstate', 'displa...
agpl-3.0
faribas/RMG-Py
rmgpy/quantity.py
4
28300
#!/usr/bin/env python # encoding: utf-8 ################################################################################ # # RMG - Reaction Mechanism Generator # # Copyright (c) 2009-2011 by the RMG Team (rmg_dev@mit.edu) # # Permission is hereby granted, free of charge, to any person obtaining a # copy of thi...
mit
SnappleCap/oh-mainline
vendor/packages/Django/tests/regressiontests/templates/parser.py
58
3218
""" Testing some internals of the template processing. These are *not* examples to be copied in user code. """ from __future__ import unicode_literals from django.template import (TokenParser, FilterExpression, Parser, Variable, TemplateSyntaxError) from django.utils.unittest import TestCase class ParserTests(Te...
agpl-3.0
paulmathews/nova
nova/api/openstack/compute/contrib/server_diagnostics.py
19
2505
# 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/licenses/LICENSE-2.0 # # Unless required b...
apache-2.0
forivall/tacoterm
mscript.py
3
29478
#!/usr/bin/env python import errno, os, re, sys, time from maitch import * ctx = Context(PACKAGE = "roxterm", SRC_DIR = "${TOP_DIR}/src", MCFLAGS = "${CPPFLAGS} -I. -I${SRC_DIR} -D_GNU_SOURCE -DHAVE_CONFIG_H") MINILIB_SOURCES = "colourscheme.c dlg.c display.c dragrcv.c dynopts.c " \ "encodings.c gl...
gpl-2.0
kondrak/bgfx
3rdparty/scintilla/scripts/FileGenerator.py
74
6509
#!/usr/bin/env python # FileGenerator.py - implemented 2013 by Neil Hodgson neilh@scintilla.org # Released to the public domain. # Generate or regenerate source files based on comments in those files. # May be modified in-place or a template may be generated into a complete file. # Requires Python 2.5 or later # The f...
bsd-2-clause
egafford/sahara
sahara/tests/unit/service/validation/test_ng_template_validation_create.py
3
15036
# Copyright (c) 2013 Mirantis 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
tcheehow/MissionPlanner
Lib/site-packages/scipy/ndimage/interpolation.py
55
25609
# Copyright (C) 2003-2005 Peter J. Verveer # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the following d...
gpl-3.0
tmerrick1/spack
lib/spack/external/jinja2/bccache.py
84
12794
# -*- coding: utf-8 -*- """ jinja2.bccache ~~~~~~~~~~~~~~ This module implements the bytecode cache system Jinja is optionally using. This is useful if you have very complex template situations and the compiliation of all those templates slow down your application too much. Situations whe...
lgpl-2.1
jaimahajan1997/sympy
sympy/combinatorics/testutil.py
33
11004
from __future__ import print_function, division from sympy.core.compatibility import range from sympy.combinatorics.util import _distribute_gens_by_base from sympy.combinatorics import Permutation rmul = Permutation.rmul def _cmp_perm_lists(first, second): """ Compare two lists of permutations as sets. ...
bsd-3-clause
hynnet/openwrt-mt7620
staging_dir/target-mipsel_r2_uClibc-0.9.33.2/usr/lib/python2.7/ctypes/macholib/dyld.py
253
5341
###################################################################### # This file should be kept compatible with Python 2.3, see PEP 291. # ###################################################################### """ dyld emulation """ import os from framework import framework_info from dylib import dylib_info from it...
gpl-2.0
web30s/odoo-9.0c-20160402
hello/templates/openerp/addons/hr_contract/hr_contract.py
44
5741
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. import time from openerp import SUPERUSER_ID from openerp.osv import fields, osv class hr_employee(osv.osv): _name = "hr.employee" _description = "Employee" _inherit = "hr.employee" def _get_latest_con...
gpl-3.0
mhbu50/erpnext
erpnext/patches/v12_0/rename_lost_reason_detail.py
3
1325
from __future__ import unicode_literals import frappe def execute(): if frappe.db.exists("DocType", "Lost Reason Detail"): frappe.reload_doc("crm", "doctype", "opportunity_lost_reason") frappe.reload_doc("crm", "doctype", "opportunity_lost_reason_detail") frappe.reload_doc("setup", "doctype...
gpl-3.0
msmolens/VTK
ThirdParty/Twisted/twisted/internet/_sslverify.py
23
58378
# -*- test-case-name: twisted.test.test_sslverify -*- # Copyright (c) 2005 Divmod, Inc. # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. from __future__ import division, absolute_import import itertools import warnings from hashlib import md5 from OpenSSL import SSL, crypto, version try: ...
bsd-3-clause
nathanaevitas/odoo
openerp/addons/event/wizard/__init__.py
435
1067
# -*- 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
govarguz/espressopp
src/main/_setup.py
9
4037
# Copyright (C) 2012,2013 # Max Planck Institute for Polymer Research # Copyright (C) 2008,2009,2010,2011 # Max-Planck-Institute for Polymer Research & Fraunhofer SCAI # # This file is part of ESPResSo++. # # ESPResSo++ is free software: you can redistribute it and/or modify # it under the terms of t...
gpl-3.0
hosseinsadeghi/ultracold-ions
uci/AngularDampingAdvance.py
2
3099
# vi: ts=4 sw=4 import math import numpy import pyopencl.array as cl_array import pyopencl as cl import sys import os class AngularDampingAdvance(): def __init__(self, ctx = None, queue = None): self.minRadius = 1.0e-5 self.ctx = ctx self.queue = queue if self.ctx == None: ...
mit
chriscauley/django-registration
registration/admin.py
1
1630
from django.contrib import admin, messages from django.contrib.sites.requests import RequestSite from django.contrib.sites.models import Site from django.utils.translation import ugettext_lazy as _ from registration.models import RegistrationProfile class RawMixin(object): def formfield_for_dbfield(self, db_field, ...
bsd-3-clause
joakim-hove/django
django/contrib/flatpages/views.py
475
2777
from django.conf import settings from django.contrib.flatpages.models import FlatPage from django.contrib.sites.shortcuts import get_current_site from django.http import Http404, HttpResponse, HttpResponsePermanentRedirect from django.shortcuts import get_object_or_404 from django.template import loader from django.uti...
bsd-3-clause
SerialShadow/SickRage
lib/hachoir_core/field/basic_field_set.py
74
4776
from hachoir_core.field import Field, FieldError from hachoir_core.stream import InputStream from hachoir_core.endian import BIG_ENDIAN, LITTLE_ENDIAN, MIDDLE_ENDIAN from hachoir_core.event_handler import EventHandler class ParserError(FieldError): """ Error raised by a field set. @see: L{FieldError} ...
gpl-3.0
X-dark/Flexget
flexget/plugins/output/utorrent.py
7
3914
# -*- coding: utf-8 -*- from __future__ import unicode_literals, division, absolute_import import os from logging import getLogger from flexget import plugin from flexget.event import event from flexget.utils import requests from flexget.utils.soup import get_soup from flexget.utils.template import RenderError log ...
mit
saisrisathya/whatsapps
build/lib/yowsup/layers/protocol_profiles/layer.py
31
2304
from yowsup.layers import YowProtocolLayer from .protocolentities import * from yowsup.layers.protocol_iq.protocolentities import ErrorIqProtocolEntity, ResultIqProtocolEntity class YowProfilesProtocolLayer(YowProtocolLayer): def __init__(self): handleMap = { "iq": (self.recvIq, self.sendIq) ...
gpl-3.0
mjtamlyn/django
tests/invalid_models_tests/test_relative_fields.py
18
60736
from django.core.checks import Error, Warning as DjangoWarning from django.db import models from django.db.models.fields.related import ForeignObject from django.test.testcases import SimpleTestCase, skipIfDBFeature from django.test.utils import isolate_apps, override_settings @isolate_apps('invalid_models_tests') cl...
bsd-3-clause
Arakmar/Sick-Beard
cherrypy/process/wspbus.py
45
14462
"""An implementation of the Web Site Process Bus. This module is completely standalone, depending only on the stdlib. Web Site Process Bus -------------------- A Bus object is used to contain and manage site-wide behavior: daemonization, HTTP server start/stop, process reload, signal handling, drop privileges, PID f...
gpl-3.0
Azure/azure-sdk-for-python
sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_08_01/operations/_virtual_router_peerings_operations.py
1
22472
# 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 may ...
mit
mynlp/ccg2lambda
scripts/run_tests.py
1
3569
#!/usr/bin/python3 # -*- coding: utf-8 -*- # # Copyright 2015 Pascual Martinez-Gomez # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # ...
apache-2.0
apporc/neutron
neutron/extensions/extra_dhcp_opt.py
5
3380
# 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 law or agreed to in...
apache-2.0
lucaspcamargo/litmus-rt
tools/perf/scripts/python/sched-migration.py
1910
11965
#!/usr/bin/python # # Cpu task migration overview toy # # Copyright (C) 2010 Frederic Weisbecker <fweisbec@gmail.com> # # perf script event handlers have been generated by perf script -g python # # This software is distributed under the terms of the GNU General # Public License ("GPL") version 2 as published by the Fre...
gpl-2.0
apache/incubator-allura
ForgeSVN/forgesvn/tests/model/test_repository.py
1
44587
# 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 (t...
apache-2.0
benjaminjkraft/django
django/core/management/commands/makemigrations.py
10
13506
import os import sys import warnings from itertools import takewhile from django.apps import apps from django.core.management.base import BaseCommand, CommandError from django.db.migrations import Migration from django.db.migrations.autodetector import MigrationAutodetector from django.db.migrations.loader import Migr...
bsd-3-clause
4shadoww/hakkuframework
core/lib/dns/rdtypes/ANY/SSHFP.py
8
2829
# Copyright (C) 2005-2007, 2009-2011 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 "...
mit
kived/py-cnotify
test/variable.py
4
15715
# -*- coding: utf-8 -*- #--------------------------------------------------------------------# # This file is part of Py-notify. # # # # Copyright (C) 2007, 2008 Paul Pogonyshev. # # ...
lgpl-2.1
samuknet/servo
tests/wpt/web-platform-tests/tools/py/testing/code/test_excinfo.py
160
30688
# -*- coding: utf-8 -*- import py from py._code.code import FormattedExcinfo, ReprExceptionInfo queue = py.builtin._tryimport('queue', 'Queue') failsonjython = py.test.mark.xfail("sys.platform.startswith('java')") from test_source import astonly try: import importlib except ImportError: invalidate_import_cac...
mpl-2.0
mlperf/inference_results_v0.7
closed/Atos/code/dlrm/tensorrt/scripts/data_loader_terabyte.py
18
12309
# Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. from __future__ import absolute_import, division, print_function, unicode_literals import os import numpy as np from torch.util...
apache-2.0
unioslo/cerebrum
contrib/no/uio/user_per_sko.py
1
20843
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2004 University of Oslo, Norway # # This file is part of Cerebrum. # # Cerebrum 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-2.0
packet-tracker/onos-1.2.0-custom-build
tools/test/topos/optical2.py
19
2477
#!/usr/bin/env python ''' file: custom/optical.py ''' from mininet.topo import Topo from mininet.net import Mininet from mininet.cli import CLI from mininet.log import setLogLevel, info from mininet.link import Intf, Link from mininet.node import RemoteController class NullIntf( Intf ): "A dummy interface with a...
apache-2.0
dav1x/ansible
lib/ansible/modules/network/dellos10/dellos10_command.py
46
7522
#!/usr/bin/python # # (c) 2015 Peter Sprygada, <psprygada@ansible.com> # # Copyright (c) 2017 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
Architektor/PySnip
venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/jisfreq.py
3131
47315
######################## 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-3.0
Nikoala/CouchPotatoServer
libs/pyutil/version_class.py
106
5299
# -*- coding: utf-8 -*- # Copyright (c) 2004-2010 Zooko Wilcox-O'Hearn # This file is part of pyutil; see README.rst for licensing terms. """ extended version number class """ # verlib a.k.a. distutils.version by Tarek Ziadé. from pyutil.verlib import NormalizedVersion def cmp_version(v1, v2): return cmp(Normal...
gpl-3.0
bgris/ODL_bgris
lib/python3.5/distutils/tests/test_install_lib.py
11
3934
"""Tests for distutils.command.install_data.""" import sys import os import importlib.util import unittest from distutils.command.install_lib import install_lib from distutils.extension import Extension from distutils.tests import support from distutils.errors import DistutilsOptionError from test.support import run_u...
gpl-3.0
GNOME/hamster-applet
wafadmin/Tools/python.py
7
11127
#! /usr/bin/env python # encoding: utf-8 import os,sys import TaskGen,Utils,Utils,Runner,Options,Build from Logs import debug,warn,info from TaskGen import extension,taskgen,before,after,feature from Configure import conf EXT_PY=['.py'] FRAG_2=''' #include "Python.h" #ifdef __cplusplus extern "C" { #endif void Py_Ini...
gpl-3.0
cbrepo/celery
celery/tests/test_utils/test_utils_info.py
14
1112
from __future__ import absolute_import from celery import Celery from celery.utils import textindent from celery.tests.utils import Case RANDTEXT = """\ The quick brown fox jumps over the lazy dog\ """ RANDTEXT_RES = """\ The quick brown fox jumps over the lazy dog\ """ QUEUES = {"queue1": { ...
bsd-3-clause
asterisk/testsuite
lib/python/asterisk/pluggable_modules.py
1
38856
"""Generic pluggable modules Copyright (C) 2012, Digium, Inc. Kinsey Moore <kmoore@digium.com> This program is free software, distributed under the terms of the GNU General Public License Version 2. """ import os import sys import logging import shutil import re sys.path.append("lib/python") from .ami import AMIEven...
gpl-2.0
etos/django
tests/forms_tests/tests/test_validators.py
111
2210
import re from unittest import TestCase from django import forms from django.core import validators from django.core.exceptions import ValidationError class TestFieldWithValidators(TestCase): def test_all_errors_get_reported(self): class UserForm(forms.Form): full_name = forms.CharField( ...
bsd-3-clause
hyperized/ansible
test/units/modules/network/netvisor/test_pn_vrouter_interface_ip.py
23
2787
# Copyright: (c) 2018, Pluribus Networks # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import (absolute_import, division, print_function) __metaclass__ = type from units.compat.mock import patch from ansible.modules.network.netvisor import pn_vrouter_inte...
gpl-3.0
dya2/python-for-android
python-build/python-libs/gdata/src/gdata/oauth/__init__.py
157
19407
import cgi import urllib import time import random import urlparse import hmac import binascii VERSION = '1.0' # Hi Blaine! HTTP_METHOD = 'GET' SIGNATURE_METHOD = 'PLAINTEXT' # Generic exception class class OAuthError(RuntimeError): def __init__(self, message='OAuth error occured.'): self.m...
apache-2.0
tempbottle/rethinkdb
drivers/python/rethinkdb/_import.py
9
39332
#!/usr/bin/env python from __future__ import print_function import signal import sys, os, datetime, time, json, traceback, csv import multiprocessing, multiprocessing.queues, subprocess, re, ctypes, codecs from optparse import OptionParser from ._backup import * import rethinkdb as r # Used because of API difference...
agpl-3.0
watonyweng/nova
nova/tests/unit/virt/hyperv/test_snapshotops.py
67
5891
# Copyright 2014 Cloudbase Solutions Srl # 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 r...
apache-2.0
darrengarvey/procfs-snapshot
parsers/smaps.py
1
3160
from model import MemoryRegion import util import re def parse_smaps_header(header): info = MemoryRegion(free=False) # Example line is: # 011e6000-01239000 rw-p 00000000 00:00 0 [heap] # 8ec00000-8ec01000 rw-s 00000000 00:14 20 /dev/shm/NS2371 (deleted) # All numbers are hex except for the ino...
apache-2.0
flijloku/livestreamer
src/livestreamer_cli/utils/player.py
23
1244
import os import sys from ..compat import shlex_quote def check_paths(exes, paths): for path in paths: for exe in exes: path = os.path.expanduser(os.path.join(path, exe)) if os.path.isfile(path): return path def find_default_player(): if "darwin" in sys.platf...
bsd-2-clause
dmarteau/QGIS
python/plugins/db_manager/db_plugins/postgis/plugin.py
25
17115
# -*- coding: utf-8 -*- """ /*************************************************************************** Name : DB Manager Description : Database manager plugin for QGIS Date : May 23, 2011 copyright : (C) 2011 by Giuseppe Sucameli email : brush.tyler@...
gpl-2.0
raygeeknyc/ohgee
visionanalyzer.py
1
19670
#!/usr/bin/python3 import logging # Used only if this is run as main _DEBUG = logging.DEBUG SENTIMENT_CONFIDENCE_THRESHOLD = 0.25 GOOD_SENTIMENT_THRESHOLD = SENTIMENT_CONFIDENCE_THRESHOLD BAD_SENTIMENT_THRESHOLD = -1*SENTIMENT_CONFIDENCE_THRESHOLD # Import the packages we need for drawing and displaying images from ...
gpl-3.0
neilLasrado/erpnext
erpnext/accounts/doctype/journal_entry/test_journal_entry.py
14
11145
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import unittest, frappe from frappe.utils import flt, nowdate from erpnext.accounts.doctype.account.test_account import get_inventory_account from erpne...
gpl-3.0
ATIX-AG/ansible
lib/ansible/vars/reserved.py
40
2591
# (c) 2017 Ansible By Red Hat # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible ...
gpl-3.0
CuonDeveloper/cuon
cuon_server/LoadBalancer/txlb/manager.py
6
18051
import os import time from datetime import datetime from twisted.protocols import amp from twisted.internet import protocol from txlb import util from txlb import model from txlb import proxy from txlb import config from txlb import logging from txlb import schedulers class Error(Exception): pass class Unkn...
gpl-3.0
rcbops/python-django-buildpackage
django/contrib/comments/__init__.py
423
3333
from django.conf import settings from django.core import urlresolvers from django.core.exceptions import ImproperlyConfigured from django.contrib.comments.models import Comment from django.contrib.comments.forms import CommentForm from django.utils.importlib import import_module DEFAULT_COMMENTS_APP = 'django.contrib....
bsd-3-clause
sathnaga/virt-test
tools/common.py
12
1426
import os, sys def load_setup_modules(client_dir): try: sys.path.insert(0, client_dir) import setup_modules finally: sys.path.pop(0) return setup_modules dirname = os.path.dirname(sys.modules[__name__].__file__) virt_test_dir = os.path.abspath(os.path.join(dirname, "..")) sys.path....
gpl-2.0
sovaa/backdoorme
backdoors/shell/bash2.py
1
1323
from backdoors.backdoor import * import subprocess import threading class Bash2(Backdoor): prompt = Fore.RED + "(bash) " + Fore.BLUE + ">> " + Fore.RESET def __init__(self, core): cmd.Cmd.__init__(self) self.intro = GOOD + "Using second Bash module..." self.core = core self.opt...
mit
tik0/inkscapeGrid
share/extensions/text_braille.py
6
1177
#!/usr/bin/env python # -*- coding: utf-8 -*- import chardataeffect, inkex, string convert_table = {\ 'a': unicode("⠁", "utf-8"),\ 'b': unicode("⠃", "utf-8"),\ 'c': unicode("⠉", "utf-8"),\ 'd': unicode("⠙", "utf-8"),\ 'e': unicode("⠑", "utf-8"),\ 'f': unicode("⠋", "utf-8"),\ 'g': unicode("⠛", "utf-8"),\ 'h': unicode(...
gpl-2.0
40223110/2015CDAFinal_test2
static/Brython3.1.0-20150301-090019/Lib/getopt.py
845
7488
"""Parser for command line options. This module helps scripts to parse the command line arguments in sys.argv. It supports the same conventions as the Unix getopt() function (including the special meanings of arguments of the form `-' and `--'). Long options similar to those supported by GNU software may be used as ...
gpl-3.0
SebDieBln/QGIS
python/plugins/processing/algs/lidar/lastools/lasthin.py
12
3757
# -*- coding: utf-8 -*- """ *************************************************************************** lasthin.py --------------------- Date : September 2013 Copyright : (C) 2013 by Martin Isenburg Email : martin near rapidlasso point com *****************...
gpl-2.0
indictranstech/reciphergroup-frappe
frappe/website/doctype/website_settings/website_settings.py
27
4297
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals import frappe from frappe import _ from frappe.utils import get_request_site_address, encode from frappe.model.document import Document from urllib import quote from frappe.websit...
mit
hzlf/openbroadcast.org
website/base/utils/fold_to_ascii/mapping.py
2
27241
# -*- coding: utf-8 -*- """ Mappings suitable for translate tables. """ # To see printed representation of character `k`: # print(unichr(k)) # # ASCII characters replace to themselves. codepoint_to_self = [ (0x0, u"\x00"), (0x1, u"\x01"), (0x2, u"\x02"), (0x3, u"\x03"), (0x4, u"\x04"), (0x5, u...
gpl-3.0
lem-usp/Bio507
site.py
1
3672
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import unicode_literals # unicode by default import sys import datetime from collections import OrderedDict import pandoc #import bib from flask import Flask from flask import render_template, redirect, url_for from flaskext.babel import Babel from flask...
mit
importsfromgooglecode/pychess
lib/pychess/Utils/const.py
20
9143
# -*- coding: UTF-8 -*- ################################################################################ # PyChess information # ################################################################################ NAME = "PyChess" ENGINES_XML_API_VERSION = "0.12" ...
gpl-3.0
sliz1/servo
tests/wpt/harness/wptrunner/products.py
118
2500
# 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/. import os import importlib import imp from .browsers import product_list def products_enabled(config): names = con...
mpl-2.0
vicky2135/lucious
oscar/lib/python2.7/site-packages/pygments/formatters/bbcode.py
31
3314
# -*- coding: utf-8 -*- """ pygments.formatters.bbcode ~~~~~~~~~~~~~~~~~~~~~~~~~~ BBcode formatter. :copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ from pygments.formatter import Formatter from pygments.util import get_bool_opt __al...
bsd-3-clause
alexandrucoman/vbox-nova-driver
nova/compute/manager.py
1
323194
# 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
tectronics/google-blog-converters-appengine
src/movabletype2blogger/movabletype2blogger.py
30
2023
#!/usr/bin/env python # Copyright 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.txt # # Unless required by applicable law or...
apache-2.0
popazerty/try
lib/python/Components/ServiceEventTracker.py
10
4229
InfoBarCount = 0 class InfoBarBase: onInfoBarOpened = [ ] onInfoBarClosed = [ ] @staticmethod def connectInfoBarOpened(fnc): if not fnc in InfoBarBase.onInfoBarOpened: InfoBarBase.onInfoBarOpened.append(fnc) @staticmethod def disconnectInfoBarOpened(fnc): if fnc in InfoBarBase.onInfoBarOpened: InfoB...
gpl-2.0
abridgett/boto
boto/sqs/attributes.py
223
1718
# Copyright (c) 2006,2007 Mitch Garnaat http://garnaat.org/ # # 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, copy, modi...
mit
ephoning/heroku-buildpack-python
vendor/distribute-0.6.36/setuptools/command/egg_info.py
66
15621
"""setuptools.command.egg_info Create a distribution's .egg-info directory and contents""" # This module should be kept compatible with Python 2.3 import os, re, sys from setuptools import Command from distutils.errors import * from distutils import log from setuptools.command.sdist import sdist from distutils.util i...
mit
ak2703/edx-platform
cms/djangoapps/contentstore/views/tabs.py
125
7890
""" Views related to course tabs """ from student.auth import has_course_author_access from util.json_request import expect_json, JsonResponse from django.http import HttpResponseNotFound from django.contrib.auth.decorators import login_required from django.core.exceptions import PermissionDenied from django.views.dec...
agpl-3.0
credativUK/OCB
addons/mrp_repair/wizard/cancel_repair.py
52
3699
# -*- 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
cubells/l10n-spain
l10n_es_aeat_mod130/models/mod130.py
1
10541
# Copyright 2014-2019 Tecnativa - Pedro M. Baeza from odoo import _, api, fields, exceptions, models def trunc(f, n): slen = len('%.*f' % (n, f)) return float(str(f)[:slen]) class L10nEsAeatMod130Report(models.Model): _description = "AEAT 130 report" _inherit = "l10n.es.aeat.report" _name = "l1...
agpl-3.0
collinjackson/mojo
third_party/cython/src/Cython/Build/Inline.py
89
10878
import sys, os, re, inspect import imp try: import hashlib except ImportError: import md5 as hashlib from distutils.core import Distribution, Extension from distutils.command.build_ext import build_ext import Cython from Cython.Compiler.Main import Context, CompilationOptions, default_options from Cython.Co...
bsd-3-clause
yury-s/v8-inspector
Source/chrome/tools/telemetry/telemetry/core/backends/form_based_credentials_backend.py
24
3604
# Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import logging from telemetry.core import exceptions class FormBasedCredentialsBackend(object): def __init__(self): self._logged_in = False def Is...
bsd-3-clause
amitdeutsch/oppia
jinja_utils_test.py
9
4194
# coding: utf-8 # # Copyright 2014 The Oppia 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 requi...
apache-2.0
cosmiclattes/TPBviz
torrent/lib/python2.7/site-packages/django/utils/unittest/loader.py
110
13445
"""Loading unittests.""" import os import re import sys import traceback import types import unittest from fnmatch import fnmatch from django.utils.unittest import case, suite try: from os.path import relpath except ImportError: from django.utils.unittest.compatibility import relpath __unittest = True de...
gpl-3.0
teosz/servo
tests/wpt/harness/wptrunner/products.py
118
2500
# 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/. import os import importlib import imp from .browsers import product_list def products_enabled(config): names = con...
mpl-2.0
srsman/odoo
addons/sale_order_dates/sale_order_dates.py
223
5308
# -*- 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
yousafsyed/casperjs
bin/Lib/unittest/test/test_result.py
81
23247
import io import sys import textwrap from test import support import traceback import unittest class Test_TestResult(unittest.TestCase): # Note: there are not separate tests for TestResult.wasSuccessful(), # TestResult.errors, TestResult.failures, TestResult.testsRun or # TestResult.shouldStop because t...
mit
winklerand/pandas
pandas/tests/test_errors.py
9
1147
# -*- coding: utf-8 -*- import pytest from warnings import catch_warnings import pandas # noqa import pandas as pd @pytest.mark.parametrize( "exc", ['UnsupportedFunctionCall', 'UnsortedIndexError', 'OutOfBoundsDatetime', 'ParserError', 'PerformanceWarning', 'DtypeWarning', 'E...
bsd-3-clause
mr-c/common-workflow-language
v1.0/salad/schema_salad/tests/test_cli_args.py
8
1199
from __future__ import absolute_import import unittest import sys import schema_salad.main as cli_parser # for capturing print() output from contextlib import contextmanager from six import StringIO @contextmanager def captured_output(): new_out, new_err = StringIO(), StringIO() old_out, old_err = sys.stdout...
apache-2.0
NickPresta/sentry
src/sentry/migrations/0032_auto__add_eventmeta.py
7
14351
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'GroupMeta' db.create_table('sentry_groupmeta', ( ('id', self.gf('django.db.models.fiel...
bsd-3-clause
skonto/spark
python/pyspark/mllib/stat/KernelDensity.py
118
1997
# # 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 us...
apache-2.0
kvar/ansible
test/units/modules/network/cnos/test_cnos_logging.py
23
2268
# # (c) 2018 Red Hat Inc. # Copyright (C) 2017 Lenovo. # # 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 la...
gpl-3.0
eayunstack/neutron
neutron/tests/unit/extension_stubs.py
5
2334
# Copyright 2011 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 req...
apache-2.0
richardcs/ansible
lib/ansible/modules/cloud/azure/azure_rm_virtualnetwork_facts.py
7
5178
#!/usr/bin/python # # Copyright (c) 2016 Matt Davis, <mdavis@ansible.com> # Chris Houseknecht, <house@redhat.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__ = type ANS...
gpl-3.0
benvand/alexa-stackoverflow
strings.py
1
1340
"""Strings for Alexa to say""" from settings import SITE_NAME_SPEAKABLE SITE_NAME = SITE_NAME_SPEAKABLE # Breaks BREAK = '<break strength="{strength}">' XS_BREAK = BREAK.format(strength='x-strong') S_BREAK = BREAK.format(strength='strong') # Greet and dismiss WELCOME_REPROMPT = \ """ You can ask {site_name} for an...
mit
seewindcn/tortoisehg
src/mercurial/ui.py
1
45732
# ui.py - user interface bits for mercurial # # Copyright 2005-2007 Matt Mackall <mpm@selenic.com> # # This software may be used and distributed according to the terms of the # GNU General Public License version 2 or any later version. from __future__ import absolute_import import errno import getpass import inspect ...
gpl-2.0
valentin-krasontovitsch/ansible
lib/ansible/modules/database/postgresql/postgresql_lang.py
1
11522
#!/usr/bin/python # -*- coding: utf-8 -*- # # (c) 2014, Jens Depuydt <http://www.jensd.be> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', ...
gpl-3.0
Azure/azure-sdk-for-python
sdk/applicationinsights/azure-applicationinsights/azure/applicationinsights/models/events_user_info_py3.py
1
1277
# 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