def from_any(size, fraction_ref=None):
 if cbook.is_numlike(size):
  return Fixed(size)
 elif cbook.is_string_like(size):
  if (size[(-1)] == u'%'):
   return Fraction((float(size[:(-1)]) / 100.0), fraction_ref)
 raise ValueError(u'Unknown format')

def from_any ( size , fraction_ref = None ) : if cbook . is_numlike ( size ) : return Fixed ( size ) elif cbook . is_string_like ( size ) : if ( size [ ( - 1 ) ] == u'%' ) : return Fraction ( ( float ( size [ : ( - 1 ) ] ) / 100.0 ) , fraction_ref ) raise ValueError ( u'Unknown format' )
creates fixed unit when the first argument is a float .