repo_name stringlengths 5 100 | path stringlengths 4 294 | copies stringclasses 990
values | size stringlengths 4 7 | content stringlengths 666 1M | license stringclasses 15
values |
|---|---|---|---|---|---|
rvs/gpdb | src/test/tinc/tincrepo/mpp/gpdb/tests/storage/walrepl/walreceiver/__init__.py | 9 | 2678 | """
Copyright (C) 2004-2015 Pivotal Software, Inc. All rights reserved.
This program and the accompanying materials are made available under
the terms of the 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
... | apache-2.0 |
markovmodel/PyEMMA | pyemma/thermo/tests/test_thermo_msm.py | 2 | 3500 | # This file is part of PyEMMA.
#
# Copyright (c) 2016 Computational Molecular Biology Group, Freie Universitaet Berlin (GER)
#
# PyEMMA is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 o... | lgpl-3.0 |
RedhawkSDR/integration-gnuhawk | gnuradio/gr-trellis/src/lib/generate_trellis.py | 10 | 3378 | #!/usr/bin/env python
#
# Copyright 2006,2007 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 (at your optio... | gpl-3.0 |
wintersandroid/tvrenamr | tests/conftest.py | 2 | 1062 | import os
import shutil
import pytest
from tvrenamr.config import Config
from tvrenamr.main import TvRenamr
from .utils import PATH, build_path, join_path
FILES = build_path(join_path('files'))
@pytest.fixture
def files(request):
"""Build the file list"""
with open(os.path.join(PATH, 'file_list'), 'r') as ... | mit |
foligny/browsershots-psycopg2 | shotfactory/browsershot.py | 1 | 2049 | #!/usr/bin/env python
# browsershots.org - Test your web design in different browsers
# Copyright (C) 2007 Johann C. Rocholl <johann@browsershots.org>
#
# Browsershots 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 Found... | gpl-3.0 |
hrishioa/Aviato | flask/Lib/site-packages/nltk/corpus/reader/ppattach.py | 10 | 3138 | # Natural Language Toolkit: PP Attachment Corpus Reader
#
# Copyright (C) 2001-2015 NLTK Project
# Author: Steven Bird <stevenbird1@gmail.com>
# Edward Loper <edloper@gmail.com>
# URL: <http://nltk.org/>
# For license information, see LICENSE.TXT
"""
Read lines from the Prepositional Phrase Attachment Corpus.
... | gpl-2.0 |
welovemusic/musiccoin | share/qt/make_spinner.py | 4415 | 1035 | #!/usr/bin/env python
# W.J. van der Laan, 2011
# Make spinning .mng animation from a .png
# Requires imagemagick 6.7+
from __future__ import division
from os import path
from PIL import Image
from subprocess import Popen
SRC='img/reload_scaled.png'
DST='../../src/qt/res/movies/update_spinner.mng'
TMPDIR='/tmp'
TMPNAM... | mit |
wa111/namebench | nb_third_party/dns/rdtypes/txtbase.py | 248 | 2986 | # Copyright (C) 2006, 2007, 2009, 2010 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
# provided that the above copyright notice and this permission notice
# appear in all copies.
#
# THE SOFTWARE IS PROVIDED... | apache-2.0 |
stormi/tsunami | src/primaires/tresor/commandes/tresor/joueur.py | 1 | 2814 | # -*-coding:Utf-8 -*
# Copyright (c) 2012 LE GOFF Vincent
# 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... | bsd-3-clause |
yize/grunt-tps | tasks/lib/python/Lib/python2.7/plat-mac/lib-scriptpackages/StdSuites/Standard_Suite.py | 73 | 25045 | """Suite Standard Suite: Common terms for most applications
Level 1, version 1
Generated from /Volumes/Sap/System Folder/Extensions/AppleScript
AETE/AEUT resource version 1/0, language 0, script 0
"""
import aetools
import MacOS
_code = 'core'
from _builtinSuites.builtin_Suite import *
class Standard_Suite_Events(b... | mit |
xtr4nge/the-backdoor-factory | payloadtests.py | 13 | 6022 | #!/usr/bin/env python
'''
Copyright (c) 2013-2015, Joshua Pitts
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 li... | bsd-3-clause |
ckane/crits | crits/relationships/forms.py | 14 | 3253 | from django.conf import settings
from django import forms
from crits.core.widgets import CalWidget
from crits.vocabulary.relationships import RelationshipTypes
class ForgeRelationshipForm(forms.Form):
"""
Django form for forging relationships between two top-level objects.
"""
error_css_class = 'erro... | mit |
aehlke/manabi-dict | src/manabidict/epwingprotocol.py | 1 | 10829 |
from PyQt4.QtGui import *
from PyQt4.QtCore import *
from PyQt4.Qt import Qt
from PyQt4.QtNetwork import QNetworkAccessManager, QNetworkRequest, QNetworkReply
from epywing.uris import route as route_dictionary_uri, collection_uri_prefix
import time
EPWING_URL_SCHEME = 'epwing'
class EpwingRenderer(QThread):
... | gpl-3.0 |
zikifer/node-gyp | legacy/tools/gyp/pylib/gyp/MSVSToolFile.py | 42 | 1800 | # 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.
"""Visual Studio project reader/writer."""
import common
import gyp.easy_xml as easy_xml
class Writer(object):
"""Visual Studio XML tool file writer."""
de... | mit |
rajat1994/brotli | python/tests/test_utils.py | 98 | 1128 | from __future__ import print_function
import sys
import os
import sysconfig
import filecmp
def diff_q(first_file, second_file):
"""Simulate call to POSIX diff with -q argument"""
if not filecmp.cmp(first_file, second_file, shallow=False):
print("Files %s and %s differ" % (first_file, second_file),
... | apache-2.0 |
kapari/ak-space | node_modules/node-gyp/gyp/pylib/gyp/generator/ninja_test.py | 1843 | 1786 | #!/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.
""" Unit tests for the ninja.py file. """
import gyp.generator.ninja as ninja
import unittest
import StringIO
import sys
import TestCommon
... | apache-2.0 |
chrisjrn/registrasion | registrasion/tests/patches.py | 1 | 1293 | from django.utils import timezone
from registrasion.contrib import mail
class SetTimeMixin(object):
''' Patches timezone.now() for the duration of a test case. Allows us to
test time-based conditions (ceilings etc) relatively easily. '''
def setUp(self):
super(SetTimeMixin, self).setUp()
... | apache-2.0 |
Godiyos/python-for-android | python3-alpha/python3-src/Lib/lib2to3/fixes/fix_idioms.py | 203 | 4876 | """Adjust some old Python 2 idioms to their modern counterparts.
* Change some type comparisons to isinstance() calls:
type(x) == T -> isinstance(x, T)
type(x) is T -> isinstance(x, T)
type(x) != T -> not isinstance(x, T)
type(x) is not T -> not isinstance(x, T)
* Change "while 1:" into "while True:".... | apache-2.0 |
csuttles/utils | python/todo-api/flask/lib/python2.7/site-packages/flask/testsuite/reqctx.py | 557 | 5960 | # -*- coding: utf-8 -*-
"""
flask.testsuite.reqctx
~~~~~~~~~~~~~~~~~~~~~~
Tests the request context.
:copyright: (c) 2012 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import flask
import unittest
try:
from greenlet import greenlet
except ImportError:
greenlet = None... | apache-2.0 |
tensorflow/tensorflow | tensorflow/python/distribute/integration_test/saved_model_test.py | 6 | 25892 | # Copyright 2020 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 |
anthrotype/nototools | third_party/spiro/curves/bigmat.py | 15 | 21245 | # Solver based on direct Newton solving of 4 parameters for each curve
# segment
import sys
from math import *
from Numeric import *
import LinearAlgebra as la
import poly3
import band
class Seg:
def __init__(self, chord, th):
self.ks = [0., 0., 0., 0.]
self.chord = chord
self.th = th
... | apache-2.0 |
sujithshankar/anaconda | pyanaconda/ui/gui/helpers.py | 1 | 8496 | # Abstract base classes for GUI classes
#
# Copyright (C) 2014 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# the GNU General Public License v.2, or (at your option) any later version.
# This program is... | gpl-2.0 |
MiLk/youtube-dl | youtube_dl/extractor/jpopsukitv.py | 15 | 2728 | # coding=utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
int_or_none,
unified_strdate,
)
class JpopsukiIE(InfoExtractor):
IE_NAME = 'jpopsuki.tv'
_VALID_URL = r'https?://(?:www\.)?jpopsuki\.tv/video/(.*?)/(?P<id>\S+)'
_TEST = {
... | unlicense |
alteredlikeness/android_kernel_msm | tools/perf/python/twatch.py | 7370 | 1334 | #! /usr/bin/python
# -*- python -*-
# -*- coding: utf-8 -*-
# twatch - Experimental use of the perf python interface
# Copyright (C) 2011 Arnaldo Carvalho de Melo <acme@redhat.com>
#
# This application is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License... | gpl-2.0 |
kjc88/sl4a | python/src/Tools/scripts/pysource.py | 94 | 3846 | #!/usr/bin/env python
"""\
List python source files.
There are three functions to check whether a file is a Python source, listed
here with increasing complexity:
- has_python_ext() checks whether a file name ends in '.py[w]'.
- look_like_python() checks whether the file is not binary and either has
the '.py[w]' e... | apache-2.0 |
dtran320/xhtml2pdf | test/visualdiff.py | 13 | 3376 | # Copyright 2010 Dirk Holtwick, holtwick.it
#
# 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... | apache-2.0 |
dvliman/jaikuengine | .google_appengine/lib/django-1.4/tests/modeltests/many_to_many/tests.py | 25 | 17889 | from __future__ import absolute_import, with_statement
from django.test import TestCase
from .models import Article, Publication
class ManyToManyTests(TestCase):
def setUp(self):
# Create a couple of Publications.
self.p1 = Publication.objects.create(id=None, title='The Python Journal')
... | apache-2.0 |
AdamWill/anaconda | pyanaconda/ui/tui/spokes/shell_spoke.py | 2 | 2293 | #
# Copyright (C) 2013 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# the GNU General Public License v.2, or (at your option) any later version.
# This program is distributed in the hope that it will be... | gpl-2.0 |
Gagravarr/django-cmis-engine | djangocmis/backends/base.py | 1 | 4011 | #
# 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
# distributed ... | apache-2.0 |
joelddiaz/openshift-tools | openshift/installer/vendored/openshift-ansible-3.6.173.0.59/roles/lib_openshift/library/oc_env.py | 7 | 65042 | #!/usr/bin/env python
# pylint: disable=missing-docstring
# flake8: noqa: T001
# ___ ___ _ _ ___ ___ _ _____ ___ ___
# / __| __| \| | __| _ \ /_\_ _| __| \
# | (_ | _|| .` | _|| / / _ \| | | _|| |) |
# \___|___|_|\_|___|_|_\/_/_\_\_|_|___|___/_ _____
# | \ / _ \ | \| |/ _ \_ _| | __| \_ ... | apache-2.0 |
betrisey/home-assistant | homeassistant/components/device_tracker/netgear.py | 15 | 3073 | """
Support for Netgear routers.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/device_tracker.netgear/
"""
import logging
import threading
from datetime import timedelta
import voluptuous as vol
import homeassistant.helpers.config_validation as cv
fro... | mit |
bruecksen/isimip | isi_mip/sciencepaper/crossrefpy.py | 1 | 1024 | import requests
# DOI http://stackoverflow.com/questions/27910/finding-a-doi-in-a-document-or-page
url = 'http://api.crossref.org/works?rows={rows}&query={query}'
class Reference:
def __init__(self, json):
for key in json.keys():
setattr(self, key, json[key])
def to_bibtex(self):
... | mit |
ArtemTeleshev/raspberrypi-linux | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/EventClass.py | 4653 | 3596 | # EventClass.py
#
# This is a library defining some events types classes, which could
# be used by other scripts to analyzing the perf samples.
#
# Currently there are just a few classes defined for examples,
# PerfEvent is the base class for all perf event sample, PebsEvent
# is a HW base Intel x86 PEBS event, and use... | gpl-2.0 |
lmregus/Portfolio | python/design_patterns/env/lib/python3.7/site-packages/pyflakes/test/test_undefined_names.py | 7 | 25291 | import ast
from sys import version_info
from pyflakes import messages as m, checker
from pyflakes.test.harness import TestCase, skipIf, skip
class Test(TestCase):
def test_undefined(self):
self.flakes('bar', m.UndefinedName)
def test_definedInListComp(self):
self.flakes('[a for a in range(10... | mit |
lscheinkman/nupic | src/nupic/frameworks/viz/examples/visualize_network.py | 14 | 2314 | #!/usr/bin/env python
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2017, 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 |
GinnyN/towerofdimensions-django | tests/regressiontests/mail/tests.py | 29 | 33513 | # coding: utf-8
import asyncore
import email
import os
import shutil
import smtpd
import sys
from StringIO import StringIO
import tempfile
import threading
from django.core import mail
from django.core.mail import (EmailMessage, mail_admins, mail_managers,
EmailMultiAlternatives, send_mail, send_mass_mail)
fro... | bsd-3-clause |
jyeatman/dipy | dipy/segment/tests/test_mask.py | 11 | 3879 | import warnings
import numpy as np
import nibabel as nib
from scipy.ndimage import generate_binary_structure, binary_dilation
from scipy.ndimage.filters import median_filter
from dipy.segment.mask import (otsu, bounding_box, crop, applymask,
multi_median, median_otsu)
from numpy.testin... | bsd-3-clause |
cactusbin/nyt | matplotlib/examples/pylab_examples/demo_agg_filter.py | 10 | 9340 | import matplotlib.pyplot as plt
import numpy as np
import matplotlib.cm as cm
import matplotlib.mlab as mlab
def smooth1d(x, window_len):
# copied from http://www.scipy.org/Cookbook/SignalSmooth
s=np.r_[2*x[0]-x[window_len:1:-1],x,2*x[-1]-x[-1:-window_len:-1]]
w = np.hanning(window_len)
y=np.convolve... | unlicense |
rowhit/h2o-2 | py/testdir_multi_jvm/test_GLM2.py | 9 | 5711 | import unittest, time, sys
sys.path.extend(['.','..','../..','py'])
import h2o, h2o_cmd, h2o_import as h2i, h2o_print as h2p, h2o_glm
# Test of glm comparing result against R-implementation
# Tested on prostate.csv short (< 1M) and long (multiple chunks)
# kbn. just updated the parseFile and runGLMonly to match the
#... | apache-2.0 |
xephero/rebooru | rebooru/apps/images/migrations/0002_auto__add_field_image_date_uploaded.py | 1 | 4328 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Image.date_uploaded'
db.add_column(u'images_image', 'date_uploaded',
s... | bsd-2-clause |
Universal-Model-Converter/UMC3.0a | data/Python/x86/Lib/site-packages/scipy/optimize/tests/test_zeros.py | 4 | 1961 | #!/usr/bin/env python
from __future__ import division, print_function, absolute_import
from math import sqrt, exp, sin, cos
from numpy.testing import TestCase, assert_almost_equal, assert_warns, \
assert_, run_module_suite, assert_allclose
from scipy.optimize import zeros as cc
from scipy... | mit |
endolith/numpy | numpy/testing/tests/test_doctesting.py | 17 | 1347 | """ Doctests for NumPy-specific nose/doctest modifications
"""
#FIXME: None of these tests is run, because 'check' is not a recognized
# testing prefix.
# try the #random directive on the output line
def check_random_directive():
'''
>>> 2+2
<BadExample object at 0x084D05AC> #random: may vary on your sys... | bsd-3-clause |
waseem18/oh-mainline | vendor/packages/kombu/kombu/tests/transport/test_redis.py | 20 | 40006 | from __future__ import absolute_import
import socket
import types
from anyjson import dumps, loads
from collections import defaultdict
from itertools import count
from kombu import Connection, Exchange, Queue, Consumer, Producer
from kombu.exceptions import InconsistencyError, VersionMismatch
from kombu.five import ... | agpl-3.0 |
daphnei/nn_chatbot | seq2seq/seq2seq/contrib/seq2seq/decoder.py | 6 | 10401 | # 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... | mit |
sajeeshcs/nested_quota_latest | nova/virt/xenapi/vm_utils.py | 5 | 99204 | # Copyright (c) 2010 Citrix Systems, Inc.
# Copyright 2011 Piston Cloud Computing, Inc.
# Copyright 2012 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# ... | apache-2.0 |
quinot/ansible | lib/ansible/module_utils/network/common/utils.py | 11 | 17265 | # This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by Ansible
# still belong to the author of the module, and may assign their own license
# to the complete wo... | gpl-3.0 |
RJ722/coala | coalib/bearlib/languages/documentation/DocumentationExtraction.py | 5 | 11114 | import re
from coalib.bearlib.languages.documentation.DocstyleDefinition import (
DocstyleDefinition)
from coalib.bearlib.languages.documentation.DocumentationComment import (
DocumentationComment)
from coalib.results.TextRange import TextRange
def _extract_doc_comment_simple(content, line, column, markers):... | agpl-3.0 |
xkcd1253/SocialNetworkforTwo | flask/lib/python2.7/site-packages/werkzeug/testsuite/debug.py | 101 | 7859 | # -*- coding: utf-8 -*-
"""
werkzeug.testsuite.debug
~~~~~~~~~~~~~~~~~~~~~~~~
Tests some debug utilities.
:copyright: (c) 2013 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import unittest
import sys
import re
from werkzeug.testsuite import WerkzeugTestCase
from werkzeug.deb... | gpl-2.0 |
klmitch/keystone | keystone/token/controllers.py | 3 | 20575 | # Copyright 2013 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | apache-2.0 |
Yuudachimoe/HikariChun-RedBot | lib/youtube_dl/extractor/mpora.py | 175 | 2053 | from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import int_or_none
class MporaIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?mpora\.(?:com|de)/videos/(?P<id>[^?#/]+)'
IE_NAME = 'MPORA'
_TEST = {
'url': 'http://mpora.de/videos/AAdo8okx4wiz/embed?locale... | gpl-3.0 |
MeGotsThis/BotGotsThis | pkg/botgotsthis/library/channel.py | 1 | 1687 | from typing import Optional, Union # noqa: F401
import bot
from bot import utils
from lib.data import Send
from lib.database import DatabaseMain
from lib.helper import timeout
async def join(channel: str,
send: Send) -> bool:
priority: Union[int, float]
db: DatabaseMain
async with Databa... | gpl-3.0 |
mvaled/sentry | tests/sentry/projectoptions/test_basic.py | 2 | 1806 | from __future__ import absolute_import
import pytest
from contextlib import contextmanager
from sentry.projectoptions import defaults, default_manager
from sentry.projectoptions.manager import WellKnownProjectOption
from sentry.models import ProjectOption
@contextmanager
def latest_epoch(value):
old = defaults... | bsd-3-clause |
VirtualMonitor/VirtualMonitor | src/libs/xpcom18a4/python/file.py | 26 | 11962 | # ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (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.mozilla.org/MPL/
#
# Softwa... | gpl-2.0 |
GISAElkartea/amv2 | antxetamedia/radio/migrations/0004_auto_20150729_1835.py | 1 | 4535 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import autoslug.fields
import django.utils.timezone
import ckeditor.fields
class Migration(migrations.Migration):
dependencies = [
('radio', '0003_auto_20150625_1205'),
]
operations = [
... | agpl-3.0 |
richardkiss/pycoin | pycoin/cmds/coinc.py | 1 | 1960 | #!/usr/bin/env python
import argparse
from pycoin.encoding.hexbytes import b2h
from pycoin.networks.registry import network_codes, network_for_netcode
from pycoin.networks.default import get_current_netcode
def create_parser():
codes = network_codes()
EPILOG = ('Known networks codes:\n ' +
', ... | mit |
Nagalim/alp-collection | python/utils.py | 1 | 9919 | #! /usr/bin/env python
"""
The MIT License (MIT)
Copyright (c) 2015 creon (creon.nu@gmail.com)
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... | mit |
ddrmanxbxfr/servo | tests/wpt/web-platform-tests/tools/wptserve/tests/functional/test_handlers.py | 77 | 11803 | import json
import os
import pytest
import unittest
import urllib2
import uuid
import wptserve
from .base import TestUsingServer, doc_root
class TestFileHandler(TestUsingServer):
def test_GET(self):
resp = self.request("/document.txt")
self.assertEqual(200, resp.getcode())
self.assertEqual... | mpl-2.0 |
MJuddBooth/pandas | pandas/tests/io/generate_legacy_storage_files.py | 1 | 12877 | #!/usr/bin/env python
"""
self-contained to write legacy storage (pickle/msgpack) files
To use this script. Create an environment where you want
generate pickles, say its for 0.18.1, with your pandas clone
in ~/pandas
. activate pandas_0.18.1
cd ~/
$ python pandas/pandas/tests/io/generate_legacy_storage_files.py \
... | bsd-3-clause |
libracore/erpnext | erpnext/hr/doctype/employee_advance/employee_advance.py | 2 | 4058 | # -*- coding: utf-8 -*-
# Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe, erpnext
from frappe import _
from frappe.model.document import Document
from frappe.utils import flt, nowdate
class Empl... | gpl-3.0 |
rhdedgar/openshift-tools | openshift/installer/vendored/openshift-ansible-3.6.173/roles/openshift_health_checker/test/aos_version_test.py | 56 | 5259 | import pytest
import aos_version
from collections import namedtuple
Package = namedtuple('Package', ['name', 'version'])
expected_pkgs = {
"spam": {
"name": "spam",
"version": "3.2.1",
"check_multi": False,
},
"eggs": {
"name": "eggs",
"version": "3.2.1",
"c... | apache-2.0 |
whn09/tensorflow | tensorflow/python/framework/dtypes.py | 21 | 19265 | # 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 |
hikelee/projector | android/master/print_db.py | 9 | 8116 | #!/usr/bin/env python2.5
import cgi
import codecs
import os
import pprint
import shutil
import sys
import sqlite3
SCREENS = 0
COLUMNS = 4
ROWS = 4
HOTSEAT_SIZE = 4
CELL_SIZE = 110
CONTAINER_DESKTOP = -100
CONTAINER_HOTSEAT = -101
DIR = "db_files"
AUTO_FILE = DIR + "/launcher.db"
INDEX_FILE = DIR + "/index.html"
de... | mit |
zakuro9715/lettuce | tests/integration/lib/Django-1.3/django/contrib/localflavor/it/it_province.py | 406 | 2740 | # -*- coding: utf-8 -*
PROVINCE_CHOICES = (
('AG', 'Agrigento'),
('AL', 'Alessandria'),
('AN', 'Ancona'),
('AO', 'Aosta'),
('AR', 'Arezzo'),
('AP', 'Ascoli Piceno'),
('AT', 'Asti'),
('AV', 'Avellino'),
('BA', 'Bari'),
('BT', 'Barletta-Andria-Trani'), # active starting from 2009
... | gpl-3.0 |
l5h5t7/ZeroNet | src/Worker/WorkerManager.py | 1 | 22150 | import time
import logging
import random
import collections
import gevent
from Worker import Worker
from Config import config
from util import helper
from Plugin import PluginManager
import util
@PluginManager.acceptPlugins
class WorkerManager(object):
def __init__(self, site):
self.site = site
... | gpl-2.0 |
yars068/blueman | blueman/gui/DeviceSelectorDialog.py | 1 | 1920 | # coding=utf-8
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from __future__ import unicode_literals
import gi
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk
from gi.repository import GObject
from blueman.gui.DeviceSelectorWidget import Dev... | gpl-3.0 |
tpsatish95/Youtube-Comedy-Comparison | Project/PairGuess.py | 1 | 2924 | __author__ = 'satish'
import numpy as np
from time import time
from sklearn.svm import SVR
from xml.dom import minidom
#### Main Path
p = "./"
import sys
sys.path.append(p + "Processor/")
import PreprocessClass
import pickle
def save_obj(obj, name ):
with open( name + '.pkl', 'wb') as f:
pickle.dump(ob... | apache-2.0 |
daviddoria/PointGraphsPhase1 | Examples/VisualizationAlgorithms/Python/probeComb.py | 15 | 4014 | #!/usr/bin/env python
# This shows how to probe a dataset with a plane. The probed data is
# then contoured.
import vtk
from vtk.util.misc import vtkGetDataRoot
VTK_DATA_ROOT = vtkGetDataRoot()
# Read data.
pl3d = vtk.vtkPLOT3DReader()
pl3d.SetXYZFileName(VTK_DATA_ROOT + "/Data/combxyz.bin")
pl3d.SetQFileName(VTK_DA... | bsd-3-clause |
diorcety/intellij-community | python/lib/Lib/site-packages/django/contrib/contenttypes/models.py | 307 | 4052 | from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.utils.encoding import smart_unicode
class ContentTypeManager(models.Manager):
# Cache to avoid re-looking up ContentType objects all over the place.
# This cache is shared by all the get_for_* methods.
_cache ... | apache-2.0 |
die-uhus/blueman | blueman/gui/applet/PluginDialog.py | 1 | 11759 | from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from __future__ import unicode_literals
from gi.repository import Gtk
from blueman.Constants import *
from blueman.Functions import *
from blueman.gui.GenericList import GenericList
import weakref
class Sett... | gpl-3.0 |
akosel/incubator-airflow | airflow/logging_config.py | 2 | 3945 | # -*- 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
#... | apache-2.0 |
dsm054/pandas | pandas/tests/series/test_rank.py | 1 | 19233 | # -*- coding: utf-8 -*-
from distutils.version import LooseVersion
from itertools import chain
import numpy as np
from numpy import nan
import pytest
from pandas._libs.algos import Infinity, NegInfinity
from pandas._libs.tslib import iNaT
import pandas.compat as compat
from pandas.compat import product
import pandas.... | bsd-3-clause |
5y/kivy | kivy/app.py | 4 | 32319 | '''Application
===========
The :class:`App` class is the base for creating Kivy applications.
Think of it as your main entry point into the Kivy run loop. In most cases, you
subclass this class and make your own app. You create an instance of your
specific app class and then, when you are ready to start the applicati... | mit |
bdusell/pycfg | src/util/tree.py | 1 | 2353 | '''A generic tree class.'''
from util.dot import escape
from util.mixin import Keyed
def Tree(node_type):
'''A parameterized tree class which asserts that its nodes carry values
that are instances of a particular type.'''
class TreeClass(Keyed):
def __init__(self, value, subtrees=None):
... | mit |
yongshengwang/builthue | desktop/core/ext-py/Babel-0.9.6/babel/messages/tests/frontend.py | 61 | 30734 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2007 Edgewall Software
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://babel.edgewall.org/wiki/License.
#
# This software cons... | apache-2.0 |
UQ-UQx/edx-platform_lti | common/test/acceptance/pages/lms/peer_calibrate.py | 206 | 1526 | """
Page that allows the student to grade calibration essays
(requirement for being allowed to grade peers).
"""
from bok_choy.page_object import PageObject
from bok_choy.promise import Promise
from .rubric import RubricPage
class PeerCalibratePage(PageObject):
"""
Grade calibration essays.
"""
url ... | agpl-3.0 |
FedoraScientific/salome-yacs | src/yacsloader_swig/Test/testRefcount.py | 1 | 8793 | # Copyright (C) 2006-2014 CEA/DEN, EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library ... | gpl-2.0 |
javalovelinux/SparkGroovyScript | dist/examples/src/main/python/ml/cross_validator.py | 71 | 3944 | #
# 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 |
RedHatQE/cfme_tests | cfme/services/catalogs/catalog.py | 1 | 5652 | import attr
from navmazing import NavigateToAttribute
from navmazing import NavigateToSibling
from widgetastic.utils import Parameter
from widgetastic.widget import Text
from widgetastic_patternfly import Button
from widgetastic_patternfly import Input
from . import ServicesCatalogView
from cfme.common import Taggable... | gpl-2.0 |
micove/libdesktop-agnostic | wafadmin/Tools/gcc.py | 3 | 2590 | #! /usr/bin/env python
# encoding: utf-8
import os,sys
import Configure,Options,Utils
import ccroot,ar
from Configure import conftest
def find_gcc(conf):
v=conf.env
cc=None
if v['CC']:
cc=v['CC']
elif'CC'in conf.environ:
cc=conf.environ['CC']
if not cc:cc=conf.find_program('gcc',var='CC')
if not cc:cc=conf.f... | lgpl-2.1 |
alhashash/odoo | addons/l10n_ar/__init__.py | 40 | 1387 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (c) 2011 Cubic ERP - Teradata SAC. (http://cubicerp.com).
#
# WARNING: This program as such is intended to be used by professional
# programmers who take t... | agpl-3.0 |
neerajvashistha/pa-dude | lib/python2.7/site-packages/PIL/PyAccess.py | 15 | 8719 | #
# The Python Imaging Library
# Pillow fork
#
# Python implementation of the PixelAccess Object
#
# Copyright (c) 1997-2009 by Secret Labs AB. All rights reserved.
# Copyright (c) 1995-2009 by Fredrik Lundh.
# Copyright (c) 2013 Eric Soroos
#
# See the README file for information on usage and redistribution
#
# Note... | mit |
Imperat/SSU-Courses | ssu-formal-languages/lexer/utils.py | 1 | 1482 | import sys
sys.path.insert(0, '/home/imperat/SSU-Courses/ssu-formal-languages')
from pda.pda import PDA
from termcolor import colored
def generate_pda_for_word(word, meta=None, prior=None):
input_alphabet = set(word)
states = range(255)[:len(word)+1]
rules = {i: {word[i]: i+1} for i, _ in enumerate(word)... | apache-2.0 |
JakeBrand/CMPUT410-E6 | v1/lib/python2.7/site-packages/django/test/utils.py | 52 | 17489 | from contextlib import contextmanager
import logging
import re
import sys
import time
from unittest import skipUnless
import warnings
from functools import wraps
from xml.dom.minidom import parseString, Node
from django.apps import apps
from django.conf import settings, UserSettingsHolder
from django.core import mail
... | apache-2.0 |
datacommonsorg/mixer | test/load_testing/docker-image/locust-tasks/tasks.py | 1 | 1429 | #!/usr/bin/env python
# Copyright 2020 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 |
paolodedios/tensorflow | tensorflow/python/keras/distribute/distributed_training_utils.py | 6 | 2490 | # Copyright 2018 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 |
rathodmartin/oc | tools/tst/ftputil-2.8/test/test_ftp_path.py | 1 | 4078 | # Copyright (C) 2003-2012, Stefan Schwarzer <sschwarzer@sschwarzer.net>
# See the file LICENSE for licensing terms.
import ftplib
import unittest
import ftputil
from ftputil import ftp_error
from test import mock_ftplib
from test import test_base
class FailingFTPHost(ftputil.FTPHost):
def _dir(self, path):
... | epl-1.0 |
bigdatauniversity/edx-platform | common/lib/xmodule/xmodule/graders.py | 101 | 17286 | import abc
import inspect
import logging
import random
import sys
from collections import namedtuple
log = logging.getLogger("edx.courseware")
# This is a tuple for holding scores, either from problems or sections.
# Section either indicates the name of the problem or the name of the section
Score = namedtuple("Scor... | agpl-3.0 |
sjuvekar/keras | examples/mnist_irnn.py | 70 | 3041 | from __future__ import absolute_import
from __future__ import print_function
import numpy as np
np.random.seed(1337) # for reproducibility
from keras.datasets import mnist
from keras.models import Sequential
from keras.layers.core import Dense, Activation
from keras.initializations import normal, identity
from keras.... | mit |
Zhongqilong/kbengine | kbe/src/lib/python/Lib/base64.py | 88 | 20167 | #! /usr/bin/env python3
"""Base16, Base32, Base64 (RFC 3548), Base85 and Ascii85 data encodings"""
# Modified 04-Oct-1995 by Jack Jansen to use binascii module
# Modified 30-Dec-2003 by Barry Warsaw to add full RFC 3548 support
# Modified 22-May-2007 by Guido van Rossum to use bytes everywhere
import re
import struc... | lgpl-3.0 |
alimanfoo/zarr | zarr/tests/test_hierarchy.py | 1 | 38032 | # -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, division
import unittest
import tempfile
import atexit
import shutil
import textwrap
import os
import pickle
import warnings
import numpy as np
from numpy.testing import assert_array_equal
import pytest
try:
import azure.storage.blob... | mit |
xlucas/confluence-python-cli | confluenceclient/api/proxy.py | 1 | 1583 | # Copyright (C) 2017 Xavier Lucas
#
# 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 distributed in ... | gpl-3.0 |
waseem18/oh-mainline | vendor/packages/django-invitation/invitation/tests.py | 16 | 6820 | """
Unit tests for django-invitation.
These tests assume that you've completed all the prerequisites for
getting django-invitation running in the default setup, to wit:
1. You have ``invitation`` in your ``INSTALLED_APPS`` setting.
2. You have created all of the templates mentioned in this
application's documenta... | agpl-3.0 |
SimonSapin/servo | tests/wpt/web-platform-tests/tools/third_party/more-itertools/more_itertools/recipes.py | 45 | 14960 | """Imported from the recipes section of the itertools documentation.
All functions taken from the recipes section of the itertools library docs
[1]_.
Some backward-compatible usability improvements have been made.
.. [1] http://docs.python.org/library/itertools.html#recipes
"""
from collections import deque
from ite... | mpl-2.0 |
atomicjets/twitter-for-bigquery | libs/apiclient/schema.py | 149 | 9291 | # Copyright (C) 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 agreed to in writ... | apache-2.0 |
haad/ansible-modules-extras | monitoring/zabbix_maintenance.py | 49 | 12390 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, Alexander Bulimov <lazywolf0@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 t... | gpl-3.0 |
vichoward/python-neutronclient | neutronclient/common/utils.py | 7 | 5942 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011, Nicira Networks, 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/LICENS... | apache-2.0 |
simonwydooghe/ansible | lib/ansible/modules/network/fortios/fortios_user_domain_controller.py | 7 | 10092 | #!/usr/bin/python
from __future__ import (absolute_import, division, print_function)
# Copyright 2019 Fortinet, Inc.
#
# 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 Lic... | gpl-3.0 |
brian-smith723/QARTOD | test/test_auxillary_checks.py | 1 | 1154 | import numpy as np
from ioos_qartod.qc_tests import auxillary_checks
import unittest
class AuxillaryCheckTest(unittest.TestCase):
# range of times every 15 minutes from 2013-01-01 to 2013-01-02
times = np.arange('2013-01-01 00:00:00', '2013-01-02 00:00:00',
dtype='datetime64[15m]')
... | apache-2.0 |
pwarren/AGDeviceControl | agdevicecontrol/thirdparty/site-packages/linux2/twisted/python/release.py | 3 | 1424 | """
A release-automation toolkit.
"""
import sys, os, re
from twisted.python import failure, usage
#errors
class DirectoryExists(OSError):
"""Some directory exists when it shouldn't."""
pass
class DirectoryDoesntExist(OSError):
"""Some directory doesn't exist when it should."""
pass
class Command... | gpl-2.0 |
jw0201/luigi | luigi/contrib/bigquery.py | 3 | 24261 | # -*- coding: utf-8 -*-
#
# Copyright 2015 Twitter 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 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.