Get a regular expression to match a formatting directive that references the given field name.

        :param field_name: The name of the field to match (a string).
        :returns: A compiled regular expression object.
352330
def get_pattern(self, field_name):
        
        return re.compile(self.raw_pattern.replace(r'\w+', field_name), re.VERBOSE)
894632
def text_fields(field_name)
      text_field = 
        if field_factory = @text_field_factories_cache[field_name.to_sym]
          field_factory.build
        else
          raise(
            UnrecognizedFieldError,
            "No text field configured for #{@class_name} with name '#{field_name}'"
          )
        end
      [text_field]
    end
1121730
def field_(self, name):
    
    try:
        field = self.fields[name]
    except KeyError:
        raise KeyError("Key %r not found in '%s'" % (name, self.__class__.__name__))
    return BoundField(self, field, name)
1132782
def get_ast_field_name(ast):
    """"""
    replacements = {
        # We always rewrite the following field names into their proper underlying counterparts.
        TYPENAME_META_FIELD_NAME: '@class'
    }
    base_field_name = ast.name.value
    normalized_name = replacements.get(base_field_name, base_field_name)
    return normalized_name
850122
def parse_field(lexer: Lexer) -> FieldNode:
    """"""
    start = lexer.token
    name_or_alias = parse_name(lexer)
    if expect_optional_token(lexer, TokenKind.COLON):
        alias: Optional[NameNode] = name_or_alias
        name = parse_name(lexer)
    else:
        alias = None
        name = name_or_alias
    return FieldNode(
        alias=alias,
        name=name,
        arguments=parse_arguments(lexer, False),
        directives=parse_directives(lexer, False),
        selection_set=parse_selection_set(lexer)
        if peek(lexer, TokenKind.BRACE_L)
        else None,
        loc=loc(lexer, start),
    )
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))
96675
def get_field_by_showname(self, showname):
        
        for field in self._get_all_fields_with_alternates():
            if field.showname_key == showname:
                # Return it if "XXX: whatever == XXX"
                return field
588596
def field_by_name(name)
      field = fields[name.to_sym] unless name.blank?
      if field.nil?
        dotted = name.to_s.split('.')[0]
        field = fields[dotted.to_sym] unless dotted.blank?
        if field && field.key_relation.nil?
          return nil
        end
      end
      field
    end
784415
def get_dict_for_field(self, field_name):
        
        try:
            field = self.model._meta.get_field(field_name)
        except FieldDoesNotExist:
            field = None
        return {
            'label': self.get_field_label(field_name, field),
            'value': self.get_field_display_value(field_name, field),
        }
1327093
def parse_fields(fields)
      if fields.blank?
        {}
      elsif fields =~ /^#{match_fields}$/
        fields.scan(/(#{match_field})(?:,|$)/).inject({}) do |m, match|
          m.merge(parse_field(match[0]))
        end
      else
        raise ArgumentError, "The fields string is not in the correct format.\n\n'#{fields}' did not match: #{match_fields}"
      end
    end
1197376
def generate(self, field_name, field):
        

        if hasattr(self, 'generate_%s' % field.__class__.__name__.lower()):
            generator = getattr(
                self,
                'generate_%s' % field.__class__.__name__.lower())
            return generator(
                field_name,
                field,
                (field.verbose_name or field_name).capitalize())
        else:
            raise NotImplementedError('%s is not supported by MongoForm' % \
                field.__class__.__name__)
1289754
public function getErrorByFieldName(string $field_name) : string
    {
        if (false === $this->validated) $this->validate();
        foreach ($this->validation_errors as $error) {
            if ($error->getFieldName() == $field_name) {
                return $error->getErrorMessage();
            }
        }
        return '';
    }
377775
def get_document_field_display(self, field_name, field):
        
        document = getattr(self.instance, field_name)
        if document:
            return mark_safe(
                '<a href="%s">%s <span class="meta">(%s, %s)</span></a>' % (
                    document.url,
                    document.title,
                    document.file_extension.upper(),
                    filesizeformat(document.file.size),
                )
            )
        return self.model_admin.get_empty_value_display()
1215897
def widget_kwargs_for_field(self, field_name):
        
        if self._meta.widgets:
            return self._meta.widgets.get(field_name, {})
        return {}
37041
public static String getMapSetterName(Field field) {
        if (field.isMap()) {
            return SETTER_PREFIX + Formatter.toPascalCase(field.getName()) + MAP_SUFFIX;
        }
        throw new IllegalArgumentException(field.toString());
    }
673199
public static String getFieldGetterName(Field field) {
        String getterName = GETTER_PREFIX + Formatter.toPascalCase(field.getName());
        if ("getClass".equals(getterName)) {
            return getterName + "_";
        }
        return getterName;
    }
1135897
public static String javaOneofConstantName(Field field) {
        String name = field.getName();
        String underscored = Formatter.toUnderscoreCase(name);
        return Formatter.toUpperCase(underscored);
    }