ScalarTypeExtension
544941
def parse_scalar_type_extension(lexer: Lexer) -> Node:
    """"""
    start = lexer.token
    expect_keyword(lexer, "extend")
    expect_keyword(lexer, "scalar")
    name = parse_name(lexer)
    directives = parse_directives(lexer, True)
    if not directives:
        raise unexpected(lexer)
    return Node(
        name=name, directives=directives, loc=loc(lexer, start)
    )
848207
def cast_scalar(method):
    
    @wraps(method)
    def new_method(self, other):
        if np.isscalar(other):
            other = type(self)([other],self.domain())
        return method(self, other)
    return new_method
800602
function scalar(value) {
    var result = new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](function (subscriber) {
        subscriber.next(value);
        subscriber.complete();
    });
    result._isScalar = true;
    result.value = value;
    return result;
}
703559
def _AddHasExtensionMethod(cls):
  """"""
  def HasExtension(self, extension_handle):
    _VerifyExtensionHandle(self, extension_handle)
    if extension_handle.label == _FieldDescriptor.LABEL_REPEATED:
      raise KeyError('"%s" is repeated.' % extension_handle.full_name)

    if extension_handle.cpp_type == _FieldDescriptor.CPPTYPE_MESSAGE:
      value = self._fields.get(extension_handle)
      return value is not None and value._is_present_in_parent
    else:
      return extension_handle in self._fields
  cls.HasExtension = HasExtension
495907
private function initActionTypeExtensions()
    {
        $this->actionTypeExtensions = [];

        foreach ($this->loadActionTypeExtensions() as $extension) {
            if (!$extension instanceof ActionTypeExtensionInterface) {
                throw new UnexpectedTypeException($extension, ActionTypeExtensionInterface::class);
            }

            $type = $extension->getExtendedType();

            $this->actionTypeExtensions[$type][] = $extension;
        }
    }
1064201
@Override
  public Context addExtension(Context moreSpecific) throws KbTypeException, CreateException {
    return wrapped().addExtension(moreSpecific);
  }
556254
def convert_to_scalars(cls, ops, kwargs):
    """"""
    from qnet.algebra.core.scalar_algebra import Scalar, ScalarValue
    scalar_ops = []
    for op in ops:
        if not isinstance(op, Scalar):
            scalar_ops.append(ScalarValue(op))
        else:
            scalar_ops.append(op)
    return scalar_ops, kwargs
1308282
function (name, type, opts) {
            opts = opts || {};
            this.operations.push(merge({op:"setColumnType", name:name, type:type}, opts));
        }
1330559
def parse_scalar_type_definition(lexer: Lexer) -> ScalarTypeDefinitionNode:
    """"""
    start = lexer.token
    description = parse_description(lexer)
    expect_keyword(lexer, "scalar")
    name = parse_name(lexer)
    directives = parse_directives(lexer, True)
    return ScalarTypeDefinitionNode(
        description=description, name=name, directives=directives, loc=loc(lexer, start)
    )
6744
def custom_object_extension_prefix_strict(instance):
    
    for key, obj in instance['objects'].items():
        if not ('extensions' in obj and 'type' in obj and
                obj['type'] in enums.OBSERVABLE_EXTENSIONS):
            continue
        for ext_key in obj['extensions']:
            if (ext_key not in enums.OBSERVABLE_EXTENSIONS[obj['type']] and
                    not CUSTOM_TYPE_PREFIX_RE.match(ext_key)):
                yield JSONError("Custom Cyber Observable Object extension type"
                                " '%s' should start with 'x-' followed by a source "
                                "unique identifier (like a domain name with dots "
                                "replaced by hyphens), a hyphen and then the name."
                                % ext_key, instance['id'],
                                'custom-prefix')
56918
public static function scalar(string $scalarType) : ScalarType
    {
        if (!isset(self::$scalars[$scalarType])) {
            self::$scalars[$scalarType] = new ScalarType($scalarType);
        }

        return self::$scalars[$scalarType];
    }
820086
function extend (base, extension) {
            if (isUndefined(base)) {
              return copy(extension);
            }
            if (isUndefined(extension)) {
              return copy(base);
            }
            if (isPureObject(base) && isPureObject(extension)) {
              return utils.extendDeep(base, extension);
            }
            return copy(extension);
          }
11973
private void checkScalarTypeExtensions(List<GraphQLError> errors, TypeDefinitionRegistry typeRegistry) {
        typeRegistry.scalarTypeExtensions()
                .forEach((name, extensions) -> {
                    checkTypeExtensionHasCorrespondingType(errors, typeRegistry, name, extensions, ScalarTypeDefinition.class);
                    checkTypeExtensionDirectiveRedefinition(errors, typeRegistry, name, extensions, ScalarTypeDefinition.class);
                });

    }
789552
public void setScalarSerializer (Class type, ScalarSerializer serializer) {
		if (type == null) throw new IllegalArgumentException("type cannot be null.");
		if (serializer == null) throw new IllegalArgumentException("serializer cannot be null.");
		scalarSerializers.put(type, serializer);
	}
205003
function objectExtendDeep(extended) {
  var currentObject;
  var currentType;
  var extendedType;
  var currentItem;
  var currentTypeInner;

  for (var i = 1, c = arguments.length; i < c; i++) {
    currentObject = arguments[i];
    if (!currentObject)
      continue;
    currentType = type(currentObject);
    extendedType = type(extended);
    // type mismatch
    if (currentType !== extendedType) {
      if (currentType === 'array') {
        extended = [];
      } else if (currentType === 'object' && extendedType !== 'function') {
        extended = {};
      }
      // else copy, primitive, date, regexp, function ...
    }
    // extend arrays
    if (currentType === 'array') {
      extended = extended.concat(currentObject);
    } else {
      // or objects ;)
      for (var key in currentObject) {
        if (ownProperty.call(currentObject, key)) {
          currentTypeInner = type(currentObject[key]);
          currentItem = currentObject[key];
          if (/^(object|array)$/.test(currentTypeInner)) {
            extended[key] = objectExtendDeep(extended[key], currentItem);
          } else if (currentTypeInner === 'date') {
            extended[key] = new Date(currentItem.getTime());
          } else if (currentTypeInner === 'regexp') {
            extended[key] = cloneRegExp(currentItem);
          } else {
            extended[key] = currentItem;
          }
        }
      }
    }
  }
  return extended;
}
72272
function findTypeForExtend(types, extend) {
  var orig = types.find(ea => ea.name === extend.name && ea.type !== "extend");
  if (!orig) throw new Error("Cannot find original for extension " + JSON.stringify(extend, null, 2));
  return orig;
}
1040692
public void addExtends(String superType) {
		if (!Strings.isEmpty(superType)) {
			JvmParameterizedTypeReference superTypeRef = newTypeRef(this.container, superType);
			this.sarlInterface.getExtends().add(superTypeRef);
			return;
		}
	}