repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
⌀
bigswitch/neutron
refs/heads/master
neutron/objects/qos/rule.py
1
# Copyright 2015 Huawei Technologies India Pvt Ltd, 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...
chenc10/Spark-PAF
refs/heads/master
ec2/lib/boto-2.34.0/boto/file/bucket.py
153
# Copyright 2010 Google Inc. # Copyright (c) 2011, Nexenta Systems Inc. # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use...
open2bizz/odoo-addons
refs/heads/12.0
project_view_with_messaging/models/__init__.py
1
from . import project
interline/xhtml2pdf
refs/heads/master
test/helloworld.py
154
# -*- coding: utf-8 -*- # Copyright 2010 Dirk Holtwick, holtwick.it # # 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 ...
pimier15/PyGUI
refs/heads/master
Kivy/Kivy/Bk_Interractive/My/C4/style_decorating/gestures.py
19
# Code 4.6 line45_str = 'eNq1VktuI0cM3fdFrM0I/LN4AWUbwAcI/BFsYwa2IGmSmduHxZa77bGTziKtjQ3W42MXH4vk5unr058/tw/70/n7cT/8dvl7gGFzf8Dh+up0Pr583Z+uhgMNm28HHjafelwXbDhI99P0O7w8PZ+7m3U3/we33ztqOLTuFen1Mx0Qht0X2KowMIZ7C2zkbThdX/3ox1jHEtpUHN3JAE2G0+3Nv8ZAqivx8PAaAEJcgiEQwzADPLxyc2vgzt4MSMR4mbzujTqRC6tJCLmqkTrJzM7WmD04CEjJVJfZrdh...
opengeogroep/inasafe
refs/heads/master
third_party/raven/utils/urlparse.py
30
from __future__ import absolute_import import urlparse as _urlparse def register_scheme(scheme): for method in filter(lambda s: s.startswith('uses_'), dir(_urlparse)): uses = getattr(_urlparse, method) if scheme not in uses: uses.append(scheme) urlparse = _urlparse.urlparse
JamesMGreene/phantomjs
refs/heads/master
src/qt/qtwebkit/Tools/Scripts/webkitpy/tool/commands/analyzechangelog.py
122
# Copyright (c) 2011 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 conditions and the ...
eemirtekin/edx-platform
refs/heads/master
lms/djangoapps/courseware/field_overrides.py
13
""" This module provides a :class:`~xblock.field_data.FieldData` implementation which wraps an other `FieldData` object and provides overrides based on the user. The use of providers allows for overrides that are arbitrarily extensible. One provider is found in `courseware.student_field_overrides` which allows for fi...
thaumos/ansible
refs/heads/devel
test/integration/targets/pause/test-pause.py
72
#!/usr/bin/env python import os import pexpect import sys import termios from ansible.module_utils.six import PY2 args = sys.argv[1:] env_vars = { 'ANSIBLE_ROLES_PATH': './roles', 'ANSIBLE_NOCOLOR': 'True', 'ANSIBLE_RETRY_FILES_ENABLED': 'False' } try: backspace = termios.tcgetattr(sys.stdin.fileno...
skyoo/jumpserver
refs/heads/master
apps/orgs/lock.py
1
from uuid import uuid4 from functools import wraps from django.core.cache import cache from django.db.transaction import atomic from rest_framework.request import Request from rest_framework.exceptions import NotAuthenticated from orgs.utils import current_org from common.exceptions import SomeoneIsDoingThis, Timeout...
ianw/pip
refs/heads/develop
pip/locations.py
117
"""Locations where we look for configs, install stuff, etc""" from __future__ import absolute_import import getpass import os import os.path import site import sys import tempfile from distutils import sysconfig from distutils.command.install import install, SCHEME_KEYS from pip.compat import get_path_uid, WINDOWS f...
msabramo/ansible
refs/heads/devel
lib/ansible/modules/remote_management/ipmi/ipmi_power.py
69
#!/usr/bin/python # -*- coding: utf-8 -*- # # 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. ...
veger/ansible
refs/heads/devel
lib/ansible/modules/packaging/os/pkg5_publisher.py
102
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright 2014 Peter Oliver <ansible@mavit.org.uk> # # 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': ...
Peter92/MouseTrack
refs/heads/master
mousetracks/utils/os/mac/appkit/__init__.py
1
"""This is part of the Mouse Tracks Python application. Source: https://github.com/Peter92/MouseTracks """ #Mac functions that require AppKit #Thanks to /u/zlft for helping, still needs a lot of work from __future__ import absolute_import from AppKit import NSScreen from AppKit import NSEvent def get_resolution(): ...
robjohnson189/home-assistant
refs/heads/dev
homeassistant/components/device_tracker/tplink.py
13
""" Support for TP-Link routers. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/device_tracker.tplink/ """ import base64 import hashlib import logging import re import threading from datetime import timedelta import requests import voluptuous as vol im...
slozier/ironpython2
refs/heads/master
Tests/compat/sbs_exceptions/try_finally3.py
2
# Licensed to the .NET Foundation under one or more agreements. # The .NET Foundation licenses this file to you under the Apache 2.0 License. # See the LICENSE file in the project root for more information. from common import runtests from .shared import try_finally_maker3 from .shared import setGenerator, test_excep...
NoelMacwan/SXDNickiUnified
refs/heads/master
scripts/build-all.py
1182
#! /usr/bin/env python # Copyright (c) 2009-2011, The Linux Foundation. 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 # ...
huxh10/iSDX
refs/heads/master
plot/plot-simple.py
1
#! /usr/bin/python import sys import matplotlib.pyplot as plt if len(sys.argv) == 1: print "please input latency files: ./plot.py [file1] [label1] [file2] [label2] .." exit(0) data = [] labels = [] for i in range(1, len(sys.argv)): if i % 2 != 0: with open(sys.argv[i], 'r') as f: dat...
xu-cheng/youtube-dl
refs/heads/master
youtube_dl/downloader/__init__.py
4
from __future__ import unicode_literals from .common import FileDownloader from .hls import HlsFD from .hls import NativeHlsFD from .http import HttpFD from .mplayer import MplayerFD from .rtmp import RtmpFD from .f4m import F4mFD from ..utils import ( determine_ext, ) def get_suitable_downloader(info_dict): ...
JorgeCoock/django
refs/heads/master
django/contrib/staticfiles/apps.py
473
from django.apps import AppConfig from django.utils.translation import ugettext_lazy as _ class StaticFilesConfig(AppConfig): name = 'django.contrib.staticfiles' verbose_name = _("Static Files")
LiJingkang/PyQt5
refs/heads/master
Learn/高级特性/PyQt5_组件_切换按钮.py
1
# 切换按钮是QPushButton的特殊模式 # 切换按钮有两种状态:按下和没有按下。我们可以通过点击它在两种状态之间切换。 import sys from PyQt5.QtWidgets import (QWidget, QPushButton, QFrame, QApplication) from PyQt5.QtGui import QColor class Example(QWidget): # 一个QWidget组件 def __init__(self): super().__init__() self.initUI(...
saurabh6790/medsyn-app1
refs/heads/master
patches/september_2012/all_permissions_patch.py
30
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import webnotes def execute(): web_cache_perms() stock_perms() project_perms() account_perms() def web_cache_perms(): webnotes.conn.sql("""upd...
woiddei/pattern
refs/heads/master
pattern/text/xx/__init__.py
21
#### PATTERN | XX ################################################################################## # -*- coding: utf-8 -*- # Copyright (c) year, institute, country # Author: Name (e-mail) # License: BSD (see LICENSE.txt for details). # http://www.clips.ua.ac.be/pages/pattern #########################################...
jjmiranda/edx-platform
refs/heads/master
common/lib/xmodule/xmodule/modulestore/split_mongo/caching_descriptor_system.py
21
import sys import logging from contracts import contract, new_contract from fs.osfs import OSFS from lazy import lazy from xblock.runtime import KvsFieldData, KeyValueStore from xblock.fields import ScopeIds from xblock.core import XBlock from opaque_keys.edx.locator import BlockUsageLocator, LocalId, CourseLocator, L...
michaelBenin/sqlalchemy
refs/heads/master
lib/sqlalchemy/testing/schema.py
76
# testing/schema.py # Copyright (C) 2005-2014 the SQLAlchemy authors and contributors <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php from . import exclusions from .. import schema, event from . import config __all__ ...
adelina-t/compute-hyperv
refs/heads/master
hyperv/nova/hostutils.py
1
# Copyright 2013 Cloudbase Solutions Srl # 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 r...
iivic/BoiseStateX
refs/heads/master
lms/djangoapps/instructor_task/tests/test_api.py
6
""" Test for LMS instructor background task queue management """ from mock import patch, Mock from bulk_email.models import CourseEmail, SEND_TO_ALL from courseware.tests.factories import UserFactory from xmodule.modulestore.exceptions import ItemNotFoundError from instructor_task.api import ( get_running_instruct...
laurent-george/weboob
refs/heads/master
modules/feedly/google.py
1
# -*- coding: utf-8 -*- # Copyright(C) 2014 Bezleputh # # This file is part of weboob. # # weboob 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 opt...
badp/ganeti
refs/heads/master
lib/http/server.py
2
# # # Copyright (C) 2007, 2008, 2010, 2012 Google Inc. # # 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. # # This progr...
jeeftor/alfredToday
refs/heads/master
src/lib/pyasn1/type/useful.py
172
# ASN.1 "useful" types from pyasn1.type import char, tag class ObjectDescriptor(char.GraphicString): tagSet = char.GraphicString.tagSet.tagImplicitly( tag.Tag(tag.tagClassUniversal, tag.tagFormatSimple, 7) ) class GeneralizedTime(char.VisibleString): tagSet = char.VisibleString.tagSet.tagImpli...
dorotan/pythontraining
refs/heads/master
env/Lib/encodings/iso2022_jp_3.py
816
# # iso2022_jp_3.py: Python Unicode Codec for ISO2022_JP_3 # # Written by Hye-Shik Chang <perky@FreeBSD.org> # import _codecs_iso2022, codecs import _multibytecodec as mbc codec = _codecs_iso2022.getcodec('iso2022_jp_3') class Codec(codecs.Codec): encode = codec.encode decode = codec.decode class Incrementa...
terryoy/django-skeleton
refs/heads/master
app/app/local_settings.py
1
from .settings import * # change to the place where you put your static files (e.g. where "/srv/www/django-skeleton/" is web root) STATIC_ROOT = "/srv/www/django-skeleton/static" # an upload folder where you upload files to (can use symbolic link to set under app folder) MEDIA_ROOT = os.path.join(BASE_DIR, "upload")
mkacik/bcc
refs/heads/master
tools/ext4dist.py
2
#!/usr/bin/python # @lint-avoid-python-3-compatibility-imports # # ext4dist Summarize ext4 operation latency. # For Linux, uses BCC, eBPF. # # USAGE: ext4dist [-h] [-T] [-m] [-p PID] [interval] [count] # # Copyright 2016 Netflix, Inc. # Licensed under the Apache License, Version 2.0 (the "License") # # 12-Fe...
cainiaocome/scikit-learn
refs/heads/master
examples/ensemble/plot_ensemble_oob.py
259
""" ============================= OOB Errors for Random Forests ============================= The ``RandomForestClassifier`` is trained using *bootstrap aggregation*, where each new tree is fit from a bootstrap sample of the training observations :math:`z_i = (x_i, y_i)`. The *out-of-bag* (OOB) error is the average er...
bjesus/wagtail
refs/heads/master
wagtail/wagtailcore/management/commands/move_pages.py
26
from django.core.management.base import BaseCommand from wagtail.wagtailcore.models import Page class Command(BaseCommand): args = "<from id> <to id>" def handle(self, _from_id, _to_id, **options): # Convert args to integers from_id = int(_from_id) to_id = int(_to_id) # Get ...
ludia/moto
refs/heads/master
tests/test_cloudformation/fixtures/route53_roundrobin.py
21
from __future__ import unicode_literals template = { "AWSTemplateFormatVersion" : "2010-09-09", "Description" : "AWS CloudFormation Sample Template Route53_RoundRobin: Sample template showing how to use weighted round robin (WRR) DNS entried via Amazon Route 53. This contrived sample uses weighted CNAME records t...
mlcommons/inference
refs/heads/master
compliance/audit_v0.5/nvidia/TEST03/modify_image_data.py
1
#! /usr/bin/env python3 import os import sys sys.path.append(os.getcwd()) import argparse import numpy as np import shutil #from common import logging #from PIL import Image import cv2 import math def modify_imagenet(data_dir, custom_data_dir): #logging.info("Modifying imagenet...") print("Moidfying imagen...
Azure/azure-sdk-for-python
refs/heads/sync-eng/common-js-nightly-docs-2-1768-ForTestPipeline
sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_network_profiles_operations.py
1
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ...
fnkr/POSS
refs/heads/master
tests/PossTest.py
1
import unittest import uuid from app.auth.models import User class PossTest(unittest.TestCase): def setUp(self): from app import app app.config.update( SERVER_NAME='localhost:%s' % app.config.get('PORT') ) self.app = app.test_client() from app import db ...
Donkyhotay/MoonPy
refs/heads/master
zope/app/renderer/interfaces.py
1
############################################################################## # # Copyright (c) 2003 Zope Corporation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # THIS SO...
IndonesiaX/edx-platform
refs/heads/master
lms/djangoapps/commerce/api/v1/tests/test_models.py
127
""" Tests for models. """ import ddt from django.test import TestCase from commerce.api.v1.models import Course from course_modes.models import CourseMode @ddt.ddt class CourseTests(TestCase): """ Tests for Course model. """ def setUp(self): super(CourseTests, self).setUp() self.course = Cour...
Dhivyap/ansible
refs/heads/devel
lib/ansible/modules/system/hostname.py
5
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2013, Hiroaki Nakamura <hnakamur@gmail.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_versi...
0Chencc/CTFCrackTools
refs/heads/master
Lib/test/test_readline.py
60
""" Very minimal unittests for parts of the readline module. These tests were added to check that the libedit emulation on OSX and the "real" readline have the same interface for history manipulation. That's why the tests cover only a small subset of the interface. """ import unittest from test.test_support import run...
kenshay/ImageScripter
refs/heads/master
ProgramData/SystemFiles/Python/Lib/site-packages/pytank/Core/sadfas.py
2
from elan import * HlConfig.cautionreset.Wait()
yk5/beam
refs/heads/master
sdks/python/apache_beam/internal/util.py
9
# # 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...
pstirparo/artifacts
refs/heads/master
tests/registry_test.py
1
# -*- coding: utf-8 -*- """Tests for the artifact definitions registry.""" import io import unittest from artifacts import errors from artifacts import reader from artifacts import registry from artifacts import source_type from tests import test_lib class TestSourceType(source_type.SourceType): """Class that im...
lcharleux/abapy
refs/heads/master
doc/sphinxext/apigen.py
59
"""Attempt to generate templates for module reference with Sphinx XXX - we exclude extension modules To include extension modules, first identify them as valid in the ``_uri2path`` method, then handle them in the ``_parse_module`` script. We get functions and classes by parsing the text of .py files. Alternatively w...
pepetreshere/odoo
refs/heads/patch-2
odoo/addons/test_action_bindings/tests/__init__.py
13
from . import test_bindings
gurneyalex/partner-contact
refs/heads/8.0
base_partner_sequence/tests/test_base_partner_sequence.py
10
# -*- coding: utf-8 -*- # © 2015 ACSONE SA/NV (<http://acsone.eu>). # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). import openerp.tests.common as common class TestBasePartnerSequence(common.TransactionCase): def test_ref_sequence_on_partner(self): res_partner = self.env['res.partne...
takeshineshiro/django
refs/heads/master
tests/template_tests/filter_tests/test_rjust.py
521
from django.template.defaultfilters import rjust from django.test import SimpleTestCase from django.utils.safestring import mark_safe from ..utils import setup class RjustTests(SimpleTestCase): @setup({'rjust01': '{% autoescape off %}.{{ a|rjust:"5" }}. .{{ b|rjust:"5" }}.{% endautoescape %}'}) def test_rju...
dhalperi/beam
refs/heads/master
sdks/python/apache_beam/runners/worker/data_plane_test.py
2
# # 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...
janssen/kivy
refs/heads/master
kivy/factory_registers.py
15
# Auto-generated file by setup.py build_factory from kivy.factory import Factory r = Factory.register r('Adapter', module='kivy.adapters.adapter') r('ListAdapter', module='kivy.adapters.listadapter') r('SimpleListAdapter', module='kivy.adapters.simplelistadapter') r('DictAdapter', module='kivy.adapters.dictadapter') ...
MyAOSP/kernel_htc_msm8960
refs/heads/jb-4.2
scripts/gcc-wrapper.py
473
#! /usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2011-2012, The Linux Foundation. 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 th...
AsimmHirani/ISpyPi
refs/heads/master
tensorflow/contrib/tensorflow-master/tensorflow/python/ops/cloud/bigquery_reader_ops_test.py
12
# 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...
onestarshang/flask_super_config
refs/heads/master
venv/lib/python2.7/site-packages/werkzeug/wsgi.py
147
# -*- coding: utf-8 -*- """ werkzeug.wsgi ~~~~~~~~~~~~~ This module implements WSGI related helpers. :copyright: (c) 2014 by the Werkzeug Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ import re import os import sys import posixpath import mimetypes from itert...
freedesktop-unofficial-mirror/pycairo
refs/heads/master
examples/cairo_snippets/snippets/curve_to.py
15
x, y = 0.1, 0.5 x1, y1 = 0.4, 0.9 x2, y2 = 0.6, 0.1 x3, y3 = 0.9, 0.5 snippet_normalize (cr, width, height) cr.move_to (x, y) cr.curve_to (x1, y1, x2, y2, x3, y3) cr.stroke () cr.set_source_rgba (1,0.2,0.2,0.6) cr.set_line_width (0.03) cr.move_to (x,y); cr.line_to (x1,y1) cr.move_to (x2,y2); cr.line_to (x3,y3) ...
rspavel/spack
refs/heads/develop
var/spack/repos/builtin/packages/sph2pipe/package.py
5
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class Sph2pipe(CMakePackage): """Sph2pipe is a portable tool for converting SPHERE files to ...
nvoron23/scikit-learn
refs/heads/master
sklearn/metrics/tests/test_pairwise.py
71
import numpy as np from numpy import linalg from scipy.sparse import dok_matrix, csr_matrix, issparse from scipy.spatial.distance import cosine, cityblock, minkowski, wminkowski from sklearn.utils.testing import assert_greater from sklearn.utils.testing import assert_array_almost_equal from sklearn.utils.testing impo...
JayvicWen/Crawler
refs/heads/master
jianlimoban/jianlimoban/items.py
2
# -*- coding: utf-8 -*- # Define here the models for your scraped items # # See documentation in: # http://doc.scrapy.org/en/latest/topics/items.html import scrapy class JianlimobanItem(scrapy.Item): # define the fields for your item here like: name = scrapy.Field() url = scrapy.Field() page = scrap...
sparkslabs/kamaelia
refs/heads/master
Code/Python/Kamaelia/Examples/SimpleGraphicalApps/TextBox/ConsoleReader_TextDisplayer_Demo.py
6
#!/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...
ryanpdwyer/jittermodel
refs/heads/master
jittermodel/tests/test_plot.py
1
# -*- coding: utf-8 -*- import numpy as np import matplotlib # Force matplotlib to not use any Xwindows backend. # See http://stackoverflow.com/a/3054314 matplotlib.use('Agg') from nose.tools import eq_ import unittest from jittermodel import u, silentremove from jittermodel.base import Cantilever, Transistor, Exper...
rbarlow/pulp
refs/heads/master
server/test/unit/server/db/migration_packages/raise_exception/0002_oh_no.py
17
def migrate(): raise Exception("Bet you didn't see this coming.")
steebchen/youtube-dl
refs/heads/master
youtube_dl/extractor/stretchinternet.py
18
from __future__ import unicode_literals from .common import InfoExtractor from ..utils import int_or_none class StretchInternetIE(InfoExtractor): _VALID_URL = r'https?://portal\.stretchinternet\.com/[^/]+/portal\.htm\?.*?\beventId=(?P<id>\d+)' _TEST = { 'url': 'https://portal.stretchinternet.com/umar...
sander76/home-assistant
refs/heads/dev
homeassistant/components/currencylayer/sensor.py
5
"""Support for currencylayer.com exchange rates service.""" from datetime import timedelta import logging import requests import voluptuous as vol from homeassistant.components.sensor import PLATFORM_SCHEMA, SensorEntity from homeassistant.const import ( ATTR_ATTRIBUTION, CONF_API_KEY, CONF_BASE, CONF...
snyderks/advent-solutions
refs/heads/master
Day9.py
1
# Day 9: http://adventofcode.com/2016/day/9 # Problem: Given a sequence of characters with repeat markers denoted by # parentheses, such as (10x2) -- repeat the next 10 characters twice. # If another repeat sequence is included in a previous one, it is not counted. import time import re start = time.time() f = open("...
kenshay/ImageScripter
refs/heads/master
ProgramData/SystemFiles/Python/Lib/site-packages/elan/Pools/System Tabs/11_Ups_Check_Pages_OLD.py
2
from ImageScripter import * from elan import * #UPS################################################# Say("Checking the ups page") Configurator.ups.Click() Configurator.upspage.SetThreshold(.98) Configurator.upspage.Wait(seconds=10) Say("Checking the ups page looks great") Configurator.communicationdevices.Click() ...
ever0409/payton
refs/heads/master
nitro.py
1
@bot.message_handler(commands=['nitro']) def nitro(m): cid = m.chat.id markup = types.InlineKeyboardMarkup() ret_msg = bot.send_message(cid, "Write Soon ```{}```", disable_notification=True, reply_markup=markup) assert ret_msg.message_id
aldenso/MyBooks
refs/heads/master
db_upgrade.py
1
#!../myvirtualenv/bin/python from migrate.versioning import api from config import SQLALCHEMY_DATABASE_URI from config import SQLALCHEMY_MIGRATE_REPO api.upgrade(SQLALCHEMY_DATABASE_URI, SQLALCHEMY_MIGRATE_REPO) v = api.db_version(SQLALCHEMY_DATABASE_URI, SQLALCHEMY_MIGRATE_REPO) print('Current database version: ' + st...
fuselock/odoo
refs/heads/8.0
addons/hw_escpos/__init__.py
385
# -*- 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...
becm/meson
refs/heads/master
test cases/common/132 build by default targets in tests/write_file.py
14
#!/usr/bin/env python3 import sys with open(sys.argv[1], 'w') as f: f.write('Test')
ESS-LLP/erpnext-medical
refs/heads/develop
erpnext/patches/v11_0/move_leave_approvers_from_employee.py
5
import frappe from frappe import _ from frappe.model.utils.rename_field import rename_field def execute(): frappe.reload_doc("hr", "doctype", "department_approver") frappe.reload_doc("hr", "doctype", "employee") frappe.reload_doc("hr", "doctype", "department") if frappe.db.has_column('Department', 'leave_approver...
waytai/django
refs/heads/master
django/contrib/gis/geometry/regex.py
657
import re # Regular expression for recognizing HEXEWKB and WKT. A prophylactic measure # to prevent potentially malicious input from reaching the underlying C # library. Not a substitute for good Web security programming practices. hex_regex = re.compile(r'^[0-9A-F]+$', re.I) wkt_regex = re.compile(r'^(SRID=(?P<srid...
rhots/automation
refs/heads/master
automation/slack.py
1
import os from slackclient import SlackClient class Slack: """Slack allows you to send messages to a specified Slack channel.""" def __init__(self): slack_api_token = os.environ["SLACK_API_TOKEN"] self._client = SlackClient(slack_api_token) def send_message(self, channel, message): ...
boone/ansible-modules-core
refs/heads/devel
cloud/amazon/ec2_asg.py
27
#!/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 distributed...
Kamik423/uni_plan
refs/heads/master
plan/plan/lib/python3.4/site-packages/setuptools/command/easy_install.py
75
#!/usr/bin/env python """ Easy Install ------------ A tool for doing automatic download/extract/build of distutils-based Python packages. For detailed documentation, see the accompanying EasyInstall.txt file, or visit the `EasyInstall home page`__. __ https://setuptools.readthedocs.io/en/latest/easy_install.html ""...
Omegaphora/external_chromium-trace
refs/heads/lp5.1
trace-viewer/third_party/closure_linter/closure_linter/errorrecord.py
135
#!/usr/bin/env python # Copyright 2012 The Closure Linter 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 # #...
ehashman/oh-mainline
refs/heads/master
vendor/packages/PyYaml/tests/lib3/test_constructor.py
57
import yaml import pprint import datetime import yaml.tokens def execute(code): global value exec(code) return value def _make_objects(): global MyLoader, MyDumper, MyTestClass1, MyTestClass2, MyTestClass3, YAMLObject1, YAMLObject2, \ AnObject, AnInstance, AState, ACustomState, InitArgs...
jagguli/intellij-community
refs/heads/master
python/testData/inspections/PyUnresolvedReferencesInspection/unusedUnresolvedModuleImported.py
68
<warning descr="Unused import statement">import <error descr="No module named spam">spam</error></warning>
jfindleyderegt/au_trap
refs/heads/master
test_threshold.py
1
import os, glob, cv2 import numpy as np import pylab im_simple = '/home/faedrus/Documents/au_trap/20141031/1414763725.88.png' im_complex = '/home/faedrus/Documents/au_trap/20141031/1414769658.04.png' img = cv2.imread(im_complex, 0) (height, width) = img.shape ret,thresh1 = cv2.threshold(img, 127, 255,cv2.THRESH_BINAR...
agaldona/odoo-addons
refs/heads/master
stock_visible_cost/models/res_config.py
4
# -*- encoding: utf-8 -*- ############################################################################## # For copyright and license notices, see __openerp__.py file in root directory ############################################################################## from openerp import models, fields class StockConfigSe...
andyfaff/scipy
refs/heads/master
benchmarks/benchmarks/go_benchmark_functions/go_funcs_I.py
21
# -*- coding: utf-8 -*- from numpy import sin, sum from .go_benchmark import Benchmark class Infinity(Benchmark): r""" Infinity objective function. This class defines the Infinity [1]_ global optimization problem. This is a multimodal minimization problem defined as follows: .. math:: ...
Dandandan/wikiprogramming
refs/heads/master
jsrepl/build/extern/python/unclosured/lib/python2.7/encodings/cp1255.py
593
""" Python Character Mapping Codec cp1255 generated from 'MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1255.TXT' with gencodec.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_table) def decode(self,in...
maximinus/grateful-dead-songs
refs/heads/master
gdsongs/shows/management/commands/clearsets.py
1
from django.core.management.base import BaseCommand, CommandError from songs.models import Song from shows.models import PlayedSong, PlayedSet, Show, ShowDate class Command(BaseCommand): help = 'Remove all PlayedSongs, PlayedSets and Shows from the database' def handle(self, *args, **options): # get numbers d...
varunarya10/contrail-sandesh
refs/heads/master
library/python/pysandesh/sandesh_base.py
3
# # Copyright (c) 2013 Juniper Networks, Inc. All rights reserved. # # # Sandesh # import os import gevent import pkgutil import importlib import trace from work_queue import WorkQueue from sandesh_logger import SandeshLogger from sandesh_client import SandeshClient from sandesh_http import SandeshHttp from sandesh_u...
simonwydooghe/ansible
refs/heads/devel
lib/ansible/modules/network/f5/bigip_firewall_rule.py
21
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright: (c) 2018, 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', ...
vdeluca/tfi
refs/heads/tfi
geonode/documents/autocomplete_light_registry.py
35
import autocomplete_light from models import Document autocomplete_light.register( Document, search_fields=['^title'], autocomplete_js_attributes={ 'placeholder': 'Document name..', }, )
PersonalGenomesOrg/open-humans
refs/heads/master
public_data/forms.py
2
from django.forms import BooleanField, CharField, Form class ConsentForm(Form): """ A subclass of django-user-account's SignupForm with a `terms` field to add validation for the Terms of Use checkbox. """ check_uncertainty = BooleanField( label=( "I understand the uncertainty ...
yvaucher/stock-logistics-tracking
refs/heads/8.0
__unported__/stock_move_packaging/wizard/move_pack.py
4
# -*- coding: utf-8 -*- ################################################################################# # # OpenERP, Open Source Management Solution # Copyright (C) 2011 Julius Network Solutions SARL <contact@julius.fr> # # This program is free software: you can redistribute it and/or modify # it under th...
yuifan/pexus4_external_regex-re2
refs/heads/pexus_kt
re2/make_unicode_groups.py
219
#!/usr/bin/python # Copyright 2008 The RE2 Authors. All Rights Reserved. # Use of this source code is governed by a BSD-style # license that can be found in the LICENSE file. """Generate C++ tables for Unicode Script and Category groups.""" import sys import unicode _header = """ // GENERATED BY make_unicode_groups...
robovm/robovm-studio
refs/heads/master
python/lib/Lib/site-packages/django/utils/xmlutils.py
734
""" Utilities for XML generation/parsing. """ from xml.sax.saxutils import XMLGenerator class SimplerXMLGenerator(XMLGenerator): def addQuickElement(self, name, contents=None, attrs=None): "Convenience method for adding an element with no children" if attrs is None: attrs = {} self.startEl...
gsnbng/erpnext
refs/heads/develop
erpnext/accounts/doctype/purchase_invoice_item/purchase_invoice_item.py
120
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe from frappe.model.document import Document from erpnext.controllers.print_settings import print_settings_for_item_table class PurchaseI...
kstaniek/condoor
refs/heads/master
condoor/drivers/XE.py
1
"""This is IOS XE driver implementation.""" from functools import partial import re from condoor.drivers.IOS import Driver as IOSDriver from condoor import pattern_manager, TIMEOUT, EOF from condoor.actions import a_send_line, a_send, a_disconnect, a_message_callback, a_return_and_reconnect from condoor.fsm import FS...
chovanecm/sacredboard
refs/heads/develop
sacredboard/app/data/__init__.py
1
"""Sacred(board) Data Access Layer.""" from sacredboard.app.data.errors import NotFoundError, DataSourceError from .datastorage import Cursor, DataStorage from .metricsdao import MetricsDAO __all__ = ["Cursor", "DataStorage", "MetricsDAO", "NotFoundError", "DataSourceError"]
numenta/nupic
refs/heads/master
external/linux32/lib/python2.6/site-packages/matplotlib/numerix/npyma/__init__.py
70
from matplotlib.numerix import use_maskedarray if use_maskedarray: from maskedarray import * print "using maskedarray" else: try: from numpy.ma import * # numpy 1.05 and later except ImportError: from numpy.core.ma import * # earlier #print "using ma"
CoderBotOrg/coderbotsrv
refs/heads/master
server/lib/pyasn1_modules/rfc2315.py
127
# # PKCS#7 message syntax # # ASN.1 source from: # http://www.trl.ibm.com/projects/xml/xss4j/data/asn1/grammars/pkcs7.asn # # Sample captures from: # openssl crl2pkcs7 -nocrl -certfile cert1.cer -out outfile.p7b # from pyasn1.type import tag,namedtype,namedval,univ,constraint,char,useful from pyasn1_modules.rfc2459 imp...
yahoo/pulsar
refs/heads/master
pulsar-functions/python-examples/native_exclamation_function.py
9
#!/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 # "...
qualitio/qualitio
refs/heads/master
qualitio/core/custommodel/management/commands/remove_customizations.py
1
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import inspect from operator import itemgetter, attrgetter from subprocess import call from optparse import make_option from django.db import connection, transaction from qualitio import customizations from qualitio.core.custommodel.models import ModelCustomizati...
Mariatta/pythondotorg
refs/heads/master
minutes/migrations/0002_auto_20150416_1853.py
12
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('minutes', '0001_initial'), ] operations = [ migrations.AlterField( model_name='minutes', name='conte...
DavidGuben/rcbplayspokemon
refs/heads/master
app/pywin32-220/com/win32com/demos/excelAddin.py
35
# A demo plugin for Microsoft Excel # # This addin simply adds a new button to the main Excel toolbar, # and displays a message box when clicked. Thus, it demonstrates # how to plug in to Excel itself, and hook Excel events. # # # To register the addin, simply execute: # excelAddin.py # This will install the COM ser...
nikephoroscoin/nikephoroscoin
refs/heads/master
share/qt/make_spinner.py
4415
#!/usr/bin/env python # W.J. van der Laan, 2011 # Make spinning .mng animation from a .png # Requires imagemagick 6.7+ from __future__ import division from os import path from PIL import Image from subprocess import Popen SRC='img/reload_scaled.png' DST='../../src/qt/res/movies/update_spinner.mng' TMPDIR='/tmp' TMPNAM...