Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def write(self, run):
if self.what is None:
self.what = TracedFile.WRITTEN
elif self.what == TracedFile.ONLY_READ:
self.what = TracedFile.READ_THEN_WRITTEN
if run is not None:
if self.runs[run] is None:
self.runs[run] = TracedFile.WRITTEN
elif self.runs[run] == TracedFile.ONLY_READ:
self.runs[run] = TracedFile.READ_THEN_WRITTEN
for fi in itervalues(files)
if fi.what == TracedFile.READ_THEN_WRITTEN and
not any(fi.path.lies_under(m) for m in magic_dirs)]
if read_then_written_files:
logger.warning(
"Some files were read and then written. We will only pack the "
"final version of the file; reproducible experiments shouldn't "
"change their input files")
logger.info("Paths:\n%s",
", ".join(unicode_(fi.path)
for fi in read_then_written_files))
files = set(
fi
for fi in itervalues(files)
if fi.what != TracedFile.WRITTEN and not any(fi.path.lies_under(m)
for m in magic_dirs))
return files, inputs, outputs
def write(self, run):
if self.what is None:
self.what = TracedFile.WRITTEN
elif self.what == TracedFile.ONLY_READ:
self.what = TracedFile.READ_THEN_WRITTEN
if run is not None:
if self.runs[run] is None:
self.runs[run] = TracedFile.WRITTEN
elif self.runs[run] == TracedFile.ONLY_READ:
self.runs[run] = TracedFile.READ_THEN_WRITTEN
def write(self, run):
if self.what is None:
self.what = TracedFile.WRITTEN
elif self.what == TracedFile.ONLY_READ:
self.what = TracedFile.READ_THEN_WRITTEN
if run is not None:
if self.runs[run] is None:
self.runs[run] = TracedFile.WRITTEN
elif self.runs[run] == TracedFile.ONLY_READ:
self.runs[run] = TracedFile.READ_THEN_WRITTEN