repo_name
stringlengths
5
100
path
stringlengths
4
375
copies
stringclasses
991 values
size
stringlengths
4
7
content
stringlengths
666
1M
license
stringclasses
15 values
mdsafwan/Deal-My-Stuff
Lib/site-packages/django/contrib/admindocs/tests/test_fields.py
638
1172
from __future__ import unicode_literals import unittest from django.contrib.admindocs import views from django.db import models from django.db.models import fields from django.utils.translation import ugettext as _ class CustomField(models.Field): description = "A custom field type" class DescriptionLackingFi...
apache-2.0
40223227/2015cdbg6w0622-40223227-
static/Brython3.1.1-20150328-091302/Lib/_sre.py
622
51369
# NOT_RPYTHON """ A pure Python reimplementation of the _sre module from CPython 2.4 Copyright 2005 Nik Haldimann, licensed under the MIT license This code is based on material licensed under CNRI's Python 1.6 license and copyrighted by: Copyright (c) 1997-2001 by Secret Labs AB """ MAXREPEAT = 2147483648 #import ar...
gpl-3.0
beeftornado/sentry
tests/sentry_plugins/gitlab/test_plugin.py
2
5161
from __future__ import absolute_import import responses from exam import fixture from django.core.urlresolvers import reverse from django.test import RequestFactory from sentry.testutils import PluginTestCase from sentry.utils import json from sentry_plugins.gitlab.plugin import GitLabPlugin class GitLabPluginTest...
bsd-3-clause
areitz/pants
src/python/pants/backend/jvm/subsystems/jvm_tool_mixin.py
4
4883
# coding=utf-8 # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) from pants.base.addr...
apache-2.0
sysadminmatmoz/ingadhoc
project_duplicate_fix/__openerp__.py
4
1477
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2015 ADHOC SA (http://www.adhoc.com.ar) # All Rights Reserved. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Pu...
agpl-3.0
jroltgen/aqua-gesture-framework
samples/SampleEvent/scons-local-1.3.0/SCons/Tool/msvs.py
5
54593
"""SCons.Tool.msvs Tool-specific initialization for Microsoft Visual Studio project files. 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, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 20...
gpl-3.0
mbalasso/mynumpy
numpy/distutils/tests/test_fcompiler_intel.py
35
1127
from numpy.testing import * import numpy.distutils.fcompiler intel_32bit_version_strings = [ ("Intel(R) Fortran Intel(R) 32-bit Compiler Professional for applications"\ "running on Intel(R) 32, Version 11.1", '11.1'), ] intel_64bit_version_strings = [ ("Intel(R) Fortran IA-64 Compiler Professional for a...
bsd-3-clause
deathglitch/metarigging
python/metarig/component.py
1
3463
import pymel.core as pm import metanode_base import metautil import metautil.miscutil as miscutil class Component(metanode_base.MetaNode): @staticmethod def create(metanode_parent, metanode_type, version, side, region, component_pivot = None): name = '{0}_{1}_{2}'.format('comp', side, region) ...
mit
SivilTaram/edx-platform
lms/djangoapps/certificates/migrations/0010_auto__del_field_generatedcertificate_enabled__add_field_generatedcerti.py
188
5338
# -*- 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): # Deleting field 'GeneratedCertificate.enabled' db.delete_column('certificates_generatedcertificate', 'enabl...
agpl-3.0
FreshXOpenSource/wallaby-frontend-qt
wallaby/frontends/qt/plugins/textpopupbuttonplugin.py
1
1714
# Copyright (c) by it's authors. # Some rights reserved. See LICENSE, AUTHORS. import wallaby.FXUI as FXUI from wallaby.qt_combat import * from wallaby.frontends.qt.widgets.buttons.textPopupButton import TextPopupButton #============================================================================# # The group name...
bsd-2-clause
zorojean/scrapy
scrapy/contracts/default.py
153
2334
from scrapy.item import BaseItem from scrapy.http import Request from scrapy.exceptions import ContractFail from . import Contract # contracts class UrlContract(Contract): """ Contract to set the url of the request (mandatory) @url http://scrapy.org """ name = 'url' def adjust_request_args(...
bsd-3-clause
kawasaki2013/python-for-android-x86
python-build/python-libs/gdata/src/gdata/contacts/__init__.py
134
13897
#!/usr/bin/python # # Copyright (C) 2008 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law ...
apache-2.0
appneta/boto
boto/pyami/installers/ubuntu/apache.py
205
1929
# Copyright (c) 2008 Chris Moyer http://coredumped.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, modify, m...
mit
kalxas/QGIS
tests/src/python/test_qgspallabeling_placement.py
29
55022
# -*- coding: utf-8 -*- """QGIS Unit tests for QgsPalLabeling: base suite of render check tests Class is meant to be inherited by classes that test different labeling outputs See <qgis-src-dir>/tests/testdata/labeling/README.rst for description. .. note:: This program is free software; you can redistribute it and/or...
gpl-2.0
pandeydivesh15/AVSR-Deep-Speech
util/image_handler.py
1
2105
import random import glob import numpy as np import cv2 from scipy.ndimage import imread IMAGE_WIDTH = IMAGE_HEIGHT = 32 def visualize_image(image, name="Image", resize=False, save_image=False, path=None): """Helper function to visualize and save any image""" image = image.reshape([IMAGE_WIDTH, IMAGE_HEIGHT]) ima...
gpl-2.0
sgerhart/ansible
test/units/modules/network/junos/test_junos_command.py
68
6199
# (c) 2017 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...
mit
felixjimenez/django
tests/proxy_models/tests.py
49
13291
from __future__ import absolute_import, unicode_literals import copy from django.conf import settings from django.contrib.contenttypes.models import ContentType from django.core import management from django.core.exceptions import FieldError from django.db import models, DEFAULT_DB_ALIAS from django.db.models import s...
bsd-3-clause
Neamar/django
tests/app_loading/tests.py
288
3113
from __future__ import unicode_literals import os from django.apps import apps from django.test import SimpleTestCase from django.test.utils import extend_sys_path from django.utils import six from django.utils._os import upath class EggLoadingTest(SimpleTestCase): def setUp(self): self.egg_dir = '%s/e...
bsd-3-clause
blua/deep-learning
face-generation/helper.py
160
8114
import math import os import hashlib from urllib.request import urlretrieve import zipfile import gzip import shutil import numpy as np from PIL import Image from tqdm import tqdm def _read32(bytestream): """ Read 32-bit integer from bytesteam :param bytestream: A bytestream :return: 32-bit integer ...
mit
TheSimoms/Felleshoelet
spotifyconnector/venv/lib/python3.6/site-packages/pip/_internal/commands/debug.py
3
3394
# The following comment should be removed at some point in the future. # mypy: disallow-untyped-defs=False from __future__ import absolute_import import locale import logging import sys from pip._internal.cli import cmdoptions from pip._internal.cli.base_command import Command from pip._internal.cli.cmdoptions impor...
gpl-2.0
two9seven/geopy
geopy/geocoders/smartystreets.py
10
4692
""" :class:`.LiveAddress` geocoder. """ from geopy.geocoders.base import Geocoder, DEFAULT_TIMEOUT, DEFAULT_SCHEME from geopy.compat import urlencode from geopy.location import Location from geopy.exc import ConfigurationError, GeocoderQuotaExceeded from geopy.util import logger __all__ = ("LiveAddress", ) class L...
mit
nesterione/scikit-learn
sklearn/linear_model/ransac.py
191
14261
# coding: utf-8 # Author: Johannes Schönberger # # License: BSD 3 clause import numpy as np from ..base import BaseEstimator, MetaEstimatorMixin, RegressorMixin, clone from ..utils import check_random_state, check_array, check_consistent_length from ..utils.random import sample_without_replacement from ..utils.valid...
bsd-3-clause
hellhovnd/django
tests/validators/tests.py
10
9403
# -*- coding: utf-8 -*- from __future__ import unicode_literals import re import types from datetime import datetime, timedelta from django.core.exceptions import ValidationError from django.core.validators import * from django.test.utils import str_prefix from django.utils.unittest import TestCase NOW = datetime.n...
bsd-3-clause
m-ober/byceps
byceps/blueprints/admin/news/views.py
1
10252
""" byceps.blueprints.admin.news.views ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :Copyright: 2006-2020 Jochen Kupperschmidt :License: Modified BSD, see LICENSE for details. """ from datetime import date from flask import abort, g, request from ....services.brand import service as brand_service from ....services.news impor...
bsd-3-clause
openaid-IATI/deprecated-version-OIPA-v2
iati/data/migrations/0009_auto__add_countrystatistics.py
1
18746
# -*- 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 model 'CountryStatistics' db.create_table('data_countrystatistics', ( ('id', self.gf('d...
agpl-3.0
Debian/openjfx
modules/web/src/main/native/Source/WebCore/AVFoundationSupport.py
6
2993
#!/usr/bin/python # Copyright (C) 2015 Apple 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: # # 1. Redistributions of source code must retain the above copyright # notice, this list o...
gpl-2.0
samfoo/servo
tests/wpt/css-tests/tools/pywebsocket/src/test/endtoend_with_external_server.py
496
2541
#!/usr/bin/env python # # Copyright 2011, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list...
mpl-2.0
garthomp/ruby_blog
node_modules/grunt-docker/node_modules/docker/node_modules/pygmentize-bundled/vendor/pygments/build-3.3/pygments/styles/pastie.py
364
2473
# -*- coding: utf-8 -*- """ pygments.styles.pastie ~~~~~~~~~~~~~~~~~~~~~~ Style similar to the `pastie`_ default style. .. _pastie: http://pastie.caboo.se/ :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ from pygments.style impor...
mit
roblabla/sublime-evernote
lib/pygments/lexers/text.py
9
69056
# -*- coding: utf-8 -*- """ pygments.lexers.text ~~~~~~~~~~~~~~~~~~~~ Lexers for non-source code file types. :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re from bisect import bisect from pygments.lexer import Lexer, LexerC...
mit
vuolter/pyload
src/pyload/plugins/downloaders/UlozTo.py
2
10781
# -*- coding: utf-8 -*- import json import os import re import urllib.parse import pycurl from pyload.core.utils import parse from ..anticaptchas.ReCaptcha import ReCaptcha from ..base.simple_downloader import SimpleDownloader from ..helpers import timestamp def convert_decimal_prefix(m): #: Decimal prefixes u...
agpl-3.0
noam09/kodi
script.module.israeliveresolver/lib/livestreamer/requests/packages/urllib3/util/timeout.py
1004
9544
# The default socket timeout, used by httplib to indicate that no timeout was # specified by the user from socket import _GLOBAL_DEFAULT_TIMEOUT import time from ..exceptions import TimeoutStateError # A sentinel value to indicate that no timeout was specified by the user in # urllib3 _Default = object() def current...
gpl-3.0
HomeRad/TorCleaner
wc/proxy/ServerHandleDirectly.py
1
2459
# -*- coding: iso-8859-1 -*- # Copyright (c) 2000, Amit Patel # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # notice, thi...
gpl-2.0
abhitopia/tensorflow
tensorflow/contrib/keras/python/keras/preprocessing/__init__.py
58
1046
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
TNT-Samuel/Coding-Projects
DNS Server/Source - Copy/Lib/unittest/suite.py
21
10479
"""TestSuite""" import sys from . import case from . import util __unittest = True def _call_if_exists(parent, attr): func = getattr(parent, attr, lambda: None) func() class BaseTestSuite(object): """A simple test suite that doesn't provide class or module shared fixtures. """ _cleanup = True...
gpl-3.0
InfoSec-CSUSB/club-websystem
src/events/views.py
2
22591
import json from datetime import date, time, datetime, timedelta from django.contrib.sites.models import Site from django.conf import settings from django.core.urlresolvers import reverse from django.shortcuts import render, redirect from django.http import HttpResponse, Http404 from django.utils import timezone from ...
mit
maellak/invenio
modules/bibindex/lib/tokenizers/BibIndexCJKTokenizer.py
19
5326
# -*- coding:utf-8 -*- ## ## This file is part of Invenio. ## Copyright (C) 2010, 2011, 2012 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 the Free Software Foundation; either version 2 of the ## License, or (at you...
gpl-2.0
mjfarmer/scada_py
env/lib/python2.7/site-packages/twisted/python/log.py
12
22366
# -*- test-case-name: twisted.test.test_log -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Logging and metrics infrastructure. """ from __future__ import division, absolute_import import sys import time import warnings from datetime import datetime from zope.interface import Interf...
gpl-3.0
vorwerkc/pymatgen
pymatgen/analysis/tests/test_interface.py
4
10881
# coding: utf-8 # Copyright (c) Pymatgen Development Team. # Distributed under the terms of the MIT License. __author__ = "Kyle Bystrom" __copyright__ = "Copyright 2019, The Materials Project" __version__ = "0.1" __maintainer__ = "Kyle Bystrom" __email__ = "kylebystrom@gmail.com" __date__ = "5/29/2019" import random ...
mit
ujdhesa/unisubs
apps/auth/backends.py
5
5311
# Amara, universalsubtitles.org # # Copyright (C) 2013 Participatory Culture Foundation # # This program 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 Software Foundation, either version 3 of the # License, or (at your op...
agpl-3.0
somsak/youtube-dl
youtube_dl/extractor/instagram.py
93
4498
from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( int_or_none, limit_length, ) class InstagramIE(InfoExtractor): _VALID_URL = r'https://instagram\.com/p/(?P<id>[\da-zA-Z]+)' _TEST = { 'url': 'https://instagram.com/p/aye83DjauH/?foo=bar#...
unlicense
MiroK/vector_calculus
vector_calculus/measures/surface_measure.py
1
2599
from sympy import Expr, Number, NumberSymbol from vector_calculus.containers import Vector, Tensor from vector_calculus.operators import dot, inner from measure import Measure class SurfaceMeasure(Measure): ''' SurfaceMeasure is defined over sets which have same geometrical dimension one higher than topol...
mit
sadikovi/queue
src/scheduler.py
1
35429
#!/usr/bin/env python # -*- coding: UTF-8 -*- # # Copyright 2016 sadikovi # # 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 requir...
apache-2.0
sergei/gtest
test/gtest_catch_exceptions_test.py
2139
9901
#!/usr/bin/env python # # Copyright 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 o...
bsd-3-clause
EducationalTestingService/halef-messenger
messenger/api/http.py
1
3049
import json from flask import jsonify, request, current_app from . import api from .exceptions import APIError from ..tasks import send_message from ..extensions import redis_store from ..utils import is_json @api.errorhandler(APIError) def handle_api_error(error): """Handles APIError exceptions gracefully.""" ...
apache-2.0
emanuil-tolev/nettail
nettail.py
1
1922
import requests from time import sleep from datetime import datetime import sys import config log = None def inform(msg): print msg log.write(msg.encode('utf-8') + '\n') def main(argv=None): global log # standard template for allowing testing of the main() function # but note we don't actually...
mit
IKholopov/HackUPC2017
hackupc/env/lib/python3.5/site-packages/requests/packages/urllib3/util/timeout.py
292
9757
from __future__ import absolute_import # The default socket timeout, used by httplib to indicate that no timeout was # specified by the user from socket import _GLOBAL_DEFAULT_TIMEOUT import time from ..exceptions import TimeoutStateError # A sentinel value to indicate that no timeout was specified by the user in # u...
apache-2.0
hyperspy/hyperspy
hyperspy/misc/eels/hydrogenic_gos.py
1
8438
# -*- coding: utf-8 -*- # Copyright 2007-2021 The HyperSpy developers # # This file is part of HyperSpy. # # HyperSpy 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...
gpl-3.0
geopython/GeoHealthCheck
GeoHealthCheck/plugins/probe/sta.py
3
2220
from GeoHealthCheck.probe import Probe class StaCaps(Probe): """Probe for SensorThings API main endpoint url""" NAME = 'STA Capabilities' DESCRIPTION = 'Perform STA Capabilities Operation and check validity' RESOURCE_TYPE = 'OGC:STA' REQUEST_METHOD = 'GET' def __init__(self): Probe....
mit
dockerera/func
func/overlord/group/conf_backend.py
5
8380
## ## Copyright 2007,2008 Red Hat, Inc ## Adrian Likins <alikins@redhat.com> ## +AUTHORS ## ## This software may be freely redistributed under the terms of the GNU ## general public license. ## ## You should have received a copy of the GNU General Public License ## along with this program; if not, write to the Free Sof...
gpl-2.0
beatrizjesus/my-first-blog
pasta/Lib/encodings/cp500.py
593
13377
""" Python Character Mapping Codec cp500 generated from 'MAPPINGS/VENDORS/MICSFT/EBCDIC/CP500.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...
mit
suyashphadtare/gd-erp
erpnext/controllers/trends.py
4
10798
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe from frappe.utils import getdate from frappe import _ def get_columns(filters, trans): validate_filters(filters) # get conditions f...
agpl-3.0
donspaulding/adspygoogle
examples/adspygoogle/dfp/v201208/get_recently_updated_line_items.py
4
2442
#!/usr/bin/python # # Copyright 2012 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required b...
apache-2.0
tomjelinek/pcs
pcs_test/tier0/lib/corosync/test_config_validators_nodes.py
3
26122
from unittest import TestCase from pcs_test.tools import fixture from pcs_test.tools.assertions import assert_report_item_list_equal from pcs_test.tools.custom_mock import patch_getaddrinfo from pcs.common.reports import codes as report_codes from pcs.lib.cib.node import PacemakerNode as PNode from pcs.lib.corosync i...
gpl-2.0
Eficent/odoomrp-wip
quality_control_version/models/qc_test.py
11
1997
# -*- coding: utf-8 -*- # © 2016 Oihane Crucelaegui - AvanzOSC # License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html from openerp import api, fields, models class QcTest(models.Model): _inherit = 'qc.test' version = fields.Integer( string='Version Number', default=0, readonly=True, copy=F...
agpl-3.0
chjw8016/GreenOdoo7-haibao
openerp/tests/addons/test_impex/tests/test_export.py
27
19254
# -*- coding: utf-8 -*- import itertools import openerp.modules.registry import openerp from openerp.tests import common class CreatorCase(common.TransactionCase): model_name = False def __init__(self, *args, **kwargs): super(CreatorCase, self).__init__(*args, **kwargs) self.model = None ...
mit
wkrzemien/DIRAC
FrameworkSystem/Service/NotificationHandler.py
2
10911
""" The Notification service provides a toolkit to contact people via email (eventually SMS etc.) to trigger some actions. The original motivation for this is due to some sites restricting the sending of email but it is useful for e.g. crash reports to get to their destination. Another use-case is...
gpl-3.0
slohse/ansible
lib/ansible/modules/messaging/rabbitmq_user.py
7
10485
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2013, Chatham Financial <oss@chathamfinancial.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'...
gpl-3.0
madan96/sympy
sympy/printing/tests/test_julia.py
23
12713
from sympy.core import (S, pi, oo, symbols, Function, Rational, Integer, Tuple, Symbol) from sympy.core import EulerGamma, GoldenRatio, Catalan, Lambda from sympy.functions import Piecewise, sqrt, ceiling, exp, sin, cos from sympy.utilities.pytest import raises from sympy.utilities.lambdify impo...
bsd-3-clause
silenceli/oga-windows
ovirt-guest-agent/CredServer.py
2
9181
# # Copyright 2010-2012 Red Hat, Inc. and/or its affiliates. # # 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
SCSSG/Odoo-SCS
addons/website_mail/tests/test_controllers.py
390
1644
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2013-Today OpenERP SA (<http://www.openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms ...
agpl-3.0
aleksandra-tarkowska/openmicroscopy
components/tools/OmeroPy/test/integration/gatewaytest/test_config_service.py
14
1554
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Copyright (C) 2016 University of Dundee & Open Microscopy Environment. All Rights Reserved. Copyright 2013 Glencoe Software, Inc. All rights reserved. Use is subject to license terms supplied in LICENSE.txt pytest fixtures used as def...
gpl-2.0
michael-dev2rights/ansible
test/runner/lib/metadata.py
21
2645
"""Test metadata for passing data to delegated tests.""" from __future__ import absolute_import, print_function import json from lib.util import ( display, is_shippable, ) from lib.diff import ( parse_diff, FileDiff, ) class Metadata(object): """Metadata object for passing data to delegated tes...
gpl-3.0
rismalrv/edx-platform
common/lib/xmodule/xmodule/tests/test_import_static.py
208
1949
""" Tests that check that we ignore the appropriate files when importing courses. """ import unittest from mock import Mock from xmodule.modulestore.xml_importer import import_static_content from opaque_keys.edx.locations import SlashSeparatedCourseKey from xmodule.tests import DATA_DIR class IgnoredFilesTestCase(uni...
agpl-3.0
kohnle-lernmodule/palama
twisted/python/log.py
16
11975
# -*- test-case-name: twisted.test.test_log -*- # Copyright (c) 2001-2004 Twisted Matrix Laboratories. # See LICENSE for details. """Logging and metrics infrastructure. """ # System Imports import sys import time import warnings # Sibling Imports from twisted.python import util, context, reflect # Backwards compat...
gpl-2.0
Impavidity/SearchEngine
Data Cleaning/porter.py
14
12900
#!/usr/bin/env python """Porter Stemming Algorithm This is the Porter stemming algorithm, ported to Python from the version coded up in ANSI C by the author. It may be be regarded as canonical, in that it follows the algorithm presented in Porter, 1980, An algorithm for suffix stripping, Program, Vol. 14, no. 3, pp 1...
mit
ayarshabeer/wagtail
wagtail/wagtailcore/rich_text.py
25
6925
from __future__ import unicode_literals # ensure that RichText.__str__ returns unicode import re # parsing HTML with regexes LIKE A BOSS. from django.utils.encoding import python_2_unicode_compatible from django.utils.html import escape from django.utils.safestring import mark_safe from wagtail.wagtailcore.whiteli...
bsd-3-clause
blacklin/kbengine
kbe/src/lib/python/Lib/ctypes/test/test_returnfuncptrs.py
96
2903
import unittest from ctypes import * import os import _ctypes_test class ReturnFuncPtrTestCase(unittest.TestCase): def test_with_prototype(self): # The _ctypes_test shared lib/dll exports quite some functions for testing. # The get_strchr function returns a *pointer* to the C strchr function. ...
lgpl-3.0
krintoxi/NoobSec-Toolkit
NoobSecToolkit /tools/inject/lib/core/xmldump.py
23
20219
#!/usr/bin/env python import codecs import os import re import xml import xml.sax.saxutils as saxutils from lib.core.common import getUnicode from lib.core.data import conf from lib.core.data import kb from lib.core.data import logger from lib.core.exception import SqlmapFilePathException from lib.core.settings impo...
gpl-2.0
x303597316/hue
desktop/core/src/desktop/migrations/0012_auto__chg_field_documentpermission_perms.py
30
8715
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Changing field 'DocumentPermission.perms' db.alter_column(u'desktop_do...
apache-2.0
tinkerinestudio/Tinkerine-Suite
TinkerineSuite/python/Lib/OpenGL/GL/APPLE/float_pixels.py
4
2896
'''OpenGL extension APPLE.float_pixels This module customises the behaviour of the OpenGL.raw.GL.APPLE.float_pixels to provide a more Python-friendly API Overview (from the spec) This extensions adds texture types, texture internal formats and color buffers composed of both 32 bit and 16 floating point numbers....
agpl-3.0
scotthartbti/android_external_chromium_org
native_client_sdk/src/tools/sel_ldr.py
27
3830
#!/usr/bin/env python # 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. """Wrapper script for launching application within the sel_ldr. """ import optparse import os import subprocess import sys import cre...
bsd-3-clause
percyfal/bokeh
examples/plotting/file/properties_alpha.py
9
1536
from itertools import product from math import pi from bokeh.plotting import figure, show, output_file cats = ['None', 'Alpha', 'RGB', 'RGBA', 'Alpha+RGB', 'Alpha+RGBA'] p = figure(x_range=cats, y_range=cats, title="Fill and Line Color Combinations") p.xaxis.axis_label = "Fill Options" p.xaxis.major_labe...
bsd-3-clause
MyTunesFreeMusic/privacy-policy
beets/util/hidden.py
20
2824
# -*- coding: utf-8 -*- # This file is part of beets. # Copyright 2016, Adrian Sampson. # # 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 t...
mit
idigbio-api-hackathon/LifemapperQgis
lifemapperTools/tools/uploadLayers.py
2
13728
# -*- coding: utf-8 -*- """ /*************************************************************************** MacroEcoDialog A QGIS plugin Macro Ecology tools for presence absence matrices ------------------- begin : 2011-02-21 co...
gpl-2.0
tiagocardosos/stoq
stoqlib/database/test/test_database.py
2
2424
# -*- coding: utf-8 -*- # vi:si:et:sw=4:sts=4:ts=4 ## ## Copyright (C) 2006 Async Open Source <http://www.async.com.br> ## All rights reserved ## ## This program 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 F...
gpl-2.0
concerned3rdparty/jirafe-python
jirafe/models/Batch.py
1
1325
#!/usr/bin/env python """ Copyright 2014 Jirafe, 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 applicab...
mit
micolous/python-slackrealtime
src/slackrealtime/tools/extract_logs.py
1
3180
""" slackrealtime/tools/extract_logs.py Copyright 2016 Michael Farrell <http://micolous.id.au> This program 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 3 of the License, or (at your opti...
gpl-3.0
DolphinDream/sverchok
utils/modules/geom_utils.py
2
5077
# This file is part of project Sverchok. It's copyrighted by the contributors # recorded in the version control history of the file, available from # its original location https://github.com/nortikin/sverchok/commit/master # # SPDX-License-Identifier: GPL3 # License-Filename: LICENSE import math import random def ...
gpl-3.0
krinart/django-nose
setup.py
7
2937
"""django-nose packaging.""" from __future__ import unicode_literals import os from codecs import open from setuptools import setup, find_packages def get_long_description(title): """Create the long_description from other files.""" ROOT = os.path.abspath(os.path.dirname(__file__)) readme = open(os.path.j...
bsd-3-clause
dataxu/ansible
lib/ansible/module_utils/facts/hardware/sunos.py
40
9663
# 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 distributed in the hope that ...
gpl-3.0
ebrelsford/v2v
vacant_to_vibrant/steward/migrations/0005_auto__add_optedinstewardprojectmanager__chg_field_stewardproject_organ.py
1
11110
# -*- 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 model 'OptedInStewardProjectManager' db.create_table(u'steward_optedinstewardprojectmanager', ( ...
gpl-3.0
thomasem/nova
nova/tests/unit/api/openstack/compute/contrib/test_neutron_security_groups.py
24
37022
# Copyright 2013 Nicira, Inc. # All Rights Reserved # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by a...
apache-2.0
nishad/namebench
libnamebench/url_map.py
175
1680
# Copyright 2009 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
apache-2.0
nipy/nipy-labs
nipy/labs/bindings/tests/test_array.py
4
2182
#!/usr/bin/env python # # Test fff_array wrapping # from numpy.testing import assert_almost_equal, assert_equal import numpy as np from .. import (array_get, array_get_block, array_add, array_sub, array_mul, array_div) MAX_TEST_SIZE = 30 def random_shape(size): """ Output random dimension...
bsd-3-clause
kinooo/Sick-Beard
lib/jsonrpclib/SimpleJSONRPCServer.py
87
8688
import lib.jsonrpclib from lib.jsonrpclib import Fault from lib.jsonrpclib.jsonrpc import USE_UNIX_SOCKETS import SimpleXMLRPCServer import SocketServer import socket import logging import os import types import traceback import sys try: import fcntl except ImportError: # For Windows fcntl = None def get_v...
gpl-3.0
geronimp/graftM
test/test_hmmer.py
2
3690
#!/usr/bin/env python3 #======================================================================= # Authors: Ben Woodcroft, Joel Boyd # # Unit tests. # # Copyright # # This 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 F...
gpl-3.0
tashaxe/Red-DiscordBot
lib/requests/packages/urllib3/util/timeout.py
292
9757
from __future__ import absolute_import # The default socket timeout, used by httplib to indicate that no timeout was # specified by the user from socket import _GLOBAL_DEFAULT_TIMEOUT import time from ..exceptions import TimeoutStateError # A sentinel value to indicate that no timeout was specified by the user in # u...
gpl-3.0
julien78910/CouchPotatoServer
libs/requests/packages/chardet/langbulgarianmodel.py
2965
12784
######################## 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
Cojacfar/Maker
comm/lib/python2.7/site-packages/django/template/defaultfilters.py
112
27781
"""Default variable filters.""" from __future__ import unicode_literals import re import random as random_module from decimal import Decimal, InvalidOperation, Context, ROUND_HALF_UP from functools import wraps from pprint import pformat from django.template.base import Variable, Library, VariableDoesNotExist from dj...
gpl-2.0
nitzmahone/ansible
lib/ansible/modules/identity/keycloak/keycloak_clienttemplate.py
5
15142
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (c) 2017, Eike Frost <ei@kefro.st> # 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
csherwood-usgs/landlab
landlab/components/diff_2d.py
7
8928
#! /usr/bin/env python import numpy as np from scipy import ndimage from landlab import Implements from landlab.framework.interfaces import (BmiBase, BmiUniformRectilinear, BadVarNameError, GRID_TYPE_UNIFORM) #@ImplementsOrRaise(BmiBase, BmiUniformRectilinear) @Implements(B...
mit
pentestfail/TA-FireEye_TAP
bin/ta_fireeye_tap/splunklib/modularinput/event.py
17
4233
# Copyright 2011-2015 Splunk, 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 wri...
mit
Nikea/VisTrails
vistrails/gui/variable_dropbox.py
2
22047
############################################################################### ## ## Copyright (C) 2011-2014, NYU-Poly. ## Copyright (C) 2006-2011, University of Utah. ## All rights reserved. ## Contact: contact@vistrails.org ## ## This file is part of VisTrails. ## ## "Redistribution and use in source and binary for...
bsd-3-clause
poiesisconsulting/openerp-restaurant
account/project/wizard/project_account_analytic_line.py
362
2343
# -*- 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
raphael0202/spaCy
spacy/en/tag_map.py
3
2900
# coding: utf8 from __future__ import unicode_literals from ..symbols import * TAG_MAP = { ".": {POS: PUNCT, "PunctType": "peri"}, ",": {POS: PUNCT, "PunctType": "comm"}, "-LRB-": {POS: PUNCT, "PunctType": "brck", "PunctSide": "ini"}, "-RRB-": {POS: PUNCT, "PunctType": "brck", "Pu...
mit
saurabhkumar1989/traffic_data_backend
trafficdata/views.py
1
4073
from django.shortcuts import render from imp import load_source # Create your views here. from pymongo import MongoClient#mongo db client from django.shortcuts import get_object_or_404, render from django.core.exceptions import ObjectDoesNotExist from django.http import HttpResponse from .models import Tweets,User,City...
apache-2.0
popazerty/try
lib/python/Components/Renderer/Canvas.py
62
1470
from enigma import eCanvas, eRect, gRGB from Renderer import Renderer class Canvas(Renderer): GUI_WIDGET = eCanvas def __init__(self): Renderer.__init__(self) self.sequence = None self.draw_count = 0 def pull_updates(self): if self.instance is None: return # do an incremental update list = self.s...
gpl-2.0
dpiers/coderang-meteor
public/jsrepl/extern/python/reloop-closured/lib/python2.7/ctypes/util.py
76
9026
###################################################################### # This file should be kept compatible with Python 2.3, see PEP 291. # ###################################################################### import sys, os # find_library(name) returns the pathname of a library, or None. if os.name == "nt": d...
mit
noox-/stbgui-1
Navigation.py
1
5390
from enigma import eServiceCenter, eServiceReference, eTimer, pNavigation, getBestPlayableServiceReference, iPlayableService from Components.ParentalControl import parentalControl from Tools.BoundFunction import boundFunction from Tools.StbHardware import setFPWakeuptime, getFPWakeuptime, getFPWasTimerWakeup from time ...
gpl-2.0
dudochkin-victor/telepathy-qt4-yell
tools/glib-gtypes-generator.py
14
12379
#!/usr/bin/python # Generate GLib GInterfaces from the Telepathy specification. # The master copy of this program is in the telepathy-glib repository - # please make any changes there. # # Copyright (C) 2006, 2007 Collabora Limited # # This library is free software; you can redistribute it and/or # modify it under the...
lgpl-2.1