edited_code stringlengths 17 978k | original_code stringlengths 17 978k |
|---|---|
import argparse
import logging
import os
import sys
import socket
import json
import pickle
import torch
from datetime import datetime
from transformers import AutoConfig, AutoTokenizer, AutoModel
from torch.utils.data import DataLoader, RandomSampler
from .framework import RerankerFramework
from ..datasets import (E... | import argparse
import logging
import os
import sys
import socket
import json
import pickle
import torch
from datetime import datetime
from transformers import AutoConfig, AutoTokenizer, AutoModel
from torch.utils.data import DataLoader, RandomSampler
from .framework import RerankerFramework
from ..datasets import (E... |
# (C) 2021 GoodData Corporation
from __future__ import annotations
import json
import os
import pytest
from gooddata_sdk.compute.model.attribute import Attribute
from gooddata_sdk.compute.model.base import ObjId
from gooddata_sdk.compute.model.execution import compute_model_to_api_model
from gooddata_sdk.compute.mod... | # (C) 2021 GoodData Corporation
from __future__ import annotations
import json
import os
import pytest
from gooddata_sdk.compute.model.attribute import Attribute
from gooddata_sdk.compute.model.base import ObjId
from gooddata_sdk.compute.model.execution import compute_model_to_api_model
from gooddata_sdk.compute.mod... |
import re
import itertools
def format_text(prefix, start, texts):
output = []
curr = []
if start:
curr.append(start)
linebreaks = 0
for text in texts:
lines = []
length = len(prefix)
if start:
length += + len(start)
# split text into words by spli... | import re
import itertools
def format_text(prefix, start, texts):
output = []
curr = []
if start:
curr.append(start)
linebreaks = 0
for text in texts:
lines = []
length = len(prefix)
if start:
length += + len(start)
# split text into words by spli... |
import csv
from tempfile import NamedTemporaryFile
from airflow.hooks.postgres_hook import PostgresHook
from airflow.hooks.S3_hook import S3Hook
from airflow.models import BaseOperator
from airflow.plugins_manager import AirflowPlugin
from airflow.utils.decorators import apply_defaults
from airflow.operators.postgres_o... | import csv
from tempfile import NamedTemporaryFile
from airflow.hooks.postgres_hook import PostgresHook
from airflow.hooks.S3_hook import S3Hook
from airflow.models import BaseOperator
from airflow.plugins_manager import AirflowPlugin
from airflow.utils.decorators import apply_defaults
from airflow.operators.postgres_o... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# math2html: convert LaTeX equations to HTML output.
#
# Copyright (C) 2009-2011 Alex Fernández
#
# Released under the terms of the `2-Clause BSD license'_, in short:
# Copying and distribution of this file, with or without modification,
# are permitted... | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# math2html: convert LaTeX equations to HTML output.
#
# Copyright (C) 2009-2011 Alex Fernández
#
# Released under the terms of the `2-Clause BSD license'_, in short:
# Copying and distribution of this file, with or without modification,
# are permitted... |
"""Sites hosted on Github"""
import base64
import json
import os.path
import re
import time
import typing
from datetime import datetime
import jwt
import requests
from flask import current_app
from ghapi.all import GhApi
from interpersonal.errors import InterpersonalNotFoundError
from interpersonal.sitetypes import ... | """Sites hosted on Github"""
import base64
import json
import os.path
import re
import time
import typing
from datetime import datetime
import jwt
import requests
from flask import current_app
from ghapi.all import GhApi
from interpersonal.errors import InterpersonalNotFoundError
from interpersonal.sitetypes import ... |
"""
Module that handles the command line arguments.
"""
import sys
from argparse import _ArgumentGroup, ArgumentParser, Namespace
from spotdl import _version
from spotdl.download.progress_handler import NAME_TO_LEVEL
from spotdl.utils.ffmpeg import FFMPEG_FORMATS
from spotdl.utils.config import DEFAULT_CONFIG
from s... | """
Module that handles the command line arguments.
"""
import sys
from argparse import _ArgumentGroup, ArgumentParser, Namespace
from spotdl import _version
from spotdl.download.progress_handler import NAME_TO_LEVEL
from spotdl.utils.ffmpeg import FFMPEG_FORMATS
from spotdl.utils.config import DEFAULT_CONFIG
from s... |
import dash
import dash_html_components as html
import dash_table
import pandas as pd
from app import app
#### GET DATA
dfAPI = pd.read_csv("freqs_data.csv")
#### LAYOUT
layout = html.Div(
[
html.H6(children="All records"),
html.Div(
[
dash_table.DataTable(
... | import dash
import dash_html_components as html
import dash_table
import pandas as pd
from app import app
#### GET DATA
dfAPI = pd.read_csv("freqs_data.csv")
#### LAYOUT
layout = html.Div(
[
html.H6(children="All records"),
html.Div(
[
dash_table.DataTable(
... |
import logging
from typing import Dict, List, Optional, Tuple
import aiosqlite
from bytecash.consensus.block_record import BlockRecord
from bytecash.types.blockchain_format.sized_bytes import bytes32
from bytecash.types.full_block import FullBlock
from bytecash.types.weight_proof import SubEpochChallengeSegment, SubE... | import logging
from typing import Dict, List, Optional, Tuple
import aiosqlite
from bytecash.consensus.block_record import BlockRecord
from bytecash.types.blockchain_format.sized_bytes import bytes32
from bytecash.types.full_block import FullBlock
from bytecash.types.weight_proof import SubEpochChallengeSegment, SubE... |
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import os
import sys
import time
from concurrent.futures import ThreadPoolExecutor
from typing import Iterator, Tuple, Li... | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import os
import sys
import time
from concurrent.futures import ThreadPoolExecutor
from typing import Iterator, Tuple, Li... |
import json
import scrapy
from kingston.items import *
class ManufacturerSpider(scrapy.Spider):
"""
Get all compatible memory for all motherboards from certain manufacturer
"""
name = 'manufacturer'
allowed_domains = [
'kingston.com',
'www.kingston.com',
]
start_urls = [
... | import json
import scrapy
from kingston.items import *
class ManufacturerSpider(scrapy.Spider):
"""
Get all compatible memory for all motherboards from certain manufacturer
"""
name = 'manufacturer'
allowed_domains = [
'kingston.com',
'www.kingston.com',
]
start_urls = [
... |
import re
import click
def test_other_command_invoke(runner):
@click.command()
@click.pass_context
def cli(ctx):
return ctx.invoke(other_cmd, arg=42)
@click.command()
@click.argument("arg", type=click.INT)
def other_cmd(arg):
click.echo(arg)
result = runner.invoke(cli, [... | import re
import click
def test_other_command_invoke(runner):
@click.command()
@click.pass_context
def cli(ctx):
return ctx.invoke(other_cmd, arg=42)
@click.command()
@click.argument("arg", type=click.INT)
def other_cmd(arg):
click.echo(arg)
result = runner.invoke(cli, [... |
import os
import typing as t
from typing import TYPE_CHECKING
import numpy as np
from torch._C import device
from simple_di import inject
from simple_di import Provide
import bentoml
from bentoml import Tag
from bentoml.exceptions import BentoMLException
from bentoml.exceptions import MissingDependencyException
from... | import os
import typing as t
from typing import TYPE_CHECKING
import numpy as np
from torch._C import device
from simple_di import inject
from simple_di import Provide
import bentoml
from bentoml import Tag
from bentoml.exceptions import BentoMLException
from bentoml.exceptions import MissingDependencyException
from... |
"""IX.IO pastebin like site
Syntax: .paste
Syntax: .npaste
Syntax: .paster
Syntax: .iffuci
"""
import logging
logging.basicConfig(format='[%(levelname) 5s/%(asctime)s] %(name)s: %(message)s',
level=logging.WARNING)
import asyncio
import os
from datetime import datetime
import requests
from telethon... | """IX.IO pastebin like site
Syntax: .paste
Syntax: .npaste
Syntax: .paster
Syntax: .iffuci
"""
import logging
logging.basicConfig(format='[%(levelname) 5s/%(asctime)s] %(name)s: %(message)s',
level=logging.WARNING)
import asyncio
import os
from datetime import datetime
import requests
from telethon... |
# 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.
#
import os
import time
from datetime import datetime
import aiohttp
from github import Github
from userbot import CMD... | # 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.
#
import os
import time
from datetime import datetime
import aiohttp
from github import Github
from userbot import CMD... |
import discord
from checks.checks import *
from random import choice
from discord.ext import commands
from discord.ext.commands.cooldowns import BucketType
class NSFW:
"""NSFW Commands 🔞"""
def __init__(self, bot):
self.bot = bot
self.thumbnail = "https://i.imgur.com/ivmKTvu.png"
s... | import discord
from checks.checks import *
from random import choice
from discord.ext import commands
from discord.ext.commands.cooldowns import BucketType
class NSFW:
"""NSFW Commands 🔞"""
def __init__(self, bot):
self.bot = bot
self.thumbnail = "https://i.imgur.com/ivmKTvu.png"
s... |
# space.py
from __future__ import annotations
import abc
import json
import os
import re
import time
from typing import TYPE_CHECKING, Any, Optional
from typing import Dict, FrozenSet, List, OrderedDict
import discord
from .command import Command, CommandAlias, CommandSimple
if TYPE_CHECKING:
from .deepbluesky i... | # space.py
from __future__ import annotations
import abc
import json
import os
import re
import time
from typing import TYPE_CHECKING, Any, Optional
from typing import Dict, FrozenSet, List, OrderedDict
import discord
from .command import Command, CommandAlias, CommandSimple
if TYPE_CHECKING:
from .deepbluesky i... |
# -*- coding=utf-8 -*-
import os
import shutil
import pytest
import vistir
from requirementslib.models.requirements import Requirement
from requirementslib.models.setup_info import ast_parse_setup_py
@pytest.mark.skipif(os.name == "nt", reason="Building this is broken on windows")
@pytest.mark.parametrize(
"tes... | # -*- coding=utf-8 -*-
import os
import shutil
import pytest
import vistir
from requirementslib.models.requirements import Requirement
from requirementslib.models.setup_info import ast_parse_setup_py
@pytest.mark.skipif(os.name == "nt", reason="Building this is broken on windows")
@pytest.mark.parametrize(
"tes... |
# 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
from .. import _utilitie... | # 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
from .. import _utilitie... |
from .path import DNENode, DummyNode
from .request import Request, DummyRequest
from .response import Response, TextResponse, StaticResponse
from .error import NotResponseError, NoResponseReturnedError, NoMethodError, ResponseError
from .view import View
from queue import Empty as QueueEmpty
import asyncio
class Asgi... | from .path import DNENode, DummyNode
from .request import Request, DummyRequest
from .response import Response, TextResponse, StaticResponse
from .error import NotResponseError, NoResponseReturnedError, NoMethodError, ResponseError
from .view import View
from queue import Empty as QueueEmpty
import asyncio
class Asgi... |
"""
MIT License
Copyright (c) 2020 GamingGeek
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, dis... | """
MIT License
Copyright (c) 2020 GamingGeek
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, dis... |
import itertools
import logging
import os.path as osp
import tempfile
import mmcv
import numpy as np
from mmcv.utils import print_log
from pycocotools.coco import COCO
#from pycocotools.cocoeval import COCOeval
from mmdet.datasets.fast_eval_api import COCOeval_opt as COCOeval
from terminaltables import AsciiTable
fro... | import itertools
import logging
import os.path as osp
import tempfile
import mmcv
import numpy as np
from mmcv.utils import print_log
from pycocotools.coco import COCO
#from pycocotools.cocoeval import COCOeval
from mmdet.datasets.fast_eval_api import COCOeval_opt as COCOeval
from terminaltables import AsciiTable
fro... |
# =================================================================
#
# Terms and Conditions of Use
#
# Unless otherwise noted, computer program source code of this
# distribution is covered under Crown Copyright, Government of
# Canada, and is distributed under the MIT License.
#
# The Canada wordmark and related grap... | # =================================================================
#
# Terms and Conditions of Use
#
# Unless otherwise noted, computer program source code of this
# distribution is covered under Crown Copyright, Government of
# Canada, and is distributed under the MIT License.
#
# The Canada wordmark and related grap... |
# -*- coding: utf-8 -*-
"""command line tool
:mod:`pcapkit.__main__` was originally the module file of
|jspcapy|_, which is now deprecated and merged with :mod:`pcapkit`.
"""
import argparse
import sys
import warnings
import emoji
from pcapkit.foundation.extraction import Extractor
from pcapkit.interface import JSO... | # -*- coding: utf-8 -*-
"""command line tool
:mod:`pcapkit.__main__` was originally the module file of
|jspcapy|_, which is now deprecated and merged with :mod:`pcapkit`.
"""
import argparse
import sys
import warnings
import emoji
from pcapkit.foundation.extraction import Extractor
from pcapkit.interface import JSO... |
# import pytest
import os
import string
import random
import copy
import json
import pytest
import warnings
import jsonschema
import numpy as np
from ai2thor.controller import Controller
from ai2thor.tests.constants import TESTS_DATA_DIR
from ai2thor.wsgi_server import WsgiServer
from ai2thor.fifo_server import FifoSer... | # import pytest
import os
import string
import random
import copy
import json
import pytest
import warnings
import jsonschema
import numpy as np
from ai2thor.controller import Controller
from ai2thor.tests.constants import TESTS_DATA_DIR
from ai2thor.wsgi_server import WsgiServer
from ai2thor.fifo_server import FifoSer... |
galera = []
pessoa = {}
soma = media = 0
while True:
pessoa.clear()
pessoa['nome'] = str(input('Nome: '))
while True:
pessoa['sexo'] = str(input('Sexo: [M/F] ')).upper()[0]
if pessoa['sexo'] in 'MF':
break
print('ERRO. Digite apenas "M" ou "F".')
pessoa['idade'] = int... | galera = []
pessoa = {}
soma = media = 0
while True:
pessoa.clear()
pessoa['nome'] = str(input('Nome: '))
while True:
pessoa['sexo'] = str(input('Sexo: [M/F] ')).upper()[0]
if pessoa['sexo'] in 'MF':
break
print('ERRO. Digite apenas "M" ou "F".')
pessoa['idade'] = int... |
import json
import time
import datetime
from enum import Enum
from itertools import chain
from threading import Thread
from typing import List, Iterator, Optional
import telegram
from telegram import InlineKeyboardMarkup, InlineKeyboardButton
from telegram.ext import (CallbackQueryHandler, ConversationHandler,
Command... | import json
import time
import datetime
from enum import Enum
from itertools import chain
from threading import Thread
from typing import List, Iterator, Optional
import telegram
from telegram import InlineKeyboardMarkup, InlineKeyboardButton
from telegram.ext import (CallbackQueryHandler, ConversationHandler,
Command... |
from checkov.common.models.enums import CheckCategories, CheckResult
from checkov.kubernetes.base_spec_check import BaseK8Check
class ApiServerBasicAuthFile(BaseK8Check):
def __init__(self):
id = "CKV_K8S_69"
name = "Ensure that the --basic-auth-file argument is not set"
categories = [Chec... | from checkov.common.models.enums import CheckCategories, CheckResult
from checkov.kubernetes.base_spec_check import BaseK8Check
class ApiServerBasicAuthFile(BaseK8Check):
def __init__(self):
id = "CKV_K8S_69"
name = "Ensure that the --basic-auth-file argument is not set"
categories = [Chec... |
import fields
from utils import *
from csv import DictWriter
from argparse import ArgumentParser
def main(max_row):
url = 'https://www.courtlistener.com/api/rest/v3/financial-disclosures'
count = 1
row_num = 1
with open('data/output.csv', 'w', newline = '', encoding = 'utf-8') as f:
writer... | import fields
from utils import *
from csv import DictWriter
from argparse import ArgumentParser
def main(max_row):
url = 'https://www.courtlistener.com/api/rest/v3/financial-disclosures'
count = 1
row_num = 1
with open('data/output.csv', 'w', newline = '', encoding = 'utf-8') as f:
writer... |
import sys
import semver
import logging
import reconcile.queries as queries
import reconcile.openshift_base as ob
import reconcile.jenkins_plugins as jenkins_base
from reconcile.slack_base import init_slack
from utils.gitlab_api import GitLabApi
from utils.saasherder import SaasHerder
from utils.defer import defer
... | import sys
import semver
import logging
import reconcile.queries as queries
import reconcile.openshift_base as ob
import reconcile.jenkins_plugins as jenkins_base
from reconcile.slack_base import init_slack
from utils.gitlab_api import GitLabApi
from utils.saasherder import SaasHerder
from utils.defer import defer
... |
import logging
import os
import random
import redis
import telegram
from dotenv import load_dotenv
from functools import partial
from bot_utils import get_arguments
from bot_utils import get_quiz_qa
from enum import Enum
from telegram.ext import ConversationHandler
from telegram.ext import CommandHandler
from telegra... | import logging
import os
import random
import redis
import telegram
from dotenv import load_dotenv
from functools import partial
from bot_utils import get_arguments
from bot_utils import get_quiz_qa
from enum import Enum
from telegram.ext import ConversationHandler
from telegram.ext import CommandHandler
from telegra... |
import json
from pathlib import Path
from typing import Any, Dict, Optional, Set, Union
import numpy
from pydantic import BaseModel, BaseSettings
from ..testing import compare_recursive
from ..util import deserialize, serialize, yaml_import
from ..util.autodocs import AutoPydanticDocGenerator
from ..util.decorators i... | import json
from pathlib import Path
from typing import Any, Dict, Optional, Set, Union
import numpy
from pydantic import BaseModel, BaseSettings
from ..testing import compare_recursive
from ..util import deserialize, serialize, yaml_import
from ..util.autodocs import AutoPydanticDocGenerator
from ..util.decorators i... |
import discord
import aiohttp
import asyncio
import json
import yaml
import logging
from datetime import datetime, timedelta
from io import BytesIO
from urllib.parse import quote
from redbot.core import commands, checks, Config
from redbot.core.data_manager import cog_data_path
from redbot.core.i18n import Translator, ... | import discord
import aiohttp
import asyncio
import json
import yaml
import logging
from datetime import datetime, timedelta
from io import BytesIO
from urllib.parse import quote
from redbot.core import commands, checks, Config
from redbot.core.data_manager import cog_data_path
from redbot.core.i18n import Translator, ... |
import discord, asyncio
import logging, traceback
import platform
import time
import sys
from discord.ext import commands
from utils import presence,settings
log = logging.getLogger("bot.core")
class LunaBot(commands.AutoShardedBot):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs... | import discord, asyncio
import logging, traceback
import platform
import time
import sys
from discord.ext import commands
from utils import presence,settings
log = logging.getLogger("bot.core")
class LunaBot(commands.AutoShardedBot):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs... |
import json
import os
from typing import Callable, Union
import discord
from discord.embeds import Embed
from discord.ext.commands.core import command
from discord.ext.commands.errors import MissingAnyRole, MissingPermissions, MissingRole
import pyowm
import pyowm.weatherapi25.observation
import ai_m2
import random
fr... | import json
import os
from typing import Callable, Union
import discord
from discord.embeds import Embed
from discord.ext.commands.core import command
from discord.ext.commands.errors import MissingAnyRole, MissingPermissions, MissingRole
import pyowm
import pyowm.weatherapi25.observation
import ai_m2
import random
fr... |
# Part of Pull Req #2 by @MaskedVirus | github.com/swatv3nub
import time
from datetime import timedelta
import requests
from pyrogram import filters
from pyrogram.types import InlineKeyboardButton, InlineKeyboardMarkup
from wbb import app
from wbb.core.decorators.errors import capture_err
__MODULE__ = "Anime"
__HEL... | # Part of Pull Req #2 by @MaskedVirus | github.com/swatv3nub
import time
from datetime import timedelta
import requests
from pyrogram import filters
from pyrogram.types import InlineKeyboardButton, InlineKeyboardMarkup
from wbb import app
from wbb.core.decorators.errors import capture_err
__MODULE__ = "Anime"
__HEL... |
# 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 math
import os
import r... | # 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 math
import os
import r... |
import sys
import subprocess
from .yamato_utils import get_base_path, get_unity_executable_path
def main():
base_path = get_base_path()
print(f"Running in base path {base_path}")
unity_exe = get_unity_executable_path()
print(f"Starting tests via {unity_exe}")
test_args = [
unity_exe,
... | import sys
import subprocess
from .yamato_utils import get_base_path, get_unity_executable_path
def main():
base_path = get_base_path()
print(f"Running in base path {base_path}")
unity_exe = get_unity_executable_path()
print(f"Starting tests via {unity_exe}")
test_args = [
unity_exe,
... |
from Instrucciones.TablaSimbolos.Instruccion import Instruccion
from Instrucciones.Sql_create.Tipo_Constraint import Tipo_Constraint, Tipo_Dato_Constraint
from Instrucciones.Excepcion import Excepcion
#from storageManager.jsonMode import *
# Asocia la integridad referencial entre llaves foráneas y llaves primarias,
# ... | from Instrucciones.TablaSimbolos.Instruccion import Instruccion
from Instrucciones.Sql_create.Tipo_Constraint import Tipo_Constraint, Tipo_Dato_Constraint
from Instrucciones.Excepcion import Excepcion
#from storageManager.jsonMode import *
# Asocia la integridad referencial entre llaves foráneas y llaves primarias,
# ... |
import boto3
# Retrieve the list of existing buckets
s3 = boto3.client('s3')
response = s3.list_buckets()
# Output the bucket names
print('Existing buckets:')
for bucket in response['Buckets']:
print(f' {bucket['Name']}') | import boto3
# Retrieve the list of existing buckets
s3 = boto3.client('s3')
response = s3.list_buckets()
# Output the bucket names
print('Existing buckets:')
for bucket in response['Buckets']:
print(f' {bucket["Name"]}') |
import os
import numpy as np
import glob
import cv2, json
import argparse
from sklearn.utils import shuffle
from keras.optimizers import SGD, Adam
from keras.models import Sequential
from keras.layers import Dropout, Dense
from keras.callbacks import EarlyStopping, ModelCheckpoint
from keras.preprocessing import image
... | import os
import numpy as np
import glob
import cv2, json
import argparse
from sklearn.utils import shuffle
from keras.optimizers import SGD, Adam
from keras.models import Sequential
from keras.layers import Dropout, Dense
from keras.callbacks import EarlyStopping, ModelCheckpoint
from keras.preprocessing import image
... |
from fastapi import Depends, FastAPI
from fastapi.security import OAuth2PasswordBearer
import os
app = FastAPI()
oauth2_scheme = OAuth2PasswordBearer(tokenUrl="token")
@app.get("/items/")
async def read_items(token: str = Depends(oauth2_scheme)):
return {"token": token}
if __name__ == '__main__':
print(f'I... | from fastapi import Depends, FastAPI
from fastapi.security import OAuth2PasswordBearer
import os
app = FastAPI()
oauth2_scheme = OAuth2PasswordBearer(tokenUrl="token")
@app.get("/items/")
async def read_items(token: str = Depends(oauth2_scheme)):
return {"token": token}
if __name__ == '__main__':
print(f'I... |
#!/usr/bin/env python
# coding=utf-8
# Copyright 2022 The HuggingFace Team All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-... | #!/usr/bin/env python
# coding=utf-8
# Copyright 2022 The HuggingFace Team All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-... |
#!/usr/local/autopkg/python
"""
JamfExtensionAttributeUploader processor for uploading extension attributes
to Jamf Pro using AutoPkg
by G Pugh
"""
import json
import re
import os
import subprocess
import uuid
from collections import namedtuple
from base64 import b64encode
from pathlib import Path
from shutil im... | #!/usr/local/autopkg/python
"""
JamfExtensionAttributeUploader processor for uploading extension attributes
to Jamf Pro using AutoPkg
by G Pugh
"""
import json
import re
import os
import subprocess
import uuid
from collections import namedtuple
from base64 import b64encode
from pathlib import Path
from shutil im... |
"""A PasswordController Module."""
import uuid
from masonite import env, Mail, Session
from masonite.auth import Auth
from masonite.helpers import config, password as bcrypt_password
from masonite.request import Request
from masonite.view import View
from masonite.validation import Validator
from config.auth import A... | """A PasswordController Module."""
import uuid
from masonite import env, Mail, Session
from masonite.auth import Auth
from masonite.helpers import config, password as bcrypt_password
from masonite.request import Request
from masonite.view import View
from masonite.validation import Validator
from config.auth import A... |
import os
from pathlib import Path
import json
import logging
from typing import Any, Text, Dict
import pytest
import rasa.shared.utils.io
import rasa.utils.io
from rasa.core.test import (
_create_data_generator,
_collect_story_predictions,
test as evaluate_stories,
FAILED_STORIES_FILE,
CONFUSION_... | import os
from pathlib import Path
import json
import logging
from typing import Any, Text, Dict
import pytest
import rasa.shared.utils.io
import rasa.utils.io
from rasa.core.test import (
_create_data_generator,
_collect_story_predictions,
test as evaluate_stories,
FAILED_STORIES_FILE,
CONFUSION_... |
from perceiver_pytorch import PerceiverIO, MultiPerceiver
from perceiver_pytorch.modalities import InputModality, modality_encoding
from perceiver_pytorch.utils import encode_position
from perceiver_pytorch.encoders import ImageEncoder
from perceiver_pytorch.decoders import ImageDecoder
import torch
from math import pr... | from perceiver_pytorch import PerceiverIO, MultiPerceiver
from perceiver_pytorch.modalities import InputModality, modality_encoding
from perceiver_pytorch.utils import encode_position
from perceiver_pytorch.encoders import ImageEncoder
from perceiver_pytorch.decoders import ImageDecoder
import torch
from math import pr... |
#!/usr/bin/env python3
import argparse
import math
import os.path
import numpy as np
import pandas as pd
from astropy import units as u
import artistools as at
def addargs(parser):
parser.add_argument('-inputpath', '-i',
default='1.00_5050.dat',
help='Path of inp... | #!/usr/bin/env python3
import argparse
import math
import os.path
import numpy as np
import pandas as pd
from astropy import units as u
import artistools as at
def addargs(parser):
parser.add_argument('-inputpath', '-i',
default='1.00_5050.dat',
help='Path of inp... |
# 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 for kanging stickers or making new ones. Thanks @rupansh"""
import io
import math
import urllib.req... | # 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 for kanging stickers or making new ones. Thanks @rupansh"""
import io
import math
import urllib.req... |
# This module defines a workflow for FFopting a molecule and then analyzing its
# electron density critical points with Critic2.
from fireworks import Workflow
from atomate.qchem.fireworks.core import CubeAndCritic2FW, FrequencyFlatteningOptimizeFW
from atomate.utils.utils import get_logger
__author__ = "Samuel Blau... | # This module defines a workflow for FFopting a molecule and then analyzing its
# electron density critical points with Critic2.
from fireworks import Workflow
from atomate.qchem.fireworks.core import CubeAndCritic2FW, FrequencyFlatteningOptimizeFW
from atomate.utils.utils import get_logger
__author__ = "Samuel Blau... |
import itertools
import json
import logging
import os
import platform
import shutil
import subprocess
import textwrap
from argparse import ArgumentParser
from pathlib import Path
from subprocess import PIPE
def main() -> None:
parser = ArgumentParser()
parser.add_argument('--toolchain')
parser.add_argumen... | import itertools
import json
import logging
import os
import platform
import shutil
import subprocess
import textwrap
from argparse import ArgumentParser
from pathlib import Path
from subprocess import PIPE
def main() -> None:
parser = ArgumentParser()
parser.add_argument('--toolchain')
parser.add_argumen... |
import torch
from vision.ssd.vgg_ssd import create_vgg_ssd, create_vgg_ssd_predictor
from vision.ssd.mobilenetv1_ssd import create_mobilenetv1_ssd, create_mobilenetv1_ssd_predictor
from vision.ssd.mobilenetv1_ssd_lite import create_mobilenetv1_ssd_lite, create_mobilenetv1_ssd_lite_predictor
from vision.ssd.squeezenet_s... | import torch
from vision.ssd.vgg_ssd import create_vgg_ssd, create_vgg_ssd_predictor
from vision.ssd.mobilenetv1_ssd import create_mobilenetv1_ssd, create_mobilenetv1_ssd_predictor
from vision.ssd.mobilenetv1_ssd_lite import create_mobilenetv1_ssd_lite, create_mobilenetv1_ssd_lite_predictor
from vision.ssd.squeezenet_s... |
import requests
import datetime
import time
import os
from lotify.client import Client
def moodle_notify():
lotify = Client()
moodleToken = os.environ.get("MOODLE_TOKEN")
lineToken = os.environ.get("LINE_TOKEN")
url = f"{os.environ.get("MOODLE_URL")}webservice/rest/server.php"
currentTime = int(ti... | import requests
import datetime
import time
import os
from lotify.client import Client
def moodle_notify():
lotify = Client()
moodleToken = os.environ.get("MOODLE_TOKEN")
lineToken = os.environ.get("LINE_TOKEN")
url = f"{os.environ.get('MOODLE_URL')}webservice/rest/server.php"
currentTime = int(ti... |
import logging
from typing import Any, Dict, List
from .utils import get_json
logging.basicConfig(level=logging.INFO)
def fetch_markets(market_type: str) -> List[Dict[str, Any]]:
'''Fetch all trading markets from a crypto exchage.'''
if market_type == 'spot':
return _fetch_spot_markets()
else:
... | import logging
from typing import Any, Dict, List
from .utils import get_json
logging.basicConfig(level=logging.INFO)
def fetch_markets(market_type: str) -> List[Dict[str, Any]]:
'''Fetch all trading markets from a crypto exchage.'''
if market_type == 'spot':
return _fetch_spot_markets()
else:
... |
from psutil import process_iter
from os import system
version = 1.0
author = 'Ivan Perzhinsky'
roblox = 'RobloxPlayerBeta.exe'
trx = 'TRX.exe'
roblox_kill_command = f'taskkill /F /IM {roblox}'
def get_processes_names():
return [proc.name() for proc in process_iter()]
def kill_roblox():
for... | from psutil import process_iter
from os import system
version = 1.0
author = 'Ivan Perzhinsky'
roblox = 'RobloxPlayerBeta.exe'
trx = 'TRX.exe'
roblox_kill_command = f'taskkill /F /IM {roblox}'
def get_processes_names():
return [proc.name() for proc in process_iter()]
def kill_roblox():
for... |
"""``AbstractRunner`` is the base class for all ``Pipeline`` runner
implementations.
"""
import logging
from abc import ABC, abstractmethod
from concurrent.futures import (
ALL_COMPLETED,
Future,
ThreadPoolExecutor,
as_completed,
wait,
)
from typing import Any, Dict, Iterable
from pluggy import Pl... | """``AbstractRunner`` is the base class for all ``Pipeline`` runner
implementations.
"""
import logging
from abc import ABC, abstractmethod
from concurrent.futures import (
ALL_COMPLETED,
Future,
ThreadPoolExecutor,
as_completed,
wait,
)
from typing import Any, Dict, Iterable
from pluggy import Pl... |
# Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | # Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
"""GNN Encoder class."""
from itertools import count
from typing import Any, Dict, NamedTuple, List, Tuple, Optional
import tensorflow as tf
from dpu_utils.tf2utils import MLP
from tf2_gnn.utils.param_helpers import get_activation_function
from .message_passing import (
MessagePassing,
MessagePassingInput,
... | """GNN Encoder class."""
from itertools import count
from typing import Any, Dict, NamedTuple, List, Tuple, Optional
import tensorflow as tf
from dpu_utils.tf2utils import MLP
from tf2_gnn.utils.param_helpers import get_activation_function
from .message_passing import (
MessagePassing,
MessagePassingInput,
... |
# Copyright Contributors to the Pyro project.
# SPDX-License-Identifier: Apache-2.0
from collections import namedtuple
from contextlib import contextmanager
from functools import partial
import warnings
import numpy as np
from jax import device_get, jacfwd, lax, random, value_and_grad
from jax.flatten_util import ra... | # Copyright Contributors to the Pyro project.
# SPDX-License-Identifier: Apache-2.0
from collections import namedtuple
from contextlib import contextmanager
from functools import partial
import warnings
import numpy as np
from jax import device_get, jacfwd, lax, random, value_and_grad
from jax.flatten_util import ra... |
import os
from datetime import datetime, timedelta
from random import randint
from typing import Optional
import pandas as pd
import pytest
from fastapi.testclient import TestClient
from pytest import fail
from sqlalchemy.orm import Session
from v3io.dataplane import RaiseForStatus
from v3io_frames import CreateError
... | import os
from datetime import datetime, timedelta
from random import randint
from typing import Optional
import pandas as pd
import pytest
from fastapi.testclient import TestClient
from pytest import fail
from sqlalchemy.orm import Session
from v3io.dataplane import RaiseForStatus
from v3io_frames import CreateError
... |
import threading
from typing import Union
import jesse.helpers as jh
from jesse.models import Order
from jesse.services import logger
class API:
def __init__(self) -> None:
self.drivers = {}
if not jh.is_live():
self.initiate_drivers()
def initiate_drivers(self) -> None:
... | import threading
from typing import Union
import jesse.helpers as jh
from jesse.models import Order
from jesse.services import logger
class API:
def __init__(self) -> None:
self.drivers = {}
if not jh.is_live():
self.initiate_drivers()
def initiate_drivers(self) -> None:
... |
from __future__ import annotations
import dataclasses
import re
from collections import defaultdict
from types import MappingProxyType
from typing import Dict, List, ClassVar, Pattern, Match, Mapping, Set, Optional
from urllib import parse
from typic.util import cached_property, slotted
from .secret import SecretStr
... | from __future__ import annotations
import dataclasses
import re
from collections import defaultdict
from types import MappingProxyType
from typing import Dict, List, ClassVar, Pattern, Match, Mapping, Set, Optional
from urllib import parse
from typic.util import cached_property, slotted
from .secret import SecretStr
... |
#!/usr/bin/env python3
# Copyright (c) 2014-2020 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the rawtransaction RPCs.
Test the following RPCs:
- getrawtransaction
- createrawtransactio... | #!/usr/bin/env python3
# Copyright (c) 2014-2020 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the rawtransaction RPCs.
Test the following RPCs:
- getrawtransaction
- createrawtransactio... |
"""Preprocessing functions and pipeline
The pipeline is three steps
1) create / load tasks, which includes
a) load raw data
b) tokenize raw data
2) create / load all vocabularies (word, char, task-specific target vocabs)
a) count tokens of a vocab
b) take the N most frequent tok... | """Preprocessing functions and pipeline
The pipeline is three steps
1) create / load tasks, which includes
a) load raw data
b) tokenize raw data
2) create / load all vocabularies (word, char, task-specific target vocabs)
a) count tokens of a vocab
b) take the N most frequent tok... |
import io
import os
import base64
from io import StringIO
from pathlib import Path
from typing import Dict, List
import dash
import dash_html_components as html
import flask
from dash.dependencies import Input, Output, State
from dash.exceptions import PreventUpdate
from pangtreebuild.affinity_tree.parameters import B... | import io
import os
import base64
from io import StringIO
from pathlib import Path
from typing import Dict, List
import dash
import dash_html_components as html
import flask
from dash.dependencies import Input, Output, State
from dash.exceptions import PreventUpdate
from pangtreebuild.affinity_tree.parameters import B... |
import os
import shutil
from pathlib import Path
from typing import Any, Dict, List, Optional, Tuple
import yaml
from cryptodoge import __version__
from cryptodoge.consensus.coinbase import create_puzzlehash_for_pk
from cryptodoge.ssl.create_ssl import generate_ca_signed_cert, get_cryptodoge_ca_crt_key, make_ca_cert
... | import os
import shutil
from pathlib import Path
from typing import Any, Dict, List, Optional, Tuple
import yaml
from cryptodoge import __version__
from cryptodoge.consensus.coinbase import create_puzzlehash_for_pk
from cryptodoge.ssl.create_ssl import generate_ca_signed_cert, get_cryptodoge_ca_crt_key, make_ca_cert
... |
"""Formatting numbers."""
import copy
from typing import Dict
from babel.core import Locale # type: ignore
from babel.core import UnknownLocaleError
from beancount.core.display_context import Precision
from beancount.core.number import Decimal
from fava.core.fava_options import OptionError
from fava.core.module_base... | """Formatting numbers."""
import copy
from typing import Dict
from babel.core import Locale # type: ignore
from babel.core import UnknownLocaleError
from beancount.core.display_context import Precision
from beancount.core.number import Decimal
from fava.core.fava_options import OptionError
from fava.core.module_base... |
import sys
import json
import collections
def gen_lef_data(data, fp, macro_name, cell_pin, bodyswitch):
def s(x):
return "%.4f" % (x/10000.0)
fp.write("MACRO %s\n" % macro_name)
fp.write(" ORIGIN 0 0 ;\n")
fp.write(" FOREIGN %s 0 0 ;\n" % macro_name)
fp.write(" SIZE %s BY %s ;\n" % (s... | import sys
import json
import collections
def gen_lef_data(data, fp, macro_name, cell_pin, bodyswitch):
def s(x):
return "%.4f" % (x/10000.0)
fp.write("MACRO %s\n" % macro_name)
fp.write(" ORIGIN 0 0 ;\n")
fp.write(" FOREIGN %s 0 0 ;\n" % macro_name)
fp.write(" SIZE %s BY %s ;\n" % (s... |
import json
import torch
from parameterized import parameterized
from torchaudio.models.wav2vec2 import (
wav2vec2_base,
wav2vec2_large,
wav2vec2_large_lv60k,
)
from torchaudio.models.wav2vec2.utils import import_huggingface_model
from torchaudio_unittest.common_utils import (
get_asset_path,
skipI... | import json
import torch
from parameterized import parameterized
from torchaudio.models.wav2vec2 import (
wav2vec2_base,
wav2vec2_large,
wav2vec2_large_lv60k,
)
from torchaudio.models.wav2vec2.utils import import_huggingface_model
from torchaudio_unittest.common_utils import (
get_asset_path,
skipI... |
import boto3
from uuid import uuid4
from collections import defaultdict
import time
from pandas import DataFrame
import datetime
import numpy as np
import pandas
import requests
pandas.set_option(
"display.max_rows", None, "display.max_columns", None, "display.width", 1000, "display.max_colwidth", None
)
def get... | import boto3
from uuid import uuid4
from collections import defaultdict
import time
from pandas import DataFrame
import datetime
import numpy as np
import pandas
import requests
pandas.set_option(
"display.max_rows", None, "display.max_columns", None, "display.width", 1000, "display.max_colwidth", None
)
def get... |
"""
Functions for preparing various inputs passed to the DataFrame or Series
constructors before passing them to a BlockManager.
"""
from __future__ import annotations
from collections import abc
from typing import (
TYPE_CHECKING,
Any,
Hashable,
Sequence,
cast,
)
import warnings
import numpy as n... | """
Functions for preparing various inputs passed to the DataFrame or Series
constructors before passing them to a BlockManager.
"""
from __future__ import annotations
from collections import abc
from typing import (
TYPE_CHECKING,
Any,
Hashable,
Sequence,
cast,
)
import warnings
import numpy as n... |
import base64
from urllib import parse
import rsa
from reqs.login import LoginReq
from .base_class import Forced, Wait, Multi
class LoginTask(Forced, Wait, Multi):
TASK_NAME = 'null'
@staticmethod
async def check(_):
return (-2, None),
@staticmethod
async def work(user):
# 搞两层的... | import base64
from urllib import parse
import rsa
from reqs.login import LoginReq
from .base_class import Forced, Wait, Multi
class LoginTask(Forced, Wait, Multi):
TASK_NAME = 'null'
@staticmethod
async def check(_):
return (-2, None),
@staticmethod
async def work(user):
# 搞两层的... |
# -*- coding: utf-8 -*-
#
# Copyright 2015 Benjamin Kiessling
#
# 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 2015 Benjamin Kiessling
#
# 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 ... |
"""Implement the Google Smart Home traits."""
from __future__ import annotations
import logging
from homeassistant.components import (
alarm_control_panel,
binary_sensor,
camera,
cover,
fan,
group,
input_boolean,
input_select,
light,
lock,
media_player,
scene,
scrip... | """Implement the Google Smart Home traits."""
from __future__ import annotations
import logging
from homeassistant.components import (
alarm_control_panel,
binary_sensor,
camera,
cover,
fan,
group,
input_boolean,
input_select,
light,
lock,
media_player,
scene,
scrip... |
# coding:utf-8
import os
import pathlib
import numpy as np
import pandas as pd
import lightgbm as lgb
import pytorch_lightning as pl
from pytorch_lightning.callbacks import EarlyStopping, ModelCheckpoint
from pytorch_lightning.loggers import WandbLogger
from DNNmodel import *
from utils import *
... | # coding:utf-8
import os
import pathlib
import numpy as np
import pandas as pd
import lightgbm as lgb
import pytorch_lightning as pl
from pytorch_lightning.callbacks import EarlyStopping, ModelCheckpoint
from pytorch_lightning.loggers import WandbLogger
from DNNmodel import *
from utils import *
... |
#!/usr/bin/env python
## -*- coding: utf-8 -*-
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 ... | #!/usr/bin/env python
## -*- coding: utf-8 -*-
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 ... |
"""Timeseries generation line plots.
This code creates generation non-stacked line plots.
@author: Daniel Levie
"""
import logging
import pandas as pd
import datetime as dt
import matplotlib.pyplot as plt
import marmot.config.mconfig as mconfig
from marmot.plottingmodules.plotutils.plot_library import SetupSubplot
... | """Timeseries generation line plots.
This code creates generation non-stacked line plots.
@author: Daniel Levie
"""
import logging
import pandas as pd
import datetime as dt
import matplotlib.pyplot as plt
import marmot.config.mconfig as mconfig
from marmot.plottingmodules.plotutils.plot_library import SetupSubplot
... |
import os
import batch
import preprocessing
import train
import predict
import pandas as pd
from matplotlib import pyplot as plt
from covidDataset import CovidDataset
from torch.utils.data import DataLoader
from transformers import BertForSequenceClassification, BertTokenizer
from sklearn.model_selection impo... | import os
import batch
import preprocessing
import train
import predict
import pandas as pd
from matplotlib import pyplot as plt
from covidDataset import CovidDataset
from torch.utils.data import DataLoader
from transformers import BertForSequenceClassification, BertTokenizer
from sklearn.model_selection impo... |
#!/usr/bin/env python3
# coding=utf-8
# ******************************************************************
# log4j-scan: A generic scanner for Apache log4j RCE CVE-2021-44228
# Original Author:
# Mazin Ahmed <Mazin at FullHunt.io>
# Modified by Megan Howell (CyberQueenMeg)
# Scanner provided by FullHunt.io - The Next-G... | #!/usr/bin/env python3
# coding=utf-8
# ******************************************************************
# log4j-scan: A generic scanner for Apache log4j RCE CVE-2021-44228
# Original Author:
# Mazin Ahmed <Mazin at FullHunt.io>
# Modified by Megan Howell (CyberQueenMeg)
# Scanner provided by FullHunt.io - The Next-G... |
# Copyright 2020 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
import logging
import re
from dataclasses import dataclass
from typing import Dict, Mapping, Optional, Sequence
from pants.base.deprecated import deprecated
from pants.util.frozendict imp... | # Copyright 2020 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
import logging
import re
from dataclasses import dataclass
from typing import Dict, Mapping, Optional, Sequence
from pants.base.deprecated import deprecated
from pants.util.frozendict imp... |
# coding=utf-8
# Copyright 2020 The HuggingFace Datasets Authors and the TensorFlow Datasets Authors.
#
# 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/LI... | # coding=utf-8
# Copyright 2020 The HuggingFace Datasets Authors and the TensorFlow Datasets Authors.
#
# 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/LI... |
import tempfile
import ctypes
import os
import platform
import subprocess
import CraftOS.OsUtilsBase
from CraftCore import CraftCore
class FileAttributes():
# https://msdn.microsoft.com/en-us/library/windows/desktop/gg258117(v=vs.85).aspx
FILE_ATTRIBUTE_READONLY = 0x1
FILE_ATTRIBUTE_REPARSE_POINT = 0x400... | import tempfile
import ctypes
import os
import platform
import subprocess
import CraftOS.OsUtilsBase
from CraftCore import CraftCore
class FileAttributes():
# https://msdn.microsoft.com/en-us/library/windows/desktop/gg258117(v=vs.85).aspx
FILE_ATTRIBUTE_READONLY = 0x1
FILE_ATTRIBUTE_REPARSE_POINT = 0x400... |
# AUTOGENERATED! DO NOT EDIT! File to edit: nbs/06_data.block.ipynb (unless otherwise specified).
__all__ = ['TransformBlock', 'CategoryBlock', 'MultiCategoryBlock', 'RegressionBlock', 'DataBlock']
# Cell
from ..torch_basics import *
from .core import *
from .load import *
from .external import *
from .transforms imp... | # AUTOGENERATED! DO NOT EDIT! File to edit: nbs/06_data.block.ipynb (unless otherwise specified).
__all__ = ['TransformBlock', 'CategoryBlock', 'MultiCategoryBlock', 'RegressionBlock', 'DataBlock']
# Cell
from ..torch_basics import *
from .core import *
from .load import *
from .external import *
from .transforms imp... |
from json import dump, load
from pathlib import Path
from copy import copy as c
from collections import defaultdict
from logging import getLogger
from datetime import date, datetime
from shutil import copy, rmtree
from bidso.utils import replace_extension
from PyQt5.QtSql import QSqlQuery
from ..api import list_subje... | from json import dump, load
from pathlib import Path
from copy import copy as c
from collections import defaultdict
from logging import getLogger
from datetime import date, datetime
from shutil import copy, rmtree
from bidso.utils import replace_extension
from PyQt5.QtSql import QSqlQuery
from ..api import list_subje... |
#!/usr/bin/env python3
# Copyright 2021 Battelle Energy Alliance, LLC
import os
import itertools
from collections import Counter
import socket
from copy import copy
import pkg_resources
import pickle
import string
import openpyxl
import openpyxl.styles
from openpyxl.worksheet.table import Table
import netaddr
from t... | #!/usr/bin/env python3
# Copyright 2021 Battelle Energy Alliance, LLC
import os
import itertools
from collections import Counter
import socket
from copy import copy
import pkg_resources
import pickle
import string
import openpyxl
import openpyxl.styles
from openpyxl.worksheet.table import Table
import netaddr
from t... |
"""Read and write swan spectra files"""
import os
import re
import gzip
import datetime
import pandas as pd
import numpy as np
from wavespectra.core.attributes import attrs
from wavespectra.core.utils import to_nautical
E2V = 1025 * 9.81
class SwanSpecFile(object):
"""Read spectra in SWAN ASCII format."""
... | """Read and write swan spectra files"""
import os
import re
import gzip
import datetime
import pandas as pd
import numpy as np
from wavespectra.core.attributes import attrs
from wavespectra.core.utils import to_nautical
E2V = 1025 * 9.81
class SwanSpecFile(object):
"""Read spectra in SWAN ASCII format."""
... |
# 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 re
import goodreads_api_client as gr
import json
import urllib.request
import yaml
from tqdm import tqdm
from bs4 import BeautifulSoup
def audible(url):
"""Add book details from Audible.com webpage.
"""
html = urllib.request.urlopen(url).read()
soup = BeautifulSoup(html, features="html.parser... | import re
import goodreads_api_client as gr
import json
import urllib.request
import yaml
from tqdm import tqdm
from bs4 import BeautifulSoup
def audible(url):
"""Add book details from Audible.com webpage.
"""
html = urllib.request.urlopen(url).read()
soup = BeautifulSoup(html, features="html.parser... |
# Django imports
from django.shortcuts import render, redirect
from django.http import HttpResponse
from django.conf import settings # Access to project settings
from django.contrib.auth.models import User
from django.contrib.auth import authenticate
from django.contrib.auth import login as django_login # To distingu... |
# Django imports
from django.shortcuts import render, redirect
from django.http import HttpResponse
from django.conf import settings # Access to project settings
from django.contrib.auth.models import User
from django.contrib.auth import authenticate
from django.contrib.auth import login as django_login # To distingu... |
import os
import shutil
from Bio import SeqIO
from Bio.Seq import Seq
from Bio.SeqRecord import SeqRecord
from Bio.Alphabet import SingleLetterAlphabet
from installed_clients.DataFileUtilClient import DataFileUtil
class AssemblyToFasta:
def __init__(self, callback_url, scratch):
self.scratch = scratch
... | import os
import shutil
from Bio import SeqIO
from Bio.Seq import Seq
from Bio.SeqRecord import SeqRecord
from Bio.Alphabet import SingleLetterAlphabet
from installed_clients.DataFileUtilClient import DataFileUtil
class AssemblyToFasta:
def __init__(self, callback_url, scratch):
self.scratch = scratch
... |
import logging
import os
import aiohttp
import discord
from discord.ext import commands
PRILOG_TOKEN = os.environ["PRILOG_TOKEN"]
class PriLog(commands.Cog):
"""Prilog APIを利用します。"""
def __init__(self, bot):
self.bot = bot
self.logger = logging.getLogger('discord.PriLog')
... | import logging
import os
import aiohttp
import discord
from discord.ext import commands
PRILOG_TOKEN = os.environ["PRILOG_TOKEN"]
class PriLog(commands.Cog):
"""Prilog APIを利用します。"""
def __init__(self, bot):
self.bot = bot
self.logger = logging.getLogger('discord.PriLog')
... |
"""The Airly integration."""
from __future__ import annotations
from datetime import timedelta
import logging
from math import ceil
from aiohttp import ClientSession
from aiohttp.client_exceptions import ClientConnectorError
from airly import Airly
from airly.exceptions import AirlyError
import async_timeout
from ho... | """The Airly integration."""
from __future__ import annotations
from datetime import timedelta
import logging
from math import ceil
from aiohttp import ClientSession
from aiohttp.client_exceptions import ClientConnectorError
from airly import Airly
from airly.exceptions import AirlyError
import async_timeout
from ho... |
import numpy as np
import pandas as pd
import sys
sys.path.append(".") # Path of xlogit library root folder.
from xlogit import MixedLogit, MultinomialLogit
print("""
**EXPECTED:
MultinomialLogit
convergence=True LL=-4958.6491193376105 electricity
convergence=True LL=-1311.9796171079972 fishing
pred pier base: 0.09... | import numpy as np
import pandas as pd
import sys
sys.path.append(".") # Path of xlogit library root folder.
from xlogit import MixedLogit, MultinomialLogit
print("""
**EXPECTED:
MultinomialLogit
convergence=True LL=-4958.6491193376105 electricity
convergence=True LL=-1311.9796171079972 fishing
pred pier base: 0.09... |
from enum import IntEnum
from typing import Dict, Union, Callable
from cereal import log, car
import cereal.messaging as messaging
from common.realtime import DT_CTRL
from selfdrive.config import Conversions as CV
from selfdrive.locationd.calibrationd import MIN_SPEED_FILTER
AlertSize = log.ControlsState.AlertSize
Al... | from enum import IntEnum
from typing import Dict, Union, Callable
from cereal import log, car
import cereal.messaging as messaging
from common.realtime import DT_CTRL
from selfdrive.config import Conversions as CV
from selfdrive.locationd.calibrationd import MIN_SPEED_FILTER
AlertSize = log.ControlsState.AlertSize
Al... |
import os,re,glob,sys,argparse,tempfile
from subprocess import Popen, PIPE, run, TimeoutExpired, DEVNULL
import datetime,shlex,time
import nibabel, nibabel.processing
import gzip, shutil
from copy import deepcopy
import sys
if sys.version_info[0] < 3:
raise Exception("Python 3.0+ is needed.")
# Get Arguments
pars... | import os,re,glob,sys,argparse,tempfile
from subprocess import Popen, PIPE, run, TimeoutExpired, DEVNULL
import datetime,shlex,time
import nibabel, nibabel.processing
import gzip, shutil
from copy import deepcopy
import sys
if sys.version_info[0] < 3:
raise Exception("Python 3.0+ is needed.")
# Get Arguments
pars... |
from django.shortcuts import render, redirect
from django.http import HttpResponse
from django.http import HttpResponseRedirect
from django.views import generic
from .forms import ContactForm
from django.core.mail import send_mail, BadHeaderError
from .models import Suggestions, Comment, UserProfile, Post, Category, F... | from django.shortcuts import render, redirect
from django.http import HttpResponse
from django.http import HttpResponseRedirect
from django.views import generic
from .forms import ContactForm
from django.core.mail import send_mail, BadHeaderError
from .models import Suggestions, Comment, UserProfile, Post, Category, F... |
#!/usr/bin/env python3
# import gi
# gi.require_version("Gtk", "3.24")
from gi.repository import Gtk as g,Gdk
import psutil as ps
from time import time
from os import popen
# Importing neccessary files
try:
from gi_composites import GtkTemplate
except ImportError:
from sysmontask.gi_composites import GtkTempl... | #!/usr/bin/env python3
# import gi
# gi.require_version("Gtk", "3.24")
from gi.repository import Gtk as g,Gdk
import psutil as ps
from time import time
from os import popen
# Importing neccessary files
try:
from gi_composites import GtkTemplate
except ImportError:
from sysmontask.gi_composites import GtkTempl... |
#! /usr/bin/python3
# Copyright 2018 Gaëtan Cassiers
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | #! /usr/bin/python3
# Copyright 2018 Gaëtan Cassiers
#
# 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 ... |
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
"""Code related to managing kernels running in YARN clusters."""
import asyncio
import errno
import logging
import os
import signal
import socket
import time
from traitlets import default, Unicode, Bool
from typing im... | # Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
"""Code related to managing kernels running in YARN clusters."""
import asyncio
import errno
import logging
import os
import signal
import socket
import time
from traitlets import default, Unicode, Bool
from typing im... |
import atexit
import logging
import os
import subprocess
import time
from concurrent import futures
import certifi
import click
from bentoml import config
from bentoml.configuration import get_debug_mode
from bentoml.exceptions import BentoMLException
from bentoml.yatai.utils import ensure_node_available_or_raise, pa... | import atexit
import logging
import os
import subprocess
import time
from concurrent import futures
import certifi
import click
from bentoml import config
from bentoml.configuration import get_debug_mode
from bentoml.exceptions import BentoMLException
from bentoml.yatai.utils import ensure_node_available_or_raise, pa... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.