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 |
|---|---|---|---|---|---|
from django.db import models
class Ubication(models.Model):
longitud=models.CharField(max_length=50)
latitud=models.CharField(max_length=50)
| DataDrivenExperiences/Server | ubication/models.py | Python | mpl-2.0 | 150 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('wagtailcore', '0023_alter_page_revision_on_delete_behaviour'),
('productions', '0001_initial'),
]
operations = [
mig... | ghostwords/localore | localore/productions/migrations/0002_productionsindexpage.py | Python | mpl-2.0 | 695 |
#!/usr/bin/python -OO
# This file is part of Archivematica.
#
# Copyright 2010-2013 Artefactual Systems Inc. <http://artefactual.com>
#
# Archivematica 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, e... | michal-ruzicka/archivematica | src/MCPClient/lib/clientScripts/manualNormalizationMoveAccessFilesToDIP.py | Python | agpl-3.0 | 5,415 |
# -*- encoding: utf-8 -*-
##############################################################################
#
# Account Payment Partner module for OpenERP
# Copyright (C) 2014 KMEE (http://www.kmee.com.br)
# @author Luis Felipe Miléo <mileo@kmee.com.br>
#
# This program is free software: you can redistribute i... | kmee/kmee_odoo_brasil_addons | __unported__/l10n_br_account_payment_boleto/__init__.py | Python | agpl-3.0 | 1,091 |
# Copyright 2010-2011 Canonical Ltd. This software is licensed under the
# GNU Affero General Public License version 3 (see the file LICENSE).
"""A comment/message for a difference between two distribution series."""
__metaclass__ = type
__all__ = [
'DistroSeriesDifferenceComment',
]
from email.Utils impor... | abramhindle/UnnaturalCodeFork | python/testdata/launchpad/lib/lp/registry/model/distroseriesdifferencecomment.py | Python | agpl-3.0 | 4,481 |
# Generated by Django 1.9.13 on 2017-04-10 16:46
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("core", "0010_auto_20170330_1856"),
]
operations = [
migrations.AddField(
model_name="siteconfiguration",
name="theme... | edx/credentials | credentials/apps/core/migrations/0011_auto_20170410_1646.py | Python | agpl-3.0 | 612 |
def safe_unicode(obj, encoding='utf-8'):
if isinstance(obj, basestring):
if not isinstance(obj, unicode):
obj = unicode(obj, encoding)
return obj
return unicode(obj.__repr__())
# return obj.__repr__() #unicode(obj).encode('ascii','ignore')
| DrDub/poissonmagique | app/model/unicode_helper.py | Python | agpl-3.0 | 280 |
from typing import Pattern
from collatex import *
from xml.dom import pulldom
import string
import re
import json
import glob
regexWhitespace = re.compile(r'\s+')
regexNonWhitespace = re.compile(r'\S+')
regexEmptyTag = re.compile(r'/>$')
regexBlankLine = re.compile(r'\n{2,}')
regexLeadingBlankLine = re.compile(r'^\n'... | ebeshero/Pittsburgh_Frankenstein | collateXPrep/svg_tester_collation.py | Python | agpl-3.0 | 6,475 |
#! /usr/bin/env python
#
# Copyright (c) 2013 University of Utah and the Flux Group.
#
# {{{GENIPUBLIC-LICENSE
#
# GENI Public License
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and/or hardware specification (the "Work") to
# deal in the Work without restricti... | nmc-probe/emulab-nome | protogeni/test/geni-sr/lookupams.py | Python | agpl-3.0 | 1,444 |
"""
Identifier for course resources.
"""
from __future__ import absolute_import
import inspect
import logging
import re
import warnings
from abc import abstractproperty
from bson.errors import InvalidId
from bson.objectid import ObjectId
from bson.son import SON
from opaque_keys import OpaqueKey, InvalidKeyError
fr... | devs1991/test_edx_docmode | venv/lib/python2.7/site-packages/opaque_keys/edx/locator.py | Python | agpl-3.0 | 49,807 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('auth', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='CustomUser',... | asm-products/pants-party | ppuser/migrations/0001_initial.py | Python | agpl-3.0 | 2,837 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) 2015-2017:
# Frederic Mohier, frederic.mohier@alignak.net
#
# This file is part of (WebUI).
#
# (WebUI) 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 F... | mohierf/bottle-webui | alignak_webui/plugins/alignakdaemon/alignakdaemon.py | Python | agpl-3.0 | 3,639 |
# -*- coding: utf-8 -*-
# from __future__ import unicode_literals
import sys, os
extensions = []
templates_path = []
from atelier.sphinxconf import configure
configure(globals())
# extensions += ['atelier.sphinxconf.blog']
# extensions += ['lino.utils.actordoc']
# extensions += ['sphinxcontrib.taglist'... | lsaffre/presto | dedocs/conf.py | Python | agpl-3.0 | 7,199 |
"""Learner dashboard views"""
from __future__ import absolute_import
from django.contrib.auth.decorators import login_required
from django.views.decorators.http import require_GET
from edxmako.shortcuts import render_to_response
from lms.djangoapps.learner_dashboard.programs import ProgramDetailsFragmentView, Program... | jolyonb/edx-platform | lms/djangoapps/learner_dashboard/views.py | Python | agpl-3.0 | 1,843 |
# Copyright 2014-2015 Rumma & Ko Ltd
# License: GNU Affero General Public License v3 (see file COPYING for details)
"""This module is internally named after the notion of
`Scout badges <http://en.wikipedia.org/wiki/Scout_badge>`.
It defines two models "Badge" and "Award". Badges represent the
different achievement l... | lino-framework/welfare | lino_welfare/modlib/badges/__init__.py | Python | agpl-3.0 | 1,244 |
from googleplaces import GooglePlaces
from django.views.generic.edit import FormView
from django.views.decorators.csrf import csrf_exempt
from django.conf import settings
from planner.models import Place
from planner.forms import DayPlanForm
from planner.utils import distance_in_meters
from ads.models import Ad
googl... | omouse/staykat | app/planner/views.py | Python | agpl-3.0 | 3,039 |
import os
import sys
import msgfmt
from setuptools import setup
from setuptools.command.install_lib import install_lib as _install_lib
from setuptools.command.develop import develop as _develop
from distutils.command.build import build as _build
from setuptools.command.test import test as TestCommand
from distutils.cm... | g3-3k/libreant | setup.py | Python | agpl-3.0 | 4,512 |
# -*- coding: utf-8 -*-
#
# Configuration file for the Sphinx documentation on 2020-05-05 21:08:30
#
# This file does only contain a selection of the most common options. For a
# full list see the documentation:
# http://www.sphinx-doc.org/en/master/config
# -- Path setup ----------------------------------------------... | antoniov/tools | os0/docs/conf.py | Python | agpl-3.0 | 4,694 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.8 on 2018-01-30 10:00
from __future__ import unicode_literals
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [("people", "0024_auto_20171220_1737")]
operations = [
migrati... | lafranceinsoumise/api-django | agir/people/migrations/0025_auto_20180130_1100.py | Python | agpl-3.0 | 1,467 |
# Amara, universalsubtitles.org
#
# Copyright (C) 2013 Participatory Culture Foundation
#
# 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 op... | ujdhesa/unisubs | apps/teams/views.py | Python | agpl-3.0 | 81,753 |
import json
import logging
from lxml import etree
from xmodule.capa_module import ComplexEncoder
from xmodule.progress import Progress
from xmodule.stringify import stringify_children
import openendedchild
from .combined_open_ended_rubric import CombinedOpenEndedRubric
log = logging.getLogger("mitx.courseware")
cl... | heran7/edx-platform | common/lib/xmodule/xmodule/open_ended_grading_classes/self_assessment_module.py | Python | agpl-3.0 | 11,226 |
# Generated by Django 2.2.10 on 2020-02-27 06:01
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('instance', '0122_openedxinstance_theme_config'),
]
operations = [
migrations.CreateModel(
name... | open-craft/opencraft | instance/migrations/0123_newrelicsslalertcondition_newrelicsslmonitor.py | Python | agpl-3.0 | 1,212 |
import datetime
from django.db import models
from django.utils.translation import ugettext_lazy as _
from cms.models import CMSPlugin
from nani.models import TranslatableModel, TranslatedFields
from nani.manager import TranslationManager
import logging
logger = logging.getLogger('logview.userlogins') #
class Categ... | chispita/epiwork | apps/journal/models.py | Python | agpl-3.0 | 3,809 |
# -*- coding: utf-8 -*-
from . import report_control
| TemosEngenharia/temos_report | models/__init__.py | Python | agpl-3.0 | 54 |
# Roboviva - Better cue sheets for everyone
# Copyright (C) 2015 Mike Kocurek
#
# 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 ... | mucow24/roboviva | make_latex.py | Python | agpl-3.0 | 1,200 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
#
#
# Copyright (c) 2009-2015 University of Dundee.
#
# 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... | openmicroscopy/stats | omerostats/registry/templatetags/custom_tags.py | Python | agpl-3.0 | 2,279 |
"""
Django module container for classes and operations related to the "Course Module" content type
"""
import json
import logging
from cStringIO import StringIO
from datetime import datetime
import requests
from django.utils.timezone import UTC
from lazy import lazy
from lxml import etree
from path import Path as path... | ampax/edx-platform | common/lib/xmodule/xmodule/course_module.py | Python | agpl-3.0 | 58,583 |
"""
Django settings for codethesaurus project.
Generated by 'django-admin startproject' using Django 3.1.1.
For more information on this file, see
https://docs.djangoproject.com/en/3.1/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.1/ref/settings/
"""
from p... | codethesaurus/codethesaur.us | codethesaurus/settings.py | Python | agpl-3.0 | 4,233 |
# © 2016 Camptocamp SA
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html)
from odoo import api, models
class SaleOrder(models.Model):
_inherit = "sale.order"
@api.onchange("payment_mode_id")
def onchange_payment_mode_set_workflow(self):
pay_mode = self.payment_mode_id
wo... | OCA/sale-workflow | sale_automatic_workflow_payment_mode/models/sale_order.py | Python | agpl-3.0 | 426 |
from django.core import serializers
from django.db import models
PythonSerializer = serializers.get_serializer("python")
class PythonWithURLSerializer(PythonSerializer):
def handle_field(self, obj, field):
value = field.value_from_object(obj)
if isinstance(field, models.FileField) and hasattr(val... | fiduswriter/fiduswriter | fiduswriter/document/helpers/serializers.py | Python | agpl-3.0 | 1,648 |
def get_systems_list(self, prefix):
systems = []
for system_name in ["windows", "mac", "linux"]:
if getattr(self, prefix + system_name) is None:
return None
elif getattr(self, prefix + system_name):
systems.append(system_name)
return systems
def set_systems_list(self... | Yepoleb/gogdb | gogdb/legacy/model/common.py | Python | agpl-3.0 | 550 |
import unittest
from unittest import mock
from pyramid import testing
def _createRequest(stuff):
context = testing.DummyResource()
context.stuff = stuff
request = testing.DummyRequest()
request.context = context
return request
class TestIPLimitation(unittest.TestCase):
d... | hirokiky/karmaid | tests/test_views.py | Python | agpl-3.0 | 4,795 |
from django.conf.urls import patterns, url
from django.contrib.auth.decorators import login_required
from django.views.generic import TemplateView
from catmaid.views import CatmaidView, ExportWidgetView
# A regular expression matching floating point and integer numbers
num = r'[-+]?[0-9]*\.?[0-9]+'
integer = r'[-+]?[... | fzadow/CATMAID | django/applications/catmaid/urls.py | Python | agpl-3.0 | 22,509 |
# Copyright 2016-2018 Onestein (<http://www.onestein.eu>)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from odoo import api, models
class HrHolidays(models.Model):
_inherit = 'hr.holidays'
@api.multi
def compute_interval(self):
res = super(HrHolidays, self).compute_interval()... | onesteinbv/addons-onestein | hr_absenteeism_hours/models/hr_holidays.py | Python | agpl-3.0 | 369 |
# 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 index on 'Action', fields ['created']
db.create_index('videos_action', ['created'])
... | ujdhesa/unisubs | apps/videos/migrations/0159_index_action_created.py | Python | agpl-3.0 | 37,588 |
"""
End to end tests for LMS dashboard.
"""
from bok_choy.web_app_test import WebAppTest
from regression.pages.lms.course_page_lms import CourseHomePageExtended
from regression.pages.lms.dashboard_lms import DashboardPageExtended
from regression.pages.lms.lms_courseware import CoursewarePageExtended
from regression.p... | edx/edx-e2e-tests | regression/tests/lms/test_dashboard.py | Python | agpl-3.0 | 1,420 |
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2014 Compassion CH (http://www.compassion.ch)
# Releasing children from poverty in Jesus' name
# @author: Emanuel Cino <ecino@compassion.ch>
#
# The licence is in the file __manifest__.py... | ecino/compassion-switzerland | account_reconcile_compassion/models/statement_operation.py | Python | agpl-3.0 | 1,033 |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'TemporaryQuery.origin'
db.add_column('instructor_email_widget_temporaryquery', 'origin',
... | jbassen/edx-platform | lms/djangoapps/instructor_email_widget/migrations/0002_auto__add_field_temporaryquery_origin.py | Python | agpl-3.0 | 7,832 |
# Copyright 2017 David Vidal <david.vidal@tecnativa.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo.tests import common
from odoo.exceptions import UserError
class TestBaseLocationNuts(common.SavepointCase):
@classmethod
def setUpClass(cls):
super(TestBaseLocationNuts, ... | microcom/partner-contact | base_location_nuts/tests/test_base_location_nuts.py | Python | agpl-3.0 | 5,612 |
# -*- coding: utf-8 -*-
import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('credit', '0001_initial'),
]
operations... | edx-solutions/edx-platform | openedx/core/djangoapps/credit/migrations/0002_creditconfig.py | Python | agpl-3.0 | 2,780 |
# -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (c) 2011 Acysos S.L. (http://acysos.com) All Rights Reserved.
# Ignacio Ibeas <ignacio@acysos.com>
# $Id$
#
# This program i... | BorgERP/borg-erp-6of3 | verticals/garage61/acy_stock_sent_number/__openerp__.py | Python | agpl-3.0 | 1,561 |
# -*- coding: utf-8 -*-
# Akvo RSR is covered by the GNU Affero General Public License.
# See more details in the license.txt file located at the root folder of the Akvo RSR module.
# For additional details on the GNU license please see < http://www.gnu.org/licenses/agpl.html >.
from rest_framework import serializer... | akvo/akvo-rsr | akvo/rest/serializers/indicator_disaggregation_target.py | Python | agpl-3.0 | 747 |
# -*- coding: utf-8 -*-
# Copyright 2016 LasLabs Inc.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
import mock
from .common import mock_api, EasypostDeliveryHelper, mock_job_delay_to_direct
module = 'openerp.addons.connector_easypost'
job = '%s.consumer.export_record' % module
requests = '%s.... | laslabs/odoo-connector-easypost | connector_easypost/tests/test_shipping_label.py | Python | agpl-3.0 | 2,384 |
# -*- coding: utf-8 -*-
# © 2016 Alessandro Fernandes Martini, Trustcode
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
'name': 'Product Equipment',
'summary': """Adiciona alguns campos na visão de \
produtos relacionados a TI.""",
'version': '8.0.1.0.0',
'category': 'Websit... | Trust-Code/trust-addons | product_equipment/__openerp__.py | Python | agpl-3.0 | 711 |
from cmoc import BestList, Prepare
import MySQLdb
from json import load
with open("/var/rc24/File-Maker/Channels/Check_Mii_Out_Channel/config.json", "r") as f:
config = load(f)
db = MySQLdb.connect(
"localhost", config["dbuser"], config["dbpass"], "rc24_cmoc", charset="utf8mb4"
)
cursor = db.cursor()
bl = Bes... | RiiConnect24/File-Maker | Channels/Check_Mii_Out_Channel/bestlist.py | Python | agpl-3.0 | 1,081 |
from __future__ import absolute_import, unicode_literals
from django.db import models
from django.conf import settings
from django.core.urlresolvers import reverse
from django.utils import timezone
from django.utils.translation import ugettext_lazy as _
from temba.channels.models import ChannelSession, Channel
from te... | tsotetsi/textily-web | temba/ivr/models.py | Python | agpl-3.0 | 6,363 |
import json
import os
import pytest
from funnel.transports.email.aws_ses import (
SesEvent,
SnsValidator,
SnsValidatorChecks,
SnsValidatorError,
)
class TestSesEventJson:
# Data Directory which contains JSON Files
data_dir = os.path.join(os.path.dirname(__file__), 'data')
def test_deliv... | hasgeek/funnel | tests/unit/transports/aws_ses/test_ses_json.py | Python | agpl-3.0 | 4,664 |
# -*- coding: utf-8 -*-
"""
Instructor Dashboard API views
JSON views which the instructor dashboard requests.
Many of these GETs may become PUTs in the future.
"""
import StringIO
import json
import logging
import re
import time
import requests
from django.conf import settings
from django.views.decorators.csrf impo... | BeDjango/intef-openedx | lms/djangoapps/instructor/views/api.py | Python | agpl-3.0 | 123,077 |
#!/usr/bin/env python
# -*- coding: utf-8 -*- #
import os
import string
import argparse
from pelican import __version__
_TEMPLATES_DIR = os.path.join(os.path.dirname(os.path.abspath(__file__)), \
"templates")
CONF = {
'pelican' : 'pelican',
'pelicanopts' : '',
'basedir': '... | 0x00f/pelican | pelican/tools/pelican_quickstart.py | Python | agpl-3.0 | 7,767 |
import os
_BASE_RENDERER_PATH = os.path.dirname(__file__)
BASE_TEMPLATE_FOLDER = os.path.join(_BASE_RENDERER_PATH, "templates")
_use_minified = True
def set_use_minified(value):
global _use_minified
_use_minified = value
def get_use_minified():
return _use_minified
| JuezUN/INGInious | inginious/frontend/plugins/grader_generator/pages/constants.py | Python | agpl-3.0 | 283 |
# -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (http://tiny.be). All Rights Reserved
#
#
# This program is free software: you can redistribute it and/or modify
# it ... | avanzosc/avanzosc6.1 | avanzosc_sector_area_incustomers/__init__.py | Python | agpl-3.0 | 1,055 |
import numpy as np
from . import BaseWordChoice
class MemBasedWordChoice(BaseWordChoice):
def pick_w(self,m,voc,mem,context=[]):
w_list = voc.get_known_words(m=m,option=None)
if m in voc.get_known_meanings() and w_list:
if 'interact_count_voc' in list(mem.keys()):
p_list = [ mem['interact_count_voc'].get... | flowersteam/naminggamesal | naminggamesal/ngstrat/word_choice/membased.py | Python | agpl-3.0 | 771 |
# SPDX-FileCopyrightText: 2014, Mangaki Authors
# SPDX-License-Identifier: AGPL-3.0-only
from mangaki.celery import app as celery_app
default_app_config = 'mangaki.apps.MangakiConfig'
| mangaki/mangaki | mangaki/mangaki/__init__.py | Python | agpl-3.0 | 186 |
# -*- coding: utf-8 -*-
# Copyright 2018 Rémy Taymans <remytaymans@gmail.com>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from openerp import api, models, fields
class Partner(models.Model):
_inherit = 'res.partner'
communication_press = fields.Boolean("Press ?")
communicatio... | houssine78/addons | partner_communication_press/models/partner.py | Python | agpl-3.0 | 1,159 |
from functools import partial
import copy
import inspect
from pprint import pprint
from flask import request
from flask.ext import login
import errors
from datatypes.fallback_json import pretty_dump
#logfile = open('../../log/trace','wa')
actions = {
'create':'POST',
'insert':'POST',
'update':'PUT',
... | Earth-MGMT-SYS/nimbodata | common/api.py | Python | agpl-3.0 | 9,373 |
from django.contrib import admin
from kdvadmin.models import *
class KDVProductBarcodeInline(admin.TabularInline):
model = KDVProductBarcode
fields = ('code',)
extra = 0
min_num = 1
class KDVProductPricingInline(admin.TabularInline):
model = KDVPricing
extra = 0
min_num = 1
@admin.regis... | d120/kifplan | kdvadmin/admin.py | Python | agpl-3.0 | 1,052 |
# 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 *
class PyPycbc(PythonPackage):
"""PyCBC is a software package used to explore astrophysical sourc... | rspavel/spack | var/spack/repos/builtin/packages/py-pycbc/package.py | Python | lgpl-2.1 | 1,994 |
"""Various tools for use with PyFEHM."""
"""
Copyright 2013.
Los Alamos National Security, LLC.
This material was produced under U.S. Government contract DE-AC52-06NA25396 for
Los Alamos National Laboratory (LANL), which is operated by Los Alamos National
Security, LLC for the U.S. Department of Energy. The U.S. Go... | losalamos/PyFEHM | ftool.py | Python | lgpl-2.1 | 13,090 |
# !/bin/python
# -*- coding: latin-1 -*-
# Copyright (C) 2009-2014 CEA/DEN, EDF R&D
#
# 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 opt... | FedoraScientific/salome-hexablock | src/TEST_PY/cas_2013/cas_2013.py | Python | lgpl-2.1 | 5,166 |
"""
"""
import pygame
from pygame.locals import *
from .const import *
from . import widget
class Input(widget.Widget):
"""A single line text input.
Example:
w = Input(value="Cuzco the Goat",size=20)
w = Input("Marbles")
"""
_value = None
def __init__(self,value="",size=20,**pa... | yarbelk/pgu | pgu/gui/input.py | Python | lgpl-2.1 | 4,660 |
# Copyright (C) 2010-2014 CEA/DEN, EDF R&D
#
# 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 option) any later version.
#
# This library ... | FedoraScientific/salome-paravis | test/VisuPrs/CutLines/E3.py | Python | lgpl-2.1 | 1,502 |
from .client import OpenTSDBClient # noqa
| yandex/yandex-tank | yandextank/plugins/OpenTSDBUploader/client/__init__.py | Python | lgpl-2.1 | 43 |
import subprocess
from distutils.core import setup, Extension
from distutils import msvccompiler
import os
import sys
sources = [ \
"module.c",
"pyeventlog.c",
"pylcm.c",
"pylcm_subscription.c",
os.path.join("..", "lcm", "eventlog.c"),
os.path.join("..", "lcm", "lcm.c"),
os.path.join("..", ... | adeschamps/lcm | lcm-python/setup.py | Python | lgpl-2.1 | 3,784 |
# ***************************************************************************
# * (c) 2009 Yorik van Havre <yorik@uncreated.net> *
# * (c) 2010 Ken Cline <cline@frii.com> *
# * (c) 2020 Eliud Cabrera Castillo <e.cabrera-castillo@tum.de> *
# * ... | Fat-Zer/FreeCAD_sf_master | src/Mod/Draft/draftguitools/gui_beziers.py | Python | lgpl-2.1 | 21,300 |
# -*- coding: utf-8 -*-
# ####################################################################
# Copyright (C) 2005-2013 by the FIFE team
# http://www.fifengine.net
# This file is part of FIFE.
#
# FIFE is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General ... | whiterabbitengine/fifeplusplus | engine/python/fife/extensions/basicapplication.py | Python | lgpl-2.1 | 8,039 |
# -*- coding: utf-8 -*-
from blocFissure.gmu.fissureCoude import fissureCoude
class fissureCoude_7(fissureCoude):
# ---------------------------------------------------------------------------
def setParamGeometrieSaine(self):
"""
Paramètres géométriques du tuyau coudé sain:
angleCoude
r_cintr
... | FedoraScientific/salome-smesh | src/Tools/blocFissure/CasTests/fissureCoude_7.py | Python | lgpl-2.1 | 4,427 |
from distutils.core import setup
setup (name = 'dolfin_adjoint',
version = '1.5',
description = 'Automatically derive the discrete adjoint of DOLFIN models',
author = 'The dolfin_adjoint team',
author_email = 'patrick.farrell@maths.ox.ac.uk',
packages = ['dolfin_adjoint', 'dolfin_adj... | ellipsis14/dolfin-adjoint | setup.py | Python | lgpl-3.0 | 400 |
from django.db import models
from django.core import exceptions
from django.utils.translation import ugettext_lazy as _
from sizefield.utils import parse_size
from sizefield.widgets import FileSizeWidget
class FileSizeField(models.BigIntegerField):
default_error_messages = {
'invalid': _(u'Incorrect file... | leplatrem/django-sizefield | sizefield/models.py | Python | lgpl-3.0 | 954 |
#!/usr/bin/env python
"""
Package for Pasty.
"""
from pkg_resources import get_distribution, DistributionNotFound
__project__ = 'Pasty'
__version__ = None # required for initial installation
try:
__version__ = get_distribution(__project__).version # pylint: disable=E1103
except DistributionNotFound: # pragma... | jacebrowning/pasty | pasty/__init__.py | Python | lgpl-3.0 | 440 |
# Copyright cf-units contributors
#
# This file is part of cf-units and is released under the LGPL license.
# See COPYING and COPYING.LESSER in the root of the repository for full
# licensing details.
"""Unit tests for the `cf_units.as_unit` function."""
import copy
import unittest
from cf_units import Unit, as_unit
... | SciTools/cf_units | cf_units/tests/unit/unit/test_as_unit.py | Python | lgpl-3.0 | 2,282 |
"""
demo_dockwidgets.py
Example uses QDockWidgets (i.e. a QMainWindow). The figures are tabified by
default but can be floating or moved to a different dockwidgetarea.
Note:
The Figure uses the Agg-backend --> figure can be emitted as PyQt_PyObject
from within a thread.
"""
__author__ = 'rudolf.hoefler@gmail.com'
__... | rhoef/mpl-qtdemo | demo_dockwidgets.py | Python | lgpl-3.0 | 1,362 |
#!/usr/bin/env python
"""%prog [options] -s HOPTRAJ.psf -f HOPTRAJ.dcd DENSITY
Generate the hopping graph from HOPTRAJ.psf and HOPTRAJ.dcd and
DENSITY. DENSITY must be the pickle file used to make the hopping
trajectory.
"""
import os.path, errno
import MDAnalysis
import hop.sitemap, hop.trajectory, hop.interactive
... | iwelland/hop | scripts/hop-generate-hopgraph.py | Python | lgpl-3.0 | 5,080 |
# This script tests adding lines between objects.
# Created by Toni Sagrista
from py4j.java_gateway import JavaGateway, GatewayParameters
gateway = JavaGateway(gateway_parameters=GatewayParameters(auto_convert=True))
gs = gateway.entry_point
"""
Concats two java arrays into one
"""
def concat(a, b):
return [a[0]... | ari-zah/gaiasky | assets/scripts/tests/line-between-objects-test.py | Python | lgpl-3.0 | 1,505 |
import Queue
import socket
import sys
import traceback
from threading import Thread
from client import Client
from message import Message
from sock import Socket
from utils import constants
from utils import exceptions
from utils import errors
from utils import utils
class ConnectionManager(object):
def __init... | shanet/Cryptully | src/network/connectionManager.py | Python | lgpl-3.0 | 6,908 |
# always start like this
from guineapig import *
import sys
# supporting routines can go here
def tokens(line):
for tok in line.split():
yield tok.lower()
#always subclass Planner
class WordCount(Planner):
lines = ReadLines('corpus.txt')
words = Flatten(lines,by=tokens)
wordCount = Group(wo... | TeamCohen/GuineaPig | tutorial/longer-wordcount.py | Python | lgpl-3.0 | 450 |
#feature.py is a module of HunTag. The Feature class is used for representing a feature type and calculating its value for some input. Feature instances are created by the getFeatureSet function in huntag.py.
from lexicon import Lexicon
import sys
import features
class Feature():
def __init__(self, kind, name, ac... | recski/HunTag | feature.py | Python | lgpl-3.0 | 2,958 |
#!/usr/bin/env python
## DESCRIPTION: This program generates plots for assessing the proportion of distinct paired-end reads
## that map uniquely in a set of FASTQ files. It takes a CSV of percentage of uniquely-mapping PE reads
## per sample and will output two plots: a bar chart showing the perc... | McIntyre-Lab/papers | nanni_chip_rna_2022/scripts/qc/unique_mapping_plots.py | Python | lgpl-3.0 | 4,499 |
# -*- coding: utf-8 -*-
import unittest
from unittest.mock import * # noqa
from nose.tools import * # noqa
from clique import * # noqa
from clique.chainstore import * # noqa
def test_ChainStore():
from clique.chainstore import (chainstore, LocalChainStore,
_global_chainstor... | nicfit/Clique | tests/test_chainstore.py | Python | lgpl-3.0 | 4,364 |
#
# Project Kimchi
#
# Copyright IBM, Corp. 2013-2014
#
# 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 option) any later version.
#
# Thi... | gouzongmei/t1 | src/kimchi/control/plugins.py | Python | lgpl-3.0 | 1,011 |
"""Algorithms"""
__copyright__ = "Copyright (C) 2014 Ivan D Vasin"
__docformat__ = "restructuredtext"
from base64 import b64encode as _b64encode
from collections import namedtuple as _namedtuple
from hashlib import md5 as _md5
from random import random as _random
from time import time as _time
from urllib import quot... | nisavid/bedframe | bedframe/auth/digest/_algorithms.py | Python | lgpl-3.0 | 30,077 |
# Copyright (C) 2015-2022 by the RBniCS authors
#
# This file is part of RBniCS.
#
# SPDX-License-Identifier: LGPL-3.0-or-later
import types
from dolfin import FunctionSpace
from rbnics.utils.decorators import overload
def generate_function_space_for_stability_factor(__init__):
from rbnics.problems.elliptic impo... | mathLab/RBniCS | rbnics/backends/dolfin/wrapping/generate_function_space_for_stability_factor.py | Python | lgpl-3.0 | 1,076 |
"""Raw representations of every data type in the AWS DMS service.
See Also:
`AWS developer guide for DMS
<https://docs.aws.amazon.com/dms/latest/userguide/index.html>`_
This file is automatically generated, and should not be directly edited.
"""
from attr import attrib
from attr import attrs
from ..core imp... | garyd203/flying-circus | src/flyingcircus/_raw/dms.py | Python | lgpl-3.0 | 6,796 |
import datetime
from pprint import pprint
from bitmovin import Bitmovin, Encoding, S3Output, H264CodecConfiguration, StreamFilter, CropFilter, CropFilterUnit, \
AACCodecConfiguration, H264Profile, StreamInput, SelectionMode, Stream, EncodingOutput, ACLEntry, \
ACLPermission, FMP4Muxing, MuxingStream, CloudRegi... | bitmovin/bitmovin-python | examples/encoding/create_simple_encoding_crop_filter.py | Python | unlicense | 17,083 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import with_statement
__all__ = ['toposort', 'CycleDetectedError', 'LoopDetectedError']
###################################################################
class CycleDetectedError(Exception): pass
class LoopDetecte... | jweg/topological-sorting | toposort.py | Python | unlicense | 10,124 |
"""
Logging with timestamps and optional log files.
===============================================================================
FILE: logme
AUTHOR: Michael D Dacre, mike.dacre@gmail.com
ORGANIZATION: Stanford University
CREATED: 2015-03-03 11:41
Last modified: 2016-03-25 23:40
DESC... | MikeDacre/mike_tools | python/logme.py | Python | unlicense | 8,625 |
#!/usr/bin/env python
"""
This program reads the .zenodo.json file finds the
designated first author, puts them first, and then puts the
remainder in alphabetical order.
"""
import argparse
import json
import sys
from operator import itemgetter
# This is free and unencumbered software released into the public domain... | jlaura/isis3 | isis/scripts/zenodo_order.py | Python | unlicense | 2,265 |
import unittest
import json
from bitmovin import Bitmovin, Response, AACCodecConfiguration
from bitmovin.errors import BitmovinApiError
from tests.bitmovin import BitmovinTestCase
class AACCodecConfigurationTests(BitmovinTestCase):
@classmethod
def setUpClass(cls):
super().setUpClass()
@classmet... | bitmovin/bitmovin-python | tests/bitmovin/services/codecconfigurations/aac_codec_configuration_tests.py | Python | unlicense | 7,290 |
# -*- coding: utf-8 -*-
from __future__ import (absolute_import, division,
print_function, unicode_literals)
from .errors import *
from .service import *
| nickchen-mitac/fork | src/ava/task/__init__.py | Python | apache-2.0 | 179 |
# http://inamidst.com/saxo/
# Created by Sean B. Palmer
import codecs
import multiprocessing
import os
import re
import socket
import socketserver
import sys
import time
sys.stdout = codecs.getwriter("utf-8")(sys.stdout.detach())
scripts = os.path.dirname(sys.modules["__main__"].__file__)
scripts = os.path.abspath(s... | sbp/saxo | test/server.py | Python | apache-2.0 | 8,663 |
# Copyright (c) 2016 The Johns Hopkins University/Applied Physics Laboratory
# 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/LICEN... | viktorTarasov/PyKMIP | kmip/services/server/crypto/engine.py | Python | apache-2.0 | 8,368 |
#Embedded file name: ACEStream\Core\APIImplementation\SingleDownload.pyo
import sys
import os
import time
import copy
import pickle
import socket
import binascii
import random
from base64 import b64encode
from types import StringType, ListType, IntType
from traceback import print_stack
from threading import Event, Lock... | aplicatii-romanesti/allinclusive-kodi-pi | .kodi/userdata/addon_data/plugin.video.p2p-streams/acestream/ace/ACEStream/Core/APIImplementation/SingleDownload.py | Python | apache-2.0 | 19,391 |
from __future__ import unicode_literals
import json
import httpretty
from httpretty import GET, POST
from ddt import ddt, data
try:
import unittest2 as unittest # Python2.6
except ImportError:
import unittest
from test_http import GetOrPost
import trovebox
@ddt
class TestHttpErrors(unittest.TestCase):
te... | photo/openphoto-python | tests/unit/test_http_errors.py | Python | apache-2.0 | 4,875 |
# Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the... | noironetworks/horizon | openstack_dashboard/context_processors.py | Python | apache-2.0 | 4,469 |
# Copyright 2013-2016 DataStax, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... | kishkaru/python-driver | cassandra/__init__.py | Python | apache-2.0 | 13,815 |
import pytest
import arrow
from weasyl import login
from weasyl import define as d
from weasyl.test.utils import Bag
user_name = "test"
email_addr = "test@weasyl.com"
token = "a" * 40
# Main test password
raw_password = "0123456789"
@pytest.mark.usefixtures('db')
def test_acct_verif_token_returned_if_email_provid... | Weasyl/weasyl | weasyl/test/login/test_get_account_verification_token.py | Python | apache-2.0 | 1,623 |
# -*- coding: utf-8 -*-
from model.group import Group
from random import randrange
def test_mod_some_group(app, db, check_ui):
if app.group.count() == 0:
app.group.create(Group(name="ifgroup", header="ifgroupsomelogo", footer="ifgroupsomecomment"))
old_groups = db.get_group_list()
index = int(rand... | 100loto/kruglov_group_16 | test/test_modify_group.py | Python | apache-2.0 | 1,175 |
#!/usr/bin/env python
#
# Copyright 2015 47Lining 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... | 47lining/nucleator-core | setup.py | Python | apache-2.0 | 2,544 |
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed unde... | tengqm/senlin-container | senlin/tests/unit/fakes.py | Python | apache-2.0 | 2,175 |
import os
import glob
import subprocess
import re
import sys
source_folder = os.path.abspath('source/')
dest_folder = sys.argv[1] + '/'
def transform_to_rst(path):
filename = os.path.splitext(os.path.basename(path))[0]
dirname = os.path.dirname(path)
target = os.path.join(dirname, filename+'.rst')
pro... | StuPro-TOSCAna/TOSCAna | docs/util/pdfgenerator/convert_md_files.py | Python | apache-2.0 | 999 |
age =27;
if age<21:
print("你不能喝酒")
else:
print("你只能喝啤酒哦!")
name="Tommy D"
if name is "Bucky":
print("Hey there Bucky")
elif name is "lucy":
print("What up Luedawg?")
elif name is "Sammy":
print("What up Slammy?")
else:
print("Please sign up for the site!") | liang1024/PythonDemo | Learning/Test7_if.py | Python | apache-2.0 | 309 |