neulab/docprompting-conala huggingface dataset:
class StringAgg(expression, delimiter, distinct=False, filter=None, default=None, ordering=())  
Returns the input values concatenated into a string, separated by the delimiter string, or default if there are no values.  
delimiter  
Required argument. Needs to be a string. 
  
distinct  
An optional boolean argument that determines if concatenated values will be distinct. Defaults to False. 
  
ordering  
An optional string of a field name (with an optional "-" prefix which indicates descending order) or an expression (or a tuple or list of strings and/or expressions) that specifies the ordering of the elements in the result string. Examples are the same as for ArrayAgg.ordering. 
  Deprecated since version 4.0: If there are no rows and default is not provided, StringAgg returns an empty string instead of None. This behavior is deprecated and will be removed in Django 5.0. If you need it, explicitly set default to Value('').
distinct  
An optional boolean argument that determines if concatenated values will be distinct. Defaults to False.
ordering  
An optional string of a field name (with an optional "-" prefix which indicates descending order) or an expression (or a tuple or list of strings and/or expressions) that specifies the ordering of the elements in the result string. Examples are the same as for ArrayAgg.ordering.
class ExclusionConstraint(*, name, expressions, index_type=None, condition=None, deferrable=None, include=None, opclasses=())  
Creates an exclusion constraint in the database. Internally, PostgreSQL implements exclusion constraints using indexes. The default index type is GiST. To use them, you need to activate the btree_gist extension on PostgreSQL. You can install it using the BtreeGistExtension migration operation. If you attempt to insert a new row that conflicts with an existing row, an IntegrityError is raised. Similarly, when update conflicts with an existing row.
class ArrayField(base_field, size=None, **options)  
A field for storing lists of data. Most field types can be used, and you pass another field instance as the base_field. You may also specify a size. ArrayField can be nested to store multi-dimensional arrays. If you give the field a default, ensure it’s a callable such as list (for an empty default) or a callable that returns a list (such as a function). Incorrectly using default=[] creates a mutable default that is shared between all instances of ArrayField.  
base_field  
This is a required argument. Specifies the underlying data type and behavior for the array. It should be an instance of a subclass of Field. For example, it could be an IntegerField or a CharField. Most field types are permitted, with the exception of those handling relational data (ForeignKey, OneToOneField and ManyToManyField). It is possible to nest array fields - you can specify an instance of ArrayField as the base_field. For example: from django.contrib.postgres.fields import ArrayField
from django.db import models

class ChessBoard(models.Model):
    board = ArrayField(
        ArrayField(
            models.CharField(max_length=10, blank=True),
            size=8,
        ),
        size=8,
    )
 Transformation of values between the database and the model, validation of data and configuration, and serialization are all delegated to the underlying base field. 
  
size  
This is an optional argument. If passed, the array will have a maximum size as specified. This will be passed to the database, although PostgreSQL at present does not enforce the restriction.
base_field  
This is a required argument. Specifies the underlying data type and behavior for the array. It should be an instance of a subclass of Field. For example, it could be an IntegerField or a CharField. Most field types are permitted, with the exception of those handling relational data (ForeignKey, OneToOneField and ManyToManyField). It is possible to nest array fields - you can specify an instance of ArrayField as the base_field. For example: from django.contrib.postgres.fields import ArrayField
from django.db import models

class ChessBoard(models.Model):
    board = ArrayField(
        ArrayField(
            models.CharField(max_length=10, blank=True),
            size=8,
        ),
        size=8,
    )
 Transformation of values between the database and the model, validation of data and configuration, and serialization are all delegated to the underlying base field.
