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 |
|---|---|---|---|---|---|
SAM-IT-SA/odoo | openerp/addons/base/tests/test_translate.py | 460 | 1941 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2010 OpenERP S.A. http://www.openerp.com
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GN... | agpl-3.0 |
sylvchev/PyRiemannEigen | Benchmark/TangentSpace/Tangent.py | 3 | 1304 | import os
import sys
import timeit
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "..")))
from Utils.CovMat import CovMat
from Utils.CovMats import CovMats
size = [10, 25, 50, 75, 100, 250, 500, 750, 1000]
# WARMUP
print("Warm up...")
for i in range(0, 10):
warm_up_covmat = CovMat... | gpl-3.0 |
repotvsupertuga/tvsupertuga.repository | instal/plugin.video.SportsDevil/lib/downloader.py | 25 | 2296 | # -*- coding: utf-8 -*-
import common
import urllib
import os.path
import xbmc, xbmcgui
class Downloader(object):
def __init__(self):
self.pDialog = None
def downloadWithJDownloader(self, url, title):
common.runPlugin('plugin://plugin.program.jdownloader/?action=addlink&url=' + url)
... | gpl-2.0 |
lemonjia/Bravado | pycchecker/pycparser/_ast_gen.py | 5 | 8427 | #-----------------------------------------------------------------
# _ast_gen.py
#
# Generates the AST Node classes from a specification given in
# a configuration file
#
# The design of this module was inspired by astgen.py from the
# Python 2.5 code-base.
#
# Copyright (C) 2008-2013, Eli Bendersky
# License: BSD
#---... | apache-2.0 |
jholkeboer/tau-graphical-crawler | lib/werkzeug/contrib/fixers.py | 259 | 10183 | # -*- coding: utf-8 -*-
"""
werkzeug.contrib.fixers
~~~~~~~~~~~~~~~~~~~~~~~
.. versionadded:: 0.5
This module includes various helpers that fix bugs in web servers. They may
be necessary for some versions of a buggy web server but not others. We try
to stay updated with the status of the bug... | apache-2.0 |
kracwarlock/Lasagne | lasagne/objectives.py | 9 | 9540 | """
Provides some minimal help with building loss expressions for training or
validating a neural network.
Three functions build element- or item-wise loss expressions from network
predictions and targets:
.. autosummary::
:nosignatures:
binary_crossentropy
categorical_crossentropy
squared_error
A c... | mit |
semplea/characters-meta | python/alchemy/examples/watson_developer_cloud/language_translation_v2.py | 2 | 3350 | # Copyright 2015 IBM 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 agreed t... | mit |
jn7163/django | django/contrib/gis/utils/wkt.py | 589 | 1923 | """
Utilities for manipulating Geometry WKT.
"""
from django.utils import six
def precision_wkt(geom, prec):
"""
Returns WKT text of the geometry according to the given precision (an
integer or a string). If the precision is an integer, then the decimal
places of coordinates WKT will be truncated t... | bsd-3-clause |
jatinmistry13/pattern | pattern/text/de/inflect.py | 21 | 29115 | #### PATTERN | DE | INFLECT ########################################################################
# -*- coding: utf-8 -*-
# Copyright (c) 2012 University of Antwerp, Belgium
# Author: Tom De Smedt <tom@organisms.be>
# License: BSD (see LICENSE.txt for details).
######################################################... | bsd-3-clause |
Conflei/ATI | [ATI] Misfenterest/Frontend/env/lib/python2.6/site-packages/setuptools/archive_util.py | 520 | 6609 | """Utilities for extracting common archive formats"""
__all__ = [
"unpack_archive", "unpack_zipfile", "unpack_tarfile", "default_filter",
"UnrecognizedFormat", "extraction_drivers", "unpack_directory",
]
import zipfile
import tarfile
import os
import shutil
import posixpath
import contextlib
from pkg_resourc... | mit |
faynwol/gfw_whitelist | list_black.py | 7 | 4090 | #!/usr/bin/python
# -*- coding: utf-8 -*-
import urlparse
import logging
import copy
from blacklist import ban
from blacklist import builtin
from blacklist import custom
from blacklist import tld
__all__ = ['main']
def decode_gfwlist(content):
# decode base64 if have to
try:
if '.' in content:
raise
return ... | mit |
chjw8016/GreenOdoo7-haibao | openerp/addons/event_moodle/event_moodle.py | 50 | 13316 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2012 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | mit |
fusionpig/ansible | lib/ansible/executor/task_executor.py | 1 | 22726 | # (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 |
MayOneUS/pledgeservice | testlib/setuptools/extension.py | 165 | 1731 | import sys
import re
import functools
import distutils.core
import distutils.extension
from setuptools.dist import _get_unpatched
_Extension = _get_unpatched(distutils.core.Extension)
def have_pyrex():
"""
Return True if Cython or Pyrex can be imported.
"""
pyrex_impls = 'Cython.Distutils.build_ext',... | apache-2.0 |
Godiyos/python-for-android | python3-alpha/python3-src/Lib/wsgiref/util.py | 55 | 5595 | """Miscellaneous WSGI-related Utilities"""
import posixpath
__all__ = [
'FileWrapper', 'guess_scheme', 'application_uri', 'request_uri',
'shift_path_info', 'setup_testing_defaults',
]
class FileWrapper:
"""Wrapper to convert file-like objects to iterables"""
def __init__(self, filelike, blksize=819... | apache-2.0 |
sgraham/nope | chrome/common/extensions/docs/server2/url_constants.py | 41 | 1163 | # 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.
GITILES_BASE = 'https://chromium.googlesource.com'
GITILES_SRC_ROOT = 'chromium/src/+'
GITILES_BRANCHES_PATH = 'refs/branch-heads'
GITILES_OAUTH2_SCOPE =... | bsd-3-clause |
mano3m/CouchPotatoServer | couchpotato/core/plugins/subtitle/main.py | 3 | 2705 | from couchpotato import get_session
from couchpotato.core.event import addEvent, fireEvent
from couchpotato.core.helpers.encoding import toUnicode
from couchpotato.core.helpers.variable import splitString
from couchpotato.core.logger import CPLog
from couchpotato.core.plugins.base import Plugin
from couchpotato.core.se... | gpl-3.0 |
danielward/health-tracker | tracker/tracker/settings.py | 1 | 2699 | """
Django settings for tracker project.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.7/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
im... | gpl-2.0 |
ryansturmer/cuttlebug | cuttlebug/settings.py | 1 | 7027 | import wx
import util
from ui.options import *
import os, pickle
from lxml import etree
session = {}
FALSE = 0
TRUE = 1
PROMPT = 2
def load_session(filename='.session'):
global session
try:
session = util.unpickle_file(filename)
except Exception, e:
print "Couldn't load ses... | mit |
xavfernandez/pip | tests/functional/test_install.py | 1 | 64161 | import distutils
import glob
import os
import re
import shutil
import ssl
import sys
import textwrap
from os.path import curdir, join, pardir
import pytest
from pip._internal.cli.status_codes import ERROR, SUCCESS
from pip._internal.models.index import PyPI, TestPyPI
from pip._internal.utils.misc import rmtree
from t... | mit |
kurtrwall/wagtail | wagtail/wagtailcore/permission_policies/base.py | 7 | 16143 | from __future__ import absolute_import, unicode_literals
from django.contrib.auth import get_user_model
from django.contrib.auth.models import Permission
from django.contrib.contenttypes.models import ContentType
from django.core.exceptions import FieldDoesNotExist, ImproperlyConfigured
from django.db.models import Q
... | bsd-3-clause |
popazerty/SDG-e2 | lib/python/Components/FanControl.py | 61 | 3723 | import os
from Components.config import config, ConfigSubList, ConfigSubsection, ConfigSlider
from Tools.BoundFunction import boundFunction
import NavigationInstance
from enigma import iRecordableService
class FanControl:
# ATM there's only support for one fan
def __init__(self):
if os.path.exists("/proc/stb/fp/... | gpl-2.0 |
abelg/virtual_io_acceleration | tools/perf/util/setup.py | 220 | 1407 | #!/usr/bin/python2
from distutils.core import setup, Extension
from os import getenv
from distutils.command.build_ext import build_ext as _build_ext
from distutils.command.install_lib import install_lib as _install_lib
class build_ext(_build_ext):
def finalize_options(self):
_build_ext.finalize_optio... | gpl-2.0 |
oracleyue/rubber-for-latex | src/converters/latex.py | 1 | 39183 | # This file is part of Rubber and thus covered by the GPL
# (c) Emmanuel Beffara, 2002--2006
# (c) Sebastian Kapfer 2015
# vim: noet:ts=4
"""
LaTeX document building system for Rubber.
This module contains all the code in Rubber that actually does the job of
building a LaTeX document from start to finish.
"""
import ... | gpl-2.0 |
VinceZK/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/common/net/bugzilla/bugzilla_mock.py | 122 | 14927 | # Copyright (C) 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... | bsd-3-clause |
tillahoffmann/tensorflow | tensorflow/python/ops/tensor_array_grad.py | 71 | 9083 | # 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 |
norayr/unisubs | libs/markdown/extensions/html_tidy.py | 123 | 2093 | #!/usr/bin/env python
"""
HTML Tidy Extension for Python-Markdown
=======================================
Runs [HTML Tidy][] on the output of Python-Markdown using the [uTidylib][]
Python wrapper. Both libtidy and uTidylib must be installed on your system.
Note than any Tidy [options][] can be passed in as extensio... | agpl-3.0 |
pratikmallya/hue | desktop/core/ext-py/Mako-0.8.1/mako/lookup.py | 38 | 13054 | # mako/lookup.py
# Copyright (C) 2006-2012 the Mako authors and contributors <see AUTHORS file>
#
# This module is part of Mako and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
import os, stat, posixpath, re
from mako import exceptions, util
from mako.template import Template... | apache-2.0 |
hernandito/SickRage | lib/sqlalchemy/testing/plugin/plugin_base.py | 76 | 14817 | # plugin/plugin_base.py
# Copyright (C) 2005-2014 the SQLAlchemy authors and contributors <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""Testing extensions.
this module is designed to work as a testing-framework-a... | gpl-3.0 |
CydarLtd/ansible | lib/ansible/modules/database/misc/riak.py | 70 | 8254 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, James Martin <jmartin@basho.com>, Drew Kerrigan <dkerrigan@basho.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 Fou... | gpl-3.0 |
arpitparmar5739/youtube-dl | youtube_dl/extractor/fourtube.py | 65 | 3914 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import (
compat_urllib_request,
)
from ..utils import (
parse_duration,
parse_iso8601,
str_to_int,
)
class FourTubeIE(InfoExtractor):
IE_NAME = '4tube'
_VALID_URL = r'https?://(?:www\.)?4tube\.c... | unlicense |
felliott/waterbutler | tests/auth/osf/test_handler.py | 2 | 8673 | from unittest import mock
import pytest
import tornado
from tests import utils
from tests.server.api.v1.utils import ServerTestCase
from waterbutler.auth.osf import settings
from waterbutler.core.auth import AuthType
from waterbutler.auth.osf.handler import OsfAuthHandler
from waterbutler.core.exceptions import (Uns... | apache-2.0 |
sommergis/gblog | arcgis/restSample.py | 1 | 2014 | # -*- coding: latin-1 -*-
# Liest die LayerIDs und die Namen eines ArcGIS REST Services
# und gibt diese aus.
# Johannes Sommer, 12.01.2011
try:
import simplejson as json
except ImportError:
print 'Benoetigtes Python-Modul fuer das Skript ist:\n'+\
' - Simplejson\n'
# Standard Python Module
import ... | gpl-3.0 |
pgandhi999/spark | examples/src/main/python/mllib/fpgrowth_example.py | 158 | 1280 | #
# 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 |
courtarro/gnuradio | docs/doxygen/doxyxml/base.py | 333 | 6794 | #
# Copyright 2010 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.
#
#... | gpl-3.0 |
Mirantis/tempest | tempest/api/data_processing/test_data_sources.py | 2 | 5748 | # Copyright (c) 2014 Mirantis Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | apache-2.0 |
vitan/hue | desktop/core/ext-py/Django-1.6.10/tests/context_processors/tests.py | 63 | 1328 | """
Tests for Django's bundled context processors.
"""
from django.test import TestCase
class RequestContextProcessorTests(TestCase):
"""
Tests for the ``django.core.context_processors.request`` processor.
"""
urls = 'context_processors.urls'
def test_request_attributes(self):
"""
... | apache-2.0 |
felixfontein/ansible | test/lib/ansible_test/_data/sanity/validate-modules/validate_modules/module_args.py | 29 | 6251 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2016 Matt Martz <matt@sivel.net>
# Copyright (C) 2016 Rackspace US, 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 ... | gpl-3.0 |
HGeerlings/eratosthenes | neigh/alt/traverse.py | 2 | 3052 | """
Exploring the use of plot.ly for visualizing correctness of a naive nearest-neighbor algorithm.
"""
from numpy.linalg import norm
import numpy as np
import operator
import random
import time
import plotly.plotly as py
import plotly.tools as tls
from plotly.graph_objs import *
from neigh_perf import get_tsne_mapp... | bsd-2-clause |
gmacchi93/serverInfoParaguay | apps/venv/lib/python2.7/site-packages/django/contrib/gis/utils/srs.py | 450 | 3123 | from django.contrib.gis.gdal import SpatialReference
from django.db import DEFAULT_DB_ALIAS, connections
def add_srs_entry(srs, auth_name='EPSG', auth_srid=None, ref_sys_name=None,
database=None):
"""
This function takes a GDAL SpatialReference system and adds its information
to the `spa... | apache-2.0 |
stonegithubs/odoo | addons/account_voucher/__init__.py | 358 | 1098 | # -*- 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 |
beast-2e/vlla | VideoDisplay_24bit/tests/high_frame_rate_24bit.py | 1 | 1090 | # Usage:
# python high_frame_rate_8bit.py > /dev/ttyACM1
import time
import random
fpscolor = [
[255, 250, 0],
[255, 150, 0],
[255, 0, 150],
[150, 0, 255]
]
while True:
for f, fps in enumerate([30, 60, 120, 240]):
for i in range(3*fps):
print bytearray([255]+map(lambda x: (fpsc... | mit |
wriggityWrecked/WebScraping | slackReceiver.py | 1 | 6847 | from slackclient import SlackClient
from datetime import timedelta
from subprocess import *
from websocket import *
import os
import datetime
import logging
import logging.handlers
import time
import traceback
import sys
import threading
from utils import robotTextResponses
#todo import from tools
tokenFilePat... | apache-2.0 |
seanballais/SAElections | node_modules/grunt-sass/node_modules/node-sass/node_modules/pangyp/gyp/pylib/gyp/generator/ninja.py | 372 | 89149 | # Copyright (c) 2013 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import copy
import hashlib
import json
import multiprocessing
import os.path
import re
import signal
import subprocess
import sys
import gyp
import gyp.common
impo... | mit |
giggsey/SickRage | lib/unidecode/x0ae.py | 253 | 4875 | data = (
'geul', # 0x00
'geulg', # 0x01
'geulm', # 0x02
'geulb', # 0x03
'geuls', # 0x04
'geult', # 0x05
'geulp', # 0x06
'geulh', # 0x07
'geum', # 0x08
'geub', # 0x09
'geubs', # 0x0a
'geus', # 0x0b
'geuss', # 0x0c
'geung', # 0x0d
'geuj', # 0x0e
'geuc', # 0x0f
'geuk', # ... | gpl-3.0 |
gri-is/lodjob | OLD_REPOSITORY/utils/price_parsing.py | 1 | 2241 | from .data_templates import make_paid_amount_parsed, make_paid_amount_unparsed
currency_divisors = {
'dollars': [100],
'florins': [100],
'francs': [100],
'marks': [100],
'pounds': [20, 12]
}
def make_decimalizer(divisor_2=1, divisor_3=1):
def decimalize(primary=0, secondary=0, tertiary=0):
... | agpl-3.0 |
wangscript/libjingle-1 | trunk/third_party/webrtc/build/generate_asm_header.py | 9 | 2819 | #!/usr/bin/env python
#
# Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
#
# Use of this source code is governed by a BSD-style license
# that can be found in the LICENSE file in the root of the source
# tree. An additional intellectual property rights grant can be found
# in the file PATENTS. All... | bsd-3-clause |
MarcosCommunity/odoo | openerp/addons/base/tests/test_misc.py | 393 | 1111 | import unittest2
from openerp.tools import misc
class test_countingstream(unittest2.TestCase):
def test_empty_stream(self):
s = misc.CountingStream(iter([]))
self.assertEqual(s.index, -1)
self.assertIsNone(next(s, None))
self.assertEqual(s.index, 0)
def test_single(self):
... | agpl-3.0 |
punchagan/statiki | tests/test_integration.py | 1 | 6132 | # -*- coding: utf-8 -*-
# Copyright © 2014 Puneeth Chaganti and others.
# See the LICENSE file for license rights and limitations (MIT).
""" Integration tests for statiki. """
import os
from os.path import exists, join
import shlex
import shutil
import subprocess
import tempfile
import unittest
from pkg_resources i... | mit |
kubeflow/kfserving | python/kfserving/test/test_v1alpha2_inference_service_spec.py | 1 | 1526 | # Copyright 2020 kubeflow.org.
#
# 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,... | apache-2.0 |
colloquium/spacewalk | client/rhel/yum-rhn-plugin/rhnplugin.py | 1 | 23715 | """
Yum plugin for RHN access.
This plugin provides access to Red Hat Network to yum via up2date modules
and XMLRPC calls.
"""
import os
import sys
import urllib
from yum.plugins import TYPE_CORE
from yum.yumRepo import YumRepository
import yum.Errors
from urlgrabber.grabber import URLGrabber
from urlgrabber.grabb... | gpl-2.0 |
bollu/vispy | vispy/scene/cameras/turntable.py | 20 | 5029 | # -*- coding: utf-8 -*-
# Copyright (c) 2015, Vispy Development Team.
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
from __future__ import division
import numpy as np
from .perspective import Base3DRotationCamera
class TurntableCamera(Base3DRotationCamera):
""" 3D camera class that ... | bsd-3-clause |
YongseopKim/crosswalk-test-suite | wrt/tct-sp01-wrt-tests/inst.xpk.py | 30 | 6769 | #!/usr/bin/env python
import os
import shutil
import glob
import time
import sys
import subprocess
import string
from optparse import OptionParser, make_option
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
PKG_NAME = os.path.basename(SCRIPT_DIR)
PARAMETERS = None
#XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=... | bsd-3-clause |
akshara775/PerfKitBenchmarker-master-2 | tests/virtual_machine_test.py | 1 | 3034 | # Copyright 2015 PerfKitBenchmarker 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 appli... | apache-2.0 |
takeshineshiro/cinder | cinder/keymgr/key_mgr.py | 27 | 4244 | # Copyright (c) 2013 The Johns Hopkins University/Applied Physics Laboratory
# 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/... | apache-2.0 |
40123142/2015cd_midterm2 | static/Brython3.1.1-20150328-091302/Lib/site-packages/pygame/SDL.py | 603 | 1813 | from browser import document
SDL_INIT_VIDEO=0
SDL_GL_DOUBLEBUFFER=1
SDL_GL_DEPTH_SIZE=2
SDL_DOUBLEBUF=3
SDL_ANYFORMAT=4
SDL_ACTIVEEVENT=5
SDL_ALLEVENTS=5
SDL_KEYDOWN=6
SDL_KEYUP=7
SDL_MOUSEMOTION=8
SDL_MOUSEBUTTONDOWN=9
SDL_MOUSEBUTTONUP=10
SDL_JOYAXISMOTION=11
SDL_JOYBALLMOTION=12
SDL_JOYHATMOTION=13
SDL_JOYBUTTON... | gpl-2.0 |
benjystanton/F2D-Prototype | node_modules/node-sass/node_modules/pangyp/gyp/pylib/gyp/easy_xml_test.py | 2698 | 3270 | #!/usr/bin/env python
# Copyright (c) 2011 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.
""" Unit tests for the easy_xml.py file. """
import gyp.easy_xml as easy_xml
import unittest
import StringIO
class TestSequenceFunctions(... | mit |
trudikampfschaf/flask-microblog | flask/lib/python2.7/site-packages/openid/dh.py | 168 | 1608 | from openid import cryptutil
from openid import oidutil
def strxor(x, y):
if len(x) != len(y):
raise ValueError('Inputs to strxor must have the same length')
xor = lambda (a, b): chr(ord(a) ^ ord(b))
return "".join(map(xor, zip(x, y)))
class DiffieHellman(object):
DEFAULT_MOD = 15517289818147... | bsd-3-clause |
randynobx/ansible | test/units/modules/network/vyos/test_vyos_command.py | 62 | 4089 | # (c) 2016 Red Hat Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is dis... | gpl-3.0 |
mkuron/espresso | src/python/espressomd/virtual_sites.py | 1 | 2520 | # Copyright (C) 2010-2018 The ESPResSo project
#
# This file is part of ESPResSo.
#
# ESPResSo 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 v... | gpl-3.0 |
Mayurji/Machine-Learning | Email Classification Using ML/Email_Classifiers.py | 1 | 10287 | from sklearn.cross_validation import train_test_split
from sklearn.feature_extraction.text import TfidfVectorizer,TfidfTransformer
from sklearn.feature_extraction.text import CountVectorizer
import scipy as sp
import nltk.stem
from sklearn.model_selection import StratifiedShuffleSplit
from sklearn.model_selection impor... | gpl-3.0 |
nicky-ji/edx-nicky | common/djangoapps/xmodule_django/models.py | 24 | 6326 | from django.db import models
from django.core.exceptions import ValidationError
from opaque_keys.edx.locations import SlashSeparatedCourseKey, Location
from opaque_keys.edx.keys import CourseKey, UsageKey
from opaque_keys.edx.locator import Locator
from south.modelsinspector import add_introspection_rules
add_introspe... | agpl-3.0 |
Dineshs91/youtube-dl | youtube_dl/extractor/ringtv.py | 124 | 1970 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
class RingTVIE(InfoExtractor):
_VALID_URL = r'http://(?:www\.)?ringtv\.craveonline\.com/(?P<type>news|videos/video)/(?P<id>[^/?#]+)'
_TEST = {
"url": "http://ringtv.craveonline.com/news/310833-luis-collazo-says-victo... | unlicense |
KaranToor/MA450 | google-cloud-sdk/.install/.backup/lib/third_party/httplib2/__init__.py | 2 | 70781 | from __future__ import generators
"""
httplib2
A caching http interface that supports ETags and gzip
to conserve bandwidth.
Requires Python 2.3 or later
Changelog:
2007-08-18, Rick: Modified so it's able to use a socks proxy if needed.
"""
__author__ = "Joe Gregorio (joe@bitworking.org)"
__copyright__ = "Copyright... | apache-2.0 |
dreardon/crits | crits/certificates/views.py | 16 | 5343 | import json
from django.contrib.auth.decorators import user_passes_test
from django.core.urlresolvers import reverse
from django.http import HttpResponse, HttpResponseRedirect
from django.shortcuts import render_to_response
from django.template import RequestContext
from crits.core import form_consts
from crits.core.... | mit |
nuagenetworks/tempest | tempest/tests/common/test_admin_available.py | 3 | 4749 | # Copyright 2015 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agre... | apache-2.0 |
bjarniegill/Cordova-Survey | csv_parser/.env/lib/python2.7/site-packages/setuptools/command/upload.py | 248 | 1172 | import getpass
from distutils.command import upload as orig
class upload(orig.upload):
"""
Override default upload behavior to obtain password
in a variety of different ways.
"""
def finalize_options(self):
orig.upload.finalize_options(self)
self.username = (
self.user... | mit |
coderbone/SickRage | sickbeard/trakt.py | 3 | 5762 | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
# Author: Nic Wolfe <nic@wolfeden.ca>
# URL: https://sickrage.tv/
# Git: https://github.com/SiCKRAGETV/SickRage.git
#
# This file is part of SickRage.
#
# SickRage is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public Licens... | gpl-3.0 |
Jgarcia-IAS/localizacion | openerp/addons-extra/odoo-pruebas/odoo-server/addons/stock_account/stock.py | 13 | 13118 | # -*- 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 |
ThomasA/pywt | pywt/thresholding.py | 2 | 3453 | # -*- coding: utf-8 -*-
# Copyright (c) 2006-2012 Filip Wasilewski <http://en.ig.ma/>
# See COPYING for license details.
"""
The thresholding helper module implements the most popular signal thresholding
functions.
"""
from __future__ import division, print_function, absolute_import
__all__ = ['threshold']
import ... | mit |
larsbergstrom/servo | tests/wpt/web-platform-tests/xhr/resources/access-control-preflight-denied.py | 23 | 1608 | def main(request, response):
def fail(message):
response.content = "FAIL: " + str(message)
response.status = 400
def getState(token):
server_state = request.server.stash.take(token)
if not server_state:
return "Uninitialized"
return server_state
def setS... | mpl-2.0 |
lokirius/python-for-android | python3-alpha/python3-src/Tools/msi/uisample.py | 89 | 147976 |
import msilib,os;dirname=os.path.dirname(__file__)
AdminExecuteSequence = [
(u'InstallValidate', None, 1400),
(u'InstallInitialize', None, 1500),
(u'InstallFinalize', None, 6600),
(u'InstallFiles', None, 4000),
(u'InstallAdminPackage', None, 3900),
(u'FileCost', None, 900),
(u'CostInitialize', None, 800),
(u'CostFinal... | apache-2.0 |
bchappet/dnfpy | src/dnfpy/cellular/c_implementation/test_rsdnf.py | 1 | 1471 | import numpy as np
from ctypes import *
import numpy.ctypeslib as npct
libac = npct.load_library("libac", "lib/")
PP_UBYTE = POINTER(POINTER(c_ubyte))
CELL_FUNC = CFUNCTYPE(None, PP_UBYTE, PP_UBYTE)
cell_fun_c = libac.compute_cell_rsdnf
cell_fun_c.argtypes = [PP_UBYTE,PP_UBYTE]
def cell_func_py(data,neighs):
cell... | gpl-2.0 |
mrcslws/nupic.research | tests/unit/frameworks/pytorch/model_compare_test.py | 3 | 2664 | # Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2019, 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 program is free software: you can redistribute it and/or modify
# it unde... | agpl-3.0 |
cjaniake/ionicweb | webapp/ionic/lib/python2.7/site-packages/wheel/pkginfo.py | 565 | 1225 | """Tools for reading and writing PKG-INFO / METADATA without caring
about the encoding."""
from email.parser import Parser
try:
unicode
_PY3 = False
except NameError:
_PY3 = True
if not _PY3:
from email.generator import Generator
def read_pkg_info_bytes(bytestr):
return Parser().pars... | gpl-2.0 |
cpcloud/numpy | numpy/f2py/auxfuncs.py | 75 | 19979 | #!/usr/bin/env python
"""
Auxiliary functions for f2py2e.
Copyright 1999,2000 Pearu Peterson all rights reserved,
Pearu Peterson <pearu@ioc.ee>
Permission to use, modify, and distribute this software is given under the
terms of the NumPy (BSD style) LICENSE.
NO WARRANTY IS EXPRESSED OR IMPLIED. USE AT YOUR OWN RIS... | bsd-3-clause |
gskachkov/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/handshake/__init__.py | 658 | 4406 | # 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... | bsd-3-clause |
geotagx/geotagx-pybossa-archive | test/test_stats.py | 1 | 8132 | # -*- 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 |
Azure/azure-sdk-for-python | sdk/identity/azure-identity/tests/test_device_code_credential.py | 1 | 11509 | # ------------------------------------
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# ------------------------------------
import datetime
from azure.core.exceptions import ClientAuthenticationError
from azure.core.pipeline.policies import SansIOHTTPPolicy
from azure.identity import Authent... | mit |
rackerlabs/onmetal-scripts | onmetal_scripts/fix_noheartbeat.py | 1 | 6080 | #!/usr/bin/env python
# Copyright 2015 Rackspace, 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
#... | apache-2.0 |
BtbN/xbmc | tools/EventClients/lib/python/bt/bt.py | 181 | 2535 | # -*- coding: utf-8 -*-
# Copyright (C) 2008-2013 Team XBMC
#
# 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.
... | gpl-2.0 |
jdobes/cobbler | cobbler/modules/authn_spacewalk.py | 1 | 5150 | """
Authentication module that uses Spacewalk's auth system.
Any org_admin or kickstart_admin can get in.
Copyright 2007-2008, Red Hat, Inc
Michael DeHaan <mdehaan@redhat.com>
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 ... | gpl-2.0 |
snim2/rcsp | _pytest/hookspec.py | 2 | 8732 | """ hook specifications for pytest plugins, invoked from main.py and builtin plugins. """
# -------------------------------------------------------------------------
# Initialization
# -------------------------------------------------------------------------
def pytest_addhooks(pluginmanager):
"""called at plugi... | gpl-2.0 |
CiscoSystems/avos | openstack_dashboard/dashboards/admin/aggregates/urls.py | 46 | 1252 | # 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
# d... | apache-2.0 |
koobonil/Boss2D | Boss2D/addon/tensorflow-1.2.1_for_boss/tensorflow/contrib/keras/python/keras/regularizers.py | 58 | 2778 | # 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... | mit |
sunqm/pyscf | pyscf/pbc/cc/test/test_eom_kuccsd_diag.py | 2 | 4547 | import unittest
import numpy as np
from pyscf.lib import finger
from pyscf.pbc import gto as pbcgto
from pyscf.pbc import scf as pbcscf
from pyscf.pbc import df as pbc_df
import pyscf.cc
import pyscf.pbc.cc as pbcc
import pyscf.pbc.tools.make_test_cell as make_test_cell
from pyscf.pbc.lib import kpts_helper
import py... | apache-2.0 |
openhatch/oh-mainline | vendor/packages/twill/twill/other_packages/_mechanize_dist/_rfc3986.py | 20 | 7560 | """RFC 3986 URI parsing and relative reference resolution / absolutization.
(aka splitting and joining)
Copyright 2006 John J. Lee <jjl@pobox.com>
This code is free software; you can redistribute it and/or modify it under
the terms of the BSD or ZPL 2.1 licenses (see the file COPYING.txt
included with the distributi... | agpl-3.0 |
mandeepdhami/nova | nova/volume/encryptors/nop.py | 61 | 1348 | # Copyright (c) 2013 The Johns Hopkins University/Applied Physics Laboratory
# 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/... | apache-2.0 |
jenalgit/django | tests/indexes/tests.py | 321 | 3037 | from unittest import skipUnless
from django.db import connection
from django.test import TestCase
from .models import Article, ArticleTranslation, IndexTogetherSingleList
class SchemaIndexesTests(TestCase):
"""
Test index handling by the db.backends.schema infrastructure.
"""
def test_index_name_ha... | bsd-3-clause |
midma101/m0du1ar | .venv/lib/python2.7/site-packages/sqlalchemy/dialects/maxdb/base.py | 17 | 42818 | # maxdb/base.py
# Copyright (C) 2005-2012 the SQLAlchemy authors and contributors <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""Support for the MaxDB database.
.. note::
The MaxDB dialect is **non-functional... | mit |
niavlys/kivy | kivy/core/video/video_pygst.py | 8 | 5989 | '''
Video PyGst
===========
Implementation of a VideoBase using PyGST. This module is compatible only with
Python 2.
'''
#
# Important notes: you must take care of glib event + python. If you connect()
# directly an event to a python object method, the object will be ref, and will
# be never unref.
# To prevent memor... | mit |
xpansa/account-financial-tools | account_tax_update/model/__init__.py | 46 | 1149 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# This module copyright (C) 2012 Therp BV (<http://therp.nl>).
# This module copyright (C) 2013 Camptocamp (<http://www.camptocamp.com>).
#
# This program is fr... | agpl-3.0 |
DylannCordel/django-cms | cms/south_migrations/0056_auto__del_field_page_published_languages.py | 63 | 18273 | # -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Deleting field 'Page.published_languages'
db.delete_column(u'cms_page',... | bsd-3-clause |
CiuffysHub/MITMf | mitmflib-0.18.4/mitmflib/impacket/dhcp.py | 2 | 8466 | # Copyright (c) 2003-2015 CORE Security Technologies
#
# This software is provided under under a slightly modified version
# of the Apache Software License. See the accompanying LICENSE file
# for more information.
#
import pcapy
import socket
import time
from random import randint
from mitmflib.impacket import struc... | gpl-3.0 |
zubair-arbi/edx-platform | common/djangoapps/util/tests/test_date_utils.py | 55 | 7800 | # -*- coding: utf-8 -*-
"""
Tests for util.date_utils
"""
from datetime import datetime, timedelta, tzinfo
import unittest
import ddt
from mock import patch
from nose.tools import assert_equals, assert_false # pylint: disable=no-name-in-module
from pytz import UTC
from util.date_utils import (
get_default_time_... | agpl-3.0 |
ruguevara/neon | neon/datasets/tests/test_cifar100.py | 7 | 1060 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import shutil
from nose.plugins.attrib import attr
from neon.datasets.cifar100 import CIFAR100
from neon.backends.cpu import CPU
class TestCIFAR100(object):
tmp_repo = os.path.join(os.path.dirname(__file__), 'repo')
def setup(self):
os.makedi... | apache-2.0 |
youprofit/webserver | admin/plugins/url_arg.py | 5 | 4080 | # Cheroke Admin
#
# Authors:
# Alvaro Lopez Ortega <alvaro@alobbs.com>
#
# Copyright (C) 2001-2014 Alvaro Lopez Ortega
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of version 2 of the GNU General Public
# License as published by the Free Software Foundation.
#
# Thi... | gpl-2.0 |
auduny/home-assistant | tests/components/meraki/test_device_tracker.py | 8 | 4400 | """The tests the for Meraki device tracker."""
import asyncio
import json
import pytest
from homeassistant.components.meraki.device_tracker import (
CONF_VALIDATOR, CONF_SECRET)
from homeassistant.setup import async_setup_component
import homeassistant.components.device_tracker as device_tracker
from homeassistan... | apache-2.0 |
drunknbass/plexpy | lib/unidecode/x012.py | 252 | 4318 | data = (
'ha', # 0x00
'hu', # 0x01
'hi', # 0x02
'haa', # 0x03
'hee', # 0x04
'he', # 0x05
'ho', # 0x06
'[?]', # 0x07
'la', # 0x08
'lu', # 0x09
'li', # 0x0a
'laa', # 0x0b
'lee', # 0x0c
'le', # 0x0d
'lo', # 0x0e
'lwa', # 0x0f
'hha', # 0x10
'hhu', # 0x11
'hhi', # 0x1... | gpl-3.0 |
pwarren/AGDeviceControl | agdevicecontrol/thirdparty/site-packages/linux2/twisted/test/test_pb.py | 3 | 40740 |
# Copyright (c) 2001-2004 Twisted Matrix Laboratories.
# See LICENSE for details.
"""Tests for Perspective Broker module.
TODO: update protocol level tests to use new connection API, leaving
only specific tests for old API.
"""
import sys, os
from cStringIO import StringIO
from zope.interface import implements
f... | gpl-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.