@acquire_lock<EOL><INDENT>@sync_required<EOL>def dump_file(self, value, relativePath, name=None,<EOL>description=None, klass=None,<EOL>dump=None, pull=None,<EOL>replace=False, ACID=None, verbose=False):<DEDENT>
<EOL>if ACID is None:<EOL><INDENT>ACID = self.__ACID<EOL><DEDENT>assert isinstance(ACID, bool), "<STR_LIT>"<EOL>relativePath = os.path.normpath(relativePath)<EOL>if relativePath == '<STR_LIT:.>':<EOL><INDENT>relativePath = '<STR_LIT>'<EOL>assert name != '<STR_LIT>', "<STR_LIT>"<EOL>assert name != '<STR_LIT>', "<STR_LIT>"<EOL>assert name != '<STR_LIT>', "<STR_LIT>"<EOL><DEDENT>if name is None:<EOL><INDENT>assert len(relativePath), "<STR_LIT>"<EOL>relativePath,name = os.path.split(relativePath)<EOL><DEDENT>self.add_directory(relativePath)<EOL>realPath = os.path.join(self.__path, relativePath)<EOL>dirInfoDict, errorMessage = self.get_directory_info(relativePath)<EOL>assert dirInfoDict is not None, errorMessage<EOL>if name in dict.__getitem__(dirInfoDict, "<STR_LIT>"):<EOL><INDENT>if not replace:<EOL><INDENT>if verbose:<EOL><INDENT>warnings.warn("<STR_LIT>"%(name))<EOL><DEDENT>return<EOL><DEDENT><DEDENT>if dump is None:<EOL><INDENT>dump=DEFAULT_DUMP<EOL><DEDENT>if pull is None:<EOL><INDENT>pull=DEFAULT_PULL<EOL><DEDENT>if ACID:<EOL><INDENT>savePath = os.path.join(tempfile.gettempdir(), str(uuid.uuid1()))<EOL><DEDENT>else:<EOL><INDENT>savePath = os.path.join(realPath,name)<EOL><DEDENT>try:<EOL><INDENT>exec( dump.replace("<STR_LIT>", str(savePath)) )<EOL><DEDENT>except Exception as e:<EOL><INDENT>message = "<STR_LIT>"%e<EOL>if '<STR_LIT>' in dump:<EOL><INDENT>message += '<STR_LIT>'%str(get_pickling_errors(value))<EOL><DEDENT>raise Exception( message )<EOL><DEDENT>if ACID:<EOL><INDENT>try:<EOL><INDENT>shutil.copyfile(savePath, os.path.join(realPath,name))<EOL><DEDENT>except Exception as e:<EOL><INDENT>os.remove(savePath)<EOL>if verbose:<EOL><INDENT>warnings.warn(e)<EOL><DEDENT>return<EOL><DEDENT>os.remove(savePath)<EOL><DEDENT>if klass is None and value is not None:<EOL><INDENT>klass = value.__class__<EOL><DEDENT>if klass is not None:<EOL><INDENT>assert inspect.isclass(klass), "<STR_LIT>"<EOL><DEDENT>dict.__getitem__(dirInfoDict, "<STR_LIT>")[name] = {"<STR_LIT>":dump,<EOL>"<STR_LIT>":pull,<EOL>"<STR_LIT>":datetime.utcnow(),<EOL>"<STR_LIT:id>":str(uuid.uuid1()),<EOL>"<STR_LIT:class>": klass,<EOL>"<STR_LIT:description>":description}<EOL>self.save()<EOL>
Dump a file using its value to the system and creates its
attribute in the Repository with utc timestamp.

:Parameters:
    #. value (object): The value of a file to dump and add to the repository. It is any python object or file.
    #. relativePath (str): The relative to the repository path of the directory where the file should be dumped.
       If relativePath does not exist, it will be created automatically.
    #. name (string): The file name.
       If None is given, name will be split from relativePath.
    #. description (None, string, pickable object): Any random description about the file.
    #. klass (None, class): The dumped object class. If None is given
       klass will be automatically set to the following value.__class__
    #. dump (None, string): The dumping method.
       If None it will be set automatically to pickle and therefore the object must be pickleable.
       If a string is given, the string should include all the necessary imports
       and a '$FILE_PATH' that replaces the absolute file path when the dumping will be performed.\n
       e.g. "import numpy as np; np.savetxt(fname='$FILE_PATH', X=value, fmt='%.6e')"
    #. pull (None, string): The pulling method.
       If None it will be set automatically to pickle and therefore the object must be pickleable.
       If a string is given, the string should include all the necessary imports,
       a '$FILE_PATH' that replaces the absolute file path when the dumping will be performed
       and finally a PULLED_DATA variable.\n
       e.g "import numpy as np; PULLED_DATA=np.loadtxt(fname='$FILE_PATH')"
    #. replace (boolean): Whether to replace any existing file with the same name if existing.
    #. ACID (None, boolean): Whether to ensure the ACID (Atomicity, Consistency, Isolation, Durability)
       properties of the repository upon dumping a file. This is ensured by dumping the file in
       a temporary path first and then moving it to the desired path.
       If None is given, repository ACID property will be used.
    #. verbose (boolean): Whether to be warn and informed about any abnormalities.