<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def is_valid_uniprot_id(instring):
 """Check if a string is a valid UniProt ID. See regex from: http://www.uniprot.org/help/accession_numbers Args: instring: any string identifier Returns: True if the string is a valid UniProt ID """

    valid_id = re.compile("[OPQ][0-9][A-Z0-9]{3}[0-9]|[A-NR-Z][0-9]([A-Z][A-Z0-9]{2}[0-9]){1,2}")
    if valid_id.match(str(instring)):
        return True
    else:
        return False