repo_name
stringlengths
6
100
path
stringlengths
4
294
copies
stringlengths
1
5
size
stringlengths
4
6
content
stringlengths
606
896k
license
stringclasses
15 values
jwayneroth/mpd-touch
pygameui/button.py
1
11634
import label import callback import theme import pygame import view import imageview CENTER = 0 LEFT = 1 RIGHT = 2 TOP = 3 BOTTOM = 4 WORD_WRAP = 0 CLIP = 1 """ Button A button with a text caption. Essentially an interactive label. Signals on_clicked(button, mousebutton) """ class Button(label.Label): def __in...
mit
syhost/android_kernel_zte_n918st
tools/perf/scripts/python/syscall-counts.py
11181
1522
# system call counts # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Displays system-wide system call totals, broken down by syscall. # If a [comm] arg is specified, only syscalls called by [comm] are displayed. import os import sys sys.path.append(os.envir...
gpl-2.0
ido-ran/ran-smart-frame2
web/server/lib/googleapiclient/discovery_cache/appengine_memcache.py
42
1599
# Copyright 2014 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 by applicable law or ...
mit
sdague/home-assistant
tests/components/tplink/test_light.py
4
18448
"""Tests for light platform.""" from datetime import timedelta import logging from typing import Callable, NamedTuple from pyHS100 import SmartDeviceException import pytest from homeassistant.components import tplink from homeassistant.components.homeassistant import ( DOMAIN as HA_DOMAIN, SERVICE_UPDATE_ENTI...
apache-2.0
OMKR/fMBT
src/d/python/contrib/dparserpy-syntax_error.py
23
1117
### PYTHON FRAGMENT # suggestions for code improvement are highly welcome ;-) def syntax_error(loc): contextwidth_left = 30 contextwidth_right = 30 ellipsis = '[...]' locbuf_flattened = loc.buf.replace("\n","\254") # \254 is 'not sign' spanstart = loc.s - contextwidth_left mn = max(spanst...
lgpl-2.1
matmutant/sl4a
python-build/python-libs/python-twitter/setup.py
90
2207
#!/usr/bin/python2.4 # # Copyright 2007 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
Hasimir/pyjs
examples/libtest/TimeModuleTest.py
6
5437
# Testing time module import sys import UnitTest import time class TimeModuleTest(UnitTest.UnitTest): def time_tuple(self, tm): return ( tm.tm_year, tm.tm_mon, tm.tm_mday, tm.tm_hour, tm.tm_min, tm.tm_sec, tm.tm_wday, ...
apache-2.0
brittanystoroz/kitsune
kitsune/questions/models.py
3
50719
import logging import re import time from datetime import datetime, timedelta, date from urlparse import urlparse from django.contrib.auth.models import User from django.contrib.contenttypes import generic from django.contrib.contenttypes.models import ContentType from django.core.cache import cache from django.core.u...
bsd-3-clause
SnabbCo/neutron
neutron/plugins/cisco/nexus/cisco_nexus_network_driver_v2.py
16
8655
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Copyright 2011 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
juanchopanza/NeuroM
neurom/fst/tests/test_core.py
5
3278
# Copyright (c) 2015, Ecole Polytechnique Federale de Lausanne, Blue Brain Project # All rights reserved. # # This file is part of NeuroM <https://github.com/BlueBrain/NeuroM> # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are ...
bsd-3-clause
ABI-Software/ZincView
src/zincview.py
1
30614
#!/usr/bin/python """ ZincView example visualisation application using OpenCMISS-Zinc, python, Qt (PySide) 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 impo...
mpl-2.0
aristotle-tek/cuny-bdif
AWS/ec2/lib/boto-2.34.0/tests/mturk/common.py
122
1811
import unittest import uuid import datetime from boto.mturk.question import ( Question, QuestionContent, AnswerSpecification, FreeTextAnswer, ) from _init_environment import SetHostMTurkConnection, config_environment class MTurkCommon(unittest.TestCase): def setUp(self): con...
mit
alteredlikeness/android_kernel_msm
tools/perf/scripts/python/failed-syscalls-by-pid.py
11180
2058
# failed system call counts, by pid # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Displays system-wide failed system call totals, broken down by pid. # If a [comm] arg is specified, only syscalls called by [comm] are displayed. import os import sys sys.pa...
gpl-2.0
dmishin/knuth_bendix
vondyck.py
1
4552
from knuth_bendix import knuthBendix, RewriteRuleset, shortLex def vdRule(n, m, k=2): """Create initial ruleset for von Dyck group with inverse elements https://en.wikipedia.org/wiki/Triangle_group#von_Dyck_groups """ return RewriteRuleset({ tuple('aA'): (), tuple('Aa'): (), tup...
mit
Humbedooh/ponymail
tools/install.py
4
3539
#!/usr/bin/env python # 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 "Licen...
apache-2.0
cgarrard/osgeopy-code
Chapter13/listing13_4.py
1
1939
# Script to draw world countries as patches. import numpy as np import matplotlib.pyplot as plt from matplotlib.path import Path import matplotlib.patches as patches from osgeo import ogr def order_coords(coords, clockwise): """Orders coordinates.""" total = 0 x1, y1 = coords[0] for x, y in coords[1:...
mit
aleneum/kogniserver
src/kogniserver/async.py
1
2307
import logging import os from threading import Thread import time try: import asyncio except ImportError: # Trollius >= 0.3 was renamed import trollius as asyncio from autobahn.asyncio.wamp import ApplicationSession from services import SessionHandler class Ping(Thread): def __init__(self, wamp): ...
mit
mikewiebe-ansible/ansible
lib/ansible/modules/cloud/azure/azure_rm_virtualmachinescalesetextension_info.py
20
7306
#!/usr/bin/python # # Copyright (c) 2018 Zim Kalinowski, (@zikalino) # # 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
coolyangzc/ucore_os_lab
related_info/ostep/ostep10-lottery.py
54
3990
#! /usr/bin/env python import sys from optparse import OptionParser import random parser = OptionParser() parser.add_option('-s', '--seed', default=0, help='the random seed', action='store', type='int', dest='seed') parser.add_option('-j', '--jobs', default=3, help='number of jobs in the system', action=...
gpl-2.0
tareqalayan/ansible
lib/ansible/modules/network/f5/bigip_traffic_group.py
26
10595
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2017, F5 Networks Inc. # GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', ...
gpl-3.0
kytvi2p/Sigil
3rdparty/python/Lib/test/test_generators.py
8
54447
import gc import sys import unittest import weakref from test import support class FinalizationTest(unittest.TestCase): def test_frame_resurrect(self): # A generator frame can be resurrected by a generator's finalization. def gen(): nonlocal frame try: yie...
gpl-3.0
jainanisha90/WeVoteServer
import_export_facebook/models.py
1
55791
# import_export_facebook/models.py # Brought to you by We Vote. Be good. # -*- coding: UTF-8 -*- from django.core.validators import RegexValidator from django.db import models from email_outbound.models import SEND_STATUS_CHOICES, TO_BE_PROCESSED from wevote_functions.functions import generate_random_string, positive_...
mit
bcornwellmott/frappe
frappe/config/integrations.py
2
1660
from __future__ import unicode_literals from frappe import _ def get_data(): return [ { "label": _("Payments"), "icon": "fa fa-star", "items": [ { "type": "doctype", "name": "Stripe Settings", "description": _("Stripe payment gateway settings"), }, { "type": "doctype", ...
mit
kenrick95/airmozilla
airmozilla/urls.py
1
1959
from django.conf import settings from django.conf.urls import patterns, include from django.contrib.staticfiles.urls import staticfiles_urlpatterns import djcelery from airmozilla.base.monkeypatches import patch patch() handler500 = 'airmozilla.base.views.handler500' urlpatterns = patterns( '', (r'^(?P<...
bsd-3-clause
tillahoffmann/tensorflow
tensorflow/contrib/metrics/python/kernel_tests/histogram_ops_test.py
130
9577
# 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
TansyArron/pants
tests/python/pants_test/bin/test_goal_runner.py
4
1149
# coding=utf-8 # Copyright 2015 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) import pytest from p...
apache-2.0
SEL-Columbia/commcare-hq
custom/ilsgateway/commtrack.py
1
12744
import logging import traceback from django.contrib.auth.models import User from corehq.apps.locations.models import Location from corehq.apps.sms.mixin import PhoneNumberInUseException, VerifiedNumber from corehq.apps.users.models import WebUser, CommCareUser, CouchUser, UserRole from custom.api.utils import apply_upd...
bsd-3-clause
broferek/ansible
lib/ansible/modules/network/avi/avi_analyticsprofile.py
19
32481
#!/usr/bin/python # # @author: Gaurav Rastogi (grastogi@avinetworks.com) # Eric Anderson (eanderson@avinetworks.com) # module_check: supported # Avi Version: 17.1.1 # # Copyright: (c) 2017 Gaurav Rastogi, <grastogi@avinetworks.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses...
gpl-3.0
shinglyu/ns3-h264-svc
src/applications/.waf-1.5.16-e6d03192b5ddfa5ef2c8d65308e48e42/wafadmin/TaskGen.py
6
10619
#! /usr/bin/env python # encoding: utf-8 import sys if sys.hexversion < 0x020400f0: from sets import Set as set import os,traceback,copy import Build,Task,Utils,Logs,Options from Logs import debug,error,warn from Constants import* typos={'sources':'source','targets':'target','include':'includes','define':'defines','imp...
gpl-2.0
acenario/Payable
lib/python2.7/site-packages/pip/_vendor/html5lib/treewalkers/lxmletree.py
355
6215
from __future__ import absolute_import, division, unicode_literals from pip._vendor.six import text_type from lxml import etree from ..treebuilders.etree import tag_regexp from gettext import gettext _ = gettext from . import _base from .. import ihatexml def ensure_str(s): if s is None: return None ...
mit
chrxr/wagtail
wagtail/wagtailimages/migrations/0001_initial.py
2
3475
# -*- coding: utf-8 -*- from __future__ import unicode_literals import taggit.managers from django.conf import settings from django.db import migrations, models import wagtail.wagtailimages.models import wagtail.wagtailsearch.index class Migration(migrations.Migration): dependencies = [ ('taggit', '000...
bsd-3-clause
kkintaro/termite-data-server
web2py/applications-original/admin/models/menu.py
22
1588
# ########################################################### # ## generate menu # ########################################################### _a = request.application _c = request.controller _f = request.function response.title = '%s %s' % (_f, '/'.join(request.args)) response.subtitle = 'admin' response.menu = [(T('...
bsd-3-clause
CM-Tab-S/android_kernel_samsung_klimtwifi
Documentation/target/tcm_mod_builder.py
4981
41422
#!/usr/bin/python # The TCM v4 multi-protocol fabric module generation script for drivers/target/$NEW_MOD # # Copyright (c) 2010 Rising Tide Systems # Copyright (c) 2010 Linux-iSCSI.org # # Author: nab@kernel.org # import os, sys import subprocess as sub import string import re import optparse tcm_dir = "" fabric_ops...
gpl-2.0
ibotty/ansible
lib/ansible/plugins/lookup/first_found.py
118
7029
# (c) 2013, seth vidal <skvidal@fedoraproject.org> red hat, inc # # 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 optio...
gpl-3.0
arthurmensch/modl
benchmarks/log.py
1
2179
import time import numpy as np from lightning.impl.primal_cd import CDClassifier from lightning.impl.sag import SAGAClassifier from sklearn.datasets import fetch_20newsgroups_vectorized from lightning.classification import SAGClassifier from sklearn.linear_model import LogisticRegression bunch = fetch_20newsgroups_v...
bsd-2-clause
DominikSchlecht/Mobile-Security-Framework-MobSF
StaticAnalyzer/tools/enjarify/enjarify/jvm/scalartypes.py
35
1310
# Copyright 2015 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 by applicable law or a...
gpl-3.0
rileychapman/roscopter-1
mavlink/pymavlink/build/lib.linux-x86_64-2.7/pymavlink/generator/lib/minixsv/pyxsval.py
78
15221
# # minixsv, Release 0.9.0 # file: pyxsval.py # # API for XML schema validator # # history: # 2004-09-09 rl created # 2004-09-29 rl adapted to re-designed XML interface classes, # ErrorHandler separated, URL processing added, some bugs fixed # 2004-10-07 rl Validator classes extracted in...
bsd-3-clause
chatziko/mopidy-youtube
mopidy_youtube/backend.py
1
5534
# -*- coding: utf-8 -*- from __future__ import unicode_literals import re import string from multiprocessing.pool import ThreadPool from urlparse import urlparse, parse_qs import unicodedata import pafy from mopidy import backend from mopidy.models import SearchResult, Track, Album import pykka import requests from ...
apache-2.0
Javiercerna/MissionPlanner
Lib/email/utils.py
53
10184
# Copyright (C) 2001-2010 Python Software Foundation # Author: Barry Warsaw # Contact: email-sig@python.org """Miscellaneous utilities.""" __all__ = [ 'collapse_rfc2231_value', 'decode_params', 'decode_rfc2231', 'encode_rfc2231', 'formataddr', 'formatdate', 'getaddresses', ...
gpl-3.0
geerlingguy/ansible
test/support/windows-integration/plugins/modules/win_dsc.py
50
6598
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2015, Trond Hindenes <trond@hindenes.com>, and others # Copyright: (c) 2017, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) ANSIBLE_METADATA = {'metadata_version': '1.1', 'statu...
gpl-3.0
petermalcolm/osf.io
tests/test_addons_oauth.py
21
8289
from nose.tools import * from framework.auth.core import Auth from framework.exceptions import PermissionsError from website import settings from website.addons.base import AddonConfig from website.addons.base import AddonOAuthNodeSettingsBase from website.addons.base import AddonOAuthUserSettingsBase from website.oa...
apache-2.0
BambooL/jeeves
demo/coursemanager/urls.py
3
1033
from django.conf.urls import patterns, include, url from django.contrib import admin admin.autodiscover() from django.conf.urls.static import static from django.conf import settings from coursemanager import views urlpatterns = patterns('', # Examples: # url(r'^$', 'coursemanager.views.home', name='home'), ...
mit
mbayon/TFG-MachineLearning
venv/lib/python3.6/site-packages/scipy/linalg/tests/test_basic.py
3
63938
# # Created by: Pearu Peterson, March 2002 # """ Test functions for linalg.basic module """ from __future__ import division, print_function, absolute_import import warnings import itertools import numpy as np from numpy import (arange, array, dot, zeros, identity, conjugate, transpose, float32) imp...
mit
praba230890/frappe
frappe/templates/pages/login.py
33
7237
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals import frappe import json import frappe.utils from frappe import _ class SignupDisabledError(frappe.PermissionError): pass no_cache = True def get_context(context): if frappe....
mit
allenlavoie/tensorflow
tensorflow/contrib/learn/python/learn/estimators/prediction_key.py
42
1311
# 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
leeseulstack/openstack
neutron/tests/unit/test_agent_rpc.py
2
6289
# 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/licenses/LICENSE-2.0 # # Unless...
apache-2.0
Zentyal/samba
ctdb/tests/takeover/simulation/ctdb_takeover.py
29
31505
#!/usr/bin/env python # ctdb ip takeover code # Copyright (C) Martin Schwenke, Ronnie Sahlberg 2010, 2011 # Based on original CTDB C code: # # Copyright (C) Ronnie Sahlberg 2007 # Copyright (C) Andrew Tridgell 2007 # This program is free software; you can redistribute it and/or modify # it under the terms of the ...
gpl-3.0
timorieber/wagtail
wagtail/api/v2/pagination.py
21
1463
from collections import OrderedDict from django.conf import settings from rest_framework.pagination import BasePagination from rest_framework.response import Response from .utils import BadRequestError class WagtailPagination(BasePagination): def paginate_queryset(self, queryset, request, view=None): li...
bsd-3-clause
zycdragonball/tensorflow
tensorflow/python/kernel_tests/softsign_op_test.py
91
2775
# 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
mavit/ansible
lib/ansible/modules/network/onyx/onyx_l2_interface.py
22
10423
#!/usr/bin/python # # 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', 'status': ['preview'], ...
gpl-3.0
wartman4404/servo
tests/wpt/update/__init__.py
194
1110
# 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/. #!/usr/bin/env python import os import subprocess import sys from mozlog.structured import structuredlog here = os.pat...
mpl-2.0
molotof/infernal-twin
build/pillow/Tests/test_imagepath.py
12
2105
from helper import unittest, PillowTestCase from PIL import ImagePath import array class TestImagePath(PillowTestCase): def test_path(self): p = ImagePath.Path(list(range(10))) # sequence interface self.assertEqual(len(p), 5) self.assertEqual(p[0], (0.0, 1.0)) self.ass...
gpl-3.0
BruceDai/web-testing-service
wts/tests/csp/csp_media-src_self_video.py
30
3606
def main(request, response): import simplejson as json f = file('config.json') source = f.read() s = json.JSONDecoder().decode(source) url1 = "http://" + s['host'] + ":" + str(s['ports']['http'][1]) url2 = "http://" + s['host'] + ":" + str(s['ports']['http'][0]) _CSP = "media-src 'self'; scr...
bsd-3-clause
heritage902/railroad
gtest/test/gtest_filter_unittest.py
2826
21261
#!/usr/bin/env python # # Copyright 2005 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...
gpl-3.0
Rudloff/youtube-dl
youtube_dl/extractor/tagesschau.py
16
12211
# -*- coding: utf-8 -*- from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( determine_ext, js_to_json, parse_iso8601, parse_filesize, ) class TagesschauPlayerIE(InfoExtractor): IE_NAME = 'tagesschau:player' _VALID_URL = r'https?://(?:www\...
unlicense
GladeRom/android_external_chromium_org
third_party/protobuf/python/google/protobuf/descriptor_database.py
230
4411
# Protocol Buffers - Google's data interchange format # Copyright 2008 Google Inc. All rights reserved. # http://code.google.com/p/protobuf/ # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions o...
bsd-3-clause
cccfran/sympy
sympy/plotting/pygletplot/plot_curve.py
25
2853
from __future__ import print_function, division from pyglet.gl import * from plot_mode_base import PlotModeBase from sympy.core import S from sympy.core.compatibility import xrange class PlotCurve(PlotModeBase): style_override = 'wireframe' def _on_calculate_verts(self): self.t_interval = self.inte...
bsd-3-clause
DucQuang1/py-earth
setup.py
1
3348
from setuptools import setup, Extension import numpy import sys import os sys.path.insert(0, os.path.join('.', 'pyearth')) from _version import __version__ # Determine whether to use Cython if '--cythonize' in sys.argv: cythonize_switch = True del sys.argv[sys.argv.index('--cythonize')] else: cythonize_swi...
bsd-3-clause
biddellns/sc2league-server
config/urls.py
1
1043
"""sc2league URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.11/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Class-...
gpl-3.0
jelugbo/hebs_repo
common/djangoapps/config_models/__init__.py
220
2002
""" Model-Based Configuration ========================= This app allows other apps to easily define a configuration model that can be hooked into the admin site to allow configuration management with auditing. Installation ------------ Add ``config_models`` to your ``INSTALLED_APPS`` list. Usage ----- Create a sub...
agpl-3.0
lkhomenk/integration_tests
cfme/fixtures/events.py
2
3698
# -*- coding: utf-8 -*- """Event testing fixture. The idea of this fixture is to pass some "expected" events to :py:class:`utils.events.EventListener` and check whether all expected events are received at the test end. register_event fixture accepts attributes for one expected event simple example: .. code-block:: ...
gpl-2.0
concurrentlabs/laguna
1.0/scripts/cachequery/cache_query.py
1
2571
#!/usr/bin/python import io import os import signal import sys from subprocess import call hit = miss = bypass = expired = 0 ######################################################################################### ######################################################################################### def main(): ...
apache-2.0
alxgu/ansible
lib/ansible/modules/utilities/logic/debug.py
45
2537
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2012 Dag Wieers <dag@wieers.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
NiklasRosenstein/c4ddev
extras/sublime-script-sender/send_python_code.py
3
9697
# -*- coding: utf8 -*- # # Copyright (C) 2014 Niklas Rosenstein # # 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,...
mit
Endika/OpenUpgrade
addons/knowledge/res_config.py
378
1436
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (C) 2004-2012 OpenERP S.A. (<http://openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms o...
agpl-3.0
nomaro/SickBeard_Backup
lib/imdb/__init__.py
50
41019
""" imdb package. This package can be used to retrieve information about a movie or a person from the IMDb database. It can fetch data through different media (e.g.: the IMDb web pages, a SQL database, etc.) Copyright 2004-2012 Davide Alberani <da@erlug.linux.it> This program is free software; you can redistribute i...
gpl-3.0
shakamunyi/ansible
test/units/parsing/vault/test_vault.py
87
5672
# (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
pavel-lazar/obsi
openbox/configuration_builder/click_configuration.py
3
1368
#!/usr/bin/env python # # Copyright (c) 2015 Pavel Lazar pavel.lazar (at) gmail.com # # The Software is provided WITHOUT ANY WARRANTY, EXPRESS OR IMPLIED. ##################################################################### class ClickConfiguration(object): REQUIREMENTS_PATTERN = 'require(package "{package}");' ...
apache-2.0
LIMXTEC/BitSend
qa/rpc-tests/wallet-hd.py
3
3205
#!/usr/bin/env python3 # Copyright (c) 2016 The Bitsend Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. from test_framework.test_framework import BitsendTestFramework from test_framework.util import ( start_nod...
mit
bank-netforce/netforce
netforce_general/netforce_general/models/user_group.py
1
1497
# Copyright (c) 2012-2015 Netforce Co. Ltd. # # 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, publ...
mit
nwchandler/ansible
test/runner/test.py
41
23807
#!/usr/bin/env python # PYTHON_ARGCOMPLETE_OK """Test runner for all Ansible tests.""" from __future__ import absolute_import, print_function import errno import os import sys from lib.util import ( ApplicationError, display, raw_command, ) from lib.delegation import ( delegate, ) from lib.executor...
gpl-3.0
gauribhoite/personfinder
env/google_appengine/lib/django-1.2/django/contrib/sessions/backends/file.py
44
5358
import errno import os import tempfile from django.conf import settings from django.contrib.sessions.backends.base import SessionBase, CreateError from django.core.exceptions import SuspiciousOperation, ImproperlyConfigured class SessionStore(SessionBase): """ Implements a file based session store. """ ...
apache-2.0
joerocklin/gem5
src/arch/x86/isa/insts/simd128/integer/data_reordering/shuffle.py
91
3586
# Copyright (c) 2007 The Hewlett-Packard Development Company # All rights reserved. # # The license below extends only to copyright in the software and shall # not be construed as granting a license to any other intellectual # property including but not limited to intellectual property relating # to a hardware implemen...
bsd-3-clause
spaceof7/QGIS
tests/src/python/test_qgscomposereffects.py
5
2935
# -*- coding: utf-8 -*- """QGIS Unit tests for QgsComposerEffects. .. note:: This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. ""...
gpl-2.0
tkchafin/scripts
phylip2biNumNex.py
1
8129
#!/usr/bin/python import re import sys import os import getopt import operator import random def main(): params = parseArgs() if params.phylip: #Get sequences as dict of lists seqs = readPhylip(params.phylip) #get list of columns and list of samplenames alen = getSeqLen(seqs) columns = [[]for i in range...
gpl-3.0
WillisXChen/django-oscar
oscar/lib/python2.7/site-packages/django/utils/module_loading.py
46
6700
# Avoid importing `importlib` from this package. from __future__ import absolute_import import copy import os import sys import warnings from importlib import import_module from django.core.exceptions import ImproperlyConfigured from django.utils import six from django.utils.deprecation import RemovedInDjango19Warnin...
bsd-3-clause
MrHarcombe/python-gpiozero
gpiozero/pins/data.py
1
53566
from __future__ import ( unicode_literals, absolute_import, print_function, division, ) str = type('') import os import sys from textwrap import dedent from itertools import cycle from operator import attrgetter from collections import namedtuple from ..exc import PinUnknownPi, PinMultiplePins, Pi...
bsd-3-clause
kressi/erpnext
erpnext/patches/v7_0/remove_doctypes_and_reports.py
41
1028
import frappe def execute(): if frappe.db.table_exists("Time Log"): frappe.db.sql("""delete from `tabDocType` where name in('Time Log Batch', 'Time Log Batch Detail', 'Time Log')""") frappe.db.sql("""delete from `tabDocField` where parent in ('Time Log', 'Time Log Batch')""") frappe.db.sql("""update `tabCusto...
gpl-3.0
jlecount-sungevity/holmium.core
tests/facet_tests.py
1
8107
""" tests for facets """ import unittest from flask_testing import LiveServerTestCase import mock from holmium.core import Page, Element, Locators, Elements, Section, ElementMap from holmium.core.facets import FacetError, defer, title, cookie, strict from holmium.core.pageobject import NonexistentElement from . impor...
mit
credativUK/OCB
addons/hr_expense/report/hr_expense_report.py
52
6694
# -*- 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
kerfab/jdic
jdic/jdic.py
1
21228
""" The Jdic module provides the features required to manipulate JSON objects through a consistent API. """ from __future__ import unicode_literals import json import hashlib import importlib from collections import Sequence, Mapping import json_delta import jsonschema from . import drivers # pylint: disable=unused-imp...
unlicense
ckloss/LIGGGHTS-PUBLIC
tools/moltemplate/examples/CG_biomolecules/vesicle_Brannigan2005+Bellesia2010/moltemplate_files/calc_table/calc_CGLipidTableINTvsINT.py
18
1241
#!/usr/bin/env python # Calculate a table of pairwise energies and forces between "INT" atoms # in the lipid membrane model described in # Brannigan et al, Phys Rev E, 72, 011915 (2005) # The energy of this interaction U(r) = eps*(0.4*(sigma/r)^12 - 3.0*(sigma/r)^2) # However it is truncated at rc2 = 22.5 (shifted ...
gpl-2.0
ketjow4/NOV
Lib/unittest/signals.py
162
1658
import signal import weakref from functools import wraps __unittest = True class _InterruptHandler(object): def __init__(self, default_handler): self.called = False self.default_handler = default_handler def __call__(self, signum, frame): installed_handler = signal.getsignal(signal....
gpl-3.0
rombie/contrail-controller
src/config/common/tests/test_common.py
1
42367
# # Copyright (c) 2013 Juniper Networks, Inc. All rights reserved. # import sys import gevent.monkey gevent.monkey.patch_all() import logging import tempfile import mock from pprint import pformat import coverage import fixtures import testtools from testtools import content from flexmock import flexmock from webtest ...
apache-2.0
joelsmith/openshift-tools
openshift_tools/monitoring/zabbix_metric_processor.py
13
11096
# vim: expandtab:tabstop=4:shiftwidth=4 # # Copyright 2015 Red Hat 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 # # Unl...
apache-2.0
pytorch/vision
references/detection/utils.py
1
8671
from collections import defaultdict, deque import datetime import errno import os import time import torch import torch.distributed as dist class SmoothedValue(object): """Track a series of values and provide access to smoothed values over a window or the global series average. """ def __init__(self...
bsd-3-clause
jnerin/ansible
test/units/modules/network/onyx/test_onyx_pfc_interface.py
16
4027
# # Copyright: Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # Make coding more python3-ish from __future__ import (absolute_import, division, print_function) __metaclass__ = type from ansible.compat.tests.mock import patch from ansible.modules.network.on...
gpl-3.0
LowieHuyghe/edmunds
tests/log/drivers/testsyslog.py
1
2970
from tests.testcase import TestCase from tests.foundation.syslogserver import SysLogServer class TestSysLog(TestCase): """ Test the SysLog """ def set_up(self): """ Set up the test case """ super(TestSysLog, self).set_up() self._server = SysLogServer() ...
apache-2.0
yhteentoimivuuspalvelut/ckanext-ytp-request
ckanext/ytp/request/command.py
1
1325
import logging from ckan.lib.cli import CkanCommand class InitDBCommand(CkanCommand): """ Initialises the database with the required tables Connects to the CKAN database and creates the member request tables Usage: paster initdb - Creates the database table member request """...
agpl-3.0
MarcusMoeller/mfc
mfc1/gui.py
6
33300
#!/usr/bin/python # -*- coding: utf-8 -*- # With the MindfulClock you turn your device into a Bell of Mindfulness. # Concept, Design: Marcurs Möller # <marcus.moeller@outlook.com> # <http://apps.microsoft.com/windows/de-de/app/ # mindfulclock/58063160-9cc6-4dee-9d92-...
gpl-3.0
iut-ibk/DynaMind-UrbanSim
3rdparty/opus/src/urbansim/configs/dplcm_estimation_config.py
2
1948
# Opus/UrbanSim urban simulation software. # Copyright (C) 2005-2009 University of Washington # See opus_core/LICENSE from urbansim.configs.estimation_base_config import run_configuration as config from urbansim.estimation.estimator import update_controller_by_specification_from_module class dplcm_configuratio...
gpl-2.0
dfm/emcee3
emcee3/tests/unit/test_state.py
1
1654
# -*- coding: utf-8 -*- from __future__ import division, print_function import numpy as np from ...state import State __all__ = ["test_dtype", "test_serialization", "test_repr"] def test_dtype(seed=1234): np.random.seed(seed) dtype = [ ("coords", np.float64, (4, )), ("log_prior", np.float...
mit
AOKP/external_chromium_org
native_client_sdk/src/build_tools/nacl-mono-builder.py
31
5279
#!/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 optparse import os import sys import tarfile import buildbot_common from build_paths import SCRIPT_DIR SDK_BUILD_DIR = SCR...
bsd-3-clause
gptech/ansible
lib/ansible/modules/utilities/logic/wait_for_connection.py
29
3313
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2017, Dag Wieers <dag@wieers.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, ...
gpl-3.0
allenai/document-qa
docqa/nn/span_prediction_ops.py
1
4078
import tensorflow as tf import numpy as np """ Some utility functions for dealing with span prediction in tensorflow """ def best_span_from_bounds(start_logits, end_logits, bound=None): """ Brute force approach to finding the best span from start/end logits in tensorflow, still usually faster then the p...
apache-2.0
carlini/cleverhans
cleverhans/model_zoo/madry_lab_challenges/cifar10_model.py
2
10334
"""cleverhans.model.Model implementation of cifar10_challenge.model.Model This re-implementation factors variable creation apart from forward propagation so it is possible to run forward propagation more than once in the same model. based on https://github.com/tensorflow/models/tree/master/resnet """ from __future__...
mit
pombreda/pyfilesystem-4
fs/rpcfs.py
7
10683
""" fs.rpcfs ======== This module provides the class 'RPCFS' to access a remote FS object over XML-RPC. You probably want to use this in conjunction with the 'RPCFSServer' class from the :mod:`fs.expose.xmlrpc` module. """ import xmlrpclib import socket import threading from fs.base import * from fs.errors import ...
bsd-3-clause
jjmleiro/hue
desktop/core/ext-py/django-openid-auth-0.5/django_openid_auth/models.py
36
2355
# django-openid-auth - OpenID integration for django.contrib.auth # # Copyright (C) 2007 Simon Willison # Copyright (C) 2008-2013 Canonical Ltd. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # * Redistributions o...
apache-2.0
andfoy/margffoy-tuay-server
env/lib/python2.7/site-packages/django/db/backends/base/introspection.py
93
7354
from collections import namedtuple from django.utils import six # Structure returned by DatabaseIntrospection.get_table_list() TableInfo = namedtuple('TableInfo', ['name', 'type']) # Structure returned by the DB-API cursor.description interface (PEP 249) FieldInfo = namedtuple('FieldInfo', 'name type_code displa...
gpl-2.0
evaschalde/odoo
addons/stock/tests/test_owner_available.py
233
3002
# Author: Leonardo Pistone # Copyright 2015 Camptocamp SA # # 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 la...
agpl-3.0