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
eagleamon/home-assistant
homeassistant/components/sensor/temper.py
18
3506
""" Support for getting temperature from TEMPer devices. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/sensor.temper/ """ import logging import voluptuous as vol from homeassistant.components.sensor import PLATFORM_SCHEMA from homeassistant.const impor...
apache-2.0
Inspq/ansible
lib/ansible/modules/cloud/ovirt/ovirt_networks.py
1
9528
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (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 #...
gpl-3.0
christophlsa/odoo
addons/l10n_be_invoice_bba/invoice.py
36
12656
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # # Copyright (c) 2011 Noviat nv/sa (www.noviat.be). All rights reserved. # # This program is free software: you can redistribute it and/or modify # i...
agpl-3.0
mancoast/CPythonPyc_test
cpython/278_test_linuxaudiodev.py
133
3179
from test import test_support test_support.requires('audio') from test.test_support import findfile, run_unittest import errno import sys import audioop import unittest linuxaudiodev = test_support.import_module('linuxaudiodev', deprecated=True) sunaudio = test_support.import_module('sunaudio', deprecated=True) SND...
gpl-3.0
tanzaho/python-goose
tests/extractors.py
1
18282
# -*- coding: utf-8 -*- """\ This is a python port of "Goose" orignialy licensed to Gravity.com under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. Python port was written by Xavier Grangier for Recrutae Gravity.co...
apache-2.0
jessicalucci/NovaOrc
nova/api/openstack/wsgi.py
4
43822
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 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.apach...
apache-2.0
lukeiwanski/tensorflow
tensorflow/python/keras/initializers.py
9
6730
# 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
kobolabs/qt-everywhere-opensource-src-4.6.2
src/3rdparty/freetype/src/tools/docmaker/sources.py
367
10766
# Sources (c) 2002, 2003, 2004, 2006, 2007, 2008, 2009 # David Turner <david@freetype.org> # # # this file contains definitions of classes needed to decompose # C sources files into a series of multi-line "blocks". There are # two kinds of blocks: # # - normal blocks, which contain source code or ordinary comment...
lgpl-2.1
ebd2/presto
presto-docs/src/main/sphinx/conf.py
57
2278
# # 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 ...
apache-2.0
neteler/QGIS
python/plugins/processing/algs/qgis/scripts/Create_points_along_lines.py
4
1165
##Vector geometry tools=group ##lines=vector ##distance=number 1 ##startpoint=number 0 ##endpoint=number 0 ##output=output vector from qgis.core import QgsFeature, QgsField from PyQt4.QtCore import QVariant from processing.tools.vector import VectorWriter def create_points(feat): geom = feat.geometry() lengt...
gpl-2.0
sosreport/sos
tests/unittests/option_tests.py
4
1415
# This file is part of the sos project: https://github.com/sosreport/sos # # This copyrighted material is made available to anyone wishing to use, # modify, copy, or redistribute it subject to the terms and conditions of # version 2 of the GNU General Public License. # # See the LICENSE file in the source distribution ...
gpl-2.0
SotongDJ/SotongDJ-PythonLab
Exp6-wget-batch-tools/progress/main.py
1
1524
import os def status(): print "----RESULT-----------" os.system("ls -1>progress/file.tmp") for wgetlog in open("progress/file.tmp").read().splitlines(): if "wget-log" in wgetlog: percentage="0%" for line in open(wgetlog).read().splitlines(): if "K ." in line o...
gpl-3.0
odpi/hadoop
hadoop-mapreduce-project/hadoop-mapreduce-examples/src/main/java/org/apache/hadoop/examples/terasort/job_history_summary.py
323
3444
#!/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 # "...
apache-2.0
ylow/SFrame
oss_src/unity/python/sframe/util/cloudpickle.py
6
28239
""" This class is defined to override standard pickle functionality The goals of it follow: -Serialize lambdas and nested functions to compiled byte code -Deal with main module correctly -Deal with other non-serializable objects It does not include an unpickler, as standard python unpickling suffices. This module wa...
bsd-3-clause
onepercentclub/django-token-auth
setup.py
1
1301
#!/usr/bin/env python import os import setuptools import token_auth with open(os.path.join(os.path.dirname(__file__), 'README.md')) as readme: README = readme.read() os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir))) setuptools.setup( name="django-token-auth", version=token_a...
gpl-2.0
alfmatos/NetworkManager
examples/python/nm-state.py
5
2748
#!/usr/bin/env python # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that...
gpl-2.0
Mte90/remo
remo/events/api/serializers.py
5
1279
from rest_framework import serializers from remo.base.templatetags.helpers import absolutify from remo.events.models import Event from remo.profiles.api.serializers import (FunctionalAreaSerializer, UserSerializer) class EventSerializer(serializers.HyperlinkedModelSerialize...
bsd-3-clause
pizzapanther/GAE-Bulk-Mailer
django/db/models/options.py
99
23148
from __future__ import unicode_literals import re from bisect import bisect from django.conf import settings from django.db.models.related import RelatedObject from django.db.models.fields.related import ManyToManyRel from django.db.models.fields import AutoField, FieldDoesNotExist from django.db.models.fields.proxy ...
bsd-2-clause
Superjom/NeuralNetworks
models/mlp.py
1
5692
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' Created on Feb 24, 2014 @author: Chunwei Yan @ PKU @mail: yanchunwei@outlook.com ''' import sys sys.path.append('..') import numpy import theano from theano import tensor as T from softmax_regression import SoftmaxRegression class HiddenLayer(object): ''' a laye...
apache-2.0
proxysh/Safejumper-for-Mac
buildlinux/env32/lib/python2.7/site-packages/twisted/test/test_hook.py
20
4244
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Test cases for twisted.hook module. """ from twisted.python import hook from twisted.trial import unittest class BaseClass: """ dummy class to help in testing. """ def __init__(self): """ dummy initializer ...
gpl-2.0
cloud-fan/spark
python/pyspark/pandas/tests/data_type_ops/test_binary_ops.py
1
6682
# # 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
shanglt/youtube-dl
youtube_dl/extractor/wistia.py
128
2050
from __future__ import unicode_literals from .common import InfoExtractor from ..compat import compat_urllib_request from ..utils import ExtractorError class WistiaIE(InfoExtractor): _VALID_URL = r'https?://(?:fast\.)?wistia\.net/embed/iframe/(?P<id>[a-z0-9]+)' _API_URL = 'http://fast.wistia.com/embed/medias...
unlicense
dbbhattacharya/kitsune
vendor/packages/logilab-astng/test/unittest_nodes.py
6
10388
# This program is free software; you can redistribute it and/or modify it under # the terms of the GNU Lesser General Public License as published by the Free Software # Foundation; either version 2 of the License, or (at your option) any later # version. # copyright 2003-2010 LOGILAB S.A. (Paris, FRANCE), all rights re...
bsd-3-clause
blaggacao/openupgradelib
docs/conf.py
3
8554
#!/usr/bin/env python # -*- coding: utf-8 -*- # # openupgradelib documentation build configuration file, created by # sphinx-quickstart on Tue Jul 9 22:26:36 2013. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in thi...
agpl-3.0
markoshorro/gem5
src/mem/slicc/ast/FormalParamAST.py
53
2683
# Copyright (c) 1999-2008 Mark D. Hill and David A. Wood # Copyright (c) 2009 The Hewlett-Packard Development Company # 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 co...
bsd-3-clause
jazztpt/edx-platform
lms/djangoapps/django_comment_client/utils.py
43
28663
from collections import defaultdict from datetime import datetime import json import logging import pytz from django.contrib.auth.models import User from django.core.urlresolvers import reverse from django.db import connection from django.http import HttpResponse from django.utils.timezone import UTC import pystache_c...
agpl-3.0
ishay2b/tensorflow
tensorflow/python/framework/device.py
150
9078
# 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
z123/build-a-saas-app-with-flask
catwatch/tests/billing/test_views.py
1
7627
from flask import url_for, json from flask_babel import gettext as _ from catwatch.tests.lib.util import ViewTestMixin from catwatch.tests.lib.assertions import assert_status_with_message class TestBilling(ViewTestMixin): def test_pricing_page(self): """ Pricing page renders successfully. """ res...
mit
teamtuga4/teamtuga4ever.repository
plugin.video.pancas/resources/lib/libraries/unwise.py
23
2106
# -*- coding: utf-8 -*- ''' Specto Add-on Copyright (C) 2015 lambda 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 l...
gpl-2.0
SickRage/SickRage
tests/test_name_parser.py
2
21121
#!/usr/bin/env python2.7 # Author: echel0n <echel0n@sickrage.ca> # URL: https://sickrage.ca # # This file is part of SickRage. # # SickRage 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 t...
gpl-3.0
youknowone/instantauth
python/instantauth/cryptors/aes.py
1
2071
""" Install 'pycrypto' package to use this module """ from Crypto.Cipher import AES from . import BaseCryptor def add_padding(data, block_size): data_len = len(data) pad_len = (block_size - data_len) % block_size if pad_len == 0: pad_len = block_size padding = chr(pad_len) return ''.join...
bsd-2-clause
jdar/phantomjs-modified
src/qt/qtwebkit/Tools/Scripts/webkitpy/common/system/environment_unittest.py
124
1853
# 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
HadiOfBBG/pegasusrises
gdata/docs/service.py
53
23149
#!/usr/bin/python # # Copyright 2009 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 b...
apache-2.0
Jumpscale/web
pythonlib/wtforms/ext/i18n/form.py
38
1560
import warnings from wtforms import form from wtforms.ext.i18n.utils import get_translations translations_cache = {} class Form(form.Form): """ Base form for a simple localized WTForms form. **NOTE** this class is now un-necessary as the i18n features have been moved into the core of WTForms, and wi...
apache-2.0
h2oai/h2o-dev
py2/jenkins_h2o_port_allocate.py
30
8319
#!/usr/bin/python # "Avoid locker or centralized resource by hard-wiring the port mapping within range" # "implied by max # of ports used per job, max # of executors per machine, and # of machines." # "Map of source determines port. in/out using env variables" print "\njenkins_h2o_port_allocate...." import socket, o...
apache-2.0
manasgarg/flask-sauth
flask_sauth/forms.py
1
3424
#!/usr/bin/env python from datetime import datetime from wtforms import Form, TextField, PasswordField, HiddenField, ValidationError from wtforms import validators as v from models import User, authenticate class RegistrationForm( Form): name = TextField( validators=[v.DataRequired(), v.Length(max=256)]) ema...
bsd-3-clause
tanmaykm/edx-platform
lms/djangoapps/teams/search_indexes.py
63
5030
""" Search index used to load data into elasticsearch""" import logging from elasticsearch.exceptions import ConnectionError from django.conf import settings from django.db.models.signals import post_delete, post_save from django.dispatch import receiver from django.utils import translation from functools import wrap...
agpl-3.0
emmett9001/schema.to
schemato/schemato.py
2
2790
import urllib import logging import re from pkg_resources import iter_entry_points from six import StringIO from six.moves import xrange from .compound_graph import CompoundGraph from .schemas.parselypage import ParselyPageValidator log = logging.getLogger(__name__) class Schemato(object): def __init__(self, ...
apache-2.0
CopeX/odoo
addons/project_issue/project_issue.py
217
29319
#-*- 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
AlexDoul/PyQt4
examples/xmlpatterns/schema/ui_schema.py
7
3609
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'schema.ui' # # Created: Fri Feb 5 15:27:54 2010 # by: PyQt4 UI code generator snapshot-4.7.1-c39e85a8e2ec # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui class Ui_SchemaMainWindow(object): ...
gpl-2.0
rhauch/modeshape
modeshape-jcr/src/test/resources/mimetype/test.py
18
12091
"""Append module search paths for third-party packages to sys.path. **************************************************************** * This module is automatically imported during initialization. * **************************************************************** In earlier versions of Python (up to 1.5a3), scripts or...
apache-2.0
FCP-INDI/nipype
nipype/interfaces/spm/tests/test_preprocess.py
10
5180
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: import os from tempfile import mkdtemp from shutil import rmtree import numpy as np from nipype.testing import (assert_equal, assert_false, assert_true, assert_raises, skipif) ...
bsd-3-clause
nitesh1989/tools-iuc
tools/transtermhp/transtermhp.py
4
2773
#!/usr/bin/env python import sys import re import subprocess from Bio import SeqIO from BCBio import GFF from Bio.SeqFeature import SeqFeature, FeatureLocation def main(expterm, fasta, gff3): with open(fasta, 'r') as handle: seq_dict = SeqIO.to_dict(SeqIO.parse(handle, "fasta")) # Build coords file ...
mit
torkelsson/monitor-core
gmetad-python/Gmetad/gmetad_element.py
15
5497
#/******************************************************************************* #* Portions Copyright (C) 2008 Novell, 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: #* #* - Redistributi...
bsd-3-clause
fkarb/xltable
xltable/chart.py
2
3266
""" Chart objects reference data from Table instances and are written to Excel worksheets as Excel charts. """ import datetime as dt class Chart(object): """ Chart objects reference data from Table instances and are written to Excel worksheets as Excel charts. :param str type: Chart type (see below)....
mit
deepaklukose/grpc
tools/distrib/python/make_grpcio_tools.py
2
6198
#!/usr/bin/env python # Copyright 2016 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 ...
apache-2.0
k-zen/Ama
ama/file_listener.py
1
2550
# -*- coding: utf-8 -*- """ Clase perteneciente al mรณdulo de procesamiento de datos e inferencias Ama. .. module:: file_listener :platform: Unix :synopsis: Funciones รบtiles para la detecciรณn de cambios en directorios. Ej. cuando se agrega un nuevo archivo de radar. .. moduleauthor:: Andreas P. Koenzen <akc@apk...
bsd-2-clause
slayerjain/servo
tests/wpt/harness/wptrunner/executors/executorservodriver.py
21
8682
# 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 json import os import socket import threading import time import traceback from .base import (Protocol, ...
mpl-2.0
jhd/spunout
flask/lib/python2.7/site-packages/sqlparse/__init__.py
4
2333
# Copyright (C) 2008 Andi Albrecht, albrecht.andi@gmail.com # # This module is part of python-sqlparse and is released under # the BSD License: http://www.opensource.org/licenses/bsd-license.php. """Parse SQL statements.""" __version__ = '0.1.13' # Setup namespace from sqlparse import engine from sqlparse import f...
gpl-3.0
ArcherCraftStore/ArcherVMPeridot
Python/Lib/turtledemo/planet_and_moon.py
65
2866
#!/usr/bin/env python3 """ turtle-example-suite: tdemo_planets_and_moon.py Gravitational system simulation using the approximation method from Feynman-lectures, p.9-8, using turtlegraphics. Example: heavy central body, light planet, very light moon! Planet has a circular orbit, moon a stable orbit arou...
apache-2.0
danieljaouen/ansible
lib/ansible/modules/network/cloudengine/ce_netstream_global.py
43
36150
#!/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
ntoll/foox
foox/species/third.py
1
12608
""" This module encapsulates the behaviour of third species counterpoint. """ import random import foox.ga as ga from .utils import is_parallel, make_generate_function, is_stepwise_motion # Some sane defaults. DEFAULT_POPULATION_SIZE = 4000 DEFAULT_MAX_GENERATION = 200 DEFAULT_MUTATION_RANGE = 3 DEFAULT_MUTATION_RAT...
mit
JazzeYoung/VeryDeepAutoEncoder
pylearn2/pylearn2/utils/tests/test_serial.py
44
4438
""" Tests for the pylearn2.utils.serial module. Currently only tests read_bin_lush_matrix and load_train_file methods. """ from theano.compat.six.moves import xrange import pylearn2 from pylearn2.utils.serial import read_bin_lush_matrix, load_train_file import numpy as np pylearn2_path = pylearn2.__path__[0] example_b...
bsd-3-clause
gchp/django
django/contrib/gis/maps/google/__init__.py
67
2767
""" This module houses the GoogleMap object, used for generating the needed javascript to embed Google Maps in a Web page. Google(R) is a registered trademark of Google, Inc. of Mountain View, California. Example: * In the view: return render(request, 'template.html', {'google': GoogleMap(key="abcd...
bsd-3-clause
denibertovic/django-client-certificates
client_certs/admin.py
1
1094
from django.contrib import admin from .models import Cert from .cert import revoke_certificates class CertAdmin(admin.ModelAdmin): list_display = ('user', 'install_link', 'is_valid', 'valid_until') fields = ('user', 'country', 'state', 'locality', 'organization', 'organizational_unit', 'common_name'...
bsd-2-clause
tplusx/ns3-gpsr
bindings/python/ns3modulegen-modular.py
18
3971
import warnings import sys import os import pybindgen.settings from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers from pybindgen.module import MultiSectionFactory import ns3modulegen_core_customizations pybindgen.settings.wrapper_registry = pybindgen.settings.StdMapWrapperRegistry cl...
gpl-2.0
DPaaS-Raksha/horizon
openstack_dashboard/dashboards/project/volumes/urls.py
9
1332
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 Nebula, 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 # # ...
apache-2.0
forgeservicelab/forge.insightly-sync
ldap_updater.py
1
27000
"""Push updates to LDAP.""" import ldap as _ldap import ldap.modlist as _modlist import logging from __init__ import sanitize, fileToRedmine from unidecode import unidecode from canned_mailer import CannedMailer from insightly_updater import InsightlyUpdater from fuzzywuzzy.process import extractOne class ForgeLDAP(o...
mit
twister2016/twister
twister/mk/dpdk_nic_bind.py
9
20853
#! /usr/bin/python # # BSD LICENSE # # Copyright(c) 2010-2014 Intel Corporation. All rights reserved. # 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 sou...
apache-2.0
hlange/LogSoCR
pysc/usi/log/console_reporter.py
1
4184
import json import colorlog import logging import logging.handlers from elloghandler.handler import ElLogHandler from socr_streamhandler.handler import SoCR_StreamHandler from socr_filehandler.handler import SoCR_FileHandler from datetime import datetime, date, time def logger_conf(loglevel,index=None): #Formatte...
agpl-3.0
mafiya69/sympy
sympy/printing/tests/test_ccode.py
13
14112
from sympy.core import (pi, oo, symbols, Rational, Integer, GoldenRatio, EulerGamma, Catalan, Lambda, Dummy, Eq) from sympy.functions import (Piecewise, sin, cos, Abs, exp, ceiling, sqrt, gamma, sign) from sympy.logic import ITE from sympy.utilities.pytest import rai...
bsd-3-clause
yarikoptic/vcrpy
vcr/cassette.py
3
10918
import sys import inspect import logging import wrapt from .compat import contextlib, collections from .errors import UnhandledHTTPRequestError from .matchers import requests_match, uri, method from .patch import CassettePatcherBuilder from .persist import load_cassette, save_cassette from .serializers import yamlser...
mit
p12tic/zeroclickinfo-fathead
lib/fathead/iso_3166_codes/parse.py
8
1518
#!/usr/bin/python # -*- coding: utf-8 -*- # Released under the GPL v2 license # https://www.gnu.org/licenses/old-licenses/gpl-2.0.html import lxml.etree, lxml.html import re from unidecode import unidecode url = "http://www.iso.org/iso/list-en1-semic-3.txt" title = "ISO 3166 Country Codes" article_type = "A" outp...
apache-2.0
Elettronik/SickRage
lib/pyasn1/type/base.py
185
9499
# Base classes for ASN.1 types import sys from pyasn1.type import constraint, tagmap from pyasn1 import error class Asn1Item: pass class Asn1ItemBase(Asn1Item): # Set of tags for this ASN.1 type tagSet = () # A list of constraint.Constraint instances for checking values subtypeSpec = constraint.C...
gpl-3.0
shankari/e-mission-server
emission/net/auth/google_auth.py
2
3146
from __future__ import unicode_literals from __future__ import print_function from __future__ import division from __future__ import absolute_import from future import standard_library standard_library.install_aliases() from builtins import * from builtins import object import logging import json import traceback impor...
bsd-3-clause
cstrap/python-vuejs
docs/conf.py
1
8556
#!/usr/bin/env python # -*- coding: utf-8 -*- # # python_vuejs documentation build configuration file, created by # sphinx-quickstart on Tue Jul 9 22:26:36 2013. # # 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 ...
mit
JackGavin13/octoprint-test-not-finished
src/octoprint_setuptools/__init__.py
4
17753
# coding=utf-8 from __future__ import absolute_import, division, print_function __author__ = "Gina HรคuรŸge <osd@foosel.net>" __license__ = 'GNU Affero General Public License http://www.gnu.org/licenses/agpl.html' __copyright__ = "Copyright (C) 2015 The OctoPrint Project - Released under terms of the AGPLv3 License" im...
agpl-3.0
jvkersch/hsmmlearn
docs/conf.py
1
9948
# -*- coding: utf-8 -*- # # hsmmlearn documentation build configuration file, created by # sphinx-quickstart on Fri Jan 1 17:33:24 2016. # # 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. # #...
gpl-3.0
zyga/snapd
tests/lib/tinyproxy/tinyproxy.py
3
4050
#!/usr/bin/python3 # Tiny HTTP Proxy. Based on the work of SUZUKI Hisao. # # Ported to py3 and modified to remove the bits we don't need # and modernized. import os import http.server import select import socket import socketserver import sys import urllib.parse class ProxyHandler (http.server.BaseHTTPRequestHandle...
gpl-3.0
hguemar/cinder
cinder/tests/test_drbdmanagedrv.py
1
11637
# Copyright 2014 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.apache.org/licenses/LICENSE-2.0 # # Unless requ...
apache-2.0
madan96/sympy
sympy/physics/unitsystems/tests/test_units.py
92
3071
# -*- coding: utf-8 -*- from __future__ import division from sympy.physics.unitsystems.units import Unit from sympy.physics.unitsystems.systems.mks import length, time from sympy.physics.unitsystems.prefixes import PREFIXES from sympy.utilities.pytest import raises k = PREFIXES['k'] def test_definition(): u = ...
bsd-3-clause
cloakedcode/CouchPotatoServer
libs/guessit/transfo/__init__.py
6
3799
#!/usr/bin/env python # -*- coding: utf-8 -*- # # GuessIt - A library for guessing information from filenames # Copyright (c) 2012 Nicolas Wack <wackou@gmail.com> # # GuessIt is free software; you can redistribute it and/or modify it under # the terms of the Lesser GNU General Public License as published by # the Free ...
gpl-3.0
2015fallproject/2015fallcase2
static/Brython3.2.0-20150701-214155/Lib/test/unittests/test_timeout.py
27
11379
"""Unit tests for socket timeout feature.""" import functools import unittest from test import support # This requires the 'network' resource as given on the regrtest command line. skip_expected = not support.is_resource_enabled('network') import time import errno import socket @functools.lru_cache() def resolve_a...
agpl-3.0
laurent-george/weboob
modules/inrocks/module.py
7
1376
# -*- coding: utf-8 -*- # Copyright(C) 2011 Julien Hebert # # This file is part of weboob. # # weboob is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your opt...
agpl-3.0
jeasoft/odoo
comunity_modules/attachment_preview/model/ir_attachment.py
4
2843
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # This module copyright (C) 2014 Therp BV (<http://therp.nl>). # # This program is free software: you can redistribute it and/or modify # it under the terms of ...
agpl-3.0
RobertWWong/WebDev
djangoApp/ENV/lib/python3.5/site-packages/setuptools/msvc9_support.py
429
2187
try: import distutils.msvc9compiler except ImportError: pass unpatched = dict() def patch_for_specialized_compiler(): """ Patch functions in distutils.msvc9compiler to use the standalone compiler build for Python (Windows only). Fall back to original behavior when the standalone compiler is no...
mit
cloudbase/cinder
cinder/api/v3/views/group_snapshots.py
5
2432
# Copyright (C) 2016 EMC 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 requ...
apache-2.0
samithaj/headphones
lib/unidecode/x080.py
252
4651
data = ( 'Yao ', # 0x00 'Lao ', # 0x01 '[?] ', # 0x02 'Kao ', # 0x03 'Mao ', # 0x04 'Zhe ', # 0x05 'Qi ', # 0x06 'Gou ', # 0x07 'Gou ', # 0x08 'Gou ', # 0x09 'Die ', # 0x0a 'Die ', # 0x0b 'Er ', # 0x0c 'Shua ', # 0x0d 'Ruan ', # 0x0e 'Er ', # 0x0f 'Nai ', # 0x10 'Zhuan...
gpl-3.0
Toms88/Evasion
node_modules/socket.io/node_modules/engine.io/node_modules/engine.io-parser/node_modules/utf8/tests/generate-test-data.py
2214
1347
#!/usr/bin/env python import re import json # http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae # http://stackoverflow.com/a/13436167/96656 def unisymbol(codePoint): if codePoint >= 0x0000 and codePoint <= 0xFFFF: return unichr(codePoint) elif codePoint >= 0x010000 and codePoint <= 0x10FFFF: ...
mit
coagulant/django-storages-py3
storages/tests/s3boto.py
3
8464
#import os #import mock #from uuid import uuid4 #from urllib2 import urlopen # #from django.test import TestCase #from django.core.files.base import ContentFile #from django.conf import settings #from django.core.files.storage import FileSystemStorage # #from boto.s3.key import Key # #from storages.backends...
bsd-3-clause
Javiercerna/MissionPlanner
Lib/site-packages/numpy/core/code_generators/genapi.py
54
15182
""" Get API information encoded in C files. See ``find_function`` for how functions should be formatted, and ``read_order`` for how the order of the functions should be specified. """ import sys, os, re try: import hashlib md5new = hashlib.md5 except ImportError: import md5 md5new = md5.new if sys.vers...
gpl-3.0
thewizardplusplus/micro
micro/utilities.py
1
1209
import os.path from . import function_type MICRO_VERSION = '2.3' HEXADECIMAL_NUMBER = '[A-Fa-f0-9]' def extract_and_add_function(entity, functions): entity_type = function_type.FunctionType( len(entity.children[0].children[1].children), function_type.make_type(entity.children[0].children[2].child...
mit
bev-a-tron/pledge_service
lib/requests/packages/urllib3/exceptions.py
330
3364
# urllib3/exceptions.py # Copyright 2008-2013 Andrey Petrov and contributors (see CONTRIBUTORS.txt) # # This module is part of urllib3 and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php ## Base Exceptions class HTTPError(Exception): "Base exception used by this module." ...
apache-2.0
deerwalk/voltdb
tests/sqlcoverage/schema/sql-grammar-gen-schema.py
1
14110
#!/usr/bin/env python # This file is part of VoltDB. # Copyright (C) 2008-2017 VoltDB Inc. # # 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 limitati...
agpl-3.0
juanyaw/python
cpython/Doc/includes/sqlite3/converter_point.py
55
1192
import sqlite3 class Point: def __init__(self, x, y): self.x, self.y = x, y def __repr__(self): return "(%f;%f)" % (self.x, self.y) def adapt_point(point): return ("%f;%f" % (point.x, point.y)).encode('ascii') def convert_point(s): x, y = list(map(float, s.split(b";"))) return Po...
bsd-3-clause
jgeewax/gcloud-python
vision/google/cloud/vision/safe.py
3
3852
# Copyright 2016 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
dreispt/project-service
project_sla/analytic_account.py
21
2967
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2013 Daniel Reis # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software...
agpl-3.0
ychen820/microblog
y/google-cloud-sdk/platform/gsutil/third_party/boto/boto/mws/connection.py
6
49712
# Copyright (c) 2012-2014 Andy Davidoff http://www.disruptek.com/ # # 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...
bsd-3-clause
tornadozou/tensorflow
tensorflow/contrib/labeled_tensor/python/ops/sugar_test.py
157
4205
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
webOS-ports/qtwebkit
Tools/Scripts/webkitpy/common/checkout/commitinfo_unittest.py
124
3032
# Copyright (C) 2010 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...
gpl-2.0
Code-Fly/stackalytics
stackalytics/processor/vcs.py
7
10961
# Copyright (c) 2013 Mirantis 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 writi...
apache-2.0
Jgarcia-IAS/SITE
openerp/addons/base/module/wizard/__init__.py
365
1250
# -*- 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
rven/odoo
addons/test_mass_mailing/tests/test_blacklist_mixin.py
5
3060
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo.addons.test_mass_mailing.models.mailing_models import MailingBLacklist from odoo.addons.test_mass_mailing.tests import common from odoo.exceptions import UserError from odoo.tests.common import users class Te...
agpl-3.0
davidbgk/udata
udata/tests/frontend/test_territories.py
1
1165
# -*- coding: utf-8 -*- from __future__ import unicode_literals from flask import url_for from udata.tests.features.territories.test_territories_process import ( create_geozones_fixtures ) from udata.tests.frontend import FrontTestCase class TerritoriesTest(FrontTestCase): modules = ['features.territories',...
agpl-3.0
kpbochenek/empireofcode
call_base.py
1
1180
# kpbochenek@gmail.com def total_cost(calls): result = 0 for c in calls: length = int(c.split(' ')[2]) mins = int(round(length / 60, 0)) if mins > 100: result += (mins - 100) * 2 mins = min(100, mins - 100) result += mins print(result) retur...
apache-2.0
gauravbose/digital-menu
django/core/management/commands/dumpdata.py
82
8474
import warnings from collections import OrderedDict from django.apps import apps from django.core import serializers from django.core.management.base import BaseCommand, CommandError from django.db import DEFAULT_DB_ALIAS, router from django.utils.deprecation import RemovedInDjango19Warning class Command(BaseCommand...
bsd-3-clause
kvar/ansible
test/units/modules/network/icx/test_icx_user.py
21
7584
# Copyright: (c) 2019, 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 from units.compat.mock import patch from ansible.modules.network.icx import icx_user from units.mod...
gpl-3.0
uclouvain/OSIS-Louvain
learning_unit/tests/api/serializers/test_component.py
1
2250
############################################################################## # # OSIS stands for Open Student Information System. It's an application # designed to manage the core business of higher education institutions, # such as universities, faculties, institutes and professional schools. # The core ...
agpl-3.0
waristo/opensource
tensorflow/tensorflow.py
1
1806
import tensorflow as tf #Tensorflow์‚ฌ์šฉ์„ ์œ„ํ•œ import from tensorflow.examples.tutorials.mnist import input_data # Dataset loading mnist = input_data.read_data_sets("./samples/MNIST_data/", one_hot=True) # Set up model x = tf.placeholder(tf.float32, [None, 784]) #์‹ฌ๋ณผ๋ฆญ ๋ณ€์ˆ˜๋“ค์„ ์‚ฌ์šฉํ•˜์—ฌ ์ƒํ˜ธ์ž‘์šฉํ•˜๋Š” ์ž‘์—…๋“ค์„ ๊ธฐ์ˆ  W = tf.Variable(tf....
gpl-3.0
ayr-ton/ansible-modules-extras
monitoring/rollbar_deployment.py
138
3898
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright 2014, Max Riveiro, <kavu13@gmail.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the...
gpl-3.0