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
madmack/i747_kernel_ics
scripts/tracing/draw_functrace.py
14676
3560
#!/usr/bin/python """ Copyright 2008 (c) Frederic Weisbecker <fweisbec@gmail.com> Licensed under the terms of the GNU GPL License version 2 This script parses a trace provided by the function tracer in kernel/trace/trace_functions.c The resulted trace is processed into a tree to produce a more human view of the call ...
gpl-2.0
jurismarches/chopper
docs/conf.py
1
8389
# -*- coding: utf-8 -*- # # Chopper documentation build configuration file, created by # sphinx-quickstart on Fri Jul 25 13:30:47 2014. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # A...
mit
nilsgrabbert/spark
examples/src/main/python/mllib/fpgrowth_example.py
158
1280
# # 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
csirtgadgets/csirtgsdk-py
csirtgsdk/feed.py
3
2484
from csirtgsdk.client.http import HTTP as Client class Feed(object): """ Represents a Feed Object """ def __init__(self, client=Client()): self.client = client def get_lines(self, data): from prettytable import PrettyTable cols = ['name', 'description', 'license', 'updated...
mpl-2.0
anfelder/ardupilot
Tools/LogAnalyzer/tests/TestMotorBalance.py
215
2265
from LogAnalyzer import Test,TestResult import DataflashLog class TestBalanceTwist(Test): '''test for badly unbalanced copter, including yaw twist''' def __init__(self): Test.__init__(self) self.name = "Motor Balance" def run(self, logdata, verbose): self.result = TestResult() ...
gpl-3.0
yrobla/nova
nova/virt/vmwareapi/vmops.py
1
61735
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright (c) 2012 VMware, Inc. # Copyright (c) 2011 Citrix Systems, Inc. # Copyright 2011 OpenStack Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # ...
apache-2.0
snasoft/QtCreatorPluginsPack
Bin/3rdParty/vera/bin/lib/test/test_pdb.py
19
9554
# A test suite for pdb; at the moment, this only validates skipping of # specified test modules (RFE #5142). import imp import sys import os import unittest import subprocess from test import test_support # This little helper class is essential for testing pdb under doctest. from test_doctest import _FakeInput clas...
lgpl-3.0
ehashman/oh-mainline
vendor/packages/python-social-auth/social/backends/foursquare.py
83
1376
""" Foursquare OAuth2 backend, docs at: http://psa.matiasaguirre.net/docs/backends/foursquare.html """ from social.backends.oauth import BaseOAuth2 class FoursquareOAuth2(BaseOAuth2): name = 'foursquare' AUTHORIZATION_URL = 'https://foursquare.com/oauth2/authenticate' ACCESS_TOKEN_URL = 'https://fours...
agpl-3.0
jordanemedlock/psychtruths
temboo/Library/Google/Spreadsheets/RetrieveLastColumnValue.py
4
7395
# -*- coding: utf-8 -*- ############################################################################### # # RetrieveLastColumnValue # Returns the value of the last cell in a specified column. # # Python versions 2.6, 2.7, 3.x # # Copyright 2014, Temboo Inc. # # Licensed under the Apache License, Version 2.0 (the "Lice...
apache-2.0
Sarah-Alsinan/muypicky
lib/python3.6/site-packages/django/contrib/gis/db/backends/spatialite/schema.py
62
6987
from django.db.backends.sqlite3.schema import DatabaseSchemaEditor from django.db.utils import DatabaseError class SpatialiteSchemaEditor(DatabaseSchemaEditor): sql_add_geometry_column = ( "SELECT AddGeometryColumn(%(table)s, %(column)s, %(srid)s, " "%(geom_type)s, %(dim)s, %(null)s)" ) sq...
mit
metashell/metashell
3rd/templight/llvm/utils/wciia.py
32
2987
#!/usr/bin/env python """ wciia - Whose Code Is It Anyway Determines code owner of the file/folder relative to the llvm source root. Code owner is determined from the content of the CODE_OWNERS.TXT by parsing the D: field usage: utils/wciia.py path limitations: - must be run from llvm source root - very simplist...
gpl-3.0
CTSRD-SOAAP/chromium-42.0.2311.135
native_client/src/trusted/validator_arm/dgen_output.py
13
2722
#!/usr/bin/python # # Copyright (c) 2012 The Native Client Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. # """ Some common boilerplates and helper functions for source code generation in files dgen_test_output.py and dgen_decode_outp...
bsd-3-clause
camallen/aggregation
experimental/serengeti/IAAI/currentAlg.py
2
1959
#!/usr/bin/env python __author__ = 'greghines' import csv import os import pymongo import numpy as np client = pymongo.MongoClient() db = client['serengeti_2014-07-28'] collection = db["serengeti_subjects"] collection2 = db["serengeti_classifications"] i = 0 blankRetire = [] consensusRetire = [] mixedRetire = [] num...
apache-2.0
kishikawakatsumi/Mozc-for-iOS
src/third_party/protobuf/python/google/protobuf/service_reflection.py
601
11010
# Protocol Buffers - Google's data interchange format # Copyright 2008 Google Inc. All rights reserved. # http://code.google.com/p/protobuf/ # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions o...
apache-2.0
BeegorMif/HTPC-Manager
lib/trakt/__init__.py
1
3489
import urllib2 from hashlib import sha1 from sickbeard import logger try: import json except ImportError: from lib import simplejson as json def TraktCall(method, api, username=None, password=None, data={}): """ A generic method for communicating with trakt. Uses the method and data provided along ...
gpl-3.0
elego/tkobr-addons
unported/tko_project_task_type/project_task.py
2
2555
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # ThinkOpen Solutions Brasil # Copyright (C) Thinkopen Solutions <http://www.tkobr.com>. # # This...
agpl-3.0
temasek/android_external_chromium_org
tools/valgrind/asan/asan_symbolize.py
23
1320
#!/usr/bin/env python # 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. from third_party import asan_symbolize import os import re import sys def fix_filename(file_name): for path_to_cut in sys.argv...
bsd-3-clause
arthurHamon2/indexing-file
process_version/models.py
1
2258
""" Draft module which represents the database model. """ from sqlalchemy import Table, Column, Integer, MetaData from sqlalchemy.dialects.postgresql import HSTORE class Models: """ Defines the tables in the database and if not present, they will be automaticaly created. """ def __init__(self): ...
mit
evanthebouncy/nnhmm
graph4/graph.py
1
4892
import random import numpy as np import networkx as nx import matplotlib.pyplot as plt import copy N = 100 def dist(c1, c2): return np.linalg.norm(np.array(c1) - np.array(c2)) def too_close(pt, pts): for pt_other in pts: if dist(pt, pt_other) < 0.05: return True return False def gen_pts(n): re...
mit
jtyr/ansible
test/units/plugins/lookup/test_password.py
46
20778
# -*- coding: utf-8 -*- # (c) 2015, Toshio Kuratomi <tkuratomi@ansible.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 License, or # (a...
gpl-3.0
ygol/odoo
addons/website_forum_doc/controllers/main.py
338
3425
# -*- coding: utf-8 -*- from openerp import http from openerp.http import request from openerp.addons.website.models.website import slug class WebsiteDoc(http.Controller): @http.route(['/forum/how-to', '/forum/how-to/<model("forum.documentation.toc"):toc>'], type='http', auth="public", website=True) def toc...
agpl-3.0
tyewang/invoke
invoke/vendor/yaml2/events.py
985
2445
# Abstract classes. class Event(object): def __init__(self, start_mark=None, end_mark=None): self.start_mark = start_mark self.end_mark = end_mark def __repr__(self): attributes = [key for key in ['anchor', 'tag', 'implicit', 'value'] if hasattr(self, key)] argu...
bsd-2-clause
mclois/iteexe
tools/obsolete/getManual.py
9
6719
#!/usr/bin/python -u # # Make a snapshot of the eXe Online Manual for offline use # # Copyright (c) 2008 James W. Tittsler <jwt@OnJapan.net> # # 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 ...
gpl-2.0
jegger/kivy
kivy/uix/checkbox.py
15
5970
''' CheckBox ======== .. versionadded:: 1.4.0 .. image:: images/checkbox.png :align: right :class:`CheckBox` is a specific two-state button that can be either checked or unchecked. If the CheckBox is in a Group, it becomes a Radio button. As with the :class:`~kivy.uix.togglebutton.ToggleButton`, only one Radio b...
mit
project-magpie/enigma2-openpli
lib/python/Screens/ServiceScan.py
6
3943
from Screen import Screen from Components.ServiceScan import ServiceScan as CScan from Components.ProgressBar import ProgressBar from Components.Label import Label from Components.ActionMap import ActionMap from Components.FIFOList import FIFOList from Components.Sources.FrontendInfo import FrontendInfo from Components...
gpl-2.0
nmathewson/mixminion
contrib/zlibutil.py
6
14962
#!/usr/bin/env python # # Copyright (c) 2002 Bryce "Zooko" Wilcox-O'Hearn # portions Copyright (c) 2001 Autonomous Zone Industries # This file is licensed under the # GNU Lesser General Public License v2.1. # See the file COPYING or visit http://www.gnu.org/ for details. # Python standard library modules impo...
mit
dhamaniasad/mythbox
resources/lib/twisted/twisted/conch/client/knownhosts.py
56
14196
# -*- test-case-name: twisted.conch.test.test_knownhosts -*- # Copyright (c) 2008-2009 Twisted Matrix Laboratories. # See LICENSE for details. """ An implementation of the OpenSSH known_hosts database. @since: 8.2 """ from binascii import Error as DecodeError, b2a_base64 import hmac import sys from zope.interface i...
gpl-2.0
googleinterns/learnbase
learnbase/src/main/webapp/WEB-INF/Lib/zipfile.py
6
57832
""" Read and write ZIP files. """ import struct, os, time, sys, shutil import binascii, cStringIO, stat import io import re import string _is_jython = os.name == "java" try: import zlib # We may need its compression method crc32 = zlib.crc32 except ImportError: zlib = None crc32 = binascii.crc32 __al...
apache-2.0
Softmotions/edx-platform
pavelib/utils/test/suites/suite.py
54
4406
""" A class used for defining and running test suites """ import sys import subprocess from paver.easy import sh from pavelib.utils.process import kill_process try: from pygments.console import colorize except ImportError: colorize = lambda color, text: text # pylint: disable=invalid-name __test__ = False ...
agpl-3.0
songfj/scrapy
scrapy/commands/bench.py
151
1640
import sys import time import subprocess from six.moves.urllib.parse import urlencode import scrapy from scrapy.commands import ScrapyCommand from scrapy.linkextractors import LinkExtractor class Command(ScrapyCommand): default_settings = { 'LOG_LEVEL': 'INFO', 'LOGSTATS_INTERVAL': 1, '...
bsd-3-clause
jawed123/pinax-phone-confirmation
phoneconfirmation/tests/tests.py
2
1802
from django.test import TestCase from django.contrib.auth.models import User from phoneconfirmation.models import PhoneNumber, PhoneCountryCode class login(object): def __init__(self, testcase, user, password): self.testcase = testcase success = testcase.client.login(username=user, password=pass...
mit
Kane-Larrete/ProsperAPI
publicAPI/api_utils.py
1
1796
from os import path, makedirs from datetime import datetime import ujson as json from tinymongo import TinyMongoClient import prosper.common.prosper_logging as p_logging import publicAPI.exceptions as exceptions LOGGER = p_logging.DEFAULT_LOGGER HERE = path.abspath(path.dirname(__file__)) CACHE_PATH = path.join(HER...
mit
fuhongliang/odoo
addons/l10n_in_hr_payroll/report/payslip_report.py
340
3978
# -*- 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 ...
agpl-3.0
scorphus/django
django/contrib/gis/gdal/prototypes/generation.py
349
4310
""" This module contains functions that generate ctypes prototypes for the GDAL routines. """ from ctypes import c_char_p, c_double, c_int, c_int64, c_void_p from functools import partial from django.contrib.gis.gdal.prototypes.errcheck import ( check_arg_errcode, check_const_string, check_errcode, check_geom, ...
bsd-3-clause
keisuke-umezawa/chainer
chainer/links/connection/lstm.py
2
11385
import six import chainer from chainer.functions.activation import lstm from chainer.functions.array import concat from chainer.functions.array import split_axis from chainer import initializers from chainer import link from chainer.links.connection import linear from chainer import utils from chainer import variable ...
mit
JshWright/home-assistant
homeassistant/components/tts/marytts.py
1
3437
""" Support for the MaryTTS service. For more details about this component, please refer to the documentation at https://home-assistant.io/components/tts.marytts/ """ import asyncio import logging import re import aiohttp import async_timeout import voluptuous as vol from homeassistant.const import CONF_HOST, CONF_P...
apache-2.0
xflin/spark
examples/src/main/python/ml/one_vs_rest_example.py
71
2237
# # 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
google-research/google-research
cnn_quantization/tf_cnn_benchmarks/flags.py
1
3598
# coding=utf-8 # Copyright 2021 The Google Research 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 applicab...
apache-2.0
Pexego/odoo
addons/hw_escpos/controllers/main.py
125
14043
# -*- coding: utf-8 -*- import commands import logging import simplejson import os import os.path import io import base64 import openerp import time import random import math import md5 import openerp.addons.hw_proxy.controllers.main as hw_proxy import pickle import re import subprocess import traceback from threading ...
agpl-3.0
Aristocles/CouchPotatoServer
libs/git/exceptions.py
122
2527
# Copyright (c) 2009, Rotem Yaari <vmalloc@gmail.com> # 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 li...
gpl-3.0
ilexius/odoo
addons/website_customer/models/website_customer.py
44
1220
# -*- coding: utf-8 -*- from openerp.osv import osv, fields class res_partner(osv.Model): _inherit = 'res.partner' _columns = { 'website_tag_ids': fields.many2many('res.partner.tag', id1='partner_id', id2='tag_id', string='Website tags', oldname="tag_ids"), } class res_partner_tags(osv.Model):...
gpl-3.0
Kongsea/tensorflow
tensorflow/contrib/training/python/training/sequence_queueing_state_saver_test.py
122
27619
# 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
tipabu/swift
test/unit/common/test_db_replicator.py
2
98546
# Copyright (c) 2010-2012 OpenStack Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agree...
apache-2.0
YeelerG/twilio-python
twilio/rest/resources/call_feedback.py
48
2977
from . import ( ListResource, InstanceResource, transform_params, ) class CallFeedback(InstanceResource): def __init__(self, parent): self.parent = parent super(CallFeedback, self).__init__( parent, None, ) class CallFeedbackFactory(ListResource): ...
mit
TwoD/ansible
lib/ansible/runner/return_data.py
133
2102
# (c) 2012-2014, Michael DeHaan <michael.dehaan@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 License, or # (at your option) an...
gpl-3.0
zchking/odoo
addons/product/__openerp__.py
262
2504
# -*- 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
ahmednuaman/gdrive-cms-py-gae
bs4/tests/test_tree.py
77
65254
# -*- coding: utf-8 -*- """Tests for Beautiful Soup's tree traversal methods. The tree traversal methods are the main advantage of using Beautiful Soup over just using a parser. Different parsers will build different Beautiful Soup trees given the same markup, but all Beautiful Soup trees can be traversed with the me...
mit
msimacek/freeipa
ipatests/test_xmlrpc/test_radiusproxy_plugin.py
5
13248
# Authors: # Petr Viktorin <pviktori@redhat.com> # # Copyright (C) 2013 Red Hat # see file 'COPYING' for use and warranty information # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either ...
gpl-3.0
telefonicaid/fiware-orion
test/acceptance/behave/components/ngsiv2/entities/list_entities/environment.py
62
1042
# -*- coding: utf-8 -*- """ Copyright 2015 Telefonica Investigacion y Desarrollo, S.A.U This file is part of Orion Context Broker. Orion Context Broker 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,...
agpl-3.0
podemos-info/odoo
addons/auction/report/report_lot_bar_code.py
9
1512
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the...
agpl-3.0
radzhome/AWS-ElasticBeanstalk-CLI
eb/linux/python2.7/lib/iam/request.py
4
3184
#!/usr/bin/env python # ============================================================================== # Copyright 2012 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Licensed under the Amazon Software License (the "License"). You may not use # this file except in compliance with the License. A copy of th...
apache-2.0
tarasfrompir/sphinx_ukr-dictionary
dictionary_uK_MARYTTS.py
1
6265
import sys import os softletters=set(u"’яїюіьє") startsyl=set(u"#'ьаяоїуюеєіи-") others = set(["#", "+", "-", u"ь", u"ъ", u"’"]) softhard_cons = { u"б" : u"b", u"в" : u"v", u"г" : u"g", u"ґ" : u"g", u"д" : u"d", u"з" : u"z", ...
gpl-3.0
opentrials/scraper
collectors/isrctn/record.py
2
2392
# -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals from .. import base from ..base.fields import Text, Date, Json # Module API class Record(base.Record): # Config table = 'isrctn' ...
mit
amitsela/beam
sdks/python/apache_beam/utils/value_provider_test.py
4
6800
# # 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
digistam/recon-ng
modules/recon/locations-pushpins/picasa.py
1
3535
import module # unique to module from datetime import datetime import math class Module(module.Module): def __init__(self, params): module.Module.__init__(self, params, query='SELECT DISTINCT latitude || \',\' || longitude FROM locations WHERE latitude IS NOT NULL AND longitude IS NOT NULL') self....
gpl-3.0
etuna-SBF-kog/Stadsparken
env/lib/python2.7/site-packages/django/conf/locale/de/formats.py
329
1288
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'j. F Y' TIME_FORMAT = 'H:i:s' DATETIME_FORMAT = 'j. F Y H:i:s' YEAR_MONTH...
gpl-3.0
BorgERP/edifact
daimler_disy/__init__.py
1
1102
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2014 Decodio ERP/Slobodni Programi d.o.o. (<http://slobodni-programi.com>). # # This program is free software: you can redistribute it and/or modif...
agpl-3.0
opencorato/sayit
speeches/south_migrations/0050_auto__add_field_recordingtimestamp_speaker_new__add_field_speech_speak.py
1
21027
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'RecordingTimestamp.speaker_new' db.add_column('speeches_recordingtimestamp', 'speaker_new', ...
agpl-3.0
beatrizjesus/my-first-blog
pasta/Lib/site-packages/django/contrib/auth/models.py
104
17967
from __future__ import unicode_literals from django.contrib import auth from django.contrib.auth.hashers import ( check_password, is_password_usable, make_password, ) from django.contrib.auth.signals import user_logged_in from django.contrib.contenttypes.models import ContentType from django.core import validators...
mit
mr-niels-christensen/rdfendpoints
lib/SPARQLWrapper/KeyCaseInsensitiveDict.py
7
1097
# -*- coding: utf-8 -*- """ A simple implementation of a key case-insensitive dictionary. @authors: U{Ivan Herman<http://www.ivan-herman.net>}, U{Sergio Fernández<http://www.wikier.org>}, U{Carlos Tejo Alonso<http://www.dayures.net>} @organization: U{World Wide Web Consortium<http://www.w3.org>} and U{Foundation CTIC...
apache-2.0
h2oai/h2o-3
h2o-py/tests/testdir_algos/rulefit/pyunit_titanic_rulefit.py
2
1128
import sys sys.path.insert(1,"../../../") import h2o from tests import pyunit_utils from h2o.estimators.rulefit import H2ORuleFitEstimator def titanic(): df = h2o.import_file(pyunit_utils.locate("smalldata/gbm_test/titanic.csv"), col_types={'pclass': "enum", 'survived': "enum"}) x = ["...
apache-2.0
ravibhure/ansible
lib/ansible/modules/cloud/profitbricks/profitbricks_datacenter.py
27
7537
#!/usr/bin/python # Copyright: Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], ...
gpl-3.0
armersong/letsencrypt
acme/acme/other.py
37
2140
"""Other ACME objects.""" import functools import logging import os from acme import jose logger = logging.getLogger(__name__) class Signature(jose.JSONObjectWithFields): """ACME signature. :ivar .JWASignature alg: Signature algorithm. :ivar bytes sig: Signature. :ivar bytes nonce: Nonce. :iva...
apache-2.0
jonashaag/ansible
lib/ansible/executor/stats.py
251
1716
# (c) 2012-2014, Michael DeHaan <michael.dehaan@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 License, or # (at your option) an...
gpl-3.0
halfak/Mediawiki-Utilities
mw/xml_dump/iteration/contributor.py
4
1246
from ...types import serializable from ...util import none_or from .util import consume_tags class Contributor(serializable.Type): """ Contributor meta data. """ __slots__ = ('id', 'user_text') TAG_MAP = { 'id': lambda e: int(e.text), 'username': lambda e: str(e.text), 'i...
mit
zstackorg/zstack-woodpecker
zstackwoodpecker/zstackwoodpecker/operations/cdrom_operations.py
2
2116
''' VM CDROM operations. @author: Legion ''' from apibinding.api import ApiError import apibinding.inventory as inventory import apibinding.api_actions as api_actions import zstackwoodpecker.test_util as test_util import account_operations def create_vm_cdrom(name, vm_uuid, iso_uuid=None, session_uuid=None): a...
apache-2.0
Zhongqilong/mykbengineer
kbe/src/lib/python/Lib/imp.py
97
9984
"""This module provides the components needed to build your own __import__ function. Undocumented functions are obsolete. In most cases it is preferred you consider using the importlib module's functionality over this module. """ # (Probably) need to stay in _imp from _imp import (lock_held, acquire_lock, release_lo...
lgpl-3.0
pratapvardhan/scikit-learn
sklearn/ensemble/tests/test_voting_classifier.py
25
8160
"""Testing for the boost module (sklearn.ensemble.boost).""" import numpy as np from sklearn.utils.testing import assert_almost_equal from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_raise_message from sklearn.exceptions import NotFittedError from sklearn.linear_model import Logi...
bsd-3-clause
stevei101/oslo.messaging
oslo_messaging/notify/_impl_log.py
5
1557
# Copyright 2011 OpenStack Foundation. # All Rights Reserved. # Copyright 2013 Red Hat, 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/licens...
apache-2.0
mcgachey/edx-platform
common/djangoapps/student/migrations/0043_auto__add_linkedinaddtoprofileconfiguration.py
102
14478
# -*- 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 'LinkedInAddToProfileConfiguration' db.create_table('student_linkedinaddtoprofileconfiguratio...
agpl-3.0
rdezavalia/ansible
lib/ansible/parsing/yaml/dumper.py
46
1780
# (c) 2012-2014, Michael DeHaan <michael.dehaan@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 License, or # (at your option) an...
gpl-3.0
bebound/Pixiv
pixiv.py
1
13940
#!/usr/bin/env python3 """ pixiv Usage: pixiv.py pixiv.py <id>... pixiv.py -r [-d | --date=<date>] pixiv.py -u Arguments: <id> user_ids Options: -r Download by ranking -d <date> --date <date> ...
mit
Ecpy/i3py
docs/source/conf.py
1
4988
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # i3py documentation build configuration file, created by # sphinx-quickstart on Sun Jan 22 17:21:50 2017. # # 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 # autog...
bsd-3-clause
hkumarmk/oslo.messaging
oslo_messaging/_drivers/protocols/amqp/eventloop.py
2
12062
# Copyright 2014, Red Hat, 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 ...
apache-2.0
ferriman/SSandSP
pyxel-test/venv/lib/python3.8/site-packages/setuptools/command/develop.py
6
8045
from distutils.util import convert_path from distutils import log from distutils.errors import DistutilsError, DistutilsOptionError import os import glob import io import pkg_resources from setuptools.command.easy_install import easy_install from setuptools import namespaces import setuptools class develop(namespace...
gpl-3.0
aitoralmeida/networkx
networkx/algorithms/isomorphism/tests/test_isomorphvf2.py
40
8082
""" Tests for VF2 isomorphism algorithm. """ import os import struct import random from nose.tools import assert_true, assert_equal from nose import SkipTest import networkx as nx from networkx.algorithms import isomorphism as iso class TestWikipediaExample(object): # Source: http://en.wikipedia.org/wiki/Gra...
bsd-3-clause
sfcta/BikeRouter
route_model/config/choice_set_config.py
2
5236
import os from UserDict import UserDict import random import route_model.misc as rm_misc from route_model.choice_set.beta_unif_randomizer import BetaUnifRandomizer from math import sqrt class ChoiceSetConfig(UserDict): """store choice set generation configuration data""" def __init__(self,changes={},method='doubly...
gpl-3.0
henocdz/python-social-auth
social/apps/django_app/default/fields.py
80
2513
import json import six from django.core.exceptions import ValidationError from django.db import models try: from django.utils.encoding import smart_unicode as smart_text smart_text # placate pyflakes except ImportError: from django.utils.encoding import smart_text class JSONField(six.with_metaclass(mod...
bsd-3-clause
danleyb2/django-pa
setup.py
1
1375
__author__ = 'danleyb2<ndieksman@gmail.com>' import os from setuptools import setup import setuptools with open(os.path.join(os.path.dirname(__file__), 'README.rst')) as readme: README = readme.read() # allow setup.py to be run from any path os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.par...
gpl-3.0
admcrae/tensorflow
tensorflow/contrib/distributions/python/ops/mvn_diag.py
24
7869
# 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
abdoosh00/edx-rtl-final
common/djangoapps/student/migrations/0008__auto__add_courseregistration.py
188
9912
# -*- 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 'CourseRegistration' db.create_table('student_courseregistration', ( ('id', self....
agpl-3.0
arifsetiawan/edx-platform
common/djangoapps/embargo/migrations/0001_initial.py
114
7291
# -*- 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 'EmbargoedCourse' db.create_table('embargo_embargoedcourse', ( ('id', self.gf('dj...
agpl-3.0
thandang/TComponent
TComponents/cpp/scons/scons-local-2.0.0.final.0/SCons/Tool/MSCommon/netframework.py
34
2805
# # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 The SCons Foundation # # 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 li...
apache-2.0
timchenxiaoyu/Diamond
src/collectors/flume/flume.py
63
3401
# coding=utf-8 """ Collect statistics from Flume #### Dependencies * urllib2 * json or simplejson """ import urllib2 import diamond.collector try: import simplejson as json except ImportError: import json class FlumeCollector(diamond.collector.Collector): # items to collect _metrics_collect =...
mit
sergei-maertens/django
django/core/management/commands/sqlmigrate.py
115
2847
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.core.management.base import BaseCommand, CommandError from django.db import DEFAULT_DB_ALIAS, connections from django.db.migrations.executor import MigrationExecutor from django.db.migrations.loader import AmbiguityError class Command(BaseCo...
bsd-3-clause
sloria/osf.io
osf/migrations/0007_auto_20170403_2304.py
28
3430
# -*- coding: utf-8 -*- # Generated by Django 1.9 on 2017-04-04 04:04 from __future__ import unicode_literals from django.db import migrations import django.utils.timezone import osf.utils.fields class Migration(migrations.Migration): dependencies = [ ('osf', '0006_add_jsonb_index_for_fileversions'), ...
apache-2.0
ycl2045/nova-master
nova/tests/network/test_network_info.py
12
25449
# Copyright 2011 OpenStack Foundation # All Rights Reserved. # Copyright 2013 IBM Corp. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LIC...
apache-2.0
tshawebdev/vkfeed
PyRSS2Gen/test.py
18
5511
# unittest? What's that? # # You'll need Mark Pilgrim's feed_parser, from # http://diveintomark.org/projects/feed_parser/ # The test takes a structure, converts it to XML, # reads it back using feed_parser, and compares # the two stuctures. feed_parser doesn't handle # everything, so I needed to filter some items. #...
bsd-2-clause
jamespacileo/django-france
django/templatetags/l10n.py
247
1845
from django.conf import settings from django.template import Node from django.template import TemplateSyntaxError, Library from django.utils import formats from django.utils.encoding import force_unicode register = Library() def localize(value): """ Forces a value to be rendered as a localized value, reg...
bsd-3-clause
vrv/tensorflow
tensorflow/contrib/learn/python/learn/tests/dataframe/batch_test.py
62
2425
# 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
izonder/intellij-community
plugins/hg4idea/testData/bin/hgext/mq.py
90
134782
# mq.py - patch queues for mercurial # # Copyright 2005, 2006 Chris Mason <mason@suse.com> # # This software may be used and distributed according to the terms of the # GNU General Public License version 2 or any later version. '''manage a stack of patches This extension lets you work with a stack of patches in a Mer...
apache-2.0
mitsuhiko/sentry
tests/sentry/web/frontend/test_accept_organization_invite.py
4
3122
from __future__ import absolute_import from django.core.urlresolvers import reverse from sentry.models import AuditLogEntry, AuditLogEntryEvent, OrganizationMember from sentry.testutils import TestCase class AcceptInviteTest(TestCase): def setUp(self): super(AcceptInviteTest, self).setUp() self....
bsd-3-clause
a10networks/a10sdk-python
a10sdk/core/A10_file/file_auth_saml_idp_oper.py
2
2106
from a10sdk.common.A10BaseClass import A10BaseClass class FileList(A10BaseClass): """This class does not support CRUD Operations please use parent. :param file: {"type": "string", "format": "string"} :param DeviceProxy: The device proxy for REST operations and session handling. Refer to `common/devi...
apache-2.0
nzavagli/UnrealPy
UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/Python-2.7.10/Lib/test/test_mimetools.py
136
1778
import unittest from test import test_support import string import StringIO mimetools = test_support.import_module("mimetools", deprecated=True) msgtext1 = mimetools.Message(StringIO.StringIO( """Content-Type: text/plain; charset=iso-8859-1; format=flowed Content-Transfer-Encoding: 8bit Foo! """)) class MimeToolsT...
mit
juiceinc/recipe
tests/test_clean_unicode.py
1
1551
# -*- coding: UTF-8 -*- from recipe.utils import clean_unicode class TestCleanUnicode(object): def test_string(self): value = clean_unicode("cookies") assert value, b"cookies" def test_nonstring(self): value = clean_unicode(22.04) assert value == b"22.04" value = clea...
mit
Salat-Cx65/python-for-android
python3-alpha/python3-src/Lib/test/test_xmlrpc.py
49
36371
import base64 import datetime import sys import time import unittest import xmlrpc.client as xmlrpclib import xmlrpc.server import http.client import socket import os import re import io import contextlib from test import support try: import threading except ImportError: threading = None alist = [{'astring': ...
apache-2.0
jnayak1/osf.io
website/security.py
54
2039
# -*- coding: utf-8 -*- """Security utilities.""" # TODO: put in website/utils/ when rubeus circular import issue is resolved import string import gnupg import logging from random import SystemRandom from website import settings random = SystemRandom() logging.getLogger('gnupg').setLevel(logging.WARNING) def rando...
apache-2.0
keithhamilton/blackmaas
lib/python2.7/site-packages/pip/commands/zip.py
393
14821
import sys import re import fnmatch import os import shutil import zipfile from pip.util import display_path, backup_dir, rmtree from pip.log import logger from pip.exceptions import InstallationError from pip.basecommand import Command class ZipCommand(Command): """Zip individual packages.""" name = 'zip' ...
bsd-3-clause
Rudloff/youtube-dl
youtube_dl/extractor/instagram.py
7
7759
from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( get_element_by_attribute, int_or_none, limit_length, lowercase_escape, try_get, ) class InstagramIE(InfoExtractor): _VALID_URL = r'(?P<url>https?://(?:www\.)?instagram\.com/p/(?P<id>[^/?...
unlicense
Mozu/mozu-python-sdk
mozurestsdk/commerce/catalog/admin/attributedefinition/attributes/attributevocabularyvalue.py
1
12229
""" This code was generated by Codezu. Changes to this file may cause incorrect behavior and will be lost if the code is regenerated. """ from mozurestsdk.mozuclient import default as default_client from mozurestsdk.mozuurl import MozuUrl; from mozurestsdk.urllocation import UrlLocation from mozure...
apache-2.0