parameters: (regions, contig_map=None)
docstring: Parses each region of `regions` into a Range proto.
  
    This function provides a super high-level interface for
    reading/parsing/converting objects into Range protos. Each `region` of
    `regions` is processed in turn, yielding one or more Range protos. This
    function inspects the contents of `region` to determine how to convert it to
    Range(s) protos. The following types of `region` strings are supported:
  
      * If region ends with an extension known in _get_parser_for_file, we treat
        region as a file and read the Range protos from it with the corresponding
        reader from _get_parser_for_file, yielding each Range from the file in
        order.
      * Otherwise we parse region as a region literal (`chr20:1-10`) and return
        the Range proto.
  
    Args:
      regions: iterable[str]. Converts each element of this iterable into
        region(s).
      contig_map: An optional dictionary mapping from contig names to ContigInfo
        protobufs. If provided, allows literals of the format "contig_name",
        which will be parsed into a Range with reference_name=contig_name,
        start=0, end=n_bases where n_bases comes from the ContigInfo.
  
    Yields:
      A Range proto.
docstring_summary: Parses each region of `regions` into a Range proto.
docstring_tokens: Parses each region of regions into a Range proto .
function: def from_regions(regions, contig_map=None):
    """Parses each region of `regions` into a Range proto.
  
    This function provides a super high-level interface for
    reading/parsing/converting objects into Range protos. Each `region` of
    `regions` is processed in turn, yielding one or more Range protos. This
    function inspects the contents of `region` to determine how to convert it to
    Range(s) protos. The following types of `region` strings are supported:
  
      * If region ends with an extension known in _get_parser_for_file, we treat
        region as a file and read the Range protos from it with the corresponding
        reader from _get_parser_for_file, yielding each Range from the file in
        order.
      * Otherwise we parse region as a region literal (`chr20:1-10`) and return
        the Range proto.
  
    Args:
      regions: iterable[str]. Converts each element of this iterable into
        region(s).
      contig_map: An optional dictionary mapping from contig names to ContigInfo
        protobufs. If provided, allows literals of the format "contig_name",
        which will be parsed into a Range with reference_name=contig_name,
        start=0, end=n_bases where n_bases comes from the ContigInfo.
  
    Yields:
      A Range proto.
    """
    for region in regions:
      reader = _get_parser_for_file(region)
      if reader:
        for elt in reader(region):
          yield elt
      else:
        yield parse_literal(region, contig_map)
function_tokens: def from_regions ( regions , contig_map = None ) : for region in regions : reader = _get_parser_for_file ( region ) if reader : for elt in reader ( region ) : yield elt else : yield parse_literal ( region , contig_map )