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 |
|---|---|---|---|---|---|
prashantas/MyDataScience | GeneralPython/PyDataStructure/multiValuedDict.py | 1 | 1163 | #http://code.activestate.com/recipes/52219-associating-multiple-values-with-each-key-in-a-dic/
#https://www.oreilly.com/library/view/python-cookbook/0596001673/ch01s06.html
def repeatedValue():
# this method allows duplicate values for the same key
d = dict()
# To add a key->value pair, do this:
#d.set... | bsd-2-clause |
redhat-openstack/ironic | ironic/tests/common/test_raid.py | 2 | 11093 | # Copyright 2014 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 applicabl... | apache-2.0 |
zjj/trac_hack | trac/upgrades/db24.py | 5 | 2911 | from trac.db import Table, Column, Index, DatabaseManager
def do_upgrade(env, ver, cursor):
# Change repository key from reponame to a surrogate id
cursor.execute("SELECT id FROM repository "
"UNION SELECT repos AS id FROM revision "
"UNION SELECT repos AS id FROM node_cha... | bsd-3-clause |
sauloal/cnidaria | scripts/venv/lib/python2.7/site-packages/matplotlib/testing/compare.py | 11 | 12935 | """
Provides a collection of utilities for comparing (image) results.
"""
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import six
import hashlib
import os
import shutil
import numpy as np
import matplotlib
from matplotlib.compat import subprocess
from... | mit |
ishank08/scikit-learn | sklearn/datasets/tests/test_base.py | 16 | 9390 | import os
import shutil
import tempfile
import warnings
import numpy
from pickle import loads
from pickle import dumps
from sklearn.datasets import get_data_home
from sklearn.datasets import clear_data_home
from sklearn.datasets import load_files
from sklearn.datasets import load_sample_images
from sklearn.datasets im... | bsd-3-clause |
duducosmos/pgs4a | python-install/lib/python2.7/test/test_string.py | 94 | 9159 | import unittest, string
from test import test_support, string_tests
from UserList import UserList
class StringTest(
string_tests.CommonTest,
string_tests.MixinStrStringUserStringTest
):
type2test = str
def checkequal(self, result, object, methodname, *args):
realresult = getattr(string, m... | lgpl-2.1 |
alianmohammad/pd-gem5-latest | src/arch/x86/isa/insts/general_purpose/rotate_and_shift/shift.py | 91 | 6764 | # 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 |
Jorge-Rodriguez/ansible | lib/ansible/module_utils/netapp_module.py | 25 | 9559 | # This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by Ansible
# still belong to the author of the module, and may assign their own license
# to the complete wo... | gpl-3.0 |
timsnyder/bokeh | bokeh/models/callbacks.py | 2 | 5701 | #-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2019, Anaconda, Inc., and Bokeh Contributors.
# All rights reserved.
#
# The full license is in the file LICENSE.txt, distributed with this software.
#-------------------------------------------------------------------... | bsd-3-clause |
lucidfrontier45/scikit-learn | sklearn/utils/tests/test_extmath.py | 2 | 8819 | # Authors: Olivier Grisel <olivier.grisel@ensta.org>
# Mathieu Blondel <mathieu@mblondel.org>
# License: BSD
import numpy as np
from scipy import sparse
from scipy import linalg
from scipy import stats
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_almost_equal
from sk... | bsd-3-clause |
user-none/calibre | src/calibre/devices/idevice/parse_xml.py | 14 | 11023 | #!/usr/bin/env python2
from __future__ import (unicode_literals, division, absolute_import,
print_function)
"""
https://github.com/ishikawa/python-plist-parser/blob/master/plist_parser.py
A `Property Lists`_ is a data representation used in Apple's Mac OS X as
a convenient way to store standar... | gpl-3.0 |
boxed/CMi | web_frontend/CMi/tvshows/api.py | 1 | 1578 | from django.template.loader import render_to_string
from django.conf.urls import patterns
from CMi.tvshows.models import Episode, Category
def tv_show_tile(title, episodes, category=None):
return (
10, render_to_string('tile.html', {
'url': '/tvshows/' + (('category/%s/' % category.pk) if categ... | mit |
khchine5/xl | lino_xl/lib/postings/mixins.py | 1 | 2368 | # -*- coding: UTF-8 -*-
# Copyright 2012-2016 Luc Saffre
#
# License: BSD (see file COPYING for details)
"""
Defines models for :mod:`lino_xl.lib.postings`.
"""
from django.contrib.contenttypes.models import ContentType
from django.utils.translation import ugettext_lazy as _
from lino.core import actions
from lino.... | bsd-2-clause |
0jpq0/kbengine | kbe/res/scripts/common/Lib/distutils/tests/test_dep_util.py | 147 | 2832 | """Tests for distutils.dep_util."""
import unittest
import os
import time
from distutils.dep_util import newer, newer_pairwise, newer_group
from distutils.errors import DistutilsFileError
from distutils.tests import support
from test.support import run_unittest
class DepUtilTestCase(support.TempdirManager, unittest.T... | lgpl-3.0 |
ibinti/intellij-community | python/helpers/pydev/third_party/pep8/lib2to3/lib2to3/pytree.py | 325 | 29039 | # Copyright 2006 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""
Python parse tree definitions.
This is a very concrete parse tree; we need to keep every token and
even the comments and whitespace between tokens.
There's also a pattern matching implementation here.
"""
__autho... | apache-2.0 |
UkiyoESoragoto/FAndroidProject | cocos2d/plugin/tools/toolsForGame/steps.py | 255 | 2302 | import sys, string, os
from Tkinter import *
# define class step
class step:
stepFrame = None
def initStep(self, root):
return
def checkStep(self):
return None
# define class step1
class step1(step):
step_entry = None
def initStep(self, root):
self.stepFrame = Frame(root)
... | mit |
espadrine/opera | chromium/src/third_party/python_26/Lib/distutils/config.py | 50 | 4292 | """distutils.pypirc
Provides the PyPIRCCommand class, the base class for the command classes
that uses .pypirc in the distutils.command package.
"""
import os
import sys
from ConfigParser import ConfigParser
from distutils.cmd import Command
DEFAULT_PYPIRC = """\
[distutils]
index-servers =
pypi
[pypi]
username... | bsd-3-clause |
nburn42/tensorflow | tensorflow/contrib/kfac/python/ops/utils_lib.py | 17 | 1719 | # 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 |
guewen/odoo | addons/account_asset/account_asset_invoice.py | 193 | 3070 | # -*- encoding: 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 G... | agpl-3.0 |
webgeodatavore/django | tests/template_tests/syntax_tests/test_url.py | 42 | 10811 | # coding: utf-8
from django.core.urlresolvers import NoReverseMatch, resolve
from django.template import RequestContext, TemplateSyntaxError
from django.test import RequestFactory, SimpleTestCase, override_settings
from ..utils import setup
@override_settings(ROOT_URLCONF='template_tests.urls')
class UrlTagTests(Sim... | bsd-3-clause |
eadgarchen/tensorflow | tensorflow/python/keras/_impl/keras/applications/vgg16.py | 9 | 8908 | # 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 |
loco-odoo/localizacion_co | openerp/addons-extra/procurement_purchase_forecast-8.0.1.0/procurement_sale_forecast/wizard/make_procurement.py | 24 | 1517 | # -*- encoding: utf-8 -*-
##############################################################################
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the... | agpl-3.0 |
loco-odoo/localizacion_co | openerp/addons/account/report/account_general_journal.py | 381 | 7669 | # -*- 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 |
caisq/tensorflow | tensorflow/python/ops/math_ops_test.py | 6 | 18203 | # 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 |
undoware/neutron-drive | google_appengine/google/appengine/_internal/django/utils/numberformat.py | 23 | 1676 | from google.appengine._internal.django.conf import settings
from google.appengine._internal.django.utils.safestring import mark_safe
def format(number, decimal_sep, decimal_pos, grouping=0, thousand_sep=''):
"""
Gets a number (as a number or string), and returns it as a string,
using formats definied as a... | bsd-3-clause |
codenote/chromium-test | tools/sort-headers.py | 4 | 4369 | #!/usr/bin/env python
# Copyright (c) 2012 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.
"""Given a filename as an argument, sort the #include/#imports in that file.
Shows a diff and prompts for confirmation before doin... | bsd-3-clause |
romankagan/DDBWorkbench | python/testData/inspections/PyMethodMayBeStaticInspection/abc.py | 488 | 7145 | # Copyright 2007 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Abstract Base Classes (ABCs) according to PEP 3119."""
import types
from _weakrefset import WeakSet
# Instance of old-style class
class _C: pass
_InstanceType = type(_C())
def abstractmethod(funcobj):
"""A d... | apache-2.0 |
sdague/home-assistant | tests/components/conversation/test_util.py | 26 | 2111 | """Test the conversation utils."""
from homeassistant.components.conversation.util import create_matcher
def test_create_matcher():
"""Test the create matcher method."""
# Basic sentence
pattern = create_matcher("Hello world")
assert pattern.match("Hello world") is not None
# Match a part
pat... | apache-2.0 |
Wojtechnology/Muzit | StreetMuse/lib/python3.4/site-packages/pip/_vendor/distlib/compat.py | 203 | 40541 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2013-2014 Vinay Sajip.
# Licensed to the Python Software Foundation under a contributor agreement.
# See LICENSE.txt and CONTRIBUTORS.txt.
#
from __future__ import absolute_import
import os
import re
import sys
if sys.version_info[0] < 3:
from StringIO import StringIO
... | apache-2.0 |
ajyoon/brown | tests/mocks/mock_graphic_object_interface.py | 1 | 1231 | from PyQt5 import QtWidgets
from brown.core.brush_pattern import BrushPattern
from brown.core.pen_cap_style import PenCapStyle
from brown.core.pen_join_style import PenJoinStyle
from brown.core.pen_pattern import PenPattern
from brown.interface.brush_interface import BrushInterface
from brown.interface.graphic_object_... | gpl-3.0 |
rayleigh0407/Hackathon-Bot | MySQL-python-1.2.5/tests/test_MySQLdb_dbapi20.py | 41 | 7818 | #!/usr/bin/env python
import dbapi20
import unittest
import MySQLdb
from configdb import connection_kwargs
import warnings
warnings.simplefilter("ignore")
class test_MySQLdb(dbapi20.DatabaseAPI20Test):
driver = MySQLdb
connect_args = ()
connect_kw_args = connection_kwargs(dict(sql_mode="ANSI,STR... | mit |
DGrady/pandas | asv_bench/benchmarks/io_sql.py | 7 | 4120 | import sqlalchemy
from .pandas_vb_common import *
import sqlite3
from sqlalchemy import create_engine
#-------------------------------------------------------------------------------
# to_sql
class WriteSQL(object):
goal_time = 0.2
def setup(self):
self.engine = create_engine('sqlite:///:memory:')
... | bsd-3-clause |
KnoxMakers/KM-Laser | extensions/km_deps/future/moves/urllib/parse.py | 13 | 1045 | from __future__ import absolute_import
from future.standard_library import suspend_hooks
from future.utils import PY3
if PY3:
from urllib.parse import *
else:
__future_module__ = True
from urlparse import (ParseResult, SplitResult, parse_qs, parse_qsl,
urldefrag, urljoin, urlpars... | gpl-3.0 |
jbassen/edx-platform | common/djangoapps/service_status/views.py | 188 | 1296 | """
Django Views for service status app
"""
import json
import time
from django.http import HttpResponse
from dogapi import dog_stats_api
from service_status import tasks
from djcelery import celery
from celery.exceptions import TimeoutError
def index(_):
"""
An empty view
"""
return HttpResponse(... | agpl-3.0 |
idea4bsd/idea4bsd | python/helpers/pydev/third_party/pep8/lib2to3/lib2to3/fixes/fix_execfile.py | 324 | 1998 | # Copyright 2006 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Fixer for execfile.
This converts usages of the execfile function into calls to the built-in
exec() function.
"""
from .. import fixer_base
from ..fixer_util import (Comma, Name, Call, LParen, RParen, Dot, Node,
... | apache-2.0 |
Flexget/Flexget | flexget/components/trakt/cli.py | 3 | 4480 | from flexget import options, plugin
from flexget.event import event
from flexget.manager import Session
from flexget.terminal import TerminalTable, TerminalTableError, console, table_parser
from . import db
def action_auth(options):
if not (options.account):
console(
'You must specify an acco... | mit |
wubr2000/zipline | tests/risk/upload_answer_key.py | 43 | 1923 | #
# Copyright 2013 Quantopian, 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 wr... | apache-2.0 |
thonkify/thonkify | src/lib/gcloud/test_client.py | 2 | 7021 | # Copyright 2015 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... | mit |
ToqueWillot/M2DAC | RDFIA/TME3-4/codesTME3-4/learning/libsvm/python/svmutil.py | 13 | 8119 | #!/usr/bin/env python
from svm import *
def svm_read_problem(data_file_name):
"""
svm_read_problem(data_file_name) -> [y, x]
Read LIBSVM-format data from data_file_name and return labels y
and data instances x.
"""
prob_y = []
prob_x = []
for line in open(data_file_name):
line = line.split(None, 1)
# In ... | gpl-2.0 |
jiangzhonghui/viewfinder | marketing/tornado/test/escape_test.py | 47 | 10024 | #!/usr/bin/env python
from __future__ import absolute_import, division, print_function, with_statement
import tornado.escape
from tornado.escape import utf8, xhtml_escape, xhtml_unescape, url_escape, url_unescape, to_unicode, json_decode, json_encode
from tornado.util import u, unicode_type, bytes_type
from tornado.... | apache-2.0 |
mrgloom/h2o-3 | h2o-py/tests/testdir_jira/pyunit_NOPASS_pubdev_1388_offset_comparisons.py | 3 | 2998 | import sys
sys.path.insert(1, "../../")
import h2o
def offset_1388(ip, port):
print "Loading datasets..."
pros_hex = h2o.import_file(h2o.locate("smalldata/prostate/prostate.csv"))
pros_hex[1] = pros_hex[1].asfactor()
pros_hex[3] = pros_hex[3].asfactor()
pros_hex[4] = pros_hex[4].asfactor()
... | apache-2.0 |
aagavin/Friday-Flair-Python-reddit-api | reddit/helpers.py | 1 | 3568 | # This file is part of reddit_api.
#
# reddit_api 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.
#
# reddit_api is distributed in the ... | gpl-3.0 |
JoelBender/bacpypes | tests/test_constructed_data/helpers.py | 1 | 2570 | #!/usr/bin/python
"""
Helper classes for constructed data tests.
"""
from bacpypes.debugging import bacpypes_debugging, ModuleLogger, xtob
from bacpypes.errors import MissingRequiredParameter
from bacpypes.primitivedata import Boolean, Integer, Tag, TagList
from bacpypes.constructeddata import Element, Sequence
# s... | mit |
iansprice/wagtail | wagtail/project_template/home/migrations/0002_create_homepage.py | 10 | 1686 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
def create_homepage(apps, schema_editor):
# Get models
ContentType = apps.get_model('contenttypes.ContentType')
Page = apps.get_model('wagtailcore.Page')
Site = apps.get_model('wagtailcore.Site')
Home... | bsd-3-clause |
agentr13/python-phonenumbers | python/tests/testdata/region_BS.py | 7 | 1600 | """Auto-generated file, do not edit by hand. BS metadata"""
from phonenumbers.phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_BS = PhoneMetadata(id='BS', country_code=1, international_prefix='011',
general_desc=PhoneNumberDesc(national_number_pattern='(242|8(00|66|77|88)|900)\\d{7}... | apache-2.0 |
inspyration/odoo | addons/auth_openid/controllers/__init__.py | 443 | 1033 | ##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2011 OpenERP SA (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public L... | agpl-3.0 |
caveman-dick/ansible | test/units/modules/network/nxos/test_nxos_evpn_vni.py | 47 | 2744 | # (c) 2016 Red Hat Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is dis... | gpl-3.0 |
JackDandy/SickGear | lib/chardet/escsm.py | 8 | 10756 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org 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 Reserved.
... | gpl-3.0 |
Qalthos/ansible | lib/ansible/utils/unsafe_proxy.py | 41 | 4247 | # PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2
# --------------------------------------------
#
# 1. This LICENSE AGREEMENT is between the Python Software Foundation
# ("PSF"), and the Individual or Organization ("Licensee") accessing and
# otherwise using this software ("Python") in source or binary form and
# its ass... | gpl-3.0 |
gedakc/manuskript | manuskript/ui/exporters/exporter_ui.py | 2 | 3647 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'manuskript/ui/exporters/exporter_ui.ui'
#
# Created: Fri Apr 8 12:22:37 2016
# by: PyQt5 UI code generator 5.2.1
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_exporter(ob... | gpl-3.0 |
thiriel/maps | django/contrib/webdesign/templatetags/webdesign.py | 350 | 2196 | from django.contrib.webdesign.lorem_ipsum import words, paragraphs
from django import template
register = template.Library()
class LoremNode(template.Node):
def __init__(self, count, method, common):
self.count, self.method, self.common = count, method, common
def render(self, context):
try:
... | bsd-3-clause |
Kiiv/CouchPotatoServer | couchpotato/core/media/movie/providers/trailer/youtube_dl/extractor/xboxclips.py | 22 | 2035 | # encoding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
parse_iso8601,
float_or_none,
int_or_none,
)
class XboxClipsIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?xboxclips\.com/video\.php\?.*vid=(?P<id>[\w-]{36})'
_TEST =... | gpl-3.0 |
funkybob/django-email-template | tests/email_template_tests/tests.py | 2 | 4422 | from functools import partial
from django.template import Template
from django.test import TestCase
from django.test.client import RequestFactory
from django.test.utils import (
setup_test_template_loader,
restore_template_loaders,
)
from email_template.email import (
render_django_fields,
send_base,
... | mit |
dataxu/ansible | lib/ansible/module_utils/network/asa/asa.py | 86 | 5729 | # This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by Ansible
# still belong to the author of the module, and may assign their own license
# to the complete wo... | gpl-3.0 |
maxdeliso/elevatorSim | Lib/distutils/command/config.py | 151 | 13092 | """distutils.command.config
Implements the Distutils 'config' command, a (mostly) empty command class
that exists mainly to be sub-classed by specific module distributions and
applications. The idea is that while every "config" command is different,
at least they're all named the same, and users always see "config" i... | bsd-2-clause |
merenlab/anvio | anvio/drivers/MODELLER.py | 1 | 40930 | # coding: utf-8
"""
Interface to MODELLER (https://salilab.org/modeller/).
"""
import os
import anvio
import shutil
import argparse
import subprocess
import pandas as pd
import anvio.utils as utils
import anvio.fastalib as u
import anvio.terminal as terminal
import anvio.constants as constants
import anvio.filesnpath... | gpl-3.0 |
awkspace/ansible | test/runner/lib/cloud/aws.py | 12 | 3262 | """AWS plugin for integration tests."""
from __future__ import absolute_import, print_function
import os
from lib.util import (
ApplicationError,
display,
is_shippable,
)
from lib.cloud import (
CloudProvider,
CloudEnvironment,
)
from lib.core_ci import (
AnsibleCoreCI,
)
class AwsCloudPro... | gpl-3.0 |
odejesush/tensorflow | venv/lib/python2.7/site-packages/werkzeug/contrib/atom.py | 259 | 15588 | # -*- coding: utf-8 -*-
"""
werkzeug.contrib.atom
~~~~~~~~~~~~~~~~~~~~~
This module provides a class called :class:`AtomFeed` which can be
used to generate feeds in the Atom syndication format (see :rfc:`4287`).
Example::
def atom_feed(request):
feed = AtomFeed("My Blog", feed... | apache-2.0 |
aequitas/home-assistant | homeassistant/components/smhi/weather.py | 2 | 6958 | """Support for the Swedish weather institute weather service."""
import asyncio
from datetime import timedelta
import logging
from typing import Dict, List
import aiohttp
import async_timeout
from homeassistant.components.weather import (
ATTR_FORECAST_CONDITION, ATTR_FORECAST_PRECIPITATION, ATTR_FORECAST_TEMP,
... | apache-2.0 |
huijunwu/heron | heronpy/streamlet/impl/reducebykeyandwindowbolt.py | 1 | 5269 | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
# 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... | apache-2.0 |
jeanlinux/calibre | src/calibre/ebooks/compression/tcr.py | 24 | 5143 | # -*- coding: utf-8 -*-
__license__ = 'GPL 3'
__copyright__ = '2009, John Schember <john@nachtimwald.com>'
__docformat__ = 'restructuredtext en'
import re
class TCRCompressor(object):
'''
TCR compression takes the form header+code_dict+coded_text.
The header is always "!!8-Bit!!". The code dict is a list... | gpl-3.0 |
dana-i2cat/felix | modules/resource/manager/stitching-entity/src/core/utils/credentials.py | 2 | 10070 | #!/usr/bin/python
#----------------------------------------------------------------------
# Copyright (c) 2011 Raytheon BBN Technologies
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and/or hardware specification (the "Work") to
# deal in the Work without restricti... | apache-2.0 |
monikagrabowska/osf.io | addons/base/testing/logger.py | 11 | 1786 | import abc
from nose.tools import * # noqa (PEP8 asserts)
from framework.auth import Auth
from tests.factories import AuthUserFactory, ProjectFactory
class AddonNodeLoggerTestSuiteMixinBase(object):
__metaclass__ = abc.ABCMeta
@abc.abstractproperty
def addon_short_name(self):
pass
@abc.ab... | apache-2.0 |
terrameijar/oppia | main_taskqueue.py | 11 | 1803 | # Copyright 2016 The Oppia 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 |
cpcloud/oh-my-zsh | plugins/git-prompt/gitstatus.py | 343 | 2372 | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
from subprocess import Popen, PIPE
import re
# change those symbols to whatever you prefer
symbols = {
'ahead of': '↑',
'behind': '↓',
'staged': '♦',
'changed': '‣',
'untracked': '…',
'clean': '⚡',
'unmerged': '≠',
'sha1': ':'
}
output, err... | mit |
bloomberg/chef-bcpc | virtual/bin/generate-chef-databags.py | 1 | 1488 | #!/usr/bin/env python3
# Copyright 2020, Bloomberg Finance 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... | apache-2.0 |
leuschel/logen | old_logen/pylogen/Pmw/Pmw_1_2/tests/Options_test.py | 3 | 10791 | # This tests Pmw option and component handling.
import Tkinter
import Test
import Pmw
Test.initialise()
"""
Definitions:
initialisation option: an option that can be set in the call
to the constructor but not in configure()
configuration option: an option that can be set in the call
to the construc... | apache-2.0 |
jylaxp/django | django/core/management/commands/startproject.py | 503 | 1359 | from importlib import import_module
from django.core.management.base import CommandError
from django.core.management.templates import TemplateCommand
from django.utils.crypto import get_random_string
class Command(TemplateCommand):
help = ("Creates a Django project directory structure for the given "
... | bsd-3-clause |
julianprabhakar/eden_car | modules/unit_tests/s3/s3validators.py | 6 | 9762 | # -*- coding: utf-8 -*-
#
# Validators Unit Tests
#
# To run this script use:
# python web2py.py -S eden -M -R applications/eden/modules/unit_tests/s3/s3validators.py
#
import unittest
from gluon import current
from s3.s3fields import *
from s3.s3validators import *
# =================================================... | mit |
shahankhatch/scikit-learn | sklearn/decomposition/dict_learning.py | 104 | 44632 | """ Dictionary learning
"""
from __future__ import print_function
# Author: Vlad Niculae, Gael Varoquaux, Alexandre Gramfort
# License: BSD 3 clause
import time
import sys
import itertools
from math import sqrt, ceil
import numpy as np
from scipy import linalg
from numpy.lib.stride_tricks import as_strided
from ..b... | bsd-3-clause |
dgarros/ansible | lib/ansible/modules/monitoring/zabbix_group.py | 35 | 7601 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2013-2014, Epic Games, Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# ... | gpl-3.0 |
EarthTeam/earthteam.net | sites/all/modules/olfp/lib/OL-FeaturePopups/doc/_scripts/split-classes.py | 5 | 1689 | #!/usr/bin/env python
import re
import os
import sys
import shutil
def splitClasses (inputFilename, outputDirectory, clear):
print "Splitting classes, input: %s output: %s " % (inputFilename, outputDirectory)
if not os.path.isfile(inputFilename):
print "\nProcess aborted due to errors."
sys.e... | gpl-2.0 |
ltilve/ChromiumGStreamerBackend | ios/crnet/build.py | 33 | 9894 | #!/usr/bin/env python
# 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 argparse
import os
import shutil
import subprocess
import sys
import tempfile
import time
SUPPORTED_ARCHES = ['i386', 'x86_64'... | bsd-3-clause |
umitproject/packet-manipulator | umit/pm/gui/core/app.py | 2 | 5811 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2008, 2009 Adriano Monteiro Marques
#
# Author: Francesco Piccinno <stack.box@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 Found... | gpl-2.0 |
noba3/KoTos | addons/plugin.video.genesis/resources/lib/indexers/phstreams.py | 28 | 28077 | # -*- coding: utf-8 -*-
'''
Phoenix Add-on
Copyright (C) 2015 Blazetamer
Copyright (C) 2015 lambda
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 Lic... | gpl-2.0 |
netscaler/horizon | openstack_dashboard/dashboards/project/databases/urls.py | 10 | 1085 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright 2013 Rackspace Hosting
#
# 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.... | apache-2.0 |
ChinaQuants/zipline | zipline/utils/data.py | 31 | 12761 | #
# Copyright 2013 Quantopian, 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 wr... | apache-2.0 |
metamx/Diamond | src/diamond/handler/graphitepickle.py | 8 | 3126 | # coding=utf-8
"""
Send metrics to a [graphite](http://graphite.wikidot.com/) using the high
performace pickle interface.
Graphite is an enterprise-scale monitoring tool that runs well on cheap
hardware. It was originally designed and written by Chris Davis at Orbitz in
2006 as side project that ultimately grew to be... | mit |
zooba/PTVS | Python/Product/Miniconda/Miniconda3-x64/Lib/site-packages/pip/_vendor/distlib/compat.py | 60 | 41404 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2013-2017 Vinay Sajip.
# Licensed to the Python Software Foundation under a contributor agreement.
# See LICENSE.txt and CONTRIBUTORS.txt.
#
from __future__ import absolute_import
import os
import re
import sys
try:
import ssl
except ImportError: # pragma: no cover
s... | apache-2.0 |
DavidLP/home-assistant | tests/components/automation/test_time_pattern.py | 11 | 6175 | """The tests for the time_pattern automation."""
import pytest
from homeassistant.setup import async_setup_component
import homeassistant.util.dt as dt_util
import homeassistant.components.automation as automation
from tests.common import async_fire_time_changed, mock_component
from tests.components.automation import... | apache-2.0 |
livingbio/Snoopy | snoopy/server/bin/sslstripSnoopy/build/lib.linux-i686-2.7/sslstrip/StrippingProxy.py | 108 | 1244 | # Copyright (c) 2004-2009 Moxie Marlinspike
#
# 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 distri... | mit |
realestate-com-au/python-dashing | dashmat/core_modules/splunk/splunk-sdk-1.3.0/setup.py | 2 | 7139 | #!/usr/bin/env python
#
# Copyright 2011-2014 Splunk, 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... | mit |
indictranstech/phrerp | erpnext/support/doctype/maintenance_visit/maintenance_visit.py | 32 | 3160 | # 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 import _
from erpnext.utilities.transaction_base import TransactionBase
class MaintenanceVisit(TransactionBase):
def ge... | agpl-3.0 |
glaubitz/fs-uae-debian | arcade/OpenGL/GL/NV/vertex_array_range2.py | 9 | 1375 | '''OpenGL extension NV.vertex_array_range2
This module customises the behaviour of the
OpenGL.raw.GL.NV.vertex_array_range2 to provide a more
Python-friendly API
Overview (from the spec)
Enabling and disabling the vertex array range is specified by the
original NV_vertex_array_range extension specification to f... | gpl-2.0 |
ProfessionalIT/maxigenios-website | sdk/google_appengine/lib/protorpc-1.0/protorpc/wsgi/util.py | 13 | 6087 | #!/usr/bin/env python
#
# Copyright 2011 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... | mit |
mcella/django | tests/generic_views/urls.py | 52 | 14592 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.conf.urls import url
from django.contrib.auth import views as auth_views
from django.contrib.auth.decorators import login_required
from django.views.decorators.cache import cache_page
from django.views.generic import TemplateView
from . impor... | bsd-3-clause |
ecavalcanti/TodoList | plugins/ti.alloy/plugin.py | 229 | 4668 | import os, sys, subprocess, hashlib
import subprocess
def check_output(*popenargs, **kwargs):
r"""Run command with arguments and return its output as a byte string.
Backported from Python 2.7 as it's implemented as pure python on stdlib.
>>> check_output(['/usr/bin/python', '--version'])
Python 2.6.... | apache-2.0 |
malishevg/edugraph | common/djangoapps/util/tests/test_submit_feedback.py | 46 | 14588 | """Tests for the Zendesk"""
from django.contrib.auth.models import AnonymousUser
from django.http import Http404
from django.test import TestCase
from django.test.client import RequestFactory
from django.test.utils import override_settings
from student.tests.factories import UserFactory
from util import views
from zen... | agpl-3.0 |
jbassen/edx-platform | openedx/core/djangoapps/call_stack_manager/core.py | 40 | 5250 | """
Get call stacks of Model Class
in three cases-
1. QuerySet API
2. save()
3. delete()
classes:
CallStackManager - stores all stacks in global dictionary and logs
CallStackMixin - used for Model save(), and delete() method
Functions:
capture_call_stack - global function used to store call stack
Decorators:
donott... | agpl-3.0 |
gauribhoite/personfinder | env/site-packages/docutils/writers/docutils_xml.py | 108 | 6981 | # $Id: docutils_xml.py 7497 2012-08-16 15:17:29Z milde $
# Author: David Goodger, Paul Tremblay, Guenter Milde
# Maintainer: docutils-develop@lists.sourceforge.net
# Copyright: This module has been placed in the public domain.
"""
Simple document tree Writer, writes Docutils XML according to
http://docutils.sourceforg... | apache-2.0 |
Pablo126/SSBW | Tarea4/tarea4/lib/python3.5/site-packages/pkg_resources/_vendor/six.py | 2715 | 30098 | """Utilities for writing code that runs on Python 2 and 3"""
# Copyright (c) 2010-2015 Benjamin Peterson
#
# 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 with... | gpl-3.0 |
mahak/keystone | keystone/limit/backends/base.py | 2 | 5766 | # Copyright 2017 SUSE Linux Gmbh
# Copyright 2017 Huawei
#
# 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 |
sharbison3/python-docs-samples | bigtable/autoscaler/autoscaler_test.py | 1 | 2682 | # Copyright 2017 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 |
nelmiux/CarnotKE | jyhton/lib-python/2.7/compiler/syntax.py | 369 | 1444 | """Check for errs in the AST.
The Python parser does not catch all syntax errors. Others, like
assignments with invalid targets, are caught in the code generation
phase.
The compiler package catches some errors in the transformer module.
But it seems clearer to write checkers that use the AST to detect
errors.
"""
... | apache-2.0 |
infinyte/oppia | extensions/rules/set_of_unicode_string.py | 20 | 2309 | # coding: utf-8
#
# Copyright 2014 The Oppia 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 requi... | apache-2.0 |
HesselTjeerdsma/Cyber-Physical-Pacman-Game | Algor/flask/lib/python2.7/site-packages/unidecode/x0a1.py | 253 | 4469 | data = (
'dit', # 0x00
'dix', # 0x01
'di', # 0x02
'dip', # 0x03
'diex', # 0x04
'die', # 0x05
'diep', # 0x06
'dat', # 0x07
'dax', # 0x08
'da', # 0x09
'dap', # 0x0a
'duox', # 0x0b
'duo', # 0x0c
'dot', # 0x0d
'dox', # 0x0e
'do', # 0x0f
'dop', # 0x10
'dex', # 0x11
'de',... | apache-2.0 |
pjg101/SickRage | lib/babelfish/exceptions.py | 88 | 2332 | # -*- coding: utf-8 -*-
#
# Copyright (c) 2013 the BabelFish authors. All rights reserved.
# Use of this source code is governed by the 3-clause BSD license
# that can be found in the LICENSE file.
#
from __future__ import unicode_literals
class Error(Exception):
"""Base class for all exceptions in babelfish"""
... | gpl-3.0 |
sidartaoliveira/ansible | lib/ansible/modules/cloud/pubnub/pubnub_blocks.py | 42 | 24312 | #!/usr/bin/python
#
# PubNub Real-time Cloud-Hosted Push API and Push Notification Client
# Frameworks
# Copyright (C) 2016 PubNub Inc.
# http://www.pubnub.com/
# http://www.pubnub.com/terms
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License a... | gpl-3.0 |
havard024/prego | venv/lib/python2.7/site-packages/django/contrib/localflavor/nl/forms.py | 100 | 2867 | """
NL-specific Form helpers
"""
from __future__ import absolute_import, unicode_literals
import re
from django.contrib.localflavor.nl.nl_provinces import PROVINCE_CHOICES
from django.core.validators import EMPTY_VALUES
from django.forms import ValidationError
from django.forms.fields import Field, Select
from djang... | mit |
frederica07/Dragon_Programming_Process | PyOpenGL-3.0.2/OpenGL/GL/NV/gpu_program5.py | 2 | 5971 | '''OpenGL extension NV.gpu_program5
This module customises the behaviour of the
OpenGL.raw.GL.NV.gpu_program5 to provide a more
Python-friendly API
Overview (from the spec)
This specification documents the common instruction set and basic
functionality provided by NVIDIA's 5th generation of assembly instruction... | bsd-2-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.