Closure of log for zero arguments.
964096
def _protected_log(x1):
    """"""
    with np.errstate(divide='ignore', invalid='ignore'):
        return np.where(np.abs(x1) > 0.001, np.log(np.abs(x1)), 0.)
1334096
def with_log(func):
    
    @functools.wraps(func)
    def wrapper(*args, **kwargs):
        """Inject `log` argument into wrapped function.

        :param list args: Pass through all positional arguments.
        :param dict kwargs: Pass through all keyword arguments.
        """
        decorator_logger = logging.getLogger('@with_log')
        decorator_logger.debug('Entering %s() function call.', func.__name__)
        log = kwargs.get('log', logging.getLogger(func.__name__))
        try:
            ret = func(log=log, *args, **kwargs)
        finally:
            decorator_logger.debug('Leaving %s() function call.', func.__name__)
        return ret
    return wrapper
1035756
def cleanup_log_files(outputfile):
    """"""
    d = os.path.dirname(os.path.abspath(outputfile))
    logfiles = [f for f in os.listdir(d) if f.endswith('ogg.log')]
    for f in logfiles:
        os.remove(f)
185073
def PowersOf(logbase, count, lower=0, include_zero=True):
    """"""
    if not include_zero:
        return [logbase ** i for i in range(lower, count+lower)]
    else:
        return [0] + [logbase ** i for i in range(lower, count+lower)]
792861
def log_level_type(arg):
	""""""
	if not arg.upper() in ('NOTSET', 'DEBUG', 'INFO', 'WARNING', 'ERROR', 'CRITICAL'):
		raise argparse.ArgumentTypeError("{0} is not a valid log level".format(repr(arg)))
	return getattr(logging, arg.upper())
439736
public static void closeQuietly(@Nullable final Closeable closeable, @Nonnull final Logger log) {
        try {
            if (null != closeable) {
                closeable.close();
            }
        } catch (Exception e) {
            log.error("Exception during cleanup of a Closeable, ignoring", e);
        }
    }
1181154
def log_wrap(origfunc):
    
    def orig_func_wraper(msg, *args):
        # Take the callers name and snap it in two, result is log
        # level, e.g.: log_debug is DEBUG level.
        log_level = origfunc.__name__.split("_")[1]

        import Log
        if getattr(Log, "LOG_%s" % log_level.upper()) <= \
                Log.LOG_LEVEL_CURRENT:
            # flatten and stringify the positional params so we don't
            # tuple() a tuple or an array and end up with
            # weirdness.
            a = map(str, juicer.utils.flatten(args))
            print_log_msg(log_level, str(msg) % tuple(a))
    return orig_func_wraper
350253
def func_reconstruct_closure(values):
    
    nums = range(len(values))
    src = ["def func(arg):"]
    src += ["  _%d = arg[%d]" % (n, n) for n in nums]
    src += ["  return lambda:(%s)" % ','.join(["_%d" % n for n in nums]), ""]
    src = '\n'.join(src)
    try:
        exec(src, globals())
    except:
        raise SyntaxError(src)
    return func(values).__closure__
645339
def printlog(self, string, verbose=None, flush=False):
        """"""
        if self.writelog:
            self.logger.info(string)
        if verbose or (self.verbose and verbose is None):
            print(string, flush=flush)
898227
def log(self, n=None, **kwargs):
        
        cmd = ['hg', 'log']
        if n:
            cmd.extend('-l%d' % n)
        cmd.extend(
            (('--%s=%s' % (k, v)) for (k, v)
                in iteritems(kwargs))
        )
        return self.sh(cmd, shell=False)
684345
def log(_self, _level, _message, *args, **kwargs):
        """
        logger = _self.opt(
            exception=_self._exception,
            record=_self._record,
            lazy=_self._lazy,
            ansi=_self._ansi,
            raw=_self._raw,
            depth=_self._depth + 1,
        )
        logger._make_log_function(_level)(logger, _message, *args, **kwargs)
467783
def close_log(log_file):
    
    sys.stdout = sys.__stdout__
    if log_file is not None:
        log_file.close()
        del log_file
19924
private static String getLeadingZeros(int i, int size)
	{
		assert i <= size;
		int w1 = (int) Math.floor(Math.log10(size));
		int w2 = (int) Math.floor(Math.log10(i));
		
		String s = "";

		for (int j = w2; j < w1; j++)
		{
			s += "0";
		}
		return s;
	}
1337094
def logvalue(self, key, value):
        """"""
        if not hasattr(self, 'logvalues'):
            self.logvalues = {}
        self.logvalues[key] = value
523089
function logm() {
    var args = [].slice.call(arguments);
    var level = args.shift();
    if (logFor(level)) {
      var msg = args.shift();
      args.unshift(posix.getpid());
      args.unshift(level);
      args.unshift("[%s] m(%d): " + msg);
      logv(args);
    }
  }
922529
def log(self, *args, **kwargs):
        
        if self.suppress_errors:
            try:
                self._log(*args, **kwargs)
                return True
            except:
                return False
        else:
            self._log(*args, **kwargs)
            return True
1035707
def closeLog(self):
        
        self._logPtr.close()
        if self._namePtr:
            self._namePtr.close()
        self.log = 0