parameters: (poly)
return_statement: return np.sum(edge) / 2.
docstring: compute area of a polygon
      :param poly:
      :return:
docstring_summary: compute area of a polygon
      :param poly:
      :return:
docstring_tokens: compute area of a polygon : param poly : : return :
function: def polygon_area(poly):
      '''
      compute area of a polygon
      :param poly:
      :return:
      '''
      poly_ = np.array(poly)
      assert poly_.shape == (4, 2), 'poly shape should be 4,2'
      edge = [
          (poly[1][0] - poly[0][0]) * (poly[1][1] + poly[0][1]),
          (poly[2][0] - poly[1][0]) * (poly[2][1] + poly[1][1]),
          (poly[3][0] - poly[2][0]) * (poly[3][1] + poly[2][1]),
          (poly[0][0] - poly[3][0]) * (poly[0][1] + poly[3][1])
      ]
      return np.sum(edge) / 2.
function_tokens: def polygon_area ( poly ) : poly_ = np . array ( poly ) assert poly_ . shape == ( 4 , 2 ) , 'poly shape should be 4,2' edge = [ ( poly [ 1 ] [ 0 ] - poly [ 0 ] [ 0 ] ) * ( poly [ 1 ] [ 1 ] + poly [ 0 ] [ 1 ] ) , ( poly [ 2 ] [ 0 ] - poly [ 1 ] [ 0 ] ) * ( poly [ 2 ] [ 1 ] + poly [ 1 ] [ 1 ] ) , ( poly [ 3 ] [ 0 ] - poly [ 2 ] [ 0 ] ) * ( poly [ 3 ] [ 1 ] + poly [ 2 ] [ 1 ] ) , ( poly [ 0 ] [ 0 ] - poly [ 3 ] [ 0 ] ) * ( poly [ 0 ] [ 1 ] + poly [ 3 ] [ 1 ] ) ] return np . sum ( edge ) / 2.