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
glennlive/gnuradio-wg-grc
gr-blocks/python/blocks/qa_hier_block2.py
21
16253
#!/usr/bin/env python from gnuradio import gr, gr_unittest, blocks import numpy import time class add_ff(gr.sync_block): def __init__(self): gr.sync_block.__init__( self, name = "add_ff", in_sig = [numpy.float32, numpy.float32], out_sig = [numpy.float32], ...
gpl-3.0
n4hy/gnuradio
gr-pager/apps/usrp_flex.py
6
6326
#!/usr/bin/env python # # Copyright 2006,2007,2009,2011 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 (a...
gpl-3.0
ddalex/django-cemplate
django_speedboost/context_processors.py
56
2505
""" A set of request processors that return dictionaries to be merged into a template context. Each function takes the request object as its only parameter and returns a dictionary to add to the context. These are referenced from the 'context_processors' option of the configuration of a DjangoTemplates backend and use...
mit
GDGLima/contentbox
third_party/django/contrib/gis/db/models/sql/where.py
118
3987
from django.db.models.constants import LOOKUP_SEP from django.db.models.fields import FieldDoesNotExist from django.db.models.sql.expressions import SQLEvaluator from django.db.models.sql.where import Constraint, WhereNode from django.contrib.gis.db.models.fields import GeometryField class GeoConstraint(Constraint): ...
apache-2.0
fafaman/django
django/core/validators.py
60
15105
from __future__ import unicode_literals import re from django.core.exceptions import ValidationError from django.utils import six from django.utils.deconstruct import deconstructible from django.utils.encoding import force_text from django.utils.functional import SimpleLazyObject from django.utils.ipv6 import is_vali...
bsd-3-clause
kobejean/tensorflow
tensorflow/contrib/data/python/kernel_tests/reader_dataset_ops_test_base.py
1
12514
# 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
Joergen/zamboni
mkt/webpay/tasks.py
7
3623
from datetime import datetime, timedelta import logging import os import tempfile from django.conf import settings from django.core.files.storage import default_storage as storage from django.db import transaction from celeryutils import task import requests from amo.utils import ImageCheck, resize_image from .mode...
bsd-3-clause
procangroup/edx-platform
common/test/acceptance/tests/studio/test_studio_help.py
7
43469
""" Test the Studio help links. """ from unittest import skip from nose.plugins.attrib import attr from common.test.acceptance.fixtures.course import XBlockFixtureDesc from common.test.acceptance.pages.common.auto_auth import AutoAuthPage from common.test.acceptance.pages.studio.asset_index import AssetIndexPage fro...
agpl-3.0
coderfi/ansible-modules-extras
database/redis.py
41
10582
#!/usr/bin/python # -*- coding: utf-8 -*- # 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. #...
gpl-3.0
roger-zhao/ardupilot-3.3
Tools/ardupilotwaf/cmake.py
9
11091
#!/usr/bin/env python # encoding: utf-8 # Copyright (C) 2015-2016 Intel Corporation. All rights reserved. # # This file 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
liangazhou/django-rdp
packages/eclipse/plugins/org.python.pydev.jython_4.4.0.201510052309/Lib/distutils/command/build_clib.py
176
8131
"""distutils.command.build_clib Implements the Distutils 'build_clib' command, to build a C/C++ library that is included in the module distribution and needed by an extension module.""" __revision__ = "$Id$" # XXX this module has *lots* of code ripped-off quite transparently from # build_ext.py -- not surprisingly ...
apache-2.0
AlexHill/django
tests/utils_tests/test_autoreload.py
3
2320
import os from django import conf from django.contrib import admin from django.test import TestCase, override_settings from django.utils.autoreload import gen_filenames LOCALE_PATH = os.path.join(os.path.dirname(__file__), 'locale') class TestFilenameGenerator(TestCase): def test_django_locales(self): "...
bsd-3-clause
akaihola/PyWO
tests/core/filters_test.py
1
11774
#!/usr/bin/env python import unittest import sys sys.path.insert(0, '../') sys.path.insert(0, './') from tests.common_test import MockedXlibTests from tests.common_test import DESKTOPS, DESKTOP_WIDTH, DESKTOP_HEIGHT, VIEWPORTS from pywo.core import Geometry, State, Type, Mode, Window from pywo.core import filters ...
gpl-3.0
yandex/libmastermind
tests/bindings/python/messages.py
2
1443
# coding=utf-8 import sys class TeamcityServiceMessages(object): quote = {"'": "|'", "|": "||", "\n": "|n", "\r": "|r", ']': '|]'} def __init__(self, output=sys.stdout): self.output = output def escapeValue(self, value): return "".join([self.quote.get(x, x) for x in value]) def mess...
gpl-2.0
brugger/kbr-tools
kbr/crypt_utils.py
1
1652
import secrets import string from Crypto.Cipher import Blowfish from Crypto.Random import get_random_bytes import codecs id_cipher = None def init( id_secret:str) -> None: global id_cipher id_cipher = Blowfish.new(id_secret.encode('utf-8'), mode=Blowfish.MODE_ECB) def decrypt_value(value:str) -> str: v...
mit
gazbert/bitcoin
qa/rpc-tests/mempool_limit.py
34
2178
#!/usr/bin/env python3 # Copyright (c) 2014-2016 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # Test mempool limiting together/eviction with the wallet from test_framework.test_framework import Bitc...
mit
DeltaEpsilon-HackFMI2/FMICalendar-REST
venv/lib/python2.7/site-packages/django/utils/numberformat.py
337
1775
from django.conf import settings from django.utils.safestring import mark_safe from django.utils import six def format(number, decimal_sep, decimal_pos=None, grouping=0, thousand_sep='', force_grouping=False): """ Gets a number (as a number or string), and returns it as a string, using formats ...
mit
166MMX/openjdk.java.net-openjfx-8u40-rt
modules/web/src/main/native/Tools/Scripts/webkitpy/tool/steps/haslanded.py
128
5225
# 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 the ...
gpl-2.0
felipenaselva/repo.felipe
plugin.video.playlistLoader/resources/lib/chardet/hebrewprober.py
2929
13359
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Shy Shalom # Portions created by the Initial Developer are Copyright (C) 2005 # the Initial Developer. All Rights Reserved. #...
gpl-2.0
caosmo/pip
pip/_vendor/requests/packages/urllib3/connectionpool.py
477
30319
import errno import logging import sys import warnings from socket import error as SocketError, timeout as SocketTimeout import socket try: # Python 3 from queue import LifoQueue, Empty, Full except ImportError: from Queue import LifoQueue, Empty, Full import Queue as _ # Platform-specific: Windows fr...
mit
laurogama/artigo_pos
environ_wsn/client/Adafruit_I2C.py
2
5500
#!/usr/bin/python import re import smbus # =========================================================================== # Adafruit_I2C Class # =========================================================================== class Adafruit_I2C(object): @staticmethod def getPiRevision(): "Gets the version number of ...
gpl-2.0
daoluan/decode-Django
Django-1.5.1/django/db/models/aggregates.py
521
2101
""" Classes to represent the definitions of aggregate functions. """ class Aggregate(object): """ Default Aggregate definition. """ def __init__(self, lookup, **extra): """Instantiate a new aggregate. * lookup is the field on which the aggregate operates. * extra is a diction...
gpl-2.0
noironetworks/heat
heat/scaling/cooldown.py
1
4427
# # 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 # ...
apache-2.0
rgom/Pydev
plugins/org.python.pydev/pysrc/pydevd_attach_to_process/winappdbg/plugins/do_exchain.py
100
2307
#!~/.wine/drive_c/Python25/python.exe # -*- coding: utf-8 -*- # Command line debugger using WinAppDbg # Show exception handlers list # Copyright (c) 2009-2014, Mario Vilas # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the follo...
epl-1.0
jordanemedlock/psychtruths
temboo/core/Library/Tumblr/Post/RetrieveDraftPosts.py
5
4578
# -*- coding: utf-8 -*- ############################################################################### # # RetrieveDraftPosts # Retrieves a list of queued posts for a specified Tumblr blog. # # Python versions 2.6, 2.7, 3.x # # Copyright 2014, Temboo Inc. # # Licensed under the Apache License, Version 2.0 (the "Licen...
apache-2.0
nareshganatra/apiai
lib/werkzeug/__init__.py
296
7210
# -*- coding: utf-8 -*- """ werkzeug ~~~~~~~~ Werkzeug is the Swiss Army knife of Python web development. It provides useful classes and functions for any WSGI application to make the life of a python web developer much easier. All of the provided classes are independent from each other so yo...
apache-2.0
ravenac95/virtstrap
virtstrap/tests/test_init_command.py
1
3279
""" Initialize Command ================== Very high level tests for the virtstrap runner """ import os import sys import fudge import subprocess from nose.tools import raises from nose.plugins.attrib import attr from virtstrap import constants from virtstrap.testing import * from virtstrap.options import create_base_p...
mit
slyon/MoonGen
deps/dpdk/app/test/autotest.py
17
2882
#!/usr/bin/python # BSD LICENSE # # Copyright(c) 2010-2014 Intel Corporation. All rights reserved. # 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 sourc...
mit
tmhm/scikit-learn
sklearn/manifold/tests/test_isomap.py
226
3941
from itertools import product import numpy as np from numpy.testing import assert_almost_equal, assert_array_almost_equal from sklearn import datasets from sklearn import manifold from sklearn import neighbors from sklearn import pipeline from sklearn import preprocessing from sklearn.utils.testing import assert_less ...
bsd-3-clause
bigoldboy/repository.bigoldboy
script.tvguide.fullscreen/resources/playwith/playwithchannel.py
2
2932
import sys import xbmc,xbmcaddon,xbmcvfs import sqlite3 from subprocess import Popen import datetime,time # from vpnapi import VPNAPI channel = sys.argv[1] start = sys.argv[2] ADDON = xbmcaddon.Addon(id='script.tvguide.fullscreen') def adapt_datetime(ts): # http://docs.python.org/2/library/sqlite3.html#registeri...
gpl-3.0
mulkieran/stratisd
tests/client-dbus/check.py
2
1308
#!/usr/bin/python import argparse import subprocess import sys arg_map = { "src/stratisd_client_dbus": [ "--reports=no", "--disable=I", "--disable=invalid-name", "--msg-template='{path}:{line}: [{msg_id}({symbol}), {obj}] {msg}'" ], "tests": [ "--reports=no", "--disable=I", "--disa...
mpl-2.0
23andMe/ansible-modules-core
cloud/amazon/ec2_snapshot.py
67
10167
#!/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 distributed...
gpl-3.0
nitinitprof/odoo
addons/hr_timesheet/report/hr_timesheet_report.py
262
2705
from openerp import tools from openerp.osv import fields,osv from openerp.addons.decimal_precision import decimal_precision as dp class hr_timesheet_report(osv.osv): _name = "hr.timesheet.report" _description = "Timesheet" _auto = False _columns = { 'date': fields.date('Date', readonly=True), ...
agpl-3.0
cuongnv23/ansible
lib/ansible/plugins/lookup/etcd.py
8
4861
# (c) 2013, Jan-Piet Mens <jpmens(at)gmail.com> # (m) 2017, Juan Manuel Parrilla <jparrill@redhat.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 versio...
gpl-3.0
1haodian/spark
examples/src/main/python/ml/bisecting_k_means_example.py
69
1777
# # 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
450586509/DLNLP
src/viterbi.py
1
2575
#code form http://www.jianshu.com/p/7e233ef57cb6 def _print(hiddenstates, V): s = " " + " ".join(("%7d" % i) for i in range(len(V))) + "\n" for i, state in enumerate(hiddenstates): s += "%.5s: " % state s += " ".join("%.7s" % ("%f" % v[i]) for v in V) s += "\n" print(s) #标准viterb...
apache-2.0
kiranvizru/psutil
test/_bsd.py
23
7730
#!/usr/bin/env python # Copyright (c) 2009, Giampaolo Rodola'. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. # TODO: add test for comparing connections with 'sockstat' cmd """BSD specific tests. These are implicitly run by test_psutil.py."...
bsd-3-clause
fabiencro/knmt
nmt_chainer/training_module/training_chainer.py
1
45275
#!/usr/bin/env python """training.py: training procedures.""" from __future__ import (absolute_import, division, print_function, unicode_literals) import datetime import json import logging import math import socket import sys import time import chainer.dataset.iterator import chainer.function...
gpl-3.0
evanccnyc/ansible
contrib/inventory/spacewalk.py
108
8666
#!/bin/env python """ Spacewalk external inventory script ================================= Ansible has a feature where instead of reading from /etc/ansible/hosts as a text file, it can query external programs to obtain the list of hosts, groups the hosts are in, and even variables to assign to each host. To use thi...
gpl-3.0
klen/adrest
tests/rpc/tests.py
1
6711
from adrest.tests.utils import AdrestTestCase from mixer.backend.django import mixer import json as js from .api import API from .models import Root, Child class RPCTestCase(AdrestTestCase): api = API def setUp(self): self.root1 = Root.objects.create(name='test_root1') for i in xrange(10): ...
lgpl-3.0
fossoult/odoo
addons/account_payment/account_move_line.py
241
4455
# -*- 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
ShanghaiTimes/Audacity2015
lib-src/lv2/serd/waflib/Tools/python.py
177
13335
#! /usr/bin/env python # encoding: utf-8 # WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file import os,sys from waflib import Utils,Options,Errors,Logs from waflib.TaskGen import extension,before_method,after_method,feature from waflib.Configure import conf FRAG=''' #...
gpl-2.0
jsoref/django
django/utils/datastructures.py
394
9231
import copy from collections import OrderedDict from django.utils import six class OrderedSet(object): """ A set which keeps the ordering of the inserted items. Currently backs onto OrderedDict. """ def __init__(self, iterable=None): self.dict = OrderedDict(((x, None) for x in iterable) ...
bsd-3-clause
LibriCerule/Cerulean_Tracking
env/lib/python3.5/site-packages/pip/_vendor/html5lib/treewalkers/lxmletree.py
436
5992
from __future__ import absolute_import, division, unicode_literals from pip._vendor.six import text_type from lxml import etree from ..treebuilders.etree import tag_regexp from . import _base from .. import ihatexml def ensure_str(s): if s is None: return None elif isinstance(s, text_type): ...
mit
cnewcome/sos
sos/plugins/nfsganesha.py
2
1519
# This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # This program is distributed in the hope that it will be useful, # but...
gpl-2.0
petrus-v/odoo
addons/sale_stock/__openerp__.py
9
2598
# -*- 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
ccn-2m/django
django/contrib/admin/templatetags/log.py
104
2124
from django import template from django.contrib.admin.models import LogEntry register = template.Library() class AdminLogNode(template.Node): def __init__(self, limit, varname, user): self.limit, self.varname, self.user = limit, varname, user def __repr__(self): return "<GetAdminLog Node>" ...
bsd-3-clause
AlexanderSavelyev/rdkit
rdkit/Chem/Fraggle/FraggleSim.py
1
16925
# Copyright (c) 2013, GlaxoSmithKline Research & Development Ltd. # 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 # ...
bsd-3-clause
Northrend/mxnet
tools/ipynb2md.py
41
2272
#!/usr/bin/env python # 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 # "L...
apache-2.0
bunnyitvn/webptn
django/templatetags/tz.py
114
5523
from datetime import datetime, tzinfo try: import pytz except ImportError: pytz = None from django.template import Node from django.template import TemplateSyntaxError, Library from django.utils import six from django.utils import timezone register = Library() # HACK: datetime is an old-style class, create...
bsd-3-clause
bread-and-pepper/django-userena
userena/contrib/umessages/south_migrations/0001_initial.py
20
8118
# encoding: 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 model 'MessageContact' db.create_table('umessages_messagecontact', ( ('id', self.gf('django.d...
bsd-3-clause
nhippenmeyer/django
tests/utils_tests/test_http.py
220
8102
from __future__ import unicode_literals import sys import unittest from datetime import datetime from django.utils import http, six from django.utils.datastructures import MultiValueDict class TestUtilsHttp(unittest.TestCase): def test_same_origin_true(self): # Identical self.assertTrue(http.sa...
bsd-3-clause
EpicCM/SPH-D700-Kernel
external/webkit/WebKitTools/wx/build/settings.py
3
14134
# Copyright (C) 2009 Kevin Ollivier 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 th...
gpl-2.0
yavalvas/yav_com
build/matplotlib/lib/mpl_toolkits/axisartist/grid_helper_curvelinear.py
18
26105
""" An experimental support for curvilinear grid. """ from __future__ import (absolute_import, division, print_function, unicode_literals) import six from six.moves import zip from itertools import chain from .grid_finder import GridFinder from .axislines import AxisArtistHelper, GridHelperB...
mit
dmlc/tvm
python/tvm/topi/testing/lrn_python.py
5
2543
# 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 u...
apache-2.0
ssaeger/scikit-learn
sklearn/cluster/tests/test_dbscan.py
176
12155
""" Tests for DBSCAN clustering algorithm """ import pickle import numpy as np from scipy.spatial import distance from scipy import sparse from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing import assert_raises from sklearn.utils.testing im...
bsd-3-clause
oliverhr/odoo
addons/auth_openid/controllers/__init__.py
443
1033
############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2011 OpenERP SA (<http://openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public L...
agpl-3.0
robertglen/flask
flask/templating.py
141
4529
# -*- coding: utf-8 -*- """ flask.templating ~~~~~~~~~~~~~~~~ Implements the bridge to Jinja2. :copyright: (c) 2015 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ from jinja2 import BaseLoader, Environment as BaseEnvironment, \ TemplateNotFound from .globals import _requ...
bsd-3-clause
le9i0nx/ansible
lib/ansible/modules/cloud/azure/azure_rm_virtualmachine_extension.py
7
9979
#!/usr/bin/python # # Copyright (c) 2017 Sertac Ozercan <seozerca@microsoft.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_version': '1.1', ...
gpl-3.0
devops2014/djangosite
django/apps/registry.py
1
13013
import sys import threading import warnings from collections import Counter, OrderedDict, defaultdict from django.core.exceptions import AppRegistryNotReady, ImproperlyConfigured from django.utils import lru_cache from .config import AppConfig class Apps(object): """ A registry that stores the configuration...
bsd-3-clause
jfinkels/birkhoff
make-release.py
1
7767
#!/usr/bin/env python3 # # make-release.py - facilitates releasing and publishing versions of a package # # Copyright (c) 2011 by Armin Ronacher. # Copyright 2014 Jeffrey Finkelstein. # # Some rights reserved. # # Redistribution and use in source and binary forms of the software as well as # documentation, with or with...
gpl-3.0
stefan-jonasson/home-assistant
homeassistant/components/fan/mqtt.py
3
11399
""" Support for MQTT fans. For more details about this platform, please refer to the documentation https://home-assistant.io/components/fan.mqtt/ """ import asyncio import logging import voluptuous as vol from homeassistant.core import callback import homeassistant.components.mqtt as mqtt from homeassistant.const im...
mit
ohmu/pghoard
pghoard/rohmu/inotify.py
1
5020
""" rohmu - inotify wrapper Copyright (c) 2016 Ohmu Ltd See LICENSE for details """ import ctypes import logging import os import select import struct from ctypes import c_char_p, c_int, c_uint32 from threading import Thread from .compat import suppress class InotifyEvent(ctypes.Structure): _fields_ = [ ...
apache-2.0
ychen820/microblog
y/google-cloud-sdk/lib/requests/packages/urllib3/fields.py
294
5976
# urllib3/fields.py # Copyright 2008-2013 Andrey Petrov and contributors (see CONTRIBUTORS.txt) # # This module is part of urllib3 and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php import email.utils import mimetypes from .packages import six def guess_content_type(filename...
bsd-3-clause
wreckJ/intellij-community
plugins/hg4idea/testData/bin/hgext/hgk.py
93
11930
# Minimal support for git commands on an hg repository # # Copyright 2005, 2006 Chris Mason <mason@suse.com> # # This software may be used and distributed according to the terms of the # GNU General Public License version 2 or any later version. '''browse the repository in a graphical way The hgk extension allows bro...
apache-2.0
kiwitcms/Kiwi
tcms/core/tests/test_utils.py
2
3152
import unittest from unittest.mock import patch from django.conf import settings from django.core.mail import send_mail from django.template.loader import render_to_string from tcms.core.utils.mailto import mailto class TestMailTo(unittest.TestCase): def setUp(self): self.expected_subject = "Test Subjec...
gpl-2.0
habitam/habitam-core
habitam/ui/forms/billable_edit_form.py
1
7718
# -*- coding: utf-8 -*- ''' This file is part of Habitam. Habitam 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 your option) any later version. Habitam is distr...
agpl-3.0
enthought/machotools
machotools/tests/test_detect.py
2
1256
import unittest from machotools.detect import is_macho, is_dylib, is_executable, is_bundle from machotools.tests.common import ( FOO_DYLIB, SIMPLE_MAIN, SIMPLE_BUNDLE, NO_MACHO_FILE, TINY_FILE ) class TestDetect(unittest.TestCase): def test_tiny_file(self): self.assertFalse(is_macho(TINY_FILE)) ...
bsd-3-clause
odoousers2014/odoo_addons-2
clv_frame/wkf/clv_frame_wkf.py
1
3293
# -*- encoding: utf-8 -*- ################################################################################ # # # Copyright (C) 2013-Today Carlos Eduardo Vercelino - CLVsol # # ...
agpl-3.0
jcshen007/cloudstack
systemvm/patches/debian/config/opt/cloud/bin/cs/CsRoute.py
2
4461
# -- coding: utf-8 -- # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "Li...
apache-2.0
15Dkatz/pants
tests/python/pants_test/source/test_wrapped_globs.py
5
9912
# coding=utf-8 # Copyright 2014 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 textw...
apache-2.0
nikolas/lettuce
tests/integration/lib/Django-1.2.5/django/utils/datastructures.py
51
14876
from types import GeneratorType from django.utils.copycompat import deepcopy class MergeDict(object): """ A simple class for creating new "virtual" dictionaries that actually look up values in more than one dictionary, passed in the constructor. If a key appears in more than one of the given diction...
gpl-3.0
alexallah/django
django/contrib/staticfiles/management/commands/runserver.py
16
1315
from django.conf import settings from django.contrib.staticfiles.handlers import StaticFilesHandler from django.core.management.commands.runserver import \ Command as RunserverCommand class Command(RunserverCommand): help = "Starts a lightweight Web server for development and also serves static files." d...
bsd-3-clause
lancezlin/ml_template_py
lib/python2.7/site-packages/numpy/lib/tests/test_format.py
27
34230
from __future__ import division, absolute_import, print_function r''' Test the .npy file format. Set up: >>> import sys >>> from io import BytesIO >>> from numpy.lib import format >>> >>> scalars = [ ... np.uint8, ... np.int8, ... np.uint16, ... np.int16, ... ...
mit
hantonov/ansible-modules-core
cloud/google/gce_lb.py
51
12569
#!/usr/bin/python # Copyright 2013 Google 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 vers...
gpl-3.0
pdufour/sqlalchemy
lib/sqlalchemy/event/base.py
60
9540
# event/base.py # Copyright (C) 2005-2015 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 """Base implementation classes. The public-facing ``Events`` serves as the base class...
mit
iLampard/alphaware
alphaware/tests/utils/test_input_validation.py
1
3236
# -*- coding: utf-8 -*- from unittest import TestCase from parameterized import parameterized import pandas as pd import numpy as np from numpy.testing.utils import assert_array_equal from xutils.date_utils import Date from pandas.util.testing import (assert_series_equal, assert_frame_...
apache-2.0
mcltn/ansible
contrib/inventory/openvz.py
79
2692
#!/usr/bin/env python # -*- coding: utf-8 -*- # # openvz.py # # Copyright 2014 jordonr <jordon@beamsyn.net> # # 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 ...
gpl-3.0
cloudbase/nova-virtualbox
nova/api/openstack/compute/contrib/baremetal_nodes.py
60
6552
# Copyright (c) 2013 NTT DOCOMO, 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 requ...
apache-2.0
pldubouilh/YABATMan
genkeys.py
1
1309
# This file is part of Piper. # # Piper 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. # # Piper is distributed in the ...
gpl-2.0
ewdurbin/raven-python
raven/handlers/logging.py
3
6145
""" raven.handlers.logging ~~~~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2010-2012 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ from __future__ import absolute_import from __future__ import print_function import datetime import logging import sys import traceback from ...
bsd-3-clause
darcamo/pyphysim
bin/combine_results.py
1
1620
#!/usr/bin/env python """ Script that reads two files with saved SimulationResults and combine them into a new SimulationResults which is saved to a new file. """ import argparse from pyphysim.simulations.results import (SimulationResults, combine_simulation_results) from pyp...
gpl-2.0
chungy/voltdb-utils
src/shutdown.py
1
2982
#!/usr/bin/env python2 # Copyright (c) 2011-2012 PM Development, LLC # Permission to use, copy, modify, and distribute this software 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 "AS IS" ...
isc
un33k/robotframework
utest/parsing/test_populator.py
16
29054
import unittest from StringIO import StringIO from robot.parsing.populators import FromFilePopulator, DataRow, FromDirectoryPopulator from robot.parsing.model import TestCaseFile from robot.utils.asserts import assert_equals, assert_true, assert_false from robot.output import LOGGER LOGGER.unregister_console_logger...
apache-2.0
jaw20/Crunchyroll-XML-Decoder
crunchy-xml-decoder/unidecode/x066.py
252
4677
data = ( 'Yun ', # 0x00 'Bei ', # 0x01 'Ang ', # 0x02 'Ze ', # 0x03 'Ban ', # 0x04 'Jie ', # 0x05 'Kun ', # 0x06 'Sheng ', # 0x07 'Hu ', # 0x08 'Fang ', # 0x09 'Hao ', # 0x0a 'Gui ', # 0x0b 'Chang ', # 0x0c 'Xuan ', # 0x0d 'Ming ', # 0x0e 'Hun ', # 0x0f 'Fen ', # 0x10 ...
gpl-2.0
duaneg/mongrel2
examples/tornado/authdemo.py
101
2405
#!/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...
bsd-3-clause
gacarrillor/QGIS
python/plugins/grassprovider/ext/r_li_shannon.py
45
1296
# -*- coding: utf-8 -*- """ *************************************************************************** r_li_shannon.py ---------------- Date : February 2016 Copyright : (C) 2016 by Médéric Ribreux Email : medspx at medspx dot fr ***************************...
gpl-2.0
codingdojotw/CppMiniTutorial
third_party/gmock-1.7.0/scripts/generator/cpp/ast.py
268
62296
#!/usr/bin/env python # # Copyright 2007 Neal Norwitz # Portions Copyright 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...
mit
piffey/ansible
lib/ansible/plugins/action/win_reboot.py
22
8340
# (c) 2016, Matt Davis <mdavis@ansible.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 import time from datetime import datetime, timedelta from ansible.errors import AnsibleErro...
gpl-3.0
hkernbach/arangodb
3rdParty/V8/v5.7.492.77/tools/gyp/test/actions/src/subdir1/counter.py
261
1107
#!/usr/bin/env python # Copyright (c) 2010 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 sys import time output = sys.argv[1] persistoutput = "%s.persist" % sys.argv[1] count = 0 try: count = open(persistoutput, 'r').r...
apache-2.0
leki75/ansible
test/runner/lib/pytar.py
72
1710
"""Python native TGZ creation.""" from __future__ import absolute_import, print_function import tarfile import os from lib.util import ( display, ) # improve performance by disabling uid/gid lookups tarfile.pwd = None tarfile.grp = None # To reduce archive time and size, ignore non-versioned files which are la...
gpl-3.0
jwomeara/mapnik
demo/python/rundemo.py
9
13282
#!/usr/bin/env python # -*- coding: utf-8 -*- # # # # This file is part of Mapnik (c++ mapping toolkit) # Copyright (C) 2005 Jean-Francois Doyon # # Mapnik 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; eithe...
lgpl-2.1
Deepomatic/DIGITS
digits/dataset/images/generic/forms.py
6
2735
# Copyright (c) 2015-2017, NVIDIA CORPORATION. All rights reserved. from __future__ import absolute_import import os.path import wtforms from wtforms import validators from ..forms import ImageDatasetForm from digits import utils from digits.utils.forms import validate_required_iff class GenericImageDatasetForm(I...
bsd-3-clause
william-richard/moto
moto/ec2/models.py
1
221847
from __future__ import unicode_literals import copy import itertools import ipaddress import json import os import re import six import warnings from boto3 import Session from pkg_resources import resource_filename from collections import defaultdict import weakref from datetime import datetime from moto.packages.bo...
apache-2.0
phrocker/accumulo
test/system/auto/simple/delete.py
2
2453
# 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 use ...
apache-2.0
baconz/shaka-player
third_party/gjslint/python-gflags-2.0/tests/gflags_helpxml_test.py
139
20061
#!/usr/bin/env python # Copyright (c) 2009, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this l...
apache-2.0
LaoZhongGu/kbengine
kbe/src/lib/python/Lib/multiprocessing/connection.py
4
14987
# # A higher level module for using sockets (or Windows named pipes) # # multiprocessing/connection.py # # Copyright (c) 2006-2008, R Oudkerk # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # ...
lgpl-3.0
robertwb/incubator-beam
sdks/python/apache_beam/runners/interactive/display/pcoll_visualization_test.py
5
8679
# # 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
sfepy/sfepy
tests/test_conditions.py
5
9724
from __future__ import absolute_import import os.path as op import numpy as nm from sfepy import data_dir from sfepy.base.testing import TestCommon import six def init_vec(variables): return nm.random.rand(variables.di.ptr[-1]) def check_vec(self, vec, ii, ok, conds, variables): from sfepy.discrete.common....
bsd-3-clause
epitron/youtube-dl
youtube_dl/extractor/kakao.py
21
5295
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor from ..compat import compat_str from ..utils import ( int_or_none, unified_timestamp, update_url_query, ) class KakaoIE(InfoExtractor): _VALID_URL = r'https?://tv\.kakao\.com/channel/(?P<channel>\d+)/cliplink/(...
unlicense