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
jjjake/iamine
iamine/core.py
2
10600
import urllib.request try: import ujson as json except ImportError: import json import asyncio try: from asyncio import JoinableQueue as Queue except ImportError: from asyncio import Queue from copy import deepcopy import time import aiohttp from .config import get_config from .requests import MineReq...
agpl-3.0
arnavd96/Cinemiezer
myvenv/lib/python3.4/site-packages/django/db/models/sql/subqueries.py
48
8006
""" Query subclasses which provide extra functionality beyond simple data retrieval. """ from django.core.exceptions import FieldError from django.db import connections from django.db.models.query_utils import Q from django.db.models.sql.constants import ( CURSOR, GET_ITERATOR_CHUNK_SIZE, NO_RESULTS, ) from django...
mit
huanpc/IoT-1
gui/controller/.venv/lib/python3.5/site-packages/django/contrib/contenttypes/migrations/0001_initial.py
585
1227
# -*- coding: utf-8 -*- from __future__ import unicode_literals import django.contrib.contenttypes.models from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ] operations = [ migrations.CreateModel( name='ContentType', fields=...
mit
QueenMargaretsCompSci/PiWars2016
source/wii_remote_test.py
1
3219
#!/usr/bin/python # import our modules import cwiid import time import RPi.GPIO as GPIO import piconzero as pz import sensorlibs as sl from picamera import PiCamera # setup our camera cam = PiCamera() # setup our constants button_delay = 0.1 PIN_LED = sl.GPIOtoBoard(4) GPIO.setup(PIN_LED, GPIO.OUT) GPIO.output(PIN_L...
gpl-3.0
vFense/vFenseAgent-nix
agent/deps/rpm6/Python-2.7.5/lib/python2.7/encodings/mac_romanian.py
593
13917
""" Python Character Mapping Codec mac_romanian generated from 'MAPPINGS/VENDORS/APPLE/ROMANIAN.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,inp...
lgpl-3.0
ktf/alibuild
tests/test_utilities.py
2
8178
# vim: set fileencoding=utf-8 : import unittest import platform # Assuming you are using the mock library to ... mock things try: from unittest.mock import patch, call # In Python 3, mock is built-in except ImportError: from mock import patch, call # Python 2 from alibuild_helpers.utilities import doDetect...
gpl-3.0
pexip/os-python-characteristic
test_characteristic.py
3
23954
from __future__ import absolute_import, division, print_function import linecache import sys import warnings import pytest from characteristic import ( Attribute, NOTHING, PY26, _attrs_to_script, _ensure_attributes, attributes, immutable, with_cmp, with_init, with_repr, ) PY2...
mit
Chilledheart/chromium
tools/telemetry/third_party/gsutilz/third_party/protorpc/demos/tunes_db/server/model.py
20
3938
#!/usr/bin/env python # # Copyright 2010 Google 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 o...
bsd-3-clause
carletes/libcloud
libcloud/test/dns/test_route53.py
39
11677
# 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 use ...
apache-2.0
fxfitz/ansible
lib/ansible/modules/cloud/amazon/ecs_taskdefinition.py
4
19207
#!/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...
gpl-3.0
rogerhu/django
tests/requests/tests.py
3
32613
# -*- encoding: utf-8 -*- from __future__ import unicode_literals from datetime import datetime, timedelta from io import BytesIO from itertools import chain import time from unittest import skipIf from django.db import connection, connections from django.core import signals from django.core.exceptions import Suspici...
bsd-3-clause
yu19930123/shadowsocks-shadowsocks
tests/nose_plugin.py
1072
1164
#!/usr/bin/env python # # Copyright 2015 clowwindy # # 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 ...
apache-2.0
A-Man/phpmyadmin
doc/_ext/configext.py
121
6622
from sphinx.domains import Domain, ObjType from sphinx.roles import XRefRole from sphinx.domains.std import GenericObject, StandardDomain from sphinx.directives import ObjectDescription from sphinx.util.nodes import clean_astext, make_refnode from sphinx.util import ws_re from sphinx import addnodes from sphinx.util.do...
gpl-2.0
jesramirez/odoo
addons/base_import_module/models/base_import_module.py
344
2066
import base64 from StringIO import StringIO from io import BytesIO from openerp.osv import osv, fields class base_import_module(osv.TransientModel): """ Import Module """ _name = "base.import.module" _description = "Import Module" _columns = { 'module_file': fields.binary('Module .ZIP file', r...
agpl-3.0
prakritish/ansible
lib/ansible/modules/cloud/cloudscale/cloudscale_server.py
30
16172
#!/usr/bin/python # -*- coding: utf-8 -*- # # (c) 2017, Gaudenz Steinlin <gaudenz.steinlin@cloudscale.ch> # # 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 ver...
gpl-3.0
google/closure-templates
python/runtime.py
1
22615
# Copyright 2015 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
apache-2.0
jiaphuan/models
research/brain_coder/common/utils.py
5
18620
from __future__ import absolute_import from __future__ import division from __future__ import print_function """Configuration class.""" import bisect from collections import deque import cPickle import heapq import random from absl import logging import numpy as np import six from six.moves import xrange import tens...
apache-2.0
opt9/Mobile-Security-Framework-MobSF
StaticAnalyzer/models.py
3
4323
from django.db import models # Create your models here. class StaticAnalyzerAndroid(models.Model): TITLE = models.TextField() APP_NAME = models.TextField() SIZE = models.CharField(max_length=50) MD5 = models.CharField(max_length=32) SHA1 = models.TextField() SHA256 = models.TextField() PAC...
gpl-3.0
nodakai/watchman
tests/integration/test_sock_perms.py
1
10512
# vim:ts=4:sw=4:et: # Copyright 2016-present Facebook, Inc. # Licensed under the Apache License, Version 2.0 # no unicode literals from __future__ import absolute_import, division, print_function import os import random import stat import string import sys import time import pywatchman import WatchmanInstance import...
apache-2.0
nicopresto/webSkapes
tool/aggregate.py
3
4163
import gluon.contrib.simplejson as json from geo import enum from geo.tree import QuadTree from geo.func import get from geo.utils import keygen from savage.graphics.color import ColorMap, red, blue, green cargs = [('boundry', 'Boundry Map', 'poly_map'), ('sort', 'Sort Field', 'attr', 'boundry'), ...
mit
hosseinmh/Django_learning
djmod/.venv/lib/python2.7/site-packages/setuptools/command/install.py
529
4683
from distutils.errors import DistutilsArgError import inspect import glob import warnings import platform import distutils.command.install as orig import setuptools # Prior to numpy 1.9, NumPy relies on the '_install' name, so provide it for # now. See https://github.com/pypa/setuptools/issues/199/ _install = orig.in...
mit
collinjackson/mojo
mojo/public/tools/dart_package_name.py
33
1150
#!/usr/bin/python # 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. """This script outputs the package name specified in the pubspec.yaml""" import argparse import os import sys # TODO(johnmccutchan): Use ...
bsd-3-clause
OpenUpgrade/OpenUpgrade
addons/base_report_designer/plugin/openerp_report_designer/bin/script/ModifyExistingReport.py
384
8450
######################################################################### # # Copyright (c) 2003-2004 Danny Brewer d29583@groovegarden.com # Copyright (C) 2004-2010 OpenERP SA (<http://openerp.com>). # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser Gene...
agpl-3.0
dgrtwo/gleam
examples/baseball.py
1
2364
import os from collections import OrderedDict from flask import Flask from wtforms import fields from ggplot import (aes, stat_smooth, geom_point, geom_text, ggtitle, ggplot, xlab, ylab) import numpy as np import pandas as pd from gleam import Page, panels # setup stats = ['At-Bats (AB)', 'Runs...
mit
Sprytile/Sprytile
rx/linq/observable/skipwhile.py
3
1516
from rx import Observable, AnonymousObservable from rx.internal.utils import adapt_call from rx.internal import extensionmethod @extensionmethod(Observable) def skip_while(self, predicate): """Bypasses elements in an observable sequence as long as a specified condition is true and then returns the remaining e...
mit
NeCTAR-RC/horizon
openstack_dashboard/dashboards/project/key_pairs/tests.py
1
7827
# 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
gangadhar-kadam/mic-erpnext
stock/report/delivery_note_trends/delivery_note_trends.py
1
1058
# ERPNext - web based ERP (http://erpnext.com) # Copyright (C) 2012 Web Notes Technologies Pvt Ltd # # 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 yo...
agpl-3.0
oceanobservatories/mi-dataset
mi/dataset/driver/flort_dj/cspp/flort_dj_cspp_recovered_driver.py
7
2024
#!/usr/bin/env python """ @package mi.dataset.driver @file mi/dataset/driver/flort_dj/cspp/flort_dj_cspp_recovered_driver.py @author Jeff Roy @brief Driver for the flort_dj_cspp instrument Release notes: Initial Release """ from mi.dataset.dataset_parser import DataSetDriverConfigKeys from mi.dataset.dataset_driver...
bsd-2-clause
stevenwilkin/go-buildpack
vendor/virtualenv-1.11.6/virtualenv.py
33
98477
#!/usr/bin/env python """Create a "virtual" Python installation """ __version__ = "1.11.6" virtualenv_version = __version__ # legacy import base64 import sys import os import codecs import optparse import re import shutil import logging import tempfile import zlib import errno import glob import distutils.sysconfig ...
mit
sevikkk/django-sql-explorer
explorer/forms.py
1
3003
from django import forms from django.forms import ModelForm, Field, ValidationError from explorer.models import Query, MSG_FAILED_BLACKLIST from django.db import DatabaseError, connections from crontab import CronTab from explorer.utils import get_connections_list _ = lambda x: x class SqlField(Field): def vali...
mit
mohamed-ali/scikit-tensor
sktensor/tests/test_tucker_hooi.py
3
1468
import logging from numpy import allclose from numpy.random import randn from scipy.sparse import rand as sprand from sktensor import tucker_hooi from sktensor.core import ttm from sktensor.dtensor import dtensor, unfolded_dtensor from sktensor.sptensor import unfolded_sptensor from sktensor.rotation import orthomax f...
gpl-3.0
komsas/OpenUpgrade
addons/l10n_ar/__init__.py
2120
1456
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (c) 2011 Cubic ERP - Teradata SAC. (http://cubicerp.com). # # WARNING: This program as such is intended to be used by professional # programmers who take t...
agpl-3.0
akosyakov/intellij-community
plugins/hg4idea/testData/bin/hgext/largefiles/uisetup.py
91
8415
# Copyright 2009-2010 Gregory P. Ward # Copyright 2009-2010 Intelerad Medical Systems Incorporated # Copyright 2010-2011 Fog Creek Software # Copyright 2010-2011 Unity Technologies # # This software may be used and distributed according to the terms of the # GNU General Public License version 2 or any later version. '...
apache-2.0
ywang037/delta-ntu-slerp4
Training/train_mobilenet_casia_1771.py
1
7420
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed Oct 4 14:47:47 2017 @author: slerp4 Compared with _debug version, this version excludes RMSprop optimizer """ #import tensorflow as tf from keras import backend as K from keras.applications.mobilenet import MobileNet from keras.preprocessing.image im...
mit
shenlong3030/asv-django-guestbook
django/contrib/gis/geos/tests/test_geos.py
10
40056
import ctypes, random, unittest, sys from django.contrib.gis.geos import * from django.contrib.gis.geos.base import gdal, numpy, GEOSBase from django.contrib.gis.geos.libgeos import GEOS_PREPARE from django.contrib.gis.geometry.test_data import TestDataMixin class GEOSTest(unittest.TestCase, TestDataMixin): ...
bsd-3-clause
apixandru/intellij-community
python/lib/Lib/site-packages/django/contrib/admindocs/urls.py
336
1089
from django.conf.urls.defaults import * from django.contrib.admindocs import views urlpatterns = patterns('', url('^$', views.doc_index, name='django-admindocs-docroot' ), url('^bookmarklets/$', views.bookmarklets, name='django-admindocs-bookmarklets' ), url('^tags/$...
apache-2.0
cynicaldevil/servo
tests/wpt/css-tests/tools/html5lib/html5lib/tests/test_whitespace_filter.py
453
5642
from __future__ import absolute_import, division, unicode_literals import unittest from html5lib.filters.whitespace import Filter from html5lib.constants import spaceCharacters spaceCharacters = "".join(spaceCharacters) try: unittest.TestCase.assertEqual except AttributeError: unittest.TestCase.assertEqual =...
mpl-2.0
gslab-econ/gslab_python
gslab_make/get_externals.py
1
4632
#! /usr/bin/env python import os import private.preliminaries as prelim import private.metadata as metadata import private.messages as messages from private.getexternalsdirectives import SystemDirective def get_externals(externals_file, external_dir = '@DEFAULTVALUE@', ...
mit
thomasrogers03/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/common/system/executive.py
117
22318
# Copyright (c) 2009, Google Inc. All rights reserved. # Copyright (c) 2009 Apple 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 abov...
bsd-3-clause
gengue/django
django/contrib/sessions/backends/cache.py
109
2588
from django.conf import settings from django.contrib.sessions.backends.base import CreateError, SessionBase from django.core.cache import caches from django.utils.six.moves import range KEY_PREFIX = "django.contrib.sessions.cache" class SessionStore(SessionBase): """ A cache-based session store. """ ...
bsd-3-clause
leoliujie/odoo
addons/stock/report/stock_graph.py
326
4514
# -*- 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
hazrpg/calibre
src/calibre/ebooks/rtf2xml/old_rtf.py
24
5124
######################################################################### # # # # # copyright 2002 Paul Henry Tremblay # # ...
gpl-3.0
anselmobd/fo2
script/TussorBipaRolo.py
1
1346
import sys import android import os import json import urllib.request print('\n'*10) print('='*30) print(' Tussor') print(' Coletor de códigos de barras') print('='*30) droid = android.Android() print('\nCelular: "{}"'.format(os.environ['QPY_USERNO'])) choice = ' ' while choice == ' ': print('') print('='*...
mit
Kamik423/uni_plan
plan/plan/lib/python3.4/site-packages/jinja2/constants.py
220
1626
# -*- coding: utf-8 -*- """ jinja.constants ~~~~~~~~~~~~~~~ Various constants. :copyright: (c) 2017 by the Jinja Team. :license: BSD, see LICENSE for more details. """ #: list of lorem ipsum words used by the lipsum() helper function LOREM_IPSUM_WORDS = u'''\ a ac accumsan ad adipiscing aenean a...
apache-2.0
FuzzyHobbit/scrapy
tests/test_utils_url.py
9
16722
# -*- coding: utf-8 -*- import unittest import six from scrapy.spiders import Spider from scrapy.utils.url import (url_is_from_any_domain, url_is_from_spider, canonicalize_url, add_http_if_no_scheme) __doctests__ = ['scrapy.utils.url'] class UrlUtilsTest(unittest.TestCase): def te...
bsd-3-clause
foss-transportationmodeling/rettina-server
.env/local/lib/python2.7/site-packages/distribute-0.6.24-py2.7.egg/setuptools/extension.py
61
1278
from distutils.core import Extension as _Extension from setuptools.dist import _get_unpatched _Extension = _get_unpatched(_Extension) # Prefer Cython to Pyrex pyrex_impls = 'Cython.Distutils.build_ext', 'Pyrex.Distutils.build_ext' for pyrex_impl in pyrex_impls: try: # from (pyrex_impl) import build_ext build_ext ...
apache-2.0
renhaoqi/gem5-stable
configs/example/ruby_mem_test.py
15
6724
# Copyright (c) 2006-2007 The Regents of The University of Michigan # Copyright (c) 2009 Advanced Micro Devices, 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 co...
bsd-3-clause
endolith/scipy
scipy/stats/stats.py
5
316939
# Copyright 2002 Gary Strangman. All rights reserved # Copyright 2002-2016 The SciPy Developers # # The original code from Gary Strangman was heavily adapted for # use in SciPy by Travis Oliphant. The original code came with the # following disclaimer: # # This software is provided "as-is". There are no expressed or...
bsd-3-clause
AlexFine/UberScheduler
Python Server/Uber/lib/requests/packages/urllib3/contrib/ntlmpool.py
714
4741
# urllib3/contrib/ntlmpool.py # Copyright 2008-2013 Andrey Petrov and contributors (see CONTRIBUTORS.txt) # # This module is part of urllib3 and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """ NTLM authenticating pool, contributed by erikcederstran Issue #10, see: http://co...
mit
facelessuser/TabsExtra
tabs_extra.py
1
32989
""" TabsExtra. Copyright (c) 2014 - 2016 Isaac Muse <isaacmuse@gmail.com> License: MIT """ import sublime_plugin import sublime import time import sys from TabsExtra import tab_menu import os import functools from operator import itemgetter import sublime_api from urllib.parse import urljoin from urllib.request impor...
mit
annayqho/TheCannon
presentations/for_michigan/make_talk_plots.py
1
4618
import pickle import matplotlib import numpy as np import matplotlib.pyplot as plt import matplotlib.gridspec as gridspec # make sample spectra plot(dataset.wl, dataset.tr_flux[2,:], alpha=0.7, c='k') title(r"Typical High-S/N LAMOST Spectrum", fontsize=27) xlim(3500, 9500) tick_params(axis='x', labelsize=27) tick_para...
mit
marknca/cling
dependencies/botocore/vendored/requests/packages/urllib3/response.py
478
16459
try: import http.client as httplib except ImportError: import httplib import zlib import io from socket import timeout as SocketTimeout from ._collections import HTTPHeaderDict from .exceptions import ( ProtocolError, DecodeError, ReadTimeoutError, ResponseNotChunked ) from .packages.six import string_type...
apache-2.0
Justaphf/BitcoinUnlimited
qa/rpc-tests/mempool_push.py
1
9835
#!/usr/bin/env python3 # Copyright (c) 2015-2019 The Bitcoin Unlimited developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. import test_framework.loginit # This is a template to make creating new QA tests easy. # You can als...
mit
tonioo/modoboa
modoboa/core/app_settings.py
1
16059
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django import forms from django.conf import settings from django.contrib.auth import password_validation from django.utils.translation import ugettext as _, ugettext_lazy from modoboa.core.password_hashers import get_dovecot_schemes from modoboa.co...
isc
StormTrooper/osmc
package/mediacenter-skin-next-osmc/files/usr/share/kodi/addons/script.module.unidecode/lib/unidecode/x06d.py
252
4651
data = ( 'Zhou ', # 0x00 'Ji ', # 0x01 'Yi ', # 0x02 'Hui ', # 0x03 'Hui ', # 0x04 'Zui ', # 0x05 'Cheng ', # 0x06 'Yin ', # 0x07 'Wei ', # 0x08 'Hou ', # 0x09 'Jian ', # 0x0a 'Yang ', # 0x0b 'Lie ', # 0x0c 'Si ', # 0x0d 'Ji ', # 0x0e 'Er ', # 0x0f 'Xing ', # 0x10 'Fu ...
gpl-2.0
margguo/python-ivi
ivi/scope.py
6
89176
""" Python Interchangeable Virtual Instrument Library Copyright (c) 2012-2014 Alex Forencich 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...
mit
lekum/ansible-modules-extras
cloud/rackspace/rax_mon_alarm.py
153
7760
#!/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...
gpl-3.0
pquentin/django
tests/csrf_tests/tests.py
17
18716
# -*- coding: utf-8 -*- from __future__ import unicode_literals import logging from django.conf import settings from django.http import HttpRequest, HttpResponse from django.middleware.csrf import CSRF_KEY_LENGTH, CsrfViewMiddleware from django.template import RequestContext, Template from django.template.context_pro...
bsd-3-clause
doduytrung/odoo-8.0
addons/account_sequence/account_sequence.py
338
2534
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). All Rights Reserved # $Id$ # # This program is free software: you can redistribute it and/or modify # ...
agpl-3.0
luzfcb/saefacto
saefacto/config/settings.py
1
24164
# -*- coding: utf-8 -*- """ Django settings for saefacto project. For more information on this file, see https://docs.djangoproject.com/en/dev/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/dev/ref/settings/ """ # Build paths inside the project like this: os.pa...
bsd-3-clause
gbd-consult/CartoCSS-Export
CartoCSSExport/ce/cartocss.py
1
66477
"""CartoCSS properties.""" # extracted from https://raw.githubusercontent.com/mapbox/carto/master/docs/latest.md Properties = { "background-color": { "default": None, "description": "Map Background color.", "type": "color" }, "background-image": { "default": "", "de...
gpl-2.0
admetricks/bravado-core
tests/spec/build_api_serving_url_test.py
4
1762
import pytest from bravado_core.spec import build_api_serving_url from bravado_core.exception import SwaggerSchemaError @pytest.fixture def origin_url(): return 'http://www.foo.com:80/bar/api-docs' def test_no_overrides(origin_url): spec = {} assert origin_url == build_api_serving_url(spec, origin_url)...
bsd-3-clause
Linaro/lava-dispatcher
lava_dispatcher/actions/deploy/mps.py
1
5714
# Copyright (C) 2018 Linaro Limited # # Author: Dean Arnold <dean.arnold@linaro.org> # # This file is part of LAVA Dispatcher. # # LAVA Dispatcher 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...
gpl-2.0
wangjun/kivy
kivy/tests/test_widget.py
73
2123
import unittest class WidgetTestCase(unittest.TestCase): def setUp(self): from kivy.uix.widget import Widget self.cls = Widget self.root = Widget() def test_add_remove_widget(self): root = self.root self.assertEqual(root.children, []) c1 = self.cls() r...
mit
gisce/OCB
addons/stock/wizard/stock_change_standard_price.py
44
5709
# -*- 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
nikodtbVf/aima-si
search.py
1
41693
"""Search (Chapters 3-4) The way to use this code is to subclass Problem to create a class of problems, then create problem instances and solve them with calls to the various search functions.""" from utils import ( is_in, argmin, argmax, argmax_random_tie, probability, weighted_sample_with_replacement, memoi...
mit
magic0704/neutron
neutron/plugins/oneconvergence/lib/config.py
43
1872
# Copyright 2014 OneConvergence, 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 requir...
apache-2.0
GabrielL/linux
tools/perf/scripts/python/net_dropmonitor.py
1812
1749
# Monitor the system for dropped packets and proudce a report of drop locations and counts import os import sys sys.path.append(os.environ['PERF_EXEC_PATH'] + \ '/scripts/python/Perf-Trace-Util/lib/Perf/Trace') from perf_trace_context import * from Core import * from Util import * drop_log = {} kallsyms = [] def...
gpl-2.0
manxueitp/cozmo-test
cozmo_sdk_examples/tutorials/02_cozmo_face/03_alarm_clock.py
1
9691
#!/usr/bin/env python3 # Copyright (c) 2016 Anki, 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 in the file LICENSE.txt or at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unles...
mit
farebord/qtile
libqtile/layout/ratiotile.py
5
13299
# -*- coding:utf-8 -*- # Copyright (c) 2011 Florian Mounier # Copyright (c) 2012-2013, 2015 Tycho Andersen # Copyright (c) 2013 Björn Lindström # Copyright (c) 2013 Tao Sauvage # Copyright (c) 2014 ramnes # Copyright (c) 2014 Sean Vig # Copyright (c) 2014 dmpayton # Copyright (c) 2014 dequis # # Permission is hereby gr...
mit
retomerz/intellij-community
python/helpers/pydev/third_party/pep8/lib2to3/lib2to3/fixes/fix_imports.py
326
5693
"""Fix incompatible imports and module references.""" # Authors: Collin Winter, Nick Edds # Local imports from .. import fixer_base from ..fixer_util import Name, attr_chain MAPPING = {'StringIO': 'io', 'cStringIO': 'io', 'cPickle': 'pickle', '__builtin__' : 'builtins', 'c...
apache-2.0
dnaextrim/django_adminlte_x
adminlte/static/plugins/ckeditor/samples/old/api.html.py
1
6969
XXXXXXXXX XXXXX XXXX XXXXXXXXX XXX XXXXXXXXXX XXXXXXXX X XXXXXXXXX XXXXXXXX XXX XXXXXX XXXXXXXXX XXX XXXXXXXXXX XXX XXXXXXXXXX XX XXXXXXXXXXXXXXXXXXXXXXXXXXX XXX XXXXXX XXXXXX XXXXX XXXXXXXXXXXXXXXX XXXXXXXXXX XXXXX XXXXXXX XXXXXXXX XXXXXXXXXXXXXX XXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXX XXXXXXXXXXXXXXXXX XX...
mit
nandub/cjdns
node_build/dependencies/libuv/build/gyp/test/compiler-override/gyptest-compiler-global-settings.py
12
2331
#!/usr/bin/env python # Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Verifies that make_global_settings can be used to override the compiler settings. """ from __future__ import print_function import TestGy...
gpl-3.0
Tayamarn/socorro
webapp-django/crashstats/base/views.py
4
1125
from django import http from django.shortcuts import render def handler500(request): if getattr(request, '_json_view', False): # Every view with the `utils.json_view` decorator sets, # on the request object, that it wants to eventually return # a JSON output. Let's re-use that fact here. ...
mpl-2.0
kurtw/cfgov-refresh
_tests/browser_testing/features/environment.py
3
9487
import os import ConfigParser import logging import httplib import base64 import multiprocessing from datetime import datetime from selenium import webdriver from elasticsearch import Elasticsearch from sheer.wsgi import app_with_config from pages.screenshot import Screenshot from pages.base import Base from pages.na...
cc0-1.0
IV-GII/SocialCookies
ENV1/lib/python2.7/site-packages/pip/vendor/html5lib/treewalkers/etree.py
80
4444
from __future__ import absolute_import, division, unicode_literals import gettext _ = gettext.gettext import re from pip.vendor.six import text_type from . import _base from ..utils import moduleFactoryFactory tag_regexp = re.compile("{([^}]*)}(.*)") def getETreeBuilder(ElementTreeImplementation): ElementTre...
gpl-2.0
will-Do/virt-test
virttest/versionable_class_unittest.py
16
10037
#!/usr/bin/python import unittest import cPickle import sys import common from autotest.client.shared import utils from autotest.client.shared.test_utils import mock from versionable_class import Manager, factory, VersionableClass man = Manager(__name__) # pylint: disable=E1003 def qemu_verison(): return 2 c...
gpl-2.0
fabianp/scikit-learn
examples/linear_model/plot_bayesian_ridge.py
248
2588
""" ========================= Bayesian Ridge Regression ========================= Computes a Bayesian Ridge Regression on a synthetic dataset. See :ref:`bayesian_ridge_regression` for more information on the regressor. Compared to the OLS (ordinary least squares) estimator, the coefficient weights are slightly shift...
bsd-3-clause
initOS/server-tools
base_user_gravatar/models/res_users.py
24
1210
# -*- coding: utf-8 -*- # © 2015 Endika Iglesias # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). import base64 import hashlib import urllib2 from openerp import api, models from openerp.exceptions import Warning as UserError from openerp.tools.translate import _ class ResUsers(models.Model): ...
agpl-3.0
cytec/SickRage
lib/send2trash/plat_other.py
68
5500
# Copyright 2013 Hardcoded Software (http://www.hardcoded.net) # This software is licensed under the "BSD" License as described in the "LICENSE" file, # which should be included with this package. The terms are also available at # http://www.hardcoded.net/licenses/bsd_license # This is a reimplementation of plat_ot...
gpl-3.0
JioCloud/tempest-lib
tempest_lib/services/identity/v3/token_client.py
1
6711
# Copyright 2015 NEC Corporation. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required ...
apache-2.0
pombreda/swarming
appengine/components/support/stats_framework_mock.py
2
2317
# Copyright 2014 The Swarming Authors. All rights reserved. # Use of this source code is governed by the Apache v2.0 license that can be # found in the LICENSE file. """Code to help test cases using stats_framework. Implicitly depends on auto_stub. """ import datetime from components import stats_framework from com...
apache-2.0
schulmar/apitrace
scripts/tracecheck.py
8
7058
#!/usr/bin/env python ########################################################################## # # Copyright 2011 VMware, Inc. # 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 th...
mit
tszym/ansible
lib/ansible/modules/cloud/google/gce_instance_template.py
8
19122
#!/usr/bin/python # Copyright: Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.0', 'status': ['preview'], ...
gpl-3.0
RPGOne/Skynet
node-master/tools/gyp/pylib/gyp/common.py
18
20338
# 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 __future__ import with_statement import collections import errno import filecmp import os.path import re import tempfile import sys # A minimal memoizing d...
bsd-3-clause
JohnOrlando/gnuradio-bitshark
docs/exploring-gnuradio/fm_demod.py
13
4712
#!/usr/bin/env python from gnuradio import gr from gnuradio import audio from gnuradio import mc4020 import sys def high_speed_adc (fg, input_rate): # return gr.file_source (gr.sizeof_short, "dummy.dat", False) return mc4020.source (input_rate, mc4020.MCC_CH3_EN | mc4020.MCC_ALL_1V) # # return a gr.flow_grap...
gpl-3.0
youngeunpark/TizenRT
external/iotivity/iotivity_1.2-rel/extlibs/gtest/gtest-1.7.0/scripts/pump.py
2471
23673
#!/usr/bin/env python # # Copyright 2008, 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...
apache-2.0
forpster/dotfiles
home/.emacs.d/.python-environments/default/lib/python2.7/site-packages/setuptools/depends.py
41
6474
import sys import imp import marshal from distutils.version import StrictVersion from imp import PKG_DIRECTORY, PY_COMPILED, PY_SOURCE, PY_FROZEN from setuptools.extern import six __all__ = [ 'Require', 'find_module', 'get_module_constant', 'extract_constant' ] class Require: """A prerequisite to building o...
mit
spark-test/spark
python/pyspark/sql/tests/test_types.py
1
43002
# -*- encoding: utf-8 -*- # # 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 ...
apache-2.0
projectatomic/commissaire
src/commissaire/containermgr/trivial.py
3
3723
# Copyright (C) 2017 Red Hat, 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 3 of the License, or # (at your option) any later version. # # This program is distributed in ...
gpl-3.0
hrayr-artunyan/shuup
shuup_tests/simple_supplier/test_simple_supplier.py
2
6268
# -*- coding: utf-8 -*- # This file is part of Shuup. # # Copyright (c) 2012-2016, Shoop Ltd. All rights reserved. # # This source code is licensed under the AGPLv3 license found in the # LICENSE file in the root directory of this source tree. import decimal import pytest import random from shuup.admin.modules.product...
agpl-3.0
julien78910/CouchPotatoServer
couchpotato/core/media/movie/providers/trailer/youtube_dl/extractor/freespeech.py
165
1226
from __future__ import unicode_literals import re import json from .common import InfoExtractor class FreespeechIE(InfoExtractor): IE_NAME = 'freespeech.org' _VALID_URL = r'https://www\.freespeech\.org/video/(?P<title>.+)' _TEST = { 'add_ie': ['Youtube'], 'url': 'https://www.freespeech.o...
gpl-3.0
joshblum/django-with-audit
django/test/utils.py
37
7300
from __future__ import with_statement import warnings from django.conf import settings, UserSettingsHolder from django.core import mail from django.test.signals import template_rendered, setting_changed from django.template import Template, loader, TemplateDoesNotExist from django.template.loaders import cached from d...
bsd-3-clause
drxaero/calibre
src/calibre/ebooks/mobi/writer8/mobi.py
14
9980
#!/usr/bin/env python2 # vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai from __future__ import (unicode_literals, division, absolute_import, print_function) __license__ = 'GPL v3' __copyright__ = '2012, Kovid Goyal <kovid@kovidgoyal.net>' __docformat__ = 'restructuredtext en' import time, ...
gpl-3.0
DEVSENSE/PTVS
Python/Tests/TestData/DebuggerProject/ExceptionHandlers.py
7
4438
try: pass except: pass try: pass except: pass try: pass pass pass except: pass pass pass try: pass except ArithmeticError: pass except AssertionError: pass except AttributeError: pass except BaseException: pass except BufferError: pass except BytesWarning: pass except DeprecationWarni...
apache-2.0
hybrideagle/django
django/db/migrations/exceptions.py
199
1240
from __future__ import unicode_literals from django.db.utils import DatabaseError from django.utils.encoding import python_2_unicode_compatible class AmbiguityError(Exception): """ Raised when more than one migration matches a name prefix. """ pass class BadMigrationError(Exception): """ Ra...
bsd-3-clause
michivo/buergerchain
dev_support/local_handysig_proxy/requests/cookies.py
109
18208
# -*- coding: utf-8 -*- """ requests.cookies ~~~~~~~~~~~~~~~~ Compatibility code to be able to use `cookielib.CookieJar` with requests. requests.utils imports from here, so be careful with imports. """ import copy import time import calendar import collections from ._internal_utils import to_native_string from .co...
mit
varunarya10/nova_test_latest
nova/tests/unit/objects/test_instance_action.py
52
16614
# Copyright 2013 IBM Corp. # # 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 agree...
apache-2.0
Huyston/WillNotebook
Lib/configparser.py
9
51296
"""Configuration file parser. A configuration file consists of sections, lead by a "[section]" header, and followed by "name: value" entries, with continuations and such in the style of RFC 822. Intrinsic defaults can be specified by passing them into the ConfigParser constructor as a dictionary. class: ...
gpl-2.0
brettlangdon/dd-agent
tests/core/test_dogstatsd.py
8
33481
# -*- coding: utf-8 -*- # stdlib import random import time import unittest # 3p from nose.plugins.attrib import attr import nose.tools as nt # project from aggregator import DEFAULT_HISTOGRAM_AGGREGATES, get_formatter, MetricsAggregator class TestUnitDogStatsd(unittest.TestCase): @staticmethod def sort_met...
bsd-3-clause