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 |
|---|---|---|---|---|---|
eadgarchen/tensorflow | tensorflow/python/keras/_impl/keras/applications/__init__.py | 14 | 1450 | # 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 |
uni-peter-zheng/autotest | utils/service_helper.py | 4 | 4191 | #!/usr/bin/python
"""Service launcher that creates pidfiles and can redirect output to a file."""
import subprocess
import sys
import os
import optparse
import signal
import pwd
import grp
import re
def stop_service(pidfile):
"""
Stop a service using a pidfile.
Read the first line of a file for an intege... | gpl-2.0 |
thepropterhoc/Cha_The_Pivot | app/node_modules/mailin/python/DNS/Base.py | 12 | 17423 | """
$Id: Base.py,v 1.12.2.19 2011/11/23 17:14:11 customdesigned Exp $
This file is part of the pydns project.
Homepage: http://pydns.sourceforge.net
This code is covered by the standard Python License. See LICENSE for details.
Base functionality. Request and Response classes, that sort of thing.
"""
import soc... | mit |
lightcn/odoo | addons/l10n_fr/l10n_fr.py | 336 | 2089 | # -*- 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 |
hryamzik/ansible | lib/ansible/modules/system/sysctl.py | 42 | 13700 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2012, David "DaviXX" CHANIAL <david.chanial@gmail.com>
# (c) 2014, James Tanner <tanner.jc@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
__metaclas... | gpl-3.0 |
rickerc/ceilometer_audit | ceilometer/openstack/common/rpc/common.py | 3 | 18551 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
# Copyright 2011 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not... | apache-2.0 |
throwable-one/lettuce | tests/integration/lib/Django-1.3/django/db/models/related.py | 231 | 3157 | from django.utils.encoding import smart_unicode
from django.db.models.fields import BLANK_CHOICE_DASH
class BoundRelatedObject(object):
def __init__(self, related_object, field_mapping, original):
self.relation = related_object
self.field_mappings = field_mapping[related_object.name]
def templ... | gpl-3.0 |
bop/rango | lib/python2.7/site-packages/setuptools/_backport/hashlib/_sha256.py | 77 | 11559 | import struct
SHA_BLOCKSIZE = 64
SHA_DIGESTSIZE = 32
def new_shaobject():
return {
'digest': [0]*8,
'count_lo': 0,
'count_hi': 0,
'data': [0]* SHA_BLOCKSIZE,
'local': 0,
'digestsize': 0
}
ROR = lambda x, y: (((x & 0xffffffff) >> (y & 31)) | (x << (32 - (y & 31... | gpl-2.0 |
airbnb/kafka | tests/kafkatest/tests/core/get_offset_shell_test.py | 17 | 4029 | # 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 |
pjryan126/solid-start-careers | store/api/zillow/venv/lib/python2.7/site-packages/pip/_vendor/html5lib/utils.py | 436 | 3267 | from __future__ import absolute_import, division, unicode_literals
from types import ModuleType
from pip._vendor.six import text_type
try:
import xml.etree.cElementTree as default_etree
except ImportError:
import xml.etree.ElementTree as default_etree
__all__ = ["default_etree", "MethodDispatcher", "isSurr... | gpl-2.0 |
Y3K/django | django/template/loaders/locmem.py | 464 | 1194 | """
Wrapper for loading templates from a plain Python dict.
"""
import warnings
from django.template import Origin, TemplateDoesNotExist
from django.utils.deprecation import RemovedInDjango20Warning
from .base import Loader as BaseLoader
class Loader(BaseLoader):
def __init__(self, engine, templates_dict):
... | bsd-3-clause |
int19h/PTVS | Python/Product/Miniconda/Miniconda3-x64/Lib/site-packages/chardet/compat.py | 270 | 1134 | ######################## BEGIN LICENSE BLOCK ########################
# Contributor(s):
# Dan Blanchard
# Ian Cordasco
#
# 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
# versi... | apache-2.0 |
gerryhd/diabot-assistant | lib/python2.7/site-packages/pip/_vendor/html5lib/treewalkers/__init__.py | 354 | 5544 | """A collection of modules for iterating through different kinds of
tree, generating tokens identical to those produced by the tokenizer
module.
To create a tree walker for a new type of tree, you need to do
implement a tree walker object (called TreeWalker by convention) that
implements a 'serialize' method taking a ... | gpl-3.0 |
M32Media/redash | old_migrations/0003_update_data_source_config.py | 16 | 2861 | import json
import jsonschema
from jsonschema import ValidationError
from redash import query_runner
from redash.models import DataSource
def validate_configuration(query_runner_type, configuration_json):
query_runner_class = query_runner.query_runners.get(query_runner_type, None)
if query_runner_class is No... | bsd-2-clause |
Adamssss/projectEuler | Problem 001-150 Python/pb060.py | 1 | 1366 | import math
import time
t1 = time.time()
prime = []
def primeSieve(n):
global prime
n = (n+1)//2
p = [True]*(n)
i = 1
prime.append(2)
while i < n:
if p[i]:
t = 2*i+1
prime.append(t)
p[i] = False
j = 2*i*i+2*i
while j < n:
... | mit |
illume/numpy3k | numpy/oldnumeric/random_array.py | 87 | 11454 | # Backward compatible module for RandomArray
__all__ = ['ArgumentError','F','beta','binomial','chi_square', 'exponential',
'gamma', 'get_seed', 'mean_var_test', 'multinomial',
'multivariate_normal', 'negative_binomial', 'noncentral_F',
'noncentral_chi_square', 'normal', 'permutation', ... | bsd-3-clause |
yhj630520/dpark | dpark/accumulator.py | 16 | 2221 | from operator import add
import copy
from dpark.serialize import load_func, dump_func
class AccumulatorParam:
def __init__(self, zero, addInPlace):
self.zero = zero
self.addInPlace = addInPlace
def __getstate__(self):
return dump_func(self.addInPlace), self.zero
def __setstate__(... | bsd-3-clause |
larsonmpdx/grpc | src/python/grpcio/setup.py | 2 | 3719 | # Copyright 2015, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... | bsd-3-clause |
SUGUS-GNULinux/WhoGUS | WhoGus.py | 1 | 7703 | #!/usr/bin/env python3.4
# -*- coding: utf-8 -*-
# Debe ejcutarse como root o el escaneo no mostrará resultados.
# La bilioteca markup.py [1] se encuentra instalada en /usr/lib/python2.7/
# conmo un archivo del mismo nombre, ya que la instalación mediante pip
# fallaba. [1] http://markup.sourceforge.net/
import codec... | gpl-3.0 |
fitzgen/servo | tests/wpt/web-platform-tests/tools/html5lib/html5lib/trie/datrie.py | 785 | 1166 | from __future__ import absolute_import, division, unicode_literals
from datrie import Trie as DATrie
from six import text_type
from ._base import Trie as ABCTrie
class Trie(ABCTrie):
def __init__(self, data):
chars = set()
for key in data.keys():
if not isinstance(key, text_type):
... | mpl-2.0 |
sumedhasingla/VTK | Wrapping/Python/vtk/test/Testing.py | 9 | 17941 | """ This module attempts to make it easy to create VTK-Python
unittests. The module uses unittest for the test interface. For more
documentation on what unittests are and how to use them, please read
these:
http://www.python.org/doc/current/lib/module-unittest.html
http://www.diveintopython.org/roman_divein.h... | bsd-3-clause |
morissette/devopsdays-hackathon-2016 | venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/retry.py | 198 | 9981 | from __future__ import absolute_import
import time
import logging
from ..exceptions import (
ConnectTimeoutError,
MaxRetryError,
ProtocolError,
ReadTimeoutError,
ResponseError,
)
from ..packages import six
log = logging.getLogger(__name__)
class Retry(object):
""" Retry configuration.
... | gpl-3.0 |
sgerhart/ansible | lib/ansible/modules/packaging/language/pip.py | 3 | 27188 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2012, Matt Wright <matt@nobien.net>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.... | mit |
chengdh/openerp-ktv | openerp/addons/hr_recruitment/report/__init__.py | 442 | 1107 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# This program is free software: you can redistribute it and/or modify
# ... | agpl-3.0 |
AccentureMobilityServices/external_qemu | gen-skin.py | 102 | 1676 | #!/usr/bin/python
#
# a python script used to generate the "default-skin.h' header file
# from a given skin directory
#
# usage:
# progname skin-directory-path > default-skin.h
#
import sys, os, string, re
header = """\
/* automatically generated, do not touch */
"""
footer = """\
static const FileEntry _file_... | gpl-2.0 |
admcrae/tensorflow | tensorflow/python/kernel_tests/softplus_op_test.py | 42 | 3261 | # 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 |
archaeogeek/csvkit | tests/test_utilities/test_csvsql.py | 21 | 4087 | #!/usr/bin/env python
import six
try:
import unittest2 as unittest
except ImportError:
import unittest
from csvkit.utilities.csvsql import CSVSQL
from tests.utils import stdin_as_string
class TestCSVSQL(unittest.TestCase):
def test_create_table(self):
args = ['--table', 'foo', 'examples/testfixe... | mit |
rob356/SickRage | lib/guessit/transfo/__init__.py | 51 | 1136 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# GuessIt - A library for guessing information from filenames
# Copyright (c) 2013 Nicolas Wack <wackou@gmail.com>
#
# GuessIt is free software; you can redistribute it and/or modify it under
# the terms of the Lesser GNU General Public License as published by
# the Free ... | gpl-3.0 |
AlexanderBrevig/Espruino | boards/STM32F4DISCOVERY.py | 1 | 3693 | #!/bin/false
# This file is part of Espruino, a JavaScript interpreter for Microcontrollers
#
# Copyright (C) 2013 Gordon Williams <gw@pur3.co.uk>
#
# 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 h... | mpl-2.0 |
chrisjsewell/PyGauss | pygauss/molecule.py | 1 | 78698 | # -*- coding: utf-8 -*-
"""
Created on Fri May 01 21:24:31 2015
@author: chris
"""
import os
from io import BytesIO
import PIL
from PIL import Image, ImageChops
import copy
import warnings
from math import degrees, atan2, sqrt, acos
import numpy as np
from scipy.signal import argrelextrema
import matplotlib as mpl... | gpl-3.0 |
Scille/parsec-cloud | tests/core/fs/workspacefs/test_workspacefile.py | 1 | 22572 | # Parsec Cloud (https://parsec.cloud) Copyright (c) AGPLv3 2016-2021 Scille SAS
import pytest
import trio
from enum import IntEnum
from typing import Union
import io
from parsec.core.fs.exceptions import FSUnsupportedOperation, FSOffsetError, FSInvalidFileDescriptor
from parsec.core.fs.workspacefs.workspacefile import... | agpl-3.0 |
pratyushanand/linux | scripts/gdb/linux/tasks.py | 333 | 3434 | #
# gdb helper commands and functions for Linux kernel debugging
#
# task & thread tools
#
# Copyright (c) Siemens AG, 2011-2013
#
# Authors:
# Jan Kiszka <jan.kiszka@siemens.com>
#
# This work is licensed under the terms of the GNU GPL version 2.
#
import gdb
from linux import utils
task_type = utils.CachedType(... | gpl-2.0 |
KnCMiner/bitcoin | qa/rpc-tests/test_framework/comptool.py | 49 | 14544 | #!/usr/bin/env python2
#
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
from mininode import *
from blockstore import BlockStore, TxStore
from util import p2p_port
'''
This is a tool for comparing two or more bitcoinds to ... | mit |
rowhit/h2o-2 | py/testdir_single_jvm/test_parse_manyfiles_1_fvec.py | 9 | 3248 | import unittest, time, sys, random
sys.path.extend(['.','..','../..','py'])
import h2o, h2o_cmd, h2o_glm, h2o_browse as h2b, h2o_import as h2i
class Basic(unittest.TestCase):
def tearDown(self):
h2o.check_sandbox_for_errors()
@classmethod
def setUpClass(cls):
# assume we're at 0xdata with ... | apache-2.0 |
JARR-aggregator/JARR | newspipe/controllers/abstract.py | 2 | 6786 | import logging
from collections import defaultdict
from datetime import datetime
import dateutil.parser
from sqlalchemy import func, or_
from werkzeug.exceptions import Forbidden, NotFound
from newspipe.bootstrap import db
logger = logging.getLogger(__name__)
class AbstractController:
_db_cls = None # referen... | agpl-3.0 |
geronimp/enrichM | build/lib/enrichm/comparer.py | 1 | 7747 | #!/usr/bin/env python3
###############################################################################
# #
# This program is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License... | gpl-3.0 |
bsmrstu-warriors/Moytri--The-Drone-Aider | Lib/site-packages/numpy/linalg/__init__.py | 54 | 2194 | """
Core Linear Algebra Tools
=========================
=============== ==========================================================
Linear algebra basics
==========================================================================
norm Vector or matrix norm
inv Inverse of a square matrix
solve ... | gpl-3.0 |
schatt/flynn | Godeps/_workspace/src/github.com/flynn/go-tuf/client/testdata/generate/generate.py | 21 | 3245 | #!/usr/bin/env python
#
# A script to generate TUF repository files.
#
# A modification of generate.py from the Python implementation:
# https://github.com/theupdateframework/tuf/blob/v0.9.9/tests/repository_data/generate.py
import shutil
import datetime
import optparse
import stat
from tuf.repository_tool import *
i... | bsd-3-clause |
guillaumfloki/bodytracker | node_modules/utf8/tests/generate-test-data.py | 1788 | 1435 | #!/usr/bin/env python
import re
import json
# https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae
# http://stackoverflow.com/a/13436167/96656
def unisymbol(codePoint):
if codePoint >= 0x0000 and codePoint <= 0xFFFF:
return unichr(codePoint)
elif codePoint >= 0x010000 and codePoint <= 0x10FFFF:
... | mit |
YoungxHelsinki/UnityMeshByteReceiveServer | test_scripts/test_curio.py | 1 | 1390 | from curio import run, spawn
from curio.socket import *
async def echo_server(address):
sock = socket(AF_INET, SOCK_STREAM)
sock.setsockopt(SOL_SOCKET, SO_REUSEADDR, 1)
sock.bind(address)
sock.listen(5)
print('Server listening at', address)
async with sock:
while True:
clien... | gpl-3.0 |
GlitchKernel/Glitch-i9300 | tools/perf/scripts/python/sctop.py | 11180 | 1924 | # system call top
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Periodically displays system-wide system call totals, broken down by
# syscall. If a [comm] arg is specified, only syscalls called by
# [comm] are displayed. If an [interval] arg is specified,... | gpl-2.0 |
michaeljohn32/odoomrp-wip | mrp_production_add_middle_stuff/wizard/wizard_addition.py | 13 | 2467 |
# -*- encoding: 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 th... | agpl-3.0 |
havt/odoo | addons/marketing_campaign_crm_demo/__openerp__.py | 260 | 1623 | # -*- 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 |
Yen-Chung-En/2015cd_midterm | static/Brython3.1.1-20150328-091302/Lib/unittest/signals.py | 1016 | 2403 | import signal
import weakref
from functools import wraps
__unittest = True
class _InterruptHandler(object):
def __init__(self, default_handler):
self.called = False
self.original_handler = default_handler
if isinstance(default_handler, int):
if default_handler == signal.SIG_D... | gpl-3.0 |
jrydberg/moto | moto/ses/models.py | 16 | 1913 | from __future__ import unicode_literals
from moto.core import BaseBackend
from .utils import get_random_message_id
class Message(object):
def __init__(self, message_id, source, subject, body, destination):
self.id = message_id
self.source = source
self.subject = subject
self.body =... | apache-2.0 |
etingof/pysnmp | examples/v3arch/asyncore/manager/cmdgen/spoof-source-address.py | 1 | 3061 | """
Spoof source address
++++++++++++++++++++
Send a SNMP GET request
* with SNMPv2c, community 'public'
* over IPv4/UDP
* to an Agent at 104.236.166.95:161
* from a non-local, spoofed IP 1.2.3.4 (root and Python 3.3+ required)
* for an OID in tuple form
This script performs similar to the following Net-SNMP command:... | bsd-2-clause |
grcanosa/code-playground | scrum/wekan/wekanplot.py | 1 | 4859 | #!/usr/bin/python3
import sys
import json
import matplotlib.pyplot as plt
import matplotlib.dates as mdates
from matplotlib.ticker import FixedLocator
import datetime
import numpy as np
import optparse
def extract_string(text,tag):
textspli = text.split();
for t in textspli:
if tag in t:
textspli2 = t.... | mit |
librallu/cohorte-herald | pyboard/ipopo.py | 1 | 19933 | import pyb # for randomness
import xmlrpc
"""
A component can have following decorators :
- componentFactory : indicates the name of the component
- validate method : called when the component is valid
- invalidate method : called when the component is invalid
- BindField : called when a field is bound (used when a... | apache-2.0 |
llulai/deep-learning | transfer-learning/tensorflow_vgg/vgg19_trainable.py | 153 | 6685 | import tensorflow as tf
import numpy as np
from functools import reduce
VGG_MEAN = [103.939, 116.779, 123.68]
class Vgg19:
"""
A trainable version VGG19.
"""
def __init__(self, vgg19_npy_path=None, trainable=True, dropout=0.5):
if vgg19_npy_path is not None:
self.data_dict = np.... | mit |
myerpengine/odoo | openerp/addons/base/module/wizard/base_update_translations.py | 447 | 2931 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 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 |
p4datasystems/CarnotKE | jyhton/Lib/test/test_time.py | 8 | 10592 | from test import test_support
import time
import unittest
class TimeTestCase(unittest.TestCase):
def setUp(self):
self.t = time.time()
def test_missing_module_attribute(self):
self.assertEqual(time.clock.__module__, 'time')
self.assertEqual(time.time.__module__, 'time')
def test... | apache-2.0 |
M0ses/ansible | v2/ansible/plugins/lookup/redis_kv.py | 16 | 2416 | # (c) 2012, Jan-Piet Mens <jpmens(at)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 ver... | gpl-3.0 |
dex4er/django | tests/middleware/tests.py | 50 | 33122 | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
import gzip
from io import BytesIO
import random
import re
import warnings
from django.conf import settings
from django.core import mail
from django.db import (transaction, connections, DEFAULT_DB_ALIAS,
IntegrityE... | bsd-3-clause |
brijeshkesariya/odoo | addons/share/res_users.py | 269 | 3038 | # -*- 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 |
kamalx/edx-platform | common/lib/capa/capa/tests/test_inputtypes.py | 62 | 54823 | # -*- coding: utf-8 -*-
"""
Tests of input types.
TODO:
- refactor: so much repetive code (have factory methods that build xml elements directly, etc)
- test error cases
- check rendering -- e.g. msg should appear in the rendered output. If possible, test that
templates are escaping things properly.
- test unic... | agpl-3.0 |
Li-poly/stock-multi-hack | tools/perf/scripts/python/syscall-counts.py | 11181 | 1522 | # system call counts
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide system call totals, broken down by syscall.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os
import sys
sys.path.append(os.envir... | gpl-2.0 |
emre/lkd-courses | lkdcourses/base/urls.py | 1 | 1431 | from django.conf.urls import include, url
from django.contrib import admin
admin.autodiscover()
from django.conf import settings
urlpatterns = [
url(r'^login/$', 'django.contrib.auth.views.login'),
url(r'^logout/$', 'django.contrib.auth.views.logout_then_login'),
url(r'^resetpassword/done/$', 'django.con... | mit |
stevenewey/django | django/db/models/deletion.py | 144 | 14337 | from collections import Counter, OrderedDict
from itertools import chain
from operator import attrgetter
from django.db import IntegrityError, connections, transaction
from django.db.models import signals, sql
from django.utils import six
class ProtectedError(IntegrityError):
def __init__(self, msg, protected_ob... | bsd-3-clause |
vipul-sharma20/oh-mainline | vendor/packages/twisted/twisted/web/test/test_domhelpers.py | 18 | 11053 | # -*- test-case-name: twisted.web.test.test_domhelpers -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Specific tests for (some of) the methods in L{twisted.web.domhelpers}.
"""
from xml.dom import minidom
from twisted.trial.unittest import TestCase
from twisted.web import microdom
... | agpl-3.0 |
salamer/picard | picard/coverart/image.py | 1 | 13907 | # -*- coding: utf-8 -*-
#
# Picard, the next-generation MusicBrainz tagger
# Copyright (C) 2007 Oliver Charles
# Copyright (C) 2007-2011 Philipp Wolfer
# Copyright (C) 2007, 2010, 2011 Lukáš Lalinský
# Copyright (C) 2011 Michael Wiencek
# Copyright (C) 2011-2012 Wieland Hoffmann
# Copyright (C) 2013-2014 Laurent Monin
... | gpl-2.0 |
usc-isi/nova | nova/api/openstack/wsgi.py | 6 | 43309 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 OpenStack LLC.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/... | apache-2.0 |
attente/snapcraft | integration_tests/test_stage.py | 2 | 1271 | # -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
#
# Copyright (C) 2015 Canonical Ltd
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3 as
# published by the Free Software Foundation.
#
# This program is distributed in the h... | gpl-3.0 |
darkleons/lama | addons/account/report/account_journal.py | 255 | 10035 | # -*- 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 |
perkinslr/pypyjs | addedLibraries/twisted/internet/_signals.py | 1 | 2730 | # -*- test-case-name: twisted.internet.test.test_sigchld -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
This module is used to integrate child process termination into a
reactor event loop. This is a challenging feature to provide because
most platforms indicate process termination vi... | mit |
virneo/nupic | tests/unit/nupic/encoders/sparse_pass_through_encoder_test.py | 7 | 4897 | #!/usr/bin/env python
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions ... | agpl-3.0 |
nischalshrestha/sampleAppEngine | lib/simplejson/tests/test_recursion.py | 149 | 1679 | from unittest import TestCase
import simplejson as json
class JSONTestObject:
pass
class RecursiveJSONEncoder(json.JSONEncoder):
recurse = False
def default(self, o):
if o is JSONTestObject:
if self.recurse:
return [JSONTestObject]
else:
re... | mit |
Lkhagvadelger/phantomjs | src/breakpad/src/tools/gyp/pylib/gyp/generator/gypsh.py | 151 | 1660 | #!/usr/bin/python
# Copyright (c) 2009 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.
"""gypsh output module
gypsh is a GYP shell. It's not really a generator per se. All it does is
fire up an interactive Python session with a ... | bsd-3-clause |
kenshay/ImageScript | ProgramData/Android/ADB/platform-tools/systrace/catapult/telemetry/telemetry/value/merge_values.py | 7 | 5448 | # Copyright 2013 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.
from telemetry.value import failure
from telemetry.value import skip
# TODO(eakuefner): Get rid of this as part of crbug.com/525688
def DefaultKeyFunc(valu... | gpl-3.0 |
andyh616/mne-python | examples/visualization/plot_topo_channel_epochs_image.py | 22 | 1861 | """
============================================================
Visualize channel over epochs as images in sensor topography
============================================================
This will produce what is sometimes called event related
potential / field (ERP/ERF) images.
One sensor topography plot is produced... | bsd-3-clause |
zvezdan/pip | tests/unit/test_req_file.py | 2 | 23863 | import os
import subprocess
import textwrap
import pytest
from mock import Mock, patch
from pretend import stub
import pip._internal.index
from pip._internal.download import PipSession
from pip._internal.exceptions import (
InstallationError, RequirementsFileParseError,
)
from pip._internal.index import PackageFi... | mit |
dvreed/Spirit | spirit/user/tests.py | 4 | 39121 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import datetime
from django.test import TestCase
from django.core.urlresolvers import reverse
from django.core.cache import cache
from django.contrib.auth import get_user_model, HASH_SESSION_KEY
from django.core import mail
from django.utils.translation ... | mit |
pedrobaeza/odoo | addons/crm_claim/report/__init__.py | 446 | 1080 | # -*- 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 |
janocat/odoo | addons/base_import/tests/test_cases.py | 189 | 15021 | # -*- encoding: utf-8 -*-
import unittest2
from openerp.tests.common import TransactionCase
from .. import models
ID_FIELD = {
'id': 'id',
'name': 'id',
'string': "External ID",
'required': False,
'fields': [],
}
def make_field(name='value', string='unknown', required=False, fields=[]):
retur... | agpl-3.0 |
kubernetes-client/python | kubernetes/client/models/v1_scale_status.py | 1 | 5005 | # coding: utf-8
"""
Kubernetes
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: release-1.18
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import si... | apache-2.0 |
zarlant/ansible_core | cloud/google/gce_net.py | 9 | 9291 | #!/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 |
Boblepointu/FuCoin | contrib/devtools/update-translations.py | 168 | 6777 | #!/usr/bin/python
# Copyright (c) 2014 Wladimir J. van der Laan
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
'''
Run this script from the root of the repository to update all translations from
transifex.
It will do the following... | mit |
mrawls/BF-simulator | BF_pythonTYC.py | 1 | 12707 | from __future__ import print_function
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.ticker import MultipleLocator
from astropy.io import fits
from astropy.time import Time
from PyAstronomy import pyasl
from scipy import ndimage
import pandas as pd
import gaussfitter as gf
import BF_functions as bff... | mit |
towerjoo/mindsbook | django/contrib/contenttypes/management.py | 315 | 2458 | from django.contrib.contenttypes.models import ContentType
from django.db.models import get_apps, get_models, signals
from django.utils.encoding import smart_unicode
def update_contenttypes(app, created_models, verbosity=2, **kwargs):
"""
Creates content types for models in the given app, removing any model
... | bsd-3-clause |
yanheven/nova | nova/tests/unit/api/ec2/test_ec2utils.py | 84 | 2549 | # Copyright 2014 - 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 ag... | apache-2.0 |
michaelgallacher/intellij-community | plugins/hg4idea/testData/bin/mercurial/manifest.py | 92 | 8142 | # manifest.py - manifest revision class for mercurial
#
# Copyright 2005-2007 Matt Mackall <mpm@selenic.com>
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
from i18n import _
import mdiff, parsers, error, revlog, util, dicthelper... | apache-2.0 |
honnibal/spaCy | spacy/lang/id/punctuation.py | 1 | 2195 | # coding: utf8
from __future__ import unicode_literals
from ..punctuation import TOKENIZER_PREFIXES, TOKENIZER_SUFFIXES, TOKENIZER_INFIXES
from ..char_classes import ALPHA, merge_chars, split_chars, _currency, _units
_units = (
_units + "s bit Gbps Mbps mbps Kbps kbps ƒ ppi px "
"Hz kHz MHz GHz mAh "
"ra... | mit |
emergenzeHack/emergenzeHack.github.io | node_modules/node-gyp/gyp/pylib/gyp/input.py | 64 | 116338 | # 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.
from compiler.ast import Const
from compiler.ast import Dict
from compiler.ast import Discard
from compiler.ast import List
from compiler.ast import Module
from co... | mit |
heyinUCB/CS294 | sp17_hw/hw3/atari_wrappers.py | 9 | 5290 | import cv2
import numpy as np
from collections import deque
import gym
from gym import spaces
class NoopResetEnv(gym.Wrapper):
def __init__(self, env=None, noop_max=30):
"""Sample initial states by taking random number of no-ops on reset.
No-op is assumed to be action 0.
"""
super(... | mit |
sorenh/cc | vendor/boto/boto/emr/jobflow.py | 3 | 3021 | # Copyright (c) 2010 Spotify AB
#
# 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, publish, dis-
# t... | apache-2.0 |
wettenhj/mytardis | tardis/tardis_portal/views/machine.py | 1 | 2466 | """
views that return data useful only to other machines (but not JSON)
"""
import logging
from django.conf import settings
from django.core.exceptions import PermissionDenied
from ..auth import decorators as authz, auth_service
from ..auth.localdb_auth import auth_key as localdb_auth_key
from ..models import Experi... | gpl-3.0 |
rooshilp/CMPUT410W15-project | testenv/lib/python2.7/site-packages/django/template/debug.py | 42 | 3778 | from django.template.base import Lexer, Parser, tag_re, NodeList, VariableNode, TemplateSyntaxError
from django.utils.encoding import force_text
from django.utils.html import conditional_escape
from django.utils.safestring import SafeData, EscapeData
from django.utils.formats import localize
from django.utils.timezone ... | gpl-2.0 |
NCI-Cloud/horizon | openstack_dashboard/dashboards/project/images/snapshots/tests.py | 32 | 3836 | # Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the... | apache-2.0 |
aimas/TuniErp-8.0 | openerp/addons/test_inherits/models.py | 295 | 1141 | # -*- coding: utf-8 -*-
from openerp import models, fields, api, osv
# We just create a new model
class Unit(models.Model):
_name = 'test.unit'
_columns = {
'name': osv.fields.char('Name', required=True),
'state': osv.fields.selection([('a', 'A'), ('b', 'B')],
... | agpl-3.0 |
Phuehvk/gyp | test/intermediate_dir/gyptest-intermediate-dir.py | 100 | 1400 | #!/usr/bin/env python
# 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.
"""
Verifies that targets have independent INTERMEDIATE_DIRs.
"""
import TestGyp
test = TestGyp.TestGyp()
test.run_gyp('test.gyp', chdir=... | bsd-3-clause |
fengguoqing/linux3.10-mini2440 | scripts/tracing/draw_functrace.py | 14676 | 3560 | #!/usr/bin/python
"""
Copyright 2008 (c) Frederic Weisbecker <fweisbec@gmail.com>
Licensed under the terms of the GNU GPL License version 2
This script parses a trace provided by the function tracer in
kernel/trace/trace_functions.c
The resulted trace is processed into a tree to produce a more human
view of the call ... | gpl-2.0 |
SiliconAcid/android_kernel_lge_g3 | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Util.py | 12527 | 1935 | # Util.py - Python extension for perf script, miscellaneous utility code
#
# Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com>
#
# This software may be distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Free Software
# Foundation.
import errno, os
FUTEX_WAIT = 0... | gpl-2.0 |
nitzmahone/ansible | lib/ansible/modules/net_tools/nmcli.py | 5 | 52136 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2015, Chris Long <alcamie@gmail.com> <chlong@redhat.com>
# Copyright: (c) 2017, 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
__meta... | gpl-3.0 |
leeseulstack/openstack | neutron/plugins/cisco/db/l3/l3_models.py | 48 | 4506 | # Copyright 2014 Cisco Systems, Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... | apache-2.0 |
sankroh/satchmo | satchmo/tax/modules/area/tax.py | 2 | 6464 | try:
from decimal import Decimal, ROUND_HALF_UP
except:
from django.utils._decimal import Decimal, ROUND_HALF_UP
from django.core.exceptions import ImproperlyConfigured
from django.db.models import Q
from satchmo.configuration import config_value
from satchmo.contact.models import Contact
from satchmo.l10n.mod... | bsd-3-clause |
jmakov/ggrc-core | src/ggrc/migrations/versions/20150520103539_b0c3361797a_migrate_control_sections_to_.py | 6 | 1661 | # Copyright (C) 2015 Google Inc., authors, and contributors <see AUTHORS file>
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
# Created By: anze@reciprocitylabs.com
# Maintained By: anze@reciprocitylabs.com
"""Migrate control_sections to relationships
Revision ID: b0c3361797a
Revises: ... | apache-2.0 |
sapics/letsencrypt | letsencrypt/tests/display/enhancements_test.py | 53 | 1703 | """Module for enhancement UI."""
import logging
import unittest
import mock
from letsencrypt import errors
from letsencrypt.display import util as display_util
class AskTest(unittest.TestCase):
"""Test the ask method."""
def setUp(self):
logging.disable(logging.CRITICAL)
def tearDown(self):
... | apache-2.0 |
jazztpt/edx-platform | pavelib/utils/test/suites/js_suite.py | 117 | 2097 | """
Javascript test tasks
"""
from pavelib import assets
from pavelib.utils.test import utils as test_utils
from pavelib.utils.test.suites.suite import TestSuite
from pavelib.utils.envs import Env
__test__ = False # do not collect
class JsTestSuite(TestSuite):
"""
A class for running JavaScript tests.
"... | agpl-3.0 |
ahmadio/edx-platform | common/static/js/vendor/mathjax-MathJax-c9db6ac/docs/source/conf.py | 104 | 6453 | # -*- coding: utf-8 -*-
#
# MathJax documentation build configuration file, created by
# sphinx-quickstart on Sun May 16 23:18:19 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... | agpl-3.0 |
RadioFreeAsia/RDacity | lib-src/lv2/lilv/waflib/Tools/dbus.py | 318 | 1142 | #! /usr/bin/env python
# encoding: utf-8
# WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file
from waflib import Task,Errors
from waflib.TaskGen import taskgen_method,before_method
@taskgen_method
def add_dbus_file(self,filename,prefix,mode):
if not hasattr(self,'dbus... | gpl-2.0 |
kennethgillen/ansible | test/runner/lib/core_ci.py | 51 | 12754 | """Access Ansible Core CI remote services."""
from __future__ import absolute_import, print_function
import json
import os
import traceback
import uuid
import errno
import time
from lib.http import (
HttpClient,
HttpResponse,
HttpError,
)
from lib.util import (
ApplicationError,
run_command,
... | gpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.