Gets input ot output participants of the Conversion.
@param conv Conversion to get participants
@param type input or output
@return related participants
762660
protected Set<PhysicalEntity> getConvParticipants(Conversion conv, RelType type)
	{
		ConversionDirectionType dir = getDirection(conv);

		if (dir == ConversionDirectionType.REVERSIBLE)
		{
			HashSet<PhysicalEntity> set = new HashSet<PhysicalEntity>(conv.getLeft());
			set.addAll(conv.getRight());
			return set;
		}
		else if (dir == ConversionDirectionType.RIGHT_TO_LEFT)
		{
			return type == RelType.INPUT ? conv.getRight() : conv.getLeft();
		}
		else return type == RelType.OUTPUT ? conv.getRight() : conv.getLeft();
	}
485527
def get_input_channel(entity):
    """"""
    try:
        if entity.SUBCLASS_OF_ID == 0x40f202fd:  # crc32(b'InputChannel')
            return entity
    except AttributeError:
        _raise_cast_fail(entity, 'InputChannel')

    if isinstance(entity, (types.Channel, types.ChannelForbidden)):
        return types.InputChannel(entity.id, entity.access_hash or 0)

    if isinstance(entity, types.InputPeerChannel):
        return types.InputChannel(entity.channel_id, entity.access_hash)

    _raise_cast_fail(entity, 'InputChannel')
285939
private Map<PhysicalEntity, Stoichiometry> getStoichiometry(Conversion conv) {
		Map<PhysicalEntity, Stoichiometry> map = new HashMap<PhysicalEntity, Stoichiometry>();

		for (Stoichiometry stoc : conv.getParticipantStoichiometry())
			map.put(stoc.getPhysicalEntity(), stoc);

		return map;
	}
354877
public InputType getOutputType(InputType... inputType) throws InvalidKerasConfigurationException {
        if (inputType.length > 1)
            throw new InvalidKerasConfigurationException(
                    "Keras SameDiff layer accepts only one input (received " + inputType.length + ")");
        return this.getSameDiffLayer().getOutputType(-1, inputType[0]);
    }
1211894
@Override
    public InputType getOutputType(InputType... inputType) throws InvalidKerasConfigurationException {
        if (inputType.length > 1)
            throw new InvalidKerasConfigurationException(
                    "Keras Convolution layer accepts only one input (received " + inputType.length + ")");
        InputType.InputTypeConvolutional convType = (InputType.InputTypeConvolutional) inputType[0];

        // Override input/output shape and input channels dynamically. This works since getOutputType will always
        // be called when initializing the model.
        ((LocallyConnected2D) this.layer).setInputSize(new int[] {(int) convType.getHeight(),(int) convType.getWidth()});
        ((LocallyConnected2D) this.layer).setNIn(convType.getChannels());
        ((LocallyConnected2D) this.layer).computeOutputSize();

        InputPreProcessor preprocessor = getInputPreprocessor(inputType[0]);
        if (preprocessor != null) {
            return this.getLocallyConnected2DLayer().getOutputType(-1, preprocessor.getOutputType(inputType[0]));
        }
        return this.getLocallyConnected2DLayer().getOutputType(-1, inputType[0]);
    }
773464
@Override
    public InputType getOutputType(InputType... inputType) throws InvalidKerasConfigurationException {
        if (inputType.length > 1)
            throw new InvalidKerasConfigurationException(
                    "Keras Subsampling/Pooling 3D layer accepts only one input (received " + inputType.length + ")");
        return this.getSubsampling3DLayer().getOutputType(-1, inputType[0]);
    }
447478
public InputType getOutputType(InputType... inputType) throws InvalidKerasConfigurationException {
        if (inputType.length > 1)
            throw new InvalidKerasConfigurationException(
                    "Keras Activation layer accepts only one input (received " + inputType.length + ")");
        return this.getActivationLayer().getOutputType(-1, inputType[0]);
    }
221490
public INDArray[] output(INDArray[] input, INDArray[] inputMasks){
        Nd4j.getExecutioner().commit(); //Commit before passing input to other thread

        // basically, depending on model type we either throw stuff to specific model, or wait for batch
        BasicInferenceObserver observer = new BasicInferenceObserver();
        InferenceObservable observable;

        if (inferenceMode == InferenceMode.SEQUENTIAL) {
            observable = new BasicInferenceObservable(input, inputMasks);
            observable.addObserver(observer);
            try {
                observables.put(observable);
            } catch (InterruptedException e) {
                Thread.currentThread().interrupt();
                throw new RuntimeException(e);
            }
        } else {
            observable = provider.setInput(observer, input, inputMasks);
        }

        try {
            // submit query to processing
            // and block until Observable returns
            //observer.wait();

            observer.waitTillDone();
        } catch (Exception e) {
            throw new RuntimeException(e);
        }

        return observable.getOutput();
    }
