def get_warning_for_invalid_pattern(pattern):
 if isinstance(pattern, str):
  hint = "Try removing the string '{}'. The list of urlpatterns should not have a prefix string as the first element.".format(pattern)
 elif isinstance(pattern, tuple):
  hint = 'Try using url() instead of a tuple.'
 else:
  hint = None
 return [Error('Your URL pattern {!r} is invalid. Ensure that urlpatterns is a list of url() instances.'.format(pattern), hint=hint, id='urls.E004')]

def get_warning_for_invalid_pattern ( pattern ) : if isinstance ( pattern , str ) : hint = "Try removing the string '{}'. The list of urlpatterns should not have a prefix string as the first element." . format ( pattern ) elif isinstance ( pattern , tuple ) : hint = 'Try using url() instead of a tuple.' else : hint = None return [ Error ( 'Your URL pattern {!r} is invalid. Ensure that urlpatterns is a list of url() instances.' . format ( pattern ) , hint = hint , id = 'urls.E004' ) ]
return a list containing a warning that the pattern is invalid .