Helper that creates a NDEF record containing an mimeMediaRecord.

@mimeType String
@payload byte[]
@id byte[] (optional)
767010
function (mimeType, payload, id) {
        if (!id) { id = []; }
        return ndef.record(ndef.TNF_MIME_MEDIA, mimeType, id, payload);
    }
575653
def as_record(self, cls, content_type, strdata):
        
        self.validate_record_type(cls)
        parsedrecord = self.deserialize(content_type, strdata)
        return self.post_process_record(cls, parsedrecord)
218425
def mimeData(self, items):
        
        func = self.dataCollector()
        if func:
            return func(self, items)
        
        # extract the records from the items
        record_items = []
        for item in self.selectedItems():
            if isinstance(item, XOrbRecordItem):
                record_items.append(item)
        
        # create the mime data
        data = QMimeData()
        self.dataStoreRecords(data, record_items)
        return data
1084533
public static Object fromBytes(EntityMetadata m, MetamodelImpl metaModel, byte[] b)
    {
        Class idFieldClass = m.getIdAttribute().getJavaType();
        if (metaModel.isEmbeddable(m.getIdAttribute().getBindableJavaType()))
        {
            return fromBytes(b, String.class);
        }
        return fromBytes(b, idFieldClass);
    }
1145186
public function getStoryEmbedAction(Request $request, $databox_id, $record_id)
    {
        $record = $this->findDataboxById($databox_id)->get_record($record_id);

        $devices = $request->get('devices', []);
        $mimes = $request->get('mimes', []);

        $ret = array_values(array_filter(array_map(function ($media) use ($request, $record) {
            return $this->listEmbeddableMedia($request, $record, $media);
        }, $record->get_embedable_medias($devices, $mimes))));

        return Result::create($request, ["embed" => $ret])->createResponse();
    }
1312868
public void CreateBuffer(int nBytes, int nMaxDirectWriteBytes) {
        m_nMaxDirectWriteBytes = nMaxDirectWriteBytes;
        m_nTotal = nBytes + 1 + nMaxDirectWriteBytes;
        m_pBuffer = new byte[m_nTotal];
        byteBuffer = new ByteBuffer();
        m_nHead = 0;
        m_nTail = 0;
        m_nEndCap = m_nTotal;
    }
835271
private static Record createRecord(String data) {
        return new Record().withData(ByteBuffer.wrap(data.getBytes()));
    }
746140
function record(options) {
  return new Promise((res, rej) => {
    var micInstance = mic({
      rate: "16000",
      channels: "1",
      debug: true,
      exitOnSilence: 3,
    });

    var micInputStream = micInstance.getAudioStream();

    // Encode the file as Opus in an Ogg container, to send to server.
    var rate = 16000;
    var channels = 1;
    var opusEncodeStream = new opus.Encoder(rate, channels);
    var oggEncoder = new ogg.Encoder();

    micInputStream.pipe(opusEncodeStream).pipe(oggEncoder.stream());

    var bufs = [];

    oggEncoder.on("data", function(buffer) {
      bufs.push(buffer);
    });

    oggEncoder.on("end", function() {
      // Package up encoded recording into buffer to send
      // over the network to the API endpoint.
      var buffer = Buffer.concat(bufs);

      sendRecordingToServer(buffer, options)
        .then((results) => {
          res(results);
        })
        .catch((err) => {
          console.error("ERR", err);
          rej(err);
        });
    });

    micInputStream.on("silence", function() {
      // Stop recording at first silence after speaking.
      micInstance.stop();
    });

    micInputStream.on("error", function(err) {
      console.error("Error in Input Stream: " + err);
    });

    micInstance.start();
  });
}
593291
def record(self):
        # type: () -> bytes
        '''
        
        '''
        if not self._initialized:
            raise pycdlibexception.PyCdlibInternalError('UDF Logical Volume Integrity Descriptor not initialized')

        rec = struct.pack(self.FMT, b'\x00' * 16,
                          self.recording_date.record(), 1, 0, 0,
                          self.logical_volume_contents_use.record(), 1,
                          self.length_impl_use, self.free_space_table,
                          self.size_table,
                          self.logical_volume_impl_use.record())[16:]
        return self.desc_tag.record(rec) + rec
