<commit_before># Function for site migration module

function ee_mod_migrate_data()
{
  # Remove if any previous directory and create /ee-backup
  rm -rf /ee-backup/$EE_DOMAIN && mkdir -p /ee-backup/$EE_DOMAIN/ && cd /ee-backup/$EE_DOMAIN/

  ee_lib_echo "Copying webroot from $EE_REMOTE_SERVER, please wait..."
  # Copy webroot using ssh with the help of rsync
  if [ "$EE_REMOTE_METHOD" == "ssh" ]; then
    # Lets FTP or rsync files
    rsync -avz --progress --rsh='sshpass -p$EE_REMOTE_PASSWORD ssh -l $EE_REMOTE_USER' $EE_REMOTE_SERVER:$EE_REMOTE_PATH/ /ee-backup/$EE_DOMAIN/ \
    || ee_lib_error "Unable to migrate data using rsync, exit status = " $?
    if [ ! -f /ee-backup/$EE_DOMAIN/wp-config.php ] && [ "$EE_SITE_CREATE_OPTION" != "--html" ] && [ "$EE_SITE_CREATE_OPTION" != "--php" ] && [ "$EE_SITE_CREATE_OPTION" != "--mysql" ]; then
      rsync -avz --progress --rsh='sshpass -p$EE_REMOTE_PASSWORD ssh -l $EE_REMOTE_USER' $EE_REMOTE_SERVER:$EE_REMOTE_PATH/../wp-config.php /ee-backup/$EE_DOMAIN/ \
      || ee_lib_error "Unable to migrate data using rsync, exit status = " $?
    fi

  # Copy webroot using ftp with the help of lftp
  elif [ "$EE_REMOTE_METHOD" == "ftp" ]; then
    lftp -e "mirror --verbose -c $EE_REMOTE_PATH /ee-backup/$EE_DOMAIN; quit" -u "$EE_REMOTE_USER,$EE_REMOTE_PASSWORD" ftp://$EE_REMOTE_SERVER \
    || ee_lib_error "Unable to migrate data using ftp, exit status = " $?
    if [ ! -f /ee-backup/$EE_DOMAIN/wp-config.php ] && [ "$EE_SITE_CREATE_OPTION" != "--html" ] && [ "$EE_SITE_CREATE_OPTION" != "--php" ] && [ "$EE_SITE_CREATE_OPTION" != "--mysql" ]; then
      lftp -e "get -c $EE_REMOTE_PATH/../wp-config.php; quit" -u "$EE_REMOTE_USER,$EE_REMOTE_PASSWORD" ftp://$EE_REMOTE_SERVER \
      || ee_lib_error "Unable to migrate data using ftp, exit status = " $?
    fi

  # Copy webroot using sftp with the help of lftp
  elif [ "$EE_REMOTE_METHOD" == "sftp" ]; then
    lftp -e "mirror --verbose -c $EE_REMOTE_PATH /ee-backup/$EE_DOMAIN ; quit" -u "$EE_REMOTE_USER,$EE_REMOTE_PASSWORD" sftp://$EE_REMOTE_SERVER \
    || ee_lib_error "Unable to migrate data using sftp, exit status = " $?
    if [ ! -f /ee-backup/$EE_DOMAIN/wp-config.php ] && [ "$EE_SITE_CREATE_OPTION" != "--html" ] && [ "$EE_SITE_CREATE_OPTION" != "--php" ] && [ ]"$EE_SITE_CREATE_OPTION" != "--mysql" ]; then
      lftp -e "get -c $EE_REMOTE_PATH/../wp-config.php; quit" -u "$EE_REMOTE_USER,$EE_REMOTE_PASSWORD" sftp://$EE_REMOTE_SERVER \
      || ee_lib_error "Unable to migrate data using lftp, exit status = " $?
    fi
  fi
}<commit_msg>Improved code<commit_after># Function for site migration module

