<commit_before># Standard library imports.
import sys

# Enthought library imports.
from pyface.tasks.i_editor_area_pane import IEditorAreaPane, \
    MEditorAreaPane
from traits.api import implements, on_trait_change, Instance, Tuple, Callable, \
    Property, Dict, Str, List, HasTraits, cached_property
from pyface.qt import QtCore, QtGui
from pyface.action.api import Action, Group
from pyface.tasks.task_layout import PaneItem, Tabbed, Splitter
from traitsui.api import Menu
from traitsui.mimedata import PyMimeData
from pyface.api import FileDialog
from pyface.constant import OK, CANCEL
from pyface.i_drop_handler import IDropHandler

# Local imports.
from task_pane import TaskPane

###############################################################################
# 'AdvancedEditorAreaPane' class.
###############################################################################

class AdvancedEditorAreaPane(TaskPane, MEditorAreaPane):
    """ The toolkit-specific implementation of an AdvancedEditorAreaPane.

    See the IEditorAreaPane interface for API documentation.
    """

    implements(IEditorAreaPane)

    #### AdvancedEditorAreaPane interface #####################################

    # Currently active tabwidget
    active_tabwidget = Instance(QtGui.QTabWidget)

    # list of installed drop handlers
    drop_handlers = List(IDropHandler)

    # Additional callback functions. Two useful callbacks that can be included:
    #  'new': new file action (takes no argument)
    #  'open': open file action (takes file_path as single argument)
    # They are used to create shortcut buttons for these actions in the empty 
    # pane that gets created when the user makes a split
    callbacks = Dict(key=Str, value=Callable)

    # The constructor of the empty widget which comes up when one creates a split
    create_empty_widget = Callable

    #### Private interface ###################################################

    _pvt_drop_handlers = List(IDropHandler)
    _all_drop_handlers = Property(List(IDropHandler), 
                                depends_on=['drop_handlers', '_pvt_drop_handlers'])

    def __pvt_drop_handlers_default(self):
        """ By default, two private drop handlers are installed: 

            1. For dropping of tabs from one pane to other
            2. For dropping of supported files from file-browser pane or outside
            the application
        """
        return [TabDropHandler(), 
                FileDropHandler(extensions=self.file_drop_extensions)]

    @cached_property
    def _get__all_drop_handlers(self):
        return self.drop_handlers + self._pvt_drop_handlers

    def _create_empty_widget_default(self):
        return lambda : self.active_tabwidget.create_empty_widget()

    ###########################################################################
    # 'TaskPane' interface.<commit_msg>BF: setup default empty callbacks dict<commit_after># Standard library imports.
import sys

# Enthought library imports.
from pyface.tasks.i_editor_area_pane import IEditorAreaPane, \
    MEditorAreaPane
from traits.api import implements, on_trait_change, Instance, Tuple, Callable, \
    Property, Dict, Str, List, HasTraits, cached_property
from pyface.qt import QtCore, QtGui
from pyface.action.api import Action, Group
from pyface.tasks.task_layout import PaneItem, Tabbed, Splitter
from traitsui.api import Menu
from traitsui.mimedata import PyMimeData
from pyface.api import FileDialog
from pyface.constant import OK, CANCEL
from pyface.i_drop_handler import IDropHandler

# Local imports.
from task_pane import TaskPane

###############################################################################
# 'AdvancedEditorAreaPane' class.
###############################################################################

class AdvancedEditorAreaPane(TaskPane, MEditorAreaPane):
    """ The toolkit-specific implementation of an AdvancedEditorAreaPane.

    See the IEditorAreaPane interface for API documentation.
    """

    implements(IEditorAreaPane)

    #### AdvancedEditorAreaPane interface #####################################

    # Currently active tabwidget
    active_tabwidget = Instance(QtGui.QTabWidget)

    # list of installed drop handlers
    drop_handlers = List(IDropHandler)

    # Additional callback functions. Two useful callbacks that can be included:
    #  'new': new file action (takes no argument)
    #  'open': open file action (takes file_path as single argument)
    # They are used to create shortcut buttons for these actions in the empty 
    # pane that gets created when the user makes a split
    callbacks = Dict({}, key=Str, value=Callable)

    # The constructor of the empty widget which comes up when one creates a split
    create_empty_widget = Callable

    #### Private interface ###################################################

    _pvt_drop_handlers = List(IDropHandler)
    _all_drop_handlers = Property(List(IDropHandler), 
                                depends_on=['drop_handlers', '_pvt_drop_handlers'])

    def __pvt_drop_handlers_default(self):
        """ By default, two private drop handlers are installed: 

            1. For dropping of tabs from one pane to other
            2. For dropping of supported files from file-browser pane or outside
            the application
        """
        return [TabDropHandler(), 
                FileDropHandler(extensions=self.file_drop_extensions)]

    @cached_property
    def _get__all_drop_handlers(self):
        return self.drop_handlers + self._pvt_drop_handlers

    def _create_empty_widget_default(self):
        return lambda : self.active_tabwidget.create_empty_widget()

    ###########################################################################
    # 'TaskPane' interface.
{'fraction_non_alphanumeric': 0.16698357821953327, 'fraction_numerical': 0.0006914433880726015, 'mean_word_length': 4.189237668161435, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, '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': '2883515', 'n_tokens_mistral': 1504, 'n_tokens_neox': 1439, 'n_words': 463}