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 |
|---|---|---|---|---|---|
Rusk85/pyload | module/plugins/hoster/LoadTo.py | 3 | 2017 | # -*- coding: utf-8 -*-
"""
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 in ... | gpl-3.0 |
AnishShah/tensorflow | tensorflow/contrib/session_bundle/gc.py | 41 | 6552 | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
miconof/headphones | lib/mako/ext/babelplugin.py | 60 | 2064 | # ext/babelplugin.py
# Copyright (C) 2006-2015 the Mako authors and contributors <see AUTHORS file>
#
# This module is part of Mako and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""gettext message extraction via Babel: http://babel.edgewall.org/"""
from babel.messages.extr... | gpl-3.0 |
houzhenggang/hiwifi-openwrt-HC5661-HC5761 | staging_dir/target-mipsel_r2_uClibc-0.9.33.2/usr/lib/python2.7/email/test/test_email_codecs_renamed.py | 298 | 2842 | # Copyright (C) 2002-2006 Python Software Foundation
# Contact: email-sig@python.org
# email package unit tests for (optional) Asian codecs
import unittest
from test.test_support import run_unittest
from email.test.test_email import TestEmailBase
from email.charset import Charset
from email.header import Header, deco... | gpl-2.0 |
reeshupatel/demo | tools/install_venv.py | 22 | 2328 | # Copyright 2013 IBM Corp.
# Copyright 2012 OpenStack Foundation
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file ex... | apache-2.0 |
AltSchool/django | tests/template_tests/filter_tests/test_chaining.py | 345 | 3940 | from django.test import SimpleTestCase
from django.utils.safestring import mark_safe
from ..utils import setup
class ChainingTests(SimpleTestCase):
"""
Chaining safeness-preserving filters should not alter the safe status.
"""
@setup({'chaining01': '{{ a|capfirst|center:"7" }}.{{ b|capfirst|center:"... | bsd-3-clause |
linted/Skip-Trace | common/STcommon.py | 1 | 1245 | try:
import logging
from Crypto.PublicKey import RSA
except ImportError as e:
print("[-] {}, exiting".format(e))
exit(1)
def configDebugLog(logFileName):
log_file = logging.FileHandler(logFileName,mode='w')
log_file.setLevel(logging.DEBUG)
log_file.setFormatter(logging.Formatter('%(asctime)s - %(levelname)s - %... | mit |
klen/simpletree | docs/conf.py | 1 | 1144 | # -*- coding: utf-8 -*-
import os
import sys
from simpletree import __version__ as release
project = 'SimpleTree'
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.intersphinx']
templates_path = ['_templates']
source_suffix = '.rst'
mas... | bsd-3-clause |
MaxTyutyunnikov/lino | lino/projects/min2/settings.py | 1 | 2156 | # -*- coding: UTF-8 -*-
## Copyright 2012-2013 Luc Saffre
## This file is part of the Lino project.
## Lino 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 y... | gpl-3.0 |
hkawasaki/kawasaki-aio8-1 | lms/djangoapps/instructor/views/tools.py | 7 | 7609 | """
Tools for the instructor dashboard
"""
import dateutil
import json
from django.conf import settings
from django.contrib.auth.models import User
from django.http import HttpResponseBadRequest
from django.utils.timezone import utc
from django.utils.translation import ugettext as _
from courseware.models import Stud... | agpl-3.0 |
chienlieu2017/it_management | odoo/addons/hr_holidays/report/holidays_summary_report.py | 5 | 5351 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from datetime import timedelta
from dateutil.relativedelta import relativedelta
from odoo import api, fields, models
class HrHolidaySummaryReport(models.AbstractModel):
_name = 'report.hr_holidays.report_holidayssu... | gpl-3.0 |
lidavidm/mathics-heroku | venv/lib/python2.7/site-packages/django/utils/version.py | 228 | 1785 | from __future__ import unicode_literals
import datetime
import os
import subprocess
def get_version(version=None):
"Returns a PEP 386-compliant version number from VERSION."
if version is None:
from django import VERSION as version
else:
assert len(version) == 5
assert version[3] i... | gpl-3.0 |
photoninger/ansible | lib/ansible/modules/cloud/azure/azure_rm_virtualmachine.py | 5 | 78829 | #!/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 |
Microvellum/Fluid-Designer | win64-vc/2.78/python/lib/distutils/tests/test_bdist_rpm.py | 21 | 5061 | """Tests for distutils.command.bdist_rpm."""
import unittest
import sys
import os
import tempfile
import shutil
from test.support import run_unittest
from distutils.core import Distribution
from distutils.command.bdist_rpm import bdist_rpm
from distutils.tests import support
from distutils.spawn import find_executabl... | gpl-3.0 |
jrief/django-shop | shop/migrations/0006_rename_to_catalog.py | 5 | 1073 | # -*- coding: utf-8 -*-
# Generated by Django 1.9.9 on 2016-10-10 20:52
from __future__ import unicode_literals
from django.db import migrations
def forwards(apps, schema_editor):
Page = apps.get_model('cms', 'Page')
for page in Page.objects.filter(application_urls='ProductsListApp'):
page.application... | bsd-3-clause |
Nicop06/ansible | lib/ansible/modules/notification/cisco_spark.py | 26 | 5640 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright: Ansible Project
# 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 |
vlegoff/tsunami | src/primaires/scripting/actions/equiper.py | 1 | 5397 | # -*-coding:Utf-8 -*
# Copyright (c) 2010-2017 LE GOFF Vincent
# 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
# ... | bsd-3-clause |
piotroxp/scibibscan | scib/lib/python3.6/site-packages/pip/_vendor/html5lib/treewalkers/base.py | 355 | 4939 | from __future__ import absolute_import, division, unicode_literals
from xml.dom import Node
from ..constants import namespaces, voidElements, spaceCharacters
__all__ = ["DOCUMENT", "DOCTYPE", "TEXT", "ELEMENT", "COMMENT", "ENTITY", "UNKNOWN",
"TreeWalker", "NonRecursiveTreeWalker"]
DOCUMENT = Node.DOCUMEN... | mit |
MichaelAquilina/restructured-preview | lib/pygments/formatters/svg.py | 76 | 5840 | # -*- coding: utf-8 -*-
"""
pygments.formatters.svg
~~~~~~~~~~~~~~~~~~~~~~~
Formatter for SVG output.
:copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.formatter import Formatter
from pygments.util import get_bool_opt, get... | mit |
KerstinYu/KerstinByte1 | lib/flask/config.py | 781 | 6234 | # -*- coding: utf-8 -*-
"""
flask.config
~~~~~~~~~~~~
Implements the configuration related objects.
:copyright: (c) 2011 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import imp
import os
import errno
from werkzeug.utils import import_string
from ._compat import string_type... | apache-2.0 |
seblat/coala-bears | bears/c_languages/codeclone_detection/ClangCountVectorCreator.py | 26 | 4858 | from clang.cindex import Cursor, Index
from bears.c_languages.codeclone_detection.ClangCountingConditions import (
get_identifier_name, is_function_declaration, is_literal, is_reference)
from bears.c_languages.codeclone_detection.CountVector import CountVector
class ClangCountVectorCreator:
"""
This obje... | agpl-3.0 |
RobotGame/rgkit | test/state_misc_test.py | 2 | 2473 | import ast
import pkg_resources
import unittest
from rgkit.gamestate import GameState
from rgkit.settings import settings
map_data = ast.literal_eval(
open(pkg_resources.resource_filename('rgkit', 'maps/default.py')).read())
settings.init_map(map_data)
class TestStateMisc(unittest.TestCase):
def test_add_ro... | unlicense |
xbmc/atv2 | xbmc/lib/libPython/Python/setup.py | 2 | 56137 | # Autodetecting setup.py script for building the Python extensions
#
__version__ = "$Revision: 52231 $"
import sys, os, getopt, imp, re
from distutils import log
from distutils import sysconfig
from distutils import text_file
from distutils.errors import *
from distutils.core import Extension, setup
from distutils.c... | gpl-2.0 |
SummerLW/Perf-Insight-Report | telemetry/telemetry/core/exceptions.py | 8 | 4616 | # 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
import sys
class Error(Exception):
"""Base class for Telemetry exceptions."""
def __init__(self, msg=''):
super(Error, self).__init_... | bsd-3-clause |
chriskmanx/qmole | QMOLEDEV/protobuf-2.4.1/python/google/protobuf/internal/reflection_test.py | 253 | 99091 | #! /usr/bin/python
# -*- coding: utf-8 -*-
#
# Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
# http://code.google.com/p/protobuf/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following cond... | gpl-3.0 |
quinot/ansible | lib/ansible/modules/cloud/amazon/aws_ssm_parameter_store.py | 20 | 6080 | #!/usr/bin/python
# Copyright: (c) 2017, Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
ANSIBLE_METADATA = {'status': ['preview'],
'supported_by': 'community',
'metadata_version': '1.1'}
DOCUMENTATION = '''
---
modul... | gpl-3.0 |
sdlovecraft/samhains | node_modules/grunt-docker/node_modules/docker/node_modules/pygmentize-bundled/vendor/pygments/pygments/lexers/compiled.py | 198 | 155163 | # -*- coding: utf-8 -*-
"""
pygments.lexers.compiled
~~~~~~~~~~~~~~~~~~~~~~~~
Lexers for compiled languages.
:copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from string import Template
from pygments.lexer import Lexer, Rege... | mit |
Tennyson53/SUR | magnum/conductor/handlers/docker_conductor.py | 6 | 10744 | # 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
# distribu... | apache-2.0 |
edisonlz/fruit | web_project/base/site-packages/django/test/testcases.py | 105 | 49890 | from __future__ import unicode_literals
from copy import copy
import difflib
import errno
from functools import wraps
import json
import os
import re
import socket
import sys
import select
import socket
import threading
import warnings
from django.conf import settings
from django.contrib.staticfiles.handlers import S... | apache-2.0 |
SummitKwan/python-neo | neo/test/iotest/test_hdf5io.py | 6 | 7390 | # -*- coding: utf-8 -*-
"""
Tests of neo.io.hdf5io_new
"""
try:
import unittest2 as unittest
except ImportError:
import unittest
import numpy as np
from numpy.testing import assert_array_equal
from quantities import kHz, mV, ms, second, nA
try:
import h5py
HAVE_H5PY = True
except ImportError:
HAV... | bsd-3-clause |
fiduswriter/fiduswriter | fiduswriter/base/tests/test_prelogin.py | 1 | 2855 | from selenium.webdriver.common.by import By
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from testing.testcases import LiveTornadoTestCase
from testing.selenium_helper import SeleniumHelper
class PreloginTest(LiveTornadoTestCase, SeleniumHe... | agpl-3.0 |
cpritam/moose | framework/scripts/distcc/MachineOutput.py | 7 | 5729 | # Import the MachineWarehouse object
from MachineWarehouse import *
## @class MachineOutput
# Provides screen output functionality
class MachineOutput(object):
## Class constructor.
# @param warehouse The MachineWarehouse object that output is desired from
# @see MachineWarehouse
def __init__(self, wareh... | lgpl-2.1 |
solintegra/addons | event_phone/__openerp__.py | 11 | 1901 | # -*- encoding: utf-8 -*-
##############################################################################
#
# Event Phone module for Odoo/OpenERP
# Copyright (C) 2014 Alexis de Lattre <alexis@via.ecp.fr>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU ... | agpl-3.0 |
TobleMiner/fahrschulcard | solver.py | 1 | 2470 | import sqlite3
from question import Question, Answer
conn = sqlite3.connect('license.db')
c = conn.cursor()
c.execute('CREATE TABLE IF NOT EXISTS "answers" (\
`id` INTEGER PRIMARY KEY AUTOINCREMENT,\
`answer` TEXT,\
`question` INTEGER)')
c.execute('CREATE TABLE IF NOT EXISTS "questions" (\
`id` INTEGER PRIMARY K... | mit |
r-martin-/Code_College | PythonProgramming/poker_hands_v2.py | 1 | 1983 | """Count poker hands
Sample program to count poker hands and thus estimate the probability of a given hand occurring .
The file contains 1 million records randomly distributed and is, therefore, statistically valid.
The data looks like this:
1,1,1,13,2,4,2,3,1,12,0
3,12,3,2,3,11,4,5,2,5,1
1,9,4,6,1,4,3,2,3,9,1
1,4,3... | mit |
erindieringer/IDS-Midtern | lib/jinja2/runtime.py | 335 | 22530 | # -*- coding: utf-8 -*-
"""
jinja2.runtime
~~~~~~~~~~~~~~
Runtime helpers.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD.
"""
import sys
from itertools import chain
from jinja2.nodes import EvalContext, _context_function_types
from jinja2.utils import Markup, soft_unicode, escape, missing... | apache-2.0 |
diofeher/django-nfa | django/db/models/related.py | 49 | 6008 | class BoundRelatedObject(object):
def __init__(self, related_object, field_mapping, original):
self.relation = related_object
self.field_mappings = field_mapping[related_object.name]
def template_name(self):
raise NotImplementedError
def __repr__(self):
return repr(self.__d... | bsd-3-clause |
dataxu/ansible | lib/ansible/modules/cloud/azure/azure_rm_virtualmachine_scaleset_facts.py | 44 | 7256 | #!/usr/bin/python
#
# Copyright (c) 2017 Sertac Ozercan, <seozerca@microsoft.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
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | gpl-3.0 |
aluedeke/chromedriver | py/test/selenium/webdriver/common/element_equality_tests.py | 19 | 1802 | #!/usr/bin/python
# Copyright 2008-2012 WebDriver committers
# Copyright 2008-2012 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... | apache-2.0 |
otherness-space/myProject | my_project_001/lib/python2.7/site-packages/django/contrib/admindocs/urls.py | 317 | 1092 | from django.conf.urls import patterns, url
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('^tag... | mit |
massmutual/scikit-learn | sklearn/discriminant_analysis.py | 3 | 27324 | """
Linear Discriminant Analysis and Quadratic Discriminant Analysis
"""
# Authors: Clemens Brunner
# Martin Billinger
# Matthieu Perrot
# Mathieu Blondel
# License: BSD 3-Clause
from __future__ import print_function
import warnings
import numpy as np
from scipy import linalg
from .extern... | bsd-3-clause |
sumspr/scikit-learn | sklearn/tests/test_base.py | 216 | 7045 | # Author: Gael Varoquaux
# License: BSD 3 clause
import numpy as np
import scipy.sparse as sp
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import assert_true
from sklearn.utils.testing import assert_false
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing impo... | bsd-3-clause |
BaxterStockman/ansible-modules-core | files/file.py | 8 | 19190 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2012, 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... | gpl-3.0 |
JoeLaMartina/aima-python | submissions/Miles/mygames.py | 15 | 10867 | from collections import namedtuple
from games import (Game)
from copy import deepcopy
class GameState:
def __init__(self, to_move, board, label=None, depth=4):
self.to_move = to_move
self.board = board
self.label = label
self.MaxDepth = depth
def __str__(self):
if self... | mit |
ukanga/SickRage | lib/hachoir_core/memory.py | 177 | 2417 | import gc
#---- Default implementation when resource is missing ----------------------
PAGE_SIZE = 4096
def getMemoryLimit():
"""
Get current memory limit in bytes.
Return None on error.
"""
return None
def setMemoryLimit(max_mem):
"""
Set memory limit in bytes.
Use value 'None' to d... | gpl-3.0 |
sodafree/backend | build/lib.linux-i686-2.7/django/contrib/flatpages/models.py | 410 | 1134 | from django.db import models
from django.contrib.sites.models import Site
from django.utils.translation import ugettext_lazy as _
class FlatPage(models.Model):
url = models.CharField(_('URL'), max_length=100, db_index=True)
title = models.CharField(_('title'), max_length=200)
content = models.TextField(_(... | bsd-3-clause |
gaddman/ansible | test/units/modules/network/fortimanager/test_fmgr_device.py | 21 | 10701 | # (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 dis... | gpl-3.0 |
canaltinova/servo | tests/wpt/web-platform-tests/content-security-policy/support/report.py | 38 | 2129 | import time
import json
import re
def retrieve_from_stash(request, key, timeout, default_value):
t0 = time.time()
while time.time() - t0 < timeout:
time.sleep(0.5)
value = request.server.stash.take(key=key)
if value is not None:
return value
return default_value
def main(request, response):
... | mpl-2.0 |
ActionAdam/osmc | package/mediacenter-skin-osmc/files/usr/share/kodi/addons/script.module.unidecode/lib/unidecode/x1d5.py | 248 | 3839 | data = (
'w', # 0x00
'x', # 0x01
'y', # 0x02
'z', # 0x03
'A', # 0x04
'B', # 0x05
'', # 0x06
'D', # 0x07
'E', # 0x08
'F', # 0x09
'G', # 0x0a
'', # 0x0b
'', # 0x0c
'J', # 0x0d
'K', # 0x0e
'L', # 0x0f
'M', # 0x10
'N', # 0x11
'O', # 0x12
'P', # 0x13
'Q', # 0x14... | gpl-2.0 |
tvuillemin/nicetypes | setup.py | 1 | 2325 | import codecs
import os
import re
from setuptools import setup, find_packages
###################################################################
NAME = "nicetypes"
PACKAGES = find_packages(where="src")
META_PATH = os.path.join("src", "nicetypes", "__init__.py")
KEYWORDS = ["class", "attribute", "boilerplate"]
CLAS... | mit |
chen0510566/MissionPlanner | Lib/site-packages/numpy/lib/tests/test_stride_tricks.py | 87 | 6958 | import numpy as np
from numpy.testing import *
from numpy.lib.stride_tricks import broadcast_arrays
def assert_shapes_correct(input_shapes, expected_shape):
""" Broadcast a list of arrays with the given input shapes and check the
common output shape.
"""
inarrays = [np.zeros(s) for s in input_shapes]
... | gpl-3.0 |
ShassAro/ShassAro | Bl_project/blVirtualEnv/lib/python2.7/site-packages/pip/_vendor/html5lib/ihatexml.py | 1727 | 16581 | from __future__ import absolute_import, division, unicode_literals
import re
import warnings
from .constants import DataLossWarning
baseChar = """
[#x0041-#x005A] | [#x0061-#x007A] | [#x00C0-#x00D6] | [#x00D8-#x00F6] |
[#x00F8-#x00FF] | [#x0100-#x0131] | [#x0134-#x013E] | [#x0141-#x0148] |
[#x014A-#x017E] | [#x0180-... | gpl-2.0 |
andreyvit/pyjamas | examples/libtest/VarsTest.py | 5 | 2249 | import UnitTest
import foo
import foo as myfoo
from foo import foo_value as myfoo_value, get_foo_value as myget_foo_value
module_global_x = 1
data = []
data.append(5)
data.append(6)
data_test = cmp(data, [1,2,3])
def changeme(lst):
lst[0] = 5
def import_sys():
global sys
import sys
... | apache-2.0 |
martynovp/edx-platform | lms/djangoapps/instructor_task/tasks_helper.py | 1 | 62345 | """
This file contains tasks that are designed to perform background operations on the
running state of a course.
"""
import json
from collections import OrderedDict
from datetime import datetime
from django.conf import settings
from eventtracking import tracker
from itertools import chain
from time import time
import... | agpl-3.0 |
hryamzik/ansible | lib/ansible/modules/cloud/cloudstack/cs_snapshot_policy.py | 80 | 10636 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2016, René Moser <mail@renemoser.net>
# 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 |
coursemdetw/2015cdb | static/Brython3.1.0-20150301-090019/Lib/ui/slider.py | 603 | 2394 | from . import widget
from browser import doc,html
class Slider(widget.Widget):
def __init__(self, id=None, label=False):
self._div_shell=html.DIV(Class="ui-slider ui-slider-horizontal ui-widget ui-widget-content ui-corner-all")
widget.Widget.__init__(self, self._div_shell, 'slider', id)
self._h... | gpl-3.0 |
silviocsg/ns-3-pcp | src/bridge/bindings/modulegen__gcc_LP64.py | 50 | 181345 | from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers
import pybindgen.settings
import warnings
class ErrorHandler(pybindgen.settings.ErrorHandler):
def handle_error(self, wrapper, exception, traceback_):
warnings.warn("exception %r in wrapper %s" % (exception, wrapper))
... | gpl-2.0 |
devGregA/code | build/lib.linux-x86_64-2.7/scrapy/tests/test_contrib_spiderstate.py | 30 | 1052 | import os
from datetime import datetime
from twisted.trial import unittest
from scrapy.contrib.spiderstate import SpiderState
from scrapy.spider import Spider
class SpiderStateTest(unittest.TestCase):
def test_store_load(self):
jobdir = self.mktemp()
os.mkdir(jobdir)
spider = Spider(name... | bsd-3-clause |
gusai-francelabs/datafari | windows/python/Lib/bsddb/test/test_misc.py | 68 | 4803 | """Miscellaneous bsddb module test cases
"""
import os, sys
import unittest
from test_all import db, dbshelve, hashopen, test_support, get_new_environment_path, get_new_database_path
#----------------------------------------------------------------------
class MiscTestCase(unittest.TestCase):
def setUp(self):
... | apache-2.0 |
greencoder/mybitly | Test Server/libraries/jinja2/_compat.py | 25 | 2665 | # -*- coding: utf-8 -*-
"""
jinja2._compat
~~~~~~~~~~~~~~
Some py2/py3 compatibility support based on a stripped down
version of six so we don't have to depend on a specific version
of it.
:copyright: Copyright 2013 by the Jinja team, see AUTHORS.
:license: BSD, see LICENSE for details.
""... | mit |
gpetretto/pymatgen | pymatgen/symmetry/bandstructure.py | 4 | 30120 | # coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
from __future__ import division, unicode_literals
import numpy as np
import warnings
from math import ceil
from math import cos
from math import sin
from math import tan
from math import pi
from warnings impor... | mit |
citrix-openstack-build/ceilometer | tests/api/v2/test_statistics.py | 3 | 4282 | # -*- encoding: utf-8 -*-
#
# Copyright © 2012 New Dream Network, LLC (DreamHost)
#
# Author: Doug Hellmann <doug.hellmann@dreamhost.com>
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# ... | apache-2.0 |
solintegra/addons | project/wizard/project_task_delegate.py | 142 | 6479 | # -*- 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 |
aubzen/sheltermanager | src/waitinglist.py | 1 | 14773 | #!/usr/bin/python
import additional
import al
import animal
import audit
import configuration
import db
import diary
import log
import media
import utils
from i18n import _, after, now, python2display, subtract_years, add_days, date_diff
def get_waitinglist_query():
"""
Returns the SELECT and JOIN commands ne... | gpl-3.0 |
RedbackThomson/LoLShadow | sleekxmpp/test/sleektest.py | 1 | 31939 | """
SleekXMPP: The Sleek XMPP Library
Copyright (C) 2010 Nathanael C. Fritz, Lance J.T. Stout
This file is part of SleekXMPP.
See the file LICENSE for copying permission.
"""
import unittest
from xml.parsers.expat import ExpatError
from sleekxmpp import ClientXMPP, ComponentXMPP
from sleekxmpp.util i... | mit |
wcevans/grpc | tools/buildgen/plugins/expand_filegroups.py | 13 | 5473 | # Copyright 2015, 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 f... | bsd-3-clause |
keyboardio/Kaleidoscope | testing/googletest/googletest/scripts/upload_gtest.py | 1963 | 2851 | #!/usr/bin/env python
#
# Copyright 2009, 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... | gpl-3.0 |
hynekcer/django | tests/select_related/models.py | 276 | 3480 | """
Tests for select_related()
``select_related()`` follows all relationships and pre-caches any foreign key
values so that complex trees can be fetched in a single query. However, this
isn't always a good idea, so the ``depth`` argument control how many "levels"
the select-related behavior will traverse.
"""
from dj... | bsd-3-clause |
dims/neutron | neutron/agent/metadata/driver.py | 2 | 6884 | # Copyright 2014 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 |
pwwang/bioprocs | bioprocs/utils/meme.py | 1 | 5335 | """
Read or write MEME motif file
"""
import re
import math
from collections import OrderedDict
class MemeRecord(object):
def __init__(self,
name,
matrix,
altname = '',
mtype = 'letter-probability',
alength = None,
w = None,
nsites = 20,
E = 0,
URL = None
):
self.name = nam... | mit |
50wu/gpdb | src/backend/gporca/concourse/build_and_test.py | 10 | 3342 | #!/usr/bin/python
import optparse
import os
import shutil
import subprocess
import sys
def num_cpus():
# Use multiprocessing module, available in Python 2.6+
try:
import multiprocessing
return multiprocessing.cpu_count()
except (ImportError, NotImplementedError):
pass
# Get PO... | apache-2.0 |
ovgu-FINken/paparazzi_pre_merge | sw/airborne/test/math/compare_utm_enu.py | 77 | 2714 | #!/usr/bin/env python
from __future__ import division, print_function, absolute_import
import sys
import os
PPRZ_SRC = os.getenv("PAPARAZZI_SRC", "../../../..")
sys.path.append(PPRZ_SRC + "/sw/lib/python")
from pprz_math.geodetic import *
from pprz_math.algebra import DoubleRMat, DoubleEulers, DoubleVect3
from math ... | gpl-2.0 |
scvalencia/ROBOCOL_desastres | Galileo/Python/venv/lib/python2.7/site-packages/setuptools/tests/doctest.py | 332 | 99828 | # Module doctest.
# Released to the public domain 16-Jan-2001, by Tim Peters (tim@python.org).
# Major enhancements and refactoring by:
# Jim Fulton
# Edward Loper
# Provided as-is; use at your own risk; no warranty; no promises; enjoy!
try:
basestring
except NameError:
basestring = str
try:
enum... | mit |
pybee/toga-cocoa | toga_cocoa/libs/foundation.py | 2 | 1443 | from ctypes import *
from ctypes import util
from rubicon.objc import *
######################################################################
# FOUNDATION
foundation = cdll.LoadLibrary(util.find_library('Foundation'))
foundation.NSMouseInRect.restype = c_bool
foundation.NSMouseInRect.argtypes = [NSPoint, NSRect, ... | bsd-3-clause |
indictranstech/phr-frappe | frappe/website/render.py | 10 | 4476 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.utils import cstr
import mimetypes, json
from werkzeug.wrappers import Response
from frappe.website.context import get_context
f... | mit |
keedio/hue | desktop/core/ext-py/python-ldap-2.3.13/Demo/page_control.py | 40 | 1392 | url = "ldap://localhost:1390/"
base = "dc=stroeder,dc=de"
search_flt = r'(objectClass=*)'
page_size = 10
import ldap,pprint
from ldap.controls import SimplePagedResultsControl
searchreq_attrlist=['cn','entryDN','entryUUID','mail','objectClass']
#ldap.set_option(ldap.OPT_DEBUG_LEVEL,255)
ldap.set_option(ldap.OPT_REFE... | apache-2.0 |
z0by/django | tests/template_tests/filter_tests/test_ljust.py | 521 | 1081 | from django.template.defaultfilters import ljust
from django.test import SimpleTestCase
from django.utils.safestring import mark_safe
from ..utils import setup
class LjustTests(SimpleTestCase):
@setup({'ljust01': '{% autoescape off %}.{{ a|ljust:"5" }}. .{{ b|ljust:"5" }}.{% endautoescape %}'})
def test_lju... | bsd-3-clause |
prabhamatta/Analyzing-Open-Data | notebooks/Day_06_B_Generators.py | 3 | 10025 | # -*- coding: utf-8 -*-
# <nbformat>3.0</nbformat>
# <headingcell level=1>
# Goals
# <markdowncell>
# **To practice using generators to yield geographical entities of various types.**
#
# Generators are a bit complicated, and I won't try to explain all the intricacies here. I will show you how to use `yield` in... | apache-2.0 |
fin/froide | froide/publicbody/csv_import.py | 1 | 3665 | # -*- encoding: utf-8 -*-
import requests
from django.contrib.auth import get_user_model
from django.contrib.sites.models import Site
from django.template.defaultfilters import slugify
from django.utils.six import StringIO, BytesIO, PY3
from taggit.utils import parse_tags
if PY3:
import csv
else:
import unic... | mit |
zzeleznick/zDjango | venv/lib/python2.7/site-packages/django/contrib/gis/tests/geo3d/tests.py | 109 | 12136 | from __future__ import absolute_import, unicode_literals
import os
import re
from django.contrib.gis.gdal import HAS_GDAL
from django.contrib.gis.geos import HAS_GEOS
from django.contrib.gis.tests.utils import postgis
from django.test import TestCase
from django.utils._os import upath
from django.utils.unittest impor... | mit |
hasteur/g13bot_tools_new | tests/fixes_tests.py | 6 | 1294 | # -*- coding: utf-8 -*-
"""Tests for fixes module."""
#
# (C) Pywikibot team, 2015
#
# Distributed under the terms of the MIT license.
#
from __future__ import absolute_import, unicode_literals
from pywikibot import fixes
from tests import unittest, join_data_path
from tests.aspects import TestCase
class TestFixes(... | mit |
jbbskinny/sympy | sympy/interactive/ipythonprinting.py | 118 | 1785 | """
A print function that pretty prints SymPy objects.
:moduleauthor: Brian Granger
Usage
=====
To use this extension, execute:
%load_ext sympy.interactive.ipythonprinting
Once the extension is loaded, SymPy Basic objects are automatically
pretty-printed in the terminal and rendered in LaTeX in the Qt console ... | bsd-3-clause |
LaoZhongGu/kbengine | kbe/res/scripts/common/Lib/msilib/__init__.py | 86 | 17536 | # Copyright (C) 2005 Martin v. Löwis
# Licensed to PSF under a Contributor Agreement.
from _msi import *
import os, string, re, sys
AMD64 = "AMD64" in sys.version
Itanium = "Itanium" in sys.version
Win64 = AMD64 or Itanium
# Partially taken from Wine
datasizemask= 0x00ff
type_valid= 0x0100
type_localizabl... | lgpl-3.0 |
Dhivyap/ansible | lib/ansible/module_utils/network/iosxr/providers/providers.py | 114 | 3943 | #
# (c) 2019, Ansible by Red Hat, inc
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#
import json
from threading import RLock
from ansible.module_utils.six import itervalues
from ansible.module_utils.network.common.utils import to_list
from ansible.module_utils.network.c... | gpl-3.0 |
arun6582/django | tests/migrations/test_writer.py | 17 | 26804 | import datetime
import decimal
import enum
import functools
import math
import os
import re
import sys
import uuid
from unittest import mock
import custom_migration_operations.more_operations
import custom_migration_operations.operations
from django import get_version
from django.conf import settings
from django.core... | bsd-3-clause |
tarc/gyp | pylib/gyp/easy_xml_test.py | 2698 | 3270 | #!/usr/bin/env python
# Copyright (c) 2011 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
""" Unit tests for the easy_xml.py file. """
import gyp.easy_xml as easy_xml
import unittest
import StringIO
class TestSequenceFunctions(... | bsd-3-clause |
foss-transportationmodeling/rettina-server | flask/lib/python2.7/site-packages/wtforms/meta.py | 114 | 3684 | from wtforms.utils import WebobInputWrapper
from wtforms import i18n
class DefaultMeta(object):
"""
This is the default Meta class which defines all the default values and
therefore also the 'API' of the class Meta interface.
"""
# -- Basic form primitives
def bind_field(self, form, unbound_... | apache-2.0 |
davisein/jitsudone | django/django/contrib/localflavor/us/us_states.py | 355 | 7655 | """
A mapping of state misspellings/abbreviations to normalized
abbreviations, and alphabetical lists of US states, territories,
military mail regions and non-US states to which the US provides
postal service.
This exists in this standalone file so that it's only imported into memory
when explicitly needed.
"""
# The... | bsd-3-clause |
delinhabit/django | django/templatetags/tz.py | 251 | 5574 | from datetime import datetime, tzinfo
from django.template import Library, Node, TemplateSyntaxError
from django.utils import six, timezone
try:
import pytz
except ImportError:
pytz = None
register = Library()
# HACK: datetime is an old-style class, create a new-style equivalent
# so we can define additio... | bsd-3-clause |
dessHub/bc-14-online-store-application | flask/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/chardistribution.py | 2755 | 9226 | ######################## 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 |
KiiCorp/kii_json | unit-test/libs/gtest-1.7.0/test/gtest_test_utils.py | 1100 | 10812 | #!/usr/bin/env python
#
# Copyright 2006, 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... | mit |
tinkerthaler/odoo | addons/document/__init__.py | 434 | 1128 | # -*- 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 |
dschwoerer/espresso | config/gen_sampleconfig.py | 24 | 1894 | # Copyright (C) 2013,2014 The ESPResSo project
# Copyright (C) 2012 Olaf Lenz
#
# This file is part of ESPResSo.
#
# ESPResSo 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 |
scotthartbti/android_external_chromium_org | chrome/test/functional/media/media_scrub_perf.py | 70 | 2598 | #!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Scrubbing performance test for <video>.
Measures the times to scrub video and audio files. Scrubbing is simulated by
having con... | bsd-3-clause |
OpenTransportDataProject/ckanext-customharvesters | ckanext/dcat/harvesters/createorg.py | 1 | 2400 | # Description: create harvested organizations from orgfile.txt
# Author: Shanshan Jiang, last modified 14.12.2016
import json
import urllib
import urllib2
import pprint
print "create organizations"
org_dict = {
'name': 'testagain',
'title': 'test again',
'image_url': ''
}
def create_org(dataset_dict)... | agpl-3.0 |
SteveXiSong/ECE757-SnoopingPredictions | src/sim/Process.py | 9 | 3021 | # Copyright (c) 2005-2008 The Regents of The University of Michigan
# 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 ... | bsd-3-clause |
XueqingLin/tensorflow | tensorflow/contrib/slim/python/slim/model_analyzer.py | 23 | 3506 | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
devs1991/test_edx_docmode | venv/lib/python2.7/site-packages/sphinx/roles.py | 5 | 11987 | # -*- coding: utf-8 -*-
"""
sphinx.roles
~~~~~~~~~~~~
Handlers for additional ReST roles.
:copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
import warnings
from docutils import nodes, utils
from docutils.parsers.rst import role... | agpl-3.0 |
robotpilot/robomongo | src/third-party/mongodb/src/third_party/v8/tools/test.py | 12 | 45192 | #!/usr/bin/env python
#
# Copyright 2012 the V8 project authors. 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
# noti... | gpl-3.0 |
jamiefolsom/edx-platform | lms/djangoapps/psychometrics/management/commands/init_psychometrics.py | 131 | 2392 | #!/usr/bin/python
#
# generate pyschometrics data from tracking logs and student module data
import json
from courseware.models import StudentModule
from track.models import TrackingLog
from psychometrics.models import PsychometricData
from django.conf import settings
from django.core.management.base import BaseComm... | agpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.