(sid_string)
Translate a SID string to an account name.

    Args:
        sid_string: a SID in string form

    Returns:
        A string with the account name if the name resolves.
        None if the name is not found.
Translate a SID string to an account name.
Translate a SID string to an account name .
def TranslateSid(sid_string):
    """Translate a SID string to an account name.

    Args:
        sid_string: a SID in string form

    Returns:
        A string with the account name if the name resolves.
        None if the name is not found.
    """
    if os.name == 'nt':
        try:
            account = LookupAccountSid(None, GetBinarySid(sid_string))
        except:
            account = None

    if account:
        if len(account[1]):
            return account[1] + '\\' + account[0]
        else:
            return account[0]
def TranslateSid ( sid_string ) : if os . name == 'nt' : try : account = LookupAccountSid ( None , GetBinarySid ( sid_string ) ) except : account = None if account : if len ( account [ 1 ] ) : return account [ 1 ] + '\\' + account [ 0 ] else : return account [ 0 ]