code: public static String[] getVariableNames(NameSpace ns) {
          if (ns == null)
              return new String[0];
          return Stream.of(ns.getVariableNames())
                  .filter(name->!name.matches("_?bsh.*"))
                  .toArray(String[]::new);
      }
docs: /*
  Get only variable names from the name space.
  Filter out any bsh internal names.