original_docstring:  Parses and validates any usual MAC address format and returns one per configured params
docstring: Parses and validates any usual MAC address format and returns one per configured params
docstring_tokens: Parses and validates any usual MAC address format and returns one per configured params
code: def macaddr_parse(mac_string, chunk=3, delimiter='-', upper=True):
      """ Parses and validates any usual MAC address format and returns one per configured params"""
      wash = re.sub(r'[^A-Fa-f0-9]+', '', mac_string)
      if len(wash) != 12:
          raise ValueError('Incorrect MAC Address format: Should be 12 Hex chars')
      else:
          dry = delimiter.join((wash[i:i+chunk] for i in range(0, len(wash), chunk)))
          if upper:
              return dry.upper()
          else:
              return dry
code_tokens: def macaddr_parse ( mac_string , chunk = 3 , delimiter = '-' , upper = True ) : wash = re . sub ( r'[^A-Fa-f0-9]+' , '' , mac_string ) if len ( wash ) != 12 : raise ValueError ( 'Incorrect MAC Address format: Should be 12 Hex chars' ) else : dry = delimiter . join ( ( wash [ i : i + chunk ] for i in range ( 0 , len ( wash ) , chunk ) ) ) if upper : return dry . upper ( ) else : return dry
short_docstring: Parses and validates any usual MAC address format and returns one per configured params
short_docstring_tokens: Parses and validates any usual MAC address format and returns one per configured params
comment: """ Parses and validates any usual MAC address format and returns one per configured params"""