<commit_before># Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.


import argparse
import copy
from datetime import datetime
import logging
import os
import re
import shutil
import smtplib
import sys
from time import gmtime
from time import strftime
from time import time

from email.mime.text import MIMEText

from prettytable import PrettyTable
import sh
from six.moves import configparser
from six.moves.urllib import parse

import rdopkg.utils.log
rdopkg.utils.log.set_colors('no')
from rdopkg.actionmods import rdoinfo
import rdopkg.conf

from delorean.db import Commit
from delorean.db import getCommits
from delorean.db import getLastProcessedCommit
from delorean.db import getSession
from delorean.db import Project
from delorean.rpmspecfile import RpmSpecCollection
from delorean.rpmspecfile import RpmSpecFile
from delorean.utils import dumpshas2file

logging.basicConfig(level=logging.ERROR)
logger = logging.getLogger("delorean")
logger.setLevel(logging.INFO)


notification_email = """
A build of the package %(name)s has failed against the current master[1] of
the upstream project, please see log[2] and update the packaging[3].

You are receiving this email because you are listed as one of the
maintainers for the %(name)s package[4].

If you have any questions please see the FAQ[5], feel free to ask new questions
on there and we will add the answer as soon as possible.

[1] - %(upstream)s
[2] - %(logurl)s
[3] - %(master-distgit)s
[4] - https://github.com/redhat-openstack/rdoinfo/blob/master/rdo.yml
[5] - https://etherpad.openstack.org/p/delorean-packages
"""

re_known_errors = re.compile('Error: Nothing to do|'
                             'Error downloading packages|'
                             'No more mirrors to try|'
                             'Cannot retrieve metalink for repository|'
                             'Failed to synchronize cache for repo|'
                             'No route to host|'
                             'Could not resolve host')

default_options = {'maxretries': '3'}


def main():
    parser = argparse.ArgumentParser()
    # Some of the non-positional arguments are required, so change the text
    # saying "optional arguments" to just "arguments":
    parser._optionals.title = 'arguments'<commit_msg>retry on "Device or resource busy" messages<commit_after># Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.


import argparse
import copy
from datetime import datetime
import logging
import os
import re
import shutil
import smtplib
import sys
from time import gmtime
from time import strftime
from time import time

from email.mime.text import MIMEText

from prettytable import PrettyTable
import sh
from six.moves import configparser
from six.moves.urllib import parse

import rdopkg.utils.log
rdopkg.utils.log.set_colors('no')
from rdopkg.actionmods import rdoinfo
import rdopkg.conf

from delorean.db import Commit
from delorean.db import getCommits
from delorean.db import getLastProcessedCommit
from delorean.db import getSession
from delorean.db import Project
from delorean.rpmspecfile import RpmSpecCollection
from delorean.rpmspecfile import RpmSpecFile
from delorean.utils import dumpshas2file

logging.basicConfig(level=logging.ERROR)
logger = logging.getLogger("delorean")
logger.setLevel(logging.INFO)


notification_email = """
A build of the package %(name)s has failed against the current master[1] of
the upstream project, please see log[2] and update the packaging[3].

You are receiving this email because you are listed as one of the
maintainers for the %(name)s package[4].

If you have any questions please see the FAQ[5], feel free to ask new questions
on there and we will add the answer as soon as possible.

[1] - %(upstream)s
[2] - %(logurl)s
[3] - %(master-distgit)s
[4] - https://github.com/redhat-openstack/rdoinfo/blob/master/rdo.yml
[5] - https://etherpad.openstack.org/p/delorean-packages
"""

re_known_errors = re.compile('Error: Nothing to do|'
                             'Error downloading packages|'
                             'No more mirrors to try|'
                             'Cannot retrieve metalink for repository|'
                             'Failed to synchronize cache for repo|'
                             'No route to host|'
                             'Device or resource busy|'
                             'Could not resolve host')

default_options = {'maxretries': '3'}


def main():
    parser = argparse.ArgumentParser()
    # Some of the non-positional arguments are required, so change the text
    # saying "optional arguments" to just "arguments":
    parser._optionals.title = 'arguments'
{'fraction_non_alphanumeric': 0.07313167259786477, 'fraction_numerical': 0.0056939501779359435, 'mean_word_length': 3.432965299684543, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5957689', 'n_tokens_mistral': 1571, 'n_tokens_neox': 1527, 'n_words': 633}