def import_theme(themeId):
    try:
        url = 'http://eclipsecolorthemes.org/?view=empty&action=download&theme=%s&type=xml'
        response = urllib2.urlopen(url % themeId)
        xml = response.read()
        descr, elements = deserialize_from_eclipse_color_theme_xml(
            xml.replace('\r', '').split('\n'))
        name, author, website = descr
        elements = '\n'.join(serialize_to_lines(elements))

        if len(name) == 0:
            return -1

        try:
            theme = Theme.objects.get(name=name)
            theme.elements = elements
        except __HOLE__:
            theme = Theme(name=name,
                          author=author or 'Idea Color Themes',
                          website=website or 'http://www.ideacolorthemes.org',
                          elements=elements,
                          ect=themeId,
                          promote=False,
                          moderating=False,
                          comment="")
        theme.save()
        return theme.id
    except:
        return -1
dataset/ETHPy150Open y-a-r-g/idea-color-themes/backend/logic/themes/themes.py/import_theme