third_party/nucleus/util/cigar.py
def to_cigar_units(source):
  """Converts object to a list of CigarUnit.

  This function attempts to convert source into a list of CigarUnit protos.
  If source is a string, we assume it is a CIGAR string and call
  parse_cigar_string on it, returning the result. It not, we assume it's an
  iterable containing element to be converted with to_cigar_unit(). The
  resulting list of converted elements is returned.

  Args:
    source: str or iterable to convert to CigarUnit protos.

  Returns:
    list[CigarUnit].
  """
  if isinstance(source, six.string_types):
    return parse_cigar_string(source)
  else:
    return [to_cigar_unit(singleton) for singleton in source]
Converts object to a list of CigarUnit.

  This function attempts to convert source into a list of CigarUnit protos.
  If source is a string, we assume it is a CIGAR string and call
  parse_cigar_string on it, returning the result. It not, we assume it's an
  iterable containing element to be converted with to_cigar_unit(). The
  resulting list of converted elements is returned.

  Args:
    source: str or iterable to convert to CigarUnit protos.

  Returns:
    list[CigarUnit].
  
Converts object to a list of CigarUnit.
This function attempts to convert source into a list of CigarUnit protos.
If source is a string, we assume it is a CIGAR string and call
parse_cigar_string on it, returning the result. It not, we assume it's an
iterable containing element to be converted with to_cigar_unit(). The
resulting list of converted elements is returned.
Converts object to a list of CigarUnit . This function attempts to convert source into a list of CigarUnit protos . If source is a string we assume it is a CIGAR string and call parse_cigar_string on it returning the result . It not we assume it ' s an iterable containing element to be converted with to_cigar_unit () . The resulting list of converted elements is returned .
def to_cigar_units(source):
  if isinstance(source, six.string_types):
    return parse_cigar_string(source)
  else:
    return [to_cigar_unit(singleton) for singleton in source]
def to_cigar_units ( source ) : if isinstance ( source , six . string_types ) : return parse_cigar_string ( source ) else : return [ to_cigar_unit ( singleton ) for singleton in source ]
Converts object to a list of CigarUnit.
Converts object to a list of CigarUnit .
"""Converts object to a list of CigarUnit.

  This function attempts to convert source into a list of CigarUnit protos.
  If source is a string, we assume it is a CIGAR string and call
  parse_cigar_string on it, returning the result. It not, we assume it's an
  iterable containing element to be converted with to_cigar_unit(). The
  resulting list of converted elements is returned.

  Args:
    source: str or iterable to convert to CigarUnit protos.

  Returns:
    list[CigarUnit].
  """
None
source
str or iterable to convert to CigarUnit protos.
str or iterable to convert to CigarUnit protos .