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 |
|---|---|---|---|---|---|
# -*- coding: utf-8 -*-
### BEGIN LICENSE
# Copyright (C) 2010-2013 Emilien Klein <emilien _AT_ klein _DOT_ st>
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 3, as published
# by the Free Software Foundation.
#
# This program ... | e2jk/nautilus-image-manipulator | nautilus_image_manipulator/NautilusImageManipulatorDialog.py | Python | gpl-3.0 | 26,709 |
# Copyright 2017 www.msv.space
#
# This file is part of SNMPTableMixer.
#
# SNMPTableMixer is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later versi... | k11a/snmpconverter | configinit.py | Python | gpl-3.0 | 24,267 |
# vim: tabstop=4 expandtab shiftwidth=4 fileencoding=utf8
# (c) 2008 Peter Todd <pete@petertodd.org>
#
# This program is made available under the GNU GPL version 3.0 or
# greater. See the accompanying file COPYING for details.
#
# This program is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of ... | petertodd/tuke | Tuke/tests/context/_context/_cfunction.py | Python | gpl-3.0 | 595 |
#! /usr/bin/env python3
import os
import matplotlib.pyplot as plt
import galore
import galore.formats
import galore.plot
from tempfile import mkstemp
fd, tmp = mkstemp(suffix='.txt', text=True)
os.close(fd)
sim_xvals = [10, 15, 19.5, 20, 20.5, 21]
sim_yvals = [12, 6, 3, 2, 1, 2]
galore.formats.write_txt(sim_xvals, ... | SMTG-UCL/galore | docs/source/figures/ir_schematic.py | Python | gpl-3.0 | 840 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import colorsys, time, random, signal
from dioder import Dioder, SerialLogic
from threading import Thread
class ExtendedDioder(Dioder, Thread):
def __init__(self, *args, **kwargs):
super(ExtendedDioder, self).__init__(*args, **kwargs)
# thread status
self.running =... | basti2342/simple-ledstrip | extended-dioder.py | Python | mpl-2.0 | 5,582 |
import numpy as np
from scipy import sparse
import statistics
def metrics(data_file):
output_str = ''
dsms = []
# the first thing we do is load the csv file (file #,from,to)
# into a DSM; we do this by converting the triples to a sparse matrix
# dsm is the first-order DSM of dependencies
dsm_initial = loa... | almossawi/firefox-code-quality | scripts/codequality.py | Python | mpl-2.0 | 4,809 |
# encoding: utf-8
#
#
# 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/.
#
# Author: Kyle Lahnakoski (kyle@lahnakoski.com)
#
from __future__ import absolute_import
from __f... | klahnakoski/Bugzilla-ETL | vendor/mo_logs/__init__.py | Python | mpl-2.0 | 19,331 |
from . import skeleton_path, m_walking_path
from numpy.testing import assert_allclose
from amcparser import Skeleton, SkelMotion
def test_motion_root():
sk = Skeleton(skeleton_path)
skm = SkelMotion(sk, m_walking_path, (1.0 / 120.0))
skm.traverse('root', 0, 10)
root_pos = sk.root.xyz_data
assert_a... | VanushVaswani/amcparser | tests/test_motion.py | Python | mpl-2.0 | 702 |
# -*- coding: utf-8 -*-
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import os
import pytest
import backend_common
@pytest.fixture(scope='session')
def app():
... | La0/mozilla-relengapi | src/shipit/api/tests/conftest.py | Python | mpl-2.0 | 1,089 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
######################################################################################################################
# WebTools bundle for Plex
#
# Allows you to manipulate subtitles on Plex Media Server
#
# Author: dane22, a Plex Community member
#
... | ukdtom/WebTools.bundle | Contents/Code/__init__.py | Python | mpl-2.0 | 5,536 |
"""
hybrid.py: IRCD-Hybrid protocol module for PyLink.
"""
import time
from pylinkirc import conf
from pylinkirc.classes import *
from pylinkirc.log import log
from pylinkirc.protocols.ts6 import TS6Protocol
__all__ = ['HybridProtocol']
# This protocol module inherits from the TS6 protocol.
class HybridProtocol(TS... | GLolol/PyLink | protocols/hybrid.py | Python | mpl-2.0 | 12,742 |
# encoding: utf-8
#
#
# 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/.
#
# Author: Kyle Lahnakoski (kyle@lahnakoski.com)
#
from __future__ import absolute_import
from __f... | klahnakoski/esReplicate | pyLibrary/queries/namespace/typed.py | Python | mpl-2.0 | 4,356 |
# coding=utf-8
#
# 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 https://mozilla.org/MPL/2.0/.
"""Run a subprocess with timeout
"""
import argparse
import collections
import platform
import signal
... | nth10sd/lithium | src/lithium/interestingness/timed_run.py | Python | mpl-2.0 | 5,962 |
# coding: utf-8
"""
This module contains utility functions.
"""
from __future__ import unicode_literals
import errno
import functools
import itertools
import io
import os
import os.path
import platform
import shutil
import textwrap
import yaml
import yaml.scanner
def find_exe(exe, path=None):
"""
Find the specifie... | cpburnz/minecraft-mod-package | mcpackage/util.py | Python | mpl-2.0 | 8,923 |
# -*- coding: utf-8 -*-
# Copyright 2016 Jairo Llopis <jairo.llopis@tecnativa.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from openerp.tests.common import SavepointCase
class SaleStockRefundPickingCase(SavepointCase):
@classmethod
def setUpClass(cls):
"""Add some defaults to ... | EBII/account-invoicing | sale_stock_picking_return_invoicing/tests/test_refund.py | Python | agpl-3.0 | 5,390 |
"""
Tests for classes extending Field.
"""
# Allow accessing protected members for testing purposes
# pylint: disable=W0212
from mock import Mock
import unittest
import datetime as dt
import pytz
import warnings
import math
import textwrap
import itertools
from contextlib import contextmanager
import ddt
from xblo... | GbalsaC/bitnamiP | XBlock/xblock/test/test_fields.py | Python | agpl-3.0 | 26,030 |
# Generated by Django 1.11.13 on 2018-08-14 17:35
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
replaces = [
("user", "0001_initial"),
("user", "0002_rename_account_tables"),
("user", "0003... | fiduswriter/fiduswriter | fiduswriter/user/migrations/0001_squashed_0003_auto_20151226_1110.py | Python | agpl-3.0 | 6,929 |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-today OpenERP SA (<http://www.openerp.com>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms o... | blancoamor/crm_rma_blancoamor | crm_rma_blancoamor.py | Python | agpl-3.0 | 14,539 |
# -*- coding: utf-8 -*-
# Copyright 2017 Eficent Business and IT Consulting Services S.L.
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
{
'name': 'Analytic Plan-Actual Analysis',
'version': '10.0.1.1.0',
'author': 'Eficent, Odoo Community Association (OCA),'
'Proje... | sysadminmatmoz/pmis | analytic_plan_analysis/__manifest__.py | Python | agpl-3.0 | 633 |
"""
Defines the URL routes for this app.
"""
from django.conf import settings
from django.conf.urls import include, patterns, url
from rest_framework import routers
from . import views as user_api_views
from .models import UserPreference
USER_API_ROUTER = routers.DefaultRouter()
USER_API_ROUTER.register(r'users', us... | mbareta/edx-platform-ft | openedx/core/djangoapps/user_api/legacy_urls.py | Python | agpl-3.0 | 1,618 |
import unittest
import requests
import requests_mock
from bears.general.URLHeadBear import URLHeadBear, LINK_CONTEXT, URLHeadResult
from coalib.results.SourceRange import SourceRange
from coalib.testing.LocalBearTestHelper import get_results
from coalib.settings.Section import Section
from queue import Queue
from .Inv... | refeed/coala-bears | tests/general/URLHeadBearTest.py | Python | agpl-3.0 | 4,508 |
import os
from bzrlib.branch import Branch
from charmhelpers.fetch import (
BaseFetchHandler,
UnhandledSource
)
from charmhelpers.core.host import mkdir
class BzrUrlFetchHandler(BaseFetchHandler):
"""Handler for bazaar branches via generic and lp URLs"""
def can_handle(self, source):
url_parts... | SaMnCo/charm-dashing | lib/charmhelpers/fetch/bzrurl.py | Python | agpl-3.0 | 1,463 |
# -*- coding: utf-8 -*-
#
#
# Copyright (C) 2015 Sucros Clear Information Technologies PLC.
# All Rights Reserved.
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either ... | Clear-ICT/odoo-addons | sale_tax_number_check/__openerp__.py | Python | agpl-3.0 | 1,340 |
# -*- coding: utf-8 -*-
##############################################################################
#
# This file is part of hr_timesheet_no_closed_project_task,
# an Odoo module.
#
# Copyright (c) 2015 ACSONE SA/NV (<http://acsone.eu>)
#
# hr_timesheet_invoice_hide_to_invoice is free software:
# ... | acsone/acsone-addons | hr_timesheet_no_closed_project_task/models/project_task.py | Python | agpl-3.0 | 1,843 |
from django.contrib import admin
from .models import Website, BTBeacon
admin.site.register(Website)
admin.site.register(BTBeacon)
| Fresnoy/kart | common/admin.py | Python | agpl-3.0 | 132 |
# monitor compute resources. Called from 'lib/oocran/oocran.c' with dependencies already imported and variables defined previously
cpu = 'cpu_' + NVF + ' value=%s' % psutil.cpu_percent()
disk = 'disk_' + NVF + ' value=%s' % psutil.disk_usage('/').percent
ram = 'ram_' + NVF + ' value=%s' % round(psutil.virtual_memory()... | oocran/vbbu | monitor.py | Python | agpl-3.0 | 1,235 |
# -*- coding: utf-8 -*-
import werkzeug
import logging
import pprint
from urlparse import urlparse, parse_qs
from openerp import SUPERUSER_ID
from openerp import http
from openerp.http import request
from openerp.tools.translate import _
from openerp.addons.website.models.website import slug
from openerp.addons.web.con... | Punto0/rcc | website_purchase_collective/controllers/main.py | Python | agpl-3.0 | 40,168 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from distutils.core import setup
requirements = [line.strip() for line in open('requirements.txt')]
setup(
name='guideseq',
version='0.9.0',
description="An easy to use bioinformatic pipeline for the GUIDE-seq assay.",
author="Shengdar Q Tsai, Martin Arye... | aryeelab/guideseq | setup.py | Python | agpl-3.0 | 1,263 |
#!/usr/bin/env python
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2015, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions ... | chanceraine/nupic.research | tests/classification/test_sensor_data_classification.py | Python | agpl-3.0 | 7,592 |
from os import path
from django.core.paginator import Paginator, InvalidPage, EmptyPage
from django.core.urlresolvers import reverse
from django.shortcuts import render_to_response, render, redirect
from django.http import HttpResponseRedirect, HttpResponse
from django.template import RequestContext
from django.views... | Rhombik/rhombik-object-repository | project/views.py | Python | agpl-3.0 | 13,528 |
# -*- coding: utf-8 -*-
# © <YEAR(S)> <AUTHOR(S)>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp import fields, models
class ProcurementOrder(models.Model):
_inherit = 'procurement.order'
related_segment = fields.Char(
string='Relatad Segment',
default='',
... | Gebesa-Dev/Addons-gebesa | mrp_segment/models/procurement_order.py | Python | agpl-3.0 | 327 |
import pybossa.sched as sched
from pybossa.forms.forms import TaskSchedulerForm
from pybossa.core import project_repo
from flask.ext.plugins import Plugin
from functools import wraps
import random
__plugin__ = "RandomScheduler"
__version__ = "0.0.1"
SCHEDULER_NAME = 'random'
def get_random_task(project_id, user_id=... | PyBossa/random-scheduler | random_scheduler/__init__.py | Python | agpl-3.0 | 1,346 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import logging
import requests
from datetime import datetime
from cachetools import LFUCache
from requests_futures.sessions import FuturesSession
import threading
from .utils import get_args
from requests.packages.urllib3.util.retry import Retry
from requests.adapters import H... | pgandev/RocketMap | pogom/webhook.py | Python | agpl-3.0 | 8,054 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
import opal.models
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('opal', '0012_maritalst... | khchine5/opal | opal/migrations/0013_inpatientadmission.py | Python | agpl-3.0 | 1,852 |
{
'name': 'Discount prepaid order',
'version': '1.0',
'category': 'Custom',
'description': """
Order Discount when it's prepaid and margin is between specific values
""",
'author': 'Nadia Ferreyra',
'website': '',
'depends': ['base',
'sale',
'pro... | Comunitea/CMNT_004_15 | project-addons/prepaid_order_discount/__manifest__.py | Python | agpl-3.0 | 697 |
# -*- coding: utf-8 -*-
"""
URL definitions for Cornerstone API.
"""
from django.conf.urls import url
from integrated_channels.cornerstone.views import CornerstoneCoursesListView, CornerstoneCoursesUpdates
urlpatterns = [
url(
r'^course-list$',
CornerstoneCoursesListView.as_view(),
name='... | edx/edx-enterprise | integrated_channels/cornerstone/urls.py | Python | agpl-3.0 | 483 |
# Copyright (C) 2020 The Software Heritage developers
# See the AUTHORS file at the top-level directory of this distribution
# License: GNU Affero General Public License version 3, or any later version
# See top-level LICENSE file for more information
from hypothesis import given
import pytest
from django.test impor... | SoftwareHeritage/swh-web-ui | swh/web/tests/common/test_middlewares.py | Python | agpl-3.0 | 1,521 |
from common.redis import generalPubSubHandler
from objects import glob
class handler(generalPubSubHandler.generalPubSubHandler):
def __init__(self):
super().__init__()
self.type = "int"
def handle(self, userID):
userID = super().parseData(userID)
if userID is None:
return
targetToken = glob.tokens.getT... | osuripple/pep.py | pubSubHandlers/updateSilenceHandler.py | Python | agpl-3.0 | 397 |
# -*- encoding: 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 G... | ttfseiko/openerp-trunk | openerp/addons/account_asset/account_asset.py | Python | agpl-3.0 | 29,177 |
#
# audio_power.py - Sound energy and power.
# Copyright (C) 2016 Hanson Robotics
#
# 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, or (at your optio... | opencog/ros-behavior-scripting | sensors/audio_power.py | Python | agpl-3.0 | 1,713 |
"""Tests for certificates views. """
import datetime
from unittest import skipUnless
from unittest.mock import patch
from urllib.parse import urlencode
from uuid import uuid4
import ddt
from django.conf import settings
from django.test.client import Client, RequestFactory
from django.test.utils import override_setti... | eduNEXT/edx-platform | lms/djangoapps/certificates/tests/test_webview_views.py | Python | agpl-3.0 | 77,238 |
from django.db import models, transaction, connection
from django.http import Http404
from datetime import date, timedelta
from django.db.models.functions import Lower
from django.db.models import Count, Sum, Min, Max
from .note import Note, array2tree
from .classe import Classe
from .semaine import Semaine
from ecolle... | stephanekirsch/e-colle | accueil/models/ramassage.py | Python | agpl-3.0 | 14,879 |
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2015 ADHOC SA (http://www.adhoc.com.ar)
# All Rights Reserved.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Pu... | maljac/odoo-addons | stock_transfer_restrict_lot/__openerp__.py | Python | agpl-3.0 | 1,555 |
#!/usr/bin/python
import re,cgi,cgitb,sys
import os
import urllib
import meowaux as mew
import Cookie
cgitb.enable()
### DEBUG
#print "Content-type: text/html; charset=utf-8;"
#print
cookie = Cookie.SimpleCookie()
cookie_hash = mew.getCookieHash( os.environ )
if ( ("userId" not in cookie_hash) or ("sessionId" not... | abetusk/www.meowcad.com | cgi/updateproject.py | Python | agpl-3.0 | 2,730 |
各組分別在各自的 .py 程式中建立應用程式 (第1步/總共3步)
from flask import Blueprint, render_template
# 利用 Blueprint建立 ag1, 並且 url 前綴為 /ag1, 並設定 template 存放目錄
scrum5_task1 = Blueprint('scrum5_task1', __name__, url_prefix='/bg4', template_folder='templates')
# scrum5_task1 為完整可以單獨執行的繪圖程式
@scrum5_task1.route('/scrum5_task1')
def task1():
... | 2015fallhw/cdw2 | users/s2b/g4/scrum5_task1.py | Python | agpl-3.0 | 3,680 |
from flask import Blueprint,current_app
from flask.json import JSONEncoder as BaseJSONEncoder
import arrow
from flask_babelplus import format_datetime as _format_datetime
from sqlalchemy.exc import SQLAlchemyError
from sqlalchemy.orm.properties import ColumnProperty
from unifispot.core.db import db
from dateutil import... | Spotipo/spotipo | unifispot/utils/modelhelpers.py | Python | agpl-3.0 | 8,979 |
PP = 0
SCORE = 1
| osuripple/lets | constants/scoreOverwrite.py | Python | agpl-3.0 | 17 |
# Copyright 2019 Ecosoft Co., Ltd (http://ecosoft.co.th/)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html)
from odoo import fields, models
class ReportPartnerList(models.TransientModel):
_name = "report.partner.list"
_description = "Wizard for report.partner.list"
partner_ids = field... | OCA/server-tools | excel_import_export_demo/report_action/partner_list/report_partner_list.py | Python | agpl-3.0 | 943 |
import os
import base64
import werkzeug.security as ws
from Crypto.Signature import PKCS1_v1_5
from Crypto.Hash import SHA
from Crypto.PublicKey import RSA
from flask import Flask, request, jsonify, abort, json
from simplekv.fs import FilesystemStore
from uuid import UUID
ACCOUNT_CREATION_DIFFICULTY = '0400'
LOGIN_DIF... | RagnarDanneskjold/omniwallet | api/user_service.py | Python | agpl-3.0 | 4,740 |
#!/usr/bin/python
#
# Copyright (C) 2020 abetusk
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This pro... | abetusk/dev | projects/pcbcnc/src/cnc3018pro.py | Python | agpl-3.0 | 8,180 |
#
# SecureDrop whistleblower submission system
# Copyright (C) 2017 Loic Dachary <loic@dachary.org>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
#... | freedomofpress/securedrop | securedrop/tests/pageslayout/test_source_session_layout.py | Python | agpl-3.0 | 1,761 |
import numpy
from openfisca_core import periods
class InMemoryStorage:
"""
Low-level class responsible for storing and retrieving calculated vectors in memory
"""
def __init__(self, is_eternal = False):
self._arrays = {}
self.is_eternal = is_eternal
def get(self, period):
... | openfisca/openfisca-core | openfisca_core/data_storage/in_memory_storage.py | Python | agpl-3.0 | 1,696 |
from ..base import WLElement
class WWW(WLElement):
pass
| fnp/librarian | src/librarian/elements/styles/www.py | Python | agpl-3.0 | 62 |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
# Copyright (C) 2010-2012 OpenERP s.a. (<http://openerp.com>).
#
# This program is free software: you ca... | OpusVL/odoo | addons/board/__openerp__.py | Python | agpl-3.0 | 1,697 |
"""TO-DO: Write a description of what this XBlock is."""
import pkg_resources
from django.templatetags.static import static
from xblock.core import XBlock
from xblock.fields import Scope, Integer
from xblock.fragment import Fragment
class HelloWorldXBlock(XBlock):
"""
TO-DO: document what your XBlock does.... | dcadams/xblock-sdk | hello_world/hello_world/hello_world.py | Python | agpl-3.0 | 3,022 |
# -*- coding: utf-8 -*-
###############################################################################
#
# Copyright (C) 2001-2014 Micronaet SRL (<http://www.micronaet.it>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License a... | Micronaet/micronaet-campaign | campaign_product/product.py | Python | agpl-3.0 | 2,927 |
# Deckard, a Web based Glade Runner
# Copyright (C) 2013 Nicolas Delvaux <contact@nicolas-delvaux.org>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, o... | Malizor/deckard | libdeckard.py | Python | agpl-3.0 | 17,967 |
##############################################################################
#
# Copyright (C) 2015 ADHOC SA (http://www.adhoc.com.ar)
# All Rights Reserved.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# pub... | ingadhoc/website | l10n_ar_website_sale_ux/__manifest__.py | Python | agpl-3.0 | 1,366 |
# -*- coding: utf-8 -*-
# Copyright 2016 Eficent Business and IT Consulting Services S.L.
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl-3.0).
from openerp.tests import common
from openerp.tools import SUPERUSER_ID
class TestPurchaseRequestToRfq(common.TransactionCase):
def setUp(self):
s... | SerpentCS/purchase-workflow | purchase_request_to_rfq/tests/test_purchase_request_to_rfq.py | Python | agpl-3.0 | 3,057 |
#!/usr/local/bin/python
#
# Copyright (c) 2005 University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
# This file is part of the Emulab network testbed software.
#
# This file is free software: you can redistribute it and/or modify it
# under the terms of the GNU Affero General Public Licens... | nmc-probe/emulab-nome | robots/vmcd/camera_data/test_lin_blend3.py | Python | agpl-3.0 | 7,084 |
#from distutils.core import setup
from setuptools import setup, find_packages
# http://guide.python-distribute.org/quickstart.html
# python setup.py sdist
# python setup.py register
# python setup.py sdist upload
# pip install epub_meta
# pip install epub_meta --upgrade --no-deps
# Manual upload to PypI
# http://pypi.... | paulocheque/epub-meta | setup.py | Python | agpl-3.0 | 1,554 |
##############################################################################
# Copyright (c) 2013-2017, 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... | lgarren/spack | var/spack/repos/builtin/packages/r-annotationdbi/package.py | Python | lgpl-2.1 | 2,016 |
from tendrl.ceph_integration.manager.exceptions import \
RequestStateError
from tendrl.ceph_integration.manager.rbd_crud import RbdCrud
from tendrl.ceph_integration.objects.rbd import Rbd
from tendrl.commons.event import Event
from tendrl.commons.message import Message
from tendrl.commons import objects
class Del... | r0h4n/ceph-integration | tendrl/ceph_integration/objects/rbd/atoms/delete/__init__.py | Python | lgpl-2.1 | 2,691 |
import json
data = '''{
"name" : "Chuck",
"phone": {
"type" : "int1",
"number" : "+1 734 303 4456"
},
"email": {
"hide" : "yes"
}
}'''
info = json.loads(data)
print('Name:',info["name"])
print('Hide:',info["email"]["hide"])
| crookedreyes/py4e-specialization | course-3/chapter-13/json1.py | Python | lgpl-2.1 | 269 |
#!/usr/bin/env python
# getmybp.py - script to donwnload data from Malaysian government site
#
# Copyright (C) 2013-2016 Arthur de Jong
#
# 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; ... | holvi/python-stdnum | getmybp.py | Python | lgpl-2.1 | 3,036 |
# -*- Mode: Python -*-
# vi:si:et:sw=4:sts=4:ts=4
# Flumotion - a streaming media server
# Copyright (C) 2004,2005,2006,2007,2008,2009 Fluendo, S.L.
# Copyright (C) 2010,2011 Flumotion Services, S.A.
# All rights reserved.
#
# This file may be distributed and/or modified under the terms of
# the GNU Lesser General Pub... | timvideos/flumotion | flumotion/admin/command/main.py | Python | lgpl-2.1 | 6,506 |
# -*- Mode: Python -*- vi:si:et:sw=4:sts=4:ts=4:syntax=python
import os
import shutil
from collections import defaultdict
from cerbero.build import recipe
from cerbero.build.source import SourceType
from cerbero.build.cookbook import CookBook
from cerbero.config import Platform
from cerbero.enums import License
from c... | flexVDI/cerbero | recipes/custom.py | Python | lgpl-2.1 | 2,085 |
import openvoronoi as ovd
import ovdvtk
import time
import vtk
import datetime
import math
import random
import os
import sys
import pickle
import gzip
if __name__ == "__main__":
# w=2500
# h=1500
# w=1920
# h=1080
w = 1024
h = 1024
myscreen = ovdvtk.VTKScreen(width=w, height=h)
ovdvt... | aewallin/openvoronoi | python_examples/spike_1.py | Python | lgpl-2.1 | 4,238 |
import numpy as np
import os
def itera_f(num, start, steps):
''' All possible portfolio configurations. BETTER IMPLEMENTATION??
steps = (int) Size of the steps. Input 100 would be interpreted as 1.
Input 10, 0.1. Input 1, 0.01.
'''
if num[start]-steps >= 0:
... | melrcm/Optimizepy | all_permutes.py | Python | lgpl-2.1 | 2,210 |
#!/usr/bin/env python
import matplotlib.pyplot as plt
import numpy as np
# Number of "papers using libmesh" by year.
#
# Note 1: this does not count citations "only," the authors must have actually
# used libmesh in part of their work. Therefore, these counts do not include
# things like Wolfgang citing us in his pap... | vikramvgarg/libmesh | doc/statistics/libmesh_citations.py | Python | lgpl-2.1 | 2,350 |
# -*- encoding: utf8 -*-
#
# The Qubes OS Project, http://www.qubes-os.org
#
# Copyright (C) 2017 Marek Marczykowski-Górecki
# <marmarek@invisiblethingslab.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public Li... | marmarek/qubes-core-mgmt-client | qubesadmin/tests/tools/qvm_pause.py | Python | lgpl-2.1 | 3,376 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# trml2pdf - An RML to PDF converter
# Copyright (C) 2003, Fabien Pinckaers, UCL, FSA
# Contributors
# Richard Waid <richard@iopen.net>
# Klaas Freitag <freitag@kde.org>
import os
import sys
import trml2pdf
__help = \
"Usage: trml2pdf input.rml >output.pdf\... | romanlv/trml2pdf | trml2pdf.py | Python | lgpl-2.1 | 672 |
#####################################################################
# app/views/__init__.py
#
# (c) Copyright 2015, Benjamin Parzella. All rights reserved.
#
# 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 ... | bparzella/gemma | app/views/__init__.py | Python | lgpl-2.1 | 775 |
import numpy as np
class GaussianFunction(object):
def __init__(self, x0, alpha, normed=True):
self.x0 = np.array(x0)
self.alpha = np.array(alpha)
self.sigma = 1.0/np.sqrt(2.0*self.alpha)
if normed:
self.norm = np.prod(np.sqrt(self.alpha / np.pi))
else:
... | dynamiq-md/dynamiq_samplers | dynamiq_samplers/tools.py | Python | lgpl-2.1 | 1,216 |
import pytest
from tendrl.commons.utils.ssh.generate_key import GenerateKey
from tendrl.commons.utils import ansible_module_runner
import mock
import maps
import __builtin__
from mock import patch
def ansible_run(*args):
if args[0]:
return {"ssh_private_key":"test_ssh_private_key"},""
elif not args[0]... | rishubhjain/commons | tendrl/commons/tests/utils/ssh/test_generate_key.py | Python | lgpl-2.1 | 2,380 |
#!/usr/bin/env python
"""Colored sine wave grating in circular mask"""
############################
# Import various modules #
############################
import VisionEgg
VisionEgg.start_default_logging(); VisionEgg.watch_exceptions()
from VisionEgg.Core import *
from VisionEgg.FlowControl import Presentation, F... | visionegg/visionegg | demo/color_grating.py | Python | lgpl-2.1 | 2,726 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# This file is part of box-linux-sync.
#
# Copyright (C) 2013 Vítor Brandão <noisebleed@noiselabs.org>
#
# box-linux-sync 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... | noiselabs/box-linux-sync | src/noiselabs/box/output.py | Python | lgpl-3.0 | 6,736 |
import pyscreenshot as img
import time
import msvcrt
import win32api
import win32con
import numpy as np
import tkinter as tk
import threading
import pyautogui
from win32api import GetKeyState
from ctypes import windll
class App(tk.Tk):
def __init__(self, *args, **kwargs):
tk.Tk.__init__(self, *args, **kwa... | ucshadow/Fish_bot | even more.py | Python | lgpl-3.0 | 5,779 |
#!/usr/bin/python3
#
# On Windows or a current Linux distro.
# pip3 install fontTools[woff]
#
import os
from fontTools.ttLib import TTFont
directory = '.'
for name in os.listdir(directory):
file = os.path.join(directory, name)
if os.path.isfile(file) and name.endswith(".woff"):
(b, ext) = os.path.spli... | bengarrett/RetroTxt | ext/fonts/woff-to-woff2.py | Python | lgpl-3.0 | 558 |
"""Helper utilities for PLACE data"""
from sys import argv
from os import remove
from os.path import basename, isdir, isfile
from itertools import count
from glob import glob
import numpy as np
def column_renamer():
"""Tool for renaming the columns in a NumPy structured array file"""
if not (len(argv) > 1 and... | PALab/PLACE | place/utilities.py | Python | lgpl-3.0 | 3,034 |
from __future__ import division
def bound(c,(bndH,method),d1,f,g,d2,D,A=None,b=None,E=None,d=None,U=None,optimality=None,initialRadius=None):
# Norm function
from numpy import ones, sqrt
from numpy.linalg import norm
# Our own functions
from trsq import trsq
from mest import mest
from doma... | coin-or/oBB | obb/lboundme_loc_rr.py | Python | lgpl-3.0 | 2,004 |
import json
from aiohttp import ClientSession
from tribler_core.restapi import get_param
from tribler_core.tests.tools.test_as_server import TestAsServer
from tribler_core.utilities.path_util import Path
from tribler_core.version import version_id
def path_to_str(obj):
if isinstance(obj, dict):
return {... | hbiyik/tribler | src/tribler-core/tribler_core/restapi/base_api_test.py | Python | lgpl-3.0 | 2,844 |
import numpy as np
np.set_printoptions(precision=6, suppress=True, linewidth=320)
from numpy import where, zeros, ones, mod, conj, array, dot, angle, complex128 #, complex256
from numpy.linalg import solve
# Set the complex precision to use
complex_type = complex128
def calc_W(n, npqpv, C, W):
"""
Calculatio... | SanPen/GridCal | src/research/power_flow/helm/old/helm_z_pq.py | Python | lgpl-3.0 | 6,030 |
"""
Hack to extract links from JCP search results.
$ handle.py <file_name>
will return a link to the first result of a JCP search.
If there are no search results, gives a return code of 4.
If there is at least one search result, prints the href in
the "<a title="Link to Article" href="..."> tag.
"""
import sys
fr... | pbugnion/bibscrape | handle_jcp.py | Python | lgpl-3.0 | 844 |
#!/usr/bin/env python
import os
from setuptools import setup, find_packages
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
name='pyrs-resource',
author='Csaba Palankai',
author_email='csaba.palankai@gmail.com',
packages=find_packages(),
include_pa... | palankai/pyrs-resource | setup.py | Python | lgpl-3.0 | 1,432 |
import tensorflow as tf
from dyn import model_attention as Model
import model as M
bn_training = True
reuse_att = False
reuse_enc = False
reuse_gen = False
reuse_dis = False
reuse_feat = False
reuse_dis2 = False
reuse_dis_f = False
reuse_genatt = False
reuse_agecls = False
reuse_agecls_r = False
reuse_age_enc = {}
... | ddddwee1/SULsT | SUL1/sample/AgingNet/temp/network.py | Python | lgpl-3.0 | 6,686 |
#!/usr/bin/python
# -*- coding: UTF-8 -*-
"""This Script generates LaTeX Table with all Information from the Results-File.
"""
from __future__ import print_function
import csv
from config import tagsets, mapping, RESULTS_CSV
__author__ = "Alexander Böhm [jwacalex], Thomas Stieglmaier, Thomas Ziegler"
__credits__ = [... | jwacalex/MULTEX-EAST-PoS-Tagger | csvtools/mkFullTable.py | Python | lgpl-3.0 | 3,084 |
import os
import time
from urllib.parse import urljoin
import requests as rq
from bs4 import BeautifulSoup as bs
current_page_url = 0
page_soup = 0
def download_file(file_url, file_path):
if os.path.exists(file_path):
print(file_path, "already exists")
return False
i = 0
while i <= 30:
... | SilentObserver/mangafox_rippers | mangafox_ripper.py | Python | lgpl-3.0 | 3,898 |
"""Dummy Frame object"""
# Copyright (C) PyZMQ Developers
# Distributed under the terms of the Modified BSD License.
from ._cffi import ffi, C
import zmq
try:
view = memoryview
except NameError:
view = buffer
_content = lambda x: x.tobytes() if type(x) == memoryview else x
class Frame(object):
_data =... | kalikaneko/pyzqm-deb | zmq/backend/cffi/message.py | Python | lgpl-3.0 | 1,368 |
# micro
# Copyright (C) 2021 micro contributors
#
# This program is free software: you can redistribute it and/or modify it under the terms of the GNU
# Lesser General Public License as published by the Free Software Foundation, either version 3 of
# the License, or (at your option) any later version.
#
# This program ... | noyainrain/micro | micro/error.py | Python | lgpl-3.0 | 1,216 |
#!/usr/bin/env python3
#
# This script removes the given package entries in the bundled_packages JSON files. This is used by the PluginInstall
# CMake module.
#
import argparse
import collections
import json
import os
import sys
def find_json_files(work_dir: str) -> list:
"""Finds all JSON files in the given dir... | Ultimaker/Cura | cmake/mod_bundled_packages_json.py | Python | lgpl-3.0 | 2,593 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by the
# Free Software Foundation; either version 3, or (at your option) any later
# version.
#
# This program is distributed in the... | Splawik/pytigon | pytigon/appdata/plugins/standard/autocomplete/__init__.py | Python | lgpl-3.0 | 4,308 |
from pycp2k.inputsection import InputSection
from ._each295 import _each295
class _check_spline3(InputSection):
def __init__(self):
InputSection.__init__(self)
self.Section_parameters = None
self.Add_last = None
self.Common_iteration_levels = None
self.Filename = None
... | SINGROUP/pycp2k | pycp2k/classes/_check_spline3.py | Python | lgpl-3.0 | 674 |
#
# This is copied from CVXOPT examples and modified to be used as test reference
# for corresponding Go program.
#
import sys
from cvxopt import matrix, solvers
import helpers
import localcones
def testsdp(opts):
c = matrix([1.,-1.,1.])
G = [ matrix([[-7., -11., -11., 3.],
[ 7., -18., -... | hrautila/go.opt | tests/py/testsdp.py | Python | lgpl-3.0 | 1,573 |
# This program is free software; you can redistribute it and/or modify
# it under the terms of the (LGPL) GNU Lesser General Public License as
# published by the Free Software Foundation; either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will ... | unomena/suds | suds/client.py | Python | lgpl-3.0 | 25,982 |
from __future__ import division
import os
from functools import reduce
def secure_randint(bitspace):
delbits = 8 - (bitspace % 8)
bytez = os.urandom(bitspace // 8)
if delbits > 0:
b = (os.urandom(1)[0] & (0xFF >> delbits)).to_bytes(1, 'big', signed=False)
bytez = b + bytez
return redu... | qstokkink/py-ipv8 | ipv8/attestation/wallet/irmaexact/__init__.py | Python | lgpl-3.0 | 360 |
from pycp2k.inputsection import InputSection
from ._each112 import _each112
class _davidson2(InputSection):
def __init__(self):
InputSection.__init__(self)
self.Section_parameters = None
self.Add_last = None
self.Common_iteration_levels = None
self.Filename = None
s... | SINGROUP/pycp2k | pycp2k/classes/_davidson2.py | Python | lgpl-3.0 | 666 |
#!/usr/bin/env python
#
# Copyright (C) 2012 Jay Sigbrandt <jsigbrandt@slb.com>
# Martin Owens <doctormo@gmail.com>
#
# 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; ei... | doctormo/python-crontab | tests/test_usage.py | Python | lgpl-3.0 | 7,441 |
__author__ = 'rainierababao'
"""Generates fake patient data.
Primary features are height and weight.
Primary labels are
"""
| rainiera/health-hack | models/prep_patient_data.py | Python | unlicense | 129 |
import webbrowser
import os
import re
from books import Book, Movie
# Styles and scripting for the page
main_page_head = '''
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Book reviews</title>
<!-- Bootstrap 3 -->
<link rel="stylesheet" href="https://netdna.bootstrapcdn.com/boot... | HeatherJW/Code | book_review/book_reviews.py | Python | unlicense | 8,418 |