code: def config_copy(args):
      
      if not (args.tospace or args.toname or args.toproject or args.tonamespace):
          raise RuntimeError('A new config name OR workspace OR project OR ' +
                             'namespace must be given (or all)')
  
      copy = fapi.get_workspace_config(args.fromproject, args.fromspace,
                                              args.namespace, args.config)
      fapi._check_response_code(copy, 200)
  
      copy = copy.json()
      if not args.toname:
          args.toname = args.config
  
      if not args.tonamespace:
          args.tonamespace = args.namespace
  
      if not args.toproject:
          args.toproject = args.fromproject
  
      if not args.tospace:
          args.tospace = args.fromspace
  
      copy['name'] = args.toname
      copy['namespace'] = args.tonamespace
  
      # Instantiate the copy
      r = fapi.overwrite_workspace_config(args.toproject, args.tospace,
                                          args.tonamespace, args.toname, copy)
      fapi._check_response_code(r, 200)
  
      if fcconfig.verbosity:
          print("Method %s/%s:%s copied to %s/%s:%s" % (
                  args.fromproject, args.fromspace, args.config,
                  args.toproject, args.tospace, args.toname))
  
      return 0
docs: Copy a method config to new name/space/namespace/project (or all 4)