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
turbokongen/home-assistant
tests/components/gios/test_air_quality.py
3
4208
"""Test air_quality of GIOS integration.""" from datetime import timedelta import json from unittest.mock import patch from gios import ApiError from homeassistant.components.air_quality import ( ATTR_AQI, ATTR_CO, ATTR_NO2, ATTR_OZONE, ATTR_PM_2_5, ATTR_PM_10, ATTR_SO2, ) from homeassista...
apache-2.0
dsaraujo/circulante
django/contrib/databrowse/plugins/calendars.py
247
4317
from django import http from django.db import models from django.contrib.databrowse.datastructures import EasyModel from django.contrib.databrowse.sites import DatabrowsePlugin from django.shortcuts import render_to_response from django.utils.text import capfirst from django.utils.encoding import force_unicode from dja...
bsd-3-clause
guiquanz/zulip
zerver/lib/test_helpers.py
113
12407
from django.test import TestCase from zerver.lib.initial_password import initial_password from zerver.lib.db import TimeTrackingCursor from zerver.lib import cache from zerver.lib import event_queue from zerver.worker import queue_processors from zerver.lib.actions import ( check_send_message, create_stream_if_ne...
apache-2.0
mitchrule/Miscellaneous
Django_Project/django/Lib/site-packages/pip/_vendor/requests/packages/chardet/jpcntx.py
1777
19348
######################## 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...
mit
perchrn/TaktPlayer
src/configuration/ConfigurationHolder.py
1
24848
''' Created on 11. jan. 2012 @author: pcn ''' from xml.etree.ElementTree import Element, SubElement from xml.etree import ElementTree from BeautifulSoup import BeautifulStoneSoup import os import random import sys def getDefaultDirectories(): taktPackageConfigDir = os.path.join(os.getcwd(), "config...
gpl-2.0
albertomurillo/ansible
lib/ansible/modules/utilities/logic/wait_for_connection.py
45
3109
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2017, Dag Wieers (@dagwieers) <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_ve...
gpl-3.0
mikitex70/pelican-plugins
assets/assets.py
30
2597
# -*- coding: utf-8 -*- """ Asset management plugin for Pelican =================================== This plugin allows you to use the `webassets`_ module to manage assets such as CSS and JS files. The ASSET_URL is set to a relative url to honor Pelican's RELATIVE_URLS setting. This requires the use of SITEURL in the ...
agpl-3.0
aioue/ansible
lib/ansible/modules/network/junos/junos_command.py
9
12197
#!/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...
gpl-3.0
timm-tem/RPi_mediaserver
piface/outputallon.py
1
1251
# THIS IS THE PYTHON CODE FOR PiFACE OUTPUT ON # # Copyright (C) 2014 Tim Massey # # 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 3 of the License, or # (at your...
gpl-3.0
pavlova-marina/QGIS
python/plugins/processing/gui/ConfigDialog.py
6
10177
# -*- coding: utf-8 -*- """ *************************************************************************** ConfigDialog.py --------------------- Date : August 2012 Copyright : (C) 2012 by Victor Olaya Email : volayaf at gmail dot com **************************...
gpl-2.0
looker/sentry
src/sentry/rules/actions/notify_event.py
2
1468
""" sentry.rules.actions.notify_event ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Used for notifying *all* enabled plugins :copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ from __future__ import absolute_import from sentry.plugins import plugins from ...
bsd-3-clause
infojasyrc/client_dataws
client_dataws/lib/util/file_verificator.py
1
2208
''' Created on Feb 02, 2013 @author: Jose Sal y Rosas @contact: arturo.jasyrc@gmail.com ''' import zlib import hashlib class Verificator(object): def __init__(self): pass def set_parameters(self, path='', algorithm='crc32', blocksize=8192): self.path = path self.algorithm = algorit...
mit
itdxer/django-project-template
{{cookiecutter.project_name}}/apps/users/migrations/0001_initial.py
1
2579
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import django.utils.timezone import django.core.validators class Migration(migrations.Migration): dependencies = [ ('auth', '0001_initial'), ] operations = [ migrations.CreateModel( ...
mit
sdiazpier/nest-simulator
pynest/nest/tests/test_siegert_neuron.py
10
9338
# -*- coding: utf-8 -*- # # test_siegert_neuron.py # # This file is part of NEST. # # Copyright (C) 2004 The NEST Initiative # # NEST 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 Lic...
gpl-2.0
google-code-export/marinemap
lingcod/data_manager/migrations/0001_initial.py
3
8109
# encoding: 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 model 'DataLayer' db.create_table('data_manager_datalayer', ( ('description', sel...
bsd-3-clause
pytool/gws
apps/gws.py
3
4400
import sys import json import jinja2 sys.path.append('../') from lync import * from bs4 import BeautifulSoup @WebApplication(root='/') class GoogleSearch(object): def __init__(self, domain='www.google.com'): self.domain = domain self.ncr_cookie = self.gws_ncr_cookie() with open('pages/sea...
mit
puttarajubr/commcare-hq
corehq/apps/api/tests.py
1
47922
import json from datetime import datetime import dateutil.parser from django.utils.http import urlencode from django.test import TestCase from django.core.urlresolvers import reverse from tastypie.models import ApiKey from tastypie.resources import Resource from tastypie import fields from corehq.apps.groups.models i...
bsd-3-clause
andrewchenshx/vnpy
vnpy/app/algo_trading/algos/dma_algo.py
1
2651
from vnpy.trader.constant import Offset, Direction, OrderType from vnpy.trader.object import TradeData, OrderData, TickData from vnpy.trader.engine import BaseEngine from vnpy.app.algo_trading import AlgoTemplate class DmaAlgo(AlgoTemplate): """""" display_name = "DMA 直接委托" default_setting = { ...
mit
LarsFronius/ansible
lib/ansible/modules/network/illumos/dladm_iptun.py
70
8227
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2016, Adam Števko <adam.stevko@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 L...
gpl-3.0
smartczm/python-learn
Old-day01-10/s13-day5/get/day5/Atm/src/crontab.py
1
2023
#!/usr/bin/env python # -*- coding:utf-8 -*- import os import json import time from config import settings from src.backend import logger def main(): card_list = os.listdir(settings.USER_DIR_FOLDER) for card in card_list: basic_info = json.load(open(os.path.join(settings.USER_DIR_FOLDER, card, 'basic...
gpl-2.0
minhphung171093/OpenERP_V7
openerp/workflow/__init__.py
76
1110
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the...
agpl-3.0
mancoast/CPythonPyc_test
fail/330_test_binhex.py
83
1532
#! /usr/bin/env python3 """Test script for the binhex C module Uses the mechanism of the python binhex module Based on an original test by Roger E. Masse. """ import binhex import os import unittest from test import support class BinHexTestCase(unittest.TestCase): def setUp(self): self.fname1 = su...
gpl-3.0
hybrid-storage-dev/cinder-client-fs-111t-hybrid-cherry
openstack/common/apiclient/fake_client.py
7
5852
# Copyright 2013 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requ...
apache-2.0
webmasterraj/GaSiProMo
flask/lib/python2.7/site-packages/botocore/vendored/requests/packages/chardet/sjisprober.py
1777
3764
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is mozilla.org code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights Reserved. # # Con...
gpl-2.0
mancoast/pycdc
tests/22_test_nested_elif.ref.py
2
1066
a = None if a == 1: print '1' elif a == 2: print '2' if a == 1: print '1' elif a == 2: print '2' else: print 'other' if a == 1: print '1' elif a == 2: print '2' elif a == 3: print '3' else: print 'other' if a == 1: print '1' elif a == 2: print '2' elif a == 3: ...
gpl-3.0
yuchangfu/pythonfun
packages/werkzeug/testsuite/contrib/cache.py
94
7212
# -*- coding: utf-8 -*- """ werkzeug.testsuite.cache ~~~~~~~~~~~~~~~~~~~~~~~~ Tests the cache system :copyright: (c) 2013 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import os import time import unittest import tempfile import shutil from werkzeug.testsuite import Werkzeug...
gpl-3.0
jacknb1ack/android_kernel_sony_msm8960t-test
scripts/tracing/draw_functrace.py
14676
3560
#!/usr/bin/python """ Copyright 2008 (c) Frederic Weisbecker <fweisbec@gmail.com> Licensed under the terms of the GNU GPL License version 2 This script parses a trace provided by the function tracer in kernel/trace/trace_functions.c The resulted trace is processed into a tree to produce a more human view of the call ...
gpl-2.0
singingwolfboy/oauthlib
oauthlib/oauth2/rfc6749/grant_types/client_credentials.py
35
4726
# -*- coding: utf-8 -*- """ oauthlib.oauth2.rfc6749.grant_types ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ """ from __future__ import unicode_literals, absolute_import import json import logging from .base import GrantTypeBase from .. import errors from ..request_validator import RequestValidator log = logging.getLogger(_...
bsd-3-clause
openvswitch/ovn-scale-test
rally_ovs/plugins/ovs/ovsclients_impl.py
1
19591
# Copyright 2016 Ebay Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, soft...
apache-2.0
takeshineshiro/Django-facebook
docs/docs_env/Lib/encodings/iso8859_4.py
593
13632
""" Python Character Mapping Codec iso8859_4 generated from 'MAPPINGS/ISO8859/8859-4.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,input,errors='...
bsd-3-clause
SickGear/SickGear
lib/apprise/plugins/NotifyXMPP/__init__.py
2
12128
# -*- coding: utf-8 -*- # # Copyright (C) 2019 Chris Caron <lead2gold@gmail.com> # All rights reserved. # # This code is licensed under the MIT License. # # 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 th...
gpl-3.0
macopedia/hr
__unported__/hr_worked_days_from_timesheet/__openerp__.py
19
1711
# -*- coding:utf-8 -*- ############################################################################## # # Copyright (C) 2014 Odoo Canada. All Rights Reserved. # # 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 # ...
agpl-3.0
florianholzapfel/home-assistant
homeassistant/components/sensor/netatmo.py
5
12251
""" Support for the NetAtmo Weather Service. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/sensor.netatmo/ """ import logging from datetime import timedelta import voluptuous as vol from homeassistant.components.sensor import PLATFORM_SCHEMA from home...
mit
Censio/ansible-dev
lib/ansible/playbook/play_context.py
3
23819
# -*- coding: utf-8 -*- # (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,...
gpl-3.0
jart/tensorflow
tensorflow/python/kernel_tests/conv_ops_test.py
8
73052
# 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
overtherain/scriptfile
software/googleAppEngine/lib/django_1_4/django/contrib/gis/gdal/tests/test_geom.py
80
21228
from binascii import b2a_hex try: import cPickle as pickle except ImportError: import pickle from django.contrib.gis.gdal import (OGRGeometry, OGRGeomType, OGRException, OGRIndexError, SpatialReference, CoordTransform, GDAL_VERSION) from django.contrib.gis.gdal.prototypes.geom import GEOJSON from django.co...
mit
abhishekarora12/ansible
test/integration/setup_gce.py
163
1391
''' Create GCE resources for use in integration tests. Takes a prefix as a command-line argument and creates two persistent disks named ${prefix}-base and ${prefix}-extra and a snapshot of the base disk named ${prefix}-snapshot. prefix will be forced to lowercase, to ensure the names are legal GCE resource names. ''' ...
gpl-3.0
RapidApplicationDevelopment/tensorflow
tensorflow/python/summary/event_multiplexer_test.py
31
9984
# 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
jbassen/edx-platform
openedx/core/djangoapps/user_api/accounts/tests/test_image_helpers.py
124
2968
""" Tests for helpers.py """ import datetime import hashlib from mock import patch from pytz import UTC from unittest import skipUnless from django.conf import settings from django.test import TestCase from ..image_helpers import get_profile_image_urls_for_user from student.tests.factories import UserFactory TEST_SI...
agpl-3.0
maftieu/CouchPotatoServer
libs/requests/packages/charade/compat.py
2943
1157
######################## BEGIN LICENSE BLOCK ######################## # Contributor(s): # Ian Cordasco - port to Python # # 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 # versio...
gpl-3.0
Comunitea/OCB
addons/report_webkit/wizard/__init__.py
431
1482
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (c) 2010 Camptocamp SA (http://www.camptocamp.com) # All Right Reserved # # Author : Vincent Renaville # # WARNING: This program as such is intended to be used by professional # programmers who take the...
agpl-3.0
cms-btv-pog/rootpy
rootpy/stats/workspace.py
5
11590
# Copyright 2012 the rootpy developers # distributed under the terms of the GNU General Public License from __future__ import absolute_import import multiprocessing import ROOT from . import log; log = log[__name__] from .. import QROOT, asrootpy from ..extern.six import string_types from ..base import NamedObject f...
gpl-3.0
azumimuo/family-xbmc-addon
script.module.youtube.dl/lib/youtube_dl/extractor/bandcamp.py
12
12253
from __future__ import unicode_literals import json import random import re import time from .common import InfoExtractor from ..compat import ( compat_str, compat_urlparse, ) from ..utils import ( ExtractorError, float_or_none, int_or_none, KNOWN_EXTENSIONS, parse_filesize, unescapeHT...
gpl-2.0
IsmoilovMuhriddin/allgo
rasp/diagnosis.py
1
3928
import signal import time import wiringpi as wp from rasp.allgo_utils import PCA9685 from rasp.allgo_utils import ultrasonic as uls LOW = 0 HIGH = 1 OUTPUT = wp.OUTPUT INPUT = wp.INPUT CAR_DIR_FW = 0 CAR_DIR_BK = 1 CAR_DIR_LF = 2 CAR_DIR_RF = 3 CAR_DIR_ST = 4 DIR_DISTANCE_ALERT = 20 preMillis = 0 ...
mit
ppppn/twitter-bot
ReplyAndFav.py
1
6678
#!/usr/bin/python # coding: UTF-8 from tweepy.error import TweepError import random import re from const import * from words import * from replies import replies import datetime import logging from API import GetAPI logging.basicConfig(level=LOGLEVEL) api = None # 説明 # 関数リスト # FUNCTION_NAME(args) > Returns(SUCCES...
mit
mkaluza/external_chromium_org
ppapi/generators/idl_gen_pnacl.py
52
9608
#!/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. """Generator for Pnacl Shim functions that bridges the calling conventions between GCC and PNaCl. """ from datetime import dateti...
bsd-3-clause
futureshocked/RaspberryPi-FullStack
Complete_Python2_app/lab_app.py
1
6719
from flask import Flask, request, render_template import time import datetime import arrow app = Flask(__name__) app.debug = True # Make this False if you are no longer debugging @app.route("/") def hello(): return "Hello World!" @app.route("/lab_temp") def lab_temp(): import sys import Adafruit_DHT humidity,...
mit
michaelhkw/incubator-impala
tests/comparison/query_profile.py
1
30490
# 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 u...
apache-2.0
ychen820/microblog
src/lib/flask_cache/backends.py
14
2427
from werkzeug.contrib.cache import (BaseCache, NullCache, SimpleCache, MemcachedCache, GAEMemcachedCache, FileSystemCache) class SASLMemcachedCache(MemcachedCache): def __init__(self, servers=None, default_timeout=300, key_prefix=None, username=None, password=N...
bsd-3-clause
benschmaus/catapult
telemetry/telemetry/internal/backends/chrome/tab_list_backend_unittest.py
6
1792
# Copyright 2015 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. from telemetry.core import exceptions from telemetry import decorators from telemetry.testing import tab_test_case class TabListBackendTest(tab_test_case.T...
bsd-3-clause
itdxer/neupy
tests/layers/test_activations.py
1
13302
import math import six import numpy as np import tensorflow as tf from neupy.utils import asfloat from neupy.exceptions import ( LayerConnectionError, WeightInitializationError, ) from neupy import layers, algorithms, init from base import BaseTestCase from helpers import simple_classification class Activa...
mit
ingadhoc/odoo
addons/website_mail/__openerp__.py
379
1623
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2013-Today OpenERP SA (<http://www.openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms ...
agpl-3.0
SOKP/external_chromium_org
tools/perf/measurements/smooth_gesture_util.py
64
1747
# 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 copy from telemetry.web_perf import timeline_interaction_record as tir_module def GetAdjustedInteractionIfContainGesture(timeline, interaction_recor...
bsd-3-clause
mrquim/mrquimrepo
script.module.youtube.dl/lib/youtube_dl/extractor/teamcoco.py
43
6627
# coding: utf-8 from __future__ import unicode_literals import base64 import binascii import re import json from .common import InfoExtractor from ..utils import ( ExtractorError, qualities, determine_ext, ) from ..compat import compat_ord class TeamcocoIE(InfoExtractor): _VALID_URL = r'https?://tea...
gpl-2.0
ogenstad/ansible-modules-extras
cloud/cloudstack/cs_firewall.py
44
13407
#!/usr/bin/python # -*- coding: utf-8 -*- # # (c) 2015, René Moser <mail@renemoser.net> # # 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 Lice...
gpl-3.0
reinout/django
django/db/transaction.py
46
11229
from contextlib import ContextDecorator from django.db import ( DEFAULT_DB_ALIAS, DatabaseError, Error, ProgrammingError, connections, ) class TransactionManagementError(ProgrammingError): """Transaction management is used improperly.""" pass def get_connection(using=None): """ Get a database c...
bsd-3-clause
lnielsen/invenio
invenio/utils/autodiscovery/checkers.py
4
15559
# -*- coding: utf-8 -*- ## ## This file is part of Invenio. ## Copyright (C) 2009, 2010, 2011, 2013 CERN. ## ## Invenio is free software; you can redistribute it and/or ## modify it under the terms of the GNU General Public License as ## published by the Free Software Foundation; either version 2 of the ## License, or ...
gpl-2.0
israeltobias/DownMedia
youtube-dl/youtube_dl/extractor/francetv.py
13
16006
# coding: utf-8 from __future__ import unicode_literals import re import json from .common import InfoExtractor from ..compat import compat_urlparse from ..utils import ( clean_html, ExtractorError, int_or_none, parse_duration, determine_ext, ) from .dailymotion import ( DailymotionIE, Da...
gpl-3.0
guileschool/BEAGLEBONE-tutorials
BBB-firmware/u-boot-v2018.05-rc2/test/py/tests/test_hush_if_test.py
6
4539
# Copyright (c) 2015-2016, NVIDIA CORPORATION. All rights reserved. # # SPDX-License-Identifier: GPL-2.0 # Test operation of the "if" shell command. import os import os.path import pytest pytestmark = pytest.mark.buildconfigspec('hush_parser') # The list of "if test" conditions to test. subtests = ( # Base if f...
mit
myerpengine/odoo
addons/account_payment/__openerp__.py
116
2997
# -*- 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
wwgong/CVoltDB
tests/scripts/xml2/xmlgenerator.py
4
3269
# Copyright (C) 2009 by Ning Shi and Andy Pavlo # Brown University # # 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, cop...
gpl-3.0
Matrixeigs/Optimization
distributed_energy_management/modelling/dynamic_operation_pb2.py
1
21841
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: dynamic_operation.proto import sys _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflection...
mit
tellesnobrega/horizon
openstack_dashboard/dashboards/project/containers/tests.py
9
24624
# Copyright 2012 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Copyright 2012 Nebula, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the...
apache-2.0
michael-dev2rights/ansible
lib/ansible/plugins/lookup/dict.py
16
1706
# (c) 2014, Kent R. Spillner <kspillner@acm.org> # (c) 2017 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 DOCUMENTATION = """ lookup: dict version_added: "1.5" ...
gpl-3.0
titilambert/alignak
test/test_maintenance_period.py
2
7340
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) 2015-2015: Alignak team, see AUTHORS.txt file for contributors # # This file is part of Alignak. # # Alignak 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 So...
agpl-3.0
karlch/vimiv
vimiv/thumbnail_manager.py
1
10586
# vim: ft=python fileencoding=utf-8 sw=4 et sts=4 """Provides classes to store and load thumbnails from a shared cache. The ThumbnailStore transparently creates and loads thumbnails according to the freedesktop.org thumbnail management standard. The ThumbnailManager provides a asynchronous mechanism to load thumbnails...
mit
foobarbazblarg/stayclean
stayclean-2020-december/venv/lib/python3.8/site-packages/pip/_internal/utils/urls.py
18
1527
import os import sys from pip._vendor.six.moves.urllib import parse as urllib_parse from pip._vendor.six.moves.urllib import request as urllib_request from pip._internal.utils.typing import MYPY_CHECK_RUNNING if MYPY_CHECK_RUNNING: from typing import Optional, Text, Union def get_url_scheme(url): # type: (...
mit
riklaunim/django-custom-multisite
django/db/models/sql/where.py
71
13399
""" Code to manage the creation and SQL rendering of 'where' constraints. """ from __future__ import absolute_import import datetime from itertools import repeat from django.utils import tree from django.db.models.fields import Field from django.db.models.sql.datastructures import EmptyResultSet, FullResultSet from ...
bsd-3-clause
rayluo/boto
tests/integration/cloudformation/test_cert_verification.py
126
1588
# Copyright (c) 2012 Mitch Garnaat http://garnaat.org/ # Copyright (c) 2012 Amazon.com, Inc. or its affiliates. # All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the # "Software"), to deal in the Software withou...
mit
OpenKMIP/PyKMIP
kmip/pie/objects.py
1
68704
# Copyright (c) 2015 The Johns Hopkins University/Applied Physics Laboratory # 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/LICEN...
apache-2.0
HousekeepLtd/django
tests/template_tests/filter_tests/test_linebreaks.py
310
1920
from django.template.defaultfilters import linebreaks_filter from django.test import SimpleTestCase from django.utils.safestring import mark_safe from ..utils import setup class LinebreaksTests(SimpleTestCase): """ The contents in "linebreaks" are escaped according to the current autoescape setting. ...
bsd-3-clause
CloudVLab/professional-services
tools/agile-machine-learning-api/tests/tests_model.py
2
15181
# Copyright 2019 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
apache-2.0
kawamon/hue
desktop/libs/libsentry/src/libsentry/sentry_ha.py
2
3072
#!/usr/bin/env python # Licensed to Cloudera, Inc. under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. Cloudera, Inc. licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you ma...
apache-2.0
xingyepei/edx-platform
common/djangoapps/course_modes/migrations/0001_initial.py
114
1860
# -*- 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 model 'CourseMode' db.create_table('course_modes_coursemode', ( ('id', self.gf('django....
agpl-3.0
ovnicraft/odoo
addons/account_voucher/report/account_voucher_sales_receipt.py
326
5808
############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public L...
agpl-3.0
99cloud/keystone_register
openstack_dashboard/dashboards/admin/users/panel.py
19
1046
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Copyright 2012 Nebula, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # no...
apache-2.0
mm112287/2015cda-24
static/Brython3.1.0-20150301-090019/Lib/locale.py
624
1918
def getdefaultlocale(): return __BRYTHON__.language,None def localeconv(): """ localeconv() -> dict. Returns numeric and monetary locale-specific parameters. """ # 'C' locale default values return {'grouping': [127], 'currency_symbol': '', ...
gpl-3.0
rackerlabs/marconi
marconi/queues/transport/wsgi/v1_0/homedoc.py
1
4656
# Copyright (c) 2013 Rackspace, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may not # use this file except in compliance with the License. You may obtain a copy # of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in w...
apache-2.0
hezuoguang/ZGVL
WLServer/site-packages/django/utils/baseconv.py
238
2981
# Copyright (c) 2010 Guilherme Gondim. All rights reserved. # Copyright (c) 2009 Simon Willison. All rights reserved. # Copyright (c) 2002 Drew Perttula. All rights reserved. # # License: # Python Software Foundation License version 2 # # See the file "LICENSE" for terms & conditions for usage, and a DISCLAIMER OF # ...
apache-2.0
tdeboissiere/DeepLearningImplementations
DenseNet/run_cifar10.py
1
7219
from __future__ import print_function import os import time import json import argparse import densenet import numpy as np import keras.backend as K from keras.datasets import cifar10 from keras.optimizers import Adam from keras.utils import np_utils def run_cifar10(batch_size, nb_epoch, ...
mit
dex4er/django-pyc
django_pyc/management/commands/clearpyc.py
1
2097
import argparse import os import re import sys from django.core.management import base class Command(base.BaseCommand): help = \ """ Clears .pyc files from the project. """ pattern = r'^.+\.pyc$' def add_arguments(self, parser): parser.add_argument( '--noinpu...
lgpl-3.0
daite/textparser
analyze_japanese.py
1
5424
#!/usr/bin/env python2 # -*- coding: utf-8 -*- # The MIT License (MIT) # Copyright (c) 2015 daite # 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 limi...
mit
znick/anytask
anytask/tasks/models.py
1
16245
# coding: utf-8 import copy import sys import json from datetime import timedelta from django.utils import timezone from django.conf import settings from django.contrib.auth.models import User from django.db import models from django.db.models import Q, Max from django.utils.translation import ugettext_lazy as _ from...
mit
RO-ny9/python-for-android
python3-alpha/python3-src/Lib/ctypes/test/test_bitfields.py
46
8643
from ctypes import * import unittest import os import ctypes import _ctypes_test class BITS(Structure): _fields_ = [("A", c_int, 1), ("B", c_int, 2), ("C", c_int, 3), ("D", c_int, 4), ("E", c_int, 5), ("F", c_int, 6), ...
apache-2.0
elishowk/django-poser
poser/utils/page.py
1
2014
# -*- coding: utf-8 -*- from django.conf import settings import re APPEND_TO_SLUG = "-copy" COPY_SLUG_REGEX = re.compile(r'^.*-copy(?:-(\d)*)?$') def is_valid_page_slug(page, slug, site, path=None): """Validates given slug depending on settings. """ # Exclude the page with the publisher_state == page.PUBL...
agpl-3.0
juju/juju
acceptancetests/jujupy/controller.py
4
2591
# This file is part of JujuPy, a library for driving the Juju CLI. # Copyright 2013-2019 Canonical Ltd. # # This program is free software: you can redistribute it and/or modify it # under the terms of the Lesser GNU General Public License version 3, as # published by the Free Software Foundation. # # This program is di...
agpl-3.0
apark263/tensorflow
tensorflow/contrib/image/python/ops/distort_image_ops.py
68
5793
# Copyright 2017 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
antoviaque/edx-platform
lms/djangoapps/commerce/tests/__init__.py
41
3664
# -*- coding: utf-8 -*- """ Commerce app tests package. """ import datetime import json from django.conf import settings from django.test import TestCase from django.test.utils import override_settings from freezegun import freeze_time import httpretty import jwt import mock from edx_rest_api_client import auth from ...
agpl-3.0
EDUlib/edx-platform
lms/djangoapps/verify_student/tests/test_ssencrypt.py
9
4172
""" Tests of the encryption and decryption utilities in the ssencrypt module. """ import base64 import binascii from lms.djangoapps.verify_student.ssencrypt import ( aes_decrypt, aes_encrypt, decode_and_decrypt, encrypt_and_encode, rsa_decrypt, rsa_encrypt ) AES_KEY_BYTES = binascii.unhexlif...
agpl-3.0
khozzy/pyalcs
lcs/agents/acs/ClassifiersList.py
2
1247
from __future__ import annotations from lcs import TypedList, Perception from lcs.agents.acs import Classifier class ClassifiersList(TypedList): """ Represents overall population, match/action sets """ def __init__(self, *args, oktypes=(Classifier,)) -> None: super().__init__(*args, oktypes=...
gpl-3.0
ManageIQ/integration_tests
cfme/tests/ansible/test_embedded_ansible_manual.py
2
8049
import pytest from cfme import test_requirements pytestmark = [ pytest.mark.manual, test_requirements.ansible ] @pytest.mark.tier(3) def test_embed_tower_retire_service_with_instances_ec2(): """ Retire Service+instances which were deployed by playbook from CFME UI. Polarion: assignee: g...
gpl-2.0
donkawechico/arguman.org
web/premises/views.py
1
23259
# -*- coding:utf-8 -*- import json from datetime import timedelta from markdown2 import markdown from django.contrib import messages from django.core.urlresolvers import reverse from django.utils import timezone from django.db.models import Max, Sum from django.utils.timezone import now from django.http import HttpRe...
mit
jnosal/seth
seth/tests/test_authentication.py
1
2947
from seth import auth from seth.tests import IntegrationTestBase from seth.classy.rest import generics class DefaultAuthenticatedResource(generics.GenericApiView): authentication_policy = None def get(self, **kwargs): return {} class BaseAuthenticatedTestCase(IntegrationTestBase): def extend_a...
mit
sankhesh/VTK
ThirdParty/ZopeInterface/zope/interface/tests/test_exceptions.py
57
2722
############################################################################## # # Copyright (c) 2010 Zope Foundation 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 SOF...
bsd-3-clause
rochbu/vexflow
site_scons/vexflow_scons.py
120
2838
""" VexFlow / TabDiv Build Script Requires: SCons, Git, and Google Closure Compiler Copyright Mohit Cheppudira 2010 """ import os from datetime import datetime from SCons.Script import * """ Make the default zip action use the external zip command. Also add -j (--junk-paths) to the command to store only the name of ...
mit
mitsuhiko/django
django/test/utils.py
1
7082
from __future__ import with_statement import sys import time import os import warnings from django.conf import settings, UserSettingsHolder from django.core import mail from django.core.mail.backends import locmem from django.test.signals import template_rendered, setting_changed from django.template import Template, ...
bsd-3-clause
kmoocdev/edx-platform
lms/djangoapps/edxnotes/tests.py
6
41385
""" Tests for the EdxNotes app. """ import json import jwt from mock import patch, MagicMock from unittest import skipUnless from datetime import datetime from edxmako.shortcuts import render_to_string from edxnotes import helpers from edxnotes.decorators import edxnotes from edxnotes.exceptions import EdxNotesParseErr...
agpl-3.0
alphafoobar/intellij-community
python/helpers/pydev/pydevd_stackless.py
53
16893
from __future__ import nested_scopes from pydevd_constants import * # @UnusedWildImport import stackless # @UnresolvedImport from pydevd_tracing import SetTrace from pydevd_custom_frames import updateCustomFrame, removeCustomFrame, addCustomFrame from pydevd_comm import GetGlobalDebugger import weakref from pydevd_fi...
apache-2.0
kawamon/hue
apps/sqoop/src/sqoop/client/base.py
2
8187
# Licensed to Cloudera, Inc. under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. Cloudera, Inc. licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file ex...
apache-2.0
foursquare/pants
tests/python/pants_test/java/test_nailgun_integration.py
1
1196
# 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, print_function, unicode_literals from pants_test.pants_run_integration_test import PantsRunIntegrationTest class TestNai...
apache-2.0