nodes: 0, module; 1, function_definition; 2, function_name:get_versions; 3, parameters; 4, block; 5, identifier:cls; 6, identifier:bucket; 7, identifier:key; 8, default_parameter; 9, expression_statement; 10, expression_statement; 11, expression_statement; 12, return_statement; 13, identifier:desc; 14, True; 15, comment:"""Fetch all versions of a specific object.
  
          :param bucket: The bucket (instance or id) to get the object from.
          :param key: Key of object.
          :param desc: Sort results desc if True, asc otherwise.
          :returns: The query to execute to fetch all versions.
          """; 16, assignment; 17, assignment; 18, call; 19, identifier:filters; 20, list; 21, identifier:order; 22, conditional_expression:cls.created.desc() if desc else cls.created.asc(); 23, attribute; 24, argument_list; 25, comparison_operator:cls.bucket_id == as_bucket_id(bucket); 26, comparison_operator:cls.key == key; 27, call; 28, identifier:desc; 29, call; 30, call; 31, identifier:order_by; 32, attribute; 33, identifier:order; 34, attribute; 35, call; 36, attribute; 37, identifier:key; 38, attribute; 39, argument_list; 40, attribute; 41, argument_list; 42, attribute; 43, argument_list; 44, identifier:cls; 45, identifier:key; 46, identifier:cls; 47, identifier:bucket_id; 48, identifier:as_bucket_id; 49, argument_list; 50, identifier:cls; 51, identifier:key; 52, attribute; 53, identifier:desc; 54, attribute; 55, identifier:asc; 56, attribute; 57, identifier:filter; 58, list_splat; 59, identifier:bucket; 60, identifier:cls; 61, identifier:created; 62, identifier:cls; 63, identifier:created; 64, identifier:cls; 65, identifier:query; 66, identifier:filters
code: def get_versions(cls, bucket, key, desc=True):
          """Fetch all versions of a specific object.
  
          :param bucket: The bucket (instance or id) to get the object from.
          :param key: Key of object.
          :param desc: Sort results desc if True, asc otherwise.
          :returns: The query to execute to fetch all versions.
          """
          filters = [
              cls.bucket_id == as_bucket_id(bucket),
              cls.key == key,
          ]
  
          order = cls.created.desc() if desc else cls.created.asc()
  
          return cls.query.filter(*filters).order_by(cls.key, order)