<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_cands_uri(field, ccd, version='p', ext='measure3.cands.astrom', prefix=None, block=None):
 """ return the nominal URI for a candidate file. @param field: the OSSOS field name @param ccd: which CCD are the candidates on @param version: either the 'p', or 's' (scrambled) candidates. @param ext: Perhaps we'll change this one day. @param prefix: if this is a 'fake' dataset then add 'fk' @param block: Which BLOCK of the field are we looking at? eg. 15BS+1+1 @return: """


    if prefix is None:
        prefix = ""
    if len(prefix) > 0:
        prefix += "_"
    if len(field) > 0:
        field += "_"

    if ext is None:
        ext = ""
    if len(ext) > 0 and ext[0] != ".":
        ext = ".{}".format(ext)

    measure3_dir = MEASURE3
    if block is not None:
        measure3_dir + "/{}".format(block)
    return "{}/{}{}{}{}{}".format(measure3_dir, prefix, field, version, ccd, ext)