"""simple docstring"""




import unittest

from knapsack import greedy_knapsack as kp
class 						__A							(			unittest.TestCase		):






     def    __A  (		self  ):
       _lowerCAmelCase						:	str        =					[10, 20, 30, 40, 50, 60]
       _lowerCAmelCase						:	Union[str, Any]        =					[2, 4, 6, 8, 10, 12]
       _lowerCAmelCase						:	Tuple        =					100
       self.assertEqual(kp.calc_profit(a__    ,					a__    ,					a__  )    ,					210  )






     def    __A  (		self  ):
       self.assertRaisesRegex(a__    ,					"""max_weight must greater than zero."""  )






     def    __A  (		self  ):
       self.assertRaisesRegex(a__    ,					"""Weight can not be negative."""  )






     def    __A  (		self  ):
       self.assertRaisesRegex(a__    ,					"""Profit can not be negative."""  )






     def    __A  (		self  ):
       self.assertRaisesRegex(a__    ,					"""max_weight must greater than zero."""  )






     def    __A  (		self  ):
       self.assertRaisesRegex(
           a__    ,					"""The length of profit and weight must be same."""  )


if __name__ == "__main__":
     unittest.main()



"""simple docstring"""




import socket





def 							SCREAMING_SNAKE_CASE					(      )	->				str:
  _lowerCAmelCase						:	Optional[int]        =					socket.socket(socket.AF_INET      ,socket.SOCK_STREAM     )
  _lowerCAmelCase						:	Optional[int]        =					socket.gethostname()
  _lowerCAmelCase						:	Tuple        =					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:
      _lowerCAmelCase						:	List[Any]        =					sock.recv(1024     )
      if not data:
        break
      out_file.write(_lowerCamelCase     )

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


if __name__ == "__main__":
     main()




