code stringlengths 2 1.05M | repo_name stringlengths 5 104 | path stringlengths 4 251 | language stringclasses 1
value | license stringclasses 15
values | size int32 2 1.05M |
|---|---|---|---|---|---|
# -*- coding: utf-8 -*-
# Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: http://doc.scrapy.org/en/latest/topics/item-pipeline.html
import pymongo
from scrapy.conf import settings
from scrapy.exceptions import DropItem
from scrapy import log
class MongoDBPi... | pleycpl/CompareWebPageContent | tracker/tracker/pipelines.py | Python | gpl-3.0 | 1,358 |
import bpy
from ... base_types.node import AnimationNode
class IntersectLinePlaneNode(bpy.types.Node, AnimationNode):
bl_idname = "an_IntersectLinePlaneNode"
bl_label = "Intersect Line Plane"
bl_width_default = 160
def create(self):
self.newInput("Vector", "Line Start", "lineStart")
se... | Thortoise/Super-Snake | Blender/animation_nodes-master/nodes/geometry/intersect_line_plane.py | Python | gpl-3.0 | 1,400 |
#!/usr/bin/env python
"""Build script for MaTiSSe.py"""
import os
from pybuilder.core import Author, init, task, use_plugin
from shutil import copyfile
import re
use_plugin('python.core')
use_plugin('python.coverage')
use_plugin('python.flake8')
use_plugin('python.frosted')
use_plugin('python.install_dependencies')
us... | szaghi/MaTiSSe | build.py | Python | gpl-3.0 | 2,139 |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
import logging
import datetime
from datetime import timedelta
import pytz as pytz
from icalendar import Calendar
class CalendarAnalyzer:
""" A Class for analyzing Calendar Events And deciding if power should be on """
def __init__(self):
nowtime = dateti... | FarrisSR/Bedehus | Calendalyzer/CalendarAnalyzer.py | Python | gpl-3.0 | 2,729 |
import asyncio
from copy import copy
class AsyncioServer:
"""Generic TCP server based on asyncio.
Users of this class must derive from it and define the
``_handle_connection_cr`` method and coroutine.
"""
def __init__(self):
self._client_tasks = set()
@asyncio.coroutine
def star... | fallen/artiq | artiq/protocols/asyncio_server.py | Python | gpl-3.0 | 1,595 |
# -*- coding: utf-8 -*-
# Copyright (C) 2010-2015 Bastian Kleineidam
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#... | wummel/patool | patoolib/programs/py_echo.py | Python | gpl-3.0 | 1,486 |
import datetime
from time import sleep
from engine.async import ResultObj
__author__ = 'Denis Mikhalkin'
import os
import subprocess
import uuid
from collections import OrderedDict
from boto import sqs
import yaml
from pytz import utc
from apscheduler.jobstores.memory import MemoryJobStore
from apscheduler.triggers.... | denismo/DevOpsGears | engine/__init__.py | Python | gpl-3.0 | 19,681 |
import xml.etree.ElementTree as ET
import maya.cmds as cmds
import os
from sets import Set
class core(object):
''' pass '''
def __init__(self):
pass
def maya_ConfirmDialog(self,title='Confirm Dialog',message='Are you sure?'):
''' Create custom confirm dialog template... | Shayen/SAL-MAYA-ProjectManager | salprojectmanager/salCore.py | Python | gpl-3.0 | 9,582 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
__RCSID__ = "$Id$"
import socket
import select
import time
import os
from DIRAC.Core.DISET.private.Transports.BaseTransport import BaseTransport
from DIRAC.FrameworkSystem.Client.Logger import gLogger
from DIRA... | yujikato/DIRAC | src/DIRAC/Core/DISET/private/Transports/PlainTransport.py | Python | gpl-3.0 | 4,187 |
import sqlite3
# Creates or opens a file called mydb with a SQLite3 DB
db = sqlite3.connect('myTestdb.db')
curser = db.cursor()
def Create():
curser.execute('''
CREATE TABLE program(
id INTEGER PRIMARY KEY,
name TEXT,
net TEXT,
screenlocation TEXT)
''')
db.commit()
def add_entry(Snam... | SiebenCorgie/BELL_CustomPackageFramework | reference/DatabaseLearning.py | Python | gpl-3.0 | 1,001 |
def main():
name = input('Your name please? ').strip()
age = int(input('Your age please: ').strip())
reddit = input('Your reddit username please: ').strip()
print('your name is {}, you are {} years old, and your username is {}'.format(name, age, reddit))
#bonus
#import os
filename = os.path.... | GHMusicalCoder/reddit_daily_challenges | easy/E_challenge_1.py | Python | gpl-3.0 | 572 |
#!/usr/bin/env python
# -*- mode: python; coding: utf-8; -*-
# (c) Lankier mailto:lankier@gmail.com
import re
import BeautifulSoup
import sgmllib
from utils import print_log
##
## Customizing SGML/HTML parser
##
class StartTagOpen:
tag = re.compile('<[a-z][-a-z]*')
def match(self, rawdata, i):
if raw... | jn0/fb2utils | fb2utils/parser.py | Python | gpl-3.0 | 7,624 |
from __future__ import print_function
import jmbitcoin as btc
from jmclient import estimate_tx_fee
from twisted.internet import reactor, task
from txjsonrpc.web.jsonrpc import Proxy
from txjsonrpc.web import jsonrpc
from twisted.web import server
from .configure import get_log
from decimal import Decimal
import binasci... | AdamISZ/CoinSwapCS | coinswap/carol.py | Python | gpl-3.0 | 29,137 |
# SyndicateManager
# /src/cm/settings.py
#
# Copyright (c) 2013 Gwyn Howell
#
# LICENSE:
#
# This file is part of SyndicateManager (http://my-syndicate.appspot.com).
#
# SyndicateManager is free software: you can redistribute it and/or modify it under the terms of the GNU General Public
# License as published by the Fr... | gwynhowell/SyndicateManager | src/cm/settings.py | Python | gpl-3.0 | 1,487 |
# -*- coding: utf-8 -*-
"""
Created on Wed Jan 16 13:55:27 2019
@author: Guillaumot Luca, PB
"""
import os
import sys
import numpy as np
flopypth = os.path.join('..', '..', 'flopy')
if flopypth not in sys.path:
sys.path.append(flopypth)
import flopy
import flopy.utils.binaryfile as bf
import time
def ModFlow_mod... | CWatM/CWatM | cwatm/hydrological_modules/groundwater_modflow/ModFlow_modelV5.py | Python | gpl-3.0 | 9,153 |
# -*- coding: utf-8 -*-
# Copyright (C) 2015 ZetaOps Inc.
#
# This file is licensed under the GNU General Public License v3
# (GPLv3). See LICENSE.txt for details.
"""HITAP Tazminat Senkronizasyon
Personelin Hitap'taki tazminat bilgilerinin
yereldeki kayıtlarla senkronizasyonunu yapar.
"""
from ulakbus.services.... | zetaops/ulakbus | ulakbus/services/personel/hitap/hizmet_tazminat_sync.py | Python | gpl-3.0 | 690 |
# -*- coding: UTF-8 -*-
#
# Copyright (c) 2009 Ars Aperta, Itaapy, Pierlis, Talend.
#
# Authors: Hervé Cauwelier <herve@itaapy.com>
#
# This file is part of Lpod (see: http://lpod-project.org).
# Lpod is free software; you can redistribute it and/or modify it under
# the terms of either:
#
# a) the GNU General Public L... | uliss/quneiform | tests/py/lpod/draw_page.py | Python | gpl-3.0 | 4,125 |
#!/usr/bin/python3
# this script will remove all jars from .classpath files and will plant new
# ones according to jars in lib
import glob # for glob
import xml.dom.minidom # for parse
raise ValueError("you really should use eclipse variables and not this script")
addJars=False
jar_list=glob.glob('lib/*.jar')
jar_l... | veltzer/demos-java | scripts/plant_classpath.py | Python | gpl-3.0 | 1,553 |
# Matrix (multiplication)
# Python3
# by Xellor
# Last update 16.03.2016
matrix_n = int(input('Enter matrix size (N x N): ')) # Set size matrix, integer only
matrix_1 = [] # Initialize matrix variables
matrix_2 = []
matrix_3 = [] # matrix_3 is result matrix
for i in range(matrix_n): # Append in matrix variables N lists... | Xellor/python-math-training | matrix_multiplication.py | Python | gpl-3.0 | 1,031 |
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
#
# Copyright (C) 2018 Canonical Ltd
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3 as
# published by the Free Software Foundation.
#
# This program is distributed in the h... | sergiusens/snapcraft | tests/unit/project_loader/inspection/test_lifecycle_status.py | Python | gpl-3.0 | 5,367 |
"""
Remove moderations where the user was already categorized (except self mod).
"""
from django.core.management.base import BaseCommand, CommandError
from moderation.moderate import remove_done_moderations
from community.models import Community
class Command(BaseCommand):
help = (
'Remove moderations from t... | jeromecc/doctoctocbot | src/moderation/management/commands/remove_done_moderations.py | Python | mpl-2.0 | 1,134 |
# 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/.
#
# Copyright (C) 2017, James R. Barlow (https://github.com/jbarlow83/)
from math import cos, pi, sin
class PdfMatrix:... | pikepdf/pikepdf | src/pikepdf/models/matrix.py | Python | mpl-2.0 | 4,208 |
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "webrtc_dev.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| PauKerr/stackato-webrtc-dev | manage.py | Python | mpl-2.0 | 253 |
# -*- coding: utf-8 -*-
from django.utils.translation import ugettext_lazy as _
import os
# Generate a secret key
try:
from secret_key import *
except ImportError:
from helpers.views.secret_key_generator import *
SETTINGS_DIR = os.path.abspath(os.path.dirname(__file__))
generate_secret_key(os.path.join... | neuromat/nira | docs/source/instalacao/settings_local.py | Python | mpl-2.0 | 812 |
from bedrock.redirects.util import (redirect, is_firefox_redirector,
platform_redirector, no_redirect)
def firefox_mobile_faq(request, *args, **kwargs):
qs = request.META.get('QUERY_STRING', '')
if 'os=firefox-os' in qs:
return 'https://support.mozilla.org/products/... | hoosteeno/bedrock | bedrock/firefox/redirects.py | Python | mpl-2.0 | 31,967 |
# Copyright 2014-2020 The ODL contributors
#
# This file is part of ODL.
#
# This Source Code Form is subject to the terms of the Mozilla Public License,
# v. 2.0. If a copy of the MPL was not distributed with this file, You can
# obtain one at https://mozilla.org/MPL/2.0/.
"""Ray transforms."""
from __future__ impor... | kohr-h/odl | odl/tomo/operators/ray_trafo.py | Python | mpl-2.0 | 14,368 |
# 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/.
from __future__ import print_function, unicode_literals
import argparse
import conditions
import os
from mach.decorato... | ahal/b2g-commands | b2gcommands/sync_commands.py | Python | mpl-2.0 | 1,820 |
#!/usr/local/bin/python2.6
# hasportal2launchedyet.com
# this script by @lukegb - Luke Granger-Brown
#
# I hereby license this script under the GNU Affero GPLv3
# and ask that any changes you make for the betterment of this script
# be contributed back to me. :)
#
#####################################
# This program i... | lukegb/HasPortal2LaunchedYet.com | dev.py | Python | agpl-3.0 | 15,265 |
# -*- coding: utf-8 -*-
# Copyright(C) 2010-2013 Christophe Benz, Romain Bignon, Julien Hebert
#
# This file is part of weboob.
#
# weboob 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... | blckshrk/Weboob | weboob/capabilities/base.py | Python | agpl-3.0 | 14,050 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2016-03-01 12:20
from __future__ import unicode_literals
import django.contrib.postgres.fields
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('modelview', '0012_auto_20160301_1034'),
]
operat... | tom-heimbrodt/oeplatform | modelview/migrations/0013_auto_20160301_1320.py | Python | agpl-3.0 | 989 |
import json
import logging
from django.conf import settings
from django.core.management.base import BaseCommand, CommandError
from django.db.utils import IntegrityError
import paypalrestsdk
from paypalrestsdk import WebProfile
from ecommerce.extensions.payment.models import PaypalWebProfile
log = logging.getLogger(_... | mferenca/HMS-ecommerce | ecommerce/extensions/payment/management/commands/paypal_profile.py | Python | agpl-3.0 | 8,570 |
# Copyright 2012-2013 Canonical Ltd. This software is licensed under the
# GNU Affero General Public License version 3 (see the file LICENSE).
"""Server fixture for BIND."""
from __future__ import (
absolute_import,
print_function,
unicode_literals,
)
str = None
__metaclass__ = type
__all__ = [
... | cloudbase/maas | src/maastesting/bindfixture.py | Python | agpl-3.0 | 11,994 |
# ActivitySim
# See full license in LICENSE.txt.
import logging
import numpy as np
import pandas as pd
from activitysim.core import tracing
from activitysim.core import config
from activitysim.core import assign
from activitysim.core import inject
from activitysim.core import simulate
from activitysim.core.util impo... | synthicity/activitysim | activitysim/core/expressions.py | Python | agpl-3.0 | 5,892 |
# -*- coding: utf-8 -*-
from . import invoice
from . import report | kmee/department | invoice_department/__init__.py | Python | agpl-3.0 | 66 |
# This file is part of wger Workout Manager.
#
# wger Workout Manager 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.
#
# wger W... | rolandgeider/wger | wger/core/tests/test_index.py | Python | agpl-3.0 | 3,734 |
VERSION = "0.8.7" | KristianOellegaard/python-nagios-frontend | balbec/__init__.py | Python | agpl-3.0 | 17 |
"""
Copyright (C) 2016 Genome Research Ltd.
Author: Irina Colgiu <ic4@sanger.ac.uk>
This program is part of meta-check
meta-check 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
... | wtsi-hgi/metadata-check | mcheck/tests/com/__init__.py | Python | agpl-3.0 | 799 |
from xmodule.modulestore.django import modulestore
from xmodule.modulestore.inheritance import own_metadata
from xmodule.modulestore import Location
from courseware.module_render import toc_for_course, get_module_for_descriptor
from courseware.model_data import FieldDataCache
from courseware.views import jump_to_i... | EduPepperPDTesting/pepper2013-testing | lms/djangoapps/portfolio/about_me.py | Python | agpl-3.0 | 5,168 |
# -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP module
# Copyright (C) 2010 Micronaet srl (<http://www.micronaet.it>) and the
# Italian OpenERP Community (<http://www.openerp-italia.com>)
#
# ###############################################... | cherrygirl/micronaet7 | chemical_analysis_specification/__init__.py | Python | agpl-3.0 | 1,318 |
"""
Helper classes to specify file dependencies for input and output.
Supports inputs from S3 and local FS.
Supports outputs to HDFS, S3, and local FS.
"""
import boto
import datetime
import fnmatch
import logging
import os
import re
import luigi
import luigi.hdfs
import luigi.format
import luigi.task
from luigi.d... | open-craft/edx-analytics-pipeline | edx/analytics/tasks/pathutil.py | Python | agpl-3.0 | 11,171 |
"""Tests for the certificates Python API. """
from contextlib import contextmanager
import ddt
from django.test import TestCase, RequestFactory
from django.test.utils import override_settings
from django.conf import settings
from mock import patch
from nose.plugins.attrib import attr
from opaque_keys.edx.locator impo... | ZLLab-Mooc/edx-platform | lms/djangoapps/certificates/tests/test_api.py | Python | agpl-3.0 | 15,488 |
"""
MIT License
Copyright (c) 2018 Claude SIMON (https://q37.info/s/rmnmqd49)
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 limitation the rights
... | epeios-q37/epeios | tools/xdhq/wrappers/PYH/XDHqFaaS.py | Python | agpl-3.0 | 9,753 |
import pytest
from openfisca_core.entities import Entity, GroupEntity
from .variables import TestVariable
class TestEntity(Entity):
def get_variable(self, variable_name):
result = TestVariable(self)
result.name = variable_name
return result
def check_variable_defined_for_entity(self... | openfisca/openfisca-core | tests/fixtures/entities.py | Python | agpl-3.0 | 971 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('stages', '0024_mark_fields_dup'),
]
operations = [
migrations.AddField(
model_name='section',
name='has_stages',
field=models.BooleanField(default=False,... | epcoullery/epcstages | stages/migrations/0025_section_has_stages.py | Python | agpl-3.0 | 642 |
# Copyright (C) 2013, Carlo de Franchis <carlo.de-franchis@cmla.ens-cachan.fr>
# Copyright (C) 2013, Gabriele Facciolo <facciolo@cmla.ens-cachan.fr>
# Copyright (C) 2013, Enric Meinhardt <enric.meinhardt@cmla.ens-cachan.fr>
# Copyright (C) 2013, Julien Michel <julien.michel@cnes.fr>
# This module contains a dictionary... | carlodef/s2p | s2p/config.py | Python | agpl-3.0 | 6,724 |
import errno
import sys
import time
import uuid
import paramiko
import logging
import six
from io import StringIO
from paramiko.ssh_exception import (AuthenticationException,
SSHException,
NoValidConnectionsError)
from django.conf import settings ... | arbrandes/hastexo-xblock | hastexo/common.py | Python | agpl-3.0 | 9,550 |
import socket
import threading
import sys
IP = "0.0.0.0"
try:
TCP_PORT = int(sys.argv[1])
if TCP_PORT < 1 or TCP_PORT > 65535:
raise ValueError()
except IndexError:
print("Usage %s <tcp port>" % sys.argv[0])
sys.exit(1)
except ValueError:
print("Please enter an integer <= 65535")
sys.e... | feroda/lessons-itis | 2016-5BI/src/socket/python3/echo-service-broadcast-to-all/echo-all-server-with-user.py | Python | agpl-3.0 | 2,239 |
# Copyright (C) 2013-2021 The Debsources developers
# <qa-debsources@lists.alioth.debian.org>.
# See the AUTHORS file at the top-level directory of this distribution and at
# https://salsa.debian.org/qa/debsources/blob/master/AUTHORS
#
# This file is part of Debsources. Debsources is free software: you can
# redistrib... | Debian/debsources | lib/debsources/tests/__init__.py | Python | agpl-3.0 | 699 |
#!/usr/bin/env python
# -*- coding: utf8 -*-
# *****************************************************************
# ** PTS -- Python Toolkit for working with SKIRT **
# ** © Astronomical Observatory, Ghent University **
# *****************************************************************
##... | SKIRT/PTS | do/core/reanalyse.py | Python | agpl-3.0 | 2,562 |
# -*- coding: utf-8 -*-
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class Homepage(Document):
def validate(self):
if not self.products:
self... | anandpdoshi/erpnext | erpnext/portal/doctype/homepage/homepage.py | Python | agpl-3.0 | 813 |
# -*- coding: utf-8; -*-
#
# This file is part of Superdesk.
#
# Copyright 2013, 2014, 2015, 2016, 2017 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/lic... | ancafarcas/superdesk-core | content_api/tests/items_versions_service_test.py | Python | agpl-3.0 | 1,894 |
import ltree_models
import sqlalchemy
from sqlalchemy import (
create_engine,
)
from sqlalchemy.orm import (
aliased,
)
import testing.postgresql
from test_project import (
test_data
)
from test_project.models import (
DBSession,
ArticleAuthorAssociation,
ArticleByAssoc,
ArticleByObj,
Ba... | colinhiggs/pyramid-jsonapi | test_project/test_project/query_tests.py | Python | agpl-3.0 | 5,074 |
# vim:ai:et:ff=unix:fileencoding=utf-8:sw=4:ts=4:
# conveyor/src/main/python/conveyor/platform/osx.py
#
# conveyor - Printing dispatch engine for 3D objects and their friends.
# Copyright © 2012 Matthew W. Samsonoff <matthew.samsonoff@makerbot.com>
#
# This program is free software: you can redistribute it and/or modif... | makerbot/conveyor | src/main/python/conveyor/platform/osx.py | Python | agpl-3.0 | 1,906 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (C) 2012, Leonardo Leite, Saulo Trento, Diego Rabatone
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, o... | radar-parlamentar/legado | py/movimento.py | Python | agpl-3.0 | 6,994 |
from . import account_payment_mode
from . import account_move
| avanzosc/odoo-addons | account_invoice_report_show_payment_reference/models/__init__.py | Python | agpl-3.0 | 62 |
# flake8: noqa
##############################################################################
# For copyright and license notices, see __manifest__.py file in module root
# directory
##############################################################################
from odoo import models, fields, api, _
from odoo.exceptio... | ingadhoc/stock | stock_ux/models/stock_picking.py | Python | agpl-3.0 | 7,572 |
#!/usr/bin/python
#
# This file is part of jetflows.
#
# Copyright (C) 2014, Henry O. Jacobs (hoj201@gmail.com), Stefan Sommer (sommer@di.ku.dk)
# https://github.com/nefan/jetflows.git
#
# jetflows is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as publishe... | stefansommer/jetflows | code/examples/shootc.py | Python | agpl-3.0 | 2,944 |
# -*- coding: utf-8 -*-
# Copyright 2019 Sergio Corato (https://efatto.it)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
{
"name": "Italian Localization - Fattura elettronica - Export ZIP",
"summary": "Permette di esportare in uno ZIP diversi file XML di "
"fatture elettroniche... | linkitspa/l10n-italy | l10n_it_fatturapa_export_zip/__manifest__.py | Python | agpl-3.0 | 847 |
# -*- coding: utf8 -*-
#
# Copyright (C) 2018 NDP Systèmes (<http://www.ndp-systemes.fr>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# Licen... | ndp-systemes/odoo-addons | base_res_config_improved/res_config.py | Python | agpl-3.0 | 2,110 |
#!/usr/bin/env python
#-*- coding: utf-8 -*-
#=============================================================================
# FileName:
# Desc:
# Author: 苦咖啡
# Email: voilet@qq.com
# HomePage: http://blog.kukafei520.net
# Version: 0.0.1
# LastChange: 2013-02-20 14:52:11
# Histor... | voilet/cmdb | finotify/models.py | Python | agpl-3.0 | 1,014 |
"""
Django settings for apimetaclub project.
Generated by 'django-admin startproject' using Django 1.10.2.
For more information on this file, see
https://docs.djangoproject.com/en/1.10/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.10/ref/settings/
"""
impor... | MetaClub/api-metaclub | src/apimetaclub/settings.py | Python | agpl-3.0 | 3,157 |
# -*- coding: utf-8 -*-
import cStringIO
import datetime
from itertools import islice
import json
import logging
import re
from sys import maxint
import werkzeug.utils
import werkzeug.wrappers
from PIL import Image
import openerp
from openerp.addons.web import http
from openerp.http import request, Response
logger ... | npiganeau/odoo | addons/website/controllers/main.py | Python | agpl-3.0 | 21,255 |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2011 Akretion LTDA.
# authors: Raphaël Valyi
#
# This program is free software: you can redistribute it and/or modify
# it under the term... | iw3hxn/LibrERP | stock_no_dashboard/__openerp__.py | Python | agpl-3.0 | 1,657 |
# Second degree Laplacian edge detection, copied from Gimp
__all__ = ['laplacian']
def _py_laplacian(im):
im = im.convert('RGB')
pix = im.load()
orig_im = im.copy()
im2 = im.copy()
pix2 = im2.load()
for i in xrange(1, im.size[0]-1):
for j in xrange(1, im.size[1]-1):
neigh4 = (
pix[i-1,j],
pix[... | zejn/arsoapi | arsoapi/laplacian.py | Python | agpl-3.0 | 2,437 |
#!/bin/sh
"""": # -*-python-*-
bup_python="$(dirname "$0")/bup-python" || exit $?
exec "$bup_python" "$0" ${1+"$@"}
"""
# end of bup preamble
from __future__ import absolute_import
import sys, os, struct
from bup import options, helpers
optspec = """
bup on--server
--
This command is run automatically by 'bup on'... | ToxicFrog/bup | cmd/on--server-cmd.py | Python | lgpl-2.1 | 1,955 |
import time
import uuid
from tendrl.commons import objects
from tendrl.commons.utils import log_utils as logger
class DeleteMonitoringDetails(objects.BaseAtom):
def __init__(self, *args, **kwargs):
super(DeleteMonitoringDetails, self).__init__(*args, **kwargs)
def run(self):
integration_id =... | r0h4n/commons | tendrl/commons/objects/cluster/atoms/delete_monitoring_details/__init__.py | Python | lgpl-2.1 | 1,914 |
# -*- python -*-
# pylogsparser - Logs parsers python library
#
# Copyright (C) 2011 Wallix Inc.
#
# 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 (... | wallix/pylogsparser | tests/test_norm_chain_speed.py | Python | lgpl-2.1 | 1,829 |
#!/usr/bin/env python
#
# @file BaseBindingsFiles.py
# @brief class for generating base files for other library implementations
# @author Frank Bergmann
# @author Sarah Keating
#
# <!--------------------------------------------------------------------------
#
# Copyright (c) 2013-2018 by the California Institute... | sbmlteam/deviser | deviser/bindings_files/BaseBindingsFiles.py | Python | lgpl-2.1 | 14,698 |
# Written by Arno Bakker
# see LICENSE.txt for license information
import sys
import os
import pickle
STATEDIR_DLCONFIG = "dlconfig.pickle"
# Global variable containing the DownloadStartupConfig to use for crearing
# Downloads
from Tribler.Core.DownloadConfig import DownloadStartupConfig
from Tribler.C... | egbertbouman/tribler-g | Tribler/Main/globals.py | Python | lgpl-2.1 | 1,940 |
from __future__ import annotations
from datetime import datetime
from typing import Any
from flask_sqlalchemy import BaseQuery
from sqlalchemy.schema import Column
from sqlalchemy.types import DateTime, Integer
from whoosh.fields import ID
from abilian.core.extensions import db
from abilian.core.util import fqcn
#... | abilian/abilian-core | src/abilian/core/models/base.py | Python | lgpl-2.1 | 2,272 |
from __future__ import absolute_import
import re
q = "'"
qq = '"'
class QuoteError(Exception):
pass
def _quotesplit(line):
inquote = None
inescape = None
wordstart = 0
word = ''
for i in range(len(line)):
c = line[i]
if inescape:
if inquote == q and c != q:
... | ToxicFrog/bup | lib/bup/shquote.py | Python | lgpl-2.1 | 4,949 |
#!/usr/bin/env python
from github_traffic_base import *
# Construct an instance of the PlotData class for plotting views.
class PlotViews(PlotData):
"""
Plot the weekly views and unique visitors.
"""
def __init__(self):
super(PlotData, self).__init__()
self.left_axis_label = 'Weekly page views'
sel... | coreymbryant/libmesh | doc/statistics/github_traffic_plotviews.py | Python | lgpl-2.1 | 28,605 |
import os,sys
import SCons.Action
import SCons.Builder
import SCons.Util
from SCons.Script import *
from SCons.Node.FS import _my_normcase
from SCons.Tool.JavaCommon import parse_java_file
def walkDirs(path):
"""helper function to get a list of all subdirectories"""
def addDirs(pathlist, dirname, names):
... | MattMulhern/OpenMamaCassandra | site_scons/jni_tools.py | Python | lgpl-2.1 | 7,622 |
''' CSA header reader from SPM spec
'''
import numpy as np
from ..py3k import ZEROB, asbytes, asstr
from .structreader import Unpacker
# DICOM VR code to Python type
_CONVERTERS = {
'FL': float, # float
'FD': float, # double
'DS': float, # decimal string
'SS': int, # signed short
'US': int, # uns... | ME-ICA/me-ica | meica.libs/nibabel/nicom/csareader.py | Python | lgpl-2.1 | 6,816 |
# Orca
#
# Copyright 2005-2008 Sun Microsystems Inc.
# Copyright 2016 Igalia, S.L.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your optio... | GNOME/orca | src/orca/flat_review.py | Python | lgpl-2.1 | 49,319 |
#!/usr/bin/env python3
import sys
from TimeFileMaker import *
if __name__ == '__main__':
USAGE = 'Usage: %s FILE_NAME [OUTPUT_FILE_NAME ..]' % sys.argv[0]
HELP_STRING = r'''Formats timing information from the output of `make TIMED=1` into a sorted table.
The input is expected to contain lines in the format:
F... | Matafou/coq | tools/make-one-time-file.py | Python | lgpl-2.1 | 773 |
# coding=utf8
#
# Copyright 2013 Dreamlab Onet.pl
#
# 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;
# version 3.0.
# This library is distributed in the hope that it will be useful,
# bu... | tikan/rmock | src/rmock/errors.py | Python | lgpl-3.0 | 832 |
"""
Unit tests for the enharmony.artist module.
"""
import unittest
from enharmony.artist import Artist
@unittest.skip("not implemented")
class TestParsing(unittest.TestCase): # pylint: disable=R0904
"""Tests for parsing artists."""
def test_nominal(self):
"""Verify a normal artist can be parsed."... | jacebrowning/enharmony | enharmony/test/test_artist.py | Python | lgpl-3.0 | 2,056 |
from instances import *
from read_instances import *
from lockfile import FileLock
import cPickle as pickle
data = readall()
alldata = []
for d in data[:1]:
H = d["H"]
nlp = createNLP(DMatrix([[1.2,0.3],[0.7,1.3]]),DMatrix([[0.2,0.4],[0.77,0.12]],lift=True,simple=False)
log = []
dists = []
... | ghorn/debian-casadi | casadi/interfaces/snopt/snopt_bug.py | Python | lgpl-3.0 | 1,067 |
import numpy as np
import cv2
import random
from multiprocessing.pool import ThreadPool
def adjust_img(img):
# a = np.random.randint(2)
# if a==1:
# img = np.flip(img, axis=1)
return img
def process(batch, max_label):
# add more process here
imgs, labels = list(zip(*batch))
imgs = [cv2.imread(i) for i in i... | ddddwee1/SULsT | example/FaceResNet/datareader.py | Python | lgpl-3.0 | 1,419 |
#
# MuPIF: Multi-Physics Integration Framework
# Copyright (C) 2010-2015 Borek Patzak
#
# Czech Technical University, Faculty of Civil Engineering,
# Department of Structural Mechanics, 166 29 Prague, Czech Republic
#
# This library is free software; you can redistribute it and/or
# modi... | mupif/mupif | mupif/model.py | Python | lgpl-3.0 | 23,354 |
from time import sleep
from daemonize import Daemonize
pid = "/tmp/test.pid"
def main():
while True:
sleep(5)
daemon = Daemonize(app="test_app", pid=pid, action=main)
daemon.start()
| chrys87/fenrir | play zone/daemon.py | Python | lgpl-3.0 | 198 |
#!/usr/bin/env python
conversion_factor = {'CO2':1E-3*28.97/12.01, 'CH4':28.97/16.04, 'TCO':28.97/28.010}
rename = {'TCO':'CO'}
from argparse import ArgumentParser
parser = ArgumentParser(description='Produces an animation of the relative difference between two experiments.')
parser.add_argument('control', help='Cont... | neishm/EC-CAS-diags | reldiff_movie.py | Python | lgpl-3.0 | 7,014 |
# (C) British Crown Copyright 2011 - 2019, Met Office
#
# This file is part of cartopy.
#
# cartopy 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)... | ocefpaf/cartopy | lib/cartopy/crs.py | Python | lgpl-3.0 | 90,497 |
# Copyright (c) 2017 Ultimaker B.V.
# Uranium is released under the terms of the LGPLv3 or higher.
from collections import deque
class PropertyEvaluationContext:
"""Context for evaluating a property value
It contains:
1. a stack of containers during the evaluation in the function call stack fashion
... | Ultimaker/Uranium | UM/Settings/PropertyEvaluationContext.py | Python | lgpl-3.0 | 887 |
#!/usr/bin/env python
##Copyright 2008-2017 Thomas Paviot (tpaviot@gmail.com)
##
##This file is part of pythonOCC.
##
##pythonOCC 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... | tpaviot/pythonocc-core | src/Display/OCCViewer.py | Python | lgpl-3.0 | 25,906 |
import datetime
from .base import ReportGenerator
from geraldo.base import cm, TA_CENTER, TA_RIGHT
from geraldo.utils import get_attr_value, calculate_size
from geraldo.widgets import Widget, Label, SystemField
from geraldo.graphics import Graphic, RoundRect, Rect, Line, Circle, Arc,\
Ellipse, Image
from geral... | HireIQ/geraldo | geraldo/generators/text.py | Python | lgpl-3.0 | 12,316 |
# -*- coding: utf-8 -*-
# Python stdlib
import unittest
# py.test
import pytest
# Python tfstate
from tfstate.base import Resource
from tfstate.provider.aws import AwsResource
# Unit tests
from unit_tests.base import BaseResourceUnitTest
@pytest.mark.provider_aws
class AwsResourceUnitTest(BaseResourceUnitTest):
... | rodynnz/python-tfstate | unit_tests/test_tfstate/test_provider/test_aws/test_base.py | Python | lgpl-3.0 | 1,331 |
# Copyright (C) 2015-2022 by the RBniCS authors
#
# This file is part of RBniCS.
#
# SPDX-License-Identifier: LGPL-3.0-or-later
from rbnics.backends.abstract.tensors_list import TensorsList
from rbnics.utils.decorators import AbstractBackend
@AbstractBackend
class TensorSnapshotsList(TensorsList):
pass
| mathLab/RBniCS | rbnics/backends/abstract/tensor_snapshots_list.py | Python | lgpl-3.0 | 311 |
from __future__ import print_function
import os
import unittest
from codecs import open as codec_open
from six import iteritems
import numpy as np
#import pyNastran
#from pyNastran.bdf.bdf import BDF
#root_path = pyNastran.__path__[0]
#test_path = os.path.join(root_path, 'bdf', 'test', 'unit')
import pyNastran
from ... | saullocastro/pyNastran | pyNastran/bdf/mesh_utils/test/test_mesh_utils.py | Python | lgpl-3.0 | 17,642 |
#!/usr/bin/env python
'''
fit best estimate of magnetometer offsets using the algorithm from
Bill Premerlani
'''
import sys, time, os, math
# allow import from the parent directory, where mavlink.py is
sys.path.insert(0, os.path.join(os.path.dirname(os.path.realpath(__file__)), '..'))
# command line option handling... | meee1/pymavlink | pymavlink/examples/magfit_delta.py | Python | lgpl-3.0 | 4,788 |
# -*- coding: utf-8 -*-
# @Author: Claire-Eleuthèriane Gerrer
# @Date: 2021-10-26 09:44:54
# @Last Modified by: Claire-Eleuthèriane Gerrer
# @Last Modified time: 2021-11-19 09:56:57
"""
Set FMU simulation parameters
=============================
"""
# %%
# ``FMUFunction`` is an OpenTURNS-friendly overlay of the ... | openturns/otfmi | doc/example/static/plot_set.py | Python | lgpl-3.0 | 2,177 |
# -*- coding: utf-8 -*-
# SPDX-License-Identifier: LGPL-3.0-only
import sys
import unittest
import packet
class obj(object):
def __init__(self, dict_):
self.__dict__.update(dict_)
class ErrorTest(unittest.TestCase):
def test_cause(self):
msg = "boom"
cause = "cause"
error =... | packethost/packet-python | test/test_baseapi.py | Python | lgpl-3.0 | 2,643 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import src.isa
class Parser(object):
def __init__(self):
self.__instr = src.isa.instructions
def parse(self, tokens):
jumpmark_address = {}
address_counter = 0
tokens_to_remove = []
# calculate all addresses for jumpmarks... | m-wichmann/pyArch | asm/src/parser.py | Python | lgpl-3.0 | 2,559 |
"""
WSGI config for bookmarks project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/2.1/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SET... | ch1huizong/dj | bookmarks/bookmarks/wsgi.py | Python | unlicense | 395 |
#-*- coding: utf8 -*-
from __future__ import division
import numpy as n, pylab as p, networkx as x, random as r, collections as c, string
__doc__="""Este arquivo possui a classe Sistem, base para todas as animações
G=x.read_gml("1-400cpp.gml") # digrafo com peso
S=Sistem(G)
S.draw("grafo1.png")
S.add_msgs([msg1,msg2.... | ttm/gmaneToolkit | visualization/sistemaMinimo_5000.py | Python | unlicense | 19,581 |
# rdiff.py: diff against remote repositories
#
# Copyright 2007-10 Brendan Cully <brendan@kublai.com>
#
# This software may be used and distributed according to the terms
# of the GNU General Public License, incorporated herein by reference.
'''diff against remote repositories
When this extension is loaded, if the fi... | atweiden/dotfiles | .hgext/hg_rdiff.py | Python | unlicense | 6,711 |
#!/usr/bin/env python
import sys
import os
import json
class ClustJson:
def __init__(self, jsonFile):
fp = open(jsonFile)
self.clusts = {}
self.data = json.load(fp)
self.ipcounts = {}
for cdata in self.data['ip_clust']:
self.ipcounts[cdata['ip']] = (
... | kulsoom-abdullah/Draviz | ClustJson.py | Python | unlicense | 2,834 |
#!/usr/bin/env python
from bitmovin.utils import Serializable
class LiveDashManifest(Serializable):
def __init__(self, manifest_id: str, time_shift: float = None, live_edge_offset: float = None):
super().__init__()
self.manifestId = manifest_id
self.timeshift = time_shift
self.liv... | bitmovin/bitmovin-python | bitmovin/resources/models/encodings/live/live_dash_manifest.py | Python | unlicense | 351 |
def number(n, f=None):
return f(n) if f else n
def zero(f=None):
return number(0, f)
def one(f=None):
return number(1, f)
def two(f=None):
return number(2, f)
def three(f=None):
return number(3, f)
def four(f=None):
return number(4, f)
def five(f=None):
return number(5, f)
def six(f=None):
... | SelvorWhim/competitive | Codewars/CalculatingWithFunctions.py | Python | unlicense | 703 |