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 |
|---|---|---|---|---|---|
"""
Functions for plotting.
"""
import numpy as np
import matplotlib.pyplot as plt
from functions import (func_single_corr, func_ratio, func_const, func_two_corr,
func_single_corr2, compute_eff_mass)
def print_label(keys, vals, xpos=0.7, ypos=0.8):
"""Print a label in the plot.
Parameters
----------... | chjost/analysis-code | analysis2/plot_functions.py | Python | gpl-3.0 | 10,517 |
# GNU Solfege - free ear training software
# Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Tom Cato Amundsen
#
# 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 versio... | gabrielelanaro/solfege | solfege/const.py | Python | gpl-3.0 | 1,656 |
###############################################################################
# #
# 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 ... | ctSkennerton/CompareM | comparem/lgt_dinucleotide.py | Python | gpl-3.0 | 13,790 |
import os
import sys
from numpy import *
from scipy.integrate import ode
from scipy.interpolate import griddata
from mesh import *
from navierstokes import NavierStokes
nE = 5000
dt = 0.0005
nsteps = 2000
Mach = 0.3
Re = 10000
HiRes = 1.
z = load('data/navierstokesInit.npz')
geom, v, t, b, soln = z['geom'], z['v'], ... | gomezstevena/x-wind | src/navierstokesRun.py | Python | gpl-3.0 | 709 |
class ocho:
def __init__(self):
self.cadena=''
def getString(self):
self.cadena = raw_input("Your desires are orders to me: ")
def printString(self):
print "Here's your sentence: {cadena}".format(cadena=self.cadena)
oct = ocho()
oct.getString()
oct.printString()
| dcabalas/UNI | SN/Python/ocho.py | Python | gpl-3.0 | 301 |
from ciscoconfparse import *
| kstaniek/ciscoconfparse | ciscoconfparse/__init__.py | Python | gpl-3.0 | 29 |
from PyQt4.QtCore import *
from PyQt4.QtGui import *
import lib.images_rc
import sys
class QImportWiz(QDialog):
#
# private
#
def _getCheckableList(self, sheets):
"""return an instance model with a sheet list composed of
three columns (sheet, number of rows, number of columns)
... | csvtools/csvtools | src/widgets/importwiz.py | Python | gpl-3.0 | 3,525 |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | saitoha/PyDRCS | drcs/wcwidth.py | Python | gpl-3.0 | 16,031 |
# Copyright (c) 2009 Bea Lam. All rights reserved.
#
# This file is part of LightBlue.
#
# LightBlue 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 l... | sanekgusev/lightblue-0.4 | src/mac/_lightblue.py | Python | gpl-3.0 | 24,269 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('viz', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='userlocationvisualization',
... | DigitalCampus/django-ujjwal-oppia | oppia/viz/migrations/0002_auto_20151013_1422.py | Python | gpl-3.0 | 401 |
# -*- coding: utf-8 -*-
from random import randint, random, seed
from skued import film_optical_coefficients
seed(23)
def test_film_interaction_conservation_power():
"""Test that R + T + A = 1 always"""
wavelength = randint(200, 1000)
thickness = randint(50, 200)
n_film = random() + 1j * random()... | LaurentRDC/scikit-ued | skued/tests/test_thin_films.py | Python | gpl-3.0 | 768 |
#
# Copyright (C) 2016 FreeIPA Contributors see COPYING for license
#
import importlib
import itertools
import sys
import six
import hashlib
from .baseldap import LDAPObject
from ipalib import errors
from ipalib.crud import PKQuery, Retrieve, Search
from ipalib.frontend import Command, Local, Method, Object
from ip... | apophys/freeipa | ipaserver/plugins/schema.py | Python | gpl-3.0 | 24,409 |
# coding=utf8
#
"""
a crawler for juweixin.com
"""
import sys
import os.path
sys.path.insert(0, os.path.abspath(os.path.join(os.path.curdir,
os.path.pardir,
os.path.pardir,
o... | seraphln/wheel | wheel/spiders/juweixin/crawler.py | Python | gpl-3.0 | 16,096 |
from alabtools.utils import Genome, Index
import h5py
import os
def test_genome_io():
g = Genome('hg38')
with h5py.File('./teststr.h5', 'w') as f:
g.save(f)
with h5py.File('./teststr.h5', 'r') as f:
g2 = Genome(f)
os.remove('./teststr.h5')
assert g == g2
def test_index_io():
... | alberlab/alabtools | test/test_utils.py | Python | gpl-3.0 | 974 |
from os.path import join
from keras.callbacks import Callback
import matplotlib.pyplot as plt
class PlotLearning(Callback):
"""Callback generating a fitness plot in a file after each epoch"""
def __init__(self, examples=False):
super().__init__()
self.i = 0
self.x = []
self.lo... | Rignak/Scripts-Python | DeepLearning/_Others/OCR/callback.py | Python | gpl-3.0 | 2,311 |
#!/usr/bin/env python
#This file is part of Spiffybot.
#
#Spiffybot 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.
#
#Spiffybot is distr... | spiffytech/spiffybot | modules/woot/wootoff.py | Python | gpl-3.0 | 1,948 |
############################################################################
# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
#
# 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://mozil... | perlang/bv9arm-chinese | branches/9.16.18/arm/conf.py | Python | mpl-2.0 | 5,717 |
# 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 .base import TestExecutor
class ProcessTestExecutor(TestExecutor):
def __init__(self, *args, **kwargs):
... | indykish/servo | tests/wpt/harness/wptrunner/executors/process.py | Python | mpl-2.0 | 701 |
# Core imports
from lib.setSettings import djangopath
djangopath(up=1, settings='settings')
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()
# DB models and exceptions
from data import models
from machineclasses.MachineClass import Machine
class WMIMachine(Machine):
def lo... | crutchcorn/WMIControl | machineclasses/WMIMachineClass.py | Python | mpl-2.0 | 6,411 |
# 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 unicode_literals
import os
import unittest
from shutil import rmtree
from tempfile import (
... | cstipkovic/spidermonkey-research | python/mozbuild/mozbuild/test/test_mozconfig.py | Python | mpl-2.0 | 17,780 |
# -*- coding: 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/.
from django.db import models
from django.utils.translation import ugettext_lazy as _
from django... | ansp-2015/arquea | menuextension/models.py | Python | mpl-2.0 | 652 |
import argparse
import os
import re
import subprocess
import textwrap
import PyPDF2
import pygments
import pygments.lexers
import pygments.formatters
def findSourceFiles(path, extensions):
"""
Return a list of absoluate paths to found source files.
path: Where to search for the source code
extensio... | jlconlin/code2PDF | code2PDF.py | Python | mpl-2.0 | 10,380 |
#
# This file is part of Plinth.
#
# 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.
#
# This program is distribute... | freedomboxtwh/Plinth | plinth/modules/help/help.py | Python | agpl-3.0 | 2,917 |
#!/usr/bin/env python
#-.- encoding: utf-8 -.-
import csv,re
#medlemsfil = 'medlemmer_20032014.csv'
#medlemsfil = 'Medlemsliste 08.03.2015.csv'
medlemsfil = 'Medlemsliste 03.09.2015.csv'
def parse():
f = open(medlemsfil)
r = csv.reader(f)
index = 0
headings = None
members = None
category = None
for row in r:
... | bringsvor/bc_korps | utils/parse_members.py | Python | agpl-3.0 | 2,410 |
"""
Filters for the project application
"""
# Django
from django.contrib.auth.models import User
# Third Party
import django_filters
# MuckRock
from muckrock.core import autocomplete
from muckrock.project.models import Project
from muckrock.tags.models import Tag
class ProjectFilterSet(django_filters.FilterSet):
... | MuckRock/muckrock | muckrock/project/filters.py | Python | agpl-3.0 | 1,057 |
# -*- encoding: utf-8 -*-
# __author__ = tony@openerp.cn
##############################################################################
#
# 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,... | Johnzero/OE7 | OE-debug文件/oecn_base_fonts/__openerp__.py | Python | agpl-3.0 | 2,131 |
# Copyright 2021 Akretion (https://www.akretion.com).
# @author Sébastien BEAU <sebastien.beau@akretion.com>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from odoo import api, fields, models
class ResPartner(models.Model):
_inherit = "res.partner"
foo_company_dependent_field = fields.Cha... | OCA/multi-company | intercompany_shared_contact/tests/models.py | Python | agpl-3.0 | 515 |
# Copyright 2013,2014 Music Technology Group - Universitat Pompeu Fabra
#
# This file is part of Dunya
#
# Dunya 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 (FSF), either version 3 of the License, or... | MTG/dunya | andalusian/api_urls.py | Python | agpl-3.0 | 3,931 |
"""switch to server-side creation timestamps
Revision ID: 1dfc65e583bf
Revises: 1b0b4e6fdf96
Create Date: 2018-02-08 23:06:09.384416
"""
# revision identifiers, used by Alembic.
revision = '1dfc65e583bf'
down_revision = '1b0b4e6fdf96'
from alembic import op
from sqlalchemy.sql import text
# SELECT table_name FROM ... | closeio/nylas | migrations/versions/239_server_default_created_at.py | Python | agpl-3.0 | 1,186 |
# -*- coding: utf-8 -*-
from . import compare_boe_file
from . import export_to_boe
| factorlibre/l10n-spain | l10n_es_aeat/wizard/__init__.py | Python | agpl-3.0 | 84 |
# -*- coding: utf-8 -*-
"""
latexonhttp.resources.fetching
~~~~~~~~~~~~~~~~~~~~~
Fetchers for resources.
:copyright: (c) 2019 Yoan Tournade.
:license: AGPL, see LICENSE for more details.
"""
import base64
import requests
import logging
logger = logging.getLogger(__name__)
# ; # TODO Extract the f... | YtoTech/latex-on-http | latexonhttp/resources/fetching.py | Python | agpl-3.0 | 4,503 |
from ckan.controllers.home import HomeController
from ckan.controllers.api import ApiController
from ckan.common import c
import ckan.logic as logic
import ckan.model as model
import ckan.lib.base as base
import json
import ckan.plugins as p
from ckanext.googleanalytics.controller import GAApiController
class GobArHo... | bishalkc/portal-andino-theme | ckanext/gobar_theme/controller.py | Python | agpl-3.0 | 3,532 |
# -*- coding: utf-8 -*-
###############################################################################
#
# Tech-Receptives Solutions Pvt. Ltd.
# Copyright (C) 2009-TODAY Tech-Receptives(<http://www.techreceptives.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the... | mohamedhagag/community-addons | openeducat_erp/res_company/__init__.py | Python | agpl-3.0 | 1,091 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
Copyright (c) 2013 Ulrich Mierendorff
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 right... | ganwell/ktasync | files/kyototycoon_orig.py | Python | agpl-3.0 | 7,463 |
##############################################################################
#
# 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/tests/views/group_element_years/test_detach.py | Python | agpl-3.0 | 5,223 |
import sys
import os
import re
import shutil
from setuptools import setup
name = 'django-skivvy'
package = 'skivvy'
description = ('Write faster integration tests for Django views – with less '
'code.')
url = 'https://github.com/oliverroick/django-skivvy'
author = 'Oliver Roick'
author_email = 'oliver.r... | Cadasta/django-skivvy | setup.py | Python | agpl-3.0 | 3,207 |
##############################################################################
#
# Copyright (C) 2018 Compassion CH (http://www.compassion.ch)
# @author: Stephane Eicher <seicher@compassion.ch>
#
# The licence is in the file __manifest__.py
#
####################################################################... | CompassionCH/compassion-modules | sponsorship_compassion/models/contracts_report.py | Python | agpl-3.0 | 10,144 |
{
"name" : "Proseal Custom Partner",
"version" : "1.0",
"depends" : ["base","account"],
"author" : "Togar Hutabarat",
"description" : """
This module is aim to add some new fields on fields on Partner form:
* Customer Number
* Supplier Number
* Customer Outstanding Bal... | togarhutabarat/proseal_v80 | proseal_custom_partner/__openerp__.py | Python | agpl-3.0 | 733 |
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from . import survey_survey
| OCA/management-system | mgmtsystem_survey/models/__init__.py | Python | agpl-3.0 | 93 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.13 on 2019-10-01 12:00
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('questions', '0001_initial'),
]
operations = [
migrations.AlterField(
... | fnp/prawokultury | questions/migrations/0002_auto_20191001_1400.py | Python | agpl-3.0 | 499 |
"""
An implementation of :class:`XBlockUserStateClient`, which stores XBlock Scope.user_state
data in a Django ORM model.
"""
import itertools
from operator import attrgetter
try:
import simplejson as json
except ImportError:
import json
from django.contrib.auth.models import User
from xblock.fields import S... | motion2015/edx-platform | lms/djangoapps/courseware/user_state_client.py | Python | agpl-3.0 | 11,254 |
from flask.ext.script import Command, Manager, Option
from flask import current_app
import os
from subprocess import Popen
class InvalidPathException(Exception):
pass
class SyncJS(Command):
option_list = (
Option('--path', '-p', dest='path'),
)
def run_command(self, command):
cmd = P... | realizeapp/realize-core | core/commands/frontend.py | Python | agpl-3.0 | 1,248 |
from __future__ import unicode_literals
notification_settings = {
# PostgreSQL backend with JSON fields
'STORAGE_BACKEND': 'notification.backends.DefaultBackend'
}
| Lysxia/dissemin | notification/settings.py | Python | agpl-3.0 | 173 |
#!/usr/bin/env python3
"""
Single-threaded HTTP server that extracts article's HTML from a full page HTML.
Accepts POST requests to "/extract" endpoint with body JSON:
{
"html": "<html><title>Title</title><body><p>Paragraph.</p></html>"
}
On success, returns HTTP 200 and extracted HTML:
{
... | berkmancenter/mediacloud | apps/extract-article-from-page/bin/extract_article_from_page_http_server.py | Python | agpl-3.0 | 5,416 |
__author__ = 'Gareth Coles'
import datetime
import calendar
import pymongo
from pymongo.collection import ObjectId
from internal.singleton import Singleton
class Db(object):
"""
Very, very simple schema validation. Super simple.
This introduces a singleton for managing the Mongo instance. It exposes
... | gdude2002/Health-journals | internal/db.py | Python | agpl-3.0 | 7,267 |
# Generated by Django 2.1 on 2018-08-19 13:12
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('world', '0003_auto_20180819_0036'),
]
operations = [
migrations.AddField(
model_name='tileevent',
... | jardiacaj/finem_imperii | world/migrations/0004_tileevent_create_timestamp.py | Python | agpl-3.0 | 501 |
mystring="40523116"
mystring=mystring +" test"
print(mystring)
| s40523116/2016fallcp_hw | w4.py | Python | agpl-3.0 | 66 |
# -*- coding: utf-8 -*-
###############################################################################
#
# Copyright (C) 2013-Today Carlos Eduardo Vercelino - CLVsol
#
# 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
#... | MostlyOpen/odoo_addons_jcafb | myo_annotation_cst/models/annotation_seq.py | Python | agpl-3.0 | 1,352 |
## TODO: This belongs somewhere else.
##
## * We need a way to construct a common library, especially to
## inspect events and provide higher-level operations
## * We need a better way to internally call queries.
import logging
log=logging.getLogger(__name__)
def query_results(query):
from django.db import co... | edx/edxanalytics | src/edxanalytics/prototypemodules/common.py | Python | agpl-3.0 | 1,629 |
from typing import Any
from django.utils import translation
from graphql import GraphQLResolveInfo
from apps.landmatrix.forms.deal import DealForm
from apps.landmatrix.forms.deal_submodels import (
contract_fields,
location_fields,
datasource_fields,
)
from apps.landmatrix.forms.investor import InvestorFo... | sinnwerkstatt/landmatrix | apps/graphql/resolvers/formfields.py | Python | agpl-3.0 | 799 |
"""tweetme URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.10/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-ba... | dubirajara/django_my_ideas_wall | myideas/api/urls.py | Python | agpl-3.0 | 931 |
#!/usr/bin/env python3
# -*-coding:UTF-8 -*
import os
import sys
import ssl
import json
import time
import uuid
import redis
import random
import logging
import logging.handlers
from flask import Flask, render_template, jsonify, request, Request, Response, session, redirect, url_for
from flask_login import LoginMana... | CIRCL/AIL-framework | var/www/Flask_server.py | Python | agpl-3.0 | 8,669 |
# -*- coding: utf-8 -*-
###############################################################################
#
# 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 a... | Micronaet/micronaet-mx8 | sale_delivery_partial_B/__init__.py | Python | agpl-3.0 | 1,040 |
"""
Student Views
"""
import datetime
import logging
import uuid
import time
import json
import warnings
from collections import defaultdict
from pytz import UTC
from ipware.ip import get_ip
from django.conf import settings
from django.contrib.auth import logout, authenticate, login
from django.contrib.auth.models imp... | kamalx/edx-platform | common/djangoapps/student/views.py | Python | agpl-3.0 | 88,916 |
# vim: set fileencoding: utf-8 -*-
# -*- coding: utf-8 -*-
import visa
from itertools import cycle, starmap, compress
import pandas as pd
import numpy as np
from collections import OrderedDict
from .force import *
from .force import (
DCForce,
StaircaseSweep,
... | wojcech/agilentpyvisa | agilentpyvisa/B1500/tester.py | Python | agpl-3.0 | 39,893 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
from oscar.core.loading import get_model
ProductAttribute = get_model("catalogue", "ProductAttribute")
def alter_couponvouchers_attribute(apps, schema_editor):
"""Change the coupon_vouchers product attribute to be r... | mferenca/HMS-ecommerce | ecommerce/extensions/catalogue/migrations/0014_alter_couponvouchers_attribute.py | Python | agpl-3.0 | 991 |
# Copyright 2010-2011 Canonical Ltd. This software is licensed under the
# GNU Affero General Public License version 3 (see the file LICENSE).
"""Loggers."""
__metaclass__ = type
__all__ = [
'BufferLogger',
'DevNullLogger',
'FakeLogger',
'LaunchpadLogger',
'NullHandler',
'PrefixFilter',
]... | abramhindle/UnnaturalCodeFork | python/testdata/launchpad/lib/lp/services/log/logger.py | Python | agpl-3.0 | 6,904 |
from __future__ import with_statement
import os
from datetime import datetime
import logging
from fabric.api import *
from fabric.contrib import files
env.user = 'bhs'
env.use_ssh_config = True
env.now = datetime.now().strftime('%Y%m%d-%H%M')
def dev():
env.hosts = ['bhs-dev']
def push_code(rev='HEAD', virtual... | Beit-Hatfutsot/dbs-back | fabfile.py | Python | agpl-3.0 | 5,429 |
from __future__ import with_statement
from alembic import context
from sqlalchemy import engine_from_config, pool
from logging.config import fileConfig
# this is the Alembic Config object, which provides
# access to the values within the .ini file in use.
config = context.config
# Interpret the config file for Python... | skylines-project/skylines | migrations/env.py | Python | agpl-3.0 | 2,099 |
'''
Created on 2009 eka 22
@author: peio
'''
# Copyright 2009 Jose Blanca, Peio Ziarsolo, COMAV-Univ. Politecnica Valencia
# This file is part of franklin.
# franklin 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 Softwa... | JoseBlanca/franklin | test/gmod/read_source_test.py | Python | agpl-3.0 | 3,791 |
BADGES = [
{
'badge_id': 'tech',
'img_path': '/static/img/badges/wrench.svg',
'name': 'Junction Technical Staff',
'description': 'Actively serves on Junction staff',
'priority': 2000
},
{
'badge_id': 'staff',
'img_path': '/static/img/badges/award_fill.... | JunctionAt/JunctionWWW | config/badges.py | Python | agpl-3.0 | 862 |
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2016 Compassion CH (http://www.compassion.ch)
# Releasing children from poverty in Jesus' name
# @author: Emanuel Cino <ecino@compassion.ch>
#
# The licence is in the file __manifest__.py... | maxime-beck/compassion-modules | partner_communication/models/res_partner.py | Python | agpl-3.0 | 2,238 |
# encoding: utf-8
from django.conf.urls import url
from externaltools.api import ExternalToolList, ExternalToolLaunch
urlpatterns = [
url(r'^$', ExternalToolList.as_view(), name='v1_api_externaltools_list'),
url(r'^launch/(?P<slug>[^/]+)/(?P<launchpoint>[^/]+)$', ExternalToolLaunch.as_view(), name='v1_api_e... | concentricsky/badgr-server | apps/externaltools/v1_api_urls.py | Python | agpl-3.0 | 344 |
# Copyright 2017 Okia SPRL (https://okia.be)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo.tests.common import TransactionCase
from odoo.exceptions import ValidationError
class TestCreditControlPolicyLevel(TransactionCase):
post_install = True
at_install = False
def test_check... | ddico/account-financial-tools | account_credit_control/tests/test_res_partner.py | Python | agpl-3.0 | 1,262 |
# -*- coding: utf-8 -*-
##############################################################################
#
# Saas Manager
# Copyright (C) 2013 Sistemas ADHOC
# No email
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
... | ingadhoc/odoo-saas-manager | addons/saas_product_base/__openerp__.py | Python | agpl-3.0 | 1,644 |
import pytest
import datetime
from inbox.models.account import Account
from inbox.models.thread import Thread
from inbox.models.folder import Folder, FolderItem
from inbox.models.message import Message
from inbox.models.backends.imap import ImapUid
from inbox.mailsync.backends.imap.common import (recompute_thread_label... | EthanBlackburn/sync-engine | tests/general/test_tags_updates.py | Python | agpl-3.0 | 4,145 |
from abc import ABC, abstractmethod
from collections import defaultdict
from Levenshtein import distance
from sqlalchemy import and_
from werkzeug.utils import cached_property
from models import Protein, UniprotEntry, ProteinReferences
from models import Gene
from database import db
class GeneMatch:
def __init... | reimandlab/ActiveDriverDB | website/search/gene.py | Python | lgpl-2.1 | 9,332 |
# cerbero - a multi-platform build system for Open Source software
# Copyright (C) 2012 Andoni Morales Alastruey <ylatuya@gmail.com>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free Software Foundation... | nicolewu/cerbero | cerbero/utils/svn.py | Python | lgpl-2.1 | 1,732 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2016 Radim Rehurek <radimrehurek@seznam.cz>
# Copyright (C) 2016 Manas Ranjan Kar <manasrkar91@gmail.com>
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""
USAGE:
$ python -m gensim.scripts.glove2word2vec --input <GloVe ve... | summanlp/gensim | gensim/scripts/glove2word2vec.py | Python | lgpl-2.1 | 2,742 |
import logging
import os
import subprocess
logger = logging.getLogger(__name__)
logging.basicConfig( \
format='%(levelname)s - %(asctime)s - %(module)s - %(message)s', \
level=logging.DEBUG)
# Picking up from client-bootstrap.sh
class Igor(object):
apiurl = None
session = None
current_step = Non... | fabiand/igor | examples/testcases/libs/common/common.py | Python | lgpl-2.1 | 2,546 |
#!/usr/bin/env python
##
# This file is part of the uSherpa Python Library project
#
# Copyright (C) 2012 Stefan Wendler <sw@kaltpost.de>
#
# The uSherpa Python 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 Sof... | wendlers/usherpa-pysherpa | setup.py | Python | lgpl-2.1 | 1,459 |
# vi:si:et:sw=4:sts=4:ts=4
# Flumotion - a streaming media server
# Copyright (C) 2004,2005,2006,2007,2008,2009 Fluendo, S.L.
# Copyright (C) 2010,2011 Flumotion Services, S.A.
# All rights reserved.
#
# This file may be distributed and/or modified under the terms of
# the GNU Lesser General Public License version 2.1... | osiloke/Flumotion-Transcoder | flumotion/transcoder/admin/transbalancer.py | Python | lgpl-2.1 | 4,755 |
#!/usr/bin/env python
#
# Seccomp Library test program
#
# Copyright (c) 2012 Red Hat <pmoore@redhat.com>
# Author: Paul Moore <paul@paul-moore.com>
#
#
# This library is free software; you can redistribute it and/or modify it
# under the terms of version 2.1 of the GNU Lesser General Public License as
# published by... | seccomp/libseccomp | tests/15-basic-resolver.py | Python | lgpl-2.1 | 1,558 |
##############################################################################
# Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | skosukhin/spack | var/spack/repos/builtin/packages/jags/package.py | Python | lgpl-2.1 | 1,927 |
# Copyright (C) 2017 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 option) any late... | mfnch/pyrtist | pyrtist/lib2deep/put.py | Python | lgpl-2.1 | 2,455 |
"""
Test connecting to a IRC channel when prompted by a bouncer
"""
from idletest import exec_test
from servicetest import (
EventPattern, assertEquals, call_async, make_channel_proxy
)
from constants import *
def test_join_bouncer(q, conn, stream, room):
stream.sendJoin(room)
new_channels = EventPatter... | freedesktop-unofficial-mirror/telepathy__telepathy-idle | tests/twisted/channels/join-muc-channel-bouncer.py | Python | lgpl-2.1 | 1,912 |
from data.conditional_import import (
dump,
# dumps,
# load,
# loads,
) | PyCQA/astroid | tests/testdata/python3/data/conditional.py | Python | lgpl-2.1 | 87 |
"""Plug-in module to store requirements in a Veracity repository."""
from doorstop import common
from doorstop.core.vcs.base import BaseWorkingCopy
log = common.logger(__name__)
class WorkingCopy(BaseWorkingCopy):
"""Veracity working copy."""
DIRECTORY = '.sgdrawer'
IGNORES = ('.sgignores', '.vvignore... | elewis33/doorstop | doorstop/core/vcs/veracity.py | Python | lgpl-3.0 | 959 |
#!/usr/bin/env python
# encoding: utf-8
"""
Ring modulators used as exciter of a waveguide bank.
"""
from pyo import *
import random
s = Server().boot()
tab_m = HarmTable([1, 0, 0, 0, 0, 0.3, 0, 0, 0, 0, 0, 0.2, 0, 0, 0, 0, 0, 0.1, 0, 0, 0, 0, 0.05]).normalize()
tab_p = HarmTable([1, 0, 0.33, 0, 0.2, 0, 0.143, 0, 0.... | belangeo/pyo | pyo/examples/synthesis/05_ring_mod_class.py | Python | lgpl-3.0 | 980 |
# Support Python 2 and 3
from __future__ import unicode_literals
from __future__ import absolute_import
from __future__ import print_function
import os
import sys
import zipfile
import time
from odpslides.template_xml_file import TemplateXML_File
here = os.path.abspath(os.path.dirname(__file__))
def zipfile_insert... | sonofeft/ODPSlides | odpslides/zip_file.py | Python | lgpl-3.0 | 882 |
import argparse
import numpy as np
import scipy.io as syio
import struct
import time
def Get14bit(val) :
if val & 0x2000 :
return -(((val & 0x1FFF)^0x1FFF)+1)
else :
return val & 0x1FFF
class fileParser(object):
def __init__(self):
self.packHdr = struct.Struct(">BH")
self.... | matthewzhenggong/fiwt | XbeeZBS2Test/recparse.py | Python | lgpl-3.0 | 4,619 |
# coding: utf-8
#
# IL-2 FB Events Parser documentation build configuration file, created by
# sphinx-quickstart on Sat Nov 22 10:43:38 2014.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.... | IL2HorusTeam/il2fb-events-parser | docs/conf.py | Python | lgpl-3.0 | 8,504 |
import os
pkg_dir = os.path.abspath(os.path.dirname(__file__))
sample_dir = os.path.join(pkg_dir, 'sample')
__version__ = '0.5.0'
| hyounggyu/xni | xni/__init__.py | Python | lgpl-3.0 | 132 |
# Copyright (C) 2008-2011 Henry Ludemann
#
# This file is part of the bdec decoder library.
#
# The bdec decoder 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 ... | asdf1011/bdec | bdec/choice.py | Python | lgpl-3.0 | 3,099 |
import struct
from coinpy.lib.serialization.common.serializer import Serializer
from coinpy.lib.serialization.exceptions import MissingDataException
class VarintSerializer(Serializer):
def __init__(self, desc=""):
self.desc = desc
def serialize(self, value):
if (value < 0xfd):
... | sirk390/coinpy | coinpy-lib/src/coinpy/lib/serialization/structures/s11n_varint.py | Python | lgpl-3.0 | 1,579 |
from raw import points
from raw import vertices
from raw import edges
from raw import polygons
__all__ = ['points', 'vertices', 'edges', 'polygons']
| selaux/numpy2vtk | numpy2vtk/data/raw/__init__.py | Python | lgpl-3.0 | 150 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('comercial', '0053_auto_20151118_1323'),
]
operations = [
migrations.AddField(
model_name='tipodeproposta',
... | dudanogueira/microerp | microerp/comercial/migrations/0054_tipodeproposta_tipo_contrato_mapeado.py | Python | lgpl-3.0 | 472 |
#!/usr/bin/env python
#
# Hello World
#
# Copyright 2012 Cody Van De Mark
#
# 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 3.0 of the License, or (at your option) any... | renardchien/Software-Development-on-Linux--Open-Source-Course- | Labs/Lab 4/Student Files/Hello.py | Python | lgpl-3.0 | 766 |
import datetime
class Duration(object):
SECOND = 1
MINUTE = 60 * SECOND
HOUR = 60 * MINUTE
DAY = 24 * HOUR
UNITS = [DAY, HOUR, MINUTE, SECOND]
def __init__(self, seconds):
self._seconds = seconds
def _unit_values(self):
value = self._seconds
for unit in self.UNITS... | cessor/galena | src/galena/moment.py | Python | lgpl-3.0 | 1,283 |
from flask import Flask, Response
import webapi.unblock as lib_unblock
import webapi.unsplash as lib_unsplash
app = Flask(__name__)
@app.route('/')
def root():
return 'Welcome to towdium.me APIs'
@app.route('/unsplash/<path:path>')
def unsplash(path):
data = lib_unsplash.request(path)
return '' if dat... | Towdium/WebAPIs | webapi/__init__.py | Python | lgpl-3.0 | 471 |
# This example is meant to be used from within the CadQuery module of FreeCAD.
import cadquery
from Helpers import show
# Create a simple block with a hole through it that we can split
c = cadquery.Workplane("XY").box(1, 1, 1).faces(">Z").workplane() \
.circle(0.25).cutThruAll()
# Cut the ... | microelly2/cadquery-freecad-module | CadQuery/Examples/Ex021_Splitting_an_Object.py | Python | lgpl-3.0 | 435 |
import time
from binascii import unhexlify
from random import choice, randint, uniform
from tribler_core.modules.metadata_store.serialization import REGULAR_TORRENT
from tribler_core.utilities.unicode import hexlify
from tribler_gui.tests.fake_tribler_api.constants import COMMITTED
from tribler_gui.tests.fake_tribler... | hbiyik/tribler | src/tribler-gui/tribler_gui/tests/fake_tribler_api/models/torrent.py | Python | lgpl-3.0 | 2,618 |
# -*- coding: utf-8 -*-
# This file is part of pygal
#
# A python svg graph plotting library
# Copyright © 2012-2014 Kozea
#
# 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... | colevscode/pygal | pygal/graph/funnel.py | Python | lgpl-3.0 | 3,592 |
"""
Definition of views.
"""
from django.shortcuts import render
from django.http import HttpRequest
from django.template import RequestContext
from datetime import datetime
def home(request):
"""Renders the home page."""
assert isinstance(request, HttpRequest)
return render(request,
'app/index.ht... | Kiddinglife/iamhungry | iamhungry/app/views.py | Python | lgpl-3.0 | 3,665 |
# -*- coding: utf-8 -*-
# © 2017 Savoir-faire Linux
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
from odoo import _, api, fields, models
class ProjectTask(models.Model):
_inherit = 'project.task'
origin_id = fields.Reference(
string='Source Document',
selection=lambda r: r... | savoirfairelinux/project-addons | project_task_autocreate/models/project_task.py | Python | lgpl-3.0 | 483 |
#! /usr/bin/python2.7
# -*- coding: utf-8 -*-
import ConfigParser
import sqlite3
from sqlite3 import Error
import os
from abc import ABCMeta, abstractmethod
curr_dir = os.path.dirname(os.path.realpath(__file__))
api_dir = os.path.abspath(os.path.join(curr_dir, '..'))
root_dir = os.path.abspath(os.path.join(api_dir, ... | elbadawyy/Hash-POS | API/Helper/Database.py | Python | lgpl-3.0 | 4,331 |
import logging
import os
from lizard_ui.settingshelper import STATICFILES_FINDERS
logging.basicConfig(
level=logging.DEBUG,
format='%(name)s %(levelname)s %(message)s')
DEBUG = True
TEMPLATE_DEBUG = True
DATABASE_ENGINE = 'sqlite3'
DATABASE_NAME = 'test.db'
SITE_ID = 1
INSTALLED_APPS = [
'lizard_wms',
... | lizardsystem/lizard5-apps | lizard_wms/testsettings.py | Python | lgpl-3.0 | 4,882 |
#!/usr/bin/env python3
import os
import argparse
class AsmStats:
file = ""
genes = 0
monoexonic_genes = 0
transcripts = 0
transcripts_per_gene = 0.0
transcript_len_mean = 0.0
monoexonic_transcripts = 0
exons = 0
exons_per_transcript = 0.0
exon_len_mean = 0.0
def __init__... | lucventurini/mikado | util/asm_collect.py | Python | lgpl-3.0 | 2,792 |
#
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# SLEPc - Scalable Library for Eigenvalue Problem Computations
# Copyright (c) 2002-2015, Universitat Politecnica de Valencia, Spain
#
# This file is part of SLEPc.
#
# SLEPc is free software: you can redistribute it and/or modify it u... | OpenCMISS-Dependencies/slepc | config/packages/petsc.py | Python | lgpl-3.0 | 6,234 |
from . import mupifobject
import Pyro5.api
import typing
import pydantic
from .units import Quantity
from .units import Unit
@Pyro5.api.expose
class LookupTable(mupifobject.MupifObject):
"""
.. automethod:: __init__
"""
def __init__(self, *, metadata={}, **kw):
super().__init__(metadata=met... | mupif/mupif | mupif/lookuptable.py | Python | lgpl-3.0 | 2,296 |