Module ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias Import alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias alias ImportFrom alias Import alias Import alias Import alias ImportFrom alias alias ImportFrom alias identifier Import alias FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr Str NameLoad Assign NameStore Call AttributeLoad Call AttributeLoad NameLoad attr Str Str NameLoad keyword AttributeLoad NameLoad attr attr Return Call NameLoad Call AttributeLoad NameLoad attr Str Str NameLoad keyword AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults Num body Return Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad decorator_list ClassDef bases NameLoad body Pass decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Num TryExcept body Assign NameStore Call AttributeLoad NameLoad attr Call NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad TupleLoad NameLoad NameLoad AttributeLoad NameLoad attr handlers ExceptHandler type NameLoad body Raise Call NameLoad Str Assign NameStore Call NameLoad Expr Call AttributeLoad NameLoad attr NameLoad keyword Str Return Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr NameLoad keyword NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults body Assign NameStore Call NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign NameStore Call NameLoad NameLoad NameLoad Assign NameStore Call NameLoad NameLoad Assign AttributeStore NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr Str Call NameLoad AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Str Call NameLoad AttributeLoad AttributeLoad NameLoad attr attr If NameLoad body Assign NameStore Dict Str NameLoad orelse Assign NameStore NameLoad Expr Call AttributeLoad NameLoad attr NameLoad keyword NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Assign NameStore AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Str If CompareIs NameLoad NameLoad body Assign NameStore SubscriptLoad Call NameLoad NameLoad Index Num orelse Assign NameStore BinOpAdd NameLoad Call NameLoad NameLoad Return TupleLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults NameLoad body Assign NameStore AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad Str attr ListLoad Call NameLoad IfExp CompareIsNot NameLoad NameLoad AttributeLoad NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr Call NameLoad Num Call NameLoad NameLoad Assign NameStore BinOpMod Str NameLoad Expr Call NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr Return Call AttributeLoad NameLoad attr Num Str keyword AttributeLoad NameLoad attr keyword NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad Call NameLoad NameLoad AttributeLoad NameLoad attr attr NameLoad If CompareIs NameLoad NameLoad body Return NameLoad Return AttributeLoad AttributeLoad Call NameLoad SubscriptLoad AttributeLoad NameLoad attr Index Str attr attr decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Assign NameStore SubscriptLoad Call NameLoad AttributeLoad NameLoad attr Index Num Assign NameStore AttributeLoad NameLoad attr Assign NameStore Call NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr Expr Call NameLoad NameLoad BinOpAdd NameLoad Str NameLoad NameLoad NameLoad Assign NameStore Call NameLoad NameLoad Expr Call NameLoad NameLoad NameLoad Str NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad If UnaryOpNot Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr NameLoad NameLoad Expr Call NameLoad NameLoad With Call NameLoad NameLoad Str NameStore body Expr Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults NameLoad body Assign NameStore Call AttributeLoad Str attr ListLoad Call NameLoad AttributeLoad AttributeLoad NameLoad attr attr Call NameLoad Call AttributeLoad NameLoad attr Num Num Str Call NameLoad Num Call NameLoad NameLoad Expr Call NameLoad Str NameLoad NameLoad Return BinOpAdd Str NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Assign NameStore Call NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr Expr Call NameLoad Str BinOpAdd NameLoad Str NameLoad Assign NameStore Call NameLoad NameLoad Expr Call NameLoad Str BinOpAdd NameLoad Str NameLoad decorator_list If CompareIsNot AttributeLoad NameLoad attr NameLoad body Assign NameStore NameLoad Assign NameStore NameLoad orelse Assign NameStore NameLoad Assign NameStore NameLoad FunctionDef arguments args NameParam NameParam NameParam defaults body Assign TupleStore NameStore NameStore Call NameLoad NameLoad NameLoad Return Call NameLoad NameLoad NameLoad Call AttributeLoad NameLoad attr NameLoad decorator_list
N/A __future__ absolute_import django.conf settings django.template.defaultfilters slugify django.utils.encoding force_text django.utils.safestring mark_safe N/A unicodedata zerver.lib.avatar user_avatar_hash zerver.decorator JsonableError boto.s3.key Key boto.s3.connection S3Connection mimetypes guess_type guess_extension zerver.models get_user_profile_by_id N/A base64 N/A os N/A re PIL Image ImageOps six.moves cStringIO StringIO N/A random sanitize_name N/A N/A value N/A N/A N/A 
    Sanitizes a value to be safe to store in a Linux filesystem, in
    S3, and in a URL.  So unicode is allowed, but not special
    characters other than ".", "-", and "_".

    This implementation is based on django.utils.text.slugify; it is
    modified by:
    * hardcoding allow_unicode=True.
    * adding '.' and '_' to the list of allowed characters.
    * preserving the case of the value.
     N/A value N/A force_text value N/A value N/A N/A unicodedata normalize NFKC value N/A value N/A N/A N/A N/A re sub [^\w\s._-] value flags N/A re U strip N/A N/A mark_safe N/A N/A re sub [-\s]+ - value flags N/A re U N/A random_name N/A N/A bytes N/A 60 N/A N/A N/A N/A base64 urlsafe_b64encode N/A N/A os urandom bytes N/A BadImageError N/A JsonableError N/A N/A N/A resize_avatar N/A N/A image_data N/A N/A N/A AVATAR_SIZE 100 N/A N/A N/A im N/A N/A Image open N/A StringIO image_data N/A im N/A N/A ImageOps fit im N/A AVATAR_SIZE AVATAR_SIZE N/A Image ANTIALIAS N/A N/A N/A IOError N/A N/A N/A BadImageError Could not decode avatar image; did you upload an image file? N/A out N/A StringIO N/A N/A N/A im save out format png N/A N/A N/A out getvalue N/A get_bucket N/A N/A conn bucket_name N/A N/A N/A bucket N/A N/A conn get_bucket bucket_name validate False N/A bucket N/A upload_image_to_s3 N/A N/A bucket_name file_name content_type user_profile contents N/A N/A N/A conn N/A S3Connection N/A settings S3_KEY N/A settings S3_SECRET_KEY N/A bucket N/A get_bucket conn bucket_name N/A key N/A Key bucket N/A N/A key key file_name N/A N/A N/A key set_metadata user_profile_id N/A str N/A user_profile id N/A N/A N/A key set_metadata realm_id N/A str N/A N/A user_profile realm id N/A content_type N/A N/A headers N/A Content-Type content_type N/A N/A headers None N/A N/A N/A key set_contents_from_string contents headers headers N/A get_file_info N/A N/A request user_file N/A N/A N/A uploaded_file_name N/A user_file name N/A content_type N/A N/A N/A request GET get mimetype N/A N/A content_type None N/A N/A content_type N/A N/A guess_type uploaded_file_name N/A 0 N/A N/A uploaded_file_name N/A uploaded_file_name N/A guess_extension content_type N/A N/A uploaded_file_name content_type N/A upload_message_image_s3 N/A N/A uploaded_file_name content_type file_data user_profile target_realm N/A None N/A N/A bucket_name N/A settings S3_AUTH_UPLOADS_BUCKET N/A s3_file_name N/A N/A / join N/A N/A str N/A N/A target_realm None N/A target_realm id N/A N/A user_profile realm id N/A random_name 18 N/A sanitize_name uploaded_file_name N/A url N/A /user_uploads/%s s3_file_name N/A N/A upload_image_to_s3 bucket_name s3_file_name content_type user_profile file_data N/A url N/A get_signed_upload_url N/A N/A path N/A N/A N/A conn N/A S3Connection N/A settings S3_KEY N/A settings S3_SECRET_KEY N/A N/A N/A conn generate_url 15 GET bucket N/A settings S3_AUTH_UPLOADS_BUCKET key path N/A get_realm_for_filename N/A N/A path N/A N/A N/A conn N/A S3Connection N/A settings S3_KEY N/A settings S3_SECRET_KEY N/A key N/A N/A N/A get_bucket conn N/A settings S3_AUTH_UPLOADS_BUCKET get_key path N/A N/A key None N/A N/A None N/A N/A N/A N/A get_user_profile_by_id N/A N/A key metadata N/A user_profile_id realm id N/A upload_avatar_image_s3 N/A N/A user_file user_profile email N/A N/A N/A content_type N/A N/A guess_type N/A user_file name N/A 0 N/A bucket_name N/A settings S3_AVATAR_BUCKET N/A s3_file_name N/A user_avatar_hash email N/A image_data N/A N/A user_file read N/A N/A upload_image_to_s3 bucket_name N/A s3_file_name .original content_type user_profile image_data N/A resized_data N/A resize_avatar image_data N/A N/A upload_image_to_s3 bucket_name s3_file_name image/png user_profile resized_data N/A mkdirs N/A N/A path N/A N/A N/A dirname N/A N/A N/A os path dirname path N/A N/A N/A N/A N/A os path isdir dirname N/A N/A N/A N/A os makedirs dirname N/A write_local_file N/A N/A type path file_data N/A N/A N/A file_path N/A N/A N/A os path join N/A settings LOCAL_UPLOADS_DIR type path N/A N/A mkdirs file_path N/A N/A open file_path wb f N/A N/A N/A N/A f write file_data N/A upload_message_image_local N/A N/A uploaded_file_name content_type file_data user_profile target_realm N/A None N/A N/A path N/A N/A / join N/A N/A str N/A N/A user_profile realm id N/A format N/A N/A random randint 0 255 x N/A random_name 18 N/A sanitize_name uploaded_file_name N/A N/A write_local_file files path file_data N/A N/A /user_uploads/ path N/A upload_avatar_image_local N/A N/A user_file user_profile email N/A N/A N/A email_hash N/A user_avatar_hash email N/A image_data N/A N/A user_file read N/A N/A write_local_file avatars N/A email_hash .original image_data N/A resized_data N/A resize_avatar image_data N/A N/A write_local_file avatars N/A email_hash .png resized_data N/A N/A N/A N/A settings LOCAL_UPLOADS_DIR None N/A N/A upload_message_image upload_message_image_local N/A upload_avatar_image upload_avatar_image_local N/A N/A upload_message_image upload_message_image_s3 N/A upload_avatar_image upload_avatar_image_s3 upload_message_image_through_web_client N/A N/A request user_file user_profile N/A N/A N/A N/A uploaded_file_name content_type N/A get_file_info request user_file N/A N/A upload_message_image uploaded_file_name content_type N/A N/A user_file read user_profile N/A