[VARIABLE "my_dataset"]
8962
public Sink updateSinkAsync(String sinkName, String datasetName)
      throws ExecutionException, InterruptedException {
    // [START updateSinkAsync]
    SinkInfo sinkInfo =
        SinkInfo.newBuilder(sinkName, DatasetDestination.of(datasetName))
            .setVersionFormat(SinkInfo.VersionFormat.V2)
            .setFilter("severity>=ERROR")
            .build();
    Future<Sink> future = logging.updateAsync(sinkInfo);
    // ...
    Sink sink = future.get();
    // [END updateSinkAsync]
    return sink;
  }
1372300
public AttributeDataset nominalDataset(String responseColName, String... variablesColNames) {
        return dataset(table.numberColumn(responseColName), AttributeType.NOMINAL, table.columns(variablesColNames));
    }
825174
def prepare_new_dataset():
    

    parser = argparse.ArgumentParser(
        description=(
            "Python client to Prepare a dataset"))
    parser.add_argument(
        "-u",
        help="username",
        required=False,
        dest="user")
    parser.add_argument(
        "-p",
        help="user password",
        required=False,
        dest="password")
    parser.add_argument(
        "-e",
        help="user email",
        required=False,
        dest="email")
    parser.add_argument(
        "-a",
        help="url endpoint with default http://localhost:8010",
        required=False,
        dest="url")
    parser.add_argument(
        "-f",
        help="file to use default ./examples/test-keras-dnn.json",
        required=False,
        dest="prepare_file")
    parser.add_argument(
        "-b",
        help=(
            "optional - path to CA bundle directory for "
            "client encryption over HTTP"),
        required=False,
        dest="ca_dir")
    parser.add_argument(
        "-c",
        help=(
            "optional - path to x509 certificate for "
            "client encryption over HTTP"),
        required=False,
        dest="cert_file")
    parser.add_argument(
        "-k",
        help=(
            "optional - path to x509 key file for "
            "client encryption over HTTP"),
        required=False,
        dest="key_file")
    parser.add_argument(
        "-s",
        help="silent",
        required=False,
        dest="silent",
        action="store_true")
    parser.add_argument(
        "-d",
        help="debug",
        required=False,
        dest="debug",
        action="store_true")
    args = parser.parse_args()

    user = ev(
        "API_USER",
        "user-not-set")
    password = ev(
        "API_PASSWORD",
        "password-not-set")
    email = ev(
        "API_EMAIL",
        "email-not-set")
    url = ev(
        "API_URL",
        "http://localhost:8010")
    prepare_file = ev(
        "DATAFILE",
        "prepare_file-not-set")
    ca_dir = os.getenv(
        "API_CA_BUNDLE_DIR",
        None)
    cert_file = os.getenv(
        "API_CERT_FILE",
        None)
    key_file = os.getenv(
        "API_KEY_FILE",
        None)
    verbose = bool(str(ev(
        "API_VERBOSE",
        "true")).lower() == "true")
    debug = bool(str(ev(
        "API_DEBUG",
        "false")).lower() == "true")

    if args.user:
        user = args.user
    if args.password:
        password = args.password
    if args.email:
        email = args.email
    if args.url:
        url = args.url
    if args.prepare_file:
        prepare_file = args.prepare_file
    if args.ca_dir:
        ca_dir = args.ca_dir
    if args.cert_file:
        cert_file = args.cert_file
    if args.key_file:
        key_file = args.key_file
    if args.silent:
        verbose = False
    if args.debug:
        debug = True

    usage = (
        "Please run with "
        "-u <username> "
        "-p <password> "
        "-a <AntiNex URL http://localhost:8010> "
        "-f <path to prepare file> "
        "-b <optional - path to CA bundle directory> "
        "-c <optional - path to x509 ssl certificate file> "
        "-k <optional - path to x509 ssl key file>")

    valid = True
    if not user or user == "user-not-set":
        log.error("missing user")
        valid = False
    if not password or password == "password-not-set":
        log.error("missing password")
        valid = False
    if not prepare_file or prepare_file == "prepare_file-not-set":
        log.error("missing prepare_file")
        valid = False
    else:
        if not os.path.exists(prepare_file):
            log.error(("did not find prepare_file={} on disk")
                      .format(
                        prepare_file))
            valid = False
    if not valid:
        log.error(usage)
        sys.exit(1)

    if verbose:
        log.info(("creating client user={} url={} file={}")
                 .format(
                    user,
                    url,
                    prepare_file))

    client = AIClient(
        user=user,
        email=email,
        password=password,
        url=url,
        ca_dir=ca_dir,
        cert_file=cert_file,
        key_file=key_file,
        verbose=verbose,
        debug=debug)

    if verbose:
        log.info(("loading request in prepare_file={}")
                 .format(
                    prepare_file))

    req_body = None
    with open(prepare_file, "r") as f:
        req_body = json.loads(f.read())

    if verbose:
        log.info("running prepare")

    prepare_was_started = False
    response = client.run_prepare(
        body=req_body)

    if response["status"] == SUCCESS:
        log.info(("prepare started with response={}")
                 .format(
                    response["data"]))
        prepare_was_started = True
    elif response["status"] == FAILED:
        log.error(("prepare failed with error='{}' with response={}")
                  .format(
                    response["error"],
                    response["data"]))
    elif response["status"] == ERROR:
        log.error(("prepare had an error='{}' with response={}")
                  .format(
                    response["error"],
                    response["data"]))
    elif response["status"] == LOGIN_FAILED:
        log.error(("prepare reported user was not able to log in "
                   "with an error='{}' with response={}")
                  .format(
                    response["error"],
                    response["data"]))

    if not prepare_was_started:
        sys.exit(1)

    if debug:
        log.info(("parsing response data={}")
                 .format(
                    response["data"]))
    else:
        if verbose:
            log.info("parsing data")

    prepare_data = response["data"]

    if not prepare_data:
        log.error(("missing prepare dictionary in response data={}")
                  .format(
                    response["data"]))
        sys.exit(1)

    prepare_id = prepare_data.get("id", None)
    prepare_status = prepare_data.get("status", None)

    log.info(("started prepare.id={} prepare.status={}")
             .format(
                prepare_id,
                prepare_status))

    prepare_results = client.wait_for_prepare_to_finish(
        prepare_id=prepare_id)

    if prepare_results["status"] != SUCCESS:
        log.error(("failed waiting for prepare.id={} to finish "
                   "error={} data={}")
                  .format(
                    prepare_id,
                    prepare_results["error"],
                    prepare_results["data"]))
        sys.exit(1)

    final_prepare = prepare_results["data"]

    log.info(("prepare={}")
             .format(
                ppj(final_prepare)))

    log.info(("prepare.id={} is done")
             .format(
                prepare_id))
