//////////////////// // DESCRIPTOR    // // ////////////////////
197264
function updateDescriptor(newDescriptor, options) {

	var descriptor,
		typeTest,
		eventType;
	
	if (newDescriptor) {
		if (!currentProperty)
			throw exception('name');
		
		descriptor = newDescriptor;
	}
	
	if (options) {
		if (!currentProperty)
			throw exception('property');
		
		descriptor = getCurrentDescriptor();
		
		if (options.type)
			typeTest = getTestFor(options.type);
		
		if (options.event)
			eventType = options.event === true ? ProtoTyper.CHANGE : options.event;
		
		if (descriptor.hasOwnProperty('value') && (typeTest || eventType)) {
			// We need to define a "private" variable.
			push(currentTarget, '_'+currentProperty, {
				'value': descriptor.value,
				'enumerable': false,
				'writable': true
			});
			delete descriptor.value;
		}
		
		if (descriptor.hasOwnProperty('writable') && (typeTest || eventType))
			delete descriptor.writable;
		
		if (typeTest || eventType) {
			descriptor.get = generateGet(currentProperty);
			descriptor.set = generateSet(descriptor.set, currentProperty, typeTest, eventType);
		}
		
		if (options.notKey)
			descriptor.enumerable = false;
		
		if (options.final)
			descriptor.configurable = false;
	}
	
	
	push(currentTarget, currentProperty, descriptor);
}
442044
public static int cudnnGetFilter4dDescriptor(
        cudnnFilterDescriptor filterDesc, 
        int[] dataType, /** image data type */
        int[] format, 
        int[] k, /** number of output feature maps */
        int[] c, /** number of input feature maps */
        int[] h, /** height of each input filter */
        int[] w)/**  */
    {
        return checkResult(cudnnGetFilter4dDescriptorNative(filterDesc, dataType, format, k, c, h, w));
    }
1117059
private static String descriptorToInternalName(String descriptor) {
        switch (descriptor.charAt(0)) {
            case 'B':
            case 'C':
            case 'D':
            case 'F':
            case 'I':
            case 'J':
            case 'S':
            case 'Z':
            case 'V':
            case '[':
                return descriptor;
            case 'L':
                return classDescriptorToInternalName(descriptor);
            default:
                throw new IllegalArgumentException("bad descriptor:" +
                    descriptor);
        }
    }
649228
public void setDescriptor(String descriptor)
  {
    _descriptor = descriptor;

    if (_isWrite)
      _jClass.getConstantPool().addUTF8(descriptor);
  }
685602
private int getFileDescriptor() throws IOException {
		final int fd = SharedSecrets.getJavaIOFileDescriptorAccess().get(getFD());

        if(fd < 1)
            throw new IOException("failed to get POSIX file descriptor!");

        return fd;
    }
155437
def method_descriptor(descriptor: str) -> MethodDescriptor:
    
    end_para = descriptor.find(')')
    returns = descriptor[end_para + 1:]
    args = descriptor[1:end_para]

    return MethodDescriptor(
        parse_descriptor(returns)[0],
        parse_descriptor(args),
        returns,
        args,
        descriptor
    )
1098380
function(descriptor) {
					var newDescriptor = {
						get: descriptor.get,
						set: function(val) {
							if (fnIsACBUrl(val)) {
								val = fnConvertUrl(val);
							}
							descriptor.set.call(this, val);
						},
						enumerable: descriptor.enumerable,
						configurable: descriptor.configurable
					};
					newDescriptor.set._sapUiCoreACB = true;
					return newDescriptor;
				}
1033749
public String getDescriptor() {
    if (sort == OBJECT) {
      return valueBuffer.substring(valueBegin - 1, valueEnd + 1);
    } else if (sort == INTERNAL) {
      StringBuilder stringBuilder = new StringBuilder();
      stringBuilder.append('L');
      stringBuilder.append(valueBuffer, valueBegin, valueEnd);
      stringBuilder.append(';');
      return stringBuilder.toString();
    } else {
      return valueBuffer.substring(valueBegin, valueEnd);
    }
  }
