Returns a readable type according to a java type
196590
def massage_type_name(cls, type_name):
        
        if type_name.lower() in ("enum", "enumeration"):
            return "enum"

        if type_name.lower() in ("str", "string"):
            return "string"

        if type_name.lower() in ("boolean", "bool"):
            return "boolean"

        if type_name.lower() in ("int", "integer"):
            return "integer"

        if type_name.lower() in ("date", "datetime", "time"):
            return "time"

        if type_name.lower() in ("double", "float", "long"):
            return "float"

        if type_name.lower() in ("list", "array"):
            return "list"

        if type_name.lower() in ("object", "dict"):
            return "object"

        if "array" in type_name.lower():
            return "list"

        return "string"
218147
def is_type_text_string(obj):
    """"""
    if PY2:
        # Python 2
        return type(obj) in [str, unicode]
    else:
        # Python 3
        return type(obj) in [str, bytes]
503418
private JSType getJSType(Node n) {
    JSType jsType = n.getJSType();
    if (jsType == null) {
      // TODO(nicksantos): This branch indicates a compiler bug, not worthy of
      // halting the compilation but we should log this and analyze to track
      // down why it happens. This is not critical and will be resolved over
      // time as the type checker is extended.
      return unknownType;
    } else {
      return jsType;
    }
  }
708567
def jtype(c):
    
    ct = c['type']
    return ct if ct != 'literal' else '{}, {}'.format(ct, c.get('xml:lang'))
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)
1211186
def getTypeStr(_type):
  
  """
  if isinstance(_type, CustomType):
    return str(_type)

  if hasattr(_type, '__name__'):
    return _type.__name__

  return ''
904070
public static Type getType(final Class c) {
        if (c.isPrimitive()) {
            if (c == Integer.TYPE) {
                return INT_TYPE;
            } else if (c == Void.TYPE) {
                return VOID_TYPE;
            } else if (c == Boolean.TYPE) {
                return BOOLEAN_TYPE;
            } else if (c == Byte.TYPE) {
                return BYTE_TYPE;
            } else if (c == Character.TYPE) {
                return CHAR_TYPE;
            } else if (c == Short.TYPE) {
                return SHORT_TYPE;
            } else if (c == Double.TYPE) {
                return DOUBLE_TYPE;
            } else if (c == Float.TYPE) {
                return FLOAT_TYPE;
            } else /* if (c == Long.TYPE) */{
                return LONG_TYPE;
            }
        } else {
            return getType(getDescriptor(c));
        }
    }
392905
private static TYPE toTYPE(String type) {
        if (null == type || type.trim().isEmpty()) {
            return TYPE.OBJECT;
        } else {
            return TYPE.valueOf(type.toUpperCase());
        }
    }
461264
function getTypeClass(type) {
  switch (type) {
    case String:
      return types.String;
    case Number:
      return types.Number;
    case Date:
      return types.Date;
    case Boolean:
      return types.Boolean;
    case Buffer:
      return types.Buffer;
  }

  if (typeof type === 'string') return types[type];

  for (const ii in types) {
    if (types[ii] === type) return types[ii];
  }
  return null;
}
155841
Object readClassOrType(int i) {
        int index =  poolIdx[i];
        int len = getChar(index + 1);
        int start = index + 3;
        Assert.check(buf[start] == '[' || buf[start + len - 1] != ';');
        // by the above assertion, the following test can be
        // simplified to (buf[start] == '[')
        return (buf[start] == '[' || buf[start + len - 1] == ';')
            ? (Object)sigToType(buf, start, len)
            : (Object)enterClass(names.fromUtf(internalize(buf, start,
                                                           len)));
    }
593657
function getType(key, req) {
  var val = this.getKey(key, req);
  if(val === undefined) return undefined;
  return val.rtype || TYPE_NAMES.STRING;
}
530620
function getType(type, method) {
    var generics = [];
    switch (type) {
      case 'Array':
        type = 'T[]';
        generics.push('T');
        break;
      case 'New Array':
        type = 'U[]';
        generics.push('T');
        generics.push('U');
        break;
      case 'ArrayElement':
        type = 'T';
        generics.push('T');
        break;
      case 'Mixed':
        type = 'T';
        generics.push('T');
        break;
      case 'Property':
        type = 'T';
        generics.push('T');
        break;
      case 'NewArrayElement':
        type = 'U';
        generics.push('T');
        generics.push('U');
        break;
      case 'NewProperty':
        type = 'U';
        generics.push('T');
        generics.push('U');
        break;
      case 'RangeElement':
        type = 'T';
        generics.push('T');
        break;
      case 'String':
      case 'Number':
      case 'Boolean':
        type = type.toLowerCase();
        break;
    }
    if (method && generics) {
      addMethodGenerics(method, generics);
    }
    return type;
  }
1033076
private int getIntForType(JSType type) {
    // Templatized types don't exist at runtime, so collapse to raw type
    if (type != null && type.isGenericObjectType()) {
      type = type.toMaybeObjectType().getRawType();
    }
    if (intForType.containsKey(type)) {
      return intForType.get(type).intValue();
    }
    int newInt = intForType.size() + 1;
    intForType.put(type, newInt);
    return newInt;
  }
699228
def get_type(self, name, api=None):
        
        k = (name, api)
        if k in self.types:
            return self.types[k]
        else:
            return self.types[(name, None)]
375457
private Iterable<? extends JSType> getTypeAlternatives(JSType type) {
    if (type.isUnionType()) {
      return type.getUnionMembers();
    } else {
      ObjectType objType = type.toMaybeObjectType();
      FunctionType constructor = objType != null ? objType.getConstructor() : null;
      if (constructor != null && constructor.isInterface()) {
        List<JSType> list = new ArrayList<>();
        for (FunctionType impl : constructor.getDirectSubTypes()) {
          list.add(impl.getInstanceType());
        }
        return list.isEmpty() ? null : list;
      } else {
        return null;
      }
    }
  }
274460
def _get_value_type(kind):
    """"""

    if kind == TEXT:
        return APETextValue
    elif kind == BINARY:
        return APEBinaryValue
    elif kind == EXTERNAL:
        return APEExtValue
    raise ValueError("unknown kind %r" % kind)
949062
function extractTypes (elements, Types) {
  function inner (elements, res) {
    const l = elements.length
    for (let i = 0; i < l; i++) {
      const e = elements[i]
      const index = Types.indexOf(e.constructor)
      if (index > -1) {
        res[index].push(e)
      } else if (e instanceof Element) {
        inner(e.content, res)
        inner(e.endContent, res)
      }
    }
  }

  const res = Types.map(() => [])
  inner(elements, res)
  return res
}