def calculate_virtual_free_capacity(total_capacity, free_capacity, provisioned_capacity, thin_provisioning_support, max_over_subscription_ratio, reserved_percentage, thin):
 total = float(total_capacity)
 reserved = (float(reserved_percentage) / 100)
 if (thin and thin_provisioning_support):
  free = (((total * max_over_subscription_ratio) - provisioned_capacity) - math.floor((total * reserved)))
 else:
  free = (free_capacity - math.floor((total * reserved)))
 return free

def calculate_virtual_free_capacity ( total_capacity , free_capacity , provisioned_capacity , thin_provisioning_support , max_over_subscription_ratio , reserved_percentage , thin ) : total = float ( total_capacity ) reserved = ( float ( reserved_percentage ) / 100 ) if ( thin and thin_provisioning_support ) : free = ( ( ( total * max_over_subscription_ratio ) - provisioned_capacity ) - math . floor ( ( total * reserved ) ) ) else : free = ( free_capacity - math . floor ( ( total * reserved ) ) ) return free
calculate the virtual free capacity based on thin provisioning support .