class_docstr: PaddleHub server
class_docstr_tok: ["PaddleHub","server"]
code: def _generate_source(self, url: str, source_type: str = "git"):
      if source_type == "server":
          source = ServerSource(url)
      elif source_type == "git":
          source = GitSource(url)
      else:
          raise ValueError(
              "Unknown source type {}.".format(source_type)
          )
      return source
  
imports: import json
  import os
  import requests
  import threading
  import time
  import yaml
  from collections import OrderedDict
  from typing import List
  import paddle
  import paddlehub
  import paddlehub.config
  from paddlehub.config import cache_config
  from paddlehub.server import ServerSource, GitSource
  from paddlehub.utils import utils
label_desc: Use image node_id 2 for calling the HubServer obj's underlying member method code with example usage: obj._generate_source(url, source_type) and returns: source