WordPress at a glance
function is not described

Automattic\WooCommerce\Admin\API\Reports\Customers

DataStore::is_valid_customer() protected WC 1.0

Check if a user ID is a valid customer or other user role with past orders.

{} It's a method of the class: DataStore{}

Hooks from the method
Return

true|false. Nothing.

Usage

$result = DataStore::is_valid_customer( $user_id );
$user_id(int) (required)
User ID.

Code of DataStore::is_valid_customer() WC 5.3.0

<?php
protected static function is_valid_customer( $user_id ) {
	$customer = new \WC_Customer( $user_id );

	if ( absint( $customer->get_id() ) !== absint( $user_id ) ) {
		return false;
	}

	$customer_roles = (array) apply_filters( 'woocommerce_analytics_customer_roles', array( 'customer' ) );
	if ( $customer->get_order_count() < 1 && ! in_array( $customer->get_role(), $customer_roles, true ) ) {
		return false;
	}

	return true;
}