

"""simple docstring"""




import socket
def   lowerCAmelCase						(					):
 '''simple docstring'''





 UpperCAmelCase__					:  Dict					   =					socket.socket(socket.AF_INET							,    socket.SOCK_STREAM      )
 UpperCAmelCase__					:  Any					   =					socket.gethostname()
 UpperCAmelCase__					:  List[Any]					   =					12312

 sock.connect((host, port)      )
 sock.send(B"""Hello server!"""      )

 with open("""Received_file"""							,    """wb"""      ) as out_file:
  print("""File opened"""      )
  print("""Receiving data..."""      )
  while True:
   UpperCAmelCase__					:  Optional[int]					   =					sock.recv(1024      )
   if not data:
    break
   out_file.write(__UpperCamelCase      )

 print("""Successfully received the file"""      )
 sock.close()
 print("""Connection closed"""      )


if __name__ == "__main__":
      main()








"""simple docstring"""




def   lowerCAmelCase						(					__UpperCamelCase      ):
 '''simple docstring'''





 UpperCAmelCase__					:  str					   =					[]
 if len(__UpperCamelCase      ) == 1:
  return [nums.copy()]
 for _ in range(len(__UpperCamelCase      )      ):
  UpperCAmelCase__					:  Tuple					   =					nums.pop(0      )
  UpperCAmelCase__					:  List[str]					   =					permute(__UpperCamelCase      )
  for perm in permutations:
   perm.append(__UpperCamelCase      )
  result.extend(__UpperCamelCase      )
  nums.append(__UpperCamelCase      )
 return result
def   lowerCAmelCase						(					__UpperCamelCase      ):
 '''simple docstring'''





 def backtrack(__UpperCamelCase      ):
  if start == len(__UpperCamelCase      ) - 1:
   output.append(nums[:]      )
  else:
   for i in range(__UpperCamelCase							,    len(__UpperCamelCase      )      ):
    UpperCAmelCase__   ,      UpperCAmelCase__					:  Union[str, Any]					   =					nums[i], nums[start]
    backtrack(start + 1      )
    UpperCAmelCase__   ,      UpperCAmelCase__					:  Union[str, Any]					   =					nums[i], nums[start]  # backtrack

 UpperCAmelCase__					:  List[str]					   =					[]
 backtrack(0      )
 return output


if __name__ == "__main__":
      import doctest

      # use res to print the data in permute2 function
      __UpperCAmelCase =				permutea([1, 2, 3])
      print(res)
      doctest.testmod()





