Return the Dynac representation of this cavity instance.
181910
def dynacRepresentation(self):
        
        return ['CAVMC', [
            [self.cavID.val],
            [self.xesln.val, self.phase.val, self.fieldReduction.val, self.isec.val, 1],
            ]]
753214
public DynamicType<EntityTypeMetadata<EntityMetadata>> getDynamicType(Set<Discriminator> discriminators) {
        return cache.computeIfAbsent(new HashSet<>(discriminators), key -> {
            LOGGER.debug("Cache miss for discriminators {}.", key);
            Set<EntityTypeMetadata<EntityMetadata>> metadata = new HashSet<>();
            for (Discriminator discriminator : key) {
                Set<EntityTypeMetadata<EntityMetadata>> candidates = typeMetadataByDiscriminator.get(discriminator);
                if (candidates != null) {
                    for (EntityTypeMetadata<EntityMetadata> candidate : candidates) {
                        Set<EntityTypeMetadata<EntityMetadata>> candidateSubTypes = aggregatedSubTypes.get(candidate);
                        if (candidateSubTypes == null || !containsAny(metadata, candidateSubTypes)) {
                            Set<Discriminator> entityDiscriminators = aggregatedDiscriminators.get(candidate);
                            if (key.size() >= entityDiscriminators.size() && key.containsAll(entityDiscriminators)) {
                                metadata.add(candidate);
                                // Remove all super types as they are already represented by the current type
                                metadata.removeAll(aggregatedSuperTypes.get(candidate));
                            }
                        }
                    }
                }
            }
            return new DynamicType<>(metadata);
        });
    }
1219756
def get_dynamic_mode(composite):
    ""
    dynmaps = composite.traverse(lambda x: x, [DynamicMap])
    holomaps = composite.traverse(lambda x: x, ['HoloMap'])
    dynamic_unbounded = any(m.unbounded for m in dynmaps)
    if holomaps:
        validate_unbounded_mode(holomaps, dynmaps)
    elif dynamic_unbounded and not holomaps:
        raise Exception("DynamicMaps in unbounded mode must be displayed alongside "
                        "a HoloMap to define the sampling.")
    return dynmaps and not holomaps, dynamic_unbounded
761524
def get_x_objs(self, *dynac_type):
        
        return [i for i in self.lattice for y in dynac_type if dynac_from_ele(i) == y]
1007228
def to_dict(self):
        ''''''
        d = super(WaitTime, self).to_dict()
        d['condition'] = {'waitTime': {'waitTime': self.wait_time}}
        return d
892613
def PartialDynamicSystem(self, ieq, variable):
        
#        print(ieq,variable.name)
        if ieq == 0:
            # U1-U2=R(i1)
            if variable == self.physical_nodes[0].variable:
                # U1 is output
                # U1=R(i1)+U2
                return [WeightedSum([self.physical_nodes[1].variable, self.variables[0]], variable, [1, self.R])]
            elif variable == self.physical_nodes[1].variable:
                # U2 is output
                # U2=-R(i1)+U2
                return [WeightedSum([self.physical_nodes[0].variable, self.variables[0]], variable, [1, -self.R])]
            elif variable == self.variables[0]:
                # i1 is output
                # i1=(U1-U2)/R
                return [WeightedSum([self.physical_nodes[0].variable, self.physical_nodes[1].variable], variable, [1/self.R, -1/self.R])]
        elif ieq == 1:
            # i1=-i2
            if variable == self.variables[0]:
                # i1 as output
                return [Gain(self.variables[1], self.variables[0], -1)]
            elif variable == self.variables[1]:
                # i2 as output
                return [Gain(self.variables[0], self.variables[1], -1)]
1337931
def reconstruct(self, X=None):
        """"""

        if X is None:
            X = self.X
        return self.D.dot(self.X)
37758
def get_descriptor(ctx):
    
    d_net = gluon.nn.Sequential()
    with d_net.name_scope():

        d_net.add(SNConv2D(num_filter=64, kernel_size=4, strides=2, padding=1, in_channels=3, ctx=ctx))
        d_net.add(gluon.nn.LeakyReLU(0.2))

        d_net.add(SNConv2D(num_filter=128, kernel_size=4, strides=2, padding=1, in_channels=64, ctx=ctx))
        d_net.add(gluon.nn.LeakyReLU(0.2))

        d_net.add(SNConv2D(num_filter=256, kernel_size=4, strides=2, padding=1, in_channels=128, ctx=ctx))
        d_net.add(gluon.nn.LeakyReLU(0.2))

        d_net.add(SNConv2D(num_filter=512, kernel_size=4, strides=2, padding=1, in_channels=256, ctx=ctx))
        d_net.add(gluon.nn.LeakyReLU(0.2))

        d_net.add(SNConv2D(num_filter=1, kernel_size=4, strides=1, padding=0, in_channels=512, ctx=ctx))

    return d_net
177624
def encode_set(dynamizer, value):
    
    inner_value = next(iter(value))
    inner_type = dynamizer.raw_encode(inner_value)[0]
    return inner_type + 'S', [dynamizer.raw_encode(v)[1] for v in value]
489809
def dynacRepresentation(self):
        
        if self.plane.val == 'H':
            p = 0
        elif self.plane.val == 'V':
            p = 1
        return ['STEER', [[self.field_strength.val], [p]]]
875499
def attrs(self, dynamizer):
        
        ret = {
            self.key: {
                'Action': self.action,
            }
        }
        if not is_null(self.value):
            ret[self.key]['Value'] = dynamizer.encode(self.value)
        return ret
889008
def _to_representation(self, instance):
        """"""

        if self.enable_optimization:
            representation = self._faster_to_representation(instance)
        else:
            representation = super(
                WithDynamicSerializerMixin,
                self
            ).to_representation(instance)

        if settings.ENABLE_LINKS:
            # TODO: Make this function configurable to support other
            #       formats like JSON API link objects.
            representation = merge_link_object(
                self, representation, instance
            )

        if self.debug:
            representation['_meta'] = {
                'id': instance.pk,
                'type': self.get_plural_name()
            }

        # tag the representation with the serializer and instance
        return tag_dict(
            representation,
            serializer=self,
            instance=instance,
            embed=self.embed
        )
83111
def get_subspace(self, dims):
        '''
        
        '''
        subspace = []
        k = 0
        for variable in self.space_expanded:
            if k in dims:
                subspace.append(variable)
            k += variable.dimensionality_in_model
        return subspace
1081181
def _shape_list(tensor):
  """"""
  # Get statically known shape (may contain None's for unknown dimensions)
  shape = tensor.get_shape().as_list()

  # Ensure that the shape values are not None
  dynamic_shape = tf.shape(tensor)
  for i in range(len(shape)):
    if shape[i] is None:
      shape[i] = dynamic_shape[i]
  return shape
416896
def dynacRepresentation(self):
        
        details = [
            self.energyDefnFlag.val,
            self.energy.val,
            self.phase.val,
            self.x.val,
            self.y.val,
            self.radius.val,
        ]
        return ['REJECT', [details]]
563590
def getDynMeth(name):
    '''
    
    '''
    cname, fname = name.rsplit('.', 1)

    clas = getDynLocal(cname)
    if clas is None:
        return None

    return getattr(clas, fname, None)
203678
def get_output_shape(sym, **input_shapes):
        """"""
        _, s_outputs, _ = sym.infer_shape(**input_shapes)
        return dict(zip(sym.list_outputs(), s_outputs))