edited_code stringlengths 17 978k | original_code stringlengths 17 978k |
|---|---|
from discord.ext import commands
import discord, random
class Events(commands.Cog):
def __init__(self, bot):
self.bot: commands.Bot = bot
@commands.Cog.listener()
async def on_ready(self):
print("Bot is Ready")
print(f"Logged in as {self.bot.user}")
print(f"Id: {self.bot.u... | from discord.ext import commands
import discord, random
class Events(commands.Cog):
def __init__(self, bot):
self.bot: commands.Bot = bot
@commands.Cog.listener()
async def on_ready(self):
print("Bot is Ready")
print(f"Logged in as {self.bot.user}")
print(f"Id: {self.bot.u... |
import json
import os
from pathlib import Path
import subprocess as sp
import sys
from textwrap import dedent
import venv
assert __name__ == "__main__"
name_kernel = "binary-embedding"
path_venv = Path(".venv").resolve()
if "-h" in sys.argv or "--help" in sys.argv:
print(
dedent(f"""\
Prepare an... | import json
import os
from pathlib import Path
import subprocess as sp
import sys
from textwrap import dedent
import venv
assert __name__ == "__main__"
name_kernel = "binary-embedding"
path_venv = Path(".venv").resolve()
if "-h" in sys.argv or "--help" in sys.argv:
print(
dedent(f"""\
Prepare an... |
#-------------------------------------------------------------------------------------------------------------------------------
# COVID19 PREDICTION IN INDIA
# FILE NAME: test.py
# DEVELOPED BY: Vigneshwar Ravichandar
# TOPICS: Regression, Machine Learning, TensorFlow
#--------------------------------------------... | #-------------------------------------------------------------------------------------------------------------------------------
# COVID19 PREDICTION IN INDIA
# FILE NAME: test.py
# DEVELOPED BY: Vigneshwar Ravichandar
# TOPICS: Regression, Machine Learning, TensorFlow
#--------------------------------------------... |
from datetime import datetime
import flask_login as login
from flask import Blueprint, Flask, Markup, redirect, request, url_for
from flask_admin import Admin, AdminIndexView, expose, helpers
from flask_admin.contrib.sqla import ModelView
from werkzeug.security import generate_password_hash
from wtforms import fields,... | from datetime import datetime
import flask_login as login
from flask import Blueprint, Flask, Markup, redirect, request, url_for
from flask_admin import Admin, AdminIndexView, expose, helpers
from flask_admin.contrib.sqla import ModelView
from werkzeug.security import generate_password_hash
from wtforms import fields,... |
"""
SiliconLife Eyeflow
Class for log batch of extracted images from detection
Author: Alex Sobral de Freitas
"""
import os
import json
import datetime
import pytz
import random
import cv2
import importlib
from pymongo import MongoClient
from bson import ObjectId
from eyeflow_sdk.file_access import FileAccess
from... | """
SiliconLife Eyeflow
Class for log batch of extracted images from detection
Author: Alex Sobral de Freitas
"""
import os
import json
import datetime
import pytz
import random
import cv2
import importlib
from pymongo import MongoClient
from bson import ObjectId
from eyeflow_sdk.file_access import FileAccess
from... |
import json
with open('sunless.dat', 'w') as f:
for name in ['areas', 'events', 'exchanges', 'personas', 'qualities']:
with open(f'{name}_import.json') as g:
data = json.loads(g.read())
for line in data:
entry = {'key': f'{name}:{line['Id']}', 'value': li... | import json
with open('sunless.dat', 'w') as f:
for name in ['areas', 'events', 'exchanges', 'personas', 'qualities']:
with open(f'{name}_import.json') as g:
data = json.loads(g.read())
for line in data:
entry = {'key': f'{name}:{line["Id"]}', 'value': li... |
import os
import shutil
import subprocess
from cookiecutter.main import cookiecutter
from pathlib import Path
import click
import yaml
from ctfcli.utils.challenge import (
create_challenge,
lint_challenge,
load_challenge,
load_installed_challenges,
sync_challenge,
)
from ctfcli.utils.config import... | import os
import shutil
import subprocess
from cookiecutter.main import cookiecutter
from pathlib import Path
import click
import yaml
from ctfcli.utils.challenge import (
create_challenge,
lint_challenge,
load_challenge,
load_installed_challenges,
sync_challenge,
)
from ctfcli.utils.config import... |
import eodslib
import os
from pathlib import Path
import pytest
import os
@pytest.mark.skip_real()
def test_create(set_output_dir, modify_id_list, unique_run_string):
output_dir = set_output_dir
conn = {
'domain': os.getenv("HOST"),
'username': os.getenv("API_USER"),
'access_token': os.... | import eodslib
import os
from pathlib import Path
import pytest
import os
@pytest.mark.skip_real()
def test_create(set_output_dir, modify_id_list, unique_run_string):
output_dir = set_output_dir
conn = {
'domain': os.getenv("HOST"),
'username': os.getenv("API_USER"),
'access_token': os.... |
"""
Author: Roman Slyusar (https://github.com/Roman-R2)
Сортировщик файлов (например фотографий)
Проблематика: скопилось много папок с фотографиями, в том числе и копий
фотографий на разных дисках, скопированных с нескольких независимых
источников в разное время.
Требования:
1. Отсортировать файлы по датам:
-. Опр... | """
Author: Roman Slyusar (https://github.com/Roman-R2)
Сортировщик файлов (например фотографий)
Проблематика: скопилось много папок с фотографиями, в том числе и копий
фотографий на разных дисках, скопированных с нескольких независимых
источников в разное время.
Требования:
1. Отсортировать файлы по датам:
-. Опр... |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... |
import threading
from typing import List, Dict
import requests
class User:
def __init__(self, user_json: dict):
self.raw = user_json
self.id: int = user_json['id']
self.is_bot: bool = user_json['is_bot']
if 'last_name' in user_json:
self.name = f"{user_json["first_name... | import threading
from typing import List, Dict
import requests
class User:
def __init__(self, user_json: dict):
self.raw = user_json
self.id: int = user_json['id']
self.is_bot: bool = user_json['is_bot']
if 'last_name' in user_json:
self.name = f"{user_json['first_name... |
import io
import json
import aiohttp
import discord
import yaml
from discord.ext import commands
from z3rsramr import parse_sram
import pyz3r
from alttprbot.alttprgen.mystery import (generate_random_game,
generate_test_game)
from alttprbot.alttprgen.preset import g... | import io
import json
import aiohttp
import discord
import yaml
from discord.ext import commands
from z3rsramr import parse_sram
import pyz3r
from alttprbot.alttprgen.mystery import (generate_random_game,
generate_test_game)
from alttprbot.alttprgen.preset import g... |
from __future__ import annotations
import typing as T
import tempfile
import importlib.resources
from pathlib import Path
import subprocess
from . import cmake_exe
def find_library(lib_name: str, lib_path: list[str], env: T.Mapping[str, str]) -> bool:
"""
check if library exists with CMake
lib_name must... | from __future__ import annotations
import typing as T
import tempfile
import importlib.resources
from pathlib import Path
import subprocess
from . import cmake_exe
def find_library(lib_name: str, lib_path: list[str], env: T.Mapping[str, str]) -> bool:
"""
check if library exists with CMake
lib_name must... |
import os
import requests
from discord.ext import commands
from cogs.bot import send_embed
class ESV(commands.Cog):
"""listens for the ESV Bible commands."""
@commands.command()
async def esv(self, ctx, *, passage: str = None):
if passage is None:
return
# Bible verse numbers... | import os
import requests
from discord.ext import commands
from cogs.bot import send_embed
class ESV(commands.Cog):
"""listens for the ESV Bible commands."""
@commands.command()
async def esv(self, ctx, *, passage: str = None):
if passage is None:
return
# Bible verse numbers... |
#!/usr/bin/env python
from __future__ import print_function
import argparse
import csv
import json
import re
import sys
import time
import closeio_api
import unidecode
from closeio_api import Client as CloseIO_API
from closeio_api.utils import count_lines, title_case, uncamel
from progressbar import ProgressBar
from... | #!/usr/bin/env python
from __future__ import print_function
import argparse
import csv
import json
import re
import sys
import time
import closeio_api
import unidecode
from closeio_api import Client as CloseIO_API
from closeio_api.utils import count_lines, title_case, uncamel
from progressbar import ProgressBar
from... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function
import asyncio
import io
import logging
import os
import warnings
import weakref
from datetime import datetime, timedelta
from glob import has_magic
from azure.core.exceptions import (
ClientAuthenticationError,
HttpRes... | # -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function
import asyncio
import io
import logging
import os
import warnings
import weakref
from datetime import datetime, timedelta
from glob import has_magic
from azure.core.exceptions import (
ClientAuthenticationError,
HttpRes... |
import sys
import subprocess
import string
### CONSTANTS ###
DIGITS = '0123456789'
LETTERS = string.ascii_letters
LETTERS_DIGITS = LETTERS + DIGITS
### Super String ###
def super_string(text, pos_start, pos_end):
result = ''
# Calculate indices
idx_start = max(text.rfind('\n', 0, pos_start.index), 0... | import sys
import subprocess
import string
### CONSTANTS ###
DIGITS = '0123456789'
LETTERS = string.ascii_letters
LETTERS_DIGITS = LETTERS + DIGITS
### Super String ###
def super_string(text, pos_start, pos_end):
result = ''
# Calculate indices
idx_start = max(text.rfind('\n', 0, pos_start.index), 0... |
import threading
from datetime import datetime
from typing import Callable, Dict, Set, List
from dataclasses import dataclass
import zmq
import zmq.auth
from zmq.backend.cython.constants import NOBLOCK
from tzlocal import get_localzone
import pytz
from vnpy.trader.constant import (
Direction,
Exchange,
Or... | import threading
from datetime import datetime
from typing import Callable, Dict, Set, List
from dataclasses import dataclass
import zmq
import zmq.auth
from zmq.backend.cython.constants import NOBLOCK
from tzlocal import get_localzone
import pytz
from vnpy.trader.constant import (
Direction,
Exchange,
Or... |
import time
import logging
import warnings
import psutil
from signal import signal, SIGINT
from py3nvml.py3nvml import *
from typing import Dict, Optional
from kge import Config, Dataset
from kge.distributed.parameter_server import init_torch_server, init_lapse_scheduler
from kge.distributed.worker_process import Work... | import time
import logging
import warnings
import psutil
from signal import signal, SIGINT
from py3nvml.py3nvml import *
from typing import Dict, Optional
from kge import Config, Dataset
from kge.distributed.parameter_server import init_torch_server, init_lapse_scheduler
from kge.distributed.worker_process import Work... |
from migrate_postgres import create_category, create_activity, activate_activity
GUIAS = ["1_conceptos.tex", "13_excepciones.tex", "17_PilasColas.tex",
"20_ordenamiento_recursivo.tex", "5_ciclos.tex", "9_diccionarios.tex",
"10_contratos.tex", "14_objetos.tex", "18_Modelo_de_ejecucion.tex",
"... | from migrate_postgres import create_category, create_activity, activate_activity
GUIAS = ["1_conceptos.tex", "13_excepciones.tex", "17_PilasColas.tex",
"20_ordenamiento_recursivo.tex", "5_ciclos.tex", "9_diccionarios.tex",
"10_contratos.tex", "14_objetos.tex", "18_Modelo_de_ejecucion.tex",
"... |
import re
f = lambda x: x.split(' ')[0].upper() + (' ' in x and f" {x.split(" ", 1)[1]}" or '')
with open('raw_html_bits') as fd:
raw_html = fd.read()
al = re.findall(r"^<td axis=\".{6}\|\d+\|\d+/?\d*\|([^\"]+)\">([^<].+)</td>$", raw_html, re.MULTILINE)
#al.insert(0xCB, ("BITS", "BITS"))
#al.insert(0xDD, ("IX",... | import re
f = lambda x: x.split(' ')[0].upper() + (' ' in x and f" {x.split(' ', 1)[1]}" or '')
with open('raw_html_bits') as fd:
raw_html = fd.read()
al = re.findall(r"^<td axis=\".{6}\|\d+\|\d+/?\d*\|([^\"]+)\">([^<].+)</td>$", raw_html, re.MULTILINE)
#al.insert(0xCB, ("BITS", "BITS"))
#al.insert(0xDD, ("IX",... |
import asyncio
import nextcord
from nextcord.ext import commands
from ..tools.Embeds import embeds
import uuid
import datetime
import os
from ..tools.Athena import Athena
class moderation(commands.Cog, embeds):
LOAD = True
NAME = "Moderation"
def __init__(self, client: Athena):
sel... | import asyncio
import nextcord
from nextcord.ext import commands
from ..tools.Embeds import embeds
import uuid
import datetime
import os
from ..tools.Athena import Athena
class moderation(commands.Cog, embeds):
LOAD = True
NAME = "Moderation"
def __init__(self, client: Athena):
sel... |
import demistomock as demisto
from CommonServerPython import *
from CommonServerUserPython import *
''' IMPORTS '''
from datetime import datetime
from typing import Dict, List, Any, Optional, Tuple
import uuid
import json
import requests
# disable insecure warnings
requests.packages.urllib3.disable_warnings()
''' GL... | import demistomock as demisto
from CommonServerPython import *
from CommonServerUserPython import *
''' IMPORTS '''
from datetime import datetime
from typing import Dict, List, Any, Optional, Tuple
import uuid
import json
import requests
# disable insecure warnings
requests.packages.urllib3.disable_warnings()
''' GL... |
# Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Matti Hämäläinen <msh@nmr.mgh.harvard.edu>
# Denis Engemann <denis.engemann@gmail.com>
# Andrew Dykstra <andrew.r.dykstra@gmail.com>
# Teon Brooks <teon.brooks@gmail.com>
# Daniel McCloy <dan.mccloy@gmail.com>
#
#... | # Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Matti Hämäläinen <msh@nmr.mgh.harvard.edu>
# Denis Engemann <denis.engemann@gmail.com>
# Andrew Dykstra <andrew.r.dykstra@gmail.com>
# Teon Brooks <teon.brooks@gmail.com>
# Daniel McCloy <dan.mccloy@gmail.com>
#
#... |
"""Provide the Subreddit class."""
# pylint: disable=too-many-lines
import socket
from copy import deepcopy
from csv import writer
from io import StringIO
from json import dumps, loads
from os.path import basename, dirname, isfile, join
from typing import TYPE_CHECKING, Any, Dict, Generator, Iterator, List, Optional, ... | """Provide the Subreddit class."""
# pylint: disable=too-many-lines
import socket
from copy import deepcopy
from csv import writer
from io import StringIO
from json import dumps, loads
from os.path import basename, dirname, isfile, join
from typing import TYPE_CHECKING, Any, Dict, Generator, Iterator, List, Optional, ... |
import itertools
import logging
from abc import ABC, abstractmethod, ABCMeta
from copy import copy
from networkx import DiGraph, topological_sort
from networkx.drawing.nx_agraph import to_agraph
from lib.utils import powerset, format_dict, powerdict
logger = logging.getLogger("halpern_pearl")
logging.basicConfig(le... | import itertools
import logging
from abc import ABC, abstractmethod, ABCMeta
from copy import copy
from networkx import DiGraph, topological_sort
from networkx.drawing.nx_agraph import to_agraph
from lib.utils import powerset, format_dict, powerdict
logger = logging.getLogger("halpern_pearl")
logging.basicConfig(le... |
# 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.
#
# Asena UserBot - Yusuf Usta
""" Internet ile alakalı bilgileri edinmek için kullanılan UserBot modülüdür. """
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.
#
# Asena UserBot - Yusuf Usta
""" Internet ile alakalı bilgileri edinmek için kullanılan UserBot modülüdür. """
from... |
import json
from hashlib import sha256
from collections import Counter
from inputimeout import inputimeout, TimeoutOccurred
import tabulate, copy, time, datetime, requests, sys, os, random
from captcha import captcha_builder
BOOKING_URL = "https://cdn-api.co-vin.in/api/v2/appointment/schedule"
BENEFICIARIES_URL = "htt... | import json
from hashlib import sha256
from collections import Counter
from inputimeout import inputimeout, TimeoutOccurred
import tabulate, copy, time, datetime, requests, sys, os, random
from captcha import captcha_builder
BOOKING_URL = "https://cdn-api.co-vin.in/api/v2/appointment/schedule"
BENEFICIARIES_URL = "htt... |
from keyword import iskeyword
from collections import defaultdict
from django.apps import apps
from django.apps.config import MODELS_MODULE_NAME
from django.db.models.fields.files import ImageField
from .exceptions import InvalidKeyError, InvalidValueError
from .const import CONFIG_NAME, nonsense_values_together
from... | from keyword import iskeyword
from collections import defaultdict
from django.apps import apps
from django.apps.config import MODELS_MODULE_NAME
from django.db.models.fields.files import ImageField
from .exceptions import InvalidKeyError, InvalidValueError
from .const import CONFIG_NAME, nonsense_values_together
from... |
#!/usr/bin/python3
import argparse
import clickhouse_driver
import itertools
import functools
import math
import os
import pprint
import random
import re
import statistics
import string
import sys
import time
import traceback
import xml.etree.ElementTree as et
from scipy import stats
def tsv_escape(s):
return s.r... | #!/usr/bin/python3
import argparse
import clickhouse_driver
import itertools
import functools
import math
import os
import pprint
import random
import re
import statistics
import string
import sys
import time
import traceback
import xml.etree.ElementTree as et
from scipy import stats
def tsv_escape(s):
return s.r... |
import copy
import os
import tempfile
from functools import wraps
from itertools import groupby
from typing import List, Optional, Tuple, TypeVar, Union
import numpy as np
import pyarrow as pa
import pyarrow.compute as pc
from . import config
from .utils.logging import get_logger
logger = get_logger(__name__)
def... | import copy
import os
import tempfile
from functools import wraps
from itertools import groupby
from typing import List, Optional, Tuple, TypeVar, Union
import numpy as np
import pyarrow as pa
import pyarrow.compute as pc
from . import config
from .utils.logging import get_logger
logger = get_logger(__name__)
def... |
# -*- coding: utf-8 -*-
# ------------------------------------------------------------------
# Filename: <filename>
# Purpose: <purpose>
# Author: <author>
# Email: <email>
#
# Copyright (C) <copyright>
# --------------------------------------------------------------------
"""
:copyright:
<copyright>
:licen... | # -*- coding: utf-8 -*-
# ------------------------------------------------------------------
# Filename: <filename>
# Purpose: <purpose>
# Author: <author>
# Email: <email>
#
# Copyright (C) <copyright>
# --------------------------------------------------------------------
"""
:copyright:
<copyright>
:licen... |
import time
import types
import calendar
import datetime
import functools
import synapse.exc as s_exc
import synapse.common as s_common
import synapse.lib.cli as s_cli
import synapse.lib.cmd as s_cmd
import synapse.lib.time as s_time
import synapse.lib.parser as s_parser
StatHelp = '''
Gives detailed information abo... | import time
import types
import calendar
import datetime
import functools
import synapse.exc as s_exc
import synapse.common as s_common
import synapse.lib.cli as s_cli
import synapse.lib.cmd as s_cmd
import synapse.lib.time as s_time
import synapse.lib.parser as s_parser
StatHelp = '''
Gives detailed information abo... |
import json
from pyrogram import Client, filters
from firebase import firebase
from process import check, searches, truecaller_search, fb_search, logreturn, log, eyecon_search
from pyrogram.types import InlineKeyboardMarkup, InlineKeyboardButton
from creds import cred
firebase = firebase.FirebaseApplication(cred.DB_UR... | import json
from pyrogram import Client, filters
from firebase import firebase
from process import check, searches, truecaller_search, fb_search, logreturn, log, eyecon_search
from pyrogram.types import InlineKeyboardMarkup, InlineKeyboardButton
from creds import cred
firebase = firebase.FirebaseApplication(cred.DB_UR... |
# Copyright 2020 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from dataclasses import dataclass
from typing import Optional, Tuple
from pants.backend.python.lint.bandit.subsystem import Bandit
from pants.backend.python.rules import pex
from pants.ba... | # Copyright 2020 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from dataclasses import dataclass
from typing import Optional, Tuple
from pants.backend.python.lint.bandit.subsystem import Bandit
from pants.backend.python.rules import pex
from pants.ba... |
import pytest
import torch
from transformers import AutoTokenizer
from typing import List, Dict
from pkg_resources import resource_filename
from nerblackbox.modules.ner_training.data_preprocessing.tools.csv_reader import (
CsvReader,
)
from nerblackbox.modules.ner_training.data_preprocessing.tools.input_example imp... | import pytest
import torch
from transformers import AutoTokenizer
from typing import List, Dict
from pkg_resources import resource_filename
from nerblackbox.modules.ner_training.data_preprocessing.tools.csv_reader import (
CsvReader,
)
from nerblackbox.modules.ner_training.data_preprocessing.tools.input_example imp... |
#!/usr/bin/env python
# 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
#
# Authors:
# - Paul Nilsson, paul.nilsson@cern.ch, 2019-2022
from __future_... | #!/usr/bin/env python
# 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
#
# Authors:
# - Paul Nilsson, paul.nilsson@cern.ch, 2019-2022
from __future_... |
from abc import ABC, abstractmethod
from inspect import isfunction
from types import FunctionType
from typing import (
TYPE_CHECKING,
Any,
Callable,
Dict,
Generic,
List,
Mapping,
Optional,
Type,
TypeVar,
Union,
cast,
)
import dagster._check as check
from dagster.core.ass... | from abc import ABC, abstractmethod
from inspect import isfunction
from types import FunctionType
from typing import (
TYPE_CHECKING,
Any,
Callable,
Dict,
Generic,
List,
Mapping,
Optional,
Type,
TypeVar,
Union,
cast,
)
import dagster._check as check
from dagster.core.ass... |
# -*- coding: utf-8 -*-
import torch
import numpy as np
import contextlib
import gc
import io
import inspect
import itertools
import math
import random
import re
import copy
import os
import tempfile
import unittest
import warnings
import types
import pickle
import textwrap
import subprocess
import weakref
import sys
... | # -*- coding: utf-8 -*-
import torch
import numpy as np
import contextlib
import gc
import io
import inspect
import itertools
import math
import random
import re
import copy
import os
import tempfile
import unittest
import warnings
import types
import pickle
import textwrap
import subprocess
import weakref
import sys
... |
# 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... |
import codecs
import operator
from typing import (
TYPE_CHECKING,
Any,
Callable,
Collection,
Dict,
Iterable,
NoReturn,
Tuple,
Union,
)
from eth_typing import (
HexStr,
)
from eth_utils.curried import (
apply_formatter_at_index,
apply_formatter_if,
apply_formatter_to_... | import codecs
import operator
from typing import (
TYPE_CHECKING,
Any,
Callable,
Collection,
Dict,
Iterable,
NoReturn,
Tuple,
Union,
)
from eth_typing import (
HexStr,
)
from eth_utils.curried import (
apply_formatter_at_index,
apply_formatter_if,
apply_formatter_to_... |
"""
This sample demonstrates retrieving sensor versions by hostname
"""
# pylint: disable=C0103,W0621,E0401
import json
from falconpy.hosts import Hosts
def device_list(offset: int, limit: int):
"""
I return a list of all devices for the CID, if I max out on the query limit, I can paginate
"""
result ... | """
This sample demonstrates retrieving sensor versions by hostname
"""
# pylint: disable=C0103,W0621,E0401
import json
from falconpy.hosts import Hosts
def device_list(offset: int, limit: int):
"""
I return a list of all devices for the CID, if I max out on the query limit, I can paginate
"""
result ... |
pergunta = {
'pergunta 1': {
'pergunta': {'quanto é 2+2? '},
'respostas': {
'a': '1',
'b': '4',
'c': '5'
},
'resposta_certa': 'b'
},
'pergunta 2': {
'pergunta': {'quanto é 7x2? '},
'respostas': {
'a': '15',
... | pergunta = {
'pergunta 1': {
'pergunta': {'quanto é 2+2? '},
'respostas': {
'a': '1',
'b': '4',
'c': '5'
},
'resposta_certa': 'b'
},
'pergunta 2': {
'pergunta': {'quanto é 7x2? '},
'respostas': {
'a': '15',
... |
# This app is for educational purpose only. Insights gained is not financial advice. Use at your own risk!
import streamlit as st
from PIL import Image
import pandas as pd
import base64
import matplotlib.pyplot as plt
from bs4 import BeautifulSoup
import requests
import json
import time
import tweepy
import datetime
fr... | # This app is for educational purpose only. Insights gained is not financial advice. Use at your own risk!
import streamlit as st
from PIL import Image
import pandas as pd
import base64
import matplotlib.pyplot as plt
from bs4 import BeautifulSoup
import requests
import json
import time
import tweepy
import datetime
fr... |
from webull import webull, streamconn
# cli.py
import click
import pickle
import os
HEADER = '\033[95m'
BLUE = '\033[94m'
CYAN = '\033[96m'
GREEN = '\033[92m'
WARNING = '\033[93m'
FAIL = '\033[91m'
ENDC = '\033[0m'
BOLD = '\033[1m'
UNDERLINE = '\033[4m'
RED = '\u001b[31m'
YELLOW = '\u001b[33m'
MAGENTA = '\u001b[35m'
S... | from webull import webull, streamconn
# cli.py
import click
import pickle
import os
HEADER = '\033[95m'
BLUE = '\033[94m'
CYAN = '\033[96m'
GREEN = '\033[92m'
WARNING = '\033[93m'
FAIL = '\033[91m'
ENDC = '\033[0m'
BOLD = '\033[1m'
UNDERLINE = '\033[4m'
RED = '\u001b[31m'
YELLOW = '\u001b[33m'
MAGENTA = '\u001b[35m'
S... |
import json
import re
import subprocess
import urllib.error
import urllib.request
import xml.etree.ElementTree as ET
from pathlib import Path
from typing import List, Optional, Tuple
from urllib.parse import urljoin, urlparse
from .error import NurError
from .manifest import LockedVersion, Repo, RepoType
def fetch_c... | import json
import re
import subprocess
import urllib.error
import urllib.request
import xml.etree.ElementTree as ET
from pathlib import Path
from typing import List, Optional, Tuple
from urllib.parse import urljoin, urlparse
from .error import NurError
from .manifest import LockedVersion, Repo, RepoType
def fetch_c... |
import base64
import json
import os
import pathlib
import sys
import time
from test.apps.openapi.schema import OpenAPIVersion
from test.utils import HERE, SIMPLE_PATH
from urllib.parse import urljoin
import hypothesis
import pytest
import requests
import trustme
import yaml
from _pytest.main import ExitCode
from hypot... | import base64
import json
import os
import pathlib
import sys
import time
from test.apps.openapi.schema import OpenAPIVersion
from test.utils import HERE, SIMPLE_PATH
from urllib.parse import urljoin
import hypothesis
import pytest
import requests
import trustme
import yaml
from _pytest.main import ExitCode
from hypot... |
import glob
import shutil
from pathlib import Path
import src.calculate_energy_density as energy_func
import src.calculate_h1 as h1_func
import src.calculate_sfr as sfr_func
import src.helper as helper
import src.calculate_surface_density as surf_func
import src.calculate_radio_sfr as radio_sfr
def copy_to_out(confi... | import glob
import shutil
from pathlib import Path
import src.calculate_energy_density as energy_func
import src.calculate_h1 as h1_func
import src.calculate_sfr as sfr_func
import src.helper as helper
import src.calculate_surface_density as surf_func
import src.calculate_radio_sfr as radio_sfr
def copy_to_out(confi... |
import logging
import time
from typing import List
from spaceone.core.utils import *
from spaceone.inventory.connector.aws_kinesis_data_stream_connector.schema.data import StreamDescription, Consumers
from spaceone.inventory.connector.aws_kinesis_data_stream_connector.schema.resource import StreamResource, KDSResponse... | import logging
import time
from typing import List
from spaceone.core.utils import *
from spaceone.inventory.connector.aws_kinesis_data_stream_connector.schema.data import StreamDescription, Consumers
from spaceone.inventory.connector.aws_kinesis_data_stream_connector.schema.resource import StreamResource, KDSResponse... |
"""
Copyright 2021 BlazeMeter Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software... | """
Copyright 2021 BlazeMeter Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software... |
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import annotations
import copy
import inspect
import json
import re
import typing
from collections import defaultdict
from dataclasses import dataclass
from enum import En... | # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import annotations
import copy
import inspect
import json
import re
import typing
from collections import defaultdict
from dataclasses import dataclass
from enum import En... |
frase = str(input('Digite uma frase: ')).strip().upper()
print(f'A letra A aparece {frase.count('A')} vezes.')
print(f'A primeira letra apareceu na posição {frase.find('A')+1}')
print(f'A ultima letra apareceu na posição {frase.rfind('A')+1}') | frase = str(input('Digite uma frase: ')).strip().upper()
print(f'A letra A aparece {frase.count("A")} vezes.')
print(f'A primeira letra apareceu na posição {frase.find("A")+1}')
print(f'A ultima letra apareceu na posição {frase.rfind("A")+1}') |
import hashlib
import os
import smtplib
import time
import zipfile
from wsgiref.util import FileWrapper
from django.http import StreamingHttpResponse
from django.utils import timezone
from django.utils.decorators import method_decorator
from django.views.decorators.csrf import ensure_csrf_cookie, csrf_exempt
from djan... | import hashlib
import os
import smtplib
import time
import zipfile
from wsgiref.util import FileWrapper
from django.http import StreamingHttpResponse
from django.utils import timezone
from django.utils.decorators import method_decorator
from django.views.decorators.csrf import ensure_csrf_cookie, csrf_exempt
from djan... |
from itertools import chain
from typing import List
from collections import namedtuple, defaultdict
import logging
logger = logging.getLogger()
EC2Url = namedtuple('EC2Url', ['url', 'instance_id'])
def get_ec2_urls(ec2_client) -> List[EC2Url]:
"""
Returns a collection of EC2 instances URL addresses
whic... | from itertools import chain
from typing import List
from collections import namedtuple, defaultdict
import logging
logger = logging.getLogger()
EC2Url = namedtuple('EC2Url', ['url', 'instance_id'])
def get_ec2_urls(ec2_client) -> List[EC2Url]:
"""
Returns a collection of EC2 instances URL addresses
whic... |
import itertools
import json
import time
import click
from flask import current_app
from flask.cli import with_appcontext
from app.common import client
from app.common import datasets as datasets_fcts
from app.common import path
from app.common.projection import epsg_string_to_proj4
from app.models import geofile, st... | import itertools
import json
import time
import click
from flask import current_app
from flask.cli import with_appcontext
from app.common import client
from app.common import datasets as datasets_fcts
from app.common import path
from app.common.projection import epsg_string_to_proj4
from app.models import geofile, st... |
import json
from pathlib import (
Path,
)
from typing import (
TYPE_CHECKING,
Any,
Dict,
Generator,
Iterable,
List,
Optional,
Tuple,
Type,
Union,
cast,
)
from eth_typing import (
URI,
Address,
ContractName,
Manifest,
)
from eth_utils import (
to_canon... | import json
from pathlib import (
Path,
)
from typing import (
TYPE_CHECKING,
Any,
Dict,
Generator,
Iterable,
List,
Optional,
Tuple,
Type,
Union,
cast,
)
from eth_typing import (
URI,
Address,
ContractName,
Manifest,
)
from eth_utils import (
to_canon... |
# SPDX-License-Identifier: MIT
#
# Copyright (c) 2021 The Anvil Extras project team members listed at
# https://github.com/anvilistas/anvil-extras/graphs/contributors
#
# This software is published at https://github.com/anvilistas/anvil-extras
import random
import anvil.js
from anvil import Component as _Component
fro... | # SPDX-License-Identifier: MIT
#
# Copyright (c) 2021 The Anvil Extras project team members listed at
# https://github.com/anvilistas/anvil-extras/graphs/contributors
#
# This software is published at https://github.com/anvilistas/anvil-extras
import random
import anvil.js
from anvil import Component as _Component
fro... |
"""Command line interface including input and output."""
import argparse
import sys
from seedrecover.wordlist import Wordlist
from seedrecover.order import iterate
from seedrecover.keyderiv import seed_to_stakeaddress, ChecksumError
from seedrecover.stakecheck import StakeAddresses
from seedrecover.bfstakecheck import... | """Command line interface including input and output."""
import argparse
import sys
from seedrecover.wordlist import Wordlist
from seedrecover.order import iterate
from seedrecover.keyderiv import seed_to_stakeaddress, ChecksumError
from seedrecover.stakecheck import StakeAddresses
from seedrecover.bfstakecheck import... |
#!/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... |
import os
import shutil
from pathlib import Path
from typing import Any, Dict, List, Optional, Tuple
import yaml
from plotter import __version__
from plotter.consensus.coinbase import create_puzzlehash_for_pk
from plotter.ssl.create_ssl import generate_ca_signed_cert, get_plotter_ca_crt_key, make_ca_cert
from plotter... | import os
import shutil
from pathlib import Path
from typing import Any, Dict, List, Optional, Tuple
import yaml
from plotter import __version__
from plotter.consensus.coinbase import create_puzzlehash_for_pk
from plotter.ssl.create_ssl import generate_ca_signed_cert, get_plotter_ca_crt_key, make_ca_cert
from plotter... |
"""Select platform for Advantage Air integration."""
from homeassistant.components.select import SelectEntity
from .const import DOMAIN as ADVANTAGE_AIR_DOMAIN
from .entity import AdvantageAirEntity
ADVANTAGE_AIR_INACTIVE = "Inactive"
async def async_setup_entry(hass, config_entry, async_add_entities):
"""Set ... | """Select platform for Advantage Air integration."""
from homeassistant.components.select import SelectEntity
from .const import DOMAIN as ADVANTAGE_AIR_DOMAIN
from .entity import AdvantageAirEntity
ADVANTAGE_AIR_INACTIVE = "Inactive"
async def async_setup_entry(hass, config_entry, async_add_entities):
"""Set ... |
import boto3
import os
from botocore.exceptions import ClientError, NoCredentialsError
class AWS:
def __init__(self, logger):
self.aws_authenticated = False
self.set_logger(logger)
self._set_account_id()
self._set_region()
self.get_notification_variables()
self.boto... | import boto3
import os
from botocore.exceptions import ClientError, NoCredentialsError
class AWS:
def __init__(self, logger):
self.aws_authenticated = False
self.set_logger(logger)
self._set_account_id()
self._set_region()
self.get_notification_variables()
self.boto... |
import os
import json
import time
import logging
import functools
from typing import List, Any, Optional, Callable, Union, Tuple, Dict
from web3 import Web3
from web3.eth import Contract
from web3.contract import ContractFunction
from web3.types import (
TxParams,
Wei,
Address,
ChecksumAddress,
ENS... | import os
import json
import time
import logging
import functools
from typing import List, Any, Optional, Callable, Union, Tuple, Dict
from web3 import Web3
from web3.eth import Contract
from web3.contract import ContractFunction
from web3.types import (
TxParams,
Wei,
Address,
ChecksumAddress,
ENS... |
"""
Built on https://github.com/ranahaani/GNews/blob/master/gnews/gnews.py
"""
import re
import httpx
import logging
import feedparser
import urllib.request
from pathlib import Path
from bs4 import BeautifulSoup as Soup
from typing import List, Union, Dict
from .gnews_utils import AVAILABLE_COUNTRIES, AVAILABLE_LANGUA... | """
Built on https://github.com/ranahaani/GNews/blob/master/gnews/gnews.py
"""
import re
import httpx
import logging
import feedparser
import urllib.request
from pathlib import Path
from bs4 import BeautifulSoup as Soup
from typing import List, Union, Dict
from .gnews_utils import AVAILABLE_COUNTRIES, AVAILABLE_LANGUA... |
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import annotations
import os
from dataclasses import dataclass
from pathlib import PurePath
from typing import Sequence
from pants.engine.engine_aware import EngineAwareP... | # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import annotations
import os
from dataclasses import dataclass
from pathlib import PurePath
from typing import Sequence
from pants.engine.engine_aware import EngineAwareP... |
from data import features
from player import message_output
import random
import time
class Character:
def __init__(self, params):
self.name = params['name']
self.lives = params['lives']
self.energy = params['energy']
self.energy_max = params['energy_max']
self.energy_name ... | from data import features
from player import message_output
import random
import time
class Character:
def __init__(self, params):
self.name = params['name']
self.lives = params['lives']
self.energy = params['energy']
self.energy_max = params['energy_max']
self.energy_name ... |
import os
os.system("python3 webserver.py &")
import asyncio
import uvloop
import sys
import discord
import ps2
import pyps4
from fortnitepy.ext import commands
asyncio.set_event_loop_policy(uvloop.EventLoopPolicy())
try:
from typing import Any, Union, Optional
import asyncio
import datetime
import j... | import os
os.system("python3 webserver.py &")
import asyncio
import uvloop
import sys
import discord
import ps2
import pyps4
from fortnitepy.ext import commands
asyncio.set_event_loop_policy(uvloop.EventLoopPolicy())
try:
from typing import Any, Union, Optional
import asyncio
import datetime
import j... |
import json
import psycopg2
print("Populating points")
with open('fixtures/cols-and-passes.json') as f:
points = json.loads(f.read())
values = []
for point in points:
values.append(f"('{point["name"]}', '{point["lat"]}', '{point["lng"]}', (SELECT id FROM regions WHERE name='{point["region"]}')),... | import json
import psycopg2
print("Populating points")
with open('fixtures/cols-and-passes.json') as f:
points = json.loads(f.read())
values = []
for point in points:
values.append(f"('{point['name']}', '{point['lat']}', '{point['lng']}', (SELECT id FROM regions WHERE name='{point['region']}')),... |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... |
# coding=utf-8
# Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team.
# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a cop... | # coding=utf-8
# Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team.
# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a cop... |
import sys
import logging
from lusid.utilities import ApiClientFactory
from lusidtools.cocoon import (
load_data_to_df_and_detect_delimiter,
load_from_data_frame,
parse_args,
identify_cash_items,
validate_mapping_file_structure,
load_json_file,
cocoon_printer,
)
from lusidtools.logger impor... | import sys
import logging
from lusid.utilities import ApiClientFactory
from lusidtools.cocoon import (
load_data_to_df_and_detect_delimiter,
load_from_data_frame,
parse_args,
identify_cash_items,
validate_mapping_file_structure,
load_json_file,
cocoon_printer,
)
from lusidtools.logger impor... |
import discord
import git
from discord.ext import commands
from discord.ext.commands import CommandNotFound
class Management(commands.Cog):
"""
Set of commands for Administration.
"""
def __init__(self, bot):
self.bot = bot
@commands.Cog.listener()
async def on_error(self, ctx, err... | import discord
import git
from discord.ext import commands
from discord.ext.commands import CommandNotFound
class Management(commands.Cog):
"""
Set of commands for Administration.
"""
def __init__(self, bot):
self.bot = bot
@commands.Cog.listener()
async def on_error(self, ctx, err... |
import abc
# import asyncio
import shared.utilities.util as util
# import json
import importlib
# import sys
from daq.daq import DAQ
from daq.interface.ifdevice import IFDevice, DummyIFDevice, IFDeviceFactory
from daq.manager.manager import Managers
class InterfaceFactory():
@staticmethod
def create(config, ... | import abc
# import asyncio
import shared.utilities.util as util
# import json
import importlib
# import sys
from daq.daq import DAQ
from daq.interface.ifdevice import IFDevice, DummyIFDevice, IFDeviceFactory
from daq.manager.manager import Managers
class InterfaceFactory():
@staticmethod
def create(config, ... |
# pyright: reportPropertyTypeMismatch=false
from __future__ import annotations
import collections
from datetime import timedelta
import functools
import gc
import json
import operator
import pickle
import re
from typing import (
TYPE_CHECKING,
Any,
Callable,
Hashable,
Literal,
Mapping,
Sequ... | # pyright: reportPropertyTypeMismatch=false
from __future__ import annotations
import collections
from datetime import timedelta
import functools
import gc
import json
import operator
import pickle
import re
from typing import (
TYPE_CHECKING,
Any,
Callable,
Hashable,
Literal,
Mapping,
Sequ... |
##################### generated by xml-casa (v2) from ptclean6.xml ##################
##################### 6a89d05724a14fedd7b8ceb75d841936 ##############################
from __future__ import absolute_import
from casashell.private.stack_manip import find_local as __sf__
from casashell.private.stack_manip import find... | ##################### generated by xml-casa (v2) from ptclean6.xml ##################
##################### 6a89d05724a14fedd7b8ceb75d841936 ##############################
from __future__ import absolute_import
from casashell.private.stack_manip import find_local as __sf__
from casashell.private.stack_manip import find... |
"""
This whole module and approach is a hack. It's not well documented because it's not official. But
the horse is out of the barn on this stuff and we have to do something.
"""
import base64, hashlib, random, re, string, ssl
from urllib.parse import urlencode, urlparse, parse_qs
import aiohttp
from . import loggin... | """
This whole module and approach is a hack. It's not well documented because it's not official. But
the horse is out of the barn on this stuff and we have to do something.
"""
import base64, hashlib, random, re, string, ssl
from urllib.parse import urlencode, urlparse, parse_qs
import aiohttp
from . import loggin... |
import argparse
import logging
from typing import Tuple
from deepdiff import DeepDiff
import requests
from requests.adapters import HTTPAdapter
from urllib3.util import Retry
from urllib.parse import quote
import pprint
from concurrent.futures import ThreadPoolExecutor
import os
import random
import math
def diff_res... | import argparse
import logging
from typing import Tuple
from deepdiff import DeepDiff
import requests
from requests.adapters import HTTPAdapter
from urllib3.util import Retry
from urllib.parse import quote
import pprint
from concurrent.futures import ThreadPoolExecutor
import os
import random
import math
def diff_res... |
"""Pair plot between variables of latent space"""
from configparser import ConfigParser, ExtendedInterpolation
import glob
import time
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import seaborn as sns
from sdss.utils.managefiles import FileDirectory
from sdss.utils.configfile import Configu... | """Pair plot between variables of latent space"""
from configparser import ConfigParser, ExtendedInterpolation
import glob
import time
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import seaborn as sns
from sdss.utils.managefiles import FileDirectory
from sdss.utils.configfile import Configu... |
#!/usr/bin/env python3
"""Generate an updated requirements_all.txt."""
import difflib
import importlib
import os
from pathlib import Path
import pkgutil
import re
import sys
from homeassistant.util.yaml.loader import load_yaml
from script.hassfest.model import Integration
COMMENT_REQUIREMENTS = (
"Adafruit_BBIO",... | #!/usr/bin/env python3
"""Generate an updated requirements_all.txt."""
import difflib
import importlib
import os
from pathlib import Path
import pkgutil
import re
import sys
from homeassistant.util.yaml.loader import load_yaml
from script.hassfest.model import Integration
COMMENT_REQUIREMENTS = (
"Adafruit_BBIO",... |
import clinica.pipelines.engine as cpe
class SpatialSVM(cpe.Pipeline):
"""SpatialSVM - Prepare input data for SVM with spatial and anatomical regularization.
Returns:
A clinica pipeline object containing the SpatialSVM pipeline.
"""
def check_pipeline_parameters(self):
"""Check pipel... | import clinica.pipelines.engine as cpe
class SpatialSVM(cpe.Pipeline):
"""SpatialSVM - Prepare input data for SVM with spatial and anatomical regularization.
Returns:
A clinica pipeline object containing the SpatialSVM pipeline.
"""
def check_pipeline_parameters(self):
"""Check pipel... |
import re
import shlex
import asyncio
import warnings
from datetime import datetime
from functools import partial, update_wrapper
from typing import (Tuple, Union, Callable, Iterable, Any, Optional, List, Dict,
Awaitable, Pattern, Type)
from aiocqhttp import Event as CQEvent
from aiocqhttp.message ... | import re
import shlex
import asyncio
import warnings
from datetime import datetime
from functools import partial, update_wrapper
from typing import (Tuple, Union, Callable, Iterable, Any, Optional, List, Dict,
Awaitable, Pattern, Type)
from aiocqhttp import Event as CQEvent
from aiocqhttp.message ... |
import cv2
import numpy as np
import png
import os
import pydicom
def get_png_filename(row):
""" 'D1-0000_L_A-R_mass_malignant|triple negative.png'
"""
fname = get_filename(row)
fname += ".png" # if not row['PatientName'] in PIDS_TO_CHECK else '-wrong.png'
return fname
def get_filename(row):
... | import cv2
import numpy as np
import png
import os
import pydicom
def get_png_filename(row):
""" 'D1-0000_L_A-R_mass_malignant|triple negative.png'
"""
fname = get_filename(row)
fname += ".png" # if not row['PatientName'] in PIDS_TO_CHECK else '-wrong.png'
return fname
def get_filename(row):
... |
#!/usr/bin/env python3
import os
import re
import sys
script_dir = os.path.dirname(__file__)
directory_to_check = os.path.join(script_dir, "../book/content/")
def remove_comments(text_string):
"""Function to omit html comment identifiers in a text string using
regular expression matches
Arguments:
text_st... | #!/usr/bin/env python3
import os
import re
import sys
script_dir = os.path.dirname(__file__)
directory_to_check = os.path.join(script_dir, "../book/content/")
def remove_comments(text_string):
"""Function to omit html comment identifiers in a text string using
regular expression matches
Arguments:
text_st... |
#!/usr/bin/env python3
from discord.permissions import permission_alias
import requests
from urllib.parse import urlsplit, parse_qs
import base64
import time
import json
from datetime import datetime
class MYGES:
def __init__(self, discordid, username=None, password=None):
self.actionurl = "https://api.ko... | #!/usr/bin/env python3
from discord.permissions import permission_alias
import requests
from urllib.parse import urlsplit, parse_qs
import base64
import time
import json
from datetime import datetime
class MYGES:
def __init__(self, discordid, username=None, password=None):
self.actionurl = "https://api.ko... |
import hashlib
import re
from sqlalchemy.exc import IntegrityError
from atst.database import db
from atst.domain.exceptions import AlreadyExistsError
def first_or_none(predicate, lst):
return next((x for x in lst if predicate(x)), None)
def getattr_path(obj, path, default=None):
_obj = obj
for item in... | import hashlib
import re
from sqlalchemy.exc import IntegrityError
from atst.database import db
from atst.domain.exceptions import AlreadyExistsError
def first_or_none(predicate, lst):
return next((x for x in lst if predicate(x)), None)
def getattr_path(obj, path, default=None):
_obj = obj
for item in... |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
__author__ = 'Richard J. Sears'
VERSION = "0.6 (2021-04-22)"
### Simple python script that helps to move my chia plots from my plotter to
### my nas. I wanted to use netcat as it was much faster on my 10GBe link than
### rsync and the servers are secure so I wrote this scri... | #!/usr/bin/python3
# -*- coding: utf-8 -*-
__author__ = 'Richard J. Sears'
VERSION = "0.6 (2021-04-22)"
### Simple python script that helps to move my chia plots from my plotter to
### my nas. I wanted to use netcat as it was much faster on my 10GBe link than
### rsync and the servers are secure so I wrote this scri... |
import abc
import textwrap
import warnings
from copy import deepcopy
from collections import namedtuple
from collections.abc import Mapping
import astropy.nddata
import astropy.units as u
import numpy as np
from astropy.units import UnitsError
try:
# Import sunpy coordinates if available to register the frames an... | import abc
import textwrap
import warnings
from copy import deepcopy
from collections import namedtuple
from collections.abc import Mapping
import astropy.nddata
import astropy.units as u
import numpy as np
from astropy.units import UnitsError
try:
# Import sunpy coordinates if available to register the frames an... |
from datetime import date
import shutil
from pathlib import Path
from typing import (
AbstractSet,
Any,
Callable,
Iterable,
List,
Tuple,
TypeVar,
Union,
Optional,
Dict,
Mapping,
)
from adam.language.language_utils import (
phase2_language_generator,
integrated_experim... | from datetime import date
import shutil
from pathlib import Path
from typing import (
AbstractSet,
Any,
Callable,
Iterable,
List,
Tuple,
TypeVar,
Union,
Optional,
Dict,
Mapping,
)
from adam.language.language_utils import (
phase2_language_generator,
integrated_experim... |
"""
Manipulation of EPI data.
.. testsetup::
>>> tmpdir = getfixture('tmpdir')
>>> tmp = tmpdir.chdir() # changing to a temporary directory
>>> nb.Nifti1Image(np.zeros((90, 90, 60)), None, None).to_filename(
... tmpdir.join('epi.nii.gz').strpath)
"""
def get_trt(in_meta, in_file=None):
r"""... | """
Manipulation of EPI data.
.. testsetup::
>>> tmpdir = getfixture('tmpdir')
>>> tmp = tmpdir.chdir() # changing to a temporary directory
>>> nb.Nifti1Image(np.zeros((90, 90, 60)), None, None).to_filename(
... tmpdir.join('epi.nii.gz').strpath)
"""
def get_trt(in_meta, in_file=None):
r"""... |
from __future__ import annotations
from enum import Enum
from re import match
from typing import Optional
from typing import Dict
from typing import List
from pathlib import Path
from jmm.utilities.functions import get_number
class Direction(Enum):
FORWARD = 1
BACKWARD = -1
class SubtitleType(Enum):
NON... | from __future__ import annotations
from enum import Enum
from re import match
from typing import Optional
from typing import Dict
from typing import List
from pathlib import Path
from jmm.utilities.functions import get_number
class Direction(Enum):
FORWARD = 1
BACKWARD = -1
class SubtitleType(Enum):
NON... |
# Contains functions and helpers to obtain and interact with REDCap API data.
import json
import requests
################################################################
#### Metadata behavior
################################################################
def _request_metadata(secrets_dict: dict) -> str:
'''M... | # Contains functions and helpers to obtain and interact with REDCap API data.
import json
import requests
################################################################
#### Metadata behavior
################################################################
def _request_metadata(secrets_dict: dict) -> str:
'''M... |
#!/usr/bin/env python3
""" eGenix Antispam Bot for Telegram Challenges
Written by Marc-Andre Lemburg in 2022.
Copyright (c) 2022, eGenix.com Software GmbH; mailto:info@egenix.com
License: MIT
"""
import random
import re
from telegram_antispam_bot.config import (
CHALLENGE_CHARS,
CHALLENGE... | #!/usr/bin/env python3
""" eGenix Antispam Bot for Telegram Challenges
Written by Marc-Andre Lemburg in 2022.
Copyright (c) 2022, eGenix.com Software GmbH; mailto:info@egenix.com
License: MIT
"""
import random
import re
from telegram_antispam_bot.config import (
CHALLENGE_CHARS,
CHALLENGE... |
import rebase.util.api_request as api_request
import requests
import json
import dill
import rebase as rb
def create(site_id, model):
"""Create a new model for the specified site
Args:
site_id (str): the id of the site
model (class): the model class to create
Returns:
str: -
... | import rebase.util.api_request as api_request
import requests
import json
import dill
import rebase as rb
def create(site_id, model):
"""Create a new model for the specified site
Args:
site_id (str): the id of the site
model (class): the model class to create
Returns:
str: -
... |
"""Defines the linter class."""
import os
import time
import logging
from typing import (
Any,
Generator,
List,
Sequence,
Optional,
Tuple,
Union,
cast,
Iterable,
)
import pathspec
from sqlfluff.core.errors import (
SQLBaseError,
SQLLexError,
SQLLintError,
SQLParseE... | """Defines the linter class."""
import os
import time
import logging
from typing import (
Any,
Generator,
List,
Sequence,
Optional,
Tuple,
Union,
cast,
Iterable,
)
import pathspec
from sqlfluff.core.errors import (
SQLBaseError,
SQLLexError,
SQLLintError,
SQLParseE... |
from os import error, name, supports_bytes_environ
import clean
import phone_book as pb
import notes_book_1 as nb
# tuple with commands words
EXIT_COMMANDS = ("good bye", "close", "exit", "bye")
FIND_COMMANDS = ("find",)
EDIT_COMMANDS = ("edit",)
BIRTHDAY_COMMANDS = ("birthday",)
SELECT_COMMANDS = ("select", "sel")
A... | from os import error, name, supports_bytes_environ
import clean
import phone_book as pb
import notes_book_1 as nb
# tuple with commands words
EXIT_COMMANDS = ("good bye", "close", "exit", "bye")
FIND_COMMANDS = ("find",)
EDIT_COMMANDS = ("edit",)
BIRTHDAY_COMMANDS = ("birthday",)
SELECT_COMMANDS = ("select", "sel")
A... |
import json
from typing import Type, Union, Dict
import webbrowser
from jose import jwt
from keycloak import KeycloakOpenID
class AuthenticationClient:
"""A facade for the some authentication implementation, currently keycloak."""
issuer = None
json_web_key_set: dict = {}
def __init__(self, conf:... |
import json
from typing import Type, Union, Dict
import webbrowser
from jose import jwt
from keycloak import KeycloakOpenID
class AuthenticationClient:
"""A facade for the some authentication implementation, currently keycloak."""
issuer = None
json_web_key_set: dict = {}
def __init__(self, conf:... |
"""
Copyright (c) 2018 iCyP
Released under the MIT license
https://opensource.org/licenses/mit-license.php
"""
from .. import V_Types as VRM_Types
def bone(node) -> VRM_Types.Node:
v_node = VRM_Types.Node()
if "name" in node:
v_node.name = node["name"]
else:
v_node.name = "tmp"
v_nod... | """
Copyright (c) 2018 iCyP
Released under the MIT license
https://opensource.org/licenses/mit-license.php
"""
from .. import V_Types as VRM_Types
def bone(node) -> VRM_Types.Node:
v_node = VRM_Types.Node()
if "name" in node:
v_node.name = node["name"]
else:
v_node.name = "tmp"
v_nod... |
# Copyright (c) 2013-2014 Will Thames <will@thames.id.au>
#
# 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... | # Copyright (c) 2013-2014 Will Thames <will@thames.id.au>
#
# 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... |
# 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
tt = ('1', '2', '3', '2', '4', '5', '1', '2', '3', '4', '5', '3', '3', '6', '7', '8')
'''
1 -> 2
2 -> 3
3 -> 4
'''
print(tt)
print(' --- count ---')
print(tt.count(1))
print(tt.count(2))
print(tt.count(3))
print(' --- index ---')
prin... | # 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
tt = ('1', '2', '3', '2', '4', '5', '1', '2', '3', '4', '5', '3', '3', '6', '7', '8')
'''
1 -> 2
2 -> 3
3 -> 4
'''
print(tt)
print(' --- count ---')
print(tt.count(1))
print(tt.count(2))
print(tt.count(3))
print(' --- index ---')
prin... |
from pprint import pprint
import socket
import yaml
from netmiko import (
Netmiko,
NetmikoTimeoutException,
NetmikoAuthenticationException,
)
def send_show_command(device, commands):
result = {}
if type(commands) == str:
commands = [commands]
try:
with Netmiko(**device) as ssh... | from pprint import pprint
import socket
import yaml
from netmiko import (
Netmiko,
NetmikoTimeoutException,
NetmikoAuthenticationException,
)
def send_show_command(device, commands):
result = {}
if type(commands) == str:
commands = [commands]
try:
with Netmiko(**device) as ssh... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.