Trying to extract a list of Unique Values from a field using python

You've pretty much got it, you just need to specify the name of your parameters table and field in your function definition, and then pass those values when you call the function. Also watch your indentation, as it's vital for Python.

def unique_values(table , field):
    with arcpy.da.SearchCursor(table, [field]) as cursor:
        return sorted({row[0] for row in cursor})

myValues = unique_values(r'N:\GISProjects\Landuse\Plant_Biosecurity_Project\ArcGIS_Online.gdb\Holdings_Property_Merge' , 'LU_ALUMMaj')

print (myValues)

Basically this is saying that when you call the function unique_values() you'll pass values to two parameters, one called table, the other called field. These are then used in your function. When you call the function, in the line

myValues = unique_values(r'N:\GISProjects\Landuse\Plant_Biosecurity_Project\ArcGIS_Online.gdb\Holdings_Property_Merge' , 'LU_ALUMMaj')  

you are passing the values to these parameters.

This is the same as declaring your parameters separately and passing them to the cursor directly:

table = r'N:\GISProjects\Landuse\Plant_Biosecurity_Project\ArcGIS_Online.gdb\Holdings_Property_Merge'
field = 'LU_ALUMMaj'

with arcpy.da.SearchCursor(table, [field]) as cursor:
    myValues = sorted({row[0] for row in cursor})

print myValues

I would advise using Python's built-in set() function along with a SearchCursor as a generator expression to find the unique values. You'll find this approach extremely efficient with large or small datasets:

import arcpy

fc = r'C:\path\to\your.gdb\featureclass'

unique_values = set(row[0] for row in arcpy.da.SearchCursor(fc, "some_field"))

The following approach was published on https://arcpy.wordpress.com/2012/02/01/create-a-list-of-unique-field-values/ It is using arcpy and numpy and has a smaller memory footprint than the SearchCursor approach.

import arcpy
import numpy

def unique_values(table , field):
    data = arcpy.da.TableToNumPyArray(table, [field])
    return numpy.unique(data[field]).tolist()

myValues = unique_values(r'N:\GISProjects\Landuse\Plant_Biosecurity_Project\ArcGIS_Online.gdb\Holdings_Property_Merge' , 'LU_ALUMMaj')

print (myValues)