def CreateWithLock(self, urn, aff4_type, token=None, age=NEWEST_TIME,
                     ignore_cache=False, force_new_version=True,
                     blocking=True, blocking_lock_timeout=10,
                     blocking_sleep_interval=1, lease_time=100):

    transaction = self._AcquireLock(
        urn, token=token, blocking=blocking,
        blocking_lock_timeout=blocking_lock_timeout,
        blocking_sleep_interval=blocking_sleep_interval,
        lease_time=lease_time)

    # Since we now own the data store subject, we can simply create the aff4
    # object in the usual way.
    return self.Create(
        urn, aff4_type, mode="rw", ignore_cache=ignore_cache,
        token=token, age=age, force_new_version=force_new_version,
        transaction=transaction)
Creates a new object and locks it.
dataset/ETHPy150Open google/grr/grr/lib/aff4.py/Factory.CreateWithLock