original_docstring: Convert an annotation in the pdffigures format
docstring: Convert an annotation in the pdffigures format
docstring_tokens: Convert an annotation in the pdffigures format
code: def from_pf_ann(ann: dict, target_page_size: Tuple[int, int]) -> 'Figure':
          """Convert an annotation in the pdffigures format"""
          cur_page_size = ann['page_height'], ann['page_width']
          if cur_page_size[0] is None:
              cur_page_size = [
                  d * DEFAULT_INFERENCE_DPI / ann['dpi'] for d in target_page_size
              ]
          return Figure(
              figure_boundary=BoxClass.from_tuple(ann['region_bb'])
              .resize_by_page(cur_page_size, target_page_size),
              caption_boundary=BoxClass.from_tuple(ann['caption_bb'])
              .resize_by_page(cur_page_size, target_page_size),
              caption_text=ann['caption'],
              name=ann['name'],
              page=ann['page'],
              figure_type=ann['figure_type'],
              page_width=target_page_size[
                  1
              ],
              page_height=target_page_size[
                  0
              ]
          )
code_tokens: def from_pf_ann ( ann : dict , target_page_size : Tuple [ int , int ] ) -> 'Figure' : cur_page_size = ann [ 'page_height' ] , ann [ 'page_width' ] if cur_page_size [ 0 ] is None : cur_page_size = [ d * DEFAULT_INFERENCE_DPI / ann [ 'dpi' ] for d in target_page_size ] return Figure ( figure_boundary = BoxClass . from_tuple ( ann [ 'region_bb' ] ) . resize_by_page ( cur_page_size , target_page_size ) , caption_boundary = BoxClass . from_tuple ( ann [ 'caption_bb' ] ) . resize_by_page ( cur_page_size , target_page_size ) , caption_text = ann [ 'caption' ] , name = ann [ 'name' ] , page = ann [ 'page' ] , figure_type = ann [ 'figure_type' ] , page_width = target_page_size [ 1 ] , page_height = target_page_size [ 0 ] )
short_docstring: Convert an annotation in the pdffigures format
short_docstring_tokens: Convert an annotation in the pdffigures format
comment: """Convert an annotation in the pdffigures format"""