edited_code stringlengths 17 978k | original_code stringlengths 17 978k |
|---|---|
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... |
import os
import json
from web3 import Web3
import discord
from discord.ext import commands, tasks
BOT_TOKEN = os.environ["DISCORD_BOT_TOKEN"]
# Initialized Discord client
intents = discord.Intents.all()
intents.members = True
client = commands.Bot(intents=intents, help_command=None, command_prefix='&?')
# Initializ... | import os
import json
from web3 import Web3
import discord
from discord.ext import commands, tasks
BOT_TOKEN = os.environ["DISCORD_BOT_TOKEN"]
# Initialized Discord client
intents = discord.Intents.all()
intents.members = True
client = commands.Bot(intents=intents, help_command=None, command_prefix='&?')
# Initializ... |
#
# This source file is part of the EdgeDB open source project.
#
# Copyright 2017-present MagicStack Inc. and the EdgeDB authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http... | #
# This source file is part of the EdgeDB open source project.
#
# Copyright 2017-present MagicStack Inc. and the EdgeDB authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http... |
#!/usr/bin/env python3
"""
Adapted from https://github.com/numba/conda-recipe-cudatoolkit
BSD 2-Clause License
Copyright (c) 2018 Onwards, Quansight, LLC
Copyright (c) 2017, Continuum Analytics, Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted... | #!/usr/bin/env python3
"""
Adapted from https://github.com/numba/conda-recipe-cudatoolkit
BSD 2-Clause License
Copyright (c) 2018 Onwards, Quansight, LLC
Copyright (c) 2017, Continuum Analytics, Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted... |
import contextlib
import fnmatch
import io
import math
import os
import re
import shutil
import sys
import tempfile
import textwrap
import zipfile
from datetime import datetime
import requests
import sarge
from .xml import ( # noqa
elementtree_parse_file,
remove_xml_element,
remove_xml_element_file,
... | import contextlib
import fnmatch
import io
import math
import os
import re
import shutil
import sys
import tempfile
import textwrap
import zipfile
from datetime import datetime
import requests
import sarge
from .xml import ( # noqa
elementtree_parse_file,
remove_xml_element,
remove_xml_element_file,
... |
#!/usr/bin/env python3
import json
import time
import fnmatch
from collections import namedtuple
import jwt
import requests # type: ignore
import boto3 # type: ignore
API_URL = "https://api.github.com/repos/ClickHouse/ClickHouse"
SUSPICIOUS_CHANGED_FILES_NUMBER = 200
SUSPICIOUS_PATTERNS = [
"tests/ci/*",
... | #!/usr/bin/env python3
import json
import time
import fnmatch
from collections import namedtuple
import jwt
import requests # type: ignore
import boto3 # type: ignore
API_URL = "https://api.github.com/repos/ClickHouse/ClickHouse"
SUSPICIOUS_CHANGED_FILES_NUMBER = 200
SUSPICIOUS_PATTERNS = [
"tests/ci/*",
... |
import datetime as dt
import re
import string
import uuid
from contextlib import suppress
from urllib.parse import urlparse
import pytz
from django.db import models
from django.utils.functional import cached_property
from django_scopes import ScopedManager
from i18nfield.fields import I18nCharField
from pretalx.commo... | import datetime as dt
import re
import string
import uuid
from contextlib import suppress
from urllib.parse import urlparse
import pytz
from django.db import models
from django.utils.functional import cached_property
from django_scopes import ScopedManager
from i18nfield.fields import I18nCharField
from pretalx.commo... |
import base64
import copy
import gzip
import json
import random
from typing import Dict, List, Optional, Tuple
from katrain.core.constants import (
ANALYSIS_FORMAT_VERSION,
PROGRAM_NAME,
REPORT_DT,
SGF_INTERNAL_COMMENTS_MARKER,
SGF_SEPARATOR_MARKER,
VERSION,
PRIORITY_DEFAULT,
ADDITIONAL... | import base64
import copy
import gzip
import json
import random
from typing import Dict, List, Optional, Tuple
from katrain.core.constants import (
ANALYSIS_FORMAT_VERSION,
PROGRAM_NAME,
REPORT_DT,
SGF_INTERNAL_COMMENTS_MARKER,
SGF_SEPARATOR_MARKER,
VERSION,
PRIORITY_DEFAULT,
ADDITIONAL... |
#
# Copyright (c) 2022 Airbyte, Inc., all rights reserved.
#
from abc import ABC, abstractmethod
from typing import Any, Iterable, List, Mapping, MutableMapping, Optional
from urllib.parse import parse_qsl, urlparse
import pendulum
import requests
from airbyte_cdk.models import SyncMode
from airbyte_cdk.sources.strea... | #
# Copyright (c) 2022 Airbyte, Inc., all rights reserved.
#
from abc import ABC, abstractmethod
from typing import Any, Iterable, List, Mapping, MutableMapping, Optional
from urllib.parse import parse_qsl, urlparse
import pendulum
import requests
from airbyte_cdk.models import SyncMode
from airbyte_cdk.sources.strea... |
from ProgressManager.RunTable.Models.RunProgress import RunProgress
from ConfigValidator.CustomErrors.ExperimentOutputErrors import ExperimentOutputFileDoesNotExistError
from ProgressManager.Output.OutputProcedure import OutputProcedure as output
from ProgressManager.Output.BaseOutputManager import BaseOutputManager
f... | from ProgressManager.RunTable.Models.RunProgress import RunProgress
from ConfigValidator.CustomErrors.ExperimentOutputErrors import ExperimentOutputFileDoesNotExistError
from ProgressManager.Output.OutputProcedure import OutputProcedure as output
from ProgressManager.Output.BaseOutputManager import BaseOutputManager
f... |
#!/usr/bin/python
#
# 2019 Graham R Pugh
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to ... | #!/usr/bin/python
#
# 2019 Graham R Pugh
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to ... |
from selenium import webdriver
from time import sleep
import json
import Client
t = Client.get_servers_raw()
if t == None:
print('Failed to get the list of servers')
raise SystemExit
if len(t) == 0:
print('The list of servers is empty')
raise SystemExit
print(f'Added {len(t)} servers to the queue')
wi... | from selenium import webdriver
from time import sleep
import json
import Client
t = Client.get_servers_raw()
if t == None:
print('Failed to get the list of servers')
raise SystemExit
if len(t) == 0:
print('The list of servers is empty')
raise SystemExit
print(f'Added {len(t)} servers to the queue')
wi... |
import pytest
from os import path as osp
from glob import glob
from shutil import which
from subprocess import Popen, PIPE, TimeoutExpired
import time
RANKS = 1
TEST_PATH = osp.dirname(osp.abspath(__file__))
def get_test_names():
"""Obtain test names by globbing for client_test
Add tests manually if necessary... | import pytest
from os import path as osp
from glob import glob
from shutil import which
from subprocess import Popen, PIPE, TimeoutExpired
import time
RANKS = 1
TEST_PATH = osp.dirname(osp.abspath(__file__))
def get_test_names():
"""Obtain test names by globbing for client_test
Add tests manually if necessary... |
# Copyright 2008-2018 pydicom authors. See LICENSE file for details.
"""Define the Dataset and FileDataset classes.
The Dataset class represents the DICOM Dataset while the FileDataset class
adds extra functionality to Dataset when data is read from or written to file.
Overview of DICOM object model
-----------------... | # Copyright 2008-2018 pydicom authors. See LICENSE file for details.
"""Define the Dataset and FileDataset classes.
The Dataset class represents the DICOM Dataset while the FileDataset class
adds extra functionality to Dataset when data is read from or written to file.
Overview of DICOM object model
-----------------... |
import numpy as np
import itertools as it
class SymbolicArray(np.ndarray):
def __new__(cls, arr, symbolic=None, **kwargs):
if isinstance(arr, cls):
return arr
arr = np.array(arr, copy=False, **kwargs)
obj = arr.view(cls)
obj.symbolic = str(symbolic or np.array2string(ar... | import numpy as np
import itertools as it
class SymbolicArray(np.ndarray):
def __new__(cls, arr, symbolic=None, **kwargs):
if isinstance(arr, cls):
return arr
arr = np.array(arr, copy=False, **kwargs)
obj = arr.view(cls)
obj.symbolic = str(symbolic or np.array2string(ar... |
from abc import (
ABC,
abstractmethod,
)
from enum import Enum
import itertools
from typing import (
TYPE_CHECKING,
Any,
Collection,
Dict,
Iterable,
List,
Optional,
Sequence,
Tuple,
Union,
cast,
)
from platon_abi import (
grammar,
)
from platon_abi.codec import (... | from abc import (
ABC,
abstractmethod,
)
from enum import Enum
import itertools
from typing import (
TYPE_CHECKING,
Any,
Collection,
Dict,
Iterable,
List,
Optional,
Sequence,
Tuple,
Union,
cast,
)
from platon_abi import (
grammar,
)
from platon_abi.codec import (... |
import pandas as pd
import psycopg2
import psycopg2.extras
class DBData():
def __init__(self, schema='wage_trust_demo'):
self._CSTR = {
'user' : 'postgres',
'password' : 'docker',
'host' : 'wage_trust_db'
}
self._schema = schema
de... | import pandas as pd
import psycopg2
import psycopg2.extras
class DBData():
def __init__(self, schema='wage_trust_demo'):
self._CSTR = {
'user' : 'postgres',
'password' : 'docker',
'host' : 'wage_trust_db'
}
self._schema = schema
de... |
import logging
from TwitchWebsocket.Message import Message
from Settings import Settings
from Log import Log
Log(__file__)
# Modules
import tkinter as tk
import tkinter.scrolledtext as tkst
import tkinter.font as tkFont
import time, json
from datetime import datetime
from functools import reduce
import threading
c... |
import logging
from TwitchWebsocket.Message import Message
from Settings import Settings
from Log import Log
Log(__file__)
# Modules
import tkinter as tk
import tkinter.scrolledtext as tkst
import tkinter.font as tkFont
import time, json
from datetime import datetime
from functools import reduce
import threading
c... |
nome = str(input('Qual é seu nome completo? ')).strip()
print(f'Seu nome tem Silva? {'Silva' in nome.title().split()}')
| nome = str(input('Qual é seu nome completo? ')).strip()
print(f'Seu nome tem Silva? {"Silva" in nome.title().split()}')
|
# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | # Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
from abc import ABC, abstractmethod
from enum import Enum, auto
from itertools import chain
from typing import (
Any,
ClassVar,
Dict,
FrozenSet,
Iterable,
Iterator,
List,
Optional,
Sequence,
Set,
Tuple,
Type,
TypeVar,
)
from datamodel_code_generator.format import Pyt... | from abc import ABC, abstractmethod
from enum import Enum, auto
from itertools import chain
from typing import (
Any,
ClassVar,
Dict,
FrozenSet,
Iterable,
Iterator,
List,
Optional,
Sequence,
Set,
Tuple,
Type,
TypeVar,
)
from datamodel_code_generator.format import Pyt... |
#!/usr/bin/env python3
# Copyright (c) 2018-2021 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test bitcoin-wallet."""
import hashlib
import os
import stat
import subprocess
import textwrap
from c... | #!/usr/bin/env python3
# Copyright (c) 2018-2021 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test bitcoin-wallet."""
import hashlib
import os
import stat
import subprocess
import textwrap
from c... |
#!/usr/bin/env python3
import uvicorn
import argparse
import sys
import yaml
import os
from suzieq.utils import load_sq_config, get_sq_install_dir
from suzieq.restServer.query import app_init
def get_cert_files(cfg):
sqdir = get_sq_install_dir()
ssl_certfile = cfg.get('rest', {}) \
.ge... | #!/usr/bin/env python3
import uvicorn
import argparse
import sys
import yaml
import os
from suzieq.utils import load_sq_config, get_sq_install_dir
from suzieq.restServer.query import app_init
def get_cert_files(cfg):
sqdir = get_sq_install_dir()
ssl_certfile = cfg.get('rest', {}) \
.ge... |
import asyncio
from typing import (
List,
Dict,
Optional,
Any,
)
from hummingbot.core.utils.wallet_setup import (
create_and_save_wallet,
import_and_save_wallet,
list_wallets,
unlock_wallet,
save_wallet
)
from hummingbot.client.config.config_var import ConfigVar
from hummingbot.clie... | import asyncio
from typing import (
List,
Dict,
Optional,
Any,
)
from hummingbot.core.utils.wallet_setup import (
create_and_save_wallet,
import_and_save_wallet,
list_wallets,
unlock_wallet,
save_wallet
)
from hummingbot.client.config.config_var import ConfigVar
from hummingbot.clie... |
src_data_file = 'nginx_logs_head.txt'
parsed_data_file = 'nginx_logs_parsed.csv'
parsed_data = []
def row_parse(item):
remote_IP_address, row_tail = item.split(maxsplit=1)
_, _request_datetime = row_tail.split('[', maxsplit=1)
request_datetime, row_tail = _request_datetime.split(']', maxsplit=1)
_, _... | src_data_file = 'nginx_logs_head.txt'
parsed_data_file = 'nginx_logs_parsed.csv'
parsed_data = []
def row_parse(item):
remote_IP_address, row_tail = item.split(maxsplit=1)
_, _request_datetime = row_tail.split('[', maxsplit=1)
request_datetime, row_tail = _request_datetime.split(']', maxsplit=1)
_, _... |
import unittest
from typing import Callable, List, Tuple
import torch
import torch.fx
import torch.fx.experimental.fx_acc.acc_tracer as acc_tracer
from fx2trt_oss.fx import (
TRTInterpreter,
InputTensorSpec,
TRTModule,
)
from torch.testing._internal.common_utils import TestCase
from torch.fx.experimental.n... | import unittest
from typing import Callable, List, Tuple
import torch
import torch.fx
import torch.fx.experimental.fx_acc.acc_tracer as acc_tracer
from fx2trt_oss.fx import (
TRTInterpreter,
InputTensorSpec,
TRTModule,
)
from torch.testing._internal.common_utils import TestCase
from torch.fx.experimental.n... |
# Copyright The PyTorch Lightning team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | # Copyright The PyTorch Lightning team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... |
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
"""
Estimating the susceptibility distortions without fieldmaps.
.. testsetup::
>>> tmpdir = getfixture('tmpdir')
>>> tmp = tmpdir.chdir() # changing to a temporary directory
>>> data = np.zer... | # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
"""
Estimating the susceptibility distortions without fieldmaps.
.. testsetup::
>>> tmpdir = getfixture('tmpdir')
>>> tmp = tmpdir.chdir() # changing to a temporary directory
>>> data = np.zer... |
# -*- coding: utf-8 -*-
from __future__ import print_function
import nose
from numpy.testing.decorators import slow
from datetime import datetime
from numpy import nan
from pandas import date_range,bdate_range, Timestamp
from pandas.core.index import Index, MultiIndex, Int64Index
from pandas.core.api import Categori... | # -*- coding: utf-8 -*-
from __future__ import print_function
import nose
from numpy.testing.decorators import slow
from datetime import datetime
from numpy import nan
from pandas import date_range,bdate_range, Timestamp
from pandas.core.index import Index, MultiIndex, Int64Index
from pandas.core.api import Categori... |
# coding=utf-8
# Copyright 2021 The HuggingFace Inc. team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | # coding=utf-8
# Copyright 2021 The HuggingFace Inc. team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... |
import base64
import json
import logging
from html.parser import HTMLParser
from http.client import HTTPConnection
from markupsafe import escape
from sqlalchemy import and_
from sqlalchemy.orm import eagerload, joinedload, lazyload, undefer
from sqlalchemy.sql import expression
from galaxy import (
model,
uti... | import base64
import json
import logging
from html.parser import HTMLParser
from http.client import HTTPConnection
from markupsafe import escape
from sqlalchemy import and_
from sqlalchemy.orm import eagerload, joinedload, lazyload, undefer
from sqlalchemy.sql import expression
from galaxy import (
model,
uti... |
import requests
import datetime
from lxml import html
headers = {"User-Agent": "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:89.0) Gecko/20100101 Firefox/89.0"}
class EFG():
def __init__(self):
self.data = requests.get(
"https://store-site-backend-static.ak.epicgames.com/freeGamesPromotions"
... | import requests
import datetime
from lxml import html
headers = {"User-Agent": "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:89.0) Gecko/20100101 Firefox/89.0"}
class EFG():
def __init__(self):
self.data = requests.get(
"https://store-site-backend-static.ak.epicgames.com/freeGamesPromotions"
... |
import asyncio
import pathlib
import sys
import time
from datetime import datetime
from decimal import Decimal
from typing import Any, Awaitable, Callable, Dict, List, Optional, Tuple, Union
import aiohttp
from chia.cmds.cmds_util import transaction_status_msg, transaction_submitted_msg
from chia.cmds.show import pri... | import asyncio
import pathlib
import sys
import time
from datetime import datetime
from decimal import Decimal
from typing import Any, Awaitable, Callable, Dict, List, Optional, Tuple, Union
import aiohttp
from chia.cmds.cmds_util import transaction_status_msg, transaction_submitted_msg
from chia.cmds.show import pri... |
import pickle
import traceback
from collections import Counter
from glob import glob
from pathlib import Path
from dpu_utils.utils import load_jsonl_gz
from .ts import code2identifiers, code2paths, code2paths4py, code2sexp
# JGD for alon_encoder
def paths2tokens(paths):
paths = [path.split(',') for path in path... | import pickle
import traceback
from collections import Counter
from glob import glob
from pathlib import Path
from dpu_utils.utils import load_jsonl_gz
from .ts import code2identifiers, code2paths, code2paths4py, code2sexp
# JGD for alon_encoder
def paths2tokens(paths):
paths = [path.split(',') for path in path... |
import math
import os
import re
from dataclasses import dataclass
from io import BytesIO
from typing import Dict, Callable, Tuple
from typing import List
from typing import Optional
from typing import Union
from urllib.parse import parse_qs, urlparse
import PIL
import requests
from PIL.Image import Image
from asyncpra... | import math
import os
import re
from dataclasses import dataclass
from io import BytesIO
from typing import Dict, Callable, Tuple
from typing import List
from typing import Optional
from typing import Union
from urllib.parse import parse_qs, urlparse
import PIL
import requests
from PIL.Image import Image
from asyncpra... |
import asyncio
import json
import logging
import traceback
from pathlib import Path
from typing import Any, Callable, Dict, List, Optional
import aiohttp
from joker.rpc.util import wrap_http_handler
from joker.server.outbound_message import NodeType
from joker.server.server import ssl_context_for_server
from joker.ty... | import asyncio
import json
import logging
import traceback
from pathlib import Path
from typing import Any, Callable, Dict, List, Optional
import aiohttp
from joker.rpc.util import wrap_http_handler
from joker.server.outbound_message import NodeType
from joker.server.server import ssl_context_for_server
from joker.ty... |
from decimal import Decimal
import time
import logging
import asyncio
import pandas as pd
from typing import List, Dict, Tuple
from hummingbot.core.utils.async_utils import safe_ensure_future
from hummingbot.core.clock import Clock
from hummingbot.core.data_type.limit_order import LimitOrder
from hummingbot.core.data_t... | from decimal import Decimal
import time
import logging
import asyncio
import pandas as pd
from typing import List, Dict, Tuple
from hummingbot.core.utils.async_utils import safe_ensure_future
from hummingbot.core.clock import Clock
from hummingbot.core.data_type.limit_order import LimitOrder
from hummingbot.core.data_t... |
"""Module for trying to find card info and write them to card_info"""
import json
import pandas as pd
import numpy as np
from collections import defaultdict
PATHBASE = "../card_info/specifics/"
def get_card_quality(df):
df["DrawQualityNew"] = (2*pd.to_numeric(df["Cards"], errors='coerce')).fillna(0).astype(np... | """Module for trying to find card info and write them to card_info"""
import json
import pandas as pd
import numpy as np
from collections import defaultdict
PATHBASE = "../card_info/specifics/"
def get_card_quality(df):
df["DrawQualityNew"] = (2*pd.to_numeric(df["Cards"], errors='coerce')).fillna(0).astype(np... |
# *******************************************************************************
# Copyright (C) 2021 INAF
#
# This software is distributed under the terms of the BSD-3-Clause license
#
# Authors:
# Ambra Di Piano <ambra.dipiano@inaf.it>
# *******************************************************************************... | # *******************************************************************************
# Copyright (C) 2021 INAF
#
# This software is distributed under the terms of the BSD-3-Clause license
#
# Authors:
# Ambra Di Piano <ambra.dipiano@inaf.it>
# *******************************************************************************... |
import logging
import math
from time import process_time
from datetime import date
from numpy.core.numeric import Infinity, NaN
import pandas as pd
from bsbetl.alltable_calcs import Calculation
from bsbetl.alltable_calcs.at_params import at_calc_params
from bsbetl.calc_helpers import first_trading_row_index, last_days... | import logging
import math
from time import process_time
from datetime import date
from numpy.core.numeric import Infinity, NaN
import pandas as pd
from bsbetl.alltable_calcs import Calculation
from bsbetl.alltable_calcs.at_params import at_calc_params
from bsbetl.calc_helpers import first_trading_row_index, last_days... |
# Copyright 2018 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
import functools
import logging
import os
import re
from dataclasses import dataclass
from enum import Enum
from pants.backend.jvm.subsystems.dependency_context import DependencyContext ... | # Copyright 2018 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
import functools
import logging
import os
import re
from dataclasses import dataclass
from enum import Enum
from pants.backend.jvm.subsystems.dependency_context import DependencyContext ... |
#!/usr/bin/env python3.9
# -*- coding: utf-8 -*-
# ██████╗██╗██████╗ ██████╗██╗ ███████╗███████╗
# ██╔════╝██║██╔══██╗██╔════╝██║ ██╔════╝██╔════╝
# ██║ ██║██████╔╝██║ ██║ █████╗ ███████╗
# ██║ ██║██╔══██╗██║ ██║ ██╔══╝ ╚════██║
# ╚██████╗██║██║ ██║╚██████╗███████╗███████╗███████║
... | #!/usr/bin/env python3.9
# -*- coding: utf-8 -*-
# ██████╗██╗██████╗ ██████╗██╗ ███████╗███████╗
# ██╔════╝██║██╔══██╗██╔════╝██║ ██╔════╝██╔════╝
# ██║ ██║██████╔╝██║ ██║ █████╗ ███████╗
# ██║ ██║██╔══██╗██║ ██║ ██╔══╝ ╚════██║
# ╚██████╗██║██║ ██║╚██████╗███████╗███████╗███████║
... |
# -*- coding: utf8 -*-
# Copyright (c) 2019 Niklas Rosenstein
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, mo... | # -*- coding: utf8 -*-
# Copyright (c) 2019 Niklas Rosenstein
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, mo... |
from typing import Dict, List, Optional, Tuple
import aiosqlite
from thyme.consensus.block_record import BlockRecord
from thyme.types.blockchain_format.sized_bytes import bytes32
from thyme.types.blockchain_format.sub_epoch_summary import SubEpochSummary
from thyme.types.header_block import HeaderBlock
from thyme.uti... | from typing import Dict, List, Optional, Tuple
import aiosqlite
from thyme.consensus.block_record import BlockRecord
from thyme.types.blockchain_format.sized_bytes import bytes32
from thyme.types.blockchain_format.sub_epoch_summary import SubEpochSummary
from thyme.types.header_block import HeaderBlock
from thyme.uti... |
import os
# use if needed to pass args to external modules
import sys
# used for directory handling
import glob
import time
import threading
#gogo MOD telegram needs import request
import requests
# needed for the binance API / websockets / Exception handling
from binance.client import Client
from binance.exceptions ... | import os
# use if needed to pass args to external modules
import sys
# used for directory handling
import glob
import time
import threading
#gogo MOD telegram needs import request
import requests
# needed for the binance API / websockets / Exception handling
from binance.client import Client
from binance.exceptions ... |
import unittest
from unittest import mock
import discord
from bot.cogs.sync.syncers import RoleSyncer, _Diff, _Role
from tests import helpers
def fake_role(**kwargs):
"""Fixture to return a dictionary representing a role with default values set."""
kwargs.setdefault("id", 9)
kwargs.setdefault("name", "f... | import unittest
from unittest import mock
import discord
from bot.cogs.sync.syncers import RoleSyncer, _Diff, _Role
from tests import helpers
def fake_role(**kwargs):
"""Fixture to return a dictionary representing a role with default values set."""
kwargs.setdefault("id", 9)
kwargs.setdefault("name", "f... |
# as due to their complexity multi-gpu tests could impact other tests, and to aid debug we have those in a separate module.
import logging
import os
import sys
from pathlib import Path
import pytest
import torch
from transformers.testing_utils import TestCasePlus, require_torch_multigpu
from .utils import load_json... | # as due to their complexity multi-gpu tests could impact other tests, and to aid debug we have those in a separate module.
import logging
import os
import sys
from pathlib import Path
import pytest
import torch
from transformers.testing_utils import TestCasePlus, require_torch_multigpu
from .utils import load_json... |
"""
Arquivo de definição da entidade matches do banco de dados.
"""
from sqlalchemy import Column, Integer, ForeignKey
from sqlalchemy.ext.declarative import declarative_base
from App.database_models.users import Users
from api_utils.json_helper import build_json_response
Base = declarative_base()
class Matches(Ba... | """
Arquivo de definição da entidade matches do banco de dados.
"""
from sqlalchemy import Column, Integer, ForeignKey
from sqlalchemy.ext.declarative import declarative_base
from App.database_models.users import Users
from api_utils.json_helper import build_json_response
Base = declarative_base()
class Matches(Ba... |
import base64
import json
import re
import requests
from bs4 import BeautifulSoup
from requests import request
URL_API = '/v2/api'
URL_LOGIN = f'{URL_API}/auth/login'
URL_DASHBOARD = f'{URL_API}/student/dashboard/dashboard'
URL_CALENDAR = f'{URL_API}/calendar/student'
URL_GRADES = f'{URL_API}/student/all_subjects'
UR... | import base64
import json
import re
import requests
from bs4 import BeautifulSoup
from requests import request
URL_API = '/v2/api'
URL_LOGIN = f'{URL_API}/auth/login'
URL_DASHBOARD = f'{URL_API}/student/dashboard/dashboard'
URL_CALENDAR = f'{URL_API}/calendar/student'
URL_GRADES = f'{URL_API}/student/all_subjects'
UR... |
"""
Carlos Barona
Agile UNO Module 5
Strings and Lists
"""
from sys import exit # Import 'exit' from the 'sys' library
import sys # Import the 'sys' library
import requests # Import the 'requests' library
site_data = {} # Setting an empty dictionary
with open("sites.csv", "r") as infile: # Using a context manager t... | """
Carlos Barona
Agile UNO Module 5
Strings and Lists
"""
from sys import exit # Import 'exit' from the 'sys' library
import sys # Import the 'sys' library
import requests # Import the 'requests' library
site_data = {} # Setting an empty dictionary
with open("sites.csv", "r") as infile: # Using a context manager t... |
import CloudFlare
import os
from loguru import logger
def update(docker_records_list, ip):
ttl = os.getenv('TTL', 60)
zones = _get_zones()
logger.info('INFO: got list of all zones')
for zone in zones:
zone_id = zone['id']
controlled_records = []
control_record_id = None
... | import CloudFlare
import os
from loguru import logger
def update(docker_records_list, ip):
ttl = os.getenv('TTL', 60)
zones = _get_zones()
logger.info('INFO: got list of all zones')
for zone in zones:
zone_id = zone['id']
controlled_records = []
control_record_id = None
... |
from dataset import trainset
from model import ModelDic
import argparse
import glob
import sys
import numpy as np
import matplotlib.pyplot as plt
from torch.utils.data import Dataset, DataLoader
import torch.functional as F
import torch.optim as optim
import torch.nn as nn
import torch
import os
import time
save_po... |
from dataset import trainset
from model import ModelDic
import argparse
import glob
import sys
import numpy as np
import matplotlib.pyplot as plt
from torch.utils.data import Dataset, DataLoader
import torch.functional as F
import torch.optim as optim
import torch.nn as nn
import torch
import os
import time
save_po... |
import logging
import os
import sys
import math
from datetime import datetime, timedelta, timezone, time
from zoneinfo import ZoneInfo
import dateparser
import hjson
import pandas as pd
import psutil
import redis
import shortuuid
from dotenv import load_dotenv
from faker import Faker
from sqlalchemy import create_engin... | import logging
import os
import sys
import math
from datetime import datetime, timedelta, timezone, time
from zoneinfo import ZoneInfo
import dateparser
import hjson
import pandas as pd
import psutil
import redis
import shortuuid
from dotenv import load_dotenv
from faker import Faker
from sqlalchemy import create_engin... |
import json
from textwrap import dedent
from typing import Dict, Iterator, Optional, Union
import retryrequests
from ._logger import logger
from ._sponsor import Sponsor
class GitHubV4Client:
def __init__(self, token: str) -> None:
self.__token = token
def exec_query(
self, query: str, vari... | import json
from textwrap import dedent
from typing import Dict, Iterator, Optional, Union
import retryrequests
from ._logger import logger
from ._sponsor import Sponsor
class GitHubV4Client:
def __init__(self, token: str) -> None:
self.__token = token
def exec_query(
self, query: str, vari... |
import typing
from datetime import datetime
from ..schema import BaseTransformer
class Transformer(BaseTransformer):
"""Transform Tennessee raw data for consolidation."""
postal_code = "TN"
fields = dict(
company="Company",
location=lambda row: row["City"] or f"{row["County"]} County",
... | import typing
from datetime import datetime
from ..schema import BaseTransformer
class Transformer(BaseTransformer):
"""Transform Tennessee raw data for consolidation."""
postal_code = "TN"
fields = dict(
company="Company",
location=lambda row: row["City"] or f"{row['County']} County",
... |
from collections import defaultdict
import itertools
import logging
import typing
from typing import Any, Dict, Hashable, List, Optional, Set, Text, Tuple, Type, Iterable
import rasa.utils.train_utils
from rasa.exceptions import MissingDependencyException
from rasa.nlu.constants import COMPONENT_INDEX
from rasa.shared... | from collections import defaultdict
import itertools
import logging
import typing
from typing import Any, Dict, Hashable, List, Optional, Set, Text, Tuple, Type, Iterable
import rasa.utils.train_utils
from rasa.exceptions import MissingDependencyException
from rasa.nlu.constants import COMPONENT_INDEX
from rasa.shared... |
# pip install cassandra-driver
from cassandra import AlreadyExists
from cassandra.cluster import Cluster
class CassandraWrapper:
def __init__(self, keyspace='lambda'):
self.cluster = Cluster(['127.0.0.1'], port=9042)
self.keyspace = keyspace
self._setup_db() # Create the keyspace
... | # pip install cassandra-driver
from cassandra import AlreadyExists
from cassandra.cluster import Cluster
class CassandraWrapper:
def __init__(self, keyspace='lambda'):
self.cluster = Cluster(['127.0.0.1'], port=9042)
self.keyspace = keyspace
self._setup_db() # Create the keyspace
... |
from marathon import MarathonClient, MarathonHttpError
from zappa.async import task
import os
import requests
import time
import yaml
dcos_username = os.environ['DCOS_USERNAME']
dcos_password = os.environ['DCOS_PASSWORD']
config = yaml.load(open('config.yaml'))
headers = {'Content-Type': 'application/json'}
payload ... | from marathon import MarathonClient, MarathonHttpError
from zappa.async import task
import os
import requests
import time
import yaml
dcos_username = os.environ['DCOS_USERNAME']
dcos_password = os.environ['DCOS_PASSWORD']
config = yaml.load(open('config.yaml'))
headers = {'Content-Type': 'application/json'}
payload ... |
import time
import torch
import torchani
import pynvml
import gc
import os
from ase.io import read
import argparse
summary = '\n'
runcounter = 0
N = 200
last_py_speed = None
def checkgpu(device=None):
i = device if device else torch.cuda.current_device()
t = torch.cuda.get_device_properties(i).total_memory
... | import time
import torch
import torchani
import pynvml
import gc
import os
from ase.io import read
import argparse
summary = '\n'
runcounter = 0
N = 200
last_py_speed = None
def checkgpu(device=None):
i = device if device else torch.cuda.current_device()
t = torch.cuda.get_device_properties(i).total_memory
... |
"""
Contains an Op for convolving input images with a set of filters. This was
developed especially for Convolutional Neural Networks.
For related ops, including downsampling and subsampling, see
tensor.signal and tensor.signal.pool.
See especially conv2d().
"""
import logging
import warnings
import numpy as np
fr... | """
Contains an Op for convolving input images with a set of filters. This was
developed especially for Convolutional Neural Networks.
For related ops, including downsampling and subsampling, see
tensor.signal and tensor.signal.pool.
See especially conv2d().
"""
import logging
import warnings
import numpy as np
fr... |
from __future__ import annotations
from pathlib import Path
from typing import TYPE_CHECKING
import pytest
from poetry.factory import Factory
if TYPE_CHECKING:
from cleo.testers.command_tester import CommandTester
from poetry.poetry import Poetry
from tests.types import CommandTesterFactory
@pytest.... | from __future__ import annotations
from pathlib import Path
from typing import TYPE_CHECKING
import pytest
from poetry.factory import Factory
if TYPE_CHECKING:
from cleo.testers.command_tester import CommandTester
from poetry.poetry import Poetry
from tests.types import CommandTesterFactory
@pytest.... |
#!/usr/bin/env python3
# coding: utf-8
from __future__ import absolute_import, unicode_literals
import collections
import contextlib
import copy
import datetime
import errno
import fileinput
import functools
import io
import itertools
import json
import locale
import operator
import os
import platform
import re
impor... | #!/usr/bin/env python3
# coding: utf-8
from __future__ import absolute_import, unicode_literals
import collections
import contextlib
import copy
import datetime
import errno
import fileinput
import functools
import io
import itertools
import json
import locale
import operator
import os
import platform
import re
impor... |
from __future__ import annotations
from itertools import zip_longest
from math import floor
from typing import List, Tuple, Union
class Category:
STR_SIZE = 30
ledger: List[dict]
balance: int
def __init__(self, name: str):
self.name = name
self.ledger = []
def deposit(self, amo... | from __future__ import annotations
from itertools import zip_longest
from math import floor
from typing import List, Tuple, Union
class Category:
STR_SIZE = 30
ledger: List[dict]
balance: int
def __init__(self, name: str):
self.name = name
self.ledger = []
def deposit(self, amo... |
"""Main classes to add caching features to ``requests.Session``
.. autosummary::
:nosignatures:
CachedSession
CacheMixin
.. Explicitly show inherited method docs on CachedSession instead of CachedMixin
.. autoclass:: requests_cache.session.CachedSession
:show-inheritance:
:inherited-members:
.. aut... | """Main classes to add caching features to ``requests.Session``
.. autosummary::
:nosignatures:
CachedSession
CacheMixin
.. Explicitly show inherited method docs on CachedSession instead of CachedMixin
.. autoclass:: requests_cache.session.CachedSession
:show-inheritance:
:inherited-members:
.. aut... |
from .segmenter import tools
my_id = "test:read_fluorescence"
__version__ = "0.1"
def register(meta):
meta.id = my_id
meta.name = "Stack loop"
meta.category = "Test"
#meta.run_dep = "simple_stack_reader", "stack"
meta.run_ret = "i_frame", "i_channel"
loop_dependencies = ((my_id, ("_i_frame",... | from .segmenter import tools
my_id = "test:read_fluorescence"
__version__ = "0.1"
def register(meta):
meta.id = my_id
meta.name = "Stack loop"
meta.category = "Test"
#meta.run_dep = "simple_stack_reader", "stack"
meta.run_ret = "i_frame", "i_channel"
loop_dependencies = ((my_id, ("_i_frame",... |
import asyncio
import enum
import functools
import gzip
import hashlib
import html
import http
import http.cookies
import importlib.util
import inspect
import io
import json
import math
import os
import re
import stat
import sys
import tempfile
import traceback
import typing
from collections import namedtuple
from col... | import asyncio
import enum
import functools
import gzip
import hashlib
import html
import http
import http.cookies
import importlib.util
import inspect
import io
import json
import math
import os
import re
import stat
import sys
import tempfile
import traceback
import typing
from collections import namedtuple
from col... |
#!/usr/bin/env python3
#
# Generates an HTML file for previewing all styles defined in a CSS file
#
# dependencies: cssutils
# USAGE:
# css_preview_generator.py style.css -o preview.html
import html
import io
import sys
import cssutils
image_placeholder = "data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www... | #!/usr/bin/env python3
#
# Generates an HTML file for previewing all styles defined in a CSS file
#
# dependencies: cssutils
# USAGE:
# css_preview_generator.py style.css -o preview.html
import html
import io
import sys
import cssutils
image_placeholder = "data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www... |
# (C) Datadog, Inc. 2021-present
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)
from contextlib import contextmanager
from copy import deepcopy
from datadog_checks.avi_vantage import metrics
from datadog_checks.base import AgentCheck, OpenMetricsBaseCheckV2
from datadog_checks.base.e... | # (C) Datadog, Inc. 2021-present
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)
from contextlib import contextmanager
from copy import deepcopy
from datadog_checks.avi_vantage import metrics
from datadog_checks.base import AgentCheck, OpenMetricsBaseCheckV2
from datadog_checks.base.e... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
: Project - Test speed of different models
: standalone segmentation using torch in-built models - fcn, deeplabv3, lr-aspp
: Author - Xi Mo
: Institute - University of Kansas
: Date - 5/13/2021 last updated 5/15/2021
: Model Reference:
https://pytorch.org/vision/st... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
: Project - Test speed of different models
: standalone segmentation using torch in-built models - fcn, deeplabv3, lr-aspp
: Author - Xi Mo
: Institute - University of Kansas
: Date - 5/13/2021 last updated 5/15/2021
: Model Reference:
https://pytorch.org/vision/st... |
__author__ = "Fox Cunning"
import configparser
import os
import threading
import time
import tkinter
from typing import Optional, Tuple, List
import pyo
import appJar
import colour
from APU.APU import APU
from debug import log
from editor_settings import EditorSettings
from rom import ROM
# ------------------------... | __author__ = "Fox Cunning"
import configparser
import os
import threading
import time
import tkinter
from typing import Optional, Tuple, List
import pyo
import appJar
import colour
from APU.APU import APU
from debug import log
from editor_settings import EditorSettings
from rom import ROM
# ------------------------... |
from typing import Optional
from pydantic import AnyUrl, BaseSettings, validator
class Settings(BaseSettings):
SERVER_NAME: str = ""
APPLICATION_NAME: str = "TLS Reporting"
APPLICATION_DESCRIPTION: str = """A number of protocols exist for establishing encrypted channels between SMTP
Mail Transfer Agents... | from typing import Optional
from pydantic import AnyUrl, BaseSettings, validator
class Settings(BaseSettings):
SERVER_NAME: str = ""
APPLICATION_NAME: str = "TLS Reporting"
APPLICATION_DESCRIPTION: str = """A number of protocols exist for establishing encrypted channels between SMTP
Mail Transfer Agents... |
import shlex
from distutils.version import LooseVersion
from functools import partial
from itertools import product
from shipyard import Action, CIPrettyLogAction, IsolatedAction, ctx
#####################################
# Travis: Wait and pull/push images #
#####################################
def wait_and_pull_c... | import shlex
from distutils.version import LooseVersion
from functools import partial
from itertools import product
from shipyard import Action, CIPrettyLogAction, IsolatedAction, ctx
#####################################
# Travis: Wait and pull/push images #
#####################################
def wait_and_pull_c... |
import os
import sys
import uuid
import tempfile
import time
from io import StringIO
import re
import numpy as np
import trimesh
from pyobb.obb import OBB
from scipy.spatial import ConvexHull
from .meshing.surface_mesh_parameters import default_surface_mesh_parameter
from .face import Face
from .tools im... | import os
import sys
import uuid
import tempfile
import time
from io import StringIO
import re
import numpy as np
import trimesh
from pyobb.obb import OBB
from scipy.spatial import ConvexHull
from .meshing.surface_mesh_parameters import default_surface_mesh_parameter
from .face import Face
from .tools im... |
import bagel
import pathlib
def main():
bagel.utils.mkdirs(output_path)
file_list = bagel.utils.file_list(input_path)
for file in file_list:
kpi = bagel.utils.load_kpi(file)
print(f'KPI: {kpi.name}')
kpi.complete_timestamp()
train_kpi, valid_kpi, test_kpi = kpi.split((0.49... | import bagel
import pathlib
def main():
bagel.utils.mkdirs(output_path)
file_list = bagel.utils.file_list(input_path)
for file in file_list:
kpi = bagel.utils.load_kpi(file)
print(f'KPI: {kpi.name}')
kpi.complete_timestamp()
train_kpi, valid_kpi, test_kpi = kpi.split((0.49... |
#!/usr/bin/python3
import argparse, logging, os, sys, time
from utils.setup import *
from utils.dataset import DepSpaceDataset
def parse_arguments():
arg_parser = argparse.ArgumentParser(description='Probe Training')
arg_parser.add_argument('ud_path', help='path to Universal Dependencies directory')
arg_parser.a... | #!/usr/bin/python3
import argparse, logging, os, sys, time
from utils.setup import *
from utils.dataset import DepSpaceDataset
def parse_arguments():
arg_parser = argparse.ArgumentParser(description='Probe Training')
arg_parser.add_argument('ud_path', help='path to Universal Dependencies directory')
arg_parser.a... |
from discord.ext import commands
import random as rng
from collections import Counter
from typing import Optional
from .utils.formats import plural
class RNG(commands.Cog):
"""Utilities that provide pseudo-RNG."""
def __init__(self, bot):
self.bot = bot
@commands.group(pass_context=True)
asyn... | from discord.ext import commands
import random as rng
from collections import Counter
from typing import Optional
from .utils.formats import plural
class RNG(commands.Cog):
"""Utilities that provide pseudo-RNG."""
def __init__(self, bot):
self.bot = bot
@commands.group(pass_context=True)
asyn... |
import argparse
import ast
import codecs
import collections
import contextlib
import keyword
import re
import string
import sys
import tokenize
import warnings
from typing import Any
from typing import cast
from typing import Container
from typing import Dict
from typing import Generator
from typing import Iterable
fro... | import argparse
import ast
import codecs
import collections
import contextlib
import keyword
import re
import string
import sys
import tokenize
import warnings
from typing import Any
from typing import cast
from typing import Container
from typing import Dict
from typing import Generator
from typing import Iterable
fro... |
from __future__ import annotations
import re
import enum
import asyncio
import warnings
from io import BytesIO
from typing import Any, List, Optional
from asyncio import TimeoutError
import PIL
import aiohttp
import discord
from PIL.Image import DecompressionBombWarning
from discord.ext import commands
from pink.e... | from __future__ import annotations
import re
import enum
import asyncio
import warnings
from io import BytesIO
from typing import Any, List, Optional
from asyncio import TimeoutError
import PIL
import aiohttp
import discord
from PIL.Image import DecompressionBombWarning
from discord.ext import commands
from pink.e... |
"""General utility functions."""
import datetime as dt
import logging as lg
import sys
import unicodedata
from pathlib import Path
from . import _version
from . import settings
def citation():
"""
Print the OSMnx package's citation information.
Boeing, G. 2017. OSMnx: New Methods for Acquiring, Constru... | """General utility functions."""
import datetime as dt
import logging as lg
import sys
import unicodedata
from pathlib import Path
from . import _version
from . import settings
def citation():
"""
Print the OSMnx package's citation information.
Boeing, G. 2017. OSMnx: New Methods for Acquiring, Constru... |
import asyncio
import datetime
import functools
import json
import re
import textwrap
import urllib
from collections import namedtuple
from io import BytesIO
import aiohttp
import discord
from bs4 import BeautifulSoup
from html2text import html2text as h2t
from redbot.core import commands
from redbot.core.bot import R... | import asyncio
import datetime
import functools
import json
import re
import textwrap
import urllib
from collections import namedtuple
from io import BytesIO
import aiohttp
import discord
from bs4 import BeautifulSoup
from html2text import html2text as h2t
from redbot.core import commands
from redbot.core.bot import R... |
import constants
from models.worker_spec import (
args_list_from_spec_params
)
def update_all_deployments(api, apps_api_instance, spec, status, namespace):
worker_deployment = update_worker_deployment(
apps_api_instance, spec, status, namespace
)
flower_deployment = update_flower_deployment(
... | import constants
from models.worker_spec import (
args_list_from_spec_params
)
def update_all_deployments(api, apps_api_instance, spec, status, namespace):
worker_deployment = update_worker_deployment(
apps_api_instance, spec, status, namespace
)
flower_deployment = update_flower_deployment(
... |
from flask import render_template, url_for, flash, redirect, request
from website import app, db, login_manager
from website.forms import LinkForm, EditForm, LoginForm
from website.models import Link, User
import json
import re
from flask_login import LoginManager, login_user, current_user, logout_user, login_required
... | from flask import render_template, url_for, flash, redirect, request
from website import app, db, login_manager
from website.forms import LinkForm, EditForm, LoginForm
from website.models import Link, User
import json
import re
from flask_login import LoginManager, login_user, current_user, logout_user, login_required
... |
import numpy as np
import os
import json
import collections
import cv2
import tensorflow as tf
from config import CONFIG
CONFIG = CONFIG()
#from prepare_img_features import model_config_dict
model_config_dict = {'mobilenet_v2': {'model': tf.keras.applications.MobileNetV2,
'featur... | import numpy as np
import os
import json
import collections
import cv2
import tensorflow as tf
from config import CONFIG
CONFIG = CONFIG()
#from prepare_img_features import model_config_dict
model_config_dict = {'mobilenet_v2': {'model': tf.keras.applications.MobileNetV2,
'featur... |
import random, RouteFinder, Board,moveLogic,bestReply
from typing import Dict
def getMove(head: Dict[str, int], coOrd: Dict[str, int]):
if head["x"] == (coOrd["x"] + 1):
return "left"
if head["x"] == (coOrd["x"] - 1):
return "right"
if head["y"] == (coOrd["y"] + 1):
return "down"
... | import random, RouteFinder, Board,moveLogic,bestReply
from typing import Dict
def getMove(head: Dict[str, int], coOrd: Dict[str, int]):
if head["x"] == (coOrd["x"] + 1):
return "left"
if head["x"] == (coOrd["x"] - 1):
return "right"
if head["y"] == (coOrd["y"] + 1):
return "down"
... |
from hikari import Member,Embed, GatewayGuild, GuildReactionAddEvent, GuildMessageCreateEvent
from lightbulb import Plugin, Context, SlashCommand, command, option, implements, guild_only
from core.cd import Cooldown
cd = Cooldown(1, 60)
plugin = Plugin("Niveaux")
plugin.add_checks(guild_only)
def get_progress_bar(l... | from hikari import Member,Embed, GatewayGuild, GuildReactionAddEvent, GuildMessageCreateEvent
from lightbulb import Plugin, Context, SlashCommand, command, option, implements, guild_only
from core.cd import Cooldown
cd = Cooldown(1, 60)
plugin = Plugin("Niveaux")
plugin.add_checks(guild_only)
def get_progress_bar(l... |
# Copyright 2020 Google, LLC.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | # Copyright 2020 Google, LLC.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
"""Irrigation Unlimited Coordinator and sub classes"""
from datetime import datetime, time, timedelta
from types import MappingProxyType
from typing import OrderedDict
import homeassistant
from homeassistant.core import HomeAssistant, CALLBACK_TYPE
from homeassistant.helpers.entity import Entity
from homeassistant.help... | """Irrigation Unlimited Coordinator and sub classes"""
from datetime import datetime, time, timedelta
from types import MappingProxyType
from typing import OrderedDict
import homeassistant
from homeassistant.core import HomeAssistant, CALLBACK_TYPE
from homeassistant.helpers.entity import Entity
from homeassistant.help... |
# -*- coding: utf-8 -*-
import argparse
import os
import shutil
from github import Github
MD_HEAD = """## ssh 的博客
大家好,我是 ssh,现在在字节跳动的 Web Infra 担任前端工程师,微信:**[sshsunlight](https://p1-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/017d568dc1d14cd883cc3238350a39ec~tplv-k3u1fbpfcp-watermark.image)**,欢迎找我交个朋友。
我会在公众号「前端从进阶到入院」每日... | # -*- coding: utf-8 -*-
import argparse
import os
import shutil
from github import Github
MD_HEAD = """## ssh 的博客
大家好,我是 ssh,现在在字节跳动的 Web Infra 担任前端工程师,微信:**[sshsunlight](https://p1-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/017d568dc1d14cd883cc3238350a39ec~tplv-k3u1fbpfcp-watermark.image)**,欢迎找我交个朋友。
我会在公众号「前端从进阶到入院」每日... |
import datetime
import MySQLdb
from itemadapter import ItemAdapter
from scrapy.exceptions import DropItem
from naver_movie.config import db_info
class NaverMoviePipeline:
def __init__(self):
self.conn = MySQLdb.connect(**db_info)
self.curs = self.conn.cursor()
def open_spider(self, spider):
... | import datetime
import MySQLdb
from itemadapter import ItemAdapter
from scrapy.exceptions import DropItem
from naver_movie.config import db_info
class NaverMoviePipeline:
def __init__(self):
self.conn = MySQLdb.connect(**db_info)
self.curs = self.conn.cursor()
def open_spider(self, spider):
... |
# -*- coding: utf-8 -*-
# ----------------------------------------------------------------------------
# Name: _extd_ast_expr
# Purpose: Extensions of AST subclasses used in expressions
#
# Author: Michael Amrhein (michael@adrhinum.de)
#
# Copyright: (c) 2018 ff. Michael Amrhein
# License: This pr... | # -*- coding: utf-8 -*-
# ----------------------------------------------------------------------------
# Name: _extd_ast_expr
# Purpose: Extensions of AST subclasses used in expressions
#
# Author: Michael Amrhein (michael@adrhinum.de)
#
# Copyright: (c) 2018 ff. Michael Amrhein
# License: This pr... |
import logging
from flask import Blueprint, Markup
from flask import (request, render_template, send_file, redirect, url_for,
flash, abort)
from flask_menu import register_menu
from .. import api
from ._navbar import show_items, activate_items
from ._utils import (call, create_csv, mark_pair_viewe... | import logging
from flask import Blueprint, Markup
from flask import (request, render_template, send_file, redirect, url_for,
flash, abort)
from flask_menu import register_menu
from .. import api
from ._navbar import show_items, activate_items
from ._utils import (call, create_csv, mark_pair_viewe... |
""" Camera extractor functions
This module handles extraction of camera timestamps for both Bpod and FPGA.
"""
import logging
from functools import partial
import cv2
import numpy as np
import matplotlib.pyplot as plt
from oneibl.stream import VideoStreamer
import ibllib.dsp.utils as dsp
from ibllib.misc import range... | """ Camera extractor functions
This module handles extraction of camera timestamps for both Bpod and FPGA.
"""
import logging
from functools import partial
import cv2
import numpy as np
import matplotlib.pyplot as plt
from oneibl.stream import VideoStreamer
import ibllib.dsp.utils as dsp
from ibllib.misc import range... |
import requests
from osbot_aws.apis.Lambda import Lambda
from gw_bot.api.API_Slack import API_Slack
from gw_bot.api.gw.API_Glasswall import API_Glasswall
from osbot_aws.helpers.Lambda_Helpers import slack_message
from osbot_utils.utils.Files import Files
class API_GW_Slack_File:
def __init__(self):
self.a... | import requests
from osbot_aws.apis.Lambda import Lambda
from gw_bot.api.API_Slack import API_Slack
from gw_bot.api.gw.API_Glasswall import API_Glasswall
from osbot_aws.helpers.Lambda_Helpers import slack_message
from osbot_utils.utils.Files import Files
class API_GW_Slack_File:
def __init__(self):
self.a... |
import time
import os
import subprocess
class Design(object):
def __init__(self):
self.top_name = "design" + time.strftime("%Y-%m-%d", time.localtime())
self.is_Chisel_design = False
self.rtl_input = " "
self.Chisel_input = " "
self.result_dir = "./design/"
... | import time
import os
import subprocess
class Design(object):
def __init__(self):
self.top_name = "design" + time.strftime("%Y-%m-%d", time.localtime())
self.is_Chisel_design = False
self.rtl_input = " "
self.Chisel_input = " "
self.result_dir = "./design/"
... |
# Copyright 2018 The Cirq Developers
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | # Copyright 2018 The Cirq Developers
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... |
import torch
import torch.nn as nn
import torch.nn.functional as F
class ConditionedCNNClassifier(nn.Module):
def __init__(self, net_cfg, embed_cfg):
super().__init__()
self.net_cfg = net_cfg
self.embed_cfg = embed_cfg
print('----------- Model Config---------------')
print(f... | import torch
import torch.nn as nn
import torch.nn.functional as F
class ConditionedCNNClassifier(nn.Module):
def __init__(self, net_cfg, embed_cfg):
super().__init__()
self.net_cfg = net_cfg
self.embed_cfg = embed_cfg
print('----------- Model Config---------------')
print(f... |
import lusid
import lusid.models as models
from lusid.api import InstrumentsApi, SearchApi
import numpy as np
import time
from lusidtools.cocoon.utilities import checkargs
import pandas as pd
import logging
import re
from lusidtools.cocoon.async_tools import run_in_executor
import asyncio
from typing import Callable
... | import lusid
import lusid.models as models
from lusid.api import InstrumentsApi, SearchApi
import numpy as np
import time
from lusidtools.cocoon.utilities import checkargs
import pandas as pd
import logging
import re
from lusidtools.cocoon.async_tools import run_in_executor
import asyncio
from typing import Callable
... |
# coding: utf-8
"""Expose data to different interface
ZMQStream explose to a ZeroMQ socket in a REQ/REP pattern.
Copyright (c) 2017, European X-Ray Free-Electron Laser Facility GmbH
All rights reserved.
You should have received a copy of the 3-Clause BSD License along with this
program. If not, see <https://opensour... | # coding: utf-8
"""Expose data to different interface
ZMQStream explose to a ZeroMQ socket in a REQ/REP pattern.
Copyright (c) 2017, European X-Ray Free-Electron Laser Facility GmbH
All rights reserved.
You should have received a copy of the 3-Clause BSD License along with this
program. If not, see <https://opensour... |
from dotenv import load_dotenv
from twitchio.ext import commands
import os
load_dotenv()
# Set up the bot.
bot = commands.Bot(
irc_token=os.environ['TMI_TOKEN'],
client_id=os.environ['CLIENT_ID'],
nick=os.environ['BOT_NICK'],
prefix=os.environ['BOT_PREFIX'],
initial_channels=[os.enviro... | from dotenv import load_dotenv
from twitchio.ext import commands
import os
load_dotenv()
# Set up the bot.
bot = commands.Bot(
irc_token=os.environ['TMI_TOKEN'],
client_id=os.environ['CLIENT_ID'],
nick=os.environ['BOT_NICK'],
prefix=os.environ['BOT_PREFIX'],
initial_channels=[os.enviro... |
import logging
from dataclasses import dataclass
from pathlib import Path
from typing import Any, List, Tuple
import yaml
# loading package files: https://stackoverflow.com/a/20885799
try:
import importlib.resources as pkg_resources
except ImportError:
# Try backported to PY<37 `importlib_resources`.
imp... | import logging
from dataclasses import dataclass
from pathlib import Path
from typing import Any, List, Tuple
import yaml
# loading package files: https://stackoverflow.com/a/20885799
try:
import importlib.resources as pkg_resources
except ImportError:
# Try backported to PY<37 `importlib_resources`.
imp... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.