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 |
|---|---|---|---|---|---|
bhargav2408/python-for-android | python3-alpha/extra_modules/gdata/spreadsheet/service.py | 47 | 16862 | #!/usr/bin/python
#
# Copyright (C) 2007 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | apache-2.0 |
hdmetor/scikit-learn | examples/text/hashing_vs_dict_vectorizer.py | 284 | 3265 | """
===========================================
FeatureHasher and DictVectorizer Comparison
===========================================
Compares FeatureHasher and DictVectorizer by using both to vectorize
text documents.
The example demonstrates syntax and speed only; it doesn't actually do
anything useful with the e... | bsd-3-clause |
xmindltd/xmind-sdk-python | xmind/core/saver.py | 5 | 1401 | #!/usr/bin/env python
#-*- coding: utf-8 -*-
"""
xmind.core.saver
~~~~~~~~~~~~~~~~~
:copyright:
:license:
"""
__author__ = "aiqi@xmind.net <Woody Ai>"
import codecs
from . import const
from .. import utils
class WorkbookSaver(object):
def __init__(self, workbook):
""" Save `WorkbookD... | mit |
bguillot/OpenUpgrade | addons/fleet/fleet.py | 33 | 47691 | # -*- 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 |
nhomar/odoo | addons/pad/py_etherpad/__init__.py | 505 | 7804 | """Module to talk to EtherpadLite API."""
import json
import urllib
import urllib2
class EtherpadLiteClient:
"""Client to talk to EtherpadLite API."""
API_VERSION = 1 # TODO probably 1.1 sometime soon
CODE_OK = 0
CODE_INVALID_PARAMETERS = 1
CODE_INTERNAL_ERROR = 2
CODE_INVALID_FUNCTION = 3
... | agpl-3.0 |
viewdy/phantomjs2 | src/qt/qtwebkit/Tools/Scripts/webkitpy/layout_tests/lint_test_expectations_unittest.py | 122 | 6074 | # Copyright (C) 2012 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 ... | bsd-3-clause |
peiyuwang/pants | tests/python/pants_test/backend/jvm/tasks/test_jvm_platform_analysis_integration.py | 21 | 4718 | # coding=utf-8
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import os
from conte... | apache-2.0 |
jcai19/smm_gem5 | tests/configs/memtest-ruby.py | 9 | 4768 | # Copyright (c) 2006-2007 The Regents of The University of Michigan
# Copyright (c) 2010 Advanced Micro Devices, 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 co... | bsd-3-clause |
abhiatgithub/shogun-toolbox | examples/undocumented/python_modular/graphical/converter_fastica_bss.py | 36 | 1108 | """
Blind Source Separation using the FastICA Algorithm with Shogun
Based on the example from scikit-learn
http://scikit-learn.org/
Kevin Hughes 2013
"""
import numpy as np
import pylab as pl
from shogun.Features import RealFeatures
from shogun.Converter import FastICA
# Generate sample data
np.random.seed(0)
n_... | gpl-3.0 |
proxysh/Safejumper-for-Mac | buildmac/Resources/env/lib/python2.7/encodings/uu_codec.py | 57 | 3772 | """ Python 'uu_codec' Codec - UU content transfer encoding
Unlike most of the other codecs which target Unicode, this codec
will return Python string objects for both encode and decode.
Written by Marc-Andre Lemburg (mal@lemburg.com). Some details were
adapted from uu.py which was written by Lance Ell... | gpl-2.0 |
sebrandon1/nova | nova/api/openstack/compute/server_migrations.py | 7 | 7291 | # Copyright 2016 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 |
motian/ngxtop | ngxtop/ngxtop.py | 9 | 13509 | """ngxtop - ad-hoc query for nginx access log.
Usage:
ngxtop [options]
ngxtop [options] (print|top|avg|sum) <var> ...
ngxtop info
ngxtop [options] query <query> ...
Options:
-l <file>, --access-log <file> access log file to parse.
-f <format>, --log-format <format> log format as specify in l... | mit |
bl8/bockbuild | profiles/monodevelop-mac-dev/monodevelop-mac-dev.py | 2 | 1573 | #!/usr/bin/python -B
import os
import sys
sys.path.append ('../..')
from bockbuild.darwinprofile import DarwinProfile
from packages import MonoDevelopMacDevPackages
abs_pathself = os.path.realpath (os.path.abspath (sys.argv[0]))
class MonoDevelopMacDevProfile (DarwinProfile, MonoDevelopMacDevPackages):
def __init... | mit |
ff94315/hiwifi-openwrt-HC5661-HC5761 | staging_dir/host/lib64/scons-2.1.0/SCons/PathList.py | 21 | 8422 | #
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 The SCons Foundation
#
# 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
# with... | gpl-2.0 |
cmende/pytelefoob0t | plugins/8ball/__init__.py | 1 | 1199 | # Copyright 2017 Christoph Mende
#
# 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... | apache-2.0 |
greyhwndz/rethinkdb | external/v8_3.30.33.16/build/gyp/pylib/gyp/generator/eclipse.py | 437 | 11894 | # 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.
"""GYP backend that generates Eclipse CDT settings files.
This backend DOES NOT generate Eclipse CDT projects. Instead, it generates XML
files that can be importe... | agpl-3.0 |
shanksauce/mintr | mintr/__init__.py | 1 | 1862 | import requests
import time
import re
from pprint import pprint
auth_headers = {}
def _validate_credentials(fn):
def wrapper(*args):
def is_not_populated(d,r):
return reduce(
lambda x,y: x or y,
map(lambda k: k not in d or not d[k], r)
)
if is_not_populated(auth_headers, ('cookie... | mit |
npuichigo/ttsflow | third_party/tensorflow/tensorflow/contrib/framework/python/ops/checkpoint_ops_test.py | 23 | 34323 | # 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 |
ashray/VTK-EVM | ThirdParty/Twisted/twisted/internet/test/test_pollingfile.py | 41 | 1276 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted.internet._pollingfile}.
"""
from twisted.python.runtime import platform
from twisted.trial.unittest import TestCase
if platform.isWindows():
from twisted.internet import _pollingfile
else:
_pollingfile = None
c... | bsd-3-clause |
davidtrem/ThunderStorm | thunderstorm/lightning/utils.py | 1 | 5027 | # -*- coding: utf-8 -*-
# Copyright (C) 2010-2013 Trémouilles David
#This file is part of Thunderstorm.
#
#ThunderStrom is free software: you can redistribute it and/or modify
#it under the terms of the GNU Lesser General Public License as published by
#the Free Software Foundation, either version 3 of the License, o... | gpl-3.0 |
qedi-r/home-assistant | tests/components/logbook/test_init.py | 4 | 58510 | """The tests for the logbook component."""
# pylint: disable=protected-access,invalid-name
import logging
from datetime import timedelta, datetime
import unittest
import pytest
import voluptuous as vol
from homeassistant.components import sun
import homeassistant.core as ha
from homeassistant.const import (
ATTR_... | apache-2.0 |
MicroPyramid/forex-python | setup.py | 1 | 1589 | import io
import os
from setuptools import setup, find_packages
VERSION = '1.6'
long_description_text = """Forex Python is a Free Foreign exchange rates and currency conversion.
Features:
List all currency rates.
BitCoin price for all curuncies.
Converting amount to BitCoins.
Get historical rates for any day since 199... | mit |
KaranToor/MA450 | google-cloud-sdk/lib/surface/deployment_manager/runtime_configs/create.py | 2 | 2929 | # 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 ag... | apache-2.0 |
URXtech/scrapy | tests/test_spidermiddleware_httperror.py | 125 | 6935 | from unittest import TestCase
from testfixtures import LogCapture
from twisted.trial.unittest import TestCase as TrialTestCase
from twisted.internet import defer
from scrapy.utils.test import get_crawler
from tests.mockserver import MockServer
from scrapy.http import Response, Request
from scrapy.spiders import Spide... | bsd-3-clause |
answer-huang/StatisticsCodeLines | statistics.py | 1 | 3024 | #coding=utf-8
__author__ = 'answer-huang'
import sys
reload(sys)
sys.setdefaultencoding('utf8')
"""
代码行统计工具
"""
import wx
from MyInfo import AboutMe
from AHDropTarget import AHDropTarget
import os
class AHFrame(wx.Frame):
def __init__(self, parent, title):
wx.Frame.__init__(self, parent, -1, title, wx... | mit |
xjljian/huawei-kernel-3.4 | tools/perf/scripts/python/net_dropmonitor.py | 4235 | 1554 | # Monitor the system for dropped packets and proudce a report of drop locations and counts
import os
import sys
sys.path.append(os.environ['PERF_EXEC_PATH'] + \
'/scripts/python/Perf-Trace-Util/lib/Perf/Trace')
from perf_trace_context import *
from Core import *
from Util import *
drop_log = {}
kallsyms = []
def... | gpl-2.0 |
yanheven/nova | nova/virt/xenapi/agent.py | 44 | 18780 | # Copyright (c) 2010 Citrix Systems, Inc.
# Copyright 2010-2012 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/LICENS... | apache-2.0 |
nop33/indico | indico/modules/events/views.py | 2 | 12813 | # This file is part of Indico.
# Copyright (C) 2002 - 2017 European Organization for Nuclear Research (CERN).
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 3 of the
# License, or (a... | gpl-3.0 |
JiYouMCC/python | renzongxian/0022/0022.py | 40 | 1696 | # Source:https://github.com/Show-Me-the-Code/show-me-the-code
# Author:renzongxian
# Date:2014-12-24
# Python 3.4
"""
第 0022 题: iPhone 6、iPhone 6 Plus 早已上市开卖。请查看你写得 第 0005 题的代码是否可以复用。
"""
from PIL import Image
import os
import sys
def resize_image(image, t_weight, t_height):
im = Image.open(image)
weight,... | mit |
CERNDocumentServer/cds | cds/modules/records/api.py | 2 | 8723 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2017, 2018 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 option) any... | gpl-2.0 |
klahnakoski/ActiveData | vendor/mo_testing/fuzzytestcase.py | 1 | 9712 | # encoding: utf-8
#
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
#
# Contact: Kyle Lahnakoski (kyle@lahnakoski.com)
#
from __future__ import unicode_literals
impor... | mpl-2.0 |
endlessm/chromium-browser | third_party/catapult/common/py_vulcanize/third_party/rcssmin/_setup/py2/setup.py | 31 | 14001 | # -*- coding: ascii -*-
#
# Copyright 2007 - 2013
# Andr\xe9 Malo or his licensors, as applicable
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENS... | bsd-3-clause |
bearstech/ansible | lib/ansible/plugins/action/eos_config.py | 126 | 4193 | #
# Copyright 2015 Peter Sprygada <psprygada@ansible.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any... | gpl-3.0 |
jackkiej/SickRage | lib/sqlalchemy/orm/exc.py | 79 | 5433 | # orm/exc.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
"""SQLAlchemy ORM exceptions."""
from .. import exc as sa_exc, util
NO_STATE = (AttributeE... | gpl-3.0 |
ipcamit/ipcamit.github.io | node_modules/pygmentize-bundled/vendor/pygments/pygments/lexers/math.py | 291 | 93298 | # -*- coding: utf-8 -*-
"""
pygments.lexers.math
~~~~~~~~~~~~~~~~~~~~
Lexers for math languages.
:copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.util import shebang_matches
from pygments.lexer import Lexer, Re... | mit |
PopCap/GameIdea | Engine/Extras/Maya_AnimationRiggingTools/MayaTools/General/Scripts/perforceUtils.py | 1 | 32585 | import maya.cmds as cmds
from P4 import P4,P4Exception
import os, cPickle
from functools import partial
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
def p4_getLatestRevision(fileName, *args):
fileArg = fileName
#try to connect
p4 = P4()
try:
... | bsd-2-clause |
linegroup/topicsketch | twokenize.py | 8 | 12993 | # -*- coding: utf-8 -*-
"""
Twokenize -- a tokenizer designed for Twitter text in English and some other European languages.
This tokenizer code has gone through a long history:
(1) Brendan O'Connor wrote original version in Python, http://github.com/brendano/tweetmotif
TweetMotif: Exploratory Search and Topic ... | apache-2.0 |
benschmaus/catapult | third_party/google-endpoints/strict_rfc3339.py | 10 | 6150 | # Copyright 2012 (C) Daniel Richman, Adam Greig
#
# This file is part of strict_rfc3339.
#
# strict_rfc3339 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... | bsd-3-clause |
yongshengwang/builthue | desktop/core/ext-py/Paste-1.7.2/paste/wsgiwrappers.py | 27 | 22165 | # (c) 2005 Ian Bicking and contributors; written for Paste (http://pythonpaste.org)
# Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
"""WSGI Wrappers for a Request and Response
The WSGIRequest and WSGIResponse objects are light wrappers to make it easier
to deal with an incoming req... | apache-2.0 |
liangazhou/django-rdp | packages/Django-1.8.6/tests/template_backends/test_utils.py | 351 | 1521 | from django.core.exceptions import ImproperlyConfigured
from django.template import engines
from django.test import SimpleTestCase, override_settings
class TemplateStringsTests(SimpleTestCase):
@override_settings(TEMPLATES=[{
'BACKEND': 'raise.import.error',
}])
def test_backend_import_error(self... | apache-2.0 |
a10networks/a10sdk-python | a10sdk/core/sflow/sflow_polling.py | 2 | 3657 | from a10sdk.common.A10BaseClass import A10BaseClass
class EthList(A10BaseClass):
"""This class does not support CRUD Operations please use parent.
:param eth_end: {"type": "number", "description": "Ethernet interface to sample", "format": "interface"}
:param eth_start: {"type": "number", "descriptio... | apache-2.0 |
angstwad/ansible | lib/ansible/module_utils/openswitch.py | 4 | 7084 | #
# (c) 2015 Peter Sprygada, <psprygada@ansible.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any late... | gpl-3.0 |
jhd/spunout | flask/lib/python2.7/site-packages/werkzeug/testsuite/datastructures.py | 145 | 28212 | # -*- coding: utf-8 -*-
"""
werkzeug.testsuite.datastructures
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Tests the functionality of the provided Werkzeug
datastructures.
TODO:
- FileMultiDict
- Immutable types undertested
- Split up dict tests
:copyright: (c) 2014 by Armin Ronacher.... | gpl-3.0 |
ShoRit/shipping-costs-sample | v2/lib/python2.7/site-packages/werkzeug/contrib/cache.py | 84 | 30341 | # -*- coding: utf-8 -*-
"""
werkzeug.contrib.cache
~~~~~~~~~~~~~~~~~~~~~~
The main problem with dynamic Web sites is, well, they're dynamic. Each
time a user requests a page, the webserver executes a lot of code, queries
the database, renders templates until the visitor gets the page he sees.
... | apache-2.0 |
xfournet/intellij-community | python/testData/MockSdk2.7/Lib/re.py | 113 | 12984 | #
# Secret Labs' Regular Expression Engine
#
# re-compatible interface for the sre matching engine
#
# Copyright (c) 1998-2001 by Secret Labs AB. All rights reserved.
#
# This version of the SRE library can be redistributed under CNRI's
# Python 1.6 license. For any other use, please contact Secret Labs
# AB (info@py... | apache-2.0 |
aarchiba/numpy | numpy/linalg/tests/test_regression.py | 78 | 3097 | """ Test functions for linalg module
"""
from __future__ import division, absolute_import, print_function
import numpy as np
from numpy import linalg, arange, float64, array, dot, transpose
from numpy.testing import (
TestCase, run_module_suite, assert_equal, assert_array_equal,
assert_array_almost_equal, asse... | bsd-3-clause |
toomuchcookies/pgu | examples/tilevid5.py | 13 | 7123 | """<title>tutorial on how to add Sprite collision hit handlers, custom painting</title>"""
import pygame
from pygame.rect import Rect
from pygame.locals import *
import math
import random
# the following line is not needed if pgu is installed
import sys; sys.path.insert(0, "..")
from pgu import tilevid, timer
SW,SH... | lgpl-2.1 |
priomsrb/vimswitch | vimswitch/UpdateProfileAction.py | 1 | 1247 | from .Action import Action
from .Settings import getSettings
from .SwitchProfileAction import createSwitchProfileAction
class UpdateProfileAction(Action):
def __init__(self, settings, switchProfileAction):
Action.__init__(self)
self.settings = settings
self.switchProfileAction = switchProf... | gpl-2.0 |
indico/indico | indico/modules/events/registration/models/invitations.py | 1 | 3543 | # This file is part of Indico.
# Copyright (C) 2002 - 2021 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.
from uuid import uuid4
from sqlalchemy.dialects.postgresql import UUID
from indico.core.db import db
fro... | mit |
gdementen/PyTables | examples/array2.py | 13 | 1029 | from __future__ import print_function
import numpy as np
import tables
# Open a new empty HDF5 file
fileh = tables.open_file("array2.h5", mode="w")
# Shortcut to the root group
root = fileh.root
# Create an array
a = np.array([1, 2.7182818284590451, 3.141592], float)
print("About to write array:", a)
print(" with sh... | bsd-3-clause |
TeachAtTUM/edx-platform | cms/djangoapps/contentstore/features/pages.py | 13 | 5052 | # pylint: disable=missing-docstring
# pylint: disable=redefined-outer-name
# pylint: disable=unused-argument
# pylint: disable=no-member
from lettuce import step, world
from nose.tools import assert_equal, assert_in
CSS_FOR_TAB_ELEMENT = "li[data-tab-id='{0}'] input.toggle-checkbox"
@step(u'I go to the pages page$'... | agpl-3.0 |
BigBrother1984/android_external_chromium_org | chrome_frame/combine_libs.py | 79 | 3272 | #!/usr/bin/env python
# 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.
# TODO(slightlyoff): move to using shared version of this script.
'''This script makes it easy to combine libs and object files to... | bsd-3-clause |
pniedzielski/fb-hackathon-2013-11-21 | src/repl.it/jsrepl/extern/python/reloop-closured/lib/python2.7/distutils/msvccompiler.py | 250 | 23637 | """distutils.msvccompiler
Contains MSVCCompiler, an implementation of the abstract CCompiler class
for the Microsoft Visual Studio.
"""
# Written by Perry Stoll
# hacked by Robin Becker and Thomas Heller to do a better job of
# finding DevStudio (through the registry)
__revision__ = "$Id$"
import sys
import os
im... | agpl-3.0 |
ajroussel/shell-nouns-data | src/extractor.py | 1 | 3851 | #!/usr/bin/env python3
import os
import argparse
import pickle
from lxml import etree
from sys import argv
from objects import *
## returns a list of ints
def to_index(s):
outlist = list()
spl1 = s.split(',')
try:
for item in spl1:
spl2 = item.split('..')
start = int(spl2... | gpl-3.0 |
stackforge/monasca-api | monasca_api/common/repositories/alarm_definitions_repository.py | 3 | 2376 | # Copyright 2014,2016 Hewlett Packard Enterprise Development Company, L.P.
#
# 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 |
Thor77/youtube-dl | youtube_dl/extractor/slideshare.py | 8 | 2124 | from __future__ import unicode_literals
import re
import json
from .common import InfoExtractor
from ..compat import (
compat_urlparse,
)
from ..utils import (
ExtractorError,
get_element_by_id,
)
class SlideshareIE(InfoExtractor):
_VALID_URL = r'https?://www\.slideshare\.net/[^/]+?/(?P<title>.+?)($... | unlicense |
kevinr/750book-web | 750book-web-env/lib/python2.7/site-packages/pinax/apps/tagging_utils/widgets.py | 3 | 1602 | from django import forms
from django.conf import settings
from django.core.urlresolvers import reverse
from django.utils.safestring import mark_safe
class TagAutoCompleteInput(forms.TextInput):
class Media:
css = {
"all": (settings.STATIC_URL + "pinax/css/jquery.autocomplete.css",)
... | mit |
Lab603/PicEncyclopedias | jni-build/jni/include/tensorflow/python/framework/tensor_shape_test.py | 7 | 15975 | # 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 |
CybOXProject/python-cybox | cybox/__init__.py | 1 | 4103 | # Copyright (c) 2020, The MITRE Corporation. All rights reserved.
# See LICENSE.txt for complete terms.
from mixbox import entities
from mixbox.vendor import six
from .version import __version__ # noqa
#: Mapping of xsi:types to implementation/extension classes
_EXTENSION_MAP = {}
def _lookup_unprefixed(typename)... | bsd-3-clause |
TwinkleChawla/nova | nova/tests/unit/cast_as_call.py | 77 | 1837 | # Copyright 2013 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 |
Yukarumya/Yukarum-Redfoxes | python/pystache/pystache/common.py | 48 | 2022 | # coding: utf-8
"""
Exposes functionality needed throughout the project.
"""
from sys import version_info
def _get_string_types():
# TODO: come up with a better solution for this. One of the issues here
# is that in Python 3 there is no common base class for unicode strings
# and byte strings, and ... | mpl-2.0 |
julianprabhakar/eden_car | tests/unit_tests/modules/s3/s3gis/OpenStreetMap.py | 43 | 1171 |
s3gis_tests = load_module("tests.unit_tests.modules.s3.s3gis")
def test_OpenStreetMap():
s3gis_tests.layer_test(
db,
db.gis_layer_openstreetmap,
dict(
enabled = True,
name = "test OSM layer",
url1 = "http://otile1.example.com/tiles/1.0.0/osm/",
... | mit |
hifly/OpenUpgrade | addons/base_report_designer/openerp_sxw2rml/__init__.py | 423 | 1091 | # -*- 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... | agpl-3.0 |
wschaeferB/autopsy | test/script/tskdbdiff.py | 2 | 39751 | # Requires python3
import re
import sqlite3
import subprocess
import shutil
import os
import codecs
import datetime
import sys
import psycopg2
import psycopg2.extras
import socket
import csv
class TskDbDiff(object):
"""Compares two TSK/Autospy SQLite databases.
Attributes:
gold_artifacts:
aut... | apache-2.0 |
munnerz/CouchPotatoServer | libs/tornado/options.py | 79 | 20184 | #!/usr/bin/env python
#
# Copyright 2009 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 |
patricmutwiri/pombola | pombola/info/admin.py | 2 | 1448 | from django.conf import settings
from django.contrib import admin
import autocomplete_light
import models
from pombola.slug_helpers.admin import StricterSlugFieldMixin
class LabelAdmin(admin.ModelAdmin):
search_fields = [ 'name' ]
list_display = [ 'name', 'slug' ]
prepopulated_fields = {'slug': ['name... | agpl-3.0 |
chouseknecht/ansible | lib/ansible/modules/identity/keycloak/keycloak_group.py | 12 | 11972 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) 2019, Adam Goossens <adam.goossens@gmail.com>
# 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... | gpl-3.0 |
pgmillon/ansible | lib/ansible/modules/cloud/vmware/vmware_host_facts.py | 1 | 11491 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2017, Wei Gao <gaowei3@qq.com>
# 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
ANSIBLE... | gpl-3.0 |
silkyar/570_Big_Little | src/arch/x86/isa/insts/simd128/integer/shift/right_logical_shift.py | 91 | 4565 | # Copyright (c) 2007 The Hewlett-Packard Development Company
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implemen... | bsd-3-clause |
evaschalde/odoo | addons/stock_landed_costs/__openerp__.py | 220 | 1914 | # -*- 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 |
mlsecproject/gglsbl-rest | config.py | 1 | 1443 | from os import environ
import logging.config
from apscheduler.schedulers.background import BackgroundScheduler
from multiprocessing import cpu_count
from subprocess import Popen
logging.config.fileConfig('logging.conf')
bind = "0.0.0.0:5000"
workers = int(environ.get('WORKERS', cpu_count() * 8 + 1))
timeout = int(en... | apache-2.0 |
lumig242/Hue-Integration-with-CDAP | desktop/core/ext-py/Django-1.6.10/django/contrib/auth/tests/test_models.py | 104 | 6290 | import warnings
from django.conf import settings
from django.contrib.auth import get_user_model
from django.contrib.auth.models import (Group, User, SiteProfileNotAvailable,
UserManager)
from django.contrib.auth.tests.custom_user import IsActiveTestUser1
from django.contrib.auth.tests.utils import skipIfCustomUser... | apache-2.0 |
estaban/pyload | module/plugins/hoster/UnrestrictLi.py | 1 | 4420 | # -*- coding: utf-8 -*-
############################################################################
# This program is free software: you can redistribute it and/or modify #
# it under the terms of the GNU Affero General Public License as #
# published by the Free Software Foundation, either version 3 of ... | gpl-3.0 |
mrquim/mrquimrepo | script.module.youtube.dl/lib/youtube_dl/extractor/bbc.py | 9 | 54001 | # coding: utf-8
from __future__ import unicode_literals
import re
import itertools
from .common import InfoExtractor
from ..utils import (
clean_html,
dict_get,
ExtractorError,
float_or_none,
get_element_by_class,
int_or_none,
parse_duration,
parse_iso8601,
try_get,
unescapeHTM... | gpl-2.0 |
JanSchulz/multi-package-feedstock | recipes/python-2.7.8/run_test.py | 1 | 1289 | import platform
import os
import sys
import subprocess
from pprint import pprint
print('Python version:', platform.python_version())
print('max unicode:', sys.maxunicode)
print('architecture:', platform.architecture())
print('sys.version:', sys.version)
print('platform.machine():', platform.machine())
import _bisect
... | bsd-3-clause |
GiovanniConserva/TestDeploy | venv/Lib/site-packages/django/db/backends/sqlite3/base.py | 323 | 18115 | """
SQLite3 backend for django.
Works with either the pysqlite2 module or the sqlite3 module in the
standard library.
"""
from __future__ import unicode_literals
import datetime
import decimal
import re
import warnings
from django.conf import settings
from django.db import utils
from django.db.backends import utils ... | bsd-3-clause |
aularon/meld | meld/vc/mercurial.py | 6 | 5772 | # Copyright (C) 2002-2005 Stephen Kennedy <stevek@gnome.org>
# 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 an... | gpl-2.0 |
gaurav38/QosRouting | pox/openflow/__init__.py | 5 | 11451 | # Copyright 2011 James McCauley
#
# 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 writi... | apache-2.0 |
kenshay/ImageScript | ProgramData/SystemFiles/opencv/sources/modules/ts/misc/run.py | 5 | 41856 | #!/usr/bin/env python
import sys, os, platform, xml, re, tempfile, glob, datetime, getpass, shutil
from optparse import OptionParser
from subprocess import Popen, PIPE
hostos = os.name # 'nt', 'posix'
hostmachine = platform.machine() # 'x86', 'AMD64', 'x86_64'
errorCode = 0
SIMD_DETECTION_PROGRAM="""
#if __SSE5__
#... | gpl-3.0 |
kcartier/tensorflow-toe-in-the-water | tensorflow/python/ops/nn_grad.py | 3 | 7922 | """Gradients for operators defined in nn_ops.py."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from tensorflow.python.framework import ops
from tensorflow.python.ops import array_ops
from tensorflow.python.ops import control_flow_ops
from tensorflow.py... | apache-2.0 |
mikeh69/JammerDetect | src/audio_tones.py | 1 | 3644 | import math #import needed modules
import pyaudio #sudo apt-get install python-pyaudio
import struct
import pickle
from time import sleep
PyAudio = pyaudio.PyAudio #initialize pyaudio
#See http://en.wikipedia.org/wiki/Bit_rate#Audio
BITRATE = 48000 #number of frames per second - 44.1kHz does not work pro... | mit |
StephaneP/volatility | volatility/plugins/fileparam.py | 57 | 1840 | # Volatility
#
# Authors:
# Mike Auty <mike.auty@gmail.com>
#
# This file is part of Volatility.
#
# Volatility 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 op... | gpl-2.0 |
percy-g2/Novathor_xperia_u8500 | 6.1.1.B.0.253/external/webkit/Source/WebKit2/Scripts/webkit2/messages_unittest.py | 15 | 24676 | # Copyright (C) 2010 Apple 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:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... | gpl-2.0 |
mirkobronzi/finance-analyzer | lib/entries.py | 1 | 3600 | """
classes Entry and Entries
"""
__author__ = 'bronzi'
from datetime import datetime
import re
#TODO: should be configurable
PUNCTUATION_REMOVER = re.compile("[0-9,\.#\-_/']")
SPACE_REMOVER = re.compile(" +")
def string_to_float(string):
"""
simply convert a string into a float
string : basestring
... | gpl-3.0 |
cousteaulecommandant/youtube-dl | youtube_dl/extractor/appleconnect.py | 139 | 1848 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
str_to_int,
ExtractorError
)
class AppleConnectIE(InfoExtractor):
_VALID_URL = r'https?://itunes\.apple\.com/\w{0,2}/?post/idsa\.(?P<id>[\w-]+)'
_TEST = {
'url': 'https://itunes.app... | unlicense |
reactormonk/eve-wspace | evewspace/Map/migrations/0005_auto__add_field_wormhole_eol_time.py | 17 | 17431 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Wormhole.eol_time'
db.add_column('Map_wormhole', 'eol_time',
self.gf('... | gpl-3.0 |
CloudServer/nova | nova/api/openstack/compute/contrib/used_limits.py | 62 | 3281 | # Copyright 2012 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 |
mrrrgn/olympia | apps/bandwagon/tests/test_models.py | 9 | 9602 | import datetime
import itertools
import random
import mock
from nose.tools import eq_
import amo
import amo.tests
from access.models import Group
from addons.models import Addon, AddonRecommendation
from bandwagon.models import (Collection, CollectionAddon, CollectionUser,
CollectionWatc... | bsd-3-clause |
simone-campagna/sheru | packages/sheru/main.py | 1 | 5020 | # -*- coding: utf-8 -*-
#
# Copyright 2015 Simone Campagna
#
# 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 |
msabramo/ansible | lib/ansible/modules/network/iosxr/iosxr_command.py | 15 | 7240 | #!/usr/bin/python
#
# 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 distribut... | gpl-3.0 |
gangadhar-kadam/helpdesk-erpnext | erpnext/patches/v5_4/notify_system_managers_regarding_wrong_tax_calculation.py | 45 | 1433 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.email import sendmail_to_system_managers
from frappe.utils import get_link_to_form
def execute():
wrong_records = []
for... | agpl-3.0 |
ilpianista/ansible | lib/ansible/module_utils/facts/namespace.py | 172 | 2366 | # This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by Ansible
# still belong to the author of the module, and may assign their own license
# to the complete wo... | gpl-3.0 |
jiangzhixiao/odoo | addons/payment_authorize/models/authorize.py | 201 | 6963 | # -*- coding: utf-'8' "-*-"
import hashlib
import hmac
import logging
import time
import urlparse
from openerp import api, fields, models
from openerp.addons.payment.models.payment_acquirer import ValidationError
from openerp.addons.payment_authorize.controllers.main import AuthorizeController
from openerp.tools.floa... | agpl-3.0 |
serviceagility/boto | boto/pyami/installers/ubuntu/installer.py | 153 | 3545 | # Copyright (c) 2006,2007,2008 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,... | mit |
Si-elegans/Web-based_GUI_Tools | spirit/forms/comment_like.py | 1 | 1042 | #-*- coding: utf-8 -*-
from django import forms
from django.utils.translation import ugettext as _
from spirit.models.comment_like import CommentLike
class LikeForm(forms.ModelForm):
class Meta:
model = CommentLike
fields = []
def __init__(self, user=None, comment=None, *args, **kwargs):
... | apache-2.0 |
NeuroDataDesign/seelviz | Flask/env/lib/python2.7/site-packages/pip/_vendor/packaging/_structures.py | 1152 | 1416 | # This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
from __future__ import absolute_import, division, print_function
class Infinity(object):
def __repr__(self):
return "Infinity... | apache-2.0 |
moyogo/tachyfont | run_time/src/gae_server/third_party/old-fonttools-master/Lib/fontTools/ttLib/tables/sbixBitmapSet.py | 7 | 4944 | from __future__ import print_function, division, absolute_import
from fontTools.misc.py23 import *
from fontTools.misc import sstruct
from fontTools.misc.textTools import readHex
from .sbixBitmap import *
import struct
sbixBitmapSetHeaderFormat = """
>
size: H # 00 28
resolution: H # 00 ... | apache-2.0 |
nttks/edx-platform | lms/djangoapps/pdfgen/tests/test_api.py | 1 | 6717 | """Tests for the pdfgen API. """
from datetime import datetime
from mock import patch
from django.test import RequestFactory
from certificates import api as certs_api
from certificates.models import CertificateGenerationConfiguration, CertificateStatuses, GeneratedCertificate
from certificates.tests.factories import ... | agpl-3.0 |
mccheung/kbengine | kbe/src/lib/python/Lib/test/test_importlib/frozen/test_finder.py | 81 | 2209 | from .. import abc
from .. import util
machinery = util.import_importlib('importlib.machinery')
import unittest
class FindSpecTests(abc.FinderTests):
"""Test finding frozen modules."""
def find(self, name, path=None):
finder = self.machinery.FrozenImporter
return finder.find_spec(name, pat... | lgpl-3.0 |
zaccoz/odoo | addons/fetchmail/res_config.py | 437 | 5234 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (C) 2004-2012 OpenERP S.A. (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms o... | agpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.