def public_factory(target, location):
 if isinstance(target, type):
  fn = target.__init__
  callable_ = target
  doc = ('Construct a new :class:`.%s` object. \n\nThis constructor is mirrored as a public API function; see :func:`~%s` for a full usage and argument description.' % (target.__name__, location))
 else:
  fn = callable_ = target
  doc = ('This function is mirrored; see :func:`~%s` for a description of arguments.' % location)
 location_name = location.split('.')[(-1)]
 spec = compat.inspect_getfullargspec(fn)
 del spec[0][0]
 metadata = format_argspec_plus(spec, grouped=False)
 metadata['name'] = location_name
 code = ('def %(name)s(%(args)s):\n    return cls(%(apply_kw)s)\n' % metadata)
 env = {'cls': callable_, 'symbol': symbol}
 exec code in env
 decorated = env[location_name]
 decorated.__doc__ = fn.__doc__
 decorated.__module__ = ('sqlalchemy' + location.rsplit('.', 1)[0])
 if (compat.py2k or hasattr(fn, '__func__')):
  fn.__func__.__doc__ = doc
 else:
  fn.__doc__ = doc
 return decorated

def public_factory ( target , location ) : if isinstance ( target , type ) : fn = target . __init__ callable_ = target doc = ( 'Construct a new :class:`.%s` object. \n\nThis constructor is mirrored as a public API function; see :func:`~%s` for a full usage and argument description.' % ( target . __name__ , location ) ) else : fn = callable_ = target doc = ( 'This function is mirrored; see :func:`~%s` for a description of arguments.' % location ) location_name = location . split ( '.' ) [ ( - 1 ) ] spec = compat . inspect_getfullargspec ( fn ) del spec [ 0 ] [ 0 ] metadata = format_argspec_plus ( spec , grouped = False ) metadata [ 'name' ] = location_name code = ( 'def %(name)s(%(args)s):\n    return cls(%(apply_kw)s)\n' % metadata ) env = { 'cls' : callable_ , 'symbol' : symbol } exec code in env decorated = env [ location_name ] decorated . __doc__ = fn . __doc__ decorated . __module__ = ( 'sqlalchemy' + location . rsplit ( '.' , 1 ) [ 0 ] ) if ( compat . py2k or hasattr ( fn , '__func__' ) ) : fn . __func__ . __doc__ = doc else : fn . __doc__ = doc return decorated
produce a wrapping function for the given cls or classmethod .