834463
public void set(int i, int y) {
        if (response == null) {
            throw new IllegalArgumentException("The dataset has no response values.");            
        }
        
        if (response.getType() != Attribute.Type.NOMINAL) {
            throw new IllegalArgumentException("The response variable is not nominal.");
        }
        
        if (i < 0) {
            throw new IllegalArgumentException("Invalid index: i = " + i);
        }

        int nrows = size();
        if (i >= nrows) {
            for (int k = nrows; k <= i; k++) {
                data.add(new Datum<>(new SparseArray()));
            }
        }

        get(i).y = y;
    }
683056
@Override
    public DataSet sample(int numSamples, org.nd4j.linalg.api.rng.Random rng) {
        return sample(numSamples, rng, false);
    }
1354846
@Override
    public DataSet get(int i) {
        if (i >= numExamples() || i < 0)
            throw new IllegalArgumentException("invalid example number: must be 0 to " + (numExamples()-1) + ", got " + i);
        if (i == 0 && numExamples() == 1)
            return this;
        return new DataSet(getHelper(features,i), getHelper(labels, i), getHelper(featuresMask,i), getHelper(labelsMask,i));
    }
230433
def get_dataset(dataset_id,**kwargs):
    

    user_id = int(kwargs.get('user_id'))

    if dataset_id is None:
        return None
    try:
        dataset_rs = db.DBSession.query(Dataset.id,
                Dataset.type,
                Dataset.unit_id,
                Dataset.name,
                Dataset.hidden,
                Dataset.cr_date,
                Dataset.created_by,
                DatasetOwner.user_id,
                null().label('metadata'),
                case([(and_(Dataset.hidden=='Y', DatasetOwner.user_id is not None), None)],
                        else_=Dataset.value).label('value')).filter(
                Dataset.id==dataset_id).outerjoin(DatasetOwner,
                                    and_(DatasetOwner.dataset_id==Dataset.id,
                                    DatasetOwner.user_id==user_id)).one()

        rs_dict = dataset_rs._asdict()

        #convert the value row into a string as it is returned as a binary
        if dataset_rs.value is not None:
            rs_dict['value'] = str(dataset_rs.value)

        if dataset_rs.hidden == 'N' or (dataset_rs.hidden == 'Y' and dataset_rs.user_id is not None):
            metadata = db.DBSession.query(Metadata).filter(Metadata.dataset_id==dataset_id).all()
            rs_dict['metadata'] = metadata
        else:
            rs_dict['metadata'] = []

    except NoResultFound:
        raise HydraError("Dataset %s does not exist."%(dataset_id))


    dataset = namedtuple('Dataset', rs_dict.keys())(**rs_dict)

    return dataset
