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
ankanch/tieba-zhuaqu
user-application-plugin-dev-kit/default-plugins/singleword/lib/result_functions_file.py
5
4829
import os import datetime import lib.maglib as MSG #这是一个对结果进行初步处理的库 #用来分离抓取结果,作者,发帖时间 #抓取结果应该储存在【用户端根目录】并以result命名 #在测试情况下,抓取结果文件为results.txt #重要全局变量 PATH_SUFFIX = os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir, os.pardir)) PATH_SUFFIX = PATH_SUFFIX[:len(PATH_SUFFIX)-8] PATH_RESULT_FILE = PATH_SUFFI...
gpl-3.0
beblount/Steer-Clear-Backend-Web
env/Lib/site-packages/werkzeug/debug/console.py
280
5557
# -*- coding: utf-8 -*- """ werkzeug.debug.console ~~~~~~~~~~~~~~~~~~~~~~ Interactive console support. :copyright: (c) 2014 by the Werkzeug Team, see AUTHORS for more details. :license: BSD. """ import sys import code from types import CodeType from werkzeug.utils import escape from werkzeug.loca...
mit
evz/python-ev3
test/test_ev3_key.py
4
1099
from ev3.ev3dev import Key import unittest from util import get_input class TestKey(unittest.TestCase): def test_key(self): d = Key() get_input('Test keyboard. Hold Up key') print(d.up) get_input('Test keyboard. Release Up key') print(d.up) get_input('Test keyboard...
apache-2.0
fbradyirl/home-assistant
tests/components/homekit_controller/test_config_flow.py
4
26689
"""Tests for homekit_controller config flow.""" import json from unittest import mock import homekit import pytest from homeassistant.components.homekit_controller import config_flow from homeassistant.components.homekit_controller.const import KNOWN_DEVICES from tests.common import MockConfigEntry from tests.compone...
apache-2.0
wdurhamh/statsmodels
statsmodels/tsa/arima_model.py
9
77514
# Note: The information criteria add 1 to the number of parameters # whenever the model has an AR or MA term since, in principle, # the variance could be treated as a free parameter and restricted # This code does not allow this, but it adds consistency with other # packages such as gretl and X1...
bsd-3-clause
AOKP/external_chromium_org
chrome/test/functional/chromoting/it2me_basic.py
68
1355
#!/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. """Basic tests for Chromoting it2me.""" import chromoting_base import pyauto class IT2MeBasic(chromoting_base.ChromotingBase): ...
bsd-3-clause
pollux1er/sajoscol
fckeditor/editor/filemanager/connectors/py/connector.py
55
4026
#!/usr/bin/env python """ FCKeditor - The text editor for Internet - http://www.fckeditor.net Copyright (C) 2003-2008 Frederico Caldeira Knabben == BEGIN LICENSE == Licensed under the terms of any of the following licenses at your choice: - GNU General Public License Version 2 or later (the "GPL") http://www.gn...
gpl-2.0
SnappleCap/oh-mainline
vendor/packages/requests/requests/packages/urllib3/contrib/pyopenssl.py
488
9326
'''SSL with SNI_-support for Python 2. Follow these instructions if you would like to verify SSL certificates in Python 2. Note, the default libraries do *not* do certificate checking; you need to do additional work to validate certificates yourself. This needs the following packages installed: * pyOpenSSL (tested wi...
agpl-3.0
MartinThoma/hwrt
hwrt/features_plugin.py
1
2007
"""Features in development.""" # Core Library modules import os import urllib.request # Local modules from . import handwritten_data, utils class Bitmap: """n × n grayscale bitmap of the recording.""" normalize = True def __init__(self, n=28): self.n = n # Size of the bitmap (n x n) def...
mit
openstack/heat
heat/policies/build_info.py
1
1502
# 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 # d...
apache-2.0
levibostian/VSAS
VSAS system/VSAS/vsasGUI/EmailScreen.py
1
4232
""" Test of an Email Screen Author: Kristen Nielsen kristen.e.nielsen@gmail.com Modeled after tkSimpleDialog.py from pythonware.com """ from Tkinter import * import tkMessageBox as MsgBox from multilistbox import MultiListbox from emailInputNew import EmailInput class EmailSettings(Toplevel): def _...
mit
dzheng256/PittAPI
PittAPI/laundry.py
2
3744
""" The Pitt API, to access workable data of the University of Pittsburgh Copyright (C) 2015 Ritwik Gupta This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your ...
gpl-2.0
mropert/conan
conans/test/integration/go_diamond_test.py
1
3953
import unittest from conans.test.utils.tools import TestServer, TestClient from conans.model.ref import ConanFileReference import platform import os from conans.test.utils.context_manager import CustomEnvPath from conans.test.utils.test_files import hello_conan_files from nose.plugins.attrib import attr @attr('golang...
mit
tai271828/courses
cs/udacity/cs101-intro-cs/code/lesson6/problem-set/lucky_search.py
4
5349
#Feeling Lucky #In Unit 6, we implemented a page ranking algorithm, but didn't finish the final #step of using it to improve our search results. For this question, you will use #the page rankings to produce the best output for a given query. #Define a procedure, lucky_search, that takes as input an index, a ranks #d...
mit
kylepjohnson/cltk
scripts/pipeline_example.py
4
5512
"""An example of a proposed NLP pipeline system. Goals are to allow for: 1. default NLP pipeline for any given language 2. users to override default pipeline 3. users to choose alternative code (classes/methods/functions) w/in the CLTK 4. users to use their own custom code (inheriting or replacing those...
mit
alanjw/GreenOpenERP-Win-X86
python/Lib/test/test_macpath.py
11
2057
import macpath from test import test_support, test_genericpath import unittest class MacPathTestCase(unittest.TestCase): def test_abspath(self): self.assertEqual(macpath.abspath("xx:yy"), "xx:yy") def test_isabs(self): isabs = macpath.isabs self.assertTrue(isabs("xx:yy"))...
agpl-3.0
Lana-B/Pheno4T
madanalysis/enumeration/observable_type.py
1
6721
################################################################################ # # Copyright (C) 2012-2013 Eric Conte, Benjamin Fuks # The MadAnalysis development team, email: <ma5team@iphc.cnrs.fr> # # This file is part of MadAnalysis 5. # Official website: <https://launchpad.net/madanalysis5> # # MadAnal...
gpl-3.0
mganeva/mantid
scripts/Muon/GUI/Common/context_example/context_example_widget.py
1
1841
# Mantid Repository : https://github.com/mantidproject/mantid # # Copyright &copy; 2018 ISIS Rutherford Appleton Laboratory UKRI, # NScD Oak Ridge National Laboratory, European Spallation Source # & Institut Laue - Langevin # SPDX - License - Identifier: GPL - 3.0 + from __future__ import (absolute_import, div...
gpl-3.0
duyetdev/openerp-6.1.1
openerp/addons/account_invoice_layout/report/report_account_invoice_layout.py
9
6486
# -*- 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
cumc-dbmi/pmi_sprint_reporter
file_transfer.py
1
3848
from base64 import b64encode from io import BytesIO from uuid import uuid4 import requests import time import wddx import settings TRANSFER_API_URL_FMT = 'https://transfer.nyp.org/seos/1000/%s.api' TRANSFER_LOGIN_URL = TRANSFER_API_URL_FMT % 'login' TRANSFER_FIND_URL = TRANSFER_API_URL_FMT % 'find' TRANSFER_PUT_URL ...
mit
WholeGrainGoats/servo
tests/wpt/web-platform-tests/tools/pytest/_pytest/assertion/util.py
175
11730
"""Utilities for assertion debugging""" import pprint import _pytest._code import py try: from collections import Sequence except ImportError: Sequence = list BuiltinAssertionError = py.builtin.builtins.AssertionError u = py.builtin._totext # The _reprcompare attribute on the util module is used by the new a...
mpl-2.0
funkring/fdoo
addons-funkring/shop_delivery/__openerp__.py
1
1296
# -*- coding: utf-8 -*- ############################################################################# # # Copyright (c) 2007 Martin Reisenhofer <martin.reisenhofer@funkring.net> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as pu...
agpl-3.0
tillahoffmann/tensorflow
tensorflow/contrib/ndlstm/python/misc.py
121
3612
# 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 applicable ...
apache-2.0
salguarnieri/intellij-community
python/lib/Lib/site-packages/django/conf/locale/nn/formats.py
685
1657
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'j. F Y' TIME_FORMAT = 'H:i' DATETIME_FORMAT = 'j. F Y H:i' YEAR_MONTH_FOR...
apache-2.0
cgstudiomap/cgstudiomap
main/parts/odoo/addons/association/__init__.py
886
1054
# -*- 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...
agpl-3.0
ujjwalwahi/odoo
addons/lunch/tests/test_lunch.py
345
5045
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (c) 2012-TODAY OpenERP S.A. <http://openerp.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of ...
agpl-3.0
infoxchange/lettuce
tests/integration/lib/Django-1.3/tests/regressiontests/settings_tests/tests.py
47
2686
from django.conf import settings from django.utils import unittest from django.conf import settings, UserSettingsHolder, global_settings class SettingsTests(unittest.TestCase): # # Regression tests for #10130: deleting settings. # def test_settings_delete(self): settings.TEST = 'test' ...
gpl-3.0
giraldeau/autovm
autovm/helpers.py
1
3970
#!/usr/bin/env python # coding=utf-8 import os from os.path import join, dirname, exists from os import makedirs, utime, unlink, walk from heapq import heappush, heappop, heappushpop import platform import sys def default_dist(): (a, b, c) = platform.dist() return c def default_arch(): mapping = { 'x86_6...
gpl-3.0
endlessm/chromium-browser
chrome/android/java/src/PRESUBMIT.py
1
8949
# Copyright (c) 2017 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. """Presubmit script for Android Java code. See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts for more details about the presub...
bsd-3-clause
kangfend/django
django/contrib/admindocs/middleware.py
477
1198
from django import http from django.conf import settings class XViewMiddleware(object): """ Adds an X-View header to internal HEAD requests -- used by the documentation system. """ def process_view(self, request, view_func, view_args, view_kwargs): """ If the request method is HEAD and...
bsd-3-clause
Uli1/mapnik
scons/scons-local-2.4.0/SCons/Tool/ifort.py
1
3327
"""SCons.Tool.ifort Tool-specific initialization for newer versions of the Intel Fortran Compiler for Linux/Windows (and possibly Mac OS X). There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) ...
lgpl-2.1
Zeken/audacity
lib-src/lv2/lilv/waflib/Tools/dbus.py
318
1142
#! /usr/bin/env python # encoding: utf-8 # WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file from waflib import Task,Errors from waflib.TaskGen import taskgen_method,before_method @taskgen_method def add_dbus_file(self,filename,prefix,mode): if not hasattr(self,'dbus...
gpl-2.0
allenai/allennlp
allennlp/training/trainer.py
1
56811
import datetime import logging import math import os import re import time import traceback from contextlib import contextmanager from typing import Any, Callable, Dict, Iterator, List, Optional, Tuple, Type, Union from allennlp.common.util import int_to_device import torch import torch.distributed as dist from torch...
apache-2.0
christabor/codeReflector
tests/test_htmlreflector.py
1
4205
# -*- coding: utf-8 -*- __author__ = """Chris Tabor (dxdstudio@gmail.com)""" import unittest from code_reflector import html_reflector class SelectorOutputTestCase(unittest.TestCase): def setUp(self): self.ref = html_reflector.HTMLReflector() def test_single_class(self): res = self.ref.pro...
apache-2.0
engine95/navel-990
tools/perf/scripts/python/failed-syscalls-by-pid.py
11180
2058
# failed system call counts, by pid # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Displays system-wide failed system call totals, broken down by pid. # If a [comm] arg is specified, only syscalls called by [comm] are displayed. import os import sys sys.pa...
gpl-2.0
liang42hao/bokeh
bokeh/models/renderers.py
8
3281
""" Models (mostly base classes) for the various kinds of renderer types that Bokeh supports. """ from __future__ import absolute_import import logging from ..plot_object import PlotObject from ..properties import abstract from ..properties import String, Enum, Instance from ..enums import Units, RenderLevel from .....
bsd-3-clause
co-ment/comt
src/cm/tests/test_comment_positioning.py
1
4722
# -*- coding: utf-8 -*- from django.test import TestCase from BeautifulSoup import BeautifulSoup from cm.models import * from django.core.cache import cache # python manage.py test #  # python manage.py test cm.CommentPositioningTest def create_comment(start_wrapper=0, end_wrapper=0, start_offset=0, end_offse...
agpl-3.0
kou/zulip
docs/conf.py
4
11256
# # zulip-contributor-docs documentation build configuration file, created by # sphinx-quickstart on Mon Aug 17 16:24:04 2015. # # 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 config...
apache-2.0
risicle/django
django/core/checks/security/base.py
341
6313
from django.conf import settings from .. import Tags, Warning, register SECRET_KEY_MIN_LENGTH = 50 SECRET_KEY_MIN_UNIQUE_CHARACTERS = 5 W001 = Warning( "You do not have 'django.middleware.security.SecurityMiddleware' " "in your MIDDLEWARE_CLASSES so the SECURE_HSTS_SECONDS, " "SECURE_CONTENT_TYPE_NOSNIFF...
bsd-3-clause
google/playhvz
backend/constants.py
1
1174
#!/usr/bin/python # # Copyright 2017 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 or a...
apache-2.0
ecrespo/django_kanban-agile
kanban/lib/python2.7/site-packages/pip/_vendor/html5lib/treebuilders/__init__.py
1730
3405
"""A collection of modules for building different kinds of tree from HTML documents. To create a treebuilder for a new type of tree, you need to do implement several things: 1) A set of classes for various types of elements: Document, Doctype, Comment, Element. These must implement the interface of _base.treebuilders...
mit
openstack-ja/horizon
openstack_dashboard/dashboards/project/volumes/tests.py
2
34464
# 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
hkawasaki/kawasaki-aio8-2
common/lib/xmodule/xmodule/video_module/video_handlers.py
7
14549
""" Handlers for video module. StudentViewHandlers are handlers for video module instance. StudioViewHandlers are handlers for video descriptor instance. """ import os import json import logging from webob import Response from xblock.core import XBlock from xmodule.course_module import CourseDescriptor from xmodule....
agpl-3.0
rohit21122012/DCASE2013
runs/2016/dnn2016med_traps/traps20/src/files.py
56
6764
#!/usr/bin/env python # -*- coding: utf-8 -*- import cPickle as pickle import csv import numpy import os import wave import librosa import yaml def load_audio(filename, mono=True, fs=44100): """Load audio file into numpy array Supports 24-bit wav-format, and flac audio through librosa. Parameters ...
mit
williamdean/pywbem
testsuite/test_mof_compiler.py
1
5847
#!/usr/bin/env python # from comfychair import main, TestCase, NotRunError from pywbem import * from pywbem.mof_compiler import MOFCompiler, MOFWBEMConnection, MOFParseError from urllib import urlretrieve, urlopen from time import time import os import sys from zipfile import ZipFile from tempfile import TemporaryF...
lgpl-2.1
t3dev/odoo
addons/stock/tests/test_report.py
2
1121
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. import odoo import odoo.tests class TestReports(odoo.tests.TransactionCase): def test_reports(self): product1 = self.env['product.product'].create({ 'name': 'Mellohi', 'default_code':...
gpl-3.0
Allianzcortex/scrapy
tests/test_utils_spider.py
147
1056
import unittest from scrapy.http import Request from scrapy.item import BaseItem from scrapy.utils.spider import iterate_spider_output, iter_spider_classes from scrapy.spiders import CrawlSpider class MyBaseSpider(CrawlSpider): pass # abstract spider class MySpider1(MyBaseSpider): name = 'myspider1' class ...
bsd-3-clause
alexpilotti/compute-hyperv
hyperv/nova/cluster/driver.py
2
3537
# Copyright (c) 2016 Cloudbase Solutions Srl # # 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 applicab...
apache-2.0
gibiansky/tensorflow
tensorflow/contrib/factorization/python/ops/gmm_ops.py
3
18636
# 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
scholer/cadnano2.5
cadnano/color.py
2
3229
# -*- coding: utf-8 -*- """This allows the model to have a :class:`Color` object class without the need for :class:`PyQt5.QtGui.QColor` When running the Qt Application, :class:`QColor` will be used, otherwise an API compatible class is used and exported as a :class:`Color` object Currently :class:`Color` objects are ...
mit
CasparLi/calibre
src/calibre/gui2/dbus_export/tray.py
14
7235
#!/usr/bin/env python2 # vim:fileencoding=utf-8 from __future__ import (unicode_literals, division, absolute_import, print_function) __license__ = 'GPL v3' __copyright__ = '2014, Kovid Goyal <kovid at kovidgoyal.net>' # Implement the StatusNotifierItem spec for creating a system tray icon in #...
gpl-3.0
hybrid-storage-dev/cinder-fs-111t-hybrid-cherry
volume/drivers/san/san.py
6
6950
# Copyright 2011 Justin Santa Barbara # 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
alfredodeza/remoto
remoto/tests/test_process.py
2
1677
from mock import Mock from remoto import process class TestExtendPath(object): def setup(self): self.path = '/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin' def test_no_environment_sets_path(self): fake_conn = Mock() fake_conn.gateway.remote_exec.return_value = fake_con...
mit
jsjohnst/tornado
tornado/test/tcpserver_test.py
33
1361
from __future__ import absolute_import, division, print_function, with_statement import socket from tornado import gen from tornado.iostream import IOStream from tornado.log import app_log from tornado.stack_context import NullContext from tornado.tcpserver import TCPServer from tornado.testing import AsyncTestCase, E...
apache-2.0
dleehr/cwltool
cwltool/schemas/v1.0/salad/schema_salad/validate.py
7
13072
from __future__ import absolute_import import pprint import avro.schema from avro.schema import Schema import sys import re import logging import six from six.moves import urllib from six.moves import range from typing import Any, List, Set, Union, Text from .sourceline import SourceLine, lineno_re, bullets, indent ...
apache-2.0
Distrotech/binutils
gdb/testsuite/gdb.perf/skip-prologue.py
41
1509
# Copyright (C) 2013-2014 Free Software Foundation, 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 progr...
gpl-2.0
yize/grunt-tps
tasks/lib/python/Lib/python2.7/site-packages/lxml/doctestcompare.py
51
18287
""" lxml-based doctest output comparison. Note: normally, you should just import the `lxml.usedoctest` and `lxml.html.usedoctest` modules from within a doctest, instead of this one:: >>> import lxml.usedoctest # for XML output >>> import lxml.html.usedoctest # for HTML output To use this module directly, yo...
mit
rabipanda/tensorflow
tensorflow/python/estimator/training.py
4
37527
# 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
jessicalucci/TaskManagement
taskflow/engines/dist_engine/dtclient.py
1
7108
# -*- coding: utf-8 -*- # vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright (C) 2013 Rackspace Hosting 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 #...
apache-2.0
javierlgroba/Eventer-gapp
djangotoolbox/middleware.py
70
2830
from django.conf import settings from django.http import HttpResponseRedirect from django.utils.cache import patch_cache_control LOGIN_REQUIRED_PREFIXES = getattr(settings, 'LOGIN_REQUIRED_PREFIXES', ()) NO_LOGIN_REQUIRED_PREFIXES = getattr(settings, 'NO_LOGIN_REQUIRED_PREFIXES', ...
lgpl-3.0
skg-net/ansible
lib/ansible/modules/utilities/logic/debug.py
76
1962
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright 2012 Dag Wieers <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_version': '1.1', ...
gpl-3.0
rfguri/vimfiles
bundle/ycm/third_party/ycmd/third_party/JediHTTP/vendor/jedi/docs/_themes/flask_theme_support.py
38
6672
""" Copyright (c) 2010 by Armin Ronacher. Some rights reserved. Redistribution and use in source and binary forms of the theme, 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 condition...
mit
lokirius/python-for-android
python3-alpha/extra_modules/gdata/apps/service.py
47
20661
#!/usr/bin/python # # Copyright (C) 2007 SIOS Technology, 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 appli...
apache-2.0
Dev4X/oppia
extensions/rules/music_phrase.py
20
4026
# coding: utf-8 # # Copyright 2013 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 ...
apache-2.0
Dev-Cloud-Platform/Dev-Cloud
dev_cloud/cc1/src/clm/utils/decorators.py
1
10248
# -*- coding: utf-8 -*- # @COPYRIGHT_begin # # Copyright [2010-2014] Institute of Nuclear Physics PAN, Krakow, Poland # # 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.apac...
apache-2.0
opmuse/opmuse
opmuse/sizeof.py
1
1750
# stolen from http://code.activestate.com/recipes/577504/ with some minor changes # for pep8 compatibility from __future__ import print_function from sys import getsizeof, stderr from itertools import chain from collections import deque try: from reprlib import repr except ImportError: pass def total_size(o,...
agpl-3.0
skuda/client-python
examples/example3.py
4
1423
# Copyright 2016 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 applicable law or agreed to ...
apache-2.0
sunlightlabs/read_FEC
fecreader/summary_data/management/commands/update_all_candidate_times.py
1
3767
from datetime import date from django.core.management.base import BaseCommand, CommandError from django.db.models import Sum from summary_data.utils.summary_utils import summarize_committee_periodic_webk from summary_data.models import Candidate_Overlay, Authorized_Candidate_Committees, Committee_Time_Summary, Comm...
bsd-3-clause
sobomax/virtualbox_64bit_edd
src/VBox/Devices/EFI/Firmware/BaseTools/Source/Python/Common/GlobalData.py
11
1624
## @file # This file is used to define common static strings used by INF/DEC/DSC files # # Copyright (c) 2007, Intel Corporation. All rights reserved.<BR> # This program and the accompanying materials # are licensed and made available under the terms and conditions of the BSD License # which accompanies this distributi...
gpl-2.0
waynenilsen/statsmodels
statsmodels/tsa/statespace/tools.py
19
12762
""" Statespace Tools Author: Chad Fulton License: Simplified-BSD """ from __future__ import division, absolute_import, print_function import numpy as np from statsmodels.tools.data import _is_using_pandas from . import _statespace try: from scipy.linalg.blas import find_best_blas_type except ImportError: # prag...
bsd-3-clause
delighted/phantomjs
src/breakpad/src/tools/gyp/pylib/gyp/MSVSProject.py
137
7491
#!/usr/bin/python2.4 # Copyright (c) 2009 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. """Visual Studio project reader/writer.""" import common import xml.dom import xml.dom.minidom import MSVSNew #----------------------------...
bsd-3-clause
dednal/chromium.src
tools/idl_parser/idl_node.py
125
5444
#!/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 sys # # IDL Node # # IDL Node defines the IDLAttribute and IDLNode objects which are constructed # by the parser as it proc...
bsd-3-clause
stefan-jonasson/home-assistant
homeassistant/components/switch/bbb_gpio.py
13
2650
""" Allows to configure a switch using BeagleBone Black GPIO. For more details about this component, please refer to the documentation at https://home-assistant.io/components/switch.bbb_gpio/ """ import logging import voluptuous as vol from homeassistant.components.switch import PLATFORM_SCHEMA import homeassistant....
mit
alem0lars/playbook-gentoo-install
roles/common_gentoo/library/select_mirror.py
3
8776
#!/usr/bin/python # -*- coding: utf-8 -*- # ------------------------------------------------------------------------------ # IMPORTS ---------------------------------------------------------------------- import copy, json, sys, xml.etree.ElementTree PY3K = sys.version_info >= (3, 0) if PY3K: from urllib.request...
apache-2.0
mattuuh7/incubator-airflow
airflow/operators/dagrun_operator.py
28
2969
# -*- coding: utf-8 -*- # # 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
root-mirror/root
build/misc/argparse2help.py
26
2276
import sys import importlib import os def getLongest(): longestSize = 0 for arg in listArgs: if (len(arg.option_strings)==0): size = len(arg.dest) else: size = len(", ".join(arg.option_strings)) longestSize = max(longestSize, size) return longestSize def write_header(parser, fileName): longestSize = g...
lgpl-2.1
rversteegen/commandergenius
project/jni/python/src/Demo/sockets/ftp.py
42
3928
# A simple FTP client. # # The information to write this program was gathered from RFC 959, # but this is not a complete implementation! Yet it shows how a simple # FTP client can be built, and you are welcome to extend it to suit # it to your needs... # # How it works (assuming you've read the RFC): # # User commands...
lgpl-2.1
duducosmos/pgs4a
python-install/lib/python2.7/xml/dom/expatbuilder.py
182
36382
"""Facility to use the Expat parser to load a minidom instance from a string or file. This avoids all the overhead of SAX and pulldom to gain performance. """ # Warning! # # This module is tightly bound to the implementation details of the # minidom DOM and can't be used with other DOM implementations. This # is due...
lgpl-2.1
gorcz/security_monkey
security_monkey/watchers/security_group.py
11
8192
# Copyright 2014 Netflix, 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...
apache-2.0
SickGear/SickGear
lib/apprise/plugins/NotifySNS.py
2
23526
# -*- 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
ThirdProject/android_external_chromium_org
tools/telemetry/telemetry/core/backends/browser_backend.py
23
2646
# 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. from telemetry.core import util from telemetry.core import web_contents class ExtensionsNotSupportedException(Exception): pass class BrowserBackend(obje...
bsd-3-clause
FireWRT/OpenWrt-Firefly-Libraries
staging_dir/host/lib/python2.7/test/test_traceback.py
26
8038
"""Test cases for traceback module""" from StringIO import StringIO import sys import unittest from imp import reload from test.test_support import run_unittest, is_jython, Error, cpython_only import traceback class TracebackCases(unittest.TestCase): # For now, a very minimal set of tests. I want to be sure th...
gpl-2.0
Moriadry/tensorflow
tensorflow/contrib/fused_conv/python/ops/fused_conv2d_bias_activation_benchmark.py
40
9766
# 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
codingpoets/tigl
misc/math-scripts/ms_componentSegmentGeom.py
2
19336
# # Copyright (C) 2007-2013 German Aerospace Center (DLR/SC) # # Created: 2012-12-17 Martin Siggel <Martin.Siggel@dlr.de> # # 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.ap...
apache-2.0
wangjun/flask-admin
examples/sqla/app.py
7
10049
import os import os.path as op from flask import Flask from flask.ext.sqlalchemy import SQLAlchemy from wtforms import validators from flask.ext import admin from flask.ext.admin.contrib import sqla from flask.ext.admin.contrib.sqla import filters # Create application app = Flask(__name__) # Create dummy secrey ke...
bsd-3-clause
jaysonsantos/servo
tests/wpt/web-platform-tests/cors/resources/cors-makeheader.py
122
2224
import json def main(request, response): origin = request.GET.first("origin", request.headers.get('origin')) if "check" in request.GET: token = request.GET.first("token") value = request.server.stash.take(token) if value is not None: if request.GET.first("check", None) == "...
mpl-2.0
bertdecoensel/noysim
noysim/viewer.py
1
28081
# Noysim -- Noise simulation tools for Aimsun. # Copyright (c) 2010-2011 by Bert De Coensel, Ghent University & Griffith University. # # Classes for sending and viewing noise levels in real-time import os import sys import socket import threading import time import random import msvcrt if not hasattr(sys...
mit
guorendong/iridium-browser-ubuntu
third_party/google_input_tools/builder.py
52
6720
#!/usr/bin/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. """Closure builder for Javascript.""" import argparse import json import os import re _BASE_REGEX_STRING = r'^\s*goog\.%s\(\s*[\'"](.+)[\...
bsd-3-clause
jun66j5/trac-ja
trac/web/fcgi_frontend.py
13
1642
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C)2005-2009 Edgewall Software # Copyright (C) 2005 Matthew Good <trac@matt-good.net> # All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. The terms # are also ava...
bsd-3-clause
bobrathbone/pischools
display_ip/lcd_class.py
2
5251
#!/usr/bin/env python # # $Id: lcd_class.py,v 1.1 2013/06/11 11:46:56 bob Exp $ # Raspberry Pi Internet Radio # using an HD44780 LCD display # # Author : Bob Rathbone # Site : http://www.bobrathbone.com # # From original LCD routines : Matt Hawkins # Site : http://www.raspberrypi-spy.co.uk # # Expanded to use 4 x 2...
gpl-3.0
dcroc16/skunk_works
google_appengine/lib/django-1.5/django/utils/six.py
84
24371
"""Utilities for writing code that runs on Python 2 and 3""" # Copyright (c) 2010-2014 Benjamin Peterson # # 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 with...
mit
Qalthos/ansible
test/units/modules/messaging/rabbitmq/test_rabbimq_user.py
55
6653
# -*- coding: utf-8 -*- from ansible.modules.messaging.rabbitmq import rabbitmq_user from units.compat.mock import patch from units.modules.utils import AnsibleExitJson, AnsibleFailJson, ModuleTestCase, set_module_args class TestRabbitMQUserModule(ModuleTestCase): def setUp(self): super(TestRabbitMQUserM...
gpl-3.0
StephaneP/volatility
volatility/plugins/linux/pslist.py
44
4046
# Volatility # Copyright (C) 2007-2013 Volatility Foundation # # This file is part of Volatility. # # Volatility is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your o...
gpl-2.0
craigcitro/pydatalab
tests/bigquery/schema_tests.py
6
4284
# 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 agreed ...
apache-2.0
ZacariasBendeck/youtube-dl
youtube_dl/extractor/metacafe.py
87
10165
from __future__ import unicode_literals import re from .common import InfoExtractor from ..compat import ( compat_parse_qs, compat_urllib_parse, compat_urllib_parse_unquote, compat_urllib_request, ) from ..utils import ( determine_ext, ExtractorError, int_or_none, ) class MetacafeIE(Info...
unlicense
ess/dd-agent
checks.d/mcache.py
22
7699
# 3rd party import memcache # project from checks import AgentCheck # Ref: http://code.sixapart.com/svn/memcached/trunk/server/doc/protocol.txt # Name Type Meaning # ---------------------------------- # pid 32u Process id of this server process # uptime 32u Number o...
bsd-3-clause
openstack/swift
swift/cli/ringcomposer.py
3
6553
# Copyright (c) 2017 OpenStack Foundation # # 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 ...
apache-2.0
GedheFoundation/sidesa2.0
surat_masuk.py
1
6371
#Boa:Frame:surat_masuk import wx import wx.richtext import wx.lib.buttons import input_administrasi_surat def create(parent): return surat_masuk(parent) [wxID_SURAT_MASUK, wxID_SURAT_MASUKDARI, wxID_SURAT_MASUKDATEPICKERCTRL1, wxID_SURAT_MASUKINPUT_KETERANGAN, wxID_SURAT_MASUKINPUT_NOMOR_SURAT, wxID_SURAT_MA...
gpl-2.0
benoitsteiner/tensorflow
tensorflow/python/layers/core.py
22
12426
# 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
calamares/calamares
src/modules/dummypythonqt/main.py
1
8246
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # === This file is part of Calamares - <https://calamares.io> === # # SPDX-FileCopyrightText: 2016-2017 Teo Mrnjavac <teo@kde.org> # SPDX-FileCopyrightText: 2017 Alf Gaida <agaida@siduction.org> # SPDX-License-Identifier: GPL-3.0-or-later # # Calamares is Free So...
gpl-3.0