code: def locus_interval_expr(
      contig,
      start,
      end,
      includes_start,
      includes_end,
      reference_genome,
      skip_invalid_intervals,
  ):
      includes_start = hl.bool(includes_start)
      includes_end = hl.bool(includes_end)
  
      if reference_genome:
          return hl.locus_interval(
              contig,
              start,
              end,
              includes_start,
              includes_end,
              reference_genome,
              skip_invalid_intervals,
          )
      else:
          return hl.interval(
              hl.struct(contig=contig, position=start),
              hl.struct(contig=contig, position=end),
              includes_start,
              includes_end,
          )
  
imports: import os
  import re
  from collections import defaultdict
  import avro.schema
  from avro.datafile import DataFileReader
  from avro.io import DatumReader
  import hail
  from hail import ir
  from hail.expr import StructExpression, LocusExpression, expr_array, expr_float64, expr_str, expr_numeric, expr_call, expr_bool, expr_int32, to_expr, analyze
  from hail.expr.types import hail_type, tarray, tfloat64, tstr, tint32, tstruct, tcall, tbool, tint64, tfloat32
  from hail.genetics.reference_genome import reference_genome_type
  from hail.ir.utils import parse_type
  from hail.matrixtable import MatrixTable
  from hail.methods.misc import require_biallelic, require_row_key_variant, require_col_key_str
  from hail.table import Table
  from hail.typecheck import typecheck, nullable, oneof, dictof, anytype, sequenceof, enumeration, sized_tupleof, numeric, table_key_type, char
  from hail.utils import new_temp_file
  from hail.utils.deduplicate import deduplicate
  from hail.utils.java import Env, FatalError, jindexed_seq_args, warning
  from hail.utils.java import info
  from hail.utils.misc import wrap_to_list, plural
  from .import_lines_helpers import split_lines, should_remove_line
label_desc: Use image node_id 1 for calling a global function with example usage: locus_interval_expr(contig, start, end, includes_start, includes_end, reference_genome, skip_invalid_intervals) and returns: hl, hl