779009
function dataSet( element ) {
  if ( document.documentElement.dataset ) {
    return _assign( {}, element.dataset );
  }
  const dataset = {};
  const regex = /^data-(.+)/;
  let attr;
  let match;

  for ( var i = 0; i < element.attributes.length; i++ ) {
    attr = element.attributes[i];
    match = attr.name.match( regex );
    if ( match ) {
      dataset[_toCamelCase( match[1] )] = attr.value;
    }
  }

  return dataset;
}
265959
@Override
   public Dataset convert(Object s) {
      if (s instanceof Dataset) {
         return (Dataset) s;
      } else {
         throw new VectorPrintRuntimeException(String.format(
             "override this method to convert %s (value: %s) to a Dataset",
             (s != null) ? s.getClass().getName() : null, String.valueOf(s)
         ));
      }
   }
926860
def index_dataset(self, dataset, force=False):
        
        self.backend.dataset_index.index_one(dataset, force=force)
317815
def evaluate(self, dataset):
        
        if not isinstance(dataset, DataFrame):
            raise ValueError("dataset must be a DataFrame but got %s." % type(dataset))
        java_blr_summary = self._call_java("evaluate", dataset)
        return BinaryLogisticRegressionSummary(java_blr_summary)
634182
private INDArray readDataSet(Group fileGroup, String datasetName)
            throws UnsupportedKerasConfigurationException {
        synchronized (Hdf5Archive.LOCK_OBJECT) {
            DataSet dataset = fileGroup.openDataSet(datasetName);
            DataSpace space = dataset.getSpace();
            int nbDims = space.getSimpleExtentNdims();
            long[] dims = new long[nbDims];
            space.getSimpleExtentDims(dims);
            float[] dataBuffer;
            FloatPointer fp;
            int j;
            INDArray data;
            switch (nbDims) {
                case 5: /* 3D Convolution weights */
                    dataBuffer = new float[(int) (dims[0] * dims[1] * dims[2] * dims[3] * dims[4])];
                    fp = new FloatPointer(dataBuffer);
                    dataset.read(fp, dataType);
                    fp.get(dataBuffer);
                    data = Nd4j.create((int) dims[0], (int) dims[1], (int) dims[2], (int) dims[3], (int) dims[4]);
                    j = 0;
                    for (int i1 = 0; i1 < dims[0]; i1++)
                        for (int i2 = 0; i2 < dims[1]; i2++)
                            for (int i3 = 0; i3 < dims[2]; i3++)
                                for (int i4 = 0; i4 < dims[3]; i4++)
                                    for (int i5 = 0; i5 < dims[4]; i5++)
                                        data.putScalar(new int[] { i1, i2, i3, i4, i5 }, dataBuffer[j++]);
                    break;
                case 4: /* 2D Convolution weights */
                    dataBuffer = new float[(int) (dims[0] * dims[1] * dims[2] * dims[3])];
                    fp = new FloatPointer(dataBuffer);
                    dataset.read(fp, dataType);
                    fp.get(dataBuffer);
                    data = Nd4j.create((int) dims[0], (int) dims[1], (int) dims[2], (int) dims[3]);
                    j = 0;
                    for (int i1 = 0; i1 < dims[0]; i1++)
                        for (int i2 = 0; i2 < dims[1]; i2++)
                            for (int i3 = 0; i3 < dims[2]; i3++)
                                for (int i4 = 0; i4 < dims[3]; i4++)
                                    data.putScalar(i1, i2, i3, i4, dataBuffer[j++]);
                    break;
                case 3:
                    dataBuffer = new float[(int) (dims[0] * dims[1] * dims[2])];
                    fp = new FloatPointer(dataBuffer);
                    dataset.read(fp, dataType);
                    fp.get(dataBuffer);
                    data = Nd4j.create((int) dims[0], (int) dims[1], (int) dims[2]);
                    j = 0;
                    for (int i1 = 0; i1 < dims[0]; i1++)
                        for (int i2 = 0; i2 < dims[1]; i2++)
                            for (int i3 = 0; i3 < dims[2]; i3++)
                                data.putScalar(i1, i2, i3, dataBuffer[j++]);
                    break;
                case 2: /* Dense and Recurrent weights */
                    dataBuffer = new float[(int) (dims[0] * dims[1])];
                    fp = new FloatPointer(dataBuffer);
                    dataset.read(fp, dataType);
                    fp.get(dataBuffer);
                    data = Nd4j.create((int) dims[0], (int) dims[1]);
                    j = 0;
                    for (int i1 = 0; i1 < dims[0]; i1++)
                        for (int i2 = 0; i2 < dims[1]; i2++)
                            data.putScalar(i1, i2, dataBuffer[j++]);
                    break;
                case 1: /* Bias */
                    dataBuffer = new float[(int) dims[0]];
                    fp = new FloatPointer(dataBuffer);
                    dataset.read(fp, dataType);
                    fp.get(dataBuffer);
                    data = Nd4j.create((int) dims[0]);
                    j = 0;
                    for (int i1 = 0; i1 < dims[0]; i1++)
                        data.putScalar(i1, dataBuffer[j++]);
                    break;
                default:
                    throw new UnsupportedKerasConfigurationException("Cannot import weights with rank " + nbDims);
            }
            space.deallocate();
            dataset.deallocate();
            return data;
        }
    }
