<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def generatenetwork(self, networktype, **networkparams):
 """ Generate a network Parameters networktype : str Function to call. Functions available are in teneto.generatenetwork measureparams : kwargs kwargs for teneto.generatenetwork.[networktype] Returns -------- TenetoBIDS.network is made with the generated network. """

        availabletypes = [f for f in dir(
            teneto.generatenetwork) if not f.startswith('__')]
        if networktype not in availabletypes:
            raise ValueError(
                'Unknown network measure. Available networks to generate are: ' + ', '.join(availabletypes))
        funs = inspect.getmembers(teneto.generatenetwork)
        funs = {m[0]: m[1] for m in funs if not m[0].startswith('__')}
        network = funs[networktype](**networkparams)
        self.network_from_array(network)
        if self.nettype[1] == 'u':
            self._drop_duplicate_ij()