original_string: public function customize(array $arr): array
    {
      $res = [];
      if ( isset($arr[0]) ){
        foreach ( $arr as $a ){
          if ( isset($a['id']) && $this->has($a['id']) ){
            $res[] = $a;
          }
        }
      }
      else if ( isset($arr['items']) ){
        $res = $arr;
        unset($res['items']);
        foreach ( $arr['items'] as $a ){
          if ( isset($a['id']) && $this->has($a['id']) ){
            if ( !isset($res['items']) ){
              $res['items'] = [];
            }
            $res['items'][] = $a;
          }
        }
      }
      return $res;
    }
code: public function customize(array $arr): array
    {
      $res = [];
      if ( isset($arr[0]) ){
        foreach ( $arr as $a ){
          if ( isset($a['id']) && $this->has($a['id']) ){
            $res[] = $a;
          }
        }
      }
      else if ( isset($arr['items']) ){
        $res = $arr;
        unset($res['items']);
        foreach ( $arr['items'] as $a ){
          if ( isset($a['id']) && $this->has($a['id']) ){
            if ( !isset($res['items']) ){
              $res['items'] = [];
            }
            $res['items'][] = $a;
          }
        }
      }
      return $res;
    }
code_tokens: public function customize ( array $ arr ) : array { $ res = [ ] ; if ( isset ( $ arr [ 0 ] ) ) { foreach ( $ arr as $ a ) { if ( isset ( $ a [ 'id' ] ) && $ this -> has ( $ a [ 'id' ] ) ) { $ res [ ] = $ a ; } } } else if ( isset ( $ arr [ 'items' ] ) ) { $ res = $ arr ; unset ( $ res [ 'items' ] ) ; foreach ( $ arr [ 'items' ] as $ a ) { if ( isset ( $ a [ 'id' ] ) && $ this -> has ( $ a [ 'id' ] ) ) { if ( ! isset ( $ res [ 'items' ] ) ) { $ res [ 'items' ] = [ ] ; } $ res [ 'items' ] [ ] = $ a ; } } } return $ res ; }
docstring: Adapts a given array of options' to user's permissions
  
  @param array $arr
  @return array
docstring_tokens: Adapts a given array of options to user s permissions