Did I find the right examples for you? yes no

All Samples(12)  |  Call(6)  |  Derive(0)  |  Import(6)

        def genre_by_index(index):
    return MUSIC_GENRES[index] if index >= 0 and index < len(MUSIC_GENRES) else u''
        


src/h/s/hsaudiotag3k-1.1.3/hsaudiotag/mp4.py   hsaudiotag3k(Download)
 
from .util import open_if_filename, tryint
from .genres import genre_by_index
 
HEADER_SIZE = 8
            return data
        elif isinstance(data, int):
            return genre_by_index(data - 1)
        else:
            return ''

src/h/s/hsaudiotag3k-1.1.3/hsaudiotag/id3v2.py   hsaudiotag3k(Download)
 
from .util import cond, tryint, FileOrPath
from .genres import genre_by_index
 
ID_ID3 = b'ID3'
        if match:
            index = int(match.group(1))
            return genre_by_index(index)
        else:
            return genre

src/h/s/hsaudiotag3k-1.1.3/hsaudiotag/id3v1.py   hsaudiotag3k(Download)
 
from .util import FileOrPath
from .genres import genre_by_index
 
TAG_VERSION_1_0 = 1
        self.year = _arrange_id3_field(data[93:97])
        genre = data[127]
        self.genre = genre_by_index(genre)
        self.size = 128
 

src/h/s/hsaudiotag-1.1.1/hsaudiotag/mp4.py   hsaudiotag(Download)
 
from .util import open_if_filename, tryint
from .genres import genre_by_index
 
HEADER_SIZE = 8
            return data
        elif isinstance(data, int):
            return genre_by_index(data - 1)
        else:
            return u''

src/h/s/hsaudiotag-1.1.1/hsaudiotag/id3v2.py   hsaudiotag(Download)
 
from .util import cond, tryint, FileOrPath
from .genres import genre_by_index
 
ID_ID3 = 'ID3'
        if match:
            index = int(match.group(1))
            return genre_by_index(index)
        else:
            return genre

src/h/s/hsaudiotag-1.1.1/hsaudiotag/id3v1.py   hsaudiotag(Download)
 
from .util import FileOrPath
from .genres import genre_by_index
 
TAG_VERSION_1_0 = 1
        self.year = _arrange_id3_field(data[93:97])
        genre = ord(data[127])
        self.genre = genre_by_index(genre)
        self.size = 128