Convert opts.name to an array if not already.
344894
function makeArrayOpt(opts, name) {
    if( !Array.isArray(opts[name]) ) {
      opts[name] = [ opts[name] ];
    }
    return opts[name];
  }
660378
def array(self, name, data, **kwargs):
        """"""
        return self._write_op(self._array_nosync, name, data, **kwargs)
1219609
def _get_dict(names, ndarrays):
        """"""
        nset = set()
        for nm in names:
            if nm in nset:
                raise ValueError('Duplicate names detected, %s' % str(names))
            nset.add(nm)
        return dict(zip(names, ndarrays))
238692
@Override
  public Collection<String> getNames(final String name) throws OptionsException {
    if (useSystemwideValues) {
      return getNames(optionsRoot, makePathElements(name), -1);
    }

    return getNames(localOptionsRoot, makePathElements(name), -1);
  }
1346542
def from_array(cls, arr):
        """"""
        return cls().with_columns([(f, arr[f]) for f in arr.dtype.names])
607397
def parse_name(cls, name: str, default: T = None) -> T:
        """"""
        if not name:
            return default
        name = name.lower()
        return next((item for item in cls if name == item.name.lower()), default)
715414
function (opts) {
        var objectName = opts.name
        var object = null

        this.objects.forEach(function (item) {
            if (item.name == objectName) {
                object = item
            }
        })
        if (object !== null) {
            return object
        }
    }
98519
function rename(opts) {
    opts = opts || {};

    return through.obj(function (file, enc, cb) {
        file.path = opts.path;
        cb(null, file);
    });
}
1020942
function convertArray(arr, pluralize, opts) {
  if (arr.length !== pluralize.count) throw new Error('missing required length of plural formats: expected ' + pluralize.count + '; got ' + arr.length);

  return pluralize.formats.reduce(function(acc, key, i) {
    acc[key] = arr[i];
    return acc;
  }, {});
}
1173440
function setOptName(opt, optKey) {
    var key$ = optKey + '$';
    opts[key$] = opts[key$] || {};
    var name = opt.name || fspath.basename(opt.path);
    while (opts[key$][name]) {
      name = '_' + name;
    }
    opts[key$][name] = opt;
    opt.name = name;
  }
600973
def [](name)
      enum_by_name(name).each { |f| return f.value if f.value != ""}
      enum_by_name(name).each { |f| return f.value }
      nil
    end
464043
function(opt) {
  var strings = (opt.string || "").split(","),
      abbr, full, metavar;
  for (var i = 0; i < strings.length; i++) {
    var string = strings[i].trim(),
        matches;
    if (matches = string.match(/^\-([^-])(?:\s+(.*))?$/)) {
      abbr = matches[1];
      metavar = matches[2];
    }
    else if (matches = string.match(/^\-\-(.+?)(?:[=\s]+(.+))?$/)) {
      full = matches[1];
      metavar = metavar || matches[2];
    }
  }

  matches = matches || [];
  var abbr = opt.abbr || abbr,   // e.g. v from -v
      full = opt.full || full, // e.g. verbose from --verbose
      metavar = opt.metavar || metavar;  // e.g. PATH from '--config=PATH'

  var string;
  if (opt.string) {
    string = opt.string;
  }
  else if (opt.position === undefined) {
    string = "";
    if (abbr) {
      string += "-" + abbr;
      if (metavar)
        string += " " + metavar
      string += ", ";
    }
    string += "--" + (full || opt.name);
    if (metavar) {
      string += " " + metavar;
    }
  }

  opt = _(opt).extend({
    name: opt.name || full || abbr,
    string: string,
    abbr: abbr,
    full: full,
    metavar: metavar,
    matches: function(arg) {
      return opt.full == arg || opt.abbr == arg || opt.position == arg
        || opt.name == arg || (opt.list && arg >= opt.position);
    }
  });
  return opt;
}
1063148
def get_index_by_name(self, name):
        """"""
        for i in range(self.n_blocks):
            if self.get_block_name(i) == name:
                return i
        raise KeyError('Block name ({}) not found'.format(name))
1009854
function parseObj(opts) {
    var obj = new Obj();

    Object.keys(opts).forEach(function (key) {
        obj[key] = opts[key];
    });

    return obj;
}
752269
def get_by_name(self, name):
        """"""
        for section in self.values():
            for preference in section.values():
                if preference.name == name:
                    return preference
        raise NotFoundInRegistry("No such preference in {0} with name={1}".format(
            self.__class__.__name__, name))
528885
def from_name(cls, name):
        """"""
        result = cls.list()
        vlans = {}
        for vlan in result:
            vlans[vlan['name']] = vlan['id']

        return vlans.get(name)
13904
public JsonArray optJsonArray(String name) {
        JsonElement el = null;
        try {
            el = get(name);
        } catch (JsonException e) {
            return null;
        }
        if (!el.isJsonArray()) {
            return null;
        }
        return el.asJsonArray();
    }