repo_name
stringlengths
5
100
path
stringlengths
4
375
copies
stringclasses
991 values
size
stringlengths
4
7
content
stringlengths
666
1M
license
stringclasses
15 values
priyankadeswal/network-address-translator
src/fd-net-device/bindings/modulegen_customizations.py
128
1118
import os def post_register_types(root_module): enabled_features = os.environ['NS3_ENABLED_FEATURES'].split(',') if 'EmuFdNetDevice' not in enabled_features: if 'ns3::EmuFdNetDeviceHelper'in root_module: root_module.classes.remove(root_module['ns3::EmuFdNetDeviceHelper']) if 'TapFdNet...
gpl-2.0
tomchristie/django
tests/forms_tests/widget_tests/test_splithiddendatetimewidget.py
45
2390
from datetime import datetime from django.forms import SplitHiddenDateTimeWidget from django.test import override_settings from django.utils import translation from .base import WidgetTest class SplitHiddenDateTimeWidgetTest(WidgetTest): widget = SplitHiddenDateTimeWidget() def test_render_empty(self): ...
bsd-3-clause
mezz64/home-assistant
homeassistant/components/deconz/cover.py
5
3276
"""Support for deCONZ covers.""" from homeassistant.components.cover import ( ATTR_POSITION, DEVICE_CLASS_WINDOW, DOMAIN, SUPPORT_CLOSE, SUPPORT_OPEN, SUPPORT_SET_POSITION, SUPPORT_STOP, CoverEntity, ) from homeassistant.core import callback from homeassistant.helpers.dispatcher import a...
apache-2.0
p0nce/tofbot
plugins/lis.py
2
4512
# Lispy: Scheme Interpreter in Python # (c) Peter Norvig, 2010-16; See http://norvig.com/lispy.html from __future__ import division import math import operator as op # Types Symbol = str # A Lisp Symbol is implemented as a Python str List = list # A Lisp List is implemented as a Python list Numb...
bsd-2-clause
EDUlib/edx-platform
openedx/core/djangoapps/content/block_structure/tests/helpers.py
4
10731
""" Common utilities for tests in block_structure module """ from contextlib import contextmanager from uuid import uuid4 from unittest.mock import patch from opaque_keys.edx.locator import BlockUsageLocator, CourseLocator from xmodule.modulestore.exceptions import ItemNotFoundError from ..api import get_cache fro...
agpl-3.0
rdelval/gorealis
vendor/git.apache.org/thrift.git/test/py/RunClientServer.py
14
12502
#!/usr/bin/env python # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "L...
apache-2.0
ahuarte47/QGIS
python/plugins/processing/preconfigured/NewPreconfiguredAlgorithmAction.py
15
1871
# -*- coding: utf-8 -*- """ *************************************************************************** NewPreconfiguredAlgorithmAction.py --------------------- Date : April 2016 Copyright : (C) 2016 by Victor Olaya Email : volayaf at gmail dot com ********...
gpl-2.0
Ffreasy/crazyflie-clients-python
lib/cflib/crazyflie/toccache.py
31
4215
#!/usr/bin/env python # -*- coding: utf-8 -*- # # || ____ _ __ # +------+ / __ )(_) /_______________ _____ ___ # | 0xBC | / __ / / __/ ___/ ___/ __ `/_ / / _ \ # +------+ / /_/ / / /_/ /__/ / / /_/ / / /_/ __/ # || || /_____/_/\__/\___/_/ \__,_/ /___/\___/ # # Copyright (C) 20...
gpl-2.0
eecsu/BET
bet/postProcess/postTools.py
2
12305
# Copyright (C) 2014-2016 The BET Development Team """ This module provides methods for postprocessing probabilities and data. """ import logging import numpy as np import bet.sample as sample class dim_not_matching(Exception): """ Exception for when the dimension is inconsistent. """ class bad_object(E...
gpl-3.0
lunafeng/django
django/contrib/gis/maps/google/__init__.py
287
2771
""" This module houses the GoogleMap object, used for generating the needed javascript to embed Google Maps in a Web page. Google(R) is a registered trademark of Google, Inc. of Mountain View, California. Example: * In the view: return render_to_response('template.html', {'google' : GoogleMap(key="...
bsd-3-clause
stackforge/monasca-api
monasca_api/common/policy/policy_engine.py
1
8717
# Copyright 2017 OP5 AB # Copyright 2017 FUJITSU LIMITED # Copyright (c) 2011 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 # # ...
apache-2.0
jstoxrocky/statsmodels
statsmodels/regression/tests/test_regression.py
6
37622
""" Test functions for models.regression """ # TODO: Test for LM from statsmodels.compat.python import long, lrange import warnings import pandas import numpy as np from numpy.testing import (assert_almost_equal, assert_approx_equal, assert_raises, assert_equal, assert_allclose) from scipy.l...
bsd-3-clause
splav/servo
tests/wpt/web-platform-tests/common/security-features/subresource/font.py
16
4580
import os, sys, base64 sys.path.insert(0, os.path.dirname(os.path.abspath(__file__))) import subresource def generate_payload(request, server_data): data = ('{"headers": %(headers)s}') % server_data if "id" in request.GET: request.server.stash.put(request.GET["id"], data) # Simple base64 encoded .t...
mpl-2.0
ryfeus/lambda-packs
Keras_tensorflow_nightly/source2.7/tensorflow/contrib/factorization/python/ops/gen_factorization_ops.py
1
11829
"""Python wrappers around TensorFlow ops. This file is MACHINE GENERATED! Do not edit. Original C++ source file: gen_factorization_ops.cc """ import collections as _collections import six as _six from tensorflow.python import pywrap_tensorflow as _pywrap_tensorflow from tensorflow.python.eager import context as _con...
mit
rmboggs/django
tests/forms_tests/widget_tests/test_splitdatetimewidget.py
202
1943
from datetime import date, datetime, time from django.forms import SplitDateTimeWidget from .base import WidgetTest class SplitDateTimeWidgetTest(WidgetTest): widget = SplitDateTimeWidget() def test_render_empty(self): self.check_html(self.widget, 'date', '', html=( '<input type="text" ...
bsd-3-clause
DIYgod/python
DIYgod/0006/important_word.py
1
1368
# -*- coding: utf-8 -*- # 第 0006 题:你有一个目录,放了你一个月的日记,都是 txt,为了避免分词的问题,假设内容都是英文,请统计出你认为每篇日记最重要的词。 import re import os # Get all files in designated path def get_files(path): filepath = os.listdir(path) files = [] for fp in filepath: fppath = path + '/' + fp if(os.path.isfile(fppath)): ...
mit
ropable/resource_tracking
tracking/migrations/0006_auto_20200213_1716.py
1
1161
# Generated by Django 2.1.11 on 2020-02-13 09:16 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('tracking', '0005_device_hidden'), ] operations = [ migrations.AlterField( model_name='device', name='hidden', ...
bsd-3-clause
chiamingyen/pygroup
wsgi/static/Brython2.1.4-20140810-083054/Lib/functools.py
730
13596
"""functools.py - Tools for working with functions and callable objects """ # Python module wrapper for _functools C module # to allow utilities written in Python to be added # to the functools module. # Written by Nick Coghlan <ncoghlan at gmail.com> # and Raymond Hettinger <python at rcn.com> # Copyright (C) 2006-2...
gpl-2.0
fitermay/intellij-community
python/helpers/py2only/docutils/io.py
104
17048
# $Id: io.py 7596 2013-01-25 13:42:17Z milde $ # Author: David Goodger <goodger@python.org> # Copyright: This module has been placed in the public domain. """ I/O classes provide a uniform API for low-level input and output. Subclasses exist for a variety of input/output mechanisms. """ __docformat__ = 'reStructured...
apache-2.0
zubron/servo
tests/wpt/harness/wptrunner/wptrunner.py
50
9660
# 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 import json import os import sys import environment as env import products imp...
mpl-2.0
hschovanec-usgs/magpy
magpy/lib/format_autodif_fread.py
2
3452
""" MagPy Auxiliary input filter - Write AUTODIF read-in data for F (also read) Written by Rachel Bailey - contains test and read function, toDo: write function """ from magpy.stream import * def isAUTODIF_FREAD(filename): """ Checks whether a file is text POS-1 file format. """ try: line = op...
gpl-3.0
neteler/QGIS
python/plugins/processing/algs/qgis/DeleteDuplicateGeometries.py
6
2947
# -*- coding: utf-8 -*- """ *************************************************************************** DeleteDuplicateGeometries.py --------------------- Date : May 2010 Copyright : (C) 2010 by Michael Minn Email : pyqgis at michaelminn dot com ***********...
gpl-2.0
felixonmars/babel
tests/test_plural.py
11
8301
# -*- coding: utf-8 -*- # # Copyright (C) 2008-2011 Edgewall Software # 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 available at http://babel.edgewall.org/wiki/License. # # This software consists...
bsd-3-clause
bxlab/bx-python
lib/bx/cookbook/doc_optparse.py
1
2840
""" :Author: M. Simionato :Date: April 2004 :Title: A much simplified interface to optparse. You should use optionparse in your scripts as follows. First, write a module level docstring containing something like this (this is just an example):: '''usage: %prog files [options] -d, --delete: delete all files...
mit
suryaambrose/code_bits
decompose_number_on_base.py
1
1690
# Standard library import unittest def decompose_number_on_base(number, base): """ Returns a number's decomposition on a defined base :param number: The number to decompose :param base: list representing the base. It must be sorted and each element must be a multiple of its predecessor. First element must be 1...
mit
SOKP/kernel_cyanogen_msm8916
scripts/build-all.py
704
14699
#! /usr/bin/env python # Copyright (c) 2009-2014, The Linux Foundation. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of source code must retain the above copyright # ...
gpl-2.0
ivaano/zato
code/zato-server/src/zato/server/service/internal/outgoing/odoo.py
6
2708
# -*- coding: utf-8 -*- """ Copyright (C) 2014 Dariusz Suchojad <dsuch at zato.io> Licensed under LGPLv3, see LICENSE.txt for terms and conditions. """ from __future__ import absolute_import, division, print_function, unicode_literals # stdlib from contextlib import closing from time import time from uuid import uu...
gpl-3.0
angelman/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/common/system/crashlogs.py
117
5490
# Copyright (c) 2011, Google Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the...
bsd-3-clause
WadeYuChen/django-oscar
src/oscar/apps/dashboard/partners/views.py
8
10728
from django.contrib import messages from django.contrib.auth.models import Permission from django.core.urlresolvers import reverse_lazy, reverse from django.shortcuts import get_object_or_404, redirect from django.utils.translation import ugettext_lazy as _ from django.template.loader import render_to_string from djang...
bsd-3-clause
katiecheng/Bombolone
env/lib/python2.7/site-packages/pip/commands/__init__.py
476
2236
""" Package containing all pip commands """ from pip.commands.bundle import BundleCommand from pip.commands.completion import CompletionCommand from pip.commands.freeze import FreezeCommand from pip.commands.help import HelpCommand from pip.commands.list import ListCommand from pip.commands.search import SearchComman...
bsd-3-clause
hmoco/osf.io
scripts/migration/migrate_meetings_preprints_to_preprintservices.py
9
58159
from datetime import timedelta import json import logging import re import sys from modularodm import Q from modularodm.storage.base import KeyExistsException from modularodm.exceptions import NoResultsFound from framework.mongo import database from framework.transactions.context import TokuTransaction from scripts i...
apache-2.0
fly19890211/edx-platform
common/lib/xmodule/xmodule/modulestore/inheritance.py
52
13259
""" Support for inheritance of fields down an XBlock hierarchy. """ from __future__ import absolute_import from datetime import datetime from pytz import UTC from xmodule.partitions.partitions import UserPartition from xblock.fields import Scope, Boolean, String, Float, XBlockMixin, Dict, Integer, List from xblock.run...
agpl-3.0
tellybug/dynamodb-mock
tests/functional/boto/test_query.py
2
8037
# -*- coding: utf-8 -*- import unittest import boto TABLE_NAME = 'Table-HR' TABLE_NAME_404 = 'Waldo' TABLE_RT = 45 TABLE_WT = 123 TABLE_RT2 = 10 TABLE_WT2 = 10 TABLE_HK_NAME = u'hash_key' TABLE_HK_TYPE = u'N' TABLE_RK_NAME = u'range_key' TABLE_RK_TYPE = u'S' HK_VALUE = u'123' HK_VALUE_404 = u'404' RK_VALUE1 = u'Wald...
lgpl-3.0
cezary12/blaze
blaze/io/scidb/query.py
13
3519
""" SciDB query generation and execution. The query building themselves are fairly low-level, since their only concern is whether to generate temporary arrays or not. """ from __future__ import absolute_import, division, print_function import uuid from itertools import chain #----------------------------------------...
bsd-3-clause
jumpojoy/neutron
neutron/common/utils.py
2
17935
# Copyright 2011, VMware, 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
sajeeshcs/nested_quota
doc/source/conf.py
18
9425
# -*- coding: utf-8 -*- # # nova documentation build configuration file, created by # sphinx-quickstart on Sat May 1 15:17:47 2010. # # 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 ...
apache-2.0
cherusk/ansible
lib/ansible/plugins/lookup/inventory_hostnames.py
117
1942
# (c) 2012, Michael DeHaan <michael.dehaan@gmail.com> # (c) 2013, Steven Dossett <sdossett@panath.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 versio...
gpl-3.0
luiseduardohdbackup/odoo
addons/website_gengo/controllers/main.py
350
1799
# -*- coding: utf-8 -*- import openerp from openerp import http, SUPERUSER_ID from openerp.http import request import time GENGO_DEFAULT_LIMIT = 20 class website_gengo(http.Controller): @http.route('/website/get_translated_length', type='json', auth='user', website=True) def get_translated_length(self, tran...
agpl-3.0
fcolamar/AliPhysics
PWGJE/EMCALJetTasks/Tracks/analysis/ext/__init__.py
369
1063
#************************************************************************** #* Copyright(c) 1998-2014, ALICE Experiment at CERN, All rights reserved. * #* * #* Author: The ALICE Off-line Project. * #* Contributors ...
bsd-3-clause
HPNetworking/HP-Intelligent-Management-Center
build/lib/pyhpimc/plat/groups.py
3
4490
'''Copyright 2015 Chris Young 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 dis...
apache-2.0
ArcherCraftStore/ArcherVMPeridot
Python/Lib/encodings/big5hkscs.py
816
1039
# # big5hkscs.py: Python Unicode Codec for BIG5HKSCS # # Written by Hye-Shik Chang <perky@FreeBSD.org> # import _codecs_hk, codecs import _multibytecodec as mbc codec = _codecs_hk.getcodec('big5hkscs') class Codec(codecs.Codec): encode = codec.encode decode = codec.decode class IncrementalEncoder(mbc.Multib...
apache-2.0
Cheppers/zulip
zerver/management/commands/add_users_to_streams.py
113
2394
from __future__ import absolute_import from optparse import make_option from django.core.management.base import BaseCommand from zerver.lib.actions import create_stream_if_needed, do_add_subscription from zerver.models import Realm, UserProfile, get_user_profile_by_email class Command(BaseCommand): help = """Ad...
apache-2.0
c0defreak/python-for-android
python3-alpha/python3-src/Lib/idlelib/UndoDelegator.py
67
10305
import string from tkinter import * from idlelib.Delegator import Delegator #$ event <<redo>> #$ win <Control-y> #$ unix <Alt-z> #$ event <<undo>> #$ win <Control-z> #$ unix <Control-z> #$ event <<dump-undo-state>> #$ win <Control-backslash> #$ unix <Control-backslash> class UndoDelegator(Delegator): max_und...
apache-2.0
mahmoud/hematite
hematite/tests/test_url.py
1
4540
# -*- coding: utf-8 -*- #from compat import unicode, bytes # TODO: round-tripping tests import pytest from hematite.url import URL, _URL_RE, parse_authority TEST_URLS = [ '*', # e.g., OPTIONS * 'http://googlewebsite.com/e-shops.aspx', 'http://example.com:8080/search?q=123&business=Nothing%20Special',...
bsd-3-clause
matmutant/sl4a
python/src/Lib/test/test_threaded_import.py
77
2535
# This is a variant of the very old (early 90's) file # Demo/threads/bug.py. It simply provokes a number of threads into # trying to import the same module "at the same time". # There are no pleasant failure modes -- most likely is that Python # complains several times about module random having no attribute # randran...
apache-2.0
foundit/Piped
doc/tutorials/twitter/1_basic/twitter_tutorial/provider.py
2
1500
import tweepy from zope import interface from twisted.application import service from twisted.internet import defer, threads, reactor from piped import exceptions, log, resource, util class MyTwitterProvider(object): # state that we are a resource provider, so that the piped plugin system finds us interface....
mit
jiemakel/omorfi
src/python/omorfi/apertium_formatter.py
1
14261
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """Functions to format apertium style analyses from omorfi data.""" # Author: Omorfi contributors <omorfi-devel@groups.google.com> 2015 # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as pu...
gpl-3.0
ojii/django-cms
cms/tests/navextender.py
27
3475
# -*- coding: utf-8 -*- from __future__ import with_statement from cms.models import Page from cms.test_utils.fixtures.navextenders import NavextendersFixture from cms.test_utils.testcases import SettingsOverrideTestCase from cms.test_utils.util.menu_extender import TestMenu from django.conf import settings from django...
bsd-3-clause
kow3ns/contrib
rescheduler/vendor/github.com/ugorji/go/codec/test.py
1516
4019
#!/usr/bin/env python # This will create golden files in a directory passed to it. # A Test calls this internally to create the golden files # So it can process them (so we don't have to checkin the files). # Ensure msgpack-python and cbor are installed first, using: # sudo apt-get install python-dev # sudo apt-g...
apache-2.0
CSC301H-Fall2013/JuakStore
site-packages/tests/regressiontests/managers_regress/tests.py
46
7920
from __future__ import absolute_import import copy from django.conf import settings from django.db import models from django.db.models.loading import cache from django.test import TestCase from django.test.utils import override_settings from .models import ( Child1, Child2, Child3, Child4, Child5,...
mit
Epirex/android_external_chromium_org
tools/perf/metrics/media.py
23
2791
# 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 logging import os from metrics import Metric class MediaMetric(Metric): """MediaMetric class injects and calls JS responsible for recording metric...
bsd-3-clause
zding5/Microblog-Flask
flask/lib/python2.7/site-packages/jinja2/_stringdefs.py
990
404291
# -*- coding: utf-8 -*- """ jinja2._stringdefs ~~~~~~~~~~~~~~~~~~ Strings of all Unicode characters of a certain category. Used for matching in Unicode-aware languages. Run to regenerate. Inspired by chartypes_create.py from the MoinMoin project, original implementation from Pygments. :co...
mit
bbrezillon/linux-sunxi
tools/perf/scripts/python/export-to-postgresql.py
293
26298
# export-to-postgresql.py: export perf data to a postgresql database # Copyright (c) 2014, Intel Corporation. # # This program is free software; you can redistribute it and/or modify it # under the terms and conditions of the GNU General Public License, # version 2, as published by the Free Software Foundation. # # Thi...
gpl-2.0
provaleks/o8
addons/website_certification/controllers/main.py
373
2149
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-TODAY OpenERP S.A. <http://www.openerp.com> # # This program is free software: you can redistribute it and/or modify # it under the terms...
agpl-3.0
apagac/cfme_tests
cfme/tests/cloud_infra_common/test_retirement_manual.py
2
3580
# -*- coding: utf-8 -*- # pylint: skip-file """Manual tests""" import pytest from cfme import test_requirements pytestmark = [ pytest.mark.ignore_stream('upstream'), pytest.mark.manual, test_requirements.retirement ] @pytest.mark.tier(2) def test_retire_infra_vms_folder(): """ test the retire fu...
gpl-2.0
svirusxxx/cjdns
node_build/dependencies/libuv/build/gyp/test/gyp-defines/gyptest-multiple-values.py
47
1314
#!/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 when multiple values are supplied for a gyp define, the last one is used. """ import os import TestGyp test = TestGyp.Te...
gpl-3.0
yf2009017/huhamhire-hosts
_build.py
24
11102
#!/usr/bin/env python # -*- coding: utf-8 -*- # # _build.py : Tools to make packages for different platforms # # Copyleft (C) 2014 - huhamhire hosts team <hosts@huhamhire.com> # ===================================================================== # Licensed under the GNU General Public License, version 3. You should ...
gpl-3.0
KellyChan/Python
javascript/backbone/backbone-templates/backbone-fileupload/venvs/lib/python2.7/site-packages/django/contrib/admin/templatetags/admin_modify.py
98
2293
from django import template register = template.Library() @register.inclusion_tag('admin/prepopulated_fields_js.html', takes_context=True) def prepopulated_fields_js(context): """ Creates a list of prepopulated_fields that should render Javascript for the prepopulated fields for both the admin form and in...
mit
ndp-systemes/odoo-addons
stock_account_improved/stock_account_improved.py
1
1355
# -*- coding: utf8 -*- # # Copyright (C) 2017 NDP Systèmes (<http://www.ndp-systemes.fr>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the # Licen...
agpl-3.0
rghe/ansible
lib/ansible/modules/cloud/amazon/aws_sgw_facts.py
20
11531
#!/usr/bin/python # Copyright (c) 2018 Loic BLOT <loic.blot@unix-experience.fr> # This module is sponsored by E.T.A.I. (www.etai.fr) # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], ...
gpl-3.0
yakky/django
django/contrib/gis/gdal/raster/source.py
17
13572
import json import os from ctypes import addressof, byref, c_double, c_void_p from django.contrib.gis.gdal.base import GDALBase from django.contrib.gis.gdal.driver import Driver from django.contrib.gis.gdal.error import GDALException from django.contrib.gis.gdal.prototypes import raster as capi from django.contrib.gis...
bsd-3-clause
AOSPU/external_chromium_org
build/android/pylib/utils/flakiness_dashboard_results_uploader.py
11
7863
# 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. """Uploads the results to the flakiness dashboard server.""" # pylint: disable=E1002,R0201 import logging import os import shutil import sys import temp...
bsd-3-clause
AltarBeastiful/qt-creator
tests/system/suite_SCOM/tst_SCOM04/test.py
4
3506
############################################################################# ## ## Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ## Contact: http://www.qt-project.org/legal ## ## This file is part of Qt Creator. ## ## Commercial License Usage ## Licensees holding valid commercial Qt licenses may use this f...
lgpl-2.1
astrorafael/ema
ema/mqttclient.py
1
13699
# ---------------------------------------------------------------------- # Copyright (c) 2015 Rafael Gonzalez. # # 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...
mit
Jorl17/jar2app
jar2app.py
1
25831
#!/usr/bin/env python # -*- coding: utf-8 -*- ## ## Copyright (C) 2015-2018 João Ricardo Lourenço <jorl17.8@gmail.com> ## ## Github: https://github.com/Jorl17 ## ## Project main repository: https://github.com/Jorl17/jar2app ## ## This file is part of jar2app. ## ## jar2app is free software: you can redistribute it and/...
gpl-2.0
davidmueller13/android_kernel_lge_msm8974
scripts/rt-tester/rt-tester.py
11005
5307
#!/usr/bin/python # # rt-mutex tester # # (C) 2006 Thomas Gleixner <tglx@linutronix.de> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as # published by the Free Software Foundation. # import os import sys import getopt import sh...
gpl-2.0
rahuldhote/odoo
addons/website_quote/controllers/main.py
83
8996
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2013-Today OpenERP SA (<http://www.openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms ...
agpl-3.0
francof2a/APC
sources/dataset.py
1
4426
# Module related with dataset import os import urllib import zipfile import numpy as np def download(dataset_name = 'UCI HAR'): """"Download database to local folder """ # Init dataset_valid = False dataset_folder = "./" download_folder = os.path.abspath("../dataset/donwload/") + "...
gpl-3.0
kamcpp/tensorflow
tensorflow/python/framework/contrib_test.py
23
1521
# 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
google/rysim
python/results_analyzer/Main.py
1
119456
# Copyright 2014 The RySim 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 law o...
apache-2.0
Peddle/hue
desktop/core/src/desktop/migrations/0012_auto__chg_field_documentpermission_perms.py
30
8715
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Changing field 'DocumentPermission.perms' db.alter_column(u'desktop_do...
apache-2.0
MonicaHsu/truvaluation
venv/lib/python2.7/site-packages/flask/templating.py
783
4707
# -*- coding: utf-8 -*- """ flask.templating ~~~~~~~~~~~~~~~~ Implements the bridge to Jinja2. :copyright: (c) 2011 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import posixpath from jinja2 import BaseLoader, Environment as BaseEnvironment, \ TemplateNotFound from .glo...
mit
mmottahedi/neuralnilm_prototype
scripts/e349.py
2
6140
from __future__ import print_function, division import matplotlib import logging from sys import stdout matplotlib.use('Agg') # Must be before importing matplotlib.pyplot or pylab! from neuralnilm import (Net, RealApplianceSource, BLSTMLayer, DimshuffleLayer, Bidirectio...
mit
lionloveqin/gstreamill
test/m3u8client.py
3
1581
""" pip install m3u8 first, please """ import sys import m3u8 import time import urllib2 import os url = "http://localhost:20119/cctv21/encoder/0/playlist.m3u8" media_sequence = 0 playlist = m3u8.load(url) while playlist.is_variant: url = playlist.base_uri + "/" + playlist.playlists[0].uri playlist = m3u8.l...
gpl-3.0
hgonzale/hssim
polyped/util.py
1
1885
import copy class Lambda(object): """ Lambda lambda-like class Acts like a lambda function, but its string representation is Python code that yields the object when executed. >>> f = Lambda('x : x**2') >>> f(1.41) 1.9880999999999998 >>> g = eval(str(f)) >>> g(2.82) 7.95239999...
bsd-2-clause
mfeurer/liac-arff
tests/test_data.py
1
9741
import types import unittest import arff class ConversorStub(object): def __init__(self, r_value): self.r_value = r_value def __call__(self, value): return self.r_value(value) class COOStub(object): def __init__(self, data, row, col): self.data = data self.row = row ...
mit
clips-tk/gradefisl
sample-settings.py
1
5008
# Django settings for minha_grade_fisl project. import os PROJECT_ROOT = os.path.abspath(os.path.dirname(__file__)) DEBUG = True TEMPLATE_DEBUG = DEBUG ADMINS = ( # ('Your Name', 'your_email@example.com'), ) MANAGERS = ADMINS DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', ...
mit
liu602348184/django
tests/utils_tests/test_dateformat.py
265
6177
from __future__ import unicode_literals from datetime import date, datetime from django.test import SimpleTestCase, override_settings from django.test.utils import TZ_SUPPORT, requires_tz_support from django.utils import dateformat, translation from django.utils.dateformat import format from django.utils.timezone imp...
bsd-3-clause
zjuwangg/scrapy
scrapy/spidermiddlewares/urllength.py
152
1059
""" Url Length Spider Middleware See documentation in docs/topics/spider-middleware.rst """ import logging from scrapy.http import Request from scrapy.exceptions import NotConfigured logger = logging.getLogger(__name__) class UrlLengthMiddleware(object): def __init__(self, maxlength): self.maxlength ...
bsd-3-clause
jerrylei98/Dailydos
venv/lib/python2.7/site-packages/jinja2/runtime.py
335
22530
# -*- coding: utf-8 -*- """ jinja2.runtime ~~~~~~~~~~~~~~ Runtime helpers. :copyright: (c) 2010 by the Jinja Team. :license: BSD. """ import sys from itertools import chain from jinja2.nodes import EvalContext, _context_function_types from jinja2.utils import Markup, soft_unicode, escape, missing...
mit
i386x/doit
doit/support/app/errors.py
1
2027
# -*- coding: utf-8 -*- #! \file ./doit/support/app/errors.py #! \author Jiří Kučera, <sanczes@gmail.com> #! \stamp 2016-09-03 14:38:52 (UTC+01:00, DST+01:00) #! \project DoIt!: Tools and Libraries for Building DSLs #! \license MIT #! \version 0.0.0 #! \fdes...
mit
Tilo15/PhotoFiddle2
PF2/Tools/Denoise.py
1
1956
import cv2 import Tool from scipy import ndimage class Denoise(Tool.Tool): def on_init(self): self.id = "denoise" self.name = "Denoise" self.icon_path = "ui/PF2_Icons/Denoise.png" self.properties = [ # Detailer Tool.Property("enabled", "Denoise", "Header", F...
gpl-3.0
dahlstrom-g/intellij-community
python/helpers/py3only/docutils/readers/__init__.py
170
3465
# $Id: __init__.py 7648 2013-04-18 07:36:22Z milde $ # Authors: David Goodger <goodger@python.org>; Ueli Schlaepfer # Copyright: This module has been placed in the public domain. """ This package contains Docutils Reader modules. """ __docformat__ = 'reStructuredText' import sys from docutils import utils, parsers,...
apache-2.0
peterlauri/django
django/templatetags/static.py
91
4391
from django import template from django.apps import apps from django.utils.encoding import iri_to_uri from django.utils.six.moves.urllib.parse import urljoin register = template.Library() class PrefixNode(template.Node): def __repr__(self): return "<PrefixNode for %r>" % self.name def __init__(self...
bsd-3-clause
yencarnacion/jaikuengine
.google_appengine/lib/django-1.5/django/utils/tzinfo.py
110
3247
"Implementation of tzinfo classes for use with datetime.datetime." from __future__ import unicode_literals import time from datetime import timedelta, tzinfo from django.utils.encoding import force_str, force_text, DEFAULT_LOCALE_ENCODING # Python's doc say: "A tzinfo subclass must have an __init__() method that ca...
apache-2.0
40223137/w1717
static/Brython3.1.3-20150514-095342/Lib/codecs.py
739
35436
""" codecs -- Python Codec Registry, API and helpers. Written by Marc-Andre Lemburg (mal@lemburg.com). (c) Copyright CNRI, All Rights Reserved. NO WARRANTY. """#" import builtins, sys ### Registry and builtin stateless codec functions try: from _codecs import * except ImportError as why: raise SystemErro...
gpl-3.0
eg-zhang/scikit-learn
benchmarks/bench_mnist.py
76
6136
""" ======================= MNIST dataset benchmark ======================= Benchmark on the MNIST dataset. The dataset comprises 70,000 samples and 784 features. Here, we consider the task of predicting 10 classes - digits from 0 to 9 from their raw images. By contrast to the covertype dataset, the feature space is...
bsd-3-clause
andris210296/andris-projeto
backend/venv/lib/python2.7/site-packages/pip/_vendor/html5lib/trie/py.py
1323
1775
from __future__ import absolute_import, division, unicode_literals from pip._vendor.six import text_type from bisect import bisect_left from ._base import Trie as ABCTrie class Trie(ABCTrie): def __init__(self, data): if not all(isinstance(x, text_type) for x in data.keys()): raise TypeError...
mit
ciarams87/PyU4V
docs/source/programmers_guide_src/code/performance-diagnostic_calls.py
2
2738
# Copyright (c) 2020 Dell Inc. or its subsidiaries. # # 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...
mit
syhost/android_kernel_xiaomi_msm8226-common
scripts/tracing/draw_functrace.py
14676
3560
#!/usr/bin/python """ Copyright 2008 (c) Frederic Weisbecker <fweisbec@gmail.com> Licensed under the terms of the GNU GPL License version 2 This script parses a trace provided by the function tracer in kernel/trace/trace_functions.c The resulted trace is processed into a tree to produce a more human view of the call ...
gpl-2.0
ESS-LLP/erpnext-healthcare
erpnext/hr/report/department_analytics/department_analytics.py
11
1903
# Copyright (c) 2013, Frappe Technologies Pvt. Ltd. and contributors # For license information, please see license.txt from __future__ import unicode_literals import frappe from frappe import _ def execute(filters=None): if not filters: filters = {} columns = get_columns() employees = get_employees(filters) depar...
gpl-3.0
ujjwalsharma045/Angular2-Creative-Tim-Admin-Theme-With-Code-
node_modules/node-gyp/gyp/pylib/gyp/MSVSUtil.py
1812
9537
# Copyright (c) 2013 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. """Utility functions shared amongst the Windows generators.""" import copy import os # A dictionary mapping supported target types to extensions. TARGET_TYPE_EX...
mit
swift-lang/swift-e-lab
parsl/addresses.py
1
1381
import logging import os import platform import requests import socket import fcntl import struct logger = logging.getLogger(__name__) def address_by_route(): logger.debug("Finding address by querying local routing table") addr = os.popen("/sbin/ip route get 8.8.8.8 | awk '{print $NF;exit}'").read().strip() ...
apache-2.0
Dobatymo/livestreamer
src/livestreamer/plugins/livestation.py
34
2666
import re from livestreamer.plugin import Plugin, PluginError, PluginOptions from livestreamer.plugin.api import http, validate from livestreamer.stream import HLSStream LOGIN_PAGE_URL = "http://www.livestation.com/en/users/new" LOGIN_POST_URL = "http://www.livestation.com/en/sessions.json" _csrf_token_re = re.compi...
bsd-2-clause
SnoringFrog/retain
retain/__init__.py
1
9569
#!/usr/bin/env python # -*- coding: iso-8859-1 -*- ''' retain - Command-line utility that removes all files except the ones specified on the command line. Usage: ------ retain [-fnrsv] [-d directory] filename [...] Options: -------- --directory <dir> The directory to operate on. Defaults to the current ...
bsd-3-clause
byterom/android_external_chromium_org
third_party/cython/src/Cython/Plex/Traditional.py
102
3502
#======================================================================= # # Python Lexical Analyser # # Traditional Regular Expression Syntax # #======================================================================= from Regexps import Alt, Seq, Rep, Rep1, Opt, Any, AnyBut, Bol, Eol, Char from Errors import Plex...
bsd-3-clause
Spiderlover/Toontown
toontown/toon/DistributedNPCBankerAI.py
3
3381
from otp.ai.AIBaseGlobal import * from direct.task.Task import Task from pandac.PandaModules import * from DistributedNPCToonBaseAI import * from toontown.estate import BankGlobals class DistributedNPCBankerAI(DistributedNPCToonBaseAI): FourthGagVelvetRopeBan = config.GetBool('want-ban-fourth-gag-velvet-rope', 0) ...
mit
Azure/azure-sdk-for-python
sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/_configuration.py
1
3355
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
mit
anaruse/chainer
tests/chainer_tests/functions_tests/math_tests/test_trigonometric.py
2
6481
import unittest import numpy import chainer from chainer.backends import cuda import chainer.functions as F from chainer import gradient_check from chainer import testing from chainer.testing import attr @testing.parameterize(*testing.product({ 'func_name': ['cos', 'sin', 'tan'], 'shape': [(3, 2), ()], ...
mit
nburn42/tensorflow
tensorflow/python/pywrap_tensorflow.py
33
3219
# 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