edited_code stringlengths 17 978k | original_code stringlengths 17 978k |
|---|---|
from checkov.common.models.enums import CheckCategories, CheckResult
from checkov.kubernetes.checks.resource.base_spec_check import BaseK8Check
strongCiphers = ["TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256","TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256","TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305","TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA... | from checkov.common.models.enums import CheckCategories, CheckResult
from checkov.kubernetes.checks.resource.base_spec_check import BaseK8Check
strongCiphers = ["TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256","TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256","TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305","TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA... |
# SPDX-License-Identifier: MIT
# Copyright (c) 2018-2022 Amano Team
import os
import shutil
import tempfile
from PIL import Image
from pyrogram import Client, filters
from pyrogram.enums import MessageEntityType
from pyrogram.errors import PeerIdInvalid, StickersetInvalid
from pyrogram.raw.functions.messages import G... | # SPDX-License-Identifier: MIT
# Copyright (c) 2018-2022 Amano Team
import os
import shutil
import tempfile
from PIL import Image
from pyrogram import Client, filters
from pyrogram.enums import MessageEntityType
from pyrogram.errors import PeerIdInvalid, StickersetInvalid
from pyrogram.raw.functions.messages import G... |
#!usr/bin/env python3
# -*- coding:utf-8 -*-
__author__ = 'yanqiong'
import random
import secrets
from bisect import bisect_right
from sgqlc.operation import Operation
from pandas.core.internals import BlockManager
from tqsdk.ins_schema import ins_schema, _add_all_frags
RD = random.Random(secrets.randbits(128)) #... | #!usr/bin/env python3
# -*- coding:utf-8 -*-
__author__ = 'yanqiong'
import random
import secrets
from bisect import bisect_right
from sgqlc.operation import Operation
from pandas.core.internals import BlockManager
from tqsdk.ins_schema import ins_schema, _add_all_frags
RD = random.Random(secrets.randbits(128)) #... |
"""
# Sheets Account
Read a Google Sheet as if it were are realtime source of transactions
for a GL account. Columns are mapped to attributes. The
assumption is that the sheet maps to a single account, and the
rows are the credit/debits to that account.
Can be used as a plugin, which will write new entries (for ref... | """
# Sheets Account
Read a Google Sheet as if it were are realtime source of transactions
for a GL account. Columns are mapped to attributes. The
assumption is that the sheet maps to a single account, and the
rows are the credit/debits to that account.
Can be used as a plugin, which will write new entries (for ref... |
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
from msccl.collectives import *
from msccl.algorithm import *
from msccl.instance import *
from msccl.topologies import *
def _alltoall_subproblem(local_nodes, num_copies):
remote_node = local_nodes
local_end = local_nodes * local_nodes... | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
from msccl.collectives import *
from msccl.algorithm import *
from msccl.instance import *
from msccl.topologies import *
def _alltoall_subproblem(local_nodes, num_copies):
remote_node = local_nodes
local_end = local_nodes * local_nodes... |
# Copyright 2019 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import annotations
import logging
import os
import zipfile
from dataclasses import dataclass
from io import BytesIO
from typing import Iterable
from pants.backend.python.... | # Copyright 2019 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import annotations
import logging
import os
import zipfile
from dataclasses import dataclass
from io import BytesIO
from typing import Iterable
from pants.backend.python.... |
"""
Save module for the console.
"""
import json
from typing import List, Optional
from spotdl.utils.search import parse_query
from spotdl.utils.m3u import create_m3u_file
def save(
query: List[str],
save_path: str,
downloader,
m3u_file: Optional[str] = None,
) -> None:
"""
Save metadata fr... | """
Save module for the console.
"""
import json
from typing import List, Optional
from spotdl.utils.search import parse_query
from spotdl.utils.m3u import create_m3u_file
def save(
query: List[str],
save_path: str,
downloader,
m3u_file: Optional[str] = None,
) -> None:
"""
Save metadata fr... |
import asyncio
import datetime
import importlib
import itertools
import os
import random
import re
import shutil
import signal
import subprocess
import sys
import time
import zipfile
import discord
import psutil
from src import const
from src.algorithms import levenshtein_distance
from src.bc import DoNotUpdateFlag
f... | import asyncio
import datetime
import importlib
import itertools
import os
import random
import re
import shutil
import signal
import subprocess
import sys
import time
import zipfile
import discord
import psutil
from src import const
from src.algorithms import levenshtein_distance
from src.bc import DoNotUpdateFlag
f... |
import shlex
import string
import sys
from contextlib import contextmanager
from typing import Any, Callable, Generic, List, Optional, Tuple, Type, TypeVar, cast
import pytest
import simple_parsing
from simple_parsing import ConflictResolution, DashVariant, ParsingError
from simple_parsing.utils import camel_case
fro... | import shlex
import string
import sys
from contextlib import contextmanager
from typing import Any, Callable, Generic, List, Optional, Tuple, Type, TypeVar, cast
import pytest
import simple_parsing
from simple_parsing import ConflictResolution, DashVariant, ParsingError
from simple_parsing.utils import camel_case
fro... |
"""Various functions that interact with Slack, e.g. posting messages."""
import asyncio
import logging
import socket
from pathlib import Path
from typing import Union, Optional
from slack_sdk.errors import SlackApiError
from lsw_slackbot.plots import plot_resource_use
from lsw_slackbot.resources import current_memory... | """Various functions that interact with Slack, e.g. posting messages."""
import asyncio
import logging
import socket
from pathlib import Path
from typing import Union, Optional
from slack_sdk.errors import SlackApiError
from lsw_slackbot.plots import plot_resource_use
from lsw_slackbot.resources import current_memory... |
"""
Provides linkedin api-related code
"""
import random
import logging
from time import sleep
import json
from linkedin_api.utils.helpers import get_id_from_urn
from linkedin_api.client import Client
logger = logging.getLogger(__name__)
class Linkedin(object):
"""
Class for accessing Linkedin API.
"""... | """
Provides linkedin api-related code
"""
import random
import logging
from time import sleep
import json
from linkedin_api.utils.helpers import get_id_from_urn
from linkedin_api.client import Client
logger = logging.getLogger(__name__)
class Linkedin(object):
"""
Class for accessing Linkedin API.
"""... |
# Copyright 2020 University of New South Wales, University of Sydney
# 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 app... | # Copyright 2020 University of New South Wales, University of Sydney
# 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 app... |
# Copyright 2020 University of New South Wales, University of Sydney, Ingham Institute
# 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
# Unle... | # Copyright 2020 University of New South Wales, University of Sydney, Ingham Institute
# 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
# Unle... |
import abc
import collections.abc
import contextlib
import dataclasses
import itertools
import math
import operator
import re
import sys
import time
from collections import defaultdict
from datetime import datetime, timedelta
from functools import lru_cache
from hashlib import md5
from typing import Any, Optional
impo... | import abc
import collections.abc
import contextlib
import dataclasses
import itertools
import math
import operator
import re
import sys
import time
from collections import defaultdict
from datetime import datetime, timedelta
from functools import lru_cache
from hashlib import md5
from typing import Any, Optional
impo... |
import os
from spirl.models.closed_loop_spirl_mdl import GoalClSPiRLMdl
from spirl.components.logger import Logger
from spirl.utils.general_utils import AttrDict
from spirl.configs.default_data_configs.kitchen import data_spec
from spirl.components.evaluator import TopOfNSequenceEvaluator
from spirl.data.kitchen.src.k... | import os
from spirl.models.closed_loop_spirl_mdl import GoalClSPiRLMdl
from spirl.components.logger import Logger
from spirl.utils.general_utils import AttrDict
from spirl.configs.default_data_configs.kitchen import data_spec
from spirl.components.evaluator import TopOfNSequenceEvaluator
from spirl.data.kitchen.src.k... |
# flake8: noqa
# Disable Flake8 because of all the sphinx imports
#
# 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 un... | # flake8: noqa
# Disable Flake8 because of all the sphinx imports
#
# 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 un... |
import json
from girder.constants import AccessType
from girder_client import HttpError
import pytest
from .conftest import getClient, getTestFolder, localDataRoot, users, wait_for_jobs
@pytest.mark.integration
@pytest.mark.parametrize("user", users.values())
@pytest.mark.run(order=3)
def test_reset_integration_env... | import json
from girder.constants import AccessType
from girder_client import HttpError
import pytest
from .conftest import getClient, getTestFolder, localDataRoot, users, wait_for_jobs
@pytest.mark.integration
@pytest.mark.parametrize("user", users.values())
@pytest.mark.run(order=3)
def test_reset_integration_env... |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import... | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import... |
import random
from time import sleep
def Guess():
global attempts
# If the user choose anything but a number between 0 and 10, they will get stuck in loop.
while True:
try:
attempts += 1 # This will count every attempt made by the user
user_number = int(input().replace(' '... | import random
from time import sleep
def Guess():
global attempts
# If the user choose anything but a number between 0 and 10, they will get stuck in loop.
while True:
try:
attempts += 1 # This will count every attempt made by the user
user_number = int(input().replace(' '... |
"""
Conversion of length units.
Available Units:- Metre,Kilometre,Feet,Inch,Centimeter,Yard,Foot,Mile,Millimeter
USAGE :
-> Import this file into their respective project.
-> Use the function length_conversion() for conversion of length units.
-> Parameters :
-> value : The number of from units you want to... | """
Conversion of length units.
Available Units:- Metre,Kilometre,Feet,Inch,Centimeter,Yard,Foot,Mile,Millimeter
USAGE :
-> Import this file into their respective project.
-> Use the function length_conversion() for conversion of length units.
-> Parameters :
-> value : The number of from units you want to... |
import os
import csv
import shutil
from datetime import datetime
from numpy import logspace
import torch
import torch.nn as nn
from torch.optim.lr_scheduler import LambdaLR
from torch.utils.data import DataLoader
from torch.optim import Adam
from dataset.e_piano import create_epiano_datasets, create_pop909_datasets
... | import os
import csv
import shutil
from datetime import datetime
from numpy import logspace
import torch
import torch.nn as nn
from torch.optim.lr_scheduler import LambdaLR
from torch.utils.data import DataLoader
from torch.optim import Adam
from dataset.e_piano import create_epiano_datasets, create_pop909_datasets
... |
# Copyright (c) 2019 - now, Eggroll Authors. 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
#
# Unless required ... | # Copyright (c) 2019 - now, Eggroll Authors. 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
#
# Unless required ... |
import glob
import json
import os
import shutil
import subprocess
from .helpers import *
def constructor(*args, default_channel=True, no_rc=True, no_dry_run=False):
umamba = get_umamba()
cmd = [umamba, "constructor"] + [arg for arg in args if arg]
try:
res = subprocess.check_output(cmd)
... | import glob
import json
import os
import shutil
import subprocess
from .helpers import *
def constructor(*args, default_channel=True, no_rc=True, no_dry_run=False):
umamba = get_umamba()
cmd = [umamba, "constructor"] + [arg for arg in args if arg]
try:
res = subprocess.check_output(cmd)
... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import json
import os
import sys
def update_allure_feature_name(results_dir: str, prefix: str):
"""Make Allure JSON results unique by pre-pending a prefix to: name, historyId & uuid.
Use it when not all of the test results show up in the Allure report.
This ... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import json
import os
import sys
def update_allure_feature_name(results_dir: str, prefix: str):
"""Make Allure JSON results unique by pre-pending a prefix to: name, historyId & uuid.
Use it when not all of the test results show up in the Allure report.
This ... |
from typing import Dict, Iterator, List, Optional, Tuple, Union
from ..constant.util import Amount, ItemPointer, Number
from .item_wrapper import item_type
from .other_wrapper import *
__all__ = [
'ItemType', 'Item', 'Empty',
'Accessory', 'EnchantedBook', 'ReforgeStone', 'TravelScroll',
'Bow', 'Sword',
... | from typing import Dict, Iterator, List, Optional, Tuple, Union
from ..constant.util import Amount, ItemPointer, Number
from .item_wrapper import item_type
from .other_wrapper import *
__all__ = [
'ItemType', 'Item', 'Empty',
'Accessory', 'EnchantedBook', 'ReforgeStone', 'TravelScroll',
'Bow', 'Sword',
... |
import click
import subprocess
import os
@click.group()
def cli():
...
@cli.command()
def deploy():
click.echo("Running chalice deploy")
output = subprocess.check_output(f"source {os.environ["VIRTUAL_ENV"]}/bin/activate && chalice deploy",shell=True)
click.echo(output)
click.echo(os.environ["VIRT... | import click
import subprocess
import os
@click.group()
def cli():
...
@cli.command()
def deploy():
click.echo("Running chalice deploy")
output = subprocess.check_output(f"source {os.environ['VIRTUAL_ENV']}/bin/activate && chalice deploy",shell=True)
click.echo(output)
click.echo(os.environ["VIRT... |
from typing import *
T = TypeVar('T')
MAGIC_ATTR = "__cxxpy_s13s__"
def template(cls: T) -> T:
s13s = {}
setattr(cls, MAGIC_ATTR, s13s)
def __class_getitem__(args):
if not isinstance(args, tuple):
args = (args,)
if args not in s13s:
name = cls.__name__ + ", ".join(map(str, args... | from typing import *
T = TypeVar('T')
MAGIC_ATTR = "__cxxpy_s13s__"
def template(cls: T) -> T:
s13s = {}
setattr(cls, MAGIC_ATTR, s13s)
def __class_getitem__(args):
if not isinstance(args, tuple):
args = (args,)
if args not in s13s:
name = cls.__name__ + ", ".join(map(str, args... |
#crie um tupla com o nome dos produtos, seguidos do preço.
#mostre uma listagem de preços, de forma tabular.
lista = ('Lápis', 1.5, 'Borracha', 2.5, 'Caderno', 10.8,
'Estojo', 20, 'Mochila', 100.5)
print('\033[31m--'*20)
print(f'{'LISTAGEM DE PREÇOS':^40}')
print('--'*20, '\033[m')
for i in range(0, len(lis... | #crie um tupla com o nome dos produtos, seguidos do preço.
#mostre uma listagem de preços, de forma tabular.
lista = ('Lápis', 1.5, 'Borracha', 2.5, 'Caderno', 10.8,
'Estojo', 20, 'Mochila', 100.5)
print('\033[31m--'*20)
print(f'{"LISTAGEM DE PREÇOS":^40}')
print('--'*20, '\033[m')
for i in range(0, len(lis... |
"""
A module that contains utility functions to load the 'classical' workspace configuration.
This configuration may have three meaningful files:
.remote (required) - information about the connection options
.remoteindex (optional) - information about which connection from options above to use
.remoteignore (optional) ... | """
A module that contains utility functions to load the 'classical' workspace configuration.
This configuration may have three meaningful files:
.remote (required) - information about the connection options
.remoteindex (optional) - information about which connection from options above to use
.remoteignore (optional) ... |
import logging
from pyrogram.errors import InputUserDeactivated, UserNotParticipant, FloodWait, UserIsBlocked, PeerIdInvalid
from info import AUTH_CHANNEL, LONG_IMDB_DESCRIPTION, MAX_LIST_ELM
from imdb import IMDb
import asyncio
from pyrogram.types import Message
from typing import Union
import re
import os
from dateti... | import logging
from pyrogram.errors import InputUserDeactivated, UserNotParticipant, FloodWait, UserIsBlocked, PeerIdInvalid
from info import AUTH_CHANNEL, LONG_IMDB_DESCRIPTION, MAX_LIST_ELM
from imdb import IMDb
import asyncio
from pyrogram.types import Message
from typing import Union
import re
import os
from dateti... |
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted.logger._json}.
"""
from io import BytesIO, StringIO
from typing import IO, Any, List, Optional, Sequence, cast
from zope.interface import implementer
from zope.interface.exceptions import BrokenMethodImplementation
from z... | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted.logger._json}.
"""
from io import BytesIO, StringIO
from typing import IO, Any, List, Optional, Sequence, cast
from zope.interface import implementer
from zope.interface.exceptions import BrokenMethodImplementation
from z... |
import click
from typing import Sequence, Tuple
from click.formatting import measure_table, iter_rows
class OrderedCommand(click.Command):
def get_params(self, ctx):
rv = super().get_params(ctx)
rv.sort(key=lambda o: (not o.required, o.name))
return rv
def format_options(self, ctx, f... | import click
from typing import Sequence, Tuple
from click.formatting import measure_table, iter_rows
class OrderedCommand(click.Command):
def get_params(self, ctx):
rv = super().get_params(ctx)
rv.sort(key=lambda o: (not o.required, o.name))
return rv
def format_options(self, ctx, f... |
# Copyright 2012-2021 The Meson development 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... | # Copyright 2012-2021 The Meson development 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... |
# Copyright 2020 StreamSets 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 or agreed to in writi... | # Copyright 2020 StreamSets 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 or agreed to in writi... |
# https://github.com/theeko74/pdfc
# modified by brio50 on 2022/01/23, working with gs version 9.54.0
"""
Simple python wrapper script to use ghoscript function to compress PDF files.
Compression levels:
0: default
1: prepress
2: printer
3: ebook
4: screen
Dependency: Ghostscript.
On MacOSX insta... | # https://github.com/theeko74/pdfc
# modified by brio50 on 2022/01/23, working with gs version 9.54.0
"""
Simple python wrapper script to use ghoscript function to compress PDF files.
Compression levels:
0: default
1: prepress
2: printer
3: ebook
4: screen
Dependency: Ghostscript.
On MacOSX insta... |
from recyclus import Client
import time
def load(job):
print('saving cyclus.sqlite...')
client.save('cyclus.sqlite', job.jobid)
def wait_for_completion(job):
while True:
time.sleep(2)
resp = job.status()
if resp['status'] != 'ok':
print(f'Error:', resp['message'])
... | from recyclus import Client
import time
def load(job):
print('saving cyclus.sqlite...')
client.save('cyclus.sqlite', job.jobid)
def wait_for_completion(job):
while True:
time.sleep(2)
resp = job.status()
if resp['status'] != 'ok':
print(f'Error:', resp['message'])
... |
import importlib
import os
from datasets.hdf5 import get_test_loaders
from unet3d import utils
from unet3d.config import load_config
from unet3d.model import get_model
logger = utils.get_logger('UNet3DPredictor')
def _get_predictor(model, loader, output_file, config):
predictor_config = config.get('pr... | import importlib
import os
from datasets.hdf5 import get_test_loaders
from unet3d import utils
from unet3d.config import load_config
from unet3d.model import get_model
logger = utils.get_logger('UNet3DPredictor')
def _get_predictor(model, loader, output_file, config):
predictor_config = config.get('pr... |
"""fix_parser.py - parse V1.0 fixprotocol sbe xml files described
by xsd https://github.com/FIXTradingCommunity/
fix-simple-binary-encoding/blob/master/v1-0-STANDARD/resources/sbe.xsd
"""
import xml.etree.ElementTree as etree
from pysbe.schema.constants import (
SBE_TYPES_TYPE,
STRING_ENUM_MAP,
VAL... | """fix_parser.py - parse V1.0 fixprotocol sbe xml files described
by xsd https://github.com/FIXTradingCommunity/
fix-simple-binary-encoding/blob/master/v1-0-STANDARD/resources/sbe.xsd
"""
import xml.etree.ElementTree as etree
from pysbe.schema.constants import (
SBE_TYPES_TYPE,
STRING_ENUM_MAP,
VAL... |
# -*- coding: utf-8 -*-
"""
Benchmark Results
Updated: 18.02.2022 (6618fa3c36b0c9f3a9d7a21bcdb00bf4fd258ee8))
------------------------------------------------------------------------------------------
| Model | Batch Size | Epochs | KNN Test Accuracy | Time | Peak GPU Usage |
--------------------------... | # -*- coding: utf-8 -*-
"""
Benchmark Results
Updated: 18.02.2022 (6618fa3c36b0c9f3a9d7a21bcdb00bf4fd258ee8))
------------------------------------------------------------------------------------------
| Model | Batch Size | Epochs | KNN Test Accuracy | Time | Peak GPU Usage |
--------------------------... |
#%% First
import numpy as np
import json
import os
import pandas as pd
import requests
from contextlib import closing
import time
from datetime import datetime
from requests.models import HTTPBasicAuth
import seaborn as sns
from matplotlib import pyplot as plt
from requests import get
from requests_futures.sessions imp... | #%% First
import numpy as np
import json
import os
import pandas as pd
import requests
from contextlib import closing
import time
from datetime import datetime
from requests.models import HTTPBasicAuth
import seaborn as sns
from matplotlib import pyplot as plt
from requests import get
from requests_futures.sessions imp... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2018/10/31 0031 18:55
# @Author : Hadrianl
# @File : realtime_data_server
# 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
#
# ... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2018/10/31 0031 18:55
# @Author : Hadrianl
# @File : realtime_data_server
# 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
#
# ... |
import itertools
import logging
import warnings
from abc import abstractmethod
from collections import Counter
from pathlib import Path
from typing import Union, List, Tuple, Dict, Optional
import torch.nn
from torch.utils.data.dataset import Dataset
from tqdm import tqdm
import flair
from flair import file_utils
fro... | import itertools
import logging
import warnings
from abc import abstractmethod
from collections import Counter
from pathlib import Path
from typing import Union, List, Tuple, Dict, Optional
import torch.nn
from torch.utils.data.dataset import Dataset
from tqdm import tqdm
import flair
from flair import file_utils
fro... |
from pathlib import Path
from typing import List, Optional, Dict, Union, Tuple, Literal, Sequence, Any
import fsspec
import numpy as np
from xarray import DataArray
from dataclasses import asdict, dataclass
import json
from ..io.mrc import mrc_to_dask
from ..io import read
import dask.array as da
import dacite
from xar... | from pathlib import Path
from typing import List, Optional, Dict, Union, Tuple, Literal, Sequence, Any
import fsspec
import numpy as np
from xarray import DataArray
from dataclasses import asdict, dataclass
import json
from ..io.mrc import mrc_to_dask
from ..io import read
import dask.array as da
import dacite
from xar... |
'''
This is to fetch the tip table data for a telegram_id
Error Handling
==============
- /withdrawmemo tipuser11111 0.0001 TLOS pay_bill
- /withdrawmemo tipuser11111 0.00001 EOS pay_bill
{"code": 3050003, "name": "eosio_assert_message_exception", "what": "eosio_assert_message assertion failure"
, "details... | '''
This is to fetch the tip table data for a telegram_id
Error Handling
==============
- /withdrawmemo tipuser11111 0.0001 TLOS pay_bill
- /withdrawmemo tipuser11111 0.00001 EOS pay_bill
{"code": 3050003, "name": "eosio_assert_message_exception", "what": "eosio_assert_message assertion failure"
, "details... |
"""
Code for understanding type annotations.
This file contains functions that turn various representations of
Python type annotations into :class:`pyanalyze.value.Value` objects.
There are three major functions:
- :func:`type_from_runtime` takes a runtime Python object, for example
``type_from_value(int)`` -> ``... | """
Code for understanding type annotations.
This file contains functions that turn various representations of
Python type annotations into :class:`pyanalyze.value.Value` objects.
There are three major functions:
- :func:`type_from_runtime` takes a runtime Python object, for example
``type_from_value(int)`` -> ``... |
# -*- 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... |
import os
import copy
import pytest
import time
import shutil
import tempfile
import logging
from _pytest.logging import caplog as _caplog
from contextlib import suppress
from panoptes.utils.logging import logger
from panoptes.utils.database import PanDB
from panoptes.utils.config.client import get_config
from panopt... | import os
import copy
import pytest
import time
import shutil
import tempfile
import logging
from _pytest.logging import caplog as _caplog
from contextlib import suppress
from panoptes.utils.logging import logger
from panoptes.utils.database import PanDB
from panoptes.utils.config.client import get_config
from panopt... |
from datetime import datetime
from typing import Dict, List, Union
import numpy as np
from pydantic import Field, PyObject
from pymatgen.core.structure import Structure
from pymatgen.io.vasp.sets import VaspInputSet
from emmet.core.settings import EmmetSettings
from emmet.core.base import EmmetBaseModel
from emmet.co... | from datetime import datetime
from typing import Dict, List, Union
import numpy as np
from pydantic import Field, PyObject
from pymatgen.core.structure import Structure
from pymatgen.io.vasp.sets import VaspInputSet
from emmet.core.settings import EmmetSettings
from emmet.core.base import EmmetBaseModel
from emmet.co... |
import os
import json
import numpy as np
import itertools
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d.art3d import Line3DCollection
from mpl_toolkits import mplot3d
def liver_dump_init(env, name = None):
liver = {'x':[],'Fes':[],'Fis':[],'Ficp':[],'volume':[],'col_p_n':[],'crash':[]}
l... | import os
import json
import numpy as np
import itertools
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d.art3d import Line3DCollection
from mpl_toolkits import mplot3d
def liver_dump_init(env, name = None):
liver = {'x':[],'Fes':[],'Fis':[],'Ficp':[],'volume':[],'col_p_n':[],'crash':[]}
l... |
# Copyright (C) 2020 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.
#
import html
import json
import re
import textwrap
from io import BytesIO, StringIO
import aiohttp
import bs4
import j... | # Copyright (C) 2020 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.
#
import html
import json
import re
import textwrap
from io import BytesIO, StringIO
import aiohttp
import bs4
import j... |
# -*- coding: utf-8 -*-
# # How long does a Computron take?
#
# - [build model of computron\-to\-wallclock relationship · Issue \#3459 · Agoric/agoric\-sdk](https://github.com/Agoric/agoric-sdk/issues/3459)
# ## Preface: Python Data Tools
#
# See also [shell.nix](shell.nix).
# +
import pandas as pd
import numpy as n... | # -*- coding: utf-8 -*-
# # How long does a Computron take?
#
# - [build model of computron\-to\-wallclock relationship · Issue \#3459 · Agoric/agoric\-sdk](https://github.com/Agoric/agoric-sdk/issues/3459)
# ## Preface: Python Data Tools
#
# See also [shell.nix](shell.nix).
# +
import pandas as pd
import numpy as n... |
from flask import Blueprint, request, jsonify
import subprocess
import json
import yamale
import yaml
import app_conf
import logging.handlers
import mydb
imageinfo = Blueprint('imageinfo', __name__)
# set logger
logger = logging.getLogger(__name__)
path = f'./logs/{__name__}.log'
fileHandler = logging.handlers.Rotati... | from flask import Blueprint, request, jsonify
import subprocess
import json
import yamale
import yaml
import app_conf
import logging.handlers
import mydb
imageinfo = Blueprint('imageinfo', __name__)
# set logger
logger = logging.getLogger(__name__)
path = f'./logs/{__name__}.log'
fileHandler = logging.handlers.Rotati... |
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
# type: ignore
import copy
import os
import platform
from dataclasses import dataclass
from pathlib import Path
from typing import List
import nox
from nox.logger import logger
BASE = os.path.abspath(os.path.dirname(__file__))
DEFAULT_PYTHON_VERS... | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
# type: ignore
import copy
import os
import platform
from dataclasses import dataclass
from pathlib import Path
from typing import List
import nox
from nox.logger import logger
BASE = os.path.abspath(os.path.dirname(__file__))
DEFAULT_PYTHON_VERS... |
"""Tasks to help Robot Framework packaging and other development.
Executed by Invoke <http://pyinvoke.org>. Install it with `pip install invoke`
and run `invoke --help` and `invoke --list` for details how to execute tasks.
See BUILD.rst for packaging and releasing instructions.
"""
from pathlib import Path
from urll... | """Tasks to help Robot Framework packaging and other development.
Executed by Invoke <http://pyinvoke.org>. Install it with `pip install invoke`
and run `invoke --help` and `invoke --list` for details how to execute tasks.
See BUILD.rst for packaging and releasing instructions.
"""
from pathlib import Path
from urll... |
from __future__ import annotations
from typing import List, Tuple, Optional
from network_simulator.BloodType import BloodType
from network_simulator.compatibility_markers import OrganType
path_structure = Optional[List[Optional[int]]]
shortest_path_structure = Tuple[path_structure, float]
class Organ:
"""
... | from __future__ import annotations
from typing import List, Tuple, Optional
from network_simulator.BloodType import BloodType
from network_simulator.compatibility_markers import OrganType
path_structure = Optional[List[Optional[int]]]
shortest_path_structure = Tuple[path_structure, float]
class Organ:
"""
... |
import logging
import sys
from abc import ABC, abstractmethod
logger = logging.getLogger(__name__)
class PaddownException(Exception):
pass
class Paddown(ABC):
@abstractmethod
def has_valid_padding(self, ciphertext: bytes) -> bool:
"""
Override this method and send off the ciphertext to ... | import logging
import sys
from abc import ABC, abstractmethod
logger = logging.getLogger(__name__)
class PaddownException(Exception):
pass
class Paddown(ABC):
@abstractmethod
def has_valid_padding(self, ciphertext: bytes) -> bool:
"""
Override this method and send off the ciphertext to ... |
from typing import Tuple, Union
from discord import Embed, Member, PermissionOverwrite, TextChannel, VoiceChannel, VoiceState
from discord.ext.commands import bot_has_guild_permissions
from discord_slash import (
Button,
ComponentContext,
Modal,
ModalContext,
Select,
SelectOption,
SlashComm... | from typing import Tuple, Union
from discord import Embed, Member, PermissionOverwrite, TextChannel, VoiceChannel, VoiceState
from discord.ext.commands import bot_has_guild_permissions
from discord_slash import (
Button,
ComponentContext,
Modal,
ModalContext,
Select,
SelectOption,
SlashComm... |
from string import ascii_lowercase
import numpy as np
import pandas as pd
import plotly.graph_objects as go
from plotly.subplots import make_subplots
from plotly.colors import hex_to_rgb
from src.timeit import timeit
@timeit
def plotOverTime(FSCPData: pd.DataFrame, FSCPDataSteel: pd.DataFrame, config: dict):
#... | from string import ascii_lowercase
import numpy as np
import pandas as pd
import plotly.graph_objects as go
from plotly.subplots import make_subplots
from plotly.colors import hex_to_rgb
from src.timeit import timeit
@timeit
def plotOverTime(FSCPData: pd.DataFrame, FSCPDataSteel: pd.DataFrame, config: dict):
#... |
import os
import re
import uuid
import typing as t
import logging
import pathlib
import functools
from typing import TYPE_CHECKING
from distutils.dir_util import copy_tree
from simple_di import inject
from simple_di import Provide
import bentoml
from bentoml import Tag
from bentoml.exceptions import BentoMLException
... | import os
import re
import uuid
import typing as t
import logging
import pathlib
import functools
from typing import TYPE_CHECKING
from distutils.dir_util import copy_tree
from simple_di import inject
from simple_di import Provide
import bentoml
from bentoml import Tag
from bentoml.exceptions import BentoMLException
... |
"""A Couchbase CLI subcommand"""
import getpass
import inspect
import ipaddress
import json
import os
import platform
import random
import re
import string
import subprocess
import sys
import urllib.parse
import tempfile
import time
from typing import Optional, List, Any, Dict
from argparse import ArgumentError, Arg... | """A Couchbase CLI subcommand"""
import getpass
import inspect
import ipaddress
import json
import os
import platform
import random
import re
import string
import subprocess
import sys
import urllib.parse
import tempfile
import time
from typing import Optional, List, Any, Dict
from argparse import ArgumentError, Arg... |
'''
Preprocessor for Foliant documentation authoring tool.
Calls Elasticsearch API to generate an index based on Markdown content.
'''
import re
import json
from os import getenv
from pathlib import Path
from urllib import request
from urllib.error import HTTPError
from markdown import markdown
from bs4 import Beauti... | '''
Preprocessor for Foliant documentation authoring tool.
Calls Elasticsearch API to generate an index based on Markdown content.
'''
import re
import json
from os import getenv
from pathlib import Path
from urllib import request
from urllib.error import HTTPError
from markdown import markdown
from bs4 import Beauti... |
from sklearn.metrics import roc_curve, auc
import numpy as np
from sklearn.metrics import confusion_matrix
from sklearn.metrics import classification_report
import json
import pandas as pd
from pathlib import Path
import matplotlib.pyplot as plt
from pylab import rcParams
# rcParams['figure.figsize'] = 20, 20
rcParams... |
from sklearn.metrics import roc_curve, auc
import numpy as np
from sklearn.metrics import confusion_matrix
from sklearn.metrics import classification_report
import json
import pandas as pd
from pathlib import Path
import matplotlib.pyplot as plt
from pylab import rcParams
# rcParams['figure.figsize'] = 20, 20
rcParams... |
from typing import List
from flake8_functions_names.custom_types import FuncdefInfo
from flake8_functions_names.utils.imports import is_module_installed
from flake8_functions_names.words import VERBS, PURE_VERBS, BLACKLISTED_WORDS_IN_FUNCTIONS_NAMES
def validate_returns_bool_if_names_said_so(funcdef: FuncdefInfo) ->... | from typing import List
from flake8_functions_names.custom_types import FuncdefInfo
from flake8_functions_names.utils.imports import is_module_installed
from flake8_functions_names.words import VERBS, PURE_VERBS, BLACKLISTED_WORDS_IN_FUNCTIONS_NAMES
def validate_returns_bool_if_names_said_so(funcdef: FuncdefInfo) ->... |
import asyncio
import discord
from discord import Member, Role, TextChannel, DMChannel
from discord.ext import commands
from typing import Union
from profanity_check import predict
class ProfanityFilter:
"""
A simple filter that checks for profanity in a message and
then deletes it. Many profanity detec... | import asyncio
import discord
from discord import Member, Role, TextChannel, DMChannel
from discord.ext import commands
from typing import Union
from profanity_check import predict
class ProfanityFilter:
"""
A simple filter that checks for profanity in a message and
then deletes it. Many profanity detec... |
import paho.mqtt.client as mqtt
import time
import argparse
from tinydb import TinyDB, Query
from tinyrecord import transaction
import logging
import sys
import json
import threading
import ssl
from random import randint
CA_ROOT_CERT_FILE = "ag-certificate/AmazonRootCA1.pem"
THING_CERT_FILE = "ag-certificate/..."
THIN... | import paho.mqtt.client as mqtt
import time
import argparse
from tinydb import TinyDB, Query
from tinyrecord import transaction
import logging
import sys
import json
import threading
import ssl
from random import randint
CA_ROOT_CERT_FILE = "ag-certificate/AmazonRootCA1.pem"
THING_CERT_FILE = "ag-certificate/..."
THIN... |
import base64
def display_skills(skills):
result = []
for skill in skills:
base = f'''<img width ='22px' align='left' src ='{'https://raw.githubusercontent.com/rahulbanerjee26/githubAboutMeGenerator/main/icons/'+skill+'.svg'}'>'''
result.append(base)
return '\n'.join(result)
def display_so... | import base64
def display_skills(skills):
result = []
for skill in skills:
base = f'''<img width ='22px' align='left' src ='{'https://raw.githubusercontent.com/rahulbanerjee26/githubAboutMeGenerator/main/icons/'+skill+'.svg'}'>'''
result.append(base)
return '\n'.join(result)
def display_so... |
import datetime
import logging
import multiprocessing
import os
import re
import subprocess
import sys
import tempfile
import time
from typing import Any, Dict, List, Optional
import dateutil.parser
import pytest
import requests
from determined import experimental
from determined.common import api, yaml
from determin... | import datetime
import logging
import multiprocessing
import os
import re
import subprocess
import sys
import tempfile
import time
from typing import Any, Dict, List, Optional
import dateutil.parser
import pytest
import requests
from determined import experimental
from determined.common import api, yaml
from determin... |
import discord
from discord.ext import commands
import asyncio
import wolframalpha
from aiohttp import ClientSession
from html2text import html2text
from random import choice, randint
from re import sub
#setup wolframalpha API
client = wolframalpha.Client(open('WA_KEY').readline().rstrip())
class Api(commands.Cog):
... | import discord
from discord.ext import commands
import asyncio
import wolframalpha
from aiohttp import ClientSession
from html2text import html2text
from random import choice, randint
from re import sub
#setup wolframalpha API
client = wolframalpha.Client(open('WA_KEY').readline().rstrip())
class Api(commands.Cog):
... |
# specifically use concurrent.futures for threadsafety
# asyncio Futures cannot be used across threads
import asyncio
import json
import time
from functools import partial
from kubernetes_asyncio import watch
from traitlets import Any
from traitlets import Bool
from traitlets import Dict
from traitlets import Int
from... | # specifically use concurrent.futures for threadsafety
# asyncio Futures cannot be used across threads
import asyncio
import json
import time
from functools import partial
from kubernetes_asyncio import watch
from traitlets import Any
from traitlets import Bool
from traitlets import Dict
from traitlets import Int
from... |
from django.contrib.auth import get_user_model
from django.contrib.auth.hashers import make_password
from django.db import transaction
from rest_framework import exceptions, serializers
from care.facility.models import Facility, FacilityUser, READ_ONLY_USER_TYPES
from care.users.api.serializers.lsg import DistrictSeri... | from django.contrib.auth import get_user_model
from django.contrib.auth.hashers import make_password
from django.db import transaction
from rest_framework import exceptions, serializers
from care.facility.models import Facility, FacilityUser, READ_ONLY_USER_TYPES
from care.users.api.serializers.lsg import DistrictSeri... |
import re
import discord
from discord.ext import commands
from discord.ext.commands import clean_content
from Util import Configuration, GearbotLogging, Permissioncheckers, Translator, Utils
INVITE_MATCHER = re.compile(r"(?:https?:\/\/)?(?:www\.)?(?:discord\.(?:gg|io|me|li)|discordapp\.com\/invite)\/([\w|\d|-]+)", f... | import re
import discord
from discord.ext import commands
from discord.ext.commands import clean_content
from Util import Configuration, GearbotLogging, Permissioncheckers, Translator, Utils
INVITE_MATCHER = re.compile(r"(?:https?:\/\/)?(?:www\.)?(?:discord\.(?:gg|io|me|li)|discordapp\.com\/invite)\/([\w|\d|-]+)", f... |
from pathlib import Path
import tvm
from tvm import autotvm
from tvm import relay
from tvm.autotvm.tuner import GATuner
from tvm.autotvm.tuner import GridSearchTuner
from tvm.autotvm.tuner import RandomTuner
from tvm.autotvm.tuner import XGBTuner
from rl_tuner.ga_dqn_tuner import GADQNTuner
from rl_tuner.ga_dqn_tuner... | from pathlib import Path
import tvm
from tvm import autotvm
from tvm import relay
from tvm.autotvm.tuner import GATuner
from tvm.autotvm.tuner import GridSearchTuner
from tvm.autotvm.tuner import RandomTuner
from tvm.autotvm.tuner import XGBTuner
from rl_tuner.ga_dqn_tuner import GADQNTuner
from rl_tuner.ga_dqn_tuner... |
#!/usr/bin/env python3
#
# Extract a CSV of findings for a particular bucket
#
import boto3
from botocore.exceptions import ClientError
import json
import os
import time
import csv
from time import sleep
from datetime import datetime
import logging
logger = logging.getLogger()
logger.setLevel(logging.INFO)
logging.... | #!/usr/bin/env python3
#
# Extract a CSV of findings for a particular bucket
#
import boto3
from botocore.exceptions import ClientError
import json
import os
import time
import csv
from time import sleep
from datetime import datetime
import logging
logger = logging.getLogger()
logger.setLevel(logging.INFO)
logging.... |
import dataclasses
import re
import textwrap
from typing import Optional, Iterable, List, Match, Pattern, Tuple, Type, TypeVar, Union
def add_line_prefix(s: str, prefix: str, /, empty_lines=False) -> str:
if empty_lines:
predicate = lambda line: True
else:
predicate = None
return textwrap... | import dataclasses
import re
import textwrap
from typing import Optional, Iterable, List, Match, Pattern, Tuple, Type, TypeVar, Union
def add_line_prefix(s: str, prefix: str, /, empty_lines=False) -> str:
if empty_lines:
predicate = lambda line: True
else:
predicate = None
return textwrap... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys
import json
import os
from pymisp import ExpandedPyMISP
from settings import url, key, ssl, outputdir, filters, valid_attribute_distribution_levels
try:
from settings import with_distribution
except ImportError:
with_distribution = False
try:
from ... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys
import json
import os
from pymisp import ExpandedPyMISP
from settings import url, key, ssl, outputdir, filters, valid_attribute_distribution_levels
try:
from settings import with_distribution
except ImportError:
with_distribution = False
try:
from ... |
# AUTOGENERATED! DO NOT EDIT! File to edit: nbs/13a_learner.ipynb (unless otherwise specified).
__all__ = ['CancelFitException', 'CancelEpochException', 'CancelTrainException', 'CancelValidException',
'CancelBatchException', 'replacing_yield', 'mk_metric', 'save_model', 'load_model', 'Learner',
'... | # AUTOGENERATED! DO NOT EDIT! File to edit: nbs/13a_learner.ipynb (unless otherwise specified).
__all__ = ['CancelFitException', 'CancelEpochException', 'CancelTrainException', 'CancelValidException',
'CancelBatchException', 'replacing_yield', 'mk_metric', 'save_model', 'load_model', 'Learner',
'... |
##
## © Copyright 2021- IBM Inc. All rights reserved
# SPDX-License-Identifier: MIT
##
#
# This code has two use-cases:
# 1. Where you want to run a batch of queries, with each saving results in CSV - specify the TestId this is added to make filename))
# 2. When you want to run a series of queries and check the data ... | ##
## © Copyright 2021- IBM Inc. All rights reserved
# SPDX-License-Identifier: MIT
##
#
# This code has two use-cases:
# 1. Where you want to run a batch of queries, with each saving results in CSV - specify the TestId this is added to make filename))
# 2. When you want to run a series of queries and check the data ... |
#!/usr/bin/env python
# GenerateJSONOutput.py
#
# Command-line interface for turning output root files into JSON files for further processing.
#
# By: Larry Lee - Dec 2017
import argparse
import sys
import os
import ROOT
ROOT.gSystem.Load(f"{os.getenv("HISTFITTER")}/lib/libSusyFitter.so")
ROOT.gROOT.SetBatch()
pa... | #!/usr/bin/env python
# GenerateJSONOutput.py
#
# Command-line interface for turning output root files into JSON files for further processing.
#
# By: Larry Lee - Dec 2017
import argparse
import sys
import os
import ROOT
ROOT.gSystem.Load(f"{os.getenv('HISTFITTER')}/lib/libSusyFitter.so")
ROOT.gROOT.SetBatch()
pa... |
import os
import sys
import time
import random
import string
import argparse
import torch
import torch.backends.cudnn as cudnn
import torch.nn.init as init
import torch.optim as optim
import torch.utils.data
import numpy as np
from utils import CTCLabelConverter, AttnLabelConverter, Averager
from dataset import hiera... | import os
import sys
import time
import random
import string
import argparse
import torch
import torch.backends.cudnn as cudnn
import torch.nn.init as init
import torch.optim as optim
import torch.utils.data
import numpy as np
from utils import CTCLabelConverter, AttnLabelConverter, Averager
from dataset import hiera... |
__package__ = "blackhat.bin.installable"
from ...helpers import Result
from ...lib.input import ArgParser
from ...lib.output import output
from ...lib.ifaddrs import getifaddrs
__COMMAND__ = "ifconfig"
__DESCRIPTION__ = ""
__DESCRIPTION_LONG__ = ""
__VERSION__ = "1.2"
def parse_args(args=[], doc=False):
"""
... | __package__ = "blackhat.bin.installable"
from ...helpers import Result
from ...lib.input import ArgParser
from ...lib.output import output
from ...lib.ifaddrs import getifaddrs
__COMMAND__ = "ifconfig"
__DESCRIPTION__ = ""
__DESCRIPTION_LONG__ = ""
__VERSION__ = "1.2"
def parse_args(args=[], doc=False):
"""
... |
# ---------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# ---------------------------------------------------------
import re
from azure.ai.ml._ml_exceptions import MlException, ErrorCategory, ErrorTarget
class JobParsingError(MlException):
"""Excep... | # ---------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# ---------------------------------------------------------
import re
from azure.ai.ml._ml_exceptions import MlException, ErrorCategory, ErrorTarget
class JobParsingError(MlException):
"""Excep... |
{"filter":false,"title":"kabutan_scraping.py","tooltip":"/kabutan_scraping.py","undoManager":{"mark":100,"position":100,"stack":[[{"start":{"row":3,"column":0},"end":{"row":4,"column":0},"action":"insert","lines":["",""],"id":2},{"start":{"row":4,"column":0},"end":{"row":5,"column":0},"action":"insert","lines":["",""]}... | {"filter":false,"title":"kabutan_scraping.py","tooltip":"/kabutan_scraping.py","undoManager":{"mark":100,"position":100,"stack":[[{"start":{"row":3,"column":0},"end":{"row":4,"column":0},"action":"insert","lines":["",""],"id":2},{"start":{"row":4,"column":0},"end":{"row":5,"column":0},"action":"insert","lines":["",""]}... |
from discord.ext import commands, tasks
from collections import Counter, defaultdict
from .utils import checks, db, time, formats
from .utils.paginator import CannotPaginate
import pkg_resources
import logging
import discord
import textwrap
import datetime
import traceback
import itertools
import typing
import asyncp... | from discord.ext import commands, tasks
from collections import Counter, defaultdict
from .utils import checks, db, time, formats
from .utils.paginator import CannotPaginate
import pkg_resources
import logging
import discord
import textwrap
import datetime
import traceback
import itertools
import typing
import asyncp... |
import json
import os
from time import sleep
import requests
import pyrominfo.pyrominfo.snes as snes
from shutil import copy
from pyrominfo.pyrominfo import nintendo64
def n64_info(filename):
n64_parser = nintendo64.Nintendo64Parser()
props = n64_parser.parse(filename)
return props
def snes_info(filen... | import json
import os
from time import sleep
import requests
import pyrominfo.pyrominfo.snes as snes
from shutil import copy
from pyrominfo.pyrominfo import nintendo64
def n64_info(filename):
n64_parser = nintendo64.Nintendo64Parser()
props = n64_parser.parse(filename)
return props
def snes_info(filen... |
import requests
from bs4 import BeautifulSoup
import jinja2
import re
class Chara:
name = ''
job = ''
hp = 0
mp = 0
str = 0
end = 0
dex = 0
agi = 0
mag = 0
killer = ""
counter_hp = ""
skills = ""
passive_skills = ""
class HtmlParser:
def __init__(self, text):
... | import requests
from bs4 import BeautifulSoup
import jinja2
import re
class Chara:
name = ''
job = ''
hp = 0
mp = 0
str = 0
end = 0
dex = 0
agi = 0
mag = 0
killer = ""
counter_hp = ""
skills = ""
passive_skills = ""
class HtmlParser:
def __init__(self, text):
... |
"""
hubspot engagements api
"""
from hubspot3.base import BaseClient
from hubspot3.utils import get_log
from typing import Dict, List
ENGAGEMENTS_API_VERSION = "1"
class EngagementsClient(BaseClient):
"""
The hubspot3 Engagements client uses the _make_request method to call the API
for data. It returns... | """
hubspot engagements api
"""
from hubspot3.base import BaseClient
from hubspot3.utils import get_log
from typing import Dict, List
ENGAGEMENTS_API_VERSION = "1"
class EngagementsClient(BaseClient):
"""
The hubspot3 Engagements client uses the _make_request method to call the API
for data. It returns... |
from ib_tws_server.codegen.generator_utils import GeneratorUtils
from ib_tws_server.api_definition import *
from ib_tws_server.codegen.generator_utils import *
import inspect
def forward_method_parameters_dict_style(params: List[inspect.Parameter]) -> str:
return ",".join([ f"{v.name} = {v.name}" for v in params ]... | from ib_tws_server.codegen.generator_utils import GeneratorUtils
from ib_tws_server.api_definition import *
from ib_tws_server.codegen.generator_utils import *
import inspect
def forward_method_parameters_dict_style(params: List[inspect.Parameter]) -> str:
return ",".join([ f"{v.name} = {v.name}" for v in params ]... |
import logging
from abc import abstractmethod
from .input import Input
from .input_config import assert_keycode_list
class Switch(Input):
"""Switch input class
Implement custom on() and off() logic
Read more about defaults from input_config.py
"""
def validate_defaults(self, defaults):
... | import logging
from abc import abstractmethod
from .input import Input
from .input_config import assert_keycode_list
class Switch(Input):
"""Switch input class
Implement custom on() and off() logic
Read more about defaults from input_config.py
"""
def validate_defaults(self, defaults):
... |
# This script is used to parse BOOST special function test data into something
# we can easily import in numpy.
import re
import os
# Where to put the data (directory will be created)
DATA_DIR = 'scipy/special/tests/data/boost'
# Where to pull out boost data
BOOST_SRC = "boostmath/test"
CXX_COMMENT = re.compile(r'^\s... | # This script is used to parse BOOST special function test data into something
# we can easily import in numpy.
import re
import os
# Where to put the data (directory will be created)
DATA_DIR = 'scipy/special/tests/data/boost'
# Where to pull out boost data
BOOST_SRC = "boostmath/test"
CXX_COMMENT = re.compile(r'^\s... |
import sys
import cv2
import os
from ast import literal_eval
from pathlib import Path
import shutil
import logging
import random
import pickle
import yaml
import subprocess
from PIL import Image
from glob import glob
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from matplotlib import animatio... | import sys
import cv2
import os
from ast import literal_eval
from pathlib import Path
import shutil
import logging
import random
import pickle
import yaml
import subprocess
from PIL import Image
from glob import glob
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from matplotlib import animatio... |
# IDLSave - a python module to read IDL 'save' files
# Copyright (c) 2010 Thomas P. Robitaille
# Many thanks to Craig Markwardt for publishing the Unofficial Format
# Specification for IDL .sav files, without which this Python module would not
# exist (http://cow.physics.wisc.edu/~craigm/idl/savefmt).
# This code was... | # IDLSave - a python module to read IDL 'save' files
# Copyright (c) 2010 Thomas P. Robitaille
# Many thanks to Craig Markwardt for publishing the Unofficial Format
# Specification for IDL .sav files, without which this Python module would not
# exist (http://cow.physics.wisc.edu/~craigm/idl/savefmt).
# This code was... |
# Copyright (C) 2019 The Raphielscape Company LLC.
#
# Licensed under the Raphielscape Public License, Version 1.c (the "License");
# you may not use this file except in compliance with the License.
#
""" Userbot module containing various sites direct links generators"""
from subprocess import PIPE, Popen
import re
im... | # Copyright (C) 2019 The Raphielscape Company LLC.
#
# Licensed under the Raphielscape Public License, Version 1.c (the "License");
# you may not use this file except in compliance with the License.
#
""" Userbot module containing various sites direct links generators"""
from subprocess import PIPE, Popen
import re
im... |
"""Test the UniFi Protect switch platform."""
# pylint: disable=protected-access
from __future__ import annotations
from unittest.mock import AsyncMock, Mock
import pytest
from pyunifiprotect.data import (
Camera,
Light,
RecordingMode,
SmartDetectObjectType,
VideoMode,
)
from homeassistant.compon... | """Test the UniFi Protect switch platform."""
# pylint: disable=protected-access
from __future__ import annotations
from unittest.mock import AsyncMock, Mock
import pytest
from pyunifiprotect.data import (
Camera,
Light,
RecordingMode,
SmartDetectObjectType,
VideoMode,
)
from homeassistant.compon... |
import logging
import threading
import time
import traceback
from dataclasses import dataclass
from functools import reduce
from pathlib import Path
from typing import Dict, List, Optional, Set, Tuple, Union
from concurrent.futures.thread import ThreadPoolExecutor
from blspy import G1Element, PrivateKey
from chiapos i... | import logging
import threading
import time
import traceback
from dataclasses import dataclass
from functools import reduce
from pathlib import Path
from typing import Dict, List, Optional, Set, Tuple, Union
from concurrent.futures.thread import ThreadPoolExecutor
from blspy import G1Element, PrivateKey
from chiapos i... |
"""Extract data from transcription format."""
import sys
import datetime
import io
import pathlib
import tabulate
import pandas as pd
from . import config
substitution_keys = ("*", "+", "^", "&", "$", "%")
def process_source(game, value):
title, d = (x.strip() for x in value.split(",", 1))
d = datetime.da... | """Extract data from transcription format."""
import sys
import datetime
import io
import pathlib
import tabulate
import pandas as pd
from . import config
substitution_keys = ("*", "+", "^", "&", "$", "%")
def process_source(game, value):
title, d = (x.strip() for x in value.split(",", 1))
d = datetime.da... |
import time
from datetime import datetime, timedelta
from urllib.parse import urljoin
import requests
from bs4 import BeautifulSoup
from flask.views import MethodView
from config.setting import BOT_TOKEN
from models import User
hitcon_zeroday_base_url = "https://zeroday.hitcon.org"
hitcon_zeroday_all_url = "https://... | import time
from datetime import datetime, timedelta
from urllib.parse import urljoin
import requests
from bs4 import BeautifulSoup
from flask.views import MethodView
from config.setting import BOT_TOKEN
from models import User
hitcon_zeroday_base_url = "https://zeroday.hitcon.org"
hitcon_zeroday_all_url = "https://... |
import abc
from collections import Counter
from contextlib import suppress
from dataclasses import dataclass
from datetime import datetime, timedelta, timezone
from typing import Union
import discord
from discord.ext import commands, tasks
from discord.ext.events.utils import fetch_recent_audit_log_entry
from discord.... | import abc
from collections import Counter
from contextlib import suppress
from dataclasses import dataclass
from datetime import datetime, timedelta, timezone
from typing import Union
import discord
from discord.ext import commands, tasks
from discord.ext.events.utils import fetch_recent_audit_log_entry
from discord.... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
币安推荐码: 返佣10%
https://www.binancezh.pro/cn/register?ref=AIR1GC70
币安合约推荐码: 返佣10%
https://www.binancezh.com/cn/futures/ref/51bitquant
if you don't have a binance account, you can use the invitation link to register one:
https://www.binancezh.com/... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
币安推荐码: 返佣10%
https://www.binancezh.pro/cn/register?ref=AIR1GC70
币安合约推荐码: 返佣10%
https://www.binancezh.com/cn/futures/ref/51bitquant
if you don't have a binance account, you can use the invitation link to register one:
https://www.binancezh.com/... |
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... | # Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... |
import os
import os.path as osp
import pickle
import random
from collections import deque
from datetime import datetime
import gym
import numpy as np
import scipy.stats as stats
import torch
import torch.optim as optim
from mpi4py import MPI
import dr
from dr.ppo.models import Policy, ValueNet
from dr.ppo.train impor... | import os
import os.path as osp
import pickle
import random
from collections import deque
from datetime import datetime
import gym
import numpy as np
import scipy.stats as stats
import torch
import torch.optim as optim
from mpi4py import MPI
import dr
from dr.ppo.models import Policy, ValueNet
from dr.ppo.train impor... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.