id int64 0 190k | prompt stringlengths 21 13.4M | docstring stringlengths 1 12k ⌀ |
|---|---|---|
180,010 | import re
from datetime import datetime, timedelta
import cv2
import numpy as np
from module.base.timer import Timer
from module.base.utils import color_similarity_2d
from module.exception import RequestHumanTakeover, ScriptError
from module.logger import logger
from module.ocr.ocr import Ocr
from tasks.base.assets.ass... | null |
180,011 | import re
from module.base.base import ModuleBase
from module.base.utils import area_offset
from module.ocr.ocr import OcrResultButton
REGEX_PUNCTUATION = re.compile(r'[ ,.\'"“”,。::!!??·•—/()()「」『』【】《》]')
def parse_name(n):
n = REGEX_PUNCTUATION.sub('', str(n)).lower()
return n | null |
180,012 | import re
from module.base.base import ModuleBase
from module.base.utils import area_offset
from module.ocr.ocr import OcrResultButton
def get_regex_from_keyword_name(keyword, attr_name):
string = ""
for instance in keyword.instances.values():
if hasattr(instance, attr_name):
for name in in... | null |
180,013 | import re
from module.base.base import ModuleBase
from module.base.utils import area_offset
from module.ocr.ocr import OcrResultButton
class ModuleBase:
config: AzurLaneConfig
device: Device
def __init__(self, config, device=None, task=None):
"""
Args:
config (AzurLaneConfig, s... | There is a white border if a blessing is selected. For the enforce case, just check the confirm button turning to white |
180,014 | import re
from module.base.timer import Timer
from module.base.utils import random_rectangle_vector_opted
from module.logger import logger
from tasks.base.ui import UI
from tasks.combat.assets.assets_combat_team import *
logger = logging.getLogger('alas')
logger.setLevel(logging.DEBUG if logger_debug else logging.INFO... | null |
180,015 | import re
from module.base.timer import Timer
from module.base.utils import random_rectangle_vector_opted
from module.logger import logger
from tasks.base.ui import UI
from tasks.combat.assets.assets_combat_team import *
logger = logging.getLogger('alas')
logger.setLevel(logging.DEBUG if logger_debug else logging.INFO... | null |
180,016 | import cv2
import numpy as np
from scipy import signal
from module.base.button import ClickButton
from module.base.timer import Timer
from module.base.utils import area_offset, area_size, crop, load_image, rgb2luma
from module.logger import logger
from module.ui.scroll import Scroll
from tasks.base.assets.assets_base_p... | Returns: tuple: (x, y) of position in original image |
180,017 | import os
import cv2
import numpy as np
The provided code snippet includes necessary dependencies for implementing the `generate_ui_mask` function. Write a Python function `def generate_ui_mask()` to solve the following problem:
code to generate ui mask
Here is the function:
def generate_ui_mask():
"""
code ... | code to generate ui mask |
180,018 | import importlib
import os
from module.base.decorator import del_cached_property
from module.exception import GameStuckError, GameTooManyClickError, ScriptError
from module.logger import logger
from tasks.base.ui import UI
from tasks.map.route.base import RouteBase
from tasks.map.route.model import RouteModel
def empt... | null |
180,019 | from tasks.map.control.control import MapControl
from tasks.map.control.waypoint import Waypoint
from tasks.map.keywords import MapPlane
class RouteBase(MapControl):
"""
Base class of `Route`
Every `Route` class must implement method `route()`
"""
# Module and func of current route, updated from Rou... | Examples: @locked_position def Luofu_ScalegorgeWaterscape_F1_X619Y387(self): pass # Search area will be locked |
180,020 | from tasks.map.control.control import MapControl
from tasks.map.control.waypoint import Waypoint
from tasks.map.keywords import MapPlane
class RouteBase(MapControl):
"""
Base class of `Route`
Every `Route` class must implement method `route()`
"""
# Module and func of current route, updated from Rou... | Examples: @locked_direction(270) def Luofu_ScalegorgeWaterscape_F1_X619Y387(self): pass # Direction will be locked to 270 |
180,021 | from tasks.map.control.control import MapControl
from tasks.map.control.waypoint import Waypoint
from tasks.map.keywords import MapPlane
class RouteBase(MapControl):
"""
Base class of `Route`
Every `Route` class must implement method `route()`
"""
# Module and func of current route, updated from Rou... | Examples: @locked_rotation(270) def Luofu_ScalegorgeWaterscape_F1_X619Y387(self): pass # Rotation will be locked to 270 |
180,022 | import cv2
import numpy as np
from module.base.decorator import cached_property, del_cached_property
from module.base.utils import Points, image_size, load_image
from module.config.utils import dict_to_kv
from module.logger import logger
from tasks.base.ui import UI
The provided code snippet includes necessary depende... | Get the coordinates of pixels in range. Equivalent to `np.array(np.where(lower <= image <= upper))` but faster. Note that this method will change `image`. `cv2.findNonZero()` is faster than `np.where` points = np.array(np.where(y > 24)).T[:, ::-1] points = np.array(cv2.findNonZero((y > 24).astype(np.uint8)))[:, 0, :] `... |
180,023 | import cv2
import numpy as np
from module.base.decorator import cached_property, del_cached_property
from module.base.utils import Points, image_size, load_image
from module.config.utils import dict_to_kv
from module.logger import logger
from tasks.base.ui import UI
The provided code snippet includes necessary depende... | If you care performance more than quality: - radius=3, use medianBlur - radius=5,7,9,11, use GaussianBlur - radius>11, use stackBlur (requires opencv >= 4.7.0) Args: image: radius: negative: Returns: np.ndarray: |
180,024 | import cv2
import numpy as np
from module.base.decorator import cached_property, del_cached_property
from module.base.utils import Points, image_size, load_image
from module.config.utils import dict_to_kv
from module.logger import logger
from tasks.base.ui import UI
The provided code snippet includes necessary depende... | Paint edge pixels black. No returns, changes are written to `image` Args: image: radius: |
180,025 | import cv2
import numpy as np
from module.base.decorator import cached_property, del_cached_property
from module.base.utils import Points, image_size, load_image
from module.config.utils import dict_to_kv
from module.logger import logger
from tasks.base.ui import UI
The provided code snippet includes necessary depende... | Create a circle with min_radius <= R <= max_radius. 1 represents circle, 0 represents background Args: min_radius: max_radius: Returns: np.ndarray: |
180,026 | import cv2
import numpy as np
from module.base.decorator import cached_property, del_cached_property
from module.base.utils import Points, image_size, load_image
from module.config.utils import dict_to_kv
from module.logger import logger
from tasks.base.ui import UI
The provided code snippet includes necessary depende... | Add a circle onto image. No returns, changes are written to `image` Args: image: circle: Created from create_circle() points: (x, y), center of the circle to draw |
180,027 | import re
from typing import Optional
from module.base.base import ModuleBase
from module.base.timer import Timer
from module.exception import ScriptError
from module.logger import logger
from module.ocr.ocr import Ocr, OcrResultButton
from module.ui.draggable_list import DraggableList
from module.ui.scroll import Scro... | null |
180,028 | import os
from functools import cached_property
import cv2
import numpy as np
from module.base.utils import (
color_similarity_2d,
crop,
get_bbox,
get_bbox_reversed,
image_paste,
image_size
)
from module.config.utils import iter_folder
from tasks.map.minimap.utils import map_image_preprocess, ro... | null |
180,029 | import os
import numpy as np
from PIL import Image
from module.base.utils import load_image
The provided code snippet includes necessary dependencies for implementing the `diff_to_180_180` function. Write a Python function `def diff_to_180_180(diff)` to solve the following problem:
Args: diff: Degree diff Returns: flo... | Args: diff: Degree diff Returns: float: Degree diff (-180~180) |
180,030 | import os
import numpy as np
from PIL import Image
from module.base.utils import load_image
The provided code snippet includes necessary dependencies for implementing the `diff_to_0_360` function. Write a Python function `def diff_to_0_360(diff)` to solve the following problem:
Args: diff: Degree diff Returns: float: ... | Args: diff: Degree diff Returns: float: Degree diff (0~360) |
180,031 | import cv2
import numpy as np
from scipy import signal
from module.base.utils import image_size
The provided code snippet includes necessary dependencies for implementing the `map_image_preprocess` function. Write a Python function `def map_image_preprocess(image)` to solve the following problem:
A shared preprocess m... | A shared preprocess method used in ResourceGenerate and _predict_position() Args: image (np.ndarray): Screenshot in RGB Returns: np.ndarray: |
180,032 | import cv2
import numpy as np
from scipy import signal
from module.base.utils import image_size
def create_circular_mask(h, w, center=None, radius=None):
# https://stackoverflow.com/questions/44865023/how-can-i-create-a-circular-mask-for-a-numpy-array
if center is None: # use the middle of the image
c... | null |
180,033 | import cv2
import numpy as np
from scipy import signal
from module.base.utils import image_size
The provided code snippet includes necessary dependencies for implementing the `rotate_bound` function. Write a Python function `def rotate_bound(image, angle)` to solve the following problem:
Rotate an image with outbound ... | Rotate an image with outbound https://blog.csdn.net/qq_37674858/article/details/80708393 Args: image (np.ndarray): angle (int, float): Returns: np.ndarray: |
180,034 | import cv2
import numpy as np
from scipy import signal
from module.base.utils import image_size
The provided code snippet includes necessary dependencies for implementing the `cubic_find_maximum` function. Write a Python function `def cubic_find_maximum(image, precision=0.05)` to solve the following problem:
Using CUB... | Using CUBIC resize algorithm to fit a curved surface, find the maximum value and location. Args: image (np.ndarray): precision (int, float): Returns: float: Maximum value on curved surface np.ndarray[float, float]: Location of maximum value |
180,035 | import cv2
import numpy as np
from scipy import signal
from module.base.utils import image_size
The provided code snippet includes necessary dependencies for implementing the `image_center_pad` function. Write a Python function `def image_center_pad(image, size, value=(0, 0, 0))` to solve the following problem:
Create... | Create a new image with given `size`, placing given `image` in the middle. Args: image (np.ndarray): size: (width, height) value: Color of the background. Returns: np.ndarray: |
180,036 | import cv2
import numpy as np
from scipy import signal
from module.base.utils import image_size
The provided code snippet includes necessary dependencies for implementing the `image_center_crop` function. Write a Python function `def image_center_crop(image, size)` to solve the following problem:
Center crop the given... | Center crop the given image. Args: image (np.ndarray): size: Output image shape, (width, height) Returns: np.ndarray: |
180,037 | import cv2
import numpy as np
from scipy import signal
from module.base.utils import image_size
The provided code snippet includes necessary dependencies for implementing the `area2corner` function. Write a Python function `def area2corner(area)` to solve the following problem:
Args: area: (x1, y1, x2, y2) Returns: np... | Args: area: (x1, y1, x2, y2) Returns: np.ndarray: [upper-left, upper-right, bottom-left, bottom-right] |
180,038 | import cv2
import numpy as np
from scipy import signal
from module.base.utils import image_size
The provided code snippet includes necessary dependencies for implementing the `convolve` function. Write a Python function `def convolve(arr, kernel=3)` to solve the following problem:
Args: arr (np.ndarray): Shape (N,) ke... | Args: arr (np.ndarray): Shape (N,) kernel (int): Returns: np.ndarray: |
180,039 | import cv2
import numpy as np
from scipy import signal
from module.base.utils import image_size
The provided code snippet includes necessary dependencies for implementing the `convolve_plain` function. Write a Python function `def convolve_plain(arr, kernel=3)` to solve the following problem:
Args: arr (np.ndarray): S... | Args: arr (np.ndarray): Shape (N,) kernel (int): Returns: np.ndarray: |
180,040 | import cv2
import numpy as np
from scipy import signal
from module.base.utils import image_size
The provided code snippet includes necessary dependencies for implementing the `peak_confidence` function. Write a Python function `def peak_confidence(arr, **kwargs)` to solve the following problem:
Evaluate the prominence... | Evaluate the prominence of the highest peak Args: arr (np.ndarray): Shape (N,) **kwargs: Additional kwargs for signal.find_peaks Returns: float: 0-1 |
180,041 | from dataclasses import dataclass, field
from module.base.timer import Timer
class Waypoint:
def __bool__(self):
def run_2x(self) -> "Waypoint":
def straight_run(self) -> "Waypoint":
def run(self) -> "Waypoint":
def walk(self) -> "Waypoint":
def set_threshold(self, threshold) -> "Waypoint"... | null |
180,042 | import threading
from multiprocessing import Event, Process
from module.logger import logger
from module.webui.setting import State
logger = logging.getLogger('alas')
logger.setLevel(logging.DEBUG if logger_debug else logging.INFO)
console_hdlr = RichHandler(
show_path=False,
show_time=False,
rich_tracebac... | null |
180,043 | import os
import re
import typing as t
from dataclasses import dataclass
import numpy as np
from tqdm import tqdm
from module.base.code_generator import CodeGenerator
from module.base.utils import SelectedGrids, area_limit, area_pad, get_bbox, get_color, image_size, load_image
from module.config.config_manual import Ma... | null |
180,044 | import itertools
import os
import re
from collections import defaultdict
from functools import cache
from hashlib import md5
from dev_tools.keywords.base import TextMap, UI_LANGUAGES, replace_templates, text_to_variable
from module.base.code_generator import CodeGenerator
from module.config.utils import deep_get, read_... | null |
180,045 | import itertools
import os
import re
from collections import defaultdict
from functools import cache
from hashlib import md5
from dev_tools.keywords.base import TextMap, UI_LANGUAGES, replace_templates, text_to_variable
from module.base.code_generator import CodeGenerator
from module.config.utils import deep_get, read_... | null |
180,046 | import itertools
import os
import re
from collections import defaultdict
from functools import cache
from hashlib import md5
from dev_tools.keywords.base import TextMap, UI_LANGUAGES, replace_templates, text_to_variable
from module.base.code_generator import CodeGenerator
from module.config.utils import deep_get, read_... | null |
180,047 | import os
import re
from typing import Iterator
import numpy as np
from tqdm import tqdm
from module.base.code_generator import CodeGenerator, MarkdownGenerator
from module.base.decorator import cached_property
from module.base.utils import SelectedGrids, load_image
from module.config.utils import iter_folder
from task... | null |
180,048 | import os
import re
from typing import Iterator
import numpy as np
from tqdm import tqdm
from module.base.code_generator import CodeGenerator, MarkdownGenerator
from module.base.decorator import cached_property
from module.base.utils import SelectedGrids, load_image
from module.config.utils import iter_folder
from task... | null |
180,049 | import os
import re
from typing import Iterator
import numpy as np
from tqdm import tqdm
from module.base.code_generator import CodeGenerator, MarkdownGenerator
from module.base.decorator import cached_property
from module.base.utils import SelectedGrids, load_image
from module.config.utils import iter_folder
from task... | null |
180,050 | import os
from datetime import datetime
from PIL import Image
from pynput import keyboard
from module.config.config import AzurLaneConfig
from module.config.utils import alas_instance
from module.device.connection import Connection, ConnectionAttr
from module.device.device import Device
from module.logger import logger... | null |
180,051 | from functools import cache
from typing import Iterable
from dev_tools.keywords.base import UI_LANGUAGES, GenerateKeyword
from module.config.utils import deep_get
class GenerateKeyword:
text_map: dict[str, TextMap] = {lang: TextMap(lang) for lang in UI_LANGUAGES}
text_map['cn'] = TextMap('chs')
def read_f... | Returns: dict: key - assignment text_id value - text_id of reward items |
180,052 | import os
import re
import typing as t
from functools import cached_property
from module.base.code_generator import CodeGenerator
from module.config.utils import read_file
from module.logger import logger
The provided code snippet includes necessary dependencies for implementing the `replace_templates` function. Write... | Replace templates in data to make sure it equals to what is shown in game Examples: replace_templates("Complete Echo of War #4 time(s)") == "Complete Echo of War 1 time(s)" |
180,053 | import re
import typing as t
from dev_tools.keywords.base import GenerateKeyword, text_to_variable
from module.base.decorator import cached_property
from module.config.utils import deep_get
def text_to_variable(text):
text = re.sub("'s |s' ", '_', text)
text = re.sub(r'[ \-—:\'/•.]+', '_', text)
text = re.... | null |
180,054 | import argparse
import sys
import typing as t
def run():
Progress.Start()
installer = Installer()
Progress.ShowDeployConfig()
installer.install()
logger.info('Finish')
Progress.Finish()
def run():
for row in output.split('\n'):
time.sleep(0.05)
if row:
logger.... | null |
180,055 | import argparse
import sys
import typing as t
def run():
Progress.Start()
installer = Installer()
Progress.ShowDeployConfig()
installer.install()
logger.info('Finish')
Progress.Finish()
def run():
for row in output.split('\n'):
time.sleep(0.05)
if row:
logger.... | null |
180,056 | import argparse
import sys
import typing as t
def config_set(modify: t.Dict[str, str], output='./config/deploy.yaml') -> t.Dict[str, str]:
"""
Args:
modify: A dict of key-value in deploy.yaml
output:
Returns:
The updated key-value in deploy.yaml
"""
data = poor_yaml_read(DE... | null |
180,057 | import configparser
import os
import subprocess
from time import sleep
from typing import List, Dict
import newrelic.agent
from app.db import Session
from app.log import LOG
from monitor.metric_exporter import MetricExporter
_NR_CONFIG_FILE_LOCATION_VAR = "NEW_RELIC_CONFIG_FILE"
def get_newrelic_license() -> str:
... | null |
180,058 | import configparser
import os
import subprocess
from time import sleep
from typing import List, Dict
import newrelic.agent
from app.db import Session
from app.log import LOG
from monitor.metric_exporter import MetricExporter
def nb_files(directory) -> int:
"""return the number of files in directory and its subdirec... | Look at different metrics and alert appropriately |
180,059 | import configparser
import os
import subprocess
from time import sleep
from typing import List, Dict
import newrelic.agent
from app.db import Session
from app.log import LOG
from monitor.metric_exporter import MetricExporter
Session = scoped_session(sessionmaker(bind=connection))
Session: sqlalchemy.orm.Session
LOG ... | null |
180,060 | import argparse
import email
import time
import uuid
from email import encoders
from email.encoders import encode_noop
from email.message import Message
from email.mime.application import MIMEApplication
from email.mime.multipart import MIMEMultipart
from email.utils import make_msgid, formatdate, getaddresses
from io ... | Return SMTP status |
180,061 | import flask_migrate
from IPython import embed
from sqlalchemy_utils import create_database, database_exists, drop_database
from app import models
from app.config import DB_URI
from app.db import Session
from app.log import LOG
from app.models import User, RecoveryCode
if False:
# noinspection PyUnreachableCode
... | null |
180,062 | import flask_migrate
from IPython import embed
from sqlalchemy_utils import create_database, database_exists, drop_database
from app import models
from app.config import DB_URI
from app.db import Session
from app.log import LOG
from app.models import User, RecoveryCode
Session = scoped_session(sessionmaker(bind=connec... | null |
180,063 | import flask_migrate
from IPython import embed
from sqlalchemy_utils import create_database, database_exists, drop_database
from app import models
from app.config import DB_URI
from app.db import Session
from app.log import LOG
from app.models import User, RecoveryCode
class RecoveryCode(Base, ModelMixin):
"""allo... | null |
180,064 | import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
def upgrade():
# As alembic cannot detect changes in column length, do it manually
op.execute('ALTER TABLE email_log ALTER COLUMN message_id TYPE varchar(1024);')
op.execute('ALTER TABLE message_id_matching ALTER COLUMN original_message... | null |
180,065 | import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
def downgrade():
# As alembic cannot detect changes in column length, do it manually
op.execute('ALTER TABLE email_log ALTER COLUMN message_id TYPE varchar(512);')
op.execute('ALTER TABLE message_id_matching ALTER COLUMN original_messag... | null |
180,066 | import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.execute('UPDATE users SET include_sender_in_reverse_alias = false WHERE include_sender_in_reverse_alias IS NULL')
op.alter_column('users', 'include_sender_i... | null |
180,067 | import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.alter_column('users', 'include_sender_in_reverse_alias',
existing_type=sa.BOOLEAN(),
nullable=True)
# ### end Alembic comman... | null |
180,068 | import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('authorization_code', sa.Column('nonce', sa.Text(), server_default=sa.text('NULL'), nullable=True))
# ### end Alembic commands ### | null |
180,069 | import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('authorization_code', 'nonce')
# ### end Alembic commands ### | null |
180,070 | import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('hibp_notified_alias',
sa.Column('id', sa.Integer(), autoincrement=True, nullable=False),
sa.Column('created_at', sqlalchemy_utils.types.ar... | null |
180,071 | import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_table('hibp_notified_alias')
# ### end Alembic commands ### | null |
180,072 | import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('users', sa.Column('replace_reverse_alias', sa.Boolean(), server_default='0', nullable=False))
# ### end Alembic commands ### | null |
180,073 | import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('users', 'replace_reverse_alias')
# ### end Alembic commands ### | null |
180,074 | import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('mailbox', sa.Column('disable_pgp', sa.Boolean(), server_default='0', nullable=False))
# ### end Alembic commands ### | null |
180,075 | import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('mailbox', 'disable_pgp')
# ### end Alembic commands ### | null |
180,076 | import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('payout',
sa.Column('id', sa.Integer(), autoincrement=True, nullable=False),
sa.Column('created_at', sqlalchemy_utils.types.arrow.ArrowType... | null |
180,077 | import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_table('payout')
# ### end Alembic commands ### | null |
180,078 | from alembic import op
import sqlalchemy as sa
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('users', sa.Column('is_developer', sa.Boolean(), server_default='0', nullable=False))
# ### end Alembic commands ### | null |
180,079 | from alembic import op
import sqlalchemy as sa
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('users', 'is_developer')
# ### end Alembic commands ### | null |
180,080 | import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('users', sa.Column('trial_end', sqlalchemy_utils.types.arrow.ArrowType(), nullable=True))
# ### end Alembic commands ### | null |
180,081 | import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('users', 'trial_end')
# ### end Alembic commands ### | null |
180,082 | import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('mailbox', sa.Column('pgp_finger_print', sa.String(length=512), nullable=True))
op.add_column('mailbox', sa.Column('pgp_public_key', sa.Text(), n... | null |
180,083 | import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('users', 'can_use_pgp')
op.drop_column('mailbox', 'pgp_public_key')
op.drop_column('mailbox', 'pgp_finger_print')
# ### end Alembic co... | null |
180,084 | import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('recovery_code',
sa.Column('id', sa.Integer(), autoincrement=True, nullable=False),
sa.Column('created_at', sqlalchemy_utils.types.arrow.Ar... | null |
180,085 | import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_table('recovery_code')
# ### end Alembic commands ### | null |
180,086 | import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('users', sa.Column('flags', sa.BigInteger(), server_default='0', nullable=False))
# ### end Alembic commands ### | null |
180,087 | import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('users', 'flags')
# ### end Alembic commands ### | null |
180,088 | import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_unique_constraint('uq_mailbox_user', 'mailbox', ['user_id', 'email'])
op.drop_constraint('mailbox_email_key', 'mailbox', type_='unique')
# ### en... | null |
180,089 | import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_unique_constraint('mailbox_email_key', 'mailbox', ['email'])
op.drop_constraint('uq_mailbox_user', 'mailbox', type_='unique')
# ### end Alembic... | null |
180,090 | import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('users', 'can_use_subdomain')
# ### end Alembic commands ### | null |
180,091 | import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('users', sa.Column('can_use_subdomain', sa.BOOLEAN(), server_default=sa.text('false'), autoincrement=False, nullable=False))
# ### end Alembic ... | null |
180,092 | import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_constraint('transactional_email_email_key', 'transactional_email', type_='unique')
# ### end Alembic commands ### | null |
180,093 | import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_unique_constraint('transactional_email_email_key', 'transactional_email', ['email'])
# ### end Alembic commands ### | null |
180,094 | import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('forward_email',
sa.Column('id', sa.Integer(), autoincrement=True, nullable=False),
sa.Column('created_at', sqlalchemy_utils.types.arrow.Ar... | null |
180,095 | import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_table('forward_email')
# ### end Alembic commands ### | null |
180,096 | import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('bounce', sa.Column('info', sa.Text(), nullable=True))
# ### end Alembic commands ### | null |
180,097 | import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('bounce', 'info')
# ### end Alembic commands ### | null |
180,098 | import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('invalid_mailbox_domain',
sa.Column('id', sa.Integer(), autoincrement=True, nullable=False),
sa.Column('created_at', sqlalchemy_utils.types... | null |
180,099 | import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_table('invalid_mailbox_domain')
# ### end Alembic commands ### | null |
180,100 | import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('users', sa.Column('max_spam_score', sa.Integer(), nullable=True))
# ### end Alembic commands ### | null |
180,101 | import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('users', 'max_spam_score')
# ### end Alembic commands ### | null |
180,102 | import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('custom_domain', sa.Column('random_prefix_generation', sa.Boolean(), server_default='0', nullable=False))
# ### end Alembic commands ### | null |
180,103 | import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('custom_domain', 'random_prefix_generation')
# ### end Alembic commands ### | null |
180,104 | import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('mailbox', sa.Column('disabled', sa.Boolean(), server_default='0', nullable=False))
# ### end Alembic commands ### | null |
180,105 | import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('mailbox', 'disabled')
# ### end Alembic commands ### | null |
180,106 | import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('users', sa.Column('alternative_id', sa.String(length=128), nullable=True))
op.create_unique_constraint(None, 'users', ['alternative_id'])
#... | null |
180,107 | import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_constraint(None, 'users', type_='unique')
op.drop_column('users', 'alternative_id')
# ### end Alembic commands ### | null |
180,108 | import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('directory', sa.Column('disabled', sa.Boolean(), server_default='0', nullable=False))
# ### end Alembic commands ### | null |
180,109 | import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('directory', 'disabled')
# ### end Alembic commands ### | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.