return an inspector object
963646
def create_sqlite_backup_db(audit_tables):
    
    #we always want to create a whole new DB, so delete the old one first
    #if it exists.
    try:
        Popen("rm %s"%(config.get('sqlite', 'backup_url')), shell=True)
        logging.warn("Old sqlite backup DB removed")
    except Exception as e:
        logging.warn(e)

    try:
        aux_dir = config.get('DEFAULT', 'hydra_aux_dir')
        os.mkdir(aux_dir)
        logging.warn("%s created", aux_dir)
    except Exception as e:
        logging.warn(e)

    try:
        backup_dir = config.get('db', 'export_target')
        os.mkdir(backup_dir)
        logging.warn("%s created", backup_dir)
    except Exception as e:
        logging.warn(e)

    db = create_engine(sqlite_engine, echo=True)
    db.connect()
    metadata = MetaData(db)

    for main_audit_table in audit_tables:
        cols = []
        for c in main_audit_table.columns:
            col = c.copy()
            if col.type.python_type == Decimal:
                col.type = DECIMAL()

            cols.append(col)
        Table(main_audit_table.name, metadata, *cols, sqlite_autoincrement=True)

    metadata.create_all(db)
816593
function inspect (depth, options) {
    // get clone of app
    var obj = _.omit(immutableApp, ['express', 'inspect', 'server'])
    // go through modules and remove the same values
    obj.modules = _.mapValues(obj.modules, obj => {
        return _.omit(obj, ['express', 'immutableApp', 'inspect', 'server'])
    })
    // return object which will be formatted
    return obj
}
297382
def get_object(request, pid):
    """"""
    sciobj = d1_gmn.app.models.ScienceObject.objects.get(pid__did=pid)
    content_type_str = d1_gmn.app.object_format_cache.get_content_type(
        sciobj.format.format
    )
    # Return local or proxied SciObj bytes
    response = django.http.StreamingHttpResponse(
        _get_sciobj_iter(sciobj), content_type_str
    )
    d1_gmn.app.views.headers.add_sciobj_properties_headers_to_response(response, sciobj)
    d1_gmn.app.event_log.log_read_event(pid, request)
    return response
1335882
def get(self, model, **spec):
        

        handles = self.__find_handles(model, **spec)
        if len(handles) > 1:
            raise MultipleObjectsReturned()
        if not handles:
            raise ObjectDoesNotExist()
        return self.get_instance(model, handles[0])
88524
def _send_mfg_inspector_request(envelope_data, credentials, destination_url):
  """"""
  logging.info('Uploading result...')
  http = httplib2.Http()

  if credentials.access_token_expired:
    credentials.refresh(http)
  credentials.authorize(http)

  resp, content = http.request(destination_url, 'POST', envelope_data)

  try:
    result = json.loads(content)
  except Exception:
    logging.debug('Upload failed with response %s: %s', resp, content)
    raise UploadFailedError(resp, content)

  if resp.status != 200:
    logging.debug('Upload failed: %s', result)
    raise UploadFailedError(result['error'], result)

  return result
85051
def get(cls):
    """"""
    return {
      SourceRootConfig,
      Reporting,
      Reproducer,
      RunTracker,
      Changed,
      BinaryUtil.Factory,
      Subprocess.Factory
    }
352987
def get_object_id(obj):
    """"""
    try:
        idx = objIds.index(obj)
        return idx + 1
    except ValueError:
        objIds.append(obj)
        return len(objIds)
513502
def main(dbfile, pidfile, mode):
    '''
    
    '''
    Inspector(dbfile, pidfile).reuse_snapshot().snapshot(mode)
1173378
def _get_object(objname, objtype):
    '''
    
    '''
    ret = None
    if objname is None:
        return ret

    if isinstance(objname, string_types):
        if objname in __opts__:
            ret = __opts__[objname]
        master_opts = __pillar__.get('master', {})
        if objname in master_opts:
            ret = master_opts[objname]
        if objname in __pillar__:
            ret = __pillar__[objname]
    elif isinstance(objname, objtype):
        ret = objname

    if not isinstance(ret, objtype):
        ret = None

    return ret
