Callable used in re.sub to match, generate and replace the
        valid syntax found in the mock response specifications.

def _replace_faker_attr(self, matchobj):
        """
        Callable used in re.sub to match, generate and replace the
        valid syntax found in the mock response specifications.
        """
        attr = matchobj.group(0).replace('<', '').replace('>', '')

        # Prepare template to handle quotes
        # For example, in situtations where the specification may
        # be "<first_name__from__users> <last_name__from__users>"
        # we want to be able to generate "John Doe" instead of "'John' 'Doe'"
        # so we create a template based on how it originally looked
        template = '{}{}{}'
        startswithquote = ''
        endswithquote = ''
        if attr.startswith('"') or attr.startswith("'"):
            startswithquote = '"'
        if attr.endswith('"') or attr.endswith("'"):
            endswithquote = '"'

        # Check if uniqueness is required
        # We will need to maintain a temporary state to keep track of values
        is_unique = False
        if attr.startswith("'^") or attr.startswith("^"):
            is_unique = True
            attr = attr[2:] if attr.startswith("'^") else attr[1:]
            temp_state = getattr(self, attr.strip("'") + '__temp_state', None)
            if temp_state is None:
                setattr(self, attr.strip("'") + '__temp_state', [])
                temp_state = []

        # 'fk' relationship fakes a 'Foreign Key' relationship but in actual
        # fact it just serves as a reference to an existing value
        if 'fk__' in attr:
            attr_map = [x.replace('"', '').replace("'", '') for x in attr.replace('fk__', '').split('.')]
            source_value = reduce(operator.getitem, attr_map, self._response_holder)
            if isinstance(source_value, str):
                return template.format(startswithquote, source_value, endswithquote)
            return source_value

        # We need to go through all the loaded fixtures to find the correct
        # values from the source file specified
        if '__from__' in attr:
            target, source = [x.replace('"', '').replace("'", '') for x in attr.split('__from__')]
            if self.parser_instance.fixture_data is not None:
                # Load up all the source values
                # e.g. for "<name__from__users>" we want to load up
                # all 'name' values retrieved from the 'users' fixture
                # into a store, essentially a list
                target_val_store = getattr(self, target + '_store', None)

                # Create a store if it doesn't exist yet
                if target_val_store is None:
                    try:
                        source_data = self.parser_instance.fixture_data[source]
                        target_val_store = []
                        if isinstance(source_data, list):
                            for data in source_data:
                                if target == 'pk':
                                    target_val_store.append(data['pk'])
                                else:
                                    for k, v in data['fields'].items():
                                        if k == target:
                                            target_val_store.append(v)
                        setattr(self, target + '_store', target_val_store)
                    except KeyError:
                        raise ValueError('Fixture %s not found' % source)

                # Store already exists, so if response is specified
                # to enforce uniqueness, we need to make use of the store to check
                # if not, we can just ignore it
                if target_val_store:
                    val = random.choice(target_val_store)
                    if is_unique:
                        while True:
                            if val not in temp_state:
                                temp_state.append(val)
                                setattr(self, attr.strip("'") + '__temp_state', temp_state)
                                break
                            if all(x in temp_state for x in target_val_store):
                                self._is_empty = True
                                break
                            val = random.choice(target_val_store)
                    if not isinstance(val, str):
                        return json.dumps(val)
                    return template.format(startswithquote, val, endswithquote)
                else:
                    return
            else:
                raise ValueError('No fixtures found')

        # If the response is not any of the special properties above
        # we will handle it below

        # Check if optional arguments are specified - syntax is <attr:min:max>
        _split = [x.replace("'", '').replace('"', '') for x in attr.split(":")]
        if len(_split) > 1:
            # Get the attr and value range (min/max)
            attr, val_range = _split[0], _split[1:]
            if len(val_range) > 1:
                minimum, maximum = val_range
            else:
                minimum, maximum = val_range[0], 0
        else:
            attr, minimum, maximum = _split[0], 0, 0

        # Min, max will be applied in a slice function if the data is a string
        attr_copy = attr  # keep a copy of original attribute
        if attr in self.PYTHON_DATATYPES:
            attr = 'py' + attr
        try:
            fake_func = getattr(fake, attr)
            fake_val = fake_func()
            fake_val = validate_fake_val(fake_val, fake_func, minimum, maximum)
        except AttributeError:
            # Check other methods
            fake_val = self.handle_other_factory_method(attr, minimum, maximum)

        if is_unique:
            while True:
                if fake_val not in temp_state:
                    break
                fake_val = fake_func()
                fake_val = validate_fake_val(fake_val, fake_func, minimum, maximum)
            temp_state.append(fake_val)
            setattr(self, attr.strip("'") + '__temp_state', temp_state)

        if attr_copy in ['int', 'float']:
            return fake_val
        return template.format(startswithquote, fake_val, endswithquote)