def docker_client_version():
 ua = flask.request.headers.get('user-agent', '')
 m = _re_docker_version.search(ua)
 if (not m):
  return
 version = m.group(1)
 if ('-' in version):
  version = version.split('-')[0]
 try:
  return tuple((int(x) for x in version))
 except ValueError:
  return

def docker_client_version ( ) : ua = flask . request . headers . get ( 'user-agent' , '' ) m = _re_docker_version . search ( ua ) if ( not m ) : return version = m . group ( 1 ) if ( '-' in version ) : version = version . split ( '-' ) [ 0 ] try : return tuple ( ( int ( x ) for x in version ) ) except ValueError : return
try and extract the client version from the user-agent string so we can warn older versions of the docker engine/daemon about incompatible apis .