Determines which symbol to use for numpy conversions
        > : a little endian system to big endian ordering
        < : a big endian system to little endian ordering
        = : No conversion
974681
def _convert_option(self):
        '''
        
        '''
        data_endian = 'little'
        if (self._encoding == 1 or self._encoding == 2 or self._encoding == 5 or
            self._encoding == 7 or self._encoding == 9 or self._encoding == 11 or
                self._encoding == 12 or self._encoding == 18):
            data_endian = 'big'
        if sys.byteorder == 'little' and data_endian == 'big':
            # big->little
            order = '>'
        elif sys.byteorder == 'big' and data_endian == 'little':
            # little->big
            order = '<'
        else:
            # no conversion
            order = '='

        return order
161691
private static function set_endianness()
  {
    $packed = pack('d', 1);
    switch ($packed)
    {
      case "\77\360\0\0\0\0\0\0":
        self::$endianness = self::BIG_ENDIAN;
        break;
      case "\0\0\0\0\0\0\360\77":
        self::$endianness = self::LITTLE_ENDIAN;
        break;
      default:
        throw new AvroException(
          sprintf('Error determining platform endianness: %s',
                  AvroDebug::hex_string($packed)));
    }
  }
1146170
def intToBin(i):
    
    # divide in two parts (bytes)
    i1 = i % 256
    i2 = int(i / 256)
    # make string (little endian)
    return i.to_bytes(2, byteorder='little')
435962
def is_symbol(string):
    
    return (
        is_int(string) or is_float(string) or
        is_constant(string) or is_unary(string) or
        is_binary(string) or
        (string == '(') or (string == ')')
    )
1227869
private function getEndianess()
    {
        if (0 === self::$endianess) {
            self::$endianess = $this->fromInt32("\x01\x00\x00\x00") == 1
                             ? self::LITTLE_ENDIAN_ORDER
                             : self::BIG_ENDIAN_ORDER;
        }
        return self::$endianess;
    }
888673
def _detect_endian(cls, stream):
        
        stream.seek(0)
        endian_str = stream.read(2)
        return BIG_ENDIAN if endian_str == b'MM' else LITTLE_ENDIAN
337931
def _is_big_endian(self):
        
        if self.endian == DataTypeMixIn.ENDIAN_NATIVE:
            return SYSTEM_ENDIAN == DataTypeMixIn.ENDIAN_BIG

        return self.endian in (DataTypeMixIn.ENDIAN_BIG, DataTypeMixIn.ENDIAN_NETWORK)
164041
def _symbol_in(self, symbol, name):
        """"""
        lsymbol = symbol.lower()
        lname = name.lower()
        return lsymbol == lname[:len(symbol)] or "_" + lsymbol in lname
471183
def converted_value(other_unit)
      if other_unit.special?
        other_unit.magnitude scalar
      else
        scalar / other_unit.scalar
      end
    end
311953
def write_int8(self, value, little_endian=True):
        
        if little_endian:
            endian = "<"
        else:
            endian = ">"
        return self.pack('%sb' % endian, value)
1070655
private static function set_endianness()
    {
        $packed = pack('d', 1);
        switch ($packed) {
            case "\77\360\0\0\0\0\0\0":
                self::$endianness = self::BIG_ENDIAN;
                break;
            case "\0\0\0\0\0\0\360\77":
                self::$endianness = self::LITTLE_ENDIAN;
                break;
            default:
                throw new Exception(
                    sprintf('Error determining platform endianness: %s',
                        Debug::hex_string($packed)));
        }
    }
1316518
public static void setInt(int n, byte[] b, int off, boolean littleEndian) {
		if (littleEndian) {
			b[off] = (byte) n;
			b[off + 1] = (byte) (n >>> 8);
			b[off + 2] = (byte) (n >>> 16);
			b[off + 3] = (byte) (n >>> 24);
		} else {
			b[off] = (byte) (n >>> 24);
			b[off + 1] = (byte) (n >>> 16);
			b[off + 2] = (byte) (n >>> 8);
			b[off + 3] = (byte) n;
		}
	}
415343
def check_format(format, subtype=None, endian=None):
    
    try:
        return bool(_format_int(format, subtype, endian))
    except (ValueError, TypeError):
        return False
827044
def get_symbol(x):
    
    hdl = SymbolHandle()
    check_call(_LIB.MXAutogradGetSymbol(x.handle, ctypes.byref(hdl)))
    return Symbol(hdl)
1160435
def read_uint16(self, little_endian=True):
        
        if little_endian:
            endian = "<"
        else:
            endian = ">"
        return self.unpack('%sH' % endian, 2)
57681
def read_int8(self, little_endian=True):
        
        if little_endian:
            endian = "<"
        else:
            endian = ">"
        return self.unpack('%sb' % endian)
570322
def read_uint32(self, little_endian=True):
        
        if little_endian:
            endian = "<"
        else:
            endian = ">"
        return self.unpack('%sI' % endian, 4)