1289569
function _createInputDescriptor (input, inputOptions, containerOptions) {
  const inputDescriptor = { failOnError: true };
  if (is.string(input)) {
    // filesystem
    inputDescriptor.file = input;
  } else if (is.buffer(input)) {
    // Buffer
    inputDescriptor.buffer = input;
  } else if (is.plainObject(input) && !is.defined(inputOptions)) {
    // Plain Object descriptor, e.g. create
    inputOptions = input;
    if (is.plainObject(inputOptions.raw)) {
      // Raw Stream
      inputDescriptor.buffer = [];
    }
  } else if (!is.defined(input) && is.object(containerOptions) && containerOptions.allowStream) {
    // Stream
    inputDescriptor.buffer = [];
  } else {
    throw new Error('Unsupported input ' + typeof input);
  }
  if (is.object(inputOptions)) {
    // Fail on error
    if (is.defined(inputOptions.failOnError)) {
      if (is.bool(inputOptions.failOnError)) {
        inputDescriptor.failOnError = inputOptions.failOnError;
      } else {
        throw new Error('Invalid failOnError (boolean) ' + inputOptions.failOnError);
      }
    }
    // Density
    if (is.defined(inputOptions.density)) {
      if (is.inRange(inputOptions.density, 1, 2400)) {
        inputDescriptor.density = inputOptions.density;
      } else {
        throw new Error('Invalid density (1 to 2400) ' + inputOptions.density);
      }
    }
    // Raw pixel input
    if (is.defined(inputOptions.raw)) {
      if (
        is.object(inputOptions.raw) &&
        is.integer(inputOptions.raw.width) && inputOptions.raw.width > 0 &&
        is.integer(inputOptions.raw.height) && inputOptions.raw.height > 0 &&
        is.integer(inputOptions.raw.channels) && is.inRange(inputOptions.raw.channels, 1, 4)
      ) {
        inputDescriptor.rawWidth = inputOptions.raw.width;
        inputDescriptor.rawHeight = inputOptions.raw.height;
        inputDescriptor.rawChannels = inputOptions.raw.channels;
      } else {
        throw new Error('Expected width, height and channels for raw pixel input');
      }
    }
    // Multi-page input (GIF, TIFF, PDF)
    if (is.defined(inputOptions.pages)) {
      if (is.integer(inputOptions.pages) && is.inRange(inputOptions.pages, -1, 100000)) {
        inputDescriptor.pages = inputOptions.pages;
      }
    }
    if (is.defined(inputOptions.page)) {
      if (is.integer(inputOptions.page) && is.inRange(inputOptions.page, 0, 100000)) {
        inputDescriptor.page = inputOptions.page;
      }
    }
    // Create new image
    if (is.defined(inputOptions.create)) {
      if (
        is.object(inputOptions.create) &&
        is.integer(inputOptions.create.width) && inputOptions.create.width > 0 &&
        is.integer(inputOptions.create.height) && inputOptions.create.height > 0 &&
        is.integer(inputOptions.create.channels) && is.inRange(inputOptions.create.channels, 3, 4) &&
        is.defined(inputOptions.create.background)
      ) {
        inputDescriptor.createWidth = inputOptions.create.width;
        inputDescriptor.createHeight = inputOptions.create.height;
        inputDescriptor.createChannels = inputOptions.create.channels;
        const background = color(inputOptions.create.background);
        inputDescriptor.createBackground = [
          background.red(),
          background.green(),
          background.blue(),
          Math.round(background.alpha() * 255)
        ];
        delete inputDescriptor.buffer;
      } else {
        throw new Error('Expected width, height, channels and background to create a new input image');
      }
    }
  } else if (is.defined(inputOptions)) {
    throw new Error('Invalid input options ' + inputOptions);
  }
  return inputDescriptor;
}
72458
public static int cudnnSetFilterNdDescriptor(
        cudnnFilterDescriptor filterDesc, 
        int dataType, /** image data type */
        int format, 
        int nbDims, 
        int[] filterDimA)
    {
        return checkResult(cudnnSetFilterNdDescriptorNative(filterDesc, dataType, format, nbDims, filterDimA));
    }
20664
public static TypeDesc forDescriptor(final String desc) throws IllegalArgumentException {
        TypeDesc type = cDescriptorsToInstances.get(desc);
        if (type != null) {
            return type;
        }

        // TODO: Support generics in descriptor.

        String rootDesc = desc;
        int cursor = 0;
        int dim = 0;
        try {
            char c;
            while ((c = rootDesc.charAt(cursor++)) == '[') {
                dim++;
            }

            switch (c) {
            case 'V':
                type = VOID;
                break;
            case 'Z':
                type = BOOLEAN;
                break;
            case 'C':
                type = CHAR;
                break;
            case 'B':
                type = BYTE;
                break;
            case 'S':
                type = SHORT;
                break;
            case 'I':
                type = INT;
                break;
            case 'J':
                type = LONG;
                break;
            case 'F':
                type = FLOAT;
                break;
            case 'D':
                type = DOUBLE;
                break;
            case 'L':
                if (dim > 0) {
                    rootDesc = rootDesc.substring(dim);
                    cursor = 1;
                }
                StringBuffer name = new StringBuffer(rootDesc.length() - 2);
                while ((c = rootDesc.charAt(cursor++)) != ';') {
                    if (c == '/') {
                        c = '.';
                    }
                    name.append(c);
                }
                type = intern(new ObjectType(rootDesc, name.toString()));
                break;
            default:
                throw invalidDescriptor(desc);
            }
        } catch (NullPointerException e) {
            throw invalidDescriptor(desc);
        } catch (IndexOutOfBoundsException e) {
            throw invalidDescriptor(desc);
        }

        if (cursor != rootDesc.length()) {
            throw invalidDescriptor(desc);
        }

        while (--dim >= 0) {
            type = type.toArrayType();
        }

        cDescriptorsToInstances.put(desc, type);
        return type;
    }
