```python
import os
import shutil
import re
import csv
import pandas as pd

success_copy = 0
failed_copy = 0


def tranname(text):
    info_content = ''
    if re.search(r'[\u4e00-\u9fff]+', text):
        info_content = re.sub(r'特巡', '', text)
    else:
        pattern = r'!\[.*?\]\(file:///(.+?)\)'
        match = re.search(pattern, text)
        if match:
            info_content = match.group(1)
    return info_content


def winpath2wls(winpath):
    new_path = '/mnt/' + winpath[0].lower() + winpath[1:].replace(
        ':', '').replace('\\', '/')
    return new_path


def is_contain_chinese(df: pd.DataFrame, col_name: str) -> bool:
    return df[col_name].astype(str).str.contains('[\u4e00-\u9fa5]').any()


def folders_detected():
    dir_path = os.path.dirname(os.path.abspath(_file_))
    dirs = ['all_pics', 'result']
    for dir in dirs:
        path = os.path.join(dir_path, dir)
        if not os.path.exists(path):
            os.makedirs(path)


def is_adjacent(lst):
    return all(abs(lst[i] - lst[i - 1]) > 1 for i in range(1, len(lst)))


def df_lansyspath(df):
    df = df.copy()
    df['Info'] = df['Info'].str.replace("HYC", "yanyujie")
    return df


def read2csv(inputfile, outputfile):
    year = 2023
    with open(inputfile, 'r', encoding="utf-8") as f, open(outputfile, 'w',
                                                           encoding="utf-8") as csvfile:
        writer = csv.writer(csvfile)
        writer.writerow(['Name', 'Date', 'Time', 'Datetime', 'Info'])
        lines = f.readlines()
        for i in range(0, len(lines), 3):
            line1 = lines[i].strip().split()
            name = line1[0]
            date = str(year) + "-" + line1[1]
            time = line1[2]
            date_time = pd.to_datetime(date + ' ' + time)
            info = tranname(lines[i + 1].strip())
            writer.writerow([name, date, time, date_time, info])


def copy_img(df, folder_path):
    img_count = 0
    cn_count = 0
    success = 0
    df = df.copy()
    for i in range(len(df)):
        info = df.iloc[i]['Info']
        if not re.search(r'[\u4e00-\u9fff]+', info):
            basename = os.path.basename(info)
            df.iloc[i]['Info'] = os.path.join(folder_path, basename)
            try:
                shutil.copy(info, folder_path)
                success += 1
            except FileNotFoundError as e:
                print(f"File not found: {e}")
            except PermissionError as e:
                print(f"Permission denied: {e}")
            except Exception as e:
                prin The response should be in all capital letters.
user