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 |
|---|---|---|---|---|---|
foss-transportationmodeling/rettina-server | flask/lib/python2.7/site-packages/flask/__init__.py | 425 | 1674 | # -*- coding: utf-8 -*-
"""
flask
~~~~~
A microframework based on Werkzeug. It's extensively documented
and follows best practice patterns.
:copyright: (c) 2011 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
__version__ = '0.10.1'
# utilities we import from Werkzeug and... | apache-2.0 |
Jeff-Wang93/vent | vent/menus/tutorials.py | 1 | 2688 | import npyscreen
class TutorialForm(npyscreen.ActionFormWithMenus):
""" Tutorial form for the Vent CLI """
def __init__(self, title='', text='', next_tutorial='', *args, **keywords):
""" Initialize tutorial form fields """
self.title = title
self.text = text
self.next_tutorial... | apache-2.0 |
ARL-UTEP-OC/emubox | workshop-creator/python27-64bit-gtk3/Lib/site-packages/gi/overrides/Dee.py | 1 | 6733 | from gi.overrides import override
from gi.importer import modules
Dee = modules['Dee']._introspection_module
from gi.repository import GLib
__all__ = []
class RowWrapper:
def __init__ (self, model, itr):
self.model = model
self.itr = itr
self.__initialized = True
def __getitem__ ... | gpl-2.0 |
sergiomb2/gdesklets | Controls/Sensor/__init__.py | 2 | 2382 | from factory.SensorFactory import SensorFactory
from main.Control import Control
from ISensor import ISensor
import gtk
#
# This control wraps legacy sensors to make them still usable.
# Sensors are deprecated and shouldn't be used in new stuff. This control is
# solely meant for retaining backwards compatibility.
#... | gpl-2.0 |
Dark-Hacker/horizon | openstack_dashboard/dashboards/project/overview/views.py | 45 | 2065 | # 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 |
annarev/tensorflow | tensorflow/python/data/experimental/kernel_tests/optimization/map_parallelization_test.py | 9 | 6324 | # Copyright 2018 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 |
elijah513/django | tests/get_object_or_404/tests.py | 296 | 3681 | from __future__ import unicode_literals
from django.http import Http404
from django.shortcuts import get_list_or_404, get_object_or_404
from django.test import TestCase
from .models import Article, Author
class GetObjectOr404Tests(TestCase):
def test_get_object_or_404(self):
a1 = Author.objects.create(n... | bsd-3-clause |
Zhongqilong/mykbengineer | kbe/src/lib/python/Lib/xml/etree/ElementInclude.py | 128 | 5151 | #
# ElementTree
# $Id: ElementInclude.py 3375 2008-02-13 08:05:08Z fredrik $
#
# limited xinclude support for element trees
#
# history:
# 2003-08-15 fl created
# 2003-11-14 fl fixed default loader
#
# Copyright (c) 2003-2004 by Fredrik Lundh. All rights reserved.
#
# fredrik@pythonware.com
# http://www.pythonware... | lgpl-3.0 |
dchilds7/Deysha-Star-Formation | vispy/gloo/gl/_es2.py | 21 | 38240 | """
THIS CODE IS AUTO-GENERATED. DO NOT EDIT.
GL ES 2.0 API (via Angle/DirectX on Windows)
"""
import ctypes
from .es2 import _lib
_lib.glActiveTexture.argtypes = ctypes.c_uint,
# void = glActiveTexture(GLenum texture)
def glActiveTexture(texture):
_lib.glActiveTexture(texture)
_lib.glAttachShader.argtypes ... | bsd-3-clause |
mlperf/training_results_v0.6 | NVIDIA/benchmarks/resnet/implementations/mxnet/common/dali.py | 1 | 17478 | import warnings
from nvidia import dali
from nvidia.dali.pipeline import Pipeline
import nvidia.dali.ops as ops
import nvidia.dali.types as types
from nvidia.dali.plugin.mxnet import DALIClassificationIterator
import horovod.mxnet as hvd
from mlperf_compliance import constants as mlperf_constants
from mlperf_log_utils ... | apache-2.0 |
ergoregion/Rota-Program | Tests/test_Roles.py | 1 | 5042 | __author__ = 'Neil Butcher'
import unittest
from Rota_System import Roles
class RoleTest(unittest.TestCase):
def setUp(self):
Roles.GlobalRoleList.clear()
Roles.GlobalRoleList.add_role(Roles.Role('Baker', 'B', 10))
Roles.GlobalRoleList.add_role(Roles.Role('Steward', 'S', 9))
Roles... | mit |
javierblasco/tensorflow | tensorflow/python/training/gradient_descent.py | 5 | 1615 | """GradientDescent for TensorFlow."""
from tensorflow.python.framework import ops
from tensorflow.python.ops import constant_op
# pylint: disable=unused-import
from tensorflow.python.ops import math_ops
# pylint: enable=unused-import
from tensorflow.python.training import optimizer
from tensorflow.python.training impor... | apache-2.0 |
pizzathief/scipy | scipy/optimize/_shgo_lib/triangulation.py | 8 | 21494 | import numpy as np
import copy
class Complex:
def __init__(self, dim, func, func_args=(), symmetry=False, bounds=None,
g_cons=None, g_args=()):
self.dim = dim
self.bounds = bounds
self.symmetry = symmetry # TODO: Define the functions to be used
# here in init... | bsd-3-clause |
ar7z1/ansible | test/units/modules/network/f5/test_bigip_device_trust.py | 8 | 5969 | # -*- coding: utf-8 -*-
#
# Copyright (c) 2017 F5 Networks Inc.
# GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
import json
import sys
from nose.plugins.skip import SkipTest
i... | gpl-3.0 |
ferabra/edx-platform | lms/djangoapps/commerce/api/v0/views.py | 39 | 7242 | """ API v0 views. """
import logging
from ecommerce_api_client import exceptions
from opaque_keys import InvalidKeyError
from opaque_keys.edx.keys import CourseKey
from rest_framework.authentication import SessionAuthentication
from rest_framework.permissions import IsAuthenticated
from rest_framework.status import HT... | agpl-3.0 |
Jgarcia-IAS/localizacion | openerp/addons-extra/base_state_ubication/__init__.py | 11 | 1488 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (c) 2012 Cubic ERP - Teradata SAC. (http://cubicerp.com).
#
# WARNING: This program as such is intended to be used by professional
# programmers who take t... | agpl-3.0 |
athompso/ansible | v1/tests/TestVaultEditor.py | 118 | 5729 | #!/usr/bin/env python
from unittest import TestCase
import getpass
import os
import shutil
import time
import tempfile
from binascii import unhexlify
from binascii import hexlify
from nose.plugins.skip import SkipTest
from ansible import errors
from ansible.utils.vault import VaultLib
from ansible.utils.vault import ... | gpl-3.0 |
nichung/wwwflaskBlogrevA | env/lib/python2.7/site-packages/pip/vendor/html5lib/serializer/htmlserializer.py | 79 | 12467 | from __future__ import absolute_import, division, unicode_literals
from pip.vendor.six import text_type
import gettext
_ = gettext.gettext
try:
from functools import reduce
except ImportError:
pass
from ..constants import voidElements, booleanAttributes, spaceCharacters
from ..constants import rcdataElements... | mit |
WebSpider/SickRage | lib/ndg/httpsclient/test/test_utils.py | 57 | 2092 | """unit tests module for ndg.httpsclient.utils module
PyOpenSSL utility to make a httplib-like interface suitable for use with
urllib2
"""
__author__ = "P J Kershaw (STFC)"
__date__ = "06/01/12"
__copyright__ = "(C) 2012 Science and Technology Facilities Council"
__license__ = "BSD - see LICENSE file in top-level dir... | gpl-3.0 |
slav/reactJsNetExamples | MvcReact/MvcReact/node_modules/npm-check-updates/node_modules/npm/node_modules/node-gyp/gyp/gyptest.py | 525 | 7988 | #!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
__doc__ = """
gyptest.py -- test runner for GYP tests.
"""
import os
import optparse
import subprocess
import sys
class CommandRunner:
"... | mit |
JingJunYin/tensorflow | tensorflow/python/tools/optimize_for_inference_lib.py | 49 | 18326 | # pylint: disable=g-bad-file-header
# Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENS... | apache-2.0 |
mancoast/CPythonPyc_test | crash/276_test_urllib2.py | 45 | 54239 | import unittest
from test import test_support
import os
import socket
import StringIO
import urllib2
from urllib2 import Request, OpenerDirector
# XXX
# Request
# CacheFTPHandler (hard to write)
# parse_keqv_list, parse_http_list, HTTPDigestAuthHandler
class TrivialTests(unittest.TestCase):
def test_trivial(sel... | gpl-3.0 |
rdbwebster/ansible-modules-extras | windows/win_chocolatey.py | 78 | 3019 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2014, Trond Hindenes <trond@hindenes.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 L... | gpl-3.0 |
avoinsystems/odoo | addons/hw_posbox_upgrade/__openerp__.py | 313 | 1696 | # -*- 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 |
JJediny/python-social-auth | social/backends/odnoklassniki.py | 61 | 7050 | """
Odnoklassniki OAuth2 and Iframe Application backends, docs at:
http://psa.matiasaguirre.net/docs/backends/odnoklassnikiru.html
"""
from hashlib import md5
from social.p3 import unquote
from social.backends.base import BaseAuth
from social.backends.oauth import BaseOAuth2
from social.exceptions import AuthFaile... | bsd-3-clause |
menardorama/ReadyNAS-Add-ons | headphones-1.0.0/debian/headphones/apps/headphones/lib/unidecode/x072.py | 252 | 4659 | data = (
'He ', # 0x00
'Lan ', # 0x01
'Biao ', # 0x02
'Rong ', # 0x03
'Li ', # 0x04
'Mo ', # 0x05
'Bao ', # 0x06
'Ruo ', # 0x07
'Lu ', # 0x08
'La ', # 0x09
'Ao ', # 0x0a
'Xun ', # 0x0b
'Kuang ', # 0x0c
'Shuo ', # 0x0d
'[?] ', # 0x0e
'Li ', # 0x0f
'Lu ', # 0x10
'Jue ', ... | gpl-2.0 |
koobonil/Boss2D | Boss2D/addon/tensorflow-1.2.1_for_boss/tensorflow/contrib/losses/python/losses/loss_ops_test.py | 82 | 55012 | # 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... | mit |
DavidLP/home-assistant | homeassistant/components/mopar/__init__.py | 7 | 4374 | """Support for Mopar vehicles."""
import logging
from datetime import timedelta
import voluptuous as vol
from homeassistant.components.lock import DOMAIN as LOCK
from homeassistant.components.sensor import DOMAIN as SENSOR
from homeassistant.components.switch import DOMAIN as SWITCH
from homeassistant.const import (
... | apache-2.0 |
clone1612/appstore | nextcloudappstore/core/tests/test_deletion_log.py | 2 | 1184 | from django.contrib.auth import get_user_model
from django.test import TestCase
from nextcloudappstore.core.models import App, AppRelease, AppReleaseDeleteLog
class DeletionLogTest(TestCase):
def test_delete_app(self):
user = get_user_model().objects.create(username='john')
app = App.objects.creat... | agpl-3.0 |
akhilari7/pa-dude | lib/python2.7/site-packages/django/contrib/gis/gdal/field.py | 355 | 6739 | from ctypes import byref, c_int
from datetime import date, datetime, time
from django.contrib.gis.gdal.base import GDALBase
from django.contrib.gis.gdal.error import GDALException
from django.contrib.gis.gdal.prototypes import ds as capi
from django.utils.encoding import force_text
# For more information, see the OG... | mit |
GUBotDev/ardupilot | Tools/autotest/pysim/util.py | 56 | 12518 | import math
from math import sqrt, acos, cos, pi, sin, atan2
import os, sys, time, random
from rotmat import Vector3, Matrix3
from subprocess import call, check_call,Popen, PIPE
def m2ft(x):
'''meters to feet'''
return float(x) / 0.3048
def ft2m(x):
'''feet to meters'''
return float(x) * 0.3048
def k... | gpl-3.0 |
Changaco/oh-mainline | vendor/packages/scrapy/scrapy/item.py | 22 | 1968 | """
Scrapy Item
See documentation in docs/topics/item.rst
"""
from pprint import pformat
from UserDict import DictMixin
from scrapy.utils.trackref import object_ref
class BaseItem(object_ref):
"""Base class for all scraped items."""
pass
class Field(dict):
"""Container of field metadata"""
class Ite... | agpl-3.0 |
dawran6/zulip | analytics/lib/counts.py | 5 | 16695 | from django.conf import settings
from django.db import connection, models
from django.db.models import F
from django.utils import timezone
from analytics.models import InstallationCount, RealmCount, \
UserCount, StreamCount, BaseCount, FillState, Anomaly, installation_epoch
from zerver.models import Realm, UserPro... | apache-2.0 |
exelearning/iteexe | twisted/persisted/marmalade.py | 13 | 16145 | # -*- test-case-name: twisted.test.test_persisted -*-
# Copyright (c) 2001-2004 Twisted Matrix Laboratories.
# See LICENSE for details.
"""Marmalade: jelly, with just a hint of bitterness.
I can serialize a Python object to an XML DOM tree (twisted.web.microdom), and
therefore to XML data, similarly to twisted.spre... | gpl-2.0 |
imiolek-ireneusz/pysiogame | i18n/custom/word_lists/pl_di.py | 1 | 12830 | # -*- coding: utf-8 -*-
# this is a list of words used by the word builder and word maze games and possibly
# other games built in the future
# these words are mainly most commonly used words in English + some other words
# in each sub-list in the list di first number is a number of words in the sublist
# to aviod cou... | gpl-3.0 |
santoshsahoo/namebench | nb_third_party/dns/rdtypes/ANY/LOC.py | 248 | 12571 | # Copyright (C) 2003-2007, 2009, 2010 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 ... | apache-2.0 |
boompieman/iim_project | project_python2/lib/python2.7/site-packages/pygments/lexers/dalvik.py | 47 | 4420 | # -*- coding: utf-8 -*-
"""
pygments.lexers.dalvik
~~~~~~~~~~~~~~~~~~~~~~
Pygments lexers for Dalvik VM-related languages.
:copyright: Copyright 2006-2015 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import RegexLexer, include, bygr... | gpl-3.0 |
umlfri/umlfri2 | umlfri2/application/commands/solution/applymetamodelconfigpatch.py | 1 | 1069 | from umlfri2.application.events.solution import MetamodelConfigChangedEvent
from ..base import Command, CommandNotDone
class ApplyMetamodelConfigPatchCommand(Command):
def __init__(self, solution, project, patch):
self.__project = project
self.__solution = solution
self.__patch = patch
... | gpl-3.0 |
e-gob/plataforma-kioscos-autoatencion | scripts/ansible-play/.venv/lib/python2.7/site-packages/ansible/modules/cloud/ovirt/ovirt_storage_templates_facts.py | 69 | 4244 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2017 Red Hat, Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
#... | bsd-3-clause |
utamaro/youtube-dl | youtube_dl/extractor/muzu.py | 147 | 2224 | from __future__ import unicode_literals
from .common import InfoExtractor
from ..compat import (
compat_urllib_parse,
)
class MuzuTVIE(InfoExtractor):
_VALID_URL = r'https?://www\.muzu\.tv/(.+?)/(.+?)/(?P<id>\d+)'
IE_NAME = 'muzu.tv'
_TEST = {
'url': 'http://www.muzu.tv/defected/marcashken-f... | unlicense |
minhphung171093/GreenERP_V8 | openerp/addons/im_chat/im_chat.py | 268 | 21928 | # -*- coding: utf-8 -*-
import base64
import datetime
import logging
import time
import uuid
import random
import simplejson
import openerp
from openerp.http import request
from openerp.osv import osv, fields
from openerp.tools.misc import DEFAULT_SERVER_DATETIME_FORMAT
from openerp.addons.bus.bus import TIMEOUT
_lo... | agpl-3.0 |
foodszhang/kbengine | kbe/res/scripts/common/Lib/site-packages/pip/_vendor/requests/packages/chardet/euckrprober.py | 2931 | 1675 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org 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 Reserved.
#
# Con... | lgpl-3.0 |
jffernandez/kivy | examples/frameworks/twisted/echo_client_app.py | 38 | 2147 | #install_twisted_rector must be called before importing the reactor
from kivy.support import install_twisted_reactor
install_twisted_reactor()
#A simple Client that send messages to the echo server
from twisted.internet import reactor, protocol
class EchoClient(protocol.Protocol):
def connectionMade(self):
... | mit |
amueller/scipy-2017-sklearn | notebooks/solutions/23_batchtrain.py | 4 | 1947 | import os
import numpy as np
from sklearn.linear_model import SGDClassifier
from sklearn.feature_extraction.text import HashingVectorizer
from sklearn.base import clone
from sklearn.datasets import load_files
def batch_train(clf, fnames, labels, iterations=1,
batchsize=1000, random_seed=1):
vec = ... | cc0-1.0 |
whiplash01/Hyperloop | src/hyperloop/battery_plot.py | 8 | 8289 | import numpy as np
import pylab as p
#design variables
# hl.Mach_bypass = .95
# hl.Mach_pod_max = .90
# hl.Mach_c1_in = .65
# hl.c1_PR_des = 13
# #initial guesses
# hl.compress.W_in = .35
# hl.flow_limit.radius_tube = hl.pod.radius_tube_inner = 178
# hl.compress.Ts_tube = hl.flow_limit.Ts_tube... | apache-2.0 |
vamsirajendra/nupic | nupic/regions/ImageSensorFilters/CenterSurroundConvolution.py | 17 | 7903 | # ----------------------------------------------------------------------
# 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 |
dmilith/SublimeText3-dmilith | Packages/pygments/all/pygments/lexers/resource.py | 46 | 2913 | # -*- coding: utf-8 -*-
"""
pygments.lexers.resource
~~~~~~~~~~~~~~~~~~~~~~~~
Lexer for resource definition files.
:copyright: Copyright 2006-2015 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import RegexLexer, bygroups, words
from ... | mit |
windskyer/nova | nova/console/xvp.py | 28 | 7148 | # Copyright (c) 2010 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 ... | gpl-2.0 |
ermin-sakic/common-open-research-emulator-CORE | coreemu-read-only/daemon/core/emane/rfpipe.py | 11 | 4945 | #
# CORE
# Copyright (c)2010-2014 the Boeing Company.
# See the LICENSE file included in this distribution.
#
# authors: Jeff Ahrenholz <jeffrey.m.ahrenholz@boeing.com>
# Harry Bullen <hbullen@i-a-i.com>
#
'''
rfpipe.py: EMANE RF-PIPE model for CORE
'''
import sys
import string
try:
from emanesh.events im... | bsd-3-clause |
madAndroid/jenkins-job-builder | jenkins_jobs/local_yaml.py | 11 | 11002 | #!/usr/bin/env python
# Copyright (C) 2013 Hewlett-Packard.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... | apache-2.0 |
kalugny/pypachy | src/python_pachyderm/proto/v2/identity/identity_pb2.py | 1 | 50757 | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: python_pachyderm/proto/v2/identity/identity.proto
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflectio... | mit |
aam-at/tensorflow | tensorflow/python/kernel_tests/linalg/sparse/csr_sparse_matrix_ops_test.py | 2 | 68344 | # 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 applica... | apache-2.0 |
zhaohuaw/stock-logistics-warehouse | __unported__/stock_inventory_extended/__init__.py | 49 | 1072 | # -*- coding: utf-8 -*-
#################################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2011 Julius Network Solutions SARL <contact@julius.fr>
#
# This program is free software: you can redistribute it and/or modify
# it under th... | agpl-3.0 |
j3parker/servo | tests/wpt/web-platform-tests/tools/pywebsocket/src/test/testdata/handlers/sub/exception_in_transfer_wsh.py | 499 | 1816 | # Copyright 2009, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... | mpl-2.0 |
jansohn/pyload | module/plugins/crypter/EmbeduploadCom.py | 2 | 2285 | # -*- coding: utf-8 -*-
import re
from module.plugins.internal.Crypter import Crypter
from module.network.HTTPRequest import BadHeader
class EmbeduploadCom(Crypter):
__name__ = "EmbeduploadCom"
__type__ = "crypter"
__version__ = "0.04"
__status__ = "testing"
__pattern__ = r'http://(?:www\... | gpl-3.0 |
djtaylor/cloudscape-DEPRECATED | python/cloudscape/common/iptc/xtables.py | 2 | 42886 | # -*- coding: utf-8 -*-
import ctypes as ct
import os
import sys
import weakref
import version
from util import find_library
XT_INV_PROTO = 0x40 # invert the sense of PROTO
NFPROTO_UNSPEC = 0
NFPROTO_IPV4 = 2
NFPROTO_ARP = 3
NFPROTO_BRIDGE = 7
NFPROTO_IPV6 = 10
NFPROTO_DECNET = 12
NFPROTO_NUMPROTO = 6
XTF_DONT_LO... | gpl-3.0 |
Clyde-fare/cclib | src/cclib/method/cspa.py | 1 | 3974 | # This file is part of cclib (http://cclib.github.io), a library for parsing
# and interpreting the results of computational chemistry packages.
#
# Copyright (C) 2006-2014, the cclib development team
#
# The library is free software, distributed under the terms of
# the GNU Lesser General Public version 2.1 or l... | lgpl-2.1 |
corso-python-prato/share-system-team2 | server/test_server.py | 1 | 62918 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
server test module
Every TestCase class should use the <TEST_DIR> directory. To do it, just call 'setup_test_dir()' in the setUp method and
'tear_down_test_dir()' in the tearDown one.
"""
import unittest
import os
import base64
import shutil
import urlparse
import json... | apache-2.0 |
bobwalker99/Pydev | plugins/org.python.pydev.jython/Lib/email/base64MIME.py | 135 | 5794 | # Copyright (C) 2002-2006 Python Software Foundation
# Author: Ben Gertzfield
# Contact: email-sig@python.org
"""Base64 content transfer encoding per RFCs 2045-2047.
This module handles the content transfer encoding method defined in RFC 2045
to encode arbitrary 8-bit data using the three 8-bit bytes in four 7-bit
ch... | epl-1.0 |
aurelijusb/arangodb | 3rdParty/V8-4.3.61/build/gyp/pylib/gyp/generator/ninja.py | 56 | 88430 | # 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 copy
import hashlib
import json
import multiprocessing
import os.path
import re
import signal
import subprocess
import sys
import gyp
import gyp.common
impo... | apache-2.0 |
Kazade/NeHe-Website | google_appengine/lib/django-1.2/tests/regressiontests/admin_ordering/tests.py | 42 | 1308 | from django.test import TestCase
from django.contrib.admin.options import ModelAdmin
from models import Band
class TestAdminOrdering(TestCase):
"""
Let's make sure that ModelAdmin.queryset uses the ordering we define in
ModelAdmin rather that ordering defined in the model's inner Meta
class.
"""
... | bsd-3-clause |
ivandevp/django | django/conf/locale/mk/formats.py | 504 | 1742 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'd F Y'
TIME_FORMAT = 'H:i'
DATETI... | bsd-3-clause |
MoKee/android_kernel_bn_omap | tools/perf/scripts/python/sctop.py | 11180 | 1924 | # system call top
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Periodically displays system-wide system call totals, broken down by
# syscall. If a [comm] arg is specified, only syscalls called by
# [comm] are displayed. If an [interval] arg is specified,... | gpl-2.0 |
mollstam/UnrealPy | UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/numpy-1.9.2/numpy/lib/tests/test_utils.py | 149 | 1466 | from __future__ import division, absolute_import, print_function
import sys
from numpy.core import arange
from numpy.testing import (
run_module_suite, assert_, assert_equal, dec
)
from numpy.lib import deprecate
import numpy.lib.utils as utils
if sys.version_info[0] >= 3:
from io import StringIO
else:
... | mit |
mewtaylor/django | django/contrib/messages/storage/cookie.py | 471 | 6545 | import json
from django.conf import settings
from django.contrib.messages.storage.base import BaseStorage, Message
from django.http import SimpleCookie
from django.utils import six
from django.utils.crypto import constant_time_compare, salted_hmac
from django.utils.safestring import SafeData, mark_safe
class Message... | bsd-3-clause |
40223139/39g7test | static/Brython3.1.3-20150514-095342/Lib/select.py | 730 | 9440 | """
borrowed from jython
https://bitbucket.org/jython/jython/raw/28a66ba038620292520470a0bb4dc9bb8ac2e403/Lib/select.py
"""
#import java.nio.channels.SelectableChannel
#import java.nio.channels.SelectionKey
#import java.nio.channels.Selector
#from java.nio.channels.SelectionKey import OP_ACCEPT, OP_CONNECT, OP_WRITE, ... | gpl-3.0 |
BrotherPhil/django | tests/template_tests/syntax_tests/test_now.py | 443 | 2037 | from datetime import datetime
from django.test import SimpleTestCase
from django.utils.formats import date_format
from ..utils import setup
class NowTagTests(SimpleTestCase):
@setup({'now01': '{% now "j n Y" %}'})
def test_now01(self):
"""
Simple case
"""
output = self.engin... | bsd-3-clause |
SmartArduino/Arduino-1 | arduino-core/src/processing/app/i18n/python/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... | lgpl-2.1 |
ajenhl/eats | server/eats/tests/views/test_entity_merge.py | 1 | 6154 | # -*- coding: utf-8 -*-
from django.conf import settings
from django.core.urlresolvers import reverse
from eats.models import Entity
from eats.tests.views.view_test_case import ViewTestCase
class EntityMergeViewTestCase (ViewTestCase):
def setUp (self):
super(EntityMergeViewTestCase, self).setUp()
... | gpl-3.0 |
ryanjmccall/nupic | external/linux32/lib/python2.6/site-packages/matplotlib/backends/backend_qt.py | 69 | 16846 | from __future__ import division
import math
import os
import sys
import matplotlib
from matplotlib import verbose
from matplotlib.cbook import is_string_like, onetrue
from matplotlib.backend_bases import RendererBase, GraphicsContextBase, \
FigureManagerBase, FigureCanvasBase, NavigationToolbar2, cursors
from mat... | gpl-3.0 |
Kapeli/PopClip-Extensions | source/OneNote/requests/packages/urllib3/fields.py | 1007 | 5833 | import email.utils
import mimetypes
from .packages import six
def guess_content_type(filename, default='application/octet-stream'):
"""
Guess the "Content-Type" of a file.
:param filename:
The filename to guess the "Content-Type" of using :mod:`mimetypes`.
:param default:
If no "Cont... | mit |
sephii/django | django/contrib/auth/handlers/modwsgi.py | 115 | 1344 | from django.contrib import auth
from django import db
from django.utils.encoding import force_bytes
def check_password(environ, username, password):
"""
Authenticates against Django's auth database
mod_wsgi docs specify None, True, False as return value depending
on whether the user exists and authen... | bsd-3-clause |
tushar-dadlani/tsung | docs/conf.py | 12 | 7726 | # -*- coding: utf-8 -*-
#
# Tsung documentation build configuration file, created by
# sphinx-quickstart on Thu Sep 19 12:07:49 2013.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All c... | gpl-2.0 |
josiah-wolf-oberholtzer/supriya | tests/patterns/test_SequencePattern.py | 1 | 1977 | import pytest
from supriya.patterns import SequencePattern
from supriya.patterns.testutils import run_pattern_test
@pytest.mark.parametrize(
"stop_at, sequence, iterations, expected, is_infinite",
[
(None, [1, 2, 3], None, [1, 2, 3], True),
(None, [1, 2, 3], 1, [1, 2, 3], False),
(Non... | mit |
israeltobias/DownMedia | youtube-dl/test/test_youtube_signature.py | 28 | 4025 | #!/usr/bin/env python
from __future__ import unicode_literals
# Allow direct execution
import os
import sys
import unittest
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
import io
import re
import string
from test.helper import FakeYDL
from youtube_dl.extractor import YoutubeIE
fro... | gpl-3.0 |
akbargumbira/inasafe | safe/report/impact_report.py | 3 | 24392 | # coding=utf-8
"""Module to generate impact report.
Enable dynamic report generation based on report metadata.
Easily customize map report or document based report.
"""
import imp
import logging
import os
import shutil
from qgis.core import (
QgsComposition,
QgsRectangle,
QgsRasterLayer)
from safe.comm... | gpl-3.0 |
harshaneelhg/scikit-learn | sklearn/manifold/spectral_embedding_.py | 128 | 19845 | """Spectral Embedding"""
# Author: Gael Varoquaux <gael.varoquaux@normalesup.org>
# Wei LI <kuantkid@gmail.com>
# License: BSD 3 clause
import warnings
import numpy as np
from scipy import sparse
from scipy.linalg import eigh
from scipy.sparse.linalg import lobpcg
from ..base import BaseEstimator
from ..ext... | bsd-3-clause |
ltilve/chromium | third_party/mojo/src/mojo/public/tools/bindings/pylib/mojom_tests/generate/data_unittest.py | 10 | 5222 | # Copyright 2014 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.
import imp
import os.path
import sys
import unittest
def _GetDirAbove(dirname):
"""Returns the directory "above" this file containing |dirname| (which mus... | bsd-3-clause |
apocquet/django | tests/m2o_recursive/tests.py | 419 | 1724 | from __future__ import unicode_literals
from django.test import TestCase
from .models import Category, Person
class ManyToOneRecursiveTests(TestCase):
def setUp(self):
self.r = Category(id=None, name='Root category', parent=None)
self.r.save()
self.c = Category(id=None, name='Child cate... | bsd-3-clause |
baryonix/collectd | contrib/network-proxy.py | 105 | 1677 | #!/usr/bin/env python
# vim: sts=4 sw=4 et
# Simple unicast proxy to send collectd traffic to another host/port.
# Copyright (C) 2007 Pavel Shramov <shramov at mexmat.net>
#
# 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 th... | gpl-2.0 |
wimnat/ansible | test/lib/ansible_test/_data/collection_detail.py | 40 | 3000 | """Retrieve collection detail."""
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import json
import os
import re
import sys
import yaml
# See semantic versioning specification (https://semver.org/)
NUMERIC_IDENTIFIER = r'(?:0|[1-9][0-9]*)'
ALPHANUMERIC_IDENTIFIER = r'(?:[0-9... | gpl-3.0 |
alphafoobar/intellij-community | python/lib/Lib/site-packages/django/contrib/localflavor/it/util.py | 436 | 1807 | from django.utils.encoding import smart_str, smart_unicode
def ssn_check_digit(value):
"Calculate Italian social security number check digit."
ssn_even_chars = {
'0': 0, '1': 1, '2': 2, '3': 3, '4': 4, '5': 5, '6': 6, '7': 7, '8': 8,
'9': 9, 'A': 0, 'B': 1, 'C': 2, 'D': 3, 'E': 4, 'F': 5, 'G': ... | apache-2.0 |
SpectreJan/gnuradio | gr-digital/python/digital/test_soft_decisions.py | 2 | 4908 | #!/usr/bin/env python
#
# Copyright 2013 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 your option)
... | gpl-3.0 |
dmsimard/ansible | lib/ansible/plugins/lookup/pipe.py | 18 | 2941 | # (c) 2012, Daniel Hokka Zakrisson <daniel@hozac.com>
# (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = r"""
name: pipe
author: Daniel Ho... | gpl-3.0 |
appsembler/edx-platform | cms/celery.py | 1 | 2978 | """
Import celery, load its settings from the django settings
and auto discover tasks in all installed django apps.
Taken from: http://celery.readthedocs.org/en/latest/django/first-steps-with-django.html
"""
from __future__ import absolute_import
import beeline
import logging
import os
from celery import Celery
from... | agpl-3.0 |
daydayuplo/gee | earth_enterprise/src/scons/khEnvironment.py | 3 | 18276 | #
# Copyright 2017 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 writin... | apache-2.0 |
redapple/parslepy | tests/test_parslepy_parse.py | 1 | 10453 | from __future__ import unicode_literals
import parslepy
import parslepy.base
import lxml.cssselect
from nose.tools import *
from .tools import *
import pprint
import os
def test_parslepy_xpathparse_xml_file():
parselet_script = {"id": "//atom:id"}
xsh = parslepy.selectors.XPathSelectorHandler(
... | mit |
c-PRIMED/puq | test/CustomParameter_test.py | 1 | 7647 | #! /usr/bin/env python
'''
Testsuite for the CustomParameter class
'''
from __future__ import absolute_import, division, print_function
import numpy as np
from puq import *
def _hisplot(y, nbins):
n, bins = np.histogram(y, nbins, normed=True)
mids = bins[:-1] + np.diff(bins) / 2.0
return mids, n
def compa... | mit |
Lkhagvadelger/phantomjs | src/breakpad/src/tools/gyp/test/lib/TestGyp.py | 137 | 23211 | #!/usr/bin/python
# Copyright (c) 2009 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
TestGyp.py: a testing framework for GYP integration tests.
"""
import os
import re
import shutil
import stat
import sys
import TestCommon... | bsd-3-clause |
aurofable/medhack-server | venv/lib/python2.7/encodings/cp500.py | 593 | 13377 | """ Python Character Mapping Codec cp500 generated from 'MAPPINGS/VENDORS/MICSFT/EBCDIC/CP500.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,input... | mit |
grilo/ansible-1 | lib/ansible/parsing/utils/addresses.py | 241 | 8167 | # Copyright 2015 Abhijit Menon-Sen <ams@2ndQuadrant.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 ... | gpl-3.0 |
lucychambers/lucychambers.github.io | .bundle/ruby/2.0.0/gems/pygments.rb-0.6.2/vendor/pygments-main/ez_setup.py | 164 | 12155 | #!python
"""Bootstrap setuptools installation
If you want to use setuptools in your package's setup.py, just include this
file in the same directory with it, and add this to the top of your setup.py::
from ez_setup import use_setuptools
use_setuptools()
If you want to require a specific version of setuptools... | gpl-2.0 |
bogus-py/graphite-api | docs/conf.py | 8 | 2188 | #!/usr/bin/env python3
# coding: utf-8
import os
import re
import sys
import sphinx_rtd_theme
from sphinx.ext import autodoc
sys.path.insert(0, os.path.join(os.path.dirname(__file__), os.pardir))
extensions = [
'sphinx.ext.autodoc',
]
templates_path = ['_templates']
source_suffix = '.rst'
master_doc = 'inde... | apache-2.0 |
friedrich420/Note-4-TMO-AEL-Kernel-Lollipop-Source | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Util.py | 12527 | 1935 | # Util.py - Python extension for perf script, miscellaneous utility code
#
# 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.
import errno, os
FUTEX_WAIT = 0... | gpl-2.0 |
tobinjt/Flexget | flexget/components/series/metainfo_series.py | 4 | 2356 | from __future__ import unicode_literals, division, absolute_import
import logging
from builtins import * # noqa pylint: disable=unused-import, redefined-builtin
from flexget.event import event
from . import series as plugin_series
from flexget import plugin
try:
# NOTE: Importing other plugins is discouraged!... | mit |
TeXitoi/navitia | source/jormungandr/jormungandr/protobuf_to_dict.py | 12 | 3072 | # Copyright (c) 2001-2014, Canal TP and/or its affiliates. All rights reserved.
#
# This file is part of Navitia,
# the software to build cool stuff with public transport.
#
# Hope you'll enjoy and contribute to this project,
# powered by Canal TP (www.canaltp.fr).
# Help us simplify mobility and open public tr... | agpl-3.0 |
nitzmahone/ansible | lib/ansible/plugins/lookup/url.py | 36 | 3469 | # (c) 2015, Brian Coca <bcoca@ansible.com>
# (c) 2012-17 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = """
lookup: url
author: Brian Coca (@bcoca)
versi... | gpl-3.0 |
saurabh6790/med_test_lib | webnotes/utils/__init__.py | 22 | 23735 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
# util __init__.py
from __future__ import unicode_literals
from webnotes import conf
import webnotes
no_value_fields = ['Section Break', 'Column Break', 'HTML', 'Table', 'FlexTable',
'Button', 'Image', 'Graph']... | mit |
CompPhysics/ComputationalPhysics | doc/Programs/LecturePrograms/programs/PDE/python/2dwave/pythonmovie.py | 6 | 2018 | #!/usr/bin/env python
# This script reads in data from file with the solutions of the
# 2dim wave function. The data are organized as
# time
# l, i, j, u(i,j) where k is the time index t_l, i refers to x_i and j to y_j
# At the end it converts a series of png files to a movie
# file movie.gif. You can run this movi... | cc0-1.0 |
temasek/android_external_chromium_org | third_party/tlslite/tlslite/VerifierDB.py | 359 | 3104 | """Class for storing SRP password verifiers."""
from utils.cryptomath import *
from utils.compat import *
import mathtls
from BaseDB import BaseDB
class VerifierDB(BaseDB):
"""This class represent an in-memory or on-disk database of SRP
password verifiers.
A VerifierDB can be passed to a server handshake... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.