edited_code stringlengths 17 978k | original_code stringlengths 17 978k |
|---|---|
import click
import progressbar
import python_freeipa
from collections import defaultdict
from typing import Any, Dict, List
from .status import Status, print_status
from .utils import ObjectManager
class Groups(ObjectManager):
def __init__(self, *args, agreements, **kwargs):
super().__init__(*args, **kw... | import click
import progressbar
import python_freeipa
from collections import defaultdict
from typing import Any, Dict, List
from .status import Status, print_status
from .utils import ObjectManager
class Groups(ObjectManager):
def __init__(self, *args, agreements, **kwargs):
super().__init__(*args, **kw... |
import tensorflow as tf
#import tensorflow_hub as hub
import numpy as np
#import cv2
import zipfile
import json
import lzma
import os
import telenet.dataset_data as tn_data
from telenet.utils import load_image_for_vrd_yolo, mdl_yolo, parse_yolo_results
from telenet.config import get as tn_config
from tqdm import tqdm
... | import tensorflow as tf
#import tensorflow_hub as hub
import numpy as np
#import cv2
import zipfile
import json
import lzma
import os
import telenet.dataset_data as tn_data
from telenet.utils import load_image_for_vrd_yolo, mdl_yolo, parse_yolo_results
from telenet.config import get as tn_config
from tqdm import tqdm
... |
from typing import List, Tuple, Union, Dict
from .base import Task
from backprop.models import BaseModel, AutoModel
from transformers.optimization import Adafactor
from backprop.utils.datasets import TextToTextDataset
import requests
TASK = "emotion"
DEFAULT_LOCAL_MODEL = "t5-base-qa-summary-emotion"
LOCAL_ALIASES ... | from typing import List, Tuple, Union, Dict
from .base import Task
from backprop.models import BaseModel, AutoModel
from transformers.optimization import Adafactor
from backprop.utils.datasets import TextToTextDataset
import requests
TASK = "emotion"
DEFAULT_LOCAL_MODEL = "t5-base-qa-summary-emotion"
LOCAL_ALIASES ... |
import datetime
import json
import os
import sys
import time
import googleapiclient
from gam.var import *
import gam
from gam import controlflow
from gam import display
from gam import fileutils
from gam import gapi
from gam.gapi import directory as gapi_directory
from gam.gapi import errors as gapi_errors
from gam.g... | import datetime
import json
import os
import sys
import time
import googleapiclient
from gam.var import *
import gam
from gam import controlflow
from gam import display
from gam import fileutils
from gam import gapi
from gam.gapi import directory as gapi_directory
from gam.gapi import errors as gapi_errors
from gam.g... |
#!/usr/bin/env python3
import os
import gym
import torch
import datetime
import argparse
import numpy as np
from torch import nn
from torch.optim.lr_scheduler import LambdaLR
from torch.utils.tensorboard import SummaryWriter
from torch.distributions import Independent, Normal
from tianshou.policy import PGPolicy
from... | #!/usr/bin/env python3
import os
import gym
import torch
import datetime
import argparse
import numpy as np
from torch import nn
from torch.optim.lr_scheduler import LambdaLR
from torch.utils.tensorboard import SummaryWriter
from torch.distributions import Independent, Normal
from tianshou.policy import PGPolicy
from... |
# -*- coding: utf8 -*-
# @rhming
import json
import re,time,logging
import requests
import login
from random import randint
# from utils import jsonencode as json
from utils.toutiao_reward import TouTiao
from utils.jifen import encrypt_req_params, encrypt_free_login_params
class blindBox:
def _init... | # -*- coding: utf8 -*-
# @rhming
import json
import re,time,logging
import requests
import login
from random import randint
# from utils import jsonencode as json
from utils.toutiao_reward import TouTiao
from utils.jifen import encrypt_req_params, encrypt_free_login_params
class blindBox:
def _init... |
import errno
import json
import logging
import os
import os.path
from collections import defaultdict, namedtuple
from contextlib import contextmanager
from datetime import datetime
from functools import partial
from itertools import groupby
import attr
from memoized import memoized
from sqlalchemy import (
Column,... | import errno
import json
import logging
import os
import os.path
from collections import defaultdict, namedtuple
from contextlib import contextmanager
from datetime import datetime
from functools import partial
from itertools import groupby
import attr
from memoized import memoized
from sqlalchemy import (
Column,... |
import os
import contextlib
import tarfile
import json
import numpy as np
import PIL
import torch
from common_utils import get_tmp_dir
import pickle
import random
from itertools import cycle
from torchvision.io.video import write_video
import unittest.mock
import hashlib
from distutils import dir_util
import re
def m... | import os
import contextlib
import tarfile
import json
import numpy as np
import PIL
import torch
from common_utils import get_tmp_dir
import pickle
import random
from itertools import cycle
from torchvision.io.video import write_video
import unittest.mock
import hashlib
from distutils import dir_util
import re
def m... |
import json, requests, datetime
item = 'HOT_POTATO_BOOK'
r = requests.get(f"https://api.hypixel.net/skyblock/bazaar/product?key=7e8355c8-a50b-4473-ba41-b03d0473a0d8&productId={item}").json()
for i in r['product_info']['week_historic']:
time = datetime.datetime.fromtimestamp(i['timestamp']/1000).strftime("%a, %H:%... | import json, requests, datetime
item = 'HOT_POTATO_BOOK'
r = requests.get(f"https://api.hypixel.net/skyblock/bazaar/product?key=7e8355c8-a50b-4473-ba41-b03d0473a0d8&productId={item}").json()
for i in r['product_info']['week_historic']:
time = datetime.datetime.fromtimestamp(i['timestamp']/1000).strftime("%a, %H:%... |
"""Definition and setup of the SpaceX Binary Sensors for Home Assistant."""
import logging
import time
import datetime
from homeassistant.util.dt import as_local, utc_from_timestamp
from homeassistant.components.sensor import ENTITY_ID_FORMAT, DEVICE_CLASS_TIMESTAMP
from homeassistant.const import LENGTH_KILOMETERS, ... | """Definition and setup of the SpaceX Binary Sensors for Home Assistant."""
import logging
import time
import datetime
from homeassistant.util.dt import as_local, utc_from_timestamp
from homeassistant.components.sensor import ENTITY_ID_FORMAT, DEVICE_CLASS_TIMESTAMP
from homeassistant.const import LENGTH_KILOMETERS, ... |
"""Tests for the unparse.py script in the Tools/parser directory."""
import unittest
import test.support
import pathlib
import random
import tokenize
import ast
def read_pyfile(filename):
"""Read and return the contents of a Python source file (as a
string), taking into account the file encoding."""
with... | """Tests for the unparse.py script in the Tools/parser directory."""
import unittest
import test.support
import pathlib
import random
import tokenize
import ast
def read_pyfile(filename):
"""Read and return the contents of a Python source file (as a
string), taking into account the file encoding."""
with... |
"""
The ``python_function`` model flavor serves as a default model interface for MLflow Python models.
Any MLflow Python model is expected to be loadable as a ``python_function`` model.
In addition, the ``mlflow.pyfunc`` module defines a generic :ref:`filesystem format
<pyfunc-filesystem-format>` for Python models and... | """
The ``python_function`` model flavor serves as a default model interface for MLflow Python models.
Any MLflow Python model is expected to be loadable as a ``python_function`` model.
In addition, the ``mlflow.pyfunc`` module defines a generic :ref:`filesystem format
<pyfunc-filesystem-format>` for Python models and... |
""" Script for cleaning data for 12 month evaluation. """
import os
import re
import sys
import numpy as np
import pandas as pd
from pprint import pprint
from glob import glob
from typing import List, Dict
from delphi.utils.shell import cd
from delphi.paths import data_dir, south_sudan_data
from delphi.utils.fp import... | """ Script for cleaning data for 12 month evaluation. """
import os
import re
import sys
import numpy as np
import pandas as pd
from pprint import pprint
from glob import glob
from typing import List, Dict
from delphi.utils.shell import cd
from delphi.paths import data_dir, south_sudan_data
from delphi.utils.fp import... |
# coding=utf-8
# Copyright 2021 Google Research and The HuggingFace Inc. team. 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/LICE... | # coding=utf-8
# Copyright 2021 Google Research and The HuggingFace Inc. team. 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/LICE... |
"""Provide the Reddit class."""
import asyncio
import configparser
import os
import re
import time
from itertools import islice
from logging import getLogger
from typing import (
IO,
TYPE_CHECKING,
Any,
Dict,
Generator,
Iterable,
Optional,
Type,
Union,
)
from warnings import warn
fr... | """Provide the Reddit class."""
import asyncio
import configparser
import os
import re
import time
from itertools import islice
from logging import getLogger
from typing import (
IO,
TYPE_CHECKING,
Any,
Dict,
Generator,
Iterable,
Optional,
Type,
Union,
)
from warnings import warn
fr... |
# SPDX-License-Identifier: BSD-3-Clause
# Copyright (c) 2020 Intel Corporation
import os
import time
from fastapi.testclient import TestClient
from onecontainer_api import models, schemas, config, startup_svc
from onecontainer_api.frontend import app
web_server_port = 80
rtmp_server_port = 1935
for svc in config.IN... | # SPDX-License-Identifier: BSD-3-Clause
# Copyright (c) 2020 Intel Corporation
import os
import time
from fastapi.testclient import TestClient
from onecontainer_api import models, schemas, config, startup_svc
from onecontainer_api.frontend import app
web_server_port = 80
rtmp_server_port = 1935
for svc in config.IN... |
import datetime
import math
import sys
from functools import partial
import numpy as np
import pandas as pd
import pytest
from pandas.util.testing import assert_frame_equal
from pandas.util.testing import assert_series_equal
from sklearn.pipeline import Pipeline
from greykite.common import constants as cst
from greyk... | import datetime
import math
import sys
from functools import partial
import numpy as np
import pandas as pd
import pytest
from pandas.util.testing import assert_frame_equal
from pandas.util.testing import assert_series_equal
from sklearn.pipeline import Pipeline
from greykite.common import constants as cst
from greyk... |
import argparse
import base64
import json
import random
from datetime import datetime, timezone, timedelta
from functools import partial
from typing import List, Dict, Union, NamedTuple, Optional, Callable, Set
import requests
from uqcsbot import bot, Command
from uqcsbot.api import Channel
from uqcsbot.utils.command... | import argparse
import base64
import json
import random
from datetime import datetime, timezone, timedelta
from functools import partial
from typing import List, Dict, Union, NamedTuple, Optional, Callable, Set
import requests
from uqcsbot import bot, Command
from uqcsbot.api import Channel
from uqcsbot.utils.command... |
from datetime import datetime
import click
from tools import background, nasa_api
from tools.utils import parse_str_to_date
@click.group()
def nasa_background():
pass
@nasa_background.command()
@click.option("--date",
default=None,
help="Enter the date as a single string in YYYYMMD... | from datetime import datetime
import click
from tools import background, nasa_api
from tools.utils import parse_str_to_date
@click.group()
def nasa_background():
pass
@nasa_background.command()
@click.option("--date",
default=None,
help="Enter the date as a single string in YYYYMMD... |
from django.shortcuts import render, redirect, get_object_or_404
from django.contrib import messages
from django.contrib.auth.decorators import login_required
from django.utils.decorators import method_decorator
from django.http import HttpResponseRedirect
from django.contrib.auth.mixins import LoginRequiredMixin, User... | from django.shortcuts import render, redirect, get_object_or_404
from django.contrib import messages
from django.contrib.auth.decorators import login_required
from django.utils.decorators import method_decorator
from django.http import HttpResponseRedirect
from django.contrib.auth.mixins import LoginRequiredMixin, User... |
"""
Command-line user interface.
"""
import argparse
import sys
from map_machine import __version__
from map_machine.map_configuration import BuildingMode, DrawingMode, LabelMode
from map_machine.osm.osm_reader import STAGES_OF_DECAY
__author__ = "Sergey Vartanov"
__email__ = "me@enzet.ru"
BOXES: str = " ▏▎▍▌▋▊▉"
BO... | """
Command-line user interface.
"""
import argparse
import sys
from map_machine import __version__
from map_machine.map_configuration import BuildingMode, DrawingMode, LabelMode
from map_machine.osm.osm_reader import STAGES_OF_DECAY
__author__ = "Sergey Vartanov"
__email__ = "me@enzet.ru"
BOXES: str = " ▏▎▍▌▋▊▉"
BO... |
# coding=utf-8
# Copyright 2020-present the HuggingFace Inc. team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ap... | # coding=utf-8
# Copyright 2020-present the HuggingFace Inc. team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ap... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
__copyright__ = """
MIT License
Copyright (c) 2021 Samapriya Roy
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... | #!/usr/bin/python
# -*- coding: utf-8 -*-
__copyright__ = """
MIT License
Copyright (c) 2021 Samapriya Roy
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... |
"""
Meteostat JSON API Server
The code is licensed under the MIT license.
"""
from datetime import datetime
import json
from flask import abort
from meteostat import Point, Monthly, units
from server import app, utils
"""
Meteostat configuration
"""
Point.radius = 120000
Monthly.threads = 4
Monthly.autoclean = Fals... | """
Meteostat JSON API Server
The code is licensed under the MIT license.
"""
from datetime import datetime
import json
from flask import abort
from meteostat import Point, Monthly, units
from server import app, utils
"""
Meteostat configuration
"""
Point.radius = 120000
Monthly.threads = 4
Monthly.autoclean = Fals... |
MENU = {
"espresso": {
"ingredients": {
"water": 50,
"coffee": 18,
},
"cost": 15.5,
},
"latte": {
"ingredients": {
"water": 200,
"milk": 150,
"coffee": 24,
},
"cost": 20.0,
},
... | MENU = {
"espresso": {
"ingredients": {
"water": 50,
"coffee": 18,
},
"cost": 15.5,
},
"latte": {
"ingredients": {
"water": 200,
"milk": 150,
"coffee": 24,
},
"cost": 20.0,
},
... |
# -*- coding: utf-8 -*-
# (C) Copyright IBM Corp. 2021.
#
# 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 l... | # -*- coding: utf-8 -*-
# (C) Copyright IBM Corp. 2021.
#
# 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 l... |
from collections import namedtuple
from functools import update_wrapper
from typing import (
TYPE_CHECKING,
AbstractSet,
Any,
Callable,
Dict,
List,
Optional,
Union,
cast,
overload,
)
from dagster import check
from dagster.core.definitions.config import is_callable_valid_config_a... | from collections import namedtuple
from functools import update_wrapper
from typing import (
TYPE_CHECKING,
AbstractSet,
Any,
Callable,
Dict,
List,
Optional,
Union,
cast,
overload,
)
from dagster import check
from dagster.core.definitions.config import is_callable_valid_config_a... |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import logging
import multiprocessing
from collections import deque
from contextlib import contextmanager
from enum import Enum
from itertools ... | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import logging
import multiprocessing
from collections import deque
from contextlib import contextmanager
from enum import Enum
from itertools ... |
# SPDX-FileCopyrightText: 2017 Fermi Research Alliance, LLC
# SPDX-License-Identifier: Apache-2.0
"""
Code not written by us
"""
import os
import sqlalchemy
import structlog
from decisionengine.framework.modules.logging_configDict import LOGGERNAME
__all__ = ["orm_as_dict", "clone_model", "add_engine_pidguard"]... | # SPDX-FileCopyrightText: 2017 Fermi Research Alliance, LLC
# SPDX-License-Identifier: Apache-2.0
"""
Code not written by us
"""
import os
import sqlalchemy
import structlog
from decisionengine.framework.modules.logging_configDict import LOGGERNAME
__all__ = ["orm_as_dict", "clone_model", "add_engine_pidguard"]... |
from flask import Blueprint, redirect, url_for, render_template, request, session
from src.constants.model_params import Ridge_Params, Lasso_Params, ElasticNet_Params, RandomForestRegressor_Params, \
SVR_params, AdabootRegressor_Params, \
GradientBoostRegressor_Params
from src.constants.model_params import Kmea... | from flask import Blueprint, redirect, url_for, render_template, request, session
from src.constants.model_params import Ridge_Params, Lasso_Params, ElasticNet_Params, RandomForestRegressor_Params, \
SVR_params, AdabootRegressor_Params, \
GradientBoostRegressor_Params
from src.constants.model_params import Kmea... |
import os
import time
import ujson as json
import torch
import sys
import pickle
import numpy as np
from torch.utils.data import Dataset
import torch.distributed as dist
import torch.nn.functional as F
from bootleg.symbols.alias_entity_table import AliasEntityTable
from bootleg.symbols.constants import *
from bootleg.... | import os
import time
import ujson as json
import torch
import sys
import pickle
import numpy as np
from torch.utils.data import Dataset
import torch.distributed as dist
import torch.nn.functional as F
from bootleg.symbols.alias_entity_table import AliasEntityTable
from bootleg.symbols.constants import *
from bootleg.... |
import matplotlib.pyplot as plt
import numpy as np
import seaborn as sns
import pandas as pd
import json
import glob
import os
import argparse
from typing import Tuple, Union, List
from collections import Counter
from tqdm import tqdm
from multiprocessing import Pool
pd.options.mode.chained_assignment = None # defa... | import matplotlib.pyplot as plt
import numpy as np
import seaborn as sns
import pandas as pd
import json
import glob
import os
import argparse
from typing import Tuple, Union, List
from collections import Counter
from tqdm import tqdm
from multiprocessing import Pool
pd.options.mode.chained_assignment = None # defa... |
from gpiozero import CPUTemperature
from tabulate import tabulate
from math import floor
import numpy as np
import termplotlib as tpl
import time
import shutil
def roundNum(num, digits):
return floor(num * 10 ** digits) / (10 ** digits)
def CtoF(temp):
fahrenheit = (temp + 1.8) + 32
rounded = roundNum(fah... | from gpiozero import CPUTemperature
from tabulate import tabulate
from math import floor
import numpy as np
import termplotlib as tpl
import time
import shutil
def roundNum(num, digits):
return floor(num * 10 ** digits) / (10 ** digits)
def CtoF(temp):
fahrenheit = (temp + 1.8) + 32
rounded = roundNum(fah... |
# -*- coding: utf-8 -*-
"""
Created on Sat Aug 3 23:07:15 2019
@author: ydima
"""
import logging
import os
from pathlib import Path
import random
import shlex
import string
from subprocess import PIPE, Popen
import tempfile
from typing import Dict, List, Optional, Union
import pandas as pd
from .constants import (... | # -*- coding: utf-8 -*-
"""
Created on Sat Aug 3 23:07:15 2019
@author: ydima
"""
import logging
import os
from pathlib import Path
import random
import shlex
import string
from subprocess import PIPE, Popen
import tempfile
from typing import Dict, List, Optional, Union
import pandas as pd
from .constants import (... |
from BiblioAlly import catalog as cat, domain, translator as bibtex
class IeeeXTranslator(bibtex.Translator):
def _document_from_proto_document(self, proto_document):
bibtex.Translator._translate_kind(proto_document)
kind = proto_document['type']
fields = proto_document['field']
i... | from BiblioAlly import catalog as cat, domain, translator as bibtex
class IeeeXTranslator(bibtex.Translator):
def _document_from_proto_document(self, proto_document):
bibtex.Translator._translate_kind(proto_document)
kind = proto_document['type']
fields = proto_document['field']
i... |
import pytest
from receptor.router import MeshRouter
test_networks = [
(
[
("a", "b", 1),
("a", "d", 1),
("a", "f", 1),
("b", "d", 1),
("b", "c", 1),
("c", "e", 1),
("c", "h", 1),
("c", "j", 1),
("e"... | import pytest
from receptor.router import MeshRouter
test_networks = [
(
[
("a", "b", 1),
("a", "d", 1),
("a", "f", 1),
("b", "d", 1),
("b", "c", 1),
("c", "e", 1),
("c", "h", 1),
("c", "j", 1),
("e"... |
# pylint: disable=invalid-name
# Requires Python 3.6+
# Ref: https://www.sphinx-doc.org/en/master/usage/configuration.html
"""Configuration for the Sphinx documentation generator."""
import sys
from functools import partial
from pathlib import Path
from setuptools_scm import get_version
# -- Path setup ------------... | # pylint: disable=invalid-name
# Requires Python 3.6+
# Ref: https://www.sphinx-doc.org/en/master/usage/configuration.html
"""Configuration for the Sphinx documentation generator."""
import sys
from functools import partial
from pathlib import Path
from setuptools_scm import get_version
# -- Path setup ------------... |
from typing import Dict
from handler import Context, Arguments, CommandResult
from rpg.items import Item
from utils.formatting import codeblock
from utils.command_helpers import get_author_player
async def run(ctx: Context, args: Arguments) -> CommandResult:
player = await get_author_player(ctx)
if player.i... | from typing import Dict
from handler import Context, Arguments, CommandResult
from rpg.items import Item
from utils.formatting import codeblock
from utils.command_helpers import get_author_player
async def run(ctx: Context, args: Arguments) -> CommandResult:
player = await get_author_player(ctx)
if player.i... |
from src.utils.config import config
import json
# import uuid
import requests
_NAMESPACE = "WS"
_VER_NAMESPACE = "WSVER"
_SAMPLE_NAMESPACE = "SMP"
# versioned and non-versioned index have same version
_SAMPLE_SET_INDEX_VERSION = 1
_SAMPLE_SET_INDEX_NAME = 'sample_set_' + str(_SAMPLE_SET_INDEX_VERSION)
_VER_SAMPLE_SET... | from src.utils.config import config
import json
# import uuid
import requests
_NAMESPACE = "WS"
_VER_NAMESPACE = "WSVER"
_SAMPLE_NAMESPACE = "SMP"
# versioned and non-versioned index have same version
_SAMPLE_SET_INDEX_VERSION = 1
_SAMPLE_SET_INDEX_NAME = 'sample_set_' + str(_SAMPLE_SET_INDEX_VERSION)
_VER_SAMPLE_SET... |
import discord
import io
import aiohttp
from aiohttp import request, ClientSession
from src.embeds.image_embed import ImageEmbed
async def request_canvas_image(ctx, url, member: discord.Member = None, params={}, is_gif=False):
params_url = "&" + "&".join(["{}={}".format(k, v)
for k... | import discord
import io
import aiohttp
from aiohttp import request, ClientSession
from src.embeds.image_embed import ImageEmbed
async def request_canvas_image(ctx, url, member: discord.Member = None, params={}, is_gif=False):
params_url = "&" + "&".join(["{}={}".format(k, v)
for k... |
"""Dataset, producer, and config metadata."""
import logging
import warnings
import sqlalchemy as sa
from .._globals import REGISTRY as registry
from .. import _tools
from .. import backend as _backend
__all__ = ['Dataset', 'Producer', 'Config']
log = logging.getLogger(__name__)
@registry.mapped
class Dataset:... | """Dataset, producer, and config metadata."""
import logging
import warnings
import sqlalchemy as sa
from .._globals import REGISTRY as registry
from .. import _tools
from .. import backend as _backend
__all__ = ['Dataset', 'Producer', 'Config']
log = logging.getLogger(__name__)
@registry.mapped
class Dataset:... |
###
# (C) Copyright [2019-2020] Hewlett Packard Enterprise Development LP
#
# 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 ... | ###
# (C) Copyright [2019-2020] Hewlett Packard Enterprise Development LP
#
# 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 ... |
#!/usr/bin/env python3
import sys
import os
import re
import argparse
import requests
from bs4 import BeautifulSoup as bs
version=1.1
print("""\033[1;36m
╦ ╦╔═╗╔╗ ╦═╗╔═╗╔═╗╔╦╗╔═╗╦═╗
║║║║╣ ╠╩╗ ╠╦╝║╣ ╠═╣║║║║╣ ╠╦╝
╚╩╝╚═╝╚═╝────╩╚═╚═╝╩ ╩╩ ╩╚═╝╩╚═
🔗🔥🔗🔥🔗🔥🔗🔥🔗🔥🔗🔥🔗🔥🔗🔥
... | #!/usr/bin/env python3
import sys
import os
import re
import argparse
import requests
from bs4 import BeautifulSoup as bs
version=1.1
print("""\033[1;36m
╦ ╦╔═╗╔╗ ╦═╗╔═╗╔═╗╔╦╗╔═╗╦═╗
║║║║╣ ╠╩╗ ╠╦╝║╣ ╠═╣║║║║╣ ╠╦╝
╚╩╝╚═╝╚═╝────╩╚═╚═╝╩ ╩╩ ╩╚═╝╩╚═
🔗🔥🔗🔥🔗🔥🔗🔥🔗🔥🔗🔥🔗🔥🔗🔥
... |
import demistomock as demisto
from CommonServerPython import *
from CommonServerUserPython import *
''' IMPORTS '''
import requests
# Disable insecure warnings
requests.packages.urllib3.disable_warnings()
API_KEY = demisto.getParam('APIKey')
SERVER_URL = 'https://analyze.intezer.com/api'
API_VERSION = '/v2-0'
BASE_... | import demistomock as demisto
from CommonServerPython import *
from CommonServerUserPython import *
''' IMPORTS '''
import requests
# Disable insecure warnings
requests.packages.urllib3.disable_warnings()
API_KEY = demisto.getParam('APIKey')
SERVER_URL = 'https://analyze.intezer.com/api'
API_VERSION = '/v2-0'
BASE_... |
"""api_gw_test"""
# Remove warnings when using pytest fixtures
# pylint: disable=redefined-outer-name
import json
from test.conftest import ENDPOINT_URL
# warning disabled, this is used as a pylint fixture
from test.elasticsearch_test import ( # pylint: disable=unused-import
es_client,
populate_es_test_case... | """api_gw_test"""
# Remove warnings when using pytest fixtures
# pylint: disable=redefined-outer-name
import json
from test.conftest import ENDPOINT_URL
# warning disabled, this is used as a pylint fixture
from test.elasticsearch_test import ( # pylint: disable=unused-import
es_client,
populate_es_test_case... |
import copy
import sys
import pprint
import os, os.path as op
from datetime import date, datetime, timedelta
from collections import OrderedDict
from functools import partial
from urllib.parse import urlparse
import yaml
from natsort import natsorted, ns
from pykwalify.core import Core
def abort(msg):
sys.stderr... | import copy
import sys
import pprint
import os, os.path as op
from datetime import date, datetime, timedelta
from collections import OrderedDict
from functools import partial
from urllib.parse import urlparse
import yaml
from natsort import natsorted, ns
from pykwalify.core import Core
def abort(msg):
sys.stderr... |
from configparser import ConfigParser
import feedparser
import re
import requests
import tweepy
def get_id(xkcd_link: str) -> int:
"""
Exctract comic id from xkcd link
"""
match = re.search(r"\d+", xkcd_link)
if match:
return int(match.group())
else:
return 0
def get_xkcd_rss... | from configparser import ConfigParser
import feedparser
import re
import requests
import tweepy
def get_id(xkcd_link: str) -> int:
"""
Exctract comic id from xkcd link
"""
match = re.search(r"\d+", xkcd_link)
if match:
return int(match.group())
else:
return 0
def get_xkcd_rss... |
import logging
import os
import sys
import warnings
from collections import namedtuple
from typing import *
import matplotlib.image
import matplotlib.pyplot as plt
from torch import Tensor
from torch.utils.tensorboard import SummaryWriter
from booster import Diagnostic
from .datatracker import DataTracker
BestScore ... | import logging
import os
import sys
import warnings
from collections import namedtuple
from typing import *
import matplotlib.image
import matplotlib.pyplot as plt
from torch import Tensor
from torch.utils.tensorboard import SummaryWriter
from booster import Diagnostic
from .datatracker import DataTracker
BestScore ... |
"""Test the creation of all inventories."""
import stewi
from stewi.globals import paths, STEWI_VERSION, config
year = 2018
def test_inventory_generation():
# Create new local path
paths.local_path = paths.local_path + "_" + STEWI_VERSION
error_list = []
for inventory in config()['databases']:
... | """Test the creation of all inventories."""
import stewi
from stewi.globals import paths, STEWI_VERSION, config
year = 2018
def test_inventory_generation():
# Create new local path
paths.local_path = paths.local_path + "_" + STEWI_VERSION
error_list = []
for inventory in config()['databases']:
... |
"""Report routes."""
import os
from urllib import parse
import bottle
import requests
from pymongo.database import Database
from database import sessions
from database.datamodels import latest_datamodel
from database.measurements import recent_measurements_by_metric_uuid
from database.reports import insert_new_repor... | """Report routes."""
import os
from urllib import parse
import bottle
import requests
from pymongo.database import Database
from database import sessions
from database.datamodels import latest_datamodel
from database.measurements import recent_measurements_by_metric_uuid
from database.reports import insert_new_repor... |
import glob
import shutil
import subprocess
import os
import sys
import argparse
# Read and save metadata from file
def exiftool_metadata(path):
metadata = {}
exifToolPath = 'exifTool.exe'
''' use Exif tool to get the metadata '''
process = subprocess.Popen(
[
exifToolPath,
... | import glob
import shutil
import subprocess
import os
import sys
import argparse
# Read and save metadata from file
def exiftool_metadata(path):
metadata = {}
exifToolPath = 'exifTool.exe'
''' use Exif tool to get the metadata '''
process = subprocess.Popen(
[
exifToolPath,
... |
import os
import shutil
import subprocess
import re
import string
import pathlib
import timeit
import jmhbenchmark
class JHaskellBenchmark(jmhbenchmark.JMHBenchmark):
def __init__(self, name, source_path, compiler_args=None):
if compiler_args is None:
compiler_args = []
source_path = ... | import os
import shutil
import subprocess
import re
import string
import pathlib
import timeit
import jmhbenchmark
class JHaskellBenchmark(jmhbenchmark.JMHBenchmark):
def __init__(self, name, source_path, compiler_args=None):
if compiler_args is None:
compiler_args = []
source_path = ... |
r"""
Early Stopping
^^^^^^^^^^^^^^
Monitor a validation metric and stop training when it stops improving.
"""
from copy import deepcopy
import numpy as np
import torch
import torch.distributed as dist
from pytorch_lightning import _logger as log
from pytorch_lightning.callbacks.base import Callback
from pytorch_lig... | r"""
Early Stopping
^^^^^^^^^^^^^^
Monitor a validation metric and stop training when it stops improving.
"""
from copy import deepcopy
import numpy as np
import torch
import torch.distributed as dist
from pytorch_lightning import _logger as log
from pytorch_lightning.callbacks.base import Callback
from pytorch_lig... |
import base64
import os
import tkinter as tk
import tkinter.messagebox as msg
import tkinter.ttk as ttk
from functools import partial
from chatwindow import ChatWindow
from requester import Requester
from avatarwindow import AvatarWindow
from addfriendwindow import AddFriendWindow
friend_avatars_dir = os.path.abspat... | import base64
import os
import tkinter as tk
import tkinter.messagebox as msg
import tkinter.ttk as ttk
from functools import partial
from chatwindow import ChatWindow
from requester import Requester
from avatarwindow import AvatarWindow
from addfriendwindow import AddFriendWindow
friend_avatars_dir = os.path.abspat... |
#!/usr/bin/env python
import os
import logging
import requests
import json
import configparser
import sys
import time
import re
from os.path import dirname
from config import (
instanceA_url, instanceA_key, instanceA_path, instanceA_profile,
instanceA_profile_id, instanceA_profile_filter, instanceA_profile_f... | #!/usr/bin/env python
import os
import logging
import requests
import json
import configparser
import sys
import time
import re
from os.path import dirname
from config import (
instanceA_url, instanceA_key, instanceA_path, instanceA_profile,
instanceA_profile_id, instanceA_profile_filter, instanceA_profile_f... |
# ble_command_load_group.py/Open GoPro, Version 2.0 (C) Copyright 2021 GoPro, Inc. (http://gopro.com/OpenGoPro).
# This copyright was auto-generated on Wed, Sep 1, 2021 5:05:57 PM
import sys
import asyncio
import logging
import argparse
from typing import Optional
from binascii import hexlify
from bleak import Blea... | # ble_command_load_group.py/Open GoPro, Version 2.0 (C) Copyright 2021 GoPro, Inc. (http://gopro.com/OpenGoPro).
# This copyright was auto-generated on Wed, Sep 1, 2021 5:05:57 PM
import sys
import asyncio
import logging
import argparse
from typing import Optional
from binascii import hexlify
from bleak import Blea... |
import cProfile
import json
import logging
import os
import pstats
import signal
import tempfile
import time
import traceback
from django.conf import settings
from django.utils.timezone import now as tz_now
from django.db import DatabaseError, OperationalError, connection as django_connection
from django.db.utils impo... | import cProfile
import json
import logging
import os
import pstats
import signal
import tempfile
import time
import traceback
from django.conf import settings
from django.utils.timezone import now as tz_now
from django.db import DatabaseError, OperationalError, connection as django_connection
from django.db.utils impo... |
''' SPEECH-TO-TEXT USING MICROSOFT SPEECH API '''
''' nonstoptimm@gmail.com '''
# Import required packages
import os
import glob
import json
import logging
import codecs
import helper as he
import azure.cognitiveservices.speech as speechsdk
import params as pa
# Load and set configuration parameters
pa.get_config()
... | ''' SPEECH-TO-TEXT USING MICROSOFT SPEECH API '''
''' nonstoptimm@gmail.com '''
# Import required packages
import os
import glob
import json
import logging
import codecs
import helper as he
import azure.cognitiveservices.speech as speechsdk
import params as pa
# Load and set configuration parameters
pa.get_config()
... |
#!/usr/bin/env python3
# PYTHON_ARGCOMPLETE_OK
"""Entry point for cwltool."""
import argparse
import copy
import functools
import io
import logging
import os
import signal
import subprocess # nosec
import sys
import time
import urllib
import warnings
from codecs import StreamWriter, getwriter
from collections.abc imp... | #!/usr/bin/env python3
# PYTHON_ARGCOMPLETE_OK
"""Entry point for cwltool."""
import argparse
import copy
import functools
import io
import logging
import os
import signal
import subprocess # nosec
import sys
import time
import urllib
import warnings
from codecs import StreamWriter, getwriter
from collections.abc imp... |
import builtins
import os
import sys
from array import array
from collections import Counter, defaultdict, deque
from dataclasses import dataclass, fields, is_dataclass
from itertools import islice
from typing import (
TYPE_CHECKING,
Any,
Callable,
Dict,
Iterable,
List,
Optional,
Set,
... | import builtins
import os
import sys
from array import array
from collections import Counter, defaultdict, deque
from dataclasses import dataclass, fields, is_dataclass
from itertools import islice
from typing import (
TYPE_CHECKING,
Any,
Callable,
Dict,
Iterable,
List,
Optional,
Set,
... |
#!/usr/bin/env python3
import asyncio
import logging
from collections import defaultdict
from functools import partial
from box import Box
_l = logging.getLogger(__name__)
_instances = dict()
_events = defaultdict(asyncio.Event)
_event_queues = list()
_event_callbacks = defaultdict(list)
class Component:
"""... | #!/usr/bin/env python3
import asyncio
import logging
from collections import defaultdict
from functools import partial
from box import Box
_l = logging.getLogger(__name__)
_instances = dict()
_events = defaultdict(asyncio.Event)
_event_queues = list()
_event_callbacks = defaultdict(list)
class Component:
"""... |
import asyncio
import logging
import voluptuous as vol
from homeassistant.components.system_log import CONF_LOGGER
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import EVENT_HOMEASSISTANT_STOP
from homeassistant.core import HomeAssistant, Event
from homeassistant.helpers import config_v... | import asyncio
import logging
import voluptuous as vol
from homeassistant.components.system_log import CONF_LOGGER
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import EVENT_HOMEASSISTANT_STOP
from homeassistant.core import HomeAssistant, Event
from homeassistant.helpers import config_v... |
# pylint: disable=too-many-lines
import os
import random
import shutil
import time
import uuid
from retval import RetVal
from pycryptostring import CryptoString
from pymensago.encryption import EncryptionPair
from pymensago.hash import blake2hash
from pymensago.serverconn import ServerConnection
from integration_set... | # pylint: disable=too-many-lines
import os
import random
import shutil
import time
import uuid
from retval import RetVal
from pycryptostring import CryptoString
from pymensago.encryption import EncryptionPair
from pymensago.hash import blake2hash
from pymensago.serverconn import ServerConnection
from integration_set... |
# -*- coding: utf-8 -*-
import requests
from webs.api.exceptions.customs import ServerError, InvalidAPIRequest, RecordNotFound, RecordAlreadyExists
class RequestMixin(object):
CODE_EXCEPTION_MSG = {
400: InvalidAPIRequest,
404: RecordNotFound,
409: RecordAlreadyExists,
422: Inva... | # -*- coding: utf-8 -*-
import requests
from webs.api.exceptions.customs import ServerError, InvalidAPIRequest, RecordNotFound, RecordAlreadyExists
class RequestMixin(object):
CODE_EXCEPTION_MSG = {
400: InvalidAPIRequest,
404: RecordNotFound,
409: RecordAlreadyExists,
422: Inva... |
import contextlib
import ipaddress
import json
import os
import random
import re
import time
import warnings
from collections import Counter
from typing import Any, Dict, List, Optional, Set, Union
import requests
import test_infra.utils.waiting
import waiting
import yaml
from assisted_service_client import models
fro... | import contextlib
import ipaddress
import json
import os
import random
import re
import time
import warnings
from collections import Counter
from typing import Any, Dict, List, Optional, Set, Union
import requests
import test_infra.utils.waiting
import waiting
import yaml
from assisted_service_client import models
fro... |
import codecs
import csv
import datetime
import logging
from django.contrib.auth import get_user_model
from django.contrib.auth.models import Group
from todo.models import Task, TaskList
log = logging.getLogger(__name__)
class CSVImporter:
"""Core upsert functionality for CSV import, for re-use by `import_csv`... | import codecs
import csv
import datetime
import logging
from django.contrib.auth import get_user_model
from django.contrib.auth.models import Group
from todo.models import Task, TaskList
log = logging.getLogger(__name__)
class CSVImporter:
"""Core upsert functionality for CSV import, for re-use by `import_csv`... |
import sys
import math
import os
sys.path.append(os.path.dirname(os.path.abspath(__file__)) + "/../../../")
from sdc_etl_libs.sdc_dataframe.Dataframe import *
import pandas as pd
import numpy as np
import json
import pytest
def test_generate_insert_query_ddl(mocker):
test_schema = """
{
"namespace": "Ti... | import sys
import math
import os
sys.path.append(os.path.dirname(os.path.abspath(__file__)) + "/../../../")
from sdc_etl_libs.sdc_dataframe.Dataframe import *
import pandas as pd
import numpy as np
import json
import pytest
def test_generate_insert_query_ddl(mocker):
test_schema = """
{
"namespace": "Ti... |
"""BERT Training Script."""
import functools
from typing import Any, Callable, Dict, Tuple, Optional, Type
from absl import logging
from clu import metric_writers
from clu import periodic_actions
from flax import jax_utils
import flax.linen as nn
import jax
from jax.experimental import optimizers as jax_optimizers
im... | """BERT Training Script."""
import functools
from typing import Any, Callable, Dict, Tuple, Optional, Type
from absl import logging
from clu import metric_writers
from clu import periodic_actions
from flax import jax_utils
import flax.linen as nn
import jax
from jax.experimental import optimizers as jax_optimizers
im... |
"""Config flow to configure the Netgear integration."""
from __future__ import annotations
import logging
from typing import cast
from urllib.parse import urlparse
from pynetgear import DEFAULT_HOST, DEFAULT_PORT, DEFAULT_USER
import voluptuous as vol
from homeassistant import config_entries
from homeassistant.compo... | """Config flow to configure the Netgear integration."""
from __future__ import annotations
import logging
from typing import cast
from urllib.parse import urlparse
from pynetgear import DEFAULT_HOST, DEFAULT_PORT, DEFAULT_USER
import voluptuous as vol
from homeassistant import config_entries
from homeassistant.compo... |
#
# 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... | #
# 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... |
from typing import Dict
from flask_babel import _
from anyway.backend_constants import InjurySeverity
from anyway.infographics_dictionaries import segment_dictionary
from anyway.models import InvolvedMarkerView
from anyway.request_params import RequestParams
from anyway.widgets.suburban_widgets.sub_urban_widg... | from typing import Dict
from flask_babel import _
from anyway.backend_constants import InjurySeverity
from anyway.infographics_dictionaries import segment_dictionary
from anyway.models import InvolvedMarkerView
from anyway.request_params import RequestParams
from anyway.widgets.suburban_widgets.sub_urban_widg... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Jan 15 10:38:14 2021
@author: kunal001
"""
import logging
logger = logging.getLogger(__name__)
class CreateDatabase:
def __init__(self,hier_graph,const_parse):
self.hier_graph_dict = {}
self.const_parse = const_parse
self.G ... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Jan 15 10:38:14 2021
@author: kunal001
"""
import logging
logger = logging.getLogger(__name__)
class CreateDatabase:
def __init__(self,hier_graph,const_parse):
self.hier_graph_dict = {}
self.const_parse = const_parse
self.G ... |
# <editor-fold desc="Basic Imports">
import os
import os.path as p
import requests
from time import time
from argparse import ArgumentParser
import sys
sys.path.append(p.join(p.dirname(__file__), '..'))
sys.path.append(p.join(p.dirname(__file__), '../..'))
# </editor-fold>
# <editor-fold desc="Parse Command Line Args... | # <editor-fold desc="Basic Imports">
import os
import os.path as p
import requests
from time import time
from argparse import ArgumentParser
import sys
sys.path.append(p.join(p.dirname(__file__), '..'))
sys.path.append(p.join(p.dirname(__file__), '../..'))
# </editor-fold>
# <editor-fold desc="Parse Command Line Args... |
import json
import time
from dataclasses import dataclass
from logging import Logger
import requests
from insightconnect_plugin_runtime.exceptions import PluginException
from insightconnect_plugin_runtime.helper import clean
from requests.auth import HTTPBasicAuth
@dataclass
class AlertParams:
alert_type: [str]
... | import json
import time
from dataclasses import dataclass
from logging import Logger
import requests
from insightconnect_plugin_runtime.exceptions import PluginException
from insightconnect_plugin_runtime.helper import clean
from requests.auth import HTTPBasicAuth
@dataclass
class AlertParams:
alert_type: [str]
... |
#
# Copyright (c) 2021 Software AG, Darmstadt, Germany and/or its licensors
#
# SPDX-License-Identifier: Apache-2.0
#
# 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.apach... | #
# Copyright (c) 2021 Software AG, Darmstadt, Germany and/or its licensors
#
# SPDX-License-Identifier: Apache-2.0
#
# 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.apach... |
from math import log, exp
from numpy import inf, zeros, zeros_like as np_zeros_like, arange, asarray, empty
from pandas import concat
from anndata import AnnData
from torch import cat, no_grad, randn, zeros_like, zeros as torch_zeros, ones, argmax
from torch.nn import Module, Linear, Sequential, RNNCell, Softplus, Par... | from math import log, exp
from numpy import inf, zeros, zeros_like as np_zeros_like, arange, asarray, empty
from pandas import concat
from anndata import AnnData
from torch import cat, no_grad, randn, zeros_like, zeros as torch_zeros, ones, argmax
from torch.nn import Module, Linear, Sequential, RNNCell, Softplus, Par... |
# 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... |
import pandas as pd
import tweepy
from textblob import TextBlob
from wordcloud import WordCloud
import plotly.graph_objs as go
import os
import re
import pystan
import numpy as np
import streamlit as st
import matplotlib.pyplot as plt
import yfinance as yf
from fbprophet import Prophet
from fbprophet.plot import plo... |
import pandas as pd
import tweepy
from textblob import TextBlob
from wordcloud import WordCloud
import plotly.graph_objs as go
import os
import re
import pystan
import numpy as np
import streamlit as st
import matplotlib.pyplot as plt
import yfinance as yf
from fbprophet import Prophet
from fbprophet.plot import plo... |
"""HelloWorld Integration for Cortex XSOAR (aka Demisto)
This integration is a good example on you can build a Cortex XSOAR Integration
using Python 3. Please follow the documentation links below and make sure that
your integration follows the Code Conventions and passes the Linting phase.
Developer Documentation: ht... | """HelloWorld Integration for Cortex XSOAR (aka Demisto)
This integration is a good example on you can build a Cortex XSOAR Integration
using Python 3. Please follow the documentation links below and make sure that
your integration follows the Code Conventions and passes the Linting phase.
Developer Documentation: ht... |
from datetime import datetime, timedelta
import requests
from decouple import config
from django.contrib.auth.models import User
from django.test import TestCase
from django.utils import timezone
from .models import Socio
class ModelTest(TestCase):
def setUp(self):
Socio(
user=User.objects.c... | from datetime import datetime, timedelta
import requests
from decouple import config
from django.contrib.auth.models import User
from django.test import TestCase
from django.utils import timezone
from .models import Socio
class ModelTest(TestCase):
def setUp(self):
Socio(
user=User.objects.c... |
#!/usr/bin/env python3
# -*- coding: UTF-8 -*-
"""
平安行动自动打卡
请事先安装好 lxml 和 requests 模块
pip install lxml requests
然后修改 27-31 行为自己的数据,未使用的变量保持原样即可
如有需要请自行配置 149-171 行的 SMTP 发信或 174-177 行的 Server 酱微信提醒
Created on 2020-04-13 20:20
@author: ZhangJiawei & Liu Chongpeng & Liu Lu
"""
import requests
import lxml.html
i... | #!/usr/bin/env python3
# -*- coding: UTF-8 -*-
"""
平安行动自动打卡
请事先安装好 lxml 和 requests 模块
pip install lxml requests
然后修改 27-31 行为自己的数据,未使用的变量保持原样即可
如有需要请自行配置 149-171 行的 SMTP 发信或 174-177 行的 Server 酱微信提醒
Created on 2020-04-13 20:20
@author: ZhangJiawei & Liu Chongpeng & Liu Lu
"""
import requests
import lxml.html
i... |
# -*- coding: utf-8 -*-
# Resource object code
#
# Created: Mon Oct 15 12:53:43 2018
# by: The Resource Compiler for PySide (Qt v4.8.7)
#
# WARNING! All changes made in this file will be lost!
from PySide import QtCore
qt_resource_data = b"\x00\x006x\x89PNG\x0d\x0a\x1a\x0a\x00\x00\x00\x0dIHDR\x00\x00\x02|\x00\x... | # -*- coding: utf-8 -*-
# Resource object code
#
# Created: Mon Oct 15 12:53:43 2018
# by: The Resource Compiler for PySide (Qt v4.8.7)
#
# WARNING! All changes made in this file will be lost!
from PySide import QtCore
qt_resource_data = b"\x00\x006x\x89PNG\x0d\x0a\x1a\x0a\x00\x00\x00\x0dIHDR\x00\x00\x02|\x00\x... |
#
# MIT License
#
# Copyright (c) 2020 Airbyte
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, pu... | #
# MIT License
#
# Copyright (c) 2020 Airbyte
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, pu... |
#!/usr/bin/env python
"""TcEx Framework Validate Module."""
# standard library
import ast
import importlib
import json
import os
import sys
import traceback
from collections import deque
from pathlib import Path
from typing import Dict, Union
# third-party
import colorama as c
# from jsonschema import SchemaError, Va... | #!/usr/bin/env python
"""TcEx Framework Validate Module."""
# standard library
import ast
import importlib
import json
import os
import sys
import traceback
from collections import deque
from pathlib import Path
from typing import Dict, Union
# third-party
import colorama as c
# from jsonschema import SchemaError, Va... |
import frappe, re
from renovation_service_provider_manager import invoke_mediator
@frappe.whitelist(allow_guest=True)
def get_service_provider_client_id(provider):
k = f"client_id_{re.sub("[^0-9a-zA-Z]+", "_", provider.lower())}"
client_id = frappe.cache().get_value(k)
if client_id:
return client_id
clien... | import frappe, re
from renovation_service_provider_manager import invoke_mediator
@frappe.whitelist(allow_guest=True)
def get_service_provider_client_id(provider):
k = f"client_id_{re.sub('[^0-9a-zA-Z]+', '_', provider.lower())}"
client_id = frappe.cache().get_value(k)
if client_id:
return client_id
clien... |
#!/usr/bin/env python
"""
Object-oriented implementation of backup reporting code.
Defines a class called 'Backup' that records all backups of a device
"""
import os, sys, argparse
import glob
from configparser import ConfigParser
from atlassian import Confluence
class Backup:
def __init__(sel... | #!/usr/bin/env python
"""
Object-oriented implementation of backup reporting code.
Defines a class called 'Backup' that records all backups of a device
"""
import os, sys, argparse
import glob
from configparser import ConfigParser
from atlassian import Confluence
class Backup:
def __init__(sel... |
import os
import re
import shutil
import sys
import urllib.error
import urllib.parse
import urllib.request
from zipfile import ZipFile
import helpers.config as config
from helpers.logger import Logger
class Updater:
__instance = None
@staticmethod
def Get():
if Updater.__instance is None:
... | import os
import re
import shutil
import sys
import urllib.error
import urllib.parse
import urllib.request
from zipfile import ZipFile
import helpers.config as config
from helpers.logger import Logger
class Updater:
__instance = None
@staticmethod
def Get():
if Updater.__instance is None:
... |
import copy
import functools
import warnings
from types import MethodType
from typing import Dict, List, Optional, Type, Union
import dill
import pandas as pd
from feast.base_feature_view import BaseFeatureView
from feast.data_source import RequestSource
from feast.errors import RegistryInferenceFailure, SpecifiedFea... | import copy
import functools
import warnings
from types import MethodType
from typing import Dict, List, Optional, Type, Union
import dill
import pandas as pd
from feast.base_feature_view import BaseFeatureView
from feast.data_source import RequestSource
from feast.errors import RegistryInferenceFailure, SpecifiedFea... |
# -*- coding: utf-8 -*-
"""Access to FAIRsharing via its API.
.. seealso:: https://beta.fairsharing.org/API_doc
"""
from typing import Any, Iterable, Mapping, MutableMapping, Optional
import pystow
import requests
import yaml
from tqdm import tqdm
__all__ = [
"ensure_fairsharing",
"load_fairsharing",
"... | # -*- coding: utf-8 -*-
"""Access to FAIRsharing via its API.
.. seealso:: https://beta.fairsharing.org/API_doc
"""
from typing import Any, Iterable, Mapping, MutableMapping, Optional
import pystow
import requests
import yaml
from tqdm import tqdm
__all__ = [
"ensure_fairsharing",
"load_fairsharing",
"... |
"""common logic for all queries"""
import json
from functools import partial, singledispatch
from operator import itemgetter
import snug
from gentools import (compose, map_yield, map_send, oneyield, reusable,
map_return)
from .load import registry
API_URL = 'https://slack.com/api/'
class ApiE... | """common logic for all queries"""
import json
from functools import partial, singledispatch
from operator import itemgetter
import snug
from gentools import (compose, map_yield, map_send, oneyield, reusable,
map_return)
from .load import registry
API_URL = 'https://slack.com/api/'
class ApiE... |
"""Provide useful functions for using PTLFlow."""
# =============================================================================
# Copyright 2021 Henrique Morimitsu
#
# 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... | """Provide useful functions for using PTLFlow."""
# =============================================================================
# Copyright 2021 Henrique Morimitsu
#
# 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... |
#!/usr/bin/env python
# coding: utf-8
import logging.config
import os
# Конфигурация базы данных
DB_CONFIG = {
'username': 'root',
'password': os.environ.get('MYSQL_TRADING_PASS'),
'host': '127.0.0.1',
'dbname': 'trading_db',
}
# Конфигурация журналирования
LOGGING = {
'version': 1,
'format... | #!/usr/bin/env python
# coding: utf-8
import logging.config
import os
# Конфигурация базы данных
DB_CONFIG = {
'username': 'root',
'password': os.environ.get('MYSQL_TRADING_PASS'),
'host': '127.0.0.1',
'dbname': 'trading_db',
}
# Конфигурация журналирования
LOGGING = {
'version': 1,
'format... |
# https://github.com/facebookresearch/torchbeast/blob/master/torchbeast/core/environment.py
import numpy as np
from collections import deque
import gym
from gym import spaces
import cv2
cv2.ocl.setUseOpenCL(False)
class NoopResetEnv(gym.Wrapper):
def __init__(self, env, noop_max=30):
"""Sample initial st... | # https://github.com/facebookresearch/torchbeast/blob/master/torchbeast/core/environment.py
import numpy as np
from collections import deque
import gym
from gym import spaces
import cv2
cv2.ocl.setUseOpenCL(False)
class NoopResetEnv(gym.Wrapper):
def __init__(self, env, noop_max=30):
"""Sample initial st... |
# 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 for having some fun with people. """
import os
import urllib
import requests
from re import sub
from ... | # 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 for having some fun with people. """
import os
import urllib
import requests
from re import sub
from ... |
import math
import lavalink
import ksoftapi
import discord
from discord.ext import commands
class Music(commands.Cog):
def __init__(self, bot):
self.bot = bot
self.kclient = bot.kclient
if not hasattr(bot, 'lavalink'):
bot.lavalink = lavalink.Client(bot.user.id)
bo... | import math
import lavalink
import ksoftapi
import discord
from discord.ext import commands
class Music(commands.Cog):
def __init__(self, bot):
self.bot = bot
self.kclient = bot.kclient
if not hasattr(bot, 'lavalink'):
bot.lavalink = lavalink.Client(bot.user.id)
bo... |
from werkzeug.wrappers import Request
from flask import Flask, redirect, url_for, request, flash
from flask_sqlalchemy import SQLAlchemy
import os
import requests
import random
from contact_form import ContactForm
from flask_dance.contrib.github import make_github_blueprint, github
from flask_dance.contrib.gitl... | from werkzeug.wrappers import Request
from flask import Flask, redirect, url_for, request, flash
from flask_sqlalchemy import SQLAlchemy
import os
import requests
import random
from contact_form import ContactForm
from flask_dance.contrib.github import make_github_blueprint, github
from flask_dance.contrib.gitl... |
from colab_ssh.utils.packages.installer import create_deb_installer
from colab_ssh.utils.ui.render_html import render_template
from subprocess import Popen, PIPE
import shlex
from colab_ssh._command import run_command, run_with_pipe
import os
import time
from colab_ssh.get_tunnel_config import get_argo_tunnel_config
fr... | from colab_ssh.utils.packages.installer import create_deb_installer
from colab_ssh.utils.ui.render_html import render_template
from subprocess import Popen, PIPE
import shlex
from colab_ssh._command import run_command, run_with_pipe
import os
import time
from colab_ssh.get_tunnel_config import get_argo_tunnel_config
fr... |
import logging
import os
import subprocess
import tempfile
from argparse import Namespace
from pathlib import Path
from .error import EvalError
from .manifest import Repo, load_manifest, update_lock_file
from .path import EVALREPO_PATH, LOCK_PATH, MANIFEST_PATH, nixpkgs_path
from .prefetch import prefetch
logger = lo... | import logging
import os
import subprocess
import tempfile
from argparse import Namespace
from pathlib import Path
from .error import EvalError
from .manifest import Repo, load_manifest, update_lock_file
from .path import EVALREPO_PATH, LOCK_PATH, MANIFEST_PATH, nixpkgs_path
from .prefetch import prefetch
logger = lo... |
import json
import os
import httpx
import time
def get_cities(cfg):
return cfg['cities'].keys()
def get_usable_bounding_boxes(nominal_boxes, cfg):
FLICKR_PUBLIC = get_secret('flickr_api_key')
FLICKR_SECRET = get_secret('flickr_api_secret')
flickr = FlickrAPI(FLICKR_PUBLIC, FLICKR_SECRET, format='parsed-j... | import json
import os
import httpx
import time
def get_cities(cfg):
return cfg['cities'].keys()
def get_usable_bounding_boxes(nominal_boxes, cfg):
FLICKR_PUBLIC = get_secret('flickr_api_key')
FLICKR_SECRET = get_secret('flickr_api_secret')
flickr = FlickrAPI(FLICKR_PUBLIC, FLICKR_SECRET, format='parsed-j... |
from sklearn.cluster import MiniBatchKMeans
import numpy as np
import torch
from models import TransformerModel, Seq2SeqTransformer, generate_square_subsequent_mask
from models import LM_NAME, MLM_NAME, MT_NAME, NLAYERS, NUM2WORD
import os
from data_preprocessing import DATA_DIR_DEV, SAVE_DATA_MT_TRAIN
from data_prepr... | from sklearn.cluster import MiniBatchKMeans
import numpy as np
import torch
from models import TransformerModel, Seq2SeqTransformer, generate_square_subsequent_mask
from models import LM_NAME, MLM_NAME, MT_NAME, NLAYERS, NUM2WORD
import os
from data_preprocessing import DATA_DIR_DEV, SAVE_DATA_MT_TRAIN
from data_prepr... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.