repo_name stringlengths 6 100 | path stringlengths 4 294 | copies stringlengths 1 5 | size stringlengths 4 6 | content stringlengths 606 896k | license stringclasses 15
values |
|---|---|---|---|---|---|
kenshay/ImageScripter | ProgramData/SystemFiles/Python/Lib/site-packages/tornado/test/queues_test.py | 34 | 13062 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under th... | gpl-3.0 |
luto/django-dashing | dashing/utils.py | 6 | 1414 | from django.conf.urls import url
from .views import Dashboard
class Router(object):
def __init__(self):
self.registry = []
def register(self, widget, basename, **parameters):
""" Register a widget, URL basename and any optional URL parameters.
Parameters are passed as keyword argumen... | bsd-3-clause |
kailIII/geraldo | site/newsite/django_1_0/django/utils/_decimal.py | 51 | 105443 | # Copyright (c) 2004 Python Software Foundation.
# All rights reserved.
# Written by Eric Price <eprice at tjhsst.edu>
# and Facundo Batista <facundo at taniquetil.com.ar>
# and Raymond Hettinger <python at rcn.com>
# and Aahz <aahz at pobox.com>
# and Tim Peters
# This module is currently Py2.3 compatibl... | lgpl-3.0 |
Dugy/wesnoth-names | data/tools/unit_tree/html_output.py | 4 | 44552 | #encoding: utf8
import os, gettext, time, copy, sys, re
import traceback
import unit_tree.helpers as helpers
import wesnoth.wmlparser3 as wmlparser3
pics_location = "../../pics"
html_header = '''
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR... | gpl-2.0 |
atosatto/ansible | lib/ansible/modules/database/proxysql/proxysql_query_rules.py | 58 | 23125 | #!/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 |
hybrid-storage-dev/cinder-client-fs-111t-hybrid-cherry | v2/quota_classes.py | 7 | 1439 | # 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 |
jmschrei/scikit-learn | sklearn/linear_model/tests/test_passive_aggressive.py | 169 | 8809 | import numpy as np
import scipy.sparse as sp
from sklearn.utils.testing import assert_less
from sklearn.utils.testing import assert_greater
from sklearn.utils.testing import assert_array_almost_equal, assert_array_equal
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.testing import assert_rais... | bsd-3-clause |
kivhift/qmk | src/commands/help.py | 1 | 1442 | #
# Copyright (c) 2009-2012 Joshua Hughes <kivhift@gmail.com>
#
import atexit
import os
import tempfile
import urllib
import webbrowser
import qmk
class HelpCommand(qmk.Command):
'''
View help for all available commands. A new tab will be opened in the
default web browser that contains the help for all o... | mit |
ljgabc/lfs | usr/lib/python2.7/encodings/cp1255.py | 593 | 12722 | """ Python Character Mapping Codec cp1255 generated from 'MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1255.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_table)
def decode(self,in... | gpl-2.0 |
kenshay/ImageScripter | ProgramData/SystemFiles/Python/Lib/site-packages/jupyter_client/tests/test_connect.py | 6 | 4395 | """Tests for kernel connection utilities"""
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
import json
import os
import nose.tools as nt
from traitlets.config import Config
from jupyter_core.application import JupyterApp
from ipython_genutils.tempdir import Temp... | gpl-3.0 |
TeamExodus/legacy_kernel_htc_flounder | Documentation/networking/cxacru-cf.py | 14668 | 1626 | #!/usr/bin/env python
# Copyright 2009 Simon Arlott
#
# 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 i... | gpl-2.0 |
dyrock/trafficserver | tests/gold_tests/headers/forwarded.test.py | 3 | 12009 | '''
Test the Forwarded header and related configuration..
'''
# 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 und... | apache-2.0 |
xclusive36/android_kernel_lge_fx3 | Documentation/networking/cxacru-cf.py | 14668 | 1626 | #!/usr/bin/env python
# Copyright 2009 Simon Arlott
#
# 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 i... | gpl-2.0 |
demisto/content | Packs/WindowsForensics/Scripts/RegistryParse/RegistryParse_test.py | 1 | 1112 | import json
import RegistryParse as reg_parse
def util_load_json(path):
with open(path, mode='r', encoding='utf-8') as f:
return json.loads(f.read())
def test_get_sub_keys():
key = 'HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\ProfileList'
folder_output_key = 'Sid'
mo... | mit |
okomestudio/moto | tests/test_s3/test_s3_storageclass.py | 3 | 3415 | from __future__ import unicode_literals
import boto
import boto3
from boto.exception import S3CreateError, S3ResponseError
from boto.s3.lifecycle import Lifecycle, Transition, Expiration, Rule
import sure # noqa
from botocore.exceptions import ClientError
from datetime import datetime
from nose.tools import assert_r... | apache-2.0 |
dhermes/gcloud-python | monitoring/noxfile.py | 2 | 4094 | # -*- coding: utf-8 -*-
#
# Copyright 2018 Google LLC
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | apache-2.0 |
aioue/ansible | lib/ansible/plugins/callback/timer.py | 168 | 1125 | # Make coding more python3-ish
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from datetime import datetime
from ansible.plugins.callback import CallbackBase
class CallbackModule(CallbackBase):
"""
This callback module tells you how long your plays ran for.
"""
... | gpl-3.0 |
brunolimawd/talk-nodebots-roll-out | node_modules/node-sass/node_modules/node-gyp/gyp/pylib/gyp/generator/ninja.py | 1284 | 100329 | # Copyright (c) 2013 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 collections
import copy
import hashlib
import json
import multiprocessing
import os.path
import re
import signal
import subprocess
import sys
import gyp
imp... | mit |
mdraeger/gmapcatcher | gmapcatcher/gps/fake.py | 4 | 24400 | # This file is Copyright (c) 2010 by the GPSD project
# BSD terms apply: see the file COPYING in the distribution root for details.
"""
gpsfake.py -- classes for creating a controlled test environment around gpsd.
The gpsfake(1) regression tester shipped with gpsd is a trivial wrapper
around this code. For a more int... | gpl-2.0 |
hohe/scikit-rf | skrf/tlineFunctions.py | 4 | 13802 |
'''
.. module:: skrf.tlineFunctions
===============================================
tlineFunctions (:mod:`skrf.tlineFunctions`)
===============================================
This module provides functions related to transmission line theory.
Impedance and Reflection Coefficient
------------------------------------... | bsd-3-clause |
yashLadha/coala | tests/coalaTest.py | 5 | 7484 | import os
import re
import sys
import unittest
import unittest.mock
from pkg_resources import VersionConflict
from coalib.coala_main import run_coala
from coalib.output.printers.LogPrinter import LogPrinter
from coalib import assert_supported_version, coala
from pyprint.ConsolePrinter import ConsolePrinter
from coala_... | agpl-3.0 |
cainmatt/django | django/middleware/common.py | 145 | 7274 | import logging
import re
from django import http
from django.conf import settings
from django.core import urlresolvers
from django.core.exceptions import PermissionDenied
from django.core.mail import mail_managers
from django.utils.cache import get_conditional_response, set_response_etag
from django.utils.encoding imp... | bsd-3-clause |
akash1808/nova_test_latest | nova/tests/unit/virt/vmwareapi/test_ds_util_datastore_selection.py | 35 | 7367 | #
# 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 |
KDE/twine2 | kdelibs.py | 1 | 37607 | # -*- coding: utf-8 -*-
# Copyright 2009-2010 Simon Edwards <simon@simonzone.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any... | lgpl-3.0 |
josiah-wolf-oberholtzer/supriya | tests/nonrealtime/test_nonrealtime_Session_zero_duration.py | 1 | 2475 | import pytest
import supriya.assets.synthdefs
import supriya.nonrealtime
import supriya.synthdefs
import supriya.ugens
def test_manual_with_gate():
session = supriya.nonrealtime.Session(0, 2)
with session.at(0):
group = session.add_group(duration=4)
for i in range(4):
with session.at(i):
... | mit |
JGiola/swift | utils/gyb_syntax_support/TypeNodes.py | 10 | 8308 | from .Child import Child
from .Node import Node # noqa: I201
TYPE_NODES = [
# simple-type-identifier -> identifier generic-argument-clause?
Node('SimpleTypeIdentifier', kind='Type',
children=[
Child('Name', kind='Token', classification='TypeIdentifier',
token_choices=[... | apache-2.0 |
frouty/odoo_oph | addons/mail/res_users.py | 36 | 10508 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2009-Today OpenERP SA (<http://www.openerp.com>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms o... | agpl-3.0 |
pombredanne/hitch | hitch/commandline.py | 1 | 10374 | """High level command line interface to hitch."""
from subprocess import call, PIPE, STDOUT, CalledProcessError, Popen
from hitch.click import command, group, argument, option
from os import path, makedirs, listdir, kill, remove
from sys import stderr, exit, modules, argv
from functools import partial
from hitch import... | agpl-3.0 |
JavaRabbit/CS496_capstone | blog/introduction_to_data_models_in_cloud_datastore/blog.py | 9 | 3743 | # Copyright 2015, Google, Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | apache-2.0 |
liorvh/infernal-twin | build/reportlab/src/reportlab/graphics/widgets/markers.py | 34 | 8442 | #Copyright ReportLab Europe Ltd. 2000-2013
#see license.txt for license details
__version__=''' $Id$ '''
__doc__="""This modules defines a collection of markers used in charts.
"""
from reportlab.graphics.shapes import Rect, Line, Circle, Polygon, Drawing, Group
from reportlab.graphics.widgets.signsandsymbols import ... | gpl-3.0 |
christoph-buente/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/port/config.py | 126 | 6136 | # Copyright (C) 2010 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 ... | bsd-3-clause |
locaweb/simplenet | src/simplenet/common/event.py | 1 | 4587 | # Copyright 2012 Locaweb.
# 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... | mit |
jeffrey4l/nova | nova/tests/unit/test_safeutils.py | 55 | 4340 | # Copyright 2011 Justin Santa Barbara
#
# 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 l... | apache-2.0 |
tuaris/bitcoin | contrib/testgen/base58.py | 2139 | 2818 | '''
Bitcoin base58 encoding and decoding.
Based on https://bitcointalk.org/index.php?topic=1026.0 (public domain)
'''
import hashlib
# for compatibility with following code...
class SHA256:
new = hashlib.sha256
if str != bytes:
# Python 3.x
def ord(c):
return c
def chr(n):
return byte... | mit |
EmreAtes/spack | var/spack/repos/builtin/packages/py-mg-rast-tools/package.py | 3 | 2387 | ##############################################################################
# Copyright (c) 2013-2018, 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 |
georgewhewell/CouchPotatoServer | libs/tornado/escape.py | 5 | 14094 | #!/usr/bin/env python
#
# Copyright 2009 Facebook
#
# 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... | gpl-3.0 |
wlerin/streamlink | src/streamlink/stream/flvconcat.py | 6 | 10722 | from __future__ import division
import logging
from collections import namedtuple
from io import IOBase
from itertools import chain, islice
from threading import Thread
from ..buffers import RingBuffer
from ..packages.flashmedia import FLVError
from ..packages.flashmedia.tag import (AudioData, AACAudioData, VideoData... | bsd-2-clause |
certik/sfepy | sfepy/base/conf.py | 1 | 10020 | import re
from base import Struct, IndexedStruct, dict_to_struct, pause, output, copy,\
import_file, assert_, get_default
from reader import Reader
_required = ['filename_mesh', 'field_[0-9]+|fields',
'ebc_[0-9]+|ebcs', 'fe', 'equations',
'region_[0-9]+|regions', 'variable_[0-9]+|variab... | bsd-3-clause |
keisuke-umezawa/chainer | chainer/links/connection/embed_id.py | 4 | 2230 | from chainer.functions.connection import embed_id
from chainer.initializers import normal
from chainer import link
from chainer import variable
class EmbedID(link.Link):
"""Efficient linear layer for one-hot input.
This is a link that wraps the :func:`~chainer.functions.embed_id` function.
This link hol... | mit |
cjmayo/mapnik | scons/scons-local-2.3.6/SCons/Platform/os2.py | 4 | 2200 | """SCons.Platform.os2
Platform-specific initialization for OS/2 systems.
There normally shouldn't be any need to import this module directly. It
will usually be imported through the generic SCons.Platform.Platform()
selection method.
"""
#
# Copyright (c) 2001 - 2015 The SCons Foundation
#
# Permission is hereby gr... | lgpl-2.1 |
Franky666/programmiersprachen-raytracer | external/boost_1_59_0/libs/mpl/doc/src/refmanual/refmanual.py | 10 | 3851 | # Copyright (c) Aleksey Gurtovoy 2001-2009
#
# 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 fnmatch
import os
import sys
import re
import string
underlines = ['+', '/']
special_cases = [ 'inse... | mit |
SSJohns/osf.io | scripts/impute_names.py | 64 | 2374 | """
Email users to verify citation information.
"""
import re
import logging
from framework.auth.utils import impute_names
from framework.email.tasks import send_email
from website.app import init_app
from website import models
app = init_app('website.settings', set_backends=True, routes=True)
logging.basicConfig(... | apache-2.0 |
jollyroger/debian-buildbot | buildbot/test/fake/fakebuild.py | 2 | 2121 | # 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 |
NL66278/OCB | addons/multi_company/__openerp__.py | 52 | 1754 | # -*- 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 |
dharmabumstead/ansible | lib/ansible/modules/web_infrastructure/ansible_tower/tower_job_launch.py | 23 | 4262 | #!/usr/bin/python
# coding: utf-8 -*-
# (c) 2017, Wayne Witzel III <wayne@riotousliving.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 |
jiangzhonghui/thumbor | vows/detector_vows.py | 11 | 1975 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# thumbor imaging service
# https://github.com/globocom/thumbor/wiki
# Licensed under the MIT license:
# http://www.opensource.org/licenses/mit-license
# Copyright (c) 2011 globo.com timehome@corp.globo.com
from pyvows import Vows, expect
ctx = Vows.Context
from thumbor.det... | mit |
muare/PCV | PCV/localdescriptors/dsift.py | 11 | 1360 | from PIL import Image
from numpy import *
import os
from PCV.localdescriptors import sift
def process_image_dsift(imagename,resultname,size=20,steps=10,force_orientation=False,resize=None):
""" Process an image with densely sampled SIFT descriptors
and save the results in a file. Optional input: size of... | bsd-2-clause |
asposeforcloud/Aspose_Cloud_SDK_For_Python | asposecloud/email/__init__.py | 1 | 7149 | __author__ = 'assadmahmood'
import requests
import json
from asposecloud import Product
from asposecloud import AsposeApp
from asposecloud.common import Utils
# ========================================================================
# DOCUMENT CLASS
# ================================================================... | mit |
Glottotopia/aagd | moin/local/moin/MoinMoin/support/pygments/lexers/_clbuiltins.py | 3 | 14247 | # -*- coding: utf-8 -*-
"""
pygments.lexers._clbuiltins
~~~~~~~~~~~~~~~~~~~~~~~~~~~
ANSI Common Lisp builtins.
:copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
BUILTIN_FUNCTIONS = [ # 638 functions
'<', '<=', '=', '>', ... | mit |
GarySparrow/mFlaskWeb | venv/Lib/site-packages/pygments/styles/pastie.py | 50 | 2473 | # -*- coding: utf-8 -*-
"""
pygments.styles.pastie
~~~~~~~~~~~~~~~~~~~~~~
Style similar to the `pastie`_ default style.
.. _pastie: http://pastie.caboo.se/
:copyright: Copyright 2006-2015 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.style impor... | mit |
michalliu/OpenWrt-Firefly-Libraries | staging_dir/host/lib/python3.4/idlelib/ClassBrowser.py | 40 | 7017 | """Class browser.
XXX TO DO:
- reparse when source changed (maybe just a button would be OK?)
(or recheck on window popup)
- add popup menu with more options (e.g. doc strings, base classes, imports)
- show function argument list? (have to do pattern matching on source)
- should the classes and methods lists also... | gpl-2.0 |
ormandj/stalker | stalkerweb/stalkerweb/auth.py | 3 | 2492 | from flask.ext.bcrypt import generate_password_hash, check_password_hash
from flask import request, redirect, url_for, session, abort
from functools import wraps
from stalkerweb import rdb, app
from stalkerweb.stutils import genPrimaryKey64
import rethinkdb as r
def is_valid_email_login(email, password):
uinfo = ... | apache-2.0 |
swprojects/wxPieTool | pyimager.py | 1 | 8720 | """
wxPieTool - wxPython Image Embedding Tool
Copyright 2016 Simon Wu <swprojects@gmx.com>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any la... | gpl-2.0 |
rocket-league-replays/rocket-league-replay-parser | replay_parser/replay_parser.py | 2 | 14301 | # -*- coding: utf-8 -*-
import pprint
import re
import sys
import struct
class ReplayParser:
SERVER_REGEX = r'((EU|USE|USW|OCE|SAM)\d+(-[A-Z][a-z]+)?)'
def __init__(self, debug=False):
self.debug = debug
def parse(self, replay_file):
# Work out what type of file we're dealing with.
... | gpl-2.0 |
troyleak/youtube-dl | youtube_dl/extractor/hypem.py | 128 | 2101 | from __future__ import unicode_literals
import json
import time
from .common import InfoExtractor
from ..compat import (
compat_urllib_parse,
compat_urllib_request,
)
from ..utils import (
ExtractorError,
)
class HypemIE(InfoExtractor):
_VALID_URL = r'http://(?:www\.)?hypem\.com/track/(?P<id>[^/]+)/... | unlicense |
pli3/e2-openwbif | plugin/controllers/views/web/powerstate.py | 1 | 5042 | #!/usr/bin/env python
##################################################
## DEPENDENCIES
import sys
import os
import os.path
try:
import builtins as builtin
except ImportError:
import __builtin__ as builtin
from os.path import getmtime, exists
import time
import types
from Cheetah.Version import MinCompatib... | gpl-2.0 |
tudyzhb/yichui | django/http/multipartparser.py | 20 | 22272 | """
Multi-part parsing for file uploads.
Exposes one class, ``MultiPartParser``, which feeds chunks of uploaded data to
file upload handlers for processing.
"""
import cgi
from django.conf import settings
from django.core.exceptions import SuspiciousOperation
from django.utils.datastructures import MultiValueDict
fro... | bsd-3-clause |
huangbin0709/easyLinux | boot/u-boot-2015.01/tools/genboardscfg.py | 21 | 14502 | #!/usr/bin/env python2
#
# Author: Masahiro Yamada <yamada.m@jp.panasonic.com>
#
# SPDX-License-Identifier: GPL-2.0+
#
"""
Converter from Kconfig and MAINTAINERS to a board database.
Run 'tools/genboardscfg.py' to create a board database.
Run 'tools/genboardscfg.py -h' for available options.
Python 2.6 or later, bu... | gpl-3.0 |
Stranger6667/django-crispy-forms | crispy_forms/layout_slice.py | 32 | 6176 | # -*- coding: utf-8 -*-
from crispy_forms.compatibility import integer_types, string_types
from crispy_forms.exceptions import DynamicError
from crispy_forms.layout import Fieldset, MultiField
from crispy_forms.bootstrap import Container
class LayoutSlice(object):
# List of layout objects that need args passed fi... | mit |
gartung/dxr | dxr/plugins/python/tests/test_overrides/test_overrides.py | 9 | 3459 | from textwrap import dedent
from dxr.plugins.python.tests import PythonSingleFileTestCase
from dxr.testing import DxrInstanceTestCase
class OverridesTests(PythonSingleFileTestCase):
source = dedent("""
class Grandparent(object):
def overridden_all(self): #grandparent
'''Overridden in all ... | mit |
cstipkovic/spidermonkey-research | python/pystache/pystache/loader.py | 48 | 4771 | # coding: utf-8
"""
This module provides a Loader class for locating and reading templates.
"""
import os
import sys
from pystache import common
from pystache import defaults
from pystache.locator import Locator
# We make a function so that the current defaults take effect.
# TODO: revisit whether this is necessa... | mpl-2.0 |
windskyer/nova | nova/scheduler/client/__init__.py | 42 | 2715 | # Copyright (c) 2014 Red Hat, 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 require... | gpl-2.0 |
cginternals/cppfs | source/tests/googletest/googletest/test/googletest-output-test.py | 71 | 12617 | #!/usr/bin/env python
#
# Copyright 2008, 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... | mit |
arocchi/Klampt | Python/klampt/vectorfield.py | 3 | 2694 | class VectorFieldFunction:
"""A callback class used with the rootfind module to define a vector
field f(x)=0 to be solved for during Newton-Raphson root finding.
The output is dimension m and the input is dimension n.
At the minimum, your subclass should fill out the m, n attributes, and
override t... | bsd-3-clause |
acogdev/ansible | contrib/inventory/landscape.py | 405 | 3467 | #!/usr/bin/env python
# (c) 2015, Marc Abramowitz <marca@surveymonkey.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
# (... | gpl-3.0 |
tiangolo/ansible | test/units/parsing/test_unquote.py | 152 | 2073 | # coding: utf-8
# (c) 2015, Toshio Kuratomi <tkuratomi@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 License, or
# (at your o... | gpl-3.0 |
trueblue2704/AskMeAnything | lib/python2.7/site-packages/tests/test_call_feedback.py | 14 | 3476 | import unittest
from nose.tools import assert_equal
from mock import Mock, patch, ANY
from tests.tools import create_mock_json
from twilio.rest.resources import Call, Calls
AUTH = ('foo', 'bar')
class CallFeedbackTest(unittest.TestCase):
@patch('twilio.rest.resources.base.make_twilio_request')
def test_get... | mit |
tencrance/cool-config | ml_keras_learn/tutorials/theanoTUT/theano14_summary.py | 3 | 1148 | # View more python tutorials on my Youtube and Youku channel!!!
# Youtube video tutorial: https://www.youtube.com/channel/UCdyjiB5H8Pu7aDTNVXTTpcg
# Youku video tutorial: http://i.youku.com/pythontutorial
# 14 - summary
"""
==============================
Summary:
-----------------------------------------------
1. Un... | mit |
SohKai/ChronoLogger | web/flask/lib/python2.7/site-packages/pip-1.5.4-py2.7.egg/pip/_vendor/requests/packages/charade/sbcsgroupprober.py | 2936 | 3291 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2001
# the Initial Developer. All R... | mit |
fuzzing/bifuz | kivy-android/common.py | 6 | 16802 | import kivy
import random
from kivy.app import App
from kivy.core.window import Window
import glob
from jnius import cast
from jnius import autoclass
import os
from commands import *
from utils import *
from kivy.lang import Builder
from kivy.metrics import metrics
from kivy.uix.floatlayout import FloatLayout
from unic... | mit |
solidgoldbomb/letsencrypt | letsencrypt/tests/reverter_test.py | 3 | 18201 | """Test letsencrypt.reverter."""
import csv
import itertools
import logging
import os
import shutil
import tempfile
import unittest
import mock
from letsencrypt import errors
class ReverterCheckpointLocalTest(unittest.TestCase):
# pylint: disable=too-many-instance-attributes, too-many-public-methods
"""Test... | apache-2.0 |
381426068/MissionPlanner | Lib/whichdb.py | 60 | 3470 | # !/usr/bin/env python
"""Guess which db package to use to open a db file."""
import os
import struct
import sys
try:
import dbm
_dbmerror = dbm.error
except ImportError:
dbm = None
# just some sort of valid exception which might be raised in the
# dbm test
_dbmerror = IOError
... | gpl-3.0 |
frankrousseau/weboob | weboob/applications/qhandjoob/qhandjoob.py | 7 | 1540 | # -*- coding: utf-8 -*-
# Copyright(C) 2013 Sébastien Monel
#
# 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 op... | agpl-3.0 |
saydulk/newfies-dialer | newfies/agent/function_def.py | 4 | 1886 | #
# Newfies-Dialer License
# http://www.newfies-dialer.org
#
# 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/.
#
# Copyright (C) 2011-2015 Star2Billing S.L.
#
# The primar... | mpl-2.0 |
erigones/esdc-ce | api/mon/backends/abstract/server.py | 1 | 1705 | from django.utils.text import Truncator
from django.utils.translation import ugettext_lazy as _
# noinspection PyProtectedMember
from vms.models.base import _DummyModel, _UserTasksModel
from vms.models import Dc
class AbstractMonitoringServer(_DummyModel, _UserTasksModel):
"""
Abstract model for representing... | apache-2.0 |
umlfri/umlfri2 | umlfri2/qtgui/canvas/scrolledcanvaswidget.py | 1 | 1410 | from PyQt5.QtCore import QPoint
from PyQt5.QtCore import Qt
from PyQt5.QtGui import QWheelEvent
from PyQt5.QtWidgets import QScrollArea
from .canvaswidget import CanvasWidget
class ScrolledCanvasWidget(QScrollArea):
def __init__(self, main_window, drawing_area):
super().__init__()
self._... | gpl-3.0 |
carbureted/shavar-prod-lists | scripts/json_verify.py | 1 | 6963 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import argparse
import glob
import json
import re
from types import DictType, ListType, UnicodeType
from urlparse import urlparse
parser = argparse.ArgumentParser(description='Verify json files for shavar.')
parser.add_argument("-f", "--file", help="filename to verify")
... | gpl-3.0 |
deployed/django | django/contrib/staticfiles/management/commands/findstatic.py | 64 | 1767 | from __future__ import unicode_literals
import os
from optparse import make_option
from django.core.management.base import LabelCommand
from django.utils.encoding import force_text
from django.contrib.staticfiles import finders
class Command(LabelCommand):
help = "Finds the absolute paths for the given static f... | bsd-3-clause |
Jollytown/Garuda | server/garuda/lib/python2.7/site-packages/django/http/cookie.py | 95 | 3621 | from __future__ import unicode_literals
from django.utils.encoding import force_str
from django.utils import six
from django.utils.six.moves import http_cookies
# Some versions of Python 2.7 and later won't need this encoding bug fix:
_cookie_encodes_correctly = http_cookies.SimpleCookie().value_encode(';') == (';',... | mit |
andnovar/kivy | kivy/cache.py | 40 | 7975 | '''
Cache manager
=============
The cache manager can be used to store python objects attached to a unique
key. The cache can be controlled in two ways: with a object limit or a
timeout.
For example, we can create a new cache with a limit of 10 objects and a
timeout of 5 seconds::
# register a new Cache
Cach... | mit |
lovexiaov/SandwichApp | venv/lib/python2.7/site-packages/py2app/build_app.py | 9 | 77527 | """
Mac OS X .app build command for distutils
Originally (loosely) based on code from py2exe's build_exe.py by Thomas Heller.
"""
from __future__ import print_function
import imp
import sys
import os
import zipfile
import plistlib
import shlex
import shutil
import textwrap
import pkg_resources
import collections
from... | apache-2.0 |
boundlessgeo/PDAL | vendor/gtest-1.7.0/test/gtest_xml_test_utils.py | 1815 | 8876 | #!/usr/bin/env python
#
# Copyright 2006, 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... | bsd-3-clause |
kamalx/edx-platform | lms/djangoapps/discussion_api/tests/test_api.py | 1 | 90651 | """
Tests for Discussion API internal interface
"""
from datetime import datetime, timedelta
import itertools
from urlparse import parse_qs, urlparse, urlunparse
from urllib import urlencode
import ddt
import httpretty
import mock
from pytz import UTC
from django.core.exceptions import ValidationError
from django.htt... | agpl-3.0 |
OneBitSoftware/jwtSample | src/Spa/env1/Lib/site-packages/pip/_vendor/lockfile/mkdirlockfile.py | 478 | 3098 | 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, ... | mit |
jobevers/emacs.d | emacs-for-python/python-libs/rope/refactor/similarfinder.py | 59 | 12370 | """This module can be used for finding similar code"""
import re
import rope.refactor.wildcards
from rope.base import codeanalyze, evaluate, exceptions, ast, builtins
from rope.refactor import (patchedast, sourceutils, occurrences,
wildcards, importutils)
class BadNameInCheckError(exceptio... | gpl-3.0 |
yfauser/ansible-modules-extras | cloud/centurylink/clc_modify_server.py | 49 | 35279 | #!/usr/bin/python
#
# Copyright (c) 2015 CenturyLink
#
# 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 la... | gpl-3.0 |
xen0l/ansible | lib/ansible/plugins/action/net_user.py | 648 | 1057 | # (c) 2017, Ansible 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 di... | gpl-3.0 |
40223232/final-test-6-22 | static/Brython3.1.1-20150328-091302/Lib/token.py | 743 | 3034 | """Token constants (from "token.h")."""
__all__ = ['tok_name', 'ISTERMINAL', 'ISNONTERMINAL', 'ISEOF']
# This file is automatically generated; please don't muck it up!
#
# To update the symbols in this file, 'cd' to the top directory of
# the python source tree after building the interpreter and run:
#
# ./pyth... | gpl-3.0 |
att-comdev/deckhand | deckhand/common/validation_message.py | 1 | 2620 | # Copyright 2018 AT&T Intellectual Property. All other 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... | apache-2.0 |
Hellrungj/CSC-412-Networking | rpc-project/venv/lib/python2.7/site-packages/setuptools/depends.py | 462 | 6370 | import sys
import imp
import marshal
from imp import PKG_DIRECTORY, PY_COMPILED, PY_SOURCE, PY_FROZEN
from distutils.version import StrictVersion
from setuptools import compat
__all__ = [
'Require', 'find_module', 'get_module_constant', 'extract_constant'
]
class Require:
"""A prerequisite to building or inst... | gpl-3.0 |
jjhelmus/scipy | scipy/signal/filter_design.py | 14 | 135076 | """Filter design.
"""
from __future__ import division, print_function, absolute_import
import warnings
import math
import numpy
import numpy as np
from numpy import (atleast_1d, poly, polyval, roots, real, asarray,
resize, pi, absolute, logspace, r_, sqrt, tan, log10,
arctan, arc... | bsd-3-clause |
gwct/grampa | lib/spec_tree.py | 1 | 5143 | import sys, os, reconcore as RC, recontree as RT, global_vars as globs
#############################################################################
def readSpecTree(spec_tree_input, starttime):
if os.path.isfile(spec_tree_input):
spec_tree = open(spec_tree_input, "r").read().replace("\n", "").replace("\r","");
e... | gpl-3.0 |
beeftornado/sentry | src/sentry/roles/manager.py | 1 | 2011 | from __future__ import absolute_import
import six
from collections import OrderedDict
class Role(object):
def __init__(self, priority, id, name, desc="", scopes=(), is_global=False):
assert len(id) <= 32, "Role id must be no more than 32 characters"
self.priority = priority
self.id = id... | bsd-3-clause |
chemelnucfin/tensorflow | tensorflow/contrib/timeseries/python/timeseries/math_utils.py | 12 | 44149 | # 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 |
mixturemodel-flow/tensorflow | tensorflow/contrib/learn/python/learn/ops/losses_ops.py | 81 | 3207 | # 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 |
akrherz/iem | htdocs/DCP/ahpsxml2wxc.py | 1 | 2188 | """Convert the AHPS XML into WXC format"""
import datetime
from paste.request import parse_formvars
from twisted.words.xish import domish, xpath
import requests
def do(nwsli):
"""work"""
res = ""
xml = requests.get(
(
"https://water.weather.gov/ahps2/"
"hydrograph_to_xml.p... | mit |
koyuawsmbrtn/eclock | windows/Python27/Lib/site-packages/pygame/tests/cursors_test.py | 18 | 3025 | #################################### IMPORTS ###################################
if __name__ == '__main__':
import sys
import os
pkg_dir = os.path.split(os.path.abspath(__file__))[0]
parent_dir, pkg_name = os.path.split(pkg_dir)
is_pygame_pkg = (pkg_name == 'tests' and
os.path.... | gpl-2.0 |
soaplib/soaplib | setup.py | 1 | 2916 | #!/usr/bin/env python
from unittest import TestLoader
from pkg_resources import resource_exists
from pkg_resources import resource_listdir
from setuptools import setup, find_packages
VERSION = '2.0.0'
LONG_DESC = """\
This is a simple, easily extendible soap library that provides several useful
tools for creating and... | lgpl-2.1 |
wangsai/oppia | core/domain/fs_domain.py | 30 | 10570 | # 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 |
tictail/claw | claw/utils.py | 1 | 2061 | # -*- coding: utf-8 -*-
import logging
from random import shuffle
from claw.constants import RE_DELIMITER
log = logging.getLogger(__name__)
def safe_format(format_string, *args, **kwargs):
"""
Helper: formats string with any combination of bytestrings/unicode
strings without raising exceptions
"""... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.