<commit_before>
module.exports = owner

owner.usage = "npm owner add <username> <pkg>"
            + "\nnpm owner rm <username> <pkg>"
            + "\nnpm owner ls <pkg>"

owner.completion = function (opts, cb) {
  var argv = opts.conf.argv.remain
  if (argv.length > 4) return cb()
  if (argv.length <= 2) {
    var subs = ["add", "rm"]
    if (opts.partialWord === "l") subs.push("ls")
    else subs.push("ls", "list")
    return cb(null, subs)
  }
  var un = encodeURIComponent(npm.config.get("username"))
  var theUser, uri
  switch (argv[2]) {
    case "ls":
      if (argv.length > 3) return cb()
      uri = url.resolve(npm.config.get("registry"), "/-/short")
      else return registry.get(uri, null, cb)

    case "rm":
      if (argv.length > 3) {
        theUser = encodeURIComponent(argv[3])
        uri = url.resolve(npm.config.get("registry"), "/-/by-user/"+theUser+"|"+un)
        console.error(uri)
        return registry.get(uri, null, function (er, d) {
          if (er) return cb(er)
          // return the intersection
          return cb(null, d[theUser].filter(function (p) {
            // kludge for server adminery.
            return un === "isaacs" || d[un].indexOf(p) === -1
          }))
        })<commit_msg>syntax error in owner<commit_after>
module.exports = owner

owner.usage = "npm owner add <username> <pkg>"
            + "\nnpm owner rm <username> <pkg>"
            + "\nnpm owner ls <pkg>"

owner.completion = function (opts, cb) {
  var argv = opts.conf.argv.remain
  if (argv.length > 4) return cb()
  if (argv.length <= 2) {
    var subs = ["add", "rm"]
    if (opts.partialWord === "l") subs.push("ls")
    else subs.push("ls", "list")
    return cb(null, subs)
  }
  var un = encodeURIComponent(npm.config.get("username"))
  var theUser, uri
  switch (argv[2]) {
    case "ls":
      if (argv.length > 3) return cb()
      uri = url.resolve(npm.config.get("registry"), "/-/short")
      return registry.get(uri, null, cb)

    case "rm":
      if (argv.length > 3) {
        theUser = encodeURIComponent(argv[3])
        uri = url.resolve(npm.config.get("registry"), "/-/by-user/"+theUser+"|"+un)
        console.error(uri)
        return registry.get(uri, null, function (er, d) {
          if (er) return cb(er)
          // return the intersection
          return cb(null, d[theUser].filter(function (p) {
            // kludge for server adminery.
            return un === "isaacs" || d[un].indexOf(p) === -1
          }))
        })
{'fraction_non_alphanumeric': 0.17195660907995178, 'fraction_numerical': 0.00562474889513861, 'mean_word_length': 2.3422818791946307, 'pattern_counts': {'":': 4, '<': 15, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2913867', 'n_tokens_mistral': 838, 'n_tokens_neox': 816, 'n_words': 216}