Extract doc snippet for element configuration,
            :param kw: element name
            :return: instance itself
                1 call getKwAsDict() to return config as a dict
                2 call getKwAsJson() to return config as json string
                3 call getKwAsString() to return config as a raw string

        USAGE: getKw('Q10')

def getKw(self, kw):
        """ Extract doc snippet for element configuration,
            :param kw: element name
            :return: instance itself
                1 call getKwAsDict() to return config as a dict
                2 call getKwAsJson() to return config as json string
                3 call getKwAsString() to return config as a raw string

        USAGE: getKw('Q10')
        """
        ikw = kw.lower()
        line_continue_flag = ''
        appendflag = False
        try:
            for line in self.file_lines:
                if line.strip() == '':
                    continue
                line = ' '.join(line.strip().split()).strip('\n; ')
                if line.startswith('!'):
                    continue
                if line.lower().startswith(ikw + ' :') or line.lower().startswith(ikw + ':'):
                    conflist = []  # list to put into element configuration
                    conflist.append(line)
                    appendflag = True
                elif appendflag and line_continue_flag == '&':
                    conflist.append(line)
                line_continue_flag = line[-1]
                if line_continue_flag != '&':
                    appendflag = False
            conf_str = ''.join(conflist).replace('&', ',')
            if 'line' in conf_str.lower().split('=')[0]:  # if bl defines lattice
                conf_str = conf_str.lower().replace(',', ' ')[::-1].replace('enil', 'beamline,lattice'[::-1], 1)[
                           ::-1]  # avoid the case with bl keyword has 'line'
        except:
            conf_str = ''

        # print conf_str

        # split('!epics'): second part is epics control conf
        splitedparts = conf_str.split('!epics')
        self.confstr = splitedparts[0]
        try:
            self.confstr_epics = splitedparts[1].strip()
        except IndexError:
            self.confstr_epics = ''

        return self