original_string: public function random($num = 1)
      {
          $count = \count($this->items);
          if ($num > $count) {
              $num = $count;
          }
  
          $this->items = array_intersect_key($this->items, array_flip((array)array_rand($this->items, $num)));
  
          return $this;
      }
code: public function random($num = 1)
      {
          $count = \count($this->items);
          if ($num > $count) {
              $num = $count;
          }
  
          $this->items = array_intersect_key($this->items, array_flip((array)array_rand($this->items, $num)));
  
          return $this;
      }
code_tokens: public function random ( $ num = 1 ) { $ count = \ count ( $ this -> items ) ; if ( $ num > $ count ) { $ num = $ count ; } $ this -> items = array_intersect_key ( $ this -> items , array_flip ( ( array ) array_rand ( $ this -> items , $ num ) ) ) ; return $ this ; }
docstring: Pick one or more random entries.
  
  @param int $num Specifies how many entries should be picked.
  
  @return $this
docstring_tokens: Pick one or more random entries .