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 |
|---|---|---|---|---|---|
class config_eval_osm_id(config_base):
mutable = 1
def eval_osm_id(param):
return current['object']['id']
# TESTS
# IN []
# OUT 'n123'
| plepe/pgmapcss | pgmapcss/eval/eval_osm_id.py | Python | agpl-3.0 | 145 |
# Copyright 2013 by Michiel de Hoon. All rights reserved.
# Copyright 2016 modified by Kevin Ha
# This code is part of the Biopython distribution and governed by its
# license. Please see the LICENSE file that should have been included
# as part of this package.
#
from Bio.motifs import matrix
from Bio.Alphabet imp... | morrislab/rnascan | rnascan/BioAddons/motifs/matrix.py | Python | agpl-3.0 | 2,895 |
# -*- coding: utf-8 -*-
# Copyright (C) 2014-2017 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2017 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014-2017 David Barragán <bameda@dbarragan.com>
# Copyright (C) 2014-2017 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# This program is free software: you can r... | dayatz/taiga-back | taiga/timeline/__init__.py | Python | agpl-3.0 | 997 |
# -*- coding: utf-8 -*-
"""
Tests for video outline API
"""
# pylint: disable=no-member
import ddt
import itertools
from uuid import uuid4
from collections import namedtuple
from edxval import api
from mobile_api.models import MobileApiConfig
from xmodule.modulestore.tests.factories import ItemFactory
from xmodule.vid... | eestay/edx-platform | lms/djangoapps/mobile_api/video_outlines/tests.py | Python | agpl-3.0 | 33,840 |
# -*- coding: utf-8 -*-
from flask import Flask
from flask.ext.restful import Api
from blatt.api.resources import (ArticleResource, JournalistResource,
MediaResource, PublicationResource)
app = Flask(__name__)
app.config.from_object('blatt.api.config')
api = Api(app)
api.add_resource... | tooxie/blatt | blatt/api/app.py | Python | agpl-3.0 | 833 |
# Copyright (c) 2015-2021 Anish Athalye (me@anishathalye.com)
#
# This software is released under AGPLv3. See the included LICENSE.txt for
# details.
from flask import Flask
app = Flask(__name__)
import gavel.settings as settings
app.config['SQLALCHEMY_DATABASE_URI'] = settings.DB_URI
app.config['SQLALCHEMY_TRACK_MOD... | anishathalye/gavel | gavel/__init__.py | Python | agpl-3.0 | 1,160 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2015. Tšili Lauri Johannes
#
# 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 ... | tsili/datpy | datpy/record/fields/publication.py | Python | agpl-3.0 | 979 |
"""
Tests for wiki permissions
"""
from django.contrib.auth.models import Group
from student.tests.factories import UserFactory
from xmodule.modulestore.tests.factories import CourseFactory
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from django.test.utils import override_settings
from cour... | morenopc/edx-platform | lms/djangoapps/course_wiki/tests/test_access.py | Python | agpl-3.0 | 8,738 |
# Generated by Django 1.11.4 on 2017-08-14 13:52
from __future__ import unicode_literals
from django.db import migrations
import localflavor.generic.models
class Migration(migrations.Migration):
dependencies = [
('user', '0028_add_user_can_resend_creds_to_power_user'),
]
operations = [
... | defivelo/db | apps/user/migrations/0029_auto_20170814_1552.py | Python | agpl-3.0 | 765 |
#------------------------------------------------------------------------------
# Copyright (C) 2009 Richard Lincoln
#
# 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; version 2 dated June... | rwl/openpowersystem | dynamics/dynamics/voltage_compensator/voltage_compensator.py | Python | agpl-3.0 | 1,867 |
# -*- coding: utf-8 -*-
'''
This file is part of Habitam.
Habitam 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.
Habitam is distr... | habitam/habitam-core | habitam/downloads/register.py | Python | agpl-3.0 | 8,200 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import filemanager.models
def deleteDeadFiles(apps, schema_editor):
fileObject = apps.get_model("filemanager", "fileObject")
files = fileObject.objects.all()
for fileInstance in files:
if not ... | Rhombik/rhombik-object-repository | filemanager/migrations/0004_auto_20150327_2335.py | Python | agpl-3.0 | 796 |
# -*- coding: utf-8 -*-
##############################################################################
#
# Infrastructure
# Copyright (C) 2014 Ingenieria ADHOC
# No email
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License... | 3dfxmadscientist/odoo-infrastructure | addons/infrastructure/instance.py | Python | agpl-3.0 | 2,237 |
# This file is part of Irianas (Client).
# Copyright (C) 2013 Irisel Gonzalez.
# Authors: Irisel Gonzalez <irisel.gonzalez@gmail.com>
#
from irianas_client.services.commons import CommonService
"""
Config basic for the config file my.cnf
"""
config_basic = {
"mysqld":
{
"datadir": "/var/lib/mysql",
... | Irigonzalez/irianas-client | irianas_client/services/database/mysql.py | Python | agpl-3.0 | 5,418 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.11 on 2018-05-04 15:35
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("services", "0056_unit_accessibility_viewpoint_nullable"),
]
operations = [
migrati... | City-of-Helsinki/smbackend | services/migrations/0057_remove_service_unit_count.py | Python | agpl-3.0 | 419 |
from django.contrib.auth.decorators import login_required, user_passes_test
from django.conf.urls import patterns, include, url
from django.core.urlresolvers import reverse_lazy
from django.views.generic.edit import DeleteView
from warehouse.models import *
from warehouse.views import *
from django.contrib import adm... | wlanslovenija/nodewatcher-warehouse | nodewatcherwarehouse/warehouse/urls.py | Python | agpl-3.0 | 1,471 |
from vertex.filters import IdListFilterSet
from ..models import Ticket
class TicketFilterSet(IdListFilterSet):
class Meta:
model = Ticket
| zapcoop/vertex | vertex_api/service/filters/ticket.py | Python | agpl-3.0 | 153 |
"""
Tests for methods defined in mongo_utils.py
"""
import ddt
import os
from unittest import TestCase
from uuid import uuid4
from pymongo import ReadPreference
from xmodule.mongo_utils import connect_to_mongodb
@ddt.ddt
class MongoUtilsTests(TestCase):
"""
Tests for methods exposed in mongo_utils
"""
... | jolyonb/edx-platform | common/lib/xmodule/xmodule/tests/test_mongo_utils.py | Python | agpl-3.0 | 1,414 |
# -*- coding: utf-8 -*-
# -*- encoding: utf-8 -*-
#############################################################################
#
# Copyright (c) 2007 Martin Reisenhofer <martin.reisenhofer@funkring.net>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU G... | funkring/fdoo | addons-funkring/at_hr/hr_timesheet.py | Python | agpl-3.0 | 11,031 |
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2015 Compassion CH (http://www.compassion.ch)
# Releasing children from poverty in Jesus' name
# @author: Emmanuel Mathier <emmanuel.mathier@gmail.com>
#
# The licence is in the file __ma... | maxime-beck/compassion-modules | sbc_compassion/models/__init__.py | Python | agpl-3.0 | 892 |
import logging
import markdown2
import textwrap
from xblock.core import XBlock
from xblock.fields import Scope, String, List
from xblock.fragment import Fragment
from xblockutils.resources import ResourceLoader
from xblockutils.studio_editable import StudioEditableXBlockMixin
log = logging.getLogger(__name__)
loader ... | hastexo/markdown-xblock | mdown/mdown.py | Python | agpl-3.0 | 6,219 |
"""
Instructor (2) dashboard page.
"""
from bok_choy.page_object import PageObject
from .instructor_dashboard import InstructorDashboardPage as EdXInstructorDashboardPage, \
MembershipPage as EdXMembershipPage
class InstructorDashboardPage(EdXInstructorDashboardPage):
"""
Instructor dashboard, where cour... | nttks/edx-platform | common/test/acceptance/pages/lms/ga_instructor_dashboard.py | Python | agpl-3.0 | 3,984 |
import logging
from django.db import IntegrityError, transaction
import traceback
import sys
from moveon.models import Company, Transport, Line, Station, Node, Route, Stretch, RoutePoint
logger = logging.getLogger(__name__)
class OSMLineManager():
def __init__(self, osmline):
self.osmline = osmline
... | SeGarVi/moveon-web | moveon/osmlinemanager.py | Python | agpl-3.0 | 4,081 |
# coding: utf-8
# Copyright (c) 2001-2018, Canal TP and/or its affiliates. All rights reserved.
#
# This file is part of Navitia,
# the software to build cool stuff with public transport.
#
# powered by Canal TP (www.canaltp.fr).
# Help us simplify mobility and open public transport:
# a non ending quest to... | kinnou02/navitia | source/tyr/tests/integration/users_test.py | Python | agpl-3.0 | 25,630 |
# -*- coding: utf-8 -*-
import logging
import time
_logger = logging.getLogger(__name__)
from openerp import http
from openerp.addons.hw_proxy.controllers.main import Proxy
# drivers modules must add to drivers an object with a get_status() method
# so that 'status' can return the status of all active drivers
drive... | MarcosCommunity/odoo | marcos_addons/marcos_pos/hw_proxy/main.py | Python | agpl-3.0 | 8,125 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("moderation_queue", "0012_auto_20150717_0811")]
operations = [
migrations.AlterField(
model_name="queuedimage",
name="why_allowed",
field=models.CharField(
... | DemocracyClub/yournextrepresentative | ynr/apps/moderation_queue/migrations/0013_auto_20150916_1753.py | Python | agpl-3.0 | 1,141 |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2015-2018: Alignak team, see AUTHORS.txt file for contributors
#
# This file is part of Alignak.
#
# Alignak 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, eit... | Alignak-monitoring/alignak | alignak/misc/common.py | Python | agpl-3.0 | 5,657 |
###############################################################################
#
# 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 as published
# by the ... | Micronaet/micronaet-order | close_residual_order/__openerp__.py | Python | agpl-3.0 | 1,752 |
# -*- encoding: utf-8 -*-
##############################################################################
#
# Author: Luis Felipe Miléo - mileo @ kmee.com.br
# Copyright 2014 KMEE - KM Enterprise Engineering
# https://www.kmee.com.br
#
# This program is free software: you can redistribute it and/or modify
# ... | kmee/kmee_odoo_brasil_addons | __unported__/l10n_br_sale_discount_included_on_invoice/model/sale_order.py | Python | agpl-3.0 | 1,568 |
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import webnotes
from webnotes.utils import flt
def execute(filters=None):
if not filters: filters = {}
columns = get_columns()
data = get_tr... | gangadhar-kadam/powapp | selling/report/sub_franchise_visiting_schedule/sub_franchise_visiting_schedule.py | Python | agpl-3.0 | 845 |
# Ariane CLI Python 3
# Cluster acceptance tests
#
# Copyright (C) 2015 echinopsii
#
# 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)... | echinopsii/net.echinopsii.ariane.community.cli.python3 | tests/acceptance/mapping/cluster_rest_at.py | Python | agpl-3.0 | 7,827 |
from django.db.models.signals import post_delete, post_save
from django.db.utils import IntegrityError
from django.dispatch import receiver
from grouprise.features.memberships.models import Membership
from grouprise.features.subscriptions.models import Subscription
@receiver(post_save, sender=Membership)
def members... | stadtgestalten/stadtgestalten | grouprise/features/subscriptions/signals.py | Python | agpl-3.0 | 979 |
# -*- coding: utf8 -*-
#
# Copyright (C) 2015 NDP Systèmes (<http://www.ndp-systemes.fr>).
#
# 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,... | ndp-systemes/odoo-addons | stock_change_quant_reservation/wizard/stock_change_quant_reservation_wizard.py | Python | agpl-3.0 | 5,975 |
# This file is part of Supysonic.
# Supysonic is a Python implementation of the Subsonic server API.
#
# Copyright (C) 2013-2020 Alban 'spl0k' Féron
# 2017 Óscar García Amor
#
# Distributed under terms of the GNU AGPLv3 license.
import os
import sys
import tempfile
from configparser import RawConfi... | spl0k/supysonic | supysonic/config.py | Python | agpl-3.0 | 2,620 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
def data_migration(apps, schema_editor):
MicroServiceChain = apps.get_model('main', 'MicroServiceChain')
MicroServiceChainLink = apps.get_model('main', 'MicroServiceChainLink')
TaskConfig = apps.get_mo... | sevein/archivematica | src/dashboard/src/main/migrations/0019_index_after_processing_decision.py | Python | agpl-3.0 | 3,090 |
"""
Tests for enrollment refund capabilities.
"""
from datetime import datetime, timedelta
import ddt
import httpretty
import logging
import pytz
import unittest
from django.conf import settings
from django.core.urlresolvers import reverse
from django.test.client import Client
from django.test.utils import overrid... | prarthitm/edxplatform | common/djangoapps/student/tests/test_refunds.py | Python | agpl-3.0 | 8,342 |
# Copyright (c) 2014 by Ecreall under licence AGPL terms
# available on http://www.gnu.org/licenses/agpl.html
# licence: AGPL
# author: Amen Souissi
from pyramid.view import view_config
from dace.processinstance.core import (
DEFAULTMAPPING_ACTIONS_VIEWS)
from pontus.view import BasicView
from lac.content.proc... | ecreall/lagendacommun | lac/views/services_processes/newsletter_service/newsletter_management/see_content_history.py | Python | agpl-3.0 | 1,496 |
#!/usr/bin/env python
import sys, os, json, re, uuid
if len(sys.argv) < 2:
print("Usage: generate_uuids <coursedir>")
sys.exit(0)
start_re = re.compile(r"^(\s*{ *\n)(.*)$", re.DOTALL)
def add_uuid_to_file(filename):
try:
with open(filename) as in_f:
contents = in_f.read()
... | lotrfan/PrairieLearn | tools/generate_uuids.py | Python | agpl-3.0 | 3,163 |
# Author: Damien Crier
# Copyright 2016 Camptocamp SA
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import models
class ResCompany(models.Model):
_inherit = 'res.company'
def find_daterange_fy(self, date):
"""
try to find a date range with type 'fiscalyear'
... | avoinsystems/account-financial-tools | account_move_fiscal_year/models/res_company.py | Python | agpl-3.0 | 628 |
from odoo import models, fields
import logging
_logger = logging.getLogger(__name__)
class ResConfigSettings(models.TransientModel):
_inherit = 'res.config.settings'
group_choose_payment_type = fields.Boolean(
'Choose Payment Type on Payments',
implied_group='account_payment_group.group_choos... | ingadhoc/account-payment | account_payment_group/wizards/res_config_settings.py | Python | agpl-3.0 | 1,029 |
import logging
import pecan
import time
from joulupukki.dispatcher.dispatcher.dispatcher import Dispatcher
from joulupukki.common.datamodel.build import Build
from joulupukki.common.datamodel.project import Project
from joulupukki.common.datamodel.user import User
from joulupukki.common.database import mongo
from joul... | jlpk/joulupukki-dispatcher | joulupukki/dispatcher/dispatcher/manager.py | Python | agpl-3.0 | 3,271 |
#!/usr/bin/env python
# -*- coding: utf-8 -*- #
from __future__ import unicode_literals
# This file is only used if you use `make publish` or
# explicitly specify it as your config file.
import os
import sys
sys.path.append(os.curdir)
from pelicanconf import *
# 因為 publishconf.py 在 pelicanconf.py 之後, 因此若兩處有相同變數的設定, ... | smpss91341/2016springcd_aG8 | static/publishconf.py | Python | agpl-3.0 | 1,717 |
import datetime
from django.core.exceptions import MultipleObjectsReturned, ObjectDoesNotExist
from django.core.management.base import BaseCommand
from django.db.models import Count
from badgeuser.models import BadgeUser, CachedEmailAddress
class Command(BaseCommand):
def handle(self, *args, **options):
... | concentricsky/badgr-server | apps/badgeuser/management/commands/delete_superseded_users.py | Python | agpl-3.0 | 2,783 |
# vim:fileencoding=utf-8:sw=4:et:syntax=python
path = require("path")
fs = require("fs")
net = require("net")
dnsproxy = require("./dns-proxy")
reversesogouproxy = require("./reverse-sogou-proxy")
urllistmanager = require("./url-list-manager")
lutils = require("./lutils")
log = lutils.logger
appname = "ub.uku.droxy"... | JuntianX/Unblock-Youku | dns-reverse-proxy/droxy.py | Python | agpl-3.0 | 14,679 |
#!/usr/bin/env python
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
setup(
name='rdfspace',
version='0.0.4',
description="""RDFSpace constructs a vector space
from any RDF dataset which can be used for
computing similarit... | bbcrd/rdfspace | setup.py | Python | agpl-3.0 | 566 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# ===========================================================================
# NEWS CHANNEL GENERATION SCRIPT
# AUTHORS: LARSEN VALLECILLO
# ****************************************************************************
# Copyright (c) 2015-2022 RiiConnect24, and its (Lead) Dev... | RiiConnect24/File-Maker | Channels/News_Channel/newsmake.py | Python | agpl-3.0 | 39,847 |
# -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# This module copyright (C) cgstudiomap <cgstudiomap@gmail.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of... | cgstudiomap/cgstudiomap | main/local_modules/res_partner_count/res_partner.py | Python | agpl-3.0 | 2,136 |
# -*- coding: utf-8 -*-
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# LICENSE
#
# Copyright (C) 2010-2022 GEM Foundation, G. Weatherill, M. Pagani,
# D. Monelli.
#
# The Hazard Modeller's Toolkit is free software: you can redistribute
# it and/or modify it under the terms of the GNU Affero General Public
# License a... | gem/oq-engine | openquake/hmtk/parsers/catalogue/base.py | Python | agpl-3.0 | 3,213 |
# -*- coding: UTF-8 -*-
"""Multi-platform terminal size get function.
Source: https://gist.githubusercontent.com/jtriley/1108174/raw/6ec4c846427120aa342912956c7f717b586f1ddb/terminalsize.py
"""
import os
import shlex
import struct
import platform
import subprocess
__author__ = "Justin Riley (https://gist.github.com/j... | dhondta/tinyscript | tinyscript/helpers/termsize.py | Python | agpl-3.0 | 2,855 |
from __future__ import absolute_import
# coding=utf-8
__author__ = "Gina Häußge <osd@foosel.net> based on work by David Braam"
__license__ = "GNU Affero General Public License http://www.gnu.org/licenses/agpl.html"
__copyright__ = "Copyright (C) 2013 David Braam - Released under terms of the AGPLv3 License"
import os... | ymilord/OctoPrint-MrBeam | src/octoprint/util/comm.py | Python | agpl-3.0 | 49,358 |
import unittest
import signal
import dbus
from systemd.manager import Manager
from systemd.exceptions import SystemdError
from systemd.unit import Unit
from systemd.job import Job
class ManagerTest(unittest.TestCase):
# Stolen from Django framework
def assertRaisesErrorWithMessage(self, error, message, call... | wiliamsouza/python-systemd | tests/manager_test.py | Python | lgpl-2.1 | 6,219 |
#!/usr/bin/env python
#------------------------------------------------------------------------------
#
# Meta Data Cutting
#
# Author: kevin.kreiser@mapquest.com
#
# Copyright 2010-1 Mapquest, Inc. All Rights reserved.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of... | artemp/MapQuest-Render-Stack | py/metacutter.py | Python | lgpl-2.1 | 8,060 |
##############################################################################
# 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/perl-test-differences/package.py | Python | lgpl-2.1 | 1,791 |
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
import os
class PyPybind11(CMakePackage):
"""pybind11 -- Seamless operability between C++11 and ... | rspavel/spack | var/spack/repos/builtin/packages/py-pybind11/package.py | Python | lgpl-2.1 | 3,731 |
# python
# This file is generated by a program (mib2py).
import CONFIG_MIB
OIDMAP = {
'1.3.6.1.4.1.11.2.14.11.5.1.7': CONFIG_MIB.hpConfig,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1': CONFIG_MIB.hpSwitchConfig,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.1': CONFIG_MIB.hpSwitchSystemConfig,
'1.3.6.1.4.1.11.2.14.11.5.1.7.1.2': CONFIG_MIB.h... | xiangke/pycopia | mibs/pycopia/mibs/CONFIG_MIB_OID.py | Python | lgpl-2.1 | 14,182 |
#!/usr/bin/env python3
from gi.repository import LibvirtGObject
from gi.repository import LibvirtSandbox
from gi.repository import GLib
from gi.repository import Gtk
import sys
import os
args = sys.argv[1:]
LibvirtGObject.init_object_check(None)
cfg = LibvirtSandbox.ConfigInteractive.new("sandbox")
if len(args) > 0... | libvirt/libvirt-sandbox | examples/virt-sandbox.py | Python | lgpl-2.1 | 762 |
import base64
import sys
import time
__all__ = [
"BytesIO",
"MAXSIZE",
"PY2",
"StringIO",
"b",
"b2s",
"builtins",
"byte_chr",
"byte_mask",
"byte_ord",
"bytes",
"bytes_types",
"decodebytes",
"encodebytes",
"input",
"integer_types",
"is_callable",
"... | paramiko/paramiko | paramiko/py3compat.py | Python | lgpl-2.1 | 4,211 |
# -*- Mode: Python -*-
# coding=utf-8
# GDBus - GLib D-Bus Library
#
# Copyright (C) 2008-2018 Red Hat, Inc.
# Copyright (C) 2018 Iñigo Martínez <inigomartinez@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 publishe... | frida/glib | gio/gdbus-2.0/codegen/codegen.py | Python | lgpl-2.1 | 230,292 |
#
# 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-647188
#
# For details, see https://github.com/spack/spack
# Please also see th... | EmreAtes/spack | lib/spack/spack/fetch_strategy.py | Python | lgpl-2.1 | 36,034 |
# -*- coding: utf-8 -*-
from .baseapi import BaseAPI, POST, DELETE, PUT
class Record(BaseAPI):
"""
An object representing an DigitalOcean Domain Record.
Args:
type (str): The type of the DNS record (e.g. A, CNAME, TXT).
name (str): The host name, alias, or service being defined by the
... | koalalorenzo/python-digitalocean | digitalocean/Record.py | Python | lgpl-3.0 | 4,016 |
# -*- coding: utf8 -*-
'''
Класс указателя стека.
val -- максимальное значение регистра.
Устанавливается по количеству максимальной допустимой памяти.
min_adr -- дно стека.
'''
class ClsRegSP:
def __init__(self, val=None, min_adr=None):
self.val = val
self.min_adr = min_adr
| prospero78/pyPC | pak_pc/pak_cpu/pak_reg/mod_reg_sp.py | Python | lgpl-3.0 | 410 |
# -*- coding: utf-8 -*-
"""
Functions of initialization layers
"""
from neurolab import mynp as np
def init_rand(layer, min=-0.5, max=0.5, init_prop='w'):
"""
Initialize the specified property of the layer
random numbers within specified limits
:Parameters:
layer:
Initialized ... | inferrna/neurolabcl | neurolab/init.py | Python | lgpl-3.0 | 3,292 |
# -*- coding: utf-8 -*-
# Resource object code
#
# Created by: The Resource Compiler for PySide2 (Qt v5.9.3)
#
# WARNING! All changes made in this file will be lost!
from PySide2 import QtCore
qt_resource_data = b"\
\x00\x00\x07\xa0\
\x3c\
\x3f\x78\x6d\x6c\x20\x76\x65\x72\x73\x69\x6f\x6e\x3d\x22\x31\x2e\
\x30\x22\x2... | SanPen/GridCal | src/api_rest/Gui/Main/icons_rc.py | Python | lgpl-3.0 | 331,926 |
"""This module contains my common ultilities functions
1 create win32 mouse cursor event
2 config for progressbar, logging
3 Class: MyTimer
"""
__author__ = 'Weichao Xu'
__version__ = "0.0.1"
__status__ = "Dev"
# ########## imports ##########
import sys, os, re, string, time, logging
import math, numpy, ran... | WDavidX/pyutil | wxu.py | Python | lgpl-3.0 | 5,763 |
#!/usr/bin/env python3
# Copyright (c) 2016 The crimson Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
from test_framework.mininode import *
from test_framework.test_framework import crimsonTestFramework
from test... | CrimsonDev14/crimsoncoin | qa/rpc-tests/p2p-versionbits-warning.py | Python | lgpl-3.0 | 6,836 |
from mpi4py import MPI
import numpy
import unittest
from floatpy.parallel import t3dmod
import floatpy.utilities.reduction as red
class TestReduction(unittest.TestCase):
def setUp(self):
self.nx, self.ny, self.nz = 64, 32, 16
self.omega_x, self.omega_y, self.omega_z = 1., 2., 3.
sel... | FPAL-Stanford-University/FloATPy | floatpy/tests/mpitest_reduction.py | Python | lgpl-3.0 | 6,586 |
from . import BackupHandler
from ..result import CommandExecutionResult
from ..exceptions import ReadWriteException
from ..entity.definition import CommandOutputDefinition
class CommandOutputBackup(BackupHandler):
def _get_definition(self) -> CommandOutputDefinition:
return self._definition
def _va... | Wolnosciowiec/file-repository | client/bahub/bahubapp/handler/commandoutputbackup.py | Python | lgpl-3.0 | 1,014 |
"""
This file defines:
-quad_area_centroid (method)
- CHEXA8 (class)
- f1
- f2
"""
from __future__ import print_function
from six.moves import zip, range
from numpy import arange, cross, abs, searchsorted, array, ones, eye
from numpy.linalg import norm
from pyNastran.bdf.field_writer_8 import print_card_8
... | saullocastro/pyNastran | pyNastran/bdf/dev_vectorized/cards/elements/solid/chexa8.py | Python | lgpl-3.0 | 18,501 |
"""
Copyright (c) 2015-2019 Nitrokey UG
This file is part of libnitrokey.
libnitrokey 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
any later version.
libnitrokey is... | Nitrokey/libnitrokey | unittest/conftest.py | Python | lgpl-3.0 | 5,914 |
# Copyright (C) 2015-2022 by the RBniCS authors
#
# This file is part of RBniCS.
#
# SPDX-License-Identifier: LGPL-3.0-or-later
from rbnics.shape_parametrization.problems.affine_shape_parametrization import AffineShapeParametrization
from rbnics.shape_parametrization.problems.affine_shape_parametrization_decorated_pro... | mathLab/RBniCS | rbnics/shape_parametrization/problems/__init__.py | Python | lgpl-3.0 | 1,198 |
#!/usr/bin/python
#-*- coding: utf-8 -*-
"""
.. currentmodule:: pylayers.measures.mesuwb
RAW_DATA Class
==============
.. autosummary::
:toctree: generated/
RAW_DATA.__init__
CAL_DATA Class
==============
.. autosummary::
:toctree: generated/
CAL_DATA.__init__
CAL_DATA.plot
CAL_DATA.getw... | buguen/pylayers | pylayers/measures/mesuwb.py | Python | lgpl-3.0 | 77,904 |
# ==============================================================================
# Copyright (C) 2011 Diego Duclos
# Copyright (C) 2011-2018 Anton Vorobyov
#
# This file is part of Eos.
#
# Eos is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as publi... | pyfa-org/eos | eos/data_handler/base.py | Python | lgpl-3.0 | 3,864 |
"""A minimal python interface to read Amptek's mca files"""
import re
import sys
import warnings
import matplotlib.pyplot as plt
import numpy as np
from scipy import interpolate
from scipy.stats import linregress
from io import open # python 2 compatibility
__author__ = 'Dih5'
__version__ = "0.4.0"
def _str_to_a... | Dih5/mcareader | mcareader.py | Python | lgpl-3.0 | 9,128 |
import socket
import serial
import time
DEFAULT_SERIAL_PORT = "/dev/ttyUSB0"
DEFAULT_SERIAL_BAUD = 1000000
DEFAULT_UDP_ADDRESS = "127.0.0.1"
DEFAULT_UDP_PORT = 13320
def get_args():
"""
Get and parse arguments.
"""
import argparse
parser = argparse.ArgumentParser(description="Swift Navigation UDP Receive t... | mfine/piksi_tools | piksi_tools/ardupilot/udp_receive.py | Python | lgpl-3.0 | 1,635 |
from __future__ import division
from __future__ import print_function
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2013 Adam.Dybbroe
# Author(s):
# Adam.Dybbroe <a000680@c14526.ad.smhi.se>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Gene... | meteoswiss-mdr/monti-pytroll | scripts/demo_refl039.py | Python | lgpl-3.0 | 4,143 |
try:
import eigen
except ImportError:
import eigen3 as eigen
try:
import sva
except ImportError:
import spacevecalg as sva
import rbdyn
def makeZXZArm(isFixed = True, X_base = sva.PTransformd.Identity()):
mbg = rbdyn.MultiBodyGraph()
mass = 1.0
I = eigen.Matrix3d.Identity()
h = eigen.Vector3d.Zero()
... | jorisv/Tasks | binding/python/tests/arms.py | Python | lgpl-3.0 | 1,512 |
from font import _font as font
out=""
for i in font:
out+="".join(i)
with open("font.ort", 'w') as fd:
fd.write("function() get_font -> ptr does\nreturn \"")
fd.write(out)
fd.write("\"\nfunction() get_colors -> ptr does\nreturn \"")
for item in [[0,0,0],
[0,0,170],
[0,170,0],
[0,170,170],
[170,0,0... | 602p/orth | os/kernel/font/makefont.py | Python | lgpl-3.0 | 611 |
#!/usr/bin/env python
import pyaudio
import wave
import audioop
from collections import deque
import os
import urllib2
import urllib
import time
import math
import thread
import threading
import cv2
import sys
import httplib, urllib, base64
import numpy as np
import json
import Image
from BaseHTTPServer import BaseHTTP... | liyazhuo/emotional_intelligence | babyMonitor.py | Python | lgpl-3.0 | 11,850 |
import os
import time
os.system('cls')
rows = 6
cols = 50
grid = []
for _ in range(rows):
grid.append([False] * cols)
for line in open('input.txt', 'r'):
if line.startswith('rect'):
(a, b) = line[4:].strip().split('x')
for i in range(int(b)):
for j in range(int(a)):
... | ultramega/adventofcode2016 | day08/part2.py | Python | unlicense | 1,019 |
#!/usr/bin/env python
from sqlite3 import connect as sqconnect
from uuid import uuid4
from hashlib import sha512
from optparse import OptionParser
opts = OptionParser()
opts.add_option(
'-i', '--init-db', dest='initdb',
action='store_true', default=False,
help="Initialize the database"
)
opts.add_option(
... | Kungbib/data.kb.se | flaskapp/initdb.py | Python | unlicense | 3,461 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
class DNA(object):
def __init__(self, dna):
self.dna = dna.upper()
def to_rna(self):
return self.dna.replace('T', 'U')
| mvader/exercism-solutions | python/rna-transcription/dna.py | Python | unlicense | 173 |
from threadly import Clock
class Stats(object):
def __init__(self):
self.__clock = Clock()
self.__startTime = self.__clock.accurate_time()
self.__totalRead = 0
self.__totalWrite = 0
def getTotalRead(self):
"""
Returns the total bytes read.
"""
return self.__totalRead
def get... | lwahlmeier/python-litesockets | litesockets/stats.py | Python | unlicense | 1,153 |
from sys import argv
if len(argv) == 1:
print("No input given. Assuming input is on the first line of \'input\'.")
input_string = open('input').readline()
else:
input_string = argv[1]
def get_twice_coordinate(string):
"""Returns the coordinates of the first place where you've been twice."""
strin... | editicalu/adventofcode2016 | 01/b.py | Python | unlicense | 1,836 |
import os
PROJECT_PATH = os.path.dirname(os.path.dirname(__file__))
BASE_PATH = os.path.dirname(PROJECT_PATH)
| kowalskj/django_MY_PROGECT | MY_PROGECT/settings/paths.py | Python | unlicense | 117 |
"""
houses support routines and the command-line dispatchers for carml
command.
"""
__all__ = []
__version__ = '20.0.0'
| meejah/carml | carml/__init__.py | Python | unlicense | 121 |
import logging
from google.appengine.api import search
from webapp2 import (
WSGIApplication as Endpoint,
Route as path,
RequestHandler as Service
)
from webapp2_extras.routes import (
PathPrefixRoute as base
)
import convert
import geofencesearch
from service import Service
class TerritorySer... | dosaygo/mozio-geofence-api-hiring-project | api/territory.py | Python | unlicense | 2,860 |
import unittest
import utils
from linkedlist import ListNode
# O(n) time. O(1) space. Two pointers
class Solution:
def partition(self, head: ListNode, x: int) -> ListNode:
dummy_lo = lo = ListNode(0)
dummy_hi = hi = ListNode(0)
while head:
if head.val < x:
lo.... | chrisxue815/leetcode_python | problems/test_0086.py | Python | unlicense | 905 |
"""
Clone of 2048 game.
"""
import random
# Directions, DO NOT MODIFY
UP = 1
DOWN = 2
LEFT = 3
RIGHT = 4
# Offsets for computing tile indices in each direction.
# DO NOT MODIFY this dictionary.
OFFSETS = {UP: (1, 0),
DOWN: (-1, 0),
LEFT: (0, 1),
RIGHT: (0, -1)}
def should_merge_til... | algenon/poc | src/game_2048.py | Python | unlicense | 5,148 |
'''
Demo_2 sums up all the input number collected from the input and gives the average value of the inputs
'''
number = 0
i = 0
sum = 0
average = 0
n=0
print('please enter the numbers, if it equals to 0 or be less than 0, the input will end')
while True:
n = int(input('please enter a number: '))
if n <= 0:
... | AlexYu-beta/Python_Study | Demo_2/Demo2_2.py | Python | unlicense | 473 |
import gmaneLegacy as g, numpy as n
from scipy.stats import ks_2samp
a=n.random.random(1000)
b=n.random.random(1000)
b_=b+.3
aa=g.kolmogorovSmirnovDistance(a,b)
bb=ks_2samp(a,b)
aa_=g.kolmogorovSmirnovDistance(a,b_)
bb_=ks_2samp(a,b_)
b__=b+.07
aa2=g.kolmogorovSmirnovDistance(a,b__)
bb2=ks_2samp(a,b__)
| ttm/gmaneLegacy | tests/compKolm.py | Python | unlicense | 308 |
def a(x): # Объявление функции
n = 1 # Присваивание переменной n начального значения.
while n < len(x): # Задаётся условие для выполнения программы:"Пока порядковый номер элемента меньше количества элементов в списке:"
for ... | Pattystar/school-orrepo | Homework-02.3.py | Python | apache-2.0 | 1,640 |
import threading
import unittest
import mock
import pytest
class TestThreadingHandler(unittest.TestCase):
def _makeOne(self, *args):
from kazoo.handlers.threading import SequentialThreadingHandler
return SequentialThreadingHandler(*args)
def _getAsync(self, *args):
from kazoo.handle... | python-zk/kazoo | kazoo/tests/test_threading_handler.py | Python | apache-2.0 | 10,586 |
#!/usr/bin/env python
import os
import sys
__author__ = 'Douglas Anastasia'
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "CloudPortal.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| cloudtp/Cloud-Portal | manage.py | Python | apache-2.0 | 288 |
# coding=utf-8
# Copyright 2021 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 ... | google/shoptimizer | shoptimizer_api/util/color_miner_test.py | Python | apache-2.0 | 10,200 |
# coding=utf-8
# Copyright 2022 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 ... | google-research/ott | ott/tools/gaussian_mixture/gaussian_mixture_pair.py | Python | apache-2.0 | 7,513 |
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
"""
Topic: 使用函数实现设计模式
如果合理利用作为一等对象的函数,某些设计模式可以简化
"""
| yidao620c/core-python | ch06design/__init__.py | Python | apache-2.0 | 174 |
"""The kraken integration."""
from __future__ import annotations
import asyncio
from datetime import timedelta
import logging
import async_timeout
import krakenex
import pykrakenapi
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import CONF_SCAN_INTERVAL
from homeassistant.core import ... | kennedyshead/home-assistant | homeassistant/components/kraken/__init__.py | Python | apache-2.0 | 5,750 |
#!/usr/bin/python
#
# Copyright 2020 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 ag... | GoogleCloudPlatform/datacatalog-connectors | google-datacatalog-connectors-commons-test/src/google/datacatalog_connectors/commons_test/utils/__init__.py | Python | apache-2.0 | 690 |
# ===============================================================================
# Copyright 2015 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/licenses... | UManPychron/pychron | pychron/experiment/automated_run/persistence_spec.py | Python | apache-2.0 | 3,105 |
# Test osqp python module
import osqp
# import osqppurepy as osqp
import numpy as np
from scipy import sparse
# Unit Test
import unittest
import numpy.testing as nptest
import shutil as sh
class codegen_matrices_tests(unittest.TestCase):
def setUp(self):
# Simple QP problem
self.P = sparse.diags... | oxfordcontrol/osqp-python | module/tests/codegen_matrices_test.py | Python | apache-2.0 | 7,046 |