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 |
|---|---|---|---|---|---|
praekelt/vumi-go | go/billing/migrations/0009_auto__chg_field_messagecost_tag_pool__add_index_messagecost_message_di.py | 1 | 10898 | # -*- 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 'MessageCost.tag_pool'
db.alter_column(u'billing_messagecost', 'tag_pool_id', self.gf('dja... | bsd-3-clause |
kneufeld/crossbarexamples | rest/subscriber/publish.py | 12 | 2204 | ###############################################################################
##
## Copyright (C) 2014, Tavendo GmbH and/or collaborators. All rights reserved.
##
## Redistribution and use in source and binary forms, with or without
## modification, are permitted provided that the following conditions are met:
##
... | apache-2.0 |
endolith/scipy | scipy/stats/mstats.py | 18 | 2260 | """
===================================================================
Statistical functions for masked arrays (:mod:`scipy.stats.mstats`)
===================================================================
.. currentmodule:: scipy.stats.mstats
This module contains a large number of statistical functions that can
be... | bsd-3-clause |
tamac-io/jenkins-job-builder | jenkins_jobs/modules/base.py | 2 | 3134 | # Copyright 2012 Hewlett-Packard Development Company, L.P.
#
# 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 |
jounex/hue | desktop/core/ext-py/Django-1.6.10/tests/fixtures/tests.py | 50 | 32310 | from __future__ import absolute_import
import warnings
from django.contrib.sites.models import Site
from django.core import management
from django.db import connection, IntegrityError
from django.test import TestCase, TransactionTestCase, skipUnlessDBFeature
from django.utils import six
from .models import Article, ... | apache-2.0 |
cjh1/tomviz | tomviz/python/tomviz/operators.py | 3 | 3147 | # -*- coding: utf-8 -*-
###############################################################################
#
# This source file is part of the tomviz project.
#
# Copyright Kitware, Inc.
#
# This source code is released under the New BSD License, (the "License").
#
# Unless required by applicable law or agreed to in ... | bsd-3-clause |
Sabayon/entropy | lib/tests/spm.py | 1 | 13331 | # -*- coding: utf-8 -*-
import sys
import os
sys.path.insert(0, '.')
sys.path.insert(0, '../')
import unittest
import shutil
import entropy.tools as et
from entropy.const import const_mkdtemp
from entropy.client.interfaces import Client
from entropy.spm.plugins.interfaces.portage_plugin import \
PortageEntropyDep... | gpl-2.0 |
jaggu303619/asylum | openerp/tools/sql.py | 455 | 1173 | # -*- 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... | agpl-3.0 |
pablooliveira/cere | src/cere/lec.py | 3 | 15222 | #!/usr/bin/env python
# This file is part of CERE.
#
# Copyright (c) 2013-2016, Universite de Versailles St-Quentin-en-Yvelines
#
# CERE 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 ... | lgpl-3.0 |
yu239/Paddle | v1_api_demo/quick_start/trainer_config.lstm.py | 13 | 1975 | # edit-mode: -*- python -*-
# Copyright (c) 2016 PaddlePaddle 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 |
davidhrbac/spacewalk | client/rhel/yum-rhn-plugin/test/profilesynctests.py | 19 | 4583 | """
Unit Tests for syncing the self.package profile with rhn.
"""
import unittest
from yum import transactioninfo
from yum.packages import YumAvailablePackage
import settestpath
import rhnplugin
class DummyRepo:
def __init__(self, channel):
self.id = channel
class SimplePkgDict:
"""
A Simpl... | gpl-2.0 |
blois/AndroidSDKCloneMin | ndk/prebuilt/linux-x86_64/lib/python2.7/markupbase.py | 173 | 14643 | """Shared support for scanning document type declarations in HTML and XHTML.
This module is used as a foundation for the HTMLParser and sgmllib
modules (indirectly, for htmllib as well). It has no documented
public API and should not be used directly.
"""
import re
_declname_match = re.compile(r'[a-zA-Z][-_.a-zA-Z... | apache-2.0 |
klahnakoski/SpotManager | vendor/mo_logs/log_usingThreadedStream.py | 4 | 3885 | # encoding: utf-8
#
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
#
# Contact: Kyle Lahnakoski (kyle@lahnakoski.com)
#
from __future__ import absolute_import, divi... | mpl-2.0 |
cajone/pychess | lib/pychess/System/TaskQueue.py | 1 | 2187 | # http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/475160
# Was accepted into Python 2.5, but earlier versions still have
# to do stuff manually
import threading
from pychess.compat import Queue
def TaskQueue():
if hasattr(Queue, "task_done"):
return Queue()
return _TaskQueue()
class _TaskQu... | gpl-3.0 |
wenyu1001/scrapy | scrapy/linkextractors/regex.py | 23 | 1360 | import re
from six.moves.urllib.parse import urljoin
from w3lib.html import remove_tags, replace_entities, replace_escape_chars, get_base_url
from scrapy.link import Link
from .sgml import SgmlLinkExtractor
linkre = re.compile(
"<a\s.*?href=(\"[.#]+?\"|\'[.#]+?\'|[^\s]+?)(>|\s.*?>)(.*?)<[/ ]?a>",
re.... | bsd-3-clause |
KyleJamesWalker/ansible | test/runner/lib/pytar.py | 70 | 1512 | """Python native TGZ creation."""
from __future__ import absolute_import, print_function
import tarfile
import os
# improve performance by disabling uid/gid lookups
tarfile.pwd = None
tarfile.grp = None
# To reduce archive time and size, ignore non-versioned files which are large or numerous.
# Also ignore miscella... | gpl-3.0 |
gngrwzrd/gity | python/pushto.py | 2 | 1558 | # Copyright Aaron Smith 2009
#
# This file is part of Gity.
#
# Gity 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.
#
# Gity is dis... | gpl-3.0 |
mattjmorrison/ReportLab | ez_setup.py | 6 | 9415 | #!python
"""Bootstrap setuptools installation
If you want to use setuptools in your package's setup.py, just include this
file in the same directory with it, and add this to the top of your setup.py::
from ez_setup import use_setuptools
use_setuptools()
If you want to require a specific version of setuptools... | bsd-3-clause |
TeamExodus/external_chromium_org | tools/telemetry/telemetry/results/page_run_unittest.py | 33 | 2090 | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
import unittest
from telemetry.page import page_set
from telemetry.results import page_run
from telemetry.value import failure
from telemetry.valu... | bsd-3-clause |
daspots/dasapp | lib/oauthlib/oauth1/rfc5849/request_validator.py | 9 | 30459 | # -*- coding: utf-8 -*-
"""
oauthlib.oauth1.rfc5849
~~~~~~~~~~~~~~
This module is an implementation of various logic needed
for signing and checking OAuth 1.0 RFC 5849 requests.
"""
from __future__ import absolute_import, unicode_literals
import sys
from . import SIGNATURE_METHODS, utils
class RequestValidator(obj... | mit |
cetic/ansible | lib/ansible/modules/system/capabilities.py | 9 | 6584 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2014, Nate Coraor <nate@bx.psu.edu>
# 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.0',
... | gpl-3.0 |
mxOBS/deb-pkg_trusty_chromium-browser | testing/gmock/scripts/upload.py | 2511 | 51024 | #!/usr/bin/env python
#
# Copyright 2007 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... | bsd-3-clause |
stamhe/ppcoin | contrib/pyminer/pyminer.py | 1257 | 6438 | #!/usr/bin/python
#
# Copyright (c) 2011 The Bitcoin developers
# Distributed under the MIT/X11 software license, see the accompanying
# file license.txt or http://www.opensource.org/licenses/mit-license.php.
#
import time
import json
import pprint
import hashlib
import struct
import re
import base64
import httplib
im... | mit |
marcosmodesto/django-testapp | django/views/decorators/cache.py | 83 | 3975 | from functools import wraps
from django.utils.decorators import decorator_from_middleware_with_args, available_attrs
from django.utils.cache import patch_cache_control, add_never_cache_headers
from django.middleware.cache import CacheMiddleware
def cache_page(*args, **kwargs):
"""
Decorator for views that tri... | bsd-3-clause |
anilmuthineni/tensorflow | tensorflow/contrib/seq2seq/python/ops/attention_decoder_fn.py | 19 | 18947 | # 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 |
noslenfa/tdjangorest | uw/lib/python2.7/site-packages/IPython/html/services/notebooks/filenbmanager.py | 2 | 14448 | """A notebook manager that uses the local file system for storage.
Authors:
* Brian Granger
"""
#-----------------------------------------------------------------------------
# Copyright (C) 2011 The IPython Development Team
#
# Distributed under the terms of the BSD License. The full license is in
# the file C... | apache-2.0 |
garyfeng/pybrain | pybrain/rl/environments/ode/tasks/ccrl.py | 25 | 15208 | from __future__ import print_function
__author__ = 'Frank Sehnke, sehnke@in.tum.de'
from pybrain.rl.environments import EpisodicTask
from pybrain.rl.environments.ode.sensors import SpecificBodyPositionSensor
from scipy import tanh, zeros, array, random, sqrt, asarray
#Basic class for all ccrl tasks
class CCRLTask(E... | bsd-3-clause |
savoirfairelinux/odoo | addons/mrp_operations/mrp_operations.py | 33 | 27326 | # -*- 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 |
mkutlak/abrt | src/cli/tests/test_utils.py | 3 | 3930 | #!/usr/bin/python3
# -*- encoding: utf-8 -*-
import logging
try:
import unittest2 as unittest
except ImportError:
import unittest
import os
import problem
from abrtcli.config import ONELINE_FMT
from abrtcli.utils import (format_problems,
get_problem_field,
... | gpl-2.0 |
codrut3/tensorflow | tensorflow/contrib/keras/api/keras/preprocessing/__init__.py | 132 | 1094 | # 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 |
supertom/ansible-modules-core | cloud/openstack/os_network.py | 36 | 8352 | #!/usr/bin/python
# Copyright (c) 2014 Hewlett-Packard Development Company, L.P.
# Copyright (c) 2013, Benno Joy <benno@ansible.com>
#
# This module 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 vers... | gpl-3.0 |
luke-segars/regis | face/management/commands/parseall.py | 2 | 3665 | import face.models.models as regis
import face.offline.QuestionParser as qp
import face.offline.ParserTools.ParserTools as ParserTools
import json, datetime
from django.core.management.base import BaseCommand, CommandError
class Command(BaseCommand):
args = 'none'
help = 'Parses all of the questions that hav... | gpl-2.0 |
CubicERP/odoo | addons/hr_gamification/models/gamification.py | 388 | 4836 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013 OpenERP SA (<http://www.openerp.com>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the ... | agpl-3.0 |
iXioN/django-all-access | allaccess/tests/test_views.py | 2 | 10353 | "Redirect and callback view tests."
from __future__ import unicode_literals
from django.conf import settings
from django.core.urlresolvers import reverse
from django.test import override_settings, RequestFactory
from .base import AllAccessTestCase, AccountAccess, get_user_model, skipIfCustomUser
from ..compat import ... | bsd-2-clause |
apollo13/ansible | lib/ansible/utils/color.py | 34 | 4647 | # (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 |
ARTFL-Project/PhiloLogic4 | python/philologic/TagCensus.py | 3 | 4469 |
from philologic import shlaxtree as st
import sys
class TagCensus:
def __init__(self, debug=False, text_target=None):
self.tags = {}
self.debug = debug
self.text_target = text_target
def parse(self, text):
self.tags = {}
parser = st.ShlaxIngestor(target=self)
... | gpl-3.0 |
kemalakyol48/python-for-android | python-modules/twisted/twisted/python/text.py | 49 | 6637 | # -*- test-case-name: twisted.test.test_text -*-
#
# Copyright (c) 2001-2010 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Miscellany of text-munging functions.
"""
import string, types
from twisted.python import deprecate, versions
def stringyString(object, indentation=''):
"""
Expansive st... | apache-2.0 |
akesandgren/easybuild-framework | test/framework/config.py | 1 | 32361 | # #
# Copyright 2013-2021 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
# with support of Ghent University (http://ugent.be/hpc),
# the Flemish Supercomputer Centre (VSC) (https://www.vscentrum.be),
# Flemish Research Foundation (... | gpl-2.0 |
deter-project/magi | magi/messaging/transportTCP.py | 1 | 2821 |
import socket
import logging
import time
from asyncore import dispatcher
from transport import Transport
import transportStream
from magimessage import DefaultCodec
log = logging.getLogger(__name__)
class TCPServer(Transport):
""" Simple TCP Server that returns new TCP clients as 'messages' """
def __init__(self,... | gpl-2.0 |
taichatha/youtube-dl | youtube_dl/downloader/fragment.py | 77 | 3754 | from __future__ import division, unicode_literals
import os
import time
from .common import FileDownloader
from .http import HttpFD
from ..utils import (
encodeFilename,
sanitize_open,
)
class HttpQuietDownloader(HttpFD):
def to_screen(self, *args, **kargs):
pass
class FragmentFD(FileDownloade... | unlicense |
hastexo/edx-platform | pavelib/paver_tests/test_assets.py | 1 | 7878 | """Unit tests for the Paver asset tasks."""
import os
from unittest import TestCase
import ddt
from mock import patch
from paver.easy import call_task, path
from watchdog.observers import Observer
from pavelib.assets import COLLECTSTATIC_LOG_DIR_ARG, collect_assets
from ..utils.envs import Env
from .utils import Pa... | agpl-3.0 |
sugartom/tensorflow-alien | tensorflow/contrib/training/python/training/evaluation.py | 9 | 16040 | # 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 applicable ... | apache-2.0 |
turtleloveshoes/kitsune | kitsune/wiki/badges.py | 23 | 1658 | from django.conf import settings
from django.db.models.signals import post_save
from kitsune.wiki.models import Revision
# Yo ******! These are year-agnostic badge templates which code uses
# to get-or-create the actual Badge instances. These strings should
# not be l10n-ized here--the badge title and description st... | bsd-3-clause |
endlessm/chromium-browser | tools/grit/minimize_css_unittest.py | 10 | 1879 | #!/usr/bin/env python
# Copyright 2016 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import unittest
import minimize_css
class CSSMinimizerTest(unittest.TestCase):
def test_simple(self):
source = """
... | bsd-3-clause |
fangxingli/hue | desktop/core/ext-py/pysaml2-2.4.0/example/idp2_repoze/idp.py | 29 | 35282 | #!/usr/bin/env python
import argparse
import base64
import re
import logging
import time
from hashlib import sha1
from urlparse import parse_qs
from Cookie import SimpleCookie
import os
from saml2 import server
from saml2 import BINDING_HTTP_ARTIFACT
from saml2 import BINDING_URI
from saml2 import BINDING_PAOS
from ... | apache-2.0 |
aisipos/django | tests/gis_tests/maps/tests.py | 322 | 2099 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from unittest import skipUnless
from django.contrib.gis.geos import HAS_GEOS
from django.test import SimpleTestCase
from django.test.utils import modify_settings, override_settings
from django.utils.encoding import force_text
GOOGLE_MAPS_API_KEY = 'XXXX... | bsd-3-clause |
horacio3/troposphere | tests/test_ec2.py | 3 | 1571 | import unittest
import troposphere.ec2 as ec2
class TestEC2(unittest.TestCase):
def test_securitygroupegress(self):
egress = ec2.SecurityGroupEgress(
'egress',
ToPort='80',
FromPort='80',
IpProtocol="tcp",
GroupId="id",
CidrIp="0.0.0... | bsd-2-clause |
theblacklion/pyglet | experimental/buffer/bars.py | 28 | 2673 | #!/usr/bin/python
# $Id:$
import random
import sys
from pyglet.gl import *
from pyglet import clock
from pyglet import font
from pyglet import graphics
from pyglet import window
BARS = 100
if len(sys.argv) > 1:
BARS = int(sys.argv[1])
MIN_BAR_LENGTH = 4
MAX_BAR_LENGTH = 100
BAR_SEGMENT_HEIGHT = 10
UPDATE_PERIOD... | bsd-3-clause |
MTASZTAKI/ApertusVR | plugins/physics/bulletPhysics/3rdParty/bullet3/examples/pybullet/examples/dumpLog.py | 4 | 1702 | import time
import math
from datetime import datetime
import struct
import sys
import os, fnmatch
import argparse
from time import sleep
def readLogFile(filename, verbose=True):
f = open(filename, 'rb')
print('Opened'),
print(filename)
keys = f.readline().decode('utf8').rstrip('\n').split(',')
fmt = f.rea... | mit |
ryfeus/lambda-packs | Spacy/source2.7/spacy/lang/nl/tag_map.py | 3 | 49792 | # coding: utf8
from __future__ import unicode_literals
from ...symbols import POS, PUNCT, ADJ, NUM, DET, ADV, ADP, X, VERB
from ...symbols import NOUN, PROPN, SPACE, PRON, CONJ
TAG_MAP = {
"ADJ__Number=Sing": {POS: ADJ},
"ADJ___": {POS: ADJ},
"ADP__AdpType=Prep": {POS: ADP},
"ADP__AdpType=Preppron|Ge... | mit |
ayepezv/GAD_ERP | openerp/addons/base/tests/test_res_partner_bank.py | 60 | 2015 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
# Copyright (c) 2015 ACSONE SA/NV (<http://acsone.eu>)
from odoo.tests.common import TransactionCase
class TestResPartnerBank(TransactionCase):
"""Tests acc_number
"""
def test_sanitized_acc_number(self):... | gpl-3.0 |
tudennis/LeetCode---kamyu104-11-24-2015 | Python/search-for-a-range.py | 2 | 2020 | from __future__ import print_function
# Time: O(logn)
# Space: O(1)
#
# Given a sorted array of integers, find the starting and ending position of a given target value.
#
# Your algorithm's runtime complexity must be in the order of O(log n).
#
# If the target is not found in the array, return [-1, -1].
#
# For exampl... | mit |
jhawkesworth/ansible | test/units/mock/yaml_helper.py | 209 | 5267 | import io
import yaml
from ansible.module_utils.six import PY3
from ansible.parsing.yaml.loader import AnsibleLoader
from ansible.parsing.yaml.dumper import AnsibleDumper
class YamlTestUtils(object):
"""Mixin class to combine with a unittest.TestCase subclass."""
def _loader(self, stream):
"""Vault r... | gpl-3.0 |
cmosa/gitinspector | gitinspector/config.py | 51 | 2939 | # coding: utf-8
#
# Copyright © 2013 Ejwa Software. All rights reserved.
#
# This file is part of gitinspector.
#
# gitinspector 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,... | gpl-3.0 |
phil-lopreiato/the-blue-alliance | database/dict_converters/team_converter.py | 3 | 1224 | from database.dict_converters.converter_base import ConverterBase
class TeamConverter(ConverterBase):
SUBVERSIONS = { # Increment every time a change to the dict is made
3: 4,
}
@classmethod
def _convert(cls, teams, dict_version):
CONVERTERS = {
3: cls.teamsConverter_v3,
... | mit |
togaurav1981/Hello-World | node_modules/pygmentize-bundled/vendor/pygments/build-3.3/pygments/formatters/_mapping.py | 94 | 5509 | # -*- coding: utf-8 -*-
"""
pygments.formatters._mapping
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Formatter mapping defintions. This file is generated by itself. Everytime
you change something on a builtin formatter defintion, run this script from
the formatters folder to update it.
Do not alter the FORMA... | mit |
cchurch/ansible | lib/ansible/modules/network/f5/bigip_firewall_rule.py | 3 | 43681 | #!/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 |
ihsanudin/odoo | addons/website_blog/__init__.py | 373 | 1036 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013-Today OpenERP SA (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms ... | agpl-3.0 |
vinayan3/clpricehistory | django/db/backends/sqlite3/introspection.py | 160 | 5815 | import re
from django.db.backends import BaseDatabaseIntrospection
# This light wrapper "fakes" a dictionary interface, because some SQLite data
# types include variables in them -- e.g. "varchar(30)" -- and can't be matched
# as a simple dictionary lookup.
class FlexibleFieldLookupDict(object):
# Maps SQL types t... | bsd-3-clause |
drtuxwang/system-config | bin/battery.py | 1 | 3916 | #!/usr/bin/env python3
"""
Monitor laptop battery
"""
import argparse
import signal
import sys
from typing import List
import power_mod
class Options:
"""
Options class
"""
def __init__(self) -> None:
self._args: argparse.Namespace = None
self.parse(sys.argv)
def get_summary_fl... | gpl-2.0 |
jounex/hue | desktop/core/ext-py/Django-1.6.10/django/template/response.py | 221 | 6214 | from django.http import HttpResponse
from django.template import loader, Context, RequestContext
from django.utils import six
class ContentNotRenderedError(Exception):
pass
class SimpleTemplateResponse(HttpResponse):
rendering_attrs = ['template_name', 'context_data', '_post_render_callbacks']
def __in... | apache-2.0 |
bonitadecker77/python-for-android | python3-alpha/python3-src/Lib/encodings/cp1006.py | 272 | 13568 | """ Python Character Mapping Codec cp1006 generated from 'MAPPINGS/VENDORS/MISC/CP1006.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_table)
def decode(self,input,errors... | apache-2.0 |
tafaRU/odoo | openerp/workflow/__init__.py | 378 | 3793 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2014 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 |
stvstnfrd/edx-platform | openedx/core/djangoapps/user_api/management/tests/test_cancel_retirement.py | 5 | 3047 | """
Test the cancel_user_retirement_request management command
"""
import pytest
from django.contrib.auth.hashers import UNUSABLE_PASSWORD_PREFIX
from django.contrib.auth.models import User # lint-amnesty, pylint: disable=imported-auth-user
from django.core.management import CommandError, call_command
from openedx.... | agpl-3.0 |
karllessard/tensorflow | tensorflow/python/keras/layers/preprocessing/text_vectorization.py | 1 | 29394 | # 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 |
ofermend/medicare-demo | socialite/jython/Lib/test/test_structseq.py | 34 | 2972 | import unittest
from test import test_support
import time
class StructSeqTest(unittest.TestCase):
def test_tuple(self):
t = time.gmtime()
astuple = tuple(t)
self.assertEqual(len(t), len(astuple))
self.assertEqual(t, astuple)
# Check that slicing works the same way; at one... | apache-2.0 |
gclenaghan/scikit-learn | sklearn/datasets/california_housing.py | 28 | 3864 | """California housing dataset.
The original database is available from StatLib
http://lib.stat.cmu.edu/
The data contains 20,640 observations on 9 variables.
This dataset contains the average house value as target variable
and the following input variables (features): average income,
housing average age, averag... | bsd-3-clause |
ychen820/microblog | y/google-cloud-sdk/platform/google_appengine/lib/django-1.3/django/contrib/gis/geos/prototypes/__init__.py | 244 | 1319 | """
This module contains all of the GEOS ctypes function prototypes. Each
prototype handles the interaction between the GEOS library and Python
via ctypes.
"""
# Coordinate sequence routines.
from django.contrib.gis.geos.prototypes.coordseq import create_cs, get_cs, \
cs_clone, cs_getordinate, cs_setordinate, c... | bsd-3-clause |
j-fuentes/werkzeug | tests/contrib/test_sessions.py | 30 | 1698 | # -*- coding: utf-8 -*-
"""
tests.sessions
~~~~~~~~~~~~~~
Added tests for the sessions.
:copyright: (c) 2014 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import os
from tempfile import gettempdir
from werkzeug.contrib.sessions import FilesystemSessionStore
def test_defaul... | bsd-3-clause |
KyleJamesWalker/ansible | lib/ansible/modules/network/f5/bigip_pool.py | 41 | 20012 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, Matt Hite <mhite@hotmail.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... | gpl-3.0 |
iAMr00t/opencog | opencog/python/learning/bayesian_learning/dynamics.py | 34 | 2843 | from decimal import Decimal
from random import random as rand
from learning.bayesian_learning.network import Row
from sample_data.uci_adult_dataset import main
__author__ = 'keyvan'
def _givens_and_negations_from(kwargs):
if kwargs.has_key('givens'):
givens = set(kwargs['givens'])
else:
given... | agpl-3.0 |
entropyx/callme | callme/proxy.py | 1 | 9608 | # Copyright (c) 2009-2014, Christian Haintz
# 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 ... | bsd-3-clause |
bitxbay/BitXBay | electrum/socks.py | 65 | 16177 | """SocksiPy - Python SOCKS module.
Version 1.00
Copyright 2006 Dan-Haim. All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
... | gpl-3.0 |
GabrielBrascher/cloudstack | test/selenium/smoke/TemplatesAndISO.py | 8 | 6757 | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | apache-2.0 |
etamponi/resilient-protocol | resilient/ensemble.py | 1 | 6786 | import hashlib
import numpy
from sklearn.base import BaseEstimator, ClassifierMixin, clone
from sklearn.tree.tree import DecisionTreeClassifier
from sklearn.utils.fixes import unique
from sklearn import preprocessing
from sklearn.utils.random import check_random_state
from resilient.logger import Logger
from resilien... | gpl-2.0 |
mnubo/kubernetes-py | kubernetes_py/models/v1/Volume.py | 3 | 9297 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# This file is subject to the terms and conditions defined in
# file 'LICENSE.md', which is part of this source code package.
#
from kubernetes_py.models.v1.AWSElasticBlockStoreVolumeSource import AWSElasticBlockStoreVolumeSource
from kubernetes_py.models.v1.EmptyDirVol... | apache-2.0 |
mearleycf/mwepd | node_modules/gulp-sass/node_modules/node-sass/node_modules/pangyp/gyp/pylib/gyp/input_test.py | 604 | 3207 | #!/usr/bin/env python
# Copyright 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.
"""Unit tests for the input.py file."""
import gyp.input
import unittest
import sys
class TestFindCycles(unittest.TestCase):
def setUp(self... | gpl-2.0 |
arbrandes/edx-platform | common/djangoapps/student/management/tests/test_bulk_change_enrollment.py | 4 | 10533 | """Tests for the bulk_change_enrollment command."""
from unittest.mock import call, patch
import ddt
import pytest
from django.core.management import call_command
from django.core.management.base import CommandError
from common.djangoapps.course_modes.tests.factories import CourseModeFactory
from common.djangoapps.... | agpl-3.0 |
singingwolfboy/edx-ora2 | docs/en_us/course_authors/source/conf.py | 48 | 1200 | # -*- coding: utf-8 -*-
#
import sys, os
# on_rtd is whether we are on readthedocs.org, this line of code grabbed from docs.readthedocs.org
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
if not on_rtd: # only import and set the theme if we're building docs locally
import sphinx_rtd_theme
html_theme ... | agpl-3.0 |
sirex/Misago | misago/users/views/admin/users.py | 8 | 13970 | from django.contrib import messages
from django.contrib.auth import get_user_model, update_session_auth_hash
from django.db import transaction
from django.http import JsonResponse
from django.shortcuts import redirect
from django.utils.translation import ugettext_lazy as _
from misago.admin.auth import start_admin_ses... | gpl-2.0 |
andrewschaaf/pj-closure | js/goog/array.py | 1 | 3829 | #<pre>Copyright 2006 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
#
# Unless required ... | apache-2.0 |
ihsanudin/odoo | addons/account/ir_sequence.py | 336 | 2454 | # -*- 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 |
ilastik/ilastik-0.5 | ilastik/modules/unsupervised_decomposition/core/unsupervisedMgr.py | 1 | 7290 | from ilastik.core.baseModuleMgr import BaseModuleDataItemMgr, BaseModuleMgr
import numpy
import traceback, sys
from ilastik.core import jobMachine
from PyQt4 import QtCore
import os
import algorithms
from ilastik.core.volume import DataAccessor
from ilastik.core.overlayMgr import OverlayItem
""" Import all algorithm ... | bsd-2-clause |
vperron/sentry | src/sentry/migrations/0130_auto__del_field_project_owner.py | 36 | 26056 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Deleting field 'Project.owner'
db.delete_column(u'sentry_project', 'owner_id')
def backwards(self, o... | bsd-3-clause |
shekkbuilder/rowhammer-test | dram_physaddr_mapping/analyse_addrs.py | 6 | 3529 | # Copyright 2015, 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 or agreed to in writing... | apache-2.0 |
mmcdermo/helpinghand | server/venv/lib/python2.7/site-packages/django/contrib/admin/bin/compress.py | 193 | 1958 | #!/usr/bin/env python
import os
import optparse
import subprocess
import sys
js_path = os.path.join(os.path.dirname(os.path.dirname(__file__)), 'static', 'admin', 'js')
def main():
usage = "usage: %prog [file1..fileN]"
description = """With no file paths given this script will automatically
compress all jQuer... | mit |
Theer108/invenio | invenio/utils/remote_debugger/config.py | 6 | 6075 | # This file is part of Invenio.
# Copyright (C) 2011, 2012, 2013 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 your option) any later version.
#
# ... | gpl-2.0 |
playm2mboy/edx-platform | common/lib/calc/calc/calc.py | 176 | 13572 | """
Parser and evaluator for FormulaResponse and NumericalResponse
Uses pyparsing to parse. Main function as of now is evaluator().
"""
import math
import operator
import numbers
import numpy
import scipy.constants
import functions
from pyparsing import (
Word, Literal, CaselessLiteral, ZeroOrMore, MatchFirst, O... | agpl-3.0 |
mcanthony/nupic | examples/opf/experiments/anomaly/temporal/noisy_saw/description.py | 32 | 14305 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... | agpl-3.0 |
tedder/ansible | lib/ansible/modules/cloud/cloudstack/cs_iso.py | 14 | 13499 | #!/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 |
eg-zhang/h2o-2 | py/testdir_single_jvm/test_NN2_params_rand2.py | 9 | 4517 | import unittest, random, sys, time
sys.path.extend(['.','..','../..','py'])
import h2o, h2o_cmd, h2o_glm, h2o_import as h2i, h2o_nn
def define_params():
paramDict = {
'destination_key' : [None, 'NN2_model'],
'ignored_cols' : [None, 0, 1, '0,1'],
'classification... | apache-2.0 |
rolando-contrib/scrapy | tests/test_downloadermiddleware_stats.py | 101 | 1596 | from unittest import TestCase
from scrapy.downloadermiddlewares.stats import DownloaderStats
from scrapy.http import Request, Response
from scrapy.spiders import Spider
from scrapy.utils.test import get_crawler
class MyException(Exception):
pass
class TestDownloaderStats(TestCase):
def setUp(self):
... | bsd-3-clause |
ncliam/serverpos | openerp/addons/project/res_config.py | 232 | 4551 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (C) 2004-2012 OpenERP S.A. (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms o... | agpl-3.0 |
chbfiv/fabric-engine-old | Native/ThirdParty/Private/Python/closure_linter/common/position.py | 285 | 3324 | #!/usr/bin/env python
#
# Copyright 2008 The Closure Linter 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
#... | agpl-3.0 |
mudbungie/NetExplorer | env/lib/python3.4/site-packages/networkx/tests/test_convert_pandas.py | 43 | 2177 | from nose import SkipTest
from nose.tools import assert_true
import networkx as nx
class TestConvertPandas(object):
numpy=1 # nosetests attribute, use nosetests -a 'not numpy' to skip test
@classmethod
def setupClass(cls):
try:
import pandas as pd
except ImportError:
... | mit |
foodszhang/kbengine | kbe/res/scripts/common/Lib/multiprocessing/resource_sharer.py | 102 | 5318 | #
# We use a background thread for sharing fds on Unix, and for sharing sockets on
# Windows.
#
# A client which wants to pickle a resource registers it with the resource
# sharer and gets an identifier in return. The unpickling process will connect
# to the resource sharer, sends the identifier and its pid, and then ... | lgpl-3.0 |
paulosman/django-openid-auth | django_openid_auth/teams.py | 25 | 14251 | # Launchpad OpenID Teams Extension support for python-openid
#
# Copyright (C) 2008-2010 Canonical Ltd.
#
# 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 copyri... | bsd-2-clause |
manipopopo/tensorflow | tensorflow/contrib/data/python/kernel_tests/serialization/concatenate_dataset_serialization_test.py | 14 | 2037 | # 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 |
tareqalayan/ansible | test/units/template/test_vars.py | 84 | 2886 | # (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 |
aerickson/ansible | lib/ansible/utils/module_docs_fragments/eos.py | 87 | 5493 | #
# (c) 2015, Peter Sprygada <psprygada@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 late... | gpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.