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 |
|---|---|---|---|---|---|
aequitas/home-assistant | homeassistant/components/lightwave/switch.py | 7 | 1682 | """Support for LightwaveRF switches."""
from homeassistant.components.switch import SwitchDevice
from homeassistant.const import CONF_NAME
from . import LIGHTWAVE_LINK
async def async_setup_platform(
hass, config, async_add_entities, discovery_info=None):
"""Find and return LightWave switches."""
if ... | apache-2.0 |
bdh1011/wau | venv/lib/python2.7/site-packages/celery/tests/backends/test_base.py | 6 | 15581 | from __future__ import absolute_import
import sys
import types
from contextlib import contextmanager
from celery.exceptions import ChordError
from celery.five import items, range
from celery.utils import serialization
from celery.utils.serialization import subclass_exception
from celery.utils.serialization import fi... | mit |
projecthamster/hamster-cli | hamster_cli/hamster_cli.py | 2 | 30015 | # -*- coding: utf-8 -*-
# This file is part of 'hamster_cli'.
#
# 'hamster_cli' 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.
#
# 'h... | gpl-3.0 |
adw0rd/lettuce | tests/integration/lib/Django-1.3/django/contrib/sessions/backends/cache.py | 268 | 1881 | from django.contrib.sessions.backends.base import SessionBase, CreateError
from django.core.cache import cache
class SessionStore(SessionBase):
"""
A cache-based session store.
"""
def __init__(self, session_key=None):
self._cache = cache
super(SessionStore, self).__init__(session_key)
... | gpl-3.0 |
jkorell/PTVS | Python/Tests/TestData/DebugAttach/Simple.py | 18 | 1635 | from threading import Thread, current_thread, Lock
from time import sleep
report_progress_now = []
progress_lock = Lock()
def check_report_progress(me, id):
global report_progress_now, progress_lock
if report_progress_now[id]:
progress_lock.acquire()
print("{} [{}] is making progress... | apache-2.0 |
rbelzile/python-myfitnesspal | myfitnesspal/entry.py | 1 | 1558 | import re
from myfitnesspal.base import MFPBase
class Entry(MFPBase):
def __init__(self, name, nutrition):
self._name = name
self._nutrition = nutrition
#split out quantity and measuring unit out of entry name
regex = r'(?P<short_name>.+), (?P<quantity>\d[\d\.]*) (?P<unit... | mit |
asdfsx/chardet | chardet/charsetgroupprober.py | 53 | 3534 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights R... | lgpl-2.1 |
XiaosongWei/chromium-crosswalk | tools/telemetry/telemetry/timeline/event_container.py | 15 | 5229 | # 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.
from telemetry.timeline import async_slice as async_slice_module
from telemetry.timeline import flow_event as flow_event_module
from telemetry.timeline impor... | bsd-3-clause |
leansoft/edx-platform | cms/djangoapps/contentstore/views/tests/test_unit_page.py | 222 | 2775 | """
Unit tests for the unit page.
"""
from contentstore.views.tests.utils import StudioPageTestCase
from xmodule.modulestore.django import modulestore
from xmodule.modulestore.tests.factories import ItemFactory
from xmodule.x_module import STUDENT_VIEW
class UnitPageTestCase(StudioPageTestCase):
"""
Unit tes... | agpl-3.0 |
bratsche/Neutron-Drive | neutron-drive/django/db/models/fields/subclassing.py | 104 | 1819 | """
Convenience routines for creating non-trivial Field subclasses, as well as
backwards compatibility utilities.
Add SubfieldBase as the __metaclass__ for your Field subclass, implement
to_python() and the other necessary methods and everything will work seamlessly.
"""
class SubfieldBase(type):
"""
A metacl... | bsd-3-clause |
R4stl1n/allianceauth | allianceauth/eveonline/autogroups/tests/test_models.py | 4 | 11512 | from django.test import TestCase
from django.contrib.auth.models import Group
from allianceauth.tests.auth_utils import AuthUtils
from allianceauth.eveonline.models import EveCharacter, EveCorporationInfo, EveAllianceInfo
from ..models import AutogroupsConfig, get_users_for_state
from . import patch, connect_signa... | gpl-2.0 |
NTesla/pattern | pattern/web/cache/__init__.py | 21 | 4199 | #### PATTERN | CACHE ###############################################################################
# Copyright (c) 2010 University of Antwerp, Belgium
# Author: Tom De Smedt <tom@organisms.be>
# License: BSD (see LICENSE.txt for details).
# http://www.clips.ua.ac.be/pages/pattern
try:
import hashlib; md5=hashlib... | bsd-3-clause |
lpryszcz/bin | fastq2fasta.py | 3 | 4418 | #!/usr/bin/env python
desc="""Convert FastQ to FASTA.
Note, reads are reported in arbitrary order due to multiprocessing!
"""
epilog="""
l.p.pryszcz+git@gmail.com
Barcelona, 10/05/2013
"""
import argparse, gzip, os, sys, subprocess
from datetime import datetime
from multiprocessing import Pool
def init_args(*args)... | gpl-3.0 |
diogocs1/comps | web/addons/account/account_move_line.py | 11 | 78177 | # -*- 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... | apache-2.0 |
django-nonrel/django-nonrel | django/db/backends/oracle/compiler.py | 347 | 2830 | from django.db.models.sql import compiler
class SQLCompiler(compiler.SQLCompiler):
def resolve_columns(self, row, fields=()):
# If this query has limit/offset information, then we expect the
# first column to be an extra "_RN" column that we need to throw
# away.
if self.query.high... | bsd-3-clause |
vanant/googleads-dfa-reporting-samples | python/v2.1/get_content_categories.py | 1 | 2155 | #!/usr/bin/python
#
# Copyright 2014 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 b... | apache-2.0 |
knewmanTE/FrameworkBenchmarks | toolset/benchmark/test_types/framework_test_type.py | 27 | 4710 | import copy
import sys
import subprocess
from subprocess import PIPE
import requests
# Requests is built ontop of urllib3,
# here we prevent general request logging
import logging
logging.getLogger('urllib3').setLevel(logging.CRITICAL)
from pprint import pprint
class FrameworkTestType:
'''
Interface betwee... | bsd-3-clause |
v1bri/gnuradio | grc/core/Connection.py | 14 | 5933 | """
Copyright 2008-2015 Free Software Foundation, Inc.
This file is part of GNU Radio
GNU Radio Companion 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 l... | gpl-3.0 |
svn2github/cef1 | tools/repack_locales.py | 4 | 5714 | #!/usr/bin/env python
# Copyright (c) 2011 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.
"""Helper script to repack paks for a list of locales.
Gyp doesn't have any built-in looping capability, so this just provi... | bsd-3-clause |
kyuupichan/electrum | gui/qt/network_dialog.py | 1 | 20239 | #!/usr/bin/env python
#
# Electrum - lightweight Bitcoin client
# Copyright (C) 2012 thomasv@gitorious
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation files
# (the "Software"), to deal in the Software without restriction,
# including witho... | mit |
stephenshank/taed-pv | pv/doc/conf.py | 3 | 8170 | # -*- coding: utf-8 -*-
#
# pv documentation build configuration file, created by
# sphinx-quickstart on Sun Sep 15 08:27:09 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 conf... | mit |
andrewyoung1991/abjad | abjad/tools/pitchtools/test/test_pitchtools_PitchArray__get_composite_offset_difference_series_from_leavs_in_expr.py | 2 | 1027 | # -*- encoding: utf-8 -*-
from abjad import *
def test_pitchtools_PitchArray__get_composite_offset_difference_series_from_leavs_in_expr_01():
staff_1 = Staff(r"\times 4/3 { c'8 d'8 e'8 }")
staff_2 = Staff("f'8 g'8 a'8 b'8")
score = Score([staff_1, staff_2])
assert systemtools.TestManager.compare(
... | gpl-3.0 |
explosion/catalogue | catalogue/_importlib_metadata/__init__.py | 1 | 19681 | import os
import re
import abc
import csv
import sys
import zipp
import email
import pathlib
import operator
import functools
import itertools
import posixpath
import collections
from ._compat import (
NullFinder,
PyPy_repr,
install,
Protocol,
)
from configparser import ConfigParser
from contextlib im... | mit |
PepperPD/edx-pepper-platform | common/djangoapps/mitxmako/makoloader.py | 15 | 3081 | import logging
from django.conf import settings
from django.template.base import TemplateDoesNotExist
from django.template.loader import make_origin, get_template_from_string
from django.template.loaders.filesystem import Loader as FilesystemLoader
from django.template.loaders.app_directories import Loader as AppDirec... | agpl-3.0 |
crepererum/invenio | invenio/legacy/bibmerge/engine.py | 15 | 26586 | # This file is part of Invenio.
# Copyright (C) 2009, 2010, 2011, 2014, 2015 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 v... | gpl-2.0 |
sanbinabu/Wox | PythonHome/Lib/site-packages/pip/_vendor/html5lib/filters/lint.py | 979 | 4306 | from __future__ import absolute_import, division, unicode_literals
from gettext import gettext
_ = gettext
from . import _base
from ..constants import cdataElements, rcdataElements, voidElements
from ..constants import spaceCharacters
spaceCharacters = "".join(spaceCharacters)
class LintError(Exception):
pass
... | mit |
philanthropy-u/edx-platform | common/djangoapps/student/tests/test_helpers.py | 3 | 5600 | """ Test Student helpers """
import logging
import ddt
from django.conf import settings
from django.contrib.sessions.middleware import SessionMiddleware
from django.urls import reverse
from django.test import TestCase
from django.test.client import RequestFactory
from django.test.utils import override_settings
from m... | agpl-3.0 |
liorvh/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/style/main_unittest.py | 124 | 3472 | # Copyright (C) 2010 Chris Jerdonek (cjerdonek@webkit.org)
#
# 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 list of conditions and... | bsd-3-clause |
joernhees/scikit-learn | sklearn/metrics/cluster/supervised.py | 25 | 31477 | """Utilities to evaluate the clustering performance of models.
Functions named as *_score return a scalar value to maximize: the higher the
better.
"""
# Authors: Olivier Grisel <olivier.grisel@ensta.org>
# Wei LI <kuantkid@gmail.com>
# Diego Molla <dmolla-aliod@gmail.com>
# Arnaud Fouchet ... | bsd-3-clause |
andreparrish/python-for-android | python-modules/twisted/twisted/scripts/test/test_tap2rpm.py | 56 | 12489 | # Copyright (c) 2009-2010 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted.scripts.tap2rpm}.
"""
import os
from twisted.trial.unittest import TestCase, SkipTest
from twisted.python import procutils
from twisted.python.failure import Failure
from twisted.internet import utils
from twisted... | apache-2.0 |
andreparrish/python-for-android | python3-alpha/python3-src/Lib/xml/etree/ElementTree.py | 46 | 57023 | #
# ElementTree
# $Id: ElementTree.py 3440 2008-07-18 14:45:01Z fredrik $
#
# light-weight XML support for Python 2.3 and later.
#
# history (since 1.2.6):
# 2005-11-12 fl added tostringlist/fromstringlist helpers
# 2006-07-05 fl merged in selected changes from the 1.3 sandbox
# 2006-07-05 fl removed support for ... | apache-2.0 |
ybellavance/python-for-android | python3-alpha/python3-src/Lib/contextlib.py | 50 | 4121 | """Utilities for with-statement contexts. See PEP 343."""
import sys
from functools import wraps
from warnings import warn
__all__ = ["contextmanager", "closing", "ContextDecorator"]
class ContextDecorator(object):
"A base class or mixin that enables context managers to work as decorators."
def _recreate_... | apache-2.0 |
teeple/pns_server | work/install/Python-2.7.4/Lib/test/test_sundry.py | 64 | 3093 | """Do a minimal test of all the modules that aren't otherwise tested."""
from test import test_support
import sys
import unittest
class TestUntestedModules(unittest.TestCase):
def test_at_least_import_untested_modules(self):
with test_support.check_warnings(quiet=True):
import CGIHTTPServer
... | gpl-2.0 |
henryiii/plumbum | tests/test_local.py | 2 | 21996 | import os
import unittest
import sys
import signal
import time
from plumbum import (local, LocalPath, FG, BG, TF, RETCODE, ERROUT,
CommandNotFound, ProcessExecutionError, ProcessTimedOut)
from plumbum.lib import six, IS_WIN32
from plumbum.fs.atomic import AtomicFile, AtomicCounterFile, PidFile
from ... | mit |
cyc805/VM | src/create-module.py | 21 | 9326 | #! /usr/bin/env python
import sys
from optparse import OptionParser
import os
WSCRIPT_TEMPLATE = '''# -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
# def options(opt):
# pass
# def configure(conf):
# conf.check_nonfatal(header_name='stdint.h', define_name='HAVE_STDINT_H')
... | gpl-2.0 |
benkonrath/django-guardian | guardian/__init__.py | 1 | 1073 | """
Implementation of per object permissions for Django.
"""
from __future__ import unicode_literals
from . import checks
try:
from .version import version as __version__
__version__split__ = __version__.split(".")
VERSION = tuple(['1', '5', '7'])
def get_version():
"""
Returns shorte... | bsd-2-clause |
CentreForResearchInAppliedLinguistics/clic | clic/web/models.py | 2 | 9496 | # -*- coding: utf-8 -*-
'''
models.py defines the SQL tables that CLiC uses. These classes
provide a python interface to the SQL database so that you can write python
code that automatically queries the database.
This is heavily dependent on Flask-SQLAlchmey and SQLAlchemy
'''
from sqlalchemy.dialects.postgresql imp... | mit |
strint/tensorflow | tensorflow/python/kernel_tests/division_past_test.py | 55 | 2219 | # Copyright 2015 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 |
tmpkus/photivo | scons-local-2.2.0/SCons/Tool/ilink.py | 14 | 2168 | """SCons.Tool.ilink
Tool-specific initialization for the OS/2 ilink linker.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011,... | gpl-3.0 |
henaras/horizon | tools/install_venv.py | 99 | 2401 | # Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2010 OpenStack Foundation
# Copyright 2013 IBM Corp.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this... | apache-2.0 |
wasn-lab/visual-positioning | cpp/scons/scons-local-2.0.0.final.0/SCons/PathList.py | 34 | 8414 | #
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without li... | apache-2.0 |
metaplinius/still-lambda | pyglet/graphics/vertexdomain.py | 2 | 30048 | # ----------------------------------------------------------------------------
# pyglet
# Copyright (c) 2006-2008 Alex Holkner
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributi... | bsd-3-clause |
kitianFresh/awesome-python3-webapp | www/app.py | 1 | 5548 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
'''
async web application.
'''
import logging; logging.basicConfig(level=logging.INFO)
import asyncio, os, json, time
from datetime import datetime
from aiohttp import web
from jinja2 import Environment, FileSystemLoader
from config import configs
import orm
from cor... | apache-2.0 |
fernandog/Medusa | ext/sqlalchemy/ext/mutable.py | 1 | 32415 | # ext/mutable.py
# Copyright (C) 2005-2018 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
r"""Provide support for tracking of in-place changes to scalar values,
which are prop... | gpl-3.0 |
brakhane/python-mode | pymode/libs/pylama/hook.py | 17 | 2874 | """ SCM hooks. Integration with git and mercurial. """
from __future__ import absolute_import
import sys
from os import path as op, chmod
from subprocess import Popen, PIPE
from .main import LOGGER
from .config import parse_options, setup_logger
try:
from configparser import ConfigParser # noqa
except ImportE... | lgpl-3.0 |
ingenieroariel/geonode | geonode/upload/templatetags/upload_tags.py | 32 | 4015 | # -*- coding: utf-8 -*-
#########################################################################
#
# Copyright (C) 2016 OSGeo
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 ... | gpl-3.0 |
Dhivyap/ansible | lib/ansible/modules/cloud/amazon/aws_region_info.py | 12 | 3757 | #!/usr/bin/python
# Copyright (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
ANSIBLE_METADATA = {
'metadata_version': '1.1',
'supported_by': 'community',
'status': ['preview']
}
DOCUMENTATION = '''
module: aws_region_info
short_descrip... | gpl-3.0 |
GladeRom/android_external_chromium_org | build/android/asan_symbolize.py | 96 | 3102 | #!/usr/bin/env python
#
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import collections
import optparse
import os
import re
import sys
from pylib import constants
# Uses symbol.py from third_party/an... | bsd-3-clause |
tndatacommons/tndata_backend | tndata_backend/goals/tests/test_managers.py | 2 | 12741 | import pytz
from datetime import date, time
from unittest.mock import patch
from django.contrib.auth import get_user_model
from django.test import TestCase
from django.utils import timezone
from model_mommy import mommy
from utils.user_utils import tzdt
from .. models import (
Action,
Category,
DailyPro... | mit |
libracore/erpnext | erpnext/accounts/report/trial_balance_for_party/trial_balance_for_party.py | 8 | 5969 | # Copyright (c) 2013, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.utils import flt, cint
from erpnext.accounts.report.trial_balance.trial_balance import validate_filters
def exec... | gpl-3.0 |
dreamsxin/kbengine | kbe/src/lib/python/Lib/idlelib/FormatParagraph.py | 76 | 7194 | """Extension to format a paragraph or selection to a max width.
Does basic, standard text formatting, and also understands Python
comment blocks. Thus, for editing Python source code, this
extension is really only suitable for reformatting these comment
blocks or triple-quoted strings.
Known problems with comment ref... | lgpl-3.0 |
amjith/python-prompt-toolkit | prompt_toolkit/output.py | 2 | 2381 | """
Interface for an output.
The actual implementations are in
`prompt_toolkit.terminal.vt100_output/win32_output`.
"""
from __future__ import unicode_literals
from abc import ABCMeta, abstractmethod
from six import with_metaclass
__all__ = (
'Output',
)
class Output(with_metaclass(ABCMeta, object)):
"""
... | bsd-3-clause |
Weil0ng/gem5 | src/arch/x86/isa/insts/simd128/integer/data_transfer/__init__.py | 91 | 2388 | # Copyright (c) 2007 The Hewlett-Packard Development Company
# 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 implemen... | bsd-3-clause |
gymnasium/edx-platform | lms/djangoapps/commerce/utils.py | 9 | 15246 | """Utilities to assist with commerce tasks."""
import json
import logging
from urllib import urlencode
from urlparse import urljoin
import requests
import waffle
from django.conf import settings
from django.contrib.auth import get_user_model
from django.urls import reverse
from django.utils.translation import ugettext... | agpl-3.0 |
gmcic/fiona-html5 | source/node_modules/node-gyp/gyp/pylib/gyp/generator/gypsh.py | 2779 | 1665 | # 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.
"""gypsh output module
gypsh is a GYP shell. It's not really a generator per se. All it does is
fire up an interactive Python session with a few local variables... | apache-2.0 |
himleyb85/django | django/contrib/auth/mixins.py | 305 | 4087 | from django.conf import settings
from django.contrib.auth import REDIRECT_FIELD_NAME
from django.contrib.auth.views import redirect_to_login
from django.core.exceptions import ImproperlyConfigured, PermissionDenied
from django.utils import six
from django.utils.encoding import force_text
class AccessMixin(object):
... | bsd-3-clause |
JordanP/openstack-snippets | ospurge/ospurge/resources/nova.py | 1 | 1062 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed u... | apache-2.0 |
molobrakos/home-assistant | homeassistant/components/ihc/light.py | 7 | 4112 | """Support for IHC lights."""
import logging
from homeassistant.components.light import (
ATTR_BRIGHTNESS, SUPPORT_BRIGHTNESS, Light)
from . import IHC_CONTROLLER, IHC_DATA, IHC_INFO
from .const import CONF_DIMMABLE, CONF_OFF_ID, CONF_ON_ID
from .ihcdevice import IHCDevice
from .util import async_pulse, async_set... | apache-2.0 |
kylazhang/virt-test | virttest/video_maker.py | 3 | 6816 | """
Video Maker transforms screenshots taken during a test into a HTML 5
compatible video, so that one can watch the screen activity of the
whole test from inside your own browser.
This relies on generally available multimedia libraries, frameworks
and tools.
"""
import os
import time
import glob
import logging
__... | gpl-2.0 |
jamesbeebop/CouchPotatoServer | libs/oauth2/clients/imap.py | 885 | 1685 | """
The MIT License
Copyright (c) 2007-2010 Leah Culver, Joe Stump, Mark Paschal, Vic Fryzel
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the ... | gpl-3.0 |
goofwear/raspberry_pwn | src/pentest/voiper/sulley/sulley/primitives.py | 8 | 30910 | import random
import struct
import string
import os
########################################################################################################################
class base_primitive (object):
'''
The primitive base class implements common functionality shared across most primitives.
'''
de... | gpl-3.0 |
dkuner/example-modules | modules/modeling/CDH4/hive_atomics/hive_union/specparser.py | 38 | 27392 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2014, DataCanvasIO
# 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 copyri... | bsd-3-clause |
MartinDelzant/scikit-learn | examples/bicluster/plot_spectral_biclustering.py | 403 | 2011 | """
=============================================
A demo of the Spectral Biclustering algorithm
=============================================
This example demonstrates how to generate a checkerboard dataset and
bicluster it using the Spectral Biclustering algorithm.
The data is generated with the ``make_checkerboard`... | bsd-3-clause |
ericmjl/bokeh | examples/models/file/choropleth.py | 1 | 2189 | from bokeh.document import Document
from bokeh.embed import file_html
from bokeh.models import ColorBar, ColumnDataSource, LinearColorMapper, Patches, Plot
from bokeh.palettes import Viridis11
from bokeh.resources import INLINE
from bokeh.sampledata import unemployment, us_counties, us_states
from bokeh.transform impor... | bsd-3-clause |
saurabh6790/omnitech-lib | conf/conf.py | 33 | 1034 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
# app configuration
# database config
db_name = '%(db_name)s'
db_password = '%(db_password)s'
# user attachments stored in
files_path = 'public/files'
public_path = 'public'
... | mit |
CydarLtd/ansible | lib/ansible/modules/monitoring/sensu_subscription.py | 60 | 5312 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2014, Anders Ingemann <aim@secoya.dk>
#
# 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 Licen... | gpl-3.0 |
eistre91/ThinkStats2 | code/timeseries.py | 66 | 18035 | """This file contains code for use with "Think Stats",
by Allen B. Downey, available from greenteapress.com
Copyright 2014 Allen B. Downey
License: GNU GPLv3 http://www.gnu.org/licenses/gpl.html
"""
from __future__ import print_function
import pandas
import numpy as np
import statsmodels.formula.api as smf
import st... | gpl-3.0 |
hds-lab/textvisdrg | msgvis/apps/datatable/models.py | 1 | 30970 | from django.db import models
from django.db.models import Q
from datetime import timedelta
import operator
from msgvis.apps.base.models import MappedValuesQuerySet
from msgvis.apps.corpus import models as corpus_models
from msgvis.apps.groups import models as groups_models
from msgvis.apps.dimensions import registry
f... | mit |
osvalr/odoo | addons/l10n_ae/__openerp__.py | 337 | 1579 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2014 Tech Receptives (<http://techreceptives.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the te... | agpl-3.0 |
neumerance/cloudloon2 | .venv/lib/python2.7/site-packages/requests/packages/charade/langcyrillicmodel.py | 184 | 18054 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Ri... | apache-2.0 |
xsynergy510x/android_external_chromium_org | tools/telemetry/telemetry/core/platform/profiler/android_traceview_profiler.py | 35 | 2545 | # 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
from telemetry.core import util
from telemetry.core.backends.chrome import android_browser_finder
from telemetry.core.platform import profiler
c... | bsd-3-clause |
Dahlgren/HTPC-Manager | libs/apscheduler/jobstores/memory.py | 33 | 3648 | from __future__ import absolute_import
from apscheduler.jobstores.base import BaseJobStore, JobLookupError, ConflictingIdError
from apscheduler.util import datetime_to_utc_timestamp
class MemoryJobStore(BaseJobStore):
"""
Stores jobs in an array in RAM. Provides no persistence support.
Plugin alias: ``m... | mit |
ericsnowcurrently/micropython | tests/float/string_format.py | 21 | 5014 | # Change the following to True to get a much more comprehensive set of tests
# to run, albeit, which take considerably longer.
full_tests = False
def test(fmt, *args):
print('{:8s}'.format(fmt) + '>' + fmt.format(*args) + '<')
test("{:10.4}", 123.456)
test("{:10.4e}", 123.456)
test("{:10.4e}", -123.456)
test("{... | mit |
metabrainz/picard | picard/dataobj.py | 3 | 2107 | # -*- coding: utf-8 -*-
#
# Picard, the next-generation MusicBrainz tagger
#
# Copyright (C) 2004 Robert Kaye
# Copyright (C) 2006-2008 Lukáš Lalinský
# Copyright (C) 2011-2012 Michael Wiencek
# Copyright (C) 2013, 2020 Laurent Monin
# Copyright (C) 2017 Sambhav Kothari
# Copyright (C) 2017 Sophist-UK
# Copyright (C) 2... | gpl-2.0 |
agileblaze/OpenStackTwoFactorAuthentication | openstack_dashboard/api/rest/nova.py | 35 | 9198 |
# Copyright 2014, Rackspace, US, 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 ... | apache-2.0 |
liberorbis/libernext | apps/erpnext/erpnext/accounts/doctype/journal_voucher/journal_voucher.py | 13 | 21988 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.utils import cstr, flt, fmt_money, formatdate, getdate
from frappe import msgprint, _, scrub
from erpnext.setup.utils impo... | gpl-2.0 |
andrefreitas/schwa | schwa/extraction/git_extractor.py | 1 | 8652 | # Copyright (c) 2015 Faculty of Engineering of the University of Porto
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use,... | mit |
shakamunyi/neutron | neutron/tests/unit/plugins/ibm/test_sdnve_agent.py | 15 | 4482 | # Copyright 2014 IBM Corp.
#
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by a... | apache-2.0 |
percy-g2/Novathor_xperia_u8500 | 6.1.1.B.0.253/external/webkit/Tools/QueueStatusServer/model/queuestatus.py | 19 | 2103 | # Copyright (C) 2009 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... | gpl-2.0 |
vianuevm/Webparser | ENV/Lib/site-packages/werkzeug/wsgi.py | 146 | 37745 | # -*- coding: utf-8 -*-
"""
werkzeug.wsgi
~~~~~~~~~~~~~
This module implements WSGI related helpers.
:copyright: (c) 2014 by the Werkzeug Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
import re
import os
import sys
import posixpath
import mimetypes
from itert... | gpl-2.0 |
petewarden/tensorflow | tensorflow/python/compiler/tensorrt/test/memory_alignment_test.py | 25 | 2529 | # 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 |
SteveXiSong/ECE757-SnoopingPredictions | configs/topologies/Pt2Pt.py | 47 | 2741 | # Copyright (c) 2011 Advanced Micro Devices, Inc.
# 2011 Massachusetts Institute of Technology
# 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 r... | bsd-3-clause |
memo/tensorflow | tensorflow/python/ops/partitioned_variables.py | 132 | 12318 | # Copyright 2015 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 |
Gateworks/platform-external-chromium_org | third_party/protobuf/python/setup.py | 135 | 7881 | #! /usr/bin/python
#
# See README for usage instructions.
import sys
import os
import subprocess
# We must use setuptools, not distutils, because we need to use the
# namespace_packages option for the "google" package.
try:
from setuptools import setup, Extension
except ImportError:
try:
from ez_setup import u... | bsd-3-clause |
nischalshrestha/recognize | lib/httplib2/socks.py | 811 | 18459 | """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
... | mit |
cchamberlain/gyp | test/copies/gyptest-all.py | 100 | 1368 | #!/usr/bin/env python
# Copyright (c) 2009 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.
"""
Verifies file copies using an explicit build target of 'all'.
"""
import TestGyp
test = TestGyp.TestGyp()
test.run_gyp('copies.gyp',
... | bsd-3-clause |
Beauhurst/django | tests/modeladmin/tests.py | 23 | 26908 | from datetime import date
from django import forms
from django.contrib.admin.models import LogEntry
from django.contrib.admin.options import (
HORIZONTAL, VERTICAL, ModelAdmin, TabularInline,
)
from django.contrib.admin.sites import AdminSite
from django.contrib.admin.widgets import AdminDateWidget, AdminRadioSele... | bsd-3-clause |
dulems/hue | desktop/core/ext-py/Paste-1.7.2/paste/util/ip4.py | 27 | 9271 | # -*- coding: iso-8859-15 -*-
"""IP4 address range set implementation.
Implements an IPv4-range type.
Copyright (C) 2006, Heiko Wundram.
Released under the MIT-license.
"""
# Version information
# -------------------
__author__ = "Heiko Wundram <me@modelnine.org>"
__version__ = "0.2"
__revision__ = "3"
__date__ = "... | apache-2.0 |
annelida/stuff | Scrapy/activesport/activesport/settings.py | 1 | 3027 | # -*- coding: utf-8 -*-
# Scrapy settings for activesport project
#
# For simplicity, this file contains only settings considered important or
# commonly used. You can find more settings consulting the documentation:
#
# http://doc.scrapy.org/en/latest/topics/settings.html
# http://scrapy.readthedocs.org/en/la... | mit |
skosukhin/spack | var/spack/repos/builtin/packages/ncdu/package.py | 1 | 2257 | ##############################################################################
# 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 |
bbossola/katas | trains/core/biz.py | 1 | 5195 | from math import inf
class Context():
def __init__(self, max_len, direct=False, deep=False):
self._max_len = max_len
self._direct = direct
self._deep = deep
self._routes = []
def routes(self):
return self._routes
def max_depth(self):
return self._max_len
... | mit |
ahmed-mahran/hue | desktop/core/ext-py/kazoo-2.0/kazoo/security.py | 36 | 4365 | """Kazoo Security"""
from base64 import b64encode
from collections import namedtuple
import hashlib
# Represents a Zookeeper ID and ACL object
Id = namedtuple('Id', 'scheme id')
class ACL(namedtuple('ACL', 'perms id')):
"""An ACL for a Zookeeper Node
An ACL object is created by using an :class:`Id` object ... | apache-2.0 |
lyceel/engine | build/android/pylib/utils/json_results_generator_unittest.py | 87 | 7184 | # 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.
#
# Most of this file was ported over from Blink's
# webkitpy/layout_tests/layout_package/json_results_generator_unittest.py
#
import unittest
import json
... | bsd-3-clause |
dawnpower/nova | nova/cells/utils.py | 4 | 6298 | # Copyright (c) 2012 Rackspace Hosting
# 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 req... | apache-2.0 |
prepare/Blink_only_permissive_lic_files | Source/build/scripts/make_css_property_names.py | 8 | 7529 | #!/usr/bin/env python
import subprocess
import sys
import css_properties
import in_generator
import license
HEADER_TEMPLATE = """
%(license)s
#ifndef %(class_name)s_h
#define %(class_name)s_h
#include "core/css/parser/CSSParserMode.h"
#include "wtf/HashFunctions.h"
#include "wtf/HashTraits.h"
#include <string.h>
... | bsd-3-clause |
oscarolar/odoo | openerp/tools/__init__.py | 38 | 1428 | # -*- 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 |
kkdd/arangodb | 3rdParty/V8-4.3.61/third_party/python_26/Lib/lib2to3/fixes/fix_apply.py | 49 | 1894 | # Copyright 2006 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Fixer for apply().
This converts apply(func, v, k) into (func)(*v, **k)."""
# Local imports
from .. import pytree
from ..pgen2 import token
from .. import fixer_base
from ..fixer_util import Call, Comma, parenthesi... | apache-2.0 |
wshallum/ansible | lib/ansible/modules/network/nxos/nxos_pim_rp_address.py | 13 | 12732 | #!/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 distribut... | gpl-3.0 |
camilonova/django | tests/forms_tests/widget_tests/test_nullbooleanselect.py | 80 | 2067 | from django.forms import NullBooleanSelect
from django.test import override_settings
from django.utils import translation
from .base import WidgetTest
class NullBooleanSelectTest(WidgetTest):
widget = NullBooleanSelect()
def test_render_true(self):
self.check_html(self.widget, 'is_cool', True, html=... | bsd-3-clause |
google/syzygy | third_party/numpy/files/numpy/distutils/command/scons.py | 93 | 24248 | import os
import sys
import os.path
from os.path import join as pjoin, dirname as pdirname
from distutils.errors import DistutilsPlatformError
from distutils.errors import DistutilsExecError, DistutilsSetupError
from numpy.distutils.command.build_ext import build_ext as old_build_ext
from numpy.distutils.ccompiler im... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.