954617
public static void checkDescriptor(DatasetDescriptor descriptor) {
    Preconditions.checkNotNull(descriptor, "Descriptor cannot be null");

    Schema schema = descriptor.getSchema();
    checkSchema(schema);

    if (descriptor.isPartitioned()) {
      // marked as [BUG] because this is checked in DatasetDescriptor
      Preconditions.checkArgument(schema.getType() == Schema.Type.RECORD,
          "[BUG] Partitioned datasets must have record schemas");

      Set<String> names = Sets.newHashSet();
      for (Schema.Field field : schema.getFields()) {
        names.add(field.name());
      }

      List<String> incompatible = Lists.newArrayList();
      List<String> duplicates = Lists.newArrayList();
      for (FieldPartitioner fp : Accessor.getDefault().getFieldPartitioners(descriptor
          .getPartitionStrategy())) {
        String name = fp.getName();
        if (!isCompatibleName(name)) {
          incompatible.add(name);
        } else if (names.contains(name)) {
          duplicates.add(name);
        } else {
          names.add(name);
        }
      }
      ValidationException.check(incompatible.isEmpty(),
          "Partition names are not alphanumeric (plus '_'): %s",
          Joiner.on(", ").join(incompatible));
      ValidationException.check(duplicates.isEmpty(),
          "Partition names duplicate data fields: %s",
          Joiner.on(", ").join(duplicates));
    }
  }
767255
async function retrieveDescriptor(descriptor) {
  if (isPlainObject(descriptor)) {
    return cloneDeep(descriptor)
  }
  if (isString(descriptor)) {

    // Remote
    if (isRemotePath(descriptor)) {
      try {
        const response = await axios.get(descriptor)
        return response.data
      } catch (error) {
        const message = `Can not retrieve remote descriptor "${descriptor}"`
        throw new DataPackageError(message)
      }

    // Local
    } else {
      if (config.IS_BROWSER) {
        const message = `Local descriptor "${descriptor}" in browser is not supported`
        throw new DataPackageError(message)
      }
      try {
        // TODO: rebase on promisified fs.readFile (async)
        const contents = fs.readFileSync(descriptor, 'utf-8')
        return JSON.parse(contents)
      } catch (error) {
        const message = `Can not retrieve local descriptor "${descriptor}"`
        throw new DataPackageError(message)
      }
    }

  }
  throw new DataPackageError('Descriptor must be String or Object')
}
706210
function(context, descriptor, args) {
		var path = args[0],
			template = args[1];
		var ctx = new Context(typeof path === 'string' ? context.get(path) : path, context, path);
		template.toHTMLString(ctx, descriptor);
	}
140362
function formatKeyDescriptor(descriptor) {
        var displayStr;

        if (brackets.platform === "mac") {
            displayStr = descriptor.replace(/-(?!$)/g, "");     // remove dashes
            displayStr = displayStr.replace("Ctrl", "\u2303");  // Ctrl > control symbol
            displayStr = displayStr.replace("Cmd", "\u2318");   // Cmd > command symbol
            displayStr = displayStr.replace("Shift", "\u21E7"); // Shift > shift symbol
            displayStr = displayStr.replace("Alt", "\u2325");   // Alt > option symbol
        } else {
            displayStr = descriptor.replace("Ctrl", Strings.KEYBOARD_CTRL);
            displayStr = displayStr.replace("Shift", Strings.KEYBOARD_SHIFT);
            displayStr = displayStr.replace(/-(?!$)/g, "+");
        }

        displayStr = displayStr.replace("Space", Strings.KEYBOARD_SPACE);

        displayStr = displayStr.replace("PageUp", Strings.KEYBOARD_PAGE_UP);
        displayStr = displayStr.replace("PageDown", Strings.KEYBOARD_PAGE_DOWN);
        displayStr = displayStr.replace("Home", Strings.KEYBOARD_HOME);
        displayStr = displayStr.replace("End", Strings.KEYBOARD_END);

        displayStr = displayStr.replace("Ins", Strings.KEYBOARD_INSERT);
        displayStr = displayStr.replace("Del", Strings.KEYBOARD_DELETE);

        return displayStr;
    }
813092
static void checkDesc(final String desc, final boolean canBeVoid) {
        int end = checkDesc(desc, 0, canBeVoid);
        if (end != desc.length()) {
            throw new IllegalArgumentException("Invalid descriptor: " + desc);
        }
    }
924344
function excludes() {
    var descriptor = _asDescriptor.call(this);

    for (var _len2 = arguments.length, excludesList = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
        excludesList[_key2] = arguments[_key2];
    }

    descriptor.excludes = excludesList;

    return descriptor;
}