code: def _restrict_to_columns(group, columns, suffix):
      found = [
          c
          for c in group.columns
          if c in columns or c.replace(suffix, "") in columns
      ]
  
      # filter
      group = group.loc[:, found]
  
      # get rid of suffixes, if any
      group = group.rename(columns=lambda x: x.replace(suffix, ""))
  
      # put in the right order...
      group = group.loc[:, columns]
  
      return group
  
imports: import re
  import numpy
  import pytest
  import pandas.util._test_decorators
  import pandas
  from pandas import Categorical, DataFrame, Index, MultiIndex, Series, Timestamp, bdate_range, concat, merge, option_context
  import pandas._testing
label_desc: Use image node_id 3 for calling a global function with example usage: _restrict_to_columns(group, columns, suffix) and returns: group