<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def set_data(self, xdata=[1,2,3,4,5], ydata=[1.7,2,3,4,3], eydata=None, **kwargs):
 """ This will handle the different types of supplied data and put everything in a standard format for processing. Parameters xdata, ydata These can be a single array of data or a list of data arrays. eydata=None Error bars for ydata. These can be None (for guessed error) or data / numbers matching the dimensionality of xdata and ydata Notes ----- xdata, ydata, and eydata can all be scripts or lists of scripts that produce arrays. Any python code will work, and the scripts automatically know about all numpy functions, the guessed parameters, and the data itself (as x, y, ey). However, the scripts are executed in order -- xdata, ydata, and eydata -- so the xdata script cannot know about ydata or eydata, the ydata script cannot know about eydata, and the eydata script knows about xdata and ydata. Example: xdata = [1,2,3,4,5] ydata = [[1,2,1,2,1], 'cos(x[0])'] eydata = ['arctan(y[1])*a+b', 5] In this example, there will be two data sets to fit (so there better be two functions!), they will share the same xdata, the second ydata set will be the array cos([1,2,3,4,5]) (note since there are multiple data sets assumed (always), you have to select the data set with an index on x and y), the error on the first data set will be this weird functional dependence on the second ydata set and fit parameters a and b (note, if a and b are not fit parameters, then you must send them as keyword arguments so that they are defined) and the second data set error bar will be a constant, 5. Note this function is "somewhat" smart about reshaping the input data to ease life a bit, but it can't handle ambiguities. If you want to play it safe, supply lists for all three arguments that match in dimensionality. results can be obtained by calling get_data() Additional optional keyword arguments are added to the globals for script evaluation. """

        # SET UP DATA SETS TO MATCH EACH OTHER AND NUMBER OF FUNCTIONS
        
        # At this stage:
        # xdata,  ydata   'script', [1,2,3], [[1,2,3],'script'], ['script', [1,2,3]]
        # eydata, exdata  'script', [1,1,1], [[1,1,1],'script'], ['script', [1,1,1]], 3, [3,[1,2,3]], None

        # if xdata, ydata, or eydata are bare scripts, make them into lists
        if type(xdata)  is str: xdata  = [xdata]
        if type(ydata)  is str: ydata  = [ydata]
        if type(eydata) is str or _s.fun.is_a_number(eydata) or eydata is None: eydata = [eydata]
        #if type(exdata) is str or _s.fun.is_a_number(exdata) or exdata is None: exdata = [exdata]

        # xdata and ydata   ['script'], [1,2,3], [[1,2,3],'script'], ['script', [1,2,3]]
        # eydata            ['script'], [1,1,1], [[1,1,1],'script'], ['script', [1,1,1]], [3], [3,[1,2,3]], [None]

        # if the first element of data is a number, then this is a normal array
        if _s.fun.is_a_number(xdata[0]): xdata = [xdata]
        if _s.fun.is_a_number(ydata[0]): ydata = [ydata]

        # xdata and ydata   ['script'], [[1,2,3]], [[1,2,3],'script'], ['script', [1,2,3]]
        # eydata            ['script'], [1,1,1],   [[1,1,1],'script'], ['script', [1,1,1]], [3], [3,[1,2,3]], [None]

        # if the first element of eydata is a number, this could also just be an error bar value
        # Note: there is some ambiguity here, if the number of data sets equals the number of data points!
        if _s.fun.is_a_number(eydata[0]) and len(eydata) == len(ydata[0]): eydata = [eydata]
        #if _s.fun.is_a_number(exdata[0]) and len(exdata) == len(xdata[0]): exdata = [exdata]
        
        # xdata and ydata   ['script'], [[1,2,3]], [[1,2,3],'script'], ['script', [1,2,3]]
        # eydata            ['script'], [[1,1,1]], [[1,1,1],'script'], ['script', [1,1,1]], [3], [3,[1,2,3]], [None]

        # Inflate the x, ex, and ey data sets to match the ydata sets
        while len(xdata)  < len(ydata): xdata .append( xdata[0])
        while len(ydata)  < len(xdata): ydata .append( ydata[0])
        #while len(exdata) < len(xdata): exdata.append(exdata[0])
        while len(eydata) < len(ydata): eydata.append(eydata[0])


        # make sure these lists are the same length as the number of functions
        while len(ydata)  < len(self.f): ydata.append(ydata[0])
        while len(xdata)  < len(self.f): xdata.append(xdata[0])
        while len(eydata) < len(self.f): eydata.append(eydata[0])
        #while len(exdata) < len(self.f): exdata.append(exdata[0])

        # xdata and ydata   ['script','script'], [[1,2,3],[1,2,3]], [[1,2,3],'script'], ['script', [1,2,3]]
        # eydata            ['script','script'], [[1,1,1],[1,1,1]], [[1,1,1],'script'], ['script', [1,1,1]], [3,3], [3,[1,2,3]], [None,None]

        # Clean up exdata. If any element isn't None, the other None elements need
        # to be set to 0 so that ODR works.
#        if not exdata.count(None) == len(exdata):
#            # Search for and replace all None's with 0
#            for n in range(len(exdata)):
#                if exdata[n] == None: exdata[n] = 0
#        
        
        # store the data, script, or whatever it is!
        self._set_xdata  = xdata
        self._set_ydata  = ydata
        self._set_eydata = eydata
        #self._set_exdata = exdata
        self._set_data_globals.update(kwargs)

        # set the eyscale to 1 for each data set
        self['scale_eydata'] = [1.0]*len(self._set_xdata)
        #self['scale_exdata'] = [1.0]*len(self._set_xdata)
        
        # Update the settings so they match the number of data sets.
        for k in self._settings.keys(): self[k] = self[k]
        
        # Plot if necessary
        if self['autoplot']: self.plot()
        
        return self