def handle_start_block(self, token_text):
        self.set_mode(MODE.BlockStatement)

        empty_braces = self.is_next('}')
        empty_anonymous_function = empty_braces and self.flags.last_word == 'function' and \
            self.last_type == 'TK_END_EXPR'

        if self.opts.brace_style == 'expand':
            if self.last_type != 'TK_OPERATOR' and \
                (empty_anonymous_function or
                    self.last_type == 'TK_EQUALS' or
                    (self.is_special_word(self.flags.last_text) and self.flags.last_text != 'else')):
                self.output_space_before_token = True
            else:
                self.append_newline()
        else: # collapse
            if self.last_type not in ['TK_OPERATOR', 'TK_START_EXPR']:
                if self.last_type == 'TK_START_BLOCK':
                    self.append_newline()
                else:
                    self.output_space_before_token = True
            else:
                # if TK_OPERATOR or TK_START_EXPR
                if self.is_array(self.previous_flags.mode) and self.flags.last_text == ',':
                    if self.last_last_text == '}':
                        self.output_space_before_token = True
                    else:
                        self.append_newline()

        self.append_token(token_text)
        self.indent()
dataset/ETHPy150Open Masood-M/yalih/jsbeautifier/build/lib.linux-i686-2.7/jsbeautifier/__init__.py/Beautifier.handle_start_block/original