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
jorgeslima/files_copier
dependencies/tinydb/tests/test_tinydb.py
2
12809
# coding=utf-8 import sys import pytest from tinydb import TinyDB, where from tinydb.storages import MemoryStorage from tinydb.middlewares import Middleware def test_purge(db): db.purge() db.insert({}) db.purge() assert len(db) == 0 def test_all(db): db.purge() for i in range(10): ...
mit
gnmiller/craig-bot
craig-bot/lib/python3.6/site-packages/discord/http.py
1
32593
# -*- coding: utf-8 -*- """ The MIT License (MIT) Copyright (c) 2015-2019 Rapptz 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 u...
mit
nealtodd/django
tests/contenttypes_tests/models.py
172
2882
from __future__ import unicode_literals from django.contrib.contenttypes.fields import ( GenericForeignKey, GenericRelation, ) from django.contrib.contenttypes.models import ContentType from django.db import models from django.utils.encoding import python_2_unicode_compatible from django.utils.http import urlquote...
bsd-3-clause
charbeljc/OCB
addons/hr_payroll_account/hr_payroll_account.py
240
10840
#-*- 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
maciekcc/tensorflow
tensorflow/contrib/copy_graph/python/util/copy_test.py
112
3739
# 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
DNFcode/edx-platform
cms/djangoapps/contentstore/management/commands/check_course.py
160
2722
from django.core.management.base import BaseCommand, CommandError from xmodule.modulestore.django import modulestore from xmodule.modulestore.xml_importer import check_module_metadata_editability from opaque_keys.edx.keys import CourseKey from opaque_keys import InvalidKeyError from opaque_keys.edx.locations import Sla...
agpl-3.0
cdegroc/scikit-learn
sklearn/linear_model/setup.py
1
1289
from os.path import join import numpy def configuration(parent_package='', top_path=None): from numpy.distutils.misc_util import Configuration from numpy.distutils.system_info import get_info config = Configuration('linear_model', parent_package, top_path) # cd fast needs CBLAS blas_info = get_in...
bsd-3-clause
TheTypoMaster/chromium-crosswalk
tools/perf/benchmarks/dromaeo.py
4
9390
# 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. import math import os from core import perf_benchmark from telemetry import benchmark from telemetry import page as page_module from telemetry.page import ...
bsd-3-clause
evensonbryan/yocto-autobuilder
lib/python2.7/site-packages/buildbot-0.8.8-py2.7.egg/buildbot/locks.py
4
12354
# This file is part of Buildbot. Buildbot 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, version 2. # # This program is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without eve...
gpl-2.0
friedrich420/HTC-ONE-M7-AEL-Kernel-5.0.2
tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/SchedGui.py
12980
5411
# SchedGui.py - Python extension for perf script, basic GUI code for # traces drawing and overview. # # Copyright (C) 2010 by Frederic Weisbecker <fweisbec@gmail.com> # # This software is distributed under the terms of the GNU General # Public License ("GPL") version 2 as published by the Free Software # Foundation. ...
gpl-2.0
neilhan/tensorflow
tensorflow/contrib/learn/python/learn/dataframe/transforms/in_memory_source.py
4
6151
# 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
ahamilton55/ansible
lib/ansible/modules/cloud/vmware/vmware_migrate_vmk.py
57
7360
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2015, Joseph Callen <jcallen () csc.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the Li...
gpl-3.0
tedlaz/pyted
sms/requests/packages/idna/codec.py
426
3299
from .core import encode, decode, alabel, ulabel, IDNAError import codecs import re _unicode_dots_re = re.compile(u'[\u002e\u3002\uff0e\uff61]') class Codec(codecs.Codec): def encode(self, data, errors='strict'): if errors != 'strict': raise IDNAError("Unsupported error handling \"{0}\"".for...
gpl-3.0
informatik-mannheim/Moduro-CC3D
Simulation/ModuroModel/Spa/SpaSdbCdiInDa.py
1
1536
# Copyright 2016 the original author or authors. # # 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...
apache-2.0
pong3489/TEST_Mission
Lib/site-packages/numpy/NumpyDotNet/bin/Tests/test_dtype.py
141
5362
import numpy as np from numpy.testing import * class TestBuiltin(TestCase): def test_run(self): """Only test hash runs at all.""" for t in [np.int, np.float, np.complex, np.int32, np.str, np.object, np.unicode]: dt = np.dtype(t) hash(dt) class TestRecord(Tes...
gpl-3.0
beepaste/beepaste
beepaste/views/viewPaste/views.py
1
1832
from pyramid.response import Response from pyramid.view import view_config from beepaste.models.pastes import Pastes from beepaste.pasteFunctions import pasteExists from pyramid.httpexceptions import HTTPNotFound, HTTPFound import base64 @view_config(route_name='view_raw', renderer='templates/pasteRaw.jinja2') def vie...
gpl-3.0
vitan/hue
desktop/core/ext-py/Paste-1.7.2/paste/debug/testserver.py
28
3385
# (c) 2005 Clark C. Evans # This module is part of the Python Paste Project and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php # This code was written with funding by http://prometheusresearch.com """ WSGI Test Server This builds upon paste.util.baseserver to customize it for r...
apache-2.0
erkanay/django
tests/syndication_tests/urls.py
42
1028
from django.conf.urls import url from . import feeds urlpatterns = [ url(r'^syndication/rss2/$', feeds.TestRss2Feed()), url(r'^syndication/rss2/guid_ispermalink_true/$', feeds.TestRss2FeedWithGuidIsPermaLinkTrue()), url(r'^syndication/rss2/guid_ispermalink_false/$', feeds.TestRss2FeedWith...
bsd-3-clause
cernopendata/opendata.cern.ch
cernopendata/modules/sitemap/generators.py
3
2158
# -*- coding: utf-8 -*- # # This file is part of CERN Open Data Portal. # Copyright (C) 2018 CERN. # # CERN Open Data Portal 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, o...
gpl-2.0
petemounce/ansible
test/sanity/validate-modules/test_validate_modules_regex.py
162
2807
#!/usr/bin/env python # This is a standalone test for the regex inside validate-modules # It is not suitable to add to the make tests target because the # file under test is outside the test's sys.path AND has a hyphen # in the name making it unimportable. # # To execute this by hand: # 1) cd <checkoutdir> # 2) so...
gpl-3.0
omnirom/android_kernel_htc_msm8960
tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Util.py
12527
1935
# Util.py - Python extension for perf script, miscellaneous utility code # # Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com> # # This software may be distributed under the terms of the GNU General # Public License ("GPL") version 2 as published by the Free Software # Foundation. import errno, os FUTEX_WAIT = 0...
gpl-2.0
sodexis/odoo
openerp/report/print_xml.py
338
11063
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the...
agpl-3.0
mrquim/mrquimrepo
repo/script.module.trakt/lib/trakt/interfaces/shows/__init__.py
4
2756
from __future__ import absolute_import, division, print_function from trakt.interfaces.base import Interface from trakt.mapper.summary import SummaryMapper import requests class ShowsInterface(Interface): path = 'shows' def get(self, id, extended=None, **kwargs): response = self.http.get(str(id), q...
gpl-2.0
neuroo/equip
tests/test_bz_1.py
1
6303
import pytest from itertools import tee, izip from testutils import get_co, get_bytecode from equip import BytecodeObject from equip.bytecode.utils import show_bytecode import equip.utils.log as logutils from equip.utils.log import logger logutils.enableLogger(to_file='./equip.log') from equip.analysis import Control...
apache-2.0
juliusbierk/scikit-image
skimage/morphology/grey.py
24
15043
""" Grayscale morphological operations """ import functools import numpy as np from scipy import ndimage as ndi from .misc import default_selem from ..util import pad, crop __all__ = ['erosion', 'dilation', 'opening', 'closing', 'white_tophat', 'black_tophat'] def _shift_selem(selem, shift_x, shift_y): ...
bsd-3-clause
aslamplr/shorts
gdata/dublincore/data.py
126
2106
#!/usr/bin/python # # Copyright (C) 2009 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 ...
mit
rbaindourov/v8-inspector
Source/chrome/tools/telemetry/telemetry/benchmark_runner.py
5
15380
# 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. """Parses the command line, discovers the appropriate benchmarks, and runs them. Handles benchmark configuration, but all the logic for actually running the...
bsd-3-clause
ahamilton55/ansible
lib/ansible/plugins/action/include_vars.py
18
10053
# (c) 2016, Allen Sanabria <asanabria@linuxdynasty.org> # # 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 l...
gpl-3.0
MiniSEC/GRR_clone
client/client_test.py
1
5467
#!/usr/bin/env python # Copyright 2010 Google Inc. All Rights Reserved. """Tests for the client.""" # Need to import client to add the flags. from grr.client import actions # Load all the standard actions. # pylint: disable=unused-import from grr.client import client_actions # pylint: enable=unused-import from grr.c...
apache-2.0
yongshengwang/builthue
desktop/core/ext-py/Django-1.4.5/django/contrib/auth/management/commands/changepassword.py
97
1881
import getpass from optparse import make_option from django.core.management.base import BaseCommand, CommandError from django.contrib.auth.models import User from django.db import DEFAULT_DB_ALIAS class Command(BaseCommand): option_list = BaseCommand.option_list + ( make_option('--database', action='stor...
apache-2.0
FlashXT/XJTU_WorkLog
2017.9/Programing/CodeSet/list&dictionary.py
1
1180
#coding=utf-8 #2017.9.22,Flash,list & dictionary 嵌套 alien_0={"color":"green","points":5} alien_1={"color":"yellow","points":10} alien_2={"color":"red","points":15} aliens=[alien_0,alien_1,alien_2] for alien in aliens: print (alien) pizza={ 'crust':'think', 'toppings':['mushrooms','extra cheese'], } print("You ord...
gpl-3.0
neilLasrado/frappe
frappe/utils/html_utils.py
1
8928
import frappe import json, re import bleach, bleach_whitelist.bleach_whitelist as bleach_whitelist from six import string_types from bs4 import BeautifulSoup def clean_html(html): if not isinstance(html, string_types): return html return bleach.clean(clean_script_and_style(html), tags=['div', 'p', 'br', 'ul', '...
mit
40223137/150601
static/Brython3.1.1-20150328-091302/Lib/ui/slider.py
603
2394
from . import widget from browser import doc,html class Slider(widget.Widget): def __init__(self, id=None, label=False): self._div_shell=html.DIV(Class="ui-slider ui-slider-horizontal ui-widget ui-widget-content ui-corner-all") widget.Widget.__init__(self, self._div_shell, 'slider', id) self._h...
agpl-3.0
Saurabh7/shogun
examples/undocumented/python_modular/graphical/preprocessor_kpca_graphical.py
26
1893
from numpy import * import matplotlib.pyplot as p import os, sys, inspect path = os.path.abspath(os.path.join(os.path.dirname(__file__), '../tools')) if not path in sys.path: sys.path.insert(1, path) del path from generate_circle_data import circle_data cir=circle_data() number_of_points_for_circle1=42 number_of_p...
mit
google/clusterfuzz
src/python/platforms/android/ui.py
1
1362
# Copyright 2019 Google LLC # # 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, ...
apache-2.0
dhananjay92/servo
tests/wpt/web-platform-tests/tools/html5lib/parse.py
420
8783
#!/usr/bin/env python """usage: %prog [options] filename Parse a document to a tree, with optional profiling """ import sys import os import traceback from optparse import OptionParser from html5lib import html5parser, sanitizer from html5lib.tokenizer import HTMLTokenizer from html5lib import treebuilders, serializ...
mpl-2.0
mikhtonyuk/pyhk2
hk2/kernel/habitat.py
1
2150
from interfaces import IStartup from hk2.injection import Container, NoScope from plugin_loaders.sysmod_plugin_loader import SysmodPluginLoader from hk2.annotations import Service from hk2.types import Annotations import logging log = logging.getLogger('hk2') #=======================================================...
mit
shootstar/novatest
nova/api/openstack/compute/contrib/extended_availability_zone.py
15
3810
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2013 Netease, LLC. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licens...
apache-2.0
hackbutty/git-repo
subcmds/forall.py
48
7781
# # Copyright (C) 2008 The Android Open Source Project # # 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 la...
apache-2.0
jsoref/django
django/core/checks/security/csrf.py
477
1796
from django.conf import settings from .. import Tags, Warning, register W003 = Warning( "You don't appear to be using Django's built-in " "cross-site request forgery protection via the middleware " "('django.middleware.csrf.CsrfViewMiddleware' is not in your " "MIDDLEWARE_CLASSES). Enabling the middle...
bsd-3-clause
bmhatfield/graphite-web
webapp/tests/test_storage.py
34
1383
import logging from graphite.storage import Store from django.conf import settings from django.test import TestCase # Silence logging during tests LOGGER = logging.getLogger() # logging.NullHandler is a python 2.7ism if hasattr(logging, "NullHandler"): LOGGER.addHandler(logging.NullHandler()) class StorageTes...
apache-2.0
40423217/2016fallcadp_hw
plugin/liquid_tags/test_flickr.py
278
2466
from . import flickr try: from unittest.mock import patch except ImportError: from mock import patch import os import pytest import re PLUGIN_DIR = os.path.dirname(__file__) TEST_DATA_DIR = os.path.join(PLUGIN_DIR, 'test_data') @pytest.mark.parametrize('input,expected', [ ('18873146680 large "test 1"', ...
agpl-3.0
finalion/WordQuery
src/service/remotemdx.py
1
3508
#-*- coding:utf-8 -*- # # Copyright © 2016–2017 Liang Feng <finalion@gmail.com> # # Support: Report an issue at https://github.com/finalion/WordQuery/issues # # 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...
gpl-3.0
sbalde/edxplatform
common/djangoapps/embargo/admin.py
154
1315
""" Django admin page for embargo models """ from django.contrib import admin import textwrap from config_models.admin import ConfigurationModelAdmin from embargo.models import IPFilter, CountryAccessRule, RestrictedCourse from embargo.forms import IPFilterForm, RestrictedCourseForm class IPFilterAdmin(Configuration...
agpl-3.0
40423147/2017springcd_hw
plugin/liquid_tags/test_audio.py
273
1456
from . import audio import pytest import re @pytest.mark.parametrize('input,expected', [ ('http://foo.bar https://bar.foo', ('http://foo.bar', 'https://bar.foo', None)), ('http://test.foo', ('http://test.foo', None, None)), ('https://test.foo', ('https://test.foo', None, None)), ('http:...
gpl-3.0
cornelvlad/qualitybots
src/webdriver/appengine_communicator.py
26
11159
#!/usr/bin/python2.6 # # Copyright 2011 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
matrixise/odoo
openerp/service/websrv_lib.py
380
7780
# -*- coding: utf-8 -*- # # Copyright P. Christeas <p_christ@hol.gr> 2008-2010 # # WARNING: This program as such is intended to be used by professional # programmers who take the whole responsibility of assessing all potential # consequences resulting from its eventual inadequacies and bugs # End users who are looking ...
agpl-3.0
Hack42/BusNotifier
webscraping/pdict.py
1
15581
__doc__ = """ pdict has a dictionary like interface and a sqlite backend It uses pickle to store Python objects and strings, which are then compressed Multithreading is supported """ import os import sys import datetime import sqlite3 import zlib import threading import md5 import shutil import glob try: import cP...
mit
lmazuel/azure-sdk-for-python
azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_firewall_rule_set.py
1
2892
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
mit
momikey/pyrge
examples/asteroid/asteroidexample.py
1
8101
import random from pyrge import * MAX_X = 640 MAX_Y = 420 class Asteroid(Entity, mixin.Wrapper): LARGE = 0 MEDIUM = 1 SMALL = 2 def __init__(self, position=Vector(0,0), velocity=Vector(0,0), size=0): super(Asteroid, self).__init__() self.sizetype = size self.reset(position,ve...
lgpl-2.1
sadaf2605/django
django/db/migrations/operations/base.py
127
4888
from __future__ import unicode_literals from django.db import router class Operation(object): """ Base class for migration operations. It's responsible for both mutating the in-memory model state (see db/migrations/state.py) to represent what it performs, as well as actually performing it agains...
bsd-3-clause
jmesteve/saas3
openerp/report/render/rml2pdf/utils.py
381
7143
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2003, Fabien Pinckaers, UCL, FSA # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesse...
agpl-3.0
MihaiMoldovanu/ansible
test/units/playbook/test_play.py
185
4200
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) an...
gpl-3.0
mollstam/UnrealPy
UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/numpy-1.9.2/numpy/testing/tests/test_decorators.py
67
4134
from __future__ import division, absolute_import, print_function import numpy as np from numpy.testing import * from numpy.testing.noseclasses import KnownFailureTest import nose def test_slow(): @dec.slow def slow_func(x, y, z): pass assert_(slow_func.slow) def test_setastest(): @dec.setast...
mit
hainm/statsmodels
statsmodels/tsa/tests/results/arima211_css_results.py
36
44583
import numpy as np llf = np.array([-240.29558272688]) nobs = np.array([ 202]) k = np.array([ 5]) k_exog = np.array([ 1]) sigma = np.array([ .79494581155191]) chi2 = np.array([ 1213.6019521322]) df_model = np.array([ 3]) k_ar = np.array([ 2]) k...
bsd-3-clause
EvanK/ansible
test/sanity/code-smell/update-bundled.py
24
4649
#!/usr/bin/env python # -*- coding: utf-8 -*- # (c) 2018, Ansible Project # # 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 ...
gpl-3.0
iwob/pysv
pysv/parsers/ply/yacc.py
44
137322
# ----------------------------------------------------------------------------- # ply: yacc.py # # Copyright (C) 2001-2017 # David M. Beazley (Dabeaz LLC) # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions ar...
mit
ukanga/SickRage
lib/requests/packages/chardet/charsetprober.py
3127
1902
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 2001 # the Initial Developer. All R...
gpl-3.0
pfhayes/boto
boto/directconnect/__init__.py
145
1679
# Copyright (c) 2013 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
barca/Nano_Tournament
tournament.py
1
5742
#!/usr/bin/env python # # tournament.py -- implementation of a Swiss-system tournament # import psycopg2 #connects to db def connect(): """Connect to the PostgreSQL database. Returns a database connection.""" return psycopg2.connect("dbname=tournament") #deltes match records from database def deleteMatches(...
mit
ICTU/quality-time
components/collector/tests/source_collectors/quality_time/test_missing_metrics.py
1
3549
"""Unit tests for the Quality-time missing metrics collector.""" from .base import QualityTimeTestCase class QualityTimeMissingMetricsTest(QualityTimeTestCase): """Unit tests for the Quality-time missing metrics collector.""" METRIC_TYPE = "missing_metrics" def setUp(self): """Set up test data....
apache-2.0
nttks/edx-platform
common/djangoapps/util/keyword_substitution.py
148
2343
""" keyword_substitution.py Contains utility functions to help substitute keywords in a text body with the appropriate user / course data. Supported: LMS: - %%USER_ID%% => anonymous user id - %%USER_FULLNAME%% => User's full name - %%COURSE_DISPLAY_NAME%% => display name of the course ...
agpl-3.0
kingvuplus/Test-OBH
lib/python/Components/Element.py
47
2938
from Tools.CList import CList # down up # Render Converter Converter Source # a bidirectional connection def cached(f): name = f.__name__ def wrapper(self): cache = self.cache if cache is None: return f(self) if name not in cache: cache[name] = (True, f(self)) return cache[name]...
gpl-2.0
switchboardOp/ansible
test/integration/cleanup_ec2.py
25
6920
''' Find and delete AWS resources matching the provided --match string. Unless --yes|-y is provided, the prompt for confirmation prior to deleting resources. Please use caution, you can easily delete you're *ENTIRE* EC2 infrastructure. ''' import boto import boto.ec2.elb import optparse import os import os.path impor...
gpl-3.0
arante/pyloc
microblog/flask/lib/python3.5/site-packages/flask/__init__.py
47
1673
# -*- coding: utf-8 -*- """ flask ~~~~~ A microframework based on Werkzeug. It's extensively documented and follows best practice patterns. :copyright: (c) 2015 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ __version__ = '0.12.2' # utilities we import from Werkzeug and...
gpl-3.0
wisner23/serenata-de-amor
src/xml2csv.py
1
2314
import json import sys from csv import DictWriter from datetime import datetime from io import StringIO from bs4 import BeautifulSoup from lxml.etree import iterparse XML_FILE_PATH = sys.argv[1] CSV_FILE_PATH = sys.argv[2] HTML_FILE_PATH = 'data/2016-08-08-datasets-format.html' def output(*args, **kwargs): """H...
mit
ichuang/sympy
sympy/physics/tests/test_gaussopt.py
3
3686
from sympy import atan2, factor, Float, I, Matrix, N, oo, pi, sqrt, symbols from sympy.physics.gaussopt import (BeamParameter, CurvedMirror, CurvedRefraction, FlatMirror, FlatRefraction, FreeSpace, GeometricRay, RayTransferMatrix, ThinLens, conjugate_gauss_beams, gaussian_conj , geometric_conj_ab, geometric_conj...
bsd-3-clause
transitland/mapzen-gtfs
mzgtfs/serviceperiod.py
3
2661
"""GTFS ServicePeriod entity.""" import datetime import entity import geom import util import validation class ServicePeriod(entity.Entity): KEY = 'service_id' REQUIRED = [ 'service_id', 'monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday', 'sunday', 'start_date',...
mit
onceuponatimeforever/oh-mainline
mysite/search/migrations/0031_cache_contributor_count.py
17
4562
# This file is part of OpenHatch. # Copyright (C) 2010 OpenHatch, Inc. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later v...
agpl-3.0
AOKP/external_chromium_org
content/browser/tracing/generate_trace_viewer_grd.py
48
2407
#!/usr/bin/env python # 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. """Creates a grd file for packaging the trace-viewer files. This file is modified from the devtools generate_devtools_grd.py file. ...
bsd-3-clause
ahaym/eden
languages/ne.py
7
327294
# -*- coding: utf-8 -*- { '# of International Staff': '# अन्तराष्ट्रिय स्टाफ', '# of National Staff': '# राष्ट्रिय स्टाफ', '# selected': '# छानियो', '%(app)s not installed. Ask the Server Administrator to install on Server.': '%(app)s इन्स्टल हुन सकेन । सर्भरलाई इन्स्टल गर्नको निम्ति सर्भरको एडमिनिस्ट्राटरलाई सोध्नुहोस...
mit
foxban/qemu-1.1.1-centos5-rpm
scripts/tracetool/format/h.py
98
1062
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Generate .h file. """ __author__ = "Lluís Vilanova <vilanova@ac.upc.edu>" __copyright__ = "Copyright 2012, Lluís Vilanova <vilanova@ac.upc.edu>" __license__ = "GPL version 2 or (at your option) any later version" __maintainer__ = "Stefan Hajnoczi" __email__ ...
gpl-2.0
hdinsight/hue
desktop/core/ext-py/boto-2.38.0/boto/ec2/image.py
92
16222
# Copyright (c) 2006-2010 Mitch Garnaat http://garnaat.org/ # Copyright (c) 2010, Eucalyptus Systems, Inc. # # 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 # w...
apache-2.0
kazemakase/scikit-learn
examples/ensemble/plot_voting_decision_regions.py
230
2386
""" ================================================== Plot the decision boundaries of a VotingClassifier ================================================== Plot the decision boundaries of a `VotingClassifier` for two features of the Iris dataset. Plot the class probabilities of the first sample in a toy dataset pred...
bsd-3-clause
PaloAltoNetworks-BD/SplunkforPaloAltoNetworks
Splunk_TA_paloalto/bin/splunk_ta_paloalto/aob_py2/solnlib/acl.py
6
6169
# Copyright 2016 Splunk, 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 writing,...
isc
tdtrask/ansible
lib/ansible/modules/windows/win_firewall_rule.py
27
2799
#!/usr/bin/env python # Copyright (c) 2017 Artem Zinenko <zinenkoartem@gmail.com> # Copyright (c) 2014 Timothy Vandenbrande <timothy.vandenbrande@gmail.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) ANSIBLE_METADATA = {'metadata_version': '1.1', 's...
gpl-3.0
flotre/sickbeard-vfvo
lib/requests/packages/chardet2/langgreekmodel.py
63
12651
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Communicator client code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights R...
gpl-3.0
newcastlecy/shadowsocks
shadowsocks/common.py
57
4530
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (c) 2014 clowwindy # # 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 u...
mit
dynaryu/rmtk
rmtk/vulnerability/derivation_fragility/R_mu_T_no_dispersion/dolsek_fajfar/__init__.py
67
1875
# -*- coding: utf-8 -*- # # LICENSE # # Copyright © 2014-2015, GEM Foundation, Chiara Casotto, Anirudh Rao, # Vitor Silva. # # The Risk Modeller's Toolkit is free software: you can redistribute # it and/or modify it under the terms of the GNU Affero General Public # License as published by the Free Software Foundation,...
agpl-3.0
hryamzik/ansible
lib/ansible/modules/database/vertica/vertica_role.py
55
7933
#!/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
mcfletch/AutobahnPython
examples/asyncio/wamp/basic/pubsub/basic/backend.py
5
1250
############################################################################### ## ## Copyright (C) 2014 Tavendo GmbH ## ## 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:/...
apache-2.0
manazhao/tf_recsys
tensorflow/contrib/learn/python/learn/dataframe/transforms/example_parser.py
26
2407
# 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
ThinkingBridge/platform_external_chromium_org
chrome/test/functional/media/media_basic_playback.py
65
2975
#!/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. """Basic playback test. Checks playback, seek, and replay based on events. This test uses the bear videos from the test matrix in...
bsd-3-clause
yuyuyu101/VirtualBox-NetBSD
src/libs/libxml2-2.6.31/python/tests/reader2.py
87
5179
#!/usr/bin/python -u # # this tests the DTD validation with the XmlTextReader interface # import sys import glob import string import StringIO import libxml2 # Memory debug specific libxml2.debugMemory(1) err="" expect="""../../test/valid/rss.xml:177: element rss: validity error : Element rss does not carry attribute...
gpl-2.0
aronsky/home-assistant
homeassistant/components/camera/canary.py
2
3622
""" Support for Canary camera. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/camera.canary/ """ import asyncio import logging from datetime import timedelta import voluptuous as vol from homeassistant.components.camera import Camera, PLATFORM_SCHEMA f...
apache-2.0
maohongyuan/kbengine
kbe/src/lib/python/Lib/turtledemo/peace.py
99
1066
#!/usr/bin/env python3 """ turtle-example-suite: tdemo_peace.py A simple drawing suitable as a beginner's programming example. Aside from the peacecolors assignment and the for loop, it only uses turtle commands. """ from turtle import * def main(): peacecolors = ("red3", "orange", "yellow"...
lgpl-3.0
ahamilton55/ansible
lib/ansible/modules/messaging/rabbitmq_vhost.py
69
4384
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2013, Chatham Financial <oss@chathamfinancial.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...
gpl-3.0
nikkisquared/servo
tests/wpt/harness/wptrunner/update/tree.py
142
11075
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. import os import re import subprocess from .. import vcs from ..vcs import bind_to_repo, git, hg def get_unique_name(...
mpl-2.0
ml-lab/neon
neon/diagnostics/visualize_rnn.py
4
6174
# ---------------------------------------------------------------------------- # Copyright 2014 Nervana Systems 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.o...
apache-2.0
takis/django
tests/resolve_url/tests.py
199
3167
from __future__ import unicode_literals from django.contrib.auth.views import logout from django.core.urlresolvers import NoReverseMatch, reverse_lazy from django.shortcuts import resolve_url from django.test import SimpleTestCase, ignore_warnings, override_settings from django.utils import six from django.utils.depre...
bsd-3-clause
stimpsonsg/moose
gui/gui/CommentEditor.py
8
1534
#!/usr/bin/python try: from PyQt4 import QtCore, QtGui QtCore.Signal = QtCore.pyqtSignal QtCore.Slot = QtCore.pyqtSlot except ImportError: try: from PySide import QtCore, QtGui QtCore.QString = str except ImportError: raise ImportError("Cannot load either PyQt or PySide") ...
lgpl-2.1
ratschlab/RGAN
eICU_tstr_evaluation.py
1
8268
import data_utils import pandas as pd import numpy as np import tensorflow as tf import math, random, itertools import pickle import time import json import os import math import data_utils import pickle from sklearn.ensemble import RandomForestClassifier from sklearn.metrics import accuracy_score, precision_score, rec...
mit
cyisfor/Python-Markdown
markdown/extensions/extra.py
122
5547
""" Python-Markdown Extra Extension =============================== A compilation of various Python-Markdown extensions that imitates [PHP Markdown Extra](http://michelf.com/projects/php-markdown/extra/). Note that each of the individual extensions still need to be available on your PYTHONPATH. This extension simply ...
bsd-3-clause
360youlun/cmsplugin-bootstrap-carousel
cmsplugin_bootstrap_carousel/migrations/0002_auto__add_field_carouselitem_button_title__add_field_carouselitem_butt.py
1
4403
# -*- coding: utf-8 -*- from south.utils import datetime_utils as 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 'CarouselItem.button_title' db.add_column(u'cmsplugin_boot...
bsd-3-clause
aperigault/ansible
lib/ansible/module_utils/network/f5/urls.py
60
4623
# -*- 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 re try: from library.module_utils.network.f5.common import F5M...
gpl-3.0
geminateCoder/Character-Archive-Website
Lib/site-packages/pip/_vendor/requests/packages/chardet/cp949prober.py
2801
1782
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is mozilla.org code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights Reserved. # # Con...
cc0-1.0
markflorisson/blaze-core
blaze/compute/air/frontend/ckernel_impls.py
6
1562
# -*- coding: utf-8 -*- """ Lift ckernels to their appropriate rank so they always consume the full array arguments. """ from __future__ import absolute_import, division, print_function from pykit.ir import transform, Op #------------------------------------------------------------------------ # Run #--------------...
bsd-3-clause
zzicewind/nova
nova/tests/unit/pci/test_utils.py
44
7119
# Copyright (c) 2013 Intel, Inc. # Copyright (c) 2012 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/li...
apache-2.0
komsas/OpenUpgrade
addons/stock_landed_costs/product.py
364
1611
# -*- 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
jhcepas/ete
ete3/tools/ete_build_lib/task/trimal.py
4
4158
# -*- coding: utf-8 -*- # #START_LICENSE########################################################### # # # This file is part of the Environment for Tree Exploration program # (ETE). http://etetoolkit.org # # ETE is free software: you can redistribute it and/or modify it # under the terms of the GNU General Public Licen...
gpl-3.0