<commit_before>import demistomock as demisto
from CommonServerPython import *
from typing import List, Dict, Optional
from ldap3 import Server, Connection, NTLM, SUBTREE, ALL_ATTRIBUTES, Tls, Entry
from ldap3.extend import microsoft
import ssl
from datetime import datetime
import traceback
import os
from ldap3.utils.log import (set_library_log_detail_level, get_library_log_detail_level,
                             set_library_log_hide_sensitive_data, EXTENDED)

# global connection
conn: Optional[Connection] = None

''' GLOBAL VARS '''

# userAccountControl is a bitmask used to store a number of settings.
# find more at:
# https://support.microsoft.com/en-gb/help/305144/how-to-use-the-useraccountcontrol-flags-to-manipulate-user-account-pro

COOMON_ACCOUNT_CONTROL_FLAGS = {
    512: "Enabled Account",
    514: "Disabled account",
    544: "Account Enabled - Require user to change password at first logon",
    4096: "Workstation/server",
    66048: "Enabled, password never expires",
    66050: "Disabled, password never expires",
    66080: "Enables, password never expires, password not required.",
    532480: "Domain controller"
}
NORMAL_ACCOUNT = 512
DISABLED_ACCOUNT = 514

# common attributes for specific AD objects
DEFAULT_PERSON_ATTRIBUTES = [
    'name',
    'displayName',
    'memberOf',
    'mail',
    'sAMAccountName',
    'manager',
    'userAccountControl'
]
DEFAULT_COMPUTER_ATTRIBUTES = [
    'name',
    'memberOf'
]

''' HELPER FUNCTIONS '''
<commit_msg>update account control translation<commit_after>import demistomock as demisto
from CommonServerPython import *
from typing import List, Dict, Optional
from ldap3 import Server, Connection, NTLM, SUBTREE, ALL_ATTRIBUTES, Tls, Entry
from ldap3.extend import microsoft
import ssl
from datetime import datetime
import traceback
import os
from ldap3.utils.log import (set_library_log_detail_level, get_library_log_detail_level,
                             set_library_log_hide_sensitive_data, EXTENDED)

# global connection
conn: Optional[Connection] = None

''' GLOBAL VARS '''

# userAccountControl is a bitmask used to store a number of settings.
# find more at:
# https://support.microsoft.com/en-gb/help/305144/how-to-use-the-useraccountcontrol-flags-to-manipulate-user-account-pro

COOMON_ACCOUNT_CONTROL_FLAGS = {
    512: "Enabled Account",
    514: "Disabled account",
    544: "Password Not Required",
    4096: "Workstation/server",
    66048: "Enabled, password never expires",
    66050: "Disabled, password never expires",
    66080: "Enables, password never expires, password not required.",
    532480: "Domain controller"
}
NORMAL_ACCOUNT = 512
DISABLED_ACCOUNT = 514

# common attributes for specific AD objects
DEFAULT_PERSON_ATTRIBUTES = [
    'name',
    'displayName',
    'memberOf',
    'mail',
    'sAMAccountName',
    'manager',
    'userAccountControl'
]
DEFAULT_COMPUTER_ATTRIBUTES = [
    'name',
    'memberOf'
]

''' HELPER FUNCTIONS '''

{'fraction_non_alphanumeric': 0.0924170616113744, 'fraction_numerical': 0.03317535545023697, 'mean_word_length': 4.286225402504472, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1120970', 'n_tokens_mistral': 981, 'n_tokens_neox': 909, 'n_words': 256}