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 |
|---|---|---|---|---|---|
Instagram/django | tests/modeltests/reserved_names/tests.py | 92 | 1671 | import datetime
from django.test import TestCase
from models import Thing
class ReservedNameTests(TestCase):
def generate(self):
day1 = datetime.date(2005, 1, 1)
t = Thing.objects.create(when='a', join='b', like='c', drop='d',
alter='e', having='f', where=day1, has_hyphen='h')
... | bsd-3-clause |
stephane-martin/salt-debian-packaging | salt-2016.3.2/salt/states/apache_module.py | 1 | 3640 | # -*- coding: utf-8 -*-
'''
Manage Apache Modules
.. versionadded:: 2014.7.0
Enable and disable apache modules.
.. code-block:: yaml
Enable cgi module:
apache_module.enabled:
- name: cgi
Disable cgi module:
apache_module.disabled:
- name: cgi
'''
from __future__ import absolute_... | apache-2.0 |
kajgan/stbgui | lib/python/Components/ConditionalWidget.py | 49 | 1710 | from GUIComponent import GUIComponent
from enigma import eTimer
class ConditionalWidget(GUIComponent):
def __init__(self, withTimer = True):
GUIComponent.__init__(self)
self.setConnect(None)
if (withTimer):
self.conditionCheckTimer = eTimer()
self.conditionCheckTimer.callback.append(self.update)
self... | gpl-2.0 |
iaksit/AB2017 | ticket/views.py | 2 | 2202 | from django.contrib.admin.views.decorators import staff_member_required
from django.contrib.auth.decorators import login_required
from django.http import HttpResponseRedirect
from django.shortcuts import render, get_object_or_404
from django.urls import reverse
from collectivework import settings
from ticket.forms imp... | gpl-3.0 |
chiviak/CouchPotatoServer | libs/suds/sax/date.py | 160 | 10456 | # This program is free software; you can redistribute it and/or modify
# it under the terms of the (LGPL) GNU Lesser General Public License as
# published by the Free Software Foundation; either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will ... | gpl-3.0 |
ashwyn/eden-message_parser | modules/ClimateDataPortal/DSL/Units.py | 53 | 11410 | # -*- coding: utf-8 -*-
import re
counted_dimension_pattern = re.compile(r"(?:\w[^\^\/ ]*)(?:\^[0-9])?")
class MeaninglessUnitsException(Exception):
pass
class DimensionError(Exception):
pass
class Units(object):
"""Used for dimensional and other analysis."""
__slots__ = ("_dimensions", "_positive")... | mit |
imprazaguy/bluetool | test/ts/TP_CON_MAS_BV-37-C.py | 1 | 3830 | # TP/CON/MAS/BV-37-C [Master Data Length Update - minimum Receive Data Channel
# PDU length and time]
#
# Verify that the IUT as Master correctly handles reception of an LL_LENGTH_REQ
# PDU
import bluetool
from bluetool.core import HCIDataTransCoordinator, HCIDataTransWorker, LEHelper
import bluetool.bluez as bluez
im... | mit |
harisibrahimkv/django | tests/postgres_tests/test_aggregates.py | 36 | 13844 | import json
from django.db.models.expressions import F, Value
from django.test.testcases import skipUnlessDBFeature
from django.test.utils import Approximate
from . import PostgreSQLTestCase
from .models import AggregateTestModel, StatTestModel
try:
from django.contrib.postgres.aggregates import (
ArrayA... | bsd-3-clause |
mayapurmedia/wagtail | wagtail/wagtailadmin/tests/test_userbar.py | 4 | 5151 | from django.test import TestCase
from django.test.client import RequestFactory
from django.core.urlresolvers import reverse
from django.template import Template, Context
from django.contrib.auth import get_user_model
from django.contrib.auth.models import AnonymousUser
from wagtail.tests.utils import WagtailTestUtils
... | bsd-3-clause |
arborh/tensorflow | tensorflow/python/data/kernel_tests/list_files_test.py | 4 | 8898 | # Copyright 2017 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 |
buguelos/odoo | openerp/addons/base/ir/ir_rule.py | 312 | 8048 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 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 |
jbradberry/django-turn-generation | sample_project/sample_app/plugins.py | 1 | 1455 | from django.contrib.contenttypes.models import ContentType
from . import models
class TurnGeneration(object):
realm_types = {
'testrealm': 'sample_app.testrealm',
}
agent_types = {
'testagent': 'sample_app.testagent',
}
permissions = {
'turngeneration.add_generator': '_i... | mit |
madflow/weblate | weblate/trans/tests/test_widgets.py | 11 | 3474 | # -*- coding: utf-8 -*-
#
# Copyright © 2012 - 2015 Michal Čihař <michal@cihar.com>
#
# This file is part of Weblate <http://weblate.org/>
#
# 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, eithe... | gpl-3.0 |
pawaranand/phr-frappe | frappe/modules/import_file.py | 28 | 3039 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import frappe, os, json
from frappe.modules import get_module_path, scrub_dt_dn
from frappe.utils import get_datetime_str
def import_files(module, dt=None, dn=None, force=Fal... | mit |
liddiard/skry | attachments/migrations/0001_initial.py | 1 | 3621 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django.core.validators
class Migration(migrations.Migration):
dependencies = [
('contenttypes', '0002_remove_content_type_name'),
('authors', '0001_initial'),
]
operations = [... | mit |
lsaffre/lino_book | lino_book/projects/team/settings/fixtures/demo.py | 1 | 14548 | # -*- coding: UTF-8 -*-
# Copyright 2015-2020 Rumma & Ko Ltd
# License: BSD (see file COPYING for details)
import datetime
from lino.api import rt, dd, _
from lino.utils import Cycler, i2d
from lino.core.roles import SiteAdmin
from lino_xl.lib.cal.choicelists import DurationUnits
from lino_xl.lib.working.roles impo... | agpl-3.0 |
Conan-Kudo/bodhi | bodhi/tests/server/consumers/test_automatic_updates.py | 2 | 18330 | # Copyright © 2019 Red Hat, Inc.
#
# This file is part of Bodhi.
#
# 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.
#
# T... | gpl-2.0 |
zvolsky/edga | languages/pl.py | 160 | 6719 | # coding: utf8
{
'!langcode!': 'pl',
'!langname!': 'Polska',
'"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"Uaktualnij" jest dodatkowym wyrażeniem postaci "pole1=\'nowawartość\'". Nie możesz uaktualnić lub usunąć wyników z JOIN:',
'%s %%{row} delete... | agpl-3.0 |
af1rst/bite-project | deps/mrtaskman/server/mapreduce/main.py | 27 | 3036 | #!/usr/bin/env python
#
# Copyright 2010 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 o... | apache-2.0 |
40223201/w16b_test | static/Brython3.1.3-20150514-095342/Lib/pydoc_data/topics.py | 694 | 385454 | # -*- coding: utf-8 -*-
# Autogenerated by Sphinx on Sat Mar 23 15:42:31 2013
topics = {'assert': '\nThe ``assert`` statement\n************************\n\nAssert statements are a convenient way to insert debugging assertions\ninto a program:\n\n assert_stmt ::= "assert" expression ["," expression]\n\nThe simple form,... | agpl-3.0 |
kumarkrishna/sympy | sympy/logic/algorithms/dpll.py | 58 | 9316 | """Implementation of DPLL algorithm
Further improvements: eliminate calls to pl_true, implement branching rules,
efficient unit propagation.
References:
- http://en.wikipedia.org/wiki/DPLL_algorithm
- http://bioinformatics.louisville.edu/ouyang/MingOuyangThesis.pdf
"""
from __future__ import print_function, divis... | bsd-3-clause |
agileblaze/OpenStackTwoFactorAuthentication | horizon/openstack_dashboard/test/integration_tests/tests/test_image_create_delete.py | 52 | 1470 | # 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
# d... | apache-2.0 |
GbalsaC/bitnamiP | docs/en_us/enrollment_api/source/conf.py | 62 | 2902 | # -*- coding: utf-8 -*-
# pylint: disable=invalid-name
# pylint: disable=redefined-builtin
# pylint: disable=protected-access
# pylint: disable=unused-argument
import os
from path import path
import sys
import mock
MOCK_MODULES = [
'ipware',
'ip',
'ipware.ip',
'get_ip',
'pygeoip',
'ipaddr',
... | agpl-3.0 |
rshorey/moxie | moxie/butterfield.py | 4 | 3490 | import os
import json
import asyncio
from butterfield.utils import at_bot
from moxie.facts import get_fact
from aiodocker import Docker
from aiocore import EventService
WEB_ROOT = os.environ.get("MOXIE_WEB_URL", "http://localhost:8888")
class LogService(EventService):
"""
Provide basic text logging using p... | mit |
vrutkovs/atomic-reactor | atomic_reactor/plugins/exit_koji_tag_build.py | 3 | 3493 | """
Copyright (c) 2017 Red Hat, Inc
All rights reserved.
This software may be modified and distributed under the terms
of the BSD license. See the LICENSE file for details.
"""
from __future__ import unicode_literals
from atomic_reactor.constants import PLUGIN_KOJI_TAG_BUILD_KEY
from atomic_reactor.koji_util import ... | bsd-3-clause |
yashodhank/erpnext | erpnext/setup/setup_wizard/setup_wizard.py | 3 | 18633 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe, copy
import os
import json
from frappe.utils import cstr, flt, getdate
from frappe import _
from frappe.utils.file_manager import save_f... | agpl-3.0 |
wikimedia/analytics-aggregator | aggregator/projectcounts.py | 1 | 34906 | # -*- 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 |
cccfran/sympy | sympy/liealgebras/type_d.py | 17 | 4768 | from sympy.core import Dict, Tuple
from sympy.sets import Set
from .cartan_type import Standard_Cartan
from sympy.matrices import eye
class TypeD(Standard_Cartan):
def __new__(cls, n):
if n < 3:
raise ValueError("n cannot be less than 3")
return Standard_Cartan.__new__(cls, "D", n)
... | bsd-3-clause |
raubana/NeverEndingDungeon | libs/TileSystem.py | 1 | 19615 | # ====== IMPORTS ======
# --- Pygame ---
import pygame
# --- Custom Modules ---
from common import copy_color, lerp_colors
# --- Misc. ---
import random, math
# ====== CONSTANTS ======
TILE_SIZE = 48 # The 2D size of a side of a single tile in pixels.
TILE_FLOOR_COLOR = (96,96,96)
TILE_GRASSTILE_COLOR = (100,165,7... | gpl-3.0 |
nzavagli/UnrealPy | UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/Python-2.7.10/Tools/pynche/StripViewer.py | 100 | 15465 | """Strip viewer and related widgets.
The classes in this file implement the StripViewer shown in the top two thirds
of the main Pynche window. It consists of three StripWidgets which display
the variations in red, green, and blue respectively of the currently selected
r/g/b color value.
Each StripWidget shows the co... | mit |
Desarrollo-CeSPI/meran | dev-plugins/node/lib/node_modules/npm/node_modules/node-gyp/legacy/tools/gyp/pylib/gyp/SCons.py | 42 | 5836 | # Copyright (c) 2011 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
SCons generator.
This contains class definitions and supporting functions for generating
pieces of SCons files for the different types of GYP targets.
"""
im... | gpl-3.0 |
tahoe/flask-restless | tests/test_processors.py | 9 | 18908 | """
tests.test_processors
~~~~~~~~~~~~~~~~~~~~~
Provides unit tests for pre- and post-processors hooks.
:copyright: 2013 Mike Klimin <klinkin@gmail.com>
:copyright: 2012, 2013, 2014, 2015 Jeffrey Finkelstein
<jeffrey.finkelstein@gmail.com> and contributors.
:license: GNU AGPLv3... | agpl-3.0 |
dr0pz0ne/sibble | lib/ansible/module_utils/api.py | 10 | 3198 | #
# (c) 2015 Brian Ccoa, <bcoca@ansible.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 later versio... | gpl-3.0 |
ddboline/pylearn2 | pylearn2/utils/timing.py | 49 | 2601 | """Utilities related to timing various segments of code."""
__authors__ = "David Warde-Farley"
__copyright__ = "Copyright 2010-2012, Universite de Montreal"
__credits__ = ["David Warde-Farley"]
__license__ = "3-clause BSD"
__maintainer__ = "David Warde-Farley"
__email__ = "wardefar@iro"
from contextlib import context... | bsd-3-clause |
CydarLtd/ansible | lib/ansible/modules/net_tools/dnsmadeeasy.py | 30 | 14042 | #!/usr/bin/python
# 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... | gpl-3.0 |
vFense/vFenseAgent-nix | agent/deps/rpm/Python-2.7.5/lib/python2.7/test/test_strop.py | 88 | 6374 | import warnings
warnings.filterwarnings("ignore", "strop functions are obsolete;",
DeprecationWarning,
r'test.test_strop|unittest')
import strop
import unittest
from test import test_support
class StropFunctionTestCase(unittest.TestCase):
def test_atoi(self):
... | lgpl-3.0 |
prisis/sublime-text-packages | Packages/SublimeCodeIntel/libs/_ielementtree.py | 8 | 1294 | import sys
import struct
VERSION = sys.version_info[:2]
PLATFORM = sys.platform
ARCH = 'x%d' % (struct.calcsize('P') * 8)
if VERSION >= (3, 3):
platform = None
try:
from _local_arch._ielementtree import *
platform = "Local arch"
except ImportError:
if PLATFORM == 'darwin':
... | mit |
john-parton/django-oscar | src/oscar/apps/catalogue/utils.py | 24 | 6072 | import os
import shutil
import tarfile
import tempfile
import zipfile
import zlib
from django.core.exceptions import FieldError
from django.core.files import File
from django.db.transaction import atomic
from django.utils.translation import ugettext_lazy as _
from PIL import Image
from oscar.apps.catalogue.exceptions... | bsd-3-clause |
mutirri/bokeh | sphinx/source/docs/tutorials/exercises/periodic.py | 23 | 3314 | from bokeh.plotting import figure, output_file, show
from bokeh.models import HoverTool, ColumnDataSource
from bokeh.sampledata import periodic_table
# categories need to be strings
elements = periodic_table.elements[periodic_table.elements['group'] != "-"]
# The categorical ranges need to be strings, so convert the ... | bsd-3-clause |
wscullin/spack | var/spack/repos/builtin/packages/lua-luaposix/package.py | 3 | 1714 | ##############################################################################
# Copyright (c) 2013-2017, 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 |
patilsangram/erpnext | erpnext/demo/setup/manufacture.py | 14 | 4071 | from __future__ import unicode_literals
import random, json
import frappe
from frappe.utils import nowdate, add_days
from erpnext.demo.setup.setup_data import import_json
from erpnext.demo.domains import data
from six import iteritems
def setup_data():
import_json("Asset Category")
setup_item()
setup_workstation(... | gpl-3.0 |
Stavitsky/neutron | neutron/db/migration/alembic_migrations/versions/3927f7f7c456_l3_extension_distributed_mode.py | 15 | 1731 | # Copyright 2014 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | apache-2.0 |
camptocamp/odoo | addons/account_anglo_saxon/invoice.py | 61 | 13374 | ##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C)
# 2004-2010 Tiny SPRL (<http://tiny.be>).
# 2009-2010 Veritos (http://veritos.nl).
# All Rights Reserved
#
# This program is free software: you can redistri... | agpl-3.0 |
shahbazn/neutron | neutron/agent/l3/dvr_snat_ns.py | 44 | 1778 | # 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
# d... | apache-2.0 |
ztultrebor/BARKEVIOUS | BARKEVIOUS.py | 1 | 1924 | # coding: utf-8
#read in libraries
import cPickle as pickle
from webcrawler import coredump
from dataloader import get_trawled_data, introduce_weighting
from ratings import PowerRater
from history import historical, model_the_model
from predict import predict
from oddsmaker import read_odds
from betting import wager
... | mit |
dzz007/photivo | scons-local-2.2.0/SCons/Tool/gettext.py | 14 | 2077 | """gettext tool
"""
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 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 re... | gpl-3.0 |
cernanalysispreservation/cap-client | cap_client/cli/metadata_cli.py | 1 | 2900 | # -*- coding: utf-8 -*-
#
# This file is part of CERN Analysis Preservation Framework.
# Copyright (C) 2020 CERN.
#
# CERN Analysis Preservation Framework 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... | gpl-2.0 |
hoangt/tpzsimul.gem5 | src/arch/arm/ArmSystem.py | 9 | 4808 | # Copyright (c) 2009, 2012-2013 ARM Limited
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implementation of the fun... | bsd-3-clause |
pratapvardhan/pandas | pandas/core/tools/numeric.py | 1 | 6034 | import numpy as np
import pandas as pd
from pandas.core.dtypes.common import (
is_scalar,
is_numeric_dtype,
is_decimal,
is_datetime_or_timedelta_dtype,
is_number,
_ensure_object)
from pandas.core.dtypes.generic import ABCSeries, ABCIndexClass
from pandas.core.dtypes.cast import maybe_downcast_to... | bsd-3-clause |
dmccue/ansible | lib/ansible/parsing/yaml/loader.py | 234 | 1877 | # (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 |
DimensionDataCBUSydney/plumbery | tests/test_engine.py | 2 | 31173 | #!/usr/bin/env python
"""
Tests for `plumbery` module.
"""
# special construct to allow relative import
#
if __name__ == "__main__" and __package__ is None:
__package__ = "tests"
from tests import dummy
import base64
import logging
import mock
import os
import unittest
import yaml
from crypto... | apache-2.0 |
CoolProp/CoolProp | wrappers/Python/CoolProp/Plots/PsychScript.py | 2 | 2020 |
# This file was auto-generated by the PsychChart.py script in wrappers/Python/CoolProp/Plots
if __name__ == '__main__':
import numpy, matplotlib
from CoolProp.HumidAirProp import HAPropsSI
from CoolProp.Plots.Plots import InlineLabel
p = 101325
Tdb = numpy.linspace(-10, 60, 100) + 273.15
# M... | mit |
CitoEngine/cito_engine | app/cito_engine/views/teams.py | 1 | 2915 | """Copyright 2014 Cyrus Dasadia
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
distr... | apache-2.0 |
tylercal/dragonfly | dragonfly/engines/backend_natlink/__init__.py | 1 | 2141 | #
# This file is part of Dragonfly.
# (c) Copyright 2007, 2008 by Christo Butcher
# Licensed under the LGPL.
#
# Dragonfly 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... | lgpl-3.0 |
Eigenlabs/EigenD | tools/packages/SCons/compat/_scons_sets.py | 28 | 19733 | """Classes to represent arbitrary sets (including sets of sets).
This module implements sets using dictionaries whose values are
ignored. The usual operations (union, intersection, deletion, etc.)
are provided as both methods and operators.
Important: sets are not sequences! While they support 'x in s',
'len(s)', a... | gpl-3.0 |
0jpq0/kbengine | kbe/src/lib/python/Lib/test/test_importlib/extension/test_finder.py | 81 | 1317 | from .. import abc
from .. import util as test_util
from . import util
machinery = test_util.import_importlib('importlib.machinery')
import unittest
import warnings
# XXX find_spec tests
class FinderTests(abc.FinderTests):
"""Test the finder for extension modules."""
def find_module(self, fullname):
... | lgpl-3.0 |
villaverde/iredadmin | tools/ira_tool_lib.py | 1 | 1823 | """Library used by other scripts under tools/ directory."""
# Author: Zhang Huangbin <zhb@iredmail.org>
import os
import sys
import logging
import web
debug = False
# Set True to print SQL queries.
web.config.debug = debug
os.environ['LC_ALL'] = 'C'
rootdir = os.path.abspath(os.path.dirname(__file__)) + '/../'
sy... | gpl-2.0 |
ddurieux/alignak | alignak/objects/escalation.py | 1 | 11934 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2015-2015: Alignak team, see AUTHORS.txt file for contributors
#
# This file is part of Alignak.
#
# Alignak 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 S... | agpl-3.0 |
masamichi/bite-project | deps/gdata-python-client/src/gdata/tlslite/utils/xmltools.py | 101 | 7380 | """Helper functions for XML.
This module has misc. helper functions for working with XML DOM nodes."""
from compat import *
import os
import re
if os.name == "java":
# Only for Jython
from javax.xml.parsers import *
import java
builder = DocumentBuilderFactory.newInstance().newDocumentBuilder()
... | apache-2.0 |
frederick-masterton/django | django/contrib/gis/tests/layermap/tests.py | 22 | 14357 | # coding: utf-8
from __future__ import unicode_literals
from copy import copy
from decimal import Decimal
import os
import unittest
from unittest import skipUnless
from django.contrib.gis.gdal import HAS_GDAL
from django.contrib.gis.tests.utils import HAS_SPATIAL_DB, mysql
from django.db import router
from django.con... | bsd-3-clause |
black-perl/ptop | ptop/core/plugin.py | 1 | 1653 | '''
ptop.core.plugin
This module define the BaseClass for plugin. It defines the basic rules that are to be followed by a new plugin.
'''
class Plugin(object):
'''
Base Plugin class
'''
def __init__(self,name,sensorType,interval):
'''creates an instance of the class
I... | mit |
Jgarcia-IAS/SAT | openerp/addons/marketing_campaign/report/__init__.py | 441 | 1071 | # -*- 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 |
ghchinoy/tensorflow | tensorflow/contrib/resampler/python/ops/resampler_ops.py | 18 | 2918 | # pylint: disable=g-bad-file-header
# Copyright 2017 The Sonnet 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 |
solomonvimal/pyras | pyras/controllers/hecras/hecrascontroller/ras41.py | 1 | 49672 | """
"""
import os
import os.path as osp
class Controller(object):
"""HECRAS Controller vesrsion RAS41"""
# %% Compute
def Compute_Cancel(self):
"""
"""
rc = self._rc
rc.Compute_Cancel()
def Compute_CurrentPlan(self):
"""
Computes the current plan.
... | mit |
chenc10/Spark-PAF | dist/examples/src/main/python/ml/cross_validator.py | 8 | 4328 | #
# 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 |
duyetdev/openerp-6.1.1 | openerp/addons/stock/report/picking.py | 9 | 1729 | # -*- 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 |
conjure-up/conjure-up | conjureup/controllers/juju/credentials/tui.py | 3 | 1332 | from conjureup import events, utils
from conjureup.app_config import app
from conjureup.consts import cloud_types
from . import common
class CredentialsController(common.BaseCredentialsController):
def render(self):
self.load_credentials()
if app.provider.cloud_type == cloud_types.LOCAL:
... | mit |
nirmeshk/oh-mainline | mysite/profile/migrations/0033_ditch_favoriting_for_projectexps.py | 17 | 5557 | # This file is part of OpenHatch.
# Copyright (C) 2009 OpenHatch, Inc.
#
# 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 option) any later v... | agpl-3.0 |
Sixshaman/networkx | networkx/algorithms/cluster.py | 6 | 10815 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2004-2016 by
# Aric Hagberg <hagberg@lanl.gov>
# Dan Schult <dschult@colgate.edu>
# Pieter Swart <swart@lanl.gov>
# All rights reserved.
# BSD license.
"""Algorithms to characterize the number of triangles in a graph."""
from __future__ import division
from i... | bsd-3-clause |
fxsjy/pybrain | pybrain/datasets/importance.py | 5 | 1811 | __author__ = 'Tom Schaul, tom@idsia.ch'
from scipy import ones, dot
from sequential import SequentialDataSet
from pybrain.utilities import fListToString
# CHECKME: does this provide for importance-datasets in the non-sequential case
# maybe there should be a second class - or another structure!
class ImportanceDa... | bsd-3-clause |
vincepandolfo/django | tests/gis_tests/geo3d/tests.py | 26 | 17237 | from __future__ import unicode_literals
import os
import re
from unittest import skipUnless
from django.contrib.gis.db.models import Extent3D, Union
from django.contrib.gis.db.models.functions import (
AsGeoJSON, AsKML, Length, Perimeter, Scale, Translate,
)
from django.contrib.gis.gdal import HAS_GDAL
from djang... | bsd-3-clause |
Antiun/bank-payment | account_banking_sepa_direct_debit/models/account_banking_mandate.py | 11 | 6872 | # -*- encoding: utf-8 -*-
##############################################################################
#
# SEPA Direct Debit module for OpenERP
# Copyright (C) 2013 Akretion (http://www.akretion.com)
# @author: Alexis de Lattre <alexis.delattre@akretion.com>
#
# This program is free software: you can redi... | agpl-3.0 |
xgaia/askomics | askomics/test/GalaxyConnector_test.py | 2 | 5304 | """
This file contain all test for the GalaxyConnector class.
This test need a Galaxy instance to be executed
"""
import os
import time
import unittest
from shutil import copyfile
from bioblend import galaxy
from pyramid.paster import get_appsettings
from pyramid import testing
from askomics.libaskomics.ParamManager ... | agpl-3.0 |
tchellomello/home-assistant | homeassistant/components/dyson/vacuum.py | 7 | 6607 | """Support for the Dyson 360 eye vacuum cleaner robot."""
import logging
from libpurecool.const import Dyson360EyeMode, PowerMode
from libpurecool.dyson_360_eye import Dyson360Eye
from homeassistant.components.vacuum import (
SUPPORT_BATTERY,
SUPPORT_FAN_SPEED,
SUPPORT_PAUSE,
SUPPORT_RETURN_HOME,
... | apache-2.0 |
pratikmallya/hue | desktop/core/ext-py/Paste-2.0.1/tests/test_util/test_datetimeutil.py | 47 | 6026 | # (c) 2005 Clark C. Evans and contributors
# This module is part of the Python Paste Project and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
# Some of this code was funded by: http://prometheusresearch.com
from time import localtime
from datetime import date
from paste.util.d... | apache-2.0 |
stu314159/pyNFC | pyNFC_Util.py | 1 | 2945 | # pyNFC_Util.py
"""
definition module for some pyNFC utility classes
"""
import numpy as np
class NFC_Halo_Data_Organizer(object):
"""
collect and organize how halo data will be organized prior to communication
"""
def __init__(self,ngb_rank):
"""
constructor
"""
s... | mit |
jfarcher/checkinapi | flask/lib/python2.7/site-packages/pip/vendor/html5lib/tokenizer.py | 1710 | 76929 | from __future__ import absolute_import, division, unicode_literals
try:
chr = unichr # flake8: noqa
except NameError:
pass
from collections import deque
from .constants import spaceCharacters
from .constants import entities
from .constants import asciiLetters, asciiUpper2Lower
from .constants import digits, ... | gpl-3.0 |
vwolfley/GrandCanyonCouncilBSA_Leaflet | node_modules/grunt-version-check/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/ordered_dict.py | 2354 | 10366 | # Unmodified from http://code.activestate.com/recipes/576693/
# other than to add MIT license header (as specified on page, but not in code).
# Linked from Python documentation here:
# http://docs.python.org/2/library/collections.html#collections.OrderedDict
#
# This should be deleted once Py2.7 is available on all bot... | mit |
40223202/2015cdb_g2 | static/Brython3.1.1-20150328-091302/Lib/unittest/test/test_loader.py | 738 | 49593 | import sys
import types
import unittest
class Test_TestLoader(unittest.TestCase):
### Tests for TestLoader.loadTestsFromTestCase
################################################################
# "Return a suite of all tests cases contained in the TestCase-derived
# class testCaseClass"
def te... | gpl-3.0 |
JJediny/python-social-auth | social/tests/backends/test_box.py | 80 | 2294 | import json
from social.tests.backends.oauth import OAuth2Test
class BoxOAuth2Test(OAuth2Test):
backend_path = 'social.backends.box.BoxOAuth2'
user_data_url = 'https://api.box.com/2.0/users/me'
expected_username = 'sean+awesome@box.com'
access_token_body = json.dumps({
'access_token': 'T9cE5a... | bsd-3-clause |
jlord/pagination-test | node_modules/browserify/node_modules/syntax-error/node_modules/esprima/tools/generate-unicode-regex.py | 260 | 4932 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# By Yusuke Suzuki <utatane.tea@gmail.com>
# Modified by Mathias Bynens <http://mathiasbynens.be/>
# http://code.google.com/p/esprima/issues/detail?id=110
import sys
import string
import re
class RegExpGenerator(object):
def __init__(self, detector):
self.detector = det... | bsd-3-clause |
aljohnso/Market_Dreams | Stock Class.py | 1 | 1179 | class Stock:
def __init__(self, Company_name):
""" the constructor for the TextModel class
all dictionaries are started at empty
the name is just for our own purposes, to keep things
organized
"""
self.Company_name = Company_name
... | mit |
ContinuumIO/numpy | numpy/random/__init__.py | 84 | 5492 | """
========================
Random Number Generation
========================
==================== =========================================================
Utility functions
==============================================================================
random Uniformly distributed values of a given sha... | bsd-3-clause |
xialin/cs4221 | hello/views.py | 1 | 6857 | from django.shortcuts import render, redirect
from django.conf import settings
import textwrap
from converter import convert_xml_to_json
from converter import update_primary_key_in_xml, merge_relationship_in_xml, validate_xml
import lxml.etree as etree
from django.http import HttpResponse
from django.views.generic.ba... | mit |
caseyrollins/osf.io | api_tests/search/serializers/test_serializers.py | 4 | 1986 | import pytest
from api.search.serializers import SearchSerializer
from api_tests import utils
from osf.models import RegistrationSchema
from osf_tests.factories import (
AuthUserFactory,
NodeFactory,
ProjectFactory,
)
from tests.utils import make_drf_request_with_version, mock_archive
from website.project.... | apache-2.0 |
whs/django | tests/auth_tests/models/custom_user.py | 39 | 3665 | from django.contrib.auth.models import (
AbstractBaseUser, AbstractUser, BaseUserManager, Group, Permission,
PermissionsMixin, UserManager,
)
from django.db import models
# The custom user uses email as the unique identifier, and requires
# that every user provide a date of birth. This lets us test
# changes ... | bsd-3-clause |
AlfiyaZi/nbviewer | nbviewer/cache.py | 9 | 4982 | #-----------------------------------------------------------------------------
# Copyright (C) 2013 The IPython Development Team
#
# Distributed under the terms of the BSD License. The full license is in
# the file COPYING, distributed as part of this software.
#-----------------------------------------------------... | bsd-3-clause |
xq262144/hue | desktop/core/ext-py/guppy-0.1.10/guppy/etc/cmd.py | 37 | 15014 | """A generic class to build line-oriented command interpreters.
Interpreters constructed with this class obey the following conventions:
1. End of file on input is processed as the command 'EOF'.
2. A command is parsed out of each line by collecting the prefix composed
of characters in the identchars member.
3. A ... | apache-2.0 |
mtils/ems | ems/qt4/gui/itemdelegate/multiroledelegate.py | 1 | 1523 |
from PyQt4.QtCore import QRect, Qt, QLine
from PyQt4.QtGui import QStyledItemDelegate, QStyleOptionViewItemV4
from PyQt4.QtGui import qApp, QStyle, QPen, QColor
class MultiRoleDelegate(QStyledItemDelegate):
def __init__(self, *args, **kwargs):
super(MultiRoleDelegate, self).__init__(*args, **kwargs)
... | mit |
bbc/kamaelia | Sketches/AM/KPIFramework/KPI/Client/Decryptor.py | 3 | 3293 | # -*- coding: utf-8 -*-
# Copyright 2010 British Broadcasting Corporation and Kamaelia Contributors(1)
#
# (1) Kamaelia Contributors are listed in the AUTHORS file and at
# http://www.kamaelia.org/AUTHORS - please extend this file,
# not this notice.
#
# Licensed under the Apache License, Version 2.0 (th... | apache-2.0 |
sgnn7/sgfc | io_dev/sgfc_io/devices/pic18f45k50/hk_usb_io.py | 1 | 8392 | #!/usr/bin/python
import sys
import time
import usb.core
import usb.util
from array import array
# Markham Thomas 2015
# This version is under heavy development
# You can add your test code to the bottom
# below the === end of module statement, or
# externally call the module
#
# ---- This version adds a python cla... | lgpl-2.1 |
Alignak-monitoring-contrib/alignak-module-logs | alignak_module_logs/logs.py | 2 | 26149 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2015-2048: Alignak contrib team, see AUTHORS.txt file for contributors
#
# This file is part of Alignak contrib projet.
#
# Alignak 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 S... | agpl-3.0 |
convexopt/gpkit | gpkit/tests/t_examples.py | 1 | 6270 | """Unit testing of tests in docs/source/examples"""
import unittest
import os
import numpy as np
from gpkit import settings
from gpkit.tests.helpers import generate_example_tests
from gpkit.small_scripts import mag
from gpkit.small_classes import Quantity
def assert_logtol(first, second, logtol=1e-6):
"Asserts t... | mit |
seanli9jan/tensorflow | tensorflow/python/profiler/tfprof_logger_test.py | 48 | 2977 | # 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 |
hforge/Localizer | zgettext.py | 1 | 8628 | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
# Copyright (C) 2001 Andrés Marzal Varo
# Copyright (C) 2001-2002 J. David Ibáñez <jdavid@itaapy.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 Foundati... | gpl-3.0 |
michaelkuty/django-cacheback | cacheback/decorators.py | 5 | 1455 | from functools import wraps
from django.utils.decorators import available_attrs
from cacheback.function import FunctionJob
def cacheback(lifetime=None, fetch_on_miss=None, job_class=None,
task_options=None, **job_class_kwargs):
"""
Decorate function to cache its return value.
:lifetime: H... | mit |
shivamMg/toy-task | toytask/toytask/views.py | 1 | 3161 | import json
import os
import random
import cv2
from django.shortcuts import render, HttpResponseRedirect
from django.core.urlresolvers import reverse
from django.views.decorators.csrf import csrf_exempt
from toytask.settings import MEDIA_ROOT
from . import modules
from .forms import UploadImageForm
def imagepath(im... | mit |
liffiton/ATLeS | src/analysis/plot.py | 1 | 11295 | import math
import re
import matplotlib
import matplotlib.pyplot as plt
from matplotlib import collections, lines, patches
from analysis import heatmaps
import config
# Source: https://gist.github.com/jasonmc/1160951
def _set_foregroundcolor(ax, color):
'''For the specified axes, sets the color of the frame, m... | mit |
zhang-alex/bash-modules | en/Lib/encodings/cp1257.py | 593 | 13630 | """ Python Character Mapping Codec cp1257 generated from 'MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1257.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... | mit |
rowhit/h2o-2 | py/testdir_single_jvm/test_GLM2_princeton.py | 9 | 1776 | import unittest, time, sys
sys.path.extend(['.','..','../..','py'])
import h2o, h2o_cmd, h2o_glm, h2o_util, h2o_import as h2i
class Basic(unittest.TestCase):
def tearDown(self):
h2o.check_sandbox_for_errors()
@classmethod
def setUpClass(cls):
h2o.init(1)
global SYNDATASETS_DIR
... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.