code: def test_value_counts():
      # each object is considered unique
      s = GeoSeries([Point(0, 0), Point(1, 1), Point(0, 0)])
      res = s.value_counts()
      if compat.PANDAS_GE_20:
          name = "count"
      else:
          name = None
      exp = pd.Series(
          [2, 1],
          index=pd14_compat_index([Point(0, 0), Point(1, 1)]),
          name=name,
      )
      assert_series_equal(res, exp)
      # Check crs doesn't make a difference - note it is not kept in output index anyway
      s2 = GeoSeries(
          [Point(0, 0), Point(1, 1), Point(0, 0)], crs="EPSG:4326"
      )
      res2 = s2.value_counts()
      assert_series_equal(res2, exp)
      if compat.PANDAS_GE_14:
          # TODO should/ can we fix CRS being lost
          assert s2.value_counts().index.array.crs is None
  
      # check mixed geometry
      s3 = GeoSeries(
          [Point(0, 0), LineString([[1, 1], [2, 2]]), Point(0, 0)]
      )
      res3 = s3.value_counts()
      index = pd14_compat_index(
          [Point(0, 0), LineString([[1, 1], [2, 2]])]
      )
      exp3 = pd.Series([2, 1], index=index, name=name)
      assert_series_equal(res3, exp3)
  
      # check None is handled
      s4 = GeoSeries([Point(0, 0), None, Point(0, 0)])
      res4 = s4.value_counts(dropna=True)
      exp4_dropna = pd.Series(
          [2], index=pd14_compat_index([Point(0, 0)]), name=name
      )
      assert_series_equal(res4, exp4_dropna)
      exp4_keepna = pd.Series(
          [2, 1],
          index=pd14_compat_index([Point(0, 0), None]),
          name=name,
      )
      res4_keepna = s4.value_counts(dropna=False)
      assert_series_equal(res4_keepna, exp4_keepna)
  
imports: import os
  from packaging.version import Version
  import warnings
  import numpy
  from numpy.testing import assert_array_equal
  import pandas
  import shapely
  from shapely.geometry import Point, GeometryCollection, LineString, LinearRing
  import geopandas
  from geopandas import GeoDataFrame, GeoSeries
  import geopandas._compat
  from geopandas.array import from_shapely
  from geopandas.testing import assert_geodataframe_equal, assert_geoseries_equal
  from pandas.testing import assert_frame_equal, assert_series_equal
  import pytest
label_desc: Use image node_id 32 for calling a global function with example usage: test_value_counts() without return types