repo_name
stringlengths
5
100
path
stringlengths
4
294
copies
stringclasses
990 values
size
stringlengths
4
7
content
stringlengths
666
1M
license
stringclasses
15 values
CapOM/ChromiumGStreamerBackend
tools/isolate_driver.py
2
12176
#!/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. """Adaptor script called through build/isolate.gypi. Creates a wrapping .isolate which 'includes' the original one, that can be consum...
bsd-3-clause
pypot/scikit-learn
sklearn/decomposition/nmf.py
16
19101
""" Non-negative matrix factorization """ # Author: Vlad Niculae # Lars Buitinck <L.J.Buitinck@uva.nl> # Author: Chih-Jen Lin, National Taiwan University (original projected gradient # NMF implementation) # Author: Anthony Di Franco (original Python and NumPy port) # License: BSD 3 clause from __future__ ...
bsd-3-clause
dagorret/YouCompleteMe
third_party/pythonfutures/docs/conf.py
65
6302
# -*- coding: utf-8 -*- # # futures documentation build configuration file, created by # sphinx-quickstart on Wed Jun 3 19:35:34 2009. # # 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...
gpl-3.0
JimCircadian/ansible
test/units/modules/network/netscaler/test_netscaler_gslb_site.py
18
24201
# Copyright (c) 2017 Citrix Systems # # 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. # # ...
gpl-3.0
mrrrgn/build-mozharness
mozinfo/__init__.py
72
1170
# 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/. """ interface to transform introspected system information to a format palatable to Mozilla Module variables: .. attri...
mpl-2.0
afedchin/xbmctorrent
resources/site-packages/concurrent/futures/_compat.py
179
4645
from keyword import iskeyword as _iskeyword from operator import itemgetter as _itemgetter import sys as _sys def namedtuple(typename, field_names): """Returns a new subclass of tuple with named fields. >>> Point = namedtuple('Point', 'x y') >>> Point.__doc__ # docstring for the new cla...
gpl-3.0
mnikhil-git/zerorpc-python
tests/test_server.py
20
5203
# -*- coding: utf-8 -*- # Open Source Initiative OSI - The MIT License (MIT):Licensing # # The MIT License (MIT) # Copyright (c) 2012 DotCloud Inc (opensource@dotcloud.com) # # Permission is hereby granted, free of charge, to any person obtaining a copy of # this software and associated documentation files (the "Softwa...
mit
rackerlabs/horizon
openstack_dashboard/dashboards/admin/domains/views.py
2
2980
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2013 Hewlett-Packard Development Company, L.P. # # 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....
apache-2.0
hopeall/odoo
addons/delivery/__openerp__.py
224
1905
# -*- 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
itskewpie/tempest
tempest/services/object_storage/object_client.py
5
7794
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 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
TeachAtTUM/edx-platform
lms/djangoapps/grades/config/models.py
12
3085
""" Models for configuration of the feature flags controlling persistent grades. """ from config_models.models import ConfigurationModel from django.conf import settings from django.db.models import BooleanField, IntegerField, TextField from opaque_keys.edx.django.models import CourseKeyField from six import text_type ...
agpl-3.0
cyclecomputing/boto
boto/manage/propget.py
115
2498
# Copyright (c) 2006-2009 Mitch Garnaat http://garnaat.org/ # # 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, modi...
mit
MalloyPower/parsing-python
front-end/testsuite-python-lib/Python-2.6/Lib/email/mime/message.py
573
1286
# Copyright (C) 2001-2006 Python Software Foundation # Author: Barry Warsaw # Contact: email-sig@python.org """Class representing message/* MIME documents.""" __all__ = ['MIMEMessage'] from email import message from email.mime.nonmultipart import MIMENonMultipart class MIMEMessage(MIMENonMultipart): """Class...
mit
dlazz/ansible
lib/ansible/module_utils/network/common/utils.py
14
15929
# This code is part of Ansible, but is an independent component. # This particular file snippet, and this file snippet only, is BSD licensed. # Modules you write using this snippet, which is embedded dynamically by Ansible # still belong to the author of the module, and may assign their own license # to the complete wo...
gpl-3.0
root-mirror/root
interpreter/llvm/src/tools/clang/tools/scan-build-py/tests/functional/cases/test_create_cdb.py
36
7783
# -*- coding: utf-8 -*- # Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. # See https://llvm.org/LICENSE.txt for license information. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception import libear from . import make_args, silent_check_call, silent_call, create_empty_file import u...
lgpl-2.1
tgroh/incubator-beam
sdks/python/apache_beam/io/gcp/datastore/v1/helper_test.py
8
9777
# # 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
rabipanda/tensorflow
tensorflow/python/training/evaluation.py
39
8616
# 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 applicable ...
apache-2.0
bunnyitvn/webptn
tests/regressiontests/admin_changelist/admin.py
47
2998
from __future__ import absolute_import from django.contrib import admin from django.core.paginator import Paginator from .models import (Event, Child, Parent, Genre, Band, Musician, Group, Quartet, Membership, ChordsMusician, ChordsBand, Invitation, Swallow) site = admin.AdminSite(name="admin") class CustomPag...
bsd-3-clause
henrytao-me/openerp.positionq
openerp/addons/edi/models/edi.py
33
32142
# -*- 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
ShenggaoZhu/midict
setup.py
1
3137
# -*- coding: utf-8 -*- import codecs import os import re import sys from setuptools import setup def find_version(*file_paths): version_file = read(*file_paths) version_match = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]", version_file, re.M) if version_match: ret...
mit
four2five/0.19.2
contrib/hod/hodlib/Common/xmlrpc.py
182
2374
#Licensed to the Apache Software Foundation (ASF) under one #or more contributor license agreements. See the NOTICE file #distributed with this work for additional information #regarding copyright ownership. The ASF licenses this file #to you under the Apache License, Version 2.0 (the #"License"); you may not use thi...
apache-2.0
futurecore/revelation
revelation/test/test_execute_branch.py
1
1838
from revelation.instruction import Instruction from revelation.isa import decode from revelation.machine import RESET_ADDR from revelation.test.machine import new_state, StateChecker import opcode_factory import pytest @pytest.mark.parametrize('is16bit,cond,imm,offset', [# BEQ (never branches...
bsd-3-clause
jessicalucci/NovaOrc
plugins/xenserver/networking/etc/xensource/scripts/ovs_configure_vif_flows.py
14
10373
#!/usr/bin/env python # 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 # # ...
apache-2.0
dungtn/hackspace-2016
source/convolutional_mlp.py
1
12792
"""This tutorial introduces the LeNet5 neural network architecture using Theano. LeNet5 is a convolutional neural network, good for classifying images. This tutorial shows how to build the architecture, and comes with all the hyper-parameters you need to reproduce the paper's MNIST results. This implementation simpl...
gpl-3.0
stonegithubs/odoo
addons/hr_contract/base_action_rule.py
389
2646
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (c) 2013 OpenERP S.A. <http://www.openerp.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of th...
agpl-3.0
JAOSP/aosp_platform_external_chromium_org
build/android/pylib/fake_dns.py
31
2221
# Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import android_commands import constants import logging import os import subprocess import time class FakeDns(object): """Wrapper class for the fake_...
bsd-3-clause
evernym/plenum
plenum/test/checkpoints/test_ordering_after_catchup.py
2
2191
from plenum.test.helper import checkViewNoForNodes, sdk_send_random_and_check from plenum.test.node_catchup.helper import waitNodeDataEquality, \ ensure_all_nodes_have_same_data from plenum.common.util import randomString from plenum.test.test_node import checkNodesConnected from plenum.test.pool_transactions.helpe...
apache-2.0
onestarshang/flask_super_config
venv/lib/python2.7/site-packages/requests/__init__.py
412
1861
# -*- coding: utf-8 -*- # __ # /__) _ _ _ _ _/ _ # / ( (- (/ (/ (- _) / _) # / """ requests HTTP library ~~~~~~~~~~~~~~~~~~~~~ Requests is an HTTP library, written in Python, for human beings. Basic GET usage: >>> import requests >>> r = requests.get('https://www.python.org') >>> ...
gpl-2.0
placrosse/ImpalaToGo
thirdparty/thrift-0.9.0/lib/py/src/protocol/TCompactProtocol.py
97
10943
# # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
apache-2.0
atmark-techno/atmark-dist
user/mosquitto/mosquitto-1.3.4/test/broker/08-ssl-bridge.py
19
2068
#!/usr/bin/env python import os import subprocess import socket import ssl import time import inspect, os, sys # From http://stackoverflow.com/questions/279237/python-import-a-module-from-a-folder cmd_subfolder = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile( inspect.currentframe() ))[0]...
gpl-2.0
viur-framework/server
tasks.py
1
13731
# -*- coding: utf-8 -*- from datetime import datetime, timedelta from server.update import checkUpdate from server.config import conf, sharedConf from server import errors, request from google.appengine.api import users from google.appengine.api import taskqueue from google.appengine.ext.deferred import PermanentTaskFa...
lgpl-3.0
sajeeshcs/nested_quota_final
nova/cells/opts.py
13
2439
# Copyright (c) 2012 Rackspace Hosting # # 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
CroissanceCommune/autonomie
autonomie/models/commercial.py
1
2143
# -*- coding: utf-8 -*- # * Copyright (C) 2012-2013 Croissance Commune # * Authors: # * Arezki Feth <f.a@majerti.fr>; # * Miotte Julien <j.m@majerti.fr>; # * Pettier Gabriel; # * TJEBBES Gaston <g.t@majerti.fr> # # This file is part of Autonomie : Progiciel de gestion de CAE. # # Autonomie is...
gpl-3.0
specify/specify7
specifyweb/workbench/upload/tests/testmustmatch.py
1
6636
import json from jsonschema import validate # type: ignore from typing import List, Dict, Any, NamedTuple, Union from .base import UploadTestsBase, get_table from ..upload_result import Uploaded, Matched, NoMatch, NullRecord, ParseFailures, FailedBusinessRule from ..upload import do_upload, do_upload_csv from ..upload...
gpl-2.0
labsanmartin/Bika-LIMS
bika/lims/exportimport/instruments/alere/pima/__init__.py
4
3686
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Alere Pima """ from datetime import datetime from bika.lims.utils import to_unicode from bika.lims import bikaMessageFactory as _ from bika.lims.exportimport.instruments.resultsimport import \ AnalysisResultsImporter, InstrumentCSVResultsFileParser class AlerePima...
agpl-3.0
Ms2ger/servo
tests/wpt/web-platform-tests/subresource-integrity/tools/list_hashes.py
191
1440
from os import path, listdir from hashlib import sha512, sha384, sha256, md5 from base64 import b64encode import re DIR = path.normpath(path.join(__file__, "..", "..")) ''' Yield each javascript and css file in the directory ''' def js_and_css_files(): for f in listdir(DIR): if path.isfile(f) and (f.endswith("....
mpl-2.0
geokrety/geokrety-api
tests/unittests/utils/payload/news.py
2
1182
# -*- coding: utf-8 -*- from mixer.backend.flask import mixer from geokrety_api_models import User from .base import BasePayload class NewsPayload(BasePayload): _url = "/v1/news/{}" _url_collection = "/v1/news" _response_type = 'NewsResponse' _response_type_collection = 'NewsCollectionResponse' ...
gpl-3.0
poo12138/gem5-stable
src/dev/x86/I82094AA.py
69
2201
# Copyright (c) 2008 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
luiseduardohdbackup/odoo
addons/mail/mail_message_subtype.py
387
3094
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2012-today OpenERP SA (<http://www.openerp.com>) # # This program is free software: you can redistribute it and/or modify # it under the terms o...
agpl-3.0
ixs/func
func/overlord/delegation_tools.py
6
7115
## ## func delegation tools ## These are some helper methods to make dealing with delegation ## dictionary trees a little more sane when dealing with delegation ## and related functions. ## ## Copyright 2008, Red Hat, Inc. ## Steve Salevan <ssalevan@redhat.com> ## ## This software may be freely redistributed under the ...
gpl-2.0
netsamir/dotfiles
files/vim/bundle/YouCompleteMe/third_party/ycmd/cpp/ycm/tests/gmock/gtest/xcode/Scripts/versiongenerate.py
3088
4536
#!/usr/bin/env python # # Copyright 2008, 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...
unlicense
lude-ma/python-ivi
ivi/agilent/agilentMSOX3024A.py
1
1693
""" Python Interchangeable Virtual Instrument Library Copyright (c) 2012-2014 Alex Forencich 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...
mit
kaedroho/django
django/contrib/gis/geos/prototypes/errcheck.py
98
2654
""" Error checking functions for GEOS ctypes prototype functions. """ from ctypes import c_void_p, string_at from django.contrib.gis.geos.error import GEOSException from django.contrib.gis.geos.libgeos import GEOSFuncFactory # Getting the `free` routine used to free the memory allocated for # string pointers returne...
bsd-3-clause
infowantstobeseen/pyglet-darwincore
pyglet/image/codecs/__init__.py
8
8615
# ---------------------------------------------------------------------------- # pyglet # Copyright (c) 2006-2008 Alex Holkner # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # * Redistribu...
bsd-3-clause
ayoubg/gem5-graphics
gem5/src/arch/power/PowerTLB.py
66
1802
# -*- mode:python -*- # Copyright (c) 2009 The University of Edinburgh # 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, t...
bsd-3-clause
Ozerev/mangos-tbc
contrib/mmap/mmap_extract.py
21
2401
#!/usr/bin/python """ This file is part of the CMaNGOS Project. See AUTHORS file for Copyright 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 the Free Software Foundation; either version 2 of the License, or...
gpl-2.0
gaeun/open-event-orga-server
migrations/versions/703eda37e75c_.py
10
1987
"""empty message Revision ID: 703eda37e75c Revises: 86fe7df8dca6 Create Date: 2016-08-07 15:11:55.493400 """ # revision identifiers, used by Alembic. revision = '703eda37e75c' down_revision = '86fe7df8dca6' from alembic import op import sqlalchemy as sa import sqlalchemy_utils def upgrade(): ### commands auto...
gpl-3.0
motion2015/edx-platform
lms/djangoapps/certificates/migrations/0017_auto__add_certificategenerationconfiguration.py
103
7245
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'CertificateGenerationConfiguration' db.create_table('certificates_certificategenerationconfi...
agpl-3.0
jumpstarter-io/nova
nova/tests/scheduler/test_filters.py
17
8685
# Copyright 2012 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 req...
apache-2.0
smmribeiro/intellij-community
python/helpers/pydev/pydev_tests_python/test_frame_evaluator.py
12
2436
import sys import threading import pytest from pydev_tests_python.debugger_unittest import IS_PY36_OR_GREATER, IS_CPYTHON from pydev_tests_python.debug_constants import TEST_CYTHON pytestmark = pytest.mark.skipif(not IS_PY36_OR_GREATER or not IS_CPYTHON or not TEST_CYTHON, reason='Requires CPython >= 3.6') def get_f...
apache-2.0
rooshilp/CMPUT410W15-project
testenv/lib/python2.7/site-packages/django/contrib/gis/geos/prototypes/predicates.py
114
1787
""" This module houses the GEOS ctypes prototype functions for the unary and binary predicate operations on geometries. """ from ctypes import c_char, c_char_p, c_double from django.contrib.gis.geos.libgeos import GEOM_PTR from django.contrib.gis.geos.prototypes.errcheck import check_predicate from django.contrib.gis...
gpl-2.0
nweedon/pyfbx
test/consistency_test.py
1
2967
''' Copyright (c) 2014, NIALL FREDERICK WEEDON 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, this list of conditions and the f...
bsd-3-clause
google-code/android-scripting
python/src/Lib/plat-irix6/cddb.py
66
7218
# This file implements a class which forms an interface to the .cddb # directory that is maintained by SGI's cdman program. # # Usage is as follows: # # import readcd # r = readcd.Readcd() # c = Cddb(r.gettrackinfo()) # # Now you can use c.artist, c.title and c.track[trackno] (where trackno # starts at 1). When the CD...
apache-2.0
DarthMaulware/EquationGroupLeaks
Leak #5 - Lost In Translation/windows/Resources/Ops/PyScripts/lib/ops/cmd/redirect.py
1
15179
import ops.cmd import dsz import dsz.cmd import util.ip from ops.cmd import OpsCommandException TCP = 'tcp' UDP = 'udp' IMPLANTLISTEN = 'implantlisten' LPLISTEN = 'lplisten' VALID_OPTIONS = ['lplisten', 'implantlisten', 'target', 'tcp', 'udp', 'portsharing', 'connections', 'limitconnections', 'sendnotify', 'packetsize...
unlicense
jasonzzz/ansible
lib/ansible/plugins/lookup/subelements.py
6
4311
# (c) 2013, Serge van Ginderachter <serge@vanginderachter.be> # # 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)...
gpl-3.0
recall704/scrapy-docs-cn
tests/test_downloadermiddleware_stats.py
101
1596
from unittest import TestCase from scrapy.downloadermiddlewares.stats import DownloaderStats from scrapy.http import Request, Response from scrapy.spiders import Spider from scrapy.utils.test import get_crawler class MyException(Exception): pass class TestDownloaderStats(TestCase): def setUp(self): ...
bsd-3-clause
kenshay/ImageScripter
ProgramData/Android/ADB/platform-tools/systrace/catapult/telemetry/telemetry/web_perf/metrics/startup_unittest.py
13
3355
# Copyright 2015 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 import telemetry.timeline.event as timeline_event from telemetry.testing import test_page_test_results from telemetry.web_perf.metrics impor...
gpl-3.0
tigawa/proofreadingchecker
vendor/bundle/ruby/1.9.1/gems/libv8-3.16.14.3/vendor/gyp/test/variables/commands/gyptest-commands-ignore-env.py
330
1466
#!/usr/bin/env python # Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Test that environment variables are ignored when --ignore-environment is specified. """ import os import TestGyp test = TestGyp.TestG...
apache-2.0
rohit21122012/DCASE2013
runs/2016/baseline2016_mfcc_21/src/evaluation.py
56
43426
#!/usr/bin/env python # -*- coding: utf-8 -*- import math import numpy import sys from sklearn import metrics class DCASE2016_SceneClassification_Metrics(): """DCASE 2016 scene classification metrics Examples -------- >>> dcase2016_scene_metric = DCASE2016_SceneClassification_Metrics(class_lis...
mit
guglielmino/pushetta-api-django
pushetta/api/channels_sl.py
1
6038
# coding=utf-8 # Progetto: Pushetta API # Service layer con le funzionalità per la gestione Channels import logging logger = logging.getLogger(__name__) from rest_framework import generics, permissions from rest_framework.response import Response from rest_framework import status from rest_framework.permissions im...
gpl-3.0
nomeata/codespeed
codespeed/migrations/0001_initial.py
5
13935
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'Project' db.create_table('codespeed_project', ( ('id', self.gf('django.db.models.field...
lgpl-2.1
Galithil/charon
charon/user.py
3
3993
" Charon: User account handling." import logging import json import urllib import tornado.web import couchdb import requests from . import constants from . import settings from . import utils from .requesthandler import RequestHandler from .saver import Saver class UserSaver(Saver): doctype = constants.USER ...
mit
ZenHarbinger/snapcraft
snapcraft/internal/pluginhandler/stage_package_grammar/errors.py
2
1402
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*- # # Copyright (C) 2017 Canonical Ltd # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License version 3 as # published by the Free Software Foundation. # # This program is distributed in the h...
gpl-3.0
GeographicaGS/moocng
moocng/courses/translation.py
1
1176
from modeltranslation.translator import translator, TranslationOptions from moocng.courses.models import Course, StaticPage, Unit, KnowledgeQuantum, Question, Option class CourseTranslationOptions(TranslationOptions): fields = ('name', 'description', 'requirements', 'learning_goals', 'intended_audience', 'promotion_m...
apache-2.0
gorkinovich/DefendersOfMankind
dependencies/Ogre/Tools/Wings3DExporter/xmlout.py
34
1531
# extremely simple XML writer # # This is to remove libxml2 dependency on platforms where it's # difficult to build # # 2003 Attila Tajti <attis@spacehawks.hu> class XMLDoc: def __init__(self, version): self.version = version self.root_element = None def saveFile(self, filename): f = file(filename, "w") ...
gpl-3.0
mbayon/TFG-MachineLearning
vbig/lib/python2.7/site-packages/sklearn/datasets/tests/test_rcv1.py
322
2414
"""Test the rcv1 loader. Skipped if rcv1 is not already downloaded to data_home. """ import errno import scipy.sparse as sp import numpy as np from sklearn.datasets import fetch_rcv1 from sklearn.utils.testing import assert_almost_equal from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing i...
mit
emfcamp/micropython
tests/basics/class_bind_self.py
59
1235
# test for correct binding of self when accessing attr of an instance class A: def __init__(self, arg): self.val = arg def __str__(self): return 'A.__str__ ' + str(self.val) def __call__(self, arg): return 'A.__call__', arg def foo(self, arg): return 'A.foo', self.val, a...
mit
mdhaber/scipy
scipy/spatial/tests/test_slerp.py
11
15434
from __future__ import division, absolute_import, print_function import numpy as np from numpy.testing import assert_allclose import pytest from scipy.spatial import geometric_slerp def _generate_spherical_points(ndim=3, n_pts=2): # generate uniform points on sphere # see: https://stackoverflow.com/a/237853...
bsd-3-clause
EricRho/home-assistant
tests/test_config.py
3
4496
""" tests.test_config ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Tests config utils. """ # pylint: disable=too-many-public-methods,protected-access import unittest import unittest.mock as mock import os from homeassistant.core import DOMAIN, HomeAssistantError import homeassistant.config as config_util from homeassistant.const im...
mit
vijayanandnandam/youtube-dl
youtube_dl/extractor/ccc.py
50
2839
from __future__ import unicode_literals from .common import InfoExtractor from ..utils import ( int_or_none, parse_iso8601, ) class CCCIE(InfoExtractor): IE_NAME = 'media.ccc.de' _VALID_URL = r'https?://(?:www\.)?media\.ccc\.de/v/(?P<id>[^/?#&]+)' _TESTS = [{ 'url': 'https://media.ccc.de...
unlicense
apache/airflow
airflow/providers/google/cloud/operators/cloud_build.py
3
8638
# # 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...
apache-2.0
jkshaver/virtualenv-1.8.2
env/lib/python2.7/site-packages/django/utils/unittest/case.py
103
42486
"""Test case implementation""" import sys import difflib import pprint import re import unittest import warnings from django.utils.unittest import result from django.utils.unittest.util import\ safe_repr, safe_str, strclass,\ unorderable_list_difference from django.utils.unittest.compatibility import wraps ...
mit
partofthething/home-assistant
tests/components/zha/test_api.py
6
18801
"""Test ZHA API.""" from binascii import unhexlify from unittest.mock import AsyncMock, patch import pytest import voluptuous as vol import zigpy.profiles.zha import zigpy.types import zigpy.zcl.clusters.general as general from homeassistant.components.websocket_api import const from homeassistant.components.zha impo...
mit
hynnet/openwrt-mt7620
staging_dir/host/lib/python2.7/optparse.py
175
61124
"""A powerful, extensible, and easy-to-use option parser. By Greg Ward <gward@python.net> Originally distributed as Optik. For support, use the optik-users@lists.sourceforge.net mailing list (http://lists.sourceforge.net/lists/listinfo/optik-users). Simple usage example: from optparse import OptionParser pa...
gpl-2.0
jdkernel/incrediblec_sense_2.6.35
arch/ia64/scripts/unwcheck.py
13143
1714
#!/usr/bin/python # # Usage: unwcheck.py FILE # # This script checks the unwind info of each function in file FILE # and verifies that the sum of the region-lengths matches the total # length of the function. # # Based on a shell/awk script originally written by Harish Patil, # which was converted to Perl by Matthew Ch...
gpl-2.0
chromaway/ngcccbase
install_https.py
4
1916
#!/usr/bin/env python import urllib2 import httplib import ssl import socket import os import sys try: main_file = os.path.abspath(sys.modules['__main__'].__file__) except AttributeError: main_file = sys.executable CERT_FILE = os.path.join(os.path.dirname(main_file), 'cacert.pem') class ValidHTTPSConnection(...
mit
hopeall/odoo
addons/account_asset/wizard/__init__.py
445
1122
# -*- encoding: 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 t...
agpl-3.0
ticosax/django
tests/template_tests/filter_tests/test_timesince.py
207
5422
from __future__ import unicode_literals from datetime import datetime, timedelta from django.template.defaultfilters import timesince_filter from django.test import SimpleTestCase from django.test.utils import requires_tz_support from ..utils import setup from .timezone_utils import TimezoneTestCase class Timesinc...
bsd-3-clause
pepetreshere/odoo
addons/website_slides_forum/models/slide_channel.py
3
1510
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo import api, fields, models class Channel(models.Model): _inherit = 'slide.channel' forum_id = fields.Many2one('forum.forum', 'Course Forum') forum_total_posts = fields.Integer('Number of active f...
agpl-3.0
seamile/Weeds
BitSet/bitset.py
1
3043
from typing import Sequence class BitmapSet: '''使用 Bigmap 定义的 Set''' def __init__(self, items: Sequence[int]) -> None: self.bit_set = bytearray() self.update(items) @property def count(self): '''元素数量''' n = 0 for byte in self.bit_set: while byte: ...
mit
coreynicholson/youtube-dl
youtube_dl/extractor/go.py
29
8340
# coding: utf-8 from __future__ import unicode_literals import re from .adobepass import AdobePassIE from ..utils import ( int_or_none, determine_ext, parse_age_limit, urlencode_postdata, ExtractorError, ) class GoIE(AdobePassIE): _SITE_INFO = { 'abc': { 'brand': '001', ...
unlicense
ARMmbed/yotta
yotta/remove.py
3
2265
# Copyright 2014-2015 ARM Limited # # Licensed under the Apache License, Version 2.0 # See LICENSE file for details. # standard library modules, , , import logging import os # fsutils, , misc filesystem utils, internal from yotta.lib import fsutils # validate, , validate things, internal from yotta.lib import validat...
apache-2.0
nolanliou/tensorflow
tensorflow/python/framework/op_def_registry.py
196
1428
# 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
manipopopo/tensorflow
tensorflow/python/ops/distributions/normal.py
16
9263
# 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
charris/numpy
numpy/lib/arraysetops.py
4
26426
""" Set operations for arrays based on sorting. Notes ----- For floating point arrays, inaccurate results may appear due to usual round-off and floating point comparison issues. Speed could be gained in some operations by an implementation of `numpy.sort`, that can provide directly the permutation vectors, thus avoi...
bsd-3-clause
bottompawn/kbengine
kbe/res/scripts/common/Lib/random.py
91
26084
"""Random variable generators. integers -------- uniform within range sequences --------- pick random element pick random sample generate random permutation distributions on the real line: ------------------------------ uniform ...
lgpl-3.0
shashidharatd/test-infra
images/bazelbuild/coalesce.py
4
3183
#!/usr/bin/env python2 # Copyright 2016 The Kubernetes 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 appl...
apache-2.0
foxwill/ol-api-tester
env/lib/python2.7/site-packages/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
rvanlaar/easy-transifex
src/transifex/transifex/addons/suggestions/formats.py
1
4209
# -*- coding: utf-8 -*- """Module for handling suggestions in resources.""" from django.conf import settings from suggestions.models import Suggestion from transifex.txcommon.log import logger from transifex.resources.models import Translation, SourceEntity from transifex.resources.formats.utils.string_utils import pe...
bsd-2-clause
evaschalde/odoo
addons/share/wizard/__init__.py
448
1067
# -*- 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
tylerjereddy/scipy
scipy/linalg/_matfuncs_inv_ssq.py
21
27982
""" Matrix functions that use Pade approximation with inverse scaling and squaring. """ import warnings import numpy as np from scipy.linalg._matfuncs_sqrtm import SqrtmError, _sqrtm_triu from scipy.linalg.decomp_schur import schur, rsf2csf from scipy.linalg.matfuncs import funm from scipy.linalg import svdvals, sol...
bsd-3-clause
rlr/fjord
vendor/packages/translate-toolkit/translate/convert/prop2po.py
3
12113
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2002-2010,2012 Zuza Software Foundation # # This file is part of translate. # # translate 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 vers...
bsd-3-clause
rubencabrera/odoo
addons/l10n_pl/__openerp__.py
277
2158
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2009 - now Grzegorz Grzelak grzegorz.grzelak@openglobe.pl # All Rights Reserved # $Id$ # # This program is free software: you can redistrib...
agpl-3.0
yaii/yai
share/extensions/render_barcode_qrcode.py
3
31528
#!/usr/bin/env python import math, sys import inkex inkex.localize() #QRCode for Python # #Ported from the Javascript library by Sam Curren # #QRCode for Javascript #http://d-project.googlecode.com/svn/trunk/misc/qrcode/js/qrcode.js # #Copyright (c) 2009 Kazuhiko Arase # #URL: http://www.d-project.com/ # # Copyright...
gpl-2.0
JorgeCoock/django
django/contrib/gis/db/backends/oracle/introspection.py
539
1977
import sys import cx_Oracle from django.db.backends.oracle.introspection import DatabaseIntrospection from django.utils import six class OracleIntrospection(DatabaseIntrospection): # Associating any OBJECTVAR instances with GeometryField. Of course, # this won't work right on Oracle objects that aren't MDS...
bsd-3-clause
Orav/kbengine
kbe/res/scripts/common/Lib/distutils/errors.py
5
3674
"""distutils.errors Provides exceptions used by the Distutils modules. Note that Distutils modules may raise standard exceptions; in particular, SystemExit is usually raised for errors that are obviously the end-user's fault (eg. bad command-line arguments). This module is safe to use in "from ... import *" m...
lgpl-3.0
UrusTeam/android_ndk_toolchain_cross
lib/python2.7/htmlentitydefs.py
390
18054
"""HTML character entity references.""" # maps the HTML entity name to the Unicode codepoint name2codepoint = { 'AElig': 0x00c6, # latin capital letter AE = latin capital ligature AE, U+00C6 ISOlat1 'Aacute': 0x00c1, # latin capital letter A with acute, U+00C1 ISOlat1 'Acirc': 0x00c2, # latin capit...
gpl-2.0
schlueter/ansible
lib/ansible/modules/cloud/vmware/vca_fw.py
26
7965
#!/usr/bin/python # Copyright (c) 2015 VMware, Inc. All Rights Reserved. # 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
AndroidOpenDevelopment/android_external_chromium_org
third_party/tlslite/tlslite/integration/httptlsconnection.py
115
4314
# Authors: # Trevor Perrin # Kees Bos - Added ignoreAbruptClose parameter # Dimitris Moraitis - Anon ciphersuites # Martin von Loewis - python 3 port # # See the LICENSE file for legal information regarding use of this file. """TLS Lite + httplib.""" import socket try: import httplib except ImportError: ...
bsd-3-clause
dossier/dossier.web
dossier/web/tests/test_label_folders.py
1
4434
from __future__ import absolute_import, division, print_function import pytest from dossier.web.label_folders import Folders from dossier.web.tests import config_local, kvl, store, label_store # noqa @pytest.yield_fixture # noqa def folders(store, label_store): yield Folders(store, label_store) @pytest.yiel...
mit