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 |
|---|---|---|---|---|---|
Just-D/chromium-1 | chrome/common/extensions/docs/server2/memcache_object_store.py | 52 | 1654 | # Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import logging
import traceback
from appengine_wrappers import memcache
from future import Future
from object_store import ObjectStore
class MemcacheO... | bsd-3-clause |
18098924759/Wox | PythonHome/Lib/site-packages/requests/packages/chardet/eucjpprober.py | 2919 | 3678 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org 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 Reserved.
#
# Con... | mit |
blazaid/pynetics | test/test_stop.py | 1 | 2293 | import pickle
from unittest import TestCase
from unittest.mock import Mock
from tempfile import TemporaryFile
from pynetics.stop import StepsNum, FitnessBound
class StepsNumTestCase(TestCase):
""" Test for the stop condition based on number of iterations. """
def test_class_is_pickeable(self):
""" ... | gpl-3.0 |
t794104/ansible | test/units/modules/storage/netapp/test_na_ontap_lun_map.py | 38 | 7000 | ''' unit tests ONTAP Ansible module: na_ontap_lun_map '''
from __future__ import print_function
import json
import pytest
from units.compat import unittest
from units.compat.mock import patch
from ansible.module_utils import basic
from ansible.module_utils._text import to_bytes
import ansible.module_utils.netapp as n... | gpl-3.0 |
liberiun/cynin-intranet | src/ubify.viewlets/ubify/viewlets/browser/comments.py | 5 | 4785 | ###############################################################################
#cyn.in is an open source Collaborative Knowledge Management Appliance that
#enables teams to seamlessly work together on files, documents and content in
#a secure central environment.
#
#cyn.in v2 an open source appliance is distributed un... | gpl-3.0 |
MalloyPower/parsing-python | front-end/testsuite-python-lib/Python-3.1/Lib/email/test/test_email_codecs.py | 2 | 2826 | # Copyright (C) 2002-2006 Python Software Foundation
# Contact: email-sig@python.org
# email package unit tests for (optional) Asian codecs
import unittest
from test.support import run_unittest
from email.test.test_email import TestEmailBase
from email.charset import Charset
from email.header import Header, decode_he... | mit |
Jannes123/inasafe | extras/system_tools.py | 17 | 12896 | """Implementation of tools to do with system administration made
as platform independent as possible.
"""
import sys
import os
import string
import urllib
import urllib2
import getpass
import tarfile
import warnings
try:
import hashlib
except ImportError:
import md5 as hashlib
def get_user_name():
"""Get... | gpl-3.0 |
meego-tablet-ux/meego-app-browser | third_party/tlslite/tlslite/TLSRecordLayer.py | 20 | 44532 | """Helper class for TLSConnection."""
from __future__ import generators
from utils.compat import *
from utils.cryptomath import *
from utils.cipherfactory import createAES, createRC4, createTripleDES
from utils.codec import *
from errors import *
from messages import *
from mathtls import *
from constants import *
fro... | bsd-3-clause |
Shanec132006/lab3 | lib/jinja2/testsuite/lexnparse.py | 402 | 22314 | # -*- coding: utf-8 -*-
"""
jinja2.testsuite.lexnparse
~~~~~~~~~~~~~~~~~~~~~~~~~~
All the unittests regarding lexing, parsing and syntax.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
import unittest
from jinja2.testsuite import JinjaTestCase
from jinja... | apache-2.0 |
fusijie/cocos2d-x-samples | download-engine.py | 7 | 12946 | #!/usr/bin/env python
#coding=utf-8
#
# ./download-deps.py
#
# Downloads Cocos2D-x engine from official website:
# http://www.cocos2d-x.org/filedown/cocos2d-x-xxx.zip) and extracts the zip
# file
#
# Having the dependencies outside the official cocos2d-x repo helps prevent
# bloating the repo.
#
"""*******************... | mit |
d0gZpAw/p2pool-doged | p2pool/test/bitcoin/test_getwork.py | 275 | 4273 | import unittest
from p2pool.bitcoin import getwork, data as bitcoin_data
class Test(unittest.TestCase):
def test_all(self):
cases = [
{
'target': '0000000000000000000000000000000000000000000000f2b944000000000000',
'midstate': '5982f893102dec03e374b472647c4f19b1b... | gpl-3.0 |
Tatsh-ansible/ansible | lib/ansible/modules/cloud/vmware/vmware_vmkernel.py | 70 | 7599 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2015, Joseph Callen <jcallen () csc.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 Li... | gpl-3.0 |
tomhughes/mapnik | scons/scons-local-4.1.0/SCons/Job.py | 4 | 15862 | # MIT License
#
# Copyright 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
# without limitation the rights to use, copy, modify, merge, ... | lgpl-2.1 |
unsiloai/syntaxnet-ops-hack | tensorflow/contrib/saved_model/python/saved_model/__init__.py | 109 | 1191 | # 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 |
btheosam/TizenRT | external/iotivity/iotivity_1.2-rel/tools/scons/UnpackAll.py | 30 | 22618 | # -*- coding: utf-8 -*-
# -- Dual Licence ----------------------------------------------------------
############################################################################
# GPL License #
# ... | apache-2.0 |
M157q/django-localflavor | localflavor/sk/sk_districts.py | 17 | 2417 | from django.utils.translation import ugettext_lazy as _
#: http://sk.wikipedia.org/wiki/Administrat%C3%ADvne_%C4%8Dlenenie_Slovenska
DISTRICT_CHOICES = (
('BB', _('Banska Bystrica')),
('BS', _('Banska Stiavnica')),
('BJ', _('Bardejov')),
('BN', _('Banovce nad Bebravou')),
('BR', _('Brezno')),
(... | bsd-3-clause |
xzturn/tensorflow | tensorflow/python/data/experimental/kernel_tests/variant_test.py | 4 | 2188 | # Copyright 2019 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 |
tuxskar/caluny | caluny/core/admin.py | 1 | 2473 | """Admin site registration models for Caluma"""
from django.contrib import admin
from .models import SemesterDate
from .models import Student, Course, Level, Exam, Timetable, CourseLabel, Degree
from .models import Subject, Teacher, TeachingSubject, School, University
@admin.register(Subject)
class SubjectAdmin(admi... | gpl-2.0 |
2014c2g3/2015cd_midterm | static/Brython3.1.0-20150301-090019/Lib/_sysconfigdata.py | 731 | 18167 | build_time_vars={'HAVE_SYS_WAIT_H': 1, 'HAVE_UTIL_H': 0, 'HAVE_SYMLINKAT': 1, 'HAVE_LIBSENDFILE': 0, 'SRCDIRS': 'Parser Grammar Objects Python Modules Mac', 'SIZEOF_OFF_T': 8, 'BASECFLAGS': '-Wno-unused-result', 'HAVE_UTIME_H': 1, 'EXTRAMACHDEPPATH': '', 'HAVE_SYS_TIME_H': 1, 'CFLAGSFORSHARED': '-fPIC', 'HAVE_HYPOT': 1... | gpl-3.0 |
cloudbase/cinder | cinder/tests/unit/test_utils.py | 3 | 58197 | # Copyright 2011 Justin Santa Barbara
#
# 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... | apache-2.0 |
40223235/2015cdb_g7 | static/Brython3.1.1-20150328-091302/Lib/ui/dialog.py | 607 | 4994 | from . import widget
from browser import html, document
class Dialog(widget.DraggableWidget):
def __init__(self, id=None):
self._div_shell=html.DIV(
Class="ui-dialog ui-widget ui-widget-content ui-corner-all ui-front ui-draggable ui-resizable",
style={'position': 'absolute', 'height': 'auto',... | gpl-3.0 |
bollu/sublimeBookmark | bookmark.py | 2 | 5194 | from .common import *
class Bookmark:
def __init__(self, uid, name, window, activeView):
self.uid = int(uid)
self.name = str(name)
self.filePath = str(activeView.file_name())
self.projectPath = getCurrentProjectPath(window)
region = getCurrentLineRegion(activeView)
... | apache-2.0 |
takeflight/wagtail | wagtail/admin/views/home.py | 2 | 6959 | from django.conf import settings
from django.contrib.auth import get_user_model
from django.contrib.auth.decorators import permission_required
from django.db import connection
from django.db.models import Max, Q
from django.http import Http404
from django.template.loader import render_to_string
from django.template.res... | bsd-3-clause |
evoggy/crazyflie-pc-client | lib/cfclient/utils/config_manager.py | 12 | 3712 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# || ____ _ __
# +------+ / __ )(_) /_______________ _____ ___
# | 0xBC | / __ / / __/ ___/ ___/ __ `/_ / / _ \
# +------+ / /_/ / / /_/ /__/ / / /_/ / / /_/ __/
# || || /_____/_/\__/\___/_/ \__,_/ /___/\___/
#
# Copyright (C) 20... | gpl-2.0 |
devoid/nova | nova/tests/virt/vmwareapi/test_vif.py | 2 | 13439 | # Copyright 2013 Canonical Corp.
# 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 ... | apache-2.0 |
frnhr/django-stdnumfield | testproject/testproject/settings.py | 1 | 3320 | """
Django settings for testproject project.
Generated by 'django-admin startproject' using Django 1.10.3.
For more information on this file, see
https://docs.djangoproject.com/en/1.10/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.10/ref/settings/
"""
impor... | unlicense |
fanjunwei/depot_tools | third_party/simplejson/__init__.py | 230 | 17510 | r"""JSON (JavaScript Object Notation) <http://json.org> is a subset of
JavaScript syntax (ECMA-262 3rd edition) used as a lightweight data
interchange format.
:mod:`simplejson` exposes an API familiar to users of the standard library
:mod:`marshal` and :mod:`pickle` modules. It is the externally maintained
version of ... | bsd-3-clause |
g19-hs/personfinder | app/unidecode/x090.py | 251 | 4631 | data = (
'Tui ', # 0x00
'Song ', # 0x01
'Gua ', # 0x02
'Tao ', # 0x03
'Pang ', # 0x04
'Hou ', # 0x05
'Ni ', # 0x06
'Dun ', # 0x07
'Jiong ', # 0x08
'Xuan ', # 0x09
'Xun ', # 0x0a
'Bu ', # 0x0b
'You ', # 0x0c
'Xiao ', # 0x0d
'Qiu ', # 0x0e
'Tou ', # 0x0f
'Zhu ', # 0x10
'... | apache-2.0 |
talipovm/terse | terse/ReportGenerator/Charges.py | 1 | 3037 | from ReportGenerator.Top_ReportGenerator import Top_ReportGenerator
from ReportGenerator.Geom import Geom
import logging
log = logging.getLogger(__name__)
class Charges(Top_ReportGenerator):
def __init__(self,we,parsed):
self.Q = list()
super().__init__(we,parsed)
def prepare_for_report(self... | mit |
jeffery-do/Vizdoombot | doom/lib/python3.5/site-packages/skimage/viewer/utils/core.py | 19 | 6555 | import numpy as np
from ..qt import QtWidgets, has_qt, FigureManagerQT, FigureCanvasQTAgg
from ..._shared.utils import warn
import matplotlib as mpl
from matplotlib.figure import Figure
from matplotlib import _pylab_helpers
from matplotlib.colors import LinearSegmentedColormap
if has_qt and 'agg' not in mpl.get_backen... | mit |
CasparLi/calibre | src/calibre/gui2/proceed.py | 14 | 16977 | #!/usr/bin/env python2
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
from __future__ import (unicode_literals, division, absolute_import,
print_function)
__license__ = 'GPL v3'
__copyright__ = '2012, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
from collecti... | gpl-3.0 |
Mapotempo/mapotempo-qgis-plugin | requests/packages/chardet/__init__.py | 1778 | 1295 | ######################## BEGIN LICENSE BLOCK ########################
# This library 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 2.1 of the License, or (at your option) any later ve... | gpl-2.0 |
mou4e/zirconium | native_client_sdk/src/build_tools/dsc2gyp.py | 28 | 11228 | #!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import argparse
import StringIO
import sys
import os
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
sys.path.append(os.pa... | bsd-3-clause |
drbean/ultisnips | test/test_MultipleMatches.py | 5 | 2322 | from test.vim_test_case import VimTestCase as _VimTest
from test.constant import *
class _MultipleMatches(_VimTest):
snippets = (
("test", "Case1", "This is Case 1"),
("test", "Case2", "This is Case 2"),
)
class Multiple_SimpleCaseSelectFirst_ECR(_MultipleMatches):
keys = "test" + EX + "... | gpl-3.0 |
hryamzik/ansible | lib/ansible/modules/notification/cisco_spark.py | 58 | 5644 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright: 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_METADATA = {'metadata_version': '1.1',
... | gpl-3.0 |
pspe/root | interpreter/llvm/src/utils/wciia.py | 99 | 2944 | #!/usr/bin/env python
"""
wciia - Whose Code Is It Anyway
Determines code owner of the file/folder relative to the llvm source root.
Code owner is determined from the content of the CODE_OWNERS.TXT
by parsing the D: field
usage:
utils/wciia.py path
limitations:
- must be run from llvm source root
- very simplist... | lgpl-2.1 |
eviljeff/zamboni | mkt/translations/utils.py | 12 | 8109 | import contextlib
from django.conf import settings
from django.utils import translation
from django.utils.encoding import force_unicode
import html5lib
import jinja2
from babel import Locale
from html5lib.serializer.htmlserializer import HTMLSerializer
def truncate_text(text, limit, killwords=False, end='...'):
... | bsd-3-clause |
AutorestCI/azure-sdk-for-python | azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/dhcp_options.py | 9 | 1037 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | mit |
openmv/openmv | scripts/examples/Arduino/Portenta-H7/10-Color-Tracking/ir_beacon_grayscale_tracking.py | 2 | 1152 | # IR Beacon Grayscale Tracking Example
#
# This example shows off IR beacon Grayscale tracking using the OpenMV Cam.
import sensor, image, time
thresholds = (255, 255) # thresholds for bright white light from IR.
sensor.reset()
sensor.set_pixformat(sensor.GRAYSCALE)
sensor.set_framesize(sensor.VGA)
sensor.set_window... | mit |
ezequielpereira/Time-Line | libs64/wx/lib/agw/hyperlink.py | 6 | 17865 | # --------------------------------------------------------------------------- #
# HYPERLINKSCTRL wxPython IMPLEMENTATION
# Ported From Angelo Mandato C++ Code By:
#
# Andrea Gavana, @ 27 Mar 2005
# Latest Revision: 27 Nov 2009, 17.00 GMT
#
#
# Original Web Site (For The C++ Code):
#
# http://www.spaceblue.com/codedetai... | gpl-3.0 |
oldm/OldMan | tests/attr_entry_test.py | 1 | 1916 | import unittest
from oldman.model.attribute import Entry
class AttributeEntryTest(unittest.TestCase):
def test_1(self):
entry = Entry()
value1 = 1
self.assertNotEquals(entry.current_value, value1)
entry.current_value = value1
self.assertEquals(entry.current_value, value1)... | bsd-3-clause |
crossbario/crossbar-examples | metaapi/monitor-sessions.py | 3 | 2397 | import os
import sys
from pprint import pprint
import txaio
import argparse
from twisted.internet import reactor
from twisted.internet.defer import inlineCallbacks
from autobahn.twisted.wamp import ApplicationRunner
from autobahn.twisted.wamp import ApplicationSession
class ClientSession(ApplicationSession):
... | apache-2.0 |
2014c2g2/teamwork | exts/w2/static/Brython2.0.0-20140209-164925/Lib/_sre.py | 38 | 53450 | # NOT_RPYTHON
"""
A pure Python reimplementation of the _sre module from CPython 2.4
Copyright 2005 Nik Haldimann, licensed under the MIT license
This code is based on material licensed under CNRI's Python 1.6 license and
copyrighted by: Copyright (c) 1997-2001 by Secret Labs AB
"""
#import array
import operator, sys... | gpl-2.0 |
TheTeaRex/cmpe281_mongoserver | node_modules/node-gyp/gyp/pylib/gyp/input_test.py | 1841 | 3207 | #!/usr/bin/env python
# Copyright 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.
"""Unit tests for the input.py file."""
import gyp.input
import unittest
import sys
class TestFindCycles(unittest.TestCase):
def setUp(self... | gpl-2.0 |
alexlo03/ansible | lib/ansible/modules/network/f5/bigip_appsvcs_extension.py | 9 | 15556 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright: (c) 2018, F5 Networks Inc.
# GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | gpl-3.0 |
tectronics/cortex-vfx | test/IECore/MarschnerLookupTableOpTest.py | 12 | 2999 | ##########################################################################
#
# Copyright (c) 2010, Image Engine Design 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:
#
# * Redistribu... | bsd-3-clause |
Cryptotest/Cryptotest | contrib/bitrpc/bitrpc.py | 239 | 7836 | from jsonrpc import ServiceProxy
import sys
import string
# ===== BEGIN USER SETTINGS =====
# if you do not set these you will be prompted for a password for every command
rpcuser = ""
rpcpass = ""
# ====== END USER SETTINGS ======
if rpcpass == "":
access = ServiceProxy("http://127.0.0.1:9332")
else:
access = Ser... | mit |
aplicatii-romanesti/allinclusive-kodi-pi | .kodi/userdata/addon_data/plugin.video.p2p-streams/acestream/ace/python-modules/pyamf/tests/adapters/test_collections.py | 25 | 1608 | # Copyright (c) The PyAMF Project.
# See LICENSE.txt for details.
"""
Tests for the L{collections} L{pyamf.adapters._collections} module.
@since: 0.5
"""
try:
import collections
except ImportError:
collections = None
import unittest
import pyamf
class CollectionsTestCase(unittest.TestCase):
"""
"... | apache-2.0 |
toanalien/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/tool/steps/postdiff.py | 132 | 2433 | # 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 |
Elandril/SickRage | lib/babelfish/language.py | 79 | 6874 | # -*- coding: utf-8 -*-
#
# Copyright (c) 2013 the BabelFish authors. All rights reserved.
# Use of this source code is governed by the 3-clause BSD license
# that can be found in the LICENSE file.
#
from __future__ import unicode_literals
from collections import namedtuple
from functools import partial
from pkg_resour... | gpl-3.0 |
ratoaq2/Flexget | flexget/plugins/api_rottentomatoes.py | 8 | 22300 | from __future__ import unicode_literals, division, absolute_import
import time
import logging
import difflib
import random
import urllib
from datetime import datetime, timedelta
from urllib2 import URLError
from sqlalchemy import Table, Column, Integer, String, DateTime, func, sql
from sqlalchemy.schema import Foreign... | mit |
ksrajkumar/openerp-6.1 | openerp/addons/product/__init__.py | 9 | 1129 | # -*- 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 |
ifduyue/sentry | src/sentry/south_migrations/0311_auto__add_releaseheadcommit__add_unique_releaseheadcommit_repository_i.py | 4 | 111429 | # -*- 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):
# Adding model 'ReleaseHeadCommit'
db.create_table(
'sentry_re... | bsd-3-clause |
mscuthbert/abjad | abjad/tools/agenttools/test/test_agenttools_IterationAgent_by_timeline_from_component.py | 2 | 4088 | # -*- encoding: utf-8 -*-
from abjad import *
def test_agenttools_IterationAgent_by_timeline_from_component_01():
r'''Yields component class instances in score of expr,
sorted backward by score offset stop time,
and starting from expr.
'''
score = Score()
staff_1 = Staff("c'4 d'4 e'4 f'4")
... | gpl-3.0 |
derbylock/pcachefs | setup.py | 3 | 3427 | #!/usr/bin/python
from distutils.core import setup
from distutils.core import Command
from unittest import TextTestRunner, TestLoader
import fnmatch
import os, sys
import os.path
import re, glob
from distutils.core import Command
from unittest import TextTestRunner, TestLoader
from glob import glob
from os.path imp... | apache-2.0 |
40223250/w16b_test | static/Brython3.1.1-20150328-091302/Lib/site-packages/pygame/colordict.py | 621 | 24077 | ## pygame - Python Game Library
## Copyright (C) 2000-2003 Pete Shinners
##
## This library is free software; you can redistribute it and/or
## modify it under the terms of the GNU Library General Public
## License as published by the Free Software Foundation; either
## version 2 of the License, or (... | agpl-3.0 |
mitar/django-pushserver | setup.py | 1 | 1615 | #!/usr/bin/env python
import os
from setuptools import setup, find_packages
try:
# Workaround for http://bugs.python.org/issue15881
import multiprocessing
except ImportError:
pass
VERSION = '0.3.4'
if __name__ == '__main__':
setup(
name = 'django-pushserver',
version = VERSION,
... | agpl-3.0 |
petteyg/intellij-community | python/lib/Lib/functools.py | 91 | 2155 | """functools.py - Tools for working with functions and callable objects
"""
# Python module wrapper for _functools C module
# to allow utilities written in Python to be added
# to the functools module.
# Written by Nick Coghlan <ncoghlan at gmail.com>
# Copyright (C) 2006 Python Software Foundation.
# See C source co... | apache-2.0 |
tschmorleiz/amcat | amcat/scripts/output/csv_output.py | 2 | 3285 | ###########################################################################
# (C) Vrije Universiteit, Amsterdam (the Netherlands) #
# #
# This file is part of AmCAT - The Amsterdam Content Analysis Toolkit #
# ... | agpl-3.0 |
lostdj/Jaklin-OpenJFX | modules/web/src/main/native/Tools/Scripts/webkitpy/style/checkers/common_unittest.py | 124 | 5220 | # Copyright (C) 2010 Chris Jerdonek (cjerdonek@webkit.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 and... | gpl-2.0 |
theflofly/tensorflow | tensorflow/python/ops/nn_test.py | 3 | 52884 | # 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 |
colinligertwood/odoo | addons/crm_helpdesk/__init__.py | 442 | 1081 | # -*- 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 |
endlessm/chromium-browser | components/resources/protobufs/binary_proto_generator.py | 6 | 7476 | #!/usr/bin/python
# Copyright 2016 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.
"""
Converts a given ASCII proto into a binary resource.
"""
import abc
import imp
import optparse
import os
import re
import subprocess... | bsd-3-clause |
tedelhourani/ansible | contrib/inventory/cloudforms.py | 145 | 18040 | #!/usr/bin/env python
# vim: set fileencoding=utf-8 :
#
# Copyright (C) 2016 Guido Günther <agx@sigxcpu.org>
#
# This script 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
... | gpl-3.0 |
brianwoo/django-tutorial | ENV/lib/python2.7/site-packages/django/contrib/messages/storage/base.py | 526 | 6285 | from __future__ import unicode_literals
from django.conf import settings
from django.contrib.messages import constants, utils
from django.utils.encoding import force_text, python_2_unicode_compatible
LEVEL_TAGS = utils.get_level_tags()
@python_2_unicode_compatible
class Message(object):
"""
Represents an ac... | gpl-3.0 |
manavgabhawala/swift | utils/swift_build_support/tests/test_arguments.py | 39 | 8166 | # tests/arguments.py --------------------------------------------*- python -*-
#
# This source file is part of the Swift.org open source project
#
# Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
# Licensed under Apache License v2.0 with Runtime Library Exception
#
# See https://swift.org/LICENSE.tx... | apache-2.0 |
prutseltje/ansible | lib/ansible/module_utils/network/f5/bigiq.py | 5 | 3789 | # -*- coding: utf-8 -*-
#
# Copyright (c) 2017 F5 Networks Inc.
# GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
import time
try:
from f5.bigiq import ManagementRoot
from icontrol... | gpl-3.0 |
swcarpentry/amy | amy/workshops/migrations/0054_self_organized_host.py | 2 | 1801 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import re
import django
from django.db import models, migrations
from django.db.models import Q
def add_self_organized_host(apps, schema_editor):
"""Make new host: self-organized."""
Host = apps.get_model('workshops', 'Host')
Host.objects.cr... | mit |
dob71/x2swn | printcore.py | 15 | 2534 | #!/usr/bin/env python
# This file is part of the Printrun suite.
#
# Printrun 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.
#
# Prin... | gpl-3.0 |
cgourlay/readthedocs.org | readthedocs/builds/migrations/0022_add_builder_to_build.py | 5 | 13041 | # -*- 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):
# Adding field 'Build.builder'
db.add_column(u'builds_build', 'builder',
... | mit |
nimnull/django-south | docs/conf.py | 8 | 6289 | # -*- coding: utf-8 -*-
#
# South documentation build configuration file, created by
# sphinx-quickstart on Mon Feb 15 23:32:07 2010.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All c... | apache-2.0 |
arista-eosplus/ansible-modules-extras | packaging/os/dnf.py | 47 | 28095 | #!/usr/bin/python -tt
# -*- coding: utf-8 -*-
# Written by Cristian van Ee <cristian at cvee.org>
#
# 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 ... | gpl-3.0 |
QianBIG/odoo | addons/crm_claim/__init__.py | 390 | 1078 | # -*- 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 |
ezequielpereira/Time-Line | libs/wx/tools/Editra/src/ebmlib/miscutil.py | 2 | 1166 | ###############################################################################
# Name: miscutil.py #
# Purpose: Various helper functions. #
# Author: Cody Precord <cprecord@editra.org> #
... | gpl-3.0 |
dengit/shadowsocks | shadowsocks/local.py | 10 | 2927 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2014 clowwindy
#
# 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
# ... | mit |
ESS-LLP/erpnext | erpnext/selling/report/available_stock_for_packing_items/available_stock_for_packing_items.py | 11 | 2373 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.utils import flt
def execute(filters=None):
if not filters: filters = {}
columns = get_columns()
iwq_map = get_item_ware... | gpl-3.0 |
slank/ansible | lib/ansible/modules/network/nxos/nxos_portchannel.py | 12 | 23422 | #!/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 |
Lion-Wei/kubernetes | hack/boilerplate/boilerplate_test.py | 136 | 1370 | #!/usr/bin/env python
# Copyright 2016 The Kubernetes Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | apache-2.0 |
cdkrot/scanner2web | serve.py | 1 | 1040 | #!/usr/bin/python3
# Copyright (C) 2016 Sayutin Dmitry.
# 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; version 3.
#
# This program is distributed in the hope that it will be useful,
# but WIT... | gpl-3.0 |
repotvsupertuga/tvsupertuga.repository | script.module.livetv/resources/modules/js2py/utils/injector.py | 34 | 5447 | __all__ = ['fix_js_args']
import types
import opcode
# Opcode constants used for comparison and replacecment
LOAD_FAST = opcode.opmap['LOAD_FAST']
LOAD_GLOBAL = opcode.opmap['LOAD_GLOBAL']
STORE_FAST = opcode.opmap['STORE_FAST']
def fix_js_args(func):
'''Use this function when unsure whether func takes this and ... | gpl-2.0 |
100star/h2o | py/testdir_multi_jvm/notest_exec2_indie_multi.py | 9 | 4202 | import unittest, sys, random, time
sys.path.extend(['.','..','../..','py'])
import h2o, h2o_cmd, h2o_browse as h2b, h2o_import as h2i, h2o_jobs, h2o_exec as h2e
import h2o_util
import multiprocessing, os, signal, time
from multiprocessing import Process, Queue
print "just independent exec streams. no sharing"
print "... | apache-2.0 |
abantam/pmtud | nsc/scons-local-1.2.0.d20090223/SCons/Script/__init__.py | 19 | 14260 | """SCons.Script
This file implements the main() function used by the scons script.
Architecturally, this *is* the scons script, and will likely only be
called from the external "scons" wrapper. Consequently, anything here
should not be, or be considered, part of the build engine. If it's
something that we expect ot... | gpl-2.0 |
ilyes14/scikit-learn | examples/preprocessing/plot_function_transformer.py | 161 | 1949 | """
=========================================================
Using FunctionTransformer to select columns
=========================================================
Shows how to use a function transformer in a pipeline. If you know your
dataset's first principle component is irrelevant for a classification task,
you ca... | bsd-3-clause |
yelu/leetcode | LongestConsecutiveSequence.py | 1 | 45525 | class Solution:
# @param num, a list of integer
# @return an integer
# Solution.1. format it to an hash set, visit from one element
# try to expand to left and right, get the longest length and
# mark all visit element.
#.
# first store all the dict in to array[[], []]
# for i in range(len(array))
# for ... | gpl-2.0 |
LeMeteore/python_koans-1 | python2/koans/about_scope.py | 100 | 2871 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from runner.koan import *
import jims
import joes
counter = 0 # Global
class AboutScope(Koan):
#
# NOTE:
# Look in jims.py and joes.py to see definitions of Dog used
# for this set of tests
#
def test_dog_is_not_available_in_the_current_sc... | mit |
duncanwp/cis_esp | web/datasets/load_aggregations.py | 1 | 12743 | import django
django.setup()
def load_aggregations():
from datasets.models import AggregationResult, CIS_Job, Measurement, User, Region
import numpy as np
import iris
datetimes = ["2008-01-01 12:00:00", "2008-01-02 12:00:00", "2008-01-03 12:00:00",
"2008-01-04 12:00:00", "2008-01-05 12:00:00",... | lgpl-3.0 |
rversteegen/commandergenius | project/jni/python/src/Lib/test/test_bsddb185.py | 194 | 1258 | """Tests for the bsddb185 module.
The file 185test.db found in Lib/test/ is for testing purposes with this
testing suite.
"""
from test.test_support import run_unittest, findfile, import_module
import unittest
bsddb185 = import_module('bsddb185', deprecated=True)
import anydbm
import whichdb
import os
import tempfile... | lgpl-2.1 |
dims/ironic | ironic/tests/unit/db/sqlalchemy/test_migrations.py | 2 | 18970 | # Copyright 2010-2011 OpenStack Foundation
# Copyright 2012-2013 IBM Corp.
# 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/li... | apache-2.0 |
JohanComparat/nbody-npt-functions | bin/bin_SMHMr/create_AGN_catalog_gawk.py | 1 | 2344 | # overall python packages
import glob
#import astropy.io.fits as fits
# 2397897 143.540054 0.032711 20.449619 119.370173 9.753314 33.197590 -1.000000 25.191960 40.977921 2 127
# ------ -------- -------- ra dec
import os
import time
import numpy as n
import sys
t0=time.time()
#from astropy.cosmology import ... | cc0-1.0 |
pombreda/django-hotclub | libs/external_libs/Pygments-0.11.1/pygments/lexer.py | 19 | 22626 | # -*- coding: utf-8 -*-
"""
pygments.lexer
~~~~~~~~~~~~~~
Base lexer classes.
:copyright: 2006-2007 by Georg Brandl.
:license: BSD, see LICENSE for more details.
"""
import re
try:
set
except NameError:
from sets import Set as set
from pygments.filter import apply_filters, Filter
from py... | mit |
jymannob/Sick-Beard | sickbeard/clients/requests/packages/charade/gb2312freq.py | 3132 | 36011 | ######################## 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... | gpl-3.0 |
weisongchen/flaskapp | venv/lib/python2.7/site-packages/sqlalchemy/dialects/mysql/__init__.py | 32 | 1185 | # mysql/__init__.py
# Copyright (C) 2005-2017 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
from . import base, mysqldb, oursql, \
pyodbc, zxjdbc, mysqlconnector, pymysql... | mit |
gclenaghan/scikit-learn | examples/applications/topics_extraction_with_nmf_lda.py | 18 | 3768 | """
=======================================================================================
Topic extraction with Non-negative Matrix Factorization and Latent Dirichlet Allocation
=======================================================================================
This is an example of applying Non-negative Matrix ... | bsd-3-clause |
erdc/proteus | proteus/tests/surface_tension/rising_bubble_rans3p/vof_n.py | 1 | 1873 | from __future__ import absolute_import
from proteus import *
try:
from .risingBubble import *
from .vof_p import *
except:
from risingBubble import *
from vof_p import *
if timeDiscretization=='vbdf':
timeIntegration = VBDF
timeOrder=2
stepController = Min_dt_cfl_controller
elif timeDi... | mit |
jmehnle/ansible | lib/ansible/utils/module_docs_fragments/fortios.py | 17 | 2306 | #
# (c) 2017, Benjamin Jolivot <bjolivot@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) any later... | gpl-3.0 |
Philippe12/external_chromium_org | third_party/protobuf/python/google/protobuf/internal/descriptor_database_test.py | 213 | 2872 | #! /usr/bin/python
#
# Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
# http://code.google.com/p/protobuf/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# ... | bsd-3-clause |
lauria/Samba4 | lib/dnspython/dns/rdtypes/IN/IPSECKEY.py | 100 | 5993 | # Copyright (C) 2006, 2007, 2009-2011 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
# provided that the above copyright notice and this permission notice
# appear in all copies.
#
# THE SOFTWARE IS PROVIDED ... | gpl-3.0 |
anhaidgroup/py_stringsimjoin | py_stringsimjoin/tests/test_size_filter.py | 1 | 25474 | import unittest
from nose.tools import assert_equal, assert_list_equal, nottest, raises
from py_stringmatching.tokenizer.delimiter_tokenizer import DelimiterTokenizer
from py_stringmatching.tokenizer.qgram_tokenizer import QgramTokenizer
import numpy as np
import pandas as pd
from py_stringsimjoin.filter.size_filter ... | bsd-3-clause |
sbalde/edx-platform | lms/djangoapps/shoppingcart/tests/test_pdf.py | 165 | 11086 | """
Tests for Pdf file
"""
from datetime import datetime
from django.test.utils import override_settings
from django.conf import settings
import unittest
from io import BytesIO
from shoppingcart.pdf import PDFInvoice
from shoppingcart.utils import parse_pages
PDF_RECEIPT_DISCLAIMER_TEXT = "THE SITE AND ANY INFORMATION... | agpl-3.0 |
newmediamedicine/indivo_server_1_0 | indivo/tests/api/accounts_tests.py | 1 | 10862 | import django.test
from indivo.models import *
from indivo.tests.internal_tests import InternalTests, TransactionInternalTests
from django.utils.http import urlencode
from indivo.tests.data import *
from lxml import etree
from indivo.lib import iso8601
def accountStateSetUp(test_cases_instance):
_self = test_case... | gpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.