true: return full data for all attachments; false: return no data for all attachments; integer: return data for attachments <= than this; string: save as file to this directory
162613
function Analyze() {
		$info = &$this->getid3->info;

		// http://flac.sourceforge.net/format.html

		$this->fseek($info['avdataoffset'], SEEK_SET);
		$StreamMarker = $this->fread(4);
		$magic = 'fLaC';
		if ($StreamMarker != $magic) {
			$info['error'][] = 'Expecting "'.getid3_lib::PrintHexBytes($magic).'" at offset '.$info['avdataoffset'].', found "'.getid3_lib::PrintHexBytes($StreamMarker).'"';
			return false;
		}
		$info['fileformat']            = 'flac';
		$info['audio']['dataformat']   = 'flac';
		$info['audio']['bitrate_mode'] = 'vbr';
		$info['audio']['lossless']     = true;

		return $this->FLACparseMETAdata();
	}
790318
def full(self, external=False):
        ''''''
        return self.fs.url(self.filename, external=external) if self.filename else None
861810
def _2(self):
        """"""
        boundary = self.boundary
        buf = StringIO()
        for (key, value) in self.form_fields:
            buf.write('--%s\r\n' % boundary)
            buf.write('Content-Disposition: form-data; name="%s"' % key)
            buf.write('\r\n\r\n%s\r\n' % value)
        for (key, filename, mimetype, filepath) in self.files:
            if os.path.isfile(filepath):
                buf.write('--{boundary}\r\n'
                          'Content-Disposition: form-data; name="{key}"; '
                          'filename="{filename}"\r\n'
                          'Content-Type: {content_type}\r\n\r\n'.format(
                              boundary=boundary,
                              key=key,
                              filename=filename,
                              content_type=mimetype))
                with open(filepath, "rb") as f:
                    shutil.copyfileobj(f, buf)
                buf.write('\r\n')
        buf.write('--' + boundary + '--\r\n\r\n')
        buf = buf.getvalue()
        self.form_data = buf
1171889
def files(self, ftype=None):
        
        a = [self.join(i) for i in self]
        if ftype is not None:
            return [i for i in a if i.isfile() and i.filetype() == ftype]
        return [i for i in a if i.isfile()]
1076726
def attachable(options = {})
      # Store the default prefix for file data
      # Defaults to "file"
      cattr_accessor :attachment_file_prefix
      self.attachment_file_prefix = (options[:file_prefix] || :file).to_s
      
      # Setup the default scope so the file data isn't included by default.
      # Generate the default scope, which includes every column except for the data column.
      # We use this so queries, by default, don't include the file data which could be quite large.
      default_scope { select(column_names.reject { |n| n == "#{attachment_file_prefix}_data" }.collect {|n| "#{table_name}.#{n}" }.join(',')) }
      
      # Include all the important stuff
      include InstanceMethods
    end
1028030
def to_api_data(self):
        
        return [attachment.to_api_data() for attachment in self.__attachments if
                attachment.on_cloud is False]
638342
def _get_member_file_data(member_data, id_filename=False):
        
        file_data = {}
        for datafile in member_data['data']:
            if id_filename:
                basename = '{}.{}'.format(datafile['id'], datafile['basename'])
            else:
                basename = datafile['basename']
            if (basename not in file_data or
                    arrow.get(datafile['created']) >
                    arrow.get(file_data[basename]['created'])):
                file_data[basename] = datafile
        return file_data
1142660
def full_data(self):
        
        data = [
            self.chat.title,
            self._username(),
            self._type(),
            self._id()
        ]
        return " ".join(filter(None, data))
601281
static boolean downloadAllData() {
        String data;
        try {
            data = export().get();
        } catch (InterruptedException ex) {
            Log.e(WonderPush.TAG, "Unexpected error while exporting data", ex);
            return false;
        } catch (ExecutionException ex) {
            Log.e(WonderPush.TAG, "Unexpected error while exporting data", ex);
            return false;
        }

        try {
            SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'", Locale.US);
            sdf.setTimeZone(TimeZone.getTimeZone("UTC"));
            File folder = new File(WonderPush.getApplicationContext().getFilesDir(), "exports");
            folder.mkdirs();
            String fn = "wonderpush-android-dataexport-" + sdf.format(new Date()) + ".json";
            File f = new File(folder, fn);
            OutputStream os = new FileOutputStream(f);
            os.write(data.getBytes());
            os.close();

            File fz = new File(folder, fn + ".zip");
            ZipOutputStream osz = new ZipOutputStream(new FileOutputStream(fz));
            osz.putNextEntry(new ZipEntry(fn));
            osz.write(data.getBytes());
            osz.closeEntry();
            osz.finish();
            osz.close();

            Uri uri = FileProvider.getUriForFile(WonderPush.getApplicationContext(), WonderPush.getApplicationContext().getPackageName() + ".wonderpush.fileprovider", fz);
            Intent sendIntent = new Intent();
            sendIntent.setAction(Intent.ACTION_SEND);
            sendIntent.putExtra(Intent.EXTRA_STREAM, uri);
            sendIntent.setType("application/zip");
            sendIntent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
            WonderPush.getApplicationContext().startActivity(Intent.createChooser(sendIntent, WonderPush.getApplicationContext().getResources().getText(R.string.wonderpush_export_data_chooser)));
            return true;
        } catch (Exception ex) {
            Log.e(WonderPush.TAG, "Unexpected error while exporting data", ex);
            return false;
        }
    }
