original_docstring: 
          Returns
          -------
          A new Segment, cropped as necessary to reach specified aspect ratio
          
docstring: Returns
  A new Segment, cropped as necessary to reach specified aspect ratio
docstring_tokens: Returns A new Segment cropped as necessary to reach specified aspect ratio
code: def crop_to_aspect_ratio(self, aspect_ratio: float) -> 'Segment':
          """
          Returns
          -------
          A new Segment, cropped as necessary to reach specified aspect ratio
          """
          segment = self.copy()
  
          if segment.aspect_ratio != aspect_ratio:
              # Crop video to match desired aspect ratio
              x1, y1, x2, y2 = v_sizing.crop_coordinates_for_aspect_ratio(segment.dimensions,
                                                                          aspect_ratio)
              segment = segment.crop(x1=x1, y1=y1, x2=x2, y2=y2)
  
          return segment
code_tokens: def crop_to_aspect_ratio ( self , aspect_ratio : float ) -> 'Segment' : segment = self . copy ( ) if segment . aspect_ratio != aspect_ratio : x1 , y1 , x2 , y2 = v_sizing . crop_coordinates_for_aspect_ratio ( segment . dimensions , aspect_ratio ) segment = segment . crop ( x1 = x1 , y1 = y1 , x2 = x2 , y2 = y2 ) return segment
short_docstring: Returns
  A new Segment, cropped as necessary to reach specified aspect ratio
short_docstring_tokens: Returns A new Segment cropped as necessary to reach specified aspect ratio
comment: """
          Returns
          -------
          A new Segment, cropped as necessary to reach specified aspect ratio
          """$SEP$# Crop video to match desired aspect ratio