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
slipstream/SlipStreamClient
client/src/main/python/slipstream/Logger.py
1
1610
import os import errno import logging from logging.handlers import RotatingFileHandler class Logger(object): LOGGER_NAME = 'SSClient' LOGFILE_MAXBYTES = 2*1024*1024 LOGFILE_BACKUPCOUNT = 5 LOGFILE_FORMAT = "%(asctime)s:%(levelname)s:%(name)s:%(message)s" log_file = '/var/log/slipstream/client/slip...
apache-2.0
HyperBaton/ansible
lib/ansible/modules/network/f5/bigip_asm_policy_manage.py
38
32848
#!/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', ...
gpl-3.0
thaumos/ansible
lib/ansible/modules/network/nxos/nxos_vtp_password.py
19
8051
#!/usr/bin/python # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distribut...
gpl-3.0
foodszhang/kbengine
kbe/src/lib/python/Tools/clinic/clinic_test.py
41
21082
# Argument Clinic # Copyright 2012-2013 by Larry Hastings. # Licensed to the PSF under a contributor agreement. # import builtins import clinic from clinic import DSLParser import collections import inspect from test import support import sys import unittest from unittest import TestCase class FakeConverter: def...
lgpl-3.0
heena23/Millionaire
test/functional/p2p-compactblocks.py
10
44276
#!/usr/bin/env python3 # Copyright (c) 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 compact blocks (BIP 152). Version 1 compact blocks are pre-segwit (txids) Version 2 compact blocks are...
mit
ryfeus/lambda-packs
Keras_tensorflow/source/numpy/matrixlib/tests/test_defmatrix.py
130
14801
from __future__ import division, absolute_import, print_function import collections import numpy as np from numpy import matrix, asmatrix, bmat from numpy.testing import ( TestCase, run_module_suite, assert_, assert_equal, assert_almost_equal, assert_array_equal, assert_array_almost_equal, assert_raises ) fro...
mit
qiubing/linux-3.2.4
tools/perf/scripts/python/futex-contention.py
11261
1486
# futex contention # (c) 2010, Arnaldo Carvalho de Melo <acme@redhat.com> # Licensed under the terms of the GNU GPL License version 2 # # Translation of: # # http://sourceware.org/systemtap/wiki/WSFutexContention # # to perf python scripting. # # Measures futex contention import os, sys sys.path.append(os.environ['PER...
gpl-2.0
magicrub/MissionPlanner
Lib/bdb.py
53
21716
"""Debugger basics""" import fnmatch import sys import os import types __all__ = ["BdbQuit","Bdb","Breakpoint"] class BdbQuit(Exception): """Exception to give up completely""" class Bdb: """Generic Python debugger base class. This class takes care of details of the trace facility; ...
gpl-3.0
pilwon/selenium-webdriver
py/test/selenium/webdriver/common/webdriverwait_tests.py
15
16413
#!/usr/bin/python # Copyright 2011 WebDriver committers # # 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 l...
apache-2.0
gbowerman/azure-quickstart-templates
bosh-cf-crossregion/scripts/setup_env.py
121
9192
#!/usr/bin/env python import json import netaddr import os import random import re import requests import sys from azure.storage.blob import AppendBlobService from azure.storage.table import TableService import azure.mgmt.network from azure.common.credentials import ServicePrincipalCredentials from azure.mgmt.network ...
mit
kpreid/shinysdr
shinysdr/plugins/wspr/test_blocks.py
1
3942
# Copyright 2017 Kevin Reid and the ShinySDR contributors # # This file is part of ShinySDR. # # ShinySDR is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option...
gpl-3.0
wbchen99/bitcoin-hnote0
qa/rpc-tests/wallet.py
5
15081
#!/usr/bin/env python3 # Copyright (c) 2014-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. from test_framework.test_framework import BitcoinTestFramework from test_framework.util import * class W...
mit
migonzalvar/youtube-dl
youtube_dl/extractor/gamespot.py
105
3168
from __future__ import unicode_literals import re import json from .common import InfoExtractor from ..compat import ( compat_urllib_parse_unquote, compat_urlparse, ) from ..utils import ( unescapeHTML, ) class GameSpotIE(InfoExtractor): _VALID_URL = r'http://(?:www\.)?gamespot\.com/.*-(?P<id>\d+)/?...
unlicense
pigeonflight/strider-plone
docker/appengine/lib/cherrypy/cherrypy/lib/static.py
83
14710
try: from io import UnsupportedOperation except ImportError: UnsupportedOperation = object() import logging import mimetypes mimetypes.init() mimetypes.types_map['.dwg']='image/x-dwg' mimetypes.types_map['.ico']='image/x-icon' mimetypes.types_map['.bz2']='application/x-bzip2' mimetypes.types_map['.gz']='applica...
mit
benschmaus/catapult
telemetry/telemetry/internal/util/path_set_unittest.py
32
1086
#!/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 os import unittest from telemetry.internal.util import path_set class PathSetTest(unittest.TestCase): def testCreate(self):...
bsd-3-clause
psychopy/psychopy
psychopy/sound/microphone.py
1
35191
#!/usr/bin/env python # -*- coding: utf-8 -*- """Audio recording using a microphone. """ # Part of the PsychoPy library # Copyright (C) 2002-2018 Jonathan Peirce (C) 2019-2021 Open Science Tools Ltd. # Distributed under the terms of the GNU General Public License (GPL). __all__ = ['Microphone'] import sys import ps...
gpl-3.0
fyookball/electrum
ios/ElectronCash/app.py
1
2878
# # This file is: # Copyright (C) 2018 Calin Culianu <calin.culianu@gmail.com> # # MIT License # import os from electroncash_gui.ios_native.monkeypatches import MonkeyPatches from electroncash.util import set_verbosity from electroncash_gui.ios_native import ElectrumGui from electroncash_gui.ios_native.utils import...
mit
yograterol/django
django/http/multipartparser.py
332
24331
""" Multi-part parsing for file uploads. Exposes one class, ``MultiPartParser``, which feeds chunks of uploaded data to file upload handlers for processing. """ from __future__ import unicode_literals import base64 import binascii import cgi import sys from django.conf import settings from django.core.exceptions imp...
bsd-3-clause
sipwise/repoapi
build/test/test_utils.py
1
11161
# Copyright (C) 2017-2020 The Sipwise Team - http://sipwise.com # # 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. # # Th...
gpl-3.0
Stane1983/kernel-aml-m3
tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Core.py
11088
3246
# Core.py - Python extension for perf script, core functions # # Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com> # # This software may be distributed under the terms of the GNU General # Public License ("GPL") version 2 as published by the Free Software # Foundation. from collections import defaultdict def aut...
gpl-2.0
ryfeus/lambda-packs
Pyrestest_wrk/source/pip/_vendor/requests/adapters.py
205
16799
# -*- coding: utf-8 -*- """ requests.adapters ~~~~~~~~~~~~~~~~~ This module contains the transport adapters that Requests uses to define and maintain connections. """ import socket from .models import Response from .packages.urllib3 import Retry from .packages.urllib3.poolmanager import PoolManager, proxy_from_url ...
mit
RNAcentral/rnacentral-import-pipeline
tests/databases/gtrnadb/parser_test.py
1
5743
# -*- coding: utf-8 -*- """ Copyright [2009-2017] EMBL-European Bioinformatics Institute 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
mrquim/mrquimrepo
repo/script.module.youtube.dl/lib/youtube_dl/extractor/amcnetworks.py
24
4634
# coding: utf-8 from __future__ import unicode_literals from .theplatform import ThePlatformIE from ..utils import ( update_url_query, parse_age_limit, int_or_none, ) class AMCNetworksIE(ThePlatformIE): _VALID_URL = r'https?://(?:www\.)?(?:amc|bbcamerica|ifc|wetv)\.com/(?:movies|shows(?:/[^/]+)+)/(?P...
gpl-2.0
bavardage/statsmodels
tools/github_stats.py
3
7203
#!/usr/bin/env python """Simple tools to query github.com and gather stats about issues. Copied from IPython 732be29 https://github.com/ipython/ipython/blob/master/tools/github_stats.py """ #----------------------------------------------------------------------------- # Imports #---------------------------------------...
bsd-3-clause
jmartinezchaine/OpenERP
openerp/addons/mrp/report/mrp_report.py
9
3791
# -*- 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
msrb/freeipa
ipalib/plugins/aci.py
2
34228
# Authors: # Rob Crittenden <rcritten@redhat.com> # Pavel Zuna <pzuna@redhat.com> # # Copyright (C) 2009 Red Hat # see file 'COPYING' for use and warranty information # # 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 # th...
gpl-3.0
kaze/paasmaker
paasmaker/pacemaker/controller/role.py
2
17884
# # Paasmaker - Platform as a Service # # 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/. # import unittest import paasmaker import uuid import logging import colander im...
mpl-2.0
camilonova/django
tests/model_fields/test_datetimefield.py
87
3393
import datetime from django.db import models from django.test import ( SimpleTestCase, TestCase, override_settings, skipUnlessDBFeature, ) from django.test.utils import requires_tz_support from django.utils import timezone from .models import DateTimeModel class DateTimeFieldTests(TestCase): def test_datet...
bsd-3-clause
grovesdixon/metaTranscriptomes
scripts/parse_codeml_pairwise_outputBACKUP.py
1
6189
#!/usr/bin/env python ##parse_codeml_pairwise_output.py ##written 6/26/14 by Groves Dixon ProgramName = 'parse_codeml_pairwise_output.py' LastUpdated = '6/26/14' By = 'Groves Dixon' VersionNumber = '1.0' print "\nRunning Program {}...".format(ProgramName) VersionString = '{} version {} Last Updated {} by {}'.format(Pr...
mit
whitepages/nova
nova/tests/functional/api_sample_tests/test_create_backup.py
30
1937
# Copyright 2012 Nebula, Inc. # Copyright 2013 IBM Corp. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required...
apache-2.0
iRGBit/QGIS
python/plugins/processing/algs/qgis/GeometryConvert.py
5
9974
# -*- coding: utf-8 -*- """ *************************************************************************** Gridify.py --------------------- Date : May 2010 Copyright : (C) 2010 by Michael Minn Email : pyqgis at michaelminn dot com *****************************...
gpl-2.0
Wintermute0110/plugin.program.advanced.emulator.launcher
tests/fakes.py
1
8256
from abc import ABCMeta, abstractmethod from resources.objects import * from resources.utils import * from resources.scrap import * class FakeRomSetRepository(ROMSetRepository): def __init__(self, roms): self.roms = roms def find_by_launcher(self, launcher): return self.roms ...
gpl-2.0
coolbombom/CouchPotatoServer
couchpotato/core/downloaders/transmission/main.py
1
10725
from base64 import b64encode from couchpotato.core.downloaders.base import Downloader, StatusList from couchpotato.core.helpers.encoding import isInt from couchpotato.core.logger import CPLog from couchpotato.environment import Env from datetime import timedelta import httplib import json import os.path import re impor...
gpl-3.0
astroswego/magellanic-structure
src/magstruct/transformations.py
1
1722
import numpy from numpy import array, sin, cos __all__ = [ 'Equatorial2Cartesian', 'Rotation3D', 'rotation_matrix_3d' ] class Equatorial2Cartesian(): def __init__(self, RA_0, Dec_0, D_0): self.RA_0 = RA_0 self.Dec_0 = Dec_0 self.D_0 = D_0 def fit(self, X, y=None): ...
mit
lindemann09/pyForceDAQ
forceDAQ/data_handling/read_force_data.py
1
2147
""" Functions to read your force and event data """ __author__ = 'Oliver Lindemann' import os import sys import gzip from collections import OrderedDict import numpy as np TAG_COMMENTS = "#" TAG_UDPDATA = TAG_COMMENTS + "UDP" TAG_DAQEVENTS = TAG_COMMENTS + "T" def _csv(line): return list(map(lambda x: x.strip(...
mit
alanch-ms/PTVS
Python/Tests/TestData/VirtualEnv/env/Lib/encodings/cp1251.py
593
13617
""" Python Character Mapping Codec cp1251 generated from 'MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1251.TXT' with gencodec.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_table) def decode(self,in...
apache-2.0
cemarchi/biosphere
Src/BioAnalyzer/Analysis/GenePrioritization/Steps/DataIntegration/IntermediateRepresentation/Transformers/MicroRnaToGeneTransformer.py
1
4546
import math import statistics from itertools import groupby from random import randint from typing import Dict, Tuple, Counter import pandas as pd from Src.BioAnalyzer.Analysis.GenePrioritization.Steps.DataIntegration.IntermediateRepresentation.Generators import \ IntermediateRepresentationGeneratorBase from Src....
bsd-3-clause
aplanas/kmanga
kmanga/core/models.py
1
21424
import os.path from django.conf import settings from django.db import connection from django.db import models from django.db.models import Count from django.db.models import F from django.db.models import Q from django.urls import reverse from django.utils import timezone class TimeStampedModel(models.Model): cr...
gpl-3.0
jbenden/ansible
test/units/modules/network/nxos/test_nxos_vxlan_vtep.py
47
2418
# (c) 2016 Red Hat Inc. # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is dis...
gpl-3.0
XiaosongWei/blink-crosswalk
Tools/Scripts/webkitpy/layout_tests/models/test_configuration_unittest.py
42
18084
# 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
blueboxgroup/neutron
neutron/plugins/sriovnicagent/sriov_nic_agent.py
1
14818
# Copyright 2014 Mellanox Technologies, Ltd # # 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 t...
apache-2.0
hryamzik/ansible
test/units/modules/network/enos/test_enos_facts.py
57
3233
# (c) 2016 Red Hat Inc. # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is dis...
gpl-3.0
batxes/4c2vhic
SHH_WT_models_highres/SHH_WT_models_highres_final_output_0.1_-0.1_5000/SHH_WT_models_highres8464.py
4
88234
import _surface import chimera try: import chimera.runCommand except: pass from VolumePath import markerset as ms try: from VolumePath import Marker_Set, Link new_marker_set=Marker_Set except: from VolumePath import volume_path_dialog d= volume_path_dialog(True) new_marker_set= d.new_marker_set marker_set...
gpl-3.0
bhilburn/gnuradio
gr-digital/python/digital/qa_pfb_clock_sync.py
23
7031
#!/usr/bin/env python # # Copyright 2011,2013 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio 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, or (at your optio...
gpl-3.0
Azure/azure-sdk-for-python
sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_12_01/aio/operations/_certificates_operations.py
1
21769
# 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
marcoitur/FreeCAD
src/Mod/Assembly/Init.py
55
1879
# FreeCAD init script of the Assembly module # (c) 2001 Juergen Riegel #*************************************************************************** #* (c) Juergen Riegel (juergen.riegel@web.de) 2002 * #* * #* T...
lgpl-2.1
KL-WLCR/incubator-airflow
tests/contrib/operators/test_dataproc_operator.py
9
13326
# -*- 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
mozilla/popcorn_maker
vendor-local/lib/python/html5lib/treewalkers/__init__.py
133
2416
"""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 ...
bsd-3-clause
Maspear/odoo
addons/stock/report/__init__.py
376
1088
# -*- 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
buddyli/private2w
libs/pony/orm/tests/test_queries.py
2
3478
from __future__ import with_statement import re, os, os.path, sys, imp from pony import orm from pony.orm import core from pony.orm.tests import testutils directive_re = re.compile(r'(\w+)(\s+[0-9\.]+)?:') directive = module_name = None statements = [] lines = [] def Schema(param): if not statement_used: ...
apache-2.0
HingeChat/HingeChat
src/hingechat/qt/qChatWidget.py
1
8829
import re from PyQt5.QtCore import Qt from PyQt5.QtCore import QTimer from PyQt5.QtGui import QFontMetrics from PyQt5.QtWidgets import QHBoxLayout from PyQt5.QtWidgets import QMessageBox from PyQt5.QtWidgets import QLabel from PyQt5.QtWidgets import QPushButton from PyQt5.QtWidgets import QSplitter from PyQt...
lgpl-3.0
emanuelschuetze/OpenSlides
tests/integration/topics/test_viewset.py
2
1395
import pytest from django.urls import reverse from rest_framework import status from openslides.agenda.models import Item from openslides.topics.models import Topic from openslides.utils.test import TestCase from ..helpers import count_queries @pytest.mark.django_db(transaction=False) def test_topic_item_db_queries...
mit
hankcs/HanLP
hanlp/components/parsers/biaffine_tf/alg.py
2
10513
# -*- coding:utf-8 -*- # Author: hankcs # Date: 2019-12-26 19:49 # Ported from the PyTorch implementation https://github.com/zysite/biaffine-parser from typing import List import numpy as np import tensorflow as tf from collections import defaultdict def nonzero(t: tf.Tensor) -> tf.Tensor: return tf.where(t > 0) ...
apache-2.0
AutorestCI/azure-sdk-for-python
azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/usage_name.py
8
1317
# 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
LLNL/spack
var/spack/repos/builtin/packages/ghost/package.py
4
2514
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class Ghost(CMakePackage, CudaPackage): """GHOST: a General, Hybrid and Optimized Sparse Toolki...
lgpl-2.1
pranjan77/ranjansample
lib/ranjansample/ranjansampleClient.py
1
7092
############################################################ # # Autogenerated by the KBase type compiler - # any changes made here will be overwritten # ############################################################ try: import json as _json except ImportError: import sys sys.path.append('simplejson-2.3.3')...
mit
memoz/ShadowDNS
shadowdns/dnsrelay.py
79
11669
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (c) 2014 clowwindy # # 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 u...
mit
namccart/gnuradio
gr-qtgui/apps/plot_base.py
58
5829
#!/usr/bin/env python # # Copyright 2013 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio 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, or (at your option) # ...
gpl-3.0
benburry/carbon
lib/carbon/client.py
4
14604
from collections import deque from time import time from twisted.application.service import Service from twisted.internet import reactor from twisted.internet.defer import Deferred, DeferredList from twisted.internet.protocol import ReconnectingClientFactory from twisted.protocols.basic import Int32StringReceiver from...
apache-2.0
hfp/tensorflow-xsmm
tensorflow/contrib/opt/python/training/adamax.py
39
8261
# Copyright 2018 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
pkruskal/scikit-learn
sklearn/cluster/k_means_.py
128
54694
"""K-means clustering""" # Authors: Gael Varoquaux <gael.varoquaux@normalesup.org> # Thomas Rueckstiess <ruecksti@in.tum.de> # James Bergstra <james.bergstra@umontreal.ca> # Jan Schlueter <scikit-learn@jan-schlueter.de> # Nelle Varoquaux # Peter Prettenhofer <peter.prettenh...
bsd-3-clause
tchellomello/home-assistant
tests/components/cloud/test_prefs.py
13
2312
"""Test Cloud preferences.""" from homeassistant.auth.const import GROUP_ID_ADMIN from homeassistant.components.cloud.prefs import STORAGE_KEY, CloudPreferences from tests.async_mock import patch async def test_set_username(hass): """Test we clear config if we set different username.""" prefs = CloudPreferen...
apache-2.0
350dotorg/Django
django/contrib/sessions/backends/file.py
43
5309
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
zahodi/ansible
lib/ansible/modules/cloud/openstack/os_keystone_service.py
27
6355
#!/usr/bin/python # Copyright 2016 Sam Yaple # # This module 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 software is distr...
gpl-3.0
JiahuiZHONG/Internship_Thread
tests/scripts/thread-cert/Cert_5_6_08_ContextManagement.py
1
4303
#!/usr/bin/python # # Copyright (c) 2016, Nest Labs, 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: # 1. Redistributions of source code must retain the above copyright # notice, thi...
bsd-3-clause
mvs-live/metaverse
test/test-rpc-v3/TestCase/MVSTestCase.py
3
5796
import unittest from utils import mvs_rpc, common, code from Roles import Alice, Bob, Cindy, Dale, Eric, Frank, Zac class MVSTestCaseBase(unittest.TestCase): roles = (Alice, Bob, Cindy, Dale, Eric, Frank, Zac) need_mine = True def setUp(self): for role in self.roles: try: ...
agpl-3.0
scherroman/mugen
mugen/location_utility.py
1
2143
from typing import List, Tuple """ Module for Location & Interval manipulation """ def intervals_from_locations(locations: List[float]) -> List[float]: intervals = [] previous_location = None for index, location in enumerate(locations): if index == 0: intervals.append(location) ...
mit
iychoi/syndicate
python/syndicate/ag/fs_driver_common/fs_backends/iplant_datastore/irods_client.py
3
7553
#!/usr/bin/env python """ Copyright 2014 The Trustees of Princeton University 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 Unle...
apache-2.0
darkleons/odoo
addons/account/project/project.py
32
2411
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 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
Zelgadis87/Sick-Beard
lib/jsonrpclib/jsonrpc.py
86
17140
""" 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 distributed under the Lice...
gpl-3.0
adbrebs/spynet
models/max_pool_3d.py
1
3198
from theano import tensor from theano.tensor.signal.downsample import DownsampleFactorMax def max_pool_3d(input, ds, ignore_border=False): """ Takes as input a N-D tensor, where N >= 3. It downscales the input by the specified factor, by keeping only the maximum value of non-overlapping patches of si...
bsd-2-clause
zikifer/node-gyp
legacy/tools/gyp/pylib/gyp/easy_xml_test.py
60
3231
#!/usr/bin/env python # Copyright (c) 2011 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. """ Unit tests for the easy_xml.py file. """ import gyp.easy_xml as easy_xml import unittest import StringIO class TestSequenceFunctions(...
mit
chrismedrela/scriptcraft
scriptcraft/client.py
1
76856
#!/usr/bin/env python #-*- coding:utf-8 -*- import ConfigParser try: import cPickle as pickle except: import pickle import itertools import math import os.path from Queue import Queue import random import time import threading from Tkinter import * import tkColorChooser import tkFileDialog import tkFont import...
gpl-3.0
sillydan1/WhatEverEngine
packages/IronPython.StdLib.2.7.5/content/Lib/multiprocessing/__init__.py
8
7897
# # Package analogous to 'threading.py' but using processes # # multiprocessing/__init__.py # # This package is intended to duplicate the functionality (and much of # the API) of threading.py but uses processes instead of threads. A # subpackage 'multiprocessing.dummy' has the same API but is a simple # wrapper for 't...
apache-2.0
mikedh/trimesh
trimesh/path/exchange/load.py
1
2622
import os from .dxf import _dxf_loaders from .svg_io import svg_to_path from ..path import Path from . import misc from ... import util def load_path(file_obj, file_type=None, **kwargs): """ Load a file to a Path file_object. Parameters ----------- file_obj : One of the following: - Pa...
mit
jakdot/pyactr
tutorials/u7_simplecompilation.py
1
1254
""" Testing a simple case of production compilation. The compilation also allows for utility learning, shown in the model below, as well. """ import warnings import pyactr as actr class Compilation1(object): """ Model testing compilation -- basic cases. """ def __init__(self, **kwargs): actr...
gpl-3.0
mcfletch/AutobahnPython
autobahn/autobahn/wamp/broker.py
9
8865
############################################################################### ## ## Copyright (C) 2013-2014 Tavendo GmbH ## ## 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 ## ## h...
apache-2.0
hn8841182/2015cd_midterm
static/Brython3.1.1-20150328-091302/Lib/csv.py
637
16166
""" csv.py - read/write/investigate CSV files """ import re from _csv import Error, __version__, writer, reader, register_dialect, \ unregister_dialect, get_dialect, list_dialects, \ field_size_limit, \ QUOTE_MINIMAL, QUOTE_ALL, QUOTE_NONNUMERIC, QUOTE_NONE, \ ...
gpl-3.0
mottosso/mindbender-setup
bin/windows/python36/Lib/lib2to3/fixes/fix_unicode.py
136
1256
r"""Fixer for unicode. * Changes unicode to str and unichr to chr. * If "...\u..." is not unicode literal change it into "...\\u...". * Change u"..." into "...". """ from ..pgen2 import token from .. import fixer_base _mapping = {"unichr" : "chr", "unicode" : "str"} class FixUnicode(fixer_base.BaseFix): BM_c...
mit
leo524/7mos-fourm
node_modules/nodebb-plugin-markdown/node_modules/pygmentize-bundled/vendor/pygments/pygments/lexers/hdl.py
363
16209
# -*- coding: utf-8 -*- """ pygments.lexers.hdl ~~~~~~~~~~~~~~~~~~~ Lexers for hardware descriptor languages. :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re from pygments.lexer import RegexLexer, bygroups, include, using, t...
gpl-3.0
er1iang/hfut_stu_lib
hfut/value.py
3
1841
# -*- coding:utf-8 -*- from __future__ import unicode_literals import re HF = 'HF' XC = 'XC' ENV = { HF: 'http://bkjw.hfut.edu.cn/', XC: 'http://222.195.8.201/', # 宣城校区教务地址, 只有第一个可以外网访问 'XC_HOSTS': [ 'http://222.195.8.201/', 'http://172.18.6.93/', 'http://172.18.6.94/', ...
mit
denis-pitul/django
tests/select_related/models.py
99
3320
""" Tests for select_related() ``select_related()`` follows all relationships and pre-caches any foreign key values so that complex trees can be fetched in a single query. However, this isn't always a good idea, so the ``depth`` argument control how many "levels" the select-related behavior will traverse. """ from dj...
bsd-3-clause
duyet-website/api.duyet.net
lib/docs/conf.py
1
8187
# -*- coding: utf-8 -*- # # Faker documentation build configuration file, created by # sphinx-quickstart on Tue Mar 11 11:25:48 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 file. # # All...
mit
coyotevz/nobix-app
nbs/models/misc.py
1
3865
# -*- coding: utf-8 -*- from datetime import datetime from sqlalchemy.ext.declarative import declared_attr from nbs.models import db class TimestampMixin(object): created = db.Column(db.DateTime, default=datetime.now) modified = db.Column(db.DateTime, default=datetime.now, onupdat...
mit
pablodiguerero/asterisk.api
migrations/versions/4_add_physical_users_.py
1
1968
"""empty message Revision ID: a374e36d0888 Revises: 4a6559da7594 Create Date: 2017-05-21 22:53:53.490856 """ from alembic import op import sqlalchemy as sa from sqlalchemy.orm import Session from models import physical from models import user # revision identifiers, used by Alembic. revision = '4_add_physical_user...
mit
gkoelln/youtube-dl
youtube_dl/extractor/livestream.py
10
13739
from __future__ import unicode_literals import re import itertools from .common import InfoExtractor from ..compat import ( compat_str, compat_urlparse, ) from ..utils import ( find_xpath_attr, xpath_attr, xpath_with_ns, xpath_text, orderedSet, update_url_query, int_or_none, fl...
unlicense
Weihonghao/ECM
Vpy34/lib/python3.5/site-packages/tensorflow/python/framework/cpp_shape_inference_pb2.py
9
5959
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: tensorflow/python/framework/cpp_shape_inference.proto import sys _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from goo...
agpl-3.0
wesm/ibis
dev/merge-pr.py
1
8184
#!/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 "Li...
apache-2.0
itsjeyd/edx-platform
lms/djangoapps/verify_student/tests/test_services.py
16
8259
""" Tests of re-verification service. """ import ddt from opaque_keys.edx.keys import CourseKey from course_modes.models import CourseMode from course_modes.tests.factories import CourseModeFactory from student.models import CourseEnrollment from student.tests.factories import UserFactory from lms.djangoapps.verify_...
agpl-3.0
hsaputra/tensorflow
tensorflow/python/kernel_tests/sparse_reorder_op_test.py
94
5261
# 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
vinoth3v/In
In/core/valuator.py
1
7873
import re from In.core.object_meta import ObjectMetaBase class ValuatorContainer(dict): def __missing__(self, key): vcls = IN.register.get_class(key, 'Valuator') obj = vcls() self[key] = obj return obj class ValuatorEngine: '''Valuator class that valuate values based on validation rules. ...
apache-2.0
ku3o/coala-bears
tests/hypertext/BootLintBearTest.py
7
2754
from bears.hypertext.BootLintBear import BootLintBear from tests.LocalBearTestHelper import verify_local_bear good_file = """ <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta name="viewport" content="width=device...
agpl-3.0
ledtvavs/repository.ledtv
script.tvguide.Vader/resources/lib/dateutil/parser/isoparser.py
9
12845
# -*- coding: utf-8 -*- """ This module offers a parser for ISO-8601 strings It is intended to support all valid date, time and datetime formats per the ISO-8601 specification. """ from datetime import datetime, timedelta, time, date import calendar from dateutil import tz from functools import wraps import re impor...
gpl-3.0
onecloud/neutron
neutron/tests/unit/vmware/test_nsx_plugin.py
2
55152
# Copyright (c) 2012 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
mihaip/delicious2google
app/openid/yadis/accept.py
184
3742
"""Functions for generating and parsing HTTP Accept: headers for supporting server-directed content negotiation. """ def generateAcceptHeader(*elements): """Generate an accept header value [str or (str, float)] -> str """ parts = [] for element in elements: if type(element) is str: ...
apache-2.0
Harmonic/laradock
jupyterhub/jupyterhub_config.py
10
5035
# Copyright (c) Jupyter Development Team. # Distributed under the terms of the Modified BSD License. # Configuration file for JupyterHub import os c = get_config() # create system users that don't exist yet c.LocalAuthenticator.create_system_users = True def create_dir_hook(spawner): username = spawner.user.nam...
mit
roadmapper/ansible
lib/ansible/module_utils/facts/system/service_mgr.py
38
6617
# Collect facts related to system service manager and init. # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) a...
gpl-3.0
plotly/plotly.py
packages/python/plotly/plotly/graph_objs/heatmapgl/legendgrouptitle/_font.py
1
8487
from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType import copy as _copy class Font(_BaseTraceHierarchyType): # class properties # -------------------- _parent_path_str = "heatmapgl.legendgrouptitle" _path_str = "heatmapgl.legendgrouptitle.font" _valid_props = {"col...
mit
hkariti/ansible-modules-core
windows/win_template.py
40
2343
# this is a virtual module that is entirely implemented server side DOCUMENTATION = ''' --- module: win_template version_added: "1.9.2" short_description: Templates a file out to a remote server. description: - Templates are processed by the Jinja2 templating language (U(http://jinja.pocoo.org/docs/)) - do...
gpl-3.0
e9wifi-dev/android_kernel_lge_e9wifi
tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Core.py
11088
3246
# Core.py - Python extension for perf script, core functions # # Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com> # # This software may be distributed under the terms of the GNU General # Public License ("GPL") version 2 as published by the Free Software # Foundation. from collections import defaultdict def aut...
gpl-2.0