code stringlengths 2 1.05M | repo_name stringlengths 5 104 | path stringlengths 4 251 | language stringclasses 1
value | license stringclasses 15
values | size int32 2 1.05M |
|---|---|---|---|---|---|
import DVDProject, TitleList, TitleCutter, TitleProperties, ProjectSettings, DVDToolbox, Process
from Screens.Screen import Screen
from Screens.ChoiceBox import ChoiceBox
from Screens.MessageBox import MessageBox
from Screens.HelpMenu import HelpableScreen
from Screens.TaskView import JobView
from Components.Task impor... | athoik/enigma2 | lib/python/Plugins/Extensions/DVDBurn/TitleList.py | Python | gpl-2.0 | 17,688 |
# Copyright (C) 2008-2012 Chris Ball <cjb@laptop.org>
# Gianluca Montecchi <gian@grys.it>
# W. Trevor King <wking@tremily.us>
#
# This file is part of Bugs Everywhere.
#
# Bugs Everywhere is free software: you can redistribute it and/or modify it
# under the terms of the ... | Warbo/bugseverywhere | libbe/command/merge.py | Python | gpl-2.0 | 6,074 |
"""
websocket - WebSocket client library for Python
Copyright (C) 2010 Hiroki Ohtani(liris)
This library 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.1 of the License, ... | gw-sd-2016/Codir | codirSublime/SocketIO/websocket/_app.py | Python | gpl-2.0 | 10,235 |
"""HTML form handling for web clients.
HTML form handling for web clients: useful for parsing HTML forms, filling them
in and returning the completed forms to the server. This code developed from a
port of Gisle Aas' Perl module HTML::Form, from the libwww-perl library, but
the interface is not the same.
The ... | odicraig/kodi2odi | addons/plugin.video.roggerstream-4.0.0/mechanize/_form.py | Python | gpl-3.0 | 124,143 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2012, Red Hat, inc
# Written by Seth Vidal
# based on the mount modules from salt and puppet
# 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
__metacl... | pdellaert/ansible | lib/ansible/modules/system/mount.py | Python | gpl-3.0 | 22,818 |
#from django.core.exceptions import PermissionDenied
#import mock
from django.test import TestCase
from django.core.exceptions import PermissionDenied
from nose.tools import assert_true, assert_false, assert_raises, assert_is_not_none, assert_equal
from sa_api_v2.cors.auth import OriginAuthentication
from sa_api_v2.cor... | codeforsanjose/MobilityMapApi | src/sa_api_v2/cors/tests.py | Python | gpl-3.0 | 9,375 |
# -*- coding: utf-8 -*-
# Copyright(C) 2011 Noé Rubinstein
#
# 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... | blckshrk/Weboob | modules/mangareader/__init__.py | Python | agpl-3.0 | 806 |
"""
Provides full versioning CRUD and representation for collections of xblocks (e.g., courses, modules, etc).
Representation:
* course_index: a dictionary:
** '_id': a unique id which cannot change,
** 'org': the org's id. Only used for searching not identity,
** 'course': the course's catalog number
... | beni55/edx-platform | common/lib/xmodule/xmodule/modulestore/split_mongo/split.py | Python | agpl-3.0 | 146,100 |
##############################################################################
# Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | EmreAtes/spack | var/spack/repos/builtin/packages/r-mda/package.py | Python | lgpl-2.1 | 1,727 |
##############################################################################
# Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | EmreAtes/spack | var/spack/repos/builtin/packages/py-readme-renderer/package.py | Python | lgpl-2.1 | 1,901 |
###############################################################
# Copyright 2020 Lawrence Livermore National Security, LLC
# (c.f. AUTHORS, NOTICE.LLNS, COPYING)
#
# This file is part of the Flux resource manager framework.
# For details, see https://github.com/flux-framework.
#
# SPDX-License-Identifier: LGPL-3.0
####... | garlick/flux-core | t/resource/get-xml-test.py | Python | lgpl-3.0 | 2,102 |
"""
This sample shows how to loop through the folders
and print their titles
Python 2/3
ArcREST version 3.5.x
"""
from __future__ import print_function
from arcrest.security import AGOLTokenSecurityHandler
import arcrest
if __name__ == "__main__":
username = ""#Username
password = ""#password
... | BrunoCaimar/ArcREST | samples/change_folder.py | Python | apache-2.0 | 883 |
from typing import Text
from zerver.lib.test_classes import WebhookTestCase
class HomeAssistantHookTests(WebhookTestCase):
STREAM_NAME = 'homeassistant'
URL_TEMPLATE = "/api/v1/external/homeassistant?&api_key={api_key}"
FIXTURE_DIR_NAME = 'homeassistant'
def test_simplereq(self) -> None:
expe... | mahim97/zulip | zerver/webhooks/homeassistant/tests.py | Python | apache-2.0 | 1,083 |
#!/usr/bin/env python
#
# Copyright 2016 VMware, 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 require... | ashahi1/docker-volume-vsphere | esx_service/utils/vsan_info.py | Python | apache-2.0 | 3,493 |
from PyQt4 import Qt, QtCore, QtGui
import vqt.main as vq_main
import vqt.tree as vq_tree
import envi.threads as e_threads
import cobra.remoteapp as c_remoteapp
import vivisect.remote.server as viv_server
from vqt.basics import *
class WorkspaceListModel(vq_tree.VQTreeModel):
columns = ('Name',)
class Workspac... | imjonsnooow/vivisect | vivisect/qt/remote.py | Python | apache-2.0 | 7,037 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
tools for imr datasets
@author: Chris Mantas
@contact: the1pro@gmail.com
@since: Created on 2016-02-12
@todo: custom formats, break up big lines
@license: http://www.apache.org/licenses/LICENSE-2.0 Apache License
"""
from ast import literal_eval
from collections impor... | project-asap/IReS-Platform | asap-tools/imr-code/imr_workflow_spark/operators/imr_tools.py | Python | apache-2.0 | 5,668 |
#
# 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... | wileeam/airflow | airflow/providers/http/sensors/http.py | Python | apache-2.0 | 4,531 |
from django.conf import settings
from zerver.lib.test_classes import WebhookTestCase
from zerver.models import get_realm, get_system_bot
class HelloWorldHookTests(WebhookTestCase):
STREAM_NAME = "test"
URL_TEMPLATE = "/api/v1/external/helloworld?&api_key={api_key}&stream={stream}"
PM_URL_TEMPLATE = "/api... | rht/zulip | zerver/webhooks/helloworld/tests.py | Python | apache-2.0 | 3,346 |
# 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... | jhseu/tensorflow | tensorflow/python/training/rmsprop.py | Python | apache-2.0 | 10,430 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 Red Hat, Inc.
# 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
#
# ... | cloudbau/glance | glance/openstack/common/gettextutils.py | Python | apache-2.0 | 7,422 |
# -*-*- encoding: utf-8 -*-*-
#
# gateway4labs is free software: you can redistribute it and/or modify
# it under the terms of the BSD 2-Clause License
# gateway4labs is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A P... | labsland/labmanager | labmanager/rlms/ext/rest.py | Python | bsd-2-clause | 9,234 |
import sys
import unittest
from dynd import nd, ndt
import ctypes
# ToDo: Reenable this with a Cython interface.
#
#class TestCTypesDTypeInterop(unittest.TestCase):
# def test_type_from_ctype_typeobject(self):
# self.assertEqual(ndt.int8, ndt.type(ctypes.c_int8))
# self.assertEqual(ndt.int16, ndt.type... | mwiebe/dynd-python | dynd/nd/test/test_ctypes_interop.py | Python | bsd-2-clause | 2,910 |
from sahanaTest import SahanaTest
import unittest, time, re
import copy
class LocationTest(SahanaTest):
"""
Test the locationWidget - This is done using the shelter registry
All tests can assume that they will be logged in with the admin account at the start.
Any test that requires a d... | flavour/ssf | tests/selenium/scripts/locationsTest.py | Python | mit | 13,090 |
# -*- encoding:utf-8 -*-
from __future__ import unicode_literals
MESSAGES = {
"%d min remaining to read": "%d منٹ کا مطالعہ باقی",
"(active)": "(فعال)",
"Also available in:": "ان زبانوں میں بھی دستیاب:",
"Archive": "آرکائیو",
"Categories": "زمرے",
"Comments": "تبصرے",
"LANGUAGE": "اردو",
... | agustinhenze/nikola.debian | nikola/data/themes/base/messages/messages_ur.py | Python | mit | 1,784 |
UP_SQL = """
CREATE TABLE `host_attributes` (
`id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
`host_id` integer NOT NULL,
`attribute` varchar(90) NOT NULL,
`value` varchar(300) NOT NULL,
FOREIGN KEY (host_id) REFERENCES hosts (id),
KEY (attribute)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
"""
D... | joyxu/autotest | database_legacy/migrations/033_add_host_attributes.py | Python | gpl-2.0 | 504 |
# -*- coding: utf-8 -*-
# MySQL Connector/Python - MySQL driver written in Python.
# Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
# MySQL Connector/Python is licensed under the terms of the GPLv2
# <http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>, like most
# MySQL Connectors. Th... | gelab/mainr | tests/cext/test_cext_connection.py | Python | gpl-2.0 | 4,342 |
from UserDict import UserDict
class odict(UserDict):
def __init__(self, dict = None):
self._keys = []
UserDict.__init__(self, dict)
def __delitem__(self, key):
UserDict.__delitem__(self, key)
self._keys.remove(key)
def __setitem__(self, key, item):
UserDict.__setit... | billiob/papyon | papyon/util/odict.py | Python | gpl-2.0 | 1,321 |
from _beale import Beale, BealeSystem
from _booth import Booth, BoothSystem | kjs73/pele | pele/potentials/test_functions/__init__.py | Python | gpl-3.0 | 75 |
# -*- coding: utf-8 -*-
from odoo.addons.account.tests.account_test_classes import AccountingTestCase
import odoo.tests
from odoo import fields
from datetime import datetime
@odoo.tests.tagged('post_install', '-at_install')
class TestFiscalPosition(AccountingTestCase):
def check_compute_fiscal_year(self, compa... | t3dev/odoo | addons/account/tests/test_account_fiscal_year.py | Python | gpl-3.0 | 4,107 |
import zipfile
try:
import zlib
COMPRESSION = zipfile.ZIP_DEFLATED
except:
COMPRESSION = zipfile.ZIP_STORED
try:
from cStringIO import StringIO
except ImportError:
from StringIO import StringIO
from django.core.files.uploadedfile import SimpleUploadedFile
class NotACompressedFile(Exception):
... | rosarior/rua | rua/apps/common/compressed_files.py | Python | gpl-3.0 | 2,263 |
#coding:utf-8
import sys,os
import copy
import re
import itertools
import net
"""basic from web.py: makes web apps (http://webpy.org)"""
__version__ = "0.37"
__author__ = [
"Aaron Swartz <me@aaronsw.com>",
"Anand Chitipothu <anandology@gmail.com>"
]
__license__ = "public domain"
__contributors__ = "see https:... | davislidaqing/Mcoderadius | toughradius/console/libs/pyforms/__init__.py | Python | agpl-3.0 | 12,706 |
"""Test the National Weather Service (NWS) config flow."""
from unittest.mock import patch
import aiohttp
from homeassistant import config_entries
from homeassistant.components.nws.const import DOMAIN
async def test_form(hass, mock_simple_nws_config):
"""Test we get the form."""
hass.config.latitude = 35
... | jawilson/home-assistant | tests/components/nws/test_config_flow.py | Python | apache-2.0 | 3,482 |
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the Li... | dstufft/warehouse | warehouse/migrations/versions/10cb17aea73_default_hosting_mode_to_pypi_only.py | Python | apache-2.0 | 1,098 |
#!/usr/bin/python
#
# Copyright 2015 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by... | davelab6/nototools | nototools/grab_mt_download.py | Python | apache-2.0 | 4,740 |
# Definition for a binary tree node
# class TreeNode:
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
class Solution:
# @param root, a tree node
# @return a boolean
def isSymmetric(self, root):
if root is None:
return True
... | JiaminXuan/leetcode-python | symmetric_tree/solution.py | Python | bsd-2-clause | 891 |
#
# This file is part of pyasn1 software.
#
# Copyright (c) 2005-2017, Ilya Etingof <etingof@gmail.com>
# License: http://snmplabs.com/pyasn1/license.html
#
import logging
from pyasn1 import __version__
from pyasn1 import error
from pyasn1.compat.octets import octs2ints
__all__ = ['Debug', 'setLogger', 'hexdump']
fl... | catapult-project/catapult | third_party/gsutil/third_party/pyasn1/pyasn1/debug.py | Python | bsd-3-clause | 3,361 |
from sqlalchemy_utils import analyze
from tests import TestCase
class TestAnalyzeWithPostgres(TestCase):
dns = 'postgres://postgres@localhost/sqlalchemy_utils_test'
def test_runtime(self):
query = self.session.query(self.Article)
assert analyze(self.connection, query).runtime
def test_no... | cheungpat/sqlalchemy-utils | tests/functions/test_analyze.py | Python | bsd-3-clause | 936 |
"""
predict_actions_cartpole is the cartpole task but where the agent will
get extra reward for saying what its next 5 *actions* will be.
This is a toy problem but the principle is useful -- imagine a household robot
or a self-driving car that accurately tells you what it's going to do before it does it.
This'll inspi... | xpharry/Udacity-DLFoudation | tutorials/reinforcement/gym/gym/envs/safety/predict_actions_cartpole.py | Python | mit | 2,176 |
from __future__ import (absolute_import, division, print_function,
unicode_literals)
from matplotlib.externals import six
import os
import tempfile
import numpy as np
from nose import with_setup
from matplotlib import pyplot as plt
from matplotlib import animation
from matplotlib.testing.nosec... | yuanagain/seniorthesis | venv/lib/python2.7/site-packages/matplotlib/tests/test_animation.py | Python | mit | 2,669 |
#!/usr/bin/python
# Author: Zion Orent <zorent@ics.com>
# Copyright (c) 2015 Intel Corporation.
#
# 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 limi... | sasmita/upm | examples/python/grovegsr.py | Python | mit | 2,008 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2017, Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.0',
... | fernandezcuesta/ansible | lib/ansible/modules/identity/ipa/ipa_group.py | Python | gpl-3.0 | 9,300 |
"""Exceptions used throughout package"""
from __future__ import absolute_import
from itertools import chain, groupby, repeat
from pip._vendor.six import iteritems
from pip._internal.utils.typing import MYPY_CHECK_RUNNING
if MYPY_CHECK_RUNNING:
from typing import Optional # noqa: F401
from pip._internal.req... | Karosuo/Linux_tools | xls_handlers/xls_sum_venv/lib/python3.6/site-packages/pip/_internal/exceptions.py | Python | gpl-3.0 | 9,145 |
"""add private bookmark support to bmarks table
Revision ID: 11087341e403
Revises: 44dccb7b8b82
Create Date: 2014-05-23 07:18:38.743431
"""
# revision identifiers, used by Alembic.
revision = '11087341e403'
down_revision = '44dccb7b8b82'
from alembic import op
import sqlalchemy as sa
def upgrade():
op.add_col... | charany1/Bookie | dbversions/versions/11087341e403_add_private_bookmark_support_to_bmarks_.py | Python | agpl-3.0 | 906 |
# -*- encoding: utf-8 -*-
##############################################################################
# For copyright and license notices, see __openerp__.py file in root directory
##############################################################################
from openerp import fields, models, api
import logging
_... | sysadminmatmoz/ingadhoc | account_journal_book/models/account.py | Python | agpl-3.0 | 1,050 |
# Copyright (c) 2013, Frappe Technologies Pvt. Ltd. and Contributors and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe, json
def execute(filters=None):
data = []
parents = {
"Sales BOM Item": "Sales BOM",
"BOM Explosion Item": "BOM",
"BOM ... | mbauskar/Das_Erpnext | erpnext/stock/report/bom_search/bom_search.py | Python | agpl-3.0 | 1,068 |
# coding=utf-8
"""
Uses /proc/vmstat to collect data on virtual memory manager
#### Dependencies
* /proc/vmstat
"""
import diamond.collector
import os
import re
class VMStatCollector(diamond.collector.Collector):
PROC = '/proc/vmstat'
MAX_VALUES = {
'pgpgin': diamond.collector.MAX_COUNTER,
... | tsheasha/fullerite | src/diamond/collectors/vmstat/vmstat.py | Python | apache-2.0 | 1,796 |
"""
Sensor for UPS packages.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sensor.ups/
"""
from collections import defaultdict
import logging
from datetime import timedelta
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_... | open-homeautomation/home-assistant | homeassistant/components/sensor/ups.py | Python | apache-2.0 | 3,298 |
"""
Support for FRITZ!Box routers.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/device_tracker.fritz/
"""
import logging
from datetime import timedelta
import voluptuous as vol
import homeassistant.helpers.config_validation as cv
from homeassistant.c... | JshWright/home-assistant | homeassistant/components/device_tracker/fritz.py | Python | apache-2.0 | 3,308 |
# Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | KaranToor/MA450 | google-cloud-sdk/lib/googlecloudsdk/core/resource/resource_exceptions.py | Python | apache-2.0 | 1,244 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# no... | Havate/havate-openstack | proto-build/gui/horizon/Horizon_GUI/openstack_dashboard/dashboards/admin/info/views.py | Python | apache-2.0 | 1,045 |
"""Implementation of JSONEncoder
"""
import re
# try:
# from _json import encode_basestring_ascii as c_encode_basestring_ascii
# except ImportError:
# c_encode_basestring_ascii = None
c_encode_basestring_ascii = None
# try:
# from _json import make_encoder as c_make_encoder
# except ImportError:
# c_m... | google/grumpy | third_party/stdlib/json/encoder.py | Python | apache-2.0 | 16,692 |
"""Parse (absolute and relative) URLs.
urlparse module is based upon the following RFC specifications.
RFC 3986 (STD66): "Uniform Resource Identifiers" by T. Berners-Lee, R. Fielding
and L. Masinter, January 2005.
RFC 2732 : "Format for Literal IPv6 Addresses in URL's by R.Hinden, B.Carpenter
and L.Masinter, Decemb... | google/grumpy | third_party/stdlib/urlparse.py | Python | apache-2.0 | 19,619 |
#
# 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... | jbonofre/beam | sdks/python/apache_beam/runners/worker/statesampler_fake.py | Python | apache-2.0 | 1,339 |
# Copyright (c) 2012, Willow Garage, 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 cond... | sorki/rosdep | test/test_rosdep_gbpdistro_support.py | Python | bsd-3-clause | 8,987 |
# Authors: Eric Larson <larson.eric.d@gmail.com>
# Federico Raimondo <federaimondo@gmail.com>
#
# License: BSD-3-Clause
import os.path as op
from ..base import BaseRaw
from ..utils import _read_segments_file, _file_size
from ..meas_info import create_info
from ...utils import logger, verbose, warn, fill_doc,... | bloyl/mne-python | mne/io/eximia/eximia.py | Python | bsd-3-clause | 3,000 |
from django.db import connection
from django.contrib.gis.gdal import HAS_GDAL
from django.contrib.gis.tests.utils import (no_mysql, oracle, postgis,
spatialite, HAS_SPATIALREFSYS, SpatialRefSys)
from django.utils import unittest
test_srs = ({'srid' : 4326,
'auth_name' : ('EPSG', True),
'... | rebost/django | django/contrib/gis/tests/test_spatialrefsys.py | Python | bsd-3-clause | 6,715 |
import unittest
from unittest import mock
from migrations.test_base import OperationTestBase
from django.db import NotSupportedError, connection
from django.db.migrations.state import ProjectState
from django.db.models import Index
from django.db.utils import ProgrammingError
from django.test import modify_settings, ... | elena/django | tests/postgres_tests/test_operations.py | Python | bsd-3-clause | 19,320 |
from sympy import symbols
from sympy.physics.mechanics import *
# -- Declare symbols.
# Declare degrees of freedom, and their time derivatives.
# TODO get rid of those which are unnecessary.
qA, qB, uA, uB = dynamicsymbols('qA qB uA uB')
qAd, qBd, uAd, uBd = dynamicsymbols('qA qB uA uB', 1)
# Declare the constants i... | Shekharrajak/pydy | examples/babyboot/babyboot.py | Python | bsd-3-clause | 2,234 |
#!/usr/bin/python
# Python library for ADXL345 accelerometer.
# Copyright 2013 Adafruit Industries
# 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... | cmuphyscomp/physcomp-examples | support/rpi/Adafruit-Raspberry-Pi-Python-Code-master/Adafruit_ADXL345/Adafruit_ADXL345.py | Python | bsd-3-clause | 3,978 |
import getpass
from distutils import log
from distutils.command import upload as orig
class upload(orig.upload):
"""
Override default upload behavior to obtain password
in a variety of different ways.
"""
def run(self):
try:
orig.upload.run(self)
finally:
s... | astaninger/speakout | venv/lib/python3.6/site-packages/setuptools/command/upload.py | Python | mit | 1,493 |
from src.platform.weblogic.interfaces import WINTERFACES, WLConsole
class FPrint(WLConsole):
""" WebLogic 10 is bugged when using Oracle's custom implementation of SSL.
Only if the default Java implementation is set will this work; otherwise,
Oracle sends an SSL23_GET_SERVER_HELLO and breaks OpenSSL.
... | GHubgenius/clusterd | src/platform/weblogic/fingerprints/WL10s.py | Python | mit | 510 |
import logging
from autotest.client.shared import utils, error
from virttest import virsh, virt_vm
from virttest.libvirt_xml import vm_xml
def run(test, params, env):
"""
Test command: virsh setmaxmem.
1) Prepare vm environment.
2) Handle params
3) Run test command and get vm started then get max... | PandaWei/tp-libvirt | libvirt/tests/src/virsh_cmd/domain/virsh_setmaxmem.py | Python | gpl-2.0 | 7,485 |
# -*- coding: utf-8 -*-
"""
***************************************************************************
FindProjection.py
-----------------
Date : February 2017
Copyright : (C) 2017 by Nyall Dawson
Email : nyall dot dawson at gmail dot com
*****************... | SrNetoChan/QGIS | python/plugins/processing/algs/qgis/FindProjection.py | Python | gpl-2.0 | 6,023 |
# Author: Nic Wolfe <nic@wolfeden.ca>
# URL: http://code.google.com/p/sickbeard/
#
# This file is part of Sick Beard.
#
# Sick Beard 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... | VoiDeD/Sick-Beard | sickbeard/processTV.py | Python | gpl-3.0 | 9,409 |
# 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/.
from __future__ import print_function, unicode_literals
import os
import platform
import sys
from distutils.spawn impor... | dsandeephegde/servo | python/mach_bootstrap.py | Python | mpl-2.0 | 9,878 |
from __future__ import unicode_literals
import re
import binascii
try:
from Crypto.Cipher import AES
can_decrypt_frag = True
except ImportError:
can_decrypt_frag = False
from .fragment import FragmentFD
from .external import FFmpegFD
from ..compat import (
compat_urllib_error,
compat_urlparse,
... | longman694/youtube-dl | youtube_dl/downloader/hls.py | Python | unlicense | 8,443 |
#!/usr/bin/env python
# Copyright 2014, Rackspace US, 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... | achekunov/openstack-ansible | playbooks/inventory/dynamic_inventory.py | Python | apache-2.0 | 36,744 |
# Copyright 2012 NTT Data. All Rights Reserved.
# Copyright 2012 Yahoo! 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/li... | hanlind/nova | nova/tests/unit/virt/libvirt/storage/test_lvm.py | Python | apache-2.0 | 8,203 |
import json
from .utils import getResponseBody
def assertStatus(response, code):
"""
Call this to assert that a given HTTP status code was returned.
:param response: The response object.
:param code: The status code.
:type code: int or str
"""
# Hide tracebacks for this function within p... | Xarthisius/girder | pytest_girder/pytest_girder/assertions.py | Python | apache-2.0 | 1,022 |
"""Test the Z-Wave JS siren platform."""
from zwave_js_server.event import Event
from homeassistant.components.siren import ATTR_TONE, ATTR_VOLUME_LEVEL
from homeassistant.components.siren.const import ATTR_AVAILABLE_TONES
from homeassistant.const import STATE_OFF, STATE_ON
SIREN_ENTITY = "siren.indoor_siren_6_2"
TO... | lukas-hetzenecker/home-assistant | tests/components/zwave_js/test_siren.py | Python | apache-2.0 | 6,133 |
#!/usr/bin/env python3
# Optimizer calibration test for bitmap and brin indexes, also btree on AO tables
#
# This program runs a set of queries, varying several parameters:
#
# - Selectivity of predicates
# - Plan type (plan chosen by the optimizer, various forced plans)
# - Width of the selected columns
#
# The progr... | 50wu/gpdb | src/backend/gporca/scripts/cal_bitmap_test.py | Python | apache-2.0 | 70,529 |
"""
This module contains the interface for graphlab server, and the
implementation of a local graphlab server.
"""
'''
Copyright (C) 2015 Dato, Inc.
All rights reserved.
This software may be modified and distributed under the terms
of the BSD license. See the LICENSE file for details.
'''
from ..cython.cy_ipc import... | jasonyaw/SFrame | oss_src/unity/python/sframe/connect/server.py | Python | bsd-3-clause | 11,681 |
#!/usr/bin/env python
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
"""
=================
fMRI: FEEDS - FSL
=================
A pipeline example that data from the FSL FEEDS set. Single subject, two
stimuli.
You can find it at http://www.fmrib.ox.ac.... | pearsonlab/nipype | examples/fmri_fsl_feeds.py | Python | bsd-3-clause | 5,653 |
"""
homeassistant.components.light.demo
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Demo platform that implements lights.
"""
import random
from homeassistant.components.light import (
Light, ATTR_BRIGHTNESS, ATTR_XY_COLOR)
LIGHT_COLORS = [
[0.861, 0.3259],
[0.6389, 0.3028],
[0.1684, 0.0416]
]
def setup_... | michaelarnauts/home-assistant | homeassistant/components/light/demo.py | Python | mit | 1,834 |
from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers
import pybindgen.settings
import warnings
class ErrorHandler(pybindgen.settings.ErrorHandler):
def handle_error(self, wrapper, exception, traceback_):
warnings.warn("exception %r in wrapper %s" % (exception, wrapper))
... | dtaht/ns-3-dev | src/flow-monitor/bindings/modulegen__gcc_LP64.py | Python | gpl-2.0 | 411,996 |
# -*- 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... | Johnzero/erp | openerp/addons/membership/report/report_membership.py | Python | agpl-3.0 | 6,097 |
import unittest, time, sys, random
sys.path.extend(['.','..','../..','py'])
import h2o, h2o_cmd, h2o_browse as h2b, h2o_import as h2i
class Basic(unittest.TestCase):
def tearDown(self):
h2o.check_sandbox_for_errors()
@classmethod
def setUpClass(cls):
h2o.init(3, use_hdfs=True, hdfs_version... | h2oai/h2o | py/testdir_0xdata_only/test_from_hdfs_hosts.py | Python | apache-2.0 | 2,900 |
# Copyright 2010 The Go Authors. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
"""GDB Pretty printers and convenience functions for Go's runtime structures.
This script is loaded by GDB when it finds a .debug_gdb_scripts
section in the compi... | dsriram/golang | src/pkg/runtime/runtime-gdb.py | Python | bsd-3-clause | 11,121 |
import numpy as np
from scipy.optimize import linear_sum_assignment
from ...utils.validation import check_consistent_length, check_array
__all__ = ["consensus_score"]
def _check_rows_and_columns(a, b):
"""Unpacks the row and column arrays and checks their shape."""
check_consistent_length(*a)
check_cons... | chrsrds/scikit-learn | sklearn/metrics/cluster/bicluster.py | Python | bsd-3-clause | 2,762 |
"""
This is a basic model to test saving and loading boolean and date-related
types, which in the past were problematic for some database backends.
"""
from django.db import models
class Donut(models.Model):
name = models.CharField(max_length=100)
is_frosted = models.BooleanField(default=False)
has_sprin... | theo-l/django | tests/datatypes/models.py | Python | bsd-3-clause | 779 |
# Written by Bram Cohen
# see LICENSE.txt for license information
from BitTornado.bitfield import Bitfield
from sha import sha
from BitTornado.clock import clock
from traceback import print_exc
from random import randrange
try:
True
except:
True = 1
False = 0
try:
from bisect import insort
except:
... | gratbrav/torrentbug | src/TF_BitTornado/BitTornado/BT1/StorageWrapper.py | Python | mit | 37,256 |
import os
def create_fds():
(fd1, fd2) = os.pipe()
return (os.fdopen(fd2, "w"), os.fdopen(fd1, "r"))
def filename(pipef):
return 'pipe:[%d]' % os.fstat(pipef.fileno()).st_ino
def dump_opts(sockf):
return [ ]
| ldu4/criu | test/inhfd/pipe.py | Python | lgpl-2.1 | 215 |
# Copyright 2014 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... | askdaddy/PerfKitBenchmarker | tests/benchmark_sets_test.py | Python | apache-2.0 | 6,976 |
from SimpleCV.base import *
from SimpleCV.ImageClass import Image, ImageSet
from SimpleCV.DrawingLayer import *
from SimpleCV.Features import FeatureExtractorBase
"""
This class is encapsulates almost everything needed to train, test, and deploy a
multiclass k-nearest neighbors image classifier. Training data should
be... | nils-werner/SimpleCV | SimpleCV/MachineLearning/KNNClassifier.py | Python | bsd-3-clause | 15,965 |
# Copyright 2019 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 __future__ import print_function
import argparse
import json
import logging
import os
import shutil
import subprocess
import sys
import tempfile
TOOLS... | scheib/chromium | tools/perf/experimental/story_clustering/gather_historical_records_and_cluster_stories.py | Python | bsd-3-clause | 5,390 |
# Test 32-bit COMPARE AND BRANCH in cases where the sheer number of
# instructions causes some branches to be out of range.
# RUN: python %s | llc -mtriple=s390x-linux-gnu | FileCheck %s
# Construct:
#
# before0:
# conditional branch to after0
# ...
# beforeN:
# conditional branch to after0
# main:
# 0xffcc by... | santoshn/softboundcets-34 | softboundcets-llvm-clang34/test/CodeGen/SystemZ/Large/branch-range-03.py | Python | bsd-3-clause | 3,453 |
# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from ...testing import assert_equal
from ..meshfix import MeshFix
def test_MeshFix_inputs():
input_map = dict(args=dict(argstr='%s',
),
cut_inner=dict(argstr='--cut-inner %d',
),
cut_outer=dict(argstr='--cut-outer %d',
),
decouple_inin=... | sgiavasis/nipype | nipype/interfaces/tests/test_auto_MeshFix.py | Python | bsd-3-clause | 3,030 |
import os.path
import re
import shutil
import sys
import tempfile
import zipfile
from distutils import dist
from glob import iglob
from ..bdist_wheel import bdist_wheel
from ..wheelfile import WheelFile
from . import WheelError, require_pkgresources
egg_info_re = re.compile(r'''
(?P<name>.+?)-(?P<ver>.+?)
(-(... | Karosuo/Linux_tools | xls_handlers/xls_sum_venv/lib/python3.6/site-packages/wheel/cli/convert.py | Python | gpl-3.0 | 9,497 |
# -*- coding: utf-8 -*-
#
# Copyright: (c) 2018, F5 Networks Inc.
# GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
import json
import pytest
import sys
if sys.version_info < (2... | helldorado/ansible | test/units/modules/network/f5/test_bigiq_device_facts.py | Python | gpl-3.0 | 3,123 |
"""Add search tokens.
Revision ID: 482338e7a7d6
Revises: 41a7e825d108
Create Date: 2014-03-18 00:16:49.525732
"""
# revision identifiers, used by Alembic.
revision = '482338e7a7d6'
down_revision = 'adc646e1f11'
from alembic import op
import sqlalchemy as sa
def upgrade():
op.create_table(
'searchtoken... | EthanBlackburn/sync-engine | migrations/versions/006_add_search_tokens.py | Python | agpl-3.0 | 797 |
#
# 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... | WindCanDie/spark | python/pyspark/tests/test_util.py | Python | apache-2.0 | 3,052 |
# stdlib
import array
from collections import defaultdict
import fcntl
import itertools
import os
import struct
# 3rd party
import psutil
# project
from checks import AgentCheck
MIXED = "mixed"
DATA = "data"
METADATA = "metadata"
SYSTEM = "system"
SINGLE = "single"
RAID0 = "raid0"
RAID1 = "raid1"
RAID10 = "raid10"
D... | GabrielNicolasAvellaneda/dd-agent | checks.d/btrfs.py | Python | bsd-3-clause | 4,277 |
""" Python Character Mapping Codec cp424 generated from 'MAPPINGS/VENDORS/MISC/CP424.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_table)
def decode(self,input,errors='... | Microvellum/Fluid-Designer | win64-vc/2.78/python/lib/encodings/cp424.py | Python | gpl-3.0 | 12,055 |
#!/usr/bin/env python3
# -*- mode: python -*-
# Re test suite and benchmark suite v1.5
# The 3 possible outcomes for each pattern
[SUCCEED, FAIL, SYNTAX_ERROR] = range(3)
# Benchmark suite (needs expansion)
#
# The benchmark suite does not test correctness, just speed. The
# first element of each tuple is the regex... | michalliu/OpenWrt-Firefly-Libraries | staging_dir/target-mipsel_1004kc+dsp_uClibc-0.9.33.2/usr/lib/python3.4/test/re_tests.py | Python | gpl-2.0 | 31,794 |
#!/usr/bin/env python
#
# Copyright 2006,2010 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your opt... | owaiskhan/Retransmission-Combining | gnuradio-examples/python/network/vector_source.py | Python | gpl-3.0 | 2,271 |
"""High level functions for working with SSH."""
from __future__ import annotations
import dataclasses
import json
import os
import random
import re
import subprocess
import shlex
import typing as t
from .encoding import (
to_bytes,
to_text,
)
from .util import (
ApplicationError,
common_environment,... | nitzmahone/ansible | test/lib/ansible_test/_internal/ssh.py | Python | gpl-3.0 | 8,503 |
import syslog
from DIRAC import gLogger, gConfig
from DIRAC.Core.DISET.RPCClient import RPCClient
from DIRAC.Core.Utilities import Time
from DIRAC.Core.Utilities.ThreadScheduler import gThreadScheduler
class SecurityLogClient:
__securityLogStore = []
def __init__( self ):
self.__messagesList = []
self._... | Sbalbp/DIRAC | FrameworkSystem/Client/SecurityLogClient.py | Python | gpl-3.0 | 2,116 |
"""Tests for the litejet component."""
from homeassistant.components import scene, switch
from homeassistant.components.litejet import DOMAIN
from homeassistant.const import CONF_PORT
from homeassistant.helpers import entity_registry as er
from tests.common import MockConfigEntry
async def async_init_integration(
... | jawilson/home-assistant | tests/components/litejet/__init__.py | Python | apache-2.0 | 1,438 |
from lib.softlayer import SoftlayerBaseAction
class SoftlayerCreateInstance(SoftlayerBaseAction):
def run(self, name, datacenter, os="DEBIAN_LATEST", domain="example.com", cpus=1, ram=2048,
disk=100, bandwidth=10, local_disk=True, keyname=None):
driver = self._get_driver()
# build the ... | meirwah/st2contrib | packs/softlayer/actions/create_instance.py | Python | apache-2.0 | 1,208 |
# -*- coding: utf-8 -*-
import unittest
"""
Tests that ElementMaker works properly.
"""
import sys, os.path
from lxml import etree
from lxml.builder import E
this_dir = os.path.dirname(__file__)
if this_dir not in sys.path:
sys.path.insert(0, this_dir) # needed for Py3
from common_imports import HelperTestCase,... | cloudera/hue | desktop/core/ext-py/lxml-3.3.6/src/lxml/tests/test_builder.py | Python | apache-2.0 | 954 |