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 |
|---|---|---|---|---|---|
stuntman723/rap-analyzer | rap_analyzer/lib/python2.7/site-packages/setuptools/depends.py | 462 | 6370 | import sys
import imp
import marshal
from imp import PKG_DIRECTORY, PY_COMPILED, PY_SOURCE, PY_FROZEN
from distutils.version import StrictVersion
from setuptools import compat
__all__ = [
'Require', 'find_module', 'get_module_constant', 'extract_constant'
]
class Require:
"""A prerequisite to building or inst... | mit |
gatkin/declxml | tests/test_text_encoding.py | 1 | 2177 | # -*- coding: utf-8 -*-
"""Tests handling of text encoding"""
import os
import pytest
import declxml as xml
_PROCESSOR = xml.dictionary('root', [
xml.string('value')
])
_VALUE = {
'value': u'Hello, 世界!',
}
_XML_STRING = u"""<root><value>Hello, 世界!</value></root>"""
_XML_STRING_INDENTED = u"""<?xml v... | mit |
bousmalis/models | swivel/vecs.py | 20 | 3115 | # Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | apache-2.0 |
Ninjakow/TrueSkill | lib/numpy/f2py/tests/test_size.py | 145 | 1154 | from __future__ import division, absolute_import, print_function
import os
from numpy.testing import run_module_suite, assert_equal, dec
import util
def _path(*a):
return os.path.join(*((os.path.dirname(__file__),) + a))
class TestSizeSumExample(util.F2PyTest):
sources = [_path('src', 'size', 'foo.f90')]
... | gpl-3.0 |
switowski/invenio | invenio/modules/deposit/validation_utils.py | 9 | 9769 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2013, 2014, 2015 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 optio... | gpl-2.0 |
fcole90/nemesys-qos | nemesys/client.py | 9 | 1705 | # client.py
# -*- coding: utf8 -*-
# Copyright (c) 2010 Fondazione Ugo Bordoni.
#
# 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 late... | gpl-3.0 |
Geode/geonode | geonode/geoserver/urls.py | 19 | 2467 | # -*- coding: utf-8 -*-
#########################################################################
#
# Copyright (C) 2016 OSGeo
#
# 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 ... | gpl-3.0 |
NejcZupec/ggrc-core | src/ggrc/services/description.py | 7 | 1743 | # Copyright (C) 2016 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
import json
from flask import request, current_app
from flask.views import MethodView
"""RESTful service discovery API for gGRC services."""
class ServiceDescription(MethodView):
"""Flask view providing ... | apache-2.0 |
SneakersInc/sniffmypacketsv2 | src/sniffmypacketsv2/transforms/pcap-dns-domain.py | 1 | 3064 | #!/usr/bin/env python
import datetime
from common.dbconnect import mongo_connect, find_session
from common.hashmethods import *
import tldextract
import logging
logging.getLogger("scapy.runtime").setLevel(logging.ERROR)
from scapy.all import *
from collections import OrderedDict
from common.entities import pcapFile
fr... | apache-2.0 |
Pluto-tv/chromium-crosswalk | tools/telemetry/third_party/gsutilz/third_party/boto/boto/rds/dbsnapshot.py | 167 | 6398 | # Copyright (c) 2006-2009 Mitch Garnaat http://garnaat.org/
#
# 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, modi... | bsd-3-clause |
ammarkhann/FinalSeniorCode | lib/python2.7/site-packages/IPython/core/tests/test_handlers.py | 30 | 3318 | """Tests for input handlers.
"""
#-----------------------------------------------------------------------------
# Module imports
#-----------------------------------------------------------------------------
# third party
import nose.tools as nt
# our own packages
from IPython.core import autocall
from IPython.testin... | mit |
tmerrick1/spack | var/spack/repos/builtin/packages/xtrans/package.py | 5 | 1867 | ##############################################################################
# Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | lgpl-2.1 |
XiaosongWei/crosswalk-test-suite | webapi/tct-csp-w3c-tests/csp-py/csp_default-src_self_object_blocked-manual.py | 30 | 2477 | def main(request, response):
import simplejson as json
f = file('config.json')
source = f.read()
s = json.JSONDecoder().decode(source)
url1 = "http://" + s['host'] + ":" + str(s['ports']['http'][1])
response.headers.set("Content-Security-Policy", "default-src 'self'")
response.headers.set("X... | bsd-3-clause |
turbinenreiter/micropython | tests/pyb/i2c_error.py | 22 | 1119 | # test I2C errors, with polling (disabled irqs) and DMA
import pyb
from pyb import I2C
# init accelerometer
pyb.Accel()
# get I2C bus
i2c = I2C(1, I2C.MASTER)
# test polling mem_read
pyb.disable_irq()
i2c.mem_read(1, 76, 0x0a) # should succeed
pyb.enable_irq()
try:
pyb.disable_irq()
i2c.mem_read(1, 77, 0x0... | mit |
has2k1/numpy | numpy/distutils/cpuinfo.py | 173 | 22970 | #!/usr/bin/env python
"""
cpuinfo
Copyright 2002 Pearu Peterson all rights reserved,
Pearu Peterson <pearu@cens.ioc.ee>
Permission to use, modify, and distribute this software is given under the
terms of the NumPy (BSD style) license. See LICENSE.txt that came with
this distribution for specifics.
NO WARRANTY IS EXP... | bsd-3-clause |
emetsger/osf.io | scripts/migration/migrate_mailing_lists_to_mailchimp_field.py | 40 | 1043 | """
Used to transfer over subscriptions current users might have from their mailing_list field (which is to be deprecated),
to the new mailchimp_mailing_lists field. After that is done, to clean-up, remove mailing_lists as a User field.
"""
import logging
import sys
from website import models
from website.app import i... | apache-2.0 |
pwoodworth/intellij-community | python/lib/Lib/pdb.py | 90 | 42362 | #! /usr/bin/env python
"""A Python debugger."""
# (See pdb.doc for documentation.)
import sys
import linecache
import cmd
import bdb
from repr import Repr
import os
import re
import pprint
import traceback
# Create a custom safe Repr instance and increase its maxstring.
# The default of 30 truncates error messages t... | apache-2.0 |
public-ink/public-ink | server/appengine-staging/lib/unidecode/x055.py | 252 | 4599 | data = (
'You ', # 0x00
'Yan ', # 0x01
'Gu ', # 0x02
'Gu ', # 0x03
'Bai ', # 0x04
'Han ', # 0x05
'Suo ', # 0x06
'Chun ', # 0x07
'Yi ', # 0x08
'Ai ', # 0x09
'Jia ', # 0x0a
'Tu ', # 0x0b
'Xian ', # 0x0c
'Huan ', # 0x0d
'Li ', # 0x0e
'Xi ', # 0x0f
'Tang ', # 0x10
'Zuo ', ... | gpl-3.0 |
harshilasu/LinkurApp | y/google-cloud-sdk/platform/gcutil/lib/google_compute_engine/gcutil_lib/gcutil_logging.py | 4 | 2573 | # Copyright 2012 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | gpl-3.0 |
tuxfux-hlp-notes/python-batches | archieves/batch-58/modules/sheets/lib/python2.7/site-packages/pip/_vendor/html5lib/treewalkers/lxmletree.py | 355 | 6215 | from __future__ import absolute_import, division, unicode_literals
from pip._vendor.six import text_type
from lxml import etree
from ..treebuilders.etree import tag_regexp
from gettext import gettext
_ = gettext
from . import _base
from .. import ihatexml
def ensure_str(s):
if s is None:
return None
... | gpl-3.0 |
n4hy/gnuradio | grc/base/Platform.py | 9 | 6735 | """
Copyright 2008-2011 Free Software Foundation, Inc.
This file is part of GNU Radio
GNU Radio Companion 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 l... | gpl-3.0 |
nic7aller/bip-switch | BipFlaskProject/BipFlaskProject/env/Lib/encodings/iso8859_11.py | 593 | 12591 | """ Python Character Mapping Codec iso8859_11 generated from 'MAPPINGS/ISO8859/8859-11.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,errors... | mit |
spinellic/Mission-Planner | Lib/site-packages/numpy/oldnumeric/ufuncs.py | 102 | 1231 | __all__ = ['less', 'cosh', 'arcsinh', 'add', 'ceil', 'arctan2', 'floor_divide',
'fmod', 'hypot', 'logical_and', 'power', 'sinh', 'remainder', 'cos',
'equal', 'arccos', 'less_equal', 'divide', 'bitwise_or',
'bitwise_and', 'logical_xor', 'log', 'subtract', 'invert',
'negative',... | gpl-3.0 |
WillisXChen/django-oscar | tests/functional/customer/history_tests.py | 50 | 2344 | from django.conf import settings
from django.core.urlresolvers import reverse
from django.test import TestCase
from django.http import HttpRequest
from oscar.test.factories import create_product
from oscar.core.compat import get_user_model
from oscar.apps.customer import history
from oscar.templatetags.history_tags i... | bsd-3-clause |
PaloAltoNetworks-BD/SplunkforPaloAltoNetworks | Splunk_TA_paloalto/bin/splunk_ta_paloalto/aob_py3/urllib3/exceptions.py | 20 | 6607 | from __future__ import absolute_import
from .packages.six.moves.http_client import IncompleteRead as httplib_IncompleteRead
# Base Exceptions
class HTTPError(Exception):
"Base exception used by this module."
pass
class HTTPWarning(Warning):
"Base warning used by this module."
pass
class PoolError... | isc |
warszawajug/warsjawa2014 | app/buildsite.py | 1 | 1997 | # -*- coding: utf-8 -*-
import jinja2
import sys
import os
import shutil
import contents
import json
absolute_path = os.path.dirname(os.path.abspath(__file__))
reload(sys)
sys.setdefaultencoding("utf-8")
absolute_template_path = absolute_path + '/templates'
absolute_output_path = absolute_path + '/output'
print('... | mit |
shubhangiKishore/pattern | test/test_metrics.py | 4 | 17518 | from __future__ import print_function
from util import *
from pattern import metrics
#-------------------------------------------------------------------------
class TestProfiling(unittest.TestCase):
def setUp(self):
# Test set for accuracy, precision and recall:
self.documents = (
... | bsd-3-clause |
theheros/kbengine | kbe/res/scripts/common/Lib/encodings/koi8_u.py | 37 | 14069 | """ Python Character Mapping Codec koi8_u generated from 'python-mappings/KOI8-U.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... | lgpl-3.0 |
erinn/ansible | v1/ansible/utils/hashing.py | 104 | 3014 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@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) an... | gpl-3.0 |
frouty/odoogoeen | addons/edi/__init__.py | 437 | 1157 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# 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 GN... | agpl-3.0 |
NMGRL/pychron | pychron/extraction_line/ipyscript_runner.py | 2 | 1204 | # ===============================================================================
# Copyright 2014 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 |
gskachkov/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/tool/steps/closebug.py | 126 | 2748 | # Copyright (C) 2010 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and th... | bsd-3-clause |
JohnOrlando/gnuradio-bitshark | grc/base/Param.py | 5 | 6477 | """
Copyright 2008, 2009 Free Software Foundation, Inc.
This file is part of GNU Radio
GNU Radio Companion 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 ... | gpl-3.0 |
ajnirp/servo | tests/wpt/web-platform-tests/old-tests/webdriver/command_contexts/window_handle_test.py | 141 | 1067 | import os
import sys
import random
import unittest
sys.path.insert(1, os.path.abspath(os.path.join(__file__, "../..")))
import base_test
repo_root = os.path.abspath(os.path.join(__file__, "../../.."))
sys.path.insert(1, os.path.join(repo_root, "tools", "webdriver"))
from webdriver import exceptions
class WindowHan... | mpl-2.0 |
rg3/youtube-dl | youtube_dl/extractor/hotstar.py | 6 | 5764 | # coding: utf-8
from __future__ import unicode_literals
import hashlib
import hmac
import time
from .common import InfoExtractor
from ..compat import compat_HTTPError
from ..utils import (
determine_ext,
ExtractorError,
int_or_none,
try_get,
)
class HotStarBaseIE(InfoExtractor):
_AKAMAI_ENCRYPTI... | unlicense |
ittailup/scrape4jobs | scrape4jobs/spiders/resumator_spider.py | 1 | 1539 | from scrapy.spider import Spider
from scrapy import signals
from scrapy.selector import Selector
import logging
import csv
from careerpagescrapers.items import Startup, StartupJob
from scrapy.log import ScrapyFileLogObserver
from scrapy.xlib.pydispatch import dispatcher
from scrapy import log
logfile = open('testlog.l... | mit |
joegomes/deepchem | deepchem/models/tests/test_overfit.py | 1 | 35451 | """
Tests to make sure deepchem models can overfit on tiny datasets.
"""
from __future__ import print_function
from __future__ import division
from __future__ import unicode_literals
__author__ = "Bharath Ramsundar"
__copyright__ = "Copyright 2016, Stanford University"
__license__ = "MIT"
import os
import tempfile
im... | mit |
mavit/ansible | lib/ansible/modules/network/f5/bigip_iapplx_package.py | 8 | 11731 | #!/usr/bin/python
# -*- 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
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | gpl-3.0 |
alivecor/tensorflow | tensorflow/contrib/seq2seq/python/ops/beam_search_decoder.py | 23 | 28748 | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
telwertowski/Books-Mac-OS-X | Versions/Books_3.0b6/Library of Congress.plugin/Contents/Resources/PyZ3950/CQLParser.py | 30 | 33090 | #!/usr/bin/python
# Author: Rob Sanderson (azaroth@liv.ac.uk)
# Distributed and Usable under the GPL
# Version: 1.7
# Most Recent Changes: contexts, new modifier style for 1.1
#
# With thanks to Adam from IndexData and Mike Taylor for their valuable input
from shlex import shlex
from xml.sax.saxutils import escape
... | mit |
r39132/airflow | tests/contrib/utils/test_weekday.py | 6 | 1607 | # -*- coding: utf-8 -*-
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
#... | apache-2.0 |
tmerrick1/spack | var/spack/repos/builtin/packages/subversion/package.py | 5 | 4171 | ##############################################################################
# Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | lgpl-2.1 |
silly-wacky-3-town-toon/SOURCE-COD | Panda3D-1.10.0/python/Lib/JOD/NewJamoDrum.py | 3 | 10076 | """
A generic Jam-o-Drum input interface for the Jam-o-Drum that uses the OptiPAC
for both spinners and pads.
@author: U{Ben Buchwald <bb2@alumni.cmu.edu>}
Last Updated: 2/27/2006
"""
from direct.showbase.DirectObject import DirectObject
import string, sys, md5
from pandac.PandaModules import Filename
from pandac.Pan... | apache-2.0 |
ColdSauce/IsSittingOnButt | server/env/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/response.py | 478 | 16459 | try:
import http.client as httplib
except ImportError:
import httplib
import zlib
import io
from socket import timeout as SocketTimeout
from ._collections import HTTPHeaderDict
from .exceptions import (
ProtocolError, DecodeError, ReadTimeoutError, ResponseNotChunked
)
from .packages.six import string_type... | apache-2.0 |
mastizada/kuma | vendor/packages/setuptools/setuptools/command/test.py | 32 | 4442 | from setuptools import Command
from distutils.errors import DistutilsOptionError
import sys
from pkg_resources import *
from unittest import TestLoader, main
class ScanningLoader(TestLoader):
def loadTestsFromModule(self, module):
"""Return a suite of all tests cases contained in the given module
... | mpl-2.0 |
soldag/home-assistant | homeassistant/components/synology_srm/device_tracker.py | 21 | 4163 | """Device tracker for Synology SRM routers."""
import logging
import synology_srm
import voluptuous as vol
from homeassistant.components.device_tracker import (
DOMAIN,
PLATFORM_SCHEMA,
DeviceScanner,
)
from homeassistant.const import (
CONF_HOST,
CONF_PASSWORD,
CONF_PORT,
CONF_SSL,
CO... | apache-2.0 |
myang321/django | tests/gis_tests/geo3d/models.py | 302 | 1294 | from django.utils.encoding import python_2_unicode_compatible
from ..models import models
@python_2_unicode_compatible
class NamedModel(models.Model):
name = models.CharField(max_length=30)
objects = models.GeoManager()
class Meta:
abstract = True
required_db_features = ['gis_enabled']
... | bsd-3-clause |
OptimusGitEtna/RestSymf | Python-3.4.2/Tools/pybench/Tuples.py | 92 | 8034 | from pybench import Test
class TupleSlicing(Test):
version = 2.0
operations = 3 * 25 * 10 * 7
rounds = 500
def test(self):
r = range(25)
t = tuple(range(100))
for i in range(self.rounds):
for j in r:
m = t[50:]
m = t[:25]
... | mit |
mitodl/bootcamp-ecommerce | main/urls.py | 1 | 3638 | """
URLs for bootcamp
"""
from django.conf import settings
from django.conf.urls import url
from django.conf.urls.static import static
from django.urls import re_path, include, path
from django.contrib import admin
from django.contrib.auth import views as auth_views
from wagtail.admin import urls as wagtailadmin_urls
... | bsd-3-clause |
Qalthos/ansible | lib/ansible/modules/cloud/amazon/ec2_snapshot_copy.py | 39 | 5853 | #!/usr/bin/python
# Copyright: (c) 2017, Ansible Project
# 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': 'community'
}
DOCUMENTATION = '''
---
module: ec2_snapshot_copy
sho... | gpl-3.0 |
foobarbazblarg/stayclean | stayclean-2016-april/display-final-after-month-is-over.py | 1 | 2952 | #!/usr/bin/python
from participantCollection import ParticipantCollection
import re
import datetime
import pyperclip
# Edit Me!
# This script gets run on the first day of the following month, and that month's URL is
# what goes here. E.g. If this directory is the directory for February, this script gets
# run on Marc... | mit |
anielsen001/scipy | scipy/ndimage/interpolation.py | 31 | 27885 | # Copyright (C) 2003-2005 Peter J. Verveer
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following d... | bsd-3-clause |
mbinette91/ConstructionLCA | webapp.py | 1 | 7974 | import os
import threading
import urlparse
import time
from SimpleHTTPServer import SimpleHTTPRequestHandler
from ModelBuilder import ModelBuilder
import pickle
import sqlite3
import json
db = None;
def GetUniqueProjectId():
global db
filename = "../temp.db"
if not db:
db = {'last_project_id': 0}
if os.path.is... | gpl-2.0 |
jhaux/tensorflow | tensorflow/python/kernel_tests/matrix_solve_ls_op_test.py | 80 | 8075 | # 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/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
SurfasJones/djcmsrc3 | venv/lib/python2.7/site-packages/cms/signals/permissions.py | 4 | 2716 | # -*- coding: utf-8 -*-
from cms.cache.permissions import clear_user_permission_cache
from cms.models import PageUser, PageUserGroup
from cms.compat import user_related_name
from menus.menu_pool import menu_pool
def post_save_user(instance, raw, created, **kwargs):
"""Signal called when new user is created, requ... | mit |
maxhutch/mapcombine | examples/word_count/word_count.py | 1 | 1274 | #!/usr/bin/env python3
from argparse import ArgumentParser
from mapcombine import outer_process
parser = ArgumentParser(description='MapCombine example')
parser.add_argument('--mapreduce', default='MapReduce',
help="Module that implements map_ and reduce_")
parser.add_argument('--MR_init', default=... | mit |
samarthmed/emacs-config | .python-environments/default/lib/python2.7/site-packages/epc/handler.py | 4 | 13330 | # Copyright (C) 2012- Takafumi Arakaki
# 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 ... | gpl-2.0 |
mims2707/bite-project | deps/gdata-python-client/tests/gdata_tests/docs/data_test.py | 39 | 15349 | #!/usr/bin/python
#
# Copyright 2009 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | apache-2.0 |
RobinQuetin/CAIRIS-web | cairis/cairis/InternalDocumentDialog.py | 1 | 3183 | # 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 |
fafaman/django | django/forms/forms.py | 27 | 19335 | """
Form classes
"""
from __future__ import unicode_literals
import copy
from collections import OrderedDict
from django.core.exceptions import NON_FIELD_ERRORS, ValidationError
from django.forms.fields import Field, FileField
# pretty_name is imported for backwards compatibility in Django 1.9
from django.forms.util... | bsd-3-clause |
petesburgh/or-tools | examples/python/knapsack_cp.py | 34 | 2309 | # Copyright 2010 Hakan Kjellerstrand hakank@bonetmail.com
#
# 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 ... | apache-2.0 |
bzbarsky/servo | tests/wpt/web-platform-tests/tools/pywebsocket/src/mod_pywebsocket/http_header_util.py | 694 | 6905 | # 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 |
NunoEdgarGub1/nupic | nupic/support/pymysqlhelpers.py | 8 | 4303 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... | gpl-3.0 |
stackmagic/repod | repod.py | 1 | 4681 | #!/usr/bin/env python
# -*- coding: utf_8 -*-
import eyed3
import os
import sqlite3 as sl
import shutil
eyed3.require("0.7")
pod = '/media/ipod-backup'
dst = '/media/ipod-music-export'
dbf = '%s/iTunes_Control/iTunes/MediaLibrary.sqlitedb' % pod
print '>>> using database file %s' % dbf
con = sl.connect(dbf)
cur = ... | apache-2.0 |
openhardnudd/QMarkdowner | utildialog/ipaddressdialog.py | 4 | 2612 | #!/usr/bin/python
# -*- coding: utf-8 -*-
import os
from PyQt4 import QtGui
from PyQt4 import QtCore
from basedialog import BaseDialog
class IPaddressDialog(BaseDialog):
def __init__(self, styleoptions, parent=None):
super(IPaddressDialog, self).__init__(styleoptions, parent)
# url内... | mit |
mancoast/CPythonPyc_test | fail/313_test_strlit.py | 10 | 5040 | r"""Test correct treatment of various string literals by the parser.
There are four types of string literals:
'abc' -- normal str
r'abc' -- raw str
b'xyz' -- normal bytes
br'xyz' -- raw bytes
The difference between normal and raw strings is of course that in a
raw string, \ escapes (while still u... | gpl-3.0 |
yawnosnorous/python-for-android | python-build/python-libs/python-twitter/simplejson/scanner.py | 928 | 2227 | """JSON token scanner
"""
import re
try:
from simplejson._speedups import make_scanner as c_make_scanner
except ImportError:
c_make_scanner = None
__all__ = ['make_scanner']
NUMBER_RE = re.compile(
r'(-?(?:0|[1-9]\d*))(\.\d+)?([eE][-+]?\d+)?',
(re.VERBOSE | re.MULTILINE | re.DOTALL))
def py_make_scan... | apache-2.0 |
elthariel/dff | testsuite/dffunittest.py | 1 | 6113 | #!/usr/bin/python
# DFF -- An Open Source Digital Forensics Framework
# Copyright (C) 2009-2010 ArxSys
# This program is free software, distributed under the terms of
# the GNU General Public License Version 2. See the LICENSE file
# at the top of the source tree.
#
# See http://www.digital-forensic.org for more inf... | gpl-2.0 |
picrust/picrust | scripts/start_parallel_picrust_jobs_sge.py | 1 | 3682 | #!/usr/bin/env python
"""A simple qsub based cluster submission script for SGE."""
__author__ = "Jens Reeder"
__copyright__ = "Copyright 2011-2013, The PICRUSt Project"
__credits__ = ["Jens Reeder",
"Rob Knight",
"Greg Caporaso",
"Morgan Langille"]
__license__ = "GPL"
__... | gpl-3.0 |
sanjeevtripurari/hue | desktop/core/src/desktop/api.py | 14 | 10396 | #!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... | apache-2.0 |
mattcieslak/DSI2 | dsi2/ui/ltpa_result.py | 1 | 9331 | #!/usr/bin/env python
from traits.api import HasTraits, Instance, Array, Bool, Dict, \
on_trait_change, Delegate, List, Color, Any, Instance, Int, File, \
Button, Enum, Str, DelegatesTo, Property, CFloat,Range
from traitsui.api import View, Item, HGroup, VGroup, \
Group, Handler, HSplit, VSplit, RangeEd... | gpl-3.0 |
chemelnucfin/tensorflow | tensorflow/python/keras/engine/training_eager_test.py | 5 | 14079 | # 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 |
DavidjohnBlodgett/RackHD | test/tests/api/v2_0/schema_tests.py | 16 | 2321 | from config.api2_0_config import *
from modules.logger import Log
from on_http_api2_0 import ApiApi as api20
from on_http_api2_0 import rest
from proboscis.asserts import assert_equal
from proboscis.asserts import assert_not_equal
from proboscis.asserts import assert_true
from proboscis.asserts import fail
from probosc... | apache-2.0 |
JMJAC/Rango | tango_project/rango/models.py | 1 | 1073 | from django.db import models
from django.template.defaultfilters import slugify
from django.contrib.auth.models import User
class Category(models.Model):
name = models.CharField(max_length=128, unique=True)
likes = models.IntegerField(default=0)
views = models.IntegerField(default=0)
slug = models.Slu... | apache-2.0 |
ChromiumWebApps/chromium | tools/win/link_limiter/build_link_limiter.py | 169 | 2766 | #!/usr/bin/env python
# Copyright (c) 2012 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 glob
import os
import shutil
import subprocess
import sys
import tempfile
BUILD_DIR = 'build'
def run_with_vsvars(cmd, tm... | bsd-3-clause |
xuegang/gpdb | src/test/tinc/tincrepo/mpp/gpdb/tests/package/subt_limit_sanity/functional/test_functional.py | 9 | 1430 | """
Copyright (C) 2004-2015 Pivotal Software, Inc. All rights reserved.
This program and the accompanying materials are made available under
the terms of the 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
... | apache-2.0 |
syphar/django | tests/queries/tests.py | 7 | 158949 | from __future__ import unicode_literals
import datetime
import pickle
import unittest
from collections import OrderedDict
from operator import attrgetter
from django.core.exceptions import EmptyResultSet, FieldError
from django.db import DEFAULT_DB_ALIAS, connection
from django.db.models import Count, F, Q
from djang... | bsd-3-clause |
Desarrollo-CeSPI/meran | dev-plugins/node64/lib/node/wafadmin/Logs.py | 4 | 4722 | #!/usr/bin/env python
# Meran - MERAN UNLP is a ILS (Integrated Library System) wich provides Catalog,
# Circulation and User's Management. It's written in Perl, and uses Apache2
# Web-Server, MySQL database and Sphinx 2 indexing.
# Copyright (C) 2009-2013 Grupo de desarrollo de Meran CeSPI-UNLP
#
# This file is part ... | gpl-3.0 |
tboyce021/home-assistant | homeassistant/components/pvpc_hourly_pricing/__init__.py | 19 | 1708 | """The pvpc_hourly_pricing integration to collect Spain official electric prices."""
import voluptuous as vol
from homeassistant import config_entries
from homeassistant.const import CONF_NAME
from homeassistant.core import HomeAssistant
import homeassistant.helpers.config_validation as cv
from .const import ATTR_TAR... | apache-2.0 |
raghavs1108/DataPlotter | pyqtgraph/exporters/Exporter.py | 38 | 5393 | from ..widgets.FileDialog import FileDialog
from ..Qt import QtGui, QtCore, QtSvg
from ..python2_3 import asUnicode, basestring
from ..GraphicsScene import GraphicsScene
import os, re
LastExportDirectory = None
class Exporter(object):
"""
Abstract class used for exporting graphics to file / printer / whatever... | mit |
jazzband/site | migrations/versions/17164a7d1c2e_.py | 1 | 3712 | """
Revision ID: 17164a7d1c2e
Revises: cc0e3906ecfb
Create Date: 2017-09-28 19:53:27.500788
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
# revision identifiers, used by Alembic.
revision = "17164a7d1c2e"
down_revision = "cc0e3906ecfb"
def upgrade():
op.create_tab... | mit |
xxsergzzxx/python-for-android | python3-alpha/extra_modules/gdata/apps/service.py | 47 | 20661 | #!/usr/bin/python
#
# Copyright (C) 2007 SIOS Technology, 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 appli... | apache-2.0 |
htuch/envoy | examples/grpc-bridge/service/gen/kv_pb2.py | 24 | 9527 | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: kv.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection... | apache-2.0 |
iguzu/gae-django | tests/regressiontests/string_lookup/models.py | 20 | 2936 | # -*- coding: utf-8 -*-
from django.db import models
class Foo(models.Model):
name = models.CharField(max_length=50)
friend = models.CharField(max_length=50, blank=True)
def __unicode__(self):
return "Foo %s" % self.name
class Bar(models.Model):
name = models.CharField(max_length=50)
norm... | bsd-3-clause |
eicher31/compassion-switzerland | partner_communication_switzerland/tests/test_sms_provider.py | 3 | 1574 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2018 Compassion CH (http://www.compassion.ch)
# @author: Quentin Gigon <gigon.quentin@gmail.com>
#
# The licence is in the file __manifest__.py
#
############################################... | agpl-3.0 |
infobloxopen/neutron | neutron/db/migration/alembic_migrations/firewall_init_ops.py | 61 | 3536 | # Copyright 2014 OpenStack Foundation
#
# 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 ... | apache-2.0 |
soumide1102/pycbc | pycbc/distributions/arbitrary.py | 2 | 12257 | # Copyright (C) 2016 Miriam Cabero Mueller, Collin Capano
# 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 progr... | gpl-3.0 |
TheWylieStCoyote/gnuradio | gr-vocoder/python/vocoder/cvsd.py | 2 | 3118 | #!/usr/bin/env python
#
# Copyright 2007,2011 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
from __future__ import division
from __future__ import unicode_literals
from gnuradio import gr, filter, blocks
from . import vocoder_swig
class cvsd_encod... | gpl-3.0 |
kyl191/ansible | test/units/parsing/test_data_loader.py | 64 | 3283 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@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) an... | gpl-3.0 |
pdellaert/ansible | lib/ansible/modules/windows/win_netbios.py | 23 | 2309 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2019, Thomas Moore (@tmmruk)
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# this is a windows documentation stub. actual code lives in the .ps1
# file of the same name
from __future__ import (absolute_import, ... | gpl-3.0 |
tudorvio/nova | nova/tests/unit/virt/xenapi/image/test_bittorrent.py | 51 | 4959 | # Copyright 2013 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | apache-2.0 |
ysekky/GPy | GPy/inference/latent_function_inference/pep.py | 6 | 3521 | from .posterior import Posterior
from ...util.linalg import jitchol, tdot, dtrtrs, dtrtri, pdinv
from ...util import diag
import numpy as np
from . import LatentFunctionInference
log_2_pi = np.log(2*np.pi)
class PEP(LatentFunctionInference):
'''
Sparse Gaussian processes using Power-Expectation Propagation
... | bsd-3-clause |
austgl/python-gflags | gflags_validators.py | 488 | 6977 | #!/usr/bin/env python
# Copyright (c) 2010, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this l... | bsd-3-clause |
Peratham/tensor-sc | scripts/anomaly.py | 2 | 1531 | import snap
import numpy as np
G = snap.PNGraph.New()
set1 = range(0, 2)
set2 = range(2, 4)
set3 = range(4, 6)
set4 = range(6, 22)
for i in set1 + set2 + set3 + set4:
G.AddNode(i)
def add_edges(side1, side2, p):
for i in side1:
for j in side2:
if np.random.random() < p and i != j:
... | bsd-2-clause |
StealthMicro/OctoPi-Makerbot | env/Lib/site-packages/werkzeug/local.py | 84 | 13416 | # -*- coding: utf-8 -*-
"""
werkzeug.local
~~~~~~~~~~~~~~
This module implements context-local objects.
:copyright: (c) 2011 by the Werkzeug Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from werkzeug.wsgi import ClosingIterator
from werkzeug._internal import... | agpl-3.0 |
tgalal/yowsup | yowsup/layers/protocol_groups/protocolentities/iq_result_groups_info.py | 59 | 4256 | from yowsup.structs import ProtocolTreeNode
from yowsup.layers.protocol_iq.protocolentities import ResultIqProtocolEntity
class InfoGroupsResultIqProtocolEntity(ResultIqProtocolEntity):
'''
<iq type="result" from="{{GROUP_ID}}" id="{{IQ_ID}}">
<group subject="{{GROUPSUBJ}}" creation="{{GROUP_CREATION_TYIME}}"
... | gpl-3.0 |
nirb/whatsapp | build/lib/yowsup/layers/protocol_groups/protocolentities/iq_groups_leave.py | 4 | 1130 | from yowsup.structs import ProtocolEntity, ProtocolTreeNode
from .iq_groups import GroupsIqProtocolEntity
class LeaveGroupsIqProtocolEntity(GroupsIqProtocolEntity):
'''
<iq type="set" id="{{id}}" xmlns="w:g", to="g.us">
<leave>
<group id="{{gjid}}"></group>
<leave>
</iq>
'''
... | gpl-3.0 |
ProjectSWGCore/NGECore2 | scripts/mobiles/talus/aakuan_warder.py | 2 | 1640 | import sys
from services.spawn import MobileTemplate
from services.spawn import WeaponTemplate
from resources.datatables import WeaponType
from resources.datatables import Difficulty
from resources.datatables import Options
from java.util import Vector
def addTemplate(core):
mobileTemplate = MobileTemplate... | lgpl-3.0 |
google-research/language | language/conpono/evals/discriminative_eval.py | 1 | 11487 | # coding=utf-8
# Copyright 2018 The Google AI Language Team Authors.
#
# 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 ... | apache-2.0 |
frouty/odoogoeen | addons/sale_order_dates/__openerp__.py | 50 | 1739 | # -*- 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 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.