Parse WC keywords.

        Subject keywords are usually semicolon-delimited.
977736
def postprocess_WC(self, entry):
        

        if type(entry.WC) not in [str, unicode]:
            WC= u' '.join([unicode(k) for k in entry.WC])
        else:
            WC= entry.WC
        entry.WC= [k.strip().upper() for k in WC.split(';')]
637197
def full_keywords(soup):
    ""
    if not raw_parser.author_keywords(soup):
        return []
    return list(map(node_contents_str, raw_parser.author_keywords(soup)))
189836
def tokentype(self, s):
        """"""
        a = s[0] if len(s)>0 else ""
        b = s[1] if len(s)>1 else ""

        if a.isdigit() or (a in ["+","-"] and b.isdigit()):
            return self.parse_number(s)
        elif a == '"': return self.parse_string(s)
        elif a == ':': return self.parse_colon(s)
        elif a == ';': return self.parse_semicolon(s)
        else:
            return self.parse_word(s)
1116666
def _parse_info(self, info_str, num_alts):
        """"""
        result = OrderedDict()
        if info_str == ".":
            return result
        # The standard is very nice to parsers, we can simply split at
        # semicolon characters, although I (Manuel) don't know how strict
        # programs follow this
        for entry in info_str.split(";"):
            if "=" not in entry:  # flag
                key = entry
                result[key] = parse_field_value(self.header.get_info_field_info(key), True)
            else:
                key, value = split_mapping(entry)
                result[key] = parse_field_value(self.header.get_info_field_info(key), value)
            self._info_checker.run(key, result[key], num_alts)
        return result
929459
def _post_keywords(self, **kwargs):
        """"""
        if self.jurisdiction and 'jurisdiction_id' not in kwargs:
            kwargs['jurisdiction_id'] = self.jurisdiction
        if 'address' in kwargs:
            address = kwargs.pop('address')
            kwargs['address_string'] = address
        if 'name' in kwargs:
            first, last = kwargs.pop('name').split(' ')
            kwargs['first_name'] = first
            kwargs['last_name'] = last
        if 'api_key' not in kwargs:
            kwargs['api_key'] = self.api_key
        return kwargs
1100151
function getKeywords(keywords) {
  let arrs = [];

  utils._each(keywords, (v, k) => {
    if (utils.isArray(v)) {
      let values = [];
      utils._each(v, (val) => {
        val = utils.getValueString('keywords.' + k, val);
        if (val) { values.push(val); }
      });
      v = values;
    } else {
      v = utils.getValueString('keywords.' + k, v);
      if (utils.isStr(v)) {
        v = [v];
      } else {
        return;
      } // unsuported types - don't send a key
    }
    arrs.push({key: k, value: v});
  });

  return arrs;
}
535476
def _separate_keyword(line):
    """"""
    try:
        first, rest = line.split(None, 1)
    except ValueError:
        first = line.strip()
        rest = ''
    return first, rest
518183
def get_subject(self, msg):
        """"""

        text, encoding = decode_header(msg['subject'])[-1]

        try:
            text = text.decode(encoding)

        # If it's already decoded, ignore error
        except AttributeError:
            pass

        return text
1089734
def parse(self, ps, **kw):
        '''
        
        '''
        namespaceURI = self.wsAddressURI
        elements = ("MessageID","Action","To","From","RelatesTo")
        d = {namespaceURI:elements}
        typecodes = self._getWSAddressTypeCodes(**d)
        pyobjs = ps.ParseHeaderElements(typecodes)
        self._messageID = pyobjs[(namespaceURI,elements[0])]
        self._action = pyobjs[(namespaceURI,elements[1])]
        self._addressTo = pyobjs[(namespaceURI,elements[2])]
        self._from = pyobjs[(namespaceURI,elements[3])]
        self._relatesTo = pyobjs[(namespaceURI,elements[4])]
