Given a correct type comment, obtain a FunctionType object
423189
def parse_function_type_comment(type_comment: str) -> Optional[FunctionType]:
    """"""
    if _ast_py3 is None:
        return None

    func_type = _ast_py3.parse(type_comment, "<type_comment>", "func_type")
    return FunctionType(argtypes=func_type.argtypes, returns=func_type.returns)
106889
function _typeof (commentStr) {
    for (var key in commentRegex) {
        var regex = commentRegex[key][0];
        if (regex.test(commentStr)) return key;
    }
    return '';
}
1265718
def _TypecheckDecorator(subject=None, **kwargs):
  
  if subject is None:
    return _TypecheckDecoratorFactory(kwargs)
  elif inspect.isfunction(subject) or inspect.ismethod(subject):
    return _TypecheckFunction(subject, {}, 2, None)
  else:
    raise TypeError()
1273746
def _CollectTypeChecks(function, parent_type_check_dict, stack_location,
                      self_name):
  """"""
  type_check_dict = dict(parent_type_check_dict)
  type_check_dict.update(_ParseDocstring(function))

  # Convert any potential string based checks into python instances.
  for key, value in type_check_dict.items():
    if isinstance(value, str):
      type_check_dict[key] = _ParseTypeCheckString(value, stack_location + 1,
                                                  self_name)

  return type_check_dict
1287600
def comments(object):
    
    return Comment.objects.filter(
        object_id=object.pk,
        content_type=ContentType.objects.get_for_model(object)
    )
937293
def simplefilter(f):
    
    return type(f.__name__, (FunctionFilter,), {
        '__module__': getattr(f, '__module__'),
        '__doc__': f.__doc__,
        'function': f,
    })
1251690
function getDecoratorTypeFromArguments(args) {
    'use strict';
    if (args.length === 0 || args.length > 3) {
        return DecoratorType.None;
    }
    var kind = typeof (args.length === 1 ? args[0] : args[2]);
    switch (kind) {
        case 'function':
            return DecoratorType.Class;
        case 'number':
            return DecoratorType.Parameter;
        case 'undefined':
            return DecoratorType.Property;
        case 'object':
            return DecoratorType.Method;
        default:
            return DecoratorType.None;
    }
}
1359309
def p_type_ref(self, p):
        ''
        p[0] = AstTypeRef(
            path=self.path,
            lineno=p.lineno(1),
            lexpos=p.lexpos(1),
            name=p[1],
            args=p[2],
            nullable=p[3],
            ns=None,
        )
1202550
function toTypeRef(type) {
    if (!type) {
      return (0, _typeOf.typeOf)(type);
    } else if (type.constructor === String || type instanceof Function) {
      return type;
    }

    return (0, _typeOf.typeOf)(type);
  }
267320
def get_functions(cls, entry):
        
        comments = []
        query = "./comment[@type='function']"
        for comment in entry.iterfind(query):
            text = comment.find('./text').text
            comments.append(models.Function(text=text))

        return comments
104774
def get_true_function(obj):
    ""
    if not callable(obj):
        raise TypeError("%r is not callable." % (obj,))
    ismethod = inspect.ismethod(obj)
    if inspect.isfunction(obj) or ismethod:
        return obj, ismethod
    if hasattr(obj, 'im_func'):
        return obj.im_func, True
    if inspect.isclass(obj):
        return getattr(obj, '__init__', None), True
    if isinstance(obj, object):
        if hasattr(obj, 'func'):
            return get_true_function(obj.func)
        return obj.__call__, True
    raise TypeError("Unknown type of object: %r" % obj)
229400
function getFunctionCallTypeParameterType (func) {
  var type = getFunctionCallType(func)
  if (type.startsWith('function (')) {
    var paramTypes = ''
    var openPar = 1
    for (var x = 10; x < type.length; x++) {
      var c = type.charAt(x)
      if (c === '(') openPar++
      else if (c === ')') openPar--

      if (openPar === 0) return paramTypes

      paramTypes += c
    }
  } else {
    throw new Error('staticAnalysisCommon.js: cannot extract parameter types from function call')
  }
}
1104663
def statement(type, hook, opt={})
      lang = opt[:lang] || Cog.active_language
      lang.comment_pattern("#{type}\\s*:\\s*(#{hook})\\s*(?:\\(\\s*(.+?)\\s*\\))?(\\s*once\\s*)?(?:\\s*([{]))?")
    end
255530
def lookup_function(val):
	""
	
	type = val.type
	
	if type.code == gdb.TYPE_CODE_REF:
		type = type.target()
	
	type = type.unqualified().strip_typedefs()
	
	typename = type.tag
	if typename == None:
		return None
	
	for function in pretty_printers_dict:
		if function.search(typename):
			return pretty_printers_dict[function](val)
	
	return None
715319
def noglobals(fn):
    
    return type(fn)(
        getattr(fn, 'func_code', getattr(fn, '__code__')),
        {'__builtins__': builtins},
        getattr(fn, 'func_name', getattr(fn, '__name__')),
        getattr(fn, 'func_defaults', getattr(fn, '__defaults__')),
        getattr(fn, 'func_closure', getattr(fn, '__closure__'))
    )
539501
function getType() {
  var result = getValue(this, 'type');
  if (!result) {
    return this.isFunction() ? 'Function' : 'unknown';
  }
  return /^(?:array|function|object|regexp)$/.test(result)
    ? _.capitalize(result)
    : result;
}
68750
function analyseComment(comment, callback) {
  var reg = /(@(require|async|require\.async)\s+)('[^']+'|"[^"]+"|[^\s;!@#%^&*()]+)/g;
  callback = callback || function(m, prefix, type, value) {
    type = type === 'require' ? type : 'async';

    return prefix + map[type].wrap(value);
  };

  return comment.replace(reg, callback).replace(/(?:@|#)\s+sourceMappingURL=([^\s]+)/g, function(_, value) {
    return '# sourceMappingURL=' + map.sourceMap.wrap(value);
  });
}