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 |
|---|---|---|---|---|---|
3L3N4/metagoofil | pdfminer/pdftypes.py | 26 | 7735 | #!/usr/bin/env python2
import sys
import zlib
from lzw import lzwdecode
from ascii85 import ascii85decode, asciihexdecode
from runlength import rldecode
from psparser import PSException, PSObject
from psparser import LIT, KWD, STRICT
LITERAL_CRYPT = LIT('Crypt')
# Abbreviation of Filter names in PDF 4.8.6. "Inline Im... | gpl-2.0 |
egonw/citeulike | plugins/python/cases.py | 2 | 3673 | #!/usr/bin/env python
import os, sys, re, urllib2, cookielib, string
from urllib import urlencode
from urllib2 import urlopen
from copy import copy
import BeautifulSoup
import htmlentitydefs
import socket
socket.setdefaulttimeout(15)
class ParseException(Exception):
pass
##
# Removes HTML or XML character refere... | bsd-3-clause |
nguyenfilip/subscription-manager | test/test_rct_cert_command.py | 3 | 2207 | #
# Copyright (c) 2012 Red Hat, Inc.
#
# This software is licensed to you under the GNU General Public License,
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
# implied, including the implied warranties of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. You should have received a copy of... | gpl-2.0 |
alexgorban/models | research/textsum/batch_reader.py | 14 | 10400 | # 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 |
jelugbo/hebs_master | common/lib/xmodule/xmodule/modulestore/django.py | 17 | 6349 | """
Module that provides a connection to the ModuleStore specified in the django settings.
Passes settings.MODULESTORE as kwargs to MongoModuleStore
"""
from __future__ import absolute_import
from importlib import import_module
from django.conf import settings
if not settings.configured:
settings.configure()
fro... | agpl-3.0 |
xuweiliang/Codelibrary | openstack_dashboard/dashboards/admin/users/tables.py | 1 | 7776 | # 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 t... | apache-2.0 |
ccellis/WHACK2016 | flask/lib/python2.7/site-packages/pip/commands/search.py | 344 | 4736 | import sys
import textwrap
import pip.download
from pip.basecommand import Command, SUCCESS
from pip.util import get_terminal_size
from pip.log import logger
from pip.backwardcompat import xmlrpclib, reduce, cmp
from pip.exceptions import CommandError
from pip.status_codes import NO_MATCHES_FOUND
from pip._vendor imp... | bsd-3-clause |
frabcus/mpcv | bin/parl.2017-06-08/01-all-candidates.py | 1 | 2347 | #!/usr/bin/env python3
import sys
import os
import collections
import datetime
import flask_mail
import boto.s3.key
sys.path.append(os.getcwd())
import app
import identity
import lookups
app.app.config['SERVER_NAME'] = 'cv.democracyclub.org.uk'
# Get list of when last sent
last_sent_by_email = lookups.candidate_ma... | agpl-3.0 |
pavels/pootle | pootle/core/utils/wordcount.py | 4 | 4873 | # -*- coding: utf-8 -*-
#
# Copyright (C) Pootle contributors.
#
# This file is a part of the Pootle project. It is distributed under the GPL3
# or later license. See the LICENSE file for a copy of the license and the
# AUTHORS file for copyright and authorship information.
import re
re._MAXCACHE = 1000
remove = r... | gpl-3.0 |
wkschwartz/django | tests/template_tests/syntax_tests/test_url.py | 34 | 11815 | from django.template import RequestContext, TemplateSyntaxError
from django.test import RequestFactory, SimpleTestCase, override_settings
from django.urls import NoReverseMatch, resolve
from ..utils import setup
@override_settings(ROOT_URLCONF='template_tests.urls')
class UrlTagTests(SimpleTestCase):
request_fac... | bsd-3-clause |
argriffing/numpy | numpy/core/tests/test_records.py | 5 | 13700 | from __future__ import division, absolute_import, print_function
import sys
import collections
import pickle
from os import path
import numpy as np
from numpy.compat import asbytes
from numpy.testing import (
TestCase, run_module_suite, assert_, assert_equal, assert_array_equal,
assert_array_almost_equal, ass... | bsd-3-clause |
drayanaindra/django-shop | shop/tests/api.py | 16 | 2260 | from shop.models.ordermodel import OrderExtraInfo, Order
from django.test.testcases import TestCase
from django.contrib.auth.models import User
from shop.tests.util import Mock
from shop.shop_api import ShopAPI
from decimal import Decimal
class ShopApiTestCase(TestCase):
def setUp(self):
self.user = User.... | bsd-3-clause |
rellla/xbmca10 | tools/EventClients/lib/python/ps3/sixpair.py | 208 | 2903 | #!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
import usb
vendor = 0x054c
product = 0x0268
timeout = 5000
passed_value = 0x03f5
def find_sixaxes():
res = []
for bus in usb.busses():
for dev in bus.devices:
if dev.idVendor == vendor and dev.idProduct == product:
res.append(dev)
return r... | gpl-2.0 |
stevenaubertin/showsServer | lib/werkzeug/datastructures.py | 146 | 86337 | # -*- coding: utf-8 -*-
"""
werkzeug.datastructures
~~~~~~~~~~~~~~~~~~~~~~~
This module provides mixins and classes with an immutable interface.
:copyright: (c) 2014 by the Werkzeug Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
import re
import sys
import cod... | apache-2.0 |
moses-palmer/slimit | src/slimit/visitors/ecmavisitor.py | 1 | 12856 | ###############################################################################
#
# Copyright (c) 2011 Ruslan Spivak
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, inc... | mit |
FedeMPouzols/Savu | savu/plugins/loaders/multi_modal_loaders/i18_loaders/i18xrd_loader.py | 1 | 5937 | # Copyright 2014 Diamond Light Source Ltd.
#
# 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 t... | gpl-3.0 |
zitouni/ieee_802-15-4_868-900 | examples/usrpN210/tools/crc16.py | 7 | 1996 | #!/usr/bin/env python
"""
Translation from a C code posted to a forum on the Internet.
@translator Thomas Schmid
"""
from array import array
def reflect(crc, bitnum):
# reflects the lower 'bitnum' bits of 'crc'
j=1
crcout=0
for b in range(bitnum):
i=1<<(bitnum-1-b)
i... | gpl-3.0 |
kelemetry/beacon | vendor/github.com/ugorji/go/codec/test.py | 107 | 4029 | #!/usr/bin/env python
# This will create golden files in a directory passed to it.
# A Test calls this internally to create the golden files
# So it can process them (so we don't have to checkin the files).
# Ensure msgpack-python and cbor are installed first, using:
# sudo apt-get install python-dev
# sudo apt-g... | apache-2.0 |
BrainDamage/Flexget | flexget/plugins/search_ptn.py | 4 | 4667 | from __future__ import unicode_literals, division, absolute_import
import logging
from requests.auth import AuthBase
from flexget import plugin
from flexget.entry import Entry
from flexget.event import event
from flexget.utils import requests
from flexget.utils.imdb import extract_id
from flexget.utils.soup import ge... | mit |
map222/spark | examples/src/main/python/ml/n_gram_example.py | 123 | 1545 | #
# 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 us... | apache-2.0 |
t0in4/django | tests/check_framework/test_multi_db.py | 191 | 1682 | from django.db import connections, models
from django.test import TestCase, mock
from django.test.utils import override_settings
from .tests import IsolateModelsMixin
class TestRouter(object):
"""
Routes to the 'other' database if the model name starts with 'Other'.
"""
def allow_migrate(self, db, ap... | bsd-3-clause |
Ervii/garage-time | garage/src/python/pants/backend/jvm/tasks/jvm_compile/anonymizer.py | 2 | 4846 | # coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (nested_scopes, generators, division, absolute_import, with_statement,
print_function, unicode_literals)
import base64
import... | apache-2.0 |
llooker/python_sdk | lookerapi/models/lookml_model_explore.py | 1 | 28033 | # coding: utf-8
"""
Looker API 3.0 Reference
### Authorization The Looker API uses Looker **API3** credentials for authorization and access control. Looker admins can create API3 credentials on Looker's **Admin/Users** page. Pass API3 credentials to the **/login** endpoint to obtain a temporary access_token.... | mit |
brendandburns/tensorflow | tensorflow/python/training/queue_runner_test.py | 5 | 6725 | """Tests for QueueRunner."""
import time
import tensorflow.python.platform
import tensorflow as tf
class QueueRunnerTest(tf.test.TestCase):
def testBasic(self):
with self.test_session() as sess:
# CountUpTo will raise OUT_OF_RANGE when it reaches the count.
zero64 = tf.constant(0, dtype=tf.int64)... | apache-2.0 |
sebastien-j/gensim | gensim/corpora/sharded_corpus.py | 63 | 35097 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Original author: Jan Hajic jr.
# Copyright (C) 2015 Radim Rehurek and gensim team.
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""
This module implements a corpus class that stores its data in separate files called
"shards". This is a com... | gpl-3.0 |
zmike/servo | tests/wpt/css-tests/tools/pywebsocket/src/mod_pywebsocket/msgutil.py | 658 | 7598 | # Copyright 2011, 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 |
JacquesLucke/still-lambda | pyglet/gl/lib_wgl.py | 41 | 5761 | # ----------------------------------------------------------------------------
# pyglet
# Copyright (c) 2006-2008 Alex Holkner
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistribu... | bsd-3-clause |
gioman/QGIS | python/plugins/processing/algs/qgis/ShortestPathPointToLayer.py | 1 | 11506 | # -*- coding: utf-8 -*-
"""
***************************************************************************
ShortestPathPointToLayer.py
---------------------
Date : December 2016
Copyright : (C) 2016 by Alexander Bruy
Email : alexander dot bruy at gmail dot com... | gpl-2.0 |
CamelBackNotation/hackdfw | Dependencies/build/lib.linux-x86_64-2.7/pymouse/mac.py | 10 | 5547 | #Copyright 2013 Paul Barton
#
#This program is free software: you can redistribute it and/or modify
#it under the terms of the GNU General Public License as published by
#the Free Software Foundation, either version 3 of the License, or
#(at your option) any later version.
#
#This program is distributed in the hope tha... | mit |
BerserkerTroll/root | bindings/pyroot/JupyROOT/utils.py | 6 | 14510 | # -*- coding:utf-8 -*-
#-----------------------------------------------------------------------------
# Author: Danilo Piparo <Danilo.Piparo@cern.ch> CERN
#-----------------------------------------------------------------------------
from __future__ import print_function
import os
import sys
import select
import te... | lgpl-2.1 |
IsCoolEntertainment/debpkg_python-boto | boto/ec2/elb/securitygroup.py | 57 | 1576 | # Copyright (c) 2010 Reza Lotun http://reza.lotun.name
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, m... | mit |
eoncloud-dev/eonboard | eoncloud_web/cloud/api/swift.py | 10 | 11697 | # 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 |
arcsun/neteaseMenu | start.py | 1 | 11671 | #coding=utf-8
from flask import Flask, redirect, render_template, request, Response
from codepy import menulog
import anydbm as dbm
import shelve
import os, sys
import urllib
from datetime import datetime
import time
import urllib2
import hashlib
app = Flask(__name__)
visit = 0
visitHome = 0
startTime = time.time()
t... | apache-2.0 |
gregdek/ansible | lib/ansible/modules/network/fortios/fortios_firewall_address.py | 7 | 15896 | #!/usr/bin/python
from __future__ import (absolute_import, division, print_function)
# Copyright 2018 Fortinet, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the Lic... | gpl-3.0 |
flyher/pymo | android/pgs4a-0.9.6/python-install/lib/python2.7/distutils/tests/setuptools_build_ext.py | 149 | 11489 | from distutils.command.build_ext import build_ext as _du_build_ext
try:
# Attempt to use Pyrex for building extensions, if available
from Pyrex.Distutils.build_ext import build_ext as _build_ext
except ImportError:
_build_ext = _du_build_ext
import os, sys
from distutils.file_util import copy_file
from di... | mit |
w1ll1am23/home-assistant | homeassistant/components/yeelightsunflower/light.py | 21 | 3638 | """Support for Yeelight Sunflower color bulbs (not Yeelight Blue or WiFi)."""
import logging
import voluptuous as vol
import yeelightsunflower
from homeassistant.components.light import (
ATTR_BRIGHTNESS,
ATTR_HS_COLOR,
PLATFORM_SCHEMA,
SUPPORT_BRIGHTNESS,
SUPPORT_COLOR,
LightEntity,
)
from ho... | apache-2.0 |
syllog1sm/TextBlob | text/nltk/tag/tnt.py | 2 | 18395 | # Natural Language Toolkit: TnT Tagger
#
# Copyright (C) 2001-2013 NLTK Project
# Author: Sam Huston <sjh900@gmail.com>
#
# URL: <http://www.nltk.org/>
# For license information, see LICENSE.TXT
'''
Implementation of 'TnT - A Statisical Part of Speech Tagger'
by Thorsten Brants
http://acl.ldc.upenn.edu/A/A00/A00-1031... | mit |
barnone/EigenD | plg_midi/midi_input_plg.py | 1 | 16450 |
#
# Copyright 2009 Eigenlabs Ltd. http://www.eigenlabs.com
#
# This file is part of EigenD.
#
# EigenD 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) a... | gpl-3.0 |
patsissons/Flexget | flexget/plugins/output/pushalot.py | 4 | 6342 | from __future__ import unicode_literals, division, absolute_import
import logging
from flexget import plugin
from flexget.event import event
from flexget.utils import json
from flexget.utils.template import RenderError
from flexget.config_schema import one_or_more
log = logging.getLogger("pushalot")
pushalot_url = "... | mit |
dirtybit/libcustomperf | scripts/tracing/draw_functrace.py | 14676 | 3560 | #!/usr/bin/python
"""
Copyright 2008 (c) Frederic Weisbecker <fweisbec@gmail.com>
Licensed under the terms of the GNU GPL License version 2
This script parses a trace provided by the function tracer in
kernel/trace/trace_functions.c
The resulted trace is processed into a tree to produce a more human
view of the call ... | gpl-2.0 |
hosseinmh/Django_learning | djmod/.venv/lib/python3.5/site-packages/setuptools/site-patch.py | 356 | 2307 | def __boot():
import sys
import os
PYTHONPATH = os.environ.get('PYTHONPATH')
if PYTHONPATH is None or (sys.platform == 'win32' and not PYTHONPATH):
PYTHONPATH = []
else:
PYTHONPATH = PYTHONPATH.split(os.pathsep)
pic = getattr(sys, 'path_importer_cache', {})
stdpath = sys.pat... | mit |
eayunstack/horizon | openstack_dashboard/dashboards/identity/projects/workflows.py | 6 | 37160 | # 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 |
savi-dev/nova | nova/scheduler/chance.py | 6 | 4430 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2010 OpenStack, LLC.
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# ... | apache-2.0 |
dasseclab/dasseclab | clones/routersploit/tests/exploits/routers/mikrotik/test_winbox_auth_bypass_creds_disclosure.py | 1 | 3375 | from routersploit.modules.exploits.routers.mikrotik.winbox_auth_bypass_creds_disclosure import Exploit
def test_check_success(tcp_target):
command_mock1 = tcp_target.get_command_mock(
b"\x68\x01\x00\x66\x4d\x32\x05\x00\xff\x01\x06\x00\xff\x09\x05\x07"
b"\x00\xff\x09\x07\x01\x00\x00\x21\x35\x2f\x2f... | gpl-2.0 |
dwks/silvius-backend | kaldigstserver/decoder2.py | 1 | 8962 | """
Created on May 17, 2013
@author: tanel
"""
import gi
gi.require_version('Gst', '1.0')
from gi.repository import GObject, Gst
GObject.threads_init()
Gst.init(None)
import logging
import thread
import os
logger = logging.getLogger(__name__)
import pdb
class DecoderPipeline2(object):
def __init__(self, conf=... | bsd-2-clause |
tklaus/ansible | lib/ansible/playbook/role/metadata.py | 80 | 3201 | # (c) 2014 Michael DeHaan, <michael@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 option) any later ve... | gpl-3.0 |
agiliq/nginx-python-buildpack | vendor/pip-1.5.4/pip/_vendor/html5lib/treebuilders/etree.py | 915 | 12621 | from __future__ import absolute_import, division, unicode_literals
from pip._vendor.six import text_type
import re
from . import _base
from .. import ihatexml
from .. import constants
from ..constants import namespaces
from ..utils import moduleFactoryFactory
tag_regexp = re.compile("{([^}]*)}(.*)")
def getETreeBu... | mit |
pdubroy/kurt | build/MacOS/PyInstaller/pyinstaller-svn-r812/Build.py | 1 | 42370 | #!/usr/bin/env python
#
# Build packages using spec files
#
# Copyright (C) 2005, Giovanni Bajo
# Based on previous work under copyright (c) 1999, 2002 McMillan Enterprises, Inc.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as publishe... | gpl-2.0 |
gdi2290/django | django/contrib/gis/gdal/tests/test_driver.py | 335 | 1253 | import unittest
from django.contrib.gis.gdal import HAS_GDAL
if HAS_GDAL:
from django.contrib.gis.gdal import Driver, GDALException
valid_drivers = (
# vector
'ESRI Shapefile', 'MapInfo File', 'TIGER', 'S57', 'DGN', 'Memory', 'CSV',
'GML', 'KML',
# raster
'GTiff', 'JPEG', 'MEM', 'PNG',
)
in... | bsd-3-clause |
neumerance/cloudloon2 | .venv/lib/python2.7/site-packages/django/forms/extras/widgets.py | 110 | 5251 | """
Extra HTML Widget classes
"""
from __future__ import unicode_literals
import datetime
import re
from django.forms.widgets import Widget, Select
from django.utils import datetime_safe
from django.utils.dates import MONTHS
from django.utils.safestring import mark_safe
from django.utils.formats import get_format
fro... | apache-2.0 |
ismailsunni/healthsites | django_project/localities/tests/test_model_DomainArchive.py | 2 | 1095 | # -*- coding: utf-8 -*-
from django.test import TestCase
from .model_factories import DomainF
from ..models import DomainArchive
class TestModelDomainArchive(TestCase):
def test_domainArchive_fields(self):
self.assertListEqual(
[fld.name for fld in DomainArchive._meta.fields], [
... | bsd-2-clause |
ltiao/networkx | networkx/algorithms/tests/test_distance_measures.py | 6 | 2145 | #!/usr/bin/env python
from nose.tools import *
import networkx
class TestDistance:
def setUp(self):
G=networkx.Graph()
from networkx import convert_node_labels_to_integers as cnlti
G=cnlti(networkx.grid_2d_graph(4,4),first_label=1,ordering="sorted")
self.G=G
def test_eccentric... | bsd-3-clause |
idea4bsd/idea4bsd | python/helpers/py2only/docutils/languages/cs.py | 148 | 1928 | # $Id: cs.py 4564 2006-05-21 20:44:42Z wiemann $
# Author: Marek Blaha <mb@dat.cz>
# Copyright: This module has been placed in the public domain.
# New language mappings are welcome. Before doing a new translation, please
# read <http://docutils.sf.net/docs/howto/i18n.html>. Two files must be
# translated for each l... | apache-2.0 |
cigroup-ol/metaopt | metaopt/tests/integration/optimizer/singleinvoke.py | 1 | 1233 | # -*- coding: utf-8 -*-
"""
Tests for the single invoke invoker.
"""
# Future
from __future__ import absolute_import, division, print_function, \
unicode_literals, with_statement
# Third Party
import nose
from mock import Mock
# First Party
from metaopt.concurrent.invoker.singleprocess import SingleProcessInvoker... | bsd-3-clause |
SuperJohn/scikit-class | grid_search.py | 6 | 1243 | import pandas as pd
import numpy as np
df = pd.read_csv('tweets.csv')
target = df['is_there_an_emotion_directed_at_a_brand_or_product']
text = df['tweet_text']
fixed_text = text[pd.notnull(text)]
fixed_target = target[pd.notnull(text)]
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.naive_b... | gpl-2.0 |
fnouama/intellij-community | python/helpers/pydev/pydev_monkey_qt.py | 47 | 5183 | from __future__ import nested_scopes
def set_trace_in_qt():
import pydevd_tracing
from pydevd_comm import GetGlobalDebugger
debugger = GetGlobalDebugger()
if debugger is not None:
pydevd_tracing.SetTrace(debugger.trace_dispatch)
_patched_qt = False
def patch_qt():
'''
... | apache-2.0 |
donnerluetjen/ardupilot | Tools/LogAnalyzer/tests/TestAutotune.py | 265 | 4748 | from LogAnalyzer import Test,TestResult
import DataflashLog
# from ArduCopter/defines.h
AUTOTUNE_INITIALISED = 30
AUTOTUNE_OFF = 31
AUTOTUNE_RESTART = 32
AUTOTUNE_SUCCESS = 33
AUTOTUNE_FAILED = 34
AUTOTUNE_REACHED_LIMIT = 35
AUTOTUNE_PILOT_TESTING = 36
AUTOTUN... | gpl-3.0 |
radiasoft/radtrack | experimental/hermite/testHermite02.py | 1 | 6919 | #
# Test executable #2 to exercise the Gauss-Hermite class
# Here, we fit a Gauss-Hermite expansion to an arbitrary profile.
# The SciPy least squares method is used.
#
# Copyright (c) 2013 RadiaBeam Technologies. All rights reserved
#
# python imports
import math
# SciPy imports
import numpy as np
import matplotlib.p... | apache-2.0 |
OpenFacetracker/facetracker-core | lib/youtube-dl/youtube_dl/extractor/shared.py | 31 | 1936 | from __future__ import unicode_literals
import re
import base64
from .common import InfoExtractor
from ..compat import (
compat_urllib_parse,
compat_urllib_request,
)
from ..utils import (
ExtractorError,
int_or_none,
)
class SharedIE(InfoExtractor):
_VALID_URL = r'http://shared\.sx/(?P<id>[\da-... | gpl-2.0 |
ekwoodrich/nirha | nirhaweb/venv/lib/python2.7/site-packages/pip/req.py | 328 | 83557 | from email.parser import FeedParser
import os
import imp
import locale
import re
import sys
import shutil
import tempfile
import textwrap
import zipfile
from distutils.util import change_root
from pip.locations import (bin_py, running_under_virtualenv,PIP_DELETE_MARKER_FILENAME,
write_delete... | apache-2.0 |
pgonda/servo | tests/wpt/css-tests/tools/pywebsocket/src/test/test_handshake_hybi.py | 413 | 22552 | #!/usr/bin/env python
#
# Copyright 2011, 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... | mpl-2.0 |
spanner888/madparts | coffee/library.py | 1 | 1940 | # (c) 2013 Joost Yervante Damad <joost@damad.be>
# License: GPL
import os, os.path, glob
import coffee.pycoffee as pycoffee
class Meta:
def __init__(self, meta):
if not 'desc' in meta:
meta['desc'] = ''
if not 'parent' in meta:
meta['parent'] = None
self.meta = meta
for k in meta:
... | gpl-3.0 |
martynovp/edx-platform | cms/djangoapps/contentstore/features/course-updates.py | 95 | 4707 | # pylint: disable=missing-docstring
# pylint: disable=redefined-outer-name
from lettuce import world, step
from selenium.webdriver.common.keys import Keys
from common import type_in_codemirror, get_codemirror_value
from nose.tools import assert_in # pylint: disable=no-name-in-module
@step(u'I go to the course updat... | agpl-3.0 |
taedla01/MissionPlanner | Lib/unittest/util.py | 60 | 4762 | """Various utility functions."""
from collections import namedtuple, OrderedDict
__unittest = True
_MAX_LENGTH = 80
def safe_repr(obj, short=False):
try:
result = repr(obj)
except Exception:
result = object.__repr__(obj)
if not short or len(result) < _MAX_LENGTH:
retu... | gpl-3.0 |
aristotle-tek/cuny-bdif | AWS/ec2/lib/boto-2.34.0/boto/cloudfront/origin.py | 153 | 6060 | # Copyright (c) 2006-2010 Mitch Garnaat http://garnaat.org/
# Copyright (c) 2010, Eucalyptus Systems, Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# w... | mit |
xuxiao19910803/edx-platform | cms/djangoapps/contentstore/tests/test_clone_course.py | 147 | 6812 | """
Unit tests for cloning a course between the same and different module stores.
"""
import json
from django.conf import settings
from opaque_keys.edx.locator import CourseLocator
from xmodule.modulestore import ModuleStoreEnum, EdxJSONEncoder
from contentstore.tests.utils import CourseTestCase
from contentstore.task... | agpl-3.0 |
mephizzle/wagtail | wagtail/wagtailadmin/tests/test_account_management.py | 25 | 19261 | from __future__ import unicode_literals
from django.test import TestCase
from django.core.urlresolvers import reverse
from django.contrib.auth import get_user_model
from django.contrib.auth.models import Group, Permission
from django.contrib.auth.tokens import PasswordResetTokenGenerator
from django.core import mail
... | bsd-3-clause |
amisrs/angular-flask | angular_flask/lib/python2.7/site-packages/requests/packages/urllib3/_collections.py | 68 | 2903 | # urllib3/_collections.py
# Copyright 2008-2013 Andrey Petrov and contributors (see CONTRIBUTORS.txt)
#
# This module is part of urllib3 and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
from collections import MutableMapping
from threading import Lock
try: # Python 2.7+
... | mit |
vrenaville/project-service | project_stage_state/project.py | 3 | 1221 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2014 Daniel Reis
#
# 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... | agpl-3.0 |
rmoorman/feedhq | feedhq/storage.py | 1 | 2371 | import tempfile
import os
import errno
from django.conf import settings
from django.core.files import locks
from django.core.files.move import file_move_safe
from django.utils.text import get_valid_filename
from django.core.files.storage import FileSystemStorage
class OverwritingStorage(FileSystemStorage):
"""
... | bsd-3-clause |
PhenomX1998/FRACTALX-OP3 | scripts/build-all.py | 162 | 14627 | #! /usr/bin/env python2
# Copyright (c) 2009-2015, The Linux Foundation. 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
# ... | gpl-2.0 |
ritviksahajpal/Py6S | Py6S/SixSHelpers/all_angles.py | 1 | 13499 | # This file is part of Py6S.
#
# Copyright 2012 Robin Wilson and contributors listed in the CONTRIBUTORS file.
#
# Py6S 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 3 of the License, o... | lgpl-3.0 |
Flamacue/pretix | src/tests/plugins/banktransfer/test_actions.py | 2 | 9548 | import json
from datetime import timedelta
import pytest
from django.utils.timezone import now
from pretix.base.models import (
Event, EventPermission, Item, Order, OrderPosition, Organizer, Quota, User,
)
from pretix.plugins.banktransfer.models import BankImportJob, BankTransaction
@pytest.fixture
def env():
... | apache-2.0 |
undefinedv/Jingubang | sqlmap/tamper/equaltolike.py | 2 | 1136 | #!/usr/bin/env python
"""
Copyright (c) 2006-2016 sqlmap developers (http://sqlmap.org/)
See the file 'doc/COPYING' for copying permission
"""
import os
import re
from lib.core.common import singleTimeWarnMessage
from lib.core.enums import DBMS
from lib.core.enums import PRIORITY
__priority__ = PRIORITY.HIGHEST
de... | gpl-3.0 |
tahnok/react-native | JSCLegacyProfiler/trace_data.py | 375 | 8013 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import re
import unittest
"""
# _-----=> irqs-off
# / _----=> need-resched
# | / _---... | bsd-3-clause |
nop33/indico-plugins | chat/indico_chat/controllers/event.py | 1 | 1645 | # This file is part of Indico.
# Copyright (C) 2002 - 2017 European Organization for Nuclear Research (CERN).
#
# Indico 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 (a... | gpl-3.0 |
sertac/django | tests/gis_tests/geo3d/tests.py | 199 | 17484 | from __future__ import unicode_literals
import os
import re
from unittest import skipUnless
from django.contrib.gis.db.models import Extent3D, Union
from django.contrib.gis.db.models.functions import (
AsGeoJSON, AsKML, Length, Perimeter, Scale, Translate,
)
from django.contrib.gis.gdal import HAS_GDAL
from djang... | bsd-3-clause |
KaranToor/MA450 | google-cloud-sdk/platform/gsutil/third_party/boto/boto/cloudsearch2/domain.py | 153 | 21247 | # Copyright (c) 2014 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights ... | apache-2.0 |
rigdenlab/SIMBAD | i2/SIMBAD_report.py | 1 | 7959 | """
SIMBAD_report.py: CCP4 GUI Project
This library is free software: you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public License
version 3, modified in accordance with the provisions of the
license to address the requirements of UK law.
... | bsd-3-clause |
Isendir/brython | www/src/Lib/xml/sax/expatreader.py | 870 | 14659 | """
SAX driver for the pyexpat C module. This driver works with
pyexpat.__version__ == '2.22'.
"""
version = "0.20"
from xml.sax._exceptions import *
from xml.sax.handler import feature_validation, feature_namespaces
from xml.sax.handler import feature_namespace_prefixes
from xml.sax.handler import feature_external_... | bsd-3-clause |
ericlink/adms-server | playframework-dist/play-1.1/python/Lib/compiler/syntax.py | 25 | 1490 | """Check for errs in the AST.
The Python parser does not catch all syntax errors. Others, like
assignments with invalid targets, are caught in the code generation
phase.
The compiler package catches some errors in the transformer module.
But it seems clearer to write checkers that use the AST to detect
error... | mit |
ESOedX/edx-platform | openedx/core/djangoapps/enrollments/errors.py | 75 | 1335 | """All Error Types pertaining to Enrollment."""
class CourseEnrollmentError(Exception):
"""Generic Course Enrollment Error.
Describes any error that may occur when reading or updating enrollment information for a user or a course.
"""
def __init__(self, msg, data=None):
super(CourseEnrollmen... | agpl-3.0 |
DmitryYurov/BornAgain | Tests/Functional/Python/PyCore/transform_cube.py | 2 | 7597 | """
Test of rotation/positioning of simple cubic particle. Original particle is compared with the one obtained
"""
from __future__ import print_function
import os, sys, unittest
import utils
from libBornAgainCore import *
class RotationsCubeTest(unittest.TestCase):
"""
Test of rotations and translations of ... | gpl-3.0 |
markYoungH/chromium.src | components/crash/tools/dmp2minidump.py | 129 | 1353 | #!/usr/bin/env python
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""A tool to extract minidumps from dmp crash dumps."""
import os
import sys
from cgi import parse_multipart
def ProcessDump(dump_fi... | bsd-3-clause |
hdinsight/hue | desktop/core/ext-py/boto-2.38.0/boto/beanstalk/wrapper.py | 153 | 1078 | """Wraps layer1 api methods and converts layer1 dict responses to objects."""
from boto.beanstalk.layer1 import Layer1
import boto.beanstalk.response
from boto.exception import BotoServerError
import boto.beanstalk.exception as exception
def beanstalk_wrapper(func, name):
def _wrapped_low_level_api(*args, **kwarg... | apache-2.0 |
Jasoning/namebench | nb_third_party/graphy/line_chart.py | 205 | 4253 | #!/usr/bin/python2.4
#
# Copyright 2008 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 o... | apache-2.0 |
kiran/bart-sign | venv/lib/python2.7/site-packages/untangle.py | 2 | 4047 | #!/usr/bin/env python
"""
untangle
Converts xml to python objects.
The only method you need to call is parse()
Partially inspired by xml2obj
(http://code.activestate.com/recipes/149368-xml2obj/)
Author: Christian Stefanescu (http://0chris.com)
License: MIT License - http://www.opensource.org/licenses/mit-li... | mit |
auferack08/edx-platform | cms/djangoapps/contentstore/tests/test_permissions.py | 28 | 5759 | """
Test CRUD for authorization.
"""
import copy
from django.contrib.auth.models import User
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from contentstore.tests.utils import AjaxEnabledTestClient
from opaque_keys.edx.locations import SlashSeparatedCourseKey
from contentstore.utils import re... | agpl-3.0 |
X-DataInitiative/tick | tick/survival/simu_sccs.py | 2 | 26354 | # License: BSD 3 clause
from operator import itemgetter
import numpy as np
import scipy.sparse as sps
from scipy.sparse import csr_matrix
from tick.base.simulation import Simu
from tick.hawkes import SimuHawkesExpKernels, SimuHawkesMulti
from tick.preprocessing import LongitudinalFeaturesLagger
from itertools import p... | bsd-3-clause |
spreeker/democracygame | external_apps/docutils-snapshot/test/test_parsers/test_rst/test_directives/test_decorations.py | 19 | 1847 | #! /usr/bin/env python
# $Id: test_decorations.py 4667 2006-07-12 21:40:56Z wiemann $
# Author: David Goodger <goodger@python.org>
# Copyright: This module has been placed in the public domain.
"""
Tests for the "header" & "footer" directives.
"""
from __init__ import DocutilsTestSupport
def suite():
s = Docuti... | bsd-3-clause |
pxzhenren/flask | tests/test_views.py | 155 | 4202 | # -*- coding: utf-8 -*-
"""
tests.views
~~~~~~~~~~~
Pluggable views.
:copyright: (c) 2015 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import pytest
import flask
import flask.views
from werkzeug.http import parse_set_header
def common_test(app):
c = app.test_client()... | bsd-3-clause |
Frulko/AutobahnPython | examples/wamp/rpc/keyvalue/client.py | 12 | 1841 | ###############################################################################
##
## Copyright 2011 Tavendo GmbH
##
## 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
##
## ht... | apache-2.0 |
Godley/MuseParse | MuseParse/tests/testHandlers/testHandlePartsAndPiece.py | 1 | 8150 | import unittest
from MuseParse.classes.Input import MxmlParser
from MuseParse.classes.ObjectHierarchy.TreeClasses.PieceTree import PieceTree
class testSetupPiece(unittest.TestCase):
def setUp(self):
self.handler = MxmlParser.SetupPiece
self.tags = []
self.attrs = {}
self.chars = ... | mit |
areski/django | tests/inspectdb/models.py | 208 | 2737 | # -*- encoding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models
class People(models.Model):
name = models.CharField(max_length=255)
parent = models.ForeignKey('self', models.CASCADE)
class Message(models.Model):
from_field = models.ForeignKey(People, models.CASCADE, db_co... | bsd-3-clause |
jorik041/phantomjs | src/qt/qtbase/util/local_database/cldr2qlocalexml.py | 102 | 42691 | #!/usr/bin/env python
#############################################################################
##
## Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
## Contact: http://www.qt-project.org/legal
##
## This file is part of the test suite of the Qt Toolkit.
##
## $QT_BEGIN_LICENSE:LGPL$
## Commercial License... | bsd-3-clause |
cpanelli/-git-clone-https-chromium.googlesource.com-chromium-tools-depot_tools | third_party/pylint/lint.py | 46 | 56500 | # Copyright (c) 2003-2014 LOGILAB S.A. (Paris, FRANCE).
# http://www.logilab.fr/ -- mailto:contact@logilab.fr
#
# 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, o... | bsd-3-clause |
onceuponatimeforever/oh-mainline | vendor/packages/docutils/test/test_parsers/test_rst/test_directives/test_figures.py | 16 | 7300 | #! /usr/bin/env python
# $Id: test_figures.py 7062 2011-06-30 22:14:29Z milde $
# Author: David Goodger <goodger@python.org>
# Copyright: This module has been placed in the public domain.
"""
Tests for images.py figure directives.
"""
from __init__ import DocutilsTestSupport
def suite():
s = DocutilsTestSupport... | agpl-3.0 |
l00py/KML_Lookup | TA-KML_lookup/bin/shapely/topology.py | 18 | 2257 | """
Intermediaries supporting GEOS topological operations
These methods all take Shapely geometries and other Python objects and delegate
to GEOS functions via ctypes.
These methods return ctypes objects that should be recast by the caller.
"""
from ctypes import byref, c_double
from shapely.geos import TopologicalE... | mit |
foreni-packages/golismero | thirdparty_libs/django/conf/locale/lt/formats.py | 104 | 1503 | # -*- 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 = r'Y \m. E j \d.'
TIME_FORMAT = 'H:... | gpl-2.0 |
uclouvain/osis_louvain | base/business/education_groups/postponement.py | 1 | 7431 | ##############################################################################
#
# OSIS stands for Open Student Information System. It's an application
# designed to manage the core business of higher education institutions,
# such as universities, faculties, institutes and professional schools.
# The core ... | agpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.