original_string: public function getFormat($country, $only_enabled = false)
      {
          $data = is_string($country) ? $this->get($country) : (array) $country;
  
          if (empty($data['format'])) {
              $format = $this->getDefaultFormat();
              gplcart_array_sort($format);
          } else {
              $format = $data['format'];
          }
  
          if ($only_enabled) {
              return array_filter($format, function ($item) {
                  return !empty($item['status']);
              });
          }
  
          return $format;
      }
code: public function getFormat($country, $only_enabled = false)
      {
          $data = is_string($country) ? $this->get($country) : (array) $country;
  
          if (empty($data['format'])) {
              $format = $this->getDefaultFormat();
              gplcart_array_sort($format);
          } else {
              $format = $data['format'];
          }
  
          if ($only_enabled) {
              return array_filter($format, function ($item) {
                  return !empty($item['status']);
              });
          }
  
          return $format;
      }
code_tokens: public function getFormat ( $ country , $ only_enabled = false ) { $ data = is_string ( $ country ) ? $ this -> get ( $ country ) : ( array ) $ country ; if ( empty ( $ data [ 'format' ] ) ) { $ format = $ this -> getDefaultFormat ( ) ; gplcart_array_sort ( $ format ) ; } else { $ format = $ data [ 'format' ] ; } if ( $ only_enabled ) { return array_filter ( $ format , function ( $ item ) { return ! empty ( $ item [ 'status' ] ) ; } ) ; } return $ format ; }
docstring: Returns an array of country format
  @param string|array $country
  @param bool $only_enabled
  @return array
docstring_tokens: Returns an array of country format