function ee_mod_migrate_data()
{
  # Remove if any previous directory and create /ee-backup
  rm -rf /ee-backup/$EE_DOMAIN && mkdir -p /ee-backup/$EE_DOMAIN/ && cd /ee-backup/$EE_DOMAIN/

  ee_lib_echo "Copying webroot from $EE_REMOTE_SERVER, please wait..."
  
  # Copy webroot using ssh with the help of rsync
  if [ "$EE_REMOTE_METHOD" == "ssh" ]; then
    if [ "$EE_REMOTE_PASSWORD" != "" ]; then
      EE_MIGRATE_CMD1='rsync -avz --progress --rsh="sshpass -p$EE_REMOTE_PASSWORD ssh -l $EE_REMOTE_USER" $EE_REMOTE_SERVER:$EE_REMOTE_PATH/ /ee-backup/$EE_DOMAIN/'
      EE_MIGRATE_CMD2='rsync -avz --progress --rsh="sshpass -p$EE_REMOTE_PASSWORD ssh -l $EE_REMOTE_USER" $EE_REMOTE_SERVER:$EE_REMOTE_PATH/../wp-config.php /ee-backup/$EE_DOMAIN/'
    else
      EE_MIGRATE_CMD1='rsync -avz --progress $EE_REMOTE_USER@$EE_REMOTE_SERVER:$EE_REMOTE_PATH/ /ee-backup/$EE_DOMAIN/'
      EE_MIGRATE_CMD2='rsync -avz --progress $EE_REMOTE_USER@$EE_REMOTE_SERVER:$EE_REMOTE_PATH/../wp-config.php /ee-backup/$EE_DOMAIN/'
    fi
  elif [ "$EE_REMOTE_METHOD" == "sftp" ]; then
    if [ "$EE_REMOTE_PASSWORD" != "" ]; then
      $EE_MIGRATE_CMD1='lftp -e "mirror --verbose -c $EE_REMOTE_PATH /ee-backup/$EE_DOMAIN; quit" -u "$EE_REMOTE_USER,$EE_REMOTE_PASSWORD" sftp://$EE_REMOTE_SERVER'
      $EE_MIGRATE_CMD2='lftp -e "get -c $EE_REMOTE_PATH/../wp-config.php; quit" -u "$EE_REMOTE_USER,$EE_REMOTE_PASSWORD" sftp://$EE_REMOTE_SERVER'
    else
      $EE_MIGRATE_CMD1='lftp -e "mirror --verbose -c $EE_REMOTE_PATH /ee-backup/$EE_DOMAIN; quit" -u "$EE_REMOTE_USER" sftp://$EE_REMOTE_SERVER'
      $EE_MIGRATE_CMD2='lftp -e "get -c $EE_REMOTE_PATH/../wp-config.php; quit" -u "$EE_REMOTE_USER" ftp://$EE_REMOTE_SERVER'
    fi
  elif [ "$EE_REMOTE_METHOD" == "ftp" ]; then
    if [ "$EE_REMOTE_PASSWORD" != "" ]; then
      $EE_MIGRATE_CMD1='lftp -e "mirror --verbose -c $EE_REMOTE_PATH /ee-backup/$EE_DOMAIN; quit" -u "$EE_REMOTE_USER,$EE_REMOTE_PASSWORD" ftp://$EE_REMOTE_SERVER'
      $EE_MIGRATE_CMD2='lftp -e "get -c $EE_REMOTE_PATH/../wp-config.php; quit" -u "$EE_REMOTE_USER,$EE_REMOTE_PASSWORD" ftp://$EE_REMOTE_SERVER'
    else
      $EE_MIGRATE_CMD1='lftp -e "mirror --verbose -c $EE_REMOTE_PATH /ee-backup/$EE_DOMAIN; quit" -u "$EE_REMOTE_USER" ftp://$EE_REMOTE_SERVER'
      $EE_MIGRATE_CMD2='lftp -e "get -c $EE_REMOTE_PATH/../wp-config.php; quit" -u "$EE_REMOTE_USER" ftp://$EE_REMOTE_SERVER'
    fi
  fi

  $EE_MIGRATE_CMD1 \
  || ee_lib_error "Unable to migrate data using rsync, exit status = " $?
  if [ ! -f /ee-backup/$EE_DOMAIN/wp-config.php ] && [ "$EE_SITE_CREATE_OPTION" != "--html" ] && [ "$EE_SITE_CREATE_OPTION" != "--php" ] && [ "$EE_SITE_CREATE_OPTION" != "--mysql" ]; then
    $EE_MIGRATE_CMD2 \
    || ee_lib_error "Unable to migrate data using rsync, exit status = " $?
  fi

}
{'fraction_non_alphanumeric': 0.16192762186115214, 'fraction_numerical': 0.00258493353028065, 'mean_word_length': 3.760105448154657, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6073623', 'n_tokens_mistral': 2362, 'n_tokens_neox': 2155, 'n_words': 433}