repo_name stringlengths 5 100 | path stringlengths 4 294 | copies stringclasses 990
values | size stringlengths 4 7 | content stringlengths 666 1M | license stringclasses 15
values |
|---|---|---|---|---|---|
hoh/Billabong | billabong/tests/test_add.py | 1 | 2236 | # Copyright (c) 2015 "Hugo Herter http://hugoherter.com"
#
# This file is part of Billabong.
#
# Intercom 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 o... | agpl-3.0 |
spectralDNS/shenfun | demo/NavierStokes.py | 1 | 1882 | """
Simple spectral Navier-Stokes solver
Not implemented for efficiency. For efficiency use the Navier-Stokes
solver in the https://github.com/spectralDNS/spectralDNS repository
"""
import numpy as np
from shenfun import *
nu = 0.000625
end_time = 0.1
dt = 0.01
N = (2**5, 2**5, 2**5)
V0 = FunctionSpace(N[0], 'F', dt... | bsd-2-clause |
datafolklabs/cement | cement/core/plugin.py | 1 | 1713 | """Cement core plugins module."""
from abc import abstractmethod
from ..core.interface import Interface
from ..core.handler import Handler
from ..utils.misc import minimal_logger
LOG = minimal_logger(__name__)
class PluginInterface(Interface):
"""
This class defines the Plugin Interface. Handlers that imp... | bsd-3-clause |
xinjiguaike/edx-platform | common/djangoapps/student/migrations/0010_auto__chg_field_courseenrollment_course_id.py | 188 | 9725 | # -*- 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):
# Changing field 'CourseEnrollment.course_id'
db.alter_column('student_courseenrollment', 'course_id', self... | agpl-3.0 |
gokudomatic/cobiv | cobiv/modules/database/sqlitedb/search/customtablestrategy.py | 1 | 6029 | import time
from cobiv.modules.database.sqlitedb.search.defaultstrategy import DefaultSearchStrategy
class CustomTableStrategy(DefaultSearchStrategy):
"""Common search strategy for custom tables. Given a custom table with a least a file key column, the strategy maps
automatically all the specified fields of ... | mit |
rizumu/django | tests/shortcuts/views.py | 87 | 2274 | from django.shortcuts import render, render_to_response
from django.template import RequestContext
def render_to_response_view(request):
return render_to_response('shortcuts/render_test.html', {
'foo': 'FOO',
'bar': 'BAR',
})
def render_to_response_view_with_multiple_templates(request):
... | bsd-3-clause |
hojel/youtube-dl | youtube_dl/extractor/channel9.py | 27 | 11365 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
ExtractorError,
parse_filesize,
qualities,
)
class Channel9IE(InfoExtractor):
'''
Common extractor for channel9.msdn.com.
The type of provided URL (video or playlist) is determined acco... | unlicense |
timothycrosley/WebBot | instant_templates/update_webbot_appengine/pygments/styles/vim.py | 26 | 1976 | # -*- coding: utf-8 -*-
"""
pygments.styles.vim
~~~~~~~~~~~~~~~~~~~
A highlighting style for Pygments, inspired by vim.
:copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.style import Style
from pygments.token import Keywor... | gpl-2.0 |
anirudhSK/chromium | chrome/test/functional/ispy/server/gs_bucket.py | 13 | 1932 | # 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.
"""Implementation of CloudBucket using Google Cloud Storage as the backend."""
import os
import sys
import cloudstorage
from common import cloud_bucket
c... | bsd-3-clause |
adambrenecki/django | django/test/simple.py | 6 | 8799 | """
This module is pending deprecation as of Django 1.6 and will be removed in
version 1.8.
"""
from importlib import import_module
import json
import re
import unittest as real_unittest
import warnings
from django.db.models import get_app, get_apps
from django.test import _doctest as doctest
from django.test import ... | bsd-3-clause |
ricardaw/pismdev | util/pism_config_editor.py | 5 | 7572 | #!/usr/bin/env python
# import modules:
## @package pism_config_editor
##
## A script simplifying creating configuration files to use with PISM's -config_override option.
##
## Does not take any command-line options; the only argument is a name of a
## NetCDF configuration file to start from. Run
## \verbatim
## pism... | gpl-2.0 |
smaty1/scrapy | scrapy/utils/response.py | 40 | 3133 | """
This module provides some useful functions for working with
scrapy.http.Response objects
"""
import os
import re
import weakref
import webbrowser
import tempfile
from twisted.web import http
from twisted.web.http import RESPONSES
from scrapy.utils.python import to_bytes
from w3lib import html
from scrapy.utils.de... | bsd-3-clause |
gsmartway/odoo | addons/account_sequence/account_sequence.py | 338 | 2534 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# This program is free software: you can redistribute it and/or modify
# ... | agpl-3.0 |
40223119/2015cda | static/Brython3.1.1-20150328-091302/Lib/test/pystone.py | 718 | 7379 | #! /usr/bin/python3.3
"""
"PYSTONE" Benchmark Program
Version: Python/1.1 (corresponds to C/1.1 plus 2 Pystone fixes)
Author: Reinhold P. Weicker, CACM Vol 27, No 10, 10/84 pg. 1013.
Translated from ADA to C by Rick Richardson.
Every method to preserve ADA-likeness ha... | gpl-3.0 |
t794104/ansible | test/units/modules/storage/netapp/test_na_ontap_job_schedule.py | 43 | 8947 | # (c) 2018, NetApp, Inc
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
''' unit tests for Ansible module: na_ontap_job_schedule '''
from __future__ import print_function
import json
import pytest
from units.compat import unittest
from units.compat.mock import patch, Mock... | gpl-3.0 |
hchen1202/django-react | virtualenv/lib/python3.6/site-packages/pyparsing.py | 77 | 231039 | # module pyparsing.py
#
# Copyright (c) 2003-2016 Paul T. McGuire
#
# 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 u... | mit |
ff94315/hiwifi-openwrt-HC5661-HC5761 | staging_dir/host/lib/python2.7/distutils/command/register.py | 175 | 11839 | """distutils.command.register
Implements the Distutils 'register' command (register with the repository).
"""
# created 2002/10/21, Richard Jones
__revision__ = "$Id$"
import urllib2
import getpass
import urlparse
from warnings import warn
from distutils.core import PyPIRCCommand
from distutils import log
class r... | gpl-2.0 |
IndonesiaX/edx-platform | lms/djangoapps/ccx/tests/test_models.py | 27 | 8934 | """
tests for the models
"""
from datetime import datetime, timedelta
from django.utils.timezone import UTC
from mock import patch
from nose.plugins.attrib import attr
from student.roles import CourseCcxCoachRole
from student.tests.factories import (
AdminFactory,
)
from util.tests.test_date_utils import fake_ugett... | agpl-3.0 |
jooking/closure-library | closure/bin/labs/code/generate_jsdoc.py | 222 | 4318 | #!/usr/bin/env python
#
# Copyright 2013 The Closure Library 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
... | apache-2.0 |
shakamunyi/sahara | sahara/plugins/cdh/client/roles.py | 7 | 6525 | # Copyright (c) 2014 Intel Corporation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | apache-2.0 |
tboyce021/home-assistant | homeassistant/components/life360/config_flow.py | 10 | 4048 | """Config flow to configure Life360 integration."""
from collections import OrderedDict
import logging
from life360 import Life360Error, LoginError
import voluptuous as vol
from homeassistant import config_entries
from homeassistant.const import CONF_PASSWORD, CONF_USERNAME
from .const import CONF_AUTHORIZATION, DOM... | apache-2.0 |
roadmapper/ansible | lib/ansible/utils/path.py | 26 | 5225 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... | gpl-3.0 |
plissonf/scikit-learn | examples/manifold/plot_compare_methods.py | 259 | 4031 | """
=========================================
Comparison of Manifold Learning methods
=========================================
An illustration of dimensionality reduction on the S-curve dataset
with various manifold learning methods.
For a discussion and comparison of these algorithms, see the
:ref:`manifold module... | bsd-3-clause |
entropy1337/infernal-twin | Modules/build/reportlab/src/reportlab/platypus/paraparser.py | 24 | 45904 | #Copyright ReportLab Europe Ltd. 2000-2012
#see license.txt for license details
#history http://www.reportlab.co.uk/cgi-bin/viewcvs.cgi/public/reportlab/trunk/reportlab/platypus/paraparser.py
__version__=''' $Id$ '''
__doc__='''The parser used to process markup within paragraphs'''
import string
import re
import sys
im... | gpl-3.0 |
visionegg/visionegg | demo/mouse_gabor_2d.py | 1 | 6332 | #!/usr/bin/env python
"""sinusoidal grating in gaussian window"""
from VisionEgg import *
start_default_logging(); watch_exceptions()
from VisionEgg.Core import *
from VisionEgg.Gratings import *
from VisionEgg.SphereMap import *
from VisionEgg.Text import *
from VisionEgg.Textures import *
import VisionEgg.Parameter... | lgpl-2.1 |
Teagan42/home-assistant | homeassistant/components/songpal/media_player.py | 3 | 10903 | """Support for Songpal-enabled (Sony) media devices."""
import asyncio
from collections import OrderedDict
import logging
from songpal import (
ConnectChange,
ContentChange,
Device,
PowerChange,
SongpalException,
VolumeChange,
)
import voluptuous as vol
from homeassistant.components.media_play... | apache-2.0 |
eeshangarg/oh-mainline | vendor/packages/irc/irc/modes.py | 21 | 2490 | def parse_nick_modes(mode_string):
"""Parse a nick mode string.
The function returns a list of lists with three members: sign,
mode and argument. The sign is "+" or "-". The argument is
always None.
Example:
>>> parse_nick_modes("+ab-c")
[['+', 'a', None], ['+', 'b', None], ['-', 'c', N... | agpl-3.0 |
marcosmodesto/django-testapp | django/views/i18n.py | 57 | 9796 | 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_unicod... | bsd-3-clause |
Dino0631/RedRain-Bot | lib/youtube_dl/extractor/vidme.py | 26 | 9023 | from __future__ import unicode_literals
import itertools
from .common import InfoExtractor
from ..compat import compat_HTTPError
from ..utils import (
ExtractorError,
int_or_none,
float_or_none,
parse_iso8601,
)
class VidmeIE(InfoExtractor):
IE_NAME = 'vidme'
_VALID_URL = r'https?://vid\.me/... | gpl-3.0 |
kyvinh/home-assistant | homeassistant/components/sensor/dweet.py | 23 | 3540 | """
Support for showing values from Dweet.io.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sensor.dweet/
"""
import json
import logging
from datetime import timedelta
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEM... | apache-2.0 |
tomprince/gemrb | gemrb/GUIScripts/CommonWindow.py | 3 | 9763 | # -*-python-*-
# GemRB - Infinity Engine Emulator
# Copyright (C) 2010 The GemRB Project
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) ... | gpl-2.0 |
dracos/QGIS | python/ext-libs/pygments/lexers/hdl.py | 363 | 16209 | # -*- coding: utf-8 -*-
"""
pygments.lexers.hdl
~~~~~~~~~~~~~~~~~~~
Lexers for hardware descriptor languages.
:copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import RegexLexer, bygroups, include, using, t... | gpl-2.0 |
ArneBab/pypyjs | website/demo/home/rfk/repos/pypy/lib-python/2.7/pty.py | 173 | 5058 | """Pseudo terminal utilities."""
# Bugs: No signal handling. Doesn't set slave termios and window size.
# Only tested on Linux.
# See: W. Richard Stevens. 1992. Advanced Programming in the
# UNIX Environment. Chapter 19.
# Author: Steen Lumholt -- with additions by Guido.
from select import select
imp... | mit |
chauhanmohit/phantomjs | src/qt/qtwebkit/Tools/jhbuild/jhbuildutils.py | 117 | 1843 | import glob
import os.path
import sys
import __builtin__
top_level_dir = None
def top_level_path(*args):
global top_level_dir
if not top_level_dir:
top_level_dir = os.path.join(os.path.dirname(__file__), '..', '..')
return os.path.join(*(top_level_dir,) + args)
def get_dependencies_path():
... | bsd-3-clause |
HesselTjeerdsma/Cyber-Physical-Pacman-Game | Algor/flask/lib/python2.7/site-packages/numpy/doc/basics.py | 7 | 7905 | """
============
Array basics
============
Array types and conversions between types
=========================================
NumPy supports a much greater variety of numerical types than Python does.
This section shows which are available, and how to modify an array's data-type.
============ ======================... | apache-2.0 |
isnnn/Sick-Beard-TPB | lib/html5lib/treewalkers/genshistream.py | 128 | 2431 | from genshi.core import START, END, XML_NAMESPACE, DOCTYPE, TEXT
from genshi.core import START_NS, END_NS, START_CDATA, END_CDATA, PI, COMMENT
from genshi.output import NamespaceFlattener
import _base
from html5lib.constants import voidElements
class TreeWalker(_base.TreeWalker):
def __iter__(self):
de... | gpl-3.0 |
romain-dartigues/ansible | lib/ansible/modules/network/f5/bigip_device_auth_ldap.py | 7 | 25083 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright: (c) 2018, F5 Networks Inc.
# 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 |
vicnet/weboob | modules/audioaddict/test.py | 2 | 1771 | # -*- coding: utf-8 -*-
# Copyright(C) 2013 Pierre Mazière
#
# This file is part of a weboob module.
#
# This weboob module 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 Licen... | lgpl-3.0 |
tareqalayan/ansible | lib/ansible/modules/cloud/ovirt/ovirt_affinity_label.py | 78 | 7067 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (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
#... | gpl-3.0 |
MikeWinter/bio-data-repository | bdr/formats/simple/views.py | 1 | 12531 | """
This module defines classes for displaying and editing simple type formats.
"""
try:
# noinspection PyPep8Naming
import cPickle as pickle
except ImportError:
import pickle
import os.path
import unicodedata
from django.forms.formsets import formset_factory
from django.http import StreamingHttpResponse
... | gpl-2.0 |
compops/gpo-abc2015 | scripts-paper/example1-gposmc.py | 2 | 5416 | ##############################################################################
##############################################################################
# Estimating the volatility of synthetic data
# using a stochastic volatility (SV) model with Gaussian log-returns.
#
# The SV model is inferred using the GP... | mit |
igor-toga/local-snat | neutron/tests/unit/db/test_l3_dvr_db.py | 1 | 31460 | # Copyright (c) 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 required by applic... | apache-2.0 |
annarev/tensorflow | tensorflow/python/keras/mixed_precision/device_compatibility_check_test.py | 5 | 5587 | # 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 |
ifduyue/django | django/db/migrations/autodetector.py | 9 | 59878 | import functools
import re
from itertools import chain
from django.conf import settings
from django.db import models
from django.db.migrations import operations
from django.db.migrations.migration import Migration
from django.db.migrations.operations.models import AlterModelOptions
from django.db.migrations.optimizer ... | bsd-3-clause |
paulorauber/pgm | examples/die.py | 1 | 3385 | import numpy as np
import contextlib
from model.factor import RandomVar
from model.factor import Factor
from model.factor import CPD
from model.gd import BayesianNetwork
from inference.approximate import ForwardSampler
from learning.parameter import ExpectationMaximization
from learning.structure import LikelihoodScor... | mit |
zerc/django | django/db/backends/sqlite3/base.py | 323 | 18115 | """
SQLite3 backend for django.
Works with either the pysqlite2 module or the sqlite3 module in the
standard library.
"""
from __future__ import unicode_literals
import datetime
import decimal
import re
import warnings
from django.conf import settings
from django.db import utils
from django.db.backends import utils ... | bsd-3-clause |
whix/tablib | tablib/packages/openpyxl3/writer/drawings.py | 116 | 8268 | # coding=UTF-8
'''
Copyright (c) 2010 openpyxl
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, merge, publ... | mit |
brennie/reviewboard | reviewboard/reviews/tests/test_default_reviewer.py | 3 | 3641 | from __future__ import unicode_literals
from django.contrib.auth.models import User
from reviewboard.reviews.models import DefaultReviewer
from reviewboard.scmtools.models import Repository, Tool
from reviewboard.site.models import LocalSite
from reviewboard.testing import TestCase
class DefaultReviewerTests(TestCa... | mit |
meredith-digops/ansible | lib/ansible/modules/cloud/cloudstack/cs_facts.py | 39 | 7253 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2015, René Moser <mail@renemoser.net>
#
# 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 Lice... | gpl-3.0 |
AnthonyBroadCrawford/servo | tests/wpt/web-platform-tests/tools/pywebsocket/src/example/hsts_wsh.py | 486 | 1784 | # Copyright 2013, 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... | mpl-2.0 |
dmsuehir/spark-tk | regression-tests/sparktkregtests/testcases/scoretests/lda.py | 12 | 2094 | # vim: set encoding=utf-8
# Copyright (c) 2016 Intel Corporation
#
# 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 require... | apache-2.0 |
Edu-Glez/Bank_sentiment_analysis | env/lib/python3.6/site-packages/pygments/styles/vim.py | 31 | 1976 | # -*- coding: utf-8 -*-
"""
pygments.styles.vim
~~~~~~~~~~~~~~~~~~~
A highlighting style for Pygments, inspired by vim.
:copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.style import Style
from pygments.token import Keywor... | apache-2.0 |
mmaker/bridgedb | lib/bridgedb/parse/__init__.py | 6 | 2621 | # -*- coding: utf-8 -*-
#
# This file is part of BridgeDB, a Tor bridge distribution system.
#
# :authors: Isis Lovecruft 0xA3ADB67A2CDB8B35 <isis@torproject.org>
# please also see AUTHORS file
# :copyright: (c) 2013 Isis Lovecruft
# (c) 2007-2013, The Tor Project, Inc.
# (c) 2007-2013... | bsd-3-clause |
47lining/ansible | plugins/callbacks/osx_say.py | 72 | 3203 |
# (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 the License, or
# (at your option) any la... | gpl-3.0 |
matthiasdiener/spack | var/spack/repos/builtin/packages/sailfish/package.py | 3 | 1627 | ##############################################################################
# Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | lgpl-2.1 |
cpcloud/toolz | toolz/recipes.py | 19 | 1287 | import itertools
from .itertoolz import frequencies, pluck, getter
from .compatibility import map
__all__ = ('countby', 'partitionby')
def countby(key, seq):
""" Count elements of a collection by a key function
>>> countby(len, ['cat', 'mouse', 'dog'])
{3: 2, 5: 1}
>>> def iseven(x): return x % 2 ... | bsd-3-clause |
jhsenjaliya/incubator-airflow | tests/dags/test_impersonation.py | 45 | 1219 | # -*- coding: utf-8 -*-
#
# 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
... | apache-2.0 |
antoyo/qutebrowser | qutebrowser/misc/sessions.py | 4 | 17153 | # vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2015-2016 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# This file is part of qutebrowser.
#
# qutebrowser 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 S... | gpl-3.0 |
iansprice/wagtail | wagtail/wagtailadmin/tests/test_messages.py | 8 | 1326 | from __future__ import absolute_import, unicode_literals
from django.contrib import messages
from django.core.urlresolvers import reverse
from django.test import TestCase, override_settings
class TestPageExplorer(TestCase):
@override_settings(MESSAGE_TAGS={
messages.DEBUG: 'my-custom-tag',
messag... | bsd-3-clause |
Cuuuurzel/KiPyCalc | sympy/polys/distributedmodules.py | 23 | 21826 | r"""
Sparse distributed elements of free modules over multivariate (generalized)
polynomial rings.
This code and its data structures are very much like the distributed
polynomials, except that the first "exponent" of the monomial is
a module generator index. That is, the multi-exponent ``(i, e_1, ..., e_n)``
represent... | mit |
obeattie/sqlalchemy | lib/sqlalchemy/engine/reflection.py | 1 | 13666 | """Provides an abstraction for obtaining database schema information.
Usage Notes:
Here are some general conventions when accessing the low level inspector
methods such as get_table_names, get_columns, etc.
1. Inspector methods return lists of dicts in most cases for the following
reasons:
* They're both stan... | mit |
leihu0724/azure-sdk-for-python | setup.py | 1 | 2026 | #!/usr/bin/env python
#-------------------------------------------------------------------------
# Copyright (c) Microsoft. 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... | apache-2.0 |
xuxiao19910803/edx | lms/djangoapps/instructor/tests/test_ecommerce.py | 41 | 14884 | """
Unit tests for Ecommerce feature flag in new instructor dashboard.
"""
import datetime
import pytz
from django.core.urlresolvers import reverse
from nose.plugins.attrib import attr
from course_modes.models import CourseMode
from student.roles import CourseFinanceAdminRole
from shoppingcart.models import Coupon,... | agpl-3.0 |
daspots/dasapp | main/auth/auth.py | 1 | 12697 | # coding: utf-8
from __future__ import absolute_import
import functools
import re
from flask_oauthlib import client as oauth
from google.appengine.ext import ndb
import flask
import flask_login
import flask_wtf
import unidecode
import wtforms
import cache
import config
import model
import task
import util
from mai... | mit |
mach0/QGIS | tests/src/python/test_qgsrasterrange.py | 45 | 20098 | # -*- coding: utf-8 -*-
"""QGIS Unit tests for QgsRasterRange.
.. note:: This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
"""
__... | gpl-2.0 |
Nitaco/ansible | contrib/inventory/mdt_dynamic_inventory.py | 117 | 4538 | #!/usr/bin/env python
# (c) 2016, Julian Barnett <jbarnett@tableau.com>
#
# This file is part of Ansible.
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at ... | gpl-3.0 |
Hybrid-Cloud/conveyor | conveyor/conveyorheat/engine/resources/openstack/neutron/lbaas/pool_member.py | 1 | 6964 | #
# Copyright 2015 IBM Corp.
#
# 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 require... | apache-2.0 |
smalls257/VRvisu | Library/External.LCA_RESTRICTED/Languages/CPython/27/Lib/encodings/cp1255.py | 593 | 12722 | """ Python Character Mapping Codec cp1255 generated from 'MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1255.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,in... | gpl-3.0 |
endlessm/chromium-browser | tools/lldb/lldb_chrome.py | 4 | 1446 | # Copyright (c) 2017 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.
"""
LLDB Support for Chromium types in Xcode
Add the following to your ~/.lldbinit:
command script import {Path to SRC Root}/tools/lldb/lldb... | bsd-3-clause |
BiznetGIO/horizon | openstack_dashboard/management/commands/make_web_conf.py | 3 | 11356 | # 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
# distributed under t... | apache-2.0 |
cloudbau/nova | nova/tests/fake_hosts.py | 42 | 1314 | # Copyright (c) 2012 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... | apache-2.0 |
BetterWorks/djangosaml2 | djangosaml2/utils.py | 2 | 2263 | # Copyright (C) 2012 Yaco Sistemas (http://www.yaco.es)
#
# 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 applic... | apache-2.0 |
root-mirror/root | tutorials/roofit/rf101_basics.py | 11 | 1963 | ## \file
## \ingroup tutorial_roofit
## \notebook
## This tutorial illustrates the basic features of RooFit.
##
## \macro_code
##
## \date February 2018
## \authors Clemens Lange, Wouter Verkerke (C++ version)
import ROOT
# Set up model
# ---------------------
# Declare variables x,mean,sigma with associated name, ti... | lgpl-2.1 |
craigem/effectivepython | item_03.py | 1 | 1035 | #!/usr/bin/env python3
'''Item 3 from Effective Python'''
import logging
# Example 1
def to_str(bytes_or_str):
'''In Python 3, you'll need one method that takes a str or bytes and
always returns a str .'''
if isinstance(bytes_or_str, bytes):
value = bytes_or_str.decode('utf-8')
else:
... | gpl-3.0 |
orangeduck/PyAutoC | Python27/Lib/test/test_dis.py | 19 | 4548 | # Minimal tests for dis module
from test.test_support import run_unittest
import unittest
import sys
import dis
import StringIO
def _f(a):
print a
return 1
dis_f = """\
%-4d 0 LOAD_FAST 0 (a)
3 PRINT_ITEM
4 PRINT_NEWLINE
%-4d 5 LOAD_CONST ... | bsd-2-clause |
megaumi/django | django/db/models/fields/files.py | 129 | 19629 | import datetime
import os
import warnings
from django import forms
from django.core import checks
from django.core.files.base import File
from django.core.files.images import ImageFile
from django.core.files.storage import default_storage
from django.db.models import signals
from django.db.models.fields import Field
f... | bsd-3-clause |
Titan-C/sympy | sympy/physics/tests/test_physics_matrices.py | 116 | 2619 | from sympy.physics.matrices import msigma, mgamma, minkowski_tensor, pat_matrix, mdft
from sympy import zeros, eye, I, Matrix, sqrt, Rational
def test_parallel_axis_theorem():
# This tests the parallel axis theorem matrix by comparing to test
# matrices.
# First case, 1 in all directions.
mat1 = Matr... | bsd-3-clause |
khalibartan/Antidote-DM | Antidotes DM/Downloader/EBook.py | 2 | 2855 | import urllib2
import re
try:
flag=1
target = open('Proxy.txt', 'r')
target_lst = target.read()
target_lst = target_lst.split()
address = target_lst[0]
port = target_lst[1]
user = target_lst[2]
password = target_lst[3]
http_proxy = "http://" + user + ":" + password + "@" + address ... | gpl-2.0 |
chubbymaggie/reverse | plasma/lib/graph.py | 1 | 27118 | #!/usr/bin/env python3
#
# PLASMA : Generate an indented asm code (pseudo-C) with colored syntax.
# Copyright (C) 2015 Joel
#
# 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 ... | gpl-3.0 |
mdavid/horizon | openstack_dashboard/contrib/sahara/content/data_processing/data_image_registry/tests.py | 25 | 5220 | # 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
# distributed under t... | apache-2.0 |
TwinkleChawla/nova | nova/test.py | 14 | 15705 | # 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 except in compliance with the License. You may obtain
# a ... | apache-2.0 |
nstockton/nvda-add-ons | applications/IfInterpreters/appModules/magnetic.py | 1 | 1910 | # -*- coding: utf-8 -*-
# A part of NonVisual Desktop Access (NVDA)
# This file is covered by the GNU General Public License.
# See the file COPYING for more details.
# Copyright (C) 2020 Nick Stockton <nstockton@gmail.com>
# Portions of This Work Copyright (C) 2006-2013 NV Access Limited
# Built-in NVDA Modul... | gpl-2.0 |
niklabh/netmag | netmag/wsgi.py | 1 | 1419 | """
WSGI config for netmag project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICATION`` s... | mit |
shuggiefisher/potato | django/test/simple.py | 150 | 15012 | import unittest as real_unittest
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.db.models import get_app, get_apps
from django.test import _doctest as doctest
from django.test.utils import setup_test_environment, teardown_test_environment
from django.test.testcases ... | bsd-3-clause |
3dfxsoftware/cbss-addons | mrp_workorder_lot/wizard/mrp_consume_produce.py | 1 | 14643 | # -*- encoding: utf-8 -*-
###########################################################################
# Module Writen to OpenERP, Open Source Management Solution
#
# Copyright (c) 2012 Vauxoo - http://www.vauxoo.com
# All Rights Reserved.
# info@vauxoo.com
###################################################... | gpl-2.0 |
fintech-circle/edx-platform | openedx/core/djangoapps/auth_exchange/tests/test_forms.py | 30 | 4027 | # pylint: disable=no-member
"""
Tests for OAuth token exchange forms
"""
import unittest
from django.conf import settings
from django.contrib.sessions.middleware import SessionMiddleware
from django.test import TestCase
from django.test.client import RequestFactory
import httpretty
from provider import scope
import so... | agpl-3.0 |
Em-Pan/swift | test/unit/proxy/test_mem_server.py | 32 | 1731 | # Copyright (c) 2010-2013 OpenStack, LLC.
#
# 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 ... | apache-2.0 |
stefanw/dataset | dataset/persistence/table.py | 1 | 18458 | import logging
from hashlib import sha1
from sqlalchemy.sql import and_, expression
from sqlalchemy.sql.expression import ClauseElement
from sqlalchemy.schema import Column, Index
from sqlalchemy import alias, false
from dataset.persistence.util import guess_type, normalize_column_name
from dataset.persistence.util im... | mit |
mmauroy/SickRage | lib/sqlalchemy/sql/dml.py | 78 | 29493 | # sql/dml.py
# Copyright (C) 2009-2014 the SQLAlchemy authors and contributors <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""
Provide :class:`.Insert`, :class:`.Update` and :class:`.Delete`.
"""
from .base import... | gpl-3.0 |
Damnever/pigar | setup.py | 1 | 2469 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import re
import codecs
from setuptools import setup, find_packages
version = ''
with open('pigar/version.py', 'r') as f:
version = re.search(
r'__version__\s*=\s*[\'"]([^\'"]*)[\'"]', f.read(), re.M
).group(1)
if not version:
raise RuntimeError('Can... | bsd-3-clause |
a1ezzz/wasp-backup | wasp_backup/apps.py | 1 | 7497 | # -*- coding: utf-8 -*-
# wasp_backup/apps.py
#
# Copyright (C) 2017 the wasp-backup authors and contributors
# <see AUTHORS file>
#
# This file is part of wasp-backup.
#
# wasp-backup is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
#... | lgpl-3.0 |
Cactuslegs/audacity-of-nope | lib-src/lv2/lilv/waflib/Tools/c_osx.py | 329 | 4274 | #! /usr/bin/env python
# encoding: utf-8
# WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file
import os,shutil,sys,platform
from waflib import TaskGen,Task,Build,Options,Utils,Errors
from waflib.TaskGen import taskgen_method,feature,after_method,before_method
app_info=... | gpl-2.0 |
istresearch/traptor | tests/traptor_integration_tests.py | 1 | 2572 | """
Traptor integration tests.
This test file is used to ensure that a Traptor is able to pull rules from Redis and begin collection.
Requirements:
* Docker
* Python 2.7 environment with Redis installed
To run this test do the following:
* Create and activate a virtual environment (venv or Anaconda)
* Rename `trapt... | mit |
ohnonot/fbpanel-genmon2 | .config/argparse.py | 490 | 87791 | # Author: Steven J. Bethard <steven.bethard@gmail.com>.
"""Command-line parsing library
This module is an optparse-inspired command-line parsing library that:
- handles both optional and positional arguments
- produces highly informative usage messages
- supports parsers that dispatch to sub-parsers
The... | mit |
dc3-plaso/plaso | plaso/cli/helpers/manager.py | 1 | 3543 | # -*- coding: utf-8 -*-
"""The CLI arguments helper manager objects."""
from plaso.lib import errors
class ArgumentHelperManager(object):
"""Class that implements the CLI argument helper manager."""
_helper_classes = {}
@classmethod
def AddCommandLineArguments(
cls, argument_group, argument_category=... | apache-2.0 |
ashishnitinpatil/vnitstudnotifs | django/contrib/gis/db/backends/postgis/adapter.py | 222 | 1557 | """
This object provides quoting for GEOS geometries into PostgreSQL/PostGIS.
"""
from __future__ import unicode_literals
from psycopg2 import Binary
from psycopg2.extensions import ISQLQuote
class PostGISAdapter(object):
def __init__(self, geom):
"Initializes on the geometry."
# Getting the WKB ... | bsd-3-clause |
dgarciam/Sick-Beard | sickbeard/ui.py | 18 | 5537 | # Author: Nic Wolfe <nic@wolfeden.ca>
# URL: http://code.google.com/p/sickbeard/
#
# This file is part of Sick Beard.
#
# Sick Beard 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 Lice... | gpl-3.0 |
ryanmcgrath/twython | tests/test_auth.py | 10 | 3450 | from twython import Twython, TwythonError, TwythonAuthError
from .config import app_key, app_secret, screen_name, unittest
class TwythonAuthTestCase(unittest.TestCase):
def setUp(self):
self.api = Twython(app_key, app_secret)
self.bad_api = Twython('BAD_APP_KEY', 'BAD_APP_SECRET')
self.ba... | mit |
aronsky/home-assistant | homeassistant/components/camera/xiaomi.py | 2 | 5498 | """
This component provides support for Xiaomi Cameras.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/camera.xiaomi/
"""
import asyncio
import logging
import voluptuous as vol
from homeassistant.components.camera import Camera, PLATFORM_SCHEMA
from ho... | apache-2.0 |
wimleers/fileconveyor | fileconveyor/filter.py | 3 | 7838 | """filter.py Filter class for daemon"""
__author__ = "Wim Leers (work@wimleers.com)"
__version__ = "$Rev$"
__date__ = "$Date$"
__license__ = "GPL"
from sets import Set, ImmutableSet
import re
import types
import os
import os.path
import stat
# Define exceptions.
class FilterError(Exception): pass
class InvalidCon... | unlicense |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.