original_docstring: 
          Create a new network config by adding given endpoint
          Return None if failed
          :param cloud_service_name:
          :param deployment_name:
          :param virtual_machine_name:
          :param public_port:
          :param private_port:
          :return:
          
docstring: Create a new network config by adding given endpoint
  Return None if failed
docstring_tokens: Create a new network config by adding given endpoint Return None if failed
code: def __compose_network_config(self, cloud_service_name, deployment_name,
                                   virtual_machine_name, public_port, private_port):
          """
          Create a new network config by adding given endpoint
          Return None if failed
          :param cloud_service_name:
          :param deployment_name:
          :param virtual_machine_name:
          :param public_port:
          :param private_port:
          :return:
          """
          try:
              virtual_machine = self.sms.get_role(cloud_service_name, deployment_name, virtual_machine_name)
          except Exception as e:
              log.error(e)
              return None
          network = ConfigurationSet()
          network.configuration_set_type = 'NetworkConfiguration'
          for configuration_set in virtual_machine.configuration_sets.configuration_sets:
              if configuration_set.configuration_set_type == 'NetworkConfiguration':
                  if configuration_set.input_endpoints is not None:
                      for input_endpoint in configuration_set.input_endpoints.input_endpoints:
                          network.input_endpoints.input_endpoints.append(
                              ConfigurationSetInputEndpoint(input_endpoint.name,
                                                            input_endpoint.protocol,
                                                            input_endpoint.port,
                                                            input_endpoint.local_port)
                          )
                      break
          network.input_endpoints.input_endpoints.append(
              ConfigurationSetInputEndpoint('auto-' + str(public_port), 'tcp', str(public_port), str(private_port))
          )
          return network
code_tokens: def __compose_network_config ( self , cloud_service_name , deployment_name , virtual_machine_name , public_port , private_port ) : try : virtual_machine = self . sms . get_role ( cloud_service_name , deployment_name , virtual_machine_name ) except Exception as e : log . error ( e ) return None network = ConfigurationSet ( ) network . configuration_set_type = 'NetworkConfiguration' for configuration_set in virtual_machine . configuration_sets . configuration_sets : if configuration_set . configuration_set_type == 'NetworkConfiguration' : if configuration_set . input_endpoints is not None : for input_endpoint in configuration_set . input_endpoints . input_endpoints : network . input_endpoints . input_endpoints . append ( ConfigurationSetInputEndpoint ( input_endpoint . name , input_endpoint . protocol , input_endpoint . port , input_endpoint . local_port ) ) break network . input_endpoints . input_endpoints . append ( ConfigurationSetInputEndpoint ( 'auto-' + str ( public_port ) , 'tcp' , str ( public_port ) , str ( private_port ) ) ) return network
short_docstring: Create a new network config by adding given endpoint
  Return None if failed
short_docstring_tokens: Create a new network config by adding given endpoint Return None if failed
comment: """
          Create a new network config by adding given endpoint
          Return None if failed
          :param cloud_service_name:
          :param deployment_name:
          :param virtual_machine_name:
          :param public_port:
          :param private_port:
          :return:
          """