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 |
|---|---|---|---|---|---|
timmyArch/timmyPaste | controller/ui.py | 1 | 1498 |
from controller.base import *
class UI(FlaskView):
def index(self):
return render_template('index.haml')
def get(self, key=None):
try:
flash=None
if key == 'new':
return render_template('new.haml')
elif key:
return self.__s... | mit |
belimawr/django-filer | filer/utils/files.py | 12 | 4505 | #-*- coding: utf-8 -*-
from __future__ import unicode_literals
import os, sys
from django.utils.text import get_valid_filename as get_valid_filename_django
from django.template.defaultfilters import slugify as slugify_django
from django.http.multipartparser import ChunkIter, exhaust, \
StopFutureHandlers, SkipFile... | bsd-3-clause |
onyxfish/csvkit | tests/test_utilities/test_csvjoin.py | 3 | 3634 | #!/usr/bin/env python
import sys
try:
from mock import patch
except ImportError:
from unittest.mock import patch
from csvkit.utilities.csvjoin import CSVJoin, launch_new_instance
from tests.utils import CSVKitTestCase, EmptyFileTests
class TestCSVJoin(CSVKitTestCase, EmptyFileTests):
Utility = CSVJoin
... | mit |
benoit-pierre/plover | test/test_formatting.py | 2 | 38867 | # Copyright (c) 2013 Hesky Fisher
# See LICENSE.txt for details.
"""Unit tests for formatting.py."""
import inspect
import pytest
from plover import formatting
from plover.formatting import Case
from plover_build_utils.testing import CaptureOutput, parametrize
def action(**kwargs):
# Support using something ... | gpl-2.0 |
navodissa/python-flask | flask/lib/python2.7/site-packages/pip/_vendor/html5lib/treewalkers/lxmletree.py | 355 | 6215 | from __future__ import absolute_import, division, unicode_literals
from pip._vendor.six import text_type
from lxml import etree
from ..treebuilders.etree import tag_regexp
from gettext import gettext
_ = gettext
from . import _base
from .. import ihatexml
def ensure_str(s):
if s is None:
return None
... | bsd-3-clause |
vitaly-krugl/nupic | tests/unit/nupic/algorithms/anomaly_likelihood_test.py | 12 | 30911 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013-2015, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This p... | agpl-3.0 |
oisinmulvihill/stats-client | stats_client/client/detail.py | 1 | 1948 | # -*- coding: utf-8 -*-
"""
Tools to glean more useful information out of a User Agents (Browser,
Mobile, etc).
Oisin Mulvihill
2016-04-22
"""
#import pycountry
from user_agents import parse
def ua_string_dict(ua_string):
"""Recover useful fields from the user agent string.
This uses https://pypi.python.or... | mit |
defzzd/UserDataBase-Heroku | venv/Lib/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py | 305 | 4235 | from binascii import hexlify, unhexlify
from hashlib import md5, sha1
from ..exceptions import SSLError
try: # Test for SSL features
SSLContext = None
HAS_SNI = False
import ssl
from ssl import wrap_socket, CERT_NONE, PROTOCOL_SSLv23
from ssl import SSLContext # Modern SSL?
from ssl import... | mit |
JelteF/bottor | tracker/app/api/matrix.py | 1 | 1416 | """matrix.py - Controller for Matrix."""
from flask import Blueprint, jsonify, request
from app.controllers import MatrixController
from app.utils import serialize_sqla
from app.views import login
matrix_api = Blueprint('matrix_api', __name__, url_prefix='/api/matrix')
@matrix_api.route('', methods=['POST'])
@login.... | mit |
kamenim/samba-old | script/generate_param.py | 13 | 10980 | # Unix SMB/CIFS implementation.
# Copyright (C) 2014 Catalyst.Net Ltd
#
# Auto generate param_functions.c
#
# ** NOTE! The following LGPL license applies to the ldb
# ** library. This does NOT imply that all of Samba is released
# ** under the LGPL
#
# This library is free software; you can redistribute it and/o... | gpl-3.0 |
edmorley/django | tests/gis_tests/test_gis_tests_utils.py | 67 | 1596 | from django.db import connection, models
from django.db.models.expressions import Func
from django.test import SimpleTestCase
from .utils import FuncTestMixin
def test_mutation(raises=True):
def wrapper(mutation_func):
def test(test_case_instance, *args, **kwargs):
class TestFunc(Func):
... | bsd-3-clause |
pf4d/dolfin-adjoint | dolfin_adjoint/optimization/optimization.py | 1 | 11701 | import numpy as np
import dolfin
from ..reduced_functional_numpy import ReducedFunctionalNumPy, get_global
from ..reduced_functional import ReducedFunctional
from ..utils import gather
from ..misc import rank
def serialise_bounds(rf_np, bounds):
''' Converts bounds to an array of (min, max) tuples and serialises i... | lgpl-3.0 |
andr-pash/timestamp-fcc | node_modules/nodemon/travis_after_all.py | 76 | 4308 | import os
import sys
import json
import time
import logging
try:
import urllib.request as urllib2
except ImportError:
import urllib2
log = logging.getLogger("travis.leader")
log.addHandler(logging.StreamHandler())
log.setLevel(logging.INFO)
TRAVIS_JOB_NUMBER = 'TRAVIS_JOB_NUMBER'
TRAVIS_BUILD_ID = 'TRAVIS_BU... | mit |
franek/weboob | modules/redmine/browser.py | 2 | 7988 | # -*- coding: utf-8 -*-
# Copyright(C) 2010-2011 Romain Bignon
#
# This file is part of weboob.
#
# weboob 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 License, or
# (at your... | agpl-3.0 |
danieljjh/oppia | core/controllers/feedback_test.py | 30 | 13790 | # 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 |
yetanotherindie/jMonkey-Engine | sdk/jme3-blender/src/com/jme3/gde/blender/scripts/import_fbx.py | 13 | 2424 | # This script invokes blender to import and save external model formats as
# .blend files to be processed further.
#
# Example usage for this importer:
# blender --background --factory-startup --python $HOME/import_3ds.py -- \
# --i="/tmp/hello.3ds" \
# --o="/tmp/hello.blend" \
#
# See blender --help... | bsd-3-clause |
MathieuDuponchelle/gobject-introspection | giscanner/gdumpparser.py | 4 | 21125 | # -*- Mode: Python -*-
# GObject-Introspection - a framework for introspecting GObject libraries
# Copyright (C) 2008 Johan Dahlin
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; eithe... | gpl-2.0 |
jackTheRipper/iotrussia | web_server/lib/werkzeug-master/docs/_themes/werkzeug_theme_support.py | 45 | 4812 | from pygments.style import Style
from pygments.token import Keyword, Name, Comment, String, Error, \
Number, Operator, Generic, Whitespace, Punctuation, Other, Literal
class WerkzeugStyle(Style):
background_color = "#f8f8f8"
default_style = ""
styles = {
# No corresponding class for the foll... | gpl-2.0 |
wxgeo/geophar | wxgeometrie/sympy/integrals/meijerint.py | 3 | 76850 | """
Integrate functions by rewriting them as Meijer G-functions.
There are three user-visible functions that can be used by other parts of the
sympy library to solve various integration problems:
- meijerint_indefinite
- meijerint_definite
- meijerint_inversion
They can be used to compute, respectively, indefinite i... | gpl-2.0 |
hhru/ansible | test/units/TestFilters.py | 107 | 5974 | '''
Test bundled filters
'''
import os.path
import unittest, tempfile, shutil
from ansible import playbook, inventory, callbacks
import ansible.runner.filter_plugins.core
import ansible.runner.filter_plugins.mathstuff
INVENTORY = inventory.Inventory(['localhost'])
BOOK = '''
- hosts: localhost
vars:
var: { a: ... | gpl-3.0 |
gitprouser/appengine-bottle-skeleton | lib/setuptools/command/test.py | 22 | 8857 | import os
import operator
import sys
import contextlib
import itertools
from distutils.errors import DistutilsError, DistutilsOptionError
from distutils import log
from unittest import TestLoader
from setuptools.extern import six
from setuptools.extern.six.moves import map, filter
from pkg_resources import (resource_... | apache-2.0 |
KuwaitNET/django-oscar-api | oscarapi/views/basket.py | 1 | 6657 | from django.utils.translation import ugettext_lazy as _
from oscar.apps.basket import signals
from oscar.core.loading import get_model
from rest_framework import status, generics, exceptions
from rest_framework.decorators import api_view
from rest_framework.response import Response
from rest_framework.views import AP... | bsd-3-clause |
flybird119/voltdb | tools/voter.d/voter.py | 7 | 2792 | # This file is part of VoltDB.
# Copyright (C) 2008-2015 VoltDB Inc.
#
# 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, c... | agpl-3.0 |
marxin/youtube-dl | youtube_dl/extractor/streetvoice.py | 129 | 1677 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..compat import compat_str
from ..utils import unified_strdate
class StreetVoiceIE(InfoExtractor):
_VALID_URL = r'https?://(?:.+?\.)?streetvoice\.com/[^/]+/songs/(?P<id>[0-9]+)'
_TESTS = [{
'url': 'http://s... | unlicense |
camilo-v/Neural-Networks | single-layer-networks/adaline/adaline.py | 1 | 4336 | #!/usr/local/bin/python3
# ---------------------------------------------------------------------------------------------------------------------
#
# Bioinformatics Research Group
# http://biorg.cis.fiu.edu/
# ... | gpl-3.0 |
armani-dev/android_kernel_xiaomi_armani_OLD | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Core.py | 11088 | 3246 | # Core.py - Python extension for perf script, core functions
#
# Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com>
#
# This software may be distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Free Software
# Foundation.
from collections import defaultdict
def aut... | gpl-2.0 |
facebook/fbthrift | thrift/compiler/test/fixtures/includes/gen-py/module/ttypes.py | 1 | 7111 | #
# Autogenerated by Thrift
#
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
# @generated
#
from __future__ import absolute_import
import six
import sys
from thrift.util.Recursive import fix_spec
from thrift.Thrift import TType, TMessageType, TPriority, TRequestContext, TProcessorEventHandler, TSe... | apache-2.0 |
bsdman/p2pool | p2pool/test/bitcoin/test_data.py | 272 | 4635 | import unittest
from p2pool.bitcoin import data, networks
from p2pool.util import pack
class Test(unittest.TestCase):
def test_header_hash(self):
assert data.hash256(data.block_header_type.pack(dict(
version=1,
previous_block=0x000000000000038a2a86b72387f93c51298298a732079b3b686df... | gpl-3.0 |
thedrow/django | django/contrib/auth/forms.py | 35 | 14207 | from __future__ import unicode_literals
from django import forms
from django.contrib.auth import (
authenticate, get_user_model, password_validation,
)
from django.contrib.auth.hashers import (
UNUSABLE_PASSWORD_PREFIX, identify_hasher,
)
from django.contrib.auth.models import User
from django.contrib.auth.tok... | bsd-3-clause |
kevinlondon/youtube-dl | youtube_dl/extractor/m6.py | 147 | 1952 | # encoding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
class M6IE(InfoExtractor):
IE_NAME = 'm6'
_VALID_URL = r'http://(?:www\.)?m6\.fr/[^/]+/videos/(?P<id>\d+)-[^\.]+\.html'
_TEST = {
'url': 'http://www.m6.fr/emission-les_reines_du_shopping/videos... | unlicense |
PetePriority/home-assistant | homeassistant/components/cover/__init__.py | 1 | 9420 | """
Support for Cover devices.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/cover/
"""
from datetime import timedelta
import functools as ft
import logging
import voluptuous as vol
from homeassistant.loader import bind_hass
from homeassistant.helpers... | apache-2.0 |
rjdp/EE-dbmigrate | ee/cli/plugins/stack_migrate.py | 3 | 5210 | from cement.core.controller import CementBaseController, expose
from cement.core import handler, hook
from ee.core.mysql import EEMysql
from ee.core.logging import Log
from ee.core.variables import EEVariables
from ee.core.aptget import EEAptGet
from ee.core.shellexec import EEShellExec
from ee.core.apt_repo import EER... | mit |
fairbird/OpenPLI-BlackHole | lib/python/Blackhole/BhBlue.py | 1 | 16097 | from Screens.Screen import Screen
from enigma import iServiceInformation, eTimer
from Components.ActionMap import ActionMap
from Components.Label import Label
from Components.ScrollLabel import ScrollLabel
from Components.MenuList import MenuList
from Components.Sources.List import List
from Components.Pixmap import Mu... | gpl-2.0 |
rgommers/statsmodels | statsmodels/sandbox/tsa/examples/try_ld_nitime.py | 34 | 1354 | '''Levinson Durbin recursion adjusted from nitime
'''
from statsmodels.compat.python import range
import numpy as np
from statsmodels.tsa.stattools import acovf
def levinson_durbin_nitime(s, order=10, isacov=False):
'''Levinson-Durbin recursion for autoregressive processes
'''
#from nitime
## if sx... | bsd-3-clause |
alikins/subscription-manager | src/subscription_manager/managerlib.py | 2 | 32414 | #
# common calls to get product and entitlemnt info for gui/tui
#
# Copyright (c) 2010 Red Hat, Inc.
#
# This software is licensed to you under the GNU General Public License,
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
# implied, including the implied warranties of MERCHANTABILITY or FITNES... | gpl-2.0 |
Belxjander/Kirito | Python-3.5.0-main/Lib/test/test_frame.py | 12 | 4476 | import gc
import sys
import types
import unittest
import weakref
from test import support
class ClearTest(unittest.TestCase):
"""
Tests for frame.clear().
"""
def inner(self, x=5, **kwargs):
1/0
def outer(self, **kwargs):
try:
self.inner(**kwargs)
except Zero... | gpl-3.0 |
tensor-tang/Paddle | python/paddle/distributed/launch_ps.py | 2 | 5430 | # Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | apache-2.0 |
sbidoul/buildbot | master/buildbot/process/debug.py | 11 | 2024 | # This file is part of Buildbot. Buildbot 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, version 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without eve... | gpl-2.0 |
int19h/PTVS | Python/Tests/TestData/VirtualEnv/env/Lib/encodings/ascii.py | 858 | 1248 | """ Python 'ascii' Codec
Written by Marc-Andre Lemburg (mal@lemburg.com).
(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.
"""
import codecs
### Codec APIs
class Codec(codecs.Codec):
# Note: Binding these as C functions will result in the class not
# converting them to methods. This is intended.
... | apache-2.0 |
landism/pants | tests/python/pants_test/backend/jvm/tasks/test_detect_duplicates.py | 8 | 10101 | # coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import os
from pant... | apache-2.0 |
mlperf/inference_results_v0.5 | open/NVIDIA/code/gnmt/tensorrt/GNMT.py | 1 | 4828 | # Copyright (c) 2019, NVIDIA CORPORATION. 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 appli... | apache-2.0 |
nerzhul/ansible | lib/ansible/modules/cloud/digital_ocean/digital_ocean_tag.py | 47 | 7481 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# 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.
#... | gpl-3.0 |
faucamp/python-gsmmodem | examples/dial_callback_demo.py | 12 | 2583 | #!/usr/bin/env python
"""\
Demo: dial a number (using callbacks to track call status)
Simple demo app that makes a voice call and plays sone DTMF tones (if supported by modem)
when the call is answered, and hangs up the call.
It uses the dial() methods callback mechanism to be informed when the call is answered and e... | lgpl-3.0 |
Mega-DatA-Lab/mxnet | example/rcnn/rcnn/symbol/proposal_target.py | 25 | 4760 | # 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 |
HyperBaton/ansible | lib/ansible/plugins/action/cli_config.py | 10 | 1302 | #
# Copyright 2018 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.
#
# Ansibl... | gpl-3.0 |
Workday/OpenFrame | tools/polymer/txt_to_polymer_grdp.py | 21 | 2455 | #!/usr/bin/env python
# Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from __future__ import with_statement
import os
import string
import sys
FILE_TEMPLATE = \
"""<?xml version="1.0" encoding="utf-8"?>
... | bsd-3-clause |
vicky2135/lucious | oscar/lib/python2.7/site-packages/pip/_vendor/webencodings/mklabels.py | 512 | 1305 | """
webencodings.mklabels
~~~~~~~~~~~~~~~~~~~~~
Regenarate the webencodings.labels module.
:copyright: Copyright 2012 by Simon Sapin
:license: BSD, see LICENSE for details.
"""
import json
try:
from urllib import urlopen
except ImportError:
from urllib.request import urlopen
def asser... | bsd-3-clause |
phuongxuanpham/SelfDrivingCar | CarND-Alexnet-Feature-Extraction-Lab/traffic_sign_inference_solution.py | 7 | 1040 | """
The traffic signs are 32x32 so you
have to resize them to be 227x227 before
passing them to AlexNet.
"""
import time
import tensorflow as tf
import numpy as np
from scipy.misc import imread
from caffe_classes import class_names
from alexnet import AlexNet
# placeholders
x = tf.placeholder(tf.float32, (None, 32, 3... | gpl-3.0 |
pomegranited/edx-platform | common/test/acceptance/pages/studio/users.py | 15 | 9666 | """
Page classes to test either the Course Team page or the Library Team page.
"""
from bok_choy.promise import EmptyPromise
from bok_choy.page_object import PageObject
from ...tests.helpers import disable_animations
from .course_page import CoursePage
from . import BASE_URL
def wait_for_ajax_or_reload(browser):
... | agpl-3.0 |
Serag8/Bachelor | google_appengine/lib/django-1.5/django/views/generic/list.py | 99 | 6695 | from __future__ import unicode_literals
from django.core.paginator import Paginator, InvalidPage
from django.core.exceptions import ImproperlyConfigured
from django.http import Http404
from django.utils.translation import ugettext as _
from django.views.generic.base import TemplateResponseMixin, ContextMixin, View
c... | mit |
RYWU/slick | slick/blueprints/dns/manager.py | 4 | 3123 | from SoftLayer import DNSManager, SoftLayerAPIError
from slick.utils.core import get_client
from slick.utils.date import parse_date
def add_record(zone_id, host, rec_type, data, ttl=60):
""" Creates a new record based upon the passed information.
:param int zone_id: The ID of the zone in which this record s... | mit |
x2nie/odoo | addons/product_extended/wizard/wizard_price.py | 104 | 2687 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
# Copyright (C) 2010-2011 OpenERP S.A. (<http://www.openerp.com>).
# $Id$
#
# This program is free... | agpl-3.0 |
bdero/edx-platform | common/lib/capa/capa/safe_exec/lazymod.py | 68 | 1207 | """A module proxy for delayed importing of modules.
From http://barnesc.blogspot.com/2006/06/automatic-python-imports-with-autoimp.html,
in the public domain.
"""
import sys
class LazyModule(object):
"""A lazy module proxy."""
def __init__(self, modname):
self.__dict__['__name__'] = modname
... | agpl-3.0 |
hydroffice/hyo_soundspeed | examples/soundspeed/profile/ex_profile_stats.py | 1 | 1775 | from datetime import datetime
import random
import logging
import numpy as np
from hyo2.soundspeed.profile.profile import Profile
from hyo2.abc.lib.logging import set_logging
ns_list = ["hyo2.soundspeed", "hyo2.soundspeedmanager", "hyo2.soundspeedsettings"]
set_logging(ns_list=ns_list)
logger = logging.getLogger(__... | lgpl-2.1 |
go-bears/rally | tests/unit/plugins/openstack/scenarios/ec2/test_utils.py | 1 | 2950 | # 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 agreed to in writing, software
#... | apache-2.0 |
laurivosandi/compiler-construction | toolchain/coder.py | 1 | 8241 | # coding: utf-8
"""
µ-Opal to UEBB machine instruction set compiler
"""
import sys
import lexer
from parser import Parser
from ctxcheck import context_check
import absy
import ir
import builtin
BUILTIN_MAPPING = {
builtin.DefinitionEq: ir.Eq,
builtin.DefinitionLessThan: ir.Lt,
builtin.Definition... | mit |
savinash47/openstack-doc-tools | os_doc_tools/openstack/common/local.py | 378 | 1677 | # Copyright 2011 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 req... | apache-2.0 |
ActiveState/code | recipes/Python/578354_Dynamically_create_dictionary_ascending/recipe-578354.py | 1 | 1171 | #!/usr/bin/env python
"""
Create a dictionary of ascending (sequential) directories.
"""
def make_pathdict(keys, fspath = None):
"""Quickly create a dictionary of ascending path components.
:param keys: list of dictionary keys (base -> root order)
:returns: dictionary of keyed paths
NOTICE: Thi... | mit |
BrunoDefrance/PLUi_versionning_manager | actions_versionning.py | 1 | 47156 | # coding: utf8
from PyQt4.QtGui import *
from qgis.gui import QgsMessageBar
from qgis.core import QgsMessageLog
from qgis.core import QgsProject
from qgis.core import QgsFeatureRequest
from qgis.core import QgsMapLayerRegistry
from qgis.core import QgsExpressionContextUtils
from qgis.core import QgsExpression... | gpl-3.0 |
phektus/Django-Google-AppEngine-OpenId-Auth | django/contrib/gis/db/backends/postgis/operations.py | 292 | 25840 | import re
from decimal import Decimal
from django.conf import settings
from django.contrib.gis.db.backends.base import BaseSpatialOperations
from django.contrib.gis.db.backends.util import SpatialOperation, SpatialFunction
from django.contrib.gis.db.backends.postgis.adapter import PostGISAdapter
from django.contrib.gi... | bsd-3-clause |
petewarden/tensorflow_makefile | tensorflow/contrib/layers/python/layers/__init__.py | 5 | 1484 | # 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... | apache-2.0 |
yghannam/teuthology | docs/_static/create_nodes.py | 9 | 1891 | #!/usr/bin/env python
# A sample script that can be used while setting up a new teuthology lab
# This script will connect to the machines in your lab, and populate a
# paddles instance with their information.
#
# You WILL need to modify it.
import logging
import sys
from teuthology.orchestra.remote import Remote
from ... | mit |
siddharthv/sm | drivers/RawHBASR.py | 10 | 15273 | #!/usr/bin/python
#
# Copyright (C) Citrix Systems Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation; version 2.1 only.
#
# This program is distributed in the hope that it will be u... | lgpl-2.1 |
jerli/sympy | sympy/ntheory/modular.py | 108 | 7676 | from __future__ import print_function, division
from sympy.core.numbers import igcdex, igcd
from sympy.core.mul import prod
from sympy.core.compatibility import as_int, reduce
from sympy.ntheory.primetest import isprime
from sympy.polys.domains import ZZ
from sympy.polys.galoistools import gf_crt, gf_crt1, gf_crt2
d... | bsd-3-clause |
CSF-JH/crossbarexamples | launchpad/test4.py | 12 | 1629 | import launchpad
import time, random
class Test:
FENCE = [(-1,-1), (0,-1), (1,-1), (1,0), (1,1), (0,1), (-1,1), (-1,0)]
def __init__(self, lp, mode = 0):
self.lp = lp
self.mode = mode
self.matrix = []
for y in xrange(9):
self.matrix.append([])
for x in xrange(9):
... | apache-2.0 |
haeusser/tensorflow | tensorflow/python/ops/accumulate_n_benchmark.py | 114 | 5470 | # 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 |
nicememory/pie | pyglet/pyglet/libs/x11/xinerama.py | 46 | 2240 | '''Wrapper for Xinerama
Generated with:
tools/genwrappers.py xinerama
Do not modify this file.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id$'
import ctypes
from ctypes import *
import pyglet.lib
_lib = pyglet.lib.load_library('Xinerama')
_int_types = (c_int16, c_int32)
if hasattr(ctypes, 'c_int64')... | apache-2.0 |
chlorisdroid/linux-rt-odroid-c1 | tools/perf/scripts/python/sched-migration.py | 11215 | 11670 | #!/usr/bin/python
#
# Cpu task migration overview toy
#
# Copyright (C) 2010 Frederic Weisbecker <fweisbec@gmail.com>
#
# perf script event handlers have been generated by perf script -g python
#
# This software is distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Fre... | gpl-2.0 |
andrew-aladev/samba-talloc-debug | lib/dnspython/dns/rdtypes/IN/A.py | 100 | 2054 | # Copyright (C) 2003-2007, 2009-2011 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
# provided that the above copyright notice and this permission notice
# appear in all copies.
#
# THE SOFTWARE IS PROVIDED "... | gpl-3.0 |
soarpenguin/ansible | lib/ansible/modules/web_infrastructure/rundeck_acl_policy.py | 9 | 8354 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2017, Loic Blot <loic.blot@unix-experience.fr>
# Sponsored by Infopro Digital. http://www.infopro-digital.com/
# Sponsored by E.T.A.I. http://www.etai.fr/
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import... | gpl-3.0 |
soarpenguin/ansible | lib/ansible/modules/cloud/cloudstack/cs_region.py | 18 | 5397 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2016, René Moser <mail@renemoser.net>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the Lice... | gpl-3.0 |
mezz64/home-assistant | homeassistant/components/demo/stt.py | 21 | 1969 | """Support for the demo for speech to text service."""
from typing import List
from aiohttp import StreamReader
from homeassistant.components.stt import Provider, SpeechMetadata, SpeechResult
from homeassistant.components.stt.const import (
AudioBitRates,
AudioChannels,
AudioCodecs,
AudioFormats,
... | apache-2.0 |
ii0/bits | python/bits/cdata.py | 2 | 7490 | # Copyright (c) 2015, Intel Corporation
# 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 condit... | bsd-3-clause |
bernard357/shellbot | shellbot/stores/sqlite.py | 1 | 5489 | # -*- coding: 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 License, Version 2.0
# (the "Li... | apache-2.0 |
evilhero/mylar | mylar/scheduler.py | 2 | 2776 | # Author: Nic Wolfe <nic@wolfeden.ca>
# URL: http://code.google.com/p/sickbeard/
#
# This file is part of Sick Beard.
#
# Sick Beard is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the Lice... | gpl-3.0 |
rdamas/e2openplugin-OpenWebif | plugin/controllers/models/info.py | 3 | 26681 | #!/usr/bin/python
# -*- coding: utf-8 -*-
##########################################################################
# OpenWebif: info
##########################################################################
# Copyright (C) 2011 - 2021 E2OpenPlugins
#
# This program is free software; you can redistribute it and/or m... | gpl-3.0 |
citassa1985/youtube-dl | youtube_dl/extractor/goldenmoustache.py | 159 | 1739 | from __future__ import unicode_literals
from .common import InfoExtractor
class GoldenMoustacheIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?goldenmoustache\.com/(?P<display_id>[\w-]+)-(?P<id>\d+)'
_TESTS = [{
'url': 'http://www.goldenmoustache.com/suricate-le-poker-3700/',
'md5': '0f9... | unlicense |
cripplet/django_iin_lookup | tests.py | 1 | 1075 | import requests
from django.test import TestCase
from models import IINInfo
class TestIINInfo(TestCase):
def test_iin(self):
self.assertEqual(IINInfo.objects.count(), 0)
info = IINInfo.objects.fetch_iin(iin='546116')
self.assertEqual(IINInfo.objects.count(), 1)
self.assertEqual(info.bin, '546116')
self.ass... | mit |
gusai-francelabs/datafari | windows/python/Lib/site-packages/pip/_vendor/_markerlib/markers.py | 1769 | 3979 | # -*- coding: utf-8 -*-
"""Interpret PEP 345 environment markers.
EXPR [in|==|!=|not in] EXPR [or|and] ...
where EXPR belongs to any of those:
python_version = '%s.%s' % (sys.version_info[0], sys.version_info[1])
python_full_version = sys.version.split()[0]
os.name = os.name
sys.platform = sys.platfo... | apache-2.0 |
arantebillywilson/python-snippets | microblog/flask/lib/python3.5/site-packages/sqlalchemy/orm/state.py | 32 | 27492 | # orm/state.py
# Copyright (C) 2005-2017 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""Defines instrumentation of instances.
This module is usually not directly visible t... | mit |
EverlyWell/redash | redash/authentication/saml_auth.py | 13 | 5120 | import logging
import requests
from flask import redirect, url_for, Blueprint, request
from redash.authentication.google_oauth import create_and_login_user
from redash.authentication.org_resolving import current_org
from redash import settings
from saml2 import BINDING_HTTP_POST, BINDING_HTTP_REDIRECT, entity
from saml... | bsd-2-clause |
zentner-kyle/servo | python/mozlog/tests/test_logger.py | 44 | 11335 | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
import datetime
import json
import socket
import threading
import time
import unittest
import mozfile
import mozlog
c... | mpl-2.0 |
MalloyPower/parsing-python | front-end/testsuite-python-lib/Python-3.2/Lib/test/test_metaclass.py | 59 | 6062 | doctests = """
Basic class construction.
>>> class C:
... def meth(self): print("Hello")
...
>>> C.__class__ is type
True
>>> a = C()
>>> a.__class__ is C
True
>>> a.meth()
Hello
>>>
Use *args notation for the bases.
>>> class A: pass
>>> class B: pass
>>>... | mit |
newrocknj/horizon | openstack_dashboard/dashboards/admin/instances/urls.py | 66 | 1554 | # 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 |
bwesterb/py-demandimport | src/__init__.py | 1 | 10488 | # demandimport.py - global demand-loading of modules for Mercurial
#
# Copyright 2006, 2007 Matt Mackall <mpm@selenic.com>
# 2013, 2015 Bas Westerbaan <bas@westerbaan.name>
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
... | gpl-2.0 |
amorwilliams/gsoops | server/libs/aliyun-sls-sdk-python-0.6.0/google/protobuf/text_format.py | 261 | 21737 | # Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
# http://code.google.com/p/protobuf/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions o... | mit |
ryuunosukeyoshi/PartnerPoi-Bot | lib/urllib3/contrib/appengine.py | 224 | 10865 | """
This module provides a pool manager that uses Google App Engine's
`URLFetch Service <https://cloud.google.com/appengine/docs/python/urlfetch>`_.
Example usage::
from urllib3 import PoolManager
from urllib3.contrib.appengine import AppEngineManager, is_appengine_sandbox
if is_appengine_sandbox():
... | gpl-3.0 |
ddrown/irssiconnectbot-protobuf | examples/list_people.py | 429 | 1135 | #! /usr/bin/python
# See README.txt for information and build instructions.
import addressbook_pb2
import sys
# Iterates though all people in the AddressBook and prints info about them.
def ListPeople(address_book):
for person in address_book.person:
print "Person ID:", person.id
print " Name:", person.na... | bsd-3-clause |
MackZxh/OCA-Choice | server-tools/server_env_base_external_referentials/__openerp__.py | 53 | 1954 | # -*- coding: utf-8 -*-
##############################################################################
#
# Author: Guewen Baconnier
# Copyright 2011-2012 Camptocamp SA
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# ... | lgpl-3.0 |
0x0all/nupic | py/nupic/support/configuration_base.py | 2 | 13684 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... | gpl-3.0 |
narry/odenos | apps/mininet_examples/multi_network_control/config_odenos.py | 6 | 10564 | #!/usr/bin/env python
# -*- coding:utf-8 -*-
# Copyright 2015 NEC Corporation. #
# #
# Licensed under the Apache License, Version 2.0 (the "License"); #
# you may not use this file except in comp... | apache-2.0 |
wlamond/scikit-learn | sklearn/datasets/rcv1.py | 17 | 8271 | """RCV1 dataset.
"""
# Author: Tom Dupre la Tour
# License: BSD 3 clause
import logging
from os.path import exists, join
from gzip import GzipFile
from io import BytesIO
from contextlib import closing
try:
from urllib2 import urlopen
except ImportError:
from urllib.request import urlopen
import numpy as np... | bsd-3-clause |
Eagles2F/sync-engine | migrations/versions/128_fix_cascades.py | 9 | 1263 | """fix_cascades
Revision ID: 284227d72f51
Revises: 581e91bd7141
Create Date: 2015-01-15 14:03:36.379402
"""
# revision identifiers, used by Alembic.
revision = '284227d72f51'
down_revision = '581e91bd7141'
from alembic import op
def upgrade():
connection = op.get_bind()
connection.execute(
'''
... | agpl-3.0 |
a10networks/a10sdk-python | a10sdk/core/slb/slb_fix_stats.py | 2 | 3197 | from a10sdk.common.A10BaseClass import A10BaseClass
class Stats(A10BaseClass):
"""This class does not support CRUD Operations please use parent.
:param svrsel_fail: {"description": "Server selection failure", "format": "counter", "type": "number", "oid": "3", "optional": true, "size": "8"}
:param de... | apache-2.0 |
nanolearning/edx-platform | common/lib/capa/capa/util.py | 3 | 5174 | from calc import evaluator
from cmath import isinf
#-----------------------------------------------------------------------------
#
# Utility functions used in CAPA responsetypes
default_tolerance = '0.001%'
def compare_with_tolerance(student_complex, instructor_complex, tolerance=default_tolerance, relative_toleran... | agpl-3.0 |
qisanstudio/qstudio-launch | src/studio/launch/commands/nginx_commands.py | 1 | 3541 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from __future__ import print_function
import os
import sys
import sh
from sh import sudo, ErrorReturnCode
from StringIO import StringIO
from termcolor import colored
from studio.frame import config
from studio.launch.base import manager
from .contrib impo... | mit |
hortonworks/hortonworks-sandbox | desktop/core/ext-py/Pygments-1.3.1/pygments/formatters/html.py | 55 | 26839 | # -*- coding: utf-8 -*-
"""
pygments.formatters.html
~~~~~~~~~~~~~~~~~~~~~~~~
Formatter for HTML output.
:copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import os
import sys
import StringIO
from pygments.formatter import Formatter
fr... | apache-2.0 |
Cinntax/home-assistant | homeassistant/components/snmp/device_tracker.py | 2 | 3830 | """Support for fetching WiFi associations through SNMP."""
import binascii
import logging
import voluptuous as vol
from homeassistant.components.device_tracker import (
DOMAIN,
PLATFORM_SCHEMA,
DeviceScanner,
)
from homeassistant.const import CONF_HOST
import homeassistant.helpers.config_validation as cv
... | apache-2.0 |
gitprouser/appengine-bottle-skeleton | lib/simplejson/tests/test_indent.py | 147 | 2568 | from unittest import TestCase
import textwrap
import simplejson as json
from simplejson.compat import StringIO
class TestIndent(TestCase):
def test_indent(self):
h = [['blorpie'], ['whoops'], [], 'd-shtaeou', 'd-nthiouh',
'i-vhbjkhnth',
{'nifty': 87}, {'field': 'yes', 'morefield'... | apache-2.0 |
deisi/home-assistant | homeassistant/components/switch/tellduslive.py | 24 | 1996 | """
Support for Tellstick switches using Tellstick Net.
This platform uses the Telldus Live online service.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/switch.tellduslive/
"""
import logging
from homeassistant.components import tellduslive
from hom... | mit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.