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 |
|---|---|---|---|---|---|
ahmadiga/min_edx | openedx/core/djangoapps/content/course_overviews/management/commands/tests/test_generate_course_overview.py | 29 | 3228 | # pylint: disable=missing-docstring
from django.core.management.base import CommandError
from mock import patch
from openedx.core.djangoapps.content.course_overviews.management.commands import generate_course_overview
from openedx.core.djangoapps.content.course_overviews.models import CourseOverview
from xmodule.module... | agpl-3.0 |
webmakin/scrapy | tests/test_crawler.py | 127 | 5138 | import warnings
import unittest
import scrapy
from scrapy.crawler import Crawler, CrawlerRunner, CrawlerProcess
from scrapy.settings import Settings, default_settings
from scrapy.spiderloader import SpiderLoader
from scrapy.utils.spider import DefaultSpider
from scrapy.utils.misc import load_object
from scrapy.extensi... | bsd-3-clause |
babycaseny/audacity | lib-src/lv2/lv2/plugins/eg-metro.lv2/waflib/Tools/gxx.py | 196 | 2806 | #! /usr/bin/env python
# encoding: utf-8
# WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file
from waflib.Tools import ccroot,ar
from waflib.Configure import conf
@conf
def find_gxx(conf):
cxx=conf.find_program(['g++','c++'],var='CXX')
cxx=conf.cmd_to_list(cxx)
conf... | gpl-2.0 |
lixiangning888/whole_project | modules/signatures_merge_tmp/antivm_vbox_files.py | 3 | 2048 | # -*- coding: utf-8 -*-
# Copyright (C) 2012 Claudio "nex" Guarnieri (@botherder)
#
# 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 lat... | lgpl-3.0 |
solintegra/addons | delivery/delivery.py | 64 | 13497 | # -*- 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 |
xccui/flink | flink-python/pyflink/serializers.py | 4 | 6208 | ################################################################################
# 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... | apache-2.0 |
ctbrennan/cross-platform-message-analytics | imessage_export.py | 1 | 11626 | ##Author: https://github.com/alexwchan
#!/usr/bin/python
# -*- encoding: utf8 -*-
"""imessage_export.py - this script takes the chat.db or sms.db SQL database
used to store messages on OS X or iOS and spits out a set of JSON files, one
for each thread.
The script is fairly rudimentary, and doesn't do anything to catch... | mit |
EasonYi/thrift | lib/py/src/transport/THttpClient.py | 53 | 4251 | #
# 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 |
bob123bob/Sick-Beard | lib/requests/packages/chardet/chardistribution.py | 215 | 8602 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights ... | gpl-3.0 |
jayceyxc/hue | desktop/core/ext-py/cffi-1.5.2/demo/manual2.py | 12 | 1175 | import _cffi_backend
ffi = _cffi_backend.FFI(b"manual2",
_version = 0x2601,
_types = b'\x00\x00\x01\x0D\x00\x00\x07\x01\x00\x00\x00\x0F\x00\x00\x00\x09\x00\x00\x00\x0B\x00\x00\x01\x03',
_globals = (b'\xff\xff\xff\x0bAA',0,b'\xff\xff\xff\x0bBB',-1,b'\xff\xff\xff\x0bCC',2,b'\xff\xff\xff\x1fFOO',0x99999999999... | apache-2.0 |
LuckyLukert/Turnierserver | Frontend/commons.py | 1 | 1422 | from database import db
from flask import abort, make_response, Response
from flask.ext.login import current_user
from flask.ext.cache import Cache
from functools import wraps
class CommonErrors:
BAD_REQUEST = ({'error': 'Bad request.'}, 400)
INVALID_ID = ({'error': 'Invalid id.'}, 404)
NO_ACCESS = ({'error': 'Ins... | lgpl-3.0 |
ojii/sandlib | lib/lib-python/2.7/encodings/cp865.py | 593 | 34874 | """ Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP865.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_map)
def decode(self,input,errors='strict'):
... | bsd-3-clause |
GiladE/birde | venv/lib/python2.7/site-packages/static.py | 5 | 16038 | #!/usr/bin/env python
"""
Copyright (C) 2012 Roman Mohr <roman@fenkhuber.at>
"""
"""static - A stupidly simple WSGI way to serve static (or mixed) content.
(See the docstrings of the various functions and classes.)
Copyright (C) 2006-2009 Luke Arno - http://lukearno.com/
This library is free software; you can redis... | mit |
roadmapper/ansible | lib/ansible/module_utils/network/iosxr/providers/providers.py | 114 | 3943 | #
# (c) 2019, Ansible by Red Hat, inc
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#
import json
from threading import RLock
from ansible.module_utils.six import itervalues
from ansible.module_utils.network.common.utils import to_list
from ansible.module_utils.network.c... | gpl-3.0 |
andreamerello/linux-stm32 | Documentation/sphinx/kernel_include.py | 44 | 8424 | #!/usr/bin/env python3
# -*- coding: utf-8; mode: python -*-
# pylint: disable=R0903, C0330, R0914, R0912, E0401
u"""
kernel-include
~~~~~~~~~~~~~~
Implementation of the ``kernel-include`` reST-directive.
:copyright: Copyright (C) 2016 Markus Heiser
:license: GPL Version 2, June 1991 see lin... | gpl-2.0 |
JVenberg/PokemonGo-Bot-Desktop | pywin/Lib/encodings/zlib_codec.py | 58 | 3048 | """ Python 'zlib_codec' Codec - zlib compression encoding
Unlike most of the other codecs which target Unicode, this codec
will return Python string objects for both encode and decode.
Written by Marc-Andre Lemburg (mal@lemburg.com).
"""
import codecs
import zlib # this codec needs the optional zlib modu... | mit |
joseAveleira/ardupilot | Tools/LogAnalyzer/tests/TestMotorBalance.py | 215 | 2265 | from LogAnalyzer import Test,TestResult
import DataflashLog
class TestBalanceTwist(Test):
'''test for badly unbalanced copter, including yaw twist'''
def __init__(self):
Test.__init__(self)
self.name = "Motor Balance"
def run(self, logdata, verbose):
self.result = TestResult()
... | gpl-3.0 |
ikaee/bfr-attendant | facerecognitionlibrary/jni-build/jni/include/tensorflow/tools/dist_test/server/parse_cluster_spec_test.py | 147 | 3420 | # 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 |
SnappleCap/oh-mainline | vendor/packages/python-social-auth/social/tests/test_storage.py | 80 | 6433 | import six
import random
import unittest2 as unittest
from social.strategies.base import BaseStrategy
from social.storage.base import UserMixin, NonceMixin, AssociationMixin, \
CodeMixin, BaseStorage
from social.tests.models import User
NOT_IMPLEMENTED_MSG = 'Implement in subclass'
... | agpl-3.0 |
tarzan0820/odoo | addons/account_bank_statement_extensions/report/bank_statement_balance_report.py | 378 | 2723 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
#
# Copyright (c) 2011 Noviat nv/sa (www.noviat.be). All rights reserved.
#
# This program is free software: you can redistribute it and/or modify
# it under ... | agpl-3.0 |
jmr2704/betakore-alien | src/scons-local-2.0.1/SCons/Variables/PackageVariable.py | 61 | 3612 | """engine.SCons.Variables.PackageVariable
This file defines the option type for SCons implementing 'package
activation'.
To be used whenever a 'package' may be enabled/disabled and the
package path may be specified.
Usage example:
Examples:
x11=no (disables X11 support)
x11=yes (will search for the... | gpl-2.0 |
unnikrishnankgs/va | venv/lib/python3.5/site-packages/IPython/utils/PyColorize.py | 3 | 10460 | # -*- coding: utf-8 -*-
"""
Class and program to colorize python source code for ANSI terminals.
Based on an HTML code highlighter by Jurgen Hermann found at:
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/52298
Modifications by Fernando Perez (fperez@colorado.edu).
Information on the original HTML highligh... | bsd-2-clause |
ryanahall/django | django/core/management/commands/test.py | 267 | 3933 | import logging
import os
import sys
from django.conf import settings
from django.core.management.base import BaseCommand
from django.test.utils import get_runner
class Command(BaseCommand):
help = 'Discover and run tests in the specified modules or the current directory.'
requires_system_checks = False
... | bsd-3-clause |
pamoakoy/invenio | modules/websubmit/lib/functions/Mail_Approval_Withdrawn_to_Referee.py | 35 | 17043 | ## This file is part of Invenio.
## Copyright (C) 2008, 2009, 2010, 2011 CERN.
##
## Invenio is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## published by the Free Software Foundation; either version 2 of the
## License, or (at your option) any later ... | gpl-2.0 |
srvg/ansible | test/lib/ansible_test/_internal/docker_util.py | 6 | 13345 | """Functions for accessing docker via the docker cli."""
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import json
import os
import time
from . import types as t
from .io import (
open_binary_file,
read_text_file,
)
from .util import (
ApplicationError,
comm... | gpl-3.0 |
ckuethe/gnuradio | gr-uhd/examples/python/usrp_nbfm_rcv.py | 58 | 14409 | #!/usr/bin/env python
#
# Copyright 2005,2007,2011,2012 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio 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, or (at ... | gpl-3.0 |
kaarthikeyapreyan/Trust-for-Youth-and-Child-Leadership | mentor/views.py | 2 | 4375 | from django.shortcuts import render
from django.http import HttpResponseRedirect
from webapp_nkana.utils.common import mongo_instance
def register_mentor_profile(request):
if request.method == 'POST':
db = mongo_instance()
keys = db.tycl.find_one({'id': 'mentor_profile_reference'})['val']
... | apache-2.0 |
lthurlow/Boolean-Constrained-Routing | networkx-1.8.1/build/lib.linux-i686-2.7/networkx/algorithms/isomorphism/isomorphvf2.py | 76 | 36794 | # -*- coding: utf-8 -*-
"""
*************
VF2 Algorithm
*************
An implementation of VF2 algorithm for graph ismorphism testing.
The simplest interface to use this module is to call networkx.is_isomorphic().
Introduction
------------
The GraphMatcher and DiGraphMatcher are responsible for matching
graphs or d... | mit |
akshmakov/Dolfin-Fijee-Fork | site-packages/dolfin/mesh/meshes.py | 1 | 2144 | "This module provides a simple Python wrapper for the SWIG-generated Mesh class"
# Copyright (C) 2012-2014 Anders Logg
#
# This file is part of DOLFIN.
#
# DOLFIN 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 Fo... | gpl-3.0 |
lunafeng/django | tests/basic/tests.py | 117 | 29910 | from __future__ import unicode_literals
import threading
import warnings
from datetime import datetime, timedelta
from django.core.exceptions import MultipleObjectsReturned, ObjectDoesNotExist
from django.db import DEFAULT_DB_ALIAS, DatabaseError, connections
from django.db.models.fields import Field
from django.db.m... | bsd-3-clause |
nishant2295/swiftp | cloud_server/httpd_doc_root/py/gcheckout.py | 23 | 6830 | from mod_python import apache
from log import log
import xml.dom.minidom
import re
import myutil
import string
import json
import socket
def do_db_work(req, py_obj):
"""Open a connection to the Erlang server that handles our database, write the given
object in JSON format, and return the server's response. Th... | gpl-3.0 |
Mirantis/mos-horizon | horizon/utils/lazy_encoder.py | 20 | 1037 | # Copyright 2016 Red Hat, 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 agre... | apache-2.0 |
datalogics-robb/scons | src/engine/SCons/Tool/sgic++.py | 2 | 1846 | """SCons.Tool.sgic++
Tool-specific initialization for MIPSpro C++ on SGI.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# __COPYRIGHT__
#
# Permission is hereby granted, free of charge, to any person obt... | mit |
kivy-garden/garden.matplotlib | backend_kivy.py | 1 | 50958 | '''
Backend Kivy
=====
.. image:: images/backend_kivy_example.jpg
:align: right
The :class:`FigureCanvasKivy` widget is used to create a matplotlib graph.
This widget has the same properties as
:class:`kivy.ext.mpl.backend_kivyagg.FigureCanvasKivyAgg`. FigureCanvasKivy
instead of rendering a static image, uses th... | mit |
t-hey/QGIS-Original | python/plugins/processing/gui/FileSelectionPanel.py | 8 | 3239 | # -*- coding: utf-8 -*-
"""
***************************************************************************
FileSelectionPanel.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
********************... | gpl-2.0 |
odoomrp/odoomrp-wip | product_variant_default_code/models/product.py | 12 | 7401 | # -*- encoding: utf-8 -*-
##############################################################################
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the... | agpl-3.0 |
TouK/vumi | vumi/application/bridge.py | 1 | 4451 | # -*- test-case-name: vumi.application.tests.test_bridge -*-
from base64 import b64encode
from twisted.python import log
from twisted.web import http
from twisted.internet.defer import inlineCallbacks
from vumi.application.base import ApplicationWorker
from vumi.utils import http_request_full
from vumi.errors import... | bsd-3-clause |
marc-sensenich/ansible | lib/ansible/plugins/shell/__init__.py | 9 | 8652 | # (c) 2016 RedHat
#
# 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 distribu... | gpl-3.0 |
ehashman/oh-mainline | vendor/packages/whoosh/src/whoosh/support/relativedelta.py | 116 | 17347 | """
Copyright (c) 2003-2010 Gustavo Niemeyer <gustavo@niemeyer.net>
This module offers extensions to the standard python 2.3+
datetime module.
"""
__author__ = "Gustavo Niemeyer <gustavo@niemeyer.net>"
__license__ = "PSF License"
import datetime
import calendar
__all__ = ["relativedelta", "MO", "TU", "WE", "TH", "F... | agpl-3.0 |
luistorresm/odoo | openerp/exceptions.py | 312 | 3157 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2011 OpenERP s.a. (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the G... | agpl-3.0 |
ikool/metact06-djan | lib/apitools/base/py/list_pager_test.py | 23 | 6861 | """Tests for list_pager."""
import unittest2
from apitools.base.py import list_pager
from apitools.base.py.testing import mock
from apitools.base.py.testing import testclient as fusiontables
class ListPagerTest(unittest2.TestCase):
def _AssertInstanceSequence(self, results, n):
counter = 0
for ... | bsd-3-clause |
OCForks/phantomjs | src/breakpad/src/third_party/protobuf/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 |
ibmsoe/ImpalaPPC | testdata/bin/random_avro_schema.py | 2 | 5828 | #!/usr/bin/env impala-python
# Copyright (c) 2015 Cloudera, 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... | apache-2.0 |
jaysonsantos/servo | tests/wpt/web-platform-tests/tools/pytest/_pytest/_code/_py2traceback.py | 192 | 2887 | # copied from python-2.7.3's traceback.py
# CHANGES:
# - some_str is replaced, trying to create unicode strings
#
import types
def format_exception_only(etype, value):
"""Format the exception part of a traceback.
The arguments are the exception type and value such as given by
sys.last_type and sys.last_va... | mpl-2.0 |
godfather1103/WeiboRobot | python27/1.0/lib/test/test_multibytecodec_support.py | 18 | 14605 | # test_multibytecodec_support.py
# Common Unittest Routines for CJK codecs
#
import codecs
import os
import re
import sys
import unittest
from httplib import HTTPException
from test import test_support
from StringIO import StringIO
class TestBase:
encoding = '' # codec name
codec = None #... | gpl-3.0 |
stwolny/GrovePi | Software/Python/grove_electromagnet.py | 7 | 2291 | #!/usr/bin/env python
#
# GrovePi Example for using the Grove Electromagnet (http://www.seeedstudio.com/wiki/Grove_-_Electromagnet)
#
# The GrovePi connects the Raspberry Pi and Grove sensors. You can learn more about GrovePi here: http://www.dexterindustries.com/GrovePi
#
# Have a question about this example? ... | mit |
hiroakis/ansible | lib/ansible/plugins/lookup/etcd.py | 151 | 2323 | # (c) 2013, Jan-Piet Mens <jpmens(at)gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later ver... | gpl-3.0 |
Kaniabi/ben10 | source/python/clikit/_tests/test_clikit_command.py | 2 | 6146 | from __future__ import unicode_literals
from ben10.foundation.string import Dedent
from clikit.command import Command, InvalidFixture
from clikit.console import BufferedConsole
import pytest
#===================================================================================================
# TESTS
#================... | lgpl-2.1 |
JenSte/pyqtgraph | pyqtgraph/parametertree/ParameterTree.py | 47 | 5662 | from ..Qt import QtCore, QtGui
from ..widgets.TreeWidget import TreeWidget
import os, weakref, re
from .ParameterItem import ParameterItem
#import functions as fn
class ParameterTree(TreeWidget):
"""Widget used to display or control data from a hierarchy of Parameters"""
def __init__... | mit |
louyihua/edx-platform | lms/djangoapps/instructor/tests/test_services.py | 4 | 5481 | """
Tests for the InstructorService
"""
import json
from xmodule.modulestore.tests.django_utils import SharedModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory
from courseware.models import StudentModule
from instructor.access import allow_access
from instructor.services import Instructo... | agpl-3.0 |
Ayub-Khan/edx-platform | cms/djangoapps/contentstore/push_notification.py | 154 | 2772 | """
Helper methods for push notifications from Studio.
"""
from uuid import uuid4
from django.conf import settings
from logging import exception as log_exception
from contentstore.tasks import push_course_update_task
from contentstore.models import PushNotificationConfig
from xmodule.modulestore.django import modules... | agpl-3.0 |
elventear/ansible | lib/ansible/modules/network/f5/bigip_sys_db.py | 16 | 5998 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2016 F5 Networks Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# ... | gpl-3.0 |
jmacmahon/invenio | modules/webaccess/web/admin/webaccessadmin.py | 3 | 14191 | # This file is part of Invenio.
# Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 CERN.
#
# Invenio is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (at ... | gpl-2.0 |
nathanbjenx/cairis | cairis/core/EnvironmentParameters.py | 2 | 2186 | # 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... | apache-2.0 |
IKholopov/HackUPC2017 | hackupc/env/lib/python3.5/site-packages/social/tests/backends/test_dummy.py | 80 | 3932 | import json
import datetime
import time
from httpretty import HTTPretty
from social.actions import do_disconnect
from social.backends.oauth import BaseOAuth2
from social.exceptions import AuthForbidden
from social.tests.models import User
from social.tests.backends.oauth import OAuth2Test
class DummyOAuth2(BaseOAu... | apache-2.0 |
kmod/icbd | stdlib/python2.5/shelve.py | 91 | 7565 | """Manage shelves of pickled objects.
A "shelf" is a persistent, dictionary-like object. The difference
with dbm databases is that the values (not the keys!) in a shelf can
be essentially arbitrary Python objects -- anything that the "pickle"
module can handle. This includes most class instances, recursive data
type... | mit |
chokribr/invenio | invenio/modules/formatter/format_elements/bfe_video_platform_sources.py | 13 | 5200 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 CERN.
#
# Invenio is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of the
# License,... | gpl-2.0 |
BeiLuoShiMen/nupic | nupic/regions/PictureSensorExplorers/vertical.py | 17 | 1762 | # ----------------------------------------------------------------------
# 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... | agpl-3.0 |
40123103/2015cd_40123103 | wsgi.py | 1 | 34518 | #@+leo-ver=5-thin
#@+node:2014fall.20141212095015.1775: * @file wsgi.py
# coding=utf-8
# 上面的程式內容編碼必須在程式的第一或者第二行才會有作用
################# (1) 模組導入區
# 導入 cherrypy 模組, 為了在 OpenShift 平台上使用 cherrypy 模組, 必須透過 setup.py 安裝
#@@language python
#@@tabwidth -4
#@+<<declarations>>
#@+node:2014fall.20141212095015.1776: ** <<declar... | gpl-3.0 |
Mashape/dd-agent | checks.d/http_check.py | 6 | 17943 | # stdlib
from datetime import datetime
import os.path
import re
import socket
import ssl
import time
import warnings
from urlparse import urlparse
# 3rd party
import requests
import tornado
from requests.adapters import HTTPAdapter
from requests.packages import urllib3
from requests.packages.urllib3.util import ssl_
... | bsd-3-clause |
citrix-openstack-build/nova | nova/virt/hyperv/volumeops.py | 4 | 9453 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 Pedro Navarro Perez
# Copyright 2013 Cloudbase Solutions Srl
# 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... | apache-2.0 |
jasonwee/asus-rt-n14uhp-mrtg | tmp/ve_asus-rt-n14uhp-mrtg/lib/python3.4/site-packages/django/templatetags/l10n.py | 337 | 1735 | from django.template import Library, Node, TemplateSyntaxError
from django.utils import formats
from django.utils.encoding import force_text
register = Library()
@register.filter(is_safe=False)
def localize(value):
"""
Forces a value to be rendered as a localized value,
regardless of the value of ``setti... | apache-2.0 |
KohlsTechnology/ansible | lib/ansible/modules/windows/win_disk_image.py | 27 | 1776 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2017, Red Hat, Inc.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'core'}
DOCUMENTATI... | gpl-3.0 |
arskom/spyne | spyne/test/interop/server/httprpc_pod_basic_twisted.py | 2 | 2015 | #!/usr/bin/env python
#
# spyne - Copyright (C) Spyne contributors.
#
# 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; either
# version 2.1 of the License, or (at your option) any later ve... | lgpl-2.1 |
rsyvarth/Schemify | lib/wtforms/widgets/core.py | 51 | 8239 | from __future__ import unicode_literals
from cgi import escape
from wtforms.compat import text_type, string_types, iteritems
__all__ = (
'CheckboxInput', 'FileInput', 'HiddenInput', 'ListWidget', 'PasswordInput',
'RadioInput', 'Select', 'SubmitInput', 'TableWidget', 'TextArea',
'TextInput', 'Option'
)
... | mit |
kgsn1763/deep-learning-from-scratch | ch08/deep_convnet.py | 1 | 6086 | #!/usr/bin/env python
# coding: utf-8
import sys, os
sys.path.append(os.pardir) # 親ディレクトリのファイルをインポートするための設定
import pickle
import numpy as np
from common.layers import Convolution, Relu, Pooling, Affine, Dropout, SoftmaxWithLoss
class DeepConvNet:
"""認識率99%以上の高精度なConvNet
ネットワーク構成は下記の通り
conv - relu -... | mit |
SohKai/ChronoLogger | web/flask/lib/python2.7/site-packages/jinja2/parser.py | 637 | 35186 | # -*- 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.lexer impo... | mit |
PyCon/pycon | pycon/finaid/migrations/0010_auto_20160927_0947.py | 2 | 2074 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('finaid', '0009_auto_20150917_1629'),
]
operations = [
migrations.RemoveField(
model_name='financialaidapplicatio... | bsd-3-clause |
geodrinx/gearthview | ext-libs/twisted/internet/_posixstdio.py | 19 | 5015 | # -*- test-case-name: twisted.test.test_stdio -*-
"""Standard input/out/err support.
Future Plans::
support for stderr, perhaps
Rewrite to use the reactor instead of an ad-hoc mechanism for connecting
protocols to transport.
Maintainer: James Y Knight
"""
import warnings
from zope.interface import ... | gpl-3.0 |
adamsp/adnwc | web/wsgi.py | 31 | 2357 | """
WSGI Utilities
(from web.py)
"""
import os, sys
import http
import webapi as web
from utils import listget, intget
from net import validaddr, validip
import httpserver
def runfcgi(func, addr=('localhost', 8000)):
"""Runs a WSGI function as a FastCGI server."""
import flup.server.fcgi as flups
ret... | apache-2.0 |
kswiat/django | django/core/urlresolvers.py | 1 | 24713 | """
This module converts requested URLs to callback view functions.
RegexURLResolver is the main class here. Its resolve() method takes a URL (as
a string) and returns a tuple in this format:
(view_function, function_args, function_kwargs)
"""
from __future__ import unicode_literals
import functools
from importl... | bsd-3-clause |
newrocknj/horizon | openstack_dashboard/dashboards/admin/hypervisors/compute/tabs.py | 57 | 1309 | # 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... | apache-2.0 |
ttglennhall/DjangoGirlsTutorial | myvenv/lib/python3.4/site-packages/pip/_vendor/requests/packages/chardet/big5freq.py | 3133 | 82594 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights R... | mit |
iivic/BoiseStateX | lms/djangoapps/instructor/management/commands/openended_stats.py | 86 | 5361 | """
Command to get statistics about open ended problems.
"""
import csv
import time
from django.core.management.base import BaseCommand
from optparse import make_option
from xmodule.modulestore.django import modulestore
from opaque_keys.edx.locations import SlashSeparatedCourseKey
from xmodule.open_ended_grading_clas... | agpl-3.0 |
kidmaple/CoolWall | user/python/Lib/test/test_gzip.py | 10 | 1207 |
import sys, os
import gzip, tempfile
filename = tempfile.mktemp()
data1 = """ int length=DEFAULTALLOC, err = Z_OK;
PyObject *RetVal;
int flushmode = Z_FINISH;
unsigned long start_total_out;
"""
data2 = """/* zlibmodule.c -- gzip-compatible data compression */
/* See http://www.cdrom.com/pub/infozip/zlib/ */... | gpl-2.0 |
goldhand/terpene | rasputin/users/migrations/0001_initial.py | 25 | 2693 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django.utils.timezone
import django.core.validators
class Migration(migrations.Migration):
dependencies = [
('auth', '0001_initial'),
]
operations = [
migrations.CreateModel(
... | bsd-3-clause |
Conjuro/GitPython | refs/headref.py | 1 | 5050 | from reference import Reference
from git.config import SectionConstraint
from git.util import join_path
__all__ = ["Head"]
class Head(Reference):
"""The GitPyhton Head implementation provides more git-command based features
A Head is a named reference to a Commit. Every Head instance contains a name
and a Commit... | bsd-3-clause |
tensorflow/models | research/delf/delf/python/datasets/google_landmarks_dataset/compute_recognition_metrics.py | 1 | 3672 | # Copyright 2019 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 applicab... | apache-2.0 |
tximikel/kuma | kuma/search/views.py | 18 | 3210 | import json
from django.http import HttpResponse, HttpResponseBadRequest
from django.shortcuts import render
from django.views.decorators.cache import cache_page
from rest_framework.generics import ListAPIView
from rest_framework.renderers import JSONRenderer
from kuma.wiki.search import WikiDocumentType
from .exce... | mpl-2.0 |
googleapis/python-api-core | owlbot.py | 1 | 1224 | # Copyright 2020 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | apache-2.0 |
kohr-h/odl | odl/test/tomo/backends/skimage_test.py | 2 | 1554 | # Copyright 2014-2017 The ODL contributors
#
# This file is part of ODL.
#
# 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 https://mozilla.org/MPL/2.0/.
"""Test skimage back-end."""
from __future_... | mpl-2.0 |
insertnamehere1/maraschino | lib/sqlalchemy/dialects/maxdb/base.py | 22 | 42809 | # maxdb/base.py
# Copyright (C) 2005-2011 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
"""Support for the MaxDB database.
This dialect is *not* ported to SQLAlchemy 0.6 or 0.... | mit |
obulpathi/reversecoin | reversecoin/bitcoin/rpc.py | 1 | 9261 | # Copyright 2011 Jeff Garzik
#
# RawProxy has the following improvements over python-jsonrpc's ServiceProxy
# class:
#
# - HTTP connections persist for the life of the RawProxy object (if server
# supports HTTP/1.1)
# - sends protocol 'version', per JSON-RPC 1.1
# - sends proper, incrementing 'id'
# - sends Basic HTT... | gpl-2.0 |
youprofit/NewsBlur | vendor/mms-agent/agent.py | 19 | 12651 | """
(C) Copyright 2011, 10gen
This is a label on a mattress. Do not modify this file!
"""
# App
import settings as _settings
import logConfig
# Python
import sys, socket, time, os, hmac, urllib2, threading, subprocess, traceback
try:
import hashlib
except ImportError:
sys.exit( 'ERROR - you must have hashli... | mit |
alqfahad/odoo | addons/resource/faces/resource.py | 433 | 25890 | #@+leo-ver=4
#@+node:@file resource.py
#@@language python
#@<< Copyright >>
#@+node:<< Copyright >>
############################################################################
# Copyright (C) 2005, 2006, 2007, 2008 by Reithinger GmbH
# mreithinger@web.de
#
# This file is part of faces.
#
# faces is free softwa... | agpl-3.0 |
adhoc-dev/odoo-addons | portal_partner_fix/__openerp__.py | 4 | 1590 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2015 ADHOC SA (http://www.adhoc.com.ar)
# All Rights Reserved.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Pu... | agpl-3.0 |
marcosschroh/Flask-Simple-Serializer | flask_simple_serializer/serializers.py | 1 | 2916 | import six
from werkzeug.datastructures import MultiDict
from collections import OrderedDict
from wtforms.form import Form
from wtforms_alchemy import ModelForm
def serializer_factory(base=Form):
class BaseSerializer(base):
def __init__(self, data_dict=None, model_instance=None, **kwargs):
... | mit |
devs1991/test_edx_docmode | venv/lib/python2.7/site-packages/git/index/fun.py | 6 | 10630 | # Contains standalone functions to accompany the index implementation and make it
# more versatile
# NOTE: Autodoc hates it if this is a docstring
from stat import (
S_IFDIR,
S_IFLNK,
S_ISLNK,
S_IFDIR,
S_ISDIR,
S_IFMT,
S_IFREG,
)
S_IFGITLINK = S_IFLNK | S_IFDIR # a submodule
fr... | agpl-3.0 |
ldoktor/avocado-vt | virttest/staging/utils_memory.py | 6 | 12938 | from __future__ import division
import re
import math
import logging
import os
from avocado.core import exceptions
from avocado.utils import process
from virttest import kernel_interface
# Returns total memory in kb
def read_from_meminfo(key, session=None):
"""
wrapper to return value from /proc/meminfo usi... | gpl-2.0 |
Jandersolutions/jander777-ghost | node_modules/grunt-docker/node_modules/docker/node_modules/pygmentize-bundled/vendor/pygments/build-3.3/pygments/lexers/other.py | 94 | 170941 | # -*- coding: utf-8 -*-
"""
pygments.lexers.other
~~~~~~~~~~~~~~~~~~~~~
Lexers for other languages.
:copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import RegexLexer, include, bygroups, using, \
thi... | mit |
zhuwenping/python-for-android | python-modules/twisted/twisted/web/twcgi.py | 49 | 11768 | # -*- test-case-name: twisted.web.test.test_cgi -*-
# Copyright (c) 2001-2010 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
I hold resource classes and helper classes that deal with CGI scripts.
"""
# System Imports
import string
import os
import urllib
# Twisted Imports
from twisted.web import http
f... | apache-2.0 |
buckiracer/data-science-from-scratch | dataScienceFromScratch/DataScienceFromScratch/visualizing_data.py | 58 | 5116 | import matplotlib.pyplot as plt
from collections import Counter
def make_chart_simple_line_chart(plt):
years = [1950, 1960, 1970, 1980, 1990, 2000, 2010]
gdp = [300.2, 543.3, 1075.9, 2862.5, 5979.6, 10289.7, 14958.3]
# create a line chart, years on x-axis, gdp on y-axis
plt.plot(years, gdp, color='gr... | unlicense |
gurneyalex/OpenUpgrade | openerp/report/print_fnc.py | 458 | 1318 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the... | agpl-3.0 |
csrocha/OpenUpgrade | addons/l10n_ca/__init__.py | 438 | 1056 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2010 Savoir-faire Linux (<http://www.savoirfairelinux.com>).
#
# This program is free software: you can redistribute it and/or modify
# it... | agpl-3.0 |
openstack/networking-odl | networking_odl/tests/unit/common/test_client.py | 1 | 2166 | # Copyright (c) 2015 Intel 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 b... | apache-2.0 |
Collisio-Adolebitque/pfne-2017 | pynet/pyth_ans_ecourse/napalm/napalm_ex2.py | 2 | 1058 | #!/usr/bin/env python
"""Test NAPALM config merge operations on one of the Cisco routers."""
from napalm_base import get_network_driver
from my_devices import pynet_rtr1
def main():
"""Test NAPALM config merge operations on one of the Cisco routers."""
for a_device in (pynet_rtr1,):
device_type = a_dev... | gpl-3.0 |
USGSDenverPychron/pychron | pychron/core/filtering.py | 1 | 3462 | # ===============================================================================
# Copyright 2015 Jake Ross
#
# 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... | apache-2.0 |
ahamilton55/ansible | test/runner/lib/git.py | 40 | 2324 | """Wrapper around git command-line tools."""
from __future__ import absolute_import, print_function
from lib.util import (
CommonConfig,
SubprocessError,
run_command,
)
class Git(object):
"""Wrapper around git command-line tools."""
def __init__(self, args):
"""
:type args: Commo... | gpl-3.0 |
foursquare/pants | src/python/pants/backend/jvm/tasks/jar_publish.py | 1 | 43360 | # 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, print_function, unicode_literals
import functools
import getpass
import hashlib
import os
import pkgutil
import shutil
imp... | apache-2.0 |
adaussy/eclipse-monkey-revival | plugins/python/org.eclipse.eclipsemonkey.lang.python/Lib/test/test_pep277.py | 119 | 7875 | # Test the Unicode versions of normal file functions
# open, os.open, os.stat. os.listdir, os.rename, os.remove, os.mkdir, os.chdir, os.rmdir
import sys, os, unittest
from unicodedata import normalize
from test import test_support
filenames = [
'1_abc',
u'2_ascii',
u'3_Gr\xfc\xdf-Gott',
u'4_\u0393\u03b... | epl-1.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.