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 |
|---|---|---|---|---|---|
jjack15/CS402-Project-UTK | OnlinePythonTutor/v3/watch_module.py | 3 | 2196 | # Created by Peter Norvig
# TODO: need to somehow enable sys._getframe()
# even though 'sys' is technically locked down
#import inspect # old and really slow!
import sys
class watchedlist(list):
"""A class that wraps a list, and monitors sets and gets.
Optionally monitors local variables."""
def __set... | agpl-3.0 |
krikru/tensorflow-opencl | tensorflow/contrib/training/python/training/failure_tolerator_test.py | 54 | 4445 | # 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 |
asadoughi/python-neutronclient | neutronclient/openstack/common/strutils.py | 1 | 7376 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 OpenStack Foundation.
# 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.apac... | apache-2.0 |
ngonzalvez/sentry | src/sentry/migrations/0064_index_checksum.py | 36 | 19092 | # -*- 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):
db.create_index('sentry_groupedmessage', ['project_id', 'checksum'])
def backwards(self, orm):
db.delet... | bsd-3-clause |
cp16net/trove | trove/cmd/common.py | 2 | 2441 | # Copyright 2014 Rackspace Hosting
# 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 require... | apache-2.0 |
ethanrublee/ecto-release | test/benchmark/metrics.py | 2 | 4617 | #!/usr/bin/env python
#
# Copyright (c) 2011, Willow Garage, 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
# n... | bsd-3-clause |
littlstar/chromium.src | tools/telemetry/telemetry/results/gtest_progress_reporter.py | 6 | 4171 | # Copyright 2014 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 time
from telemetry.results import progress_reporter
from telemetry.value import failure
from telemetry.value import skip
class GTestProgressReport... | bsd-3-clause |
Yannig/ansible | lib/ansible/modules/cloud/amazon/cloudformation.py | 8 | 25361 | #!/usr/bin/python
# 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
# upcoming features:
# - Ted's multifile YAML concatenation
# - changesets (and bl... | gpl-3.0 |
waseem18/oh-mainline | vendor/packages/twisted/twisted/words/im/baseaccount.py | 80 | 1808 | # -*- Python -*-
#
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
#
class AccountManager:
"""I am responsible for managing a user's accounts.
That is, remembering what accounts are available, their settings,
adding and removal of accounts, etc.
@ivar accounts: A collection ... | agpl-3.0 |
SimplyKnownAsG/yaml-cpp | test/gtest-1.8.0/googletest/scripts/upload_gtest.py | 1963 | 2851 | #!/usr/bin/env python
#
# Copyright 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... | mit |
manashmndl/flexx | flexx/react/tests/test_both.py | 20 | 15553 | """
Tests that should run in both Python and JS.
This helps ensure that both implementation work in the same way.
Focus on use-cases rather than coverage.
These tests work a bit awkward, but its very useful to be able to test
that the two systems work exactly the same way. You define a class with
signals, and then pr... | bsd-2-clause |
zofuthan/edx-platform | scripts/runone.py | 182 | 3124 | #!/usr/bin/env python
import argparse
import os
import sys
# I want this:
# ERROR: test_update_and_fetch (edx-platform.cms.djangoapps.contentstore.tests.test_course_settings.CourseDetailsViewTest)
# to become:
# test --settings=cms.envs.test --pythonpath=. -s cms/djangoapps/contentstore/tests/test_course_settings... | agpl-3.0 |
darjus-amzn/boto | tests/integration/ec2containerservice/test_ec2containerservice.py | 99 | 1749 | # Copyright (c) 2015 Amazon.com, Inc. or its affiliates. All Rights Reserved
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights ... | mit |
shanglt/youtube-dl | youtube_dl/extractor/stanfordoc.py | 173 | 3526 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
ExtractorError,
orderedSet,
unescapeHTML,
)
class StanfordOpenClassroomIE(InfoExtractor):
IE_NAME = 'stanfordoc'
IE_DESC = 'Stanford Open ClassRoom'
_VALID_URL = r'https?://openclassroom... | unlicense |
toooooper/oppia | core/domain/rte_component_registry.py | 29 | 3279 | # 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 |
int19h/PTVS | Python/Product/Miniconda/Miniconda3-x64/Lib/site-packages/setuptools/__init__.py | 29 | 7283 | """Extensions to the 'distutils' for large or complex distributions"""
import os
import sys
import functools
import distutils.core
import distutils.filelist
import re
from distutils.errors import DistutilsOptionError
from distutils.util import convert_path
from fnmatch import fnmatchcase
from ._deprecation_warning im... | apache-2.0 |
nzlosh/st2 | st2tests/integration/orquesta/test_performance.py | 3 | 2222 | # -*- coding: utf-8 -*-
# Copyright 2020 The StackStorm Authors.
# Copyright 2019 Extreme 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/license... | apache-2.0 |
ghedsouza/django | django/core/management/commands/migrate.py | 16 | 14047 | import time
from collections import OrderedDict
from importlib import import_module
from django.apps import apps
from django.core.checks import Tags, run_checks
from django.core.management.base import BaseCommand, CommandError
from django.core.management.sql import (
emit_post_migrate_signal, emit_pre_migrate_sign... | bsd-3-clause |
llhe/tensorflow | tensorflow/contrib/keras/api/keras/preprocessing/sequence/__init__.py | 57 | 1172 | # 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 |
admetricks/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests_integrationtest.py | 114 | 50422 | # Copyright (C) 2010 Google Inc. All rights reserved.
# Copyright (C) 2010 Gabor Rapcsanyi (rgabor@inf.u-szeged.hu), University of Szeged
# Copyright (C) 2011 Apple Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following ... | bsd-3-clause |
nwjs/chromium.src | third_party/blink/tools/print_web_test_times.py | 9 | 1704 | #!/usr/bin/env vpython
#
# 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 li... | bsd-3-clause |
tudorvio/nova | nova/api/openstack/compute/plugins/v3/scheduler_hints.py | 43 | 1771 | # Copyright 2011 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 |
jonashaag/jedi | test/completion/ordering.py | 13 | 2079 | # -----------------
# normal
# -----------------
a = ""
a = 1
#? int()
a
#? []
a.append
a = list
b = 1; b = ""
#? str()
b
# temp should not be accessible before definition
#? []
temp
a = 1
temp = b;
b = a
a = temp
#? int()
b
#? int()
b
#? str()
a
a = tuple
if 1:
a = list
#? ['append']
a.append
#? ['index']
a... | mit |
ricxsar/ardupilot | Tools/LogAnalyzer/tests/TestGPSGlitch.py | 273 | 2325 | from LogAnalyzer import Test,TestResult
import DataflashLog
class TestGPSGlitch(Test):
'''test for GPS glitch reporting or bad GPS data (satellite count, hdop)'''
def __init__(self):
Test.__init__(self)
self.name = "GPS"
def run(self, logdata, verbose):
self.result = TestResult()
self.result.status = Tes... | gpl-3.0 |
TalShafir/ansible | test/units/modules/network/f5/test_bigip_sys_global.py | 5 | 4423 | # -*- coding: utf-8 -*-
#
# Copyright (c) 2017 F5 Networks Inc.
# GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
import json
import sys
from nose.plugins.skip import SkipTest
i... | gpl-3.0 |
hdinsight/hue | desktop/core/ext-py/Paste-2.0.1/tests/test_exceptions/test_formatter.py | 47 | 4985 | from paste.exceptions import formatter
from paste.exceptions import collector
import sys
import os
import difflib
class Mock(object):
def __init__(self, **kw):
for name, value in kw.items():
setattr(self, name, value)
class Supplement(Mock):
object = 'test_object'
source_url = 'http:/... | apache-2.0 |
tectronics/ambhas | examples/run_richards.py | 3 | 1615 | # -*- coding: utf-8 -*-
"""
Created on Tue Nov 13 10:47:16 2012
@author: Sat Kumar Tomer
@email: satkumartomer@gmail.com
@website: www.ambhas.com
"""
from ambhas.richards import RICHARDS_1D
import matplotlib.pyplot as plt
from scipy.io import netcdf as nc
params = {'axes.labelsize': 15,
'text.fontsize': 1... | lgpl-2.1 |
bnoordhuis/suv | deps/gyp/test/mac/gyptest-postbuild-copy-bundle.py | 172 | 2697 | #!/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 a postbuild copying a dependend framework into an app bundle is
rerun if the resources in the framework change.
"""
impor... | isc |
hulifox008/openembedded | contrib/qa/checksum/checksum.py | 45 | 2326 | #
# Helper utilitiy to verify checksums of SRC_URI's
#
# To ease parsing I will use INI files to contain the
# checksums, at least they will force some kind of structure. This allows
# to easily add and replace new sums
#
#
# Example:
# [PN-PV-filename]
# md5=THESUM
# sha256=OTHERSUM
#
# [PN-filename]
# md5=TH... | mit |
simartin/servo | tests/wpt/web-platform-tests/common/security-features/scope/document.py | 18 | 1179 | import os, sys, json
from wptserve.utils import isomorphic_decode, isomorphic_encode
import importlib
util = importlib.import_module("common.security-features.scope.util")
def main(request, response):
policyDeliveries = json.loads(request.GET.first(b"policyDeliveries", b"[]"))
maybe_additional_headers = {}
met... | mpl-2.0 |
spacewalkproject/spacewalk | client/tools/rhncfg/config_management/rhncfg_remove.py | 10 | 2929 | #
# Copyright (c) 2008--2016 Red Hat, Inc.
#
# This software is licensed to you under the GNU General Public License,
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
# implied, including the implied warranties of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. You should have received a c... | gpl-2.0 |
YzPaul3/h2o-3 | scripts/send_to_mysql.py | 7 | 3583 | import sys, os
import csv
import mysql.connector
from mysql.connector.constants import ClientFlag
import traceback
class SendDataToMysql:
def __init__(self):
self = self
def add_test_cases_to_h2o(self):
#Connect to mysql database
h2o = mysql.connector.connect(client_flags=[ClientFlag.... | apache-2.0 |
qinyushuang/robotframework-selenium2library | test/resources/testserver/testserver.py | 61 | 3546 | # http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/336012
import SimpleHTTPServer
import BaseHTTPServer
import httplib
import os
class StoppableHttpRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
"""http request handler with QUIT stopping the server"""
def do_QUIT(self):
"""send 20... | apache-2.0 |
nwchandler/ansible | test/units/module_utils/aws/test_aws_module.py | 88 | 6242 | # -*- coding: utf-8 -*-
# (c) 2017, Michael De La Rue
#
# 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 lat... | gpl-3.0 |
Ikusaba-san/Chiaki-Nanami | cogs/bot/halp.py | 1 | 7051 | import json
import random
from datetime import datetime
import discord
from discord.ext import commands
from ..utils.converter import Category
from ..utils.examples import wrap_example
from ..utils.formats import multi_replace
from ..utils.help import CogPages, help_command
from ..utils.misc import emoji_url
from ..u... | mit |
GeekTrainer/Flask | Work/TriviaMVA/TriviaMVA/env/Lib/site-packages/flask/testsuite/regression.py | 563 | 3198 | # -*- coding: utf-8 -*-
"""
flask.testsuite.regression
~~~~~~~~~~~~~~~~~~~~~~~~~~
Tests regressions.
:copyright: (c) 2011 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import os
import gc
import sys
import flask
import threading
import unittest
from werkzeug.exceptions impor... | apache-2.0 |
ceb8/astroquery | astroquery/utils/tap/conn/tests/DummyConnHandler.py | 2 | 5631 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
=============
TAP plus
=============
@author: Juan Carlos Segovia
@contact: juan.carlos.segovia@sciops.esa.int
European Space Astronomy Centre (ESAC)
European Space Agency (ESA)
Created on 30 jun. 2016
"""
from astroquery.utils.tap import taputils... | bsd-3-clause |
thadeaus/wesnoth | scons/python_devel.py | 49 | 1381 | # vi: syntax=python:et:ts=4
import sys, os
from config_check_utils import backup_env, restore_env
import distutils.sysconfig
def exists():
return True
def PythonExtension(env, target, source, **kv):
return env.SharedLibrary(target, source, SHLIBPREFIX='', SHLIBSUFFIX=distutils.sysconfig.get_config_var("SO"), ... | gpl-2.0 |
msabramo/ansible | lib/ansible/modules/packaging/os/pkgng.py | 9 | 12668 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, bleader
# Written by bleader <bleader@ratonland.org>
# Based on pkgin module written by Shaun Zinck <shaun.zinck at gmail.com>
# that was based on pacman module written by Afterburn <http://github.com/afterburn>
# that was based on apt module written by Matthew Wi... | gpl-3.0 |
plotly/plotly.py | packages/python/plotly/plotly/graph_objs/indicator/_legendgrouptitle.py | 1 | 4710 | from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class Legendgrouptitle(_BaseTraceHierarchyType):
# class properties
# --------------------
_parent_path_str = "indicator"
_path_str = "indicator.legendgrouptitle"
_valid_props = {"font", "text"... | mit |
superdump/cerbero | cerbero/commands/genxcconfig.py | 29 | 2437 | # cerbero - a multi-platform build system for Open Source software
# Copyright (C) 2012 Andoni Morales Alastruey <ylatuya@gmail.com>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free Software Foundation; eit... | lgpl-2.1 |
HyperBaton/ansible | lib/ansible/modules/cloud/google/gce_snapshot.py | 29 | 6899 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright: Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | gpl-3.0 |
tonybaloney/st2contrib | packs/aws/actions/lib/action.py | 3 | 4279 | import re
import eventlet
import importlib
import boto.ec2
import boto.route53
import boto.vpc
from st2actions.runners.pythonrunner import Action
from ec2parsers import ResultSets
class BaseAction(Action):
def __init__(self, config):
super(BaseAction, self).__init__(config)
self.credentials = ... | apache-2.0 |
rectory-school/rectory-apps | seating_charts/migrations/0001_initial.py | 1 | 12937 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('academic... | mit |
odooindia/odoo | addons/survey/__openerp__.py | 64 | 2413 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-TODAY OpenERP S.A. <http://www.openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms... | agpl-3.0 |
techdragon/django | django/contrib/messages/storage/fallback.py | 704 | 2172 | from django.contrib.messages.storage.base import BaseStorage
from django.contrib.messages.storage.cookie import CookieStorage
from django.contrib.messages.storage.session import SessionStorage
class FallbackStorage(BaseStorage):
"""
Tries to store all messages in the first backend, storing any unstored
me... | bsd-3-clause |
yoziru-desu/airflow | airflow/operators/http_operator.py | 7 | 2551 | import logging
from airflow.hooks import HttpHook
from airflow.models import BaseOperator
from airflow.utils import apply_defaults, AirflowException
class SimpleHttpOperator(BaseOperator):
"""
Calls an endpoint on an HTTP system to execute an action
:param http_conn_id: The connection to run the sensor ... | apache-2.0 |
facaiy/spark | resource-managers/kubernetes/integration-tests/tests/worker_memory_check.py | 35 | 1624 | #
# 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 |
georgewhewell/CouchPotatoServer | libs/sqlalchemy/dialects/firebird/kinterbasdb.py | 18 | 6572 | # firebird/kinterbasdb.py
# Copyright (C) 2005-2013 the SQLAlchemy authors and contributors <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""
The most common way to connect to a Firebird engine is implemented by
kint... | gpl-3.0 |
alexandrucoman/vbox-neutron-agent | neutron/plugins/ml2/config.py | 5 | 2670 | # Copyright (c) 2013 OpenStack Foundation
# 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 ... | apache-2.0 |
sheshas/HGSHM | qemu-2.3.0-rc3/roms/u-boot/tools/reformat.py | 31 | 4371 | #! /usr/bin/python
########################################################################
#
# reorder and reformat a file in columns
#
# this utility takes lines from its standard input and reproduces them,
# partially reordered and reformatted, on its standard output.
#
# It has the same effect as a 'sort | column -... | gpl-2.0 |
smilecoin/smilecoin | contrib/testgen/base58.py | 2139 | 2818 | '''
Bitcoin base58 encoding and decoding.
Based on https://bitcointalk.org/index.php?topic=1026.0 (public domain)
'''
import hashlib
# for compatibility with following code...
class SHA256:
new = hashlib.sha256
if str != bytes:
# Python 3.x
def ord(c):
return c
def chr(n):
return byte... | mit |
ConnorGBrewster/servo | tests/wpt/web-platform-tests/tools/wptrunner/wptrunner/wptmanifest/tests/test_serializer.py | 3 | 4547 | import sys
import unittest
import pytest
from .. import parser, serializer
class TokenizerTest(unittest.TestCase):
def setUp(self):
self.serializer = serializer.ManifestSerializer()
self.parser = parser.Parser()
def serialize(self, input_str):
return self.serializer.serialize(self.p... | mpl-2.0 |
svenkreiss/databench | databench/cli.py | 1 | 5320 | #!/usr/bin/env python
"""Databench command line tool. See http://databench.trivial.io for
more info."""
from __future__ import absolute_import, print_function
from . import __version__ as DATABENCH_VERSION
import argparse
import logging
import os
import ssl
import sys
import tornado
def main(**kwargs):
"""Entry... | mit |
mangaki/mangaki | mangaki/mangaki/management/commands/retrieveposters.py | 1 | 2428 | from django.core.management.base import BaseCommand
from mangaki.models import Work
import requests
import time
class Command(BaseCommand):
help = 'Downloads posters'
def add_arguments(self, parser):
parser.add_argument('work_id', nargs='*', type=int)
parser.add_argument('--check-exists', actio... | agpl-3.0 |
fpy171/django | django/contrib/admin/checks.py | 186 | 38800 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from itertools import chain
from django.contrib.admin.utils import (
NotRelationField, flatten, get_fields_from_path,
)
from django.core import checks
from django.core.exceptions import FieldDoesNotExist
from django.db import models
from django.forms... | bsd-3-clause |
ryfeus/lambda-packs | Sklearn_scipy_numpy/source/numpy/distutils/fcompiler/vast.py | 184 | 1775 | from __future__ import division, absolute_import, print_function
import os
from numpy.distutils.fcompiler.gnu import GnuFCompiler
compilers = ['VastFCompiler']
class VastFCompiler(GnuFCompiler):
compiler_type = 'vast'
compiler_aliases = ()
description = 'Pacific-Sierra Research Fortran 90 Compiler'
... | mit |
ytjiang/django | tests/template_tests/syntax_tests/test_filter_tag.py | 521 | 1795 | from django.template import TemplateSyntaxError
from django.test import SimpleTestCase
from ..utils import setup
class FilterTagTests(SimpleTestCase):
@setup({'filter01': '{% filter upper %}{% endfilter %}'})
def test_filter01(self):
output = self.engine.render_to_string('filter01')
self.ass... | bsd-3-clause |
mom-ocean/MOM5 | test/test_run.py | 3 | 2465 |
from __future__ import print_function
from model_test_setup import ModelTestSetup
import os
import sys
import shutil
# This defines the different tests. To run an individual test on the command
# line type (for example):
# $ python -c "import test_run ; tc = test_run.TestRun() ; test_run.TestRun.check_run(tc, 'MOM_... | gpl-2.0 |
pchauncey/ansible | lib/ansible/modules/network/avi/avi_snmptrapprofile.py | 27 | 3396 | #!/usr/bin/python
#
# Created on Aug 25, 2016
# @author: Gaurav Rastogi (grastogi@avinetworks.com)
# Eric Anderson (eanderson@avinetworks.com)
# module_check: supported
#
#
# 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... | gpl-3.0 |
oouyang/fxos-certsuite | mcts/web-platform-tests/tests/webdriver/base_test.py | 7 | 1303 | import ConfigParser
import json
import os
import sys
import unittest
from webserver import Httpd
from network import get_lan_ip
repo_root = os.path.abspath(os.path.join(__file__, "../.."))
sys.path.insert(1, os.path.join(repo_root, "tools", "webdriver"))
from webdriver.driver import WebDriver
from webdriver import ex... | mpl-2.0 |
mastizada/kuma | vendor/packages/nose/unit_tests/test_config.py | 10 | 4551 | import re
import os
import tempfile
import unittest
import warnings
import pickle
import sys
import nose.config
from nose.plugins.manager import DefaultPluginManager
from nose.plugins.skip import SkipTest
from nose.plugins.prof import Profile
class TestNoseConfig(unittest.TestCase):
def test_defaults(self):
... | mpl-2.0 |
saurabh6790/test_final_med_app | support/doctype/maintenance_schedule/maintenance_schedule.py | 29 | 11570 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import webnotes
from webnotes.utils import add_days, cstr, getdate
from webnotes.model.doc import addchild
from webnotes.model.bean import getlist
f... | agpl-3.0 |
jss-emr/openerp-7-src | openerp/addons/analytic/analytic.py | 1 | 17758 | # -*- 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 |
sfprime/pattern | examples/01-web/07-wikipedia.py | 21 | 1524 | import os, sys; sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..", ".."))
from pattern.web import Wikipedia
# This example retrieves an article from Wikipedia (http://en.wikipedia.org).
# Wikipedia queries request the article HTML source from the server. This can be slow.
# It is a good idea to cache re... | bsd-3-clause |
jjmleiro/hue | desktop/core/ext-py/markdown/markdown/extensions/abbr.py | 131 | 2899 | '''
Abbreviation Extension for Python-Markdown
==========================================
This extension adds abbreviation handling to Python-Markdown.
Simple Usage:
>>> import markdown
>>> text = """
... Some text with an ABBR and a REF. Ignore REFERENCE and ref.
...
... *[ABBR]: Abbreviation
... | apache-2.0 |
prutseltje/ansible | lib/ansible/modules/storage/netapp/na_cdot_volume.py | 23 | 15029 | #!/usr/bin/python
# (c) 2017, NetApp, 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',
'status': ['preview'],
... | gpl-3.0 |
YeEmrick/learning | stanford-tensorflow/examples/03_linreg_starter.py | 1 | 3321 | """ Starter code for simple linear regression example using placeholders
Created by Chip Huyen (huyenn@cs.stanford.edu)
CS20: "TensorFlow for Deep Learning Research"
cs20.stanford.edu
Lecture 03
"""
import os
from tensorflow.python.summary import writer
os.environ['TF_CPP_MIN_LOG_LEVEL']='2'
import time
import numpy... | apache-2.0 |
okjohn/SHARPpy | sharppy/drawing/skewt.py | 2 | 15486 | import math
import sharppy as sp
import sharppy.sharptab as tab
from sharppy.sharptab.constants import *
__all__ = ['SkewT']
class SkewT:
def __init__(self, canvas, **kwargs):
self.gCanvas = canvas
# Canvas Widths
self.rpad = 100
self.bpad = 20
self.wid = kwargs.get('wi... | bsd-3-clause |
ianatpn/nupictest | examples/bindings/sparse_matrix_how_to.py | 5 | 12347 | #!/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... | gpl-3.0 |
joachimmetz/dfvfs | dfvfs/credentials/keychain.py | 2 | 2707 | # -*- coding: utf-8 -*-
"""The path specification key chain.
The key chain is used to manage credentials for path specifications.
E.g. BitLocker Drive Encryption (BDE) encrypted volumes can require a
credential (e.g. password) to access the unencrypted data (unlock).
"""
from dfvfs.credentials import manager
class ... | apache-2.0 |
xbianonpi/Sick-Beard-TPB | lib/unidecode/x099.py | 252 | 4629 | data = (
'Hai ', # 0x00
'Ren ', # 0x01
'Tian ', # 0x02
'Jiao ', # 0x03
'Jia ', # 0x04
'Bing ', # 0x05
'Yao ', # 0x06
'Tong ', # 0x07
'Ci ', # 0x08
'Xiang ', # 0x09
'Yang ', # 0x0a
'Yang ', # 0x0b
'Er ', # 0x0c
'Yan ', # 0x0d
'Le ', # 0x0e
'Yi ', # 0x0f
'Can ', # 0x10
'... | gpl-3.0 |
ITA-ftuyama/TG | pgu/hexvid.py | 3 | 4158 | """Hexagonal tile engine.
Note -- this engine is not finished. Sprites are not supported. It
can still be useful for using the level editor, and for rendering hex
terrains, however. If you are able to update it and use it in a real game,
help would be greatly appreciated!
Please note that this file is alpha, and i... | mit |
ashleyrback/echidna | echidna/output/plot_chi_squared.py | 4 | 19917 | """ *** DEPRECIATED ***
Contains functions to view and interrogate chi-squared minimisation
Attributes:
MAIN_FONT (dict): style properties for the main font to use in plot labels
"""
from mpl_toolkits.mplot3d import Axes3D
import matplotlib.pyplot as plt
from matplotlib.colorbar import make_axes_gridspec
from matp... | mit |
Litetokens/liteblockd | lib/api.py | 1 | 82959 | import os
import json
import re
import time
import datetime
import base64
import decimal
import operator
import logging
import copy
import uuid
import urllib
import functools
from logging import handlers as logging_handlers
from gevent import wsgi
from geventhttpclient import HTTPClient
from geventhttpclient.url impor... | mit |
mattrhummel/GermannaCC-WPTheme | node_modules/pangyp/gyp/tools/graphviz.py | 2679 | 2878 | #!/usr/bin/env python
# Copyright (c) 2011 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.
"""Using the JSON dumped by the dump-dependency-json generator,
generate input suitable for graphviz to render a dependency graph of
targets... | mit |
vFense/vFenseAgent-nix | agent/deps/mac/Python-2.7.5/lib/python2.7/xml/dom/__init__.py | 327 | 3998 | """W3C Document Object Model implementation for Python.
The Python mapping of the Document Object Model is documented in the
Python Library Reference in the section on the xml.dom package.
This package contains the following modules:
minidom -- A simple implementation of the Level 1 DOM with namespace
sup... | lgpl-3.0 |
ankitjain87/django-allauth | allauth/socialaccount/providers/tumblr/views.py | 66 | 1295 | import json
from allauth.socialaccount.providers.oauth.client import OAuth
from allauth.socialaccount.providers.oauth.views import (OAuthAdapter,
OAuthLoginView,
OAuthCallbackView)
from .provider import T... | mit |
austinellis/googlepythontutorials | babynames/solution/babynames.py | 212 | 3852 | #!/usr/bin/python
# Copyright 2010 Google Inc.
# Licensed under the Apache License, Version 2.0
# http://www.apache.org/licenses/LICENSE-2.0
# Google's Python Class
# http://code.google.com/edu/languages/google-python-class/
import sys
import re
"""Baby Names exercise
Define the extract_names() function below and c... | apache-2.0 |
axbaretto/beam | sdks/python/.tox/docs/lib/python2.7/site-packages/setuptools/command/upload.py | 248 | 1172 | import getpass
from distutils.command import upload as orig
class upload(orig.upload):
"""
Override default upload behavior to obtain password
in a variety of different ways.
"""
def finalize_options(self):
orig.upload.finalize_options(self)
self.username = (
self.user... | apache-2.0 |
PopCap/GameIdea | Engine/Source/ThirdParty/HTML5/emsdk/emscripten/1.30.0/third_party/ply/example/BASIC/basinterp.py | 166 | 17284 | # This file provides the runtime support for running a basic program
# Assumes the program has been parsed using basparse.py
import sys
import math
import random
class BasicInterpreter:
# Initialize the interpreter. prog is a dictionary
# containing (line,statement) mappings
def __init__(self,prog):
... | bsd-2-clause |
mou4e/zirconium | tools/telemetry/telemetry/core/platform/cros_interface_unittest.py | 8 | 6570 | # 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.
# TODO(nduca): Rewrite what some of these tests to use mocks instead of
# actually talking to the device. This would improve our coverage quite
# a bit.
imp... | bsd-3-clause |
Pencroff/ai-hackathon-2017 | Backend/venv/lib/python3.6/site-packages/setuptools/command/test.py | 130 | 8816 | import os
import operator
import sys
import contextlib
import itertools
from distutils.errors import DistutilsError, DistutilsOptionError
from distutils import log
from unittest import TestLoader
import six
from six.moves import map, filter
from pkg_resources import (resource_listdir, resource_exists, normalize_path,... | mit |
explora26/zephyr | scripts/west_commands/sign.py | 1 | 7203 | # Copyright (c) 2018 Foundries.io
#
# SPDX-License-Identifier: Apache-2.0
import abc
import argparse
import os
import subprocess
from west import cmake
from west import log
from west.build import is_zephyr_build
from west.util import quote_sh_list
from runners.core import BuildConfiguration
from zephyr_ext_common i... | apache-2.0 |
alisidd/tensorflow | tensorflow/python/kernel_tests/softmax_op_test.py | 85 | 7224 | # 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 |
hortonworks/hortonworks-sandbox | desktop/core/ext-py/ctypes-1.0.2/ctypes/test/test_returnfuncptrs.py | 66 | 1449 | import unittest
from ctypes import *
import _ctypes_test
class ReturnFuncPtrTestCase(unittest.TestCase):
def test_with_prototype(self):
# The _ctypes_test shared lib/dll exports quite some functions for testing.
# The get_strchr function returns a *pointer* to the C strchr function.
dll =... | apache-2.0 |
josh-willis/pycbc | pycbc/inference/sampler/multinest.py | 4 | 15466 | # Copyright (C) 2018 Daniel Finstad
# 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 |
florentx/OpenUpgrade | addons/hr_payroll_account/__openerp__.py | 120 | 1776 | #-*- coding:utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# d$
#
# This program is free software: you can redistribute it and/or modify
# it ... | agpl-3.0 |
ilo10/scikit-learn | sklearn/dummy.py | 208 | 17370 | # Author: Mathieu Blondel <mathieu@mblondel.org>
# Arnaud Joly <a.joly@ulg.ac.be>
# Maheshakya Wijewardena <maheshakya.10@cse.mrt.ac.lk>
# License: BSD 3 clause
from __future__ import division
import warnings
import numpy as np
import scipy.sparse as sp
from .base import BaseEstimator, ClassifierMixin... | bsd-3-clause |
rickerc/neutron_audit | neutron/plugins/linuxbridge/common/constants.py | 5 | 1569 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright 2012 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... | apache-2.0 |
Elico-Corp/odoo_OCB | addons/l10n_hr/__openerp__.py | 18 | 1702 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
# Author: Goran Kliska
# mail: goran.kliska(AT)slobodni-programi.hr
# Copyright (C) 2011- Slobodni programi d.o.o., Zagreb
# Contributions:
# Tomislav Bošnjaković, Storm Computers d.o.o. :
# - ac... | agpl-3.0 |
OPU-Surveillance-System/monitoring | master/scripts/planner/map_converter.py | 1 | 12283 | """
Convert the GUI's map into a grid.
"""
import utm
import numpy as np
import math
from shapely.geometry import Polygon, Point
import matplotlib.pyplot as plt
from matplotlib import colors
from matplotlib import cm
from sys import path
from tqdm import tqdm
import pickle
import datetime
import time
import random
pat... | mit |
XiaodunServerGroup/medicalmooc | lms/djangoapps/wechat/features/login.py | 28 | 1604 | #pylint: disable=C0111
#pylint: disable=W0621
from lettuce import step, world
from django.contrib.auth.models import User
@step('I am an unactivated user$')
def i_am_an_unactivated_user(step):
user_is_an_unactivated_user('robot')
@step('I am an activated user$')
def i_am_an_activated_user(step):
user_is_an... | agpl-3.0 |
fengthedroid/s2protocol | protocol28272.py | 21 | 27047 | # Copyright (c) 2013 Blizzard Entertainment
#
# 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, publi... | mit |
systers/hyperkitty | hyperkitty/tests/views/test_mailman.py | 1 | 2114 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2016-2017 by the Free Software Foundation, Inc.
#
# This file is part of HyperKitty.
#
# HyperKitty 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... | gpl-3.0 |
indictranstech/erpnext | erpnext/patches/v7_0/make_guardian.py | 22 | 1269 | from __future__ import unicode_literals
import frappe
def execute():
if frappe.db.exists("DocType", "Student"):
student_table_cols = frappe.db.get_table_columns("Student")
if "father_name" in student_table_cols:
# 'Schools' module changed to the 'Education'
# frappe.reload_doc("schools", "doctype", "studen... | agpl-3.0 |
chazy/reviewboard | reviewboard/site/models.py | 1 | 3194 | #
# models.py -- Models for the "reviewboard.site" app.
#
# Copyright (c) 2010 David Trowbridge
#
# 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 lim... | mit |
Bysmyyr/chromium-crosswalk | tools/telemetry/third_party/gsutilz/third_party/crcmod/python2/crcmod/_crcfunpy.py | 68 | 3073 | #-----------------------------------------------------------------------------
# Low level CRC functions for use by crcmod. This version is implemented in
# Python for a couple of reasons. 1) Provide a reference implememtation.
# 2) Provide a version that can be used on systems where a C compiler is not
# available f... | bsd-3-clause |
dmoliveira/networkx | networkx/algorithms/bipartite/tests/test_edgelist.py | 31 | 7069 | """
Unit tests for bipartite edgelists.
"""
from nose.tools import assert_equal, assert_raises, assert_not_equal, raises
import io
import tempfile
import os
import networkx as nx
from networkx.testing import (assert_edges_equal, assert_nodes_equal,
assert_graphs_equal)
from network... | bsd-3-clause |
sergio-incaser/odoo | openerp/addons/test_workflow/tests/test_workflow.py | 392 | 6232 | # -*- coding: utf-8 -*-
import openerp
from openerp import SUPERUSER_ID
from openerp.tests import common
class test_workflows(common.TransactionCase):
def check_activities(self, model_name, i, names):
""" Check that the record i has workitems in the given activity names.
"""
instance = se... | agpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.