repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
⌀
SivilTaram/edx-platform
refs/heads/master
common/lib/xmodule/xmodule/modulestore/split_mongo/caching_descriptor_system.py
82
import sys import logging from contracts import contract, new_contract from fs.osfs import OSFS from lazy import lazy from xblock.runtime import KvsFieldData from xblock.fields import ScopeIds from xblock.core import XBlock from opaque_keys.edx.locator import BlockUsageLocator, LocalId, CourseLocator, LibraryLocator, D...
GoogleCloudPlatform/appengine-config-transformer
refs/heads/master
yaml_conversion/lib/google/appengine/api/backendinfo.py
1
# 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 ...
StephenSwat/eve_lunar_mining_organiser
refs/heads/master
elmo/moon_tracker/utils.py
1
def user_can_view_scans(user, moon): return ( user_can_delete_scans(user, moon) or user.has_perm('eve_sde.sys_can_view_scans', moon.planet.system) or user.has_perm('eve_sde.con_can_view_scans', moon.planet.system.constellation) or user.has_perm('eve_sde.reg_can_view_scans', moon.plan...
viranch/compose
refs/heads/master
tests/integration/service_test.py
5
from __future__ import absolute_import from __future__ import unicode_literals import os import shutil import tempfile from os import path from docker.errors import APIError from six import StringIO from six import text_type from .. import mock from .testcases import DockerClientTestCase from .testcases import pull_...
abdoosh00/edraak
refs/heads/master
cms/djangoapps/contentstore/tests/test_import_pure_xblock.py
6
""" Integration tests for importing courses containing pure XBlocks. """ from django.test.utils import override_settings from xblock.core import XBlock from xblock.fields import String from xmodule.modulestore.xml_importer import import_from_xml from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase ...
paulbdavis/ledger
refs/heads/next
test/python/PostingTest.py
8
# -*- coding: utf-8 -*- import unittest import exceptions import operator from ledger import * from StringIO import * from datetime import * class PostingTestCase(unittest.TestCase): def setUp(self): pass def tearDown(self): pass def test_(self): pass def suite(): return u...
sudheeshap8/LetsTango-Newsletter-Generator
refs/heads/master
lib/werkzeug/debug/repr.py
313
# -*- coding: utf-8 -*- """ werkzeug.debug.repr ~~~~~~~~~~~~~~~~~~~ This module implements object representations for debugging purposes. Unlike the default repr these reprs expose a lot more information and produce HTML instead of ASCII. Together with the CSS and JavaScript files of the debug...
spotify/napalm
refs/heads/master
napalm/nxos/nxos.py
1
# -*- coding: utf-8 -*- # Copyright 2015 Spotify AB. All rights reserved. # # The contents of this file are 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/LICE...
krizsa/node-o3
refs/heads/master
external/include/zbar/examples/upcrpc.py
7
#!/usr/bin/env python from xmlrpclib import ServerProxy import sys, re server = ServerProxy("http://dev.upcdatabase.com/rpc") ean_re = re.compile(r'^(UPC-A:|EAN-13:)?(\d{11,13})$', re.M) def lookup(decode): match = ean_re.search(decode) if match is None: print decode, return ean = match.gr...
zorroz/microblog
refs/heads/master
flask/lib/python2.7/site-packages/pip/_vendor/requests/packages/charade/langgreekmodel.py
2762
######################## 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...
mr-karan/python-mit-ocw-algo
refs/heads/master
heapSort.py
2
""" heapSort.py ------------------- Uses the max heap data structure implemented in a list. Time Complexity: O(n log n) Stable: NO """ def max_heapify(seq, i, n): left_child = 2 * i + 1 right_child = 2 * i + 2 if left_child <= n and seq[left_child] > seq[i]: largest = lef...
IronCountySchoolDistrict/powerschool_apps
refs/heads/master
powerschool_apps/health_care_plan/migrations/0022_auto_20170321_1621.py
1
# -*- coding: utf-8 -*- # Generated by Django 1.10.5 on 2017-03-21 22:21 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('health_care_plan', '0021_diabetes_blood_glucose_monitoring'), ] operations = [ ...
ameistad/django-template
refs/heads/master
{{cookiecutter.repo_name}}/apps/users/models.py
3
from django.contrib.auth.models import AbstractUser # Overriding the user model is recommended so you can customize it in the future. # https://docs.djangoproject.com/en/stable/topics/auth/customizing/#auth-custom-user class User(AbstractUser): pass
ducthien1490/youtube-dl
refs/heads/master
youtube_dl/extractor/howstuffworks.py
106
from __future__ import unicode_literals from .common import InfoExtractor from ..utils import ( find_xpath_attr, int_or_none, js_to_json, unescapeHTML, ) class HowStuffWorksIE(InfoExtractor): _VALID_URL = r'https?://[\da-z-]+\.howstuffworks\.com/(?:[^/]+/)*(?:\d+-)?(?P<id>.+?)-video\.htm' _TE...
aashish24/VTK-old
refs/heads/cvshead
Examples/GUI/Qt/GraphicsViewPython/GraphicsViewPython.py
23
#!/usr/bin/env python import sys from PyQt4 import QtOpenGL,QtGui,QtCore import vtk class MyOpenGLScene(QtGui.QGraphicsScene): def __init__(self, ctx): super(MyOpenGLScene, self).__init__() self.mCtx = ctx self.mQVTKItem = vtk.QVTKGraphicsItem(self.mCtx) self.addItem(self.mQVTKItem) self.mQVTKIt...
andela-ooladayo/django
refs/heads/master
django/utils/text.py
308
from __future__ import unicode_literals import re import unicodedata from gzip import GzipFile from io import BytesIO from django.utils import six from django.utils.encoding import force_text from django.utils.functional import SimpleLazyObject, allow_lazy from django.utils.safestring import SafeText, mark_safe from ...
aquasky111/CodeIgniter
refs/heads/develop
user_guide_src/cilexer/setup.py
397
""" Install and setup CodeIgniter highlighting for Pygments. """ from setuptools import setup entry_points = """ [pygments.lexers] cilexer = cilexer.cilexer:CodeIgniterLexer """ setup( name='pycilexer', version='0.1', description=__doc__, author="EllisLab, Inc.", packages=['cilexer'], install...
scottdangelo/RemoveVolumeMangerLocks
refs/heads/RemoveVolumeManagerLocks
cinder/__init__.py
43
# Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # 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 ...
fotinakis/sentry
refs/heads/master
tests/sentry/web/frontend/test_organization_settings.py
3
from __future__ import absolute_import from django.core.urlresolvers import reverse from sentry.models import Organization from sentry.testutils import TestCase, PermissionTestCase class OrganizationSettingsPermissionTest(PermissionTestCase): def setUp(self): super(OrganizationSettingsPermissionTest, se...
drmrd/ansible
refs/heads/devel
lib/ansible/modules/network/avi/avi_api_session.py
46
#!/usr/bin/python """ # Created on Aug 12, 2016 # # @author: Gaurav Rastogi (grastogi@avinetworks.com) GitHub ID: grastogi23 # # module_check: not supported # # 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.txt) # "...
dennisss/sympy
refs/heads/master
sympy/matrices/expressions/tests/test_funcmatrix.py
124
from sympy import (symbols, FunctionMatrix, MatrixExpr, Lambda, Matrix) def test_funcmatrix(): i, j = symbols('i,j') X = FunctionMatrix(3, 3, Lambda((i, j), i - j)) assert X[1, 1] == 0 assert X[1, 2] == -1 assert X.shape == (3, 3) assert X.rows == X.cols == 3 assert Matrix(X) == Matrix(3, ...
jakesyl/fail2ban
refs/heads/master
fail2ban/server/banmanager.py
1
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: t -*- # vi: set ft=python sts=4 ts=4 sw=4 noet : # This file is part of Fail2Ban. # # Fail2Ban 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;...
ibrahimgunduz34/SpiffWorkflow
refs/heads/master
SpiffWorkflow/specs/Join.py
3
# -*- coding: utf-8 -*- from __future__ import division # Copyright (C) 2007 Samuel Abels # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at you...
sergiolimajr/resrc
refs/heads/master
resrc/userprofile/models.py
1
# -*- coding: utf-8 -*-: from django.db import models from django.contrib.auth.models import User from django.core import urlresolvers from resrc.utils import slugify class Profile(models.Model): class Meta: verbose_name = 'user' verbose_name_plural = 'users' user = models.ForeignKey(User, u...
wagnerand/zamboni
refs/heads/master
scripts/generate-mkt-cats.py
5
import amo from addons.models import AddonCategory, Category, Webapp def run(): """ Usage:: python -B manage.py runscript scripts.generate-mkt-cats """ cats = { 'books-reference': 'Books & Reference', 'business': 'Business', 'education': 'Education', 'enterta...
tsabi/Odoo-tsabi-fixes
refs/heads/master
addons/crm/crm.py
14
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-today OpenERP SA (<http://www.openerp.com>) # # This program is free software: you can redistribute it and/or modify # it under the terms o...
RedHatQE/rhui-testing-tools
refs/heads/master
rhui-tests/test_rhui_tcms94923.py
1
#! /usr/bin/python -tt import nose from rhuilib.rhui_testcase import * from rhuilib.rhuimanager import * from rhuilib.rhuimanager_cds import * class test_tcms_94923(RHUITestcase): def _setup(self): '''[TCMS#94923 setup] Do initial rhui-manager run''' RHUIManager.initial_run(self.rs.Instances["RH...
aajanki/youtube-dl
refs/heads/master
youtube_dl/extractor/iconosquare.py
85
from __future__ import unicode_literals from .common import InfoExtractor from ..utils import int_or_none class IconosquareIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?(?:iconosquare\.com|statigr\.am)/p/(?P<id>[^/]+)' _TEST = { 'url': 'http://statigr.am/p/522207370455279102_24101272', ...
pbrook/mbed
refs/heads/master
workspace_tools/test_api.py
9
""" mbed SDK Copyright (c) 2011-2014 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...
vmanoria/bluemix-hue-filebrowser
refs/heads/master
hue-3.8.1-bluemix/desktop/core/ext-py/Django-1.6.10/tests/bug639/models.py
40
import os import tempfile from django.core.files.storage import FileSystemStorage from django.db import models from django.forms import ModelForm temp_storage_dir = tempfile.mkdtemp(dir=os.environ['DJANGO_TEST_TEMP_DIR']) temp_storage = FileSystemStorage(temp_storage_dir) class Photo(models.Model): title = mode...
evansd/django
refs/heads/master
django/contrib/gis/db/backends/oracle/base.py
135
from django.db.backends.oracle.base import ( DatabaseWrapper as OracleDatabaseWrapper, ) from .features import DatabaseFeatures from .introspection import OracleIntrospection from .operations import OracleOperations from .schema import OracleGISSchemaEditor class DatabaseWrapper(OracleDatabaseWrapper): Schem...
rfree2/cjdns
refs/heads/master
node_build/dependencies/libuv/build/gyp/test/actions-none/src/fake_cross.py
332
#!/usr/bin/python # Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import sys fh = open(sys.argv[-1], 'wb') for filename in sys.argv[1:-1]: fh.write(open(filename).read()) fh.close()
nashve/mythbox
refs/heads/master
resources/lib/twisted/twisted/protocols/amp.py
56
# -*- test-case-name: twisted.test.test_amp -*- # Copyright (c) 2005 Divmod, Inc. # Copyright (c) 2007-2010 Twisted Matrix Laboratories. # See LICENSE for details. """ This module implements AMP, the Asynchronous Messaging Protocol. AMP is a protocol for sending multiple asynchronous request/response pairs over the s...
xsynergy510x/android_external_chromium_org
refs/heads/cm-12.1
tools/telemetry/telemetry/core/local_server.py
26
# Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import collections import json import os import re import subprocess import sys from telemetry.core import forwarders from telemetry.core import util Named...
nikitasingh981/scikit-learn
refs/heads/master
doc/conf.py
22
# -*- coding: utf-8 -*- # # scikit-learn documentation build configuration file, created by # sphinx-quickstart on Fri Jan 8 09:13:42 2010. # # This file is execfile()d with the current directory set to its containing # dir. # # Note that not all possible configuration values are present in this # autogenerated file. ...
VigTech/Vigtech-Services
refs/heads/master
env/lib/python2.7/site-packages/django/contrib/auth/admin.py
83
from django.conf import settings from django.conf.urls import url from django.contrib import admin, messages from django.contrib.admin.options import IS_POPUP_VAR from django.contrib.admin.utils import unquote from django.contrib.auth import update_session_auth_hash from django.contrib.auth.forms import ( AdminPass...
AsherBond/MondocosmOS
refs/heads/master
opencollada/Externals/LibXML/python/tests/tstLastError.py
87
#!/usr/bin/python -u import sys, unittest import libxml2 class TestCase(unittest.TestCase): def runTest(self): self.test1() self.test2() def setUp(self): libxml2.debugMemory(1) def tearDown(self): libxml2.cleanupParser() if libxml2.debugMemory(1) != 0: ...
scottdangelo/cinderclient-api-microversions
refs/heads/cinderclient-api-microversions
cinderclient/v2/shell.py
2
# Copyright (c) 2013-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 required by ...
nghiant2710/resin-sdk-python
refs/heads/master
setup.py
1
"""A setuptools based setup module. See: https://packaging.python.org/en/latest/distributing.html https://github.com/pypa/sampleproject """ # Always prefer setuptools over distutils from setuptools import setup, find_packages import os import re def get_version(package): """ Return package version as listed...
degs098/python-social-auth
refs/heads/master
examples/django_example/example/app/views.py
111
import json from django.conf import settings from django.http import HttpResponse, HttpResponseBadRequest from django.shortcuts import redirect from django.contrib.auth.decorators import login_required from django.contrib.auth import logout as auth_logout, login from social.backends.oauth import BaseOAuth1, BaseOAuth...
ddd332/presto
refs/heads/master
presto-docs/target/sphinx/docutils/parsers/rst/tableparser.py
112
# $Id: tableparser.py 7320 2012-01-19 22:33:02Z milde $ # Author: David Goodger <goodger@python.org> # Copyright: This module has been placed in the public domain. """ This module defines table parser classes,which parse plaintext-graphic tables and produce a well-formed data structure suitable for building a CALS tab...
Rockvole/indoor-air-quality-dashboard
refs/heads/master
awair/request_readings.py
1
import os import sys sys.path.append(os.path.abspath("../foobot/")) import foobot_tools import dashboard_tools import commandline_tools from datetime import datetime, timedelta import pytz import awair_tools C_MAX_DAYS = 10 (start_timestamp, end_timestamp) = commandline_tools.parse_args(sys.argv) print("start_timest...
ecosoft-odoo/odoo
refs/heads/8.0
addons/hr_timesheet_invoice/wizard/hr_timesheet_analytic_profit.py
337
# -*- 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...
Distrotech/intellij-community
refs/heads/master
python/testData/refactoring/move/importFirstWithSlash/after/src/file1.py
79
__author__ = 'catherine' def function_2(): pass
jordanemedlock/psychtruths
refs/heads/master
temboo/core/Library/SunlightLabs/Congress/Legislator/Search.py
4
# -*- coding: utf-8 -*- ############################################################################### # # Search # Returns current committees, subcommittees, and their membership. # # Python versions 2.6, 2.7, 3.x # # Copyright 2014, Temboo Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # y...
teppchan/tkintertips
refs/heads/master
py/event/mouse_single1.py
1
#!/usr/bin/env python import Tkinter as Tk root=Tk.Tk() l=Tk.Label(root, width=10, height=2, text="Hello!!", ) def print_click(event): print("Clicked\n") l.bind("<Button-1>", print_click) l.pack() root.mainloop()
MayOneUS/pledgeservice
refs/heads/master
lib/mailchimp/requests/packages/chardet/latin1prober.py
950
######################## 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...
andreif/django
refs/heads/master
tests/many_to_one/models.py
215
""" Many-to-one relationships To define a many-to-one relationship, use ``ForeignKey()``. """ from __future__ import unicode_literals from django.db import models from django.utils.encoding import python_2_unicode_compatible @python_2_unicode_compatible class Reporter(models.Model): first_name = models.CharFiel...
dendyyangky/sgeede_b2b
refs/heads/master
sgeede_internal_transfer/__openerp__.py
2
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved # $Id$ # # This program is free software: you can redistribute it and/or modify #...
titasakgm/brc-stock
refs/heads/master
openerp/addons/account/wizard/account_report_aged_partner_balance.py
48
# -*- 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...
zielmicha/satori
refs/heads/master
satori.web/satori/web/views/download.py
1
# vim:ts=4:sts=4:sw=4:expandtab from django.conf import settings from satori.client.common import want_import want_import(globals(), '*') from satori.web.utils.decorators import general_view from django.http import HttpResponse from mimetypes import guess_type def blob_generator(blob): length = blob.length cou...
bbc/kamaelia
refs/heads/master
Sketches/CL/Topology3D/Utils/TopologyViewer3D.py
3
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright 2010 British Broadcasting Corporation and Kamaelia Contributors(1) # # (1) Kamaelia Contributors are listed in the AUTHORS file and at # http://www.kamaelia.org/AUTHORS - please extend this file, # not this notice. # # Licensed under the Apache License,...
thedrow/streamparse
refs/heads/master
examples/wordcount/multilang/resources/word_count.py
1
from collections import defaultdict from pystorm.bolt import BasicBolt class WordCountBolt(BasicBolt): word_count = defaultdict(int) def process(self, tup): for word in tup.values: self.word_count[word] += 1 BasicBolt.emit([word, self.word_count[word]]) if __name__ == '__m...
angea/corkami
refs/heads/master
wip/MakePE/examples/packer/virtualizer.py
1
# Minimalist virtualizer # handles only PUSH (68/6A) and CALL (E8) # no code analysis, dirty vm module. import pefile, mypacklib pe, oep, ib, start, size = mypacklib.load() # virtualizes the original code # (needs to parse the hex, transform the underneath assembly, and rewrite it) opcodes = ["PUSH", "CALL...
bnbowman/HlaTools
refs/heads/master
src/pbhla/sequences/input.py
1
#! /usr/bin/env python from pbhla.filenames import is_fasta, is_fastq __author__ = 'Brett Bowman' __email__ = 'bbowman@pacificbiosciences.com' import os import logging from pbcore.io import FastqReader, FastqWriter from pbhla.utils import valid_file log = logging.getLogger() def get_input_file( input ): if os...
Kami/logshipper
refs/heads/master
logshipper/pyinotify_eventlet_notifier.py
2
# Copyright 2014 Koert van der Veer # Adapted from pyeventlet, which is MIT licensed # # 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.a...
dimazalfrianz/namebench
refs/heads/master
nb_third_party/dns/rdtypes/dsbase.py
248
# Copyright (C) 2010 Nominum, Inc. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose with or without fee is hereby granted, # provided that the above copyright notice and this permission notice # appear in all copies. # # THE SOFTWARE IS PROVIDED "AS IS" AND NOMIN...
PetePriority/home-assistant
refs/heads/dev
homeassistant/components/cover/aladdin_connect.py
8
""" Platform for the Aladdin Connect cover component. For more details about this platform, please refer to the documentation https://home-assistant.io/components/cover.aladdin_connect/ """ import logging import voluptuous as vol from homeassistant.components.cover import (CoverDevice, PLATFORM_SCHEMA, ...
tdtrask/ansible
refs/heads/devel
test/units/modules/network/dellos6/dellos6_module.py
62
# (c) 2016 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 option) any later version. # # Ansible is dis...
Fablabsitges/BeachLab_flip_flap
refs/heads/master
V1/software/attiny version/code/python/ff.py
3
#!/usr/bin/python # Filename: ff.py version = '1.0' # SPLIT-FLAP DISPLAY CONTROL LANGUAGE # Created by Francisco in Fab lab Sitges # May 2014 # Released under MIT license http://opensource.org/licenses/MIT import serial import time import os import sys import pyttsx # # init the TTS engine # engine = pyttsx.init()...
songmonit/CTTMSONLINE_V8
refs/heads/master
addons/base_report_designer/base_report_designer.py
314
# -*- 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...
Acidburn0zzz/servo
refs/heads/master
tests/wpt/web-platform-tests/tools/third_party/h2/setup.py
24
#!/usr/bin/env python # -*- coding: utf-8 -*- import codecs import os import re import sys try: from setuptools import setup except ImportError: from distutils.core import setup # Get the version version_regex = r'__version__ = ["\']([^"\']*)["\']' with open('h2/__init__.py', 'r') as f: text = f.read() ...
joaquins/Gooey
refs/heads/master
gooey/__init__.py
1
import os from gooey.python_bindings.gooey_decorator import Gooey from gooey.python_bindings.gooey_parser import GooeyParser # from gooey.gui import application version_file = os.path.join(os.path.dirname(__file__), 'version') __version__ = '0.8.12.0'
chrrrles/ansible-modules-extras
refs/heads/devel
cloud/vmware/vca_nat.py
10
#!/usr/bin/python # Copyright (c) 2015 VMware, Inc. All Rights Reserved. # # 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 ...
gsathya/slyer
refs/heads/master
slyer.py
1
#!/usr/bin/env python import sys import getopt import os import util def usage(): print "Options" print "-i --index create an index page" print "-p --publish render posts" print "-c --clean clear headers from drafts" print "-s --sync check if files are in sync" print "-h --help ...
glwu/python-for-android
refs/heads/master
python3-alpha/python3-src/Doc/includes/sqlite3/converter_point.py
45
import sqlite3 class Point: def __init__(self, x, y): self.x, self.y = x, y def __repr__(self): return "(%f;%f)" % (self.x, self.y) def adapt_point(point): return "%f;%f" % (point.x, point.y) def convert_point(s): x, y = list(map(float, s.split(";"))) return Point(x, y) # Regist...
DarkEnergySurvey/ugali
refs/heads/master
tests/test_install.py
2
#!/usr/bin/env python """ Test the installation process. """ import os from os.path import basename, dirname import subprocess import tempfile # ADW: Is there any reason to do this in CI? __test__ = False # Not all that robust... try: GITBASE = basename(dirname(subprocess.check_output('git config --get remote.ori...
Russell-IO/ansible
refs/heads/devel
lib/ansible/modules/network/cloudengine/ce_switchport.py
43
#!/usr/bin/python # # 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 later version. # # Ansible is distribut...
dreispt/geospatial
refs/heads/8.0
base_geoengine/tests/test_geoengine.py
3
# -*- coding: utf-8 -*- # # # Authors: Laurent Mignon # Copyright (c) 2015 Acsone SA/NV (http://www.acsone.eu) # # 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 vers...
dahlstrom-g/intellij-community
refs/heads/master
python/testData/inspections/PyAsyncCallInspection/ScheduleTask37/a.py
14
import asyncio async def nested(): print("42") async def main(): # Schedule nested() to run soon concurrently with "main()". asyncio.create_task(nested()) await asyncio.sleep(3) asyncio.run(main())
GoogleCloudPlatform/cloud-run-samples
refs/heads/main
istio-authorization/id_token_request.py
1
#!/usr/bin/env python3 # # Copyright 2020 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 o...
akosyakov/intellij-community
refs/heads/master
python/testData/psi/TupleAsDictKey.py
83
{}[1,2,3]
MeSayan/code
refs/heads/master
python/matched.py
1
def matched(s): topofstack = -1 for c in s: if c == "(": topofstack = topofstack + 1 elif c == ")": if topofstack >= 0: topofstack = topofstack - 1 else : return(False) if topofstack == -1: return(True) return(F...
markYoungH/chromium.src
refs/heads/nw12
chrome/common/extensions/docs/server2/local_file_system.py
79
# 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 os import sys from docs_server_utils import StringIdentity from file_system import FileSystem, FileNotFoundError, StatInfo from future import Fut...
air01a/pimusic
refs/heads/master
PlaylistManager/PlaylistManager.py
1
import os import random class PlaylistManager: def __init__(self): self._playList = [] self._playingIndex = -1 self._repeat = True def randomizePlayList(self): track=[self._playList[self._playingIndex]] del self._playList[self._playingIndex] random.shuffl...
scality/manila
refs/heads/master
manila/tests/db/sqlalchemy/test_api.py
1
# Copyright 2013 OpenStack Foundation # Copyright (c) 2014 NetApp, Inc. # Copyright (c) 2015 Rushil Chugh # 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 # # ...
QuickSander/CouchPotatoServer
refs/heads/master
libs/caper/parsers/anime.py
81
# Copyright 2013 Dean Gardiner <gardiner91@gmail.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 applicable law or a...
ATNF/askapsdp
refs/heads/master
Code/Doc/admin/current/build.py
2
from askapdev.rbuild.builders import Setuptools as Builder def dummy(): pass builder = Builder(".") builder._install = dummy builder.build()
agry/NGECore2
refs/heads/master
scripts/object/draft_schematic/bio_engineer/creature/creature_boar_wolf.py
85615
import sys def setup(core, object): return
h2oai/sparkling-water
refs/heads/master
kubernetes/src/python/initTest.py
1
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
wanglei828/apollo
refs/heads/master
modules/tools/plot_planning/plot_speed_steering.py
1
import sys import matplotlib.pyplot as plt from cyber_py.record import RecordReader from modules.canbus.proto import chassis_pb2 def process(reader): last_steering_percentage = None last_speed_mps = None last_timestamp_sec = None speed_data = [] d_steering_data = [] for msg in reader.read_mess...
msegado/edx-platform
refs/heads/master
lms/djangoapps/verify_student/migrations/0002_auto_20151124_1024.py
83
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('verify_student', '0001_initial'), ] operations = [ migrations.AddField( model_name='historicalverificationdeadli...
becdot/adventures-in-text
refs/heads/master
scaffolding.py
1
# ROOM AND PARENT OBJECT CLASSES # Rooms inherit from the Room class # -- note: room exits must be set after rooms are created, since they contain references to each other # # All objects inherit from this parent Object class # It defines basic functionality (e.g. 'look' common to all objects) and attributes requir...
clbarnes/hiveplotter
refs/heads/master
hiveplotter/util/config_utils.py
1
from configparser import ConfigParser import json import os import logging import sys from io import StringIO logger = logging.getLogger() CONF_PATH = os.path.abspath(os.path.join(__file__, '..', '..', 'hiveplotter_defaults.ini')) logger.debug('Config path: {}'.format(CONF_PATH)) class Defaults: def __init__(se...
biggihs/python-pptx
refs/heads/master
tests/unitutil/mock.py
5
# encoding: utf-8 """ Utility functions wrapping the excellent *mock* library. """ from __future__ import absolute_import, print_function import sys if sys.version_info >= (3, 3): from unittest import mock # noqa from unittest.mock import ANY, call, MagicMock # noqa from unittest.mock import ( ...
xydinesh/youtube-dl
refs/heads/master
youtube_dl/extractor/rutv.py
106
# encoding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( ExtractorError, int_or_none ) class RUTVIE(InfoExtractor): IE_DESC = 'RUTV.RU' _VALID_URL = r'''(?x) https?://player\.(?:rutv\.ru|vgtrk\.com)/ (?P<path>flas...
aachik/flask-blog-abdulmx
refs/heads/master
env/lib/python2.7/site-packages/jinja2/testsuite/inheritance.py
414
# -*- coding: utf-8 -*- """ jinja2.testsuite.inheritance ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Tests the template inheritance feature. :copyright: (c) 2010 by the Jinja Team. :license: BSD, see LICENSE for more details. """ import unittest from jinja2.testsuite import JinjaTestCase from jinja2 import Env...
weigj/django-multidb
refs/heads/master
django/contrib/comments/__init__.py
5
from django.conf import settings from django.core import urlresolvers from django.core.exceptions import ImproperlyConfigured # Attributes required in the top-level app for COMMENTS_APP REQUIRED_COMMENTS_APP_ATTRIBUTES = ["get_model", "get_form", "get_form_target"] def get_comment_app(): """ Get the comment a...
daniel-ortiz/autopin-plus
refs/heads/master
vendor/mosquitto-1.3.5/test/broker/01-connect-invalid-id-0-311.py
18
#!/usr/bin/env python # Test whether a CONNECT with a zero length client id results in the correct CONNACK packet. import subprocess import socket import time import inspect, os, sys # From http://stackoverflow.com/questions/279237/python-import-a-module-from-a-folder cmd_subfolder = os.path.realpath(os.path.abspath...
opticron/ML256-Door-Auth
refs/heads/master
src/nfc_poller_mock.py
1
class nfc_poller: def __init__(self): self._address = 0x24 def create_json_response(self, reader_id, card_uid, status): json = """{"reader_id":"<reader_id>","card_uid":"<card_uid>","status":"<status>"}""" json = json.replace("<reader_id>", str(reader_id)) json = json.replace("<...
alexandrebarachant/mne-python
refs/heads/master
mne/gui/_help.py
11
# Author: Christian Brodbeck <christianbrodbeck@nyu.edu> # # License: BSD (3-clause) import json import os from textwrap import TextWrapper def read_tooltips(gui_name): "Read and format tooltips, return a dict" dirname = os.path.dirname(__file__) help_path = os.path.join(dirname, 'help', gui_name + '.json...
sdague/home-assistant
refs/heads/dev
homeassistant/components/blebox/config_flow.py
19
"""Config flow for BleBox devices integration.""" import logging from blebox_uniapi.error import Error, UnsupportedBoxVersion from blebox_uniapi.products import Products from blebox_uniapi.session import ApiHost import voluptuous as vol from homeassistant import config_entries from homeassistant.const import CONF_HOS...
hokein/atom-shell
refs/heads/master
tools/mac/apply_locales.py
202
#!/usr/bin/env python # Copyright (c) 2009 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. # TODO: remove this script when GYP has for loops import sys import optparse def main(argv): parser = optparse.OptionParser() ...
klnusbaum/UDJ-Server
refs/heads/master
udjserver/udj/migrations/0084_auto__add_field_sortingalgorithm_uses_duration.py
1
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'SortingAlgorithm.uses_duration' db.add_column('udj_sortingalgorithm', 'uses_duration', ...
transientlunatic/otter
refs/heads/master
otter/html.py
1
import matplotlib, numpy from . import plot import markdown import tabulate md_extensions = [ 'markdown.extensions.tables', 'markdown.extensions.extra' ] class HTMLElement(object): tag = None childtag = None def __init__(self, content=None, **kwargs): self.content = [] self.m...
MichaelCoughlinAN/Odds-N-Ends
refs/heads/master
Python/test_reg_match.py
1
import re regex = re.compile('app-(.*)-standalone.jar') l = ['app-4.1.118-standalone.jar', 'app-4.1.119-standalone.jar', 'just', 'a', 'test'] matches = [string for string in l if re.search(regex, string)] if len(matches) > 0: print 'There are matches' else: print 'There are no'
Eficent/sale-workflow
refs/heads/8.0
sale_owner_stock_sourcing/model/sale_order.py
37
# -*- coding: utf-8 -*- # # # Author: Yannick Vaucher # Copyright 2014-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 # Lic...
ovnicraft/openerp-restaurant
refs/heads/master
crm_partner_assign/__init__.py
364
# -*- 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...
harnash/sparrow
refs/heads/master
apps/testrunner/test_suites/selenium_tests/selenium_timer.py
2
# -*- coding: utf-8 -*- from __future__ import unicode_literals import logging logger = logging.getLogger(__name__) class SeleniumTimer(object): def __init__(self, driver): self.__driver = driver self.__measurements = [] self.__start_timestamp = None self.__total_load_time = None...
sktjdgns1189/android_kernel_samsung_c1skt
refs/heads/cm-12.1
tools/perf/scripts/python/syscall-counts-by-pid.py
11180
# 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 system call totals, broken down by syscall. # If a [comm] arg is specified, only syscalls called by [comm] are displayed. import os, sys sys.path.append(os.env...