<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def import_keypair(kwargs=None, call=None):
    '''
    Upload public key to cloud provider.
    Similar to EC2 import_keypair.

    .. versionadded:: 2016.11.0

    kwargs
        file(mandatory): public key file-name
        keyname(mandatory): public key name in the provider
    '''
    with salt.utils.files.fopen(kwargs['file'], 'r') as public_key_filename:
        public_key_content = salt.utils.stringutils.to_unicode(public_key_filename.read())

    digitalocean_kwargs = {
        'name': kwargs['keyname'],
        'public_key': public_key_content
    }

    created_result = create_key(digitalocean_kwargs, call=call)
    return created_result