<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def loadSV(fname, shape=None, titles=None, aligned=False, byteorder=None, renamer=None, **kwargs):
 """ Load a delimited text file to a numpy record array. Basically, this function calls loadSVcols and combines columns returned by that function into a numpy ndarray with stuctured dtype. Also uses and returns metadata including column names, formats, coloring, &c. if these items are determined during the loading process. **Parameters** **fname** : string or file object Path (or file object) corresponding to a separated variable (CSV) text file. **names** : list of strings Sets the names of the columns of the resulting tabarray. If not specified, `names` value is determined first by looking for metadata in the header of the file, and if that is not found, **namesinheader** parameter below. **formats** : string or list of strings Sets the datatypes of the columns. The value of `formats` can be a list or comma-delimited string of values describing values for each column (e.g. "str,str,int,float" or ["str", "str", "int", "float"]), a single value to apply to all columns, or anything that can be used in numpy.rec.array constructor. If the **formats** (or **dtype**) parameter are not specified, typing is done by inference. See **typer** parameter below. **dtype** : numpy dtype object Sets the numpy dtype of the resulting tabarray, combining column format and column name information. If dtype is set, any **names** and **formats** specifications will be overriden. If the **dtype** (or **formats**) parameter are not specified, typing is done by inference. See **typer** parameter below. The **names**, **formats** and **dtype** parameters duplicate parameters of the NumPy record array creation inferface. Additional paramters of the NumPy inferface that are passed through are **shape**, **titles**, **byteorder** and **aligned** (see NumPy documentation for more information.) **kwargs**: keyword argument dictionary of variable length Contains various parameters to be passed down to loadSVcols. These may include **skiprows**, **comments**, **delimiter**, **lineterminator**, **uselines**, **usecols**, **excludecols**, **metametadata**, **namesinheader**,**headerlines**, **valuefixer**, **linefixer**, **colfixer**, **delimiter_regex**, **inflines**, **typer**, **missingvalues**, **fillingvalues**, **verbosity**, and various CSV module parameters like **escapechar**, **quoting**, **quotechar**, **doublequote**, **skipinitialspace**. **Returns** **R** : numpy record array Record array constructed from data in the SV file **metadata** : dictionary Metadata read and constructed during process of reading file. **See Also:** :func:`tabular.io.loadSVcols`, :func:`tabular.io.saveSV`, :func:`tabular.io.DEFAULT_TYPEINFERER` """
    
    [columns, metadata] = loadSVcols(fname, **kwargs)
    
    if 'names' in metadata.keys():
        names = metadata['names']
    else:
        names = None
 
    if 'formats' in metadata.keys():
        formats = metadata['formats']
    else:
        formats = None
    
    if 'dtype' in metadata.keys():
        dtype = metadata['dtype']
    else:
        dtype = None
 
    if renamer is not None:
        print 'Trying user-given renamer ...'
        renamed = renamer(names)
        if len(renamed) == len(uniqify(renamed)):
            names = renamed
            print '''... using renamed names (original names will be in return 
                     metadata)'''
        else:
            print '... renamer failed to produce unique names, not using.'
            
    if names and len(names) != len(uniqify(names)):
        print 'Names are not unique, reverting to default naming scheme.'
        names = None


    return [utils.fromarrays(columns, type=np.ndarray, dtype=dtype, 
                             shape=shape, formats=formats, names=names, 
                             titles=titles, aligned=aligned, 
                             byteorder=byteorder), metadata]