def _check_cors_origin(origin, allowed_origins):
 if isinstance(allowed_origins, list):
  if (origin in allowed_origins):
   return origin
 elif (allowed_origins == '*'):
  return allowed_origins
 elif (allowed_origins == origin):
  return allowed_origins

def _check_cors_origin ( origin , allowed_origins ) : if isinstance ( allowed_origins , list ) : if ( origin in allowed_origins ) : return origin elif ( allowed_origins == '*' ) : return allowed_origins elif ( allowed_origins == origin ) : return allowed_origins
check if an origin match cors allowed origins .