def _section_from_spec(elf_file, spec):
    '''
        Retrieve a section given a "spec" (either number or name).
        Return None if no such section exists in the file.
    '''
    if isinstance(spec, int):
        num = int(spec)
        if num < elf_file.num_sections():
            return elf_file.get_section(num)

    # Not a number. Must be a name then
    if isinstance(spec, str):
        try:
            return elf_file.get_section_by_name(spec)
        except AttributeError:
            return None
def _section_from_spec ( elf_file , spec ) : if isinstance ( spec , int ) : num = int ( spec ) if num < elf_file . num_sections ( ) : return elf_file . get_section ( num ) if isinstance ( spec , str ) : try : return elf_file . get_section_by_name ( spec ) except AttributeError : return None
Retrieve a section given a "spec" (either number or name).
        Return None if no such section exists in the file.