def _get_name(self):
if self.url.count('<STR_LIT::>') > <NUM_LIT:1>:<EOL><INDENT>base_name = self.url.split('<STR_LIT:/>', <NUM_LIT:3>)[-<NUM_LIT:1>].replace('<STR_LIT:/>', '<STR_LIT:_>')[<NUM_LIT:1>:]<EOL>if base_name.startswith('<STR_LIT::>'):<EOL><INDENT>base_name = base_name.split('<STR_LIT:_>')[-<NUM_LIT:1>]<EOL><DEDENT>base_name = re.sub('<STR_LIT>', '<STR_LIT>', base_name)<EOL>if base_name.endswith('<STR_LIT:_>'):<EOL><INDENT>base_name = base_name[:-<NUM_LIT:1>]<EOL><DEDENT>base_name = (<EOL>'<STR_LIT:_>' + self._method['<STR_LIT:name>']<EOL>).join(base_name.rsplit('<STR_LIT:_>', <NUM_LIT:1>))<EOL><DEDENT>else:<EOL><INDENT>base_name = self._method['<STR_LIT:name>']<EOL><DEDENT>if base_name == '<STR_LIT>':<EOL><INDENT>base_name = '<STR_LIT>'<EOL><DEDENT>if self._apipie_resource != self.resource:<EOL><INDENT>return '<STR_LIT>' % (self._apipie_resource, base_name)<EOL><DEDENT>else:<EOL><INDENT>return base_name<EOL><DEDENT>
There are three cases, because apipie definitions can have multiple
signatures but python does not
For example, the api endpoint:
   /api/myres/:myres_id/subres/:subres_id/subres2

for method *index* will be translated to the api method name:
    subres_index_subres2

So when you want to call it from v2 object, you'll have:

  myres.subres_index_subres2