repo_name stringlengths 5 100 | path stringlengths 4 375 | copies stringclasses 991
values | size stringlengths 4 7 | content stringlengths 666 1M | license stringclasses 15
values |
|---|---|---|---|---|---|
Teagan42/home-assistant | homeassistant/components/trend/binary_sensor.py | 5 | 6698 | """A sensor that monitors trends in other components."""
from collections import deque
import logging
import math
import numpy as np
import voluptuous as vol
from homeassistant.components.binary_sensor import (
DEVICE_CLASSES_SCHEMA,
ENTITY_ID_FORMAT,
PLATFORM_SCHEMA,
BinarySensorDevice,
)
from homeas... | apache-2.0 |
arista-eosplus/ansible | lib/ansible/modules/utilities/logic/wait_for.py | 7 | 22390 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2012, Jeroen Hoekx <jeroen@hoekx.be>
#
# 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 Licens... | gpl-3.0 |
tedder/ansible-modules-core | network/dellos10/dellos10_template.py | 5 | 5713 | #!/usr/bin/python
#
# (c) 2015 Peter Sprygada, <psprygada@ansible.com>
#
# Copyright (c) 2016 Dell 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 versi... | gpl-3.0 |
sandeepkoduri/GAE-html-to-pdf | libs/reportlab/pdfgen/pdfgeom.py | 3 | 2993 | #Copyright ReportLab Europe Ltd. 2000-2017
#see license.txt for license details
#history http://www.reportlab.co.uk/cgi-bin/viewcvs.cgi/public/reportlab/trunk/reportlab/pdfgen/pdfgeom.py
__version__='3.3.0'
__doc__="""
This module includes any mathematical methods needed for PIDDLE.
It should have no dependencies beyon... | mit |
hubsaysnuaa/odoo | addons/account/project/wizard/account_analytic_cost_ledger_for_journal_report.py | 378 | 2209 | # -*- 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 |
hyowon/servo | tests/wpt/web-platform-tests/tools/html5lib/html5lib/inputstream.py | 618 | 30855 | from __future__ import absolute_import, division, unicode_literals
from six import text_type
from six.moves import http_client
import codecs
import re
from .constants import EOF, spaceCharacters, asciiLetters, asciiUppercase
from .constants import encodings, ReparseException
from . import utils
from io import String... | mpl-2.0 |
prune998/ansible | lib/ansible/modules/cloud/azure/azure_rm_virtualnetwork.py | 56 | 13795 | #!/usr/bin/python
#
# Copyright (c) 2016 Matt Davis, <mdavis@ansible.com>
# Chris Houseknecht, <house@redhat.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 Soft... | gpl-3.0 |
glwu/python-for-android | python-modules/twisted/twisted/python/procutils.py | 61 | 1380 | # Copyright (c) 2001-2004 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Utilities for dealing with processes.
"""
import os
def which(name, flags=os.X_OK):
"""Search PATH for executable files with the given name.
On newer versions of MS-Windows, the PATHEXT environment variable will be
... | apache-2.0 |
jcurbelo/networkx | networkx/algorithms/traversal/tests/test_bfs.py | 41 | 1362 | #!/usr/bin/env python
from nose.tools import *
import networkx as nx
class TestBFS:
def setUp(self):
# simple graph
G = nx.Graph()
G.add_edges_from([(0, 1), (1, 2), (1, 3), (2, 4), (3, 4)])
self.G = G
def test_successor(self):
assert_equal(nx.bfs_successors(self.G, so... | bsd-3-clause |
bbengfort/email-analysis | mailstat/console.py | 1 | 2516 | # mailstat.console
# Console utilities for mailstat
#
# Author: Benjamin Bengfort <benjamin@bengfort.com>
# Created: Sun Dec 29 15:57:44 2013 -0600
#
# Copyright (C) 2013 Bengfort.com
# For license information, see LICENSE.txt
#
# ID: console.py [] benjamin@bengfort.com $
"""
Console utilities for mailstat
"""
###... | mit |
percyfal/bokeh | examples/models/file/colorspec.py | 12 | 2172 | from __future__ import print_function
from bokeh.util.browser import view
from bokeh.document import Document
from bokeh.embed import file_html
from bokeh.models.glyphs import Circle
from bokeh.models import (
Plot, DataRange1d, LinearAxis, ColumnDataSource, PanTool, WheelZoomTool
)
from bokeh.resources import INL... | bsd-3-clause |
saisai/httpie | tests/test_auth.py | 42 | 2311 | """HTTP authentication-related tests."""
import requests
import pytest
from utils import http, add_auth, HTTP_OK, TestEnvironment
import httpie.input
import httpie.cli
class TestAuth:
def test_basic_auth(self, httpbin):
r = http('--auth=user:password',
'GET', httpbin.url + '/basic-auth/u... | bsd-3-clause |
d120/pyophase | staff/migrations/0016_auto_20170209_2025.py | 1 | 3406 | # -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-02-09 19:25
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('ophasebase', '0004_auto_20170209_2025'),
('exam', '... | agpl-3.0 |
1stvamp/dh-virtualenv | dh_virtualenv/deployment.py | 1 | 7890 | # -*- coding: utf-8 -*-
# Copyright (c) 2013 - 2014 Spotify AB
# This file is part of dh-virtualenv.
# dh-virtualenv 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 ... | gpl-2.0 |
safawo/antlr4 | runtime/Python2/src/antlr4/error/ErrorStrategy.py | 14 | 30951 | #
# [The "BSD license"]
# Copyright (c) 2012 Terence Parr
# Copyright (c) 2012 Sam Harwell
# Copyright (c) 2014 Eric Vergnaud
# 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. Redis... | bsd-3-clause |
Metaswitch/calico-neutron | neutron/plugins/ml2/managers.py | 2 | 31941 | # Copyright (c) 2013 OpenStack Foundation
# 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 ... | apache-2.0 |
bourreauEric/or-tools | examples/python/blending.py | 34 | 3639 | # Copyright 2011 Hakan Kjellerstrand hakank@bonetmail.com
#
# 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 |
icaoberg/cellorganizer-galaxy-tools | datatypes/display_applications/application.py | 1 | 15670 | # Contains objects for using external display applications
import logging
import urllib
from six import string_types
from urllib import quote_plus
from copy import deepcopy
from galaxy.util import parse_xml, string_as_bool
from galaxy.util.odict import odict
from galaxy.util.template import fill_template
from galaxy.w... | gpl-3.0 |
tuhangdi/django | django/db/models/sql/datastructures.py | 270 | 5619 | """
Useful auxiliary data structures for query construction. Not useful outside
the SQL domain.
"""
from django.db.models.sql.constants import INNER, LOUTER
class EmptyResultSet(Exception):
pass
class MultiJoin(Exception):
"""
Used by join construction code to indicate the point at which a
multi-val... | bsd-3-clause |
prutseltje/ansible | test/units/modules/network/ovs/ovs_module.py | 73 | 2381 | # (c) 2017 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 |
caseyrygt/osf.io | api_tests/nodes/views/test_node_registrations_list.py | 4 | 3386 | # -*- coding: utf-8 -*-
from nose.tools import * # flake8: noqa
from urlparse import urlparse
from api.base.settings.defaults import API_BASE
from tests.base import ApiTestCase
from tests.factories import (
ProjectFactory,
RegistrationFactory,
AuthUserFactory
)
node_url_for = lambda n_id: '/{}nodes/{}/'... | apache-2.0 |
lbartoletti/QGIS | tests/src/python/test_qgslayoutatlas.py | 29 | 30990 | # -*- coding: utf-8 -*-
"""QGIS Unit tests for QgsLayoutAtlas
.. note:: This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
"""
__a... | gpl-2.0 |
cchurch/ansible | lib/ansible/modules/network/f5/bigip_ike_peer.py | 38 | 25680 | #!/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 |
StephenOrJames/aviation_weather | tests/components/test_wind.py | 2 | 1744 | import unittest
from aviation_weather import Wind
from aviation_weather.exceptions import WindDecodeError
class TestWind(unittest.TestCase):
"""Unit tests for aviation_weather.components.wind.Wind"""
def _test_valid(self, raw, direction, speed, gusts, variable):
w = Wind(raw)
self.assertEqual... | mit |
weiweihuanghuang/wei-glyphs-scripts | Text/html2text/config.py | 3 | 3846 | from __future__ import unicode_literals
import re
# Use Unicode characters instead of their ascii pseudo-replacements
UNICODE_SNOB = 0
# Marker to use for marking tables for padding post processing
TABLE_MARKER_FOR_PAD = "special_marker_for_table_padding"
# Escape all special characters. Output is less readable, bu... | apache-2.0 |
timothycrosley/hug | hug/authentication.py | 1 | 5571 | """hug/authentication.py
Provides the basic built-in authentication helper functions
Copyright (C) 2016 Timothy Edmund Crosley
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 restrictio... | mit |
zanderle/django | django/conf/locale/ka/formats.py | 504 | 2180 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'l, j F, Y'
TIME_FORMAT = 'h:i a'
... | bsd-3-clause |
Karaage-Cluster/karaage-srs | docs/conf.py | 1 | 9074 | # -*- coding: utf-8 -*-
#
# Karaage documentation build configuration file, created by
# sphinx-quickstart on Thu Jan 16 14:28:57 2014.
#
# 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... | gpl-3.0 |
dermoth/gramps | gramps/gen/lib/notebase.py | 9 | 6324 | #
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2000-2007 Donald N. Allingham
# Copyright (C) 2010 Michiel D. Nauta
#
# 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; e... | gpl-2.0 |
napalm-automation/napalm-yang | napalm_yang/models/openconfig/network_instances/network_instance/protocols/protocol/ospfv2/areas/area/interfaces/interface/state/__init__.py | 1 | 78111 | # -*- coding: utf-8 -*-
from operator import attrgetter
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType
from pyangbind.lib.yangtypes import RestrictedClassType
from pyangbind.lib.yangtypes import TypedListType
from pyangbind.lib.yangtypes import YANGBool
from pyangbind.lib.yangtypes import YANGListTy... | apache-2.0 |
mavit/ansible | test/units/playbook/test_helpers.py | 119 | 19184 | # (c) 2016, Adrian Likins <alikins@redhat.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later vers... | gpl-3.0 |
c0710204/mirrorsBistu | pypi/bandersnatch/lib/python2.7/site-packages/coverage/data.py | 6 | 8834 | """Coverage data for Coverage."""
import os
from coverage.backward import iitems, pickle, sorted # pylint: disable=W0622
from coverage.files import PathAliases
from coverage.misc import file_be_gone
class CoverageData(object):
"""Manages collected coverage data, including file storage.
The data file for... | mit |
vijayendrabvs/hap | neutron/tests/unit/openvswitch/test_ovs_neutron_agent.py | 1 | 40227 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2012 OpenStack Foundation.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LIC... | apache-2.0 |
aivarsk/scrapy | tests/test_utils_reqser.py | 103 | 2724 | # -*- coding: utf-8 -*-
import unittest
from scrapy.http import Request
from scrapy.spiders import Spider
from scrapy.utils.reqser import request_to_dict, request_from_dict
class RequestSerializationTest(unittest.TestCase):
def setUp(self):
self.spider = TestSpider()
def test_basic(self):
r... | bsd-3-clause |
xindus40223115/w16b_test | static/Brython3.1.3-20150514-095342/Lib/operator.py | 674 | 7736 | #!/usr/bin/env python3
"""
Operator Interface
This module exports a set of functions corresponding to the intrinsic
operators of Python. For example, operator.add(x, y) is equivalent
to the expression x+y. The function names are those used for special
methods; variants without leading and trailing '__' are also p... | gpl-3.0 |
Johnetordoff/waterbutler | tests/server/api/v1/test_metadata_mixin.py | 4 | 2105 | import pytest
from unittest import mock
from waterbutler.server.api.v1.provider.metadata import MetadataMixin
class BaseMetadataMixinTest:
def setup_method(self, method):
self.mixin = MetadataMixin()
self.mixin.write = mock.Mock()
self.mixin.request = mock.Mock()
self.mixin.set_s... | apache-2.0 |
RockySteveJobs/python-for-android | python3-alpha/extra_modules/gdata/webmastertools/service.py | 48 | 22284 | #!/usr/bin/python
#
# Copyright (C) 2008 Yu-Jie Lin
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | apache-2.0 |
ycaihua/kbengine | kbe/src/lib/python/Lib/idlelib/idle_test/test_autoexpand.py | 59 | 4117 | """Unit tests for idlelib.AutoExpand"""
import unittest
from test.support import requires
from tkinter import Text, Tk
#from idlelib.idle_test.mock_tk import Text
from idlelib.AutoExpand import AutoExpand
class Dummy_Editwin:
# AutoExpand.__init__ only needs .text
def __init__(self, text):
self.text =... | lgpl-3.0 |
nirmeshk/oh-mainline | vendor/packages/gdata/src/gdata/tlslite/utils/codec.py | 361 | 2771 | """Classes for reading/writing binary data (such as TLS records)."""
from compat import *
class Writer:
def __init__(self, length=0):
#If length is zero, then this is just a "trial run" to determine length
self.index = 0
self.bytes = createByteArrayZeros(length)
def add(self, x, lengt... | agpl-3.0 |
mortada/tensorflow | tensorflow/python/debug/cli/tensor_format.py | 28 | 16452 | # 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 |
vismartltd/edx-platform | common/test/acceptance/pages/studio/import_export.py | 17 | 7718 | """
Import/Export pages.
"""
from bok_choy.promise import EmptyPromise
import os
import requests
from .utils import click_css
from .library import LibraryPage
from .course_page import CoursePage
from . import BASE_URL
class TemplateCheckMixin(object):
"""
Mixin for verifying that a template is loading the cor... | agpl-3.0 |
MediaSapiens/autonormix | django/contrib/contenttypes/views.py | 295 | 3025 | from django import http
from django.contrib.contenttypes.models import ContentType
from django.contrib.sites.models import Site, get_current_site
from django.core.exceptions import ObjectDoesNotExist
def shortcut(request, content_type_id, object_id):
"Redirect to an object's page based on a content-type ID and an ... | bsd-3-clause |
hmcmooc/muddx-platform | lms/djangoapps/instructor/access.py | 56 | 2555 | """
Access control operations for use by instructor APIs.
Does not include any access control, be sure to check access before calling.
TO DO sync instructor and staff flags
e.g. should these be possible?
{instructor: true, staff: false}
{instructor: true, staff: true}
"""
import logging
from djan... | agpl-3.0 |
BT-ojossen/odoo | addons/base_geolocalize/models/res_partner.py | 239 | 3743 | # -*- 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 |
NoelMacwan/android_kernel_sony_msm8928 | tools/perf/scripts/python/syscall-counts.py | 11181 | 1522 | # system call counts
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide system call totals, broken down by syscall.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os
import sys
sys.path.append(os.envir... | gpl-2.0 |
arcticshores/kivy | kivy/tests/test_uix_widget.py | 59 | 4118 | from kivy.tests.common import GraphicUnitTest
class UIXWidgetTestCase(GraphicUnitTest):
def test_default_widgets(self):
from kivy.uix.button import Button
from kivy.uix.slider import Slider
r = self.render
r(Button())
r(Slider())
def test_button_properties(self):
... | mit |
jokajak/itweb | data/env/lib/python2.6/site-packages/PasteScript-1.7.3-py2.6.egg/paste/script/create_distro.py | 5 | 17023 | # (c) 2005 Ian Bicking and contributors; written for Paste (http://pythonpaste.org)
# Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
import re
import sys
import os
import pkg_resources
from command import Command, BadCommand
import copydir
import pluginlib
import fnmatch
try:
set... | gpl-3.0 |
algerbrex/Schemey | src/bytecode.py | 1 | 14432 | """
bytecode.py
----------------------------------------
Implementation of bytecode instructions. Also
includes the implementation of CodeObjects objects,
Instruction objects, and the serializer and deserializer
for the CodeObjects.
"""
from .utils import pack_integer, unpack_integer, pack_string, unpack_string, Str... | unlicense |
oesteban/seaborn | seaborn/timeseries.py | 4 | 15212 | """Timeseries plotting functions."""
from __future__ import division
import numpy as np
import pandas as pd
from scipy import stats, interpolate
import matplotlib as mpl
import matplotlib.pyplot as plt
from .external.six import string_types
from . import utils
from . import algorithms as algo
from .palettes import c... | bsd-3-clause |
whip112/Whip112 | kuma/wiki/decorators.py | 21 | 4051 | try:
from functools import wraps
except ImportError:
from django.utils.functional import wraps
import newrelic.agent
from waffle import flag_is_active, switch_is_active
from django.http import HttpResponsePermanentRedirect, Http404
from jingo.helpers import urlparams
from kuma.core.urlresolvers import revers... | mpl-2.0 |
MIhanguangyi/esp-idf | tools/ci/apply_bot_filter.py | 4 | 1529 | #!/usr/bin/env python
# internal use only
# called by CI jobs to determine if it need to be executed
import os
import re
import sys
import json
RE_FILTER_PATTERN = re.compile(r'^r"(.+)?"$')
RE_TYPE = type(re.compile("", 0))
def parse_filter(filter_name):
filter_raw = os.getenv(filter_name)
filters = []
... | apache-2.0 |
htc-mirror/ville-ics-crc-3.0.8-ca24d1e | scripts/tracing/draw_functrace.py | 14676 | 3560 | #!/usr/bin/python
"""
Copyright 2008 (c) Frederic Weisbecker <fweisbec@gmail.com>
Licensed under the terms of the GNU GPL License version 2
This script parses a trace provided by the function tracer in
kernel/trace/trace_functions.c
The resulted trace is processed into a tree to produce a more human
view of the call ... | gpl-2.0 |
TheTimmy/spack | var/spack/repos/builtin/packages/r-preprocesscore/package.py | 2 | 1592 | ##############################################################################
# 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 |
dibaunaumh/tikal-corp-website | cms/tests/rendering.py | 1 | 11927 | # -*- coding: utf-8 -*-
from django.conf import settings
from django.template import Template, RequestContext
from django.contrib.auth.models import User
from cms.tests.base import CMSTestCase
from cms.models import Page, Title, CMSPlugin, Placeholder
from django.contrib.sites.models import Site
from cms.plugins.text.m... | bsd-3-clause |
beezee/GAE-Django-site | django/contrib/localflavor/at/forms.py | 273 | 2446 | """
AT-specific Form helpers
"""
import re
from django.core.validators import EMPTY_VALUES
from django.forms import ValidationError
from django.forms.fields import Field, RegexField, Select
from django.utils.translation import ugettext_lazy as _
re_ssn = re.compile(r'^\d{4} \d{6}')
class ATZipCodeField(RegexField)... | bsd-3-clause |
lanen/youtube-dl | youtube_dl/extractor/criterion.py | 138 | 1359 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import re
from .common import InfoExtractor
class CriterionIE(InfoExtractor):
_VALID_URL = r'https?://www\.criterion\.com/films/(?P<id>[0-9]+)-.+'
_TEST = {
'url': 'http://www.criterion.com/films/184-le-samourai',
'md5': 'bc51be... | unlicense |
hachreak/invenio-previewer | invenio_previewer/views.py | 2 | 3243 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2016 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... | gpl-2.0 |
vladryk/horizon | openstack_dashboard/dashboards/admin/overview/panel.py | 70 | 1058 | # Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the... | apache-2.0 |
konstruktoid/ansible-upstream | lib/ansible/modules/database/misc/redis.py | 55 | 9760 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: Ansible Project
# 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 |
undoware/neutron-drive | google_appengine/google/appengine/api/memcache/__init__.py | 3 | 52907 | #!/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 |
Passtechsoft/TPEAlpGen | blender/release/scripts/startup/bl_ui/space_view3d_toolbar.py | 1 | 66068 | # ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distrib... | gpl-3.0 |
juharris/tensorflow | tensorflow/python/kernel_tests/unpack_op_test.py | 10 | 4695 | # 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 |
marcelocure/django | django/contrib/admin/views/main.py | 327 | 16684 | import sys
from collections import OrderedDict
from django.contrib.admin import FieldListFilter
from django.contrib.admin.exceptions import (
DisallowedModelAdminLookup, DisallowedModelAdminToField,
)
from django.contrib.admin.options import (
IS_POPUP_VAR, TO_FIELD_VAR, IncorrectLookupParameters,
)
from djang... | bsd-3-clause |
madongfly/grpc | src/python/grpcio/grpc/framework/crust/implementations.py | 12 | 14676 | # Copyright 2015, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... | bsd-3-clause |
jef-n/QGIS | tests/src/python/test_qgscoordinateformatter.py | 36 | 32619 | # -*- coding: utf-8 -*-
"""QGIS Unit tests for QgsCoordinateFormatter.
.. note:: This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version... | gpl-2.0 |
jacroe/spynot | cherrypy/lib/auth_basic.py | 88 | 3416 | # This file is part of CherryPy <http://www.cherrypy.org/>
# -*- coding: utf-8 -*-
# vim:ts=4:sw=4:expandtab:fileencoding=utf-8
__doc__ = """This module provides a CherryPy 3.x tool which implements
the server-side of HTTP Basic Access Authentication, as described in :rfc:`2617`.
Example usage, using the built-in che... | lgpl-3.0 |
tbadgu/Barcamp-Bangalore-Android-App | gcm_flask/werkzeug/testsuite/routing.py | 65 | 27231 | # -*- coding: utf-8 -*-
"""
werkzeug.testsuite.routing
~~~~~~~~~~~~~~~~~~~~~~~~~~
Routing tests.
:copyright: (c) 2011 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import unittest
from werkzeug.testsuite import WerkzeugTestCase
from werkzeug import routing as r
from werkzeu... | apache-2.0 |
Albinoman887/android_kernel_htc_pyramid | Documentation/target/tcm_mod_builder.py | 3119 | 42754 | #!/usr/bin/python
# The TCM v4 multi-protocol fabric module generation script for drivers/target/$NEW_MOD
#
# Copyright (c) 2010 Rising Tide Systems
# Copyright (c) 2010 Linux-iSCSI.org
#
# Author: nab@kernel.org
#
import os, sys
import subprocess as sub
import string
import re
import optparse
tcm_dir = ""
fabric_ops... | gpl-2.0 |
gt-ros-pkg/hrl-haptic-manip | hrl_fabric_based_tactile_sensor/src/hrl_fabric_based_tactile_sensor/pr2_tactile_sleeve_driver_node.py | 1 | 13261 | #!/usr/bin/python
import sys
import math, numpy as np
import roslib; roslib.load_manifest('hrl_fabric_based_tactile_sensor')
import rospy
from hrl_msgs.msg import FloatArray
import hrl_lib.util as ut
import hrl_lib.transforms as tr
import hrl_fabric_based_tactile_sensor.adc_publisher_node as apn
from m3skin_ros.ms... | apache-2.0 |
tms/node-gyp | gyp/test/configurations/inheritance/gyptest-inheritance.py | 430 | 1047 | #!/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 build of an executable in three different configurations.
"""
import TestGyp
test = TestGyp.TestGyp()
test.run_gyp('configur... | mit |
H-Huang/LL1-Academy | LL1_Academy/tools/MassGrammarGenerator.py | 1 | 3890 | from LL1_Academy.tools import GrammarChecker,SingleGrammarGenerator, SvmLearn
from LL1_Academy.models import Grammar, Question
import os
#Description: The MassGrammarGenerator class randomly generates grammar and filter
#out the interesting ones to store in the database.
script_dir = os.path.dirname(__file__) #<-- a... | mit |
BlueLens/bl-magi | tensorflow/object_detection/protos/image_resizer_pb2.py | 4 | 6995 | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: object_detection/protos/image_resizer.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protob... | apache-2.0 |
r0h4n/node-agent | tendrl/node_agent/monitoring/collectd/collectors/gluster/low_weight/tendrl_glusterfs_health_counters.py | 1 | 5552 | import collectd
import socket
import traceback
import utils as tendrl_glusterfs_utils
from tendrl_gluster import TendrlGlusterfsMonitoringBase
PEER_IN_CLUSTER = ['Peer', 'in', 'Cluster']
class TendrlGlusterfsHealthCounters(
TendrlGlusterfsMonitoringBase
):
def __init__(self):
self.provisioner_onl... | lgpl-2.1 |
lancezlin/pyjs | examples/misc/simplewiki/__main__.py | 8 | 1049 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
TARGETS = [
'Wiki.py',
]
PACKAGE = {
'title': 'simplewiki',
'desc': 'Simple Wiki example',
}
def setup(targets):
'''Setup example for translation, MUST call util.setup(targets).'''
util.setup(targets)
def translate():
'''Translate example, MU... | apache-2.0 |
denverpost/wordpress-helpers | rfp-bot/bot.py | 1 | 1681 | #!/usr/bin/env python
import os
import time
from slackclient import SlackClient
BOT_NAME = 'rfp-bot'
BOT_ID = os.environ.get("BOT_ID")
AT_BOT = "<@" + BOT_ID + ">:"
EXAMPLE_COMMAND = "do"
slack_client = SlackClient(os.environ.get('SLACK_BOT_TOKEN'))
def post_message(channel):
"""
"""
# {u'text': u'<@... | mit |
hilaskis/UAV_MissionPlanner | Lib/os2emxpath.py | 192 | 4603 | # Module 'os2emxpath' -- common operations on OS/2 pathnames
"""Common pathname manipulations, OS/2 EMX version.
Instead of importing this module directly, import os and refer to this
module as os.path.
"""
import os
import stat
from genericpath import *
from ntpath import (expanduser, expandvars, isabs, islink, spli... | gpl-2.0 |
DanielMe/papenburg-presentation | node_modules/node-sass/node_modules/node-gyp/gyp/pylib/gyp/MSVSNew.py | 1835 | 12124 | # Copyright (c) 2012 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.
"""New implementation of Visual Studio project generation."""
import os
import random
import gyp.common
# hashlib is supplied as of Python 2.5 as the replacemen... | mit |
Peddle/hue | desktop/core/ext-py/Django-1.6.10/django/contrib/gis/tests/geoapp/tests.py | 47 | 37664 | from __future__ import absolute_import
import re
from django.db import connection
from django.contrib.gis import gdal
from django.contrib.gis.geos import HAS_GEOS
from django.contrib.gis.tests.utils import (
HAS_SPATIAL_DB, no_mysql, no_oracle, no_spatialite,
mysql, oracle, postgis, spatialite)
from django.te... | apache-2.0 |
HAMIDx9/MITMf | core/utils.py | 18 | 3605 | # Copyright (c) 2014-2016 Marcello Salvati
#
# 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 distrib... | gpl-3.0 |
diega/gnobots2-clutter | glchess/src/lib/ggz/chess.py | 3 | 5544 | # -*- coding: utf-8 -*-
import struct
class GGZChessFeedback:
def onSeat(self, seatNum, version):
pass
def onPlayers(self, whiteType, whiteName, blackType, blackName):
pass
def onClockRequest(self):
pass
def onClock(self, mode, sec... | gpl-2.0 |
GDGND/evm | allauth/socialaccount/providers/facebook/locale.py | 76 | 2333 | # Default locale mapping for the Facebook JS SDK
# The list of supported locales is at
# https://www.facebook.com/translations/FacebookLocales.xml
import os
from django.utils.translation import get_language, to_locale
def _build_locale_table(filename_or_file):
"""
Parses the FacebookLocales.xml file and buil... | mit |
abad623/verbalucce | verbalucce/nltk/misc/sort.py | 5 | 4335 | # Natural Language Toolkit: List Sorting
#
# Copyright (C) 2001-2012 NLTK Project
# Author: Steven Bird <sb@csse.unimelb.edu.au>
# URL: <http://www.nltk.org/>
# For license information, see LICENSE.TXT
"""
This module provides a variety of list sorting algorithms, to
illustrate the many different algorithms (recipes) ... | apache-2.0 |
adamgreen/pyOCD | pyOCD/target/target_kl28z.py | 5 | 2647 | """
mbed CMSIS-DAP debugger
Copyright (c) 2006-2013 ARM Limited
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 |
z3ntu/razer-drivers | daemon/tests/test_effect_sync.py | 1 | 5345 | import unittest
import unittest.mock
import razer_daemon.misc.effect_sync
# msg type = effect, arg = orig_device, arg = effect_name, arg.. = arg..
MSG1 = ('effect', None, 'setBrightness', 255)
# Static effect message from blackwidow chroma
MSG2 = ('effect', None, 'setStatic', 255, 255, 0)
# Static effect message fro... | gpl-2.0 |
ccellar/MassTransit | doc/source/conf.py | 5 | 8347 | # -*- coding: utf-8 -*-
#
# MassTransit documentation build configuration file, created by
# sphinx-quickstart on Mon Jan 17 15:29:48 2011.
#
# 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.
#
#... | apache-2.0 |
mikewiebe-ansible/ansible | lib/ansible/modules/cloud/google/gcp_compute_router_info.py | 13 | 9367 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2017 Google
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# ----------------------------------------------------------------------------
#
# *** AUTO GENERATED CODE *** AUTO GENERATED CODE ***
#
... | gpl-3.0 |
nate-parrott/commanding | commanding.py | 1 | 5793 | from collections import defaultdict
import math
import re
class ProbabilityCounter(object):
def __init__(self):
self.counts = defaultdict(int)
self.total = 0
def add(self, item):
self.counts[item] += 1
self.total += 1
def __getitem__(self, item):
return self.counts[item] * 1.0 / self.total if item in ... | mit |
marratj/ansible | lib/ansible/modules/net_tools/basics/uri.py | 10 | 18086 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, Romeo Theriault <romeot () hawaii.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.1... | gpl-3.0 |
chadouming/faster-angler | Documentation/target/tcm_mod_builder.py | 2358 | 40707 | #!/usr/bin/python
# The TCM v4 multi-protocol fabric module generation script for drivers/target/$NEW_MOD
#
# Copyright (c) 2010 Rising Tide Systems
# Copyright (c) 2010 Linux-iSCSI.org
#
# Author: nab@kernel.org
#
import os, sys
import subprocess as sub
import string
import re
import optparse
tcm_dir = ""
fabric_ops... | gpl-2.0 |
eri-trabiccolo/exaile | plugins/grouptagger/__init__.py | 1 | 11251 | # Copyright (C) 2011 Dustin Spicuzza
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This program is distributed in the hope that... | gpl-2.0 |
orgito/ansible | lib/ansible/modules/windows/win_domain.py | 40 | 4035 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2017, Red Hat, Inc.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'core'}
DOCUMENTATI... | gpl-3.0 |
Nicop06/ansible | lib/ansible/modules/storage/zfs/zpool_facts.py | 33 | 6172 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2016, Adam Števko <adam.stevko@gmail.com>
# 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 |
hackerbot/DjangoDev | django/core/serializers/python.py | 29 | 7605 | """
A Python "serializer". Doesn't do much serializing per se -- just converts to
and from basic Python data types (lists, dicts, strings, etc.). Useful as a basis for
other serializers.
"""
from __future__ import unicode_literals
from collections import OrderedDict
from django.apps import apps
from django.conf impor... | bsd-3-clause |
alexheretic/apart-gtk | src/progress.py | 1 | 9907 | from typing import *
from gi.repository import GLib, Gtk
import logging
from apartcore import ApartCore, MessageListener
import historic_job
from historic_job import FinishedJob
import running_job
from running_job import RunningJob
import settings
import sys
import subprocess
log = logging.getLogger('ProgressAndHistor... | gpl-3.0 |
blossomica/airmozilla | airmozilla/search/models.py | 2 | 4258 | from django.db import models
from django.contrib.auth.models import User
from django.utils import timezone
from django.dispatch import receiver
from django.core.cache import cache
from jsonfield.fields import JSONField
from airmozilla.main.models import Event, Channel, Tag
def _get_now():
return timezone.now()
... | bsd-3-clause |
teeple/pns_server | work/install/Python-2.7.4/Lib/test/test_readline.py | 59 | 1709 | """
Very minimal unittests for parts of the readline module.
These tests were added to check that the libedit emulation on OSX and
the "real" readline have the same interface for history manipulation. That's
why the tests cover only a small subset of the interface.
"""
import unittest
from test.test_support import run... | gpl-2.0 |
alon/polinax | libs/external_libs/docutils-0.4/docutils/parsers/rst/directives/admonitions.py | 7 | 2320 | # Author: David Goodger
# Contact: goodger@users.sourceforge.net
# Revision: $Revision: 3155 $
# Date: $Date: 2005-04-02 23:57:06 +0200 (Sat, 02 Apr 2005) $
# Copyright: This module has been placed in the public domain.
"""
Admonition directives.
"""
__docformat__ = 'reStructuredText'
from docutils.parsers.rst impo... | gpl-2.0 |
JaSpa/swift | test/Driver/Dependencies/Inputs/fake-build-whole-module.py | 72 | 1067 | #!/usr/bin/env python
# fake-build-for-whole-module.py - Optimized fake build -*- python -*-
#
# This source file is part of the Swift.org open source project
#
# Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
# Licensed under Apache License v2.0 with Runtime Library Exception
#
# See https://swift.... | apache-2.0 |
robbwagoner/ansible-modules-core | packaging/os/redhat_subscription.py | 54 | 14531 | #!/usr/bin/python
DOCUMENTATION = '''
---
module: redhat_subscription
short_description: Manage Red Hat Network registration and subscriptions using the C(subscription-manager) command
description:
- Manage registration and subscription to the Red Hat Network entitlement platform.
version_added: "1.2"
author: "Jam... | gpl-3.0 |
plain-vanilla-games/babel | tests/messages/test_mofile.py | 41 | 3095 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2007-2011 Edgewall Software
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://babel.edgewall.org/wiki/License.
#
# This software consists... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.