1037644
def _parse(self, fullname):
        """"""
        n = ' '.join(fullname.split()).strip(',')
        if not n:
            return
        comps = [p.strip() for p in n.split(',')]
        if len(comps) > 1 and not all([self._is_suffix(comp) for comp in comps[1:]]):
            vlj = []
            while True:
                vlj.append(comps.pop(0))
                if not self._is_suffix(comps[0]):
                    break
            ltokens = self._tokenize(vlj)
            ltokens = self._strip(ltokens, self._is_prefix, 'prefix')
            ltokens = self._strip(ltokens, self._is_suffix, 'suffix', True)
            self['lastname'] = self._clean(' '.join(ltokens), capitalize='name')
        tokens = self._tokenize(comps)
        tokens = self._strip(tokens, self._is_title, 'title')
        if not 'lastname' in self:
            tokens = self._strip(tokens, self._is_suffix, 'suffix', True)
        voni = []
        end = len(tokens) - 1
        if not 'prefix' in self:
            for i, token in enumerate(reversed(tokens)):
                if self._is_prefix(token):
                    if (i == 0 and end > 0) or (not 'lastname' in self and not i == end):
                        voni.append(end - i)
                else:
                    if (i == 0 and 'lastname' in self) or voni:
                        break
        if voni:
            if not 'lastname' in self:
                self['lastname'] = self._clean(' '.join(tokens[voni[0]+1:]), capitalize='name')
            self['prefix'] = self._clean(' '.join(tokens[voni[-1]:voni[0]+1]))
            tokens = tokens[:voni[-1]]
        else:
            if not 'lastname' in self:
                self['lastname'] = self._clean(tokens.pop(), capitalize='name')
        if tokens:
            self['firstname'] = self._clean(tokens.pop(0), capitalize='name')
        if tokens:
            nicki = []
            for i, token in enumerate(tokens):
                if token[0] in QUOTES:
                    for j, token2 in enumerate(tokens[i:]):
                        if token2[-1] in QUOTES:
                            nicki = range(i, i+j+1)
                            break
            if nicki:
                self['nickname'] = self._clean(' '.join(tokens[nicki[0]:nicki[-1]+1]).strip(''.join(QUOTES)),
                                                     capitalize='name')
                tokens[nicki[0]:nicki[-1]+1] = []
        if tokens:
            self['middlename'] = self._clean(' '.join(tokens), capitalize='name')
        namelist = []
        for attr in ['title', 'firstname', 'middlename', 'nickname', 'prefix', 'lastname', 'suffix']:
            if attr in self:
                namelist.append('"%s"' % self[attr] if attr == 'nickname' else self[attr])
        self['fullname'] = ' '.join(namelist)
990207
def parse_keypair_lines(content, delim='|', kv_sep='='):
    
    r = []
    if content:
        for row in [line for line in content if line]:
            item_dict = {}
            for item in row.split(delim):
                key, value = [i.strip("'\"").strip() for i in item.strip().split(kv_sep)]
                item_dict[key] = value
            r.append(item_dict)
    return r
6765
def _get_keywords(self, **kwargs):
        """"""
        if self.jurisdiction and 'jurisdiction_id' not in kwargs:
            kwargs['jurisdiction_id'] = self.jurisdiction
        if 'count' in kwargs:
            kwargs['page_size'] = kwargs.pop('count')
        if 'start' in kwargs:
            start = kwargs.pop('start')
            if 'end' in kwargs:
                end = kwargs.pop('end')
            else:
                end = date.today().strftime('%m-%d-%Y')
            start, end = self._format_dates(start, end)
            kwargs['start_date'] = start
            kwargs['end_date'] = end
        elif 'between' in kwargs:
            start, end = kwargs.pop('between')
            start, end = self._format_dates(start, end)
            kwargs['start_date'] = start
            kwargs['end_date'] = end
        return kwargs
107438
def parse_email_headers(s)
		keys={}
		match = (s =~ /\A((\w[\w\s\_\-]+: .*\n)+)\s*\n/)
		if match != 0
			keys[:data] = s
		else
			keys[:data] = $'
			headers = $1
			headers.split("\n").each do |l| 
# Fails if there are other ':' characters.
#				k, v = l.split(':')
				k, v = l.split(':', 2)
				k, v = normalize_key_and_value(k, v)
				k = k.to_sym
#				puts "K = #{k}, V=#{v}"
				keys[k] = v
			end
		end
		keys
	end
1004569
function keywordsToArray(keywords, result) {
      if (typeof keywords === 'string') {
        result = result.concat(keywords.split(','));
      }
      else if (keywords instanceof Array) {
        if (keywords.length > 0) {
          for (var i = 0; i < keywords.length; i++) {
            result = keywordsToArray(keywords[i], result);
          }
        }
      }
      return result;
    }
1273911
def _parse_subject(subject):
    '''
    
    '''
    ret = {}
    nids = []
    for nid_name, nid_num in six.iteritems(subject.nid):
        if nid_num in nids:
            continue
        try:
            val = getattr(subject, nid_name)
            if val:
                ret[nid_name] = val
                nids.append(nid_num)
        except TypeError as err:
            log.debug("Missing attribute '%s'. Error: %s", nid_name, err)

    return ret
66384
def _format_keyword(self, keyword):
        
        import re
        result = ''
        if keyword:
            result = re.sub(r"\W", "", keyword)
            # Remove underscores ('_') too.
            result = re.sub(r"_", "", result)
        return result
1150180
def _kw(keywords):
    """"""
    r = {}
    for k, v in keywords:
        r[k] = v
    return r