clean: for list of literals only
320111
def get_tid2synonyms(self, clean:bool=True):
        '''  '''
        tid2synonyms = {}
        header = ['Index'] + list(self.fetch_synonyms().columns)
        for row in self.fetch_synonyms().itertuples():
            row = {header[i]:val for i, val in enumerate(row)}
            if clean:
                synonym = {'literal':row['literal'], 'type':row['type']}
                tid2synonyms[row['tid']].append(synonym)
            elif not clean:
                tid2synonyms[row['tid']].append(row)
        return tid2synonyms
667032
def _clean_code(code):
    
    lines = []
    # cleanup lines, the parser is very sensitive to extra spaces,...
    for l in code.splitlines():
        # remove last .
        if l.endswith('.'):
            l = l[:-1]
        # the parser doe not like VALUE xxx.
        if "VALUE" in l:
            l = l[:l.find("VALUE")]
        # the parser does not like extra spaces between "PIC X(xxx)" and "."
        indent = len(l) - len(l.lstrip())
        tokens = l.split(" ")
        while "" in tokens:
            tokens.remove("")
        if tokens and not tokens[-1].endswith("."):
            tokens[-1] += "."
        lines.append(" " * indent + " ".join(tokens))

    return lines
769204
def _clean_algorithm(data):
    
    # convert single items to lists
    for key in ["variantcaller", "jointcaller", "svcaller"]:
        val = tz.get_in(["algorithm", key], data)
        if val:
            if not isinstance(val, (list, tuple)) and isinstance(val, six.string_types):
                val = [val]
            # check for cases like [false] or [None]
            if isinstance(val, (list, tuple)):
                if len(val) == 1 and not val[0] or (isinstance(val[0], six.string_types)
                                                    and val[0].lower() in ["none", "false"]):
                    val = False
            data["algorithm"][key] = val
    return data
150921
public static <E> List<E> clean(List<E> list) {
        if (iterable(list)) {
            return list.stream().filter(e -> {
                if (Objects.isNull(e)) {
                    return false;
                }
                if (e instanceof Nullable) {
                    return !((Nullable) e).isNull();
                }
                return true;
            }).collect(Collectors.toList());
        }
        return list;
    }
868895
def _clean_dict(target_dict, whitelist=None):
    
    assert isinstance(target_dict, dict)
    return {
        ustr(k).strip(): ustr(v).strip()
        for k, v in target_dict.items()
        if v not in (None, Ellipsis, [], (), "")
        and (not whitelist or k in whitelist)
    }
776684
def _ctypes_ex_clean(executable):
    
    result = []
    for p in executable.ordered_parameters:
        _ctypes_code_parameter(result, p, "clean")
        
    if type(executable).__name__ == "Function":
        _ctypes_code_parameter(result, executable, "clean")
        
    return result
747246
private static String cleanWS(String s) {
        s = replaceAll(s, OuterWhiteSpacesPtn, "");
        s = replaceAll(s, WhiteSpacesPtn, " ");
        return s;
    }
803948
function cleanDoclets(desc) {
  var idx = desc.indexOf('@');
  return (idx === -1 ? desc : desc.substr(0, idx)).trim();
}
89747
function excludeFiles(list, regex) {
        var ret = [];
        for (var i=0; i < list.length; i++) {
            if (!regex.test(list[i].dst)) {
                ret.push(list[i]);
            }
        }
        return ret;
    }
1214952
function clean(code) {

    try {
        const ast = babylon.parse(code, {
            // parse in strict mode and allow module declarations
            sourceType: 'module',
            plugins: [
                // enable jsx and flow syntax
                'jsx',
                'flow'
            ]
        });

        const cleanAst = strip(ast).program;

        const resultCode = generate(cleanAst, {}).code;

        return resultCode.replace(/(\/\*\$ | \#\*\/)/g, '');

    } catch (e) {
        console.log(code);
        throw e;
    }
}
460906
def strip_magics(source):
    
    filtered=[]
    for line in source.splitlines():
        if not line.startswith('%') or line.startswith('%%'):
            filtered.append(line)
    return '\n'.join(filtered)
743347
def cleanBlockQuotedText(text, joiner=b' '):
    """"""
    L = filter(truth, map(_lineClean, split(text, '\n')))
    return joiner.join(L)
10197
function clean(test) {
  return {
    title: test.title,
    fullTitle: test.fullTitle(),
    duration: test.duration,
    currentRetry: test.currentRetry()
  };
}
204099
def clean(self):

        """"""

        for s in self.visible_files.values():
            s.clean()
        for s in [sub[1][x] for sub in self.avail_files.values() for x in sub[1]]: # Double list comprehensions aren't very
            s.clean()
363353
def clean(self, argslist):
        """"""
        result = []
        for arg in argslist:
            if type(arg) == type([]):
                if len(result) > 0:
                    result[-1] = result[-1] + "(*{})".format(len(self.clean(arg)))
                elif "/" not in arg[0]:
                    msg.warn("argument to function call unrecognized. {}".format(arg))
            else:
                cleaner = re.sub("[:,]+", "", arg).strip()
                if len(cleaner) > 0:
                    result.append(cleaner)
        
        return result
1305314
def _clean_text(self, text):
        """"""
        output = []
        for char in text:
            cp = ord(char)
            if cp in (0, 0xfffd) or self._is_control(char):
                continue
            if self._is_whitespace(char):
                output.append(' ')
            else:
                output.append(char)
        return ''.join(output)
913132
def raw_clean(self, datas):
        
        datas = strip_tags(datas)             # Remove HTML
        datas = STOP_WORDS.rebase(datas, '')  # Remove STOP WORDS
        datas = PUNCTUATION.sub('', datas)    # Remove punctuation
        datas = datas.lower()
        return [d for d in datas.split() if len(d) > 1]