def ValidateSourceReference(ref):
 repo_revision = ref.split('#', 1)
 revision_id = repo_revision[(-1)]
 if (not re.match(SOURCE_REVISION_RE_STRING, revision_id)):
  raise validation.ValidationError(('Bad revision identifier: %s' % revision_id))
 if (len(repo_revision) == 2):
  uri = repo_revision[0]
  if (not re.match(SOURCE_REPO_RE_STRING, uri)):
   raise validation.ValidationError(('Bad repository URI: %s' % uri))

def ValidateSourceReference ( ref ) : repo_revision = ref . split ( '#' , 1 ) revision_id = repo_revision [ ( - 1 ) ] if ( not re . match ( SOURCE_REVISION_RE_STRING , revision_id ) ) : raise validation . ValidationError ( ( 'Bad revision identifier: %s' % revision_id ) ) if ( len ( repo_revision ) == 2 ) : uri = repo_revision [ 0 ] if ( not re . match ( SOURCE_REPO_RE_STRING , uri ) ) : raise validation . ValidationError ( ( 'Bad repository URI: %s' % uri ) )
determines if a source reference is valid .