> ## Documentation Index
> Fetch the complete documentation index at: https://takeprofit.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Package sortedcontainers

export const Anchor = ({id}) => {
  return <div id={id} style={{
    scrollMarginTop: "var(--scroll-mt)"
  }}></div>;
};

export const Field = ({id, name, type, required, defaultVal, children}) => {
  return <div id={id} style={{
    scrollMarginTop: "var(--scroll-mt)"
  }} className="mt-4">
      <div className="pt-2.5 pb-5 my-2.5 border-gray-50 dark:border-gray-800/50 border-b">
        <div className="flex font-mono text-sm group/param-head param-head">
          <div className="flex-1 flex content-start py-0.5 mr-5">
            <div className="flex items-center flex-wrap gap-2">
              {id && <div className="absolute">
                  <a href={`#${id}`} className="-ml-10 flex items-center opacity-0 border-0 group-hover/param-head:opacity-100 py-2" aria-label={`Navigate to ${id}`}>
                    <div className="w-6 h-6 text-gray-400 rounded-md flex items-center justify-center zinc-box bg-white ring-1 ring-gray-400/30 dark:ring-gray-700/25 hover:ring-gray-400/60 dark:hover:ring-white/20">
                      <svg xmlns="http://www.w3.org/2000/svg" fill="gray" height="12px" viewBox="0 0 576 512">
                        <path d="M0 256C0 167.6 71.6 96 160 96h72c13.3 0 24 10.7 24 24s-10.7 24-24 24H160C98.1 144 48 194.1 48 256s50.1 112 112 112h72c13.3 0 24 10.7 24 24s-10.7 24-24 24H160C71.6 416 0 344.4 0 256zm576 0c0 88.4-71.6 160-160 160H344c-13.3 0-24-10.7-24-24s10.7-24 24-24h72c61.9 0 112-50.1 112-112s-50.1-112-112-112H344c-13.3 0-24-10.7-24-24s10.7-24 24-24h72c88.4 0 160 71.6 160 160zM184 232H392c13.3 0 24 10.7 24 24s-10.7 24-24 24H184c-13.3 0-24-10.7-24-24s10.7-24 24-24z"></path>
                      </svg>
                    </div>
                  </a>
                </div>}
              <div className="font-semibold text-primary dark:text-primary-light">
                {name}
              </div>
              <div className="flex items-center space-x-2 text-xs font-medium">
                <div className="flex items-center px-2 py-0.5 rounded-md bg-gray-100/50 dark:bg-white/5 text-gray-600 dark:text-gray-200 font-medium">
                  {type}
                </div>
                {required && <span className="px-2 py-0.5 rounded-md bg-red-100/50 dark:bg-red-400/10 text-red-600 dark:text-red-300 font-medium">
                    required
                  </span>}
                {defaultVal && <div className="flex items-center px-2 py-0.5 rounded-md bg-gray-100/50 dark:bg-white/5 text-gray-600 dark:text-gray-200 font-medium">
                    <span class="text-gray-400 dark:text-gray-500">default:</span>
                    {defaultVal}
                  </div>}
              </div>
            </div>
          </div>
        </div>
        <div className="mt-4 prose-sm prose-gray dark:prose-invert">
          {children}
        </div>
      </div>
    </div>;
};

Sorted collections library.

***

## Types

<Anchor id="class_SortedList" />

### `SortedList`

*type*

List that holds values in sorted order.

<Steps>
  <Step title="Methods" icon="function">
    <Field id="method_SortedList_init" name="__init__" type="(lst) -> None">
      Class constructor (initializer for the data type).

      <Expandable title="parameters info">
        <Field name="lst" type="indie.Optional[list[float]]" defaultVal="None">
          List to get values from.
        </Field>
      </Expandable>
    </Field>

    <Field id="method_SortedList_add" name="add" type="(value) -> None">
      Adds given value to the list.

      <Expandable title="parameters info">
        <Field name="value" type="float" required>
          New value that will be put to the list.
        </Field>
      </Expandable>
    </Field>

    <Field id="method_SortedList_remove" name="remove" type="(x) -> None">
      Removes given value from the list.

      <Expandable title="parameters info">
        <Field name="x" type="float" required>
          Value that will be removed from the list
        </Field>
      </Expandable>
    </Field>

    <Field id="method_SortedList_getitem" name="__getitem__" type="(i) -> float">
      Returns list element at given index.

      <Expandable title="parameters info">
        <Field name="i" type="int" required>
          Index of an element in the list.
        </Field>
      </Expandable>

      <Note>Method `__getitem__` should never be called directly, instead `list_obj[key]` syntax should be used.</Note>
    </Field>

    <Field id="method_SortedList_len" name="__len__" type="() -> int">
      Returns the length (the number of items) of a list.
      <Note>Method `__len__` should never be called directly, instead `len(list_obj)` syntax should be used.</Note>
    </Field>

    <Field id="method_SortedList_contains" name="__contains__" type="(x) -> bool">
      Returns `True` if the list contains the given value, otherwise `False`.

      <Expandable title="parameters info">
        <Field name="x" type="float" required>
          Element to find in the list.
        </Field>
      </Expandable>

      <Note>Method `__contains__` should never be called directly, instead `val in lst` syntax should be used.</Note>
    </Field>
  </Step>
</Steps>

***
