Lookups given fields in _node, and if not found in _full_metadata. Raises KeyError if not found anywhere.
484964
def _field(self, *keys) -> Any:
        """"""
        try:
            d = self._node
            for key in keys:
                d = d[key]
            return d
        except KeyError:
            d = self._full_metadata
            for key in keys:
                d = d[key]
            return d
686591
def scan_for_field(self, field_key):
        '''
        
        '''
        if field_key == self.get_name():
            return self
        if field_key in self._fields_dict:
            return self._fields_dict[field_key]
        for field in self._fields:
            if isinstance(field, Container):
                resolved = field.scan_for_field(field_key)
                if resolved:
                    return resolved
        return None
560930
def find(key):
    
    docs = list(collection.find({KEY_FIELD: key}))
    # Return None if we didn't find anything.
    if not docs:
        return None
    pickled_value = docs[0][VALUE_FIELD]
    # Unpickle and return the value.
    return pickle.loads(pickled_value)
1254891
def get_fields(model, fields, meta=None):
    
    model = get_model(model)
    if fields is not None:
        f = fields
    elif meta and hasattr(model, meta):
        m = getattr(model, meta)
        if hasattr(m, 'fields'):
            f = m.fields
        else:
            f = model._fields_list
    else:
        f = model._fields_list
        
    fields_list = []
    for x in f:
        field = {}
        if isinstance(x, str):  #so x is field_name
            field['name'] = x
        elif isinstance(x, tuple):
            field['name'] = x[0]
            field['field'] = x[1]
        elif isinstance(x, dict):
            field = x.copy()
        else:
            raise UliwebError('Field definition {!r} is not right, it should be just like (field_name, form_field_obj)'.format(x))
        
        if 'prop' not in field:
            if hasattr(model, field['name']):
                field['prop'] = getattr(model, field['name'])
            else:
                field['prop'] = None
        
        fields_list.append((field['name'], field))
    return fields_list
216217
def connection_field?(field)
      type = field.type.unwrap

      if edges_field = type.get_field('edges')
        edges = edges_field.type.unwrap
        if node_field = edges.get_field('node')
          return node_field?(node_field)
        end
      end

      false
    end
996635
def _get_local_fields(self, model):
        ""
        local = [f for f in model._meta.fields]
        m2m = [f for f in model._meta.many_to_many]
        fields = local + m2m
        names = tuple([x.name for x in fields])

        return {
            ':local': dict(list(zip(names, fields))),
        }
790302
def lookup(name, object, field: :id, cast: false)
      @template.add_node Nodes::Lookup.new(name, object, field, cast)
    end
964609
def match_field(field_class):
    
    for cls in field_class.mro():
        if cls in list(LOOKUP_TABLE.keys()):
            return cls
    # could not match the field class
    raise Exception('{0} None Found '.format(field_class))
1069625
def lookup_field_orderable(self, field):
        
        try:
            self.model._meta.get_field_by_name(field)
            return True
        except Exception:
            # that field doesn't exist, so not sortable
            return False
1167810
def lookup(self, key_name, headers=None, callback=None):
        
        return self.get_key(key_name, headers=headers, callback=callback)
222761
def get_pks(self, field_vals):
        """"""
        field_name = self.schema.pk.name
        return self.in_field(field_name, field_vals).get()
361196
def _select_deep_meta(field, depth):
    
    name = field.name
    if hasattr(field.value, "__call__"):
        try:

            def assign(source, destination):
                destination[name] = field.value(wrap(source))
                return 0, None

            return assign
        except Exception as e:

            def assign(source, destination):
                destination[name] = None
                return 0, None

            return assign

    prefix = field.value[depth : len(field.value) - 1 :]
    if prefix:

        def assign(source, destination):
            for i, f in enumerate(prefix):
                source = source.get(f)
                if source is None:
                    return 0, None
                if is_list(source):
                    return depth + i + 1, source

            f = field.value.last()
            try:
                if not f:  # NO NAME FIELD INDICATES SELECT VALUE
                    destination[name] = source
                else:
                    destination[name] = source.get(f)
            except Exception as e:
                Log.error(
                    "{{value}} does not have {{field}} property",
                    value=source,
                    field=f,
                    cause=e,
                )
            return 0, None

        return assign
    else:
        f = field.value[0]
        if not f:  # NO NAME FIELD INDICATES SELECT VALUE

            def assign(source, destination):
                destination[name] = source
                return 0, None

            return assign
        else:

            def assign(source, destination):
                try:
                    destination[name] = source.get(f)
                except Exception as e:
                    Log.error(
                        "{{value}} does not have {{field}} property",
                        value=source,
                        field=f,
                        cause=e,
                    )
                return 0, None

            return assign
96978
def find_field_meta(obj, value):
    
    if "__" in value:
        value_list = value.split("__")
        child_obj = obj._meta.get_field(value_list[0]).rel.to
        return find_field_meta(child_obj, "__".join(value_list[1:]))
    return obj._meta.get_field(value)
19885
def separate_fields(fields):
    
    flat_fields = {}
    nested_fields = {}

    # exclude "id" and "meta" elements
    for k, v in fields.items():
        # TODO: remove dependence on KEYS_TO_INCLUDE
        if k not in KEYS_TO_EXCLUDE:
            if type(v) not in [type({}), type([])]:
                flat_fields.update({k: v})
            else:
                nested_fields.update({k: v})

    return flat_fields, nested_fields
247134
def lookupBaseFieldTypeByName( fieldName )
      type = ""
      fid = lookupFieldIDByName( fieldName )
      field = lookupField( fid ) if fid
      type = field.attributes[ "base_type" ] if field
      type
   end
773186
def load_unknown_fields(self, data, original_data):
        """"""
        if isinstance(original_data, list):
            for elem in original_data:
                self.load_unknown_fields(data, elem)
        else:
            for key, value in original_data.items():
                if key not in data:
                    data[key] = value
        return data
112557
def expand_entity(self, entity):
        
        if self.name in entity:
            return entity
        for key, value in entity.items():
            if isinstance(value, dict):
                if self.name in value:
                    return value
        raise KeyError("The field %s (%s) not found in %s" % (self.name, self._rule['type'], entity))