original_docstring: Find a registration name matching data or generate a unique one.
docstring: Find a registration name matching data or generate a unique one.
docstring_tokens: Find a registration name matching data or generate a unique one .
code: def find_registration_name(self, data):
          """Find a registration name matching data or generate a unique one."""
          endpoint = data.get(ATTR_SUBSCRIPTION).get(ATTR_ENDPOINT)
          for key, registration in self.registrations.items():
              subscription = registration.get(ATTR_SUBSCRIPTION)
              if subscription.get(ATTR_ENDPOINT) == endpoint:
                  return key
          return ensure_unique_string('unnamed device', self.registrations)
code_tokens: def find_registration_name ( self , data ) : endpoint = data . get ( ATTR_SUBSCRIPTION ) . get ( ATTR_ENDPOINT ) for key , registration in self . registrations . items ( ) : subscription = registration . get ( ATTR_SUBSCRIPTION ) if subscription . get ( ATTR_ENDPOINT ) == endpoint : return key return ensure_unique_string ( 'unnamed device' , self . registrations )
short_docstring: Find a registration name matching data or generate a unique one.
short_docstring_tokens: Find a registration name matching data or generate a unique one .
comment: """Find a registration name matching data or generate a unique one."""