680954
function MediaRecorder (stream) {
  /**
   * The `MediaStream` passed into the constructor.
   * @type {MediaStream}
   */
  this.stream = stream

  /**
   * The current state of recording process.
   * @type {"inactive"|"recording"|"paused"}
   */
  this.state = 'inactive'

  this.em = document.createDocumentFragment()
  this.encoder = createWorker(MediaRecorder.encoder)

  var recorder = this
  this.encoder.addEventListener('message', function (e) {
    var event = new Event('dataavailable')
    event.data = new Blob([e.data], { type: recorder.mimeType })
    recorder.em.dispatchEvent(event)
    if (recorder.state === 'inactive') {
      recorder.em.dispatchEvent(new Event('stop'))
    }
  })
}
818830
public Base64NDArrayBody toArray(SingleCSVRecord record) throws IOException {
        List<Writable> record2 = toArrowWritablesSingle(
                toArrowColumnsStringSingle(bufferAllocator,
                        transformProcess.getInitialSchema(),record.getValues()),
                transformProcess.getInitialSchema());
        List<Writable> finalRecord = execute(Arrays.asList(record2),transformProcess).get(0);
        INDArray convert = RecordConverter.toArray(finalRecord);
        return new Base64NDArrayBody(Nd4jBase64.base64String(convert));
    }
551286
function (uri, id) {
        var payload = uriHelper.encodePayload(uri);
        if (!id) { id = []; }
        return ndef.record(ndef.TNF_WELL_KNOWN, ndef.RTD_URI, id, payload);
    }
1350047
def create_record(self, rtype=None, name=None, content=None, **kwargs):
        
        if not rtype and kwargs.get('type'):
            warnings.warn('Parameter "type" is deprecated, use "rtype" instead.',
                          DeprecationWarning)
            rtype = kwargs.get('type')

        return self._create_record(rtype, name, content)
1155410
private byte[] createCSVRecord(String[] data)
  {
    StringBuilder sb = new StringBuilder(1024);

    for (int i = 0; i < data.length; ++i)
    {
      if (i > 0)
      {
        sb.append(',');
      }
      sb.append(SnowflakeType.escapeForCSV(data[i]));
    }
    sb.append('\n');
    return sb.toString().getBytes(UTF_8);
  }
411704
def dataStoreRecords(mimeData, record_items):
        
        record_data = []
        for record_item in record_items:
            record = record_item.record()
            if record is None:
                continue
            
            repro = '%s(%s)' % (record.schema().name(), record.primaryKey())
            record_data.append(repro)
        
        if not record_data:
            return
        
        record_data = ';'.join(record_data)
        mimeData.setData('application/x-orb-records', QByteArray(record_data))
        
        # store the associated mime data for the individual record
        if len(record_items) == 1:
            for format, value in record_items[0].dragData().items():
                mimeData.setData(format, QByteArray(value))
697014
def record(self, i=0):
        """"""
        f = self.__getFileObj(self.dbf)
        if self.numRecords is None:
            self.__dbfHeader()
        i = self.__restrictIndex(i)
        recSize = self.__recStruct.size
        f.seek(0)
        f.seek(self.__dbfHdrLength + (i * recSize))
        return self.__record(oid=i)
52083
function(dataURI) {
        var binary = atob(dataURI.split(',')[1]);
        var mimeString = dataURI.split(',')[0].split(':')[1].split(';')[0];
        var array = [];

        for(var i = 0; i < binary.length; i++) {
          array.push(binary.charCodeAt(i));
        }

        return new Blob([ new Uint8Array(array) ], { type: mimeString });
      }