repo_name stringlengths 5 100 | path stringlengths 4 294 | copies stringclasses 990
values | size stringlengths 4 7 | content stringlengths 666 1M | license stringclasses 15
values |
|---|---|---|---|---|---|
phillipwei/crazyflie-clients-python | lib/cflib/drivers/crazyradio.py | 10 | 8915 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# || ____ _ __
# +------+ / __ )(_) /_______________ _____ ___
# | 0xBC | / __ / / __/ ___/ ___/ __ `/_ / / _ \
# +------+ / /_/ / / /_/ /__/ / / /_/ / / /_/ __/
# || || /_____/_/\__/\___/_/ \__,_/ /___/\___/
#
# Copyright (C) 20... | gpl-2.0 |
phi1-h/price-tracker | priceTracker/save_data.py | 1 | 3219 | import copyreg
import pickle
import os
from .product import product
from .__init__ import pClass
import sys
os.chdir(os.path.expanduser("~"))
def createDir(dir):
p = dir.replace("/", "/ ").split()
for d in range(len(p)):
x = str(p[0:d+1]).replace("[","").replace("]","").replace("'","").replace(" ","").r... | mit |
stevanmilic/beagleboard-kernel-modules | beaglepy/wrappers/singleton.py | 1 | 1325 | """Module for singleton pattern"""
class Singleton(object):
"""
A non-thread-safe helper class to ease implementing singletons.
This should be used as a decorator -- not a metaclass -- to the
class that should be a singleton.
The decorated class can define one `__init__` function that
takes o... | gpl-3.0 |
mj10777/QGIS | tests/src/python/test_qgslayerdefinition.py | 6 | 4191 | # -*- coding: utf-8 -*-
"""QGIS Unit tests for QgsLayerDefinition
.. 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 |
xiandiancloud/ji | common/djangoapps/cache_toolbox/templatetags/cache_toolbox.py | 239 | 2059 | from django import template
from django.core.cache import cache
from django.template import Node, TemplateSyntaxError, Variable
from django.template import resolve_variable
register = template.Library()
class CacheNode(Node):
def __init__(self, nodelist, expire_time, key):
self.nodelist = nodelist
... | agpl-3.0 |
ChenJunor/hue | desktop/core/ext-py/Pygments-1.3.1/pygments/unistring.py | 75 | 404249 | # -*- coding: utf-8 -*-
"""
pygments.unistring
~~~~~~~~~~~~~~~~~~
Strings of all Unicode characters of a certain category.
Used for matching in Unicode-aware languages. Run to regenerate.
Inspired by chartypes_create.py from the MoinMoin project.
:copyright: Copyright 2006-2010 by the Pygment... | apache-2.0 |
tiredpixel/pikka-bird-server-py | pikka_bird_server/routes/collections.py | 1 | 1847 | from flask import Blueprint, jsonify, request, abort
import msgpack
import pikka_bird_server
from pikka_bird_server.models.collection import Collection
from pikka_bird_server.models.machine import Machine
from pikka_bird_server.models.report import Report
from pikka_bird_server.models.service import Service
collecti... | mit |
meabsence/python-for-android | python-modules/twisted/twisted/internet/test/test_iocp.py | 61 | 3873 | from twisted.internet.protocol import ServerFactory, Protocol, ClientCreator
from twisted.internet.defer import DeferredList, maybeDeferred, Deferred
from twisted.trial import unittest
from twisted.internet import reactor
from twisted.python import log
from zope.interface.verify import verifyClass
class StopStartRead... | apache-2.0 |
simple88/ssbc | web/views.py | 4 | 4033 | #coding: utf8
import re
import datetime
import sys
import urllib
from django.http import Http404
from django.views.decorators.cache import cache_page
from django.shortcuts import render, redirect
from lib import politics
import workers.metautils
from search.models import RecKeywords, Hash
re_punctuations = re.compil... | gpl-2.0 |
lmazuel/ansible | lib/ansible/module_utils/facts/timeout.py | 135 | 2215 | # 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 distributed in the hope that ... | gpl-3.0 |
f304646673/scheduler_frame | src/frame/mysql_conn.py | 1 | 13222 | import re
import json
import time
import MySQLdb
import type_check
from DBUtils.PooledDB import PooledDB
from loggingex import LOG_WARNING
from loggingex import LOG_INFO
from loggingex import LOG_ERROR_SQL
class mysql_conn():
def __init__(self, host_name, port_num, user_name, password, db_name, charset_name = "ut... | apache-2.0 |
danakj/chromium | tools/grit/grit/gather/skeleton_gatherer.py | 62 | 5224 | #!/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.
'''A baseclass for simple gatherers that store their gathered resource in a
list.
'''
import types
from grit.gather import interf... | bsd-3-clause |
enclose-io/compiler | current/deps/v8/tools/release/filter_build_files.py | 8 | 3027 | #!/usr/bin/env python
# Copyright 2017 the V8 project authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Enumerates relevant build files for each platform.
This can be used to filter the build directory before making an official
arch... | mit |
mathkann/exercises-in-programming-style | 32-trinity/util.py | 18 | 1773 | import sys, os
#
# getch in a platform-independent way
# Credit: http://code.activestate.com/recipes/134892/
#
class _Getch:
"""Gets a single character from standard input. Does not echo to the
screen."""
def __init__(self):
try:
self.impl = _GetchWindows()
except ImportError:
... | mit |
ky822/scikit-learn | sklearn/setup.py | 225 | 2856 | import os
from os.path import join
import warnings
def configuration(parent_package='', top_path=None):
from numpy.distutils.misc_util import Configuration
from numpy.distutils.system_info import get_info, BlasNotFoundError
import numpy
libraries = []
if os.name == 'posix':
libraries.appe... | bsd-3-clause |
bmanojlovic/ansible | contrib/inventory/rax.py | 21 | 16418 | #!/usr/bin/env python
# (c) 2013, Jesse Keating <jesse.keating@rackspace.com,
# Paul Durivage <paul.durivage@rackspace.com>,
# Matt Martz <matt@sivel.net>
#
# This file is part of Ansible.
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Pu... | gpl-3.0 |
uglyboxer/linear_neuron | net-p3/lib/python3.5/site-packages/scipy/linalg/flinalg.py | 138 | 1727 | #
# Author: Pearu Peterson, March 2002
#
from __future__ import division, print_function, absolute_import
__all__ = ['get_flinalg_funcs']
# The following ensures that possibly missing flavor (C or Fortran) is
# replaced with the available one. If none is available, exception
# is raised at the first attempt to use t... | mit |
markwatkinson/luminous | tests/regression/python/generator.py | 2 | 2885 | #!/usr/bin/env python
import random
import syllables
class PasswordGenerator:
"""
m: a markov model instance
"""
def __init__(self, m, lookbehind_chars=2):
self.__m = m
self.__lookbehind = lookbehind_chars
self.punc = '_-!.;,#?'
self.char_number_mappings = {'a': '4@&', 'e': '3', 'l... | lgpl-2.1 |
broferek/ansible | test/units/modules/network/fortios/test_fortios_wireless_controller_hotspot20_h2qp_conn_capability.py | 21 | 12221 | # Copyright 2019 Fortinet, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the... | gpl-3.0 |
letsencrypt/letsencrypt | certbot-apache/certbot_apache/tests/centos6_test.py | 1 | 9703 | """Test for certbot_apache.configurator for CentOS 6 overrides"""
import os
import unittest
from certbot_apache import obj
from certbot_apache import override_centos
from certbot_apache import parser
from certbot_apache.tests import util
from certbot.errors import MisconfigurationError
def get_vh_truth(temp_dir, conf... | apache-2.0 |
ochinchina/thrift | test/crossrunner/report.py | 46 | 13458 | #
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | apache-2.0 |
slightlymadphoenix/activityPointsApp | activitypoints/lib/python3.5/site-packages/setuptools/command/rotate.py | 389 | 2164 | from distutils.util import convert_path
from distutils import log
from distutils.errors import DistutilsOptionError
import os
import shutil
from setuptools.extern import six
from setuptools import Command
class rotate(Command):
"""Delete older distributions"""
description = "delete older distributions, kee... | mit |
alimusa123/helloapp12 | lib/flask/config.py | 781 | 6234 | # -*- coding: utf-8 -*-
"""
flask.config
~~~~~~~~~~~~
Implements the configuration related objects.
:copyright: (c) 2011 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import imp
import os
import errno
from werkzeug.utils import import_string
from ._compat import string_type... | apache-2.0 |
barzan/dbseer | middleware_old/rs-sysmon2/plugins/dstat_disk_tps.py | 3 | 3052 | ### Author: Dag Wieers <dag$wieers,com>
class dstat_plugin(dstat):
"""
Percentage of bandwidth utilization for block devices.
Displays percentage of CPU time during which I/O requests were issued
to the device (bandwidth utilization for the device). Device saturation
occurs when this value is clos... | apache-2.0 |
nischalshrestha/sampleAppEngine | lib/pyasn1/type/base.py | 86 | 10706 | # Base classes for ASN.1 types
import sys
from pyasn1.type import constraint, tagmap, tag
from pyasn1 import error
class Asn1Item: pass
class Asn1ItemBase(Asn1Item):
# Set of tags for this ASN.1 type
tagSet = tag.TagSet()
# A list of constraint.Constraint instances for checking values
subtypeSpec... | mit |
fandrefh/AnjoMeu | anjo/campaign/migrations/0004_auto__add_field_campaign_user.py | 2 | 4399 | # -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Campaign.user'
db.add_column(u'campaign_campaign', 'user'... | gpl-2.0 |
haridsv/pip | pip/_vendor/html5lib/trie/py.py | 1323 | 1775 | from __future__ import absolute_import, division, unicode_literals
from pip._vendor.six import text_type
from bisect import bisect_left
from ._base import Trie as ABCTrie
class Trie(ABCTrie):
def __init__(self, data):
if not all(isinstance(x, text_type) for x in data.keys()):
raise TypeError... | mit |
mglukhikh/intellij-community | python/lib/Lib/sre_parse.py | 116 | 26883 | #
# Secret Labs' Regular Expression Engine
#
# convert re-style regular expression to sre pattern
#
# Copyright (c) 1998-2001 by Secret Labs AB. All rights reserved.
#
# See the sre.py file for information on usage and redistribution.
#
"""Internal support module for sre"""
# XXX: show string offset and offending ch... | apache-2.0 |
wonder-sk/QGIS | python/custom_widgets/qgis_customwidgets.py | 13 | 1934 | # -*- coding: utf-8 -*-
"""
***************************************************************************
customwidgets.py
---------------------
Date : May 2014
Copyright : (C) 2014 by Denis Rouzaud
Email : denis.rouzaud@gmail.com
****************************... | gpl-2.0 |
dladd/pyFormex | pyformex/gui/colorscale.py | 1 | 8343 | #!/usr/bin/env python
# $Id$
##
## This file is part of pyFormex 0.8.9 (Fri Nov 9 10:49:51 CET 2012)
## pyFormex is a tool for generating, manipulating and transforming 3D
## geometrical models by sequences of mathematical operations.
## Home page: http://pyformex.org
## Project page: http://savannah.nongnu.org... | gpl-3.0 |
andrew512/rstatmon | rstatmon/rstatmon.py | 1 | 26409 | import sys
import math
import argparse
import threading
import subprocess
import Queue
import signal
import time
import datetime
import logging
import curses
import cjson
FORMAT = '%(name)-20s - %(asctime)s - %(levelname)8s - %(message)s'
logging.basicConfig(format=FORMAT,level=logging.DEBUG, filename='rstatmon.log')... | mit |
cbrewster/servo | tests/wpt/web-platform-tests/tools/manifest/sourcefile.py | 3 | 22469 | import hashlib
import re
import os
from six import binary_type
from six.moves.urllib.parse import urljoin
from fnmatch import fnmatch
try:
from xml.etree import cElementTree as ElementTree
except ImportError:
from xml.etree import ElementTree
import html5lib
from . import XMLParser
from .item import Stub, Man... | mpl-2.0 |
pyjs/pyjs | pyjswidgets/pyjamas/ui/Frame.py | 9 | 1351 | # Copyright 2006 James Tauber and contributors
# Copyright (C) 2009 Luke Kenneth Casson Leighton <lkcl@lkcl.net>
#
# 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/... | apache-2.0 |
writefaruq/lionface-app | django/core/handlers/modpython.py | 13 | 8492 | import os
from pprint import pformat
import sys
from warnings import warn
from django import http
from django.core import signals
from django.core.handlers.base import BaseHandler
from django.core.urlresolvers import set_script_prefix
from django.utils import datastructures
from django.utils.encoding import ... | bsd-3-clause |
IECS/MansOS | mos/make/scripts/link.py | 1 | 7835 | #!/usr/bin/python
#
# Copyright (c) 2010-2012 the MansOS team. 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 ... | mit |
xhteam/git-repo | subcmds/download.py | 32 | 2300 | #
# Copyright (C) 2008 The Android Open Source Project
#
# 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 la... | apache-2.0 |
MarekIgnaszak/econ-project-templates | .mywaflib/waflib/extras/rst.py | 56 | 6951 | #!/usr/bin/env python
# encoding: utf-8
# Jérôme Carretero, 2013 (zougloub)
"""
reStructuredText support (experimental)
Example::
def configure(conf):
conf.load('rst')
if not conf.env.RST2HTML:
conf.fatal('The program rst2html is required')
def build(bld):
bld(
features = 'rst',
type = 'rst2htm... | bsd-3-clause |
ryanahall/django | tests/serializers_regress/tests.py | 23 | 23092 | """
A test spanning all the capabilities of all the serializers.
This class defines sample data and a dynamically generated
test case that is capable of testing the capabilities of
the serializers. This includes all valid data values, plus
forward, backwards and self references.
"""
from __future__ import unicode_lite... | bsd-3-clause |
gclenaghan/scikit-learn | doc/conf.py | 210 | 8446 | # -*- coding: utf-8 -*-
#
# scikit-learn documentation build configuration file, created by
# sphinx-quickstart on Fri Jan 8 09:13:42 2010.
#
# 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.
... | bsd-3-clause |
denys-duchier/django | tests/queries/test_q.py | 17 | 2830 | from django.db.models import F, Q
from django.test import SimpleTestCase
class QTests(SimpleTestCase):
def test_deconstruct(self):
q = Q(price__gt=F('discounted_price'))
path, args, kwargs = q.deconstruct()
self.assertEqual(path, 'django.db.models.query_utils.Q')
self.assertEqual(a... | bsd-3-clause |
brotherjimthomas/tb | docs/conf.py | 1 | 9936 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# TaskBuster documentation build configuration file, created by
# sphinx-quickstart on Tue Sep 27 11:42:34 2016.
#
# 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
#... | mit |
petrus-v/odoo | addons/account_check_writing/__init__.py | 446 | 1111 | # -*- 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 |
digital-abyss/ansible-modules-extras | database/postgresql/postgresql_lang.py | 116 | 9789 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2014, Jens Depuydt <http://www.jensd.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 L... | gpl-3.0 |
lowiki-org/localwiki-backend-server | localwiki/region_scores/migrations/0001_initial.py | 3 | 3941 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'RegionScore'
db.create_table(u'region_scores_regionscore', (
(u'id', self.gf('dj... | gpl-2.0 |
deepesch/scikit-learn | sklearn/tree/tree.py | 113 | 34767 | """
This module gathers tree-based methods, including decision, regression and
randomized trees. Single and multi-output problems are both handled.
"""
# Authors: Gilles Louppe <g.louppe@gmail.com>
# Peter Prettenhofer <peter.prettenhofer@gmail.com>
# Brian Holt <bdholt1@gmail.com>
# Noel Da... | bsd-3-clause |
syphar/django | django/core/mail/backends/console.py | 696 | 1477 | """
Email backend that writes messages to console instead of sending them.
"""
import sys
import threading
from django.core.mail.backends.base import BaseEmailBackend
from django.utils import six
class EmailBackend(BaseEmailBackend):
def __init__(self, *args, **kwargs):
self.stream = kwargs.pop('stream',... | bsd-3-clause |
AtsushiHashimoto/fujino_mthesis | tools/flowgraph/mst/generate_label.py | 1 | 6546 | # _*_ coding: utf-8 -*-
import os
import re
import io
import csv
import copy
import json
import argparse
import pandas as pd
def get_dataframe_of_flowgraph(flow_path):
"""
input: flow_graph_path
output: pandas dataframe
"""
ID = 0
POSITION = 1
ids = [] # It is not always number... | bsd-2-clause |
mikewesner-wf/glasshouse | glasshouse.indigoPlugin/Contents/Server Plugin/jinja2/parser.py | 171 | 35218 | # -*- coding: utf-8 -*-
"""
jinja2.parser
~~~~~~~~~~~~~
Implements the template parser.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
from jinja2 import nodes
from jinja2.exceptions import TemplateSyntaxError, TemplateAssertionError
from jinja2.utils impo... | apache-2.0 |
mikedingjan/wagtail | wagtail/core/tests/test_utils.py | 15 | 1729 | # -*- coding: utf-8 -*
from django.test import TestCase
from django.utils.text import slugify
from wagtail.core.utils import accepts_kwarg, cautious_slugify
class TestCautiousSlugify(TestCase):
def test_behaves_same_as_slugify_for_latin_chars(self):
test_cases = [
('', ''),
('???... | bsd-3-clause |
akaraspt/deepsleepnet | dhedfreader.py | 1 | 6823 | '''
Reader for EDF+ files.
TODO:
- add support for log-transformed channels:
http://www.edfplus.info/specs/edffloat.html and test with
data generated with
http://www.edfplus.info/downloads/software/NeuroLoopGain.zip.
- check annotations with Schalk's Physiobank data.
Copyright (c) 2012 Boris Reuderink.
'''
... | apache-2.0 |
pymedusa/Medusa | ext/twitter/twitter_utils.py | 5 | 16403 | # encoding: utf-8
from __future__ import unicode_literals
import mimetypes
import os
import re
import sys
from tempfile import NamedTemporaryFile
from unicodedata import normalize
try:
from urllib.parse import urlparse
except ImportError:
from urlparse import urlparse
import requests
from twitter import Twit... | gpl-3.0 |
Meriipu/quodlibet | quodlibet/browsers/paned/prefs.py | 2 | 9173 | # Copyright 2013 Christoph Reiter
# 2015 Nick Boultbee
# 2017 Fredrik Strupe
#
# 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 ... | gpl-2.0 |
nagyistoce/euca2ools | euca2ools/commands/ec2/modifynetworkaclentry.py | 5 | 5641 | # Copyright 2013-2014 Eucalyptus Systems, Inc.
#
# Redistribution and use of this software 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 ... | bsd-2-clause |
cvmfs/cctools | chirp/src/python/chirp_python_example.py | 9 | 2213 | #!/usr/bin/env cctools_python
# CCTOOLS_PYTHON_VERSION 2.7 2.6 2.5 2.4
import sys
import os
try:
import Chirp
except ImportError:
print 'Could not find Chirp module. Please set PYTHONPATH accordingly.'
sys.exit(1)
def write_some_file(filename='bar.txt'):
message = '''
One makeflow to rule them ... | gpl-2.0 |
0x90/e5372 | e5372/api.py | 3 | 3038 | # _*_ coding: utf-8 _*_
from __future__ import unicode_literals, absolute_import
from collections import namedtuple
from functools import partial
import requests
from e5372.context import get_default_context
from e5372 import consts, etree, Error
get_request = requests.get
# TODO: break to some modules
# TODO: Err... | gpl-3.0 |
cmccoy/codon-sw | deps/seqan/util/skel/app_tests_template/run_tests.py | 10 | 3100 | #!/usr/bin/env python
"""Execute the tests for %(APP_NAME)s.
The golden test outputs are generated by the script generate_outputs.sh.
You have to give the root paths to the source and the binaries as arguments to
the program. These are the paths to the directory that contains the 'projects'
directory.
Usage: run_t... | bsd-3-clause |
josephharrington/ClusterRunner | app/master/build_fsm.py | 2 | 8309 | from enum import Enum
import time
from fysom import Fysom, FysomError
# WIP(joey): Fysom is not thread safe -- multiple threads could theoretically traverse
# WIP(joey): the same state transition simultaneously.
from app.util import log
class BuildState(str, Enum):
"""Posssible states for the FSM"""
QUEUED ... | apache-2.0 |
mauroalberti/gsf | pygsf/geometries/transformations.py | 1 | 5752 |
from affine import Affine
from ..mathematics.scalars import *
from ..mathematics.deformations import *
from ..orientations.orientations import Axis
def gdal_to_affine(
geotransform: Tuple[numbers.Real, numbers.Real, numbers.Real, numbers.Real, numbers.Real, numbers.Real]
) -> Affine:
"""
Create an affin... | gpl-3.0 |
coala/coala | tests/results/result_actions/PrintAspectActionTest.py | 4 | 1748 | import unittest
from coala_utils.ContextManagers import retrieve_stdout
from coalib.results.Result import Result
from coalib.results.result_actions.PrintAspectAction import PrintAspectAction
from coalib.settings.Section import Section
from coalib.bearlib.aspects import Root
class PrintAspectActionTest(unittest.TestC... | agpl-3.0 |
gfreed/android_external_chromium-org | third_party/pexpect/ANSI.py | 171 | 12646 | """This implements an ANSI (VT100) terminal emulator as a subclass of screen.
PEXPECT LICENSE
This license is approved by the OSI and FSF as GPL-compatible.
http://opensource.org/licenses/isc-license.txt
Copyright (c) 2012, Noah Spurrier <noah@noah.org>
PERMISSION TO USE, COPY, MODIFY, AND/OR DIS... | bsd-3-clause |
openhdf/enigma2-wetek | lib/python/Plugins/SystemPlugins/DeviceManager/ExtrasList.py | 2 | 2182 | from enigma import *
from Screens.Screen import Screen
from Components.ActionMap import ActionMap
from Components.MenuList import MenuList
from Components.GUIComponent import GUIComponent
from Components.HTMLComponent import HTMLComponent
from Tools.Directories import fileExists
from Components.MultiContent import Mult... | gpl-2.0 |
sourcepole/kadas-albireo | python/plugins/processing/algs/qgis/SpatialJoin.py | 5 | 10276 | # -*- coding: utf-8 -*-
"""
***************************************************************************
SpatialJoin.py
---------------------
Date : October 2013
Copyright : (C) 2013 by Joshua Arnott
Email : josh at snorfalorpagus dot net
*******************... | gpl-2.0 |
MartinHjelmare/home-assistant | tests/components/shopping_list/test_init.py | 12 | 12030 | """Test shopping list component."""
import asyncio
from unittest.mock import patch
import pytest
from homeassistant.bootstrap import async_setup_component
from homeassistant.helpers import intent
from homeassistant.components.websocket_api.const import TYPE_RESULT
@pytest.fixture(autouse=True)
def mock_shopping_lis... | apache-2.0 |
ibank/node-gyp | gyp/pylib/gyp/generator/scons.py | 231 | 35679 | # 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.
import gyp
import gyp.common
import gyp.SCons as SCons
import os.path
import pprint
import re
import subprocess
# TODO: remove when we delete the last WriteList... | mit |
dav1x/ansible | lib/ansible/modules/notification/jabber.py | 32 | 4800 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2015, Brian Coca <bcoca@ansible.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the Licen... | gpl-3.0 |
xxsergzzxx/python-for-android | python3-alpha/python3-src/Lib/test/test_binascii.py | 57 | 8992 | """Test the binascii C module."""
from test import support
import unittest
import binascii
import array
# Note: "*_hex" functions are aliases for "(un)hexlify"
b2a_functions = ['b2a_base64', 'b2a_hex', 'b2a_hqx', 'b2a_qp', 'b2a_uu',
'hexlify', 'rlecode_hqx']
a2b_functions = ['a2b_base64', 'a2b_hex', ... | apache-2.0 |
elena/django | tests/servers/views.py | 57 | 1330 | from urllib.request import urlopen
from django.http import HttpResponse, StreamingHttpResponse
from django.views.decorators.csrf import csrf_exempt
from .models import Person
def example_view(request):
return HttpResponse('example view')
def streaming_example_view(request):
return StreamingHttpResponse((b... | bsd-3-clause |
kittehcoin/p2pool | SOAPpy/WSDL.py | 294 | 5100 | """Parse web services description language to get SOAP methods.
Rudimentary support."""
ident = '$Id: WSDL.py 1467 2008-05-16 23:32:51Z warnes $'
from version import __version__
import wstools
import xml
from Errors import Error
from Client import SOAPProxy, SOAPAddress
from Config import Config
import urllib
class... | gpl-3.0 |
nathanial/lettuce | tests/integration/lib/Django-1.3/django/contrib/gis/gdal/envelope.py | 321 | 7044 | """
The GDAL/OGR library uses an Envelope structure to hold the bounding
box information for a geometry. The envelope (bounding box) contains
two pairs of coordinates, one for the lower left coordinate and one
for the upper right coordinate:
+----------o Upper right; (max_x, max_y)
... | gpl-3.0 |
XWARIOSWX/wnframework | website/doctype/contact_us_settings/templates/pages/contact.py | 32 | 1606 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import webnotes
from webnotes.utils import now
def get_context():
bean = webnotes.bean("Contact Us Settings", "Contact Us Settings")
query_options = filter(None, bean.do... | mit |
TomTranter/OpenPNM | tests/unit/models/geometry/ThroatSurfaceAreaTest.py | 1 | 1798 | import numpy as np
import scipy as sp
import openpnm as op
from numpy.testing import assert_allclose
import openpnm.models.geometry.throat_surface_area as tsa
class ThroatSurfaceAreaTest:
def setup_class(self):
self.net = op.network.Cubic(shape=[5, 5, 5])
self.geo = op.geometry.GenericGeometry(net... | mit |
Universal-Model-Converter/UMC3.0a | data/Python/x86/Lib/idlelib/MultiCall.py | 43 | 17483 | """
MultiCall - a class which inherits its methods from a Tkinter widget (Text, for
example), but enables multiple calls of functions per virtual event - all
matching events will be called, not only the most specific one. This is done
by wrapping the event functions - event_add, event_delete and event_info.
MultiCall r... | mit |
isrohutamahopetechnik/MissionPlanner | Lib/site-packages/numpy/oldnumeric/linear_algebra.py | 102 | 2180 | """Backward compatible with LinearAlgebra from Numeric
"""
# This module is a lite version of the linalg.py module in SciPy which contains
# high-level Python interface to the LAPACK library. The lite version
# only accesses the following LAPACK functions: dgesv, zgesv, dgeev,
# zgeev, dgesdd, zgesdd, dgelsd, zgelsd, ... | gpl-3.0 |
MphasisWyde/eWamSublimeAdaptor | POC/v0_4_POC_with_generic_cmd_and_swagger/third-party/dateutil/relativedelta.py | 104 | 18172 | # -*- coding: utf-8 -*-
import datetime
import calendar
from six import integer_types
__all__ = ["relativedelta", "MO", "TU", "WE", "TH", "FR", "SA", "SU"]
class weekday(object):
__slots__ = ["weekday", "n"]
def __init__(self, weekday, n=None):
self.weekday = weekday
self.n = n
def __c... | mit |
norberts1/hometop_HT3 | HT3/sw/etc/html/httpd.py | 1 | 1408 | #!/usr/bin/python3
#
#################################################################
## Copyright (c) 2013 Norbert S. <junky-zs@gmx.de>
#
# 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... | gpl-3.0 |
elky/django | tests/delete_regress/models.py | 325 | 3172 | from django.contrib.contenttypes.fields import (
GenericForeignKey, GenericRelation,
)
from django.contrib.contenttypes.models import ContentType
from django.db import models
class Award(models.Model):
name = models.CharField(max_length=25)
object_id = models.PositiveIntegerField()
content_type = mode... | bsd-3-clause |
mmb90/dftintegrate | dftintegrate/customserializer.py | 1 | 1393 | import numpy
def tojson(obj):
if isinstance(obj, complex):
return {'__class__': 'complex',
'__value__': [obj.real, obj.imag]}
if isinstance(obj, numpy.int64):
return {'__class__': 'numpy.int64',
'__value__': int(obj)}
if isinstance(obj, numpy.complex128):
... | mit |
pigeonflight/strider-plone | docker/appengine/lib/django-1.5/tests/regressiontests/defaultfilters/tests.py | 28 | 30689 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import datetime
import decimal
from django.template.defaultfilters import *
from django.test import TestCase
from django.utils import six
from django.utils import unittest, translation
from django.utils.safestring import SafeData
from django.utils.encodi... | mit |
Enyruas/Kitux | sellrobots/views.py | 1 | 3347 | # Create your views here.
from django.http import HttpResponse, HttpResponseRedirect, Http404
from django.shortcuts import render, redirect
from productRead import Product,getFarnellRequestUrl, getProductInfo
import requests
from models import useraccount
def index(request):
return HttpResponse("Hello, world. You'... | apache-2.0 |
edry/edx-platform | lms/djangoapps/courseware/tests/test_middleware.py | 115 | 1927 | """
Tests for courseware middleware
"""
from django.core.urlresolvers import reverse
from django.test.client import RequestFactory
from django.http import Http404
from mock import patch
from nose.plugins.attrib import attr
import courseware.courses as courses
from courseware.middleware import RedirectUnenrolledMiddle... | agpl-3.0 |
sarvex/django | tests/syndication_tests/urls.py | 216 | 1381 | from django.conf.urls import url
from . import feeds
urlpatterns = [
url(r'^syndication/rss2/$', feeds.TestRss2Feed()),
url(r'^syndication/rss2/guid_ispermalink_true/$',
feeds.TestRss2FeedWithGuidIsPermaLinkTrue()),
url(r'^syndication/rss2/guid_ispermalink_false/$',
feeds.TestRss2FeedWithG... | bsd-3-clause |
ice9js/servo | tests/wpt/css-tests/tools/webdriver/webdriver/command.py | 258 | 3985 | """Dispatches requests to remote WebDriver endpoint."""
import exceptions
import httplib
import json
import urlparse
import webelement
class CommandExecutor(object):
"""Dispatches requests to remote WebDriver endpoint."""
_HEADERS = {
"User-Agent": "Python WebDriver Local End",
"Content-Type... | mpl-2.0 |
gkc1000/pyscf | pyscf/nao/m_g297.py | 1 | 143208 | # Copyright 2014-2018 The PySCF Developers. 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 appl... | apache-2.0 |
edevil/django | tests/m2m_recursive/models.py | 410 | 1120 | """
Many-to-many relationships between the same two tables
In this example, a ``Person`` can have many friends, who are also ``Person``
objects. Friendship is a symmetrical relationship - if I am your friend, you
are my friend. Here, ``friends`` is an example of a symmetrical
``ManyToManyField``.
A ``Person`` can als... | bsd-3-clause |
suncycheng/intellij-community | python/helpers/pycharm/teamcity/flake8_v3_plugin.py | 6 | 1883 | import re
from io import BytesIO
from flake8.formatting import base
from teamcity.messages import TeamcityServiceMessages
from teamcity import __version__, is_running_under_teamcity
class TeamcityReport(base.BaseFormatter):
name = 'teamcity-messages'
version = __version__
options_added = False
@cl... | apache-2.0 |
jaskorpe/kone | kone.py | 1 | 2720 | #!/usr/bin/env python
# Copyright (c) 2006 Øyvind Skaar, Jon Anders Skorpen
if __name__ == "__main__":
import sys, os, socket
import freedb, gui, cdrom
# Configuration
client = "Kone"
version = "0.4"
# Get the hostname & username from the os,
# used in communication with the freedb server
username = os... | mit |
cchurch/ansible | lib/ansible/modules/network/fortios/fortios_firewall_multicast_policy.py | 24 | 12164 | #!/usr/bin/python
from __future__ import (absolute_import, division, print_function)
# Copyright 2019 Fortinet, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the Lic... | gpl-3.0 |
jean/sentry | src/sentry/south_migrations/0213_migrate_file_blobs.py | 4 | 61317 | # -*- coding: utf-8 -*-
import six
from collections import defaultdict
from django.db import models
from south.db import db
from south.utils import datetime_utils as datetime
from south.v2 import DataMigration
class Migration(DataMigration):
def _ensure_blob(self, orm, file):
from sentry.app import lock... | bsd-3-clause |
ivanlmj/Android-DNSSL | Flask/lib/python2.7/site-packages/requests/__init__.py | 71 | 2197 | # -*- coding: utf-8 -*-
# __
# /__) _ _ _ _ _/ _
# / ( (- (/ (/ (- _) / _)
# /
"""
Requests HTTP library
~~~~~~~~~~~~~~~~~~~~~
Requests is an HTTP library, written in Python, for human beings. Basic GET
usage:
>>> import requests
>>> r = requests.get('https://www.python.org')
>>> ... | gpl-2.0 |
rjkunde/TempHumiditySensorProject | Adafruit_DHT/Raspberry_Pi_2.py | 9 | 1891 | # Copyright (c) 2014 Adafruit Industries
# Author: Tony DiCola
# 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, copy, mo... | mit |
snakeleon/YouCompleteMe-x86 | third_party/ycmd/third_party/python-future/src/libpasteurize/fixes/fix_unpacking.py | 60 | 5954 | u"""
Fixer for:
(a,)* *b (,c)* [,] = s
for (a,)* *b (,c)* [,] in d: ...
"""
from lib2to3 import fixer_base
from itertools import count
from lib2to3.fixer_util import (Assign, Comma, Call, Newline, Name,
Number, token, syms, Node, Leaf)
from libfuturize.fixer_util import indentation, sui... | gpl-3.0 |
HKUST-SING/tensorflow | tensorflow/compiler/tests/variable_ops_test.py | 30 | 3939 | # 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 |
AlexHill/django | django/contrib/admindocs/middleware.py | 115 | 1198 | from django.conf import settings
from django import http
class XViewMiddleware(object):
"""
Adds an X-View header to internal HEAD requests -- used by the documentation system.
"""
def process_view(self, request, view_func, view_args, view_kwargs):
"""
If the request method is HEAD and... | bsd-3-clause |
ojengwa/oh-mainline | vendor/packages/Django/django/db/backends/sqlite3/creation.py | 109 | 4033 | import os
import sys
from django.db.backends.creation import BaseDatabaseCreation
from django.utils.six.moves import input
class DatabaseCreation(BaseDatabaseCreation):
# SQLite doesn't actually support most of these types, but it "does the right
# thing" given more verbose field definitions, so leave them as ... | agpl-3.0 |
mrabbah/snmpccgx | flask/lib/python2.7/site-packages/pip/_vendor/lockfile/mkdirlockfile.py | 536 | 3096 | from __future__ import absolute_import, division
import time
import os
import sys
import errno
from . import (LockBase, LockFailed, NotLocked, NotMyLock, LockTimeout,
AlreadyLocked)
class MkdirLockFile(LockBase):
"""Lock file by creating a directory."""
def __init__(self, path, threaded=True,... | gpl-3.0 |
haya14busa/alc-etm-searcher | nltk-3.0a3/build/lib/nltk/parse/pchart.py | 2 | 18780 | # Natural Language Toolkit: Probabilistic Chart Parsers
#
# Copyright (C) 2001-2013 NLTK Project
# Author: Edward Loper <edloper@gmail.com>
# Steven Bird <stevenbird1@gmail.com>
# URL: <http://nltk.org/>
# For license information, see LICENSE.TXT
"""
Classes and interfaces for associating probabilities with tr... | mit |
slohse/ansible | lib/ansible/modules/cloud/openstack/os_nova_flavor.py | 19 | 7526 | #!/usr/bin/python
# Copyright (c) 2015 Hewlett-Packard Development Company, L.P.
# 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 |
zieckey/sdhash | external/tools/build/v2/test/indirect_conditional.py | 20 | 1389 | #!/usr/bin/python
# Copyright (C) Vladimir Prus 2006.
# Distributed under the Boost Software License, Version 1.0. (See
# accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
import BoostBuild
t = BoostBuild.Tester()
t.write("jamroot.jam", """
exe a1 : a1.cpp : <conditional>@a1-rule ... | apache-2.0 |
unintended/Cohen | coherence/backends/playlist_storage.py | 3 | 6766 | # Licensed under the MIT license
# http://opensource.org/licenses/mit-license.php
# a backend
# Copyright 2007, Frank Scholz <coherence@beebits.net>
# Copyright 2008, Jean-Michel Sizun <jm.sizun@free.fr>
from twisted.internet import defer
from coherence.upnp.core import utils
from coherence.upnp.core i... | mit |
kenshay/ImageScripter | ProgramData/SystemFiles/Python/Lib/test/test_sax.py | 18 | 38132 | # regression test for SAX 2.0 -*- coding: utf-8 -*-
# $Id$
from xml.sax import make_parser, ContentHandler, \
SAXException, SAXReaderNotAvailable, SAXParseException
try:
make_parser()
except SAXReaderNotAvailable:
# don't try to test this module if we cannot create a parser
r... | gpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.