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 |
|---|---|---|---|---|---|
ericoporto/Chove-Agora | lib/requests_oauthlib/oauth1_session.py | 5 | 16103 | from __future__ import unicode_literals
try:
from urlparse import urlparse
except ImportError:
from urllib.parse import urlparse
import logging
from oauthlib.common import add_params_to_uri
from oauthlib.common import urldecode as _urldecode
from oauthlib.oauth1 import (
SIGNATURE_HMAC, SIGNATURE_RSA, SI... | apache-2.0 |
heke123/chromium-crosswalk | tools/perf/profile_creators/cookie_profile_extender.py | 14 | 3339 | # Copyright 2015 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 multiprocessing
import os
try:
import sqlite3 # Not present on ChromeOS DUT.
except ImportError:
pass
import page_sets
from profile_creators im... | bsd-3-clause |
RafaelTorrealba/odoo | addons/report_webkit/convert.py | 322 | 2581 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2010 Camptocamp SA (http://www.camptocamp.com)
# All Right Reserved
#
# Author : Nicolas Bessi (Camptocamp)
#
# WARNING: This program as such is intended to be used by professional
# programmers who ... | agpl-3.0 |
felipenaselva/felipe.repository | script.module.requests/lib/requests/packages/urllib3/util/ssl_.py | 148 | 12046 | from __future__ import absolute_import
import errno
import warnings
import hmac
from binascii import hexlify, unhexlify
from hashlib import md5, sha1, sha256
from ..exceptions import SSLError, InsecurePlatformWarning, SNIMissingWarning
SSLContext = None
HAS_SNI = False
IS_PYOPENSSL = False
# Maps the length of a d... | gpl-2.0 |
anarchivist/pyflag | src/plugins/Flash/AdvancedCommands.py | 1 | 13927 | """ These Flash commands allow more sophisticated operations, most of
which may not be needed by most users. Some operations are
specifically designed for testing and have little use in practice.
"""
import pyflag.pyflagsh as pyflagsh
import pyflag.Registry as Registry
import pyflag.DB as DB
import fnmatch
import pyfla... | gpl-2.0 |
florian-dacosta/OCB | openerp/addons/base/tests/test_res_lang.py | 384 | 2104 | import unittest2
import openerp.tests.common as common
class test_res_lang(common.TransactionCase):
def test_00_intersperse(self):
from openerp.addons.base.res.res_lang import intersperse
assert intersperse("", []) == ("", 0)
assert intersperse("0", []) == ("0", 0)
assert intersp... | agpl-3.0 |
mobarski/sandbox | parallel/p7cat.py | 1 | 1316 | ## p7cat.py - parallel concatenation
## (c) 2017 by mobarski (at) gmail (dot) com
## licence: MIT
## version: x1
from __future__ import print_function
import sys
import os
from multiprocessing import Process
from time import time
def write_part(path_in, path_out, offset, blocksize=4096):
fi = open(path_in,'rb')
fo ... | mit |
ruziniu/v2ex | v2ex/babel/ext/bleach/encoding.py | 51 | 2028 | import datetime
from decimal import Decimal
import types
def is_protected_type(obj):
"""Determine if the object instance is of a protected type.
Objects of protected types are preserved as-is when passed to
force_unicode(strings_only=True).
"""
return isinstance(obj, (
types.NoneType,
... | bsd-3-clause |
pigeonflight/strider-plone | docker/appengine/lib/django-1.5/tests/regressiontests/inspectdb/models.py | 48 | 1091 | from django.db import models
class People(models.Model):
name = models.CharField(max_length=255)
class Message(models.Model):
from_field = models.ForeignKey(People, db_column='from_id')
class PeopleData(models.Model):
people_pk = models.ForeignKey(People, primary_key=True)
ssn = models.CharField(max... | mit |
stoq/stoqdrivers | docs/fiscal-driver-template.py | 1 | 5263 | #
# Stoqdrivers template driver
#
# Copyright (C) 2007 Async Open Source <http://www.async.com.br>
# All rights reserved
#
# 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... | lgpl-2.1 |
kustodian/ansible | lib/ansible/modules/database/influxdb/influxdb_write.py | 8 | 2452 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) 2017, René Moser <mail@renemoser.net>
# 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... | gpl-3.0 |
aerickson/xbmc | tools/EventClients/examples/python/example_simple.py | 228 | 1272 | #!/usr/bin/python
# This is a simple example showing how you can send a key press event
# to XBMC using the XBMCClient class
import sys
sys.path.append("../../lib/python")
import time
from xbmcclient import XBMCClient
def main():
host = "localhost"
port = 9777
# Create an XBMCClient object and con... | gpl-2.0 |
waheedahmed/edx-platform | openedx/core/djangoapps/api_admin/views.py | 1 | 9646 | """Views for API management."""
import logging
from django.conf import settings
from django.contrib.sites.shortcuts import get_current_site
from django.core.urlresolvers import reverse_lazy, reverse
from django.http.response import JsonResponse
from django.shortcuts import redirect
from django.utils.translation import... | agpl-3.0 |
zhangsu/amphtml | validator/build.py | 6 | 22339 | #!/usr/bin/env python
#
# Copyright 2015 The AMP HTML 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
#
# Unl... | apache-2.0 |
yanchen036/tensorflow | tensorflow/python/debug/lib/session_debug_file_test.py | 19 | 5085 | # 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 |
wetdesert/rad2py | assignments/program4A.py | 8 | 2159 | #!/usr/bin/env python
# coding:utf-8
"""PSP Program 4A - Linear Regression Parameter
"""
__author__ = "Mariano Reingart (reingart@gmail.com)"
__copyright__ = "Copyright (C) 2011 Mariano Reingart"
__license__ = "GPL 3.0"
def mean(values):
"""Calculate the average of the numbers given:
>>> mean([1, 2, 3... | gpl-3.0 |
roselleebarle04/opencog | tests/python/blending_test/link_connector_test.py | 22 | 27877 | __author__ = 'DongMin Kim'
from opencog.atomspace import *
from test_conceptual_blending_base import TestConceptualBlendingBase
# Only run the unit tests if the required dependencies have been installed
# (see: https://github.com/opencog/opencog/issues/337)
try:
__import__("nose.tools")
except ImportError:
im... | agpl-3.0 |
follow99/django | django/views/decorators/cache.py | 586 | 2304 | from functools import wraps
from django.middleware.cache import CacheMiddleware
from django.utils.cache import add_never_cache_headers, patch_cache_control
from django.utils.decorators import (
available_attrs, decorator_from_middleware_with_args,
)
def cache_page(*args, **kwargs):
"""
Decorator for view... | bsd-3-clause |
bixbydev/Bixby | google/gdata/test_config.py | 72 | 17854 | #!/usr/bin/env python
# Copyright (C) 2009 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 l... | gpl-3.0 |
chfoo/fogchamp | util/csv2json.py | 1 | 4170 | '''Convert CSV files into JSON files needed for the visualizer page.'''
import argparse
import json
import os
import functools
from util.readers.addarash1 import AddarashReader
from util.readers.bulbapedia import BulbapediaReader
from util.readers.chfoo import ChfooReader
from util.readers.editornotes import EditorNote... | mit |
vpelletier/neoppod | neo/lib/event.py | 1 | 9556 | #
# Copyright (C) 2006-2016 Nexedi SA
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed... | gpl-2.0 |
cntnboys/410Lab6 | build/django/tests/comment_tests/tests/__init__.py | 13 | 2811 | from django.contrib.auth.models import User
from django.contrib.comments.forms import CommentForm
from django.contrib.comments.models import Comment
from django.contrib.contenttypes.models import ContentType
from django.contrib.sites.models import Site
from django.test import TestCase, override_settings
from ..models ... | apache-2.0 |
jythontools/pip | pip/_vendor/requests/packages/chardet/constants.py | 3008 | 1335 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2001
# the Initial Developer. All R... | mit |
ultcoin/UltimateCoin | share/qt/make_spinner.py | 4415 | 1035 | #!/usr/bin/env python
# W.J. van der Laan, 2011
# Make spinning .mng animation from a .png
# Requires imagemagick 6.7+
from __future__ import division
from os import path
from PIL import Image
from subprocess import Popen
SRC='img/reload_scaled.png'
DST='../../src/qt/res/movies/update_spinner.mng'
TMPDIR='/tmp'
TMPNAM... | mit |
kpech21/Greek-Stemmer | tests/lemmatizers/test_verb.py | 1 | 1883 | # -*- coding: utf-8 -*-
import pytest
from greek_stemmer.lemmatizers.verb import stem
class TestVerbStem:
# rule-set 1: check irregular verbs
verb_stem_ruleset1 = [
('', 'VB', ''),
('ΕΙΜΑΙ', 'VB', 'ΕΙ'),
('ΕΙΜΑΣΤΕ', 'VBS', 'ΕΙ'),
('ΠΩ', 'VB', 'Π'),
('ΖΕΙΤΕ', 'VBS', '... | lgpl-3.0 |
ecrc/girih | scripts/test_pochoir_increasing_grid_size.py | 2 | 4325 | #!/usr/bin/env python
def run_pochoir_test(dry_run, th, kernel, nx, ny, nz, nt, target_dir, outfile, pinning_cmd, pinning_args):
import os
import subprocess
from string import Template
from scripts.utils import ensure_dir
job_template=Template(
"""$pinning_cmd $pinning_args $exec_path $nx $ny $nz $nt | t... | bsd-3-clause |
computersalat/ansible | test/lib/ansible_test/_internal/provider/source/git.py | 43 | 2654 | """Source provider for a content root managed by git version control."""
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
from ... import types as t
from ...git import (
Git,
)
from ...encoding import (
to_bytes,
)
from ...util import (
SubprocessError,
... | gpl-3.0 |
cython-testbed/pandas | pandas/tests/io/parser/test_textreader.py | 4 | 11387 | # -*- coding: utf-8 -*-
"""
Tests the TextReader class in parsers.pyx, which
is integral to the C engine in parsers.py
"""
import pytest
from pandas.compat import StringIO, BytesIO, map
from pandas import compat
import os
import sys
from numpy import nan
import numpy as np
from pandas import DataFrame
from pandas... | bsd-3-clause |
ghandiosm/Test | addons/account_budget/__openerp__.py | 27 | 2220 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': 'Budgets Management',
'version': '1.0',
'category': 'Accounting & Finance',
'description': """
This module allows accountants to manage analytic and crossovered budgets.
========================... | gpl-3.0 |
BigDataforYou/movie_recommendation_workshop_1 | big_data_4_you_demo_1/venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/langgreekmodel.py | 2763 | 12628 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights R... | mit |
doantranhoang/namebench | nb_third_party/jinja2/constants.py | 220 | 6229 | # -*- coding: utf-8 -*-
"""
jinja.constants
~~~~~~~~~~~~~~~
Various constants.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
#: list of lorem ipsum words used by the lipsum() helper function
LOREM_IPSUM_WORDS = u'''\
a ac accumsan ad adipiscing aenean a... | apache-2.0 |
tito/pymt | pymt/graphx/stencil.py | 2 | 3406 | '''
Stencil: use stencil for mask drawing
Usage ::
with gx_stencil:
# change viewport
# draw stuff
'''
__all__ = (
# stencil
'GlStencil', 'gx_stencil',
'stencilPush', 'stencilPop', 'stencilUse',
)
from OpenGL.GL import GL_STENCIL_BUFFER_BIT, GL_STENCIL_TEST, \
GL_NEVER, GL_I... | lgpl-3.0 |
Eksmo/django-tastypie | tests/core/tests/throttle.py | 12 | 6446 | import mock
import time
from django.core.cache import cache
from django.test import TestCase
from django.utils.encoding import force_text
from tastypie.models import ApiAccess
from tastypie.throttle import BaseThrottle, CacheThrottle, CacheDBThrottle
class NoThrottleTestCase(TestCase):
def test_init(self):
... | bsd-3-clause |
3quarterstack/simple_blog | django/contrib/auth/tests/urls.py | 100 | 3405 | from django.conf.urls import patterns, url
from django.contrib.auth import context_processors
from django.contrib.auth.urls import urlpatterns
from django.contrib.auth.views import password_reset
from django.contrib.auth.decorators import login_required
from django.contrib.messages.api import info
from django.http impo... | mit |
nan86150/ImageFusion | lib/python2.7/site-packages/scipy/weave/examples/wx_example.py | 100 | 7328 | """ This is taken from the scrolled window example from the demo.
Take a look at the DoDrawing2() method below. The first 6 lines
or so have been translated into C++.
"""
from __future__ import absolute_import, print_function
import sys
sys.path.insert(0,'..')
import inline_tools
from wxPython.wx import *
... | mit |
AndKyr/GETELEC | python/JFplot.py | 1 | 1648 | #! /usr/bin/python
import numpy as np
import getelec_mod as gt
from mpl_toolkits.mplot3d import Axes3D
import matplotlib.pyplot as plt
import matplotlib as mb
font = 30
# mb.rcParams["font.family"] = "Serif"
mb.rcParams["font.size"] = font
mb.rcParams["axes.labelsize"] = font
mb.rcParams["xtick.labelsize"] = font
mb.... | gpl-3.0 |
ahmedaljazzar/edx-platform | common/djangoapps/microsite_configuration/models.py | 12 | 5888 | """
Model to store a microsite in the database.
The object is stored as a json representation of the python dict
that would have been used in the settings.
"""
import collections
from django.contrib.sites.models import Site
from django.db import models
from django.db.models.base import ObjectDoesNotExist
from django... | agpl-3.0 |
bauruine/ansible | lib/ansible/inventory/script.py | 16 | 5816 | # (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 |
goyal-sidd/BLT | website/models.py | 1 | 10857 | import os
from urlparse import urlparse
import requests
import tweepy
from PIL import Image
from annoying.fields import AutoOneToOneField
from colorthief import ColorThief
from django.conf import settings
from django.contrib.auth.models import User
from django.core.exceptions import ValidationError
from django.core.fi... | agpl-3.0 |
mark-r-g/hydrus | tests/test_rapidclus.py | 1 | 1819 | # Mark Gatheman <markrg@protonmail.com>
#
# This file is part of Hydrus.
#
# Hydrus is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
... | gpl-3.0 |
joergdietrich/astropy | astropy/utils/tests/test_console.py | 2 | 6316 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
# -*- coding: utf-8 -*-
# TEST_UNICODE_LITERALS
from __future__ import (absolute_import, division, print_function,
unicode_literals)
from ...extern import six # pylint: disable=W0611
from ...extern.six import next
from ...extern... | bsd-3-clause |
DooMLoRD/android_kernel_sony_msm8660 | scripts/build-all.py | 1250 | 9474 | #! /usr/bin/env python
# Copyright (c) 2009-2011, Code Aurora Forum. 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
# n... | gpl-2.0 |
googleapis/googleapis-gen | google/cloud/secrets/v1beta1/secretmanager-v1beta1-py/google/cloud/secretmanager/__init__.py | 1 | 3026 | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | apache-2.0 |
michalliu/OpenWrt-Firefly-Libraries | staging_dir/target-mipsel_1004kc+dsp_uClibc-0.9.33.2/usr/lib/python3.4/idlelib/ZoomHeight.py | 130 | 1300 | # Sample extension: zoom a window to maximum height
import re
import sys
from idlelib import macosxSupport
class ZoomHeight:
menudefs = [
('windows', [
('_Zoom Height', '<<zoom-height>>'),
])
]
def __init__(self, editwin):
self.editwin = editwin
def zoom_height... | gpl-2.0 |
nimzco/Environment | Sublime/Packages/ArcticTypescript/lib/system/Completion.py | 2 | 10326 | # coding=utf8
import re
import json
import sublime
from ..utils import Debug
from ..utils.uiutils import get_prefix
from ..utils.viewutils import get_file_infos, get_content_of_line_at
# IS AN OBJECT MEMBER
# TRUE: line=Instance. or line=Instance.fooba or line=Instance.foobar.alic
# FALSE: line=Inst
js_id_re = re.c... | mit |
jhayworth/config | .emacs.d/elpy/rpc-venv/local/lib/python2.7/site-packages/pip/_internal/distributions/sdist.py | 20 | 4086 | import logging
from pip._internal.build_env import BuildEnvironment
from pip._internal.distributions.base import AbstractDistribution
from pip._internal.exceptions import InstallationError
from pip._internal.utils.subprocess import runner_with_spinner_message
from pip._internal.utils.typing import MYPY_CHECK_RUNNING
... | gpl-3.0 |
tempbottle/kbengine | kbe/res/scripts/common/Lib/distutils/tests/test_util.py | 94 | 11250 | """Tests for distutils.util."""
import os
import sys
import unittest
from copy import copy
from test.support import run_unittest
from distutils.errors import DistutilsPlatformError, DistutilsByteCompileError
from distutils.util import (get_platform, convert_path, change_root,
check_environ,... | lgpl-3.0 |
labase/surdonews | src/surdonews/leao/main.py | 1 | 5477 | from jqueryui import jq
from browser import document, html
from superpython.virgem.main import Sala, Labirinto, Cena, INVENTARIO # importando do virgem
STYLE = dict(position="absolute", width=300, left=0, top=0, background="blue") # mudar cor do background lá embaixo
STYLE["min-height"] = "300px"
IMAGEM = "http://s1... | gpl-3.0 |
henryr/Impala | tests/benchmark/plugins/vtune_plugin.py | 12 | 5735 | #!/usr/bin/env python
# Copyright (c) 2013 Cloudera, Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... | apache-2.0 |
ipashchenko/emcee-x | document/plots/oned.py | 16 | 2164 | import os
import sys
import time
import numpy as np
import matplotlib.pyplot as pl
import h5py
from multiprocessing import Pool
sys.path.append(os.path.abspath(os.path.join(__file__, "..", "..", "..")))
import emcee
# import acor
def lnprobfn(p, icov):
return -0.5 * np.dot(p, np.dot(icov, p))
def random_cov... | mit |
superchilli/webapp | venv/lib/python2.7/site-packages/wheel/test/test_basic.py | 472 | 6405 | """
Basic wheel tests.
"""
import os
import pkg_resources
import json
import sys
from pkg_resources import resource_filename
import wheel.util
import wheel.tool
from wheel import egg2wheel
from wheel.install import WheelFile
from zipfile import ZipFile
from shutil import rmtree
test_distributions = ("complex-dist"... | mit |
mikebranstein/mvc-quickstart-instructions | node_modules/gulp-sass/node_modules/node-sass/node_modules/node-gyp/gyp/pylib/gyp/MSVSUserFile.py | 2710 | 5094 | # 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.
"""Visual Studio user preferences file writer."""
import os
import re
import socket # for gethostname
import gyp.common
import gyp.easy_xml as easy_xml
#------... | mit |
entomb/CouchPotatoServer | couchpotato/core/settings/__init__.py | 5 | 7480 | from __future__ import with_statement
import traceback
from couchpotato.api import addApiView
from couchpotato.core.event import addEvent, fireEvent
from couchpotato.core.helpers.encoding import toUnicode
from couchpotato.core.helpers.variable import mergeDicts, tryInt, tryFloat
from couchpotato.core.settings.model imp... | gpl-3.0 |
chouseknecht/ansible | lib/ansible/modules/cloud/univention/udm_user.py | 37 | 18102 | #!/usr/bin/python
# -*- coding: UTF-8 -*-
# Copyright: (c) 2016, Adfinis SyGroup AG
# Tobias Rueetschi <tobias.ruetschi@adfinis-sygroup.ch>
# 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... | gpl-3.0 |
cubieboard/openbox_external_chromium | testing/gtest/test/gtest_xml_test_utils.py | 398 | 8029 | #!/usr/bin/env python
#
# Copyright 2006, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list... | bsd-3-clause |
JizhouZhang/SDR | gr-filter/python/filter/design/api_object.py | 45 | 2638 | # Copyright 2012 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
#
# G... | gpl-3.0 |
levilucio/SyVOLT | GM2AUTOSAR_MM/transformation/HMapPartition.py | 1 | 3685 | from core.himesis import Himesis
import uuid
class HMapPartition(Himesis):
def __init__(self):
"""
Creates the himesis graph representing the DSLTrans rule MapPartition.
"""
# Flag this instance as compiled now
self.is_compiled = True
super(HMapPa... | mit |
aselle/tensorflow | tensorflow/python/keras/layers/wrappers.py | 3 | 24939 | # 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 |
Teamxrtc/webrtc-streaming-node | third_party/depot_tools/external_bin/gsutil/gsutil_4.15/gsutil/third_party/python-gflags/gflags.py | 448 | 104236 | #!/usr/bin/env python
#
# Copyright (c) 2002, 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 ... | mit |
plxaye/chromium | src/native_client_sdk/src/tools/run.py | 34 | 2917 | #!/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.
"""Launch a local server on an ephemeral port, then launch a executable that
points to that server.
"""
import copy
import getos
i... | apache-2.0 |
Weicong-Lin/pymo-global | android/pgs4a-0.9.6/python-install/lib/python2.7/test/test_ast.py | 13 | 16348 | import sys, itertools, unittest
from test import test_support
import ast
def to_tuple(t):
if t is None or isinstance(t, (basestring, int, long, complex)):
return t
elif isinstance(t, list):
return [to_tuple(e) for e in t]
result = [t.__class__.__name__]
if hasattr(t, 'lineno') and hasat... | mit |
hkhamm/django_rest_tutorial_2 | env/lib/python2.7/site-packages/django/contrib/formtools/wizard/storage/base.py | 216 | 3949 | from django.core.files.uploadedfile import UploadedFile
from django.utils.datastructures import MultiValueDict
from django.utils.functional import lazy_property
from django.utils import six
from django.contrib.formtools.wizard.storage.exceptions import NoFileStorageConfigured
class BaseStorage(object):
step_key ... | mit |
smasala/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/tool/steps/__init__.py | 122 | 3810 | # 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 |
jean/pybossa | pybossa/model/category.py | 4 | 1456 | # -*- coding: utf8 -*-
# This file is part of PyBossa.
#
# Copyright (C) 2013 SF Isle of Man Limited
#
# PyBossa is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at... | agpl-3.0 |
cindyyu/kuma | vendor/packages/translate/storage/versioncontrol/bzr.py | 26 | 4781 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2004-2008,2012 Zuza Software Foundation
#
# This file is part of translate.
#
# translate 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 vers... | mpl-2.0 |
devs1991/test_edx_docmode | common/djangoapps/auth_exchange/tests/utils.py | 30 | 3916 | """
Test utilities for OAuth access token exchange
"""
from social.apps.django_app.default.models import UserSocialAuth
from third_party_auth.tests.utils import ThirdPartyOAuthTestMixin
class AccessTokenExchangeTestMixin(ThirdPartyOAuthTestMixin):
"""
A mixin to define test cases for access token exchange. T... | agpl-3.0 |
ap3h3ad/roll20-character-sheets | Ars_Magica_5th/arm5_py_integration/__init__.py | 8 | 22058 | """Module for providing the parts in the template.html file"""
import csv
from pathlib import Path
import markdown
from bs4 import BeautifulSoup as soup
from .helpers import (
CHARACTERISTICS,
FORMS,
TECHNIQUES,
enumerate_helper,
repeat_template,
)
from .translations import translation_attrs, tran... | mit |
rohitwaghchaure/vestasi-frappe | frappe/widgets/form/assign_to.py | 17 | 4264 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
"""assign/unassign to ToDo"""
import frappe
from frappe import _
from frappe.utils import cint
from frappe.widgets.form.load import get_docinfo
def get(args=None):
"""get as... | mit |
benpetty/Code-Katas | katas/sort_cards/sort_cards.py | 1 | 1347 | """Sort Cards.
https://www.codewars.com/kata/56f399b59821793533000683
Write a function sort_cards() that sorts a shuffled list of cards,
so that any given list of cards is sorted by rank,
no matter the starting collection.
All cards in the list are represented as strings,
so that sorted list of cards looks like this... | mit |
sivaramakrishnansr/ryu | ryu/contrib/tinyrpc/protocols/jsonrpc.py | 41 | 8589 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from .. import RPCBatchProtocol, RPCRequest, RPCResponse, RPCErrorResponse,\
InvalidRequestError, MethodNotFoundError, ServerError,\
InvalidReplyError, RPCError, RPCBatchRequest, RPCBatchResponse
import json
class FixedErrorMessageMixin(obje... | apache-2.0 |
mfazliazran/raft | thirdparty/pdfminer/pdfminer/runlength.py | 67 | 1666 | #!/usr/bin/env python2
#
# RunLength decoder (Adobe version) implementation based on PDF Reference
# version 1.4 section 3.3.4.
#
# * public domain *
#
import sys
def rldecode(data):
"""
RunLength decoder (Adobe version) implementation based on PDF Reference
version 1.4 section 3.3.4:
The RunLeng... | gpl-3.0 |
spcui/avocado-vt | virttest/libvirt_xml/devices/watchdog.py | 21 | 1026 | """
watchdog device support class(es)
http://libvirt.org/formatdomain.html#elementsWatchdog
"""
from virttest.libvirt_xml import accessors
from virttest.libvirt_xml.devices import base
class Watchdog(base.UntypedDeviceBase):
__slots__ = ('model_type', 'action', 'address')
def __init__(self, virsh_instance... | gpl-2.0 |
ns950/calibre | src/calibre/gui2/convert/look_and_feel.py | 13 | 5251 | #!/usr/bin/env python2
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
from __future__ import with_statement
__license__ = 'GPL v3'
__copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
from PyQt5.Qt import Qt
from calibre.gui2.convert.look_and_feel_ui import Ui_Form
f... | gpl-3.0 |
kcpawan/django | tests/auth_tests/models/custom_permissions.py | 295 | 1433 | """
The CustomPermissionsUser users email as the identifier, but uses the normal
Django permissions model. This allows us to check that the PermissionsMixin
includes everything that is needed to interact with the ModelBackend.
"""
from django.contrib.auth.models import AbstractBaseUser, PermissionsMixin
from django.con... | bsd-3-clause |
axbaretto/beam | sdks/python/.tox/lint/lib/python2.7/site-packages/nose/twistedtools.py | 86 | 5525 | """
Twisted integration
-------------------
This module provides a very simple way to integrate your tests with the
Twisted_ event loop.
You must import this module *before* importing anything from Twisted itself!
Example::
from nose.twistedtools import reactor, deferred
@deferred()
def test_resolve():
... | apache-2.0 |
lwiecek/django | django/test/html.py | 56 | 7943 | """
Comparing two html documents.
"""
from __future__ import unicode_literals
import re
from django.utils import six
from django.utils.encoding import force_text, python_2_unicode_compatible
from django.utils.html_parser import HTMLParseError, HTMLParser
WHITESPACE = re.compile('\s+')
def normalize_whitespace(str... | bsd-3-clause |
Jaemu/haiku.py | yaml/events.py | 985 | 2445 |
# Abstract classes.
class Event(object):
def __init__(self, start_mark=None, end_mark=None):
self.start_mark = start_mark
self.end_mark = end_mark
def __repr__(self):
attributes = [key for key in ['anchor', 'tag', 'implicit', 'value']
if hasattr(self, key)]
argu... | apache-2.0 |
NewpTone/stacklab-nova | nova/tests/compute/test_stats.py | 8 | 7803 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2012 OpenStack, LLC.
# 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... | apache-2.0 |
ytaben/cyphesis | rulesets/deeds/world/tasks/Drying.py | 3 | 2009 | #This file is distributed under the terms of the GNU General Public license.
#Copyright (C) 2011 Jekin Trivedi <jekintrivedi@gmail.com> (See the file COPYING for details).
from atlas import *
from physics import *
from physics import Quaternion
from physics import Vector3D
import server
class Drying(server.Task):
... | gpl-2.0 |
Gateworks/platform-external-chromium_org | tools/find_depot_tools.py | 74 | 1374 | # Copyright (c) 2011 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.
"""Small utility function to find depot_tools and add it to the python path.
Will throw an ImportError exception if depot_tools can't be found since it
i... | bsd-3-clause |
vmanoria/bluemix-hue-filebrowser | hue-3.8.1-bluemix/desktop/core/ext-py/Django-1.6.10/django/contrib/gis/gdal/error.py | 466 | 1517 | """
This module houses the OGR & SRS Exception objects, and the
check_err() routine which checks the status code returned by
OGR methods.
"""
#### OGR & SRS Exceptions ####
class GDALException(Exception): pass
class OGRException(Exception): pass
class SRSException(Exception): pass
class OGRIndexError(OGRException, K... | gpl-2.0 |
roadmapper/ansible | test/support/windows-integration/plugins/become/runas.py | 75 | 2457 | # -*- coding: utf-8 -*-
# Copyright: (c) 2018, 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 = """
become: runas
short_description: Run As user
... | gpl-3.0 |
lmprice/ansible | contrib/inventory/digital_ocean.py | 23 | 21119 | #!/usr/bin/env python
"""
DigitalOcean external inventory script
======================================
Generates Ansible inventory of DigitalOcean Droplets.
In addition to the --list and --host options used by Ansible, there are options
for generating JSON of other DigitalOcean data. This is useful when creating
d... | gpl-3.0 |
coderbone/SickRage | lib/hachoir_parser/misc/ole2.py | 74 | 14203 | """
Microsoft Office documents parser.
OLE2 files are also used by many other programs to store data.
Informations:
* wordole.c of AntiWord program (v0.35)
Copyright (C) 1998-2003 A.J. van Os
Released under GNU GPL
http://www.winfield.demon.nl/
* File gsf-infile-msole.c of libgsf library (v1.14.0)
Copyright (C... | gpl-3.0 |
torchingloom/edx-platform | common/djangoapps/external_auth/tests/test_openid_provider.py | 46 | 16144 | #-*- encoding=utf-8 -*-
'''
Created on Jan 18, 2013
@author: brian
'''
import openid
import json
from openid.fetchers import HTTPFetcher, HTTPResponse
from urlparse import parse_qs, urlparse
from django.conf import settings
from django.test import TestCase, LiveServerTestCase
from django.core.cache import cache
from ... | agpl-3.0 |
helenst/django | django/template/loaders/app_directories.py | 95 | 1560 | """
Wrapper for loading templates from "templates" directories in INSTALLED_APPS
packages.
"""
import io
from django.core.exceptions import SuspiciousFileOperation
from django.template.base import TemplateDoesNotExist
from django.template.utils import get_app_template_dirs
from django.utils._os import safe_join
from... | bsd-3-clause |
adlai/p2pool | wstools/XMLname.py | 291 | 2479 | """Translate strings to and from SOAP 1.2 XML name encoding
Implements rules for mapping application defined name to XML names
specified by the w3 SOAP working group for SOAP version 1.2 in
Appendix A of "SOAP Version 1.2 Part 2: Adjuncts", W3C Working Draft
17, December 2001, <http://www.w3.org/TR/soap12-part2/#namem... | gpl-3.0 |
jjdmol/LOFAR | CEP/Pipeline/recipes/sip/nodes/setupparmdb.py | 2 | 1516 | # LOFAR IMAGING PIPELINE
#
# setupparmdb nodes recipe
# Marcel Loose, 2012
# loose@astr... | gpl-3.0 |
mixja/eap-sim-lab | lib/pyscard-1.6.16/build/lib.macosx-10.10-x86_64-2.7/smartcard/pcsc/PCSCContext.py | 3 | 1857 | """PCSC context singleton.
__author__ = "http://www.gemalto.com"
Copyright 2001-2012 gemalto
Author: Jean-Daniel Aussel, mailto:jean-daniel.aussel@gemalto.com
This file is part of pyscard.
pyscard is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as ... | mit |
GGoussar/scikit-image | doc/examples/segmentation/plot_marked_watershed.py | 9 | 1988 | """
===============================
Markers for watershed transform
===============================
The watershed is a classical algorithm used for **segmentation**, that
is, for separating different objects in an image.
Here a marker image is built from the region of low gradient inside the image.
In a gradient imag... | bsd-3-clause |
pjdelport/pip | pip/_vendor/requests/packages/chardet/sbcharsetprober.py | 2927 | 4793 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2001
# the Initial Developer. All R... | mit |
chugunovyar/factoryForBuild | env/lib/python2.7/site-packages/tornado/tcpclient.py | 208 | 6802 | #!/usr/bin/env python
#
# Copyright 2014 Facebook
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | gpl-3.0 |
karlnapf/kameleon-mcmc | kameleon_mcmc/tools/Visualise.py | 1 | 5656 | """
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.
Written (W) 2013 Heiko Strathmann
Written (W) 2013 Dino Sejdinovic
"""
fro... | bsd-2-clause |
cyberphox/MissionPlanner | Lib/site-packages/numpy/distutils/command/build.py | 99 | 1255 | import os
import sys
from distutils.command.build import build as old_build
from distutils.util import get_platform
from numpy.distutils.command.config_compiler import show_fortran_compilers
class build(old_build):
sub_commands = [('config_cc', lambda *args: True),
('config_fc', lambda... | gpl-3.0 |
santisiri/popego | envs/ALPHA-POPEGO/lib/python2.5/site-packages/numpy-1.0.4-py2.5-linux-x86_64.egg/numpy/add_newdocs.py | 1 | 44163 | from lib import add_newdoc
add_newdoc('numpy.core','dtype',
[('fields', "Fields of the data-type or None if no fields"),
('names', "Names of fields or None if no fields"),
('alignment', "Needed alignment for this data-type"),
('byteorder',
"Little-endian (<),... | bsd-3-clause |
jmesteve/openerpseda | openerp/addons/process/process.py | 50 | 16137 | # -*- 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 |
gunan/tensorflow | tensorflow/python/ops/resources.py | 36 | 4444 | # 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 |
hyperized/ansible | lib/ansible/modules/network/fortios/fortios_system_password_policy.py | 13 | 12578 | #!/usr/bin/python
from __future__ import (absolute_import, division, print_function)
# Copyright 2019 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 |
supertuxkart/stk-stats | userreport/models.py | 2 | 9803 | # This file is mainly for detecting the graphics used and storing these
# information in string that are later used for the report
import json
import re
import logging
from django.db import models
LOG = logging.getLogger(__name__)
class UserReport(models.Model):
uploader = models.GenericIPAddressField(editable... | mit |
jamielennox/keystoneauth | keystoneauth1/session.py | 3 | 30502 | # 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 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.