(self, train_dsl, cpn)
return res
@param train_dsl: dict or str
        @param cpn: list or str
def generate_dsl(self, train_dsl, cpn):
        """
        @param train_dsl: dict or str
        @param cpn: list or str
        """

        if isinstance(train_dsl, dict):
            train_dsl = json.dumps(train_dsl)

        config_data = {
            "cpn_str": cpn,
            "train_dsl": train_dsl,
            "version": "2"
        }

        res = self._post(url="job/dsl/generate", handle_result=True, json=config_data)
        if not res.get("data"):
            res["data"] = {}
        return res
def generate_dsl ( self , train_dsl , cpn ) : if isinstance ( train_dsl , dict ) : train_dsl = json . dumps ( train_dsl ) config_data = { "cpn_str" : cpn , "train_dsl" : train_dsl , "version" : "2" } res = self . _post ( url = "job/dsl/generate" , handle_result = True , json = config_data ) if not res . get ( "data" ) : res [ "data" ] = { } return res