def get_asset(graphene_info, asset_key):
    from ..schema.errors import GrapheneAssetNotFoundError
    from ..schema.pipelines.pipeline import GrapheneAsset
    check.inst_param(asset_key, 'asset_key', AssetKey)
    instance = graphene_info.context.instance
    asset_nodes_by_asset_key = get_asset_nodes_by_asset_key(graphene_info)
    asset_node = asset_nodes_by_asset_key.get(asset_key)
    if ((not asset_node) and (not instance.has_asset_key(asset_key))):
        return GrapheneAssetNotFoundError(asset_key=asset_key)
    return GrapheneAsset(key=asset_key, definition=asset_node)
def get_asset(graphene_info, asset_key):
    from ..schema.errors import GrapheneAssetNotFoundError
    from ..schema.pipelines.pipeline import GrapheneAsset
    check.inst_param(asset_key, 'asset_key', AssetKey)
    instance = graphene_info.context.instance
    asset_nodes_by_asset_key = get_asset_nodes_by_asset_key(graphene_info)
    asset_node = asset_nodes_by_asset_key.get(asset_key)
    if ((not asset_node) and (not instance.has_asset_key(asset_key))):
        return GrapheneAssetNotFoundError(asset_key=asset_key)
    return GrapheneAsset(key=asset_key, definition=asset_node)