The aside version of construct_xblock: take a type and key. Return an instance
541612
def create_aside(self, block_type, keys):
        
        aside_cls = XBlockAside.load_class(block_type)
        return aside_cls(runtime=self, scope_ids=keys)
1121336
function getBlock(type) {
  switch (type) {
    case 'Radio':
    case 'Bool':
      return Radio;

    case 'Checkbox':
      return Checkbox;

    case 'Number':
      return Number;

    case 'Select':
      return Select;

    case 'Image':
      return Image;

    case 'Text':
      return Text;

    case 'Input':
      return Input;

    case 'Textarea':
      return Textarea;

    case 'Data':
      return Data;

    case 'Evaluation':
      return Evaluation;

    case 'FetchOrg':
      return FetchOrg;

    case 'Table':
      return Table;

    case 'Signature':
      return Signature;

    case 'Summary':
      return Summary;

    case 'Sum':
      return Sum;

    case 'Switch':
      return Switch;

    case 'Information':
      return Information;

    default:
      return null;
  }
}
553484
def get(key, default=-1):
        """"""
        if isinstance(key, int):
            return Frame(key)
        if key not in Frame._member_map_:
            extend_enum(Frame, key, default)
        return Frame[key]
1048621
def construct(cls, name, version=None):
        
        other = VersionedObject(None)
        other.name_ = name
        other.version_ = Version() if version is None else version
        return other
400462
def build(cls: Type[T], data: Generic) -> T:
        """"""
        fields = fields_dict(cls)
        kwargs: Dict[str, Any] = {}
        for key, value in data.items():
            if key in fields:
                if isinstance(value, Mapping):
                    t = fields[key].type
                    if issubclass(t, Auto):
                        value = t.build(value)
                    else:
                        value = Auto.generate(value, name=key.title())
                kwargs[key] = value
            else:
                log.debug(f"got unknown attribute {key} for {cls.__name__}")
        return cls(**kwargs)
560860
def _Cobject(cls, ctype):
    
    o = object.__new__(cls)
    o._as_parameter_ = ctype
    return o
705631
private static Block convertBlock(TBlock tblk) {
    return new Block(tblk.getBlockId(), 
                     tblk.getNumBytes(),
                     tblk.getGenerationStamp());
  }
83929
def create_object(self, cls: Type[T], additional_kwargs=None) -> T:
        """"""
        additional_kwargs = additional_kwargs or {}
        log.debug('%sCreating %r object with %r', self._log_prefix, cls, additional_kwargs)

        try:
            instance = cls.__new__(cls)
        except TypeError as e:
            reraise(
                e,
                CallError(cls, getattr(cls.__new__, '__func__', cls.__new__), (), {}, e, self._stack),
                maximum_frames=2,
            )
        try:
            init = cls.__init__
            self.call_with_injection(init, self_=instance, kwargs=additional_kwargs)
        except TypeError as e:
            # The reason why getattr() fallback is used here is that
            # __init__.__func__ apparently doesn't exist for Key-type objects
            reraise(
                e,
                CallError(
                    instance,
                    getattr(instance.__init__, '__func__', instance.__init__),
                    (),
                    additional_kwargs,
                    e,
                    self._stack,
                ),
            )
        return instance
580689
def InstanceOf(cls, **kwargs):
    """"""
    return Property(types=cls, load=cls.load, **kwargs)
1031342
def create(cls, expr, binds):
        
        return cls(expr=expr, binds=binds, dtype=bool_dtype)
187047
def from_key(cls, *args):
        
        key = args if len(args) > 1 else args[0]
        return cls._instances.get(key, None)
1133095
function constructas(Type, o) {
		if (!gui.debug || edb.Type.isConstructor(Type)) {
			if (edb.Type.is(o)) {
				if (Type.is(o)) {
					return o;
				} else {
					fail(Type, o);
				}
			} else {
				return new Type(o);
			}
		} else {
			fail('edb.Type', Type);
		}
	}
1351636
def convert_coerce_type_and_add_to_where_block(coerce_type_block, where_block):
    """"""
    instanceof_filter = convert_coerce_type_to_instanceof_filter(coerce_type_block)

    if where_block:
        # There was already a Filter block -- we'll merge the two predicates together.
        return Filter(BinaryComposition(u'&&', instanceof_filter.predicate, where_block.predicate))
    else:
        return instanceof_filter
933082
function createBlock(type, nodes, props = {}) {
  if (!isArray(nodes)) {
    props = nodes;
    nodes = undefined;
  }

  const node = { object: 'block', type, ...props };
  return addNodes(node, nodes);
}
528420
def create(client, _type, **kwargs):
    """"""
    obj = client.factory.create("ns0:%s" % _type)
    for key, value in kwargs.items():
        setattr(obj, key, value)
    return obj
1182028
def _get_x(self, kwargs):
        '''
        
        '''
        if 'x' in kwargs:
            return round(float(kwargs['x']), 6)
        elif self._element_x in kwargs:
            return round(float(kwargs[self._element_x]), 6)
        elif self._type == 3 and self._element_1mx in kwargs:
            return round(1. - float(kwargs[self._element_1mx]), 6)
        else:
            raise TypeError()
1109253
def lower_coerce_type_blocks(ir_blocks):
    """"""
    new_ir_blocks = []

    for block in ir_blocks:
        new_block = block
        if isinstance(block, CoerceType):
            predicate = BinaryComposition(
                u'contains', Literal(list(block.target_class)), LocalField('@class'))
            new_block = Filter(predicate)

        new_ir_blocks.append(new_block)

    return new_ir_blocks