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
adw0rd/lettuce
tests/integration/lib/Django-1.2.5/django/core/handlers/modpython.py
71
9160
import os from pprint import pformat from django import http from django.core import signals from django.core.handlers.base import BaseHandler from django.core.urlresolvers import set_script_prefix from django.utils import datastructures from django.utils.encoding import force_unicode, smart_str, iri_to_uri # NOTE: d...
gpl-3.0
harmy/kbengine
kbe/src/lib/python/Lib/telnetlib.py
47
22218
r"""TELNET client class. Based on RFC 854: TELNET Protocol Specification, by J. Postel and J. Reynolds Example: >>> from telnetlib import Telnet >>> tn = Telnet('www.python.org', 79) # connect to finger port >>> tn.write(b'guido\r\n') >>> print(tn.read_all()) Login Name TTY Idle When...
lgpl-3.0
saleemjaveds/https-github.com-openstack-nova
nova/api/openstack/compute/plugins/v3/deferred_delete.py
2
3092
# 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 requ...
apache-2.0
cosmicAsymmetry/zulip
zerver/views/webhooks/papertrail.py
23
2145
from __future__ import absolute_import from django.utils.translation import ugettext as _ from zerver.lib.actions import check_send_message from zerver.lib.response import json_success, json_error from zerver.decorator import REQ, has_request_variables, api_key_only_webhook_view from zerver.lib.validator import check_d...
apache-2.0
mcella/django
tests/sites_framework/tests.py
115
2958
from django.apps import apps from django.conf import settings from django.contrib.sites.managers import CurrentSiteManager from django.contrib.sites.models import Site from django.core import checks from django.db import models from django.test import TestCase from .models import ( AbstractArticle, CustomArticle, ...
bsd-3-clause
dancingdan/tensorflow
tensorflow/contrib/learn/python/learn/summary_writer_cache.py
42
1307
# 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
priyankadeswal/network-address-translator
src/csma/bindings/modulegen__gcc_LP64.py
28
367346
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
philipgian/pre-commit
pre_commit/make_archives.py
1
2079
from __future__ import absolute_import from __future__ import print_function from __future__ import unicode_literals import os.path import tarfile from pre_commit import five from pre_commit import output from pre_commit.util import cmd_output from pre_commit.util import cwd from pre_commit.util import rmtree from pr...
mit
rajat1994/scikit-learn
examples/plot_kernel_ridge_regression.py
230
6222
""" ============================================= Comparison of kernel ridge regression and SVR ============================================= Both kernel ridge regression (KRR) and SVR learn a non-linear function by employing the kernel trick, i.e., they learn a linear function in the space induced by the respective k...
bsd-3-clause
Bashar/django
tests/app_loading/tests.py
61
3095
from __future__ import unicode_literals import os from django.apps import apps from django.test import TestCase from django.test.utils import extend_sys_path from django.utils._os import upath from django.utils import six class EggLoadingTest(TestCase): def setUp(self): self.egg_dir = '%s/eggs' % os.pa...
bsd-3-clause
gautam1858/tensorflow
tensorflow/python/ops/ragged/ragged_eager_test.py
13
1953
# Copyright 2018 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
GarySparrow/mFlaskWeb
venv/Lib/site-packages/pip/_vendor/distlib/version.py
335
23711
# -*- coding: utf-8 -*- # # Copyright (C) 2012-2016 The Python Software Foundation. # See LICENSE.txt and CONTRIBUTORS.txt. # """ Implementation of a flexible versioning scheme providing support for PEP-440, setuptools-compatible and semantic versioning. """ import logging import re from .compat import string_types ...
mit
ovnicraft/edx-platform
lms/djangoapps/instructor_analytics/basic.py
17
21170
""" Student and course analytics. Serve miscellaneous course and student data """ import json import datetime from shoppingcart.models import ( PaidCourseRegistration, CouponRedemption, CourseRegCodeItem, RegistrationCodeRedemption, CourseRegistrationCodeInvoiceItem ) from django.db.models import Q from django...
agpl-3.0
podemos-info/odoo
addons/l10n_es/__openerp__.py
8
2396
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (c) 2008-2010 Zikzakmedia S.L. (http://zikzakmedia.com) All Rights Reserved. # Jordi Esteve <jesteve@zikzakmedia.com> # $Id$...
agpl-3.0
chineyting/lab4-Info3180
server/lib/werkzeug/contrib/lint.py
318
12282
# -*- coding: utf-8 -*- """ werkzeug.contrib.lint ~~~~~~~~~~~~~~~~~~~~~ .. versionadded:: 0.5 This module provides a middleware that performs sanity checks of the WSGI application. It checks that :pep:`333` is properly implemented and warns on some common HTTP errors such as non-empty respons...
apache-2.0
ridfrustum/lettuce
tests/integration/lib/Django-1.2.5/django/db/models/related.py
81
2269
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...
gpl-3.0
coddingtonbear/d-rats
d_rats/gps.py
1
33132
import re import time import tempfile import platform import datetime import subst import threading import serial import socket from math import pi,cos,acos,sin,atan2 import utils if __name__ == "__main__": import gettext gettext.install("D-RATS") TEST = "$GPGGA,180718.02,4531.3740,N,12255.4599,W,1,07,1.4,...
gpl-3.0
thaumos/ansible
lib/ansible/module_utils/facts/system/dns.py
232
2678
# 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
MrCodeYu/spark
python/pyspark/ml/clustering.py
3
37032
# # 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
horica-ionescu/flask
tests/test_appctx.py
141
4034
# -*- coding: utf-8 -*- """ tests.appctx ~~~~~~~~~~~~ Tests the application context. :copyright: (c) 2015 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import pytest import flask def test_basic_url_generation(): app = flask.Flask(__name__) app.config['SERVER_NAME'...
bsd-3-clause
UManPychron/pychron
pychron/core/helpers/importtools.py
3
1317
# =============================================================================== # Copyright 2015 Jake Ross # # 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...
apache-2.0
mosaic-cloud/mosaic-distribution-dependencies
dependencies/nodejs/0.8.22/tools/gyp/pylib/gyp/MSVSSettings.py
253
43329
# Copyright (c) 2012 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. """Code to validate and convert settings of the Microsoft build tools. This file contains code to validate and convert settings of the Microsoft build tools. The...
apache-2.0
leonsio/YAHM
share/tools/ubi_reader/ubifs/output.py
3
5157
#!/usr/bin/env python ############################################################# # ubi_reader/ubifs # (c) 2013 Jason Pruitt (jrspruitt@gmail.com) # # 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 Foundat...
cc0-1.0
nurmd2/nurmd
addons/website_sale_delivery/models/sale_order.py
11
8741
# -*- coding: utf-8 -*- from openerp.osv import orm, fields from openerp import SUPERUSER_ID from openerp.addons import decimal_precision from openerp.exceptions import ValidationError from openerp.tools.translate import _ class delivery_carrier(orm.Model): _name = 'delivery.carrier' _inherit = ['delivery.ca...
gpl-3.0
MiroK/dolfin
site-packages/dolfin/multistage/rushlarsenschemes.py
2
21736
"""This module defines different MultiStageScheme classes based on the Rush Larsen expicit integration schemes which can be passed to a PointIntegralSolver""" # Copyright (C) 2014 Johan Hake # # This file is part of DOLFIN. # # DOLFIN is free software: you can redistribute it and/or modify # it under the terms of the ...
gpl-3.0
aoyono/sicpy
Chapter2/exercises/exercise2_76.py
1
1059
# -*- coding: utf-8 -*- """ https://mitpress.mit.edu/sicp/full-text/book/book-Z-H-16.html#%_thm_2.76 """ def run_the_magic(): print(""" In case we add new types to a system with generic operations: 1. in explicit design style, we would need to create a new predicate for each type, ...
mit
abhikumar22/MYBLOG
blg/Lib/site-packages/django-1.11.7-py3.6.egg/django/utils/encoding.py
47
10078
# -*- encoding: utf-8 -*- from __future__ import unicode_literals import codecs import datetime import locale from decimal import Decimal from django.utils import six from django.utils.functional import Promise from django.utils.six.moves.urllib.parse import quote, unquote if six.PY3: from urllib.parse import un...
gpl-3.0
ShownX/incubator-mxnet
example/speech-demo/io_func/feat_readers/stats.py
25
5593
# 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 u...
apache-2.0
crowning2/dash
contrib/devtools/fix-copyright-headers.py
311
1474
#!/usr/bin/env python ''' Run this script inside of src/ and it will look for all the files that were changed this year that still have the last year in the copyright headers, and it will fix the headers on that file using a perl regex one liner. For example: if it finds something like this and we're in 2014 // Copyr...
mit
reinhrst/ycmd
cpp/ycm/tests/gmock/gtest/test/gtest_xml_test_utils.py
1815
8876
#!/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...
gpl-3.0
GheRivero/ansible
lib/ansible/modules/network/ios/ios_static_route.py
58
8881
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2017, Ansible by Red Hat, inc # # This file is part of Ansible by Red Hat # # 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 Li...
gpl-3.0
timlau/yumex
src/poc/test-liststore.py
1
2777
#!/usr/bin/python -tt import gtk import time import gobject import base64 class Dummy: def __init__(self): self.name = 'package' self.ver = '1.0' self.rel = '0.1.fc14' self.arch = 'x86_64' self.summary = "This is a packages" def list_store(model, num=10): for i in xra...
gpl-2.0
abhattad4/Digi-Menu
digimenu2/build/lib.linux-x86_64-2.7/django/contrib/gis/management/commands/ogrinspect.py
111
5738
import argparse import inspect from django.contrib.gis import gdal from django.core.management.base import BaseCommand, CommandError class LayerOptionAction(argparse.Action): """ Custom argparse action for the `ogrinspect` `layer_key` keyword option which may be an integer or a string. """ def __...
bsd-3-clause
Medigate/cutiuta-server
cutiuta-server/env/lib/python3.4/site-packages/pip/_vendor/distlib/wheel.py
224
39043
# -*- coding: utf-8 -*- # # Copyright (C) 2013-2014 Vinay Sajip. # Licensed to the Python Software Foundation under a contributor agreement. # See LICENSE.txt and CONTRIBUTORS.txt. # from __future__ import unicode_literals import base64 import codecs import datetime import distutils.util from email import message_from...
gpl-3.0
mcella/django
django/conf/locale/el/formats.py
446
1477
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # from __future__ import unicode_literals # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'd/m/Y' TIME_FORMAT = 'P' DATETIME...
bsd-3-clause
kirti3192/spoken-website
mdldjango/views.py
1
15036
from django.shortcuts import render from django.views.decorators.csrf import csrf_exempt from django.core.context_processors import csrf from models import MdlUser from events.models import TrainingAttendance from django.http import HttpResponse, HttpResponseRedirect from django.contrib.auth.decorators import login_req...
gpl-3.0
axsauze/eventsfinder
django/contrib/localflavor/mx/models.py
197
2266
from django.utils.translation import ugettext_lazy as _ from django.db.models.fields import CharField from django.contrib.localflavor.mx.mx_states import STATE_CHOICES from django.contrib.localflavor.mx.forms import (MXRFCField as MXRFCFormField, MXZipCodeField as MXZipCodeFormField, MXCURPField as MXCURPFormField...
bsd-3-clause
opendaylight/archived-net-virt-platform
sdncon/stats/data.py
4
51399
# # Copyright (c) 2013 Big Switch Networks, Inc. # # Licensed under the Eclipse Public License, Version 1.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.eclipse.org/legal/epl-v10.html # # Unless required by applicable l...
epl-1.0
sarvex/tensorflow
tensorflow/lite/testing/op_tests/tanh.py
17
2112
# Copyright 2019 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
dedalusj/PaperChase
backend/alembic/env.py
1
2339
from __future__ import with_statement import sys from os.path import dirname, abspath sys.path.append(dirname(dirname(abspath(__file__)))) from alembic import context from sqlalchemy import engine_from_config, pool from logging.config import fileConfig from paperchase.models import * from paperchase.core import db f...
mit
IngenuityEngine/arkMath
test/test_helpers.py
1
2374
# Standard modules from expects import * # Our modules import arkInit arkInit.init() import tryout import arkMath from arkMath import Mat44 class test(tryout.TestSuite): title = 'test/test_helpers.py' def is_vector(self): vec = arkMath.Vec(1,2,3,4) self.assertEqual(arkMath.isVector(vec), True) self.assertE...
mit
socialsweethearts/django-allauth
allauth/socialaccount/providers/persona/tests.py
61
1079
try: from mock import patch except ImportError: from unittest.mock import patch from django.test import TestCase from django.test.utils import override_settings from django.core.urlresolvers import reverse from allauth.utils import get_user_model SOCIALACCOUNT_PROVIDERS = {'persona': ...
mit
MobinRanjbar/hue
desktop/core/ext-py/boto-2.38.0/boto/manage/__init__.py
271
1108
# Copyright (c) 2006-2009 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...
apache-2.0
deklungel/iRulez
old/modules/libraries/telepot/urllib3/util/response.py
316
2343
from __future__ import absolute_import from ..packages.six.moves import http_client as httplib from ..exceptions import HeaderParsingError def is_fp_closed(obj): """ Checks whether a given file-like object is closed. :param obj: The file-like object to check. """ try: # Check `i...
mit
leingang/plg
plg/utils/decorators.py
1
1819
#!/usr/bin/env python import logging def debug_entry(f): """ debug the entry into a function >>> import sys >>> import logging The stream configuration is just to make doctests work. In practice, you'd probably want the default stream sys.stderr. >>> logging.basicConfig(lev...
gpl-3.0
neharejanjeva/techstitution
venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/__init__.py
360
2852
""" urllib3 - Thread-safe connection pooling and re-using. """ from __future__ import absolute_import import warnings from .connectionpool import ( HTTPConnectionPool, HTTPSConnectionPool, connection_from_url ) from . import exceptions from .filepost import encode_multipart_formdata from .poolmanager imp...
cc0-1.0
MattsFleaMarket/python-for-android
python3-alpha/python3-src/Lib/lib2to3/fixes/fix_print.py
164
2854
# Copyright 2006 Google, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. """Fixer for print. Change: 'print' into 'print()' 'print ...' into 'print(...)' 'print ... ,' into 'print(..., end=" ")' 'print >>x, ...' into 'print(..., file=x)' No changes are appl...
apache-2.0
abloomston/sympy
sympy/calculus/finite_diff.py
14
12026
""" Finite difference weights ========================= This module implements an algorithm for efficient generation of finite difference weights for ordinary differentials of functions for derivatives from 0 (interpolation) up to arbitrary order. The core algorithm is provided in the finite difference weight generat...
bsd-3-clause
Christopher83/samsung-kernel-msm7x30
tools/perf/scripts/python/sched-migration.py
11215
11670
#!/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
TNT-Samuel/Coding-Projects
DNS Server/Source - Copy/Lib/site-packages/prompt_toolkit/key_binding/defaults.py
15
4918
""" Default key bindings.:: registry = load_key_bindings() app = Application(key_bindings_registry=registry) """ from __future__ import unicode_literals from prompt_toolkit.key_binding.registry import ConditionalRegistry, MergedRegistry from prompt_toolkit.key_binding.bindings.basic import load_basic_bindings,...
gpl-3.0
ecrespo/django_kanban-agile
kanban/lib/python2.7/site-packages/django/contrib/gis/gdal/base.py
654
1179
from ctypes import c_void_p from django.contrib.gis.gdal.error import GDALException from django.utils import six class GDALBase(object): """ Base object for GDAL objects that has a pointer access property that controls access to the underlying C pointer. """ # Initially the pointer is NULL. _...
mit
dpyro/servo
tests/wpt/css-tests/css-text-3_dev/html/reference/support/generate-segment-break-transformation-rules-tests.py
324
4862
#!/usr/bin/env python # - * - coding: UTF-8 - * - """ This script generates tests segment-break-transformation-rules-001 ~ 049 which cover all possible combinations of characters at two sides of segment breaks. More specifically, there are seven types of characters involve in these rules: 1. East Asian Full-width (F)...
mpl-2.0
mbode/flink
flink-python/pyflink/table/table_config.py
2
13133
################################################################################ # 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...
apache-2.0
vveerava/Openstack
neutron/tests/unit/ml2/drivers/nuage/test_nuage_mechanism_driver.py
14
1685
# Copyright 2014 Alcatel-Lucent USA 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 l...
apache-2.0
nathanhilbert/geonode
docs/tutorials/devel/conf.py
30
8061
# -*- coding: utf-8 -*- # # GeoNode Developers Workshop documentation build configuration file, created by # sphinx-quickstart on Mon Dec 17 15:21:27 2012. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogen...
gpl-3.0
pitrou/numba
numba/targets/arrayobj.py
1
109012
""" Implementation of operations on Array objects and objects supporting the buffer protocol. """ from __future__ import print_function, absolute_import, division import math import llvmlite.llvmpy.core as lc from llvmlite.llvmpy.core import Constant import numpy from numba import types, cgutils, typing from numba....
bsd-2-clause
kynesim/wireshark
tools/indexcap.py
31
11892
#!/usr/bin/env python # # Tool to index protocols that appears in the given capture files # # The script list_protos_in_cap.sh does the same thing. # # Copyright 2009, Kovarththanan Rajaratnam <kovarththanan.rajaratnam@gmail.com> # # Wireshark - Network traffic analyzer # By Gerald Combs <gerald@wireshark.org> # Copyri...
gpl-2.0
py-geek/City-Air
venv/lib/python2.7/site-packages/requests/packages/chardet/gb2312prober.py
2994
1681
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is mozilla.org code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights Reserved. # # Con...
mit
auready/django
tests/auth_tests/test_models.py
9
11262
from unittest import mock from django.conf.global_settings import PASSWORD_HASHERS from django.contrib.auth import get_user_model from django.contrib.auth.base_user import AbstractBaseUser from django.contrib.auth.hashers import get_hasher from django.contrib.auth.models import ( AbstractUser, Group, Permission, U...
bsd-3-clause
cetygamer/pywinauto
pywinauto/unittests/test_menuwrapper.py
1
6250
# GUI Application automation and testing library # Copyright (C) 2006-2018 Mark Mc Mahon and Contributors # https://github.com/pywinauto/pywinauto/graphs/contributors # http://pywinauto.readthedocs.io/en/latest/credits.html # All rights reserved. # # Redistribution and use in source and binary forms, with or without # ...
bsd-3-clause
globau/servo
tests/wpt/css-tests/tools/pytest/_pytest/runner.py
173
17105
""" basic collect and runtest protocol implementations """ import bdb import sys from time import time import py import pytest from _pytest._code.code import TerminalRepr, ExceptionInfo def pytest_namespace(): return { 'fail' : fail, 'skip' : skip, 'importorskip' : importo...
mpl-2.0
frombeijingwithlove/dlcv_for_beginners
chap6/bbox_labeling/bbox_labeling.py
1
7575
import os import cv2 from tkFileDialog import askdirectory from tkMessageBox import askyesno WINDOW_NAME = 'Simple Bounding Box Labeling Tool' FPS = 24 SUPPOTED_FORMATS = ['jpg', 'jpeg', 'png'] DEFAULT_COLOR = {'Object': (255, 0, 0)} COLOR_GRAY = (192, 192, 192) BAR_HEIGHT = 16 KEY_UP = 65362 KEY_DOWN = 65364 KEY_LEF...
bsd-3-clause
teampopong/pokr.kr
alembic/versions/3e683fc1af11_region_id_field_of_meetings_table.py
1
1559
# -*- coding: utf-8 -*- """region_id field of 'meetings' table Revision ID: 3e683fc1af11 Revises: 2f08fb65fe0b Create Date: 2014-05-24 21:31:25.378918 """ from __future__ import unicode_literals # revision identifiers, used by Alembic. revision = '3e683fc1af11' down_revision = '2f08fb65fe0b' from alembic import op...
apache-2.0
amurzeau/streamlink-debian
tests/plugins/test_viasat.py
3
2116
from streamlink.plugins.viasat import Viasat from tests.plugins import PluginCanHandleUrl class TestPluginCanHandleUrlViasat(PluginCanHandleUrl): __plugin__ = Viasat should_match = [ "http://www.juicyplay.dk/story/se-robinson-benjamins-store-forandring", "http://www.tv3.dk/paradise-hotel/para...
bsd-2-clause
tanmaykm/edx-platform
common/lib/xmodule/xmodule/modulestore/tests/test_asides.py
79
2078
""" Tests for Asides """ from xblock.core import XBlockAside from xblock.fields import Scope, String from xblock.fragment import Fragment from unittest import TestCase from xmodule.modulestore.tests.utils import XmlModulestoreBuilder from mock import patch class AsideTestType(XBlockAside): """ Test Aside type...
agpl-3.0
ecosoft-odoo/odoo
addons/point_of_sale/point_of_sale.py
55
77955
# -*- 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
gmalmquist/pants
contrib/cpp/src/python/pants/contrib/cpp/tasks/cpp_compile.py
16
3753
# coding=utf-8 # Copyright 2015 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) import os from pant...
apache-2.0
coursera-dl/coursera
coursera/test/test_parsing.py
2
4888
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Test functionality of coursera module. """ import json import os.path import pytest from six import iteritems from mock import patch, Mock, mock_open from coursera import coursera_dl from coursera import api from coursera.define import IN_MEMORY_EXTENSION, IN_MEMORY...
lgpl-3.0
eLBati/odoo
addons/account/project/wizard/account_analytic_cost_ledger_report.py
378
2026
# -*- 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
dokterbob/satchmo
satchmo/apps/payment/modules/purchaseorder/views.py
6
1428
"""Simple wrapper for standard checkout as implemented in payment.views""" from django import http from forms import PurchaseorderPayShipForm from livesettings import config_get_group from payment.views import confirm, payship from satchmo_utils.dynamic import lookup_url import logging log = logging.getLogger('purcha...
bsd-3-clause
grap/odoo-addons-cpo
purchase_compute_order/__init__.py
4
1099
# -*- encoding: utf-8 -*- ############################################################################## # # Purchase - Computed Purchase Order Module for Odoo # Copyright (C) 2013-Today GRAP (http://www.grap.coop) # @author Julien WESTE # @author Sylvain LE GAL (https://twitter.com/legalsylvain) # # Thi...
agpl-3.0
Ektorus/bohrium
ve/cpu/tools/locate.py
1
8762
from __future__ import print_function ## 3D Lattice Boltzmann (BGK) model of a fluid. ## D3Q19 model. At each timestep, particle densities propagate ## outwards in the directions indicated in the figure. An ## equivalent 'equilibrium' density is found, and the densities ## relax towards that state, in a proportion gove...
lgpl-3.0
40223246/w16b_test
static/Brython3.1.1-20150328-091302/Lib/contextlib.py
737
8788
"""Utilities for with-statement contexts. See PEP 343.""" import sys from collections import deque from functools import wraps __all__ = ["contextmanager", "closing", "ContextDecorator", "ExitStack"] class ContextDecorator(object): "A base class or mixin that enables context managers to work as decorators." ...
agpl-3.0
mcgachey/edx-platform
common/djangoapps/student/management/commands/cert_restriction.py
256
3879
from django.core.management.base import BaseCommand, CommandError import os from optparse import make_option from student.models import UserProfile import csv class Command(BaseCommand): help = """ Sets or gets certificate restrictions for users from embargoed countries. (allow_certificate in userpro...
agpl-3.0
Micronaet/micronaet-mx
sale_discount/model/discount.py
1
4156
# -*- coding: utf-8 -*- ############################################################################### # # Copyright (C) 2001-2014 Micronaet SRL (<http://www.micronaet.it>). # # Original module for stock.move from: # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny...
agpl-3.0
opennode/nodeconductor-assembly-waldur
src/waldur_auth_social/migrations/0001_initial.py
2
1334
from django.conf import settings from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] operations = [ migrations.CreateModel( name='AuthProfile', fields=[ ...
mit
jshufelt/privacyidea
tests/redismock.py
6
3958
# -*- coding: utf-8 -*- """ 2015-06-04 Create REDIS mock Cornelius Kölbel <cornelius@privacyidea.org> Original responses.py is: Copyright 2013 Dropbox, 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...
agpl-3.0
jesonyang001/qarepo
askbot/management/commands/export_osqa.py
13
9841
from django.core.exceptions import ImproperlyConfigured from django.core.management.base import BaseCommand, CommandError from django.core.serializers.xml_serializer import Serializer from django.db import connections, router, DEFAULT_DB_ALIAS from django.utils.datastructures import SortedDict from StringIO import Stri...
gpl-3.0
Turlough/keyczar
cpp/src/tools/scons/scons-local-1.2.0.d20090223/SCons/Memoize.py
19
10910
# # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 The SCons Foundation # # 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 limitati...
apache-2.0
Edraak/edx-platform
openedx/core/lib/cache_utils.py
45
1950
""" Utilities related to caching. """ import cPickle as pickle import functools import zlib from xblock.core import XBlock def memoize_in_request_cache(request_cache_attr_name=None): """ Memoize a method call's results in the request_cache if there's one. Creates the cache key by joining the unicode of al...
agpl-3.0
EKiefer/edge-starter
py34env/Lib/site-packages/django/utils/cache.py
220
15067
""" This module contains helper functions for controlling caching. It does so by managing the "Vary" header of responses. It includes functions to patch the header of response objects directly and decorators that change functions to do that header-patching themselves. For information on the Vary header, see: http...
mit
DonBeo/statsmodels
statsmodels/examples/ex_arch_canada.py
34
8691
# -*- coding: utf-8 -*- """ Created on Sat Dec 24 07:31:47 2011 Author: Josef Perktold """ from __future__ import print_function import numpy as np import statsmodels.sandbox.stats.diagnostic as dia canada_raw = '''\ 405.36646642737 929.610513893698 7.52999999999884 386.136109062605 404.6398339...
bsd-3-clause
tmxdyf/CouchPotatoServer
libs/pyutil/test/current/json_tests/test_unicode.py
106
1973
from unittest import TestCase from pyutil import jsonutil as json class TestUnicode(TestCase): def test_encoding1(self): encoder = json.JSONEncoder(encoding='utf-8') u = u'\N{GREEK SMALL LETTER ALPHA}\N{GREEK CAPITAL LETTER OMEGA}' s = u.encode('utf-8') ju = encoder.encode(u) ...
gpl-3.0
guorendong/iridium-browser-ubuntu
media/tools/layout_tests/test_expectations_unittest.py
165
1697
#!/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. import unittest from test_expectations import TestExpectations class TestTestExpectations(unittest.TestCase): def testParseLi...
bsd-3-clause
harshaneelhg/scikit-learn
sklearn/feature_selection/univariate_selection.py
95
23709
"""Univariate features selection.""" # Authors: V. Michel, B. Thirion, G. Varoquaux, A. Gramfort, E. Duchesnay. # L. Buitinck, A. Joly # License: BSD 3 clause import numpy as np import warnings from scipy import special, stats from scipy.sparse import issparse from ..base import BaseEstimator from ..prepr...
bsd-3-clause
SNoiraud/gramps
gramps/gen/lib/styledtexttag.py
8
4094
# # Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2008 Zsolt Foldvari # Copyright (C) 2013 Doug Blank <doug.blank@gmail.com> # Copyright (C) 2017 Nick Hall # # 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...
gpl-2.0
kapadia/rasterio
rasterio/rio/bounds.py
2
4017
import logging import os import click from cligj import ( precision_opt, indent_opt, compact_opt, projection_geographic_opt, projection_mercator_opt, projection_projected_opt, sequence_opt, use_rs_opt, geojson_type_feature_opt, geojson_type_bbox_opt, geojson_type_collection_opt) from .helpers import w...
bsd-3-clause
soulnothing/FlaskReDoc
example/exampleapplication.py
1
3734
import sys import re import json from flask import current_app, render_template, render_template_string from flask import Flask, jsonify from threading import Thread from flaskredoc import ReDoc from werkzeug.wsgi import DispatcherMiddleware from werkzeug.serving import run_simple from werkzeug.debug import DebuggedApp...
mit
spirrello/spirrello-pynet-work
applied_python/lib/python2.7/site-packages/pip/_vendor/distlib/database.py
203
49199
# -*- coding: utf-8 -*- # # Copyright (C) 2012-2014 The Python Software Foundation. # See LICENSE.txt and CONTRIBUTORS.txt. # """PEP 376 implementation.""" from __future__ import unicode_literals import base64 import codecs import contextlib import hashlib import logging import os import posixpath import sys import z...
gpl-3.0
msimacek/samba
third_party/waf/wafadmin/Tools/vala.py
32
10296
#!/usr/bin/env python # encoding: utf-8 # Ali Sabil, 2007 import os.path, shutil import Task, Runner, Utils, Logs, Build, Node, Options from TaskGen import extension, after, before EXT_VALA = ['.vala', '.gs'] class valac_task(Task.Task): vars = ("VALAC", "VALAC_VERSION", "VALAFLAGS") before = ("cc", "cxx") def ...
gpl-3.0
actmd/Diamond
src/collectors/kafkastat/kafkastat.py
54
4706
# coding=utf-8 """ Collect stats via MX4J from Kafka #### Dependencies * urllib2 * xml.etree """ import urllib2 from urllib import urlencode try: from xml.etree import ElementTree except ImportError: ElementTree = None try: from ElementTree import ParseError as ETParseError except ImportError: E...
mit
dmitriz/zipline
zipline/utils/tradingcalendar.py
6
11182
# # Copyright 2013 Quantopian, 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 wr...
apache-2.0
marty331/jakesclock
flask/lib/python2.7/site-packages/flask/__init__.py
425
1674
# -*- coding: utf-8 -*- """ flask ~~~~~ A microframework based on Werkzeug. It's extensively documented and follows best practice patterns. :copyright: (c) 2011 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ __version__ = '0.10.1' # utilities we import from Werkzeug and...
gpl-2.0
LaoZhongGu/kbengine
kbe/res/scripts/common/Lib/encodings/__init__.py
764
5067
""" Standard "encodings" Package Standard Python encoding modules are stored in this package directory. Codec modules must have names corresponding to normalized encoding names as defined in the normalize_encoding() function below, e.g. 'utf-8' must be implemented by the module 'utf_8.py'. Ea...
lgpl-3.0
chatcannon/numpy
numpy/f2py/f90mod_rules.py
122
9850
#!/usr/bin/env python """ Build F90 module support for f2py2e. Copyright 2000 Pearu Peterson all rights reserved, Pearu Peterson <pearu@ioc.ee> Permission to use, modify, and distribute this software is given under the terms of the NumPy License. NO WARRANTY IS EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK. $Date: 200...
bsd-3-clause
cykl/hprof2flamegraph
stackcollapse_hpl.py
1
8006
#! /usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (c) 2014, Clément MATHIEU # 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 c...
bsd-2-clause
vpodzime/anaconda
tests/regex_tests/url_test.py
9
8062
# # Copyright (C) 2010-2013 Red Hat, Inc. # # This copyrighted material is made available to anyone wishing to use, # modify, copy, or redistribute it subject to the terms and conditions of # the GNU General Public License v.2, or (at your option) any later version. # This program is distributed in the hope that it wi...
gpl-2.0
davidzchen/tensorflow
tensorflow/python/keras/engine/training_eager_test.py
8
14505
# 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
nirmeshk/oh-mainline
vendor/packages/Django/django/views/i18n.py
103
9886
import os import gettext as gettext_module from django import http from django.conf import settings from django.utils import importlib from django.utils.translation import check_for_language, activate, to_locale, get_language from django.utils.text import javascript_quote from django.utils.encoding import smart_text f...
agpl-3.0
andrewnc/scikit-learn
examples/plot_isotonic_regression.py
303
1767
""" =================== Isotonic Regression =================== An illustration of the isotonic regression on generated data. The isotonic regression finds a non-decreasing approximation of a function while minimizing the mean squared error on the training data. The benefit of such a model is that it does not assume a...
bsd-3-clause