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
sgerhart/ansible
lib/ansible/modules/network/f5/bigiq_application_fastl4_tcp.py
9
21592
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright: (c) 2018, F5 Networks Inc. # 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', ...
mit
dermoth/gramps
gramps/plugins/tool/eventnames.py
8
6530
# # Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2000-2007 Donald N. Allingham # Copyright (C) 2008 Brian G. Matherly # Copyright (C) 2010 Jakim Friant # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as publi...
gpl-2.0
martindisch/SensorTag
util/readdata.py
1
1919
import pygatt import time def tempConvert(rawTemp): SCALE_LSB = 0.03125 # mask to fill in leading ones after bitshift if number is negative mask = 0xc000 if rawTemp > 0x7fff else 0x0000 # right-shift by two and fill in leading ones if necessary t = rawTemp >> 2 | mask # convert to negative numb...
mit
jl2922/hci
extrapolate_o3.py
1
3771
""" Obtain results from csv and extrapolate to CBS & FCI limit.""" import sys import numpy as np import pandas as pd import statsmodels.api as sm np.set_printoptions(precision=12) def printCorrelationEnergy(statsResult): coefs = statsResult.params.values stdevs = statsResult.bse print('Correlation Energ...
mit
PythonScientists/Shape
env/lib/python3.5/site-packages/pip/_vendor/requests/utils.py
319
24163
# -*- coding: utf-8 -*- """ requests.utils ~~~~~~~~~~~~~~ This module provides utility functions that are used within Requests that are also useful for external consumption. """ import cgi import codecs import collections import io import os import re import socket import struct import warnings from . import __vers...
apache-2.0
teltek/edx-platform
common/test/acceptance/pages/lms/discussion.py
11
29079
from contextlib import contextmanager from bok_choy.javascript import wait_for_js from bok_choy.page_object import PageObject from bok_choy.promise import EmptyPromise from common.test.acceptance.pages.common.utils import hover from common.test.acceptance.pages.lms.course_page import CoursePage from common.test.accep...
agpl-3.0
varunarya10/nova_test_latest
nova/db/sqlalchemy/migrate_repo/versions/234_add_expire_reservations_index.py
146
1511
# 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 to in...
apache-2.0
fenglu-g/incubator-airflow
airflow/operators/mysql_to_hive.py
6
5432
# -*- coding: 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
glennyonemitsu/MarkupHiveSDK
jinja2/_markupsafe/__init__.py
182
7749
# -*- coding: utf-8 -*- """ markupsafe ~~~~~~~~~~ Implements a Markup string. :copyright: (c) 2010 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import re from itertools import imap __all__ = ['Markup', 'soft_unicode', 'escape', 'escape_silent'] _striptags_re = re.compile...
mit
diagramsoftware/odoo
addons/account_budget/report/__init__.py
444
1139
# -*- 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
CasataliaLabs/biscuit_drishtiman
Pmw-2.0.0/Pmw/Pmw_2_0_0/lib/PmwScrolledField.py
2
1922
import tkinter import Pmw class ScrolledField(Pmw.MegaWidget): def __init__(self, parent = None, **kw): # Define the megawidget options. INITOPT = Pmw.INITOPT optiondefs = ( ('labelmargin', 0, INITOPT), ('labelpos', None, INITOPT), ...
gpl-3.0
mearns/agenda
sphinx/source/conf.py
1
10486
# -*- coding: utf-8 -*- # # agenda documentation build configuration file, created by # sphinx-quickstart on Wed May 07 14:26:13 2014. # # 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 fil...
gpl-3.0
adrianmoisey/cptdevops
flask/debughelpers.py
318
6024
# -*- coding: utf-8 -*- """ flask.debughelpers ~~~~~~~~~~~~~~~~~~ Various helpers to make the development experience better. :copyright: (c) 2015 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ from ._compat import implements_to_string, text_type from .app import Flask from .bl...
bsd-3-clause
sih4sing5hong5/tai5-uan5_gian5-gi2_phing5-tai5
臺灣言語平臺/management/commands/加sheet的json.py
2
1107
import json from django.core.management.base import BaseCommand from 臺灣言語平臺.正規化團隊模型 import 正規化sheet表 from django.conf import settings class Command(BaseCommand): help = '加sheet的json' def add_arguments(self, parser): parser.add_argument( '服務帳戶json', type=str, hel...
mit
mje-nz/PX4-Firmware
Tools/validate_yaml.py
2
1791
#! /usr/bin/env python """ Script to validate YAML file(s) against a YAML schema file """ from __future__ import print_function import argparse import os import sys try: import yaml except: print("Failed to import yaml.") print("You may need to install it with 'sudo pip install pyyaml'") print("") ...
bsd-3-clause
murgatroid99/grpc
src/python/grpcio_tests/tests/unit/_early_ok_test.py
1
5571
# Copyright 2018 gRPC 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 in writing...
apache-2.0
mm112287/2015cd_midterm
static/Brython3.1.1-20150328-091302/Lib/multiprocessing/util.py
696
9917
# # Module providing various facilities to other parts of the package # # multiprocessing/util.py # # Copyright (c) 2006-2008, R Oudkerk # Licensed to PSF under a Contributor Agreement. # import sys import functools import os import itertools import weakref import atexit import threading # we want threading to ...
gpl-3.0
lucafavatella/intellij-community
plugins/hg4idea/testData/bin/mercurial/scmwindows.py
94
1669
import os import osutil import util import _winreg def systemrcpath(): '''return default os-specific hgrc search path''' rcpath = [] filename = util.executablepath() # Use mercurial.ini found in directory with hg.exe progrc = os.path.join(os.path.dirname(filename), 'mercurial.ini') if os.path.i...
apache-2.0
40223215/2016fallcadp_hw
plugin/liquid_tags/test_flickr.py
278
2466
from . import flickr try: from unittest.mock import patch except ImportError: from mock import patch import os import pytest import re PLUGIN_DIR = os.path.dirname(__file__) TEST_DATA_DIR = os.path.join(PLUGIN_DIR, 'test_data') @pytest.mark.parametrize('input,expected', [ ('18873146680 large "test 1"', ...
agpl-3.0
CingHu/neutron-ustack
neutron/openstack/common/gettextutils.py
13
18849
# Copyright 2012 Red Hat, Inc. # Copyright 2013 IBM Corp. # 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....
apache-2.0
LuisAlejandro/tribus
tribus/web/registration/ldap/hashers.py
2
2003
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) 2013-2014 Tribus Developers # # This file is part of Tribus. # # Tribus is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the L...
gpl-3.0
meles5/qutebrowser
qutebrowser/completion/completionwidget.py
1
10584
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et: # Copyright 2014-2016 Florian Bruhin (The Compiler) <mail@qutebrowser.org> # # This file is part of qutebrowser. # # qutebrowser 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 S...
gpl-3.0
dharmabumstead/ansible
lib/ansible/modules/net_tools/snmp_facts.py
35
12804
#!/usr/bin/python # This file is part of Networklore's snmp library for Ansible # 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
Gazer022/bitcoin
test/functional/invalidtxrequest.py
19
2639
#!/usr/bin/env python3 # Copyright (c) 2015-2016 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test node responses to invalid transactions. In this test we connect to one node over p2p, and test tx...
mit
sandeepkoduri/GAE-html-to-pdf
libs/pip/_vendor/requests/packages/chardet/chardetect.py
1786
2504
#!/usr/bin/env python """ Script which takes one or more file paths and reports on their detected encodings Example:: % chardetect somefile someotherfile somefile: windows-1252 with confidence 0.5 someotherfile: ascii with confidence 1.0 If no paths are provided, it takes its input from stdin. """ from...
mit
secretdataz/OpenKore-Src
src/scons-local-2.0.1/SCons/Tool/mslib.py
61
2221
"""SCons.Tool.mslib Tool-specific initialization for lib (MicroSoft library archiver). 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) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, ...
gpl-2.0
yigitguler/django
django/conf/locale/de_CH/formats.py
115
1445
# -*- 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 from __future__ import unicode_literals DATE_FORMAT = 'j. F Y' TIME_FORMAT = 'H:i' DATE...
bsd-3-clause
GoogleCloudPlatform/deploymentmanager-samples
google/resource-snippets/compute-v1/autoscaler.py
2
3799
# Copyright 2018 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
Azure/azure-sdk-for-python
sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/aio/operations/_keys_operations.py
1
15471
# 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 may ...
mit
metacloud/percona-xtrabackup
test/kewpie/percona_tests/xtrabackup_disabled/ib_basic_test.py
24
4748
#! /usr/bin/env python # -*- mode: python; indent-tabs-mode: nil; -*- # vim:expandtab:shiftwidth=2:tabstop=2:smarttab: # # Copyright (C) 2011 Patrick Crews # # # 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 Softwar...
gpl-2.0
Royal-Society-of-New-Zealand/NZ-ORCID-Hub
orcid_api_v3/models/source_orcid_v30.py
1
4185
# coding: utf-8 """ ORCID Member No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 OpenAPI spec version: Latest Generated by: https://github.com/swagger-api/swagger-codegen.git """ import pprint import re # noqa: F401 import si...
mit
jfterpstra/bluebottle
bluebottle/payments_voucher/migrations/0001_initial.py
2
3525
# -*- coding: utf-8 -*- # Generated by Django 1.9.4 on 2016-05-23 13:25 from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models import django.db.models.deletion import django_extensions.db.fields class Migration(migrations.Migration): initial = True ...
bsd-3-clause
Kayoti/p2
tournament_test.py
1
4577
#!/usr/bin/env python # # Test cases for tournament.py from tournament import * def testDeleteMatches(): deleteMatches() print "1. Old matches can be deleted." def testDelete(): deleteMatches() deletePlayers() print "2. Player records can be deleted." def testCount(): deleteMatches() d...
mit
microdog/hello-gfw
setup.py
1
3457
# Always prefer setuptools over distutils from setuptools import setup, find_packages # To use a consistent encoding from codecs import open from os import path here = path.abspath(path.dirname(__file__)) # Get the long description from the relevant file with open(path.join(here, 'README.rst'), encoding='utf-8') as f...
mit
xstaticxgpx/netsnmp-py3
test_async.py
1
12070
#!/usr/bin/python3 from netsnmp._api import get_async from async_devtypes import SNMP_DEVTYPES #import cx_Oracle import zmq import redis, hiredis import logging, logging.handlers import random, sys, threading, time import multiprocessing as mp # Python 2 support try: import queue except: import Queue as queue...
mit
apache/incubator-mxnet
example/gluon/style_transfer/models/download_model.py
23
1195
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
apache-2.0
nemaniarjun/coala
tests/bearlib/languages/documentation/DocumentationCommentTest.py
9
14785
import unittest from coalib.bearlib.languages.documentation.DocstyleDefinition import ( DocstyleDefinition) from coalib.bearlib.languages.documentation.DocumentationComment import ( DocumentationComment) from coalib.bearlib.languages.documentation.DocBaseClass import ( DocBaseClass) from tests.bearlib.lang...
agpl-3.0
bjesus/wagtail
wagtail/wagtailcore/tests/test_whitelist.py
16
4807
from bs4 import BeautifulSoup from django.test import TestCase from wagtail.wagtailcore.whitelist import ( check_url, attribute_rule, allow_without_attributes, Whitelister ) class TestCheckUrl(TestCase): def test_allowed_url_schemes(self): for url_scheme in ['', 'http', 'https', 'ftp', 'ma...
bsd-3-clause
Parsl/parsl
parsl/tests/configs/local_threads_globus.py
1
1097
from parsl.config import Config from parsl.data_provider.data_manager import default_staging from parsl.data_provider.globus import GlobusStaging from parsl.executors.threads import ThreadPoolExecutor # If you are a developer running tests, make sure to update parsl/tests/configs/user_opts.py # If you are a user copyi...
apache-2.0
GGiecold/PySCUBA
src/PySCUBA/Tree_classes.py
1
6533
#!/usr/bin/env python # PySCUBA/src/PySCUBA/Tree_classes.py # Author: Gregory Giecold for the GC Yuan Lab # Affiliation: Harvard University # Contact: g.giecold@gmail.com; ggiecold@jimmy.harvard.edu """Classes for flow or mass cytometry data processing, modified from the outdated 'fcm' Python package by Jacob...
mit
erigones/esdc-ce
api/accounts/permission/views.py
1
1803
from api.decorators import api_view, request_data_defaultdc, setting_required from api.permissions import IsSuperAdmin from api.accounts.permission.api_views import PermissionView __all__ = ('permission_list', 'permission_manage') @api_view(('GET',)) @request_data_defaultdc(permissions=(IsSuperAdmin,)) @setting_requ...
apache-2.0
thaim/ansible
lib/ansible/plugins/lookup/keyring.py
59
1901
# (c) 2016, Samuel Boucher <boucher.samuel.c@gmail.com> # (c) 2017 Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import (absolute_import, division, print_function) __metaclass__ = type DOCUMENTATION = """ lookup: keyring author: ...
mit
BAGAsss/mrmc
tools/EventClients/examples/python/example_button2.py
228
2074
#!/usr/bin/python # This is a simple example showing how you can send a key press event # to XBMC in a non-queued fashion to achieve a button pressed down # event i.e. a key press that repeats. # The repeat interval is currently hard coded in XBMC but that might # change in the future. # NOTE: Read the comments in '...
gpl-2.0
AnimeshSinha1309/Website-Edunet
WebsiteEdunet/env/Lib/site-packages/django/db/backends/oracle/operations.py
86
18396
from __future__ import unicode_literals import datetime import re import uuid from django.conf import settings from django.db.backends.base.operations import BaseDatabaseOperations from django.db.backends.utils import truncate_name from django.utils import six, timezone from django.utils.encoding import force_bytes, ...
mit
atassumer/fabric-bolt
src/fabric_bolt/projects/migrations/0018_auto__add_field_configuration_value_number__add_field_configuration_va.py
18
9963
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'Configuration.value_number' db.add_column(u'projects_configuration', 'value_number', ...
mit
lucashmorais/x-Bench
mozmill-env/python/Lib/site-packages/pip/__init__.py
73
8049
#!/usr/bin/env python import os import optparse import sys import re from pip.exceptions import InstallationError, CommandError, PipError from pip.log import logger from pip.util import get_installed_distributions, get_prog from pip.vcs import git, mercurial, subversion, bazaar # noqa from pip.baseparser import crea...
mit
halentest/solr
eclipse-build/main/org/apache/lucene/analysis/charfilter/htmlentity.py
8
31079
# 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
geometrybase/gensim
gensim/corpora/ucicorpus.py
68
7517
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) 2012 Jonathan Esterhazy <jonathan.esterhazy at gmail.com> # Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html """ University of California, Irvine (UCI) Bag-of-Words format. http://archive.ics.uci.edu/ml/datasets/Bag+of+Words """ ...
gpl-3.0
skg-net/ansible
lib/ansible/modules/storage/netapp/na_ontap_export_policy.py
6
8299
#!/usr/bin/python # (c) 2018, NetApp, Inc # 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', 'status': ['preview'], ...
gpl-3.0
aliyun/oss-ftp
python27/unix/lib/requests/structures.py
1160
2977
# -*- coding: utf-8 -*- """ requests.structures ~~~~~~~~~~~~~~~~~~~ Data structures that power Requests. """ import collections class CaseInsensitiveDict(collections.MutableMapping): """ A case-insensitive ``dict``-like object. Implements all methods and operations of ``collections.MutableMapping...
mit
linebp/pandas
pandas/tests/frame/test_subclass.py
15
9524
# -*- coding: utf-8 -*- from __future__ import print_function from warnings import catch_warnings import numpy as np from pandas import DataFrame, Series, MultiIndex, Panel import pandas as pd import pandas.util.testing as tm from pandas.tests.frame.common import TestData class TestDataFrameSubclassing(TestData):...
bsd-3-clause
dadarom/disconf
disconf-web/bin/makeSql.py
15
1108
#!/usr/bin/env python # coding=utf8 """ Created on 2014年2月15日 @author: liaoqiqi """ myfile = open("url_resrouces.txt") lines = myfile.readlines() print "use disconf;" print 'delete from role_resource;' for line in lines: line = line.strip('\n') if not line: continue if line[0] == '#': ...
gpl-2.0
enzzzy/netmiko
tests/test_netmiko_commit.py
12
13261
#!/usr/bin/env python """ test_ssh_connect: verify ssh connectivity test_config_mode: verify enter config mode test_commit_base: test std .commit() test_commit_confirm: test commit with confirm test_confirm_delay: test commit-confirm with non-std delay test_no_confirm: test commit-confirm with no confirm test_commit_ch...
mit
FireBladeNooT/Medusa_1_6
lib/imdb/parser/sql/objectadapter.py
62
7978
""" parser.sql.objectadapter module (imdb.parser.sql package). This module adapts the SQLObject ORM to the internal mechanism. Copyright 2008-2010 Davide Alberani <da@erlug.linux.it> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published...
gpl-3.0
mujiansu/arangodb
3rdParty/V8-4.3.61/PRESUBMIT.py
13
10356
# Copyright 2012 the V8 project authors. 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 conditi...
apache-2.0
w1ll1am23/home-assistant
homeassistant/components/somfy_mylink/__init__.py
3
5945
"""Component for the Somfy MyLink device supporting the Synergy API.""" import asyncio import logging from somfy_mylink_synergy import SomfyMyLinkSynergy import voluptuous as vol from homeassistant.components.cover import ENTITY_ID_FORMAT from homeassistant.config_entries import SOURCE_IMPORT, ConfigEntry from homeas...
apache-2.0
ojengwa/oh-mainline
vendor/packages/django-celery/examples/demoproject/settings.py
16
2361
# Django settings for demoproject project. import djcelery djcelery.setup_loader() DEBUG = True TEMPLATE_DEBUG = DEBUG ADMINS = ( # ('Your Name', 'your_email@domain.com'), ) CELERY_RESULT_BACKEND = "database" BROKER_HOST = "localhost" BROKER_PORT = 5672 BROKER_USER = "guest" BROKER_PASSWORD = "guest" BROKER_VHOS...
agpl-3.0
mydongistiny/android_kernel_motorola_shamu
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
lokirius/python-for-android
python-modules/zope/zope/interface/verify.py
50
4534
############################################################################## # # Copyright (c) 2001, 2002 Zope Foundation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # TH...
apache-2.0
fsalamero/pilas
pilasengine/tests/test_depurador.py
6
2168
# -*- encoding: utf-8 -*- import sys import unittest from PyQt4 import QtGui import pilasengine class TestIniciar(unittest.TestCase): app = QtGui.QApplication(sys.argv) def setUp(self): self.pilas = pilasengine.iniciar() def testPuedeDeshabilitarTodosLosModos(self): self.pilas.depurador...
lgpl-3.0
dproc/trex_odp_porting_integration
scripts/automation/trex_control_plane/console/trex_tui.py
2
14176
import termios import sys import os import time from common.text_opts import * from common import trex_stats from client_utils import text_tables from collections import OrderedDict import datetime class SimpleBar(object): def __init__ (self, desc, pattern): self.desc = desc self.pattern = pattern ...
apache-2.0
Denisolt/IEEE-NYIT-MA
local/lib/python2.7/site-packages/pip/_vendor/html5lib/treewalkers/__init__.py
354
5544
"""A collection of modules for iterating through different kinds of tree, generating tokens identical to those produced by the tokenizer module. To create a tree walker for a new type of tree, you need to do implement a tree walker object (called TreeWalker by convention) that implements a 'serialize' method taking a ...
gpl-3.0
Pablo126/SSBW
Tarea4/tarea4/lib/python3.5/site-packages/django/utils/module_loading.py
145
6290
import copy import os import sys from importlib import import_module from django.utils import six def import_string(dotted_path): """ Import a dotted module path and return the attribute/class designated by the last name in the path. Raise ImportError if the import failed. """ try: module...
gpl-3.0
mdibaiee/servo
tests/wpt/web-platform-tests/common/large.py
238
1370
def main(request, response): """Code for generating large responses where the actual response data isn't very important. Two request parameters: size (required): An integer number of bytes (no suffix) or kilobytes ("kb" suffix) or megabytes ("Mb" suffix). string (optional): The...
mpl-2.0
OpenEdgeComputing/elijah-discovery-basic
server/register-rest/registerAPI/wsgi.py
2
1144
""" WSGI config for registerAPI project. This module contains the WSGI application used by Django's development server and any production WSGI deployments. It should expose a module-level variable named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover this application via the ``WSGI_APPLICATIO...
apache-2.0
mrnamingo/vix4-34-enigma2-bcm
lib/python/Plugins/SystemPlugins/VideoEnhancement/VideoEnhancement.py
44
11758
from os import path as os_path from Components.config import config, ConfigSubsection, ConfigSlider, ConfigSelection, ConfigBoolean, ConfigNothing, NoSave # The "VideoEnhancement" is the interface to /proc/stb/vmpeg/0. class VideoEnhancement: firstRun = True def __init__(self): self.last_modes_preferred = [ ] ...
gpl-2.0
tima/ansible
lib/ansible/modules/database/vertica/vertica_configuration.py
16
6465
#!/usr/bin/python # -*- coding: utf-8 -*- # 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.1', ...
gpl-3.0
bogdandrutu/grpc
test/core/bad_client/gen_build_yaml.py
14
3634
#!/usr/bin/env python2.7 # Copyright 2015, 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 lis...
bsd-3-clause
s20121035/rk3288_android5.1_repo
external/chromium_org/tools/telemetry/telemetry/results/base_test_results_unittest.py
48
1725
# Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import sys import unittest from telemetry.core import exceptions class TestOutputStream(object): def __init__(self): self.output_data = [] def wr...
gpl-3.0
gralco/Slic3r-Ooze-Shield-Script
ooze.py
1
2674
#!/usr/bin/python import sys def find_gcode_line(lines, code, layer_height = None, retract_lift = None, reverse = False): for line in reversed(lines) if reverse else lines: if(code in line): if(layer_height == retract_lift and lines[lines.index(line)] == lines[lines.index(line)+2]): continue ...
gpl-3.0
phaller0513/aima-python
submissions/Porter/vaccuum.py
18
6500
import agents as ag import envgui as gui import random # ______________________________________________________________________________ loc_A, loc_B = (1, 1), (2, 1) # The two locations for the Vacuum world def RandomVacuumAgent(): "Randomly choose one of the actions from the vacuum environment." p = ag.Ra...
mit
oldzhu/linux
tools/perf/scripts/python/export-to-sqlite.py
132
13366
# export-to-sqlite.py: export perf data to a sqlite3 database # Copyright (c) 2017, 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. # # This progr...
gpl-2.0
Cuuuurzel/KiPyCalc
sympy_old/functions/elementary/miscellaneous.py
5
8756
from sympy.core import S, C, sympify from sympy.core.basic import Basic from sympy.core.containers import Tuple from sympy.core.operations import LatticeOp, ShortCircuit from sympy.core.function import Application, Lambda from sympy.core.expr import Expr from sympy.core.singleton import Singleton class IdentityFunctio...
mit
opencord/xos
lib/xos-genx/xos-genx-tests/test_general_validation.py
2
7085
# Copyright 2017-present Open Networking 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 agr...
apache-2.0
andrewyoung1991/scons
test/MSVS/vs-9.0-scc-legacy-files.py
5
3277
#!/usr/bin/env python # # __COPYRIGHT__ # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, ...
mit
hhj0325/pystock
com/hhj/pystock/matplotlib_demo/pie_bar_demo.py
1
1939
import numpy as np import matplotlib as mpl import matplotlib.pyplot as plt mpl.rcParams['axes.titlesize'] = 20 mpl.rcParams['xtick.labelsize'] = 16 mpl.rcParams['ytick.labelsize'] = 16 mpl.rcParams['axes.labelsize'] = 16 mpl.rcParams['xtick.major.size'] = 0 mpl.rcParams['ytick.major.size'] = 0 # 包含了狗,猫和猎豹的最高奔跑速度,还有对...
apache-2.0
alirizakeles/memopol
settings.py
1
4669
# -*- coding:utf-8 -*- # Import default settings from memopol core # Then override if needed from memopol.base.default_settings import * # pylint: disable=W0614,W0401 #============================================================================== # Generic Django project settings #===================================...
agpl-3.0
js54434/FAIT-free-as-in-tablature
AudioTracks.py
1
11744
import ast # for string-to-data conversion import math import sys import copy from PyQt4 import QtGui, QtCore import pyaudio import wave class AudioTrack: def __init__(*args, **kwargs): self = args[0] self._parent = args[1] self.scene = self._parent.scene # note:...
gpl-3.0
ltilve/chromium
third_party/libaddressinput/chromium/tools/require_fields.py
111
2236
#!/usr/bin/env python # Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import json import urllib from sys import exit as sys_exit # Derived from region_data_constants.cc. _COUNTRIES = [ 'AD', 'AE', 'A...
bsd-3-clause
HyperBaton/ansible
lib/ansible/modules/cloud/vmware/vmware_host.py
5
37611
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2015, Joseph Callen <jcallen () csc.com> # Copyright: (c) 2017, Ansible Project # Copyright: (c) 2018, Christian Kotte <christian.kotte@gmx.de> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import...
gpl-3.0
tarikfayad/trelby
src/namesdlg.py
6
8271
import misc import namearray import util import wx # NameArray, or None if not loaded nameArr = None # if not already loaded, read the name database from disk and store it. # returns False on errors. def readNames(frame): global nameArr if nameArr: # already loaded return True try: ...
gpl-2.0
CalthorpeAnalytics/urbanfootprint
footprint/main/engines/scenario_engine_setup.py
1
8916
# UrbanFootprint v1.5 # Copyright (C) 2017 Calthorpe Analytics # # This file is part of UrbanFootprint version 1.5 # # UrbanFootprint is distributed under the terms of the GNU General # Public License version 3, as published by the Free Software Foundation. This # code is distributed WITHOUT ANY WARRANTY, without impl...
gpl-3.0
thaim/ansible
lib/ansible/modules/web_infrastructure/sophos_utm/utm_proxy_frontend_info.py
31
4166
#!/usr/bin/python # Copyright: (c) 2018, Johannes Brunswicker <johannes.brunswicker@gmail.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...
mit
redhat-openstack/manila
manila/share/drivers/netapp/dataontap/cluster_mode/lib_single_svm.py
5
5036
# Copyright (c) 2015 Clinton Knight. 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
vladan-m/ggrc-core
src/ggrc_risk_assessments/__init__.py
2
2878
# Copyright (C) 2013 Google Inc., authors, and contributors <see AUTHORS file> # Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> # Created By: dan@reciprocitylabs.com # Maintained By: dan@reciprocitylabs.com from flask import Blueprint from ggrc import settings from ggrc.app import app fro...
apache-2.0
saumishr/django
django/contrib/sessions/backends/file.py
79
5340
import errno import os import tempfile from django.conf import settings from django.contrib.sessions.backends.base import SessionBase, CreateError from django.core.exceptions import SuspiciousOperation, ImproperlyConfigured class SessionStore(SessionBase): """ Implements a file based session store. """ ...
bsd-3-clause
Titulacion-Sistemas/PythonTitulacion-EV
Lib/site-packages/django/db/models/fields/__init__.py
64
53213
from __future__ import unicode_literals import copy import datetime import decimal import math import warnings from base64 import b64decode, b64encode from itertools import tee from django.db import connection from django.db.models.loading import get_model from django.db.models.query_utils import QueryWrapper from dj...
mit
schakrava/rockstor-core
src/rockstor/system/acl.py
7
1219
""" Copyright (c) 2012-2013 RockStor, Inc. <http://rockstor.com> This file is part of RockStor. RockStor 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 option) any la...
gpl-3.0
adafruit/micropython
tools/mpy-tool.py
1
24052
#!/usr/bin/env python3 # # This file is part of the MicroPython project, http://micropython.org/ # # The MIT License (MIT) # # Copyright (c) 2016 Damien P. George # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to d...
mit
blackberry/lifeguard
app/views/template/models.py
1
1500
from jinja2 import BaseLoader, TemplateNotFound class ObjectLoader(BaseLoader): def get_source(self, environment, obj): return obj, None, None class VarParser(): @staticmethod def parse_kv_strings_to_dict(*args): """ Parse 1 or more string/dict objects containing template variables in a final ...
apache-2.0
yanheven/neutron
neutron/plugins/ml2/extensions/port_security.py
12
3866
# Copyright 2015 Intel 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 requir...
apache-2.0
bcbnz/pylabels
labels/sheet.py
1
24224
# This file is part of pylabels, a Python library to create PDFs for printing # labels. # Copyright (C) 2012, 2013, 2014, 2015 Blair Bonnett # # pylabels 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 ...
gpl-3.0
lscheinkman/nupic
src/nupic/encoders/base.py
10
26422
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2013-2015, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions apply: # # This p...
agpl-3.0
rtfm-ctf/rtfmapi
modules/bruteforce/ssh-bruteforce.py
1
2834
import threading from threading import Thread import time import argparse from pexpect import pxssh import nmap Found = False Fails = 0 maxConnections = 5 connection_lock = threading.BoundedSemaphore(maxConnections) def nmapScan(tgtHost): nmapScan = nmap.PortScanner() nmapScan.scan(tgtHost, '22') state = nmapScan...
gpl-2.0
AlexanderFabisch/scikit-learn
examples/linear_model/plot_sgd_loss_functions.py
73
1232
""" ========================== SGD: convex loss functions ========================== A plot that compares the various convex loss functions supported by :class:`sklearn.linear_model.SGDClassifier` . """ print(__doc__) import numpy as np import matplotlib.pyplot as plt def modified_huber_loss(y_true, y_pred): z ...
bsd-3-clause
shakamunyi/tensorflow
tensorflow/python/estimator/canned/parsing_utils_test.py
74
8522
# 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
mancdaz/graphite-buildpackage
webapp/graphite/storage.py
4
10546
import os, time, fnmatch, socket, errno from os.path import isdir, isfile, join, exists, splitext, basename, realpath import whisper from graphite.remote_storage import RemoteStore from django.conf import settings try: import rrdtool except ImportError: rrdtool = False try: import gzip except ImportError: gzi...
apache-2.0
benoitsteiner/tensorflow-xsmm
tensorflow/contrib/gan/python/features/python/clip_weights.py
74
1194
# 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
rchakra3/x9115rc3
hw/code/8/optimizer/de.py
2
4390
from __future__ import division import random import math from common import prerun_each_obj from model.helpers.candidate import Candidate from helpers.a12 import a12 """ This contains the optimizers """ def de(model, frontier_size=10, cop=0.5, ea=0.5, repeat=100, threshold=0.01, era_size=10, era0=None, lives=5): ...
gpl-2.0
barbuza/django
scripts/manage_translations.py
277
7141
#!/usr/bin/env python # # This python file contains utility scripts to manage Django translations. # It has to be run inside the django git root directory. # # The following commands are available: # # * update_catalogs: check for new strings in core and contrib catalogs, and # output how much string...
bsd-3-clause