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
aydoganserdar/python-rabbit-logging
setup.py
1
1223
from setuptools import setup, find_packages CLASSIFIERS = [ 'Development Status :: 5 - Production/Stable', 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Programming Language :: Python :: 2', ...
mit
yuanming-hu/taichi
python/taichi/lang/shell.py
1
1472
import atexit import functools import os import sys from taichi.core.util import ti_core as _ti_core import taichi as ti try: import sourceinspect as oinspect except ImportError: ti.warn('`sourceinspect` not installed!') ti.warn( 'Without this package Taichi may not function well in Python IDLE i...
mit
luisvmf/sqlite-server
node_modules/luisvmfsqliteserver/node_modules/node-gyp/gyp/pylib/gyp/input.py
578
116086
# 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. from compiler.ast import Const from compiler.ast import Dict from compiler.ast import Discard from compiler.ast import List from compiler.ast import Module from co...
mit
folz/drop
docs/conf.py
1
7698
# -*- coding: utf-8 -*- # # drop documentation build configuration file, created by # sphinx-quickstart on Sun Feb 17 11:46:20 2013. # # 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. # # All co...
mit
leeopop/2015-CS570-Project
lda_preprocess.py
1
2532
import csv from loader import load_single_file num_of_topics__criteria_for_cut_words = 20 num_of_appearance__criteria_for_cut_words = 10 output_num_of_words_per_topic = 50 def load_vocab(): vocab = {} inverse_dict = load_single_file('keyword_table.csv') num = max([int(x['unique']) for x in inverse_dict.values()])...
mit
etzhou/edx-platform
lms/djangoapps/shoppingcart/migrations/0009_auto__del_coupons__add_courseregistrationcode__add_coupon__chg_field_c.py
114
16498
# -*- 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): # Deleting model 'Coupons' db.delete_table('shoppingcart_coupons') # Adding model 'CourseRegistrati...
agpl-3.0
DarthMaulware/EquationGroupLeaks
Leak #5 - Lost In Translation/windows/exploits/ZIBE/plugin_manager.py
1
2051
# uncompyle6 version 2.9.10 # Python bytecode 2.6 (62161) # Decompiled from: Python 3.6.0b2 (default, Oct 11 2016, 05:27:10) # [GCC 6.2.0 20161005] # Embedded file name: c:\Temp\build\ZIBE\plugin_manager.py # Compiled at: 2013-02-27 18:02:46 from plugins import * class PluginManager(object): __plugins__ = {} ...
unlicense
LearnEra/LearnEraPlaftform
common/djangoapps/terrain/stubs/start.py
50
2773
""" Command-line utility to start a stub service. """ import sys import time import logging from .comments import StubCommentsService from .xqueue import StubXQueueService from .youtube import StubYouTubeService from .ora import StubOraService from .lti import StubLtiService from .video_source import VideoSourceHttpSer...
agpl-3.0
nick-thompson/servo
python/mach/mach/test/providers/conditions.py
128
1324
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. from __future__ import unicode_literals from mach.decorators import ( CommandProvider, Command, ) def is_foo(c...
mpl-2.0
benrudolph/commcare-hq
corehq/apps/groups/hierarchy.py
3
5903
""" This code lets you define hierarchies of users using groups and group metadata. There's a dropdown report filter that uses this data to narrow down the users included in a report. See the hsph-dev project for an example. """ from functools import partial from dimagi.utils.decorators.memoized import memoized from c...
bsd-3-clause
TEAM-Gummy/platform_external_chromium
third_party/libjingle/source/talk/site_scons/talk.py
64
15628
# Copyright 2010 Google Inc. # All Rights Reserved. # # Author: Tim Haloun (thaloun@google.com) # Daniel Petersson (dape@google.com) # import os # Keep a global dictionary of library target params for lookups in # ExtendComponent(). _all_lib_targets = {} def _GenericLibrary(env, static, **kwargs): """Extend...
bsd-3-clause
kevinr/750book-web
750book-web-env/lib/python2.7/site-packages/django/contrib/auth/tests/auth_backends.py
25
9715
from django.conf import settings from django.contrib.auth.models import User, Group, Permission, AnonymousUser from django.contrib.contenttypes.models import ContentType from django.test import TestCase class BackendTest(TestCase): backend = 'django.contrib.auth.backends.ModelBackend' def setUp(self): ...
mit
alekz112/xlwings
xlwings/tests/test_xlwings.py
1
33895
# -*- coding: utf-8 -*- from __future__ import unicode_literals import os import sys import shutil import pytz import nose from nose.tools import assert_equal, raises, assert_true, assert_false, assert_not_equal from datetime import datetime, date from xlwings import Application, Workbook, Sheet, Range, Chart, ChartTy...
apache-2.0
titom1986/CouchPotatoServer
libs/suds/xsd/__init__.py
205
3007
# This program is free software; you can redistribute it and/or modify # it under the terms of the (LGPL) GNU Lesser General Public License as # published by the Free Software Foundation; either version 3 of the # License, or (at your option) any later version. # # This program is distributed in the hope that it will ...
gpl-3.0
yousafsyed/casperjs
bin/Lib/test/test_resource.py
93
6613
import contextlib import sys import os import unittest from test import support import time resource = support.import_module('resource') # This test is checking a few specific problem spots with the resource module. class ResourceTest(unittest.TestCase): def test_args(self): self.assertRaises(TypeError,...
mit
ntuecon/server
pyenv/Lib/site-packages/django/core/checks/security/sessions.py
477
2595
from django.conf import settings from .. import Tags, Warning, register def add_session_cookie_message(message): return message + ( " Using a secure-only session cookie makes it more difficult for " "network traffic sniffers to hijack user sessions." ) W010 = Warning( add_session_cookie_...
bsd-3-clause
android-ia/platform_external_chromium_org
PRESUBMIT.py
25
59933
# 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. """Top-level presubmit script for Chromium. See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts for more details about the presu...
bsd-3-clause
Zomboided/VPN-Manager
resetVPN.py
1
4136
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (C) 2016 Zomboided # # 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 option)...
gpl-2.0
EmreAtes/spack
var/spack/repos/builtin/packages/perl-sub-exporter-progressive/package.py
5
1621
############################################################################## # Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
lgpl-2.1
balloob/home-assistant
tests/components/plex/test_init.py
5
7404
"""Tests for Plex setup.""" import copy from datetime import timedelta import ssl import plexapi import requests import homeassistant.components.plex.const as const from homeassistant.config_entries import ( ENTRY_STATE_LOADED, ENTRY_STATE_NOT_LOADED, ENTRY_STATE_SETUP_ERROR, ENTRY_STATE_SETUP_RETRY, ...
apache-2.0
Sweetgrassbuffalo/ReactionSweeGrass-v2
.meteor/local/dev_bundle/python/Lib/test/test_urllib2_localnet.py
14
26043
import os import base64 import urlparse import urllib2 import BaseHTTPServer import unittest import hashlib from test import test_support mimetools = test_support.import_module('mimetools', deprecated=True) threading = test_support.import_module('threading') try: import ssl except ImportError: ssl = None he...
gpl-3.0
jaruba/chromium.src
tools/telemetry/telemetry/value/merge_values_unittest.py
11
4500
# Copyright 2013 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 unittest from telemetry import page as page_module from telemetry.page import page_set from telemetry.value import list_of_scalar_values fro...
bsd-3-clause
jskDr/keraspp
old/gan_cnn_mse.py
1
6490
################################ # 공통 패키지 불러오기 ################################ from keras.datasets import mnist import numpy as np from PIL import Image import math import os import keras.backend as K K.set_image_data_format('channels_first') print(K.image_data_format) ################################ # GAN 모델링 ###...
mit
loco-odoo/localizacion_co
openerp/addons/payment_buckaroo/controllers/main.py
325
1270
# -*- coding: utf-8 -*- try: import simplejson as json except ImportError: import json import logging import pprint import werkzeug from openerp import http, SUPERUSER_ID from openerp.http import request _logger = logging.getLogger(__name__) class BuckarooController(http.Controller): _return_url = '/pa...
agpl-3.0
chengjf/database-interface-doc-management
flask-demo/flask/Lib/encodings/shift_jis_2004.py
816
1059
# # shift_jis_2004.py: Python Unicode Codec for SHIFT_JIS_2004 # # Written by Hye-Shik Chang <perky@FreeBSD.org> # import _codecs_jp, codecs import _multibytecodec as mbc codec = _codecs_jp.getcodec('shift_jis_2004') class Codec(codecs.Codec): encode = codec.encode decode = codec.decode class IncrementalEnc...
apache-2.0
StrongBoy998/ihome-project
Tornado_Project/utils/image_storage.py
1
1089
# -*- coding: utf-8 -*- import qiniu.config import logging from qiniu import Auth, put_data, etag, urlsafe_base64_encode #需要填写你的 Access Key 和 Secret Key access_key = 'btZDjv_qjI4O1P5-KKeaZXBGLJcM-AZfigN8HjQf' secret_key = 'j2Sgq1Pz-1O90OoFSKr24Xa80mVWqzpqbo-byiN5' #要上传的空间 bucket_name = 'ihome' def storage(data): ...
apache-2.0
ebar0n/django
django/utils/dateparse.py
4
4732
"""Functions to parse datetime objects.""" # We're using regular expressions rather than time.strptime because: # - They provide both validation and parsing. # - They're more flexible for datetimes. # - The date/datetime/time constructors produce friendlier error messages. import datetime import re from django.utils...
bsd-3-clause
OpenSPA/dvbapp
lib/python/Plugins/SystemPlugins/FastScan/plugin.py
1
15297
# -*- coding: utf-8 -*- from Plugins.Plugin import PluginDescriptor from Screens.Screen import Screen from Screens.MessageBox import MessageBox from Components.config import config, ConfigSelection, ConfigYesNo, getConfigListEntry, ConfigSubsection, ConfigText from Components.ConfigList import ConfigListScreen from Co...
gpl-2.0
kawamon/hue
desktop/core/ext-py/thrift-0.13.0/src/protocol/TProtocol.py
6
13468
# # 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
MOA-2011/enigma2
lib/python/Screens/Dish.py
7
8474
# -*- coding: utf-8 -*- from Screen import Screen from Components.BlinkingPixmap import BlinkingPixmapConditional from Components.Pixmap import Pixmap from Components.config import config, ConfigInteger from Components.Sources.Boolean import Boolean from Components.Label import Label from Components.ProgressBar import ...
gpl-2.0
ronpaulcoin/ronpaulcoin
contrib/testgen/base58.py
2139
2818
''' Bitcoin base58 encoding and decoding. Based on https://bitcointalk.org/index.php?topic=1026.0 (public domain) ''' import hashlib # for compatibility with following code... class SHA256: new = hashlib.sha256 if str != bytes: # Python 3.x def ord(c): return c def chr(n): return byte...
mit
facelessuser/Pywin32
lib/x64/win32/lib/win32timezone.py
4
32691
# -*- coding: UTF-8 -*- """ win32timezone: Module for handling datetime.tzinfo time zones using the windows registry for time zone information. The time zone names are dependent on the registry entries defined by the operating system. This module may be tested using the doctest module. Written by Jason...
bsd-3-clause
MyAOSP/external_chromium_org
chrome/common/extensions/docs/server2/app_yaml_helper_test.py
43
6153
#!/usr/bin/env python # Copyright 2013 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 unittest from app_yaml_helper import AppYamlHelper from extensions_paths import SERVER2 from host_file_system_provider import H...
bsd-3-clause
creationix/gyp
pylib/gyp/ninja_syntax.py
35
4968
# This file comes from # https://github.com/martine/ninja/blob/master/misc/ninja_syntax.py # Do not edit! Edit the upstream one instead. """Python module for generating .ninja files. Note that this is emphatically not a required piece of Ninja; it's just a helpful utility for build-file-generation systems that alr...
bsd-3-clause
delighted/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/style/filter.py
196
11782
# Copyright (C) 2010 Chris Jerdonek (chris.jerdonek@gmail.com) # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions...
bsd-3-clause
justyns/home-assistant
homeassistant/components/media_player/itunes.py
5
14006
""" Support for interfacing to iTunes API. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/media_player.itunes/ """ import logging import requests from homeassistant.components.media_player import ( MEDIA_TYPE_MUSIC, MEDIA_TYPE_PLAYLIST, SUPPORT_NEX...
mit
ville-k/tensorflow
tensorflow/contrib/learn/python/learn/estimators/state_saving_rnn_estimator.py
68
27991
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
chrisdearman/micropython
drivers/display/lcd160cr_test.py
25
5045
# Driver test for official MicroPython LCD160CR display # MIT license; Copyright (c) 2017 Damien P. George import time, math, framebuf, lcd160cr def get_lcd(lcd): if type(lcd) is str: lcd = lcd160cr.LCD160CR(lcd) return lcd def show_adc(lcd, adc): data = [adc.read_core_temp(), adc.read_core_vbat(...
mit
fapable/pygameproject2
Menu/Opties.py
1
1096
import pygame import Game as dm def opties(): pygame.mixer.music.load("music.mp3") pygame.mixer.music.play(loops=0, start=0.0) size = width, height = 340,240 screen = pygame.display.set_mode(size) redSquare = pygame.image.load('achtergrondSpelers.png').convert() white = (255,255,255) w = ...
apache-2.0
lz1988/company-site
django/contrib/auth/tests/management.py
97
9156
from __future__ import unicode_literals from datetime import date from django.contrib.auth import models, management from django.contrib.auth.management import create_permissions from django.contrib.auth.management.commands import changepassword from django.contrib.auth.models import User from django.contrib.auth.test...
bsd-3-clause
benoitsteiner/tensorflow-opencl
tensorflow/python/ops/ctc_ops.py
43
11713
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
elsuizo/Kivy_work
Game_1/game1.py
1
1067
#= ------------------------------------------------------------------------- # @file game1.py # # @date 11/17/15 23:12:50 # @author Martin Noblia # @email martin.noblia@openmailbox.org # # @brief # # @detail # # Licence: # This program is free software: you can redistribute it and/or modify # it under the terms of the...
mit
dims/nova
nova/api/openstack/compute/server_external_events.py
27
5080
# Copyright 2014 Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agre...
apache-2.0
shsingh/ansible
lib/ansible/plugins/doc_fragments/emc.py
44
1134
# -*- coding: utf-8 -*- # Copyright: (c) 2018, Luca Lorenzetto (@remix_tj) <lorenzetto.luca@gmail.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) class ModuleDocFragment(object): DOCUMENTATION = r''' options: - See respective platform section for more details ...
gpl-3.0
dmitry-sobolev/ansible
lib/ansible/modules/windows/win_timezone.py
42
1565
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2015, Phil Schwartz <schwartzmx@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 ...
gpl-3.0
wuhengzhi/chromium-crosswalk
chrome/common/extensions/PRESUBMIT_test.py
168
3653
#!/usr/bin/env python # Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import os import unittest import PRESUBMIT EXTENSIONS_PATH = os.path.join('chrome', 'common', 'extensions') DOCS_PATH = os.path.j...
bsd-3-clause
adlnet-archive/edx-platform
common/lib/xmodule/xmodule/abtest_module.py
86
5331
import random import logging from lxml import etree from xmodule.x_module import XModule from xmodule.raw_module import RawDescriptor from xmodule.xml_module import XmlDescriptor from xmodule.exceptions import InvalidDefinitionError from xblock.fields import String, Scope, Dict DEFAULT = "_DEFAULT_GROUP" log = logg...
agpl-3.0
moutai/scikit-learn
sklearn/externals/joblib/numpy_pickle.py
31
17419
""" Utilities for fast persistence of big data, with optional compression. """ # Author: Gael Varoquaux <gael dot varoquaux at normalesup dot org> # Copyright (c) 2009 Gael Varoquaux # License: BSD Style, 3 clauses. import pickle import traceback import os import zlib import warnings from io import BytesIO from ._co...
bsd-3-clause
GdZ/scriptfile
software/googleAppEngine/lib/django_1_3/tests/regressiontests/m2m_regress/models.py
92
1930
from django.db import models from django.contrib.auth import models as auth # No related name is needed here, since symmetrical relations are not # explicitly reversible. class SelfRefer(models.Model): name = models.CharField(max_length=10) references = models.ManyToManyField('self') related = models.ManyT...
mit
OnroerendErfgoed/pyramid_urireferencer
tests/test_renderers.py
1
2787
# -*- coding: utf-8 -*- from pyramid_urireferencer.models import ( RegistryResponse, ApplicationResponse, Item ) class TestRenderers: def test_empty_registry_renderer(self): rr = RegistryResponse('http://id.example.org/foo/1', True, False, 0, []) from pyramid_urireferencer.renderers i...
mit
luiscarlosgph/nas
env/lib/python2.7/site-packages/django/template/smartif.py
111
6276
""" Parser and utilities for the smart 'if' tag """ # Using a simple top down parser, as described here: # http://effbot.org/zone/simple-top-down-parsing.htm. # 'led' = left denotation # 'nud' = null denotation # 'bp' = binding power (left = lbp, right = rbp) class TokenBase(object): """ Base class for op...
mit
Morgan-Stanley/treadmill
lib/python/treadmill/rest/api/allocation.py
3
7517
"""Treadmill allocation REST api. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import flask import flask_restplus as restplus from flask_restplus import fields from treadmill import webutils def _alloc_id(te...
apache-2.0
afaheem88/rally
rally/plugins/openstack/scenarios/sahara/node_group_templates.py
11
4156
# Copyright 2014: Mirantis 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 b...
apache-2.0
ric2b/Vivaldi-browser
chromium/testing/libfuzzer/dictionary_generator.py
18
7954
#!/usr/bin/python2 # # Copyright 2016 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. """Generate a dictionary for libFuzzer or AFL-based fuzzer. Invoked manually using a fuzzer binary and target format/protocol specifica...
bsd-3-clause
FreddieShoreditch/image_folder_organiser
venv/lib/python2.7/site-packages/setuptools/extension.py
229
1649
import sys import re import functools import distutils.core import distutils.errors import distutils.extension from .dist import _get_unpatched from . import msvc9_support _Extension = _get_unpatched(distutils.core.Extension) msvc9_support.patch_for_specialized_compiler() def _have_cython(): """ Return True...
mit
emersonsoftware/ansiblefork
lib/ansible/vars/hostvars.py
23
4138
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) an...
gpl-3.0
ghedsouza/django
tests/m2m_through/models.py
72
4434
from datetime import datetime from django.db import models # M2M described on one of the models class Person(models.Model): name = models.CharField(max_length=128) class Meta: ordering = ('name',) def __str__(self): return self.name class Group(models.Model): name = models.CharFie...
bsd-3-clause
jlguardi/yowsup
yowsup/layers/axolotl/protocolentities/iq_keys_set.py
19
2884
from yowsup.common import YowConstants from yowsup.layers.protocol_iq.protocolentities import IqProtocolEntity from yowsup.structs import ProtocolTreeNode import os, time class SetKeysIqProtocolEntity(IqProtocolEntity): def __init__(self, identityKey, signedPreKey, preKeys, djbType, registrationId = None): ...
gpl-3.0
kdwink/intellij-community
python/lib/Lib/site-packages/django/contrib/auth/middleware.py
289
3552
from django.contrib import auth from django.core.exceptions import ImproperlyConfigured class LazyUser(object): def __get__(self, request, obj_type=None): if not hasattr(request, '_cached_user'): from django.contrib.auth import get_user request._cached_user = get_user(request) ...
apache-2.0
TomiBelan/multiparser
example_lr.py
1
1164
from grammar import Grammar from makelr import make_lr_parser preface = "from toycalc.lex import tokenizer" rules = { # stat -> HELLO | IF cond THEN stat | IF cond THEN stat ELSE stat "stat": [(("HELLO",), "lambda ctx, a: 'hello'"), (("IF", "cond", "THEN", "stat"), "lambda ctx, a, b...
apache-2.0
ruuk/script.module.youtube.dl
lib/youtube_dl/extractor/ninegag.py
24
3708
from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import str_to_int class NineGagIE(InfoExtractor): IE_NAME = '9gag' _VALID_URL = r'https?://(?:www\.)?9gag(?:\.com/tv|\.tv)/(?:p|embed)/(?P<id>[a-zA-Z0-9]+)(?:/(?P<display_id>[^?#/]+))?' _TESTS = [{ ...
gpl-2.0
FusionSP/android_external_chromium_org
third_party/binutils/download.py
93
2942
#!/usr/bin/env python # 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. # vim: set ts=2 sw=2 et sts=2 ai: """Minimal tool to download binutils from Google storage. TODO(mithro): Replace with generic downloa...
bsd-3-clause
gmalmquist/pants
tests/python/pants_test/subsystem/test_subsystem.py
10
4711
# coding=utf-8 # Copyright 2015 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) import unittest fro...
apache-2.0
chrisenuf/fullerite
src/diamond/collectors/lmsensors/lmsensors.py
25
2078
# coding=utf-8 """ This class collects data from libsensors. It should work against libsensors 2.x and 3.x, pending support within the PySensors Ctypes binding: [http://pypi.python.org/pypi/PySensors/](http://pypi.python.org/pypi/PySensors/) Requires: 'sensors' to be installed, configured, and the relevant kernel mod...
apache-2.0
leonardoo/django-pipeline
tests/tests/test_compiler.py
1
5061
from __future__ import unicode_literals import sys from unittest import skipIf from django.test import TestCase from pipeline.collector import default_collector from pipeline.compilers import Compiler, CompilerBase, SubProcessCompiler from pipeline.exceptions import CompilerError from tests.utils import _, pipeline...
mit
FHannes/intellij-community
python/testData/inspections/PyArgumentListInspection/decorators.py
55
1130
def deco(param): pass @deco # ok def f6(): pass @deco(1) # ok def f7(): pass @deco(<warning descr="Parameter 'param' unfilled">)</warning> # fail: missing param def f8(): pass @deco(1, <warning descr="Unexpected argument">2</warning>) # fail: extra param def f9(): pass def deco2(p1, p2): pass <warning d...
apache-2.0
ironbox360/django
django/utils/_os.py
502
3581
from __future__ import unicode_literals import os import sys import tempfile from os.path import abspath, dirname, isabs, join, normcase, normpath, sep from django.core.exceptions import SuspiciousFileOperation from django.utils import six from django.utils.encoding import force_text if six.PY2: fs_encoding = sy...
bsd-3-clause
trebuchet-deploy/trigger
trigger/utils/__init__.py
3
1235
# # 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, software # ...
apache-2.0
servo/servo
tests/wpt/web-platform-tests/tools/third_party/pywebsocket3/mod_pywebsocket/stream.py
20
35191
# Copyright 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 f...
mpl-2.0
santiagoaguiar/svg-edit
extras/update-langs.py
5
2338
#!/usr/bin/env python # -*- coding: iso-8859-15 -*- """ This is a helper script for the svg-edit project, useful for managing all the language files Licensed under the Apache 2 License as is the rest of the project Requires Python 2.6 Copyright (c) 2010 Jeff Schiller """ import os import json from types import DictTy...
mit
SCSSG/Odoo-SCS
addons/point_of_sale/point_of_sale.py
4
76548
# -*- 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
torehc/sinucha
web/sinucha/control/models.py
1
5334
from django.db import models from django.contrib.auth.models import User import datetime from django.db.models.signals import post_save from django.dispatch import receiver class User_Data(models.Model): USER = 'user' ADMIN = 'admin' ROL_CHOICES = ( (USER, 'USER'), (ADMIN, 'ADMIN'), ...
gpl-3.0
cxxgtxy/tensorflow
tensorflow/examples/tutorials/mnist/fully_connected_feed.py
70
9515
# 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
edespino/gpdb
gpMgmt/bin/gpconfig_modules/compare_segment_guc.py
16
5349
from gpconfig_modules.database_segment_guc import DatabaseSegmentGuc from gpconfig_modules.file_segment_guc import FileSegmentGuc from gpconfig_modules.segment_guc import SegmentGuc class MultiValueGuc(SegmentGuc): """ encapsulate various GUC locations within a given segment. A segment can include 2 datab...
apache-2.0
dcamposliz/youtube-dl
youtube_dl/extractor/muzu.py
147
2224
from __future__ import unicode_literals from .common import InfoExtractor from ..compat import ( compat_urllib_parse, ) class MuzuTVIE(InfoExtractor): _VALID_URL = r'https?://www\.muzu\.tv/(.+?)/(.+?)/(?P<id>\d+)' IE_NAME = 'muzu.tv' _TEST = { 'url': 'http://www.muzu.tv/defected/marcashken-f...
unlicense
saradbowman/osf.io
osf/models/licenses.py
12
2879
# -*- coding: utf-8 -*- import functools from django.contrib.postgres.fields import ArrayField from django.db import models from osf.models.base import BaseModel, ObjectIDMixin def _serialize(fields, instance): return { field: getattr(instance, field if field != 'id' else 'license_id') for field ...
apache-2.0
insidenothing/3D-Printing-Software
skein_engines/skeinforge-47/fabmetheus_utilities/geometry/manipulation_meta/_array.py
12
5507
""" Boolean geometry array. """ from __future__ import absolute_import #Init has to be imported first because it has code to workaround the python bug where relative imports don't work if the module is imported as a main module. import __init__ from fabmetheus_utilities.geometry.geometry_tools import vertex from fab...
gpl-2.0
AravindK95/ee106b
project3/src/lab3/src/lab3/transformations.py
2
66033
# -*- coding: utf-8 -*- # transformations.py # Copyright (c) 2006-2015, Christoph Gohlke # Copyright (c) 2006-2015, The Regents of the University of California # Produced at the Laboratory for Fluorescence Dynamics # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modifica...
mit
baixobaixa/limbo-android
jni/qemu/scripts/tracetool/format/h.py
98
1062
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Generate .h file. """ __author__ = "Lluís Vilanova <vilanova@ac.upc.edu>" __copyright__ = "Copyright 2012, Lluís Vilanova <vilanova@ac.upc.edu>" __license__ = "GPL version 2 or (at your option) any later version" __maintainer__ = "Stefan Hajnoczi" __email__ ...
gpl-2.0
tanyunshi/python-docx
tests/parts/test_numbering.py
7
2641
# encoding: utf-8 """ Test suite for the docx.parts.numbering module """ from __future__ import absolute_import, print_function, unicode_literals import pytest from docx.oxml.numbering import CT_Numbering from docx.parts.numbering import NumberingPart, _NumberingDefinitions from ..oxml.unitdata.numbering import a_...
mit
reachtarunhere/aima-python
canvas.py
59
4701
from IPython.display import HTML, display, clear_output _canvas = """ <script type="text/javascript" src="./js/canvas.js"></script> <div> <canvas id="{0}" width="{1}" height="{2}" style="background:rgba(158, 167, 184, 0.2);" onclick='click_callback(this, event, "{3}")'></canvas> </div> <script> var {0}_canvas_object ...
mit
joequant/pyswagger
pyswagger/tests/v2_0/test_circular.py
1
3163
from pyswagger import SwaggerApp, utils, primitives, errs from ..utils import get_test_data_folder from ...scanner import CycleDetector from ...scan import Scanner import unittest import os import six class CircularRefTestCase(unittest.TestCase): """ test for circular reference guard """ def test_path_item_...
mit
40223125/40223125-2
static/Brython3.1.0-20150301-090019/Lib/xml/sax/xmlreader.py
824
12612
"""An XML Reader is the SAX 2 name for an XML parser. XML Parsers should be based on this code. """ from . import handler from ._exceptions import SAXNotSupportedException, SAXNotRecognizedException # ===== XMLREADER ===== class XMLReader: """Interface for reading an XML document using callbacks. XMLReade...
gpl-3.0
vybstat/scikit-learn
sklearn/ensemble/__init__.py
217
1307
""" The :mod:`sklearn.ensemble` module includes ensemble-based methods for classification and regression. """ from .base import BaseEnsemble from .forest import RandomForestClassifier from .forest import RandomForestRegressor from .forest import RandomTreesEmbedding from .forest import ExtraTreesClassifier from .fores...
bsd-3-clause
2014c2g12/c2g12
exts/exts/wsgi/static/Brython2.1.0-20140419-113919/Lib/xml/etree/ElementInclude.py
784
5146
# # ElementTree # $Id: ElementInclude.py 3375 2008-02-13 08:05:08Z fredrik $ # # limited xinclude support for element trees # # history: # 2003-08-15 fl created # 2003-11-14 fl fixed default loader # # Copyright (c) 2003-2004 by Fredrik Lundh. All rights reserved. # # fredrik@pythonware.com # http://www.pythonware...
gpl-2.0
kjw0106/boto
tests/integration/sns/test_connection.py
114
2585
# Copyright (c) 2013 Amazon.com, Inc. or its affiliates. # All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the right...
mit
klickagent/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/port/factory.py
118
5888
# Copyright (C) 2010 Google Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the ...
bsd-3-clause
rocktavious/DevToolsLib
DTL/api/bases.py
1
3894
import inspect #------------------------------------------------------------ #------------------------------------------------------------ class BaseStruct(object): #------------------------------------------------------------ def __init__(self, *args, **kwds): self.deserialize(*args, **kwds) ...
mit
yagimimi/miyalab_slide2
node_modules/node-sass/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py
1283
65086
# 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. """ This module contains classes that help to emulate xcodebuild behavior on top of other build systems, such as make and ninja. """ import copy import gyp.common...
mit
xuvw/viewfinder
backend/www/service_health.py
13
3375
# Copyright 2012 Viewfinder Inc. All Rights Reserved. """Handler for service health status. """ __author__ = 'matt@emailscrubbed.com (Matt Tracy)' import logging import time from collections import namedtuple from viewfinder.backend.base import handler, counters from viewfinder.backend.db import metric from viewfin...
apache-2.0
CredoReference/edx-platform
cms/djangoapps/contentstore/tests/test_request_event.py
13
1641
"""Tests for CMS's requests to logs""" import mock from django.urls import reverse from django.test import TestCase from contentstore.views.helpers import event as cms_user_track class CMSLogTest(TestCase): """ Tests that request to logs from CMS return 204s """ def test_post_answers_to_log(self): ...
agpl-3.0
tensorflow/lingvo
lingvo/tasks/asr/decoder_utils_test.py
1
7263
# Lint as: python3 # Copyright 2018 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 ...
apache-2.0
chyeh727/django
tests/template_tests/test_logging.py
210
2286
from __future__ import unicode_literals import logging from django.template import Engine, Variable, VariableDoesNotExist from django.test import SimpleTestCase class TestHandler(logging.Handler): def __init__(self): super(TestHandler, self).__init__() self.log_record = None def emit(self, ...
bsd-3-clause
TheCacophonyProject/Full_Noise
test/test_tracks.py
1
4984
class TestTracks: def test_can_add_and_delete_tracks(self, helper): recording = helper.given_new_device(self, "tracks").has_recording() user = helper.admin_user() track0 = user.can_add_track_to_recording(recording) user.can_see_track(track0) track1 = user.can_add_track_to_r...
agpl-3.0
mgagne/nova
nova/tests/unit/api/openstack/compute/test_auth.py
11
2569
# Copyright 2010 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
davidopp/kubernetes
cluster/juju/layers/kubernetes/reactive/k8s.py
44
21583
#!/usr/bin/env python # Copyright 2015 The Kubernetes Authors. # # 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 appli...
apache-2.0
MrLoick/python-for-android
python-build/python-libs/gdata/src/gdata/tlslite/HandshakeSettings.py
359
6364
"""Class for setting handshake parameters.""" from constants import CertificateType from utils import cryptomath from utils import cipherfactory class HandshakeSettings: """This class encapsulates various parameters that can be used with a TLS handshake. @sort: minKeySize, maxKeySize, cipherNames, certifi...
apache-2.0
MikeLing/shogun
examples/undocumented/python/distance_canberraword.py
5
1398
#!/usr/bin/env python from tools.load import LoadMatrix lm=LoadMatrix() traindna = lm.load_dna('../data/fm_train_dna.dat') testdna = lm.load_dna('../data/fm_test_dna.dat') parameter_list = [[traindna,testdna,3,0,False],[traindna,testdna,3,0,False]] def distance_canberraword (fm_train_dna=traindna,fm_test_dna=testdn...
gpl-3.0
CyanogenMod/android_kernel_motorola_omap4-common
tools/perf/scripts/python/sched-migration.py
11215
11670
#!/usr/bin/python # # Cpu task migration overview toy # # Copyright (C) 2010 Frederic Weisbecker <fweisbec@gmail.com> # # perf script event handlers have been generated by perf script -g python # # This software is distributed under the terms of the GNU General # Public License ("GPL") version 2 as published by the Fre...
gpl-2.0
KaiSzuttor/espresso
samples/dpd.py
4
2365
# Copyright (C) 2010-2019 The ESPResSo project # # This file is part of ESPResSo. # # ESPResSo 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 v...
gpl-3.0