code: def _sort_set_none_first(set_):
      """Sort a set, sorting ``None`` before other elements, if present."""
      if None in set_:
          set_.remove(None)
          out = [None]
          out.extend(sorted(set_))
          set_.add(None)
          return out
      else:
          return sorted(set_)
  
imports: from contextlib import contextmanager
  from copy import deepcopy
  from itertools import product
  import operator
  import warnings
  import numpy
  import pandas
  from distutils.version import StrictVersion
  from trading_calendars.utils.pandas_utils import days_at_time
label_desc: Use image node_id 13 for calling a global function with example usage: _sort_set_none_first(set_) and returns: out, sorted