def get_device_name(doc):
    """
    Finds device name in the document title
    :param doc: docx Document instance
    :return: device name as string
    """
    found = False
    for paragraph in doc.paragraphs:
        if found:
            title = paragraph.text
            for word in str(title).split():
                if any(char.isdigit() for char in word):
                    return word[0:20].replace(',', '').replace('*', '').replace('#', '')
        if 'ЦЕЛЬ ИСПЫТАНИЙ' in paragraph.text or \
           'Цель ИСПЫТАНИЙ' in paragraph.text or \
           'ЦЕЛЬ РАБОТЫ' in paragraph.text:
            found = True