size  
This is an optional argument. If passed, the array will have a maximum size as specified. This will be passed to the database, although PostgreSQL at present does not enforce the restriction.
class BigIntegerRangeField(**options)  
Stores a range of large integers. Based on a BigIntegerField. Represented by an int8range in the database and a NumericRange in Python. Regardless of the bounds specified when saving the data, PostgreSQL always returns a range in a canonical form that includes the lower bound and excludes the upper bound, that is [).
class CIText(**options)  
A mixin to create case-insensitive text fields backed by the citext type. Read about the performance considerations prior to using it. To use citext, use the CITextExtension operation to set up the citext extension in PostgreSQL before the first CreateModel migration operation. If you’re using an ArrayField of CIText fields, you must add 'django.contrib.postgres' in your INSTALLED_APPS, otherwise field values will appear as strings like '{thoughts,django}'. Several fields that use the mixin are provided:
class CITextField(**options)  
These fields subclass CharField, EmailField, and TextField, respectively. max_length won’t be enforced in the database since citext behaves similar to PostgreSQL’s text type.
class DateRangeField(**options)  
Stores a range of dates. Based on a DateField. Represented by a daterange in the database and a DateRange in Python. Regardless of the bounds specified when saving the data, PostgreSQL always returns a range in a canonical form that includes the lower bound and excludes the upper bound, that is [).
class DateTimeRangeField(**options)  
Stores a range of timestamps. Based on a DateTimeField. Represented by a tstzrange in the database and a DateTimeTZRange in Python.
class DecimalRangeField(**options)  
Stores a range of floating point values. Based on a DecimalField. Represented by a numrange in the database and a NumericRange in Python.
class django.contrib.postgres.forms.BaseRangeField  
Base class for form range fields.  
base_field  
The form field to use. 
  
range_type  
The psycopg2 range type to use.
class HStoreField(**options)  
A field for storing key-value pairs. The Python data type used is a dict. Keys must be strings, and values may be either strings or nulls (None in Python). To use this field, you’ll need to:  Add 'django.contrib.postgres' in your INSTALLED_APPS. 
Set up the hstore extension in PostgreSQL.  You’ll see an error like can't adapt type 'dict' if you skip the first step, or type "hstore" does not exist if you skip the second.
class IntegerRangeField(**options)  
Stores a range of integers. Based on an IntegerField. Represented by an int4range in the database and a NumericRange in Python. Regardless of the bounds specified when saving the data, PostgreSQL always returns a range in a canonical form that includes the lower bound and excludes the upper bound, that is [).
class RangeBoundary(inclusive_lower=True, inclusive_upper=False)  
 
inclusive_lower  
If True (default), the lower bound is inclusive '[', otherwise it’s exclusive '('. 
  
inclusive_upper  
If False (default), the upper bound is exclusive ')', otherwise it’s inclusive ']'.
inclusive_lower  
If True (default), the lower bound is inclusive '[', otherwise it’s exclusive '('.
inclusive_upper  
If False (default), the upper bound is exclusive ')', otherwise it’s inclusive ']'.
class RangeField(**options)  
Base class for model range fields.  
base_field  
The model field class to use. 
  
range_type  
The psycopg2 range type to use. 
  
form_field  
The form field class to use. Should be a subclass of django.contrib.postgres.forms.BaseRangeField.
form_field  
The form field class to use. Should be a subclass of django.contrib.postgres.forms.BaseRangeField.
class DateRangeField  
Based on DateField and translates its input into DateRange. Default for DateRangeField.
class DateTimeRangeField  
Based on DateTimeField and translates its input into DateTimeTZRange. Default for DateTimeRangeField.
class DecimalRangeField  
Based on DecimalField and translates its input into NumericRange. Default for DecimalRangeField.
class HStoreField  
A field which accepts JSON encoded data for an HStoreField. It casts all values (except nulls) to strings. It is represented by an HTML <textarea>.  User friendly forms HStoreField is not particularly user friendly in most cases, however it is a useful way to format data from a client-side widget for submission to the server.   Note On occasions it may be useful to require or restrict the keys which are valid for a given field. This can be done using the KeysValidator.
class IntegerRangeField  
Based on IntegerField and translates its input into NumericRange. Default for IntegerRangeField and BigIntegerRangeField.
class RangeWidget(base_widget, attrs=None)  
Widget used by all of the range fields. Based on MultiWidget. RangeWidget has one required argument:  
base_widget  
A RangeWidget comprises a 2-tuple of base_widget. 
  
decompress(value)  
Takes a single “compressed” value of a field, for example a DateRangeField, and returns a tuple representing a lower and upper bound.
base_widget  
A RangeWidget comprises a 2-tuple of base_widget.
decompress(value)  
Takes a single “compressed” value of a field, for example a DateRangeField, and returns a tuple representing a lower and upper bound.
class SimpleArrayField(base_field, delimiter=', ', max_length=None, min_length=None)  
A field which maps to an array. It is represented by an HTML <input>.  
base_field  
This is a required argument. It specifies the underlying form field for the array. This is not used to render any HTML, but it is used to process the submitted data and validate it. For example: >>> from django import forms
>>> from django.contrib.postgres.forms import SimpleArrayField

