edited_code stringlengths 17 978k | original_code stringlengths 17 978k |
|---|---|
from operator import attrgetter
import pyangbind.lib.xpathhelper as xpathhelper
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType, RestrictedClassType, TypedListType
from pyangbind.lib.yangtypes import YANGBool, YANGListType, YANGDynClass, ReferenceType
from pyangbind.lib.base import PybindBase
from d... |
from operator import attrgetter
import pyangbind.lib.xpathhelper as xpathhelper
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType, RestrictedClassType, TypedListType
from pyangbind.lib.yangtypes import YANGBool, YANGListType, YANGDynClass, ReferenceType
from pyangbind.lib.base import PybindBase
from d... |
# Copyright (c) 2020 Intel Corporation
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, d... | # Copyright (c) 2020 Intel Corporation
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, d... |
# coding=utf-8
# Copyright 2020 The HuggingFace Inc. team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | # coding=utf-8
# Copyright 2020 The HuggingFace Inc. team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... |
# Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | # Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... |
r"""
vanilla pseudo-labeling implementation
"""
from collections import defaultdict
from alr.utils import timeop, manual_seed
from alr.data.datasets import Dataset
from alr.data import UnlabelledDataset
from alr.training import VanillaPLTrainer
from alr.training.samplers import RandomFixedLengthSampler
from alr import... | r"""
vanilla pseudo-labeling implementation
"""
from collections import defaultdict
from alr.utils import timeop, manual_seed
from alr.data.datasets import Dataset
from alr.data import UnlabelledDataset
from alr.training import VanillaPLTrainer
from alr.training.samplers import RandomFixedLengthSampler
from alr import... |
import json
class OrderException(Exception):
pass
def first_step(event, context):
print(event)
if event.get('orderId') is None:
raise OrderException('No orderId was provided!')
if event['orderId'] != 'abc123':
raise OrderException(f'No record found for recordId: {event['orderId']}')
... | import json
class OrderException(Exception):
pass
def first_step(event, context):
print(event)
if event.get('orderId') is None:
raise OrderException('No orderId was provided!')
if event['orderId'] != 'abc123':
raise OrderException(f'No record found for recordId: {event["orderId"]}')
... |
# AUTOGENERATED! DO NOT EDIT! File to edit: nbs/05-orchestrator.ipynb (unless otherwise specified).
__all__ = ['retry_request', 'if_possible_parse_local_datetime', 'SP_and_date_request', 'handle_capping',
'date_range_request', 'year_request', 'construct_year_month_pairs', 'year_and_month_request',
... | # AUTOGENERATED! DO NOT EDIT! File to edit: nbs/05-orchestrator.ipynb (unless otherwise specified).
__all__ = ['retry_request', 'if_possible_parse_local_datetime', 'SP_and_date_request', 'handle_capping',
'date_range_request', 'year_request', 'construct_year_month_pairs', 'year_and_month_request',
... |
import argparse
import datetime
import os
import traceback
import kornia
import numpy as np
import torch
import torch.nn.functional as F
from torch import nn
from torch.utils.data import DataLoader
from tqdm.autonotebook import tqdm
import models
from datasets import LowLightDataset, LowLightFDataset
from models impo... | import argparse
import datetime
import os
import traceback
import kornia
import numpy as np
import torch
import torch.nn.functional as F
from torch import nn
from torch.utils.data import DataLoader
from tqdm.autonotebook import tqdm
import models
from datasets import LowLightDataset, LowLightFDataset
from models impo... |
"""
Downloading images scrapped from the https://substance3d.adobe.com/assets/allassets
and saved in local SQLite file
"""
import os
import time
import sys
import platform
from os import path
import requests # to get image from the web
import shutil # to save it locally
from rich import pretty
from rich.console i... | """
Downloading images scrapped from the https://substance3d.adobe.com/assets/allassets
and saved in local SQLite file
"""
import os
import time
import sys
import platform
from os import path
import requests # to get image from the web
import shutil # to save it locally
from rich import pretty
from rich.console i... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Feb 5 22:33:48 2019
@author: Kazuki
"""
import numpy as np
import pandas as pd
import os, gc
from glob import glob
from tqdm import tqdm
import sys
sys.path.append(f'/home/{os.environ.get('USER')}/PythonLibrary')
import lgbextension as ex
import ligh... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Feb 5 22:33:48 2019
@author: Kazuki
"""
import numpy as np
import pandas as pd
import os, gc
from glob import glob
from tqdm import tqdm
import sys
sys.path.append(f'/home/{os.environ.get("USER")}/PythonLibrary')
import lgbextension as ex
import ligh... |
import os
import re
import ctypes
import zlib
import functools
from urllib.parse import urlparse
from collections import namedtuple
from copy import deepcopy
from datafaucet import metadata
from datafaucet.paths import rootdir
from datafaucet._utils import merge, to_ordered_dict
from datafaucet.yaml import YamlDict
... | import os
import re
import ctypes
import zlib
import functools
from urllib.parse import urlparse
from collections import namedtuple
from copy import deepcopy
from datafaucet import metadata
from datafaucet.paths import rootdir
from datafaucet._utils import merge, to_ordered_dict
from datafaucet.yaml import YamlDict
... |
import logging
import zmq
import sys
import time
import uptime
import pickle
from datetime import datetime
from os import path
try:
from gps_config import (init, GPS_TOPIC)
except ImportError:
raise Exception('failed to import init method')
sys.exit(-1)
def gen_gps_message():
return [
time.t... | import logging
import zmq
import sys
import time
import uptime
import pickle
from datetime import datetime
from os import path
try:
from gps_config import (init, GPS_TOPIC)
except ImportError:
raise Exception('failed to import init method')
sys.exit(-1)
def gen_gps_message():
return [
time.t... |
from logging import getLogger
import slack
logger = getLogger(__name__)
class ChannelListNotLoadedError(RuntimeError):
pass
class ChannelNotFoundError(RuntimeError):
pass
class FileNotUploadedError(RuntimeError):
pass
class SlackAPI(object):
def __init__(self, token, channel: str, to_user: st... | from logging import getLogger
import slack
logger = getLogger(__name__)
class ChannelListNotLoadedError(RuntimeError):
pass
class ChannelNotFoundError(RuntimeError):
pass
class FileNotUploadedError(RuntimeError):
pass
class SlackAPI(object):
def __init__(self, token, channel: str, to_user: st... |
import logging
import sys
import yfinance
import pandas as pd
import yfinance as yf
import os
from collections import defaultdict
from datetime import datetime, timedelta
from typing import Any, Dict, List
from finrl.config import TimeRange, setup_utils_configuration
from finrl.data.converter import convert_ohlcv_fo... | import logging
import sys
import yfinance
import pandas as pd
import yfinance as yf
import os
from collections import defaultdict
from datetime import datetime, timedelta
from typing import Any, Dict, List
from finrl.config import TimeRange, setup_utils_configuration
from finrl.data.converter import convert_ohlcv_fo... |
#!/usr/bin/python3
# -*- coding: UTF-8 -*-
import datetime
import json
import os
import re
import requests
import time
from bs4 import BeautifulSoup
requests.packages.urllib3.util.ssl_.DEFAULT_CIPHERS = 'ALL:@SECLEVEL=1'
def try_write(path, text):
paths = path.split("/")
sub_path = ""
for i in paths[:-1]:
... | #!/usr/bin/python3
# -*- coding: UTF-8 -*-
import datetime
import json
import os
import re
import requests
import time
from bs4 import BeautifulSoup
requests.packages.urllib3.util.ssl_.DEFAULT_CIPHERS = 'ALL:@SECLEVEL=1'
def try_write(path, text):
paths = path.split("/")
sub_path = ""
for i in paths[:-1]:
... |
"""Common test functions."""
from pathlib import Path
import re
from unittest.mock import AsyncMock, MagicMock, PropertyMock, patch
from uuid import uuid4
from aiohttp import web
from aiohttp.test_utils import TestClient
from awesomeversion import AwesomeVersion
import pytest
from supervisor.api import RestAPI
from s... | """Common test functions."""
from pathlib import Path
import re
from unittest.mock import AsyncMock, MagicMock, PropertyMock, patch
from uuid import uuid4
from aiohttp import web
from aiohttp.test_utils import TestClient
from awesomeversion import AwesomeVersion
import pytest
from supervisor.api import RestAPI
from s... |
# -*- coding: utf-8 -*-
"""
Functions for model training and evaluation (single-partner and multi-partner cases)
"""
import operator
import os
from abc import ABC, abstractmethod
from copy import deepcopy
from timeit import default_timer as timer
import numpy as np
import random
import tensorflow as tf
from loguru im... | # -*- coding: utf-8 -*-
"""
Functions for model training and evaluation (single-partner and multi-partner cases)
"""
import operator
import os
from abc import ABC, abstractmethod
from copy import deepcopy
from timeit import default_timer as timer
import numpy as np
import random
import tensorflow as tf
from loguru im... |
""" Galaxy Process Management superclass and utilities
"""
import contextlib
import importlib
import inspect
import os
import subprocess
import sys
from abc import ABCMeta, abstractmethod
from gravity.config_manager import ConfigManager
from gravity.io import error
from gravity.util import which
# If at some point ... | """ Galaxy Process Management superclass and utilities
"""
import contextlib
import importlib
import inspect
import os
import subprocess
import sys
from abc import ABCMeta, abstractmethod
from gravity.config_manager import ConfigManager
from gravity.io import error
from gravity.util import which
# If at some point ... |
#!/usr/bin/env python3
# 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
# "L... | #!/usr/bin/env python3
# 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
# "L... |
#!/usr/bin/env python3
#
# ISC License
#
# Copyright (C) 2021 DS-Homebrew
# Copyright (C) 2021-present lifehackerhansol
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice app... | #!/usr/bin/env python3
#
# ISC License
#
# Copyright (C) 2021 DS-Homebrew
# Copyright (C) 2021-present lifehackerhansol
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice app... |
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, CTCLabelConverterForBaiduWarpctc, AttnLabelConverter, ... | 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, CTCLabelConverterForBaiduWarpctc, AttnLabelConverter, ... |
from nussl import ml, datasets, evaluation
import tempfile
from torch import optim
import numpy as np
import logging
import os
import torch
from matplotlib import pyplot as plt
logging.basicConfig(
format='%(asctime)s,%(msecs)d %(levelname)-8s [%(filename)s:%(lineno)d] %(message)s',
datefmt='%Y-%m-%d:%H:%M:%S'... | from nussl import ml, datasets, evaluation
import tempfile
from torch import optim
import numpy as np
import logging
import os
import torch
from matplotlib import pyplot as plt
logging.basicConfig(
format='%(asctime)s,%(msecs)d %(levelname)-8s [%(filename)s:%(lineno)d] %(message)s',
datefmt='%Y-%m-%d:%H:%M:%S'... |
# 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... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Author: Bertrand256
# Created on: 2018-11
import base64
import json
import logging
import time
from collections import namedtuple
from enum import Enum
from functools import partial
from typing import List, Union, Callable
import ipaddress
from PyQt5 import QtWidgets, Q... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Author: Bertrand256
# Created on: 2018-11
import base64
import json
import logging
import time
from collections import namedtuple
from enum import Enum
from functools import partial
from typing import List, Union, Callable
import ipaddress
from PyQt5 import QtWidgets, Q... |
"""DEFINES THE INVERSEDYNAMICS SOLVER, A Solver for solving the joint based model of a dog."""
from scipy import optimize, signal
from data.data_loader import C3DData, load_force_plate_data, ForcePlateData, SMALData, get_delay_between, DataSources, \
path_join
from vis.utils import *
from vis import visualisations
f... | """DEFINES THE INVERSEDYNAMICS SOLVER, A Solver for solving the joint based model of a dog."""
from scipy import optimize, signal
from data.data_loader import C3DData, load_force_plate_data, ForcePlateData, SMALData, get_delay_between, DataSources, \
path_join
from vis.utils import *
from vis import visualisations
f... |
"""Implementation for Eldes Cloud"""
import asyncio
import async_timeout
import logging
import aiohttp
from homeassistant.const import (
STATE_ALARM_ARMED_AWAY,
STATE_ALARM_ARMED_HOME,
STATE_ALARM_DISARMED
)
from ..const import API_URL, API_PATHS
_LOGGER = logging.getLogger(__name__)
ALARM_STATES_MAP = ... | """Implementation for Eldes Cloud"""
import asyncio
import async_timeout
import logging
import aiohttp
from homeassistant.const import (
STATE_ALARM_ARMED_AWAY,
STATE_ALARM_ARMED_HOME,
STATE_ALARM_DISARMED
)
from ..const import API_URL, API_PATHS
_LOGGER = logging.getLogger(__name__)
ALARM_STATES_MAP = ... |
import os
import json
import shutil
from lib.config import Config
from lib.variables import Variables, HACKERMODE_FOLDER_NAME
RED = '\033[1;31m'
GREEN = '\033[1;32m'
YELLOW = '\033[1;33m'
NORMAL = '\033[0m'
UNDERLINE = '\033[4m'
BOLD = '\033[1m'
with open(os.path.join(Variables.HACKERMODE_PATH, 'packages.json')) as... | import os
import json
import shutil
from lib.config import Config
from lib.variables import Variables, HACKERMODE_FOLDER_NAME
RED = '\033[1;31m'
GREEN = '\033[1;32m'
YELLOW = '\033[1;33m'
NORMAL = '\033[0m'
UNDERLINE = '\033[4m'
BOLD = '\033[1m'
with open(os.path.join(Variables.HACKERMODE_PATH, 'packages.json')) as... |
"""Interact with Taskwarrior."""
import datetime
import os
import re
import threading
import traceback
from pathlib import Path
from shutil import which
from subprocess import PIPE, Popen
from typing import List, Optional, Tuple, Union
import albert as v0 # type: ignore
import dateutil
import gi
import taskw
from fu... | """Interact with Taskwarrior."""
import datetime
import os
import re
import threading
import traceback
from pathlib import Path
from shutil import which
from subprocess import PIPE, Popen
from typing import List, Optional, Tuple, Union
import albert as v0 # type: ignore
import dateutil
import gi
import taskw
from fu... |
from fastapi import FastAPI, Form
from fastapi.responses import HTMLResponse
from pydantic import BaseModel
from typing import Optional
app = FastAPI()
class UssdParams(BaseModel):
session_id: str
service_code: str
phone_number: str
text: str
# dummy acc. data
accounts = {
"A001": {
"bi... | from fastapi import FastAPI, Form
from fastapi.responses import HTMLResponse
from pydantic import BaseModel
from typing import Optional
app = FastAPI()
class UssdParams(BaseModel):
session_id: str
service_code: str
phone_number: str
text: str
# dummy acc. data
accounts = {
"A001": {
"bi... |
"""Generate mypy config."""
from __future__ import annotations
import configparser
import io
import os
from pathlib import Path
from typing import Final
from .model import Config, Integration
# Modules which have type hints which known to be broken.
# If you are an author of component listed here, please fix these e... | """Generate mypy config."""
from __future__ import annotations
import configparser
import io
import os
from pathlib import Path
from typing import Final
from .model import Config, Integration
# Modules which have type hints which known to be broken.
# If you are an author of component listed here, please fix these e... |
def count_step(m, w, h):
m = [[i for i in l] for l in m]
next_pos = [(0, 0)]
while next_pos:
x, y = next_pos.pop(0)
for i, j in ((-1, 0), (1, 0), (0, -1), (0, 1)):
x_, y_ = x + i, y + j
if 0 <= x_ < w and 0 <= y_ < h:
if not m[y_][x_]:
... | def count_step(m, w, h):
m = [[i for i in l] for l in m]
next_pos = [(0, 0)]
while next_pos:
x, y = next_pos.pop(0)
for i, j in ((-1, 0), (1, 0), (0, -1), (0, 1)):
x_, y_ = x + i, y + j
if 0 <= x_ < w and 0 <= y_ < h:
if not m[y_][x_]:
... |
import sqlite3
import threading
import notify2
from datetime import datetime
from http.server import HTTPServer, BaseHTTPRequestHandler
from urllib.parse import parse_qs
from halo import Halo
from prompt_toolkit import ANSI
from prompt_toolkit.application import Application, get_app
from prompt_toolkit.buffer import B... | import sqlite3
import threading
import notify2
from datetime import datetime
from http.server import HTTPServer, BaseHTTPRequestHandler
from urllib.parse import parse_qs
from halo import Halo
from prompt_toolkit import ANSI
from prompt_toolkit.application import Application, get_app
from prompt_toolkit.buffer import B... |
import logging
import snap7
# for setup the Logo connection please follow this link
# http://snap7.sourceforge.net/logo.html
logging.basicConfig(level=logging.INFO)
# Siemens LOGO devices Logo 8 is the default
Logo_7 = True
logger = logging.getLogger(__name__)
plc = snap7.logo.Logo()
plc.connect("192.168.0.41",0... | import logging
import snap7
# for setup the Logo connection please follow this link
# http://snap7.sourceforge.net/logo.html
logging.basicConfig(level=logging.INFO)
# Siemens LOGO devices Logo 8 is the default
Logo_7 = True
logger = logging.getLogger(__name__)
plc = snap7.logo.Logo()
plc.connect("192.168.0.41",0... |
colors = {"clean": "\033[m",
"red": "\033[31m",
"green": "\033[32m",
"yellow": "\033[33m",
"blue": "\033[34m",
"purple": "\033[35m",
"cian": "\033[36m"}
teams = ("Fortaleza", "Athletico-PR", "Atlético-GO", "Bragantino", "Bahia", "Fluminense", "Palmeiras", "Fla... | colors = {"clean": "\033[m",
"red": "\033[31m",
"green": "\033[32m",
"yellow": "\033[33m",
"blue": "\033[34m",
"purple": "\033[35m",
"cian": "\033[36m"}
teams = ("Fortaleza", "Athletico-PR", "Atlético-GO", "Bragantino", "Bahia", "Fluminense", "Palmeiras", "Fla... |
# Copyright 2020 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
import itertools
from textwrap import dedent
from flake8_pantsbuild import PB10, PB11, PB12, PB13, PB20, PB30
def test_pb_10(flake8dir) -> None:
template = dedent(
"""\
... | # Copyright 2020 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
import itertools
from textwrap import dedent
from flake8_pantsbuild import PB10, PB11, PB12, PB13, PB20, PB30
def test_pb_10(flake8dir) -> None:
template = dedent(
"""\
... |
from discord.ext import commands
import discord
import sys
from pathlib import Path
import motor.motor_asyncio
from config import token, extension_dir
from utils.context import UnnamedContext
from utils.help import PaginatedHelpCommand
class UnnamedBot(commands.Bot):
def __init__(self, command_prefix, **options):... | from discord.ext import commands
import discord
import sys
from pathlib import Path
import motor.motor_asyncio
from config import token, extension_dir
from utils.context import UnnamedContext
from utils.help import PaginatedHelpCommand
class UnnamedBot(commands.Bot):
def __init__(self, command_prefix, **options):... |
import re
import click
import logging
from pathlib import Path
from dotenv import find_dotenv, load_dotenv
import importlib
import torch
import torch.autograd
from torch.utils.data import dataset
import torch.utils.data.dataloader
import ignite.utils
import ignite.handlers.early_stopping
import ignite.engine
import ... | import re
import click
import logging
from pathlib import Path
from dotenv import find_dotenv, load_dotenv
import importlib
import torch
import torch.autograd
from torch.utils.data import dataset
import torch.utils.data.dataloader
import ignite.utils
import ignite.handlers.early_stopping
import ignite.engine
import ... |
from urllib.parse import urlparse
import classyjson as cj
import asyncio
import discord
import math
import time
from util.code import format_exception
from util.ipc import PacketType
def strip_command(ctx): # returns message.clean_content excluding the command used
length = len(ctx.prefix) + len(ctx.invoked_wit... | from urllib.parse import urlparse
import classyjson as cj
import asyncio
import discord
import math
import time
from util.code import format_exception
from util.ipc import PacketType
def strip_command(ctx): # returns message.clean_content excluding the command used
length = len(ctx.prefix) + len(ctx.invoked_wit... |
import smtplib
import urllib.parse
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from itsdangerous import URLSafeTimedSerializer
from flask import current_app
from server.services.messaging.template_service import get_template, get_profile_url
class SMTPService:
@staticmet... | import smtplib
import urllib.parse
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from itsdangerous import URLSafeTimedSerializer
from flask import current_app
from server.services.messaging.template_service import get_template, get_profile_url
class SMTPService:
@staticmet... |
from parsons.notifications.gmail import Gmail
import json
import os
import requests_mock
import unittest
import shutil
import base64
import email
_dir = os.path.dirname(__file__)
class TestGmail(unittest.TestCase):
@requests_mock.Mocker()
def setUp(self, m):
self.tmp_folder = "tmp/"
self.cr... | from parsons.notifications.gmail import Gmail
import json
import os
import requests_mock
import unittest
import shutil
import base64
import email
_dir = os.path.dirname(__file__)
class TestGmail(unittest.TestCase):
@requests_mock.Mocker()
def setUp(self, m):
self.tmp_folder = "tmp/"
self.cr... |
from pathlib import Path
from pprint import pprint
import keyword
import builtins
import textwrap
from ursina import color, lerp, application
def indentation(line):
return len(line) - len(line.lstrip())
def get_module_attributes(str):
attrs = list()
for l in str.split('\n'):
if len(l) == 0:
... | from pathlib import Path
from pprint import pprint
import keyword
import builtins
import textwrap
from ursina import color, lerp, application
def indentation(line):
return len(line) - len(line.lstrip())
def get_module_attributes(str):
attrs = list()
for l in str.split('\n'):
if len(l) == 0:
... |
import swagger_client
from swagger_client.rest import ApiException
import maya
import os
import json
import datetime
import pandas as pd
import glob
import datetime
from loguru import logger
import requests
import socket
import urllib
import webbrowser
from http.server import BaseHTTPRequestHandler, HTTPServer
class ... | import swagger_client
from swagger_client.rest import ApiException
import maya
import os
import json
import datetime
import pandas as pd
import glob
import datetime
from loguru import logger
import requests
import socket
import urllib
import webbrowser
from http.server import BaseHTTPRequestHandler, HTTPServer
class ... |
from ...configuration.configuration import Configuration
from ...exceptions.executorexceptions import CommandExecutionFailure
from ...interfaces.batchsystemadapter import BatchSystemAdapter
from ...interfaces.batchsystemadapter import MachineStatus
from ...utilities.utils import async_run_command
from ...utilities.util... | from ...configuration.configuration import Configuration
from ...exceptions.executorexceptions import CommandExecutionFailure
from ...interfaces.batchsystemadapter import BatchSystemAdapter
from ...interfaces.batchsystemadapter import MachineStatus
from ...utilities.utils import async_run_command
from ...utilities.util... |
import uuid
from os import getenv
from boto3utils import s3
from cirruslib import Catalog, get_task_logger
# envvars
CATALOG_BUCKET = getenv('CIRRUS_CATALOG_BUCKET')
def lambda_handler(payload, context):
catalog = Catalog.from_payload(payload)
logger = get_task_logger("task.pre-batch", catalog=catalog)
... | import uuid
from os import getenv
from boto3utils import s3
from cirruslib import Catalog, get_task_logger
# envvars
CATALOG_BUCKET = getenv('CIRRUS_CATALOG_BUCKET')
def lambda_handler(payload, context):
catalog = Catalog.from_payload(payload)
logger = get_task_logger("task.pre-batch", catalog=catalog)
... |
"""
Tasks for maintaining the project.
Execute 'invoke --list' for guidance on using Invoke
"""
import platform
import webbrowser
from pathlib import Path
from invoke import call, task
from invoke.context import Context
from invoke.runners import Result
ROOT_DIR = Path(__file__).parent
DOCS_DIR = ROOT_DIR.joinpath("... | """
Tasks for maintaining the project.
Execute 'invoke --list' for guidance on using Invoke
"""
import platform
import webbrowser
from pathlib import Path
from invoke import call, task
from invoke.context import Context
from invoke.runners import Result
ROOT_DIR = Path(__file__).parent
DOCS_DIR = ROOT_DIR.joinpath("... |
'''
parse country case counts provided by ECDC and write results to TSV
this should be run from the top level of the repo.
Will need to be integrated with other parsers once they become available.
'''
import xlrd
import csv
import json
from urllib.request import urlretrieve
from collections import defaultdict
from da... | '''
parse country case counts provided by ECDC and write results to TSV
this should be run from the top level of the repo.
Will need to be integrated with other parsers once they become available.
'''
import xlrd
import csv
import json
from urllib.request import urlretrieve
from collections import defaultdict
from da... |
import numpy as np
import scipy.special
import os
import math
import logging
import pandas as pd
import warnings
import time
import json
import pickle
import functools
import tqdm
from typing import Tuple
from autogluon.core.scheduler.scheduler_factory import scheduler_factory
from autogluon.core.utils import set_logg... | import numpy as np
import scipy.special
import os
import math
import logging
import pandas as pd
import warnings
import time
import json
import pickle
import functools
import tqdm
from typing import Tuple
from autogluon.core.scheduler.scheduler_factory import scheduler_factory
from autogluon.core.utils import set_logg... |
import pymysql
import time
import os
import socket
import threading
from time import sleep
from copy import deepcopy
from contextlib import closing
from json import loads
from queue import Queue
from datetime import datetime
from binascii import hexlify
from src.retranslators import Wialon, EGTS, WialonIPS, GalileoSk... | import pymysql
import time
import os
import socket
import threading
from time import sleep
from copy import deepcopy
from contextlib import closing
from json import loads
from queue import Queue
from datetime import datetime
from binascii import hexlify
from src.retranslators import Wialon, EGTS, WialonIPS, GalileoSk... |
"""
Credits:
This file was adopted from: https://github.com/pydata/xarray # noqa
Source file: https://github.com/pydata/xarray/blob/1d7bcbdc75b6d556c04e2c7d7a042e4379e15303/xarray/backends/rasterio_.py # noqa
"""
import contextlib
import os
import re
import threading
import warnings
import numpy as np
import raster... | """
Credits:
This file was adopted from: https://github.com/pydata/xarray # noqa
Source file: https://github.com/pydata/xarray/blob/1d7bcbdc75b6d556c04e2c7d7a042e4379e15303/xarray/backends/rasterio_.py # noqa
"""
import contextlib
import os
import re
import threading
import warnings
import numpy as np
import raster... |
import boto3
from botocore.exceptions import ClientError
import json
import os
import time
import datetime
from dateutil import tz
from lib.account import *
from lib.common import *
import logging
logger = logging.getLogger()
logger.setLevel(logging.INFO)
logging.getLogger('botocore').setLevel(logging.WARNING)
logg... |
import boto3
from botocore.exceptions import ClientError
import json
import os
import time
import datetime
from dateutil import tz
from lib.account import *
from lib.common import *
import logging
logger = logging.getLogger()
logger.setLevel(logging.INFO)
logging.getLogger('botocore').setLevel(logging.WARNING)
logg... |
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from .ga import GeneticAlgorithm
from . import objectives as ga_objectives
import deap
import warnings
class AutoGeneS:
PLOT_PARAMS = {
'small': {
'figsize': (10,5),
'all_ms': 8,
'sel_ms': 10
... | import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from .ga import GeneticAlgorithm
from . import objectives as ga_objectives
import deap
import warnings
class AutoGeneS:
PLOT_PARAMS = {
'small': {
'figsize': (10,5),
'all_ms': 8,
'sel_ms': 10
... |
from discord.ext import commands
from discord.ext.commands import Bot, Context
from models.command import CommandInfo
import config
from util.discord.channel import ChannelUtil
from util.discord.messages import Messages
from util.env import Env
from db.models.favorite import Favorite
from db.models.user import User
fr... | from discord.ext import commands
from discord.ext.commands import Bot, Context
from models.command import CommandInfo
import config
from util.discord.channel import ChannelUtil
from util.discord.messages import Messages
from util.env import Env
from db.models.favorite import Favorite
from db.models.user import User
fr... |
"""
Copyright (c) 2015-2020 Raj Patel(raj454raj@gmail.com), StopStalk
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
... | """
Copyright (c) 2015-2020 Raj Patel(raj454raj@gmail.com), StopStalk
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
... |
from reportlab.platypus import Paragraph, Spacer, Table, TableStyle, PageBreak
from reportlab.lib.styles import getSampleStyleSheet
from reportlab.lib import colors
from reportlab.lib.units import mm
from copy import deepcopy
from reportlab.lib.enums import TA_CENTER, TA_LEFT, TA_JUSTIFY
from directions.models import N... | from reportlab.platypus import Paragraph, Spacer, Table, TableStyle, PageBreak
from reportlab.lib.styles import getSampleStyleSheet
from reportlab.lib import colors
from reportlab.lib.units import mm
from copy import deepcopy
from reportlab.lib.enums import TA_CENTER, TA_LEFT, TA_JUSTIFY
from directions.models import N... |
# pylint: disable=missing-docstring
import copy
import itertools
import functools
import pathlib
from collections import namedtuple
from contextlib import suppress
import pytest
from rollit.runtime import Runner
from rollit.runtime.towers import IncrementalTower
from rollit.util import is_valid_iterable
try:
fro... | # pylint: disable=missing-docstring
import copy
import itertools
import functools
import pathlib
from collections import namedtuple
from contextlib import suppress
import pytest
from rollit.runtime import Runner
from rollit.runtime.towers import IncrementalTower
from rollit.util import is_valid_iterable
try:
fro... |
import discord
from discord.ext import commands
from discord.commands import slash_command, Option
import asyncio
from bot import GoModBot
from discord.ui import InputText, Modal
class Modal(Modal):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.add_item(InputText(label... | import discord
from discord.ext import commands
from discord.commands import slash_command, Option
import asyncio
from bot import GoModBot
from discord.ui import InputText, Modal
class Modal(Modal):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.add_item(InputText(label... |
# Copyright (c) 2021 PPViT 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 by applicable l... | # Copyright (c) 2021 PPViT 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 by applicable l... |
#!/usr/bin/env python3
import os
import re
import sys
import time
import packaging.version
import requests
PROJECT = "praw"
HEADERS = {"Authorization": f"token {os.environ.get("READTHEDOCS_TOKEN")}"}
def fetch_versions():
response = requests.get(
f"https://readthedocs.org/api/v3/projects/{PROJECT}/versi... | #!/usr/bin/env python3
import os
import re
import sys
import time
import packaging.version
import requests
PROJECT = "praw"
HEADERS = {"Authorization": f"token {os.environ.get('READTHEDOCS_TOKEN')}"}
def fetch_versions():
response = requests.get(
f"https://readthedocs.org/api/v3/projects/{PROJECT}/versi... |
import logging
import os
import unittest
from typing import (
Any,
Optional,
)
from galaxy.tool_util.verify.test_data import TestDataResolver
from galaxy_test.base.env import (
setup_keep_outdir,
target_url_parts,
)
log = logging.getLogger(__name__)
class FunctionalTestCase(unittest.TestCase):
"... | import logging
import os
import unittest
from typing import (
Any,
Optional,
)
from galaxy.tool_util.verify.test_data import TestDataResolver
from galaxy_test.base.env import (
setup_keep_outdir,
target_url_parts,
)
log = logging.getLogger(__name__)
class FunctionalTestCase(unittest.TestCase):
"... |
# %% [markdown]
# #
import itertools
import os
import time
from itertools import chain
import colorcet as cc
import matplotlib as mpl
import matplotlib.pyplot as plt
import networkx as nx
import numpy as np
import pandas as pd
import seaborn as sns
from anytree import LevelOrderGroupIter, Node, RenderTree
from joblib ... | # %% [markdown]
# #
import itertools
import os
import time
from itertools import chain
import colorcet as cc
import matplotlib as mpl
import matplotlib.pyplot as plt
import networkx as nx
import numpy as np
import pandas as pd
import seaborn as sns
from anytree import LevelOrderGroupIter, Node, RenderTree
from joblib ... |
# Import
import traceback
from datetime import datetime
import aiohttp
import discord
from discord import Webhook, AsyncWebhookAdapter
from discord.ext import commands
import psutil
# Framework
import Framework
# Cog Initialising
class HANDLER(commands.Cog):
def __init__(self, client):
self.client = c... | # Import
import traceback
from datetime import datetime
import aiohttp
import discord
from discord import Webhook, AsyncWebhookAdapter
from discord.ext import commands
import psutil
# Framework
import Framework
# Cog Initialising
class HANDLER(commands.Cog):
def __init__(self, client):
self.client = c... |
import argparse
import requests
from cromwell_tools.cromwell_api import CromwellAPI
from cromwell_tools.cromwell_auth import CromwellAuth
from cromwell_tools.diag import task_runtime
from cromwell_tools import __version__
diagnostic_index = {
'task_runtime': task_runtime.run
}
def parser(arguments=None):
# ... | import argparse
import requests
from cromwell_tools.cromwell_api import CromwellAPI
from cromwell_tools.cromwell_auth import CromwellAuth
from cromwell_tools.diag import task_runtime
from cromwell_tools import __version__
diagnostic_index = {
'task_runtime': task_runtime.run
}
def parser(arguments=None):
# ... |
# -----------------------------------------------------------------------------
# Builder
# -----------------------------------------------------------------------------
# Team: DataHub
# -----------------------------------------------------------------------------
# Author: Maxime Sirois
# ----------------------... | # -----------------------------------------------------------------------------
# Builder
# -----------------------------------------------------------------------------
# Team: DataHub
# -----------------------------------------------------------------------------
# Author: Maxime Sirois
# ----------------------... |
from copy import deepcopy
import asyncio
import json
import pandas as pd
import streamlit as st
from structlog import get_logger
from helpers import (
fromtimestamp,
show_weather,
WeatherItem,
gather_one_call_weather_data,
clean_time,
)
log = get_logger()
st.set_page_config(
layout="wide",
... | from copy import deepcopy
import asyncio
import json
import pandas as pd
import streamlit as st
from structlog import get_logger
from helpers import (
fromtimestamp,
show_weather,
WeatherItem,
gather_one_call_weather_data,
clean_time,
)
log = get_logger()
st.set_page_config(
layout="wide",
... |
import redis
from typing import Tuple, Union, List
class Redis():
def __init__(self, host: str = 'localhost', port: int = 6379, user: str = '', password: str = '') -> None:
self._host = host
self._port = port
self._user = user
self._password = password
self.client = redis.S... | import redis
from typing import Tuple, Union, List
class Redis():
def __init__(self, host: str = 'localhost', port: int = 6379, user: str = '', password: str = '') -> None:
self._host = host
self._port = port
self._user = user
self._password = password
self.client = redis.S... |
# DataManager -> responsible for talking to the Google Sheets API.
# FlightSearch -> responsible for talking to the Flight Search API.
# FlightData -> responsible for structuring the flight data
# NotificationManager -> responsible for sending notifications with the deal flight details
from data_manager import DataMan... | # DataManager -> responsible for talking to the Google Sheets API.
# FlightSearch -> responsible for talking to the Flight Search API.
# FlightData -> responsible for structuring the flight data
# NotificationManager -> responsible for sending notifications with the deal flight details
from data_manager import DataMan... |
import difflib
import re
from typing import Optional, Union
from discord.utils import escape_markdown
def wrap_in_code(value: str, *, block: Optional[Union[bool, str]] = None):
value = value.replace("`", "\u200b`\u200b")
value = value.replace("\u200b\u200b", "\u200b")
if block is None:
return "`... | import difflib
import re
from typing import Optional, Union
from discord.utils import escape_markdown
def wrap_in_code(value: str, *, block: Optional[Union[bool, str]] = None):
value = value.replace("`", "\u200b`\u200b")
value = value.replace("\u200b\u200b", "\u200b")
if block is None:
return "`... |
import os
import sys
import copy
import pickle
import numpy as np
import pandas as pd
from tqdm import tqdm
from pprint import pprint
from sklearn.model_selection import train_test_split
import utils
from debug import ipsh
sys.path.insert(0, '_data_main')
try:
from _data_main.fair_adult_data import *
except:
pri... | import os
import sys
import copy
import pickle
import numpy as np
import pandas as pd
from tqdm import tqdm
from pprint import pprint
from sklearn.model_selection import train_test_split
import utils
from debug import ipsh
sys.path.insert(0, '_data_main')
try:
from _data_main.fair_adult_data import *
except:
pri... |
import synapse.exc as s_exc
import synapse.lib.gis as s_gis
import synapse.lib.layer as s_layer
import synapse.lib.types as s_types
import synapse.lib.module as s_module
import synapse.lib.grammar as s_grammar
units = {
'mm': 1,
'millimeter': 1,
'millimeters': 1,
'cm': 10,
'centimeter': 10,
'... | import synapse.exc as s_exc
import synapse.lib.gis as s_gis
import synapse.lib.layer as s_layer
import synapse.lib.types as s_types
import synapse.lib.module as s_module
import synapse.lib.grammar as s_grammar
units = {
'mm': 1,
'millimeter': 1,
'millimeters': 1,
'cm': 10,
'centimeter': 10,
'... |
# Use snippet 'summarize_a_survey_module' to output a table and a graph of
# participant counts by response for one question_concept_id
# The snippet assumes that a dataframe containing survey questions and answers already exists
# The snippet also assumes that setup has been run
# Update the next 3 lines
survey_df =... | # Use snippet 'summarize_a_survey_module' to output a table and a graph of
# participant counts by response for one question_concept_id
# The snippet assumes that a dataframe containing survey questions and answers already exists
# The snippet also assumes that setup has been run
# Update the next 3 lines
survey_df =... |
from __future__ import absolute_import, print_function, unicode_literals
import elliottlib
from elliottlib import constants, logutil, Runtime, bzutil, openshiftclient, errata
LOGGER = logutil.getLogger(__name__)
from elliottlib.cli import cli_opts
from elliottlib.cli.common import cli, use_default_advisory_option, fin... | from __future__ import absolute_import, print_function, unicode_literals
import elliottlib
from elliottlib import constants, logutil, Runtime, bzutil, openshiftclient, errata
LOGGER = logutil.getLogger(__name__)
from elliottlib.cli import cli_opts
from elliottlib.cli.common import cli, use_default_advisory_option, fin... |
import json
import click
from isic_cli.cli.context import IsicContext
@click.group(short_help='Manage authentication with the ISIC Archive.')
@click.pass_obj
def user(ctx):
pass
@user.command()
@click.pass_obj
def login(obj: IsicContext):
"""Login to the ISIC Archive."""
if obj.user:
click.ech... | import json
import click
from isic_cli.cli.context import IsicContext
@click.group(short_help='Manage authentication with the ISIC Archive.')
@click.pass_obj
def user(ctx):
pass
@user.command()
@click.pass_obj
def login(obj: IsicContext):
"""Login to the ISIC Archive."""
if obj.user:
click.ech... |
#!/usr/bin/env python
import os
import subprocess
import sys
# Required third-party imports, must be specified in pyproject.toml.
import packaging.version
import setuptools
def process_options():
"""
Determine all runtime options, returning a dictionary of the results. The
keys are:
'rootdir': ... | #!/usr/bin/env python
import os
import subprocess
import sys
# Required third-party imports, must be specified in pyproject.toml.
import packaging.version
import setuptools
def process_options():
"""
Determine all runtime options, returning a dictionary of the results. The
keys are:
'rootdir': ... |
from typing import Dict, Union, List, Optional
import ray
from ray._raylet import ObjectRef
from ray._raylet import PlacementGroupID
from ray._private.utils import hex_to_binary
from ray.util.annotations import PublicAPI, DeveloperAPI
from ray.ray_constants import to_memory_units
from ray._private.client_mode_hook imp... | from typing import Dict, Union, List, Optional
import ray
from ray._raylet import ObjectRef
from ray._raylet import PlacementGroupID
from ray._private.utils import hex_to_binary
from ray.util.annotations import PublicAPI, DeveloperAPI
from ray.ray_constants import to_memory_units
from ray._private.client_mode_hook imp... |
# -*- coding: utf-8 -*-
#
# conda-forge documentation build configuration file, created by
# sphinx-quickstart on Wed Jun 1 01:44:13 2016.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#... | # -*- coding: utf-8 -*-
#
# conda-forge documentation build configuration file, created by
# sphinx-quickstart on Wed Jun 1 01:44:13 2016.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#... |
"""Derive the license information and publish in docs."""
import functools
import json
import pathlib
import pkg_resources
import string
import subprocess # nosec
from typing import List, Tuple
__all__ = ['dependency_tree_console_text', 'direct_dependencies_table', 'indirect_dependencies_table']
ENCODING = 'utf-8'
T... | """Derive the license information and publish in docs."""
import functools
import json
import pathlib
import pkg_resources
import string
import subprocess # nosec
from typing import List, Tuple
__all__ = ['dependency_tree_console_text', 'direct_dependencies_table', 'indirect_dependencies_table']
ENCODING = 'utf-8'
T... |
#
# This file is part of LiteX.
#
# This file is Copyright (c) 2013-2014 Sebastien Bourdeauducq <sb@m-labs.hk>
# This file is Copyright (c) 2014-2019 Florent Kermarrec <florent@enjoy-digital.fr>
# This file is Copyright (c) 2018 Dolu1990 <charles.papon.90@gmail.com>
# This file is Copyright (c) 2019 Gabriel L. Somlo <g... | #
# This file is part of LiteX.
#
# This file is Copyright (c) 2013-2014 Sebastien Bourdeauducq <sb@m-labs.hk>
# This file is Copyright (c) 2014-2019 Florent Kermarrec <florent@enjoy-digital.fr>
# This file is Copyright (c) 2018 Dolu1990 <charles.papon.90@gmail.com>
# This file is Copyright (c) 2019 Gabriel L. Somlo <g... |
"""Window object represented in layout."""
from bui.layout.attr import Attr
from bui.layout.component import Component
class Window(Component):
"""
Window tag, to encompass widget tags.
The window tag is the only one that is truly mandatory in your
[layout](../overview.md). It is used to describe b... | """Window object represented in layout."""
from bui.layout.attr import Attr
from bui.layout.component import Component
class Window(Component):
"""
Window tag, to encompass widget tags.
The window tag is the only one that is truly mandatory in your
[layout](../overview.md). It is used to describe b... |
import os
import re
import logging
from abc import abstractmethod
from collections import Counter
from pathlib import Path
from typing import List, Union, Dict
import gensim
import numpy as np
import torch
from bpemb import BPEmb
from deprecated import deprecated
from pytorch_pretrained_bert import (
BertTokenize... | import os
import re
import logging
from abc import abstractmethod
from collections import Counter
from pathlib import Path
from typing import List, Union, Dict
import gensim
import numpy as np
import torch
from bpemb import BPEmb
from deprecated import deprecated
from pytorch_pretrained_bert import (
BertTokenize... |
# Copyright The PyTorch Lightning team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | # Copyright The PyTorch Lightning team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... |
# -*- coding: utf-8 -*-
"""Click commands."""
import os
from glob import glob
from subprocess import call
import click
HERE = os.path.abspath(os.path.dirname(__file__))
PROJECT_ROOT = os.path.join(HERE, os.pardir)
TEST_PATH = os.path.join(PROJECT_ROOT, "tests")
@click.command()
def test():
"""Run the tests."""
... | # -*- coding: utf-8 -*-
"""Click commands."""
import os
from glob import glob
from subprocess import call
import click
HERE = os.path.abspath(os.path.dirname(__file__))
PROJECT_ROOT = os.path.join(HERE, os.pardir)
TEST_PATH = os.path.join(PROJECT_ROOT, "tests")
@click.command()
def test():
"""Run the tests."""
... |
# 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.
"""Extract a list of passes form the LLVM source tree.
Usage:
$ extract_passes_from_llvm_source_tree /path/to/llvm/source/root
Optionall... | # 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.
"""Extract a list of passes form the LLVM source tree.
Usage:
$ extract_passes_from_llvm_source_tree /path/to/llvm/source/root
Optionall... |
import datetime as dt
from abc import abstractmethod
from django.db import models
from tacticalrmm.middleware import get_debug_info, get_username
ACTION_TYPE_CHOICES = [
("schedreboot", "Scheduled Reboot"),
("taskaction", "Scheduled Task Action"),
("agentupdate", "Agent Update"),
("chocoinstall", "Ch... | import datetime as dt
from abc import abstractmethod
from django.db import models
from tacticalrmm.middleware import get_debug_info, get_username
ACTION_TYPE_CHOICES = [
("schedreboot", "Scheduled Reboot"),
("taskaction", "Scheduled Task Action"),
("agentupdate", "Agent Update"),
("chocoinstall", "Ch... |
#! /usr/bin/env python3
"""
Sherlock: Find Usernames Across Social Networks Module
This module contains the main logic to search for usernames at social
networks.
"""
import csv
import json
import os
import platform
import re
import sys
import random
from argparse import ArgumentParser, RawDescriptionHelpFormatter
f... | #! /usr/bin/env python3
"""
Sherlock: Find Usernames Across Social Networks Module
This module contains the main logic to search for usernames at social
networks.
"""
import csv
import json
import os
import platform
import re
import sys
import random
from argparse import ArgumentParser, RawDescriptionHelpFormatter
f... |
from . import util
from engine import metroverse as mv
def render_boosts(blocks=None, highlight=False, render_stacked=False):
active_boosts = mv.active_boosts(blocks)
names = set()
if blocks is not None:
for block in blocks:
names.update(block['buildings']['all'].keys())
large_ho... | from . import util
from engine import metroverse as mv
def render_boosts(blocks=None, highlight=False, render_stacked=False):
active_boosts = mv.active_boosts(blocks)
names = set()
if blocks is not None:
for block in blocks:
names.update(block['buildings']['all'].keys())
large_ho... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
'''
This script computes the max mean mass concentration of several pollutants
from a CSV file containing the following columns:
- 'DateTime' : ISO 8601 date and time
- 'Timestamp': seconds elapsed since 01/01/1970
- 'PM10 (µg/m3)' (optional)
- 'PM2.5 (µg/... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
'''
This script computes the max mean mass concentration of several pollutants
from a CSV file containing the following columns:
- 'DateTime' : ISO 8601 date and time
- 'Timestamp': seconds elapsed since 01/01/1970
- 'PM10 (µg/m3)' (optional)
- 'PM2.5 (µg/... |
"""
This Module interacts with Gerrit and retrieves Data from Gerrit
"""
import os
import json
import logging
import argparse
import pandas as pd
from datetime import datetime, timedelta
from json.decoder import JSONDecodeError
from urllib.parse import urlunsplit, urlencode
from typing import Tuple, Union
try:
fro... | """
This Module interacts with Gerrit and retrieves Data from Gerrit
"""
import os
import json
import logging
import argparse
import pandas as pd
from datetime import datetime, timedelta
from json.decoder import JSONDecodeError
from urllib.parse import urlunsplit, urlencode
from typing import Tuple, Union
try:
fro... |
# coding=utf-8
# Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team.
# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a cop... | # coding=utf-8
# Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team.
# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a cop... |
#!/usr/bin/env python3
# Usage: ./main.py
"""
Copyright (C) 2020-2021 John C. Allwein 'johnnyapol' (admin@johnnyapol.me)
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, includ... | #!/usr/bin/env python3
# Usage: ./main.py
"""
Copyright (C) 2020-2021 John C. Allwein 'johnnyapol' (admin@johnnyapol.me)
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, includ... |
print(f'\033[1:33m{'-'*40:^40}\033[m')
print(f'\033[1:33m{'DICIONÁRIO EM PYTHON':^40}\033[m')
print(f'\033[1:33m{'-'*40:^40}\033[m')
aluno = dict()
aluno['Nome'] = str(input('Nome: '))
aluno['Média'] = float(input(f'Média de {aluno['Nome']}: '))
if aluno['Média'] >= 7:
aluno['Situação'] = '\033[1:32mAprovado\033[... | print(f'\033[1:33m{"-"*40:^40}\033[m')
print(f'\033[1:33m{"DICIONÁRIO EM PYTHON":^40}\033[m')
print(f'\033[1:33m{"-"*40:^40}\033[m')
aluno = dict()
aluno['Nome'] = str(input('Nome: '))
aluno['Média'] = float(input(f'Média de {aluno["Nome"]}: '))
if aluno['Média'] >= 7:
aluno['Situação'] = '\033[1:32mAprovado\033[... |
#!/usr/bin/env python
"""
Import MPPT CSV data and plot it.
CSV format:
Volts,volts,amps,watts,state,mode_str,panelSN,resistance,timestamp
29.646,29.646,0.0,0.0,0,CR,B41J00052893,100000,20210913_120014.79
14.267,14.267,0.354,5.05,1,CR,B41J00052893,40.0,20210913_120016.16
"""
from __future__ import print_functi... | #!/usr/bin/env python
"""
Import MPPT CSV data and plot it.
CSV format:
Volts,volts,amps,watts,state,mode_str,panelSN,resistance,timestamp
29.646,29.646,0.0,0.0,0,CR,B41J00052893,100000,20210913_120014.79
14.267,14.267,0.354,5.05,1,CR,B41J00052893,40.0,20210913_120016.16
"""
from __future__ import print_functi... |
# Copyright 2016-2022 Swiss National Supercomputing Centre (CSCS/ETH Zurich)
# ReFrame Project Developers. See the top-level LICENSE file for details.
#
# SPDX-License-Identifier: BSD-3-Clause
import re
import json
import reframe.utility as util
import reframe.utility.jsonext as jsonext
from reframe.core.backends imp... | # Copyright 2016-2022 Swiss National Supercomputing Centre (CSCS/ETH Zurich)
# ReFrame Project Developers. See the top-level LICENSE file for details.
#
# SPDX-License-Identifier: BSD-3-Clause
import re
import json
import reframe.utility as util
import reframe.utility.jsonext as jsonext
from reframe.core.backends imp... |
# MIT License
# Copyright (c) 2020 Simon Schug, João Sacramento
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, ... | # MIT License
# Copyright (c) 2020 Simon Schug, João Sacramento
# 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, ... |
# Copyright (C) 2019 The Raphielscape Company LLC.
#
# Licensed under the Raphielscape Public License, Version 1.d (the "License");
# you may not use this file except in compliance with the License.
#
""" Userbot module containing commands related to android"""
import asyncio
import json
import re
import os
import tim... | # Copyright (C) 2019 The Raphielscape Company LLC.
#
# Licensed under the Raphielscape Public License, Version 1.d (the "License");
# you may not use this file except in compliance with the License.
#
""" Userbot module containing commands related to android"""
import asyncio
import json
import re
import os
import tim... |
# VolScan is a Binance Volatility Bot(BVT Bot)
# compatible module that generates crypto buying signals based upon negative price change & volatility.
# It does this in two different ways,
# the main one being by calculating the aggregate price change within a user defined period,
# the second way being by use of the C... | # VolScan is a Binance Volatility Bot(BVT Bot)
# compatible module that generates crypto buying signals based upon negative price change & volatility.
# It does this in two different ways,
# the main one being by calculating the aggregate price change within a user defined period,
# the second way being by use of the C... |
# Copyright (c) 2019-2022 ThatRedKite and contributors
from typing import Optional
from discord.ext import commands
from wand.image import Image as WandImage
from wand.color import Color as WandColor
import discord
import si_prefix
from math import sin, atan
from io import BytesIO
from thatkitebot.backend import uti... | # Copyright (c) 2019-2022 ThatRedKite and contributors
from typing import Optional
from discord.ext import commands
from wand.image import Image as WandImage
from wand.color import Color as WandColor
import discord
import si_prefix
from math import sin, atan
from io import BytesIO
from thatkitebot.backend import uti... |
"""
Módulo que representa um ticket, uma pessoa ou um serviço.
Não deve ser usado diretamente, mas obtido no retorno de algum método
da classe Entity ou Query.
Exemplo de uso:
>>> from pyvidesk.tickets import Tickets
>>> tickets = Tickets(token="my_token")
>>> ticket = ticket.get_by_id(3)
>>> print(ticket)
... <Mod... | """
Módulo que representa um ticket, uma pessoa ou um serviço.
Não deve ser usado diretamente, mas obtido no retorno de algum método
da classe Entity ou Query.
Exemplo de uso:
>>> from pyvidesk.tickets import Tickets
>>> tickets = Tickets(token="my_token")
>>> ticket = ticket.get_by_id(3)
>>> print(ticket)
... <Mod... |
from typing import List, Tuple
import pytest
from conftest import DeSECAPIV1Client, query_replication, NSLordClient, assert_eventually
def generate_params(dict_value_lists_by_type: dict) -> List[Tuple[str, str]]:
return [
(rr_type, value)
for rr_type in dict_value_lists_by_type.keys()
fo... | from typing import List, Tuple
import pytest
from conftest import DeSECAPIV1Client, query_replication, NSLordClient, assert_eventually
def generate_params(dict_value_lists_by_type: dict) -> List[Tuple[str, str]]:
return [
(rr_type, value)
for rr_type in dict_value_lists_by_type.keys()
fo... |
import numpy as np
def remove_values_from_list(the_list, val):
return [value for value in the_list if value != val]
def remove_values_from_list_to_float(the_list, val):
return [float(value) for value in the_list if value != val]
def load_3d_arr_from_string(arr):
arr = arr.replace('[', '').replace(']',... | import numpy as np
def remove_values_from_list(the_list, val):
return [value for value in the_list if value != val]
def remove_values_from_list_to_float(the_list, val):
return [float(value) for value in the_list if value != val]
def load_3d_arr_from_string(arr):
arr = arr.replace('[', '').replace(']',... |
# Referenced from
# https://opensource.apple.com/tarballs/xnu-7195.60.75/bsd/kern/kdebug.c
# https://gitee.com/mirrors/darwin-xnu/blob/main/bsd/kern/kdebug.c kdebug.h
import enum
import io
from construct import Struct, Const, Padding, Int32ul, Int64ul, Array, GreedyRange, Byte, FixedSized, \
CString
KDBG_CLASS... | # Referenced from
# https://opensource.apple.com/tarballs/xnu-7195.60.75/bsd/kern/kdebug.c
# https://gitee.com/mirrors/darwin-xnu/blob/main/bsd/kern/kdebug.c kdebug.h
import enum
import io
from construct import Struct, Const, Padding, Int32ul, Int64ul, Array, GreedyRange, Byte, FixedSized, \
CString
KDBG_CLASS... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.