Generate output for the `_inspect` helper based on the
given `type`
964248
function switchOutput(type, json) {
  if (type[0] === '.') type = type.slice(1);
  var result = '';

  switch (type) {
    case 'md':
      result = ''
        + '\n```json\n'
        + json
        + '\n```\n';
      break;
    case 'html':
      result = ''
        + '<div class="highlight highlight-json">\n'
        + '<pre><code>\n'
        + json
        + '</code></pre>'
        + '</div>';
      break;
    default: {
      result = json;
      break;
    }
  }
  return result;
}
1135976
def action(self, event_type, when, **kwargs):
        
        l.debug("Event %s (%s) firing...", event_type, when)
        for k,v in kwargs.items():
            if k not in inspect_attributes:
                raise ValueError("Invalid inspect attribute %s passed in. Should be one of: %s" % (k, inspect_attributes))
            #l.debug("... %s = %r", k, v)
            l.debug("... setting %s", k)
            setattr(self, k, v)

        for bp in self._breakpoints[event_type]:
            l.debug("... checking bp %r", bp)
            if bp.check(self.state, when):
                l.debug("... FIRE")
                bp.fire(self.state)
918313
def debug(value):
    
    print("%s %s: " % (type(value), value))
    print(dir(value))
    print('\n\n')
    return ''
628155
def inspect
      ss = if @source.respond_to?(:join)
             @source.map(&:inspect).join(', ')
           elsif @source.is_a?(Proc)
             "?proc"
           else
             @source.inspect
           end

      ms = @metadata.reject { |_, v| v.nil? }
      ms.merge!(delta: delta) if delta != 1
      ms = ms.map { |k, v| "#{k}: #{v.inspect}" }.join(', ')

      "P[#{ss}#{", #{ms}" unless ms.empty?}]"
    end
712789
def inspect( indent = nil, lines = nil )
      if variables.empty?
        if dimension == 0 and not indent
          "#{typecode.inspect}(#{force.inspect})"
        else
          if indent
            prepend = ''
          else
            prepend = "#{Hornetseye::MultiArray(typecode, dimension).inspect}:\n"
            indent = 0
            lines = 0
          end
          if empty?
            retval = '[]'
          else
            retval = '[ '
            for i in 0 ... shape.last
              x = element i
              if x.dimension > 0
                if i > 0
                  retval += ",\n  "
                  lines += 1
                  if lines >= 10
                    retval += '...' if indent == 0
                    break
                  end
                  retval += '  ' * indent
                end
                str = x.inspect indent + 1, lines
                lines += str.count "\n"
                retval += str
                if lines >= 10
                  retval += '...' if indent == 0
                  break
                end
              else
                retval += ', ' if i > 0
                str = x.force.inspect
                if retval.size + str.size >= 74 - '...'.size -
                    '[  ]'.size * indent.succ
                  retval += '...'
                  break
                else
                  retval += str
                end
              end
            end
            retval += ' ]' unless lines >= 10
          end
          prepend + retval
        end
      else
        to_s
      end
    end
1091503
def generate_data_type(self, data_type):
        """"""
        if isinstance(data_type, Struct):
            # Output a struct definition.
            self.emit('')
            self.emit('struct %s' % data_type.name)
            with self.indent():
                if data_type.doc is not None:
                    self.emit(self.format_string(data_type.doc))
                for field in data_type.fields:
                    type_repr = self.format_data_type(field.data_type)
                    if not field.has_default:
                        self.emit('%s %s' % (field.name, type_repr))
                    else:
                        self.emit('%s %s = %s' %
                            (field.name, type_repr, self.format_value(field.default)))
                    if field.doc is not None:
                        with self.indent():
                            self.emit(self.format_value(field.doc))
        elif isinstance(data_type, Union):
            # Output a union definition.
            self.emit('')
            self.emit('union %s' % data_type.name)
            with self.indent():
                if data_type.doc is not None:
                    self.emit(self.format_string(data_type.doc))
                for field in data_type.fields:
                    name = field.name
                    # Add a star for a catch-all field.
                    # (There are two ways to recognize these.)
                    if field.catch_all or field is data_type.catch_all_field:
                        name += '*'
                    if isinstance(field.data_type, Void):
                        self.emit('%s' % (name))
                    else:
                        type_repr = self.format_data_type(field.data_type)
                        self.emit('%s %s' % (name, type_repr))
                    if field.doc is not None:
                        with self.indent():
                            self.emit(self.format_value(field.doc))
        else:
            # Don't know what this is.
            self.emit('')
            self.emit('# ??? %s' % repr(data_type))