782640
function (dataset, heatMap, isColumns, sets, setSourceFileName) {
    var promptTool = {};
    var _this = this;
    promptTool.execute = function (options) {
      var metadataName = options.input.dataset_field_name;
      var vector = _this.annotateSets(dataset, isColumns, sets,
        metadataName, setSourceFileName);

      heatMap.getProject().trigger('trackChanged', {
        vectors: [vector],
        display: ['text'],
        columns: isColumns
      });
    };
    promptTool.toString = function () {
      return 'Select Fields To Match On';
    };
    promptTool.gui = function () {
      return [
        {
          name: 'dataset_field_name',
          options: morpheus.MetadataUtil.getMetadataNames(
            isColumns ? dataset.getColumnMetadata() : dataset.getRowMetadata()),
          type: 'select',
          value: 'id',
          required: true
        }];

    };
    morpheus.HeatMap.showTool(promptTool, heatMap);

  }
369759
def load_dataset(self, dataset, verbose=True):
        
        assert self.get_dataset(dataset) is True, "Datasets aren't properly downloaded, " \
                                                  "rerun to try again or download datasets manually."

        if verbose:
            print("Loading %s" % dataset)

        dataset_path = self.base_dataset_path + dataset
        for path in tqdm(glob.glob(dataset_path + "/*.gnt")):
            for image, label in self.load_gnt_file(path):
                yield image, label
705980
public void setDataset(String v) {
    if (InputElement_Type.featOkTst && ((InputElement_Type)jcasType).casFeat_dataset == null)
      jcasType.jcas.throwFeatMissing("dataset", "edu.cmu.lti.oaqa.framework.types.InputElement");
    jcasType.ll_cas.ll_setStringValue(addr, ((InputElement_Type)jcasType).casFeatCode_dataset, v);}
762552
def datasets_get(self, dataset_name):
    
    url = Api._ENDPOINT + (Api._DATASETS_PATH % dataset_name)
    return datalab.utils.Http.request(url, credentials=self._credentials)
185679
def evaluate(self, dataset):
        
        if not isinstance(dataset, DataFrame):
            raise ValueError("dataset must be a DataFrame but got %s." % type(dataset))
        java_glr_summary = self._call_java("evaluate", dataset)
        return GeneralizedLinearRegressionSummary(java_glr_summary)