def METHOD_NAME(layout_block, sectionName, sectionUserName):
    def getBlockEntryPointsList(b, entryPointList) :
        list = java.util.ArrayList();
        for i in range( 0, entryPointList.size()) :
            ep = entryPointList.get(i)
            if (ep.getBlock() == b) :
                list.add(ep)
        return list
    SectionManager = jmri.InstanceManager.getDefault(jmri.SectionManager)
    sb = layout_block.getBlock()
    section = SectionManager.createNewSection(sectionName, sectionUserName)
    section.addBlock(sb)
    entryPointList = java.util.ArrayList()
    paths= sb.getPaths()
    for j in range(0, paths.size()):
        p = paths.get(j)
        if p.getBlock() != sb:
            #this is path to an outside block, so need an Entry Point
            pbDir = jmri.Path.decodeDirection(p.getFromBlockDirection())
            # ep = getEntryPointInList(oldList, sb, p.getBlock(), pbDir)
            # if (ep == None) :
            ep = jmri.EntryPoint(sb, p.getBlock(), pbDir)
            entryPointList.add(ep)
    beginBlock = sb
    # Set directions where possible
    epList = getBlockEntryPointsList(beginBlock,entryPointList)
    #print epList
    if ((epList.size() == 2)):
        log.debug('Block {} has {} entry pts, directions auto-set.'.format(layout_block.getUserName(), epList.size()))
        if (((epList.get(0)).isUnknownType()) \
                and ((epList.get(1)).isUnknownType())) :
            (epList.get(0)).setTypeForward()
            (epList.get(1)).setTypeReverse()
    elif (epList.size() == 1) :
        log.debug('Block {} has {} entry pts, directions auto-set.'.format(layout_block.getUserName(), epList.size()))
        (epList.get(0)).setTypeForward()
    else : 
        log.warn('Block {} has {} entry pts, you must set directions manually'.format(layout_block.getUserName(), epList.size()))
        section.setComment("Need Manual EntryPoints ({})".format(epList.size()))
    for j in range(0, entryPointList.size()) :
        ep = entryPointList.get(j)
        if ep.isForwardType():
            section.addToForwardList(ep)
        elif ep.isReverseType():
            section.addToReverseList(ep)