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
eayunstack/neutron
neutron/tests/unit/core_extensions/test_qos.py
1
17080
# Copyright (c) 2015 Red Hat 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
leifos/ifind
ifind/common/retrievability_ruler.py
1
2088
__author__ = 'Kojayboy' class RetrievabilityMeasure(object): doc_list = {} b = 0.0 c = 100 def __init__(self, b, c): self.b = b self.c = c self.doc_list = {} ## lolwut. without this, all instances share the same dictionary :/ def __str__(self): if self.b > 0.0: return "Gravity Measure. Beta = %f Cu...
mit
cosmoscoin/CMCP2Pool
p2pool/test/util/test_forest.py
283
6804
import random import unittest from p2pool.util import forest, math class DumbTracker(object): def __init__(self, items=[]): self.items = {} # hash -> item self.reverse = {} # previous_hash -> set of item_hashes for item in items: self.add(item) def add(self, i...
gpl-3.0
wenjoy/homePage
node_modules/node-captcha/node_modules/canvas/node_modules/jade/node_modules/markdown/node_modules/nopt/node_modules/abbrev/node_modules/tap/node_modules/glob/node_modules/inflight/node_modules/tap/node_modules/yamlish/yamlish-py/setup.py
160
1406
# coding: utf-8 from setuptools import setup requires_list = [ "PyYAML>=3.09" ] import os.path def read(fname): with open(os.path.join(os.path.dirname(__file__), fname)) as inf: return "\n" + inf.read().replace("\r\n", "\n") setup( name='yamlish', version="0.17.0", description='Python imp...
mit
chippey/gaffer
python/GafferSceneUI/PruneUI.py
12
2396
########################################################################## # # Copyright (c) 2013, Image Engine Design 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: # # * Redistrib...
bsd-3-clause
indro/t2c
libs/external_libs/Pygments-0.11.1/pygments/unistring.py
19
404148
# -*- coding: utf-8 -*- """ pygments.unistring ~~~~~~~~~~~~~~~~~~ Strings of all Unicode characters of a certain category. Used for matching in Unicode-aware languages. Run to regenerate. Inspired by chartypes_create.py from the MoinMoin project. :copyright: 2007 by Georg Brandl. :license...
mit
inspirehep/invenio
modules/elmsubmit/lib/elmsubmit_richtext2txt.py
39
13955
# -*- coding: utf-8 -*- ## ## This file is part of Invenio. ## Copyright (C) 2004, 2005, 2006, 2007, 2008, 2010, 2011 CERN. ## ## Invenio is free software; you can redistribute it and/or ## modify it under the terms of the GNU General Public License as ## published by the Free Software Foundation; either version 2 of t...
gpl-2.0
radhika-raghavendran/mbed-os5.1-onsemi
tools/host_tests/hello_auto.py
122
1148
""" mbed SDK Copyright (c) 2011-2013 ARM Limited 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 wr...
apache-2.0
agilman/flask-template
app/models.py
1
1788
from flask import Flask from flask_sqlalchemy import SQLAlchemy from collections import OrderedDict import datetime from app import app db = SQLAlchemy(app) class CommonFuncs(object): def _asdict(self): result = OrderedDict() for key in self.__mapper__.c.keys(): attr = getattr(self,ke...
mit
maxamillion/ansible-modules-extras
network/f5/bigip_gtm_wide_ip.py
15
5234
#!/usr/bin/python # -*- coding: utf-8 -*- # # (c) 2015, Michael Perzel # # 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 you...
gpl-3.0
renatopp/batma
batma/graphics/sprite.py
1
5433
# -*- coding:utf-8 -*- # Copyright (c) 2011 Renato de Pontes Pereira, renato.ppontes at gmail dot 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 witho...
mit
rjfarmer/mesaplot
tests/test_mesaplot.py
1
2297
try: import unittest as unittest except ImportError: import unittest2 as unittest import mesaPlot as mp import os import matplotlib.pyplot as plt os.chdir('tests') class TestFileReader(unittest.TestCase): def test_init(self): m=mp.MESA() def test_load_history1(self): m=mp.MESA() m.loadHistory() def ...
gpl-2.0
scalative/haas
haas/plugins/i_discoverer_plugin.py
3
2484
# -*- coding: utf-8 -*- # Copyright (c) 2013-2014 Simon Jagoe # All rights reserved. # # This software may be modified and distributed under the terms # of the 3-clause BSD license. See the LICENSE.txt file for details. from __future__ import absolute_import, unicode_literals from abc import ABCMeta, abstractmethod ...
bsd-3-clause
maxwen/primou-kernel-HELLBOY
arch/ia64/scripts/unwcheck.py
13143
1714
#!/usr/bin/python # # Usage: unwcheck.py FILE # # This script checks the unwind info of each function in file FILE # and verifies that the sum of the region-lengths matches the total # length of the function. # # Based on a shell/awk script originally written by Harish Patil, # which was converted to Perl by Matthew Ch...
gpl-2.0
Sitryk/Sitryk-Cogs
coowner/coowner.py
1
23627
from .utils import chat_formatting as cf from .utils.dataIO import dataIO from discord.ext import commands from .utils import checks from copy import deepcopy import discord import random import os DEFAULT_SETTINGS = {"RESTRICTED": [], "WHITELIST" : [], "WL_ENABLED" : False, ...
mit
philippeback/volatility
volatility/plugins/ssdt.py
44
10691
# Volatility # Copyright (C) 2008-2013 Volatility Foundation # # This file is part of Volatility. # # Volatility is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your o...
gpl-2.0
clcii/xbmcaudiobible
default.py
1
8196
#!/usr/bin/python # -*- coding: utf-8 -*- __addonname__ = "Audio Bible Browser" __addonid__ = "plugin.audio.audiobible" __author__ = "clcii" import urllib,urllib2,re,sys,base64,socket,time #,pickle,collections from xbmcswift2 import Plugin,xbmc,xbmcgui,ListItem,actions from datetime import dat...
gpl-2.0
haya14busa/alc-etm-searcher
nltk-3.0a3/build/lib/nltk/util.py
2
37457
# Natural Language Toolkit: Utility functions # # Copyright (C) 2001-2013 NLTK Project # Author: Steven Bird <stevenbird1@gmail.com> # URL: <http://nltk.org/> # For license information, see LICENSE.TXT from __future__ import print_function import locale import re import types import textwrap import pydoc import bisect...
mit
bsmr-c-cpp/mongrel2
examples/zcov/zcov/GCovParser.py
97
6244
#!/usr/bin/python from pprint import pprint import subprocess import os import re import sys class GCovFileData: CallNotExecuted = 0 CallReturned = 1 BranchNotTaken = 0 BranchTaken = 1 BranchFallthrough = 2 # not used def __init__(self, keys, lines, calls, branches, functions): self....
bsd-3-clause
bwhmather/verktyg
verktyg/http/cookies.py
1
8734
""" verktyg.http.cookies ~~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2015 Ben Mather, based on Werkzeug, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ import re import string from itertools import chain from time import time from datetime import timedelta from...
bsd-3-clause
keerts/home-assistant
homeassistant/components/configurator.py
10
5792
""" Support to allow pieces of code to request configuration from the user. Initiate a request by calling the `request_config` method with a callback. This will return a request id that has to be used for future calls. A callback has to be provided to `request_config` which will be called when the user has submitted c...
apache-2.0
3dfxmadscientist/cbss-server
cbss/tests/test_xmlrpc.py
61
2617
# -*- coding: utf-8 -*- # Run with one of these commands: # > OPENERP_ADDONS_PATH='../../addons/trunk' OPENERP_PORT=8069 \ # OPENERP_DATABASE=yy PYTHONPATH=. python tests/test_xmlrpc.py # > OPENERP_ADDONS_PATH='../../addons/trunk' OPENERP_PORT=8069 \ # OPENERP_DATABASE=yy nosetests tests/test_xmlrpc.py ...
agpl-3.0
adelina-t/nova
nova/tests/unit/compute/monitors/test_cpu_monitor.py
13
3173
# Copyright 2013 Intel Corporation # 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
palladius/gcloud
packages/gsutil/boto/boto/glacier/__init__.py
17
2418
# Copyright (c) 2011 Mitch Garnaat http://garnaat.org/ # Copyright (c) 2011 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 ...
gpl-3.0
XileForce/Vindicator
arch/ia64/scripts/unwcheck.py
13143
1714
#!/usr/bin/python # # Usage: unwcheck.py FILE # # This script checks the unwind info of each function in file FILE # and verifies that the sum of the region-lengths matches the total # length of the function. # # Based on a shell/awk script originally written by Harish Patil, # which was converted to Perl by Matthew Ch...
gpl-2.0
lingmann/dcos
packages/dcos-integration-test/extra/test_mesos.py
2
9969
import json import logging import uuid import pytest import retrying import test_helpers from dcos_test_utils import marathon, recordio # Creates and yields the initial ATTACH_CONTAINER_INPUT message, then a data message, # then an empty data chunk to indicate end-of-stream. def input_streamer(nested_container_id)...
apache-2.0
citrix-openstack-build/nova
nova/tests/api/openstack/compute/plugins/v3/test_console_output.py
10
5216
# Copyright 2011 Eldar Nugaev # 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 ...
apache-2.0
wxgeo/geophar
wxgeometrie/sympy/core/tests/test_power.py
7
15883
from sympy.core import ( Rational, Symbol, S, Float, Integer, Mul, Number, Pow, Basic, I, nan, pi, E, symbols, oo, zoo) from sympy.core.tests.test_evalf import NS from sympy.core.function import expand_multinomial from sympy.functions.elementary.miscellaneous import sqrt, cbrt from sympy.functions.elementary.ex...
gpl-2.0
Jgarcia-IAS/localizacion
openerp/addons-extra/odoo-pruebas/odoo-server/addons/base_report_designer/plugin/openerp_report_designer/bin/script/lib/tiny_socket.py
386
3270
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). All Rights Reserved # $Id$ # # This program is free software: you can redistribute it and/or modify # ...
agpl-3.0
pershoot/android_kernel_samsung_p4
tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Core.py
11088
3246
# Core.py - Python extension for perf script, core functions # # 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. from collections import defaultdict def aut...
gpl-2.0
Elettronik/SickRage
lib/rebulk/test/rules_module.py
21
1177
#!/usr/bin/env python # -*- coding: utf-8 -*- # pylint: disable=no-self-use, pointless-statement, missing-docstring, invalid-name from ..match import Match from ..rules import Rule class Rule3(Rule): def when(self, matches, context): return context.get('when') def then(self, matches, when_response, c...
gpl-3.0
blueman-project/blueman
blueman/plugins/applet/KillSwitch.py
2
5655
from gettext import gettext as _ import os from typing import Dict, Callable, Any, Optional from gi.repository import GLib, Gio import struct import logging from blueman.main.DBusProxies import Mechanism from blueman.plugins.AppletPlugin import AppletPlugin from blueman.plugins.applet.PowerManager import PowerManager...
gpl-3.0
dims/neutron
neutron/agent/linux/ra.py
5
7239
# Copyright 2014 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 requ...
apache-2.0
jaysonsantos/servo
tests/wpt/web-platform-tests/websockets/handlers/echo_wsh.py
163
1219
#!/usr/bin/python from mod_pywebsocket import msgutil from mod_pywebsocket import common _GOODBYE_MESSAGE = u'Goodbye' def web_socket_do_extra_handshake(request): # This example handler accepts any request. See origin_check_wsh.py for how # to reject access from untrusted scripts based on origin value. if...
mpl-2.0
pavelchristof/gomoku-ai
tensorflow/python/ops/matmul_benchmark.py
33
5488
# 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
kenshay/ImageScripter
ProgramData/SystemFiles/Python/Lib/test/test_mailbox.py
41
86569
import os import sys import time import stat import socket import email import email.message import re import shutil import StringIO import tempfile from test import test_support import unittest import mailbox import glob try: import fcntl except ImportError: pass # Silence Py3k warning rfc822 = test_support.i...
gpl-3.0
ravibhure/ansible
lib/ansible/modules/web_infrastructure/ansible_tower/tower_inventory.py
34
3846
#!/usr/bin/python # coding: utf-8 -*- # (c) 2017, Wayne Witzel III <wayne@riotousliving.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1...
gpl-3.0
chris-allan/openmicroscopy
components/xsd-fu/generateDS/Demos/People/peoplesup.py
17
42895
#!/usr/bin/env python # # Generated Tue Jan 30 12:32:05 2007 by generateDS.py. # import sys import getopt from xml.dom import minidom from xml.dom import Node # # If you have installed IPython you can uncomment and use the following. # IPython is available from http://ipython.scipy.org/. # ## from IPython.Shell imp...
gpl-2.0
ganeti/ganeti
test/py/ganeti.locking_unittest.py
1
34642
#!/usr/bin/python3 # # Copyright (C) 2006, 2007, 2010 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: # # 1. Redistributions of source code must retain the above copyright notice, #...
bsd-2-clause
Innovahn/cybex
addons/purchase_requisition/wizard/bid_line_qty.py
374
1711
# -*- 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
metasmile/awesome-strings
raw/chromium/grit/grit/clique.py
34
17957
#!/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. '''Collections of messages and their translations, called cliques. Also collections of cliques (uber-cliques). ''' import re impo...
mit
capooti/pootle
local_apps/pootle_store/signals.py
7
1049
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2009 Zuza Software Foundation # # This file is part of translate. # # translate 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 t...
gpl-2.0
Cryptoverse/cryptoverse-service-python
tests/models/test_starLog.py
1
2854
from unittest import TestCase import pytest from project.models import StarLog @pytest.mark.usefixtures("session", 'db') class TestStarLog(object): def test_add_to_starlog(self, session, db): s = StarLog( "000000fb315c6d9bcee6e83606695ae2b" "4a09beb929ce471608829...
mit
zofuthan/edx-platform
common/test/acceptance/tests/lms/test_lms_edxnotes.py
84
44359
""" Test LMS Notes """ from uuid import uuid4 from datetime import datetime from nose.plugins.attrib import attr from ..helpers import UniqueCourseTest from ...fixtures.course import CourseFixture, XBlockFixtureDesc from ...pages.lms.auto_auth import AutoAuthPage from ...pages.lms.course_nav import CourseNavPage from ....
agpl-3.0
zackster/HipHopGoblin
lib/python2.6/django/core/mail/backends/filebased.py
394
2485
"""Email backend that writes messages to a file.""" import datetime import os from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.core.mail.backends.console import EmailBackend as ConsoleEmailBackend class EmailBackend(ConsoleEmailBackend): def __init__(self, *arg...
bsd-3-clause
dpo/nlpy
nlpy/optimize/solvers/lsqr.py
3
15469
""" Solve the least-squares problem minimize ||Ax-b|| using LSQR. This is a line-by-line translation from Matlab code available at http://www.stanford.edu/~saunders/lsqr. Michael P. Friedlander, University of British Columbia Dominique Orban, Ecole Polytechnique de Montreal """ from nlpy.tools.utils import roots...
gpl-3.0
ritchyteam/odoo
addons/point_of_sale/report/account_statement.py
380
2031
# -*- 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
qisanstudio/qsapp-score
src/score/migration/versions/42f4a0f4afd9_create_table.py
1
3217
"""create_table Revision ID: 42f4a0f4afd9 Revises: None Create Date: 2014-11-15 16:53:22.716676 """ # revision identifiers, used by Alembic. revision = '42f4a0f4afd9' down_revision = None from alembic import op import sqlalchemy as sa #from guokr.platform.sqlalchemy.types import JSONType def upgrade(): op.crea...
mit
ylatuya/Flumotion
flumotion/component/producers/looper/looper.py
1
9532
# -*- Mode: Python -*- # vi:si:et:sw=4:sts=4:ts=4 # # Flumotion - a streaming media server # Copyright (C) 2004,2005,2006,2007 Fluendo, S.L. (www.fluendo.com). # All rights reserved. # This file may be distributed and/or modified under the terms of # the GNU General Public License version 2 as published by # the Free ...
gpl-2.0
evilhero/mylar
lib/apscheduler/jobstores/sqlalchemy.py
5
5785
from __future__ import absolute_import from apscheduler.jobstores.base import BaseJobStore, JobLookupError, ConflictingIdError from apscheduler.util import maybe_ref, datetime_to_utc_timestamp, utc_timestamp_to_datetime from apscheduler.job import Job try: import cPickle as pickle except ImportError: # pragma: n...
gpl-3.0
eneldoserrata/marcos_openerp
addons/procurement/__init__.py
72
1112
# -*- 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
MER-GROUP/intellij-community
python/lib/Lib/site-packages/django/core/cache/backends/base.py
232
7960
"Base Cache class." import warnings from django.conf import settings from django.core.exceptions import ImproperlyConfigured, DjangoRuntimeWarning from django.utils.encoding import smart_str from django.utils.importlib import import_module class InvalidCacheBackendError(ImproperlyConfigured): pass class CacheKe...
apache-2.0
vedujoshi/tempest
tempest/api/object_storage/test_object_formpost.py
1
4527
# Copyright (C) 2013 eNovance SAS <licensing@enovance.com> # # 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 applicabl...
apache-2.0
Bootz/multicore-opimization
llvm/tools/clang/utils/analyzer/SATestAdd.py
6
2950
#!/usr/bin/env python """ Static Analyzer qualification infrastructure: adding a new project to the Repository Directory. Add a new project for testing: build it and add to the Project Map file. Assumes it's being run from the Repository Directory. The project directory should be added inside the Repository D...
gpl-3.0
endisd/samba
source4/scripting/python/samba/torture/spoolss.py
27
10498
import sys, string import dcerpc def ResizeBufferCall(fn, pipe, r): r['buffer'] = None r['buf_size'] = 0 result = fn(pipe, r) if result['result'] == dcerpc.WERR_INSUFFICIENT_BUFFER or \ result['result'] == dcerpc.WERR_MORE_DATA: r['buffer'] = result['buf_size'] * '\x00' r...
gpl-3.0
lightningkay/NoahGameFrame
Dependencies/protobuf/third_party/googletest/googletest/scripts/fuse_gtest_files.py
28
8901
#!/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...
apache-2.0
wyom/sympy
sympy/polys/domains/ring.py
103
3288
"""Implementation of :class:`Ring` class. """ from __future__ import print_function, division from sympy.polys.domains.domain import Domain from sympy.polys.polyerrors import ExactQuotientFailed, NotInvertible, NotReversible from sympy.utilities import public @public class Ring(Domain): """Represents a ring dom...
bsd-3-clause
wooga/airflow
airflow/providers/google/cloud/operators/dataflow.py
1
23975
# # 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...
apache-2.0
HyperloopTeam/FullOpenMDAO
lib/python2.7/site-packages/networkx-1.9.1-py2.7.egg/networkx/readwrite/json_graph/node_link.py
9
5363
# Copyright (C) 2011-2013 by # Aric Hagberg <hagberg@lanl.gov> # Dan Schult <dschult@colgate.edu> # Pieter Swart <swart@lanl.gov> # All rights reserved. # BSD license. from itertools import chain, count import json import networkx as nx from networkx.utils import make_str __author__ = """Aric Hagberg ...
gpl-2.0
rismalrv/edx-platform
common/test/acceptance/tests/studio/test_studio_course_team.py
47
14195
""" Acceptance tests for course in studio """ from flaky import flaky from nose.plugins.attrib import attr from .base_studio_test import StudioCourseTest from ...pages.studio.auto_auth import AutoAuthPage from ...pages.studio.users import CourseTeamPage from ...pages.studio.index import DashboardPage @flaky # TODO...
agpl-3.0
kashyap32/scrapy
tests/test_utils_sitemap.py
140
7411
import unittest from scrapy.utils.sitemap import Sitemap, sitemap_urls_from_robots class SitemapTest(unittest.TestCase): def test_sitemap(self): s = Sitemap(b"""<?xml version="1.0" encoding="UTF-8"?> <urlset xmlns="http://www.google.com/schemas/sitemap/0.84"> <url> <loc>http://www.example.com/</loc...
bsd-3-clause
spmealin/pyAdafruit_DRV2605
examples/audio/audio.py
1
1088
################################################## # This is a library for the Adafruit DRV2605L Haptic Driver # # ----> http://www.adafruit.com/products/2305 # # Check out the links above for our tutorials and wiring diagrams # This motor/haptic driver uses I2C to communicate # # Adafruit invests time and resour...
mit
PmagPy/PmagPy
programs/qqplot.py
2
2180
#!/usr/bin/env python from __future__ import print_function from builtins import input import sys import matplotlib if matplotlib.get_backend() != "TKAgg": matplotlib.use("TKAgg") import pmagpy.pmagplotlib as pmagplotlib def main(): """ NAME qqplot.py DESCRIPTION makes qq plot of input da...
bsd-3-clause
nvoron23/hue
desktop/core/ext-py/tablib-develop/tablib/packages/yaml3/nodes.py
985
1440
class Node(object): def __init__(self, tag, value, start_mark, end_mark): self.tag = tag self.value = value self.start_mark = start_mark self.end_mark = end_mark def __repr__(self): value = self.value #if isinstance(value, list): # if len(value) == 0: ...
apache-2.0
srikantbmandal/ansible
lib/ansible/modules/cloud/cloudstack/cs_vpc.py
49
11522
#!/usr/bin/python # -*- coding: utf-8 -*- # # (c) 2016, René Moser <mail@renemoser.net> # # This file is part of Ansible # # Ansible is free software: you can redistribute it an/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the Licen...
gpl-3.0
dkodnik/arp
addons/lunch/__openerp__.py
62
2636
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2012 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the G...
agpl-3.0
guschmue/tensorflow
tensorflow/python/saved_model/signature_constants.py
119
2635
# 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
AICP/external_chromium_org
tools/find_runtime_symbols/prepare_symbol_info.py
10
8506
#!/usr/bin/env python # Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import hashlib import json import logging import os import re import shutil import subprocess import sys import tempfile BASE_PAT...
bsd-3-clause
Eszti/4lang
src/fourlang/dict_to_4lang.py
1
6896
from __future__ import with_statement from collections import defaultdict import json import logging import os import sys import threading import time import traceback from dep_to_4lang import DepTo4lang from entry_preprocessor import EntryPreprocessor from lexicon import Lexicon from longman_parser import LongmanPars...
mit
TridevGuha/django
django/contrib/gis/db/backends/base/models.py
434
7111
import re from django.contrib.gis import gdal from django.utils import six from django.utils.encoding import python_2_unicode_compatible @python_2_unicode_compatible class SpatialRefSysMixin(object): """ The SpatialRefSysMixin is a class used by the database-dependent SpatialRefSys objects to reduce redu...
bsd-3-clause
Duraznos/root
bindings/pyroot/ROOTaaS/iPyROOT/cpptransformer.py
7
3545
import sys import re from IPython.core.inputtransformer import InputTransformer from IPython import get_ipython from IPython.core import display import utils _cppDcl=re.compile("\s*\.cpp\s+-d") _cppAclic=re.compile("\s*\.cpp\s+-a") _bash=re.compile("\s*\.bash\d*") class CppTransformer(InputTransformer): def __in...
lgpl-2.1
unikmhz/npui
netprofile_dialup/netprofile_dialup/__init__.py
1
3140
#!/usr/bin/env python # -*- coding: utf-8 -*- # # NetProfile: Dial-Up module # Copyright © 2013-2017 Alex Unigovsky # # This file is part of NetProfile. # NetProfile 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 ...
agpl-3.0
remotelockbox/remotelockbox
app.py
1
5071
from contextlib import closing import datetime import logging import argparse from flask import Flask, flash, redirect, render_template, json, \ request, url_for import flask_login from flask_login import login_required import db from db import get_user import forms import worker app = Flask(__name__) app.secret...
mit
dragondjf/CloudSetuper
setuper web app/handlers/admin/adminhandler.py
1
1613
#!/usr/bin/env python # -*- coding: utf-8 -*- from tornado.web import authenticated, removeslash from handlers.basehandlers import BaseHandler adminusers = [ { 'username': 'admin', 'password': 'admin' } ] class AdminLoginHandler(BaseHandler): role = "admin" @removeslash def ge...
mit
smallnamespace/fireplace
tests/test_classic.py
2
93839
#!/usr/bin/env python from utils import * def test_abusive_sergeant(): game = prepare_game() wisp = game.player1.give(WISP) wisp.play() assert wisp.atk == 1 game.player1.give("CS2_188").play(target=wisp) assert wisp.atk == 3 game.end_turn() assert wisp.atk == 1 def test_acolyte_of_pain(): game = prepare_ga...
agpl-3.0
Maximilian-Reuter/SickRage-1
lib/pysrt/srtitem.py
73
3244
# -*- coding: utf-8 -*- """ SubRip's subtitle parser """ from pysrt.srtexc import InvalidItem, InvalidIndex from pysrt.srttime import SubRipTime from pysrt.comparablemixin import ComparableMixin from pysrt.compat import str, is_py2 import re class SubRipItem(ComparableMixin): """ SubRipItem(index, start, end...
gpl-3.0
Stratoscale/rackattack-virtual
rackattack/common/tests/fakepipes.py
2
5199
import os import select from rackattack.common.tests.fakeepoll import FakeEpoll class FakePipe: FAKE_FIFO_FD_COUNTER = 2000 def __init__(self): self.content = "" self.readFd = None self.writeFd = None def read(self, length): assert self.readFd is not None length =...
apache-2.0
eunchong/build
third_party/requests_1_2_3/requests/packages/charade/mbcsgroupprober.py
2769
1967
######################## 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...
bsd-3-clause
forseti-security/forseti-security
google/cloud/forseti/scanner/scanners/log_sink_scanner.py
1
5628
# Copyright 2018 The Forseti Security 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 ap...
apache-2.0
htwenhe/DJOA
env/Lib/site-packages/odf/manifest.py
5
1458
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (C) 2006-2007 Søren Roug, European Environment Agency # # 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 L...
mit
joeythesaint/yocto-autobuilder
lib/python2.7/site-packages/buildbot-0.8.8-py2.7.egg/buildbot/test/unit/test_status_master.py
4
3169
# 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
NickC1/skCCM
skccm/skccm.py
1
9086
# # Data for analyzing causality. # By Nick Cortale # # Classes: # ccm # embed # # Paper: # Detecting Causality in Complex Ecosystems # George Sugihara et al. 2012 # # Thanks to Kenneth Ells and Dylan McNamara # # Notes: # Originally I thought this can be made way faster by only calculting the # distances once and th...
mit
ulfjack/bazel
third_party/py/gflags/gflags/flags_modules_for_testing/module_foo.py
11
5105
#!/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 of c...
apache-2.0
tarikkdiry/Flock
flask/lib/python2.7/site-packages/sqlparse/engine/statement_splitter.py
20
3648
# -*- coding: utf-8 -*- # # Copyright (C) 2016 Andi Albrecht, albrecht.andi@gmail.com # # This module is part of python-sqlparse and is released under # the BSD License: https://opensource.org/licenses/BSD-3-Clause from sqlparse import sql, tokens as T class StatementSplitter(object): """Filter that split stream...
bsd-3-clause
twobraids/socorro
socorro/unittest/external/fs/test_crash_data.py
1
7310
# 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 shutil import tempfile from configman import ConfigurationManager, Namespace from mock import Mock from nose.plu...
mpl-2.0
opendatagroup/hadrian
titus/titus/pmml/version_4_1.py
1
117445
#!/usr/bin/env python # Copyright (C) 2014 Open Data ("Open Data" refers to # one or more of the following companies: Open Data Partners LLC, # Open Data Research LLC, or Open Data Capital LLC.) # # This file is part of Hadrian. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this...
apache-2.0
aleksandr-bakanov/astropy
astropy/wcs/wcsapi/tests/test_sliced_low_level_wcs.py
3
25909
import warnings import pytest import numpy as np from numpy.testing import assert_equal, assert_allclose from astropy.wcs.wcs import WCS, FITSFixedWarning from astropy.wcs import WCS from astropy.io.fits import Header from astropy.io.fits.verify import VerifyWarning from astropy.coordinates import SkyCoord, Galactic ...
bsd-3-clause
tensorflow/tensorflow
tensorflow/python/keras/layers/preprocessing/benchmarks/weighted_embedding_varlen_benchmark.py
7
3477
# 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
kerr-huang/python-messaging
messaging/test/test_wap.py
4
7297
# -*- coding: utf-8 -*- from array import array import unittest from messaging.sms import SmsDeliver from messaging.sms.wap import (is_a_wap_push_notification as is_push, is_mms_notification, extract_push_notification) def list_to_str(l): a = array("B...
gpl-2.0
Krossom/python-for-android
python-build/python-libs/xmpppy/xmpp/roster.py
203
9163
## roster.py ## ## Copyright (C) 2003-2005 Alexey "Snake" Nezhdanov ## ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation; either version 2, or (at your option) ## any later version. ...
apache-2.0
dcode/ssg-el6-kickstart
config/hardening/classification-banner.py
3
13666
#!/usr/bin/python # Classification Banner # # This script was written by Frank Caviggia, Red Hat Consulting # Last update was 04 May 2015 # This script is NOT SUPPORTED by Red Hat Global Support Services. # Please contact Rick Tavares for more information. # # Script: classification-banner.py # Description: Displays a ...
apache-2.0
opcode81/ProbCog
src/main/python/MLN/grounding/bpll.py
1
13782
# Markov Logic Networks - Grounding # # (C) 2013 by Daniel Nyga (nyga@cs.tum.edu) # # 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 ri...
gpl-3.0
seancug/python-example
fatiando-0.2/fatiando/gravmag/tensor.py
1
8136
r""" Utilities for operating on the gradient tensor of potential fields. **Functions** * :func:`~fatiando.gravmag.tensor.invariants`: Calculates the first (:math:`I_1`), second (:math:`I_2`), and dimensionless (:math:`I`) invariants * :func:`~fatiando.gravmag.tensor.eigen`: Calculates the eigenvalues and eigenvec...
gpl-2.0
bvcms/bvcms
CmsWeb/Lib/xml/dom/xmlbuilder.py
239
12337
"""Implementation of the DOM Level 3 'LS-Load' feature.""" import copy import xml.dom from xml.dom.NodeFilter import NodeFilter __all__ = ["DOMBuilder", "DOMEntityResolver", "DOMInputSource"] class Options: """Features object that has variables set for each DOMBuilder feature. The DOMBuilder class uses a...
gpl-2.0
XXMrHyde/android_external_chromium_org
components/tools/metrics/count_ifdefs.py
158
2206
#!/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. """Counts the number of #if or #ifdef lines containing at least one preprocessor token that is a full match for the given pattern, ...
bsd-3-clause
MonicaHsu/truvaluation
venv/lib/python2.7/idlelib/IOBinding.py
8
21207
# changes by dscherer@cmu.edu # - IOBinding.open() replaces the current window with the opened file, # if the current window is both unmodified and unnamed # - IOBinding.loadfile() interprets Windows, UNIX, and Macintosh # end-of-line conventions, instead of relying on the standard library, # which will...
mit
isida/4
plugins/youtube.py
2
2714
#!/usr/bin/python # -*- coding: utf-8 -*- # --------------------------------------------------------------------------- # # # # Plugin for iSida Jabber Bot # # Copyright (C) diSabler <dsy@dsy....
gpl-3.0
trivoldus28/pulsarch-verilog
tools/local/bas-release/bas,3.9-SunOS-i386/lib/python/lib/python2.4/lib-tk/Tkdnd.py
198
11488
"""Drag-and-drop support for Tkinter. This is very preliminary. I currently only support dnd *within* one application, between different windows (or within the same window). I an trying to make this as generic as possible -- not dependent on the use of a particular widget or icon type, etc. I also hope that this wi...
gpl-2.0
pahaz/ansible-modules-core
utilities/helper/accelerate.py
90
27254
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2013, James Cammarata <jcammarata@ansible.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 ...
gpl-3.0
lunafeng/django
django/contrib/gis/geos/polygon.py
450
6843
from ctypes import byref, c_uint from django.contrib.gis.geos import prototypes as capi from django.contrib.gis.geos.geometry import GEOSGeometry from django.contrib.gis.geos.libgeos import GEOM_PTR, get_pointer_arr from django.contrib.gis.geos.linestring import LinearRing from django.utils import six from django.util...
bsd-3-clause