edited_code stringlengths 17 978k | original_code stringlengths 17 978k |
|---|---|
from fvcore.common.registry import Registry
from omegaconf.listconfig import ListConfig
from collections import OrderedDict
import re
import math
import copy
import threading
import numpy as np
import torch
import torch.nn.functional as F
from torch import nn
from .. import (
build_encoder_module, interp_clip_vp_... | from fvcore.common.registry import Registry
from omegaconf.listconfig import ListConfig
from collections import OrderedDict
import re
import math
import copy
import threading
import numpy as np
import torch
import torch.nn.functional as F
from torch import nn
from .. import (
build_encoder_module, interp_clip_vp_... |
from urllib.request import urlopen
from bs4 import BeautifulSoup
import pandas as pd
def divider_tag(tag):
tag = tag[tag.find('>') + 1:tag.find('</')]
if len(tag) == 0:
tag = '-'
return tag
def attach(names):
result = ''
if len(names) != 1:
for i in range(len(names)):
... | from urllib.request import urlopen
from bs4 import BeautifulSoup
import pandas as pd
def divider_tag(tag):
tag = tag[tag.find('>') + 1:tag.find('</')]
if len(tag) == 0:
tag = '-'
return tag
def attach(names):
result = ''
if len(names) != 1:
for i in range(len(names)):
... |
#
# MIT License
#
# Copyright (c) 2020 Airbyte
#
# 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, modify, merge, pu... | #
# MIT License
#
# Copyright (c) 2020 Airbyte
#
# 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, modify, merge, pu... |
from twitchAPI.types import VideoType, EventSubSubscriptionConflict, EventSubSubscriptionTimeout, EventSubSubscriptionError
from time import sleep
from threading import Thread
import logging
from vodloader_video import vodloader_video
from vodloader_status import vodloader_status
from youtube_uploader import YouTubeOve... | from twitchAPI.types import VideoType, EventSubSubscriptionConflict, EventSubSubscriptionTimeout, EventSubSubscriptionError
from time import sleep
from threading import Thread
import logging
from vodloader_video import vodloader_video
from vodloader_status import vodloader_status
from youtube_uploader import YouTubeOve... |
"""
Tests for the migrate_saml_uids management command.
"""
from unittest.mock import mock_open, patch
from django.core.management import call_command
from django.test import TestCase
from social_django.models import UserSocialAuth
from common.djangoapps.student.tests.factories import UserFactory
from lms.djangoapps.... | """
Tests for the migrate_saml_uids management command.
"""
from unittest.mock import mock_open, patch
from django.core.management import call_command
from django.test import TestCase
from social_django.models import UserSocialAuth
from common.djangoapps.student.tests.factories import UserFactory
from lms.djangoapps.... |
"""The Deck model and related utilities"""
import enum
import logging
import typing as t
import urllib.error
from datetime import datetime
import tqdm
import infiltrate.browsers as browsers
import infiltrate.global_data as global_data
import infiltrate.models.card as card
# todo replace application with config injec... | """The Deck model and related utilities"""
import enum
import logging
import typing as t
import urllib.error
from datetime import datetime
import tqdm
import infiltrate.browsers as browsers
import infiltrate.global_data as global_data
import infiltrate.models.card as card
# todo replace application with config injec... |
""" https://github.com/Zeta-qixi/nonebot-plugin-covid19-news """
import json
from typing import Dict
from pagermaid.listener import listener
from pagermaid.utils import alias_command, obtain_message, get
POLICY_ID = {}
class Area:
def __init__(self, data):
self.name = data['name']
self.today = ... | """ https://github.com/Zeta-qixi/nonebot-plugin-covid19-news """
import json
from typing import Dict
from pagermaid.listener import listener
from pagermaid.utils import alias_command, obtain_message, get
POLICY_ID = {}
class Area:
def __init__(self, data):
self.name = data['name']
self.today = ... |
#!/usr/bin/env python3
import sys
import inspect
from itypes import addr
TRACE = -1
DEBUG = 0
INFO = 1
WARNING = 2
ERROR = 3
log_level = INFO
def set_trace_level(level):
global log_level
if isinstance(level, str):
level = str_to_level(level)
log_level = level
def str_to_level(str):
if str =... | #!/usr/bin/env python3
import sys
import inspect
from itypes import addr
TRACE = -1
DEBUG = 0
INFO = 1
WARNING = 2
ERROR = 3
log_level = INFO
def set_trace_level(level):
global log_level
if isinstance(level, str):
level = str_to_level(level)
log_level = level
def str_to_level(str):
if str =... |
import os
import random
import re
import shlex
import string
import subprocess
import tempfile
import time
import click
import fmf
import tmt
# Timeout in seconds of waiting for a connection
CONNECTION_TIMEOUT = 60 * 4
# Wait time when reboot happens in seconds
SSH_INITIAL_WAIT_TIME = 5
class Provision(tmt.steps.S... | import os
import random
import re
import shlex
import string
import subprocess
import tempfile
import time
import click
import fmf
import tmt
# Timeout in seconds of waiting for a connection
CONNECTION_TIMEOUT = 60 * 4
# Wait time when reboot happens in seconds
SSH_INITIAL_WAIT_TIME = 5
class Provision(tmt.steps.S... |
import logging
import wandb
from torch import optim
from torch.utils.data import DataLoader
from losses import build_loss
from metrics.basic import AverageMeter, compute_accuracy
from utils import save_model
logger = logging.getLogger(__name__)
def train_local(net_id, net, trainloader, testloader, com... | import logging
import wandb
from torch import optim
from torch.utils.data import DataLoader
from losses import build_loss
from metrics.basic import AverageMeter, compute_accuracy
from utils import save_model
logger = logging.getLogger(__name__)
def train_local(net_id, net, trainloader, testloader, com... |
from easygraphics.processing import ProcessingWidget
from easygraphics.image import Image
import easygraphics
import inspect
image_funcs = dir(Image)
for func in easygraphics.__all__:
if not func in image_funcs:
continue
if func.startswith("_"):
continue
fun = eval(f"easygraphics.{func}")
... | from easygraphics.processing import ProcessingWidget
from easygraphics.image import Image
import easygraphics
import inspect
image_funcs = dir(Image)
for func in easygraphics.__all__:
if not func in image_funcs:
continue
if func.startswith("_"):
continue
fun = eval(f"easygraphics.{func}")
... |
import PySimpleGUI as sg
class TelaOrganizador:
def __init__(self):
self.__window = None
def tela_opcoes(self):
opcao = -1
while opcao == -1:
self.inicializar_opcoes()
button, values = self.__window.read()
if values['0'] or button is None:
... | import PySimpleGUI as sg
class TelaOrganizador:
def __init__(self):
self.__window = None
def tela_opcoes(self):
opcao = -1
while opcao == -1:
self.inicializar_opcoes()
button, values = self.__window.read()
if values['0'] or button is None:
... |
from datetime import datetime
from functools import partial
#
from .utils.context_utils import DoOnException
from .utils.context_utils import ExitOnException
from .utils.context_utils import BaseContextDecorator
__all__ = ["get_logger", "Logger"]
def get_logger(filename, name, sublogger=None, mode="w"):
"""init... | from datetime import datetime
from functools import partial
#
from .utils.context_utils import DoOnException
from .utils.context_utils import ExitOnException
from .utils.context_utils import BaseContextDecorator
__all__ = ["get_logger", "Logger"]
def get_logger(filename, name, sublogger=None, mode="w"):
"""init... |
"""
ASGI config for Graphql Project project.
It exposes the ASGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/dev/howto/deployment/asgi/
"""
import os
import sys
from pathlib import Path
from django.core.asgi import get_asgi_appl... | """
ASGI config for Graphql Project project.
It exposes the ASGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/dev/howto/deployment/asgi/
"""
import os
import sys
from pathlib import Path
from django.core.asgi import get_asgi_appl... |
from abc import ABC
from aiohttp import web, ClientSession
from aiohttp_swagger3 import SwaggerDocs, ReDocUiSettings
from astropy.io import fits
from astropy.visualization import (
AsymmetricPercentileInterval,
MinMaxInterval,
ZScaleInterval,
LinearStretch,
LogStretch,
AsinhStretch,
SqrtStre... | from abc import ABC
from aiohttp import web, ClientSession
from aiohttp_swagger3 import SwaggerDocs, ReDocUiSettings
from astropy.io import fits
from astropy.visualization import (
AsymmetricPercentileInterval,
MinMaxInterval,
ZScaleInterval,
LinearStretch,
LogStretch,
AsinhStretch,
SqrtStre... |
# SPDX-FileCopyrightText: 2019-2021 REFITT Team
# SPDX-License-Identifier: Apache-2.0
"""Make authenticated requests to the API."""
# type annotations
from __future__ import annotations
from typing import List, Dict, Callable, Optional, IO, Any, Union
# standard libs
import os
import sys
import json
import functool... | # SPDX-FileCopyrightText: 2019-2021 REFITT Team
# SPDX-License-Identifier: Apache-2.0
"""Make authenticated requests to the API."""
# type annotations
from __future__ import annotations
from typing import List, Dict, Callable, Optional, IO, Any, Union
# standard libs
import os
import sys
import json
import functool... |
from flask import Flask, request, jsonify
from chatterbox import *
import girlsfrontline_core_python as gfl_core
import re
import logging
import json
import urllib
import pymysql
from logging_db import MySQLHandler
from ranking_poll import EventRankPoll
import static_resp as rp
import kakao_vision as kv
application =... | from flask import Flask, request, jsonify
from chatterbox import *
import girlsfrontline_core_python as gfl_core
import re
import logging
import json
import urllib
import pymysql
from logging_db import MySQLHandler
from ranking_poll import EventRankPoll
import static_resp as rp
import kakao_vision as kv
application =... |
from datetime import datetime
from typing import Dict, Text
from loguru import logger as logging
from mongoengine.errors import DoesNotExist
from mongoengine.errors import ValidationError
from pydantic import SecretStr
from validators import ValidationFailure
from validators import email as mail_check
from kairon.exce... | from datetime import datetime
from typing import Dict, Text
from loguru import logger as logging
from mongoengine.errors import DoesNotExist
from mongoengine.errors import ValidationError
from pydantic import SecretStr
from validators import ValidationFailure
from validators import email as mail_check
from kairon.exce... |
#!/usr/bin/env python
import re
import sys
from collections import ChainMap
import math
from PyQt5.QtCore import Qt
from PyQt5.QtWidgets import (QApplication, QMainWindow, QTableWidget,
QTableWidgetItem, QItemDelegate, QLineEdit)
cellre = re.compile(r'\b[A-Z][0-9]\b')
def cellname(i, ... | #!/usr/bin/env python
import re
import sys
from collections import ChainMap
import math
from PyQt5.QtCore import Qt
from PyQt5.QtWidgets import (QApplication, QMainWindow, QTableWidget,
QTableWidgetItem, QItemDelegate, QLineEdit)
cellre = re.compile(r'\b[A-Z][0-9]\b')
def cellname(i, ... |
"""Structure for model trainer loosely taken from:
https://realpython.com/sentiment-analysis-python mainly for guide on spacy.
dataset used is from https://ai.stanford.edu/~amaas/data/sentiment/
using version 2.3.5 of spacy as version 3 includes api issues when trying to use en cor web sm
"""
import os
from random impo... | """Structure for model trainer loosely taken from:
https://realpython.com/sentiment-analysis-python mainly for guide on spacy.
dataset used is from https://ai.stanford.edu/~amaas/data/sentiment/
using version 2.3.5 of spacy as version 3 includes api issues when trying to use en cor web sm
"""
import os
from random impo... |
# coding=utf-8
# Copyright 2020-present 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 ap... | # coding=utf-8
# Copyright 2020-present 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 ap... |
from datetime import datetime
import factory
from chemreg.common.factory import ControlledVocabularyFactory, DjangoSerializerFactory
from chemreg.lists.serializers import (
AccessibilityTypeSerializer,
ExternalContactSerializer,
IdentifierTypeSerializer,
ListSerializer,
ListTypeSerializer,
Rec... | from datetime import datetime
import factory
from chemreg.common.factory import ControlledVocabularyFactory, DjangoSerializerFactory
from chemreg.lists.serializers import (
AccessibilityTypeSerializer,
ExternalContactSerializer,
IdentifierTypeSerializer,
ListSerializer,
ListTypeSerializer,
Rec... |
import os
import unittest
from PyGRB.preprocess.GRB_class import BATSEGRB
class TestBATSEGRB(unittest.TestCase):
def setUp(self):
self.burst = 3770
self.datatype = 'tte_list'
def tearDown(self):
del self.burst
del self.datatype
def test_burst_assignment_tte_list(sel... | import os
import unittest
from PyGRB.preprocess.GRB_class import BATSEGRB
class TestBATSEGRB(unittest.TestCase):
def setUp(self):
self.burst = 3770
self.datatype = 'tte_list'
def tearDown(self):
del self.burst
del self.datatype
def test_burst_assignment_tte_list(sel... |
from sklearn.metrics import make_scorer
from sklearn.metrics import accuracy_score
from sklearn.metrics import precision_score
from sklearn.metrics import recall_score
from sklearn.metrics import f1_score,precision_recall_fscore_support
from sklearn.metrics import confusion_matrix
from sklearn.model_selection import cr... | from sklearn.metrics import make_scorer
from sklearn.metrics import accuracy_score
from sklearn.metrics import precision_score
from sklearn.metrics import recall_score
from sklearn.metrics import f1_score,precision_recall_fscore_support
from sklearn.metrics import confusion_matrix
from sklearn.model_selection import cr... |
import argparse
import json
import logging
import os
import pprint
from collections import Counter, defaultdict, namedtuple
from dataclasses import dataclass
from itertools import chain
from typing import Any, Callable, Dict, List, Set, Tuple
import numpy as np
import torch
from scipy.stats import entropy
from sklea... | import argparse
import json
import logging
import os
import pprint
from collections import Counter, defaultdict, namedtuple
from dataclasses import dataclass
from itertools import chain
from typing import Any, Callable, Dict, List, Set, Tuple
import numpy as np
import torch
from scipy.stats import entropy
from sklea... |
import discord
from discord.ext import commands
from discord.ext.commands import cooldown
from discord.ext.commands.cooldowns import BucketType
import time
import asyncio
import asyncpg
from datetime import datetime, timezone, timedelta
from utils import errorhandler
from random import randint, choice
heartt = "<:hear... | import discord
from discord.ext import commands
from discord.ext.commands import cooldown
from discord.ext.commands.cooldowns import BucketType
import time
import asyncio
import asyncpg
from datetime import datetime, timezone, timedelta
from utils import errorhandler
from random import randint, choice
heartt = "<:hear... |
import json
import os
import shutil
import asyncio
import aiohttp
import aiodocker
import zipfile
import re
import logging
from datetime import datetime
from .exceptions import ConnectionError, ApiError, SpecificationError
from aiodocker.exceptions import DockerError
VPN_IMAGE = "trainml/tinc:no-upnp"
STORAGE_IMAGE ... | import json
import os
import shutil
import asyncio
import aiohttp
import aiodocker
import zipfile
import re
import logging
from datetime import datetime
from .exceptions import ConnectionError, ApiError, SpecificationError
from aiodocker.exceptions import DockerError
VPN_IMAGE = "trainml/tinc:no-upnp"
STORAGE_IMAGE ... |
import os
class Printer:
def __init__(self,
features=None,
width=None):
if features is None:
features = ['slot_id', 'status', 'duration', 'violation', 'msg']
width = [20, 10, 10, 10, 30]
self.features = features
self.widt... | import os
class Printer:
def __init__(self,
features=None,
width=None):
if features is None:
features = ['slot_id', 'status', 'duration', 'violation', 'msg']
width = [20, 10, 10, 10, 30]
self.features = features
self.widt... |
import argparse
import base64
import copy
import os
import re
import threading
import uuid
import warnings
from collections import OrderedDict, defaultdict
from contextlib import ExitStack
from typing import Optional, Union, Tuple, List, Set, Dict, overload, Type
from .builder import build_required, _build_flow, _hang... | import argparse
import base64
import copy
import os
import re
import threading
import uuid
import warnings
from collections import OrderedDict, defaultdict
from contextlib import ExitStack
from typing import Optional, Union, Tuple, List, Set, Dict, overload, Type
from .builder import build_required, _build_flow, _hang... |
#!/usr/bin/env python3
import argparse
import datetime
import os
import pickle
import pprint
import numpy as np
import torch
from torch.utils.tensorboard import SummaryWriter
from examples.atari.atari_network import QRDQN
from examples.atari.atari_wrapper import make_atari_env
from examples.offline.utils import load... | #!/usr/bin/env python3
import argparse
import datetime
import os
import pickle
import pprint
import numpy as np
import torch
from torch.utils.tensorboard import SummaryWriter
from examples.atari.atari_network import QRDQN
from examples.atari.atari_wrapper import make_atari_env
from examples.offline.utils import load... |
import asyncio
import os
import time
from abc import abstractmethod
from typing import TextIO
import nest_asyncio
from aiohttp import ClientSession as clientSession, ClientConnectorError
from tqdm.contrib.telegram import tqdm
from core import users_db, logger
class YandexDisk:
def __init__(self):
self._... | import asyncio
import os
import time
from abc import abstractmethod
from typing import TextIO
import nest_asyncio
from aiohttp import ClientSession as clientSession, ClientConnectorError
from tqdm.contrib.telegram import tqdm
from core import users_db, logger
class YandexDisk:
def __init__(self):
self._... |
import sys
import json
if __name__ == '__main__':
# convert input to dictionary
inputString = sys.argv[1]
inputDict = json.loads(inputString)
# check for missing inputs
while len(inputDict) < 5:
missingInput = ''
try:
if 'number' not in inputDict:
missi... | import sys
import json
if __name__ == '__main__':
# convert input to dictionary
inputString = sys.argv[1]
inputDict = json.loads(inputString)
# check for missing inputs
while len(inputDict) < 5:
missingInput = ''
try:
if 'number' not in inputDict:
missi... |
# -*- coding: UTF-8 -*-
import traceback
import simplejson as json
import re
from django.contrib.auth.decorators import permission_required
from django.contrib.auth.models import Group
from django.shortcuts import render, get_object_or_404
from django.http import HttpResponseRedirect
from django.urls import reverse
... | # -*- coding: UTF-8 -*-
import traceback
import simplejson as json
import re
from django.contrib.auth.decorators import permission_required
from django.contrib.auth.models import Group
from django.shortcuts import render, get_object_or_404
from django.http import HttpResponseRedirect
from django.urls import reverse
... |
import json
import logging
import shutil
from datetime import datetime, timezone
from enum import Enum
from json import JSONDecodeError
from pathlib import Path
from time import sleep
import boto3
from dateutil.parser import isoparse
from django.conf import settings
from django.core.exceptions import ValidationError
f... | import json
import logging
import shutil
from datetime import datetime, timezone
from enum import Enum
from json import JSONDecodeError
from pathlib import Path
from time import sleep
import boto3
from dateutil.parser import isoparse
from django.conf import settings
from django.core.exceptions import ValidationError
f... |
#!/usr/bin/env python3
import sys
import argparse
from brightcove.DeliverySystem import DeliverySystem
from brightcove.OAuth import OAuth
from brightcove.utils import load_account_info
# init the argument parsing
parser = argparse.ArgumentParser(prog=sys.argv[0])
parser.add_argument('--list', action='store_true', defa... | #!/usr/bin/env python3
import sys
import argparse
from brightcove.DeliverySystem import DeliverySystem
from brightcove.OAuth import OAuth
from brightcove.utils import load_account_info
# init the argument parsing
parser = argparse.ArgumentParser(prog=sys.argv[0])
parser.add_argument('--list', action='store_true', defa... |
# python module to make interfacing with the cube simpler
import requests
import json
class Animation(object):
def __init__(self):
self.animation_type = "None"
def to_json(self):
return f'{{'animation':{self.animation_type}}}'
class Blink(Animation):
def __init__(self, count=1, wait=1... | # python module to make interfacing with the cube simpler
import requests
import json
class Animation(object):
def __init__(self):
self.animation_type = "None"
def to_json(self):
return f'{{"animation":{self.animation_type}}}'
class Blink(Animation):
def __init__(self, count=1, wait=1... |
# Copyright (C) 2021 Intel Corporation
#
# SPDX-License-Identifier: MIT
import av
import json
import os
from abc import ABC, abstractmethod, abstractproperty
from collections import OrderedDict
from contextlib import closing
from PIL import Image
from .utils import md5_hash, rotate_image
class VideoStreamReader:
... | # Copyright (C) 2021 Intel Corporation
#
# SPDX-License-Identifier: MIT
import av
import json
import os
from abc import ABC, abstractmethod, abstractproperty
from collections import OrderedDict
from contextlib import closing
from PIL import Image
from .utils import md5_hash, rotate_image
class VideoStreamReader:
... |
import hail as hl
from .generic import *
ukb_imputed_bgen_path = 'gs://fc-7d5088b4-7673-45b5-95c2-17ae00a04183/imputed/ukb_imp_chr{}_v3.bgen'
ukb_imputed_info_path = 'gs://fc-7d5088b4-7673-45b5-95c2-17ae00a04183/imputed/ukb_mfi_chr{}_v3.txt'
ukb_imputed_info_ht_path = f'{bucket}/imputed/ukb_mfi_v3.ht'
def get_sample... | import hail as hl
from .generic import *
ukb_imputed_bgen_path = 'gs://fc-7d5088b4-7673-45b5-95c2-17ae00a04183/imputed/ukb_imp_chr{}_v3.bgen'
ukb_imputed_info_path = 'gs://fc-7d5088b4-7673-45b5-95c2-17ae00a04183/imputed/ukb_mfi_chr{}_v3.txt'
ukb_imputed_info_ht_path = f'{bucket}/imputed/ukb_mfi_v3.ht'
def get_sample... |
""" MIDI encoding method, similar to Compound Word
https://arxiv.org/abs/2101.02402
"""
from typing import List, Tuple, Dict, Optional, Union
import numpy as np
from miditoolkit import Instrument, Note, TempoChange
from .midi_tokenizer_base import MIDITokenizer, Vocabulary, Event, detect_chords
from .constants impo... | """ MIDI encoding method, similar to Compound Word
https://arxiv.org/abs/2101.02402
"""
from typing import List, Tuple, Dict, Optional, Union
import numpy as np
from miditoolkit import Instrument, Note, TempoChange
from .midi_tokenizer_base import MIDITokenizer, Vocabulary, Event, detect_chords
from .constants impo... |
import jax.numpy as jnp
from jax import grad, jit, vmap, jacfwd, jvp, vjp
from jax import random
import numpy as np
import jax.numpy as jnp
from jax.experimental.ode import odeint
from torch.utils.data import Dataset
from emlp.groups import SO2eR3,O2eR3,DkeR3,Trivial
from emlp.reps import T,Scalar
from oil.utils.utils ... | import jax.numpy as jnp
from jax import grad, jit, vmap, jacfwd, jvp, vjp
from jax import random
import numpy as np
import jax.numpy as jnp
from jax.experimental.ode import odeint
from torch.utils.data import Dataset
from emlp.groups import SO2eR3,O2eR3,DkeR3,Trivial
from emlp.reps import T,Scalar
from oil.utils.utils ... |
"""
Module contains class 'Review', which contains information
about book review, written in english, and class 'ReviewList',
which keeps all book reviews.
"""
from nltk.sentiment import SentimentIntensityAnalyzer
from typing import List
from langdetect import detect
from langdetect.lang_detect_exception import LangDe... | """
Module contains class 'Review', which contains information
about book review, written in english, and class 'ReviewList',
which keeps all book reviews.
"""
from nltk.sentiment import SentimentIntensityAnalyzer
from typing import List
from langdetect import detect
from langdetect.lang_detect_exception import LangDe... |
import os
import re
from urllib import request
import requests
import subprocess
import sys
regex_info = re.compile(r".*<resultMsg>(?P<msg>[^']*)</resultMsg>"
r".*<downloadURI><!\[CDATA\[(?P<uri>[^']*)\]\]></downloadURI>"
r".*<versionCode>(?P<vs_code>\d+)</versionCode>",... | import os
import re
from urllib import request
import requests
import subprocess
import sys
regex_info = re.compile(r".*<resultMsg>(?P<msg>[^']*)</resultMsg>"
r".*<downloadURI><!\[CDATA\[(?P<uri>[^']*)\]\]></downloadURI>"
r".*<versionCode>(?P<vs_code>\d+)</versionCode>",... |
from packaging import version
from redbot import __version__
from redbot.core.utils.chat_formatting import (box, humanize_list,
humanize_number)
from ..abc import ThemesMeta
from ..core.base_help import (CategoryConvert, Context, EmbedField,
... | from packaging import version
from redbot import __version__
from redbot.core.utils.chat_formatting import (box, humanize_list,
humanize_number)
from ..abc import ThemesMeta
from ..core.base_help import (CategoryConvert, Context, EmbedField,
... |
import datetime
import discord
import asyncio
import json
import random
import threading
from random import randrange
from discord_components.component import ButtonStyle
from discord_components import Button
from DatabaseTools import Database
from discord.ext import commands
from discord.utils import get
from tzlocal... | import datetime
import discord
import asyncio
import json
import random
import threading
from random import randrange
from discord_components.component import ButtonStyle
from discord_components import Button
from DatabaseTools import Database
from discord.ext import commands
from discord.utils import get
from tzlocal... |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""Test if Jupyter notebooks work."""
import logging
import os
import subprocess
import sys
from pathlib import Path
import pkg_resources
import yaml
log = logging.getLogger(__name__)
def get_scripts():
"""Read `scripts.yaml` info."""
path = Pat... | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""Test if Jupyter notebooks work."""
import logging
import os
import subprocess
import sys
from pathlib import Path
import pkg_resources
import yaml
log = logging.getLogger(__name__)
def get_scripts():
"""Read `scripts.yaml` info."""
path = Pat... |
import json
import subprocess
import asyncio
from solana.rpc.async_api import AsyncClient
from solana.publickey import PublicKey
from anchorpy import Program, Provider, Wallet
class bcolors:
HEADER = '\033[95m'
OKBLUE = '\033[94m'
OKCYAN = '\033[96m'
OKGREEN = '\033[92m'
WARNING = '\033[93m'
F... | import json
import subprocess
import asyncio
from solana.rpc.async_api import AsyncClient
from solana.publickey import PublicKey
from anchorpy import Program, Provider, Wallet
class bcolors:
HEADER = '\033[95m'
OKBLUE = '\033[94m'
OKCYAN = '\033[96m'
OKGREEN = '\033[92m'
WARNING = '\033[93m'
F... |
from ipaddress import ip_address,ip_network
import asyncio
import re
from lxml import etree
import argparse
import json
from configparser import ConfigParser
from pathlib import Path
import sys
from rich.progress import Progress
from rich.console import Console
from httpx import AsyncClient
from prettytable... | from ipaddress import ip_address,ip_network
import asyncio
import re
from lxml import etree
import argparse
import json
from configparser import ConfigParser
from pathlib import Path
import sys
from rich.progress import Progress
from rich.console import Console
from httpx import AsyncClient
from prettytable... |
import logging
import os
import threading
from fsspec.asyn import fsspec_loop
from fsspec.utils import infer_storage_options
from funcy import cached_property, memoize, wrap_prop
from dvc.exceptions import DvcException
from dvc.path_info import CloudURLInfo
from dvc.scheme import Schemes
from dvc.utils import format_... | import logging
import os
import threading
from fsspec.asyn import fsspec_loop
from fsspec.utils import infer_storage_options
from funcy import cached_property, memoize, wrap_prop
from dvc.exceptions import DvcException
from dvc.path_info import CloudURLInfo
from dvc.scheme import Schemes
from dvc.utils import format_... |
#!/usr/bin/env python
# coding: utf-8
# # Publications markdown generator for academicpages
#
# Takes a set of bibtex of publications and converts them for use with [academicpages.github.io](academicpages.github.io). This is an interactive Jupyter notebook ([see more info here](http://jupyter-notebook-beginner-guide.... | #!/usr/bin/env python
# coding: utf-8
# # Publications markdown generator for academicpages
#
# Takes a set of bibtex of publications and converts them for use with [academicpages.github.io](academicpages.github.io). This is an interactive Jupyter notebook ([see more info here](http://jupyter-notebook-beginner-guide.... |
# -*- coding: utf-8 -*-
import os
import re
import json
import hashlib
import datetime as dt
import click
import requests
import sqlalchemy
import textdistance
from colorama import Fore, Style
from cli_helpers import tabular_output
from . import __version__, CONRAD_HOME
from .db import engine, Session
from .models i... | # -*- coding: utf-8 -*-
import os
import re
import json
import hashlib
import datetime as dt
import click
import requests
import sqlalchemy
import textdistance
from colorama import Fore, Style
from cli_helpers import tabular_output
from . import __version__, CONRAD_HOME
from .db import engine, Session
from .models i... |
from checkov.common.models.enums import CheckCategories, CheckResult
from checkov.kubernetes.base_spec_check import BaseK8Check
class ApiServerServiceAccountLookup(BaseK8Check):
def __init__(self):
id = "CKV_K8S_96"
name = "Ensure that the --service-account-lookup argument is set to true"
c... | from checkov.common.models.enums import CheckCategories, CheckResult
from checkov.kubernetes.base_spec_check import BaseK8Check
class ApiServerServiceAccountLookup(BaseK8Check):
def __init__(self):
id = "CKV_K8S_96"
name = "Ensure that the --service-account-lookup argument is set to true"
c... |
# developed by novuh (github.com/n0vuh)
# AntiZon is intended for the purpose of getting a consumer a better price for a product.
# AntiZon is not intended to be used as financial advice.
# source code, p.s: ignore lazy code, it'll be fixed
import json
import os
from colorama import Back, Fore, Style
from ... | # developed by novuh (github.com/n0vuh)
# AntiZon is intended for the purpose of getting a consumer a better price for a product.
# AntiZon is not intended to be used as financial advice.
# source code, p.s: ignore lazy code, it'll be fixed
import json
import os
from colorama import Back, Fore, Style
from ... |
import os
import re
import xlsxwriter
from django.db import transaction, IntegrityError
from django.db.models import Q
from django.http import HttpResponse
from django.contrib.auth.hashers import make_password
from submission.models import Submission
from utils.api import APIView, validate_serializer
from ... | import os
import re
import xlsxwriter
from django.db import transaction, IntegrityError
from django.db.models import Q
from django.http import HttpResponse
from django.contrib.auth.hashers import make_password
from submission.models import Submission
from utils.api import APIView, validate_serializer
from ... |
import os
import re
import typing
import logging
import subprocess
from shlex import quote
from ghostricon.commands import server_types
from ghostricon.config import reload_config
class Vpn:
logger = logging.getLogger("VPNTOOL")
reg = re.compile(r"^\|\s*\d+\s*\|\s*(.*?)\s*\|\s*(.*?)\s*\|$")
def __init__... | import os
import re
import typing
import logging
import subprocess
from shlex import quote
from ghostricon.commands import server_types
from ghostricon.config import reload_config
class Vpn:
logger = logging.getLogger("VPNTOOL")
reg = re.compile(r"^\|\s*\d+\s*\|\s*(.*?)\s*\|\s*(.*?)\s*\|$")
def __init__... |
# MIT License
#
# Copyright (c) 2020 The Google AI Language Team Authors, The HuggingFace Inc. team and github/lonePatient
#
# 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 restricti... | # MIT License
#
# Copyright (c) 2020 The Google AI Language Team Authors, The HuggingFace Inc. team and github/lonePatient
#
# 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 restricti... |
import json
import logging
from stix_shifter_utils.stix_translation.src.json_to_stix import json_to_stix_translator
from stix_shifter.stix_translation import stix_translation
from stix_shifter_modules.splunk.entry_point import EntryPoint
from stix2validator import validate_instance
from stix_shifter_modules.splunk.stix... | import json
import logging
from stix_shifter_utils.stix_translation.src.json_to_stix import json_to_stix_translator
from stix_shifter.stix_translation import stix_translation
from stix_shifter_modules.splunk.entry_point import EntryPoint
from stix2validator import validate_instance
from stix_shifter_modules.splunk.stix... |
import requests
from googlesearch import search
from bs4 import BeautifulSoup
from .error_handling import SearchNotWork, NoResultFound
class Charapedia:
def __init__(self, char: str):
try:
mal_char_id = search('site:myanimelist.net {} character info inurl:/character/'.format(char), num_results=0)
... | import requests
from googlesearch import search
from bs4 import BeautifulSoup
from .error_handling import SearchNotWork, NoResultFound
class Charapedia:
def __init__(self, char: str):
try:
mal_char_id = search('site:myanimelist.net {} character info inurl:/character/'.format(char), num_results=0)
... |
#!/usr/bin/python3
# http://www.pythonchallenge.com/pc/def/channel.html
import signal
from zipfile import ZipFile
from handlers.python import exit_signal_handler
# noinspection PyShadowingNames
def get_next_file(i, zf, file_name, result):
is_last = True
try:
file_words = zf.read(file_name).split()
... | #!/usr/bin/python3
# http://www.pythonchallenge.com/pc/def/channel.html
import signal
from zipfile import ZipFile
from handlers.python import exit_signal_handler
# noinspection PyShadowingNames
def get_next_file(i, zf, file_name, result):
is_last = True
try:
file_words = zf.read(file_name).split()
... |
#!/usr/bin/env python3
#
# Copyright (C) 2021 Intel Corporation.
#
# SPDX-License-Identifier: BSD-3-Clause
#
import sys, os, re
sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), '..', 'library'))
import common, lib.error, lib.lib
# Constants for device name prefix
IVSHMEM = "IVSHMEM"
VUART = "V... | #!/usr/bin/env python3
#
# Copyright (C) 2021 Intel Corporation.
#
# SPDX-License-Identifier: BSD-3-Clause
#
import sys, os, re
sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), '..', 'library'))
import common, lib.error, lib.lib
# Constants for device name prefix
IVSHMEM = "IVSHMEM"
VUART = "V... |
import copy
from io import StringIO
import numpy as np
from theano import scalar
from theano.gof.graph import Apply
from theano.gof.op import Op
from theano.gof.utils import MethodNotDefined
from theano.link.c.interface import HideC
from theano.scalar import Composite, Scalar
from theano.scalar.basic import complex_t... | import copy
from io import StringIO
import numpy as np
from theano import scalar
from theano.gof.graph import Apply
from theano.gof.op import Op
from theano.gof.utils import MethodNotDefined
from theano.link.c.interface import HideC
from theano.scalar import Composite, Scalar
from theano.scalar.basic import complex_t... |
import sys
import time
import os
import pathlib
import zipfile
from hydra.core.hydra_config import HydraConfig
TOTAL_BAR_LENGTH = 80
LAST_T = time.time()
BEGIN_T = LAST_T
def progress_bar(current, total, msg=None):
global LAST_T, BEGIN_T
if current == 0:
BEGIN_T = time.time() # Reset for new bar.
... | import sys
import time
import os
import pathlib
import zipfile
from hydra.core.hydra_config import HydraConfig
TOTAL_BAR_LENGTH = 80
LAST_T = time.time()
BEGIN_T = LAST_T
def progress_bar(current, total, msg=None):
global LAST_T, BEGIN_T
if current == 0:
BEGIN_T = time.time() # Reset for new bar.
... |
import os
from pathlib import Path
from shutil import copytree
from bs4 import BeautifulSoup
from sphinx.testing.util import SphinxTestApp
from sphinx.testing.path import path as sphinx_path
import sphinx.errors
import pytest
path_tests = Path(__file__).parent
class SphinxBuild:
def __init__(self, app: Sphin... | import os
from pathlib import Path
from shutil import copytree
from bs4 import BeautifulSoup
from sphinx.testing.util import SphinxTestApp
from sphinx.testing.path import path as sphinx_path
import sphinx.errors
import pytest
path_tests = Path(__file__).parent
class SphinxBuild:
def __init__(self, app: Sphin... |
# Copyright 2018 Iguazio
#
# 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, softwa... | # Copyright 2018 Iguazio
#
# 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, softwa... |
# %% [markdown]
# # THE MIND OF A MAGGOT
# %% [markdown]
# ## Imports
import os
import time
import colorcet as cc
import matplotlib as mpl
import matplotlib.pyplot as plt
import matplotlib.transforms as transforms
import numpy as np
import pandas as pd
import seaborn as sns
from scipy.linalg import orthogonal_procrus... | # %% [markdown]
# # THE MIND OF A MAGGOT
# %% [markdown]
# ## Imports
import os
import time
import colorcet as cc
import matplotlib as mpl
import matplotlib.pyplot as plt
import matplotlib.transforms as transforms
import numpy as np
import pandas as pd
import seaborn as sns
from scipy.linalg import orthogonal_procrus... |
import os
def get_path(file, level="."):
path = os.path.dirname(os.path.realpath(file))
levels = level.count(".")
if levels > 1:
for l in range(levels - 1):
path = "/".join(path.split("/")[:-1])
return path
def new_path(path, extension=""):
def f(filename):
# return p... | import os
def get_path(file, level="."):
path = os.path.dirname(os.path.realpath(file))
levels = level.count(".")
if levels > 1:
for l in range(levels - 1):
path = "/".join(path.split("/")[:-1])
return path
def new_path(path, extension=""):
def f(filename):
# return p... |
import requests
from bs4 import BeautifulSoup
import pickle
import os
from urllib.parse import urlparse, unquote
from urllib.parse import parse_qs
import pandas as pd
import json
class FacebookPostsScraper:
# We need the email and password to access Facebook, and optionally the text in the Url that identifies th... | import requests
from bs4 import BeautifulSoup
import pickle
import os
from urllib.parse import urlparse, unquote
from urllib.parse import parse_qs
import pandas as pd
import json
class FacebookPostsScraper:
# We need the email and password to access Facebook, and optionally the text in the Url that identifies th... |
#!/usr/bin/env python3
# Copyright (C) 2020 The Android Open Source Project
#
# 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 requ... | #!/usr/bin/env python3
# Copyright (C) 2020 The Android Open Source Project
#
# 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 requ... |
import time
import aiohttp
import traceback
import discord
import textwrap
import io
import datetime
import random
import json
import shlex
import gc
import os
from subprocess import Popen, PIPE
from dhooks import Webhook
from contextlib import redirect_stdout
from copy import copy
from typing import Union
from utils ... | import time
import aiohttp
import traceback
import discord
import textwrap
import io
import datetime
import random
import json
import shlex
import gc
import os
from subprocess import Popen, PIPE
from dhooks import Webhook
from contextlib import redirect_stdout
from copy import copy
from typing import Union
from utils ... |
import asyncio
import os
import random
import logging
import contextlib
import sqlite3
import discord
from discord.ext import commands
from pathlib import Path
import motor.motor_asyncio
import io
import textwrap
import traceback
from traceback import format_exception
import utils.json_loader
from utils.mongo import ... | import asyncio
import os
import random
import logging
import contextlib
import sqlite3
import discord
from discord.ext import commands
from pathlib import Path
import motor.motor_asyncio
import io
import textwrap
import traceback
from traceback import format_exception
import utils.json_loader
from utils.mongo import ... |
"""
a code to pre-process and extract fist-level features from raw data from the selected patients.
the output will be the extracted features, chronologically, in 5 second non-overlapping windows
order by patient and seizure.
format output name:pat[patient_number]_seizure[seizure_number]_featureMatrix.npy
example outp... | """
a code to pre-process and extract fist-level features from raw data from the selected patients.
the output will be the extracted features, chronologically, in 5 second non-overlapping windows
order by patient and seizure.
format output name:pat[patient_number]_seizure[seizure_number]_featureMatrix.npy
example outp... |
"""
MIT License
Copyright (c) 2020-present windowsboy111, shay (shayypy)
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,... | """
MIT License
Copyright (c) 2020-present windowsboy111, shay (shayypy)
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,... |
import json
import os
from glob import glob
from pathlib import Path
from typing import Dict, Any, List, Optional
from spark_pipeline_framework_testing.mockserver_client.mockserver_client import (
MockServerFriendlyClient,
request,
response,
times,
text_equals,
times_any,
json_equals,
)
d... | import json
import os
from glob import glob
from pathlib import Path
from typing import Dict, Any, List, Optional
from spark_pipeline_framework_testing.mockserver_client.mockserver_client import (
MockServerFriendlyClient,
request,
response,
times,
text_equals,
times_any,
json_equals,
)
d... |
import asyncio
import collections
import signal
import traceback
import typing
from copy import copy
from functools import wraps
import attr
@attr.s(auto_attribs=True)
class Catch:
signal: str
handler: str
@attr.s(auto_attribs=True)
class State:
name: str
parent: typing.Optional[str]
catches: t... | import asyncio
import collections
import signal
import traceback
import typing
from copy import copy
from functools import wraps
import attr
@attr.s(auto_attribs=True)
class Catch:
signal: str
handler: str
@attr.s(auto_attribs=True)
class State:
name: str
parent: typing.Optional[str]
catches: t... |
#!/usr/bin/env python3
import sys
from TALinputs import TALinput
from multilanguage import Env, Lang, TALcolors
import chococroc_lib as cl
# METADATA OF THIS TAL_SERVICE:
problem="chococroc"
service="check_game_value"
args_list = [
('m',int),
('n',int),
('value',int),
('silent',bool)
]
ENV =Env(arg... | #!/usr/bin/env python3
import sys
from TALinputs import TALinput
from multilanguage import Env, Lang, TALcolors
import chococroc_lib as cl
# METADATA OF THIS TAL_SERVICE:
problem="chococroc"
service="check_game_value"
args_list = [
('m',int),
('n',int),
('value',int),
('silent',bool)
]
ENV =Env(arg... |
"""Utility functions for printing version information.
The original script is from
`xarray <https://github.com/pydata/xarray/blob/master/xarray/util/print_versions.py>`__
"""
import importlib
import locale
import os
import platform
import struct
import subprocess
import sys
from types import ModuleType
from typing imp... | """Utility functions for printing version information.
The original script is from
`xarray <https://github.com/pydata/xarray/blob/master/xarray/util/print_versions.py>`__
"""
import importlib
import locale
import os
import platform
import struct
import subprocess
import sys
from types import ModuleType
from typing imp... |
# -*- coding:utf-8 -*-
# /usr/bin/env python
"""
Date: 2020/4/29 12:33
Desc: 河北省空气质量预报信息发布系统
http://110.249.223.67/publish/
每日 17 时发布
等级划分
1. 空气污染指数为0-50,空气质量级别为一级,空气质量状况属于优。此时,空气质量令人满意,基本无空气污染,各类人群可正常活动。
2. 空气污染指数为51-100,空气质量级别为二级,空气质量状况属于良。此时空气质量可接受,但某些污染物可能对极少数异常敏感人群健康有较弱影响,建议极少数异常敏感人群应减少户外活动。
3. 空气污染指数为101-150,空气质量... | # -*- coding:utf-8 -*-
# /usr/bin/env python
"""
Date: 2020/4/29 12:33
Desc: 河北省空气质量预报信息发布系统
http://110.249.223.67/publish/
每日 17 时发布
等级划分
1. 空气污染指数为0-50,空气质量级别为一级,空气质量状况属于优。此时,空气质量令人满意,基本无空气污染,各类人群可正常活动。
2. 空气污染指数为51-100,空气质量级别为二级,空气质量状况属于良。此时空气质量可接受,但某些污染物可能对极少数异常敏感人群健康有较弱影响,建议极少数异常敏感人群应减少户外活动。
3. 空气污染指数为101-150,空气质量... |
# The MIT License (MIT)
#
# SPDX-FileCopyrightText: Copyright (c) 2019 Michael Schroeder
#
# 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 th... | # The MIT License (MIT)
#
# SPDX-FileCopyrightText: Copyright (c) 2019 Michael Schroeder
#
# 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 th... |
"""
MIT License
Copyright (c) 2020 Maxim Krivich
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, modify, merge, publish,... | """
MIT License
Copyright (c) 2020 Maxim Krivich
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, modify, merge, publish,... |
from .torch_core import *
from .basic_data import *
from .layers import *
__all__ = ['ItemList', 'CategoryList', 'MultiCategoryList', 'MultiCategoryProcessor', 'LabelList', 'ItemLists', 'get_files',
'PreProcessor', 'LabelLists', 'FloatList', 'CategoryProcessor']
def _decode(df):
return np.array([[df.co... | from .torch_core import *
from .basic_data import *
from .layers import *
__all__ = ['ItemList', 'CategoryList', 'MultiCategoryList', 'MultiCategoryProcessor', 'LabelList', 'ItemLists', 'get_files',
'PreProcessor', 'LabelLists', 'FloatList', 'CategoryProcessor']
def _decode(df):
return np.array([[df.co... |
from rapidz import Stream
import os
import numpy as np
from event_model import compose_resource
@Stream.register_api()
class Store(Stream):
def __init__(self, upstream, root, writer, resource_kwargs=None, **kwargs):
Stream.__init__(self, upstream, **kwargs)
if writer is None:
writer = ... | from rapidz import Stream
import os
import numpy as np
from event_model import compose_resource
@Stream.register_api()
class Store(Stream):
def __init__(self, upstream, root, writer, resource_kwargs=None, **kwargs):
Stream.__init__(self, upstream, **kwargs)
if writer is None:
writer = ... |
# -*- coding: utf-8 -*-
"""
- Usage of this bot is not at all recommended as its against the Terms of Service of discord.
- Your account may get banned if you use this bot.
- You can still make an alt account if you are that desperate.
- The bot requires `Manage Channels` permission in every server.
- Deletes (or at l... | # -*- coding: utf-8 -*-
"""
- Usage of this bot is not at all recommended as its against the Terms of Service of discord.
- Your account may get banned if you use this bot.
- You can still make an alt account if you are that desperate.
- The bot requires `Manage Channels` permission in every server.
- Deletes (or at l... |
# teabag app
from flask import Flask, render_template
import random as r
import os
app = Flask(__name__)
partsOfSpeech = {'nouns1': ['an aura', 'an accomplishment', 'the love', 'the life', 'the soul'],
'nouns2': ['respect', 'compassion', 'kindness', 'love', 'life', 'knowledge', 'strength',
... | # teabag app
from flask import Flask, render_template
import random as r
import os
app = Flask(__name__)
partsOfSpeech = {'nouns1': ['an aura', 'an accomplishment', 'the love', 'the life', 'the soul'],
'nouns2': ['respect', 'compassion', 'kindness', 'love', 'life', 'knowledge', 'strength',
... |
from models import db_session, User
from flask import Flask, request, url_for, redirect, render_template
from models import Claim
from models import Document
from models import Attribution
from models import Entity
from models import Perspective
from flask_login import current_user
from vaderSentiment.vaderSentiment im... | from models import db_session, User
from flask import Flask, request, url_for, redirect, render_template
from models import Claim
from models import Document
from models import Attribution
from models import Entity
from models import Perspective
from flask_login import current_user
from vaderSentiment.vaderSentiment im... |
# A part of NonVisual Desktop Access (NVDA)
# Copyright (C) 2020 NV Access Limited
# This file may be used under the terms of the GNU General Public License, version 2 or later.
# For more details see: https://www.gnu.org/licenses/gpl-2.0.html
"""This file provides robot library functions for NVDA system tests.
... | # A part of NonVisual Desktop Access (NVDA)
# Copyright (C) 2020 NV Access Limited
# This file may be used under the terms of the GNU General Public License, version 2 or later.
# For more details see: https://www.gnu.org/licenses/gpl-2.0.html
"""This file provides robot library functions for NVDA system tests.
... |
# -*- coding: utf-8 -*-
"""
:Module: khorosjx.core
:Synopsis: Collection of core functions and tools to work with the Jive Core API v3
:Usage: ``import khorosjx.core`` (Imported by default in primary package)
:Example: ``user_info = khorosjx.core.get_data('people', 'john.doe@ex... | # -*- coding: utf-8 -*-
"""
:Module: khorosjx.core
:Synopsis: Collection of core functions and tools to work with the Jive Core API v3
:Usage: ``import khorosjx.core`` (Imported by default in primary package)
:Example: ``user_info = khorosjx.core.get_data('people', 'john.doe@ex... |
import os
import pandas as pd
class tabledb:
def __init__(self,db_name):
self.db_name = db_name
if not os.path.exists(db_name):os.mkdir(db_name)
def create_table(self,**kwargs):
if 'name' in kwargs and 'colums' in kwargs and isinstance(kwargs['name'],str) and isinstance(kwargs['colums'],list):
file_p... | import os
import pandas as pd
class tabledb:
def __init__(self,db_name):
self.db_name = db_name
if not os.path.exists(db_name):os.mkdir(db_name)
def create_table(self,**kwargs):
if 'name' in kwargs and 'colums' in kwargs and isinstance(kwargs['name'],str) and isinstance(kwargs['colums'],list):
file_p... |
"""
Implementation of global attrs.
These are defined in here to keep the `sunpy.net.attrs` namespace clean, and to
prevent circular imports.
"""
import collections
import astropy.units as u
from sunpy.time import TimeRange, parse_time
from sunpy.time.time import _variables_for_parse_time_docstring
from sunpy.util.d... | """
Implementation of global attrs.
These are defined in here to keep the `sunpy.net.attrs` namespace clean, and to
prevent circular imports.
"""
import collections
import astropy.units as u
from sunpy.time import TimeRange, parse_time
from sunpy.time.time import _variables_for_parse_time_docstring
from sunpy.util.d... |
import time
from datetime import datetime
import pytest
from lightkube import Client, ApiError, AsyncClient
from lightkube.types import PatchType
from lightkube.resources.core_v1 import Pod, Node, ConfigMap, Service, Namespace
from lightkube.resources.apps_v1 import Deployment
from lightkube.models.meta_v1 import Obj... | import time
from datetime import datetime
import pytest
from lightkube import Client, ApiError, AsyncClient
from lightkube.types import PatchType
from lightkube.resources.core_v1 import Pod, Node, ConfigMap, Service, Namespace
from lightkube.resources.apps_v1 import Deployment
from lightkube.models.meta_v1 import Obj... |
"""
Module that interacts with the orchestrator CLI.
Provide the interfaces to ceph orch and in turn manage the orchestration engine.
"""
from datetime import datetime, timedelta
from json import loads
from time import sleep
from ceph.ceph import ResourceNotFoundError
from utility.log import Log
from .ceph import Ce... | """
Module that interacts with the orchestrator CLI.
Provide the interfaces to ceph orch and in turn manage the orchestration engine.
"""
from datetime import datetime, timedelta
from json import loads
from time import sleep
from ceph.ceph import ResourceNotFoundError
from utility.log import Log
from .ceph import Ce... |
from collections import defaultdict
import boto3
import datetime
import os
import requests
import sys
n_days = 7
yesterday = datetime.datetime.today() - datetime.timedelta(days=1)
week_ago = yesterday - datetime.timedelta(days=n_days)
# It seems that the sparkline symbols don't line up (probalby based on font?) so pu... | from collections import defaultdict
import boto3
import datetime
import os
import requests
import sys
n_days = 7
yesterday = datetime.datetime.today() - datetime.timedelta(days=1)
week_ago = yesterday - datetime.timedelta(days=n_days)
# It seems that the sparkline symbols don't line up (probalby based on font?) so pu... |
# Copyright 2021 The Emscripten Authors. All rights reserved.
# Emscripten is available under two separate licenses, the MIT license and the
# University of Illinois/NCSA Open Source License. Both these licenses can be
# found in the LICENSE file.
from enum import Enum
from functools import wraps
from pathlib import... | # Copyright 2021 The Emscripten Authors. All rights reserved.
# Emscripten is available under two separate licenses, the MIT license and the
# University of Illinois/NCSA Open Source License. Both these licenses can be
# found in the LICENSE file.
from enum import Enum
from functools import wraps
from pathlib import... |
"""
Core
This code does the heavy lifting of turning strings into Quantities. Its the functions that need to deal with the
most mess.
"""
from typing import List, Union
import re
from unit_parse.config import Unit, Quantity, config
from unit_parse.pre_processing_substitution import sub_general
from unit_parse.utils ... | """
Core
This code does the heavy lifting of turning strings into Quantities. Its the functions that need to deal with the
most mess.
"""
from typing import List, Union
import re
from unit_parse.config import Unit, Quantity, config
from unit_parse.pre_processing_substitution import sub_general
from unit_parse.utils ... |
"""
ETG API provides hotel's static data dump in .zstd format.
You can find more about the dump structure and the format in our documentation - https://docs.emergingtravel.com/#0b55c99a-7ef0-4a18-bbfe-fd1bdf35d08e
Please note that uncompressed data could be more than 20GB.
Below is an example of how to handle such la... | """
ETG API provides hotel's static data dump in .zstd format.
You can find more about the dump structure and the format in our documentation - https://docs.emergingtravel.com/#0b55c99a-7ef0-4a18-bbfe-fd1bdf35d08e
Please note that uncompressed data could be more than 20GB.
Below is an example of how to handle such la... |
from __future__ import annotations
import logging
from typing import TYPE_CHECKING, Union
import matplotlib.pyplot as plt
import numpy as np
from .._doc import doc
from ._image import Image
from ._utils import show_image
logger = logging.getLogger(__name__)
if TYPE_CHECKING:
from .mesh import TriangleMesh
@d... | from __future__ import annotations
import logging
from typing import TYPE_CHECKING, Union
import matplotlib.pyplot as plt
import numpy as np
from .._doc import doc
from ._image import Image
from ._utils import show_image
logger = logging.getLogger(__name__)
if TYPE_CHECKING:
from .mesh import TriangleMesh
@d... |
# 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 u... | # 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 u... |
import importlib
import os
import re
from pathlib import Path
import pytest
from mypy import api as mypy_api
# This ensures mypy can find the test files, no matter where tests are run from:
os.chdir(Path(__file__).parent.parent.parent)
cases = (
("mypy.ini", "success.py", "success.txt"),
("mypy.ini", "fail.... | import importlib
import os
import re
from pathlib import Path
import pytest
from mypy import api as mypy_api
# This ensures mypy can find the test files, no matter where tests are run from:
os.chdir(Path(__file__).parent.parent.parent)
cases = (
("mypy.ini", "success.py", "success.txt"),
("mypy.ini", "fail.... |
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
'''
@File : train-duration.py
@Date : 2021/01/05, Tue
@Author : Atomicoo
@Version : 1.0
@Contact : atomicoo95@gmail.com
@License : (C)Copyright 2020-2021, ShiGroup-NLP-XMU
@Desc : Synthetize sentences into speech.
'''
__author__ = 'Atomicoo'
impo... | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
'''
@File : train-duration.py
@Date : 2021/01/05, Tue
@Author : Atomicoo
@Version : 1.0
@Contact : atomicoo95@gmail.com
@License : (C)Copyright 2020-2021, ShiGroup-NLP-XMU
@Desc : Synthetize sentences into speech.
'''
__author__ = 'Atomicoo'
impo... |
"""Support for Nest devices."""
# mypy: ignore-errors
from datetime import datetime, timedelta
import logging
import threading
from nest import Nest
from nest.nest import APIError, AuthorizationError
import voluptuous as vol
from homeassistant import config_entries
from homeassistant.config_entries import ConfigEntr... | """Support for Nest devices."""
# mypy: ignore-errors
from datetime import datetime, timedelta
import logging
import threading
from nest import Nest
from nest.nest import APIError, AuthorizationError
import voluptuous as vol
from homeassistant import config_entries
from homeassistant.config_entries import ConfigEntr... |
# -*- coding: utf-8 -*-
import os
import demjson
import PixivArtistHandler
import PixivHelper
import PixivImageHandler
import PixivTagsHandler
import PixivUtil2
_default_batch_filename = "./batch_job.json"
class JobOption(object):
filenameFormat = ""
filenameMangaFormat = ""
filenameInfoFormat = ""
... | # -*- coding: utf-8 -*-
import os
import demjson
import PixivArtistHandler
import PixivHelper
import PixivImageHandler
import PixivTagsHandler
import PixivUtil2
_default_batch_filename = "./batch_job.json"
class JobOption(object):
filenameFormat = ""
filenameMangaFormat = ""
filenameInfoFormat = ""
... |
import logging
import os
from collections import defaultdict
from contextlib import contextmanager
from copy import deepcopy
from glob import glob
from inspect import signature
from signal import SIGINT
from django.test import SimpleTestCase
import attr
import gevent
from gevent.event import Event
from gevent.queue i... | import logging
import os
from collections import defaultdict
from contextlib import contextmanager
from copy import deepcopy
from glob import glob
from inspect import signature
from signal import SIGINT
from django.test import SimpleTestCase
import attr
import gevent
from gevent.event import Event
from gevent.queue i... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.