>>> class NumberListForm(forms.Form):
...     numbers = SimpleArrayField(forms.IntegerField())

>>> form = NumberListForm({'numbers': '1,2,3'})
>>> form.is_valid()
True
>>> form.cleaned_data
{'numbers': [1, 2, 3]}

>>> form = NumberListForm({'numbers': '1,2,a'})
>>> form.is_valid()
False
 
  
delimiter  
This is an optional argument which defaults to a comma: ,. This value is used to split the submitted data. It allows you to chain SimpleArrayField for multidimensional data: >>> from django import forms
>>> from django.contrib.postgres.forms import SimpleArrayField

>>> class GridForm(forms.Form):
...     places = SimpleArrayField(SimpleArrayField(IntegerField()), delimiter='|')

>>> form = GridForm({'places': '1,2|2,1|4,3'})
>>> form.is_valid()
True
>>> form.cleaned_data
{'places': [[1, 2], [2, 1], [4, 3]]}
  Note The field does not support escaping of the delimiter, so be careful in cases where the delimiter is a valid character in the underlying field. The delimiter does not need to be only one character.  
  
max_length  
This is an optional argument which validates that the array does not exceed the stated length. 
  
min_length  
This is an optional argument which validates that the array reaches at least the stated length. 
  User friendly forms SimpleArrayField is not particularly user friendly in most cases, however it is a useful way to format data from a client-side widget for submission to the server.
base_field  
This is a required argument. It specifies the underlying form field for the array. This is not used to render any HTML, but it is used to process the submitted data and validate it. For example: >>> from django import forms
>>> from django.contrib.postgres.forms import SimpleArrayField

>>> class NumberListForm(forms.Form):
...     numbers = SimpleArrayField(forms.IntegerField())

>>> form = NumberListForm({'numbers': '1,2,3'})
>>> form.is_valid()
True
>>> form.cleaned_data
{'numbers': [1, 2, 3]}

>>> form = NumberListForm({'numbers': '1,2,a'})
>>> form.is_valid()
False
delimiter  
This is an optional argument which defaults to a comma: ,. This value is used to split the submitted data. It allows you to chain SimpleArrayField for multidimensional data: >>> from django import forms
>>> from django.contrib.postgres.forms import SimpleArrayField

>>> class GridForm(forms.Form):
...     places = SimpleArrayField(SimpleArrayField(IntegerField()), delimiter='|')

>>> form = GridForm({'places': '1,2|2,1|4,3'})
>>> form.is_valid()
True
>>> form.cleaned_data
{'places': [[1, 2], [2, 1], [4, 3]]}
  Note The field does not support escaping of the delimiter, so be careful in cases where the delimiter is a valid character in the underlying field. The delimiter does not need to be only one character.
max_length  
This is an optional argument which validates that the array does not exceed the stated length.
min_length  
This is an optional argument which validates that the array reaches at least the stated length.
class SplitArrayField(base_field, size, remove_trailing_nulls=False)  
This field handles arrays by reproducing the underlying field a fixed number of times.  
base_field  
This is a required argument. It specifies the form field to be repeated. 
  
size  
This is the fixed number of times the underlying field will be used. 
  
remove_trailing_nulls  
By default, this is set to False. When False, each value from the repeated fields is stored. When set to True, any trailing values which are blank will be stripped from the result. If the underlying field has required=True, but remove_trailing_nulls is True, then null values are only allowed at the end, and will be stripped. Some examples: SplitArrayField(IntegerField(required=True), size=3, remove_trailing_nulls=False)

['1', '2', '3']  # -> [1, 2, 3]
['1', '2', '']  # -> ValidationError - third entry required.
['1', '', '3']  # -> ValidationError - second entry required.
['', '2', '']  # -> ValidationError - first and third entries required.

SplitArrayField(IntegerField(required=False), size=3, remove_trailing_nulls=False)

['1', '2', '3']  # -> [1, 2, 3]
['1', '2', '']  # -> [1, 2, None]
['1', '', '3']  # -> [1, None, 3]
['', '2', '']  # -> [None, 2, None]

SplitArrayField(IntegerField(required=True), size=3, remove_trailing_nulls=True)

['1', '2', '3']  # -> [1, 2, 3]
['1', '2', '']  # -> [1, 2]
['1', '', '3']  # -> ValidationError - second entry required.
['', '2', '']  # -> ValidationError - first entry required.