146140
function debugOutputAstAsTypeScript(ast) {
    var /** @type {?} */ converter = new _TsEmitterVisitor();
    var /** @type {?} */ ctx = EmitterVisitorContext.createRoot();
    var /** @type {?} */ asts = Array.isArray(ast) ? ast : [ast];
    asts.forEach(function (ast) {
        if (ast instanceof Statement) {
            ast.visitStatement(converter, ctx);
        }
        else if (ast instanceof Expression) {
            ast.visitExpression(converter, ctx);
        }
        else if (ast instanceof Type$1) {
            ast.visitType(converter, ctx);
        }
        else {
            throw new Error("Don't know how to print debug info for " + ast);
        }
    });
    return ctx.toSource();
}
119873
def printdeps(obj,              # type: Mapping[Text, Any]
              document_loader,  # type: Loader
              stdout,           # type: Union[TextIO, StreamWriter]
              relative_deps,    # type: bool
              uri,              # type: Text
              basedir=None,     # type: Text
              nestdirs=True     # type: bool
             ):  # type: (...) -> None
    """"""
    deps = find_deps(obj, document_loader, uri, basedir=basedir,
                     nestdirs=nestdirs)
    if relative_deps == "primary":
        base = basedir if basedir else os.path.dirname(uri_file_path(str(uri)))
    elif relative_deps == "cwd":
        base = os.getcwd()
    visit_class(deps, ("File", "Directory"), functools.partial(
        make_relative, base))
    stdout.write(json_dumps(deps, indent=4))
865230
def clean_ret_type(ret_type):
    """"""
    ret_type = get_printable(ret_type).strip()
    if ret_type == 'LRESULT LRESULT':
        ret_type = 'LRESULT'
    for bad in [
            'DECLSPEC_NORETURN', 'NTSYSCALLAPI', '__kernel_entry',
            '__analysis_noreturn', '_Post_equals_last_error_',
            '_Maybe_raises_SEH_exception_',
            '_CRT_STDIO_INLINE', '_ACRTIMP'
    ]:
        if bad in ret_type:
            ret_type = ret_type.replace(bad, '').strip()
            logging.debug(_('cleaned %s'), bad)
    return ret_type
742999
function inspect(engine) {
  var inspect = ['"' + engine.name + '"'];
  var exts = utils.arrayify(engine.options.ext).join(', ');
  inspect.push('<ext "' + exts + '">');
  engine.inspect = function() {
    return '<Engine ' + inspect.join(' ') + '>';
  };
}
803056
function inspect(callback) {
  return function (filename) {
    var chunks = [];

    function transform(chunk, encoding, done) {
      /* jshint validthis:true */
      chunks.push(chunk);
      this.push(chunk);
      done();
    }

    function flush(done) {
      callback(filename, chunks.join(''), done);
      if (callback.length < 3) {
        done();
      }
    }

    return through(transform, flush);
  }
}
667697
def run_check_kind(_):
    '''
    
    '''
    for kindv in router_post:
        for rec_cat in MCategory.query_all(kind=kindv):
            catid = rec_cat.uid
            catinfo = MCategory.get_by_uid(catid)
            for rec_post2tag in MPost2Catalog.query_by_catid(catid):
                postinfo = MPost.get_by_uid(rec_post2tag.post_id)
                if postinfo.kind == catinfo.kind:
                    pass
                else:
                    print(postinfo.uid)
921327
def detect_output_type(args):
    """"""
    if not args['single'] and not args['multiple']:
        # Save to multiple files if multiple files/URLs entered
        if len(args['query']) > 1 or len(args['out']) > 1:
            args['multiple'] = True
        else:
            args['single'] = True
113032
function lookupType (path, spec, types) {
  const type = (() => {
    const match = R.path(path, spec).match(/^#\/definitions\/(.+)/)
    if (match !== void 0) {
      return match[1]
    } else {
      throw Error(`Reference path does not meet specification: ${path}`)
    }
  })()

  if (type in types) {
    return types[type]
  } else {
    throw Error(`Couldn't find definition for ${type}`)
  }
}
1167652
private void inspectClassProperties(final String type,
            Map<String, Property> properties)
   {

      JavaSource<?> clazz = sourceForName(this.project, type);

      if (clazz instanceof MethodHolder<?>)
      {
         lookupGetters(properties, (MethodHolder<?>) clazz);
         lookupSetters(properties, (MethodHolder<?>) clazz);

         if (clazz instanceof JavaClass)
         {
            JavaClassSource source = Roaster.parse(JavaClassSource.class,
                     clazz.toString());
            if (!source.getSuperType().equals("java.lang.Object"))
            {
               inspectClassProperties(source.getSuperType(), properties);
            }
         }
      }
   }
184700
function(type, desc){
        this.assert(
            type == typeof this.obj
            , function(){ return 'expected ' + this.inspect + ' to be a ' + type + (desc ? " | " + desc : "") }
            , function(){ return 'expected ' + this.inspect + ' not to be a ' + type  + (desc ? " | " + desc : "") })
        return this;
    }
716426
def fprint(self, obj, stream=None, **kwargs):
        """"""
        if stream is None:
            stream = sys.stdout

        options = self.options
        options.update(kwargs)

        if isinstance(obj, dimod.SampleSet):
            self._print_sampleset(obj, stream, **options)
            return

        raise TypeError("cannot format type {}".format(type(obj)))