673693
public static ReceiveListenerDispatcher getInstance(Conversation.ConversationType convType, boolean isOnClientSide)
   {
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "getInstance",
                                           new Object[] {""+convType, ""+isOnClientSide});

      ReceiveListenerDispatcher retInstance;

      // A conversation has type CLIENT if it is an Outbound or Inbound connection from a JetStream
      // client. The client side RLD is different from the server side RLD, so we need the
      // isOnClientSide flag to distinguish them.
      // A conversation has type ME if it is an Outbound or Inbound connection from another ME.
      if (convType == Conversation.CLIENT)
      {
         if (isOnClientSide)
         {
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(tc, "Returning client instance");
            synchronized(ReceiveListenerDispatcher.class)
            {
               if (clientInstance == null)
               {
                  clientInstance = new ReceiveListenerDispatcher(true, true); // Client side of ME-Client conversation
               }
            }
            retInstance = clientInstance;
         }
         else
         {
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(tc, "Returning server instance");
            synchronized(ReceiveListenerDispatcher.class)
            {
               if (serverInstance == null)
               {
                  serverInstance = new ReceiveListenerDispatcher(false, true); // ME side of ME-Client conversation
               }
            }
            retInstance = serverInstance;
         }
      }
      else
      {
         if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(tc, "Returning ME-ME instance");
         synchronized(ReceiveListenerDispatcher.class)
         {
            if (meInstance == null)
            {
               meInstance = new ReceiveListenerDispatcher(false, false); // ME-ME conversation
            }
         }
         retInstance = meInstance;
      }

      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "getInstance", retInstance);
      return retInstance;
   }
1068118
public static TypeVariableName get(java.lang.reflect.TypeVariable<?> type) {
    return get(type, new LinkedHashMap<>());
  }
124546
public String getCompressor(String type) {
        if (mCompressionMap == null) {
            return null;
        }

        return mCompressionMap.get(type).toString();
    }
533850
public double getOutputSizeInBytes(Collection<Symbol> outputSymbols, TypeProvider types)
    {
        requireNonNull(outputSymbols, "outputSymbols is null");

        return outputSymbols.stream()
                .mapToDouble(symbol -> getOutputSizeForSymbol(getSymbolStatistics(symbol), types.get(symbol)))
                .sum();
    }
1255611
public PriorityConverter getConverter(Type type) {
        PriorityConverter converter = converters.get(type);
        return converter;
    }
375768
@Override
    public InputType getOutputType(InputType... inputType) throws InvalidKerasConfigurationException {
        if (inputType.length > 1)
            throw new InvalidKerasConfigurationException(
                    "Keras Permute layer accepts only one input (received " + inputType.length + ")");
        PermutePreprocessor reshape = (PermutePreprocessor) getInputPreprocessor(inputType);
        return reshape.getOutputType(inputType[0]);
    }
39087
private ObjectInspector getObjectInspectorForType(TypeInfo type)
            throws SerDeException {
        switch (type.getCategory()) {
            case PRIMITIVE:
                PrimitiveTypeInfo primitiveType = (PrimitiveTypeInfo) type;
                if (isSupportedPrimitive(primitiveType)) {
                    return PrimitiveObjectInspectorFactory.getPrimitiveJavaObjectInspector(primitiveType.getPrimitiveCategory());
                }
                break;
            case STRUCT:
                StructTypeInfo structType = (StructTypeInfo) type;
                List<ObjectInspector> structInspectors = Lists.newArrayListWithCapacity(structType.getAllStructFieldTypeInfos().size());
                for (TypeInfo fieldType : structType.getAllStructFieldTypeInfos()) {
                    structInspectors.add(getObjectInspectorForType(fieldType));
                }
                return ObjectInspectorFactory.getStandardStructObjectInspector(structType.getAllStructFieldNames(), structInspectors);
            case MAP:
                MapTypeInfo mapType = (MapTypeInfo) type;
                return ObjectInspectorFactory.getStandardMapObjectInspector(
                        getObjectInspectorForType(mapType.getMapKeyTypeInfo()), getObjectInspectorForType(mapType.getMapValueTypeInfo()));
            case LIST:
                ListTypeInfo listType = (ListTypeInfo) type;
                return ObjectInspectorFactory.getStandardListObjectInspector(getObjectInspectorForType(listType.getListElementTypeInfo()));
            case UNION:
                UnionTypeInfo unionType = (UnionTypeInfo) type;
                List<ObjectInspector> unionInspectors = Lists.newArrayListWithCapacity(unionType.getAllUnionObjectTypeInfos().size());
                for (TypeInfo fieldType : unionType.getAllUnionObjectTypeInfos()) {
                    unionInspectors.add(getObjectInspectorForType(fieldType));
                }
                return ObjectInspectorFactory.getStandardUnionObjectInspector(unionInspectors);
        }

        // Should be unreachable
        throw new SerDeException("Unsupported type: " + type);
    }
526304
public AVIMConversation getConversation(String conversationId, int convType) {
    AVIMConversation result = null;
    switch (convType) {
      case Conversation.CONV_TYPE_SYSTEM:
        result = getServiceConversation(conversationId);
        break;
      case Conversation.CONV_TYPE_TEMPORARY:
        result = getTemporaryConversation(conversationId);
        break;
      case Conversation.CONV_TYPE_TRANSIENT:
        result = getChatRoom(conversationId);
        break;
      default:
        result = getConversation(conversationId);
        break;
    }
    return result;
  }
1269144
@SuppressWarnings("unchecked") public <R, W> Converter<R, W> getTypeConverter(Class<?> key) {
        return (Converter<R, W>) typeConverts.get(key);
    }