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 |
|---|---|---|---|---|---|
import pylab as pl
import scipy as sp
from serpentine import *
from elements import *
import visualize
class AtfExt :
def __init__(self) :
print 'AtfExt:__init__'
# set twiss parameters
mytwiss = Twiss()
mytwiss.betax = 6.85338806855804
mytwiss.alphax = 1.11230788371885
... | OscarES/serpentinetracker | examples/atf/atfExt.py | Python | gpl-3.0 | 1,975 |
# -*- coding: utf-8 -*-
"""
Created on Thu Jun 05 13:55:13 2014
@author: Alison Kirkby
"""
import mtpy.core.edi as mtedi
import os
import os.path as op
import numpy as np
import matplotlib.pyplot as plt
import scipy.interpolate as si
import mtpy.utils.exceptions as MTex
import mtpy.utils.calculator as MTcc
import mt... | MTgeophysics/mtpy | mtpy/modeling/pek1dclasses.py | Python | gpl-3.0 | 30,903 |
from django.core.urlresolvers import reverse
from tests.test_utils import create_generic_job
from treeherder.model.models import JobLog
def test_get_job_log_urls(test_repository, result_set_stored,
failure_classifications,
generic_reference_data, webapp):
job1 ... | kapy2010/treeherder | tests/webapp/api/test_job_log_url_api.py | Python | mpl-2.0 | 1,524 |
# encoding: utf-8
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
#
# Author: Kyle Lahnakoski (kyle@lahnakoski.com)
#
from __future__ import unicode_literals
from __f... | klahnakoski/MoDevETL | pyLibrary/convert.py | Python | mpl-2.0 | 17,324 |
#!/usr/bin/env python3
# coding:utf-8
from __future__ import print_function
'PackagesHTTPD - stream folder content as .tar over http'
__author__ = 'Mathias Gumz <mgumz@tpip.net>'
__license__ = 'MPL2'
__version__ = ''
import sys
import os, os.path
import zipfile, tarfile
from StringIO import StringIO
import cgi
try:... | pokymobo/redomat | libredo/data/result_httpd.py | Python | mpl-2.0 | 4,908 |
# coding: utf-8
'''Common test fixtures
@author: Jesse Schwartzentruber (:truber)
@license:
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/.
'''
import logging
import os... | MozillaSecurity/FuzzManager | server/covmanager/tests/conftest.py | Python | mpl-2.0 | 6,179 |
#!/usr/bin/python
# vim:fileencoding=utf8
from __future__ import unicode_literals
import unittest
class TestUDPipe(unittest.TestCase):
def test_model(self):
import ufal.udpipe
model = ufal.udpipe.Model.load('test/data/test.model')
self.assertTrue(model)
tokenizer = model.newToken... | ufal/udpipe | releases/pypi/test/test_udpipe.py | Python | mpl-2.0 | 1,690 |
#!/usr/bin/env python
'''
Set of analytics based on ssdeep hash.
- compare
Simple implementation of ssdeep comparisions using a few optimizations
described at the links below
https://www.virusbulletin.com/virusbulletin/2015/11/optimizing-ssdeep-use-scale
http://www.intezer.com/intezer-community-tip-s... | jmlong1027/multiscanner | analytics/ssdeep_analytics.py | Python | mpl-2.0 | 10,551 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import modelcluster.fields
class Migration(migrations.Migration):
dependencies = [
('wagtailcore', '0028_merge'),
('home', '0023_remove_homepage_live_feed_intro'),
]
operations = [
... | ghostwords/localore | localore/home/migrations/0024_homepagefeaturedpage.py | Python | mpl-2.0 | 1,191 |
# Generated by Django 2.0.5 on 2018-05-10 22:56
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [("studies", "0001_initial")]
operations = [migrations.AlterModelOptions(name="extension", options={"ordering": ("-id",)})]
| mozilla/normandy | normandy/studies/migrations/0002_auto_20180510_2256.py | Python | mpl-2.0 | 272 |
"""
Serializers for Video Abstraction Layer
Serialization is usually sent through the VideoSerializer which uses the
EncodedVideoSerializer which uses the profile_name as it's profile field.
"""
from rest_framework import serializers
from django.core.exceptions import ValidationError
from edxval.models import Profile... | GbalsaC/bitnamiP | edx-val/edxval/serializers.py | Python | agpl-3.0 | 4,408 |
from tfidf import *
import psycopg2
import psycopg2.extensions
import math
def cos_sim(A,B):
def dot_product(a,b):
sum = 0.0
for key in a.keys():
if key in b:
sum += a[key]*b[key]
return sum
return dot_product(A,B)/(math.sqrt(dot_product(A,A)) * math.sqrt(dot_... | JohnCEarls/AUREA | scripts/testScripts/testTFIDF.py | Python | agpl-3.0 | 1,566 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import datetime
class Migration(migrations.Migration):
dependencies = [
('ccx', '0008_auto_20170523_0630'),
]
operations = [
migrations.AlterField(
model_name='customcour... | mbareta/edx-platform-ft | lms/djangoapps/ccx/migrations/0009_auto_20170608_0525.py | Python | agpl-3.0 | 735 |
import subprocess
import logging
import os, sys, traceback
import urllib
from fluxclient import check_platform
from .misc import BinaryUploadHelper, BinaryHelperMixin, OnTextMessageMixin
logger = logging.getLogger("API.SLICING")
StlSlicer = None
StlSlicerCura = None
def get_default_cura():
return os.environ["c... | flux3dp/fluxghost | fluxghost/api/stl_slicing_parser.py | Python | agpl-3.0 | 13,536 |
# -*- coding: utf-8 -*-
# © 2017 Cesar Barron Bautista
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from . import purchase
| Gebesa-Dev/Addons-gebesa | purchase_order_o2o_procurement/models/__init__.py | Python | agpl-3.0 | 148 |
import time
import RPi.GPIO as GPIO
GPIO.VERSION
GPIO.setmode(GPIO.BOARD)
GPIO.setup(11,GPIO.OUT)
GPIO.setup(12,GPIO.OUT)
from smbus import SMBus
bus = SMBus(1)
def read_ain(i):
global bus
#bus.write_byte_data(0x48, 0x40 | ((i) & 0x03), 0)
bus.write_byte(0x48, i)
bus.read_byte(0x48)#first 2 are l... | EugeneHasJeans/EugeneHasJeans.github.io | documents/lifelines.py | Python | agpl-3.0 | 799 |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2015-2015: 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, ei... | gst/alignak | alignak/objects/resultmodulation.py | Python | agpl-3.0 | 5,934 |
# -*- coding: utf-8 -*-
# This file is part of Shoop.
#
# Copyright (c) 2012-2015, Shoop 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 pytest
from shoop.notify import Context
from shoop_tests.notify.fixt... | taedori81/shoop | shoop_tests/notify/test_log_entries.py | Python | agpl-3.0 | 1,388 |
import logging
import time
from django.conf import settings
from django.core.mail import get_connection as dj_get_connection
logger = logging.getLogger(__name__)
class BackendWrapper(object):
"""A wrapper around Django's Email Backend, providing hooks
for instrumentation and testing.
"""
def __ini... | EDUlib/notifier | notifier/connection_wrapper.py | Python | agpl-3.0 | 1,867 |
# Copyright 2016 - 2018 Ternaris.
# SPDX-License-Identifier: AGPL-3.0-only
from pkg_resources import resource_filename
import marv_node.testing
from marv_node.testing import make_dataset, run_nodes, temporary_directory
from marv_robotics.detail import connections_section as node
from marv_store import Store
class ... | ternaris/marv-robotics | code/marv/marv_node/testing/_robotics_tests/test_section_topics.py | Python | agpl-3.0 | 960 |
# -*- coding: 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 General Public License as pu... | funkring/fdoo | addons-funkring/at_account/wizard/invoice_attachment_wizard.py | Python | agpl-3.0 | 2,242 |
"""StoreServer provides a number of plugins which can provide a store
service on a server.
There are currently 2 plugins available: ``webserver`` and ``gitdaemon``.
These can be used to simplify provision of a store, e.g using the
``webserver`` StoreServer instead of installing a 3rd party webserver
such as Apache.
... | certain/certain | certain/StoreServer/__init__.py | Python | agpl-3.0 | 325 |
from __future__ import division
import datetime
import re
import itertools
import random
from django.conf import settings
from django.core import exceptions
from django.core.urlresolvers import reverse
from django.db.models import Q
from django.contrib.contenttypes import generic
from django.contrib.contenttypes.m... | Hutspace/odekro | mzalendo/core/models.py | Python | agpl-3.0 | 25,729 |
import requests
LRS = "http://cygnus.ic.uva.nl:8000/XAPI/statements"
u = raw_input("LRS username: ")
p = raw_input("LRS password: ")
r = requests.get(LRS,headers={"X-Experience-API-Version":"1.0"},auth=(u,p));
if r.status_code == 200:
print "Success"
else:
print "Server returns",r.status_code
| ictofnwi/coach | test_lrs.py | Python | agpl-3.0 | 305 |
from config import cloudplatform
storage_adapter = None
if cloudplatform == "google":
import googlestorage
storage_adapter = googlestorage
elif cloudplatform == "aws":
import awsstorage
storage_adapter = awsstorage
elif cloudplatform == "azure":
from FlaskWebProject import azurestorage
storage... | ohaz/amos-ss15-proj1 | FlaskWebProject/storageinterface.py | Python | agpl-3.0 | 3,348 |
# -*- coding: utf-8 -*-
#
##############################################################################
#
# Authors: Adrien Peiffer
# Copyright (c) 2014 Acsone SA/NV (http://www.acsone.eu)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero Genera... | QANSEE/l10n-belgium | account_companyweb/wizard/__init__.py | Python | agpl-3.0 | 1,052 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (C) 2009-2014:
# Gabes Jean, naparuba@gmail.com
# Gerhard Lausser, Gerhard.Lausser@consol.de
# Gregory Starck, g.starck@gmail.com
# Hartmut Goebel, h.goebel@goebel-consult.de
#
# This file is part of Shinken.
#
# Shinken is free software: you can redis... | h4wkmoon/shinken | shinken/objects/contact.py | Python | agpl-3.0 | 13,143 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import urllib2
import time, os
import sys, fileinput
from bs4 import BeautifulSoup
class Grabber(object):
def use(self):
print ""
print "* This just Fucking whatever for grabbing."
print "* For license just fucking to change this. ^Summon Agus Cre... | agusmakmun/Some-Examples-of-Simple-Python-Script | grabbing/notes.py | Python | agpl-3.0 | 5,474 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.18 on 2019-02-04 16:09
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('meinberlin_organisations', '0006_update_orga_type_string'),
]
operations = [
migra... | liqd/a4-meinberlin | meinberlin/apps/organisations/migrations/0007_remove_organisation_type.py | Python | agpl-3.0 | 420 |
"""
Forms and validation code for user registration.
"""
from django import forms
from django.utils.translation import ugettext_lazy as _
from django.contrib.auth.models import User
from registration.models import RegistrationProfile
# I put this on all required fields, because it's easier to pick up
# on them wit... | umitproject/openmonitor-aggregator | registration/forms.py | Python | agpl-3.0 | 6,034 |
"""
flask.ext.restless.views
~~~~~~~~~~~~~~~~~~~~~~~~
Provides the following view classes, subclasses of
:class:`flask.MethodView` which provide generic endpoints for interacting
with an entity of the database:
:class:`flask.ext.restless.views.API`
Provides the endpoints for each of the ... | jkatzer/flask-restless | flask_restless/views.py | Python | agpl-3.0 | 72,094 |
# Copyright 2020 Creu Blanca
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
"name": "Kpi Dashboard",
"summary": """
Create Dashboards using kpis""",
"version": "14.0.1.0.0",
"license": "AGPL-3",
"author": "Creu Blanca,Odoo Community Association (OCA)",
"website": "htt... | OCA/reporting-engine | kpi_dashboard/__manifest__.py | Python | agpl-3.0 | 797 |
import pytest
from postix.core.models import Ping
from ..factories import cashdesk_factory, ping_factory
@pytest.mark.django_db
def test_troubleshooter_ping_view(troubleshooter_client):
[ping_factory(ponged=(index % 3 != 0)) for index in range(10)]
desk = cashdesk_factory()
assert Ping.objects.count() =... | c3cashdesk/c6sh | src/tests/troubleshooter/test_troubleshooter_views_ping.py | Python | agpl-3.0 | 624 |
{
'name': 'Product Pack POS َfor IngAdhoc',
'summary': 'Product packs on POS',
'description': """
This module is extension َfor INGADHOC's module product_pack that will
Process product_pack pickings َfrom POS sales.
Note: this module works with Fixed price packs only.
""",
'version': '10.0.0.2',
... | mohamedhagag/dvit-odoo | product_pack_pos/__manifest__.py | Python | agpl-3.0 | 665 |
# encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Poll.detailed_chart'
db.add_column('polls_poll', 'detailed_chart', self.gf('django.db.mode... | tracfm/tracfm | tracfm/polls/migrations/0010_auto__add_field_poll_detailed_chart.py | Python | agpl-3.0 | 13,004 |
# -*- coding: utf-8 -*-
# (c) 2015 Andreas Motl, Elmyra UG <andreas.motl@elmyra.de>
from kotori.version import __VERSION__
from pyramid.config import Configurator
def main(global_config, **settings):
"""This function returns a Pyramid WSGI application."""
settings['SOFTWARE_VERSION'] = __VERSION__
confi... | daq-tools/kotori | kotori/frontend/app.py | Python | agpl-3.0 | 843 |
# -*- coding: utf-8 -*-
##############################################################################
#
# This file is part of medical_medicament,
# an Odoo module.
#
# Copyright (c) 2015 ACSONE SA/NV (<http://acsone.eu>)
#
# medical_medicament is free software:
# you can redistribute it and/or mod... | ShaheenHossain/eagle-medical | medical_medicament/__manifest__.py | Python | agpl-3.0 | 1,827 |
'''
Created on Mar 25, 2013
@author: dmitchell
'''
import datetime
import subprocess
import unittest
import uuid
from importlib import import_module
from xblock.fields import Scope
from xmodule.course_module import CourseDescriptor
from xmodule.modulestore.exceptions import InsufficientSpecificationError, ItemNotFoun... | abo-abo/edx-platform | common/lib/xmodule/xmodule/modulestore/tests/test_split_modulestore.py | Python | agpl-3.0 | 55,767 |
from django.http import HttpResponseRedirect
from django.shortcuts import render_to_response
from django.template import RequestContext
from oauth_access.access import OAuthAccess
from oauth_access.exceptions import MissingToken
def oauth_login(request, service,
redirect_field_name="next", redirect_to_sessio... | DraXus/andaluciapeople | oauth_access/views.py | Python | agpl-3.0 | 1,715 |
# -*- coding: utf-8 -*-
# Copyright 2019 Joan Marín <Github@JoanMarin>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
"name": "Tax Group Types",
"category": "Financial",
"version": "10.0.1.0.0",
"author": "EXA Auto Parts Github@exaap, "
"Joan Marín Github@JoanMarin",
... | odoo-colombia/l10n-colombia | account_tax_group_type/__manifest__.py | Python | agpl-3.0 | 636 |
# -*- coding: utf-8; -*-
#
# This file is part of Superdesk.
#
# Copyright 2013, 2014 Sourcefabric z.u. and contributors.
#
# For the full copyright and license information, please see the
# AUTHORS and LICENSE files distributed with this source code, or
# at https://www.sourcefabric.org/superdesk/license
from flask i... | amagdas/superdesk | server/apps/archive/archive_link.py | Python | agpl-3.0 | 2,628 |
##############################################################################
#
# 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 | base/forms/search/search_tutor.py | Python | agpl-3.0 | 1,699 |
# -*- coding: utf-8; -*-
#
# This file is part of Superdesk.
#
# Copyright 2013, 2014 Sourcefabric z.u. and contributors.
#
# For the full copyright and license information, please see the
# AUTHORS and LICENSE files distributed with this source code, or
# at https://www.sourcefabric.org/superdesk/license
from copy imp... | superdesk/superdesk-aap | server/aap/publish/formatters/anpa_formatter.py | Python | agpl-3.0 | 8,923 |
# -*- coding: utf-8 -*-
##############################################################################
#
# Author: Guewen Baconnier
# Copyright 2013 Camptocamp SA
# Copyright 2013 Akretion
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero Gene... | credativUK/connector-magento | __unported__/magentoerpconnect/magento_model.py | Python | agpl-3.0 | 28,454 |
# -*- coding: utf-8 -*-
#
# This file is part of INGInious. See the LICENSE and the COPYRIGHTS files for
# more information about the licensing of this file.
""" Course page """
import web
from inginious.frontend.pages.utils import INGIniousPage
class CoursePage(INGIniousPage):
""" Course page """
def get_... | JuezUN/INGInious | inginious/frontend/pages/course.py | Python | agpl-3.0 | 4,665 |
from edx_ace import MessageType
# This code also exists in the Credentials app `messages.py` file. Any changes here should be duplicated there as well
# until we can come back around and create a common base Messaging class that the Credentials and Records app will
# utilize.
class ProgramCreditRequest(MessageType):
... | edx/credentials | credentials/apps/records/messages.py | Python | agpl-3.0 | 1,071 |
import datetime
from judge.utils.timedelta import nice_repr
from . import registry
@registry.filter
def timedelta(value, display='long'):
if value is None:
return value
return nice_repr(value, display)
@registry.filter
def timestampdelta(value, display='long'):
value = datetime.timedelta(second... | DMOJ/site | judge/jinja2/timedelta.py | Python | agpl-3.0 | 584 |
# encoding: utf-8
# Copyright (c) 2001-2014, Canal TP and/or its affiliates. All rights reserved.
#
# This file is part of Navitia,
# the software to build cool stuff with public transport.
#
# Hope you'll enjoy and contribute to this project,
# powered by Canal TP (www.canaltp.fr).
# Help us simplify mobility ... | ballouche/navitia | source/jormungandr/tests/ptref_tests.py | Python | agpl-3.0 | 34,004 |
# -*- 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... | xrg/openerp-server | bin/service/web_services.py | Python | agpl-3.0 | 41,970 |
# -*- coding: utf-8 -*-
from django.db import models
from django.contrib.auth.models import User
from users.models import Hijo
class Post(models.Model):
title = models.TextField(null=True, blank=True) #Título
content = models.TextField(null=True, blank=True) #Contenido de la entrada
url = models.URLField... | pupils/pupils | pupils/tablon/models.py | Python | agpl-3.0 | 566 |
# -*- coding: utf-8 -*-
"""
This is the common settings file, intended to set sane defaults. If you have a
piece of configuration that's dependent on a set of feature flags being set,
then create a function that returns the calculated value based on the value of
FEATURES[...]. Modules that extend this one can change th... | kuiwei/edx-platform | lms/envs/common.py | Python | agpl-3.0 | 63,921 |
# -*- coding: utf-8 -*-
import base64
import time
import simplejson as json
from eventlet.green import urllib2
import urllib
from kral import config
def stream(queries, queue, kral_start_time):
url = 'https://stream.twitter.com/1/statuses/filter.json'
queries = [q.lower() for q in queries]
quoted_querie... | lrvick/kral | kral/services/twitter.py | Python | agpl-3.0 | 2,819 |
# -*- coding: utf-8 -*-
from setuptools import setup, find_packages
import os
import glob
import sys
#VERSION="2.1dev4"
VERSION="2.6dev5"
# Taken from kennethreitz/requests/setup.py
package_directory = os.path.realpath(os.path.dirname(__file__))
def get_file_contents(file_path):
"""Get the context of the file u... | woddx/privacyidea | setup.py | Python | agpl-3.0 | 5,648 |
from __future__ import absolute_import
from django.conf.urls import include, url
from tastypie.api import Api
from locations.api import v1, v2
from locations.api.sword import views
v1_api = Api(api_name="v1")
v1_api.register(v1.SpaceResource())
v1_api.register(v1.LocationResource())
v1_api.register(v1.PackageResource... | artefactual/archivematica-storage-service | storage_service/locations/api/urls.py | Python | agpl-3.0 | 865 |
# This file is part of Booktype.
# Copyright (c) 2012 Aleksandar Erkalovic <aleksandar.erkalovic@sourcefabric.org>
#
# Booktype 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 Li... | aerkalov/Booktype | lib/booki/channels/group.py | Python | agpl-3.0 | 2,141 |
# -*- coding: utf-8 -*-
# Copyright (C) 2012 Rodrigo Alves Lima
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version... | rodrigoalveslima/runn | src/src/middleware.py | Python | agpl-3.0 | 917 |
# decodex - simple enigma decoder.
#
# Copyright (c) 2013 Paul R. Tagliamonte <tag@pault.ag>
#
# 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 ... | paultag/decodex | decodex/utils/words.py | Python | agpl-3.0 | 2,313 |
from erukar.system.engine import Enemy, BasicAI
from ..templates.Undead import Undead
from erukar.content.inventory import Shortsword, Buckler
from erukar.content.modifiers import Steel, Oak
class Skeleton(Undead):
ClassName = 'Skeleton'
ClassLevel = 1
BaseMitigations = {
'bludgeoning': (-0.25, 0)... | etkirsch/legends-of-erukar | erukar/content/enemies/undead/Skeleton.py | Python | agpl-3.0 | 1,103 |
###################################################################
#
# Copyright (c) 2011 Canonical Ltd.
# Copyright (c) 2013 Miing.org <samuel.miing@gmail.com>
#
# This software is licensed under the GNU Affero General Public
# License version 3 (AGPLv3), as published by the Free Software
# Foundation, and may be ... | miing/mci_migo | fabfile/__init__.py | Python | agpl-3.0 | 899 |
# Generated by Django 3.0.9 on 2020-09-04 21:51
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('stock', '0006_auto_20200904_2343'),
]
operations = [
migrations.RemoveField(
model_name='paymenttransaction',
name='... | UrLab/incubator | stock/migrations/0007_auto_20200904_2351.py | Python | agpl-3.0 | 587 |
#!/usr/bin/env python
"""
Build an ansible inventory based on autoscaling group instance lifecycle state.
Outputs JSON to stdout with keys for each state and combination of autoscaling
group and state.
{
"InService": [
"10.0.47.127",
"10.0.46.174"
],
"Terminating:Wait": [
"10.0.48.104"
],
"e-d-... | hmcmooc/ec2-edx-configuration | playbooks/edx-east/lifecycle_inventory.py | Python | agpl-3.0 | 2,195 |
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2009 CamptoCamp. All rights reserved.
# @author Nicolas Bessi
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Publi... | rosenvladimirov/addons | currency_rate_update_bg/services/currency_getter.py | Python | agpl-3.0 | 2,676 |
# -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2015 MicroEra s.r.l.
# (<http://www.microera.it>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License... | appendif/microera | jimo_pricelist_report/__openerp__.py | Python | agpl-3.0 | 1,482 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.20 on 2020-03-04 21:13
# Django
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('crowdsource', '0025_auto_20191209_1647'),
]
operations = [
migrations.AddField(
model_name='c... | MuckRock/muckrock | muckrock/crowdsource/migrations/0026_crowdsource_ask_public.py | Python | agpl-3.0 | 587 |
# Django settings for apmanager project.
import os
from django.utils.translation import ugettext_lazy as _
DEBUG = True
USE_DAEMON = True
if os.environ.get("USE_DEV_PATHS", None):
DEV_PATHS = True
else:
DEV_PATHS = False
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@domain.com'),
)
MANAGE... | veloutin/papas | etc/papas/settings.py | Python | agpl-3.0 | 4,958 |
# -*- coding: utf-8 -*-
# Copyright 2017 LasLabs Inc.
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
from odoo import api, fields, models, _
from odoo.exceptions import ValidationError
class ResLang(models.Model):
_inherit = 'res.lang'
default_uom_ids = fields.Many2many(
string='De... | ovnicraft/server-tools | base_locale_uom_default/models/res_lang.py | Python | agpl-3.0 | 1,775 |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
import django.utils.timezone
import model_utils.fields
from django.db import migrations, models
from opaque_keys.edx.django.models import CourseKeyField, UsageKeyField
from lms.djangoapps.courseware.fields import UnsignedBigIntAutoField
... | ESOedX/edx-platform | lms/djangoapps/grades/migrations/0001_initial.py | Python | agpl-3.0 | 2,347 |
# -*- coding: utf-8 -*-
# Copyright (C) 2016-Today: Odoo Community Association (OCA)
# @author: Sylvain LE GAL (https://twitter.com/legalsylvain)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
import logging
from openerp import models, fields, api
_logger = logging.getLogger(__name__)
class G... | legalsylvain/oca-custom | __unported__/oca_freestore/models/github_repository.py | Python | agpl-3.0 | 4,465 |
#!/usr/bin/env python
import os
import os.path
import msgpack
import json
from base64 import b64encode, b64decode
from binascii import hexlify
from time import time
import compression
import crypto
from transports.metatransport import MetaTransport
from transports.transport import NotRedundant
from flexceptions im... | sharph/forklift | forklift/backup.py | Python | agpl-3.0 | 14,454 |
# -*- coding: utf-8 -*-
# Copyright 2016 ACSONE SA/NV (<http://acsone.eu>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from . import mass_mailing_stats
| acsone/mozaik | mozaik_communication/models/__init__.py | Python | agpl-3.0 | 178 |
"""
Tests for contentstore.views.preview.py
"""
import re
from unittest import mock
import ddt
from django.test.client import Client, RequestFactory
from web_fragments.fragment import Fragment
from xblock.core import XBlock, XBlockAside
from cms.djangoapps.contentstore.utils import reverse_usage_url
from cms.django... | edx/edx-platform | cms/djangoapps/contentstore/views/tests/test_preview.py | Python | agpl-3.0 | 9,656 |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2012 - INECO PARTNERSHIP LIMITED (<http://www.ineco.co.th>).
#
# This program is free software: you can redistribute it and/or modify
# it under... | jeffery9/mixprint_addons | ineco_purchase_sequence/__openerp__.py | Python | agpl-3.0 | 1,458 |
# #############################################################################
#
# OpenERP, Open Source Management Solution
# This module copyright (C) 2010 - 2014 Savoir-faire Linux
# (<http://www.savoirfairelinux.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of ... | OCA/server-tools | module_prototyper/tests/test_prototype_module_export.py | Python | agpl-3.0 | 2,979 |
# Copyright 2015, Province of British Columbia
# License: https://github.com/bcgov/ckanext-bcgov/blob/master/license
from ckan.common import c, _
import pylons.config as config
import ckan.lib.base as base
import ckan.plugins as plugins
import ckan.plugins.toolkit as toolkit
from routes.mapper import SubMapper
fr... | gjlawran/ckanext-bcgov | ckanext/bcgov/plugin.py | Python | agpl-3.0 | 17,900 |
from cornflake.exceptions import ValidationError
from flask import Response
from radar.api.serializers.auth import ForgotUsernameSerializer
from radar.api.views.generics import ApiView, request_json
from radar.auth.exceptions import UserNotFound
from radar.auth.forgot_username import forgot_username
class ForgotUser... | renalreg/radar | radar/api/views/forgot_username.py | Python | agpl-3.0 | 814 |
#! /usr/bin/python
# -*- coding: utf-8 -*-
#-----------------------------------------------------------------------------
# Name: ProjectCli.py
# Purpose:
# Author: Fabien Marteau <fabien.marteau@armadeus.com>
# Created: 23/05/2008
#-----------------------------------------------------------------------------
... | xcthulhu/periphondemand | src/bin/commandline/projectcli.py | Python | lgpl-2.1 | 32,354 |
from abc import ABCMeta
from recommenders.similarity.weights_similarity_matrix_builder import \
WeightsSimilarityMatrixBuilder
from tripadvisor.fourcity import extractor
from recommenders.base_recommender import BaseRecommender
from utils import dictionary_utils
__author__ = 'fpena'
class MultiCriteriaBaseReco... | melqkiades/yelp | source/python/recommenders/multicriteria/multicriteria_base_recommender.py | Python | lgpl-2.1 | 3,524 |
#!/usr/bin/env python3
#
# Copyright © 2019 Endless Mobile, Inc.
#
# SPDX-License-Identifier: LGPL-2.1-or-later
#
# Original author: Philip Withnall
"""
Checks that a merge request doesn’t add any instances of the string ‘todo’
(in uppercase), or similar keywords. It may remove instances of that keyword,
or move them ... | endlessm/glib | .gitlab-ci/check-todos.py | Python | lgpl-2.1 | 2,831 |
import numpy as np
from .base import Env
from rllab.spaces import Discrete
from rllab.envs.base import Step
from rllab.core.serializable import Serializable
MAPS = {
"chain": [
"GFFFFFFFFFFFFFSFFFFFFFFFFFFFG"
],
"4x4_safe": [
"SFFF",
"FWFW",
"FFFW",
"WFFG"
],
... | roboticslab-uc3m/xgnitive | programs/drl/envs/grid_world_3D_env.py | Python | lgpl-2.1 | 6,357 |
# referenciacatastral.py - functions for handling Spanish real state ids
# coding: utf-8
#
# Copyright (C) 2016 David García Garzón
# Copyright (C) 2016-2017 Arthur de Jong
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as publish... | holvi/python-stdnum | stdnum/es/referenciacatastral.py | Python | lgpl-2.1 | 4,360 |
import itchat
itchat.login()
friends = itchat.get_friends(update = True)[0:]
info = {}
for i in friends:
info[i['NickName']] = i.Signature
print(info) | XiangYz/webscraper | itchat_test.py | Python | lgpl-2.1 | 157 |
# Copyright (C) 2011 Jeff Forcier <jeff@bitprophet.org>
#
# This file is part of ssh.
#
# 'ssh' 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)
# ... | bitprophet/ssh | ssh/transport.py | Python | lgpl-2.1 | 88,838 |
# -*- coding: utf-8 -*-
# This program is free software; you can redistribute it and/or modify
# it under the terms of the (LGPL) GNU Lesser General Public License as
# published by the Free Software Foundation; either version 3 of the
# License, or (at your option) any later version.
#
# This program is distri... | Affirm/suds-jurko | tests/test_wsse.py | Python | lgpl-3.0 | 1,605 |
# This file is part of PyEMMA.
#
# Copyright (c) 2015-2017 Computational Molecular Biology Group, Freie Universitaet Berlin (GER)
#
# PyEMMA 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 versio... | fabian-paul/PyEMMA | pyemma/thermo/estimators/DTRAM_estimator.py | Python | lgpl-3.0 | 14,367 |
#!/usr/bin/env python
#-*- coding: UTF-8 -*-
# File: pyText2Pdf.py
#
# Derived from http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/189858
__docformat__ = 'plaintext'
__date__ = '04/10/2013'
'''
pyText2Pdf - Python script to convert plain text files into Adobe
Acrobat PDF files.
Version 1.2
Author... | costastf/blind-Pyrsync | pytxt2pdf/pyText2Pdf.py | Python | lgpl-3.0 | 22,089 |
#!/usr/bin/python
import itertools
class ListCreator():
current_list = None
def fcstDiracGammasInAlldimsAllIndicesContracted(self):
self.current_list = set(
list(itertools.permutations(['dirac_gamma<1>', 'dirac_gamma<1>'])) +
list(itertools.permutations(['dirac_gamma<1>', 'dirac_gamm... | FeynCalc/pyfeyncalctester | src/listcreator.py | Python | lgpl-3.0 | 44,022 |
###################################################################################
#
# Copyright (c) 2017-2019 MuK IT GmbH.
#
# This file is part of MuK Documents Access
# (see https://mukit.at).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Le... | muk-it/muk_dms | muk_dms_access/tests/test_benchmark.py | Python | lgpl-3.0 | 1,933 |
"""
Usefull method and classes not belonging anywhere and depending on opcua library
"""
from dateutil import parser
from datetime import datetime
from enum import Enum, IntEnum
import uuid
from opcua import ua
from opcua.ua.uaerrors import UaError
def val_to_string(val):
"""
convert a python object or pyth... | bitkeeper/python-opcua | opcua/common/ua_utils.py | Python | lgpl-3.0 | 8,286 |
#!/usr/bin/env python3
# -*- coding: utf-8; Mode: Python; indent-tabs-mode: nil; tab-width: 4 -*-
# vim: set fileencoding=utf-8 filetype=python syntax=python.doxygen fileformat=unix tabstop=4 expandtab :
# kate: encoding utf-8; bom off; syntax python; indent-mode python; eol unix; replace-tabs off; indent-width 4; tab-... | DevynCJohnson/Pybooster | pylib/code_interpreter.py | Python | lgpl-3.0 | 5,388 |
def isPandigital(strN):
Ln = [c for c in strN]
Ln.sort()
if Ln == ['1', '2', '3', '4', '5', '6', '7', '8', '9']:
return True
return False
listPans=[]
listMultiplier=[]
#dont know if these limits are ok
i=9
while i<9999:
n=2
while n<999:
j=1
strProd=''
while j<n:... | haphaeu/yoshimi | EulerProject/038.py | Python | lgpl-3.0 | 1,137 |
# -*- encoding: utf-8 -*-
# from django.shortcuts import render, render_to_response, redirect, get_object_or_404, get_list_or_404, Http404
from django.core.cache import cache
from django.shortcuts import *
from django.views.generic import TemplateView, FormView
from django.http import HttpResponseRedirect, HttpResponse... | VigTech/Vigtech-Services | principal/views.py | Python | lgpl-3.0 | 45,303 |
#! /usr/bin/env python
from openturns import *
from math import *
TESTPREAMBLE()
try :
# TEST NUMBER ZERO : DEFAULT CONSTRUCTOR AND STRING CONVERTER
print "test number zero : default constructor and string converter"
# Default constructor
symmetricMatrix0 =SymmetricMatrix()
# String converter
... | dbarbier/privot | python/test/t_SymmetricMatrix_std.py | Python | lgpl-3.0 | 4,523 |
from django.db.models.sql import compiler
from datetime import datetime
import re
from django.db.models.base import Model
REV_ODIR = {
'ASC': 'DESC',
'DESC': 'ASC'
}
SQL_SERVER_8_LIMIT_QUERY = \
"""SELECT *
FROM (
SELECT TOP %(limit)s *
FROM (
%(orig_sql)s
ORDER BY %(ord)s
) AS %(table)s
ORDER... | VanyaDNDZ/django-sybase-backend | sqlsybase_server/pyodbc/compiler.py | Python | unlicense | 10,019 |
class Symbol():
def __init__(self, name, isterm):
self.name = name
self.isterm = isterm
def __str__(self):
if self.isterm:
if self.name == "":
return "&"
return "'{}'".format(self.name)
return "<{}>".format(self.name)
| ggabriel96/cfg_analyzer | Symbol.py | Python | unlicense | 299 |
'''
A palindromic number reads the same both ways. The largest palindrome made from the product of two 2-digit numbers is 9009 = 91 × 99.
Find the largest palindrome made from the product of two 3-digit numbers.
'''
nums = range(999, 99, -1)
allProducts = [x * y for x in nums for y in nums]
palindromeProducts = [p f... | nadrees/PyEuler | 0004.py | Python | unlicense | 416 |
from __future__ import unicode_literals
from .abc import ABCIE
from .abc7news import Abc7NewsIE
from .academicearth import AcademicEarthCourseIE
from .addanime import AddAnimeIE
from .adobetv import AdobeTVIE
from .adultswim import AdultSwimIE
from .aftonbladet import AftonbladetIE
from .aljazeera import AlJazeeraIE
f... | rzhxeo/youtube-dl | youtube_dl/extractor/__init__.py | Python | unlicense | 17,033 |
#!/usr/bin/env python
"""
books.py
reads a list of books from an input file and returns them filtered and sorted
features
- iterates through records without holding the entire dataset in memory, allowing for large datasets
- uses SQLite for storage and retrieval
"""
import os
import argparse
import sqlite3
f... | danieltalsky/gp-code-test | books.py | Python | unlicense | 1,974 |
import glob
import sys
import string
import Bio.PDB
def parse_noe(filename):
f = open(filename, 'r')
noe_pairs = []
for line in f.readlines():
res_a = int(string.split(line)[2])
res_b = int(string.split(line)[7])
noe_pair = [res_a, res_b]
if noe_pair n... | andersx/cs-proteins | scripts/visualize_noe.py | Python | unlicense | 1,599 |
# -*- coding:utf-8 -*-
from bottle import route, run
@route("/")
def access():
return "OK!"
# hostデフォルト値は、127.0.0.1
# OK - localhost / 127.0.0.1
# NG - 192.168.0.10 / hostname
# run(port=8080, debug=True, reloader=True)
# run(host="localhost", port=8080, debug=True, reloader=True)
# OK - 192.168.... | thinkAmi-sandbox/Bottle-sample | lan_access.py | Python | unlicense | 589 |
#!/usr/bin/python3.5
# import time
import math
class DataHeap:
"""Min-Heap with additionnal data field"""
def __init__(self):
self.list = [(0, None)]
self.size = 0
def insert(self, value, data = None):
self.list.append((value, data))
self.size += 1
self.percolateUp(self.size)
def percolat... | dherault/Coursera_algorithms | homework/dijkstra_shortest_path.py | Python | unlicense | 4,317 |