Sets the avatar.

@param avatar The avatar to set.
@param fileType The type of the avatar, e.g. "png" or "jpg".
@return The current instance in order to chain call methods.
552973
public WebhookBuilder setAvatar(InputStream avatar, String fileType) {
        delegate.setAvatar(avatar, fileType);
        return this;
    }
769682
def get_avatar_upload_to(self, filename):
        
        dummy, ext = os.path.splitext(filename)
        return os.path.join(
            machina_settings.PROFILE_AVATAR_UPLOAD_TO,
            '{id}{ext}'.format(id=str(uuid.uuid4()).replace('-', ''), ext=ext),
        )
1217834
def upload_custom_service_account_avatar(self, account, avatar):
        
        return self.post(
            url=
            "http://api.weixin.qq.com/customservice/kfaccount/uploadheadimg",
            params={
                "access_token": self.token,
                "kf_account": account
            },
            files={"media": avatar}
        )
1118628
public function setFileAvatar($file_avatar){
        if(!$this->setModified('file_avatar', $file_avatar)->isModified()){
            return $this;
        }
        $this->file_avatar = $file_avatar;
        return $this;
    }
76314
public AccountUpdater setAvatar(BufferedImage avatar, String fileType) {
        delegate.setAvatar(avatar, fileType);
        return this;
    }
5372
public function setImageType($type)
	{
		if ($type)
		{
			$this->image_type = $type;
		}

		if ($this->image_type == IMAGETYPE_PNG && $this->resource)
		{
			imagealphablending($this->resource, false);
			imagesavealpha($this->resource, true);
		}
	}
936463
public function setFileType($fileType)
    {
        if ($fileType == $this->fileType) return $this;
        if (!isset(self::getFileTypes()[$fileType])) {
            throw new \InvalidArgumentException(sprintf('"%s" is not a valid file type.', $fileType));
        }

        $this->fileType = $fileType;
        return $this;
    }
1087610
public function setAsset($url, $fileType)
    {
        $this->assetUrl = $url;
        $this->assetFileType = $fileType;
        return $this;
    }
910127
public MultipartBuilder type(MediaType type) {
        if (type == null) {
            throw new NullPointerException("type == null");
        }
        if (!type.type().equals("multipart")) {
            throw new IllegalArgumentException("multipart != " + type);
        }
        this.type = type;
        return this;
    }
277601
def add_avatar(self, a, b=None):
        
        if self.engine._planning:
            raise NotImplementedError("Currently can't add avatars within a plan")
        if b is None:
            if not (
                    isinstance(a, Place) or
                    isinstance(a, Thing)
            ):
                raise TypeError(
                    'when called with one argument, '
                    'it must be a place or thing'
                )
            g = a.character.name
            n = a.name
        else:
            if isinstance(a, Character):
                g = a.name
            elif not isinstance(a, str):
                raise TypeError(
                    'when called with two arguments, '
                    'the first is a character or its name'
                )
            else:
                g = a
            if isinstance(b, Place) or isinstance(b, Thing):
                n = b.name
            elif not isinstance(b, str):
                raise TypeError(
                    'when called with two arguments, '
                    'the second is a thing/place or its name'
                )
            else:
                n = b
        # This will create the node if it doesn't exist. Otherwise
        # it's redundant but harmless.
        self.engine._exist_node(g, n)
        # Declare that the node is my avatar
        branch, turn, tick = self.engine._nbtt()
        self.engine._remember_avatarness(self.name, g, n, branch=branch, turn=turn, tick=tick)
1303645
public void setIcon(final IconType iconType) {
        if (iconType != null)
            attrMixin.setAttribute(ICON, iconType.getCssName());
        else
            attrMixin.removeAttribute(ICON);
    }
957170
public void setTo( ImageType o ) {
		this.family = o.family;
		this.dataType = o.dataType;
		this.numBands = o.numBands;
	}
880941
public void setImage(final Image image) {
		LinkModel model = getOrCreateComponentModel();
		model.image = image;
		model.imageUrl = null;
	}
690508
public void setAvatar(final Link newavatar) {
        final Link old = getAvatar();
        if (old != null) {
            getOtherLinks().remove(old);
        }
        newavatar.setRel("avatar");
        getOtherLinks().add(newavatar);
    }
1052307
public void setFileTypeOrName(String type) {
        fileTypeOrName = type;
        if ((fileAsBufferedImage != null) && !ImageIO.getImageWritersByFormatName(getFileType()).hasNext()) {
            throw new IllegalArgumentException(String.format("No image writer found for format \"%s\"", getFileType()));
        }
    }
566408
public void setImage(BufferedImage image) {
		this.image = image;
		setPreferredSize(new Dimension(image.getWidth(), image.getHeight()));
		setSize(new Dimension(image.getWidth(), image.getHeight()));
		getParent().repaint(0);
	}
47295
public function setFileType(/*# string */ $fileType)
    {
        if (!Reader::isSupported($fileType)) {
            throw new InvalidArgumentException(
                Message::get(Message::CONFIG_FILE_TYPE_UNKNOWN, $fileType),
                Message::CONFIG_FILE_TYPE_UNKNOWN
            );
        }

        $this->file_type = $fileType;
        return $this;
    }