SplitArrayField(IntegerField(required=False), size=3, remove_trailing_nulls=True)

['1', '2', '3']  # -> [1, 2, 3]
['1', '2', '']  # -> [1, 2]
['1', '', '3']  # -> [1, None, 3]
['', '2', '']  # -> [None, 2]
base_field  
This is a required argument. It specifies the form field to be repeated.
remove_trailing_nulls  
By default, this is set to False. When False, each value from the repeated fields is stored. When set to True, any trailing values which are blank will be stripped from the result. If the underlying field has required=True, but remove_trailing_nulls is True, then null values are only allowed at the end, and will be stripped. Some examples: SplitArrayField(IntegerField(required=True), size=3, remove_trailing_nulls=False)

['1', '2', '3']  # -> [1, 2, 3]
['1', '2', '']  # -> ValidationError - third entry required.
['1', '', '3']  # -> ValidationError - second entry required.
['', '2', '']  # -> ValidationError - first and third entries required.

SplitArrayField(IntegerField(required=False), size=3, remove_trailing_nulls=False)

['1', '2', '3']  # -> [1, 2, 3]
['1', '2', '']  # -> [1, 2, None]
['1', '', '3']  # -> [1, None, 3]
['', '2', '']  # -> [None, 2, None]

SplitArrayField(IntegerField(required=True), size=3, remove_trailing_nulls=True)

['1', '2', '3']  # -> [1, 2, 3]
['1', '2', '']  # -> [1, 2]
['1', '', '3']  # -> ValidationError - second entry required.
['', '2', '']  # -> ValidationError - first entry required.

SplitArrayField(IntegerField(required=False), size=3, remove_trailing_nulls=True)

['1', '2', '3']  # -> [1, 2, 3]
['1', '2', '']  # -> [1, 2]
['1', '', '3']  # -> [1, None, 3]
['', '2', '']  # -> [None, 2]
class BloomIndex(*expressions, length=None, columns=(), **options)  
Creates a bloom index. To use this index access you need to activate the bloom extension on PostgreSQL. You can install it using the BloomExtension migration operation. Provide an integer number of bits from 1 to 4096 to the length parameter to specify the length of each index entry. PostgreSQL’s default is 80. The columns argument takes a tuple or list of up to 32 values that are integer number of bits from 1 to 4095.  Changed in Django 3.2: Positional argument *expressions was added in order to support functional indexes.
class BrinIndex(*expressions, autosummarize=None, pages_per_range=None, **options)  
Creates a BRIN index. Set the autosummarize parameter to True to enable automatic summarization to be performed by autovacuum. The pages_per_range argument takes a positive integer.  Changed in Django 3.2: Positional argument *expressions was added in order to support functional indexes.
class BTreeIndex(*expressions, fillfactor=None, **options)  
Creates a B-Tree index. Provide an integer value from 10 to 100 to the fillfactor parameter to tune how packed the index pages will be. PostgreSQL’s default is 90.  Changed in Django 3.2: Positional argument *expressions was added in order to support functional indexes.
class GinIndex(*expressions, fastupdate=None, gin_pending_list_limit=None, **options)  
Creates a gin index. To use this index on data types not in the built-in operator classes, you need to activate the btree_gin extension on PostgreSQL. You can install it using the BtreeGinExtension migration operation. Set the fastupdate parameter to False to disable the GIN Fast Update Technique that’s enabled by default in PostgreSQL. Provide an integer number of bytes to the gin_pending_list_limit parameter to tune the maximum size of the GIN pending list which is used when fastupdate is enabled.  Changed in Django 3.2: Positional argument *expressions was added in order to support functional indexes.
class GistIndex(*expressions, buffering=None, fillfactor=None, **options)  
Creates a GiST index. These indexes are automatically created on spatial fields with spatial_index=True. They’re also useful on other types, such as HStoreField or the range fields. To use this index on data types not in the built-in gist operator classes, you need to activate the btree_gist extension on PostgreSQL. You can install it using the BtreeGistExtension migration operation. Set the buffering parameter to True or False to manually enable or disable buffering build of the index. Provide an integer value from 10 to 100 to the fillfactor parameter to tune how packed the index pages will be. PostgreSQL’s default is 90.  Changed in Django 3.2: Positional argument *expressions was added in order to support functional indexes.
class HashIndex(*expressions, fillfactor=None, **options)  
Creates a hash index. Provide an integer value from 10 to 100 to the fillfactor parameter to tune how packed the index pages will be. PostgreSQL’s default is 90.  Use this index only on PostgreSQL 10 and later Hash indexes have been available in PostgreSQL for a long time, but they suffer from a number of data integrity issues in older versions.   Changed in Django 3.2: Positional argument *expressions was added in order to support functional indexes.
class OpClass(expression, name)  
An OpClass() expression represents the expression with a custom operator class that can be used to define functional indexes or unique constraints. To use it, you need to add 'django.contrib.postgres' in your INSTALLED_APPS. Set the name parameter to the name of the operator class. For example: Index(
    OpClass(Lower('username'), name='varchar_pattern_ops'),
    name='lower_username_idx',
)
 creates an index on Lower('username') using varchar_pattern_ops. Another example: UniqueConstraint(
    OpClass(Upper('description'), name='text_pattern_ops'),
    name='upper_description_unique',
)
 creates a unique constraint on Upper('description') using text_pattern_ops.  Changed in Django 4.0: Support for functional unique constraints was added.
