@click.command()<EOL>@click.option("<STR_LIT>", "<STR_LIT>", is_flag=True, help="<STR_LIT>")<EOL>@click.argument("<STR_LIT:name>")<EOL>@click.argument("<STR_LIT>", default="<STR_LIT>")<EOL>@click.option("<STR_LIT>", "<STR_LIT>", type=click.Path(exists=True))<EOL>def create(quiet, name, base_uri, symlink_path):
_validate_name(name)<EOL>admin_metadata = dtoolcore.generate_admin_metadata(name)<EOL>parsed_base_uri = dtoolcore.utils.generous_parse_uri(base_uri)<EOL>if parsed_base_uri.scheme == "<STR_LIT>":<EOL><INDENT>if symlink_path is None:<EOL><INDENT>raise click.UsageError("<STR_LIT>")  <EOL><DEDENT><DEDENT>if symlink_path:<EOL><INDENT>base_uri = dtoolcore.utils.sanitise_uri(<EOL>"<STR_LIT>" + parsed_base_uri.path<EOL>)<EOL>parsed_base_uri = dtoolcore.utils.generous_parse_uri(base_uri)<EOL><DEDENT>proto_dataset = dtoolcore.generate_proto_dataset(<EOL>admin_metadata=admin_metadata,<EOL>base_uri=dtoolcore.utils.urlunparse(parsed_base_uri),<EOL>config_path=CONFIG_PATH)<EOL>if symlink_path:<EOL><INDENT>symlink_abspath = os.path.abspath(symlink_path)<EOL>proto_dataset._storage_broker.symlink_path = symlink_abspath<EOL><DEDENT>try:<EOL><INDENT>proto_dataset.create()<EOL><DEDENT>except dtoolcore.storagebroker.StorageBrokerOSError as err:<EOL><INDENT>raise click.UsageError(str(err))<EOL><DEDENT>proto_dataset.put_readme("<STR_LIT>")<EOL>if quiet:<EOL><INDENT>click.secho(proto_dataset.uri)<EOL><DEDENT>else:<EOL><INDENT>click.secho("<STR_LIT>", nl=False, fg="<STR_LIT>")<EOL>click.secho(proto_dataset.uri)<EOL>click.secho("<STR_LIT>")<EOL>step = <NUM_LIT:1><EOL>if parsed_base_uri.scheme != "<STR_LIT>":<EOL><INDENT>click.secho("<STR_LIT>".format(step))<EOL>click.secho(<EOL>"<STR_LIT>".format(proto_dataset.uri),<EOL>fg="<STR_LIT>")<EOL>if parsed_base_uri.scheme == "<STR_LIT:file>":<EOL><INDENT>data_path = proto_dataset._storage_broker._data_abspath<EOL>click.secho("<STR_LIT>")<EOL>click.secho(<EOL>"<STR_LIT>".format(data_path),<EOL>fg="<STR_LIT>"<EOL>)<EOL><DEDENT>step = step + <NUM_LIT:1><EOL><DEDENT>click.secho("<STR_LIT>".format(step))<EOL>click.secho(<EOL>"<STR_LIT>".format(proto_dataset.uri),<EOL>fg="<STR_LIT>")<EOL>step = step + <NUM_LIT:1><EOL>click.secho(<EOL>"<STR_LIT>".format(step)<EOL>)<EOL>click.secho("<STR_LIT>".format(proto_dataset.uri), fg="<STR_LIT>")<EOL><DEDENT>
Create a proto dataset.