code: def iter_sample(
      iterable: Iterable, sample_percent: float
  ) -> Iterator:
      for item in iterable:
          if len(item.reference) == 0:
              continue
          coin_flip = random.uniform(0, 1)
          if coin_flip < sample_percent:
              yield item
  
file_path: scispacy/scispacy/base_project_code.py
imports: from typing import Optional, Callable, Iterable, Iterator
  from pathlib import Path
  import random
  import itertools
  import spacy
  import warnings
  from spacy.training import Corpus, Example
  from spacy.language import Language
  from scispacy.custom_tokenizer import combined_rule_tokenizer
  from scispacy.data_util import read_full_med_mentions, read_ner_from_tsv
label_desc: Use image node_id 1 for calling a global function with example usage: iter_sample(iterable, sample_percent) without return types