Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def run_batch(args, graph):
for path in args.split_seeds:
split_seeds = load_split_seeds(path)
split_result = do_split(graph=graph, split_seeds=split_seeds, agglo_id=args.agglo_id)
state = display_split_result(
graph=graph,
split_seeds=split_seeds,
image_url=args.image_url,
segmentation_url=args.segmentation_url,
**split_result)
print('<p><a href="%s">%s</a></p>' % (neuroglancer.to_url(state), path))
def save_script(script_path, keypoints):
temp_path = script_path + '.tmp'
with open(temp_path, 'w') as f:
for x in keypoints:
f.write(neuroglancer.to_url(x['state']) + '\n')
f.write(str(x['transition_duration']) + '\n')
if hasattr(os, 'replace'):
# Only available on Python3
os.replace(temp_path, script_path)
else:
# Fails on Windows if script_path already exists
os.rename(temp_path, script_path)
def print_combined_state_url(self):
print(neuroglancer.to_url(self.make_combined_state()))