edited_code stringlengths 17 978k | original_code stringlengths 17 978k |
|---|---|
from typing import Dict, Optional, Tuple, List
import aiosqlite
from src.consensus.sub_block_record import SubBlockRecord
from src.types.header_block import HeaderBlock
from src.util.ints import uint32, uint64
from src.wallet.block_record import HeaderBlockRecord
from src.types.sized_bytes import bytes32
class Walle... | from typing import Dict, Optional, Tuple, List
import aiosqlite
from src.consensus.sub_block_record import SubBlockRecord
from src.types.header_block import HeaderBlock
from src.util.ints import uint32, uint64
from src.wallet.block_record import HeaderBlockRecord
from src.types.sized_bytes import bytes32
class Walle... |
import json
from airiam.terraform.entity_terraformers.BaseEntityTransformer import BaseEntityTransformer
class IAMPolicyDocumentTransformer(BaseEntityTransformer):
def __init__(self, entity_json: dict, policy_name, principal_name=None):
policy_document_name = f"{policy_name}_document"
if principa... | import json
from airiam.terraform.entity_terraformers.BaseEntityTransformer import BaseEntityTransformer
class IAMPolicyDocumentTransformer(BaseEntityTransformer):
def __init__(self, entity_json: dict, policy_name, principal_name=None):
policy_document_name = f"{policy_name}_document"
if principa... |
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# 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
#
# Unl... | # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# 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
#
# Unl... |
import typing as ty
import numpy as np
import scipy.special
import sklearn.metrics as skm
from . import util
def calculate_metrics(
task_type: str,
y: np.ndarray,
prediction: np.ndarray,
classification_mode: str,
y_info: ty.Optional[ty.Dict[str, ty.Any]],
) -> ty.Dict[str, float]:
if task_ty... | import typing as ty
import numpy as np
import scipy.special
import sklearn.metrics as skm
from . import util
def calculate_metrics(
task_type: str,
y: np.ndarray,
prediction: np.ndarray,
classification_mode: str,
y_info: ty.Optional[ty.Dict[str, ty.Any]],
) -> ty.Dict[str, float]:
if task_ty... |
# -*- coding: utf-8 -*-
"""
pybit
------------------------
pybit is a lightweight and high-performance API connector for the
RESTful and WebSocket APIs of the Bybit exchange.
Documentation can be found at
https://github.com/verata-veritatis/pybit
:copyright: (c) 2020-2021 verata-veritatis
:license: MIT License
"""... | # -*- coding: utf-8 -*-
"""
pybit
------------------------
pybit is a lightweight and high-performance API connector for the
RESTful and WebSocket APIs of the Bybit exchange.
Documentation can be found at
https://github.com/verata-veritatis/pybit
:copyright: (c) 2020-2021 verata-veritatis
:license: MIT License
"""... |
import logging
from pajbot.managers.db import DBManager
from pajbot.models.command import Command
from pajbot.models.user import User
from pajbot.modules import BaseModule
from pajbot.modules import ModuleSetting
from pajbot.utils import time_since
log = logging.getLogger(__name__)
class TopModule(BaseModule):
... | import logging
from pajbot.managers.db import DBManager
from pajbot.models.command import Command
from pajbot.models.user import User
from pajbot.modules import BaseModule
from pajbot.modules import ModuleSetting
from pajbot.utils import time_since
log = logging.getLogger(__name__)
class TopModule(BaseModule):
... |
import json
import os
import sqlite3
from datetime import datetime
from pathlib import Path
import asyncpg
from tabulate import tabulate
from typing import Dict
from openmaptiles.pgutils import get_postgis_version, get_vector_layers
from openmaptiles.sqlite_utils import query
from openmaptiles.sqltomvt import MvtGene... | import json
import os
import sqlite3
from datetime import datetime
from pathlib import Path
import asyncpg
from tabulate import tabulate
from typing import Dict
from openmaptiles.pgutils import get_postgis_version, get_vector_layers
from openmaptiles.sqlite_utils import query
from openmaptiles.sqltomvt import MvtGene... |
import itertools
import logging
import os.path as osp
import tempfile
from collections import OrderedDict
import mmcv
import numpy as np
import pycocotools
from mmcv.utils import print_log
from pycocotools.coco import COCO
from pycocotools.cocoeval import COCOeval
from terminaltables import AsciiTable
from mmdet.core... | import itertools
import logging
import os.path as osp
import tempfile
from collections import OrderedDict
import mmcv
import numpy as np
import pycocotools
from mmcv.utils import print_log
from pycocotools.coco import COCO
from pycocotools.cocoeval import COCOeval
from terminaltables import AsciiTable
from mmdet.core... |
import MySQLdb
import json
from datetime import timedelta, datetime
from unittest.mock import patch, Mock, ANY
import sqlparse
from django.contrib.auth import get_user_model
from django.test import TestCase
from common.config import SysConfig
from sql.engines import EngineBase
from sql.engines.goinception import GoIn... | import MySQLdb
import json
from datetime import timedelta, datetime
from unittest.mock import patch, Mock, ANY
import sqlparse
from django.contrib.auth import get_user_model
from django.test import TestCase
from common.config import SysConfig
from sql.engines import EngineBase
from sql.engines.goinception import GoIn... |
from datetime import datetime
from typing import Optional, Union
from discord.embeds import Embed
from discord.ext.commands import Cog, Context, group, has_permissions
from discord.member import Member
from discord.role import Role
from colors import Colors
from log import log
from permission import update_user_permi... | from datetime import datetime
from typing import Optional, Union
from discord.embeds import Embed
from discord.ext.commands import Cog, Context, group, has_permissions
from discord.member import Member
from discord.role import Role
from colors import Colors
from log import log
from permission import update_user_permi... |
#CADASTRO DE PESSOAS em dicionário - AULA 19 EXERCÍCIO 94
#dados das pessos: nome, sexo e idade
#todos os dicionários numa lista
#Informar quantos cadastrados, média de idade, lista de mulheres e nomes de pessoas de idade acima da média
#
pessoa = dict()
grupo = list()
somaidades = media = 0
while True:
pessoa.clea... | #CADASTRO DE PESSOAS em dicionário - AULA 19 EXERCÍCIO 94
#dados das pessos: nome, sexo e idade
#todos os dicionários numa lista
#Informar quantos cadastrados, média de idade, lista de mulheres e nomes de pessoas de idade acima da média
#
pessoa = dict()
grupo = list()
somaidades = media = 0
while True:
pessoa.clea... |
from typing import Any, Dict, Tuple
from ee.clickhouse.models.property import get_property_string_expr
from ee.clickhouse.queries.event_query import ClickhouseEventQuery
from posthog.constants import AUTOCAPTURE_EVENT, PAGEVIEW_EVENT, SCREEN_EVENT
from posthog.models.filters.path_filter import PathFilter
class PathE... | from typing import Any, Dict, Tuple
from ee.clickhouse.models.property import get_property_string_expr
from ee.clickhouse.queries.event_query import ClickhouseEventQuery
from posthog.constants import AUTOCAPTURE_EVENT, PAGEVIEW_EVENT, SCREEN_EVENT
from posthog.models.filters.path_filter import PathFilter
class PathE... |
import abc
from collections import defaultdict
from contextlib import contextmanager
from dataclasses import dataclass, field, replace
import math
import struct
import sys
import traceback
import typing
from typing import (
AbstractSet,
Callable,
Collection,
DefaultDict,
Dict,
Iterator,
List... | import abc
from collections import defaultdict
from contextlib import contextmanager
from dataclasses import dataclass, field, replace
import math
import struct
import sys
import traceback
import typing
from typing import (
AbstractSet,
Callable,
Collection,
DefaultDict,
Dict,
Iterator,
List... |
from PySock import client
def abc(data,con):
print(f"Message from {data["sender_name"]} : {data["data"]}")
con.SEND("test","Hurrah! it's working.")
def client_msg(data):
print(f"Message from : {data["sender_name"]} => {data["data"]}")
c = client(client_name = "swat", debug = True)
c.CLIENT("localhost",88... | from PySock import client
def abc(data,con):
print(f"Message from {data['sender_name']} : {data['data']}")
con.SEND("test","Hurrah! it's working.")
def client_msg(data):
print(f"Message from : {data['sender_name']} => {data['data']}")
c = client(client_name = "swat", debug = True)
c.CLIENT("localhost",88... |
import pandas as pd
from sklearn.model_selection import train_test_split
random_state = 100
data = pd.read_csv("~/headlinegen/data/nytime_front_page.csv")
data['title'] = data['title'].apply(lambda x: ' '.join(x.split(' ')[:-5]))
lens = data["content"].apply(lambda x: len(x.split(" "))).nlargest(10)
print(
f'm... | import pandas as pd
from sklearn.model_selection import train_test_split
random_state = 100
data = pd.read_csv("~/headlinegen/data/nytime_front_page.csv")
data['title'] = data['title'].apply(lambda x: ' '.join(x.split(' ')[:-5]))
lens = data["content"].apply(lambda x: len(x.split(" "))).nlargest(10)
print(
f'm... |
import os
from functools import wraps
from flask import flash, redirect, render_template, url_for, current_app, Markup, request
from flask_login import login_user, login_required, logout_user, current_user
from app.auth import bp
from app.auth.forms import SignUpForm, RegistrationForm, LoginForm, ResetPasswordForm, New... | import os
from functools import wraps
from flask import flash, redirect, render_template, url_for, current_app, Markup, request
from flask_login import login_user, login_required, logout_user, current_user
from app.auth import bp
from app.auth.forms import SignUpForm, RegistrationForm, LoginForm, ResetPasswordForm, New... |
import ads
ads.config.token = 'my token'
import numpy as np
# Filenames
## Enter the filename for first-author publications here:
first_author = "first_author.bib"
## Enter the filename for cd-authored publications here:
co_author = "co_author.bib"
# Function Declarations
def extract_bibcodes(filename):
"""Tak... | import ads
ads.config.token = 'my token'
import numpy as np
# Filenames
## Enter the filename for first-author publications here:
first_author = "first_author.bib"
## Enter the filename for cd-authored publications here:
co_author = "co_author.bib"
# Function Declarations
def extract_bibcodes(filename):
"""Tak... |
import traceback
import argparse
import numpy as np
from src import NeuralNetwork, generateExample, getTensorExample
from typing import *
def get_args() -> argparse.Namespace:
"""Set-up the argument parser
Returns:
argparse.Namespace:
"""
parser = argparse.ArgumentParser(
description=... | import traceback
import argparse
import numpy as np
from src import NeuralNetwork, generateExample, getTensorExample
from typing import *
def get_args() -> argparse.Namespace:
"""Set-up the argument parser
Returns:
argparse.Namespace:
"""
parser = argparse.ArgumentParser(
description=... |
import os
from unittest import TestCase
import pytest
from dotenv import load_dotenv
from pytest import skip
from osbot_utils.utils.Files import file_not_exists
from osbot_k8s.kubernetes.Ssh import Ssh
@pytest.mark.skip('needs live server') # todo add to test setup the creation of pods and nodes we can S... | import os
from unittest import TestCase
import pytest
from dotenv import load_dotenv
from pytest import skip
from osbot_utils.utils.Files import file_not_exists
from osbot_k8s.kubernetes.Ssh import Ssh
@pytest.mark.skip('needs live server') # todo add to test setup the creation of pods and nodes we can S... |
import datetime
import json
import logging
import os
import queue
import subprocess as sp
import threading
import time
from collections import defaultdict
from pathlib import Path
import psutil
import shutil
from frigate.config import FrigateConfig
from frigate.const import RECORD_DIR, CLIPS_DIR, CACHE_DIR
from friga... | import datetime
import json
import logging
import os
import queue
import subprocess as sp
import threading
import time
from collections import defaultdict
from pathlib import Path
import psutil
import shutil
from frigate.config import FrigateConfig
from frigate.const import RECORD_DIR, CLIPS_DIR, CACHE_DIR
from friga... |
#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
import itertools
import time
from contextlib import ExitStack as contextlib_ExitStack
from typing import Any, Iterable, List, Optional, Tuple
import torch
from pytext.common.constants import BatchContext, Stage
from pytext.c... | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
import itertools
import time
from contextlib import ExitStack as contextlib_ExitStack
from typing import Any, Iterable, List, Optional, Tuple
import torch
from pytext.common.constants import BatchContext, Stage
from pytext.c... |
import numpy as np
import astropy.units as u
import astropy.wcs.utils
from astropy.coordinates import (
ITRS,
BaseCoordinateFrame,
CartesianRepresentation,
SkyCoord,
SphericalRepresentation,
)
from astropy.wcs import WCS
from sunpy import log
from .frames import (
BaseCoordinateFrame,
Heli... | import numpy as np
import astropy.units as u
import astropy.wcs.utils
from astropy.coordinates import (
ITRS,
BaseCoordinateFrame,
CartesianRepresentation,
SkyCoord,
SphericalRepresentation,
)
from astropy.wcs import WCS
from sunpy import log
from .frames import (
BaseCoordinateFrame,
Heli... |
import asyncio
import json
import logging
from pathlib import Path
from typing import Dict, List, TypedDict
from gql import Client, gql
from gql.client import AsyncClientSession
from gql.transport.aiohttp import AIOHTTPTransport
log = logging.getLogger(__name__)
class Episode(TypedDict):
id: str
title: str
... | import asyncio
import json
import logging
from pathlib import Path
from typing import Dict, List, TypedDict
from gql import Client, gql
from gql.client import AsyncClientSession
from gql.transport.aiohttp import AIOHTTPTransport
log = logging.getLogger(__name__)
class Episode(TypedDict):
id: str
title: str
... |
from typing import Any, Dict, List, Optional, Tuple, TYPE_CHECKING
# from typing import cast as typecast
import json
import logging
import os
import yaml
from .config import Config
from .acresource import ACResource
from ..utils import parse_yaml, dump_yaml
AnyDict = Dict[str, Any]
HandlerResult = Optional[Tuple[st... | from typing import Any, Dict, List, Optional, Tuple, TYPE_CHECKING
# from typing import cast as typecast
import json
import logging
import os
import yaml
from .config import Config
from .acresource import ACResource
from ..utils import parse_yaml, dump_yaml
AnyDict = Dict[str, Any]
HandlerResult = Optional[Tuple[st... |
import torch
import numpy as np
import dnnutil.network as network
import time
__all__ = ['calculate_accuracy', 'Trainer', 'ClassifierTrainer', 'AutoencoderTrainer']
def calculate_accuracy(prediction, label, axis=1):
'''calculate_accuracy(prediction, label)
Computes the mean accuracy over a batch of pre... | import torch
import numpy as np
import dnnutil.network as network
import time
__all__ = ['calculate_accuracy', 'Trainer', 'ClassifierTrainer', 'AutoencoderTrainer']
def calculate_accuracy(prediction, label, axis=1):
'''calculate_accuracy(prediction, label)
Computes the mean accuracy over a batch of pre... |
"""
This script uses python to build a `.nec` file. This allows
for the use of variables and other arithmetic which is much
easier in python. For information on the cards specified by the
arguments, e.g. EX or RP, check out https://www.nec2.org/part_3/cards/
"""
from datetime import datetime as dt
from math import *
... | """
This script uses python to build a `.nec` file. This allows
for the use of variables and other arithmetic which is much
easier in python. For information on the cards specified by the
arguments, e.g. EX or RP, check out https://www.nec2.org/part_3/cards/
"""
from datetime import datetime as dt
from math import *
... |
import random
import shutil
import os
import numpy as np
import data_loader
import audio_processing
from typing import Dict
from loguru import logger
from tqdm import tqdm
from pprint import pprint
class DataGenerator:
def __init__(self, conf: Dict, batch_size: int = 8):
assert "csv_file_path" in conf
... | import random
import shutil
import os
import numpy as np
import data_loader
import audio_processing
from typing import Dict
from loguru import logger
from tqdm import tqdm
from pprint import pprint
class DataGenerator:
def __init__(self, conf: Dict, batch_size: int = 8):
assert "csv_file_path" in conf
... |
"""
FUNÇÕES BÁSICAS PARA O PROGRAMA
"""
from time import sleep
# Imprimir caracter especial
def linha(tam=40):
print(f"{"="*tam}")
# Recebe e valida um nome
def ler_nome(txt):
stop = True
while stop:
stop = False
nome = input(txt).strip()
lista_nome = nome.split()
... | """
FUNÇÕES BÁSICAS PARA O PROGRAMA
"""
from time import sleep
# Imprimir caracter especial
def linha(tam=40):
print(f"{'='*tam}")
# Recebe e valida um nome
def ler_nome(txt):
stop = True
while stop:
stop = False
nome = input(txt).strip()
lista_nome = nome.split()
... |
# 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... |
from typing import List
from aiogram.types import KeyboardButton, ReplyKeyboardMarkup
from keyboards import emojis
from repository import Repository
PART_NAMES: List[str] = ["head", "story", "essence", "proofs", "claims", "additions"]
def get_claim_parts_kb(user_id: int) -> ReplyKeyboardMarkup:
parts_status: d... | from typing import List
from aiogram.types import KeyboardButton, ReplyKeyboardMarkup
from keyboards import emojis
from repository import Repository
PART_NAMES: List[str] = ["head", "story", "essence", "proofs", "claims", "additions"]
def get_claim_parts_kb(user_id: int) -> ReplyKeyboardMarkup:
parts_status: d... |
import email
import jwt
import datetime
from models.users import User
from bson.objectid import ObjectId
from utils.email_util import sent_email
from flask import jsonify, make_response
from special_variables import _secret_key
from utils.token_util import token_required
from flask_bcrypt import generate_password_hash,... | import email
import jwt
import datetime
from models.users import User
from bson.objectid import ObjectId
from utils.email_util import sent_email
from flask import jsonify, make_response
from special_variables import _secret_key
from utils.token_util import token_required
from flask_bcrypt import generate_password_hash,... |
import datetime
import hashlib
import time
from collections import namedtuple, OrderedDict
from copy import copy
from itertools import chain
import csv
import gevent
from .exception import StopUser, CatchResponseError
import logging
console_logger = logging.getLogger("locust.stats_logger")
STATS_NAME_WIDTH = 60
ST... | import datetime
import hashlib
import time
from collections import namedtuple, OrderedDict
from copy import copy
from itertools import chain
import csv
import gevent
from .exception import StopUser, CatchResponseError
import logging
console_logger = logging.getLogger("locust.stats_logger")
STATS_NAME_WIDTH = 60
ST... |
"""Map Sentinel-1 data products to xarray.
References:
- Sentinel-1 document library: https://sentinels.copernicus.eu/web/sentinel/user-guides/sentinel-1-sar/document-library
- Sentinel-1 Product Specification v3.9 07 May 2021 S1-RS-MDA-52-7441-3-9 documenting IPF 3.40
https://sentinel.esa.int/documents/247904... | """Map Sentinel-1 data products to xarray.
References:
- Sentinel-1 document library: https://sentinels.copernicus.eu/web/sentinel/user-guides/sentinel-1-sar/document-library
- Sentinel-1 Product Specification v3.9 07 May 2021 S1-RS-MDA-52-7441-3-9 documenting IPF 3.40
https://sentinel.esa.int/documents/247904... |
from typing import Iterable
__all__ = ['in_', 'not_in', 'exists', 'not_exists', 'equal', 'not_equal']
class Operator:
def __init__(self, op_name: str, op: str, value=None):
self.op = op
self.value = value
self.op_name = op_name
def encode(self, key):
return f"{key}{self.op}{s... | from typing import Iterable
__all__ = ['in_', 'not_in', 'exists', 'not_exists', 'equal', 'not_equal']
class Operator:
def __init__(self, op_name: str, op: str, value=None):
self.op = op
self.value = value
self.op_name = op_name
def encode(self, key):
return f"{key}{self.op}{s... |
import json
import os
import subprocess
import zipfile
import hashlib
import pytest
import py.path
import exifread
EXECUTABLE = os.getenv("MAPILLARY_TOOLS_EXECUTABLE", "python3 -m mapillary_tools")
IMPORT_PATH = "tests/integration/mapillary_tools_process_images_provider/data"
USERNAME = "test_username_MAKE_SURE_IT_IS... | import json
import os
import subprocess
import zipfile
import hashlib
import pytest
import py.path
import exifread
EXECUTABLE = os.getenv("MAPILLARY_TOOLS_EXECUTABLE", "python3 -m mapillary_tools")
IMPORT_PATH = "tests/integration/mapillary_tools_process_images_provider/data"
USERNAME = "test_username_MAKE_SURE_IT_IS... |
from discord.ext import commands
from discord.utils import escape_markdown
from fuzzywuzzy import process as fwp
from util.data.guild_data import GuildData
class Tags(commands.Cog):
def __init__(self, bot):
self.bot = bot
@commands.command(name="settag", aliases=["edittag", "newtag", "addtag"])
... | from discord.ext import commands
from discord.utils import escape_markdown
from fuzzywuzzy import process as fwp
from util.data.guild_data import GuildData
class Tags(commands.Cog):
def __init__(self, bot):
self.bot = bot
@commands.command(name="settag", aliases=["edittag", "newtag", "addtag"])
... |
"""Amazon S3 Module."""
import concurrent.futures
import csv
import logging
import time
import uuid
from itertools import repeat
from typing import Any, Callable, Dict, Iterator, List, Optional, Tuple, Union
import boto3 # type: ignore
import botocore.exceptions # type: ignore
import pandas as pd # type: ignore
im... | """Amazon S3 Module."""
import concurrent.futures
import csv
import logging
import time
import uuid
from itertools import repeat
from typing import Any, Callable, Dict, Iterator, List, Optional, Tuple, Union
import boto3 # type: ignore
import botocore.exceptions # type: ignore
import pandas as pd # type: ignore
im... |
import random
import string
from typing import Dict
import demistomock as demisto
from CommonServerPython import *
from CommonServerUserPython import *
import sys
import traceback
import json
import os
import hashlib
from datetime import timedelta
from io import StringIO
import logging
import warnings
import email
fr... | import random
import string
from typing import Dict
import demistomock as demisto
from CommonServerPython import *
from CommonServerUserPython import *
import sys
import traceback
import json
import os
import hashlib
from datetime import timedelta
from io import StringIO
import logging
import warnings
import email
fr... |
#
# KTH Royal Institute of Technology
# DD2424: Deep Learning in Data Science
# Assignment 4
#
# Carlo Rapisarda (carlora@kth.se)
#
import numpy as np
import matplotlib.pyplot as plt
import dataset as dt
from os.path import exists
from model import RNNet
from utilities import compute_grads_numerical, compare_grads, un... | #
# KTH Royal Institute of Technology
# DD2424: Deep Learning in Data Science
# Assignment 4
#
# Carlo Rapisarda (carlora@kth.se)
#
import numpy as np
import matplotlib.pyplot as plt
import dataset as dt
from os.path import exists
from model import RNNet
from utilities import compute_grads_numerical, compare_grads, un... |
#encoding:utf-8
import torch
import numpy as np
from ..utils.utils import model_device,load_bert
class Predicter(object):
def __init__(self,
model,
logger,
n_gpu,
model_path
):
self.model = model
self.logger = logg... | #encoding:utf-8
import torch
import numpy as np
from ..utils.utils import model_device,load_bert
class Predicter(object):
def __init__(self,
model,
logger,
n_gpu,
model_path
):
self.model = model
self.logger = logg... |
# -*- coding: utf-8 -*-
"""
test_doc_table
~~~~~~~~~~~~~~
Test the Table Document element.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import logging
import unittest
from chemdataextractor.doc.table import T... | # -*- coding: utf-8 -*-
"""
test_doc_table
~~~~~~~~~~~~~~
Test the Table Document element.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import logging
import unittest
from chemdataextractor.doc.table import T... |
"""Portfolio View"""
__docformat__ = "numpy"
import logging
from typing import List, Optional
import os
import numpy as np
import pandas as pd
from matplotlib import pyplot as plt
from gamestonk_terminal.config_terminal import theme
from gamestonk_terminal.config_plot import PLOT_DPI
from gamestonk_terminal.portfoli... | """Portfolio View"""
__docformat__ = "numpy"
import logging
from typing import List, Optional
import os
import numpy as np
import pandas as pd
from matplotlib import pyplot as plt
from gamestonk_terminal.config_terminal import theme
from gamestonk_terminal.config_plot import PLOT_DPI
from gamestonk_terminal.portfoli... |
##################################################
# Import Own Assets
##################################################
from hyperparameter_hunter import exceptions
from hyperparameter_hunter.settings import G
from hyperparameter_hunter.utils.general_utils import now_time, expand_mins_secs
##########################... | ##################################################
# Import Own Assets
##################################################
from hyperparameter_hunter import exceptions
from hyperparameter_hunter.settings import G
from hyperparameter_hunter.utils.general_utils import now_time, expand_mins_secs
##########################... |
import logging
import sys
import itertools
import time
import click
import click_log
import tqdm
import pysam
import multiprocessing as mp
from inspect import getframeinfo, currentframe, getdoc
from ..utils import bam_utils
from ..utils.model import LibraryModel
from ..annotate.command import get_segments
from .... | import logging
import sys
import itertools
import time
import click
import click_log
import tqdm
import pysam
import multiprocessing as mp
from inspect import getframeinfo, currentframe, getdoc
from ..utils import bam_utils
from ..utils.model import LibraryModel
from ..annotate.command import get_segments
from .... |
# Copyright (C) 2019 The Raphielscape Company LLC.
#
# Licensed under the Raphielscape Public License, Version 1.d (the "License");
# you may not use this file except in compliance with the License.
#
# ReCode by @mrismanaziz
# FROM Man-Userbot <https://github.com/mrismanaziz/Man-Userbot>
# t.me/SharingUserbot & t.me/L... | # Copyright (C) 2019 The Raphielscape Company LLC.
#
# Licensed under the Raphielscape Public License, Version 1.d (the "License");
# you may not use this file except in compliance with the License.
#
# ReCode by @mrismanaziz
# FROM Man-Userbot <https://github.com/mrismanaziz/Man-Userbot>
# t.me/SharingUserbot & t.me/L... |
import jsonlines
import re
import transformers
import torch
from tqdm import trange, tqdm
import argparse
import os, sys
def get_case_insensitive_key_value(input_dict, key):
return next((value for dict_key, value in input_dict.items() if dict_key.lower() == key.lower()), None)
def filter_triples(model, tokenizer,... | import jsonlines
import re
import transformers
import torch
from tqdm import trange, tqdm
import argparse
import os, sys
def get_case_insensitive_key_value(input_dict, key):
return next((value for dict_key, value in input_dict.items() if dict_key.lower() == key.lower()), None)
def filter_triples(model, tokenizer,... |
#!/usr/bin/env python
# Copyright 2015-2016 Yelp Inc.
#
# 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 ... | #!/usr/bin/env python
# Copyright 2015-2016 Yelp Inc.
#
# 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 ... |
#! /usr/bin/env python3
import argparse
import csv
import datetime
import json
import os
import sys
roast_fields = [
'dateTime',
'uid',
'roastNumber',
'roastName',
'beanId',
'rating',
'serialNumber',
'firmware',
'hardware',
{'fields': ['ambient', 'ambientTemp'], 'mapped_field... | #! /usr/bin/env python3
import argparse
import csv
import datetime
import json
import os
import sys
roast_fields = [
'dateTime',
'uid',
'roastNumber',
'roastName',
'beanId',
'rating',
'serialNumber',
'firmware',
'hardware',
{'fields': ['ambient', 'ambientTemp'], 'mapped_field... |
"""
Здесь собраны все команды настроек
"""
import json
from vkbottle.user import Blueprint, Message
from utils.edit_msg import edit_msg
from utils.emojis import ENABLED, DISABLED, ERROR
from filters import ForEveryoneRule
bp = Blueprint("Settings command")
@bp.on.message(ForEveryoneRule("settings"), ... | """
Здесь собраны все команды настроек
"""
import json
from vkbottle.user import Blueprint, Message
from utils.edit_msg import edit_msg
from utils.emojis import ENABLED, DISABLED, ERROR
from filters import ForEveryoneRule
bp = Blueprint("Settings command")
@bp.on.message(ForEveryoneRule("settings"), ... |
import os
import json
import argparse
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.utils.data import DataLoader
from collections import OrderedDict
from sg2im.utils import timeit, bool_flag, LossManager
from sg2im.utils import int_tuple, float_tuple, str_tuple
from sg2im.data.vg import... | import os
import json
import argparse
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.utils.data import DataLoader
from collections import OrderedDict
from sg2im.utils import timeit, bool_flag, LossManager
from sg2im.utils import int_tuple, float_tuple, str_tuple
from sg2im.data.vg import... |
# Licensed to Modin Development Team under one or more contributor license agreements.
# See the NOTICE file distributed with this work for additional information regarding
# copyright ownership. The Modin Development Team licenses this file to you under the
# Apache License, Version 2.0 (the "License"); you may not u... | # Licensed to Modin Development Team under one or more contributor license agreements.
# See the NOTICE file distributed with this work for additional information regarding
# copyright ownership. The Modin Development Team licenses this file to you under the
# Apache License, Version 2.0 (the "License"); you may not u... |
from transformers import EvalPrediction
from sklearn.metrics import precision_recall_fscore_support
import numpy as np
def compute_metrics(pred: EvalPrediction):
"""Compute recall at the masked position
"""
mask = pred.label_ids != -100
# filter everything except the masked position and flatten tensor... | from transformers import EvalPrediction
from sklearn.metrics import precision_recall_fscore_support
import numpy as np
def compute_metrics(pred: EvalPrediction):
"""Compute recall at the masked position
"""
mask = pred.label_ids != -100
# filter everything except the masked position and flatten tensor... |
# Copyright 2020 Huawei Technologies Co., Ltd
#
# 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... | # Copyright 2020 Huawei Technologies Co., Ltd
#
# 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 __future__ import annotations
from collections.abc import Iterable
from reprlib import Repr
from typing import TYPE_CHECKING, Any, Callable, Dict, List, Optional, Set, Tuple, Type
from uuid import UUID, uuid4
from restio.event import EventListener
from restio.fields.base import Field, T_co
from restio.shared imp... | from __future__ import annotations
from collections.abc import Iterable
from reprlib import Repr
from typing import TYPE_CHECKING, Any, Callable, Dict, List, Optional, Set, Tuple, Type
from uuid import UUID, uuid4
from restio.event import EventListener
from restio.fields.base import Field, T_co
from restio.shared imp... |
"""Example Extorter, useful as a starting point"""
import typing
import logging
import dataclasses
import datetime
# 3rdparty
import slugify
# We use ibflex
from ibflex import parser, FlexStatement, CashAction
from coolbeans.extort.base import ExtortionProtocol
from coolbeans.tools.seeds import Trade, Transfer, E... | """Example Extorter, useful as a starting point"""
import typing
import logging
import dataclasses
import datetime
# 3rdparty
import slugify
# We use ibflex
from ibflex import parser, FlexStatement, CashAction
from coolbeans.extort.base import ExtortionProtocol
from coolbeans.tools.seeds import Trade, Transfer, E... |
#
# Copyright(c) 2019-2020 Intel Corporation
# SPDX-License-Identifier: BSD-3-Clause-Clear
#
import random
from itertools import permutations
import pytest
from api.cas.ioclass_config import IoClass
from storage_devices.disk import DiskType, DiskTypeSet, DiskTypeLowerThan
from test_tools import fs_utils
from test_to... | #
# Copyright(c) 2019-2020 Intel Corporation
# SPDX-License-Identifier: BSD-3-Clause-Clear
#
import random
from itertools import permutations
import pytest
from api.cas.ioclass_config import IoClass
from storage_devices.disk import DiskType, DiskTypeSet, DiskTypeLowerThan
from test_tools import fs_utils
from test_to... |
# Copyright 2020 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import annotations
from dataclasses import dataclass
from typing import Tuple
from pants.backend.python.lint.pylint.subsystem import (
Pylint,
PylintFieldSet,
... | # Copyright 2020 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import annotations
from dataclasses import dataclass
from typing import Tuple
from pants.backend.python.lint.pylint.subsystem import (
Pylint,
PylintFieldSet,
... |
import os
import sys
import importlib
import argparse
import csv
import numpy as np
import time
import pickle
import pathlib
import gzip
import tensorflow as tf
import tensorflow.contrib.eager as tfe
import svmrank
import utilities
from utilities_tf import load_batch_gcnn
def load_batch_flat(sample_files, feats_t... | import os
import sys
import importlib
import argparse
import csv
import numpy as np
import time
import pickle
import pathlib
import gzip
import tensorflow as tf
import tensorflow.contrib.eager as tfe
import svmrank
import utilities
from utilities_tf import load_batch_gcnn
def load_batch_flat(sample_files, feats_t... |
import urllib.request
from datetime import datetime
import string
from argparse import ArgumentParser
import gspread
from oauth2client.service_account import ServiceAccountCredentials
from bs4 import BeautifulSoup
from sortedcontainers import SortedDict
class StockPriceScraper:
def __init__(self, base_url, stoc... | import urllib.request
from datetime import datetime
import string
from argparse import ArgumentParser
import gspread
from oauth2client.service_account import ServiceAccountCredentials
from bs4 import BeautifulSoup
from sortedcontainers import SortedDict
class StockPriceScraper:
def __init__(self, base_url, stoc... |
import json
import os
import re
from collections import OrderedDict
import pytest
from allennlp.common.checks import ConfigurationError
from allennlp.common.params import infer_and_cast, Params, parse_overrides, unflatten, with_fallback
from allennlp.common.testing import AllenNlpTestCase
class TestParams(AllenNlpT... | import json
import os
import re
from collections import OrderedDict
import pytest
from allennlp.common.checks import ConfigurationError
from allennlp.common.params import infer_and_cast, Params, parse_overrides, unflatten, with_fallback
from allennlp.common.testing import AllenNlpTestCase
class TestParams(AllenNlpT... |
"""RemoteJIT client/server config functions
"""
__all__ = ['RemoteJIT', 'Signature', 'Caller']
import os
import inspect
import warnings
import ctypes
from contextlib import nullcontext
from . import irtools
from .typesystem import Type, get_signature
from .thrift import Server, Dispatcher, dispatchermethod, Data, Cli... | """RemoteJIT client/server config functions
"""
__all__ = ['RemoteJIT', 'Signature', 'Caller']
import os
import inspect
import warnings
import ctypes
from contextlib import nullcontext
from . import irtools
from .typesystem import Type, get_signature
from .thrift import Server, Dispatcher, dispatchermethod, Data, Cli... |
#Import Libraries
#Web Scraping tools
from bs4 import BeautifulSoup as bs
from selenium import webdriver
#from splinter import Browser
#DataFrame tools
import pandas as pd
#Misc tools for web scraping
import time
import requests
#Function to initianilze browser.
def init_browser():
#Settings for headless mode.... | #Import Libraries
#Web Scraping tools
from bs4 import BeautifulSoup as bs
from selenium import webdriver
#from splinter import Browser
#DataFrame tools
import pandas as pd
#Misc tools for web scraping
import time
import requests
#Function to initianilze browser.
def init_browser():
#Settings for headless mode.... |
import asyncio
import datetime
import logging
import secrets
from main import game
class GameError(Exception):
pass
class ForbiddenMoveError(GameError):
pass
class MoveIsNotPossible(GameError):
pass
class Game:
def __init__(self):
self._game = game
self._is_started = False
... | import asyncio
import datetime
import logging
import secrets
from main import game
class GameError(Exception):
pass
class ForbiddenMoveError(GameError):
pass
class MoveIsNotPossible(GameError):
pass
class Game:
def __init__(self):
self._game = game
self._is_started = False
... |
# 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... |
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the Apache 2.0 License.
import getpass
import time
import http
import logging
from random import seed
import infra.network
import infra.proc
import infra.remote_client
import infra.rates
import cimetrics.upload
from loguru import logger as LO... | # Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the Apache 2.0 License.
import getpass
import time
import http
import logging
from random import seed
import infra.network
import infra.proc
import infra.remote_client
import infra.rates
import cimetrics.upload
from loguru import logger as LO... |
from getpass import getuser
from shlex import quote
from typing import Dict
import click
import hashlib
import json
import logging
import os
import subprocess
import sys
import time
import warnings
from ray.autoscaler.command_runner import CommandRunnerInterface
from ray.autoscaler._private.docker import check_bind_mo... | from getpass import getuser
from shlex import quote
from typing import Dict
import click
import hashlib
import json
import logging
import os
import subprocess
import sys
import time
import warnings
from ray.autoscaler.command_runner import CommandRunnerInterface
from ray.autoscaler._private.docker import check_bind_mo... |
import datetime
import json
import multiprocessing
import os
import random
import re
import time
import discum
version = 'v0.01'
config_path = 'data/config.json'
logo = f'''
###### ### ### ## ####### ### ## ## ###
## ## ## ## ## ## ## ## ## ## ## ## ## ##
## ## ## ... | import datetime
import json
import multiprocessing
import os
import random
import re
import time
import discum
version = 'v0.01'
config_path = 'data/config.json'
logo = f'''
###### ### ### ## ####### ### ## ## ###
## ## ## ## ## ## ## ## ## ## ## ## ## ##
## ## ## ... |
# -*- coding: utf-8 -*-
"""Functions to make simple plots with M/EEG data."""
# Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Denis Engemann <denis.engemann@gmail.com>
# Martin Luessi <mluessi@nmr.mgh.harvard.edu>
# Eric Larson <larson.eric.d@gmail.com>
# Cathy Nangini... | # -*- coding: utf-8 -*-
"""Functions to make simple plots with M/EEG data."""
# Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Denis Engemann <denis.engemann@gmail.com>
# Martin Luessi <mluessi@nmr.mgh.harvard.edu>
# Eric Larson <larson.eric.d@gmail.com>
# Cathy Nangini... |
"""
GroupBunk v.1.2
Leave your Facebook groups quietly
Author: Shine Jayakumar
Github: https://github.com/shine-jayakumar
LICENSE: MIT
"""
from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.chrome.options import Options
from selenium.common.exceptions imp... | """
GroupBunk v.1.2
Leave your Facebook groups quietly
Author: Shine Jayakumar
Github: https://github.com/shine-jayakumar
LICENSE: MIT
"""
from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.chrome.options import Options
from selenium.common.exceptions imp... |
#!/usr/bin/python3
# **************************************************************************** #
# #
# :::::::: #
# Artsy.py :+... | #!/usr/bin/python3
# **************************************************************************** #
# #
# :::::::: #
# Artsy.py :+... |
# MIT License
#
# Copyright (c) 2020 Genesis Cloud Ltd. <opensource@genesiscloud.com>
#
# 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 r... | # MIT License
#
# Copyright (c) 2020 Genesis Cloud Ltd. <opensource@genesiscloud.com>
#
# 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 r... |
from __future__ import division
import numpy as np
from openmdao.api import ExplicitComponent
from openmdao.api import Group
class PowerSplit(ExplicitComponent):
"""
A power split mechanism for mechanical or electrical power.
Inputs
------
power_in : float
Power fed to the splitter. (vect... | from __future__ import division
import numpy as np
from openmdao.api import ExplicitComponent
from openmdao.api import Group
class PowerSplit(ExplicitComponent):
"""
A power split mechanism for mechanical or electrical power.
Inputs
------
power_in : float
Power fed to the splitter. (vect... |
from enum import Enum
import gym
import numpy as np
from gym import spaces
from gym.utils import seeding
class Action(Enum):
decrease_attention = 0
increase_attention = 1
access_detector = 2
isolate_node = 3
forget_node = 4
class State(Enum):
healthy = 0
infected = 1
class MalwareEnv(... | from enum import Enum
import gym
import numpy as np
from gym import spaces
from gym.utils import seeding
class Action(Enum):
decrease_attention = 0
increase_attention = 1
access_detector = 2
isolate_node = 3
forget_node = 4
class State(Enum):
healthy = 0
infected = 1
class MalwareEnv(... |
# Owner(s): ["oncall: fx"]
import builtins
import contextlib
import copy
import functools
import inspect
import math
import numbers
import operator
import os
import pickle
import sys
import torch
import traceback
import typing
import types
import warnings
import unittest
from math import sqrt
from torch.multiprocessin... | # Owner(s): ["oncall: fx"]
import builtins
import contextlib
import copy
import functools
import inspect
import math
import numbers
import operator
import os
import pickle
import sys
import torch
import traceback
import typing
import types
import warnings
import unittest
from math import sqrt
from torch.multiprocessin... |
# coding: utf-8
# Copyright (c) 2019-2020 Latona. All rights reserved.
import time
from aion.logger import lprint
from aion.microservice import Options, main_decorator
from .check import UpdateUsbStateToDB, UsbConnectionMonitor, DATABASE
SERVICE_NAME = "check-usb-storage-connection"
EXECUTE_INTERVAL = 5
def fillt... | # coding: utf-8
# Copyright (c) 2019-2020 Latona. All rights reserved.
import time
from aion.logger import lprint
from aion.microservice import Options, main_decorator
from .check import UpdateUsbStateToDB, UsbConnectionMonitor, DATABASE
SERVICE_NAME = "check-usb-storage-connection"
EXECUTE_INTERVAL = 5
def fillt... |
import os
import pandas as pd
import fsspec
import argparse
from src.defaults import args_info
env_vars = open("/content/credentials","r").read().split('\n')
for var in env_vars[:-1]:
key, value = var.split(' = ')
os.environ[key] = value
storage_options={'account_name':os.environ['ACCOUNT_NAME'],\
... | import os
import pandas as pd
import fsspec
import argparse
from src.defaults import args_info
env_vars = open("/content/credentials","r").read().split('\n')
for var in env_vars[:-1]:
key, value = var.split(' = ')
os.environ[key] = value
storage_options={'account_name':os.environ['ACCOUNT_NAME'],\
... |
"""CLI argument parsing."""
import argparse
# from ..io import EXTENSIONS
from ._parseutil import Color
from ._parseutil import CustomFormatter
from ._parseutil import FileFolderType
from ._parseutil import FileType
from ._parseutil import FolderType
from ._parseutil import ProbabilityType
from ._parseutil import Sha... | """CLI argument parsing."""
import argparse
# from ..io import EXTENSIONS
from ._parseutil import Color
from ._parseutil import CustomFormatter
from ._parseutil import FileFolderType
from ._parseutil import FileType
from ._parseutil import FolderType
from ._parseutil import ProbabilityType
from ._parseutil import Sha... |
from .TLiDB_dataset import TLiDB_Dataset
from tlidb.TLiDB.metrics.all_metrics import Accuracy
class clinc150_dataset(TLiDB_Dataset):
"""
CLINC150 dataset
This is the full dataset from https://github.com/clinc/oos-eval
Input (x):
- text (str): Text utterance
Target (y):
- label (li... | from .TLiDB_dataset import TLiDB_Dataset
from tlidb.TLiDB.metrics.all_metrics import Accuracy
class clinc150_dataset(TLiDB_Dataset):
"""
CLINC150 dataset
This is the full dataset from https://github.com/clinc/oos-eval
Input (x):
- text (str): Text utterance
Target (y):
- label (li... |
#!/usr/bin/env python
# coding: utf-8
# In[1]:
from allennlp.predictors.predictor import Predictor
# ## Instantiate AllenNLP `Predictor`
# 1. Load the same model that is used in the [demo](https://demo.allennlp.org/coreference-resolution) (*don't get alarmed by the warning - we don't need to fine-tune the model t... | #!/usr/bin/env python
# coding: utf-8
# In[1]:
from allennlp.predictors.predictor import Predictor
# ## Instantiate AllenNLP `Predictor`
# 1. Load the same model that is used in the [demo](https://demo.allennlp.org/coreference-resolution) (*don't get alarmed by the warning - we don't need to fine-tune the model t... |
import io
import json
import zipfile
from functools import cached_property
from typing import Callable, Dict, KeysView, List, NamedTuple, Set, Union
import requests
from django.contrib import messages
from django.contrib.auth.mixins import UserPassesTestMixin
from django.core.exceptions import ObjectDoesNotExist, Susp... | import io
import json
import zipfile
from functools import cached_property
from typing import Callable, Dict, KeysView, List, NamedTuple, Set, Union
import requests
from django.contrib import messages
from django.contrib.auth.mixins import UserPassesTestMixin
from django.core.exceptions import ObjectDoesNotExist, Susp... |
#!/usr/bin/env python
# encoding: utf-8
"""
Script for installing the components of the ArPI home security system to a running Raspberry PI Zero Wifi host.
It uses the configuration file install.yaml!
---
@author: Gábor Kovács
@copyright: 2017 arpi-security.info. All rights reserved.
@contact: gkovacs81@gm... | #!/usr/bin/env python
# encoding: utf-8
"""
Script for installing the components of the ArPI home security system to a running Raspberry PI Zero Wifi host.
It uses the configuration file install.yaml!
---
@author: Gábor Kovács
@copyright: 2017 arpi-security.info. All rights reserved.
@contact: gkovacs81@gm... |
import os
import pytest
import re
import subprocess
import time
from afdko.fdkutils import (
get_temp_file_path,
get_temp_dir_path,
)
from test_utils import (
get_input_path,
get_bad_input_path,
get_expected_path,
generate_ps_dump,
)
from runner import main as runner
from differ import main as ... | import os
import pytest
import re
import subprocess
import time
from afdko.fdkutils import (
get_temp_file_path,
get_temp_dir_path,
)
from test_utils import (
get_input_path,
get_bad_input_path,
get_expected_path,
generate_ps_dump,
)
from runner import main as runner
from differ import main as ... |
import os
import re
import sys
import copy
import logging
import warnings
import subprocess
import shutil
import uuid
import tempfile
import asyncio
from collections import OrderedDict
from pprint import pformat
from yggdrasil import platform, tools, languages, multitasking, constants
from yggdrasil.components import i... | import os
import re
import sys
import copy
import logging
import warnings
import subprocess
import shutil
import uuid
import tempfile
import asyncio
from collections import OrderedDict
from pprint import pformat
from yggdrasil import platform, tools, languages, multitasking, constants
from yggdrasil.components import i... |
"""
API operations for Workflows
"""
import hashlib
import json
import logging
import os
from typing import (
Any,
Dict,
List,
Optional,
)
from fastapi import (
Body,
Path,
Query,
Response,
status,
)
from gxformat2._yaml import ordered_dump
from markupsafe import escape
from pydant... | """
API operations for Workflows
"""
import hashlib
import json
import logging
import os
from typing import (
Any,
Dict,
List,
Optional,
)
from fastapi import (
Body,
Path,
Query,
Response,
status,
)
from gxformat2._yaml import ordered_dump
from markupsafe import escape
from pydant... |
import argparse
import asyncio
import functools
import json
import logging
import re
import shlex
import urllib.request
import zlib
import ModuleUpdate
ModuleUpdate.update()
import websockets
import aioconsole
import Items
import Regions
from MultiClient import ReceivedItem, get_item_name_from_id, get_location_name_... | import argparse
import asyncio
import functools
import json
import logging
import re
import shlex
import urllib.request
import zlib
import ModuleUpdate
ModuleUpdate.update()
import websockets
import aioconsole
import Items
import Regions
from MultiClient import ReceivedItem, get_item_name_from_id, get_location_name_... |
import os
import json
from flask import Flask, render_template
DATABASE_PATH = "../.contacts-store"
# Read database and build HTML string
file_names = os.listdir(DATABASE_PATH)
file_names.remove(".git")
html = "<table><th>Contact</th><th>Last Name</th><th>Tlf</th><th>Email</th><th>Job</th><th>Province</th>"
for file_... | import os
import json
from flask import Flask, render_template
DATABASE_PATH = "../.contacts-store"
# Read database and build HTML string
file_names = os.listdir(DATABASE_PATH)
file_names.remove(".git")
html = "<table><th>Contact</th><th>Last Name</th><th>Tlf</th><th>Email</th><th>Job</th><th>Province</th>"
for file_... |
# Copyright (c) OpenMMLab. All rights reserved.
import math
from mmcv.parallel import is_module_wrapper
from mmcv.runner.hooks import HOOKS, Hook
class BaseEMAHook(Hook):
"""Exponential Moving Average Hook.
Use Exponential Moving Average on all parameters of model in training
process. All par... | # Copyright (c) OpenMMLab. All rights reserved.
import math
from mmcv.parallel import is_module_wrapper
from mmcv.runner.hooks import HOOKS, Hook
class BaseEMAHook(Hook):
"""Exponential Moving Average Hook.
Use Exponential Moving Average on all parameters of model in training
process. All par... |
import threading
import numpy as np
import jesse.helpers as jh
from jesse.models.Candle import Candle
from jesse.models.CompletedTrade import CompletedTrade
from jesse.models.DailyBalance import DailyBalance
from jesse.models.Order import Order
from jesse.models.Orderbook import Orderbook
from jesse.models.Ticker imp... | import threading
import numpy as np
import jesse.helpers as jh
from jesse.models.Candle import Candle
from jesse.models.CompletedTrade import CompletedTrade
from jesse.models.DailyBalance import DailyBalance
from jesse.models.Order import Order
from jesse.models.Orderbook import Orderbook
from jesse.models.Ticker imp... |
import copy
from typing import Optional
from vyper import ast as vy_ast
from vyper.ast.validation import validate_call_args
from vyper.exceptions import (
ExceptionList,
FunctionDeclarationException,
ImmutableViolation,
InvalidLiteral,
InvalidOperation,
InvalidType,
IteratorException,
N... | import copy
from typing import Optional
from vyper import ast as vy_ast
from vyper.ast.validation import validate_call_args
from vyper.exceptions import (
ExceptionList,
FunctionDeclarationException,
ImmutableViolation,
InvalidLiteral,
InvalidOperation,
InvalidType,
IteratorException,
N... |
# Daisyxmusic (Telegram bot project )
# Copyright (C) 2021 Inukaasith
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later ve... | # Daisyxmusic (Telegram bot project )
# Copyright (C) 2021 Inukaasith
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later ve... |
#!/usr/bin/env python3
import sys
import time
import datetime
import os
import psutil
def main():
CurrentTime = datetime.datetime.now()
with open(r"/sys/class/thermal/thermal_zone0/temp") as f:
CurrentTemp0 = f.readline()
with open(r"/sys/class/thermal/thermal_zone1/temp") as f:
Cur... | #!/usr/bin/env python3
import sys
import time
import datetime
import os
import psutil
def main():
CurrentTime = datetime.datetime.now()
with open(r"/sys/class/thermal/thermal_zone0/temp") as f:
CurrentTemp0 = f.readline()
with open(r"/sys/class/thermal/thermal_zone1/temp") as f:
Cur... |
# YOLOv5 YOLO-specific modules
import argparse
import logging
import sys
from copy import deepcopy
sys.path.append('./') # to run '$ python *.py' files in subdirectories
logger = logging.getLogger(__name__)
from models.common import *
from models.experimental import *
from utils.autoanchor import check_anchor_order... | # YOLOv5 YOLO-specific modules
import argparse
import logging
import sys
from copy import deepcopy
sys.path.append('./') # to run '$ python *.py' files in subdirectories
logger = logging.getLogger(__name__)
from models.common import *
from models.experimental import *
from utils.autoanchor import check_anchor_order... |
# -*- coding: utf-8 -*-
###########################################################################
# Copyright (c), The AiiDA team. All rights reserved. #
# This file is part of the AiiDA code. #
# ... | # -*- coding: utf-8 -*-
###########################################################################
# Copyright (c), The AiiDA team. All rights reserved. #
# This file is part of the AiiDA code. #
# ... |
#
# This file is part of LiteX.
#
# Copyright (c) 2021 Franck Jullien <franck.jullien@collshade.fr>
# SPDX-License-Identifier: BSD-2-Clause
import os
import csv
import re
import datetime
from xml.dom import expatbuilder
import xml.etree.ElementTree as et
from litex.build import tools
namespaces = {
"efxpt" : "h... | #
# This file is part of LiteX.
#
# Copyright (c) 2021 Franck Jullien <franck.jullien@collshade.fr>
# SPDX-License-Identifier: BSD-2-Clause
import os
import csv
import re
import datetime
from xml.dom import expatbuilder
import xml.etree.ElementTree as et
from litex.build import tools
namespaces = {
"efxpt" : "h... |
from typing import Any, MutableMapping, Optional
def merge_dicts(a: MutableMapping[str, Any], b: MutableMapping[str, Any], path: Optional[list] = None) -> MutableMapping[str, Any]:
"""
Merge the keys and values of the two dicts.
:param a:
:param b:
:param path:
:return:
:raises ValueError... | from typing import Any, MutableMapping, Optional
def merge_dicts(a: MutableMapping[str, Any], b: MutableMapping[str, Any], path: Optional[list] = None) -> MutableMapping[str, Any]:
"""
Merge the keys and values of the two dicts.
:param a:
:param b:
:param path:
:return:
:raises ValueError... |
# coding=utf-8
# Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team.
# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
#
# 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 cop... | # coding=utf-8
# Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team.
# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
#
# 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 cop... |
import asyncio
import aiohttp
import logging
from lavaplayer.exceptions import NodeError
from .objects import (
Info,
PlayerUpdateEvent,
TrackStartEvent,
TrackEndEvent,
TrackExceptionEvent,
TrackStuckEvent,
WebSocketClosedEvent,
)
from .emitter import Emitter
import typing as t
if t.TYPE_CH... | import asyncio
import aiohttp
import logging
from lavaplayer.exceptions import NodeError
from .objects import (
Info,
PlayerUpdateEvent,
TrackStartEvent,
TrackEndEvent,
TrackExceptionEvent,
TrackStuckEvent,
WebSocketClosedEvent,
)
from .emitter import Emitter
import typing as t
if t.TYPE_CH... |
import base64
import logging
import re
from html import unescape as html_unescape
from streamlink.plugin import Plugin, pluginmatcher
from streamlink.plugin.api import validate
from streamlink.stream import HTTPStream
from streamlink.utils.parse import parse_json
log = logging.getLogger(__name__)
@pluginmatcher(re.... | import base64
import logging
import re
from html import unescape as html_unescape
from streamlink.plugin import Plugin, pluginmatcher
from streamlink.plugin.api import validate
from streamlink.stream import HTTPStream
from streamlink.utils.parse import parse_json
log = logging.getLogger(__name__)
@pluginmatcher(re.... |
#!/usr/bin/env python
"""
Koala Bot Base Cog code and additional base cog functions
Commented using reStructuredText (reST)
"""
# Futures
# Built-in/Generic Imports
import os
import time
import re
import aiohttp
import logging
from concurrent.futures import ThreadPoolExecutor
logging.basicConfig(filename='TwitchAle... | #!/usr/bin/env python
"""
Koala Bot Base Cog code and additional base cog functions
Commented using reStructuredText (reST)
"""
# Futures
# Built-in/Generic Imports
import os
import time
import re
import aiohttp
import logging
from concurrent.futures import ThreadPoolExecutor
logging.basicConfig(filename='TwitchAle... |
import superimport
import itertools
import matplotlib.pyplot as plt
import numpy as np
from scipy.linalg import eigh
from sklearn.cluster import KMeans
from sklearn.metrics.pairwise import rbf_kernel
import pyprobml_utils as pml
plt.style.use('classic')
def spectral_clustering_demo():
np.random.seed(0)
num_c... | import superimport
import itertools
import matplotlib.pyplot as plt
import numpy as np
from scipy.linalg import eigh
from sklearn.cluster import KMeans
from sklearn.metrics.pairwise import rbf_kernel
import pyprobml_utils as pml
plt.style.use('classic')
def spectral_clustering_demo():
np.random.seed(0)
num_c... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.