<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _get_bucketing_id(self, user_id, attributes):
 """ Helper method to determine bucketing ID for the user. Args: user_id: ID for user. attributes: Dict representing user attributes. May consist of bucketing ID to be used. Returns: String representing bucketing ID if it is a String type in attributes else return user ID. """


    attributes = attributes or {}
    bucketing_id = attributes.get(enums.ControlAttributes.BUCKETING_ID)

    if bucketing_id is not None:
      if isinstance(bucketing_id, string_types):
        return bucketing_id

      self.logger.warning('Bucketing ID attribute is not a string. Defaulted to user_id.')

    return user_id