def check_for_prefix(self, bucket_name, prefix, delimiter):
prefix = prefix + delimiter if prefix[-<NUM_LIT:1>] != delimiter else prefix<EOL>prefix_split = re.split(r'<STR_LIT>'.format(d=delimiter), prefix, <NUM_LIT:1>)<EOL>previous_level = prefix_split[<NUM_LIT:0>]<EOL>plist = self.list_prefixes(bucket_name, previous_level, delimiter)<EOL>return False if plist is None else prefix in plist<EOL>
Checks that a prefix exists in a bucket

:param bucket_name: the name of the bucket
:type bucket_name: str
:param prefix: a key prefix
:type prefix: str
:param delimiter: the delimiter marks key hierarchy.
:type delimiter: str