Get text type (letter)
339848
def _getTextType(self, lineData, column):
        
        if lineData is None:
            return ' '  # default is code

        textTypeMap = lineData[1]
        if column >= len(textTypeMap):  # probably, not actual data, not updated yet
            return ' '

        return textTypeMap[column]
714387
def get_text(self):
        """"""
        return u''.join(u'{0}'.format(b) for b in self.text)
805889
function getTypeArray (typeString) {
  const letters = typeString.split('')
  const elements = []
  let acc = ''

  while (letters.length) {
    const letter = letters.shift()
    // Ignore spaces
    if (letter !== ' ') {
      switch (letter) {
        case '[':
        case ']':
        case '/':
          if (acc.length) {
            elements.push(acc)
            acc = ''
          }
          elements.push(letter === '/' ? ' / ' : letter)
          break
        default:
          acc += letter
      }
    }
    continue
  }
  if (acc.length) {
    elements.push(acc)
    acc = ''
  }
  return elements
}
270231
def _guess_type(val):
        """"""
        if isinstance(val, bool):
            return "choice"
        elif isinstance(val, int):
            return "number"
        elif isinstance(val, float):
            return "number"
        elif isinstance(val, str):
            return "text"
        elif hasattr(val, 'read'):
            return "file"
        else:
            return "text"
87024
def eval_string_type(self, text, is_string=False):
        """"""

        stype = set()
        wstype = set()

        for m in RE_ITER_STRING_TYPES.finditer(text):
            value = m.group(0)
            if value == '*':
                wstype.add('u')
                wstype.add('f')
                wstype.add('r')
                wstype.add('b')
            elif value.endswith('*'):
                wstype.add(value[0].lower())
            else:
                stype.add(value.lower())

        if is_string and 'b' not in stype and 'f' not in stype:
            stype.add('u')

        return stype, wstype
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)
575034
def get_edu_text(text_subtree):
    """"""
    assert text_subtree.label() == SubtreeType.text
    return u' '.join(word.decode('utf-8') for word in text_subtree.leaves())
789149
function getText(msg) {
    return msg.parts.filter(function (part) {
      return part.mime_type === 'text/plain';
    }).map(function (part) {
      return part.body;
    }).join('; ');
  }
471819
def get_text_style(text):
    """"""
    style = {}
    style['alpha'] = text.get_alpha()
    if style['alpha'] is None:
        style['alpha'] = 1
    style['fontsize'] = text.get_size()
    style['color'] = color_to_hex(text.get_color())
    style['halign'] = text.get_horizontalalignment()  # left, center, right
    style['valign'] = text.get_verticalalignment()  # baseline, center, top
    style['malign'] = text._multialignment  # text alignment when '\n' in text
    style['rotation'] = text.get_rotation()
    style['zorder'] = text.get_zorder()
    return style
1092871
def python_type(textx_type_name):
    """"""
    return {
        'ID': text,
        'BOOL': bool,
        'INT': int,
        'FLOAT': float,
        'STRICTFLOAT': float,
        'STRING': text,
        'NUMBER': float,
        'BASETYPE': text,
    }.get(textx_type_name, textx_type_name)
1123006
def __get_type_from_char(self, c):
        
        if c.isdigit() or c =='-':
            return ("number", False, None)
        elif c == 't' or c == 'f': ## true/false
            return ("boolean", False, None)
        elif c == 'n': ## nil
            return ("nil", False, None)
        elif c == '\\' :
            return ("char", False, None)
        elif c == ':':
            return ("keyword", False, None)
        elif c == '"':
            return ("string", False, None)
        elif c == '#':
            if self.__read_and_back(1) == '{':
                return ("set", True, "}")
            if self.__read_and_back(1) == ':':
                return ("namespaced_dict", True, "}")
            if self.__read_and_back(4) == 'inst':
                return ("datetime", False, None)
            if self.__read_and_back(4) == 'uuid':
                return ("uuid", False, None)
        elif c == '{':
            return ("dict", True, "}")
        elif c == '(':
            return ("list", True, ")")
        elif c == '[':
            return ('list', True, "]")

        return (None, False, None)
151957
def get_selected_text(self):
        
        return to_text_string(self.textCursor().selectedText()).replace(u"\u2029",
                                                     self.get_line_separator())
970597
function GetPhpType()
	{
		$rt = $this->Type;
		switch ($this->Type)
		{
			case "smallint":
			case "bigint":
			case "tinyint":
			case "mediumint":
				$rt = "int";
				break;
			case "varchar":
			case "text":
			case "tinytext":
				$rt = "string";
				break;
			case "date":
			case "datetime":
				$rt = "date";
				break;
			case "decimal":
			case "float":
				$rt = "float";
				break;
			default;
				break;
		}

		return $rt;
	}
634298
def get_type_name(t):
    
    # Lookup in the mapping
    try:
        return __type_names[t]
    except KeyError:
        # Specific types
        if issubclass(t, six.integer_types):
            return _(u'Integer number')

        # Get name from the Type itself
        return six.text_type(t.__name__).capitalize()
456455
def get_string_width(self, s):
        ""
        s = self.normalize_text(s)
        cw=self.current_font['cw']
        w=0
        l=len(s)
        if self.unifontsubset:
            for char in s:
                char = ord(char)
                if len(cw) > char:
                    w += cw[char] # ord(cw[2*char])<<8 + ord(cw[2*char+1])
                #elif (char>0 and char<128 and isset($cw[chr($char)])) { $w += $cw[chr($char)]; }
                elif (self.current_font['desc']['MissingWidth']) :
                    w += self.current_font['desc']['MissingWidth']
                #elif (isset($this->CurrentFont['MissingWidth'])) { $w += $this->CurrentFont['MissingWidth']; }
                else:
                    w += 500
        else:
            for i in range(0, l):
                w += cw.get(s[i],0)
        return w*self.font_size/1000.0
998606
def get_human_readable_type(item):
    """"""
    if isinstance(item, (ndarray, MaskedArray)):
        return item.dtype.name
    elif isinstance(item, Image):
        return "Image"
    else:
        text = get_type_string(item)
        if text is None:
            text = to_text_string('unknown')
        else:
            return text[text.find('.')+1:]
1348620
public static String getTextType(String mimeType, String extension) {
        String textType = null;
        if (StringUtils.isNotBlank(mimeType)) {
            textType = EDITOR_MODES.get(mimeType);
            if (StringUtils.isBlank(textType)) {
                String[] parts = StringUtils.split(mimeType, '/');
                if (parts.length > 1) {
                    textType = EDITOR_MODES.get(parts[1]);
                }
                if (StringUtils.isBlank(textType)) {
                    if (StringUtils.isNotBlank(extension)) {
                        textType = EDITOR_MODES.get(extension);
                    }
                    if (StringUtils.isBlank(textType)) {
                        textType = EDITOR_MODES.get(parts[0]);
                    }
                }
            }
        }
        if (StringUtils.isBlank(textType)) {
            if (StringUtils.isNotBlank(extension)) {
                textType = EDITOR_MODES.get(extension);
            }
        }
        if (textType == null) {
            textType = "";
        }
        return textType;
    }