215614
boolean isMultiPartFormData() {
		for(HttpParameter parameter : parameters) {
			if(parameter.getType() == Type.FILE) {
				return true;
			}
		}
		return false;
	}
551923
def content(self):
        
        raw_content = self._manager.api.session.get(self.download_link).content
        data = BytesIO(raw_content)
        archive = ZipFile(data)
        filename = archive.filelist[0]  # Always 1 file in the archive
        return archive.read(filename)
263725
function(obj) {
    //todo: support file type (useful?)
    var result = {};
    result.boundry = '-------------------------------'+Math.floor(Math.random()*1000000000);
    var lines = [];
    for(var p in obj){
        if (obj.hasOwnProperty(p)) {
            lines.push(
                '--'+result.boundry+"\n"+
                'Content-Disposition: form-data; name="'+p+'"'+"\n"+
                "\n"+
                obj[p]+"\n"
            );
        }
    }
    lines.push( '--'+result.boundry+'--' );
    result.body = lines.join('');
    result.length = result.body.length;
    result.type = 'multipart/form-data; boundary='+result.boundry;
    return result;
  }
760056
function(data) {
    for (var n in data) {
      if (data[n] instanceof Blob) {
        return true;
      }
      if ((angular.isObject(data[n]) || angular.isArray(data[n])) && hasFile(data[n])) {
        return true;
      }
    }
    return false;
  }
28254
private boolean parseAttachmentsArray(String messageString) throws JSONException {
		JSONObject root = new JSONObject(messageString);
		if (!root.isNull(KEY_ATTACHMENTS)) {
			JSONArray items = root.getJSONArray(KEY_ATTACHMENTS);
			remoteAttachmentStoredFiles = new ArrayList<StoredFile>();
			for (int i = 0; i < items.length(); i++) {
				String json = items.getJSONObject(i).toString();
				JSONObject attachment = new JSONObject(json);
				String mimeType = attachment.optString("content_type");
				StoredFile storedFile = new StoredFile();
				storedFile.setId(getNonce());
				storedFile.setApptentiveUri(attachment.optString("url"));
				storedFile.setSourceUriOrPath(attachment.optString("thumbnail_url"));
				storedFile.setLocalFilePath(attachment.optString(""));
				storedFile.setMimeType(mimeType);
				storedFile.setCreationTime(0);
				remoteAttachmentStoredFiles.add(storedFile);
			}
			if (remoteAttachmentStoredFiles.size() > 0) {
				setTextOnly(false);
				return true;
			}
		}
		return false;
	}
400302
def save_as_header(self, response, **kwargs):
        
        save_as = kwargs.get('save_as', None)
        if save_as is False:
            return
        file_obj = kwargs.get('file_obj', None)
        if save_as is True or save_as is None:
            filename = os.path.basename(file_obj.path)
        else:
            filename = save_as
        response['Content-Disposition'] = smart_str(
            'attachment; filename=%s' % filename)
1107221
def filedata(self):
        """"""
        if self._filedata_api is None:
            self._filedata_api = self.get_filedata_api()
        return self._filedata_api
1180100
def acts_as_file(params = {})
      self.class_eval do
        unless method_defined?(:save_with_file)
          define_method(:save_with_file) do |*args|
            params.each do |field, filename_instance_method|
              field_name = :"@#{field}"
              filename = filename_instance_method.bind(self).call
              content  = self.instance_variable_get(field_name)
              if filename and content
                dirname = File.dirname(filename)
                FileUtils.mkdir_p(dirname) unless Dir.exist?(dirname)
                File.open(filename, 'w') do |f|
                  f.flock(File::LOCK_EX) # inter-process locking
                  f.sync = true
                  f.write(content)
                  f.flush
                end
              end
            end
            save_without_file(*args)
          end
          define_method(:save) {|*args| } unless method_defined?(:save)
          alias_method :save_without_file, :save
          alias_method :save, :save_with_file

          params.each do |field, filename_instance_method|
            field_name = :"@#{field}"
            define_method("#{field}=") do |content|
              self.instance_variable_set(field_name, content)
            end
          end

          params.each do |field, filename_instance_method|
            field_name = :"@#{field}"
            define_method(field) do |offset = nil, length = nil|
              if offset || length
                # does not cache in this way
                filename = filename_instance_method.bind(self).call
                return nil unless filename
                return nil unless File.exist?(filename)
                File.open(filename) do |file|
                  file.seek(offset) if offset
                  file.read(length)
                end
              else
                content = self.instance_variable_get(field_name)
                return content if content
                # if (self.updated_at.nil? or File.mtime(filename) > self.updated_at)
                filename = filename_instance_method.bind(self).call
                return nil unless filename
                return nil unless File.exist?(filename)
                self.instance_variable_set(field_name, File.read(filename))
              end
            end
          end

          define_method(:destroy_with_file) do
            params.each do |field, filename_instance_method|
              field_name = :"@#{field}"
              filename = filename_instance_method.bind(self).call
              File.unlink(filename) if File.exist?(filename)
            end
            destroy_without_file
          end
          define_method(:destroy) {} unless method_defined?(:destroy)
          alias_method :destroy_without_file, :destroy
          alias_method :destroy, :destroy_with_file
        end
      end
    end