884325
def inspect_current_object(self):
        """"""
        editor = self.get_current_editor()
        editor.sig_display_signature.connect(self.display_signature_help)
        line, col = editor.get_cursor_line_column()
        editor.request_hover(line, col)
644520
def send_mfg_inspector_data(inspector_proto, credentials, destination_url):
  """"""
  envelope = guzzle_pb2.TestRunEnvelope()
  envelope.payload = zlib.compress(inspector_proto.SerializeToString())
  envelope.payload_type = guzzle_pb2.COMPRESSED_MFG_EVENT
  envelope_data = envelope.SerializeToString()

  for _ in xrange(5):
    try:
      result = _send_mfg_inspector_request(
          envelope_data, credentials, destination_url)
      return result
    except UploadFailedError:
      time.sleep(1)

  logging.critical(
      'Could not upload to mfg-inspector after 5 attempts. Giving up.')

  return {}
1193775
public function getInspector()
    {
        if (is_null($this->_inspector)) {
            $this->_inspector = new Inspector($this->_entity);
        }
        return $this->_inspector;
    }
971080
def getmembers(_object, _predicate):
    """"""
    # This should be:
    #return inspect.getmembers(_object, _predicate)

    # ... and it is re-implemented as:
    observers = []
    for key in dir(_object):
        try: m = getattr(_object, key)
        except AttributeError: continue
        if _predicate(m): observers.append((key, m))
        pass
    return observers
96973
def prune(self):
        
        def to_include(obj):
            inc = obj.permission in self.display
            if self.settings['hide_undoc'].lower() == 'true' and not obj.doc:
                inc = False
            return inc

        if self.obj == 'proc' and self.meta['proc_internals'] == 'false':
            self.functions = []
            self.subroutines = []
            self.types = []
            self.interfaces = []
            self.absinterfaces = []
            self.variables = []
        else:
            self.functions = [obj for obj in self.functions if to_include(obj)]
            self.subroutines = [obj for obj in self.subroutines if to_include(obj)]
            self.types = [obj for obj in self.types if to_include(obj)]
            self.interfaces = [obj for obj in self.interfaces if to_include(obj)]
            self.absinterfaces = [obj for obj in self.absinterfaces if to_include(obj)]
            self.variables = [obj for obj in self.variables if to_include(obj)]
            if hasattr(self,'modprocedures'):
                self.modprocedures = [obj for obj in self.modprocedures if to_include(obj)]
            if hasattr(self,'modsubroutines'):
                self.modsubroutines = [obj for obj in self.modsubroutines if to_include(obj)]
            if hasattr(self,'modfunctions'):
                self.modfunctions = [obj for obj in self.modfunctions if to_include(obj)]
        # Recurse
        for obj in self.absinterfaces:
            obj.visible = True
        for obj in self.iterator('functions', 'subroutines', 'types', 'interfaces', 'modprocedures', 'modfunctions', 'modsubroutines'):
            obj.visible = True
        for obj in self.iterator('functions', 'subroutines', 'types', 'modprocedures', 'modfunctions', 'modsubroutines'):
            obj.prune()
1309839
def inspect
      keys = methods - Object.methods - Pipes::Context.instance_methods
      fields = keys.map { |key| "#{key}=#{public_send(key).inspect}" }
      fields << "@error=#{@error.inspect}"
      object_id_hex = '%x' % (object_id << 1)
      "#<Pipes::Context:0x00#{object_id_hex} #{fields.join(', ')}>"
    end
54339
def parent_class_inspector
      @parent_class_inspector ||= ParentClass.new(parsed_source:        class_introspector.parsed_source,
                                                  klasses_to_be_mocked: klasses_to_be_mocked,
                                                  mock_append_name:     mock_append_name).call
    end
382768
def erlang_inspect(raw = false)
      result = '{'
      each_with_index { |obj, i| result << ',' if i > 0; result << Erlang.inspect(obj, raw: raw) }
      result << '}'
      return result
    end