import grp


def getgid(group):
    """Get gid for group
    """
    if type(group) is str:
        gid = grp.getgrnam(group).gr_gid
        return gid
    elif type(group) is int:
        gid = grp.getgrgid(group).gr_gid
        return gid