<commit_before>
#  IATI Data Quality, tools for Data QA on IATI-formatted  publications
#  by <NAME>, <NAME>, <NAME> and <NAME>
#
#  Copyright (C) 2013  Publish What You Fund
#
#  This programme is free software; you may redistribute and/or modify
#  it under the terms of the GNU Affero General Public License v3.0

from iatidq import db
import models

def package_status(package_id):
    return models.PackageStatus.query.filter_by(package_id=package_id).order_by("runtime_datetime desc").first()

def packages():
    return models.Package.query.order_by(models.Package.package_name).all()

def packageGroups():
    return models.PackageGroup.query.order_by(models.PackageGroup.name).all()<commit_msg>Get organisations attached to a specific package<commit_after>
#  IATI Data Quality, tools for Data QA on IATI-formatted  publications
#  by <NAME>, <NAME>, <NAME> and <NAME>
#
#  Copyright (C) 2013  Publish What You Fund
#
#  This programme is free software; you may redistribute and/or modify
#  it under the terms of the GNU Affero General Public License v3.0

from iatidq import db
import models

def package_status(package_id):
    return models.PackageStatus.query.filter_by(package_id=package_id).order_by("runtime_datetime desc").first()

def packages():
    return models.Package.query.order_by(models.Package.package_name).all()

def packageGroups():
    return models.PackageGroup.query.order_by(models.PackageGroup.name).all()

def packageOrganisations(package_id):
    if package_id is not None:
        packageorganisations = db.session.query(models.Organisation,
                                             models.OrganisationPackage
                        ).filter(models.Package.id==package_id
                        ).join(models.OrganisationPackage
                        ).join(models.Package
                        ).all()
        return packageorganisations
    else:
        return False
{'fraction_non_alphanumeric': 0.08915537017726799, 'fraction_numerical': 0.006256517205422315, 'mean_word_length': 3.3514739229024944, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5354768', 'n_tokens_mistral': 543, 'n_tokens_neox': 531, 'n_words': 154}