code: def get_enabled_regions(exec_type, json_spec, from_command_line, executable_builder_exeception):
      
  
      from_spec = json_spec.get('regionalOptions')
  
      if from_spec is not None:
          assert_consistent_reg_options(exec_type, json_spec, executable_builder_exeception)
  
      assert_consistent_regions(from_spec, from_command_line, executable_builder_exeception)
  
      enabled_regions = None
      if from_spec is not None:
          enabled_regions = from_spec.keys()
      elif from_command_line is not None:
          enabled_regions = from_command_line
  
      return enabled_regions
docs: Return a list of regions in which the global executable (app or global workflow)
      will be enabled, based on the "regionalOption" in their JSON specification
      and/or --region CLI argument used with "dx build".
  
      :param exec_type: 'app' or 'globalworkflow'
      :type json_spec: str.
      :param json_spec: The contents of dxapp.json or dxworkflow.json
      :type json_spec: dict or None.
      :param from_command_line: The regional options specified on the command-line via --region.
      :type from_command_line: list or None.
      :param builder_exception: Exception that will be thrown.
      :type builder_exception: AppBuilderException or WorkflowBuilderException.