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 |
|---|---|---|---|---|---|
#!/usr/bin/python -tt
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that i... | rpm-software-management/yum-utils | verifytree.py | Python | gpl-2.0 | 11,046 |
# -*- coding: utf-8 -*-
#!/usr/bin/python
#
# This is derived from a cadquery script for generating PDIP models in X3D format
#
# from https://bitbucket.org/hyOzd/freecad-macros
# author hyOzd
# This is a
# Dimensions are from Microchips Packaging Specification document:
# DS00000049BY. Body drawing is the same as QFP ... | easyw/kicad-3d-models-in-freecad | cadquery/FCAD_script_generator/Fuse/main_generator.py | Python | gpl-2.0 | 8,654 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#-----------------------------------------------------------------------#
# #
# This file is part of the Horus Project #
# ... | javivi001/horus | src/horus/engine/board.py | Python | gpl-2.0 | 7,274 |
# -- coding: utf-8 --
# ===========================================================================
# eXe
# Copyright 2010-2011, Pedro Peña Pérez
#
# 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 Foundatio... | exelearning/iteexe | exe/importers/scanresources.py | Python | gpl-2.0 | 19,859 |
"""Testing code for the tupa.features package, unit-testing only."""
import os
from collections import OrderedDict
import pytest
from ucca import textutil
from tupa.action import Actions
from tupa.features.dense_features import DenseFeatureExtractor
from tupa.features.sparse_features import SparseFeatureExtractor
fro... | danielhers/tupa | tests/test_features.py | Python | gpl-3.0 | 5,494 |
"""This application provides a framework for disqualifying users for various
reasons, as well as simple modeling of any custom disqualification.
"""
| papedaniel/oioioi | oioioi/disqualification/__init__.py | Python | gpl-3.0 | 149 |
# coding=utf-8
# Author: Nic Wolfe <nic@wolfeden.ca>
#
# URL: https://sickrage.github.io
#
# This file is part of SickRage.
#
# SickRage is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the ... | Jusedawg/SickRage | sickbeard/classes.py | Python | gpl-3.0 | 8,125 |
from namespace_class import *
try:
p = Private1()
error = 1
except:
error = 0
if (error):
raise RuntimeError, "Private1 is private"
try:
p = Private2()
error = 1
except:
error = 0
if (error):
raise RuntimeError, "Private2 is private"
EulerT3D.toFrame(1,1,1)
b = BooT_i()
b = BooT_H()
f = FooT_i()... | jrversteegh/softsailor | deps/swig-2.0.4/Examples/test-suite/python/namespace_class_runme.py | Python | gpl-3.0 | 379 |
# -*- encoding: utf-8 -*-
"""Test class for Users UI
:Requirement: User
:CaseAutomation: Automated
:CaseLevel: Acceptance
:CaseComponent: UI
:TestType: Functional
:CaseImportance: High
:Upstream: No
"""
import random
from fauxfactory import gen_string
from nailgun import entities
from robottelo import ssh
from ... | ares/robottelo | tests/foreman/ui/test_user.py | Python | gpl-3.0 | 61,539 |
# System imports
import itertools
import concurrent.futures
# Third party imports
import requests
class Client:
"""
Used for sending commands to one or more IDA containers over HTTP.
"""
def __init__(self, urls):
"""
>>> client = Client(['http://host-1:4001', 'http://host-2:4001'])
... | intezer/docker-ida | ida_client/ida_client.py | Python | gpl-3.0 | 2,196 |
import os
import sys
import math
import errno
import subprocess
import tkMessageBox
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
import matplotlib.animation as animation
from PIL import Image
from matplotlib import style
from datetime import datetime
from matplotlib.widgets import RadioBu... | RyanChinSang/LeagueLatency | History/Raw/v2.2a Stable/LL.py | Python | gpl-3.0 | 21,253 |
#!/usr/bin/env python3
# -*- mode:python; tab-width:4; c-basic-offset:4; intent-tabs-mode:nil; -*-
# ex: filetype=python tabstop=4 softtabstop=4 shiftwidth=4 expandtab autoindent smartindent
#
# Universal Password Changer (UPwdChg)
# Copyright (C) 2014-2018 Cedric Dufour <http://cedric.dufour.name>
# Author: Cedric Du... | alex-dot/upwdchg | tests/python-tokenreader-test.py | Python | gpl-3.0 | 7,822 |
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have purchased from
# Numenta, Inc. a separate commercial license for this software code, the
# following terms and conditions apply:
#
# This pro... | tkaitchuck/nupic | examples/opf/experiments/spatial_classification/base/description.py | Python | gpl-3.0 | 14,847 |
../../../../../share/pyshared/twisted/test/test_usage.py | Alberto-Beralix/Beralix | i386-squashfs-root/usr/lib/python2.7/dist-packages/twisted/test/test_usage.py | Python | gpl-3.0 | 56 |
from .solvers import pack_vectors
| marklee77/vpack | vectorpack/openopt/__init__.py | Python | gpl-3.0 | 34 |
# -*- coding: utf-8 -*-
# diceware_list -- generate wordlists for diceware
# Copyright (C) 2016-2019. Uli Fouquet
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the ... | ulif/wordlist-gen | tests/test_libwordlist.py | Python | gpl-3.0 | 27,107 |
# Authors:
# Jan Cholasta <jcholast@redhat.com>
#
# Copyright (C) 2014 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 v... | realsobek/freeipa | ipalib/install/certstore.py | Python | gpl-3.0 | 15,409 |
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2018-2021 Jay Kamat <jaygkamat@gmail.com>
#
# This file is part of qutebrowser.
#
# qutebrowser 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, e... | fiete201/qutebrowser | qutebrowser/config/configcache.py | Python | gpl-3.0 | 1,820 |
import unittest
from golem.network.p2p.node import Node
def is_ip_address(address):
"""
Check if @address is correct IP address
:param address: Address to be checked
:return: True if is correct, false otherwise
"""
from ipaddress import ip_address, AddressValueError
try:
# will rai... | Radagast-red/golem | tests/golem/network/p2p/test_node.py | Python | gpl-3.0 | 1,163 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.6 on 2018-05-02 08:34
from __future__ import unicode_literals
import dirtyfields.dirtyfields
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.db.models.manager
class Migration(migrations.Migrati... | BartDeCaluwe/925r | ninetofiver/migrations/0072_auto_20180502_0834.py | Python | gpl-3.0 | 2,929 |
# -*- coding: utf-8 -*-
#########################################################################
#
# Copyright (C) 2012 OpenPlans
#
# 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 versio... | AnnalisaS/migration_geonode | geonode/layers/models.py | Python | gpl-3.0 | 29,589 |
# Django Imports
from django.db.models.signals import post_save
from django.dispatch import receiver
# Python Imports
from logging import getLogger
# Local Imports
from .models import Person, PersonAttribute, PersonIdentifier, PersonIdentifierAttribute, GroupIdentifier, \
GroupIdentifierAttribute
# Logging
logger ... | alzeih/ava | ava_core/organize/signals.py | Python | gpl-3.0 | 1,780 |
# -*- coding: utf-8 -*-
# from django.contrib import admin
# from tribus.web.cloud.models import *
# class PaqueteAlin(admin.TabularInline):
# model = Paquete
# extra = 0
#
# class AdminMantenedor(admin.ModelAdmin):
# fieldsets = (
# ('Nombre del mantenedor', {
# 'classes': ('wide', 'extrap... | LuisAlejandro/tribus | tribus/web/cloud/admin.py | Python | gpl-3.0 | 1,893 |
import IMP
import IMP.test
import IMP.core
class Tests(IMP.test.TestCase):
"""Tests copying derivatives to and from refined"""
def _create_particle(self, m, ks):
p = IMP.Particle(m)
for k in ks:
p.add_attribute(k, 0.0)
return p
def _setup(self):
k0 = IMP.Floa... | shanot/imp | modules/core/test/test_to_from_refined.py | Python | gpl-3.0 | 2,150 |
#! /usr/bin/env python
'''Tests rendering using shader objects from core GL or extensions
Uses the:
Lighthouse 3D Tutorial toon shader
http://www.lighthouse3d.com/opengl/glsl/index.php?toon2
By way of:
http://www.pygame.org/wiki/GLSLExample
'''
import OpenGL
OpenGL.ERROR_ON_COPY = True
from OpenGL.G... | mgood7123/UPM | Sources/PyOpenGL-Demo-3.0.1b1/PyOpenGL-Demo/GLUT/shader_test.py | Python | gpl-3.0 | 5,525 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2017, Bruno Calogero <brunocalogero@hotmail.com>
# 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_... | tima/ansible | lib/ansible/modules/network/aci/aci_interface_policy_leaf_policy_group.py | Python | gpl-3.0 | 15,589 |
from typing import List
class NamedList:
"""A contaner class for storing a list of named integers."""
def __init__(self, names: List[str], values: List[int]) -> None:
self._names = names
self._values = values
def __getitem__(self, name: str) -> int:
idx = self._names.index(name)
... | pyta-uoft/pyta | examples/pylint/e1138_unsupported_delete_operation.py | Python | gpl-3.0 | 595 |
#!/usr/bin/env python2
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
__license__ = 'GPL v3'
__copyright__ = '2010, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
import os
from PyQt5.Qt import Qt, QVBoxLayout, QFormLayout
from calibre.gui2.preferences import ConfigWidgetBase, test_... | jelly/calibre | src/calibre/gui2/preferences/adding.py | Python | gpl-3.0 | 8,073 |
"""Unit tests for stats.cache module."""
# -----------------------------------------------------------------------------
# Imports
# -----------------------------------------------------------------------------
from nose.tools import raises
import numpy as np
from klustaviewa.stats.indexed_matrix import Index... | DavidTingley/ephys-processing-pipeline | installation/klustaviewa-0.3.0/klustaviewa/stats/tests/test_indexed_matrix.py | Python | gpl-3.0 | 7,015 |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# filename: tops_sql.py
# Copyright 2008-2010 Stefano Costa <steko@iosa.it>
#
# This file is part of Total Open Station.
#
# Total Open Station is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by ... | BackupTheBerlios/tops | totalopenstation/output/tops_sql.py | Python | gpl-3.0 | 2,442 |
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have purchased from
# Numenta, Inc. a separate commercial license for this software code, the
# following terms and conditions apply:
#
# This pro... | tkaitchuck/nupic | py/nupic/frameworks/opf/two_gram_model.py | Python | gpl-3.0 | 6,948 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2017 Joshua Charles Campbell
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your o... | orezpraw/partycrasher | partycrasher/config_loader.py | Python | gpl-3.0 | 1,971 |
#!/usr/bin/env python
# ***** BEGIN LICENSE BLOCK *****
# 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/.
# ***** END LICENSE BLOCK *****
import os
import re
from mozhar... | simar7/build-mozharness | mozharness/mozilla/testing/unittest.py | Python | mpl-2.0 | 11,491 |
#!/usr/bin/env python
import os
import sys
sys.path.insert(
0,
os.path.join(
os.path.dirname(os.path.abspath(__file__)), '..', '..', '..', 'common',
'security-features', 'tools'))
import generate
class ReferrerPolicyConfig(object):
def __init__(self):
self.selection_pattern = \
... | notriddle/servo | tests/wpt/web-platform-tests/referrer-policy/generic/tools/generate.py | Python | mpl-2.0 | 1,383 |
#!/usr/bin/env python
#
#
# Copyright (C) 2014 Sascha Rommelfangen, Raphael Vinot
# Copyright (C) 2014 CIRCL Computer Incident Response Center Luxembourg (SMILE gie)
#
from datetime import date
import json
import redis
try:
from urllib.parse import quote
except ImportError:
from urllib import quote
from pyfau... | xujun10110/url-abuse | url_abuse_async.py | Python | agpl-3.0 | 14,884 |
# -*- coding: utf-8 -*-
# This file is part of wger Workout Manager.
#
# wger Workout Manager 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 option) any ... | DeveloperMal/wger | wger/gym/managers.py | Python | agpl-3.0 | 2,069 |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# OpenFisca -- A versatile microsimulation software
# By: OpenFisca Team <contact@openfisca.fr>
#
# Copyright (C) 2011, 2012, 2013, 2014, 2015 OpenFisca Team
# https://github.com/openfisca
#
# This file is part of OpenFisca.
#
# OpenFisca is free software; you can redist... | adrienpacifico/openfisca-france-data | openfisca_france_data/debugger.py | Python | agpl-3.0 | 20,788 |
# Copyright (c) 2001-2015, Canal TP and/or its affiliates. All rights reserved.
#
# This file is part of Navitia,
# the software to build cool stuff with public transport.
#
# Hope you'll enjoy and contribute to this project,
# powered by Canal TP (www.canaltp.fr).
# Help us simplify mobility and open public tr... | pbougue/navitia | source/eitri/ed_handler.py | Python | agpl-3.0 | 6,071 |
from functools import wraps
from flask import current_app, request
from flask_sitemap import Sitemap, sitemap_page_needed
from udata.app import cache
sitemap = Sitemap()
CACHE_KEY = 'sitemap-page-{0}'
@sitemap_page_needed.connect
def create_page(app, page, urlset):
key = CACHE_KEY.format(page)
cache.set(k... | opendatateam/udata | udata/sitemap.py | Python | agpl-3.0 | 977 |
import logging
logging.warning('This module is deprecated. Use '
'`coalib.testing.BearTestHelper` instead.')
from coalib.testing.BearTestHelper import *
| sounak98/coala-bears | tests/BearTestHelper.py | Python | agpl-3.0 | 171 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
############################################################################
#
# MODULE: tr3.unregister
# AUTHOR(S): Soeren Gebbert
#
# PURPOSE: Unregister raster3d maps from space time raster3d datasets
# COPYRIGHT: (C) 2011 by the GRASS Development Team
#
#... | AsherBond/MondocosmOS | grass_trunk/temporal/tr3.unregister/tr3.unregister.py | Python | agpl-3.0 | 1,642 |
import ipaddress
import docker.types
def init():
pass
def get_next_cidr(client):
networks = client.networks.list()
last_cidr = ipaddress.ip_network("10.0.0.0/24")
for network in networks:
if (network.attrs["IPAM"] and network.attrs["IPAM"]["Config"]
and len(network.attrs["IPA... | puffinrocks/puffin | puffin/core/network.py | Python | agpl-3.0 | 1,606 |
# Create your views here.
import random
import json
import hashlib
import smtplib
from django.shortcuts import render_to_response, get_object_or_404
from django.conf import settings
from django.template import RequestContext
from django.contrib.auth.models import User
from django.contrib import messages
from django.h... | yohanboniface/memopol-core | memopol/campaign/views.py | Python | agpl-3.0 | 8,612 |
#####################################################################################
#
# Copyright (C) Tavendo GmbH
#
# Unless a separate license agreement exists between you and Tavendo GmbH (e.g. you
# have purchased a commercial license), the license terms below apply.
#
# Should you enter into a separate licen... | w1z2g3/crossbar | crossbar/controller/test/test_cli.py | Python | agpl-3.0 | 10,540 |
# -*- coding: utf-8 -*-
# Copyright (c) 2012-2016 CoNWeT Lab., Universidad Politécnica de Madrid
# This file is part of Wirecloud.
# Wirecloud 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 v... | rockneurotiko/wirecloud | src/wirecloud/platform/wiring/views.py | Python | agpl-3.0 | 6,563 |
# © 2014-2015 Tecnativa S.L. - Jairo Llopis
# © 2016 Tecnativa S.L. - Vicent Cubells
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from odoo import fields, models
class ResPartner(models.Model):
_inherit = "res.partner"
department_id = fields.Many2one("res.partner.department", "Depar... | OCA/partner-contact | partner_contact_department/models/res_partner.py | Python | agpl-3.0 | 839 |
#! /usr/bin/python3
# This simulates the org.freedesktop.UDisks.Encrypted.Slots property
# et al for versions of UDisks that don't have them yet.
import sys
import json
import subprocess
import re
import base64
import signal
import atexit
import os
def b64_decode(data):
# The data we get doesn't seem to have any... | moraleslazaro/cockpit | pkg/storaged/luksmeta-monitor-hack.py | Python | lgpl-2.1 | 5,420 |
##############################################################################
# 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... | krafczyk/spack | var/spack/repos/builtin/packages/picard/package.py | Python | lgpl-2.1 | 4,400 |
import os
import sys
import time
from django.db import models
'''
@author: lbergesio,omoya,CarolinaFernandez
@organization: i2CAT, OFELIA FP7
Django RuleTable Model class
'''
#Django is required to run this model
class PolicyRuleTableModel(models.Model):
class Meta:
"""Rul... | fp7-ofelia/pypelib | src/pypelib/persistence/backends/django/RuleTableModel.py | Python | lgpl-3.0 | 1,069 |
# 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 ... | wrigri/libcloud | libcloud/common/openstack_identity.py | Python | apache-2.0 | 48,080 |
# -*- coding: utf-8 -*-
#
# Copyright 2017 Ricequant, 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 ... | xclxxl414/rqalpha | rqalpha/utils/package_helper.py | Python | apache-2.0 | 953 |
# Copyright (c) 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 agreed to... | mahak/neutron | neutron/plugins/ml2/drivers/openvswitch/agent/common/constants.py | Python | apache-2.0 | 6,043 |
from __future__ import absolute_import, division, print_function, unicode_literals
CASH_TRANSACTION_TYPES = {'Cashflow', 'Coupon', 'Dividend', 'Payment'}
TRANSACTION_TYPES = {'Allocation', 'Block', 'Exercise', 'Expiry', 'Journal', 'Maturity', 'Net',
'Novation', 'Split', 'Trade', 'Transfer'} | CASH... | nedlowe/amaas-core-sdk-python | amaascore/transactions/enums.py | Python | apache-2.0 | 767 |
# coding: utf-8
"""
OpenAPI spec version:
Generated by: https://github.com/swagger-api/swagger-codegen.git
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
... | detiber/lib_openshift | lib_openshift/models/v1beta1_replica_set_spec.py | Python | apache-2.0 | 6,193 |
# 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... | GabrielBrascher/cloudstack | systemvm/debian/opt/cloud/bin/cs/__init__.py | Python | apache-2.0 | 1,000 |
# -*- coding: utf-8 -*-
'''
Created on Apr 27, 2016
@author: Aaron Ponti
'''
from ch.systemsx.cisd.openbis.dss.etl.dto.api.impl import MaximumIntensityProjectionGenerationAlgorithm
class GenericTIFFSeriesMaximumIntensityProjectionGenerationAlgorithm(MaximumIntensityProjectionGenerationAlgorithm):
'''
Custo... | aarpon/obit_microscopy_core_technology | core-plugins/microscopy/3/dss/drop-boxes/MicroscopyDropbox/GenericTIFFSeriesMaximumIntensityProjectionGenerationAlgorithm.py | Python | apache-2.0 | 1,343 |
"""Core functions used by the Thunder streaming feeder scripts, including asynchronous checking for new files.
"""
import errno
import os
import time
from thunder_streaming.feeder.utils.filenames import getFilenamePostfix, getFilenamePrefix
from thunder_streaming.feeder.utils.logger import global_logger
from thunder_s... | andrewosh/thunder-streaming | python/thunder_streaming/feeder/core.py | Python | apache-2.0 | 4,148 |
# Copyright 2012 OpenStack LLC.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | ntt-sic/python-glanceclient | glanceclient/v2/shell.py | Python | apache-2.0 | 10,082 |
# -*- coding: utf-8 -*-
import collections
import httplib as http
import pytz
from flask import request
from modularodm import Q
from framework.exceptions import HTTPError
from framework.auth.decorators import must_be_logged_in
from framework.auth.utils import privacy_info_handle
from framework.forms.utils import san... | himanshuo/osf.io | website/project/views/comment.py | Python | apache-2.0 | 8,683 |
# Copyright (c) 2015 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 agreed to ... | swiftstack/swift3-stackforge | swift3/test/functional/test_acl.py | Python | apache-2.0 | 5,823 |
# Copyright 2014 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | cloudbase/neutron-virtualbox | neutron/tests/sub_base.py | Python | apache-2.0 | 5,363 |
from typing import Optional
from common.serializers.serialization import state_roots_serializer
from crypto.bls.bls_bft import BlsBft
from crypto.bls.bls_bft_replica import BlsBftReplica
from crypto.bls.bls_multi_signature import MultiSignature, MultiSignatureValue
from crypto.bls.indy_crypto.bls_crypto_indy_crypto im... | evernym/plenum | plenum/bls/bls_bft_replica_plenum.py | Python | apache-2.0 | 16,403 |
"""Base class for Tado entity."""
from homeassistant.helpers.entity import Entity
from .const import DEFAULT_NAME, DOMAIN, TADO_ZONE
class TadoDeviceEntity(Entity):
"""Base implementation for Tado device."""
def __init__(self, device_info):
"""Initialize a Tado device."""
super().__init__()
... | tboyce1/home-assistant | homeassistant/components/tado/entity.py | Python | apache-2.0 | 1,664 |
# ===============================================================================
# Copyright 2014 Jake Ross
#
# 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... | USGSDenverPychron/pychron | pychron/pyscripts/hops_editor.py | Python | apache-2.0 | 17,028 |
'''
Integration Test for creating KVM VM with all nodes shutdown and recovered.
@author: Quarkonics
'''
import zstackwoodpecker.test_util as test_util
import zstackwoodpecker.test_state as test_state
import zstackwoodpecker.test_lib as test_lib
import zstackwoodpecker.operations.resource_operations as res_... | zstackorg/zstack-woodpecker | integrationtest/vm/ha/test_all_nodes_recovery_with_one_cmd_create_vm.py | Python | apache-2.0 | 1,972 |
from __future__ import absolute_import
# Copyright (c) 2010-2019 openpyxl
from openpyxl.descriptors.serialisable import Serialisable
from openpyxl.descriptors import (
Typed,
Alias,
)
from openpyxl.descriptors.excel import (
ExtensionList,
)
from openpyxl.descriptors.sequence import (
MultiSequence,
... | kawamon/hue | desktop/core/ext-py/openpyxl-2.6.4/openpyxl/chart/plotarea.py | Python | apache-2.0 | 5,861 |
# Copyright 2017 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | pklfz/fold | tensorflow_fold/util/proto_test.py | Python | apache-2.0 | 5,810 |
"""
The Django User class is used to handle users and authentication.
https://docs.djangoproject.com/en/1.10/ref/contrib/auth/
User groups:
superadmin - Can access django admin page
admin - Can access regular admin pages
hacker - Hacker pages
mentor - Mentor pages
judge - Judge pages
user (imp... | andrewsosa/hackfsu_com | api/api/models/__init__.py | Python | apache-2.0 | 1,488 |
"""Treadmill bootstrap module.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import io
import errno
import json
import logging
import os
import sys
import subprocess
import tempfile
import pkg_resources
if os.n... | Morgan-Stanley/treadmill | lib/python/treadmill/bootstrap/install.py | Python | apache-2.0 | 13,260 |
#!/usr/bin/python
# Copyright 2017 Telstra Open Source
#
# 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... | nikitamarchenko/open-kilda | services/topology-engine/queue-engine/tests/smoke-tests/create-multi-path-topology.py | Python | apache-2.0 | 779 |
#!/usr/bin/env python2
'''Androguard Gui'''
import argparse
import sys
from androguard.core import androconf
from androguard.session import Session
from androguard.gui.mainwindow import MainWindow
from androguard.misc import init_print_colors
from PySide import QtCore, QtGui
from threading import Thread
class Ipyt... | revolutionaryG/androguard | androgui.py | Python | apache-2.0 | 1,817 |
#!/usr/bin/env python
#
# Copyright 2007 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | wgrose/leanto | google/appengine/api/datastore.py | Python | apache-2.0 | 52,965 |
# Copyright 2016 Google LLC
#
# 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, s... | tseaver/google-cloud-python | logging/google/cloud/logging/_helpers.py | Python | apache-2.0 | 3,909 |
from bluesky.plans import count
from bluesky.callbacks import LiveTable
RE(count([pe1]), LiveTable([pe1]))
| NSLS-II-XPD/ipython_ophyd | profile_collection_germ/acceptance_tests/01-count-pe1.py | Python | bsd-2-clause | 109 |
# j4cDAC test code
#
# Copyright 2011 Jacob Potter
#
# 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, version 3.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ... | lightengine/lightstream | lightstream/oldlib/dac.py | Python | bsd-2-clause | 5,679 |
from django.conf import settings
from django.utils import translation
from geotrek.tourism import models as tourism_models
from geotrek.tourism.views import TouristicContentViewSet, TouristicEventViewSet
from geotrek.trekking.management.commands.sync_rando import Command as BaseCommand
# Register mapentity models
fro... | johan--/Geotrek | geotrek/tourism/management/commands/sync_rando.py | Python | bsd-2-clause | 1,966 |
#!/usr/bin/env python
"""simple thread pool
@author: dn13(dn13@gmail.com)
@author: Fibrizof(dfang84@gmail.com)
"""
import threading
import Queue
import new
def WorkerPoolError( Exception ):
pass
class Task(threading.Thread):
def __init__(self, queue, result_queue):
threading.Thread.__init__(self)
... | hackshel/py-aluminium | src/__furture__/simplepool.py | Python | bsd-3-clause | 3,289 |
import os
from django_extensions.management.jobs import DailyJob
import nbformat
from nbconvert.preprocessors import ExecutePreprocessor
from nbconvert import HTMLExporter
class Job(DailyJob):
help = "Convert Jupyter Notebook in lowfat/reports to HTML page in lowfat/reports/html."
def execute(self):
... | softwaresaved/fat | lowfat/jobs/daily/report.py | Python | bsd-3-clause | 1,861 |
# 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 field 'Schema.immutable'
db.add_column('tardis_portal_schema', 'immutable', self.gf('django.db.mo... | steveandroulakis/mytardis | tardis/tardis_portal/migrations/0005_auto__add_field_schema_immutable.py | Python | bsd-3-clause | 16,169 |
''' Display a variety of simple scatter marker shapes whose attributes
can be associated with data columns from ``ColumnDataSources``.
The full list of markers built into Bokeh is given below:
* :class:`~bokeh.models.markers.Asterisk`
* :class:`~bokeh.models.markers.Circle`
* :class:`~bokeh.models.markers.CircleCross... | Karel-van-de-Plassche/bokeh | bokeh/models/markers.py | Python | bsd-3-clause | 5,924 |
# -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Handles the "Console" unit format.
"""
from . import base, core, utils
class Console(base.Base):
"""
Output-only format for to display pretty formatting at the
console.
For example::
>>> import astro... | funbaker/astropy | astropy/units/format/console.py | Python | bsd-3-clause | 2,766 |
from django.core.management.base import BaseCommand, CommandError
from django.db import IntegrityError
import olympia.core.logger
from olympia.access.models import Group, GroupUser
from olympia.users.models import UserProfile
class Command(BaseCommand):
help = 'Add a new user to a group.'
log = olympia.core... | harikishen/addons-server | src/olympia/zadmin/management/commands/addusertogroup.py | Python | bsd-3-clause | 1,528 |
# -*- coding: utf-8 -*-
from werkzeug.contrib import wrappers
from werkzeug import routing
from werkzeug.wrappers import Request, Response
def test_reverse_slash_behavior():
"""Test ReverseSlashBehaviorRequestMixin"""
class MyRequest(wrappers.ReverseSlashBehaviorRequestMixin, Request):
pass
req =... | r-kitaev/lucid-python-werkzeug | tests/contrib/test_wrappers.py | Python | bsd-3-clause | 2,682 |
from lib.common import helpers
class Module:
def __init__(self, mainMenu, params=[]):
self.info = {
'Name': 'Get-SQLServerInfo',
'Author': ['@_nullbind', '@0xbadjuju'],
'Description': ('Returns basic server and user information from target SQL Servers.'),
'... | frohoff/Empire | lib/modules/powershell/situational_awareness/network/get_sql_server_info.py | Python | bsd-3-clause | 4,512 |
"""
The :mod:`sklearn.pls` module implements Partial Least Squares (PLS).
"""
# Author: Edouard Duchesnay <edouard.duchesnay@cea.fr>
# License: BSD 3 clause
from ..base import BaseEstimator, RegressorMixin, TransformerMixin
from ..utils import check_arrays
from ..externals import six
import warnings
from abc import ... | depet/scikit-learn | sklearn/cross_decomposition/pls_.py | Python | bsd-3-clause | 28,547 |
import subprocess
def start(args, logfile, errfile):
subprocess.Popen(
"$PY3_GUNICORN --pid=gunicorn.pid hello.wsgi:application -c gunicorn_conf.py --env DJANGO_DB=mysql",
cwd="django", shell=True, stderr=errfile, stdout=logfile)
return 0
def stop(logfile, errfile):
subprocess.call(
... | torhve/FrameworkBenchmarks | frameworks/Python/django/setup_py3.py | Python | bsd-3-clause | 430 |
import os
from setuptools import setup, find_packages
README = open(os.path.join(os.path.dirname(__file__), 'README.rst')).read()
# allow setup.py to be run from any path
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))
from watermarker import __version__
setup(
name='django-waterm... | lzanuz/django-watermark | setup.py | Python | bsd-3-clause | 1,660 |
# -*- coding: utf-8 -*-
"""Module for pull and push command."""
import abc
from base64 import b64decode
import six
from six.moves import configparser
from ..core.api import API
from ..core.commands import AbstractCommand
from ..core.models.terminal import clean_order
from .client.controllers import ApiController
from .... | EvgeneOskin/termius-cli | termius/cloud/commands.py | Python | bsd-3-clause | 4,879 |
import numpy as np
from scipy._lib._util import check_random_state
def rvs_ratio_uniforms(pdf, umax, vmin, vmax, size=1, c=0, random_state=None):
"""
Generate random samples from a probability density function using the
ratio-of-uniforms method.
Parameters
----------
pdf : callable
A ... | WarrenWeckesser/scipy | scipy/stats/_rvs_sampling.py | Python | bsd-3-clause | 7,177 |
from kraken.core.maths import Vec3
from kraken.core.maths.xfo import Xfo
from kraken.core.objects.components.base_example_component import BaseExampleComponent
from kraken.core.objects.attributes.attribute_group import AttributeGroup
from kraken.core.objects.attributes.scalar_attribute import ScalarAttribute
from kra... | goshow-jp/Kraken | Python/kraken_components/fabrice/fabrice_clavicle.py | Python | bsd-3-clause | 7,805 |
from sympy import I, sqrt, log, exp, sin, asin, factorial
from sympy.core import Symbol, S, Rational, Integer, Dummy, Wild, Pow
from sympy.core.facts import InconsistentAssumptions
from sympy import simplify
from sympy.core.compatibility import range
from sympy.utilities.pytest import raises, XFAIL
def test_symbol_u... | sahilshekhawat/sympy | sympy/core/tests/test_assumptions.py | Python | bsd-3-clause | 27,164 |
###############################################################################
##
## Copyright (C) 2011-2014, NYU-Poly.
## Copyright (C) 2006-2011, University of Utah.
## All rights reserved.
## Contact: contact@vistrails.org
##
## This file is part of VisTrails.
##
## "Redistribution and use in source and binary for... | Nikea/VisTrails | vistrails/packages/rpy/__init__.py | Python | bsd-3-clause | 2,002 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2016-01-15 18:28
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('ims', '0010_auto_20151227_1147'),
]
operations = [
migrations.AlterField(
... | grovesr/django-ims | ims/migrations/0011_auto_20160115_1328.py | Python | bsd-3-clause | 517 |
'''
This file holds globally useful utility classes and functions, i.e., classes and
functions that are generic enough not to be specific to one app.
'''
import logging
import os
import re
import sys
from datetime import tzinfo, timedelta
from django.conf import settings
# Setup logging support.
LOGGER = logging.get... | MiltosD/CEF-ELRC | metashare/utils.py | Python | bsd-3-clause | 4,061 |
# -*- coding: utf-8 -*-
"""
Werkzeug
========
Werkzeug started as simple collection of various utilities for WSGI
applications and has become one of the most advanced WSGI utility
modules. It includes a powerful debugger, full featured request and
response objects, HTTP utilities to handle entity tags, cache control
... | 0x19/werkzeug | setup.py | Python | bsd-3-clause | 2,732 |
from django.db import models
from .mixins import FileMixin
class BaseCategory(models.Model):
title = models.CharField(max_length=100, unique=True)
class Meta:
abstract = True
ordering = ('title',)
def __str__(self):
return self.title
class FileCategory(BaseCategory):
class... | developersociety/django-glitter | glitter/assets/models.py | Python | bsd-3-clause | 1,508 |
# -*- coding: utf-8 -*-
#
# django-notes documentation build configuration file, created by
# sphinx-quickstart on Wed May 13 10:34:42 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.
#
... | BraveToasterStudio/django-notes | docs/conf.py | Python | bsd-3-clause | 6,470 |
import copy
from types import GeneratorType
class MergeDict(object):
"""
A simple class for creating new "virtual" dictionaries that actually look
up values in more than one dictionary, passed in the constructor.
If a key appears in more than one of the given dictionaries, only the
first occurrenc... | skevy/django | django/utils/datastructures.py | Python | bsd-3-clause | 15,444 |
from pyglet.window import key, mouse
from pyglet.libs.darwin.quartzkey import keymap, charmap
from pyglet.libs.darwin.cocoapy import *
NSTrackingArea = ObjCClass('NSTrackingArea')
# Event data helper functions.
def getMouseDelta(nsevent):
dx = nsevent.deltaX()
dy = nsevent.deltaY()
return int(dx), int(d... | mammadori/pyglet | pyglet/window/cocoa/pyglet_view.py | Python | bsd-3-clause | 13,557 |
file = "../_ser/lininteg.py"
out = ["namespace mfem {"]
fid = open(file, 'r')
for line in fid.readlines():
if line.startswith("class"):
cname = (line.split(' ')[1]).split('(')[0]
if line.startswith(" def __init__"):
pp = ""
if line.find("*args") != -1:
pp = " ... | mfem/PyMFEM | mfem/common/generate_lininteg_ext.py | Python | bsd-3-clause | 1,212 |