:param inobject: input string, int for getting null string of length of int
    :param inlen: optional parameter, length of a given string can be specified
    :return:
171279
def stringToCharP(inobject, inlen=None):

    
    if inlen and isinstance(inobject, str):
        return create_string_buffer(inobject.encode(encoding='UTF-8'), inlen)
    if isinstance(inobject, bytes):
        return inobject
    if isinstance(inobject, c_int):
        return stringToCharP(" " * inobject.value)
    if isinstance(inobject, int):
        return stringToCharP(" " * inobject)
    return c_char_p(inobject.encode(encoding='UTF-8'))
822644
private static int js_imul(Object[] args)
    {
        if (args == null) {
            return 0;
        }

        int x = ScriptRuntime.toInt32(args, 0);
        int y = ScriptRuntime.toInt32(args, 1);
        return x * y;
    }
424715
public static Invoker parseInvoker(Object proxyObject) {
        InvocationHandler handler = java.lang.reflect.Proxy.getInvocationHandler(proxyObject);
        if (handler instanceof JDKInvocationHandler) {
            return ((JDKInvocationHandler) handler).getProxyInvoker();
        }
        return null;
    }
1202803
def element(self, inp=None):
        
        if inp is None:
            return self.elements[0]
        elif inp in self.elements:
            return inp
        else:
            raise ValueError('cannot convert inp {} to element in {}'
                             ''.format(inp, self))
277950
def set_insn(self, insn):
        
        self.insn = insn
        self.size = len(self.insn)
846795
def create_binary_buffer(init_or_size):
    
    # As per ctypes.create_string_buffer, as of python 2.7.10 at least:
    # - int or long is a length
    # - str or unicode is an initialiser
    # Testing the latter confuses 2to3, so test the former.
    if isinstance(init_or_size, (int, long)):
        init_or_size = bytearray(init_or_size)
    return create_initialised_buffer(init_or_size)
552119
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
		in.defaultReadObject();
		this.nullMask = new boolean[fieldSerializers.length];
	}
1228895
static void isCorrectLength(byte[] object, int length, String name) {
    Validate.notNull(object, "%s cannot be null.", name);

    Validate.isTrue(object.length == length,
        "%s should be %d bytes, found %d bytes.", name, length, object.length);
  }
500876
function stringifyStrictObject( v , runtime )
{
	var i , iMax , keys ;
	
	runtime.str += '{' ;
	
	keys = Object.keys( v ) ;
	
	for ( i = 0 , iMax = keys.length ; i < iMax ; i ++ )
	{
		if ( v[ keys[ i ] ] !== undefined )
		{
			if ( i ) { runtime.str += ',' ; }
			stringifyString( keys[ i ] , runtime ) ;
			runtime.str += ':' ;
			stringifyAnyType( v[ keys[ i ] ] , runtime ) ;
		}
	}
	
	runtime.str += '}' ;
}
1047147
public static InOutParameter inout(final InParameter in) {
        return new InOutParameter() {
            public int getType() {
                return in.getType();
            }

            public Object getValue() {
                return in.getValue();
            }
        };
    }
377632
function (i) {
            var len = this.length,
                j = +i + ( i < 0 ? len : 0 );
            if (j >= 0 && j < len) {
                return vQ(this[j]);
            }
            return null;
        }
430328
public static String readString(final ObjectInput in) throws IOException,
            ClassNotFoundException {
        try {
            Object o = in.readObject();
            return (String) o;
        } catch (OptionalDataException e) {
            StringBuilder bldr = new StringBuilder();
            if (e.length == 0) {
                bldr.append("(attempted to read past end of object data)");
            } else {
                bldr.append("(attempted to read object data when ");
                bldr.append(e.length);
                bldr.append(" byte(s) of primitive data is present)");
            }
            err.println(bldr);
            e.printStackTrace();
            throw e;
        }
    }
245754
public static String readString(DataInput in) throws IOException {
    int length = readVInt(in);
    if (length == -1) return null;
    byte[] buffer = new byte[length];
    in.readFully(buffer);
    return Text.decode(buffer);
  }
699056
function getIniValue (iniObject, keyParts) {
  const current = iniObject[keyParts[0]]
  if (!current) {
    return null
  } else if (keyParts.length === 1) {
    return current
  } else {
    return getIniValue(current, keyParts.slice(1))
  }
}
852696
public static String nn(Object object, Object defaultString) {
        if (object == null || object.toString().isEmpty()) {
            return defaultString == null ? "" : defaultString.toString();
        }

        return object.toString();
    }
1138002
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
        ObjectInputStream.GetField fields = in.readFields();
        String language = (String)fields.get("language", "");
        String script = (String)fields.get("script", "");
        String country = (String)fields.get("country", "");
        String variant = (String)fields.get("variant", "");
        String extStr = (String)fields.get("extensions", "");
        baseLocale = BaseLocale.getInstance(convertOldISOCodes(language), script, country, variant);
        if (extStr != null && extStr.length() > 0) {
            try {
                InternalLocaleBuilder bldr = new InternalLocaleBuilder();
                bldr.setExtensions(extStr);
                localeExtensions = bldr.getLocaleExtensions();
            } catch (LocaleSyntaxException e) {
                throw new IllformedLocaleException(e.getMessage());
            }
        } else {
            localeExtensions = null;
        }
    }
287726
private Object[] handleParameters(IoBuffer in, Notify notify, Input input) {
        Object[] params = new Object[] {};
        List<Object> paramList = new ArrayList<>();
        final Object obj = Deserializer.deserialize(input, Object.class);
        if (obj instanceof Map) {
            // Before the actual parameters we sometimes (connect) get a map of parameters, this is usually null, but if set should be
            // passed to the connection object.
            @SuppressWarnings("unchecked")
            final Map<String, Object> connParams = (Map<String, Object>) obj;
            notify.setConnectionParams(connParams);
        } else if (obj != null) {
            paramList.add(obj);
        }
        while (in.hasRemaining()) {
            paramList.add(Deserializer.deserialize(input, Object.class));
        }
        params = paramList.toArray();
        if (log.isDebugEnabled()) {
            log.debug("Num params: {}", paramList.size());
            for (int i = 0; i < params.length; i++) {
                log.debug(" > {}: {}", i, params[i]);
            }
        }
        return params;
    }