code stringlengths 6 947k | repo_name stringlengths 5 100 | path stringlengths 4 226 | language stringclasses 1
value | license stringclasses 15
values | size int64 6 947k |
|---|---|---|---|---|---|
# This file is part of Shuup.
#
# Copyright (c) 2012-2016, Shoop Commerce Ltd. All rights reserved.
#
# This source code is licensed under the AGPLv3 license found in the
# LICENSE file in the root directory of this source tree.
import os
def get_test_requirements_from_tox_ini(path):
result = []
between_begin... | suutari/shoop | shuup_setup_utils/parsing.py | Python | agpl-3.0 | 928 |
import os
from django.core.wsgi import get_wsgi_application
import elasticSearchFunctions
application = get_wsgi_application()
# Set up Elasticsearch client
elasticSearchFunctions.setup_reading_from_client_conf()
| sevein/archivematica | src/dashboard/src/wsgi.py | Python | agpl-3.0 | 218 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import datetime
from django.utils import timezone
class Migration(migrations.Migration):
dependencies = [
('videos', '0014_add_enabled_and_notes'),
]
operations = [
migrations.Create... | palfrey/kitling | frontend/videos/migrations/0015_add_channel.py | Python | agpl-3.0 | 907 |
# -*- 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):
# Deleting field 'Profile.modified_user'
db.delete_column(u'user_profile', 'modified_user_id')
# De... | taikoa/wevolver-server | wevolve/users/migrations/0005_auto__del_field_profile_modified_user__del_field_profile_data.py | Python | agpl-3.0 | 7,905 |
# Copyright 2009-2011 Canonical Ltd. This software is licensed under the
# GNU Affero General Public License version 3 (see the file LICENSE).
"""Tests of the branch interface."""
__metaclass__ = type
from bzrlib.branch import format_registry as branch_format_registry
from bzrlib.bzrdir import BzrProber
from bzrlib... | abramhindle/UnnaturalCodeFork | python/testdata/launchpad/lib/lp/code/interfaces/tests/test_branch.py | Python | agpl-3.0 | 2,218 |
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2004-2014 Pexego Sistemas Informáticos 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 Lice... | Pexego/PXGO_00049_2013_PCG | project-addons/purchase_oferts/__openerp__.py | Python | agpl-3.0 | 1,398 |
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2015, Numenta, Inc. Unless you have purchased from
# Numenta, Inc. a separate commercial license for this software code, the
# following terms and conditions apply:
#
# This pro... | akhilaananthram/nupic.fluent | fluent/encoders/language_encoder.py | Python | agpl-3.0 | 7,974 |
"""
gw2copilot/wine_mumble_reader.py
The latest version of this package is available at:
<https://github.com/jantman/gw2copilot>
################################################################################
Copyright 2016 Jason Antman <jason@jasonantman.com> <http://www.jasonantman.com>
This file is part of g... | jantman/gw2copilot | gw2copilot/wine_mumble_reader.py | Python | agpl-3.0 | 9,880 |
# -*- coding: utf-8 -*-
from openerp import models, fields, api
class crm_phonecall(models.Model):
_inherit = 'crm.phonecall'
repair_id = fields.Many2one(comodel_name="mrp.repair", string="Repair", required=False, )
class mrp_repair(models.Model):
_inherit = 'mrp.repair'
phonecalls = fields.One2man... | gmathers/iii-addons | iii-phonecall/iii_phonecall.py | Python | agpl-3.0 | 417 |
from abc import ABCMeta, abstractmethod
class TaskDispenser(metaclass=ABCMeta):
def __init__(self, task_list_func, dispenser_data):
"""
Instantiate a new TaskDispenser
:param task_list_func: A function returning the list of available course tasks from the task factory
:param dispen... | UCL-INGI/INGInious | inginious/frontend/task_dispensers/__init__.py | Python | agpl-3.0 | 2,182 |
# -*- coding: utf-8 -*-
# © 2016 Comunitea
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
from datetime import datetime, timedelta
from odoo import api, fields, models, _
from odoo.tools import DEFAULT_SERVER_DATETIME_FORMAT, float_compare
from odoo.exceptions import UserError
class SaleOrderLine(mo... | Comunitea/CMNT_00098_2017_JIM_addons | jim_intercompany/models/sale_order.py | Python | agpl-3.0 | 10,292 |
"""
Admin role page
"""
from flask import (Blueprint, render_template, request, flash,
redirect, url_for)
from flask.ext.login import current_user
from noink import mainApp, _
from noink.state import get_state
from noink.user_db import UserDB
from noink.role_db import RoleDB
from noink.exceptions import RoleN... | criswell/noink | src/noink/blueprints/admin_role.py | Python | agpl-3.0 | 6,347 |
# -*- coding: utf-8 -*-
# See LICENSE file for full copyright and licensing details.
from odoo import api, fields, models
class SaleAdvancePaymentInv(models.TransientModel):
_inherit = "sale.advance.payment.inv"
@api.model
def _get_advance_payment(self):
ctx = self.env.context.copy()
if ... | JayVora-SerpentCS/vertical-hotel | hotel/wizard/sale_make_invoice_advance.py | Python | agpl-3.0 | 2,320 |
# -*- coding: utf-8 -*-
from .hooks import post_init_hook
from . import models
from . import tests
| acsone/server-tools | base_name_search_improved/__init__.py | Python | agpl-3.0 | 99 |
# -*- coding: utf-8 -*-
import os
from django.contrib import admin
from django import forms
from django.utils import simplejson
from django.utils.safestring import mark_safe
from django.core.urlresolvers import reverse
from django.conf.urls import url, patterns
from django.shortcuts import render
from django.contrib.... | fnp/edumed | wtem/admin.py | Python | agpl-3.0 | 8,331 |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | CubicERP/odoo | addons/product/product.py | Python | agpl-3.0 | 67,910 |
from django.db import models
# Create your models here.
class Career(models.Model):
name = models.CharField(max_length=80)
faculty = models.CharField(max_length=80)
def __str__(self):
return self.name
class AcademicTitle(models.Model):
LEVELS = (
('3', 'Tercer Nivel'),
('4E... | miltonlab/researchman | manager/models.py | Python | agpl-3.0 | 1,045 |
# This file is part of VoltDB.
# Copyright (C) 2008-2016 VoltDB Inc.
#
# 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 ver... | paulmartel/voltdb | lib/python/voltcli/voltadmin.d/show.py | Python | agpl-3.0 | 1,129 |
###############################################################################
#
# 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-xmlrpc | xmlrpc_operation_product/__openerp__.py | Python | agpl-3.0 | 1,769 |
import datetime
import threading
import requests
import db
import cfg
from skier import pgp
from cfg import API_VERSION, SKIER_VERSION
def import_key(keyserver: str, keyid: str):
"""
Attempts to import a key from the keyserver.
:param keyserver: The keyserver to import from.
:param keyid: The Key ID... | SkierPGP/Skier | skier/pgpactions.py | Python | agpl-3.0 | 5,513 |
# Generated by Django 2.0.2 on 2018-03-23 22:29
from django.db import migrations, models
SCORE_TYPE_MAP = {1: 'NO_SCORE', 2: 'FULL', 3: 'PIANO', 4: 'CONDENSED'}
FORWARDS_QUERY = """
UPDATE library_piece
SET "score_type" = %s
WHERE "score_id" = %s
""... | cellofellow/symphony | library/migrations/0009_score_type_to_choices.py | Python | agpl-3.0 | 1,288 |
# -*- coding: utf-8 -*-
# © 2011 SYLEAM Info Services (http://www.Syleam.fr)
# © 2011 Sebastien LANGE (sebastien.lange@syleam.fr)
# © 2014 Elico Corp (https://www.elico-corp.com)
# Licence AGPL-3.0 or later(http://www.gnu.org/licenses/agpl.html)
from openerp.osv import osv
from openerp.osv import fields
from openerp.... | Elico-Corp/openerp-7.0 | wms/wizard/stock_to_date.py | Python | agpl-3.0 | 11,857 |
"""
An integer that is not co-prime to 10 but has a prime factor other than 2 or 5
has a reciprocal that is eventually periodic, but with a non-repeating sequence
of digits that precede the repeating part. The reciprocal can be expressed as:
\frac{1}{2^a 5^b p^k q^\ell \cdots}\, ,
where a and b are not both zero... | aureooms/repeating-decimal | reciprocals.py | Python | agpl-3.0 | 1,599 |
# -*- coding: utf-8 -*-
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('rdrf', '0022_merge'),
]
operations = [
migrations.AddField(
model_name='rdrfcontext',
name='context_form_group',
field=models.F... | muccg/rdrf | rdrf/rdrf/migrations/0023_rdrfcontext_context_form_group.py | Python | agpl-3.0 | 534 |
# pylint: disable=R0903, print-statement
"""for Sub.inherited, only the warning for "aay" is desired.
The warnings for "aab" and "aac" are most likely false positives though,
because there could be another subclass that overrides the same method and does
use the arguments (eg Sub2)
"""
__revision__ = 'thx to M... | GbalsaC/bitnamiP | venv/lib/python2.7/site-packages/pylint/test/input/func_unused_overridden_argument.py | Python | agpl-3.0 | 913 |
# Copyright (C) 2020 Open Source Integrators
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from . import test_consolidated_invoices
| OCA/multi-company | account_invoice_consolidated/tests/__init__.py | Python | agpl-3.0 | 151 |
from . import ir_model
from . import ir_ui_view
| OCA/OpenUpgrade | openupgrade_framework/odoo_patch/odoo/addons/base/models/__init__.py | Python | agpl-3.0 | 48 |
# -*- coding: utf-8 -*-
# Copyright (C) 2013-Today Carlos Eduardo Vercelino - CLVsol
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
'name': 'Summary',
'summary': 'Summary Module used by CLVsol Solutions.',
'version': '12.0.4.0',
'author': 'Carlos Eduardo Vercelino - CLVsol',
'ca... | CLVsol/clvsol_odoo_addons | clv_summary/__manifest__.py | Python | agpl-3.0 | 940 |
from flask_wtf import Form
from wtforms import FormField, TextField, DateTimeField, IntegerField, FloatField
from wtforms.validators import InputRequired, Length, Regexp
class LocationForm(Form):
latitude = FloatField(validators=[InputRequired()])
longitude = FloatField(validators=[InputRequired()])
class Sig... | mitclap/backend | app/forms.py | Python | agpl-3.0 | 1,199 |
from operator import itemgetter
from mediawords.db import connect_to_db
from mediawords.dbi.downloads.store import store_content
from mediawords.test.db.create import create_test_topic, create_test_medium, create_test_feed, create_test_story
from topics_base.stories import merge_foreign_rss_stories
def test_merge_f... | berkmancenter/mediacloud | apps/topics-base/tests/python/topics_base/stories/test_merge_foreign_rss_stories.py | Python | agpl-3.0 | 2,758 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('popit', '0015_auto_20151001_0130'),
]
operations = [
migrations.AlterField(
model_name='contacts',
n... | Sinar/popit_ng | popit/migrations/0016_auto_20151001_0131.py | Python | agpl-3.0 | 558 |
##############################################################################
#
# OSIS stands for Open Student Information System. It's an application
# designed to manage the core business of higher education institutions,
# such as universities, faculties, institutes and professional schools.
# The core ... | uclouvain/OSIS-Louvain | attribution/tests/views/charge_repartition/common.py | Python | agpl-3.0 | 4,717 |
#!/usr/bin/env python
# -*- coding: utf8 -*-
# *****************************************************************
# ** PTS -- Python Toolkit for working with SKIRT **
# ** © Astronomical Observatory, Ghent University **
# *****************************************************************
##... | SKIRT/PTS | modeling/build/models/stars.py | Python | agpl-3.0 | 41,196 |
# 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 model 'Notification'
db.create_table('notification_notification', (
('id', self.gf('django.db... | fgaudin/aemanager | notification/migrations/0001_initial.py | Python | agpl-3.0 | 4,760 |
import logging
from collections import Counter
from udata.commands import cli, header, success
log = logging.getLogger(__name__)
@cli.group('images')
def grp():
'''Images related operations'''
pass
def render_or_skip(obj, attr):
try:
getattr(obj, attr).rerender()
obj.save()
re... | opendatateam/udata | udata/commands/images.py | Python | agpl-3.0 | 2,037 |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | ksrajkumar/openerp-6.1 | openerp/osv/orm.py | Python | agpl-3.0 | 245,233 |
from django.utils.translation import ugettext_lazy as _
# Django uses the first translation it detects in an installed app.
# The "helfertool" app is listed first, so we have can override default translations here.
#
# Just put the english text here and translate it, this vesion will be used.
# There is no other purpo... | helfertool/helfertool | src/helfertool/override_translations.py | Python | agpl-3.0 | 410 |
# Copyright NuoBiT Solutions, S.L. (<https://www.nuobit.com>)
# Eric Antones <eantones@nuobit.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)
from odoo import fields, models
class AccountMove(models.Model):
_inherit = "account.move"
def _prepare_asset_vals(self, aml):
vals = supe... | nuobit/odoo-addons | account_asset_invoice_line_link/models/account_move.py | Python | agpl-3.0 | 659 |
# -*- coding: utf-8 -*-
"""
2016-01-20 Cornelius Kölbel <cornelius@privacyidea.org>
Support STARTTLS mock
2015-01-30 Cornelius Kölbel <cornelius@privacyidea.org>
Change responses.py to be able to run with SMTP
Original responses.py is:
Copyright 2013 Dropbox, Inc.
Licensed under the Apache Lic... | privacyidea/privacyidea | tests/smtpmock.py | Python | agpl-3.0 | 7,934 |
"""
base 36 encoding/decoding taken from wikipedia sample code
http://en.wikipedia.org/wiki/Base_36#Python_Conversion_Code
"""
def encode(number, alphabet='0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'):
"""Converts an integer to a base36 string."""
if not isinstance(number, (int, long)):
raise TypeError('num... | dkm/skylines | skylines/lib/base36.py | Python | agpl-3.0 | 746 |
# -*- coding: utf8 -*-
__version__ = "$Revision$ $Date$"
__author__ = "Guillaume Bour <guillaume@bour.cc>"
__license__ = """
Copyright (C) 2010-2011, Guillaume Bour <guillaume@bour.cc>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License a... | gbour/Strawberry | strawberry/tag.py | Python | agpl-3.0 | 3,892 |
#!/usr/bin/env python
# coding:utf-8
import sys, os
from twisted.internet import reactor
from bottle import Bottle
from bottle import request
from bottle import response
from bottle import redirect
from bottle import static_file
from bottle import abort
from hashlib import md5
from urlparse import urljoin
from toughrad... | vzer/ToughRADIUS | toughradius/console/control/control.py | Python | agpl-3.0 | 905 |
from typing import List, Tuple, Any
from django.db.models import Max, QuerySet
from semantic_version import Version
from nextcloudappstore.core.models import App, AppReleaseDeleteLog, Category, \
AppRating, NextcloudRelease
def create_etag(pairs: List[Tuple[QuerySet, str]]) -> str:
"""
Turn a list of que... | nextcloud/appstore | nextcloudappstore/core/caching.py | Python | agpl-3.0 | 1,819 |
#!/usr/bin/env python
# This file is part of VoltDB.
# Copyright (C) 2008-2016 VoltDB Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitatio... | paulmartel/voltdb | examples/metrocard/exportServer.py | Python | agpl-3.0 | 6,191 |
from django import template
from django.utils.text import capfirst
register = template.Library()
@register.filter
def verbose_name(obj, arg):
return capfirst(obj._meta.get_field(arg).verbose_name)
| sbsdev/daisyproducer | daisyproducer/documents/templatetags/verbose_name.py | Python | agpl-3.0 | 214 |
'''
Copyright (c) 2012 Alexander Abbott
This file is part of the Cheshire Cyber Defense Scoring Engine (henceforth
referred to as Cheshire).
Cheshire 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 Sof... | smartboyathome/Wonderland-Engine | tests/CheshireCatTests/test_team_checks_manual.py | Python | agpl-3.0 | 3,635 |
from flask import jsonify, request
from radar.api.serializers.nurture_tubes import OptionSerializer, SamplesSerializer
from radar.api.views.common import (
PatientObjectDetailView,
PatientObjectListView,
)
from radar.api.views.generics import ListModelView
from radar.database import db
from radar.exceptions im... | renalreg/radar | radar/api/views/nurture_tubes.py | Python | agpl-3.0 | 1,651 |
# Copyright (C)2016 D. Plaindoux.
#
# 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 2, or (at your option) any
# later version.
import unittest
from fluent_rest.spec.rest ... | d-plaindoux/fluent-rest | tests/verb_test.py | Python | lgpl-2.1 | 1,943 |
#
# Copyright (c) 2011 Red Hat, Inc.
#
# This software is licensed to you under the GNU Lesser General Public
# License as published by the Free Software Foundation; either version
# 2 of the License (LGPLv2) or (at your option) any later version.
# There is NO WARRANTY for this software, express or implied,
# includin... | splice/gofer | src/gofer/metrics.py | Python | lgpl-2.1 | 1,728 |
# -*- coding: utf-8 -*-
import unittest
from kiwi.python import AttributeForwarder, slicerange, enum, strip_accents
class SliceTest(unittest.TestCase):
def genlist(self, limit, start, stop=None, step=None):
if stop is None:
stop = start
start = None
return list(slicerang... | stoq/kiwi | tests/test_python.py | Python | lgpl-2.1 | 3,893 |
# -*- coding: utf-8 -*-
# Copyright (c) 2003, Taro Ogawa. All Rights Reserved.
# Copyright (c) 2013, Savoir-faire Linux inc. 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 Software Fo... | savoirfairelinux/num2words | tests/test_ko.py | Python | lgpl-2.1 | 4,547 |
from .discrete import DiscreteSimulation
| Lucretiel/genetics | genetics/simulation/__init__.py | Python | lgpl-2.1 | 41 |
import logging
import subprocess
import time
import urllib
import sys
import glob
import os
from multiprocessing import Process
from signal import SIGKILL
try:
from volta.analysis import grab, uploader
except Exception:
raise RuntimeError("Please install volta. https://github.com/yandex-load/volta")
from pkg_... | nnugumanov/yandex-tank | yandextank/plugins/Android/plugin.py | Python | lgpl-2.1 | 7,170 |
# Copyright (C) 2011, 2012 by Matteo Franchin
#
# This file is part of Pyrtist.
#
# Pyrtist 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... | mfnch/pyrtist | pyrtist/gui/dox/dox.py | Python | lgpl-2.1 | 2,729 |
# -*- coding: utf-8 -*-
import sys
import os.path
import subprocess
import json
import string
import tempfile
import shutil
import threading
import exceptions
import errno
from collections import defaultdict
from xml.etree import ElementTree
import nixops.statefile
import nixops.backends
import nixops.logger
import ni... | AmineChikhaoui/nixops | nixops/deployment.py | Python | lgpl-3.0 | 53,483 |
#!/usr/bin/python
# This file is part of Androguard.
#
# Copyright (C) 2012, Anthony Desnos <desnos at t0t0.fr>
# All rights reserved.
#
# Androguard 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, eit... | thanatoskira/AndroGuard | build/scripts-2.7/androxgmml.py | Python | lgpl-3.0 | 11,137 |
'''
Pixie: FreeBSD virtualization guest configuration client
Copyright (C) 2011 The Hotel Communication Network inc.
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 Li... | masom/Puck | client/pixie/lib/setup_plugin.py | Python | lgpl-3.0 | 24,567 |
# Copyright (c) 2018 Ultimaker B.V.
# Cura is released under the terms of the LGPLv3 or higher.
from PyQt5.QtCore import QUrl
from PyQt5.QtGui import QDesktopServices
from typing import Set
from UM.Extension import Extension
from UM.Application import Application
from UM.Logger import Logger
from UM.i18n import i18n... | Ultimaker/Cura | plugins/FirmwareUpdateChecker/FirmwareUpdateChecker.py | Python | lgpl-3.0 | 3,835 |
#!/usr/bin/env python
# Copyright (C) 2017 DearBytes B.V. - All Rights Reserved
import os
from datetime import datetime
from sqlalchemy import Column
from sqlalchemy import DateTime
from sqlalchemy import ForeignKey
from sqlalchemy import Integer
from sqlalchemy import String
from sqlalchemy import create_engine
from ... | DearBytes/Remote-Integrity-Tool | dear/remote_integrity/models.py | Python | lgpl-3.0 | 6,183 |
import unittest
from irrat.factorize import prime_generator
from irrat.expression import Division
_FIRST_HUNDRED_PRIMES = list(prime_generator(546))
def product(*args):
p = 1
for i in args:
p *= i
return p
class DivisionExpressionTest(unittest.TestCase):
def test_doesnt_factorize_large_pri... | joe-jordan/irrat | test/test_expression.py | Python | lgpl-3.0 | 2,679 |
# (C) British Crown Copyright 2013 - 2015, Met Office
#
# This file is part of Iris.
#
# Iris 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 l... | jkettleb/iris | lib/iris/tests/unit/fileformats/pp/test_PPField.py | Python | lgpl-3.0 | 11,449 |
from run import db
class Right(db.Model):
right_id = db.Column(db.Integer, primary_key=True)
name = db.Column(db.String, unique=True, nullable=False)
description = db.Column(db.String)
| progagtudo/matemate | model/permission/right.py | Python | lgpl-3.0 | 200 |
import logging
import os
import datetime
import six
import humanfriendly
from pathlib import Path
from django.db import models
from django.utils.html import format_html
from django.utils.encoding import uri_to_iri
from django.core.management import call_command
from django.utils.safestring import mark_safe
from django.... | xahhy/Django-vod | vodmanagement/models.py | Python | lgpl-3.0 | 14,356 |
# Copyright (C) 2015-2022 by the RBniCS authors
#
# This file is part of RBniCS.
#
# SPDX-License-Identifier: LGPL-3.0-or-later
def function_copy(function):
pass
| mathLab/RBniCS | rbnics/backends/basic/wrapping/function_copy.py | Python | lgpl-3.0 | 168 |
#!/usr/bin/env/python
# -*- coding: utf-8 -*-
###
### Author: Chris Iatrou (ichrispa@core-vector.net)
### Version: rev 13
###
### This program was created for educational purposes and has been
### contributed to the open62541 project by the author. All licensing
### terms for this source is inherited by the terms and... | Torben-D/open62541 | tools/pyUANamespace/ua_builtin_types.py | Python | lgpl-3.0 | 59,096 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# This file is part of PRIMO2 -- Probabilistic Inference Modules.
# Copyright (C) 2013-2017 Social Cognitive Systems Group,
# Faculty of Technology, Bielefeld University
#
# This program is free software: you can redistribute it and/or modify
# it ... | SocialCognitiveSystems/PRIMO | primo2/tests/Inference_test.py | Python | lgpl-3.0 | 13,455 |
"""Django middlewares."""
try:
# Python 2.x
from urlparse import urlsplit, urlunsplit
except ImportError:
# Python 3.x
from urllib.parse import urlsplit
from urllib.parse import urlunsplit
from django.conf import settings
from django.http import HttpResponsePermanentRedirect
try:
# Django 1.... | rdegges/django-sslify | sslify/middleware.py | Python | unlicense | 2,315 |
def say_hello(user):
print('Hello', user, '!')
| pycam/python-functions-and-modules | my_first_module.py | Python | unlicense | 51 |
import fechbase
class Records(fechbase.RecordsBase):
def __init__(self):
fechbase.RecordsBase.__init__(self)
self.fields = [
{'name': 'FORM TYPE', 'number': '1'},
{'name': 'FILER FEC CMTE ID', 'number': '2'},
{'name': 'COMMITTEE NAME', 'number': '3'},
... | h4ck3rm1k3/FEC-Field-Documentation | fec/version/v3/F3X.py | Python | unlicense | 7,477 |
#-*- coding: utf8 -*-
from SPARQLWrapper import SPARQLWrapper, JSON
from configuracao import *
import string, networkx as x, nltk as k
import __builtin__
stemmer = k.stem.RSLPStemmer()
def fazRedeAmizades():
global SPARQLWrapper
q="""SELECT ?a ?b ?aname ?bname
WHERE {
?a foaf:knows ?b .
... | ttm/pnud4 | flask/auxiliar.py | Python | unlicense | 5,873 |
from time import clock
from math import factorial
def timer(function):
def wrapper(*args, **kwargs):
start = clock()
print(function(*args, **kwargs))
print("Solution took: %f seconds." % (clock() - start))
return wrapper
@timer
def find_answer():
return sum(map(int, str(factoria... | Igglyboo/Project-Euler | 1-99/20-29/Problem20.py | Python | unlicense | 378 |
import logging
from PyQt5 import QtCore
from collections import OrderedDict
from copper.core.utils.copper_string import CopperString
from .parm_template import ParmTemplate, ParmLookScheme, ParmNamingScheme, ParmTemplateType, StringParmType
logger = logging.getLogger(__name__)
CopperLinear = 0
CopperBezier = 2
#C... | cinepost/Copperfield_FX | copper/core/parameter/parameter.py | Python | unlicense | 6,311 |
import ftplib
import os
import datastore
class FtpStore(datastore.DataStore):
def progress(self, block):
self.trans_total += len(block)
datastore.DataStore.progress(self, self.trans_total, self.file_size_total)
def exists(self, file):
if file == "" or file == "/" or file == "./":
... | jptrosclair/webpush | src/ftpstore.py | Python | unlicense | 2,104 |
from subprocess import call
call(["bin/automo.exe"])
| aliaafee/automo | automo-win/launcher.py | Python | unlicense | 54 |
c = get_config()
# NEVER NAG ME
c.TerminalInteractiveShell.confirm_exit = False
# Configuration file for ipython.
# ------------------------------------------------------------------------------
# InteractiveShellApp(Configurable) configuration
# -----------------------------------------------------------------------... | npotts/dotfiles | ipython/profile_default/ipython_config.py | Python | unlicense | 38,662 |
from params import *
from util import *
from asa80432_loader import *
def payload(params):
block_enc = []
while len(block_enc) == 0:
mask_byte = ord(rand_byte()) # one byte, used as an int
#print "trying to mask data with 0x%02x" % mask_byte
block_enc = prepare_blocks(params, mask_by... | DarthMaulware/EquationGroupLeaks | Leak #1 - Equation Group Cyber Weapons Auction - Invitation/EQGRP-Free-File/Firewall/EXPLOITS/EPBA/EPICBANANA/versions/asa80432.py | Python | unlicense | 2,675 |
#!/usr/bin/env python
import lshost
lshost.run(server='cgi')
| drjson/livestreamer-host | examples/cgi_server.py | Python | unlicense | 61 |
__author__ = 'eric'
import pandas as pd
import numpy as np
import math
import copy
import QSTK.qstkutil.qsdateutil as du
import datetime as dt
import QSTK.qstkutil.DataAccess as da
import QSTK.qstkutil.tsutil as tsu
import QSTK.qstkstudy.EventProfiler as ep
dataObj = da.DataAccess('Yahoo')
def find_events(ls_symbol... | ericsomdahl/compfiOne | HW2/hw2.py | Python | unlicense | 2,580 |
# -*- 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... | googleapis/python-recommender | google/cloud/recommender_v1/services/recommender/async_client.py | Python | apache-2.0 | 50,233 |
import os
import numpy as np
import math
import arcpy
def intersect_file(intersect_file, intersect_col=None):
intersect_aoi_basename = os.path.basename(intersect_file)
intersect_calc = {'adm2': """!FC_NAME! +"_"+!ISO!+ str(!ID_1!)+'d'+ str(!ID_2!)""",
'adm1': """!FC_NAME! +"_"+!ISO!+ st... | sgibbes/zonal_stats_app | utilities/prep_shapefile.py | Python | apache-2.0 | 3,132 |
from django.conf.urls import url, include
from django.contrib.auth import views as auth_views
from django.contrib import admin
from app import views
from app import api_views
api_urlpatterns = [
url(r'^get_friends_light_states', api_views.json_friends_light_states, name='api_v1_get_friends_light_states'),
url... | cydrobolt/lucem | lucem/urls.py | Python | apache-2.0 | 732 |
# Copyright 2018 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | tensorflow/moonlight | moonlight/staves/staffline_distance.py | Python | apache-2.0 | 10,559 |
# coding: utf-8
"""
Server API
Reference for Server API (REST/Json)
OpenAPI spec version: 2.0.6
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re
class VideoAccessInfoResponse(object):
"""
NOTE: This cl... | kinow-io/kinow-python-sdk | kinow_client/models/video_access_info_response.py | Python | apache-2.0 | 8,913 |
"""Resolwe collection model."""
from django.contrib.postgres.fields import ArrayField
from django.contrib.postgres.indexes import GinIndex
from django.contrib.postgres.search import SearchVectorField
from django.db import models, transaction
from resolwe.permissions.models import PermissionObject, PermissionQuerySet
... | genialis/resolwe | resolwe/flow/models/collection.py | Python | apache-2.0 | 3,575 |
def __virtual__():
return True
def execute(*args, **kwargs):
# we use the dunder to assert the loader is provided minionmods
return __salt__["test.arg"]("test.arg fired")
| saltstack/salt | tests/integration/files/file/base/_executors/arg.py | Python | apache-2.0 | 185 |
# Copyright 2013 IBM Corp.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... | openstack/ironic | ironic/objects/__init__.py | Python | apache-2.0 | 1,737 |
# 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 agreed to in writing, s... | googleapis/python-documentai | samples/snippets/process_document_splitter_sample.py | Python | apache-2.0 | 3,497 |
# Copyright 2017 James Fong
#
# 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 i... | Naftoreiclag/Genre-Entities | tool/SyncEngineCodelite.py | Python | apache-2.0 | 2,659 |
# coding: utf-8
import imp
from migrate.versioning import api
from app import db
from config import SQLALCHEMY_DATABASE_URI
from config import SQLALCHEMY_MIGRATE_REPO
migration = SQLALCHEMY_MIGRATE_REPO + '/versions/%03d_migration.py' % (api.db_version(SQLALCHEMY_DATABASE_URI, SQLALCHEMY_MIGRATE_REPO) + 1)
tmp_modu... | tongxindao/Flask-micblog | Flask-MicroBlog/web/micblog/db_migrate.py | Python | apache-2.0 | 844 |
import json
import correlation
import category
import tools
import settings
from matplotlib.backends.backend_pdf import PdfPages
def process_data(data_type, stats, highlights):
print("Starting student data processing.")
all_pdf_path, highlight_pdf_path = (None,None)
question_types, demographic_question... | code-ape/SocialJusticeDataProcessing | stats.py | Python | apache-2.0 | 3,877 |
# Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | alexgorban/models | research/slim/nets/nasnet/nasnet_utils.py | Python | apache-2.0 | 20,826 |
#!/usr/bin/env python
#
# Camlistore uploader client for Python.
#
# Copyright 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-... | marsch/camlistore | lib/python/camli/op.py | Python | apache-2.0 | 12,883 |
#
# DAPLink Interface Firmware
# Copyright (c) 2016-2017, ARM Limited, All Rights Reserved
# SPDX-License-Identifier: Apache-2.0
#
# 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... | google/DAPLink-port | test/stress_tests/hid_usb_test.py | Python | apache-2.0 | 2,358 |
import os
from fontbakery.profiles.universal import UNIVERSAL_PROFILE_CHECKS
from fontbakery.checkrunner import Section, WARN, PASS #, INFO, ERROR, SKIP, FAIL
from fontbakery.callable import check #, disable
from fontbakery.message import Message
from fontbakery.fonts_profile import profile_factory
from fontbakery.con... | graphicore/fontbakery | Lib/fontbakery/profiles/notofonts.py | Python | apache-2.0 | 6,244 |
import sparse_interaction
from sklearn.datasets import fetch_20newsgroups_vectorized
from sklearn.cross_validation import StratifiedKFold
from sklearn.linear_model import SGDClassifier
from sklearn.metrics import f1_score
dat = fetch_20newsgroups_vectorized()
X = dat.data
Y = dat.target
cv = StratifiedKFold(Y)
X = X[... | AWNystrom/SparseInteraction | old/compare.py | Python | apache-2.0 | 789 |
# coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import os
import sub... | tejal29/pants | tests/python/pants_test/pants_run_integration_test.py | Python | apache-2.0 | 6,636 |
#!/usr/bin/env python
# standard library imports
from os.path import exists
# third party related imports
from setuptools import setup, find_packages
# local library imports
from mobile_push import __version__
def read_from_file(filename):
if exists(filename):
with open(filename) as f:
ret... | theKono/mobile-push | setup.py | Python | apache-2.0 | 1,163 |
#
# 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
# ... | wikimedia/operations-software-deployment-trebuchet-trigger | trigger/config.py | Python | apache-2.0 | 5,847 |
import cv2
import numpy
from PIL import Image
import numpy as np
import os
from matplotlib import pyplot as plt
bin_n = 16 # Number of bins
def hog(img):
gx = cv2.Sobel(img, cv2.CV_32F, 1, 0)
gy = cv2.Sobel(img, cv2.CV_32F, 0, 1)
mag, ang = cv2.cartToPolar(gx, gy)
bins = np.int32(bin_n*ang/... | Emmanu12/Image-Classification-using-SVM | predict.py | Python | apache-2.0 | 4,390 |
# Copyright (c) 2015 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to ... | ekcs/congress | congress/tests/api/test_driver_model.py | Python | apache-2.0 | 3,604 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.