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
abgworrall/test-infra
gubernator/third_party/defusedxml/sax.py
53
1462
# defusedxml # # Copyright (c) 2013 by Christian Heimes <christian@python.org> # Licensed to PSF under a Contributor Agreement. # See http://www.python.org/psf/license for licensing details. """Defused xml.sax """ from __future__ import print_function, absolute_import from xml.sax import InputSource as _InputSource fr...
apache-2.0
ess-dmsc/do-ess-data-simulator
DonkiPlayer/scripts/mcstas-generator/src/flatbuffers/compat.py
19
1465
# Copyright 2016 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...
bsd-2-clause
YinongLong/scikit-learn
sklearn/decomposition/tests/test_sparse_pca.py
160
6028
# Author: Vlad Niculae # License: BSD 3 clause import sys import numpy as np from sklearn.utils.testing import assert_array_almost_equal from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing import SkipTest from sklearn.utils.testing import ass...
bsd-3-clause
isyippee/ceilometer
ceilometer/hardware/discovery.py
7
3617
# -*- encoding: 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, so...
apache-2.0
pizzathief/scipy
benchmarks/benchmarks/sparse.py
5
13402
""" Simple benchmarks for the sparse module """ import warnings import time import timeit try: import cPickle as pickle except ImportError: import pickle import numpy import numpy as np from numpy import ones, array, asarray, empty, random try: from scipy import sparse from scipy.sparse import (csr_ma...
bsd-3-clause
chemelnucfin/tensorflow
tensorflow/contrib/distributions/python/kernel_tests/mvn_full_covariance_test.py
25
7365
# 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
katiecheng/Bombolone
env/lib/python2.7/site-packages/PIL/MicImagePlugin.py
40
2160
# # The Python Imaging Library. # $Id$ # # Microsoft Image Composer support for PIL # # Notes: # uses TiffImagePlugin.py to read the actual image streams # # History: # 97-01-20 fl Created # # Copyright (c) Secret Labs AB 1997. # Copyright (c) Fredrik Lundh 1997. # # See the README file for information ...
bsd-3-clause
nipy/nireg
examples/affine_registration.py
2
4047
#!/usr/bin/env python # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: """ This script requires the nipy-data package to run. It is an example of inter-subject affine registration using two MR-T1 images from the sulcal 2000 database acquired at CEA, SHFJ,...
bsd-3-clause
tdipisa/mapstore
mapcomposer/app/static/externals/proj4js/tools/pjjs.py
250
3061
#!/usr/bin/env python # # TODO explain # # -- Copyright 2007 IGN France / Geoportail project -- # import sys import os import re SUFFIX_JAVASCRIPT = ".js" def _pjcat2js_remove(rezDirectory,catName,targetDirectory): pjCatFilename = os.path.join(rezDirectory, catName) pjCat = open(pjCatFilename,'r') commen...
gpl-3.0
HiroIshikawa/21playground
flask-rethink/env/lib/python3.5/site-packages/pip/commands/list.py
269
7251
from __future__ import absolute_import import logging from pip._vendor import pkg_resources from pip.basecommand import Command from pip.exceptions import DistributionNotFound from pip.index import FormatControl, fmt_ctl_formats, PackageFinder, Search from pip.req import InstallRequirement from pip.utils import get_...
mit
lomocoin/lomocoin-qt
share/qt/make_spinner.py
4415
1035
#!/usr/bin/env python # W.J. van der Laan, 2011 # Make spinning .mng animation from a .png # Requires imagemagick 6.7+ from __future__ import division from os import path from PIL import Image from subprocess import Popen SRC='img/reload_scaled.png' DST='../../src/qt/res/movies/update_spinner.mng' TMPDIR='/tmp' TMPNAM...
mit
liyonghelpme/myBlog
pelican/tests/test_utils.py
1
16159
# -*- coding: utf-8 -*- from __future__ import unicode_literals, print_function import logging import shutil import os import datetime import time import locale from sys import platform, version_info from tempfile import mkdtemp import pytz from pelican.generators import TemplatePagesGenerator from pelican.writers im...
agpl-3.0
playm2mboy/edx-platform
openedx/core/lib/api/authentication.py
36
3458
""" Common Authentication Handlers used across projects. """ from rest_framework.authentication import SessionAuthentication from rest_framework_oauth.authentication import OAuth2Authentication from rest_framework.exceptions import AuthenticationFailed from rest_framework_oauth.compat import oauth2_provider, provider_n...
agpl-3.0
tquilian/exeNext
twisted/web/google.py
71
2101
# Copyright (c) 2001-2004 Twisted Matrix Laboratories. # See LICENSE for details. # """\"I'm Feeling Lucky\" with U{Google<http://google.com>}. """ import urllib from twisted.internet import protocol, reactor, defer from twisted.web import http class GoogleChecker(http.HTTPClient): def connectionMade(self): ...
gpl-2.0
AustereCuriosity/astropy
astropy/io/ascii/tests/test_types.py
4
1749
# Licensed under a 3-clause BSD style license - see LICENSE.rst # TEST_UNICODE_LITERALS from ....extern.six.moves import cStringIO as StringIO import numpy as np from ... import ascii from ....extern.six.moves import zip from .common import assert_equal, setup_function, teardown_function def test_types_from_dat(...
bsd-3-clause
Zhongqilong/mykbengineer
kbe/res/scripts/common/Lib/test/test_email/test_contentmanager.py
91
33538
import unittest from test.test_email import TestEmailBase, parameterize import textwrap from email import policy from email.message import EmailMessage from email.contentmanager import ContentManager, raw_data_manager @parameterize class TestContentManager(TestEmailBase): policy = policy.default message = Em...
lgpl-3.0
GenericStudent/home-assistant
homeassistant/components/hvv_departures/sensor.py
9
6546
"""Sensor platform for hvv.""" from datetime import timedelta import logging from aiohttp import ClientConnectorError from pygti.exceptions import InvalidAuth from pytz import timezone from homeassistant.const import ATTR_ATTRIBUTION, ATTR_ID, DEVICE_CLASS_TIMESTAMP from homeassistant.helpers import aiohttp_client fr...
apache-2.0
nsinha17/incubator-metron
metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/METRON/0.2.1BETA/package/scripts/mysql_users.py
1
1981
#!/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 "License");...
apache-2.0
MarioCodes/Desarrollo_Proyectos_Clase
python/convert-java-logs-to-csv-file/logs/Logs.py
1
1687
""" Created on May 08, 2019 @author: msanchez """ from logs.SVWLogs import SVWLogs from utils.FileUtils import FileUtils class Logs(object): """ Sets the main structure to follow, to modify it in a future with other Log structures. Attributes: svw_logs specific, encapsulated solution to c...
apache-2.0
mutanthost/plexhole
lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/url.py
713
5879
from __future__ import absolute_import from collections import namedtuple from ..exceptions import LocationParseError url_attrs = ['scheme', 'auth', 'host', 'port', 'path', 'query', 'fragment'] class Url(namedtuple('Url', url_attrs)): """ Datastructure for representing an HTTP URL. Used as a return value f...
gpl-2.0
MakeHer/edx-platform
common/test/acceptance/tests/lms/test_lms_dashboard_search.py
74
7060
""" Test dashboard search """ import os import json from bok_choy.web_app_test import WebAppTest from ..helpers import generate_course_key from ...pages.common.logout import LogoutPage from ...pages.common.utils import click_css from ...pages.studio.utils import add_html_component, type_in_codemirror from ...pages.stu...
agpl-3.0
mehtapgundogan/Tellal
env/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/eucjpprober.py
2919
3678
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is mozilla.org code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights Reserved. # # Con...
gpl-2.0
enthought/traitsbackendqt
enthought/traits/ui/qt4/ui_editor.py
1
1280
#------------------------------------------------------------------------------ # # Copyright (c) 2009, Enthought, Inc. # All rights reserved. # # This software is provided without warranty under the terms of the BSD # license included in enthought/LICENSE.txt and may be redistributed only # under the conditions d...
gpl-2.0
ktan2020/legacy-automation
win/Lib/site-packages/robot/running/timeouts/timeoutsignaling.py
2
1263
# Copyright 2008-2013 Nokia Siemens Networks Oyj # # 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
viger/docker
proxy/proxy/code/default/python27/1.0/lib/email/header.py
255
22243
# Copyright (C) 2002-2006 Python Software Foundation # Author: Ben Gertzfield, Barry Warsaw # Contact: email-sig@python.org """Header encoding and decoding functionality.""" __all__ = [ 'Header', 'decode_header', 'make_header', ] import re import binascii import email.quoprimime import email.base64m...
mit
acumb/LatticeDNAOrigami
origamipy/mbar.py
1
5092
"""Functions for carrying out Multi Bennet Acceptance Ration (MBAR) analysis""" import math from pymbar import timeseries import scipy from origamipy.us_process import * def calc_rstaple_u(staple_M, lattice_site_volume): """Calculate reduced staple chemical potential""" sites_per_litre = 1e-3 / lattice_sit...
mit
zhanqxun/cv_fish
numpy/doc/creation.py
118
5507
""" ============== Array Creation ============== Introduction ============ There are 5 general mechanisms for creating arrays: 1) Conversion from other Python structures (e.g., lists, tuples) 2) Intrinsic numpy array array creation objects (e.g., arange, ones, zeros, etc.) 3) Reading arrays from disk, either from...
apache-2.0
S01780/python-social-auth
social/tests/backends/test_amazon.py
92
1317
import json from social.tests.backends.oauth import OAuth2Test class AmazonOAuth2Test(OAuth2Test): backend_path = 'social.backends.amazon.AmazonOAuth2' user_data_url = 'https://www.amazon.com/ap/user/profile' expected_username = 'FooBar' access_token_body = json.dumps({ 'access_token': 'fooba...
bsd-3-clause
Outernet-Project/librarian-ondd
librarian_ondd/setup.py
1
2550
import logging from bottle import request from bottle_utils.i18n import lazy_gettext as _ from .forms import ONDDForm def read_ondd_setup(): initial_data = request.app.supervisor.exts.setup.get('ondd') return {} if isinstance(initial_data, bool) else initial_data def has_invalid_config(): ondd_client ...
gpl-3.0
annapowellsmith/openpresc
openprescribing/pipeline/management/commands/update_smoketests.py
1
1634
import os import glob import json from django.conf import settings from django.core.management import BaseCommand from gcutils.bigquery import Client, results_to_dicts class Command(BaseCommand): def add_arguments(self, parser): parser.add_argument('last_imported') def handle(self, *args, **kwargs)...
mit
diagramsoftware/account-financial-tools
account_journal_always_check_date/__openerp__.py
13
2087
# -*- encoding: utf-8 -*- ############################################################################## # # Account Journal Always Check Date module for OpenERP # Copyright (C) 2013-2014 Akretion (http://www.akretion.com) # @author Alexis de Lattre <alexis.delattre@akretion.com> # # This program is free so...
agpl-3.0
TuXiaokang/pyseeta
pyseeta/model_zoo.py
1
4747
''' Copyright (c) 2016- Facebook, Inc (Adam Paszke) Copyright (c) 2014- Facebook, Inc (Soumith Chintala) Copyright (c) 2011-2014 Idiap Research Institute (Ronan Collobert) Copyright (c) 2012-2014 Deepmind Technologies (Koray Kavukcuoglu) Copyright (c) 2011-2012 NEC Laboratories America ...
mit
nagyistoce/odoo-dev-odoo
addons/l10n_be/wizard/l10n_be_account_vat_declaration.py
309
10685
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # Adapted by Noviat to # - enforce correct vat number # - support negative balance # - assign...
agpl-3.0
Grumpy-Mike/Mikes-Pi-Bakery
LEGO_Boost/Part 1/distance_sensor.py
1
1577
from pylgbst.movehub import MoveHub, ColorDistanceSensor import time def callback(clr, distance): if clr <= 10: print("Colour number",clr,LED_COLORS[clr], " / Distance",distance) else: print("Color: %s / Distance: %s" % (clr, distance)) hub = MoveHub() LED_COLORS = ['BLACK', '',...
gpl-2.0
r0h4n/node-agent
tendrl/node_agent/provisioner/gluster/plugins/gdeploy.py
3
6240
import importlib from tendrl.commons.utils import log_utils as logger from tendrl.commons.utils.ssh import generate_key from tendrl.node_agent.provisioner.gluster.provisioner_base import\ ProvisionerBasePlugin try: from python_gdeploy.actions import configure_gluster_firewall # noqa from python_gdeploy.ac...
lgpl-2.1
ATIX-AG/ansible
test/units/plugins/action/test_synchronize.py
32
8106
''' (Epdb) pprint(DeepDiff(self.final_task_vars, out_task_vars), indent=2) { 'dic_item_added': set([u"root['ansible_python_interpreter']"]), 'dic_item_removed': set([ u"root['hostvars']['127.0.0.1']", u"root['hostvars']['::1']", u"root['hostvars']['localhost']"]...
gpl-3.0
pemiu01/ionicons
builder/generate.py
357
9438
from subprocess import call import os import json BUILDER_PATH = os.path.dirname(os.path.abspath(__file__)) ROOT_PATH = os.path.join(BUILDER_PATH, '..') FONTS_FOLDER_PATH = os.path.join(ROOT_PATH, 'fonts') CSS_FOLDER_PATH = os.path.join(ROOT_PATH, 'css') SCSS_FOLDER_PATH = os.path.join(ROOT_PATH, 'scss') LESS_FOLDER_...
mit
WSDC-NITWarangal/django
django/conf/locale/fi/formats.py
504
1390
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # from __future__ import unicode_literals # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'j. E Y' TIME_FORMAT = 'G.i' DATET...
bsd-3-clause
alexanderturner/ansible
lib/ansible/modules/network/vyos/vyos_command.py
5
7152
#!/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
1zha0/gwibber-with-fanfou-protocol
gwibber/microblog/util/const.py
2
7814
import xdg.BaseDirectory from os.path import join, isdir, realpath from os import mkdir, environ CACHE_DIR = realpath(join(xdg.BaseDirectory.xdg_cache_home, "gwibber")) if not isdir(CACHE_DIR): mkdir(CACHE_DIR) from os import environ if environ.has_key("FB_APP_KEY"): FB_APP_KEY = environ["FB_APP_KEY"] else: FB_...
gpl-2.0
unnamed-idea/ardupilot
Tools/autotest/pysim/fg_display.py
229
1919
#!/usr/bin/env python import socket, struct, time, math, errno from pymavlink import fgFDM class udp_socket(object): '''a UDP socket''' def __init__(self, device, blocking=True, input=True): a = device.split(':') if len(a) != 2: print("UDP ports must be specified as host:port") ...
gpl-3.0
popazerty/test-gui
lib/python/Components/GUIComponent.py
57
2512
import skin from enigma import ePoint, eSize class GUIComponent(object): """ GUI component """ def __init__(self): self.instance = None self.onVisibilityChange = [ ] self.__visible = 0 self.visible = 1 self.skinAttributes = None self.deprecationInfo = None def execBegin(self): pass def execEnd(se...
gpl-2.0
sanguinariojoe/FreeCAD
src/3rdParty/libkdtree/python-bindings/py-kdtree_test.py
24
13015
# # $Id: py-kdtree_test.py 2268 2008-08-20 10:08:58Z richert $ # import unittest from kdtree import KDTree_2Int, KDTree_4Int, KDTree_3Float, KDTree_4Float, KDTree_6Float try: long except NameError: long = int class KDTree_2IntTestCase(unittest.TestCase): def test_empty(self): nn = KDTree_2Int()...
lgpl-2.1
yostudios/Spritemapper
spritecss/main.py
1
4772
import sys import logging import optparse from os import path, access, R_OK from itertools import ifilter from contextlib import contextmanager from spritecss.css import CSSParser, print_css from spritecss.config import CSSConfig from spritecss.finder import find_sprite_refs from spritecss.mapper import SpriteMapColle...
mit
khink/xhtml2pdf
demo/wsgi/pisawsgidemo.py
98
2215
#!/bin/python # -*- coding: utf-8 -*- # Copyright 2010 Dirk Holtwick, holtwick.it # # 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 # # Unles...
apache-2.0
cgwalters/librepo
examples/python/verify_local_yum_metadata.py
2
1145
#!/usr/bin/python """ Example: Verify checksum of local yum metadata Use case: We have some incomplete yum metadata localy. They are incomplete because they doesn't contain all files specified in repomd.xml. They contains only primary.xml and filelists.xml. We want to check checksum of this metadata. """ import sys ...
lgpl-2.1
isabellaleehs/isabellaleehs.github.io
projects/webapp1/flask/lib/python2.7/site-packages/wheel/egg2wheel.py
471
2633
#!/usr/bin/env python import os.path import re import sys import tempfile import zipfile import wheel.bdist_wheel import shutil import distutils.dist from distutils.archive_util import make_archive from argparse import ArgumentParser from glob import iglob egg_info_re = re.compile(r'''(?P<name>.+?)-(?P<ver>.+?) (-...
mit
nicolasiscoding/IEEEOpenCV2016
ROS/src/object_detection/src/GenericCascade.py
2
2724
#!/usr/bin/env python import cv2 # import rospy # import roslib import numpy as np import os.path # roslib.load_manifest('object_detection') # from sensor_msgs.msg import Image # from cv_bridge import CvBridge, CvBridgeError ''' ############################################################# # IEEE Hardwa...
mit
mosdef-hub/mbuild
mbuild/formats/par_writer.py
2
6707
"""CHARMM Par format.""" import warnings __all__ = ["write_par"] def write_par(structure, filename): """Write CHARMM Par file given a parametrized structure. Notes ----- Follows format according to https://www.ks.uiuc.edu/Training/Tutorials/namd/namd-tutorial-unix-html/ node25.html Furth...
mit
tpltnt/SimpleCV
SimpleCV/Features/EdgeHistogramFeatureExtractor.py
13
1898
from SimpleCV.base import * from SimpleCV.ImageClass import Image from SimpleCV.Features.FeatureExtractorBase import * class EdgeHistogramFeatureExtractor(FeatureExtractorBase): """ Create a 1D edge length histogram and 1D edge angle histogram. This method takes in an image, applies an edge detector, and...
bsd-3-clause
tfmorris/dedupe
dedupe/variables/exists.py
2
1117
from .base import DerivedType from categorical import CategoricalComparator from .categorical_type import CategoricalType class ExistsType(CategoricalType) : type = "Exists" _predicate_functions = [] def __init__(self, definition) : super(CategoricalType, self ).__init__(definition) ...
mit
raulshepherd/ardupilot-solo
mk/PX4/Tools/genmsg/scripts/genmsg_check_deps.py
216
2999
#!/usr/bin/env python # Software License Agreement (BSD License) # # Copyright (c) 2014, Open Source Robotics Foundation, 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: # # * Redistribut...
gpl-3.0
ycaihua/kbengine
kbe/res/scripts/common/Lib/test/test_readline.py
60
2234
""" Very minimal unittests for parts of the readline module. """ import os import unittest from test.support import run_unittest, import_module from test.script_helper import assert_python_ok # Skip tests if there is no readline module readline = import_module('readline') class TestHistoryManipulation (unittest.TestC...
lgpl-3.0
colinligertwood/odoo
addons/sale/edi/sale_order.py
403
10861
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (c) 2011-2012 OpenERP S.A. <http://openerp.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of t...
agpl-3.0
scs/uclinux
user/python/python-2.4.4/Lib/idlelib/PyParse.py
11
18904
import re import sys # Reason last stmt is continued (or C_NONE if it's not). C_NONE, C_BACKSLASH, C_STRING, C_BRACKET = range(4) if 0: # for throwaway debugging output def dump(*stuff): sys.__stdout__.write(" ".join(map(str, stuff)) + "\n") # Find what looks like the start of a popular stmt. _synchre...
gpl-2.0
GladeRom/android_external_chromium_org
tools/telemetry/telemetry/core/forwarders/do_nothing_forwarder_unittest.py
37
2557
# Copyright 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import unittest from telemetry.core import forwarders from telemetry.core import util from telemetry.core.forwarders import do_nothing_forwarder class Tes...
bsd-3-clause
aam-at/tensorflow
tensorflow/python/keras/layers/recurrent_v2_test.py
8
5232
# Copyright 2019 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
candy7393/VTK
Examples/Modelling/Python/reconstructSurface.py
23
2614
#!/usr/bin/env python # This example shows how to construct a surface from a point cloud. # First we generate a volume using the # vtkSurfaceReconstructionFilter. The volume values are a distance # field. Once this is generated, the volume is countoured at a # distance value of 0.0. import os import string import vtk...
bsd-3-clause
ms-iot/python
cpython/Lib/test/buffer_tests.py
91
11374
# Tests that work for both bytes and buffer objects. # See PEP 3137. import struct import sys class MixinBytesBufferCommonTests(object): """Tests that work for both bytes and buffer objects. See PEP 3137. """ def marshal(self, x): """Convert x into the appropriate type for these tests.""" ...
bsd-3-clause
cloudbau/cinder
cinder/tests/api/contrib/test_hosts.py
3
8033
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # 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 # # http://www.a...
apache-2.0
zycdragonball/tensorflow
tensorflow/python/tools/strip_unused_lib.py
104
4859
# pylint: disable=g-bad-file-header # 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/LICENS...
apache-2.0
dlazz/ansible
lib/ansible/modules/network/fortios/fortios_firewall_vip46.py
7
15899
#!/usr/bin/python from __future__ import (absolute_import, division, print_function) # Copyright 2018 Fortinet, Inc. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the Lic...
gpl-3.0
kodi-addons/plugin.video.espn_3
resources/lib/adobe_activate_api.py
1
11244
import urlparse import urllib import uuid import hashlib import hmac import base64 import urllib2 import time import json import gzip import os import cookielib from StringIO import StringIO import requests import xbmc from globals import ADDON_PATH_PROFILE SETTINGS_FILE = 'adobe.json' UA_ATV = 'AppleCoreMedia/1.0.0....
gpl-3.0
SmartDeveloperHub/agora-fountain
agora/fountain/tests/__init__.py
1
7700
""" #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=# This file is part of the Smart Developer Hub Project: http://www.smartdeveloperhub.org Center for Open Middleware http://www.centeropenmiddleware.com/ #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=...
apache-2.0
Accelerite/cinder
cinder/scheduler/flows/create_volume.py
4
7696
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # d...
apache-2.0
shubhamchopra/spark
python/pyspark/streaming/flume.py
4
5985
# # 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 us...
apache-2.0
wangyum/tensorflow
tensorflow/contrib/keras/python/keras/layers/merge.py
2
18933
# 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
steedos/odoo
addons/hr_holidays/hr_holidays.py
159
33482
# -*- coding: utf-8 -*- ################################################################################## # # Copyright (c) 2005-2006 Axelor SARL. (http://www.axelor.com) # and 2004-2010 Tiny SPRL (<http://tiny.be>). # # $Id: hr.py 4656 2006-11-24 09:58:42Z Cyp $ # # This program is free software: you can redistri...
agpl-3.0
pathawks/tweet-dump
tweet-dump.py
1
7425
#!/usr/bin/env python # -*- coding: UTF-8 -*- '''Load the latest update for a Twitter user and leave it in an XHTML fragment''' __author__ = 'Pat Hawks <pat@pathawks.com>' __version__ = '0.2' import cgi import codecs import getopt import sys import twitter import keyring import webbrowser TWEET_TEMPLATE = """ <b...
apache-2.0
oranagra/redis
deps/jemalloc/scripts/gen_travis.py
21
3183
#!/usr/bin/env python from itertools import combinations travis_template = """\ language: generic matrix: include: %s before_script: - autoconf - ./configure ${COMPILER_FLAGS:+ \ CC="$CC $COMPILER_FLAGS" \ CXX="$CXX $COMPILER_FLAGS" } \ $CONFIGURE_FLAGS - make -j3 - make -j3 tests scrip...
bsd-3-clause
Gabriel439/pants
tests/python/pants_test/backend/codegen/targets/test_java_protobuf_library.py
1
3446
# coding=utf-8 # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) from textwrap import...
apache-2.0
flyingbanana1024102/transmission-line-simulator
src/models/model.py
1
3474
# # Transmission Line Simulator # # Author(s): Jiacong Xu # Created: May-28-2017 # from util.constants import * from collections import deque from circuit import Circuit import numpy as np class AppState(object): """ Describes the valid states in this app. """ Editing = 'editing' Simulating = 'si...
mit
hydrius/schwarzschild-radius
old/SchwarzschildRadius1/buildings.py
1
1719
class buildings: @staticmethod def builds(building, quantity, player, planet, time, *kwargs): success = 0 #planet = player['planets'][player['viewPlanetIndex']] for key in buildings.buildings[building]["cost"].keys(): if planet['resource'][key] - (buildings.buildings[buildi...
mit
hynnet/openwrt-mt7620
staging_dir/target-mipsel_r2_uClibc-0.9.33.2/usr/lib/python2.7/test/test_transformer.py
136
1120
import unittest from test import test_support # Silence Py3k warning test_support.import_module('compiler', deprecated=True) from compiler import transformer, ast from compiler import compile class Tests(unittest.TestCase): def testMultipleLHS(self): """ Test multiple targets on the left hand side. """ ...
gpl-2.0
furbrain/Coherence
coherence/backends/feed_storage.py
3
7861
# Licensed under the MIT license # http://opensource.org/licenses/mit-license.php # Copyright 2009, Dominik Ruf <dominikruf at googlemail dot com> from coherence.backend import BackendItem from coherence.backend import BackendStore from coherence.upnp.core import DIDLLite from coherence.upnp.core.utils import Reverse...
mit
etherkit/OpenBeacon2
client/linux-x86/venv/lib/python3.8/site-packages/pkg_resources/_vendor/appdirs.py
177
24701
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2005-2010 ActiveState Software Inc. # Copyright (c) 2013 Eddy Petrișor """Utilities for determining application-specific dirs. See <http://github.com/ActiveState/appdirs> for details and usage. """ # Dev Notes: # - MSDN on where to store app data files: # ...
gpl-3.0
CyrilPeponnet/Archipel
ArchipelAgent/archipel-agent-hypervisor-geolocalization/archipelagenthypervisorgeolocalization/geoloc.py
4
7374
# -*- coding: utf-8 -*- # # geoloc.py # # Copyright (C) 2010 Antoine Mercadal <antoine.mercadal@inframonde.eu> # Copyright, 2011 - Franck Villaume <franck.villaume@trivialdev.com> # This file is part of ArchipelProject # http://archipelproject.org # # This program is free software: you can redistribute it and/or modify...
agpl-3.0
JeffRoy/mi-dataset
mi/dataset/driver/adcpt_acfgm/dcl/pd8/adcpt_acfgm_dcl_pd8_driver_common.py
1
1392
#!/usr/bin/env python # ## # OOIPLACEHOLDER # # Copyright 2014 Raytheon Co. ## __author__ = "Ronald Ronquillo" from mi.core.log import get_logger log = get_logger() from mi.dataset.dataset_driver import DataSetDriver from mi.dataset.parser.adcpt_acfgm_dcl_pd8 import AdcptAcfgmPd8Parser MODULE_NAME = 'mi.dataset.p...
bsd-2-clause
adobecs5/urp2015
lib/python3.4/site-packages/pip/_vendor/cachecontrol/controller.py
69
9047
""" The httplib2 algorithms ported for use with requests. """ import re import calendar import time from email.utils import parsedate_tz from pip._vendor.requests.structures import CaseInsensitiveDict from .cache import DictCache from .serialize import Serializer URI = re.compile(r"^(([^:/?#]+):)?(//([^/?#]*))?([^?...
apache-2.0
vismartltd/edx-platform
common/djangoapps/heartbeat/tests/test_heartbeat.py
114
1460
""" Test the heartbeat """ import json from django.core.urlresolvers import reverse from django.db.utils import DatabaseError from django.test.client import Client from django.test.testcases import TestCase from mock import patch from xmodule.exceptions import HeartbeatFailure @patch('heartbeat.views.modulestore') ...
agpl-3.0
amyvmiwei/chromium
tools/grit/grit/clique_unittest.py
6
7941
#!/usr/bin/python2.4 # Copyright (c) 2006-2008 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. '''Unit tests for grit.clique''' import os import sys if __name__ == '__main__': sys.path.append(os.path.join(os.path.dirnam...
bsd-3-clause
hujingguang/OpsSystem
users/views.py
1
3093
from django.shortcuts import render,render_to_response from django.contrib.auth.decorators import login_required from django.template import RequestContext from django.http import HttpResponse from django.contrib.auth.models import User from datetime import datetime import json @login_required(login_url='/') def list...
mit
ahmetabdi/SickRage
tornado/locale.py
160
21946
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright 2009 Facebook # # 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 ...
gpl-3.0
marcuskelly/recover
Lib/site-packages/Crypto/Cipher/_mode_cfb.py
9
9008
# -*- coding: utf-8 -*- # # Cipher/mode_cfb.py : CFB mode # # =================================================================== # The contents of this file are dedicated to the public domain. To # the extent that dedication to the public domain is not available, # everyone is granted a worldwide, perpetual, royalty...
bsd-2-clause
chauhanmohit/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/port/leakdetector_unittest.py
121
9172
# 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 f...
bsd-3-clause
dave62/lpod-Chart
src/chart.py
1
34156
from lpod.element import odf_create_element, register_element_class, odf_element from lpod.frame import odf_create_frame from lpod.element import odf_create_element from lpod.container import odf_new_container from lpod.table import _get_cell_coordinates, _digit_to_alpha from lpod.utils import _get_abspath from string ...
gpl-3.0
Cinntax/home-assistant
homeassistant/components/device_automation/toggle_entity.py
1
5616
"""Device automation helpers for toggle entity.""" from typing import Any, Dict, List import voluptuous as vol from homeassistant.core import Context, HomeAssistant, CALLBACK_TYPE from homeassistant.components.automation import state, AutomationActionType from homeassistant.components.device_automation.const import ( ...
apache-2.0
midori1/midorinoblog
site-packages/django/contrib/gis/geos/tests/test_geos_mutation.py
112
5462
# Copyright (c) 2008-2009 Aryeh Leib Taurog, all rights reserved. # Modified from original contribution by Aryeh Leib Taurog, which was # released under the New BSD license. import unittest from unittest import skipUnless from .. import HAS_GEOS if HAS_GEOS: from .. import fromstr, LinearRing, LineString, MultiP...
apache-2.0
anomalchik/android_kernel_xiaomi
tools/perf/scripts/python/syscall-counts-by-pid.py
11180
1927
# system call counts, by pid # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Displays system-wide system call totals, broken down by syscall. # If a [comm] arg is specified, only syscalls called by [comm] are displayed. import os, sys sys.path.append(os.env...
gpl-2.0
piffey/ansible
lib/ansible/modules/database/proxysql/proxysql_mysql_users.py
42
16189
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (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 = ''' --- module: proxysql_mysql_users versi...
gpl-3.0
haridsv/pip
pip/_vendor/requests/exceptions.py
895
2517
# -*- coding: utf-8 -*- """ requests.exceptions ~~~~~~~~~~~~~~~~~~~ This module contains the set of Requests' exceptions. """ from .packages.urllib3.exceptions import HTTPError as BaseHTTPError class RequestException(IOError): """There was an ambiguous exception that occurred while handling your request.""...
mit
dpac-vlsi/SynchroTrace
tests/long/fs/80.solaris-boot/test.py
90
1630
# Copyright (c) 2007 The Regents of The University of Michigan # 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 ...
bsd-3-clause
Pica4x6/megaradrp
megaradrp/recipes/calibration/trace.py
1
3127
# # Copyright 2011-2015 Universidad Complutense de Madrid # # This file is part of Megara DRP # # Megara DRP 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 optio...
gpl-3.0
rohe/pysaml2-3
src/saml2/authn_context/timesync.py
37
107827
#!/usr/bin/env python # # Generated Thu May 16 21:05:38 2013 by parse_xsd.py version 0.5. # import saml2 from saml2 import SamlBase NAMESPACE = 'urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken' class PhysicalVerification(SamlBase): """The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken: Physical...
bsd-2-clause
mydongistiny/kernel_huawei_angler-ak
tools/perf/scripts/python/sctop.py
11180
1924
# system call top # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Periodically displays system-wide system call totals, broken down by # syscall. If a [comm] arg is specified, only syscalls called by # [comm] are displayed. If an [interval] arg is specified,...
gpl-2.0
koljanos/dakoljanos-anotherone
jni/libhpdf-2.3.0RC2/if/python/hpdf_errorcode.py
32
6102
error_detail={ 0x1001: 'Internal error. The consistency of the data was lost.', 0x1002: 'Internal error. The consistency of the data was lost.', 0x1003: 'Internal error. The consistency of the data was lost.', 0x1004: 'The length of the data exceeds HPDF_LIMIT_MAX_STRING_LEN.', 0x1005: 'Cannot get a pallet dat...
gpl-3.0
ericpre/hyperspy
hyperspy/_signals/lazy.py
1
50395
# -*- coding: utf-8 -*- # Copyright 2007-2021 The HyperSpy developers # # This file is part of HyperSpy. # # HyperSpy 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...
gpl-3.0
obnam-mirror/obnam
obnamlib/blob_store.py
1
3369
# Copyright 2015-2016 Lars Wirzenius # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed ...
gpl-3.0
ezotrank/mysql-connector-python
python3/mysql/connector/locales/eng/client_error.py
4
5943
# -*- coding: utf-8 -*- # MySQL Connector/Python - MySQL driver written in Python. # Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. # MySQL Connector/Python is licensed under the terms of the GPLv2 # <http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>, like most # MySQL Connectors. There a...
gpl-2.0
google-code-export/jaikuengine
common/templatetags/test/avatar.py
35
1613
# Copyright 2009 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
apache-2.0