code: def parse_site(sample, convention, Z):
      
      convention = str(convention)
      site = sample  # default is that site = sample
  #
  #
  # Sample is final letter on site designation eg:  TG001a (used by SIO lab
  # in San Diego)
      if convention == "1":
          return sample[:-1]  # peel off terminal character
  #
  # Site-Sample format eg:  BG94-1  (used by PGL lab in Beijing)
  #
      if convention == "2":
          parts = sample.strip('-').split('-')
          return parts[0]
  #
  # Sample is XXXX.YY where XXX is site and YY is sample
  #
      if convention == "3":
          parts = sample.split('.')
          return parts[0]
  #
  # Sample is XXXXYYY where XXX is site desgnation and YYY is Z long integer
  #
      if convention == "4":
          k = int(Z) - 1
          return sample[0:-k]  # peel off Z characters from site
  
      if convention == "5":  # sample == site
          return sample
  
      if convention == "6":  # should be names in orient.txt
          print("-W- Finding names in orient.txt is not currently supported")
  
      if convention == "7":  # peel off Z characters for site
          k = int(Z)
          return sample[0:k]
  
      if convention == "8":  # peel off Z characters for site
          return ""
  
      if convention == "9":  # peel off Z characters for site
          return sample
  
      print("Error in site parsing routine")
      return
docs: parse the site name from the sample name using the specified convention