Saves user avatar picture to file.

        :Parameters:
          Filename : str
            Destination path.
          AvatarId : int
            Avatar Id
337275
def SaveAvatarToFile(self, Filename, AvatarId=1):
        
        s = 'AVATAR %s %s' % (AvatarId, path2unicode(Filename))
        self._Skype._DoCommand('GET %s' % s, s)
1282014
def save_as(self, filename):
        
        with open(filename, 'w+b') as f:
            for chunk in self._download():
                f.write(chunk)
425768
def save_feature(self, cat, img, feature, data):
        """"""
        filename = self.path(cat, img, feature)
        mkdir(filename)
        savemat(filename, {'output':data})
605107
def save(self, fname: str):
        
        mx.nd.save(fname, self.source + self.target + self.label)
405816
def set_user_avatar(self, username, avatar):
        
        self._set_avatar(
            {'username': username}, self._get_url('user/avatar'), avatar)
549897
def save_file(self, data, filename, size=None, thumbnail_size=None):
        
        max_size = size or self.max_size
        thumbnail_size = thumbnail_size or self.thumbnail_size
        if data and isinstance(data, FileStorage):
            try:
                self.image = Image.open(data)
            except Exception as e:
                raise ValidationError("Invalid image: %s" % e)

        path = self.get_path(filename)
        # If Path does not exist, create it
        if not op.exists(op.dirname(path)):
            os.makedirs(os.path.dirname(path), self.permission)

        # Figure out format
        filename, format = self.get_save_format(filename, self.image)
        if self.image and (self.image.format != format or max_size):
            if max_size:
                image = self.resize(self.image, max_size)
            else:
                image = self.image
            self.save_image(image, self.get_path(filename), format)
        else:
            data.seek(0)
            data.save(path)
        self.save_thumbnail(data, filename, format, thumbnail_size)

        return filename
1165590
def savefig(viz, name, gallery=GALLERY):
    
    if not path.exists(gallery):
        os.makedirs(gallery)

    # Must save as png
    if len(name.split(".")) > 1:
        raise ValueError("name should not specify extension")

    outpath = path.join(gallery, name+".png")
    viz.poof(outpath=outpath)
    print("created {}".format(outpath))
628055
def save(self, path):
        
        (folder, filename) = os.path.split(path)
        (name, extension) = os.path.splitext(filename)

        if not name:
            raise ValueError, "name is required"

        if extension:
            format = Image.image_format(extension)
        else:
            format = self.format
            filename = name + self.extension
            path = os.path.join(folder, filename)

        image = self.convert(format)
        if image._contents:
            f = open(path, "wb")
            f.write(image._contents)
            f.close()
        else:
            image.pil_image.save(path, format)

        return path
1161846
def save_avatar(strategy, details, user=None, *args, **kwargs):
    """"""
    if user:
        backend_name = kwargs['backend'].__class__.__name__.lower()
        response = kwargs.get('response', {})
        social_thumb = None
        if 'facebook' in backend_name:
            if 'id' in response:
                social_thumb = (
                    'http://graph.facebook.com/{0}/picture?type=normal'
                ).format(response['id'])
        elif 'twitter' in backend_name and response.get('profile_image_url'):
            social_thumb = response['profile_image_url']
        elif 'googleoauth2' in backend_name and response.get('image', {}).get('url'):
            social_thumb = response['image']['url'].split('?')[0]
        else:
            social_thumb = 'http://www.gravatar.com/avatar/'
            social_thumb += hashlib.md5(user.email.lower().encode('utf8')).hexdigest()
            social_thumb += '?size=100'
        if social_thumb and user.social_thumb != social_thumb:
            user.social_thumb = social_thumb
            strategy.storage.user.changed(user)
398819
def save(self, filename=None):
        
        filename = filename or self._filename
        o = open(filename, 'w')
        o.write(self.write())
        o.close()
701249
def save(self, filename, image_format="eps", width=8, height=6):
        
        self.get_plot(width, height).savefig(filename, format=image_format)
107815
def save_plain_image_as_file(self, filepath, format='png', quality=90):
        
        pixbuf = self.get_plain_image_as_pixbuf()
        options = {}
        if format == 'jpeg':
            options['quality'] = str(quality)
        pixbuf.save(filepath, format, options)
1260245
def store_to_file(self, filename):
    
    with tf.gfile.Open(filename, "w") as f:
      for i in range(len(self._id_to_token)):
        f.write(self._id_to_token[i] + "\n")
1076267
def generate(self, text):
        
        sizes = current_app.config['AVATARS_SIZE_TUPLE']
        path = current_app.config['AVATARS_SAVE_PATH']
        suffix = {sizes[0]: 's', sizes[1]: 'm', sizes[2]: 'l'}

        for size in sizes:
            image_byte_array = self.get_image(
                string=str(text),
                width=int(size),
                height=int(size),
                pad=int(size * 0.1))
            self.save(image_byte_array, save_location=os.path.join(path, '%s_%s.png' % (text, suffix[size])))
        return [text + '_s.png', text + '_m.png', text + '_l.png']
402505
def save(self, filename):
        

        if filename is None:
            filename = self.filename('.b26s')
        # if len(filename.split('\\\\?\\')) == 1:
        #     filename = '\\\\?\\' + filename
        with open(filename, 'w') as outfile:
            outfile.write(pickle.dumps(self.__dict__))
1296382
def save(self, filename):
		'''  '''

		import json
		f = open(filename, 'w')
		json.dump(self.settings, f, indent = 4)
		f.close()
126227
def save_profile_id(self, profile: Profile):
        
        os.makedirs(self.dirname_pattern.format(profile=profile.username,
                                                target=profile.username), exist_ok=True)
        with open(self._get_id_filename(profile.username), 'w') as text_file:
            text_file.write(str(profile.userid) + "\n")
            self.context.log("Stored ID {0} for profile {1}.".format(profile.userid, profile.username))