repo_name stringlengths 5 100 | path stringlengths 4 375 | copies stringclasses 991
values | size stringlengths 4 7 | content stringlengths 666 1M | license stringclasses 15
values |
|---|---|---|---|---|---|
yl565/statsmodels | statsmodels/tsa/statespace/tests/results/results_structural.py | 7 | 7399 | """
Results for SARIMAX tests
Results from R, KFAS library using script `test_ucm.R`.
See also Stata time series documentation.
Author: Chad Fulton
License: Simplified-BSD
"""
from numpy import pi
irregular = {
'models': [
{'irregular': True},
{'level': 'irregular'},
{'level': 'ntrend'},
... | bsd-3-clause |
rickhurst/Django-non-rel-blog | django/contrib/localflavor/ar/forms.py | 309 | 3903 | # -*- coding: utf-8 -*-
"""
AR-specific Form helpers.
"""
from django.forms import ValidationError
from django.core.validators import EMPTY_VALUES
from django.forms.fields import RegexField, CharField, Select
from django.utils.encoding import smart_unicode
from django.utils.translation import ugettext_lazy as _
class... | bsd-3-clause |
Mistobaan/tensorflow | tensorflow/contrib/learn/python/learn/datasets/load_csv_test.py | 137 | 1348 | # 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 |
sid-kap/pants | src/python/pants/console/stty_utils.py | 30 | 1090 | # coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import subprocess
fr... | apache-2.0 |
vgrem/Office365-REST-Python-Client | office365/directory/objectIdentity.py | 1 | 1662 | from office365.runtime.client_value import ClientValue
class ObjectIdentity(ClientValue):
"""
Represents an identity used to sign in to a user account.
"""
def __init__(self, signInType=None, issuer=None, issuerAssignedId=None):
"""
:param str signInType: Specifies the user sign-in t... | mit |
caot/intellij-community | python/lib/Lib/site-packages/django/contrib/gis/geos/prototypes/threadsafe.py | 110 | 2802 | import threading
from django.contrib.gis.geos.libgeos import lgeos, notice_h, error_h, CONTEXT_PTR
class GEOSContextHandle(object):
"""
Python object representing a GEOS context handle.
"""
def __init__(self):
# Initializing the context handler for this thread with
# the notice and erro... | apache-2.0 |
TheWardoctor/Wardoctors-repo | script.module.exodus/lib/resources/lib/sources/pl/cdahd.py | 5 | 6682 | # -*- coding: utf-8 -*-
'''
Exodus Add-on
Copyright (C) 2017 homik
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any la... | apache-2.0 |
sirchia/CouchPotatoServer | couchpotato/core/providers/nzb/moovee/main.py | 2 | 2468 | from couchpotato.core.event import fireEvent
from couchpotato.core.helpers.encoding import tryUrlencode
from couchpotato.core.logger import CPLog
from couchpotato.core.providers.nzb.base import NZBProvider
from dateutil.parser import parse
import re
import time
log = CPLog(__name__)
class Moovee(NZBProvider):
u... | gpl-3.0 |
aisipos/django | tests/postgres_tests/test_ranges.py | 15 | 25276 | import datetime
import json
from django import forms
from django.core import exceptions, serializers
from django.db.models import F
from django.test import override_settings
from django.utils import timezone
from . import PostgreSQLTestCase
from .models import RangeLookupsModel, RangesModel
try:
from psycopg2.ex... | bsd-3-clause |
titanxxh/xengt-ha-kernel | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/SchedGui.py | 12980 | 5411 | # SchedGui.py - Python extension for perf script, basic GUI code for
# traces drawing and overview.
#
# Copyright (C) 2010 by Frederic Weisbecker <fweisbec@gmail.com>
#
# This software is distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Free Software
# Foundation.
... | gpl-2.0 |
wd5/jangr | django/contrib/admin/actions.py | 160 | 3285 | """
Built-in, globally-available admin actions.
"""
from django import template
from django.core.exceptions import PermissionDenied
from django.contrib.admin import helpers
from django.contrib.admin.util import get_deleted_objects, model_ngettext
from django.db import router
from django.shortcuts import render_to_resp... | bsd-3-clause |
arborh/tensorflow | tensorflow/python/data/experimental/kernel_tests/map_defun_op_test.py | 5 | 12858 | # 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 |
aimejeux/enigma2 | lib/python/Screens/ParentalControlSetup.py | 4 | 14940 | from Screens.Screen import Screen
from Components.ConfigList import ConfigListScreen
from Components.ActionMap import NumberActionMap
from Components.config import config, getConfigListEntry, ConfigNothing, NoSave, ConfigPIN
from Components.ParentalControlList import ParentalControlEntryComponent, ParentalControlList
... | gpl-2.0 |
apanju/odoo | addons/purchase_requisition/wizard/purchase_requisition_partner.py | 373 | 2320 | # -*- 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 |
batermj/algorithm-challenger | code-analysis/programming_anguage/python/source_codes/Python3.5.9/Python-3.5.9/Lib/unittest/test/test_assertions.py | 4 | 17021 | import datetime
import warnings
import weakref
import unittest
from itertools import product
class Test_Assertions(unittest.TestCase):
def test_AlmostEqual(self):
self.assertAlmostEqual(1.00000001, 1.0)
self.assertNotAlmostEqual(1.0000001, 1.0)
self.assertRaises(self.failureException,
... | apache-2.0 |
moreati/django | tests/model_formsets_regress/tests.py | 173 | 20725 | from __future__ import unicode_literals
from django import forms
from django.forms.formsets import DELETION_FIELD_NAME, BaseFormSet
from django.forms.models import (
BaseModelFormSet, inlineformset_factory, modelform_factory,
modelformset_factory,
)
from django.forms.utils import ErrorDict, ErrorList
from djan... | bsd-3-clause |
ahmetabdi/SickRage | lib/sqlalchemy/event/api.py | 75 | 3844 | # event/api.py
# Copyright (C) 2005-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
"""Public API functions for the event system.
"""
from __future__ import absolute_import... | gpl-3.0 |
sophacles/invoke | tests/parser/context.py | 2 | 11893 | import copy
from spec import Spec, eq_, skip, ok_, raises
from invoke.parser import Argument, Context
from invoke.tasks import task
from invoke.collection import Collection
class Context_(Spec):
"ParserContext" # meh
def may_have_a_name(self):
c = Context(name='taskname')
eq_(c.name, 'taskna... | bsd-2-clause |
Insanityandme/dotfiles | vim/bundle/ultisnips/test/test_Completion.py | 29 | 1299 | from test.vim_test_case import VimTestCase as _VimTest
from test.constant import *
# Tab Completion of Words {{{#
class Completion_SimpleExample_ECR(_VimTest):
snippets = ('test', '$1 ${1:blah}')
keys = 'superkallifragilistik\ntest' + EX + 'sup' + COMPL_KW + \
COMPL_ACCEPT + ' some more'
wanted ... | unlicense |
rgerkin/neuroConstruct | lib/jython/Lib/UserList.py | 327 | 3644 | """A more or less complete user-defined wrapper around list objects."""
import collections
class UserList(collections.MutableSequence):
def __init__(self, initlist=None):
self.data = []
if initlist is not None:
# XXX should this accept an arbitrary sequence?
if type(initlis... | gpl-2.0 |
dou800/php-buildpack-legacy | builds/runtimes/python-2.7.6/lib/python2.7/email/test/test_email_codecs_renamed.py | 298 | 2842 | # Copyright (C) 2002-2006 Python Software Foundation
# Contact: email-sig@python.org
# email package unit tests for (optional) Asian codecs
import unittest
from test.test_support import run_unittest
from email.test.test_email import TestEmailBase
from email.charset import Charset
from email.header import Header, deco... | mit |
Mappy/luigi | luigi/parameter.py | 1 | 16451 | # Copyright (c) 2012 Spotify AB
#
# 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, s... | apache-2.0 |
SoftwareKing/zstack-utility | zstacklib/zstacklib/test/test_thread.py | 3 | 1078 | '''
@author: frank
'''
import unittest
import time
import threading
from ..utils.thread import ThreadFacade
from ..utils.thread import AsyncThread
class TestThreadFacade(unittest.TestCase):
def _do(self, name, value=None):
self.ok = name
self.value = value;
def test_ru... | apache-2.0 |
ONSdigital/eq-survey-runner | app/views/static.py | 1 | 2777 | from flask import Blueprint, current_app, request, session as cookie_session
from flask_themes2 import render_theme_template
from structlog import get_logger
from app.globals import get_session_store
from app.utilities.schema import load_schema_from_session_data
from app.utilities.cookies import analytics_allowed
log... | mit |
alfredgamulo/cloud-custodian | tests/test_notify.py | 2 | 9902 | # Copyright The Cloud Custodian Authors.
# SPDX-License-Identifier: Apache-2.0
from .common import BaseTest, functional
import base64
import os
import json
import time
import tempfile
import zlib
from c7n.exceptions import PolicyValidationError
class NotifyTest(BaseTest):
@functional
def test_notify_addres... | apache-2.0 |
portnov/sverchok | nodes/modifier_make/polygons_adaptative.py | 3 | 5472 | # ##### BEGIN GPL LICENSE BLOCK #####
#
# 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.
#
# This program is distrib... | gpl-3.0 |
sanjeevtripurari/hue | desktop/core/ext-py/pyasn1-0.1.8/test/type/test_constraint.py | 53 | 8746 | from pyasn1.type import constraint, error
from pyasn1.error import PyAsn1Error
from sys import version_info
if version_info[0:2] < (2, 7) or \
version_info[0:2] in ( (3, 0), (3, 1) ):
try:
import unittest2 as unittest
except ImportError:
import unittest
else:
import unittest
class Single... | apache-2.0 |
UOMx/edx-platform | common/lib/xmodule/xmodule/poll_module.py | 146 | 7498 | """Poll module is ungraded xmodule used by students to
to do set of polls.
On the client side we show:
If student does not yet anwered - Question with set of choices.
If student have answered - Question with statistics for each answers.
"""
import cgi
import json
import logging
from copy import deepcopy
from collecti... | agpl-3.0 |
2014c2g2/2015cdag2_test | static/Brython3.1.1-20150328-091302/Lib/logging/__init__.py | 733 | 66279 | # Copyright 2001-2013 by Vinay Sajip. All Rights Reserved.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose and without fee is hereby granted,
# provided that the above copyright notice appear in all copies and that
# both that copyright notice and this permissio... | gpl-3.0 |
nalyd88/Algorithms | DP/LogCutting/LogCutting.py | 1 | 2100 | # Practicing Dynamic Programming (DP) with the log cutting problem given on the practice midterm.
import numpy as np
################################################################################
# Slow Algorithm
################################################################################
def cut_log... | mit |
blublud/networkx | networkx/algorithms/components/tests/test_semiconnected.py | 64 | 1901 | from itertools import chain
import networkx as nx
from nose.tools import *
class TestIsSemiconnected(object):
def test_undirected(self):
assert_raises(nx.NetworkXNotImplemented, nx.is_semiconnected,
nx.Graph())
assert_raises(nx.NetworkXNotImplemented, nx.is_semiconnected,
... | bsd-3-clause |
psyhofreak/ft-engine | scripts/sql.bench.summary.py | 16 | 2076 | #!/usr/bin/env python
# summarize the sql-bench trace file
import sys
import re
import os.path
class testreports:
def __init__(self):
self.reports = []
def append(self, report):
self.reports.append(report)
def duration(self, start, stop):
t0 = os.popen('date -d"' + start + '" +%... | gpl-2.0 |
konstruktoid/ansible-upstream | lib/ansible/plugins/terminal/enos.py | 101 | 2824 | # (C) 2017 Red Hat Inc.
# Copyright (C) 2017 Lenovo.
#
# GNU General Public License v3.0+
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for ... | gpl-3.0 |
shinpeimuraoka/ryu | ryu/tests/unit/ofproto/test_parser_v13.py | 27 | 4999 | # Copyright (C) 2014 Nippon Telegraph and Telephone 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 appli... | apache-2.0 |
guoci/python3-xlib-trunk | Xlib/ext/record.py | 1 | 9344 | # Xlib.ext.record -- RECORD extension module
#
# Copyright (C) 2006 Alex Badea <vamposdecampos@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 Foundation; either version 2 of the Li... | gpl-2.0 |
yuifan/pexus4_external_chromium-trace | trace-viewer/third_party/pywebsocket/src/mod_pywebsocket/extensions.py | 29 | 23947 | # Copyright 2012, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... | bsd-3-clause |
rapyuta/autobahn_rce | examples/websocket/echo_site_tls/server.py | 26 | 2260 | ###############################################################################
##
## Copyright 2011,2012 Tavendo GmbH
##
## 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:... | apache-2.0 |
Lujeni/ansible | test/units/modules/network/fortios/test_fortios_router_ospf.py | 21 | 12710 | # Copyright 2019 Fortinet, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the... | gpl-3.0 |
Bismarrck/tensorflow | tensorflow/python/util/function_utils_test.py | 21 | 9293 | # 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 |
InverseLina/tornado | tornado/platform/twisted.py | 58 | 21688 | # Author: Ovidiu Predescu
# Date: July 2011
#
# 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 ... | apache-2.0 |
peterlada/backend | docs/conf.py | 1 | 8265 | # -*- coding: utf-8 -*-
#
# backend documentation build configuration file, created by
# sphinx-quickstart on Tue Jun 25 13:03:08 2013.
#
# 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
# autogenerated file.
#
# All... | mit |
paterson/servo | tests/wpt/css-tests/tools/pywebsocket/src/mod_pywebsocket/_stream_base.py | 652 | 5978 | # Copyright 2011, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... | mpl-2.0 |
TheNaterz/koadic | core/loader.py | 1 | 1886 | import os
import sys
import inspect
import core.plugin
def load_plugins(dir, instantiate = False, shell = None):
plugins = {}
for root, dirs, files in os.walk(dir):
sys.path.append(root)
# make forward slashes on windows
module_root = root.replace(dir, "").replace("\\", "/")
... | apache-2.0 |
arnavd96/Cinemiezer | myvenv/lib/python3.4/site-packages/django/views/csrf.py | 70 | 5732 | from django.conf import settings
from django.http import HttpResponseForbidden
from django.template import Context, Engine, TemplateDoesNotExist, loader
from django.utils.translation import ugettext as _
from django.utils.version import get_docs_version
# We include the template inline since we need to be able to reli... | mit |
wahuneke/django-stripe-payments | payments/tests/test_email.py | 2 | 1329 | # pylint: disable=C0301
import decimal
from django.core import mail
from django.test import TestCase
from mock import patch
from ..models import Customer
from ..utils import get_user_model
class EmailReceiptTest(TestCase):
def setUp(self):
User = get_user_model()
self.user = User.objects.creat... | bsd-3-clause |
nzlosh/st2 | st2auth/st2auth/backends/__init__.py | 3 | 1958 | # Copyright 2020 The StackStorm Authors.
# Copyright 2019 Extreme Networks, 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 ... | apache-2.0 |
ecino/compassion-modules | child_compassion/wizards/project_description.py | 3 | 6938 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2016 Compassion CH (http://www.compassion.ch)
# Releasing children from poverty in Jesus' name
# @author: Emanuel Cino <ecino@compassion.ch>
#
# The licence is in the file __manifest__.py... | agpl-3.0 |
akintoey/django | tests/utils_tests/test_autoreload.py | 191 | 7073 | import os
import shutil
import tempfile
from importlib import import_module
from django import conf
from django.contrib import admin
from django.test import SimpleTestCase, override_settings
from django.test.utils import extend_sys_path
from django.utils import autoreload
from django.utils._os import npath
LOCALE_PAT... | bsd-3-clause |
dudonwai/dudonsblog | Lib/encodings/punycode.py | 586 | 6813 | # -*- coding: iso-8859-1 -*-
""" Codec for the Punicode encoding, as specified in RFC 3492
Written by Martin v. Löwis.
"""
import codecs
##################### Encoding #####################################
def segregate(str):
"""3.1 Basic code point segregation"""
base = []
extended = {}
for c in st... | mit |
etherkit/OpenBeacon2 | client/win/venv/Lib/site-packages/pip/_vendor/lockfile/symlinklockfile.py | 536 | 2616 | from __future__ import absolute_import
import os
import time
from . import (LockBase, NotLocked, NotMyLock, LockTimeout,
AlreadyLocked)
class SymlinkLockFile(LockBase):
"""Lock access to a file using symlink(2)."""
def __init__(self, path, threaded=True, timeout=None):
# super(Symlin... | gpl-3.0 |
lizardsystem/flooding | flooding_base/static/weblib/OpenLayers-2.12-rc7/tools/oldot.py | 295 | 1359 | import re
import os
def run():
sourceDirectory = "../lib/OpenLayers"
allFiles = []
SUFFIX_JAVASCRIPT = ".js"
## Find all the Javascript source files
for root, dirs, files in os.walk(sourceDirectory):
for filename in files:
if filename.endswith(SUFFIX_JAVASCRIPT) and not f... | gpl-3.0 |
pkess/beets | test/test_the.py | 10 | 2781 | # -*- coding: utf-8 -*-
"""Tests for the 'the' plugin"""
from __future__ import division, absolute_import, print_function
import unittest
from test import _common
from beets import config
from beetsplug.the import ThePlugin, PATTERN_A, PATTERN_THE, FORMAT
class ThePluginTest(_common.TestCase):
def test_unthe_... | mit |
jvkops/django | tests/generic_views/models.py | 382 | 1631 | from django.core.urlresolvers import reverse
from django.db import models
from django.db.models import QuerySet
from django.db.models.manager import BaseManager
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class Artist(models.Model):
name = models.CharField(max_length... | bsd-3-clause |
tysonholub/twilio-python | twilio/rest/sync/v1/service/sync_list/sync_list_item.py | 1 | 20321 | # coding=utf-8
r"""
This code was generated by
\ / _ _ _| _ _
| (_)\/(_)(_|\/| |(/_ v1.0.0
/ /
"""
from twilio.base import deserialize
from twilio.base import serialize
from twilio.base import values
from twilio.base.instance_context import InstanceContext
from twilio.base.instance_resource import... | mit |
rht/zulip | zerver/webhooks/freshdesk/view.py | 1 | 6058 | """Webhooks for external integrations."""
import logging
from typing import Any, Dict, List
from django.http import HttpRequest, HttpResponse
from django.utils.translation import ugettext as _
from zerver.decorator import authenticated_rest_api_view
from zerver.lib.email_notifications import convert_html_to_markdown
... | apache-2.0 |
hlange/LogSoCR | pysc/usi/systemc.py | 1 | 1548 | from __future__ import print_function
import logging
import usi.api.systemc as api
# Renaming time constants for easy reuse
FS = api.SC_FS
PS = api.SC_PS
NS = api.SC_NS
US = api.SC_US
MS = api.SC_MS
SEC = api.SC_SEC
"""Time constants units"""
TIME_UNITS = {
FS:"fs",
PS:"ps",
NS:"ns",
US:"us",
MS:"... | agpl-3.0 |
waytai/odoo | addons/hr_timesheet_invoice/report/__init__.py | 433 | 1136 | # -*- 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 |
asidev/aybu-manager | aybu/manager/activity_log/packages.py | 1 | 2606 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Copyright 2010-2012 Asidev s.r.l.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required b... | apache-2.0 |
brchiu/tensorflow | tensorflow/python/saved_model/tag_constants.py | 10 | 1881 | # 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 |
Thhhza/XlsxWriter | xlsxwriter/test/comparison/test_chart_font01.py | 8 | 1851 | ###############################################################################
#
# Tests for XlsxWriter.
#
# Copyright (c), 2013-2015, John McNamara, jmcnamara@cpan.org
#
from ..excel_comparsion_test import ExcelComparisonTest
from ...workbook import Workbook
class TestCompareXLSXFiles(ExcelComparisonTest):
"""... | bsd-2-clause |
ahmed-mahran/hue | desktop/core/ext-py/Django-1.6.10/tests/template_tests/test_smartif.py | 150 | 2190 | from django.template.smartif import IfParser
from django.utils import unittest
class SmartIfTests(unittest.TestCase):
def assertCalcEqual(self, expected, tokens):
self.assertEqual(expected, IfParser(tokens).parse().eval({}))
# We only test things here that are difficult to test elsewhere
# Many o... | apache-2.0 |
jeffreyliu3230/osf.io | tasks.py | 9 | 23940 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Invoke tasks. To run a task, run ``$ invoke <COMMAND>``. To see a list of
commands, run ``$ invoke --list``.
"""
import os
import sys
import code
import platform
import subprocess
import logging
from invoke import task, run
from website import settings
logging.getLogg... | apache-2.0 |
timeartist/ufyr | ufyr/metadata.py | 1 | 2664 | from redis import StrictRedis
class MetadataBase(object):
def __init__(self, key_base=None, **kwargs):
self.r = StrictRedis(**kwargs)
self.key_base = key_base or 'ufyr:%s' ##Should probably be subclassed
self._get_meta_key = lambda x: self.key_base%x
self._error_key = self... | unlicense |
ghandiosm/Test | addons/mail/models/mail_template.py | 13 | 26916 | # -*- coding: utf-8 -*-
import base64
import datetime
import dateutil.relativedelta as relativedelta
import logging
import lxml
import urlparse
import openerp
from urllib import urlencode, quote as quote
from openerp import _, api, fields, models, SUPERUSER_ID
from openerp import tools
from openerp import report as o... | gpl-3.0 |
itjp/w2p_js_separation | languages/sk.py | 161 | 6877 | # coding: utf8
{
'!langcode!': 'sk',
'!langname!': 'Slovenský',
'"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"update" je voliteľný výraz ako "field1=\'newvalue\'". Nemôžete upravovať alebo zmazať výsledky JOINu',
'%s %%{row} deleted': '%s zmazaných... | lgpl-3.0 |
google-research/dice_rl | estimators/tabular_bayes_dice.py | 1 | 10379 | # Copyright 2020 Google 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 in writing, ... | apache-2.0 |
Diegojnb/JdeRobot | src/drivers/MAVLinkServer/MAVProxy/modules/lib/mavmemlog.py | 8 | 3580 | '''in-memory mavlink log'''
from pymavlink import mavutil
class mavmemlog(mavutil.mavfile):
'''a MAVLink log in memory. This allows loading a log into
memory to make it easier to do multiple sweeps over a log'''
def __init__(self, mav, progress_callback=None):
mavutil.mavfile.__init__(self, None, ... | gpl-3.0 |
Yukarumya/Yukarum-Redfoxes | media/webrtc/trunk/tools/gyp/test/win/gyptest-link-enable-winrt-app-revision.py | 41 | 1180 | #!/usr/bin/env python
# Copyright (c) 2013 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.
"""
Make sure msvs_application_type_revision works correctly.
"""
import TestGyp
import os
import sys
import struct
CHDIR = 'winrt-app-ty... | mpl-2.0 |
joram/sickbeard-orange | lib/hachoir_parser/network/tcpdump.py | 90 | 16398 | """
Tcpdump parser
Source:
* libpcap source code (file savefile.c)
* RFC 791 (IPv4)
* RFC 792 (ICMP)
* RFC 793 (TCP)
* RFC 1122 (Requirements for Internet Hosts)
Author: Victor Stinner
Creation: 23 march 2006
"""
from lib.hachoir_parser import Parser
from lib.hachoir_core.field import (FieldSet, ParserError,
... | gpl-3.0 |
TiagoBras/svg2code | svg2code/svg_parser.py | 1 | 16075 | # -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function
import re
import xml.etree.ElementTree as ElementTree
from svg2code.svg_colors import SVG_COLORS
from svg2code.helpers import parseSVGNumber as parseNumber
from os import path
class RGBAColor(object):
"""rgba color format: [0... | mit |
int19h/PTVS | Python/Product/Miniconda/Miniconda3-x64/Lib/encodings/mac_romanian.py | 272 | 13661 | """ Python Character Mapping Codec mac_romanian generated from 'MAPPINGS/VENDORS/APPLE/ROMANIAN.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,inp... | apache-2.0 |
nikolas/lettuce | tests/integration/lib/Django-1.2.5/django/contrib/formtools/utils.py | 64 | 1261 | try:
import cPickle as pickle
except ImportError:
import pickle
from django.conf import settings
from django.utils.hashcompat import md5_constructor
from django.forms import BooleanField
def security_hash(request, form, *args):
"""
Calculates a security hash for the given Form instance.
This crea... | gpl-3.0 |
dlazz/ansible | lib/ansible/modules/cloud/vmware/vmware_host_powermgmt_policy.py | 43 | 8768 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2018, Christian Kotte <christian.kotte@gmx.de>
#
# 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 = {
'met... | gpl-3.0 |
ansible/ansible | examples/scripts/my_test_info.py | 29 | 3120 | #!/usr/bin/python
# Copyright: (c) 2020, Your Name <YourName@example.org>
# 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
DOCUMENTATION = r'''
---
module: my_test_info
short_descriptio... | gpl-3.0 |
GiggleLiu/nrg_mapping | nrgmap/discmodel.py | 1 | 5812 | '''
The Discretized model, or the sun model.
'''
from numpy import *
from scipy import sparse as sps
import pdb
__all__=['DiscModel','load_discmodel']
class DiscModel(object):
'''
Discrete model class.
Construct:
DiscModel((Elist_neg,Elist_pos),(Tlist_neg,Tlist_pos),z=1.)
z could be one... | mit |
salomon1184/bite-project | server/models/compat/run_tester_map.py | 17 | 3398 | # Copyright 2010 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | apache-2.0 |
cleverhans-lab/cleverhans | cleverhans/experimental/certification/tests/dual_formulation_test.py | 2 | 8080 | """Tests for cleverhans.experimental.certification.dual_formulation."""
# pylint: disable=missing-docstring
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import unittest
import numpy as np
import tensorflow as tf
from cleverhans.experimental.certificatio... | mit |
kntem/webdeposit | modules/webjournal/lib/webjournal_unit_tests.py | 2 | 2782 | # -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2009, 2010, 2011 CERN.
##
## Invenio is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## published by the Free Software Foundation; either version 2 of the
## License, or (at yo... | gpl-2.0 |
epandurski/django | tests/template_tests/test_engine.py | 199 | 3971 | import os
from django.template import Context
from django.template.engine import Engine
from django.test import SimpleTestCase, ignore_warnings
from django.utils.deprecation import RemovedInDjango110Warning
from .utils import ROOT, TEMPLATE_DIR
OTHER_DIR = os.path.join(ROOT, 'other_templates')
@ignore_warnings(cat... | bsd-3-clause |
eventql/eventql | deps/3rdparty/spidermonkey/mozjs/python/pyasn1/test/codec/cer/test_decoder.py | 51 | 1126 | from pyasn1.type import univ
from pyasn1.codec.cer import decoder
from pyasn1.compat.octets import ints2octs, str2octs, null
from pyasn1.error import PyAsn1Error
from sys import version_info
if version_info[0:2] < (2, 7) or \
version_info[0:2] in ( (3, 0), (3, 1) ):
try:
import unittest2 as unittest
... | agpl-3.0 |
wweiradio/django | tests/many_to_one_null/tests.py | 142 | 6484 | from __future__ import unicode_literals
from django.test import TestCase
from .models import Article, Car, Driver, Reporter
class ManyToOneNullTests(TestCase):
def setUp(self):
# Create a Reporter.
self.r = Reporter(name='John Smith')
self.r.save()
# Create an Article.
se... | bsd-3-clause |
JonasThomas/free-cad | src/Mod/Cam/InitGui.py | 1 | 2807 | # Cam gui init module
# (c) 2003 Juergen Riegel
#
# Gathering all the information to start FreeCAD
# This is the second one of three init scripts, the third one
# runs when the gui is up
#***************************************************************************
#* (c) Juergen Riegel (juergen.riegel@web.d... | lgpl-2.1 |
easyfmxu/zulip | zerver/templatetags/app_filters.py | 125 | 1391 | from django.template import Library
register = Library()
def and_n_others(values, limit):
# A helper for the commonly appended "and N other(s)" string, with
# the appropriate pluralization.
return " and %d other%s" % (len(values) - limit,
"" if len(values) == limit + 1 else... | apache-2.0 |
hughperkins/kgsgo-dataset-preprocessor | thirdparty/future/src/libpasteurize/fixes/fix_unpacking.py | 60 | 5954 | u"""
Fixer for:
(a,)* *b (,c)* [,] = s
for (a,)* *b (,c)* [,] in d: ...
"""
from lib2to3 import fixer_base
from itertools import count
from lib2to3.fixer_util import (Assign, Comma, Call, Newline, Name,
Number, token, syms, Node, Leaf)
from libfuturize.fixer_util import indentation, sui... | mpl-2.0 |
bluemonk482/tdparse | src/sklearnSVM.py | 1 | 3651 | import os, time
from argparse import ArgumentParser
import numpy as np
from sklearn import svm, metrics
from sklearn.model_selection import GridSearchCV
from sklearn.model_selection import ShuffleSplit, GroupKFold
from sklearn.datasets import load_svmlight_file
from sklearn.externals import joblib
from utilities import... | mit |
dpgoetz/sos | setup.py | 1 | 1592 | #!/usr/bin/python
# Copyright (c) 2010-2011 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... | apache-2.0 |
Andrew-McNab-UK/DIRAC | tests/Integration/DataManagementSystem/Test_Client_FTS.py | 2 | 8332 | """ This is a test of the chain
FTSClient -> FTSManagerHandler -> FTSDB
It supposes that the DB is present, and that the service is running
"""
from DIRAC.Core.Base.Script import parseCommandLine
parseCommandLine()
import unittest
#import mock
import uuid
from DIRAC import gLogger
from DIRAC.DataManagementS... | gpl-3.0 |
dcroc16/skunk_works | google_appengine/lib/PyAMF-0.6.1/pyamf/remoting/gateway/wsgi.py | 39 | 6037 | # Copyright (c) The PyAMF Project.
# See LICENSE.txt for details.
"""
WSGI server implementation.
The Python Web Server Gateway Interface (WSGI) is a simple and universal
interface between web servers and web applications or frameworks.
The WSGI interface has two sides: the "server" or "gateway" side, and the
"appli... | mit |
jfozard/pyvol | pyvol/renderer.py | 1 | 24178 |
import sys
import os.path
import numpy as np
import numpy.linalg as la
import math
import warnings
# Suppress UserWarning from external.transform module
warnings.filterwarnings("ignore", module="external.transform", lineno=1833)
from mesh.GLmesh import GLMesh
import OpenGL.GL
from OpenGL.GL import (
GL_ELEME... | mit |
suyashphadtare/vestasi-update-erp | erpnext/stock/doctype/material_request/material_request.py | 4 | 12308 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
# ERPNext - web based ERP (http://erpnext.com)
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.utils import cstr, flt
f... | agpl-3.0 |
40223117cda/2015cd_midterm | static/Brython3.1.1-20150328-091302/Lib/queue.py | 818 | 8835 | '''A multi-producer, multi-consumer queue.'''
try:
import threading
except ImportError:
import dummy_threading as threading
from collections import deque
from heapq import heappush, heappop
try:
from time import monotonic as time
except ImportError:
from time import time
__all__ = ['Empty', 'Full', 'Q... | gpl-3.0 |
cristiana214/cristianachavez214-cristianachavez | python/src/Lib/sgmllib.py | 306 | 17884 | """A parser for SGML, using the derived class as a static DTD."""
# XXX This only supports those SGML features used by HTML.
# XXX There should be a way to distinguish between PCDATA (parsed
# character data -- the normal case), RCDATA (replaceable character
# data -- only char and entity references and end tags are ... | apache-2.0 |
sho-h/ruby_env | devkit/mingw/bin/lib/encodings/utf_16.py | 88 | 4110 | """ Python 'utf-16' Codec
Written by Marc-Andre Lemburg (mal@lemburg.com).
(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.
"""
import codecs, sys
### Codec APIs
encode = codecs.utf_16_encode
def decode(input, errors='strict'):
return codecs.utf_16_decode(input, errors, True)
class Inc... | mit |
kmike/splash | splash/lua_runner.py | 3 | 5259 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
import abc
import lupa
from splash.render_options import BadOption
from splash.utils import truncated
class ImmediateResult(object):
def __init__(self, value):
self.value = value
class AsyncCommand(object):
def __init__(self, id, name,... | bsd-3-clause |
tylertian/Openstack | openstack F/swift/swift/container/updater.py | 4 | 12579 | # Copyright (c) 2010-2012 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 |
xisisu/RT-Xen | tools/python/xen/xm/cpupool-new.py | 41 | 1702 | #============================================================================
# This library is free software; you can redistribute it and/or
# modify it under the terms of version 2.1 of the GNU Lesser General Public
# License as published by the Free Software Foundation.
#
# This library is distributed in the hope th... | gpl-2.0 |
chauhanhardik/populo_2 | common/djangoapps/third_party_auth/models.py | 7 | 19981 | # -*- coding: utf-8 -*-
"""
Models used to implement SAML SSO support in third_party_auth
(inlcuding Shibboleth support)
"""
from config_models.models import ConfigurationModel, cache
from django.conf import settings
from django.core.exceptions import ValidationError
from django.db import models
from django.utils impor... | agpl-3.0 |
wandec/grr | config/client.py | 2 | 10674 | #!/usr/bin/env python
"""Configuration parameters for the client."""
from grr.lib import config_lib
from grr.lib import rdfvalue
# General Client options.
config_lib.DEFINE_string("Client.name", "GRR",
"The name of the client. This will be used as a base "
"name to g... | apache-2.0 |
obsrvbl/ona | src/scripts/ona_service/pna_pusher.py | 1 | 1769 | # Copyright 2015 Observable Networks
#
# 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 |
ycaihua/kbengine | kbe/res/scripts/common/Lib/site-packages/pip/util.py | 343 | 24172 | import sys
import shutil
import os
import stat
import re
import posixpath
import zipfile
import tarfile
import subprocess
import textwrap
from pip.exceptions import InstallationError, BadCommand, PipError
from pip.backwardcompat import(WindowsError, string_types, raw_input,
console_to_s... | lgpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.