<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def upload_from_fileobject(f, profile=None, label=None):
 """ Saves image from f with TMP prefix and returns img_id. """

    if profile is None:
        profile = 'default'
    conf = get_profile_configs(profile)
    f.seek(0)
    if not is_image(f, types=conf['TYPES']):
        msg = (('Format of uploaded file is not allowed. '
                'Allowed formats is: %(formats)s.') %
               {'formats': ', '.join(map(lambda t: t.upper(), conf['TYPES']))})
        raise RuntimeError(msg)
    return _custom_upload(f, profile, label, conf)