Where do I put this code to enable email as username in Multisite?

Hi, I need to paste this code someplace, but I don't know into which file to paste it. It allows an email address to be used as the Username in Multisite. Also open to any other suggestions for accomplishing this same goal. Thanks, Sherry

<?php

/**
* WordPress register with email only, make it possible to register with email
* as username in a multisite installation
* @param Array $result Result array of the wpmu_validate_user_signup-function
* @return Array Altered result array
*/
function custom_register_with_email($result) {

if ( $result['user_name'] != '' && is_email( $result['user_name'] ) ) {

unset( $result['errors']->errors['user_name'] );

}

return $result;
}
add_filter('wpmu_validate_user_signup','custom_register_with_email');

?>