class SpGistIndex(*expressions, fillfactor=None, **options)  
Creates an SP-GiST index. Provide an integer value from 10 to 100 to the fillfactor parameter to tune how packed the index pages will be. PostgreSQL’s default is 90.  Changed in Django 3.2: Positional argument *expressions was added in order to support functional indexes.
class AddConstraintNotValid(model_name, constraint)  
Like AddConstraint, but avoids validating the constraint on existing rows.
class AddIndexConcurrently(model_name, index)  
Like AddIndex, but creates an index with the CONCURRENTLY option. This has a few caveats to be aware of when using this option, see the PostgreSQL documentation of building indexes concurrently.
class BtreeGistExtension  
Installs the btree_gist extension.
class CreateCollation(name, locale, *, provider='libc', deterministic=True)  
Creates a collation with the given name, locale and provider. Set the deterministic parameter to False to create a non-deterministic collation, such as for case-insensitive filtering.
class CreateExtension(name)  
An Operation subclass which installs a PostgreSQL extension. For common extensions, use one of the more specific subclasses below.  
name  
This is a required argument. The name of the extension to be installed.
class HStoreExtension  
Installs the hstore extension and also sets up the connection to interpret hstore data for possible use in subsequent migrations.
class RemoveCollation(name, locale, *, provider='libc', deterministic=True)  
Removes the collations named name. When reversed this is creating a collation with the provided locale, provider, and deterministic arguments. Therefore, locale is required to make this operation reversible.
class RemoveIndexConcurrently(model_name, name)  
Like RemoveIndex, but removes the index with the CONCURRENTLY option. This has a few caveats to be aware of when using this option, see the PostgreSQL documentation.
class ValidateConstraint(model_name, name)  
Scans through the table and validates the given check constraint on existing rows.
class SearchHeadline(expression, query, config=None, start_sel=None, stop_sel=None, max_words=None, min_words=None, short_word=None, highlight_all=None, max_fragments=None, fragment_delimiter=None)
class SearchRank(vector, query, weights=None, normalization=None, cover_density=False)
class KeysValidator(keys, strict=False, messages=None)  
Validates that the given keys are contained in the value. If strict is True, then it also checks that there are no other keys present. The messages passed should be a dict containing the keys missing_keys and/or extra_keys.  Note Note that this checks only for the existence of a given key, not that the value of a key is non-empty.
class RangeMaxValueValidator(limit_value, message=None)  
Validates that the upper bound of the range is not greater than limit_value.
class RangeMinValueValidator(limit_value, message=None)  
Validates that the lower bound of the range is not less than the limit_value.
class middleware.RedirectFallbackMiddleware  
You can change the HttpResponse classes used by the middleware by creating a subclass of RedirectFallbackMiddleware and overriding response_gone_class and/or response_redirect_class.  
response_gone_class  
The HttpResponse class used when a Redirect is not found for the requested path or has a blank new_path value. Defaults to HttpResponseGone. 
  
response_redirect_class  
The HttpResponse class that handles the redirect. Defaults to HttpResponsePermanentRedirect.
response_gone_class  
The HttpResponse class used when a Redirect is not found for the requested path or has a blank new_path value. Defaults to HttpResponseGone.
response_redirect_class  
The HttpResponse class that handles the redirect. Defaults to HttpResponsePermanentRedirect.