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 |
|---|---|---|---|---|---|
Code4SA/mapit | mapit_gb/controls/2014-05.py | 3 | 11399 | # A control file for importing May 2014 Boundary-Line.
# This control file assumes previous Boundary-Lines have been imported,
# because it uses that information. If this is a first import, use the
# first-gss control file.
def code_version():
return 'gss'
def check(name, type, country, geometry):
"""Shoul... | agpl-3.0 |
Carmezim/tensorflow | tensorflow/python/tools/saved_model_cli_test.py | 20 | 17777 | # 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 |
esdalmaijer/PyGaze | pygaze/_logfile/baselogfile.py | 1 | 3346 | # -*- coding: utf-8 -*-
#
# This file is part of PyGaze - the open-source toolbox for eye tracking
#
# PyGaze is a Python module for easily creating gaze contingent experiments
# or other software (as well as non-gaze contingent experiments/software)
# Copyright (C) 2012-2013 Edwin S. Dalmaijer
#
# ... | gpl-3.0 |
mlhenderson/transform | plugins/scripts/upload/trns_transform_FASTA_DNA_Assembly_to_KBaseGenomes_ContigSet.py | 3 | 14066 | #!/usr/bin/env python
# standard library imports
import os
import sys
import logging
import re
import hashlib
# 3rd party imports
import simplejson
# KBase imports
import biokbase.Transform.script_utils as script_utils
# transformation method that can be called if this module is imported
# Note the logger has diff... | mit |
nicupavel/wifi | wifi/scan.py | 1 | 5377 | from __future__ import division
import re
import textwrap
import wifi.subprocess_compat as subprocess
from wifi.utils import db2dbm
from wifi.exceptions import InterfaceError
class Cell(object):
"""
Presents a Python interface to the output of iwlist.
"""
def __init__(self):
self.bitrates =... | bsd-2-clause |
piotrb5e3/ComfyMS-backend | posts/tests/test_views/test_unpublish.py | 1 | 1710 | from django.core.urlresolvers import reverse
from django.contrib.auth.models import User
from rest_framework import status
from rest_framework.test import APITestCase
from rest_framework_jwt import utils
from posts.models import Post
from posts.tests.factory import create_post
class TestPost(APITestCase):
unpu... | apache-2.0 |
titienmiami/mmc.repository | plugin.video.tvalacarta/servers/modovideo.py | 1 | 2571 | # -*- coding: iso-8859-1 -*-
#------------------------------------------------------------
# pelisalacarta - XBMC Plugin
# Conector para modovideo
# http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/
#------------------------------------------------------------
import re, urlparse, urllib, urllib2
import os
from ... | gpl-2.0 |
sampadsaha5/sympy | sympy/functions/elementary/tests/test_piecewise.py | 11 | 18755 | from sympy import (
adjoint, And, Basic, conjugate, diff, expand, Eq, Function, I,
Integral, integrate, Interval, lambdify, log, Max, Min, oo, Or, pi,
Piecewise, piecewise_fold, Rational, solve, symbols, transpose,
cos, exp, Abs, Not, Symbol, S
)
from sympy.printing import srepr
from sympy.utilities.pyt... | bsd-3-clause |
rockho-team/shuup-shipping-table | shuup_shipping_table_tests/settings.py | 1 | 3686 | # -*- coding: utf-8 -*-
import os
import tempfile
SECRET_KEY = "x"
INSTALLED_APPS = (
# django
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.messages',
'django.contrib.sessions',
'django.contrib.staticfiles',
# shuup themes
'shuup.th... | agpl-3.0 |
Salat-Cx65/python-for-android | python-build/python-libs/gdata/tests/atom_test.py | 87 | 26717 | #!/usr/bin/python
# -*-*- encoding: utf-8 -*-*-
#
# Copyright (C) 2006 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
#
# Unle... | apache-2.0 |
bitcoinapi/bootstrap | test-infra/s3_cache.py | 2166 | 5734 | #!/usr/bin/env python2.7
# pylint: disable=C0301
from __future__ import absolute_import, unicode_literals, print_function, division
from sys import argv
from os import environ, stat, chdir, remove as _delete_file
from os.path import dirname, basename, abspath, realpath, expandvars
from hashlib import sha256
from subpr... | mit |
drewsetski/koding | go/src/vendor/github.com/mitchellh/packer/vendor/github.com/ugorji/go/codec/test.py | 1516 | 4019 | #!/usr/bin/env python
# This will create golden files in a directory passed to it.
# A Test calls this internally to create the golden files
# So it can process them (so we don't have to checkin the files).
# Ensure msgpack-python and cbor are installed first, using:
# sudo apt-get install python-dev
# sudo apt-g... | apache-2.0 |
cschoonover91/librenms | lib/influxdb-php/vendor/guzzlehttp/guzzle/docs/conf.py | 46 | 2006 | import sys, os
from sphinx.highlighting import lexers
from pygments.lexers.web import PhpLexer
lexers['php'] = PhpLexer(startinline=True, linenos=1)
lexers['php-annotations'] = PhpLexer(startinline=True, linenos=1)
primary_domain = 'php'
extensions = []
templates_path = ['_templates']
source_suffix = '.rst'
master_d... | gpl-3.0 |
thoughtpalette/thoughts.thoughtpalette.com | node_modules/grunt-docker/node_modules/docker/node_modules/pygmentize-bundled/vendor/pygments/pygments/styles/perldoc.py | 364 | 2175 | # -*- coding: utf-8 -*-
"""
pygments.styles.perldoc
~~~~~~~~~~~~~~~~~~~~~~~
Style similar to the style used in the `perldoc`_ code blocks.
.. _perldoc: http://perldoc.perl.org/
:copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from... | mit |
nikitasingh981/scikit-learn | examples/text/hashing_vs_dict_vectorizer.py | 93 | 3243 | """
===========================================
FeatureHasher and DictVectorizer Comparison
===========================================
Compares FeatureHasher and DictVectorizer by using both to vectorize
text documents.
The example demonstrates syntax and speed only; it doesn't actually do
anything useful with the e... | bsd-3-clause |
samthor/intellij-community | python/lib/Lib/encodings/cp437.py | 593 | 34820 | """ Python Character Mapping Codec cp437 generated from 'VENDORS/MICSFT/PC/CP437.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_map)
def decode(self,input,errors='strict... | apache-2.0 |
sunlianqiang/kbengine | kbe/res/scripts/common/Lib/test/test_call.py | 182 | 3159 | import unittest
from test import support
# The test cases here cover several paths through the function calling
# code. They depend on the METH_XXX flag that is used to define a C
# function, which can't be verified from Python. If the METH_XXX decl
# for a C function changes, these tests may not cover the right pat... | lgpl-3.0 |
svanschalkwyk/datafari | windows/python/Lib/test/test_grp.py | 45 | 3291 | """Test script for the grp module."""
import unittest
from test import test_support
grp = test_support.import_module('grp')
class GroupDatabaseTestCase(unittest.TestCase):
def check_value(self, value):
# check that a grp tuple has the entries and
# attributes promised by the docs
self.as... | apache-2.0 |
cloudera/hue | desktop/core/ext-py/docutils-0.14/docutils/languages/lt.py | 16 | 1940 | # -*- coding: utf-8 -*-
# $Id: lt.py 7911 2015-08-31 08:23:06Z milde $
# Author: Dalius Dobravolskas <dalius.do...@gmail.com>
# Copyright: This module has been placed in the public domain.
# New language mappings are welcome. Before doing a new translation, please
# read <http://docutils.sf.net/docs/howto/i18n.html>.... | apache-2.0 |
tomik/akimot | other/tagui/board_widget.py | 1 | 6768 | from PyQt4 import QtGui
from PyQt4 import QtCore
import sys
sys.path.append('..')
from aei import board
ANIMATE_ONE = 0.2
DIRECTIONS = {'n' : -8, 'w' : -1, 'e' : 1, 's': 8}
MAX_MOVE_INTERVAL = 1500
STEP_INTERVAL = 300
ERROR = -1
BSIDE = 8
BSIZE = 64
COL_EMPTY = 2
COLORS = ['Gold', 'Silver', '']
PIECE_EMPTY_STR... | gpl-3.0 |
robert-kisteleki/ripe-atlas-tools | tests/commands/report.py | 3 | 22948 | # coding=utf-8
# Copyright (c) 2015 RIPE NCC
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is dist... | gpl-3.0 |
RomainBrault/scikit-learn | sklearn/neighbors/graph.py | 36 | 6650 | """Nearest Neighbors graph functions"""
# Author: Jake Vanderplas <vanderplas@astro.washington.edu>
#
# License: BSD 3 clause (C) INRIA, University of Amsterdam
from .base import KNeighborsMixin, RadiusNeighborsMixin
from .unsupervised import NearestNeighbors
def _check_params(X, metric, p, metric_params):
"""C... | bsd-3-clause |
kch8qx/osf.io | website/project/views/contributor.py | 1 | 27505 | # -*- coding: utf-8 -*-
import httplib as http
from flask import request
from modularodm.exceptions import ValidationError, ValidationValueError
from framework import forms
from framework import status
from framework.auth import cas
from framework.auth import User, get_user
from framework.auth.core import generate_c... | apache-2.0 |
kumar303/addons-server | src/olympia/users/tasks.py | 7 | 1425 | from django.core.files.storage import default_storage as storage
import olympia.core.logger
from olympia.amo.celery import task
from olympia.amo.decorators import set_modified_on
from olympia.amo.templatetags.jinja_helpers import user_media_path
from olympia.amo.utils import resize_image
from .models import UserProf... | bsd-3-clause |
rajul/sugar | src/jarabe/journal/journalactivity.py | 6 | 17405 | # Copyright (C) 2006, Red Hat, Inc.
# Copyright (C) 2007, One Laptop Per Child
#
# 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 ... | gpl-2.0 |
geekboxzone/lollipop_external_chromium_org_third_party_WebKit | Source/build/scripts/name_utilities.py | 32 | 3069 | # Copyright (C) 2013 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the ... | bsd-3-clause |
DailyActie/Surrogate-Model | 01-codes/numpy-master/numpy/polynomial/polynomial.py | 1 | 52763 | """
Objects for dealing with polynomials.
This module provides a number of objects (mostly functions) useful for
dealing with polynomials, including a `Polynomial` class that
encapsulates the usual arithmetic operations. (General information
on how this module represents and works with polynomial objects is in
the do... | mit |
BGCECSE2015/CADO | PYTHON/Extraction/WorkUnstructuredGrid/Ugrid_to_Python.py | 1 | 2002 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
print "Start"
from vtk import *
from vtk.util.numpy_support import vtk_to_numpy
import itertools as it
import cPickle
import getopt,sys
import numpy as np
# The source file: INPUT
print "Starting the Input reading"
try:
opts, args = getopt.getopt(sys.argv[1:], "ho:v", ... | bsd-3-clause |
ajyoon/brown | tests/test_models/test_beat.py | 1 | 3692 | import unittest
from fractions import Fraction
import pytest
from brown.models.beat import Beat
class TestBeat(unittest.TestCase):
def test_init_from_numerator_denominator(self):
dur = Beat(1, 4)
assert(dur.numerator == 1)
assert(dur.denominator == 4)
def test_init_from_existing_be... | gpl-3.0 |
micahcochran/geopandas | geopandas/_version.py | 3 | 16750 |
# This file helps to compute a version number in source trees obtained from
# git-archive tarball (such as those provided by githubs download-from-tag
# feature). Distribution tarballs (built by setup.py sdist) and build
# directories (produced by setup.py build) will contain a much shorter file
# that just contains t... | bsd-3-clause |
edx/edxanalytics | src/util/playback.py | 1 | 1385 | import logging, logging.handlers
import sys
logging.handlers.HTTPHandler('','',method='GET')
logger = logging.getLogger('simple_example')
# http_handler = logging.handlers.HTTPHandler('127.0.0.1:9022', '/event', method='GET')
http_handler = logging.handlers.HTTPHandler('127.0.0.1:9999', '/httpevent', method='GET')
... | agpl-3.0 |
zycdragonball/tensorflow | tensorflow/contrib/learn/python/learn/estimators/linear_test.py | 58 | 71789 | # 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 |
anryko/ansible | lib/ansible/modules/network/f5/bigip_profile_tcp.py | 19 | 21522 | #!/usr/bin/python
# -*- 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
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | gpl-3.0 |
sfcta/BikeRouter | Bike Model/route_model/traversal/single_source_dijkstra.py | 2 | 4066 | import heapq, random
def single_source_dijkstra(G,source,varname,exclude_group=[],target=None,weights={},link_randomizer=None,allow_centroids=False,target_type=0,verbose=False):
#for hash table targets, target_type 0 means all must be reached, target_type 1 means any can be reached and function will return node reac... | gpl-3.0 |
souravbadami/oppia | core/domain/visualization_registry_test.py | 1 | 4415 | # coding: utf-8
#
# Copyright 2014 The Oppia 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 requi... | apache-2.0 |
hurricup/intellij-community | python/lib/Lib/site-packages/django/contrib/gis/gdal/datasource.py | 321 | 4734 | """
DataSource is a wrapper for the OGR Data Source object, which provides
an interface for reading vector geometry data from many different file
formats (including ESRI shapefiles).
When instantiating a DataSource object, use the filename of a
GDAL-supported data source. For example, a SHP file or a
TIGER/Line... | apache-2.0 |
JBonsink/GSOC-2013 | tools/ns-allinone-3.14.1/pybindgen-0.15.0.809/pybindgen/typehandlers/inttype.py | 2 | 29713 | # docstrings not needed here (the type handler interfaces are fully
# documented in base.py)
# pylint: disable-msg=C0111
import struct
assert struct.calcsize('i') == 4 # assumption is made that sizeof(int) == 4 for all platforms pybindgen runs on
from base import ReturnValue, Parameter, PointerParameter, PointerRetu... | gpl-3.0 |
likaiwalkman/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/common/config/committers_unittest.py | 121 | 20173 | # 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 list of conditions and the f... | bsd-3-clause |
timsneath/notepad2 | scintilla/qt/ScintillaEdit/WidgetGen.py | 65 | 7794 | #!/usr/bin/env python
# WidgetGen.py - regenerate the ScintillaWidgetCpp.cpp and ScintillaWidgetCpp.h files
# Check that API includes all gtkscintilla2 functions
import sys
import os
import getopt
scintillaDirectory = "../.."
scintillaScriptsDirectory = os.path.join(scintillaDirectory, "scripts")
sys.path.append(scin... | bsd-3-clause |
2014c2g9/c2g9 | wsgi/static/Brython2.1.0-20140419-113919/Lib/random.py | 104 | 25660 | """Random variable generators.
integers
--------
uniform within range
sequences
---------
pick random element
pick random sample
generate random permutation
distributions on the real line:
------------------------------
uniform
... | gpl-2.0 |
jscn/django | tests/unmanaged_models/models.py | 66 | 3764 | """
Models can have a ``managed`` attribute, which specifies whether the SQL code
is generated for the table on various manage.py operations.
"""
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
# All of these models are created in the database by Django.
@python_2_unicod... | bsd-3-clause |
LChristakis/chalice-hunter | lib/python3.4/site-packages/setuptools/package_index.py | 84 | 38798 | """PyPI and direct package downloading"""
import sys
import os
import re
import shutil
import socket
import base64
import hashlib
from functools import wraps
from pkg_resources import (
CHECKOUT_DIST, Distribution, BINARY_DIST, normalize_path, SOURCE_DIST,
require, Environment, find_distributions, safe_name, s... | mit |
m-housh/asyncio-utils | tests/test_asyncio_utils.py | 1 | 3526 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
test_asyncio_utils
----------------------------------
Tests for ``asyncio_utils`` module.
"""
import pytest
import collections
from asyncio_utils import *
pytestmark = pytest.mark.asyncio
async def test_aiter():
async def gen():
yield 1
async fo... | mit |
xxsergzzxx/python-for-android | python3-alpha/python3-src/Tools/pybench/NewInstances.py | 92 | 1561 | from pybench import Test
# Check for new-style class support:
try:
class c(object):
pass
except NameError:
raise ImportError
###
class CreateNewInstances(Test):
version = 2.0
operations = 3 + 7 + 4
rounds = 60000
def test(self):
class c(object):
pass
cl... | apache-2.0 |
luken/pcitweak | pcitweak/devices.py | 1 | 5490 | import os, re
from config import PCIConfigSpace, PCIConfigSpaceAccess
class PCIDeviceAddress:
def __init__(self, domain=None, bus=None, device=None, func=None):
self.domain = domain
self.bus = bus
self.device = device
self.func = func
def __str__(self):
return "%04x:%02... | mit |
FNCS/ns-3.26 | src/flow-monitor/examples/flowmon-parse-results.py | 20 | 6138 | from __future__ import division
import sys
import os
try:
from xml.etree import cElementTree as ElementTree
except ImportError:
from xml.etree import ElementTree
def parse_time_ns(tm):
if tm.endswith('ns'):
return long(tm[:-4])
raise ValueError(tm)
class FiveTuple(object):
__slots__ = ['... | gpl-2.0 |
100Shapes/wagtail | wagtail/contrib/wagtailroutablepage/tests.py | 1 | 3029 | from django.test import TestCase
from wagtail.wagtailcore.models import Page
from wagtail.tests.models import RoutablePageTest, routable_page_external_view
class TestRoutablePage(TestCase):
def setUp(self):
self.home_page = Page.objects.get(id=2)
self.routable_page = self.home_page.add_child(inst... | bsd-3-clause |
yoosw/printrun_golconda | setup.py | 12 | 5945 | #!/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 |
yqzhang/OpenANN | benchmarks/iris/benchmark.py | 5 | 3308 | ## \page IrisBenchmark Iris Flower Dataset
#
# The iris dataset is a standard machine learning dataset.
# See e.g. the <a href="http://en.wikipedia.org/wiki/Iris_flower_data_set"
# target=_blank>Wikipedia article</a> for more details.
#
# You can start the benchmark with the script:
# \verbatim
# python benchmark... | gpl-3.0 |
ChronoMonochrome/android_external_chromium_org | build/android/pylib/utils/flakiness_dashboard_results_uploader.py | 59 | 7781 | # 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.
"""Uploads the results to the flakiness dashboard server."""
import logging
import os
import shutil
import subprocess
import sys
import tempfile
import ... | bsd-3-clause |
0jpq0/kbengine | kbe/src/lib/python/Lib/test/test_heapq.py | 111 | 14475 | """Unittests for heapq."""
import sys
import random
import unittest
from test import support
from unittest import TestCase, skipUnless
py_heapq = support.import_fresh_module('heapq', blocked=['_heapq'])
c_heapq = support.import_fresh_module('heapq', fresh=['_heapq'])
# _heapq.nlargest/nsmallest are saved in heapq._... | lgpl-3.0 |
joegomes/deepchem | deepchem/models/tensorflow_models/lr.py | 2 | 9592 | # -*- coding: utf-8 -*-
"""
Created on Tue Nov 08 14:10:02 2016
@author: Zhenqin Wu
"""
import tensorflow as tf
import numpy as np
import os
import time
from deepchem.metrics import from_one_hot
from deepchem.models.tensorflow_models import TensorflowGraph
from deepchem.models.tensorflow_models import TensorflowGraph... | mit |
tkingless/webtesting | venvs/tutorials/lib/python2.7/site-packages/pip/_vendor/pyparsing.py | 75 | 158096 | # module pyparsing.py
#
# Copyright (c) 2003-2015 Paul T. McGuire
#
# 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, cop... | mit |
WeblateOrg/weblate | weblate/accounts/notifications.py | 1 | 25871 | #
# Copyright © 2012 - 2021 Michal Čihař <michal@cihar.com>
#
# This file is part of Weblate <https://weblate.org/>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the Lice... | gpl-3.0 |
pornmailbox/linux-hi3518 | tools/perf/scripts/python/syscall-counts.py | 1996 | 1700 | # 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 |
fritzo/googlemock | test/gmock_output_test.py | 986 | 5999 | #!/usr/bin/env python
#
# Copyright 2008, 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... | bsd-3-clause |
aspinuso/dispel4py | dispel4py/storm/storm_submission.py | 4 | 10651 | # Copyright (c) The University of Edinburgh 2014
#
# 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 agr... | apache-2.0 |
kenshay/ImageScripter | ProgramData/SystemFiles/Python/Tools/Scripts/parseentities.py | 44 | 1719 | #!/usr/bin/env python
""" Utility for parsing HTML entity definitions available from:
http://www.w3.org/ as e.g.
http://www.w3.org/TR/REC-html40/HTMLlat1.ent
Input is read from stdin, output is written to stdout in form of a
Python snippet defining a dictionary "entitydefs" mapping literal
ent... | gpl-3.0 |
asgard-lab/neutron | neutron/tests/common/net_helpers.py | 1 | 20604 | # Copyright (c) 2015 Thales Services SAS
#
# 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 |
calfonso/ansible | lib/ansible/modules/identity/ipa/ipa_role.py | 94 | 10522 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# 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
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | gpl-3.0 |
richard-willowit/odoo | addons/account_voucher/__manifest__.py | 36 | 1684 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name' : 'Sale & Purchase Vouchers',
'version' : '1.0',
'summary': 'Manage your debts and credits thanks to simple sale/purchase receipts',
'description': """
TODO
old description:
Invoicing & Payments... | gpl-3.0 |
aerkalov/booktype-scrolls | scripts/replace/replace_in_chapter.py | 1 | 2053 | #!/usr/bin/env python
# This file is part of booktype-scrolls.
# Copyright (c) 2012 Aleksandar Erkalovic <aleksandar.erkalovic@sourcefabric.org>
#
# Booktype 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 Foundati... | agpl-3.0 |
PeterKietzmann/RIOT | dist/tools/compile_and_test_for_board/compile_and_test_for_board.py | 8 | 25004 | #! /usr/bin/env python3
"""
This script handles building all applications and tests for one board and also
execute tests if they are available.
An incremental build can selected using `--incremental` to not rerun successful
compilation and tests. But then it should be run on a fixed version of the
repository as no ve... | lgpl-2.1 |
Signbank/Auslan-signbank | signbank/dictionary/migrations/0033_auto__del_field_gloss_InSuppBook__del_field_gloss_NotBkDBOnly__del_fie.py | 2 | 9592 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Deleting field 'Gloss.InSuppBook'
db.delete_column('dictionary_gloss', 'InSuppBook')
# Deleting f... | bsd-3-clause |
gvaf/breakpad | src/testing/gtest/test/gtest_env_var_test.py | 7 | 3711 | #!/usr/bin/env python
#
# Copyright 2008, 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... | bsd-3-clause |
faturita/ShinkeyBot | NeoCortex/PILServer.py | 1 | 1155 | import io
import socket
import struct
from PIL import Image
# Start a socket listening for connections on 0.0.0.0:8000 (0.0.0.0 means
# all interfaces)
server_socket = socket.socket()
server_socket.bind(('0.0.0.0', 8000))
server_socket.listen(0)
# Accept a single connection and make a file-like object out of it
conne... | mit |
Trinitaria/namebench | libnamebench/data_sources.py | 173 | 15580 | #!/usr/bin/env python
# Copyright 2009 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required... | apache-2.0 |
tornadozou/tensorflow | tensorflow/contrib/distributions/python/kernel_tests/bijectors/softmax_centered_test.py | 70 | 4301 | # 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 |
sinkuri256/python-for-android | python3-alpha/python3-src/Lib/tkinter/test/test_ttk/test_style.py | 54 | 2792 | import unittest
import tkinter
from tkinter import ttk
from test.support import requires, run_unittest
import tkinter.test.support as support
requires('gui')
class StyleTest(unittest.TestCase):
def setUp(self):
self.style = ttk.Style()
def test_configure(self):
style = self.style
s... | apache-2.0 |
mahak/cinder | cinder/tests/unit/volume/drivers/vmware/fake.py | 2 | 1187 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | apache-2.0 |
ChronoMonochrome/android_external_chromium_org | chrome/common/extensions/docs/server2/caching_file_system_test.py | 23 | 8818 | #!/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 os
import sys
import unittest
from caching_file_system import CachingFileSystem
from file_system import StatInfo
from loca... | bsd-3-clause |
mohittahiliani/tcp-eval-suite-ns3 | src/point-to-point-layout/bindings/modulegen__gcc_ILP32.py | 28 | 477247 | from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers
import pybindgen.settings
import warnings
class ErrorHandler(pybindgen.settings.ErrorHandler):
def handle_error(self, wrapper, exception, traceback_):
warnings.warn("exception %r in wrapper %s" % (exception, wrapper))
... | gpl-2.0 |
pomegranited/edx-platform | lms/djangoapps/instructor/tests/test_api_email_localization.py | 64 | 3576 | # -*- coding: utf-8 -*-
"""
Unit tests for the localization of emails sent by instructor.api methods.
"""
from django.core import mail
from django.core.urlresolvers import reverse
from nose.plugins.attrib import attr
from courseware.tests.factories import InstructorFactory
from lang_pref import LANGUAGE_KEY
from stud... | agpl-3.0 |
melbit-kevinwessel/ansible-modules-core | database/mysql/mysql_user.py | 24 | 17625 | #!/usr/bin/python
# (c) 2012, Mark Theunissen <mark.theunissen@gmail.com>
# Sponsored by Four Kitchens http://fourkitchens.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... | gpl-3.0 |
mindw/numpy | numpy/doc/byteswapping.py | 110 | 5349 | """
=============================
Byteswapping and byte order
=============================
Introduction to byte ordering and ndarrays
==========================================
The ``ndarray`` is an object that provide a python array interface to data
in memory.
It often happens that the memory that you want to v... | bsd-3-clause |
MichaelNedzelsky/intellij-community | python/lib/Lib/site-packages/django/contrib/localflavor/kw/forms.py | 310 | 1988 | """
Kuwait-specific Form helpers
"""
import re
from datetime import date
from django.core.validators import EMPTY_VALUES
from django.forms import ValidationError
from django.forms.fields import Field, RegexField
from django.utils.translation import gettext as _
id_re = re.compile(r'^(?P<initial>\d{1})(?P<yy>\d\d)(?P<... | apache-2.0 |
newville/scikit-image | skimage/feature/tests/test_blob.py | 4 | 4824 | import numpy as np
from skimage.draw import circle
from skimage.feature import blob_dog, blob_log, blob_doh
import math
from numpy.testing import assert_raises
def test_blob_dog():
r2 = math.sqrt(2)
img = np.ones((512, 512))
img3 = np.ones((5, 5, 5))
xs, ys = circle(400, 130, 5)
img[xs, ys] = 255... | bsd-3-clause |
vanhonit/xmario_center | test/gtk3/test_views.py | 3 | 1739 | #!/usr/bin/python
from gi.repository import Gtk, GObject
import unittest
from testutils import setup_test_env
setup_test_env()
TIMEOUT=300
class TestViews(unittest.TestCase):
def test_viewswitcher(self):
from softwarecenter.ui.gtk3.panes.viewswitcher import get_test_window_viewswitcher
win = ge... | gpl-3.0 |
tyagiarpit/servo | tests/wpt/css-tests/css-text-decor-3_dev/xhtml1print/support/generate-text-emphasis-position-property-tests.py | 841 | 3343 | #!/usr/bin/env python
# - * - coding: UTF-8 - * -
"""
This script generates tests text-emphasis-position-property-001 ~ 006
which cover all possible values of text-emphasis-position property with
all combination of three main writing modes and two orientations. Only
test files are generated by this script. It also out... | mpl-2.0 |
alon/polinax | libs/external_libs/python-openid-2.1.1/openid/test/test_consumer.py | 10 | 75107 | import urlparse
import cgi
import time
import warnings
from openid.message import Message, OPENID_NS, OPENID2_NS, IDENTIFIER_SELECT, \
OPENID1_NS, BARE_NS
from openid import cryptutil, dh, oidutil, kvform
from openid.store.nonce import mkNonce, split as splitNonce
from openid.consumer.discover import OpenIDServic... | gpl-2.0 |
tiran/sssd | src/sbus/codegen/sbus_Template.py | 6 | 9834 | #
# Authors:
# Pavel Brezina <pbrezina@redhat.com>
#
# Copyright (C) 2017 Red Hat
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at yo... | gpl-3.0 |
IljaKosynkin/ResourcesManager | ResourceManager/scripts/MappingParser.py | 1 | 3815 | import re
classes_reg = re.compile(r'(.+?)(<?->)(.+)')
variable_reg = re.compile(r'(.+?)(,.+?)?(<?->)([^,]+)(,.+)?')
class_reg = re.compile(r'(class|struct)([^:{]+?)(:[^{]+?){([^}]+?)}', re.DOTALL)
class_var_reg = re.compile(r'(let|var)([^:=]+?)(:[^=]+)(=.+?)?')
class Direction:
ONE_WAY = 0
TWO_WAY = 1
... | apache-2.0 |
kiith-sa/QGIS | python/plugins/processing/tests/qgis_interface.py | 8 | 3356 | # -*- coding: utf-8 -*-
"""
InaSAFE Disaster risk assessment tool developed by AusAid -
**QGIS plugin implementation.**
Contact : ole.moller.nielsen@gmail.com
.. note:: 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
... | gpl-2.0 |
keithlee/shakeAppPyDev | django/core/management/commands/flush.py | 249 | 3437 | from optparse import make_option
from django.conf import settings
from django.db import connections, router, transaction, models, DEFAULT_DB_ALIAS
from django.core.management import call_command
from django.core.management.base import NoArgsCommand, CommandError
from django.core.management.color import no_style
from d... | bsd-3-clause |
dlazz/ansible | lib/ansible/modules/system/dconf.py | 5 | 13112 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2017, Branko Majic <branko@majic.rs>
# 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 |
christiandev/l10n-brazil | __unported__/l10n_br_account_product/account_product_fiscal_classification.py | 2 | 15143 | # -*- encoding: utf-8 -*-
###############################################################################
# #
# Copyright (C) 2012 Renato Lima - Akretion #
# ... | agpl-3.0 |
ThinkingBridge/platform_external_chromium_org | build/android/pylib/gtest/test_package_apk.py | 23 | 4809 | # 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.
"""Defines TestPackageApk to help run APK-based native tests."""
import logging
import os
import shlex
import sys
import tempfile
import time
from pyli... | bsd-3-clause |
dvliman/jaikuengine | .google_appengine/lib/django-1.4/tests/regressiontests/generic_views/urls.py | 29 | 10284 | from __future__ import absolute_import
from django.conf.urls import patterns, url
from django.views.decorators.cache import cache_page
from django.views.generic import TemplateView
from . import views
urlpatterns = patterns('',
# base
#(r'^about/login-required/$',
# views.DecoratedAboutView()),
... | apache-2.0 |
gauribhoite/personfinder | app/subscribe.py | 5 | 9574 | #!/usr/bin/python2.7
# Copyright 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | apache-2.0 |
alexei-matveev/ase-local | doc/exercises/siesta1/answer1.py | 3 | 1197 | # -*- coding: utf-8 -*-
# creates: ener.png distance.png angle.png
import os
import matplotlib
matplotlib.use('Agg')
import pylab as plt
e_s = [0.01,0.1,0.2,0.3,0.4,0.5]
E = [-463.2160, -462.9633, -462.4891, -462.0551,
-461.5426, -461.1714]
d = [1.1131, 1.1046, 1.0960, 1.0901,
1.0857, 1.0810]
alpha = [100.... | gpl-2.0 |
jeffcharles/Open-Source-at-Laurier-Website | wluopensource/osl_comments/moderation.py | 1 | 1725 | from django.contrib import comments
from django.contrib.comments.moderation import CommentModerator, Moderator
from django.core.exceptions import ObjectDoesNotExist
from osl_comments import signals
from osl_comments.models import CommentsBannedFromIpAddress
class OslCommentModerator(CommentModerator):
email_notif... | bsd-3-clause |
dpo/nlpy | nlpy/tools/norms.py | 3 | 2495 | import numpy as np
from numpy import infty
from numpy.linalg import norm
def norm1(x):
if len(x) > 0:
return norm(x,ord=1)
return 0.0
def norm2(x):
if len(x) > 0:
return norm(x)
return 0.0
def normp(x,p):
if len(x) > 0:
return norm(x,ord=p)
return 0.0
def norm_infty(x... | gpl-3.0 |
rookdev/pyes | docs/_ext/applyxrefs.py | 91 | 2153 | """Adds xref targets to the top of files."""
import sys
import os
testing = False
DONT_TOUCH = (
'./index.txt',
)
def target_name(fn):
if fn.endswith('.txt'):
fn = fn[:-4]
return '_' + fn.lstrip('./').replace('/', '-')
def process_file(fn, lines):
lines.insert(0, '\n')
lin... | bsd-3-clause |
MayankGo/ec2-api | ec2api/api/common.py | 1 | 14867 | # Copyright 2014
# The Cloudscaling Group, 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 agreed to... | apache-2.0 |
misdess/bitcoin | qa/rpc-tests/mempool_spendcoinbase.py | 133 | 2724 | #!/usr/bin/env python2
# Copyright (c) 2014 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 spending coinbase transactions.
# The coinbase transaction in block N can appear in block
# N+100... ... | mit |
willzhang05/postgrestesting1 | postgrestesting1/lib/python3.5/site-packages/psycopg2/tests/testutils.py | 6 | 10400 | # testutils.py - utility module for psycopg2 testing.
#
# Copyright (C) 2010-2011 Daniele Varrazzo <daniele.varrazzo@gmail.com>
#
# psycopg2 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 vers... | mit |
llonchj/sentry | tests/sentry/plugins/interfaces/test_releasehook.py | 29 | 1132 | """
sentry.plugins.base.structs
~~~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2013 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import, print_function
__all__ = ['ReleaseHook']
from sentry.models import Release
from sentry.plug... | bsd-3-clause |
huahbo/pyamg | pyamg/util/tests/test_BSR_utils.py | 2 | 2205 | from numpy import array, ravel
from scipy import mat
from scipy.sparse import bsr_matrix
from pyamg.util.BSR_utils import BSR_Get_Row, BSR_Row_WriteScalar,\
BSR_Row_WriteVect
from numpy.testing import TestCase, assert_equal
class TestBSRUtils(TestCase):
def test_BSR_Get_Row(self):
indptr = array([0, ... | mit |
kybriainfotech/iSocioCRM | addons/hw_posbox_homepage/controllers/main.py | 27 | 8253 | # -*- coding: utf-8 -*-
import logging
import os
import time
import werkzeug
import subprocess
from os import listdir
import openerp
from openerp import http
from openerp.http import request
from openerp.tools.translate import _
_logger = logging.getLogger(__name__)
index_style = """
<style>
body... | agpl-3.0 |
SamiHiltunen/invenio-communities | requirements.py | 148 | 5904 | #!/usr/bin/env python2
#
# -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2015 CERN.
#
# Invenio is free software; you can redistribute it
# and/or modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (... | gpl-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.