edited_code stringlengths 17 978k | original_code stringlengths 17 978k |
|---|---|
from pynggdpp import ndc
import json
def cache_collection(event=None, context=None):
processable_collection = ndc.get_message("processable_collections")
if processable_collection is None:
response = {
"statusCode": 204
}
return response
else:
body = dict()
... | from pynggdpp import ndc
import json
def cache_collection(event=None, context=None):
processable_collection = ndc.get_message("processable_collections")
if processable_collection is None:
response = {
"statusCode": 204
}
return response
else:
body = dict()
... |
# v1.0
import datetime as dt
import platform
import subprocess
import time
from web3 import Web3
from web3.middleware import geth_poa_middleware
import csv
w3 = Web3(Web3.HTTPProvider('https://bsc-dataseed1.binance.org/'))
w3.middleware_onion.inject(geth_poa_middleware, layer=0)
class dapps:
pancak... | # v1.0
import datetime as dt
import platform
import subprocess
import time
from web3 import Web3
from web3.middleware import geth_poa_middleware
import csv
w3 = Web3(Web3.HTTPProvider('https://bsc-dataseed1.binance.org/'))
w3.middleware_onion.inject(geth_poa_middleware, layer=0)
class dapps:
pancak... |
"""Docstring"""
###############################################################################
# IMPORTS ########################################################### IMPORTS #
###############################################################################
# Standard library
import datetime
import binascii
# Installe... | """Docstring"""
###############################################################################
# IMPORTS ########################################################### IMPORTS #
###############################################################################
# Standard library
import datetime
import binascii
# Installe... |
# Copyright 2020 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-2.0
#
# Unless required by applicabl... | # Copyright 2020 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-2.0
#
# Unless required by applicabl... |
# coding=utf-8
# Copyright 2020-present the HuggingFace Inc. team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ap... | # coding=utf-8
# Copyright 2020-present the HuggingFace Inc. team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ap... |
import abc
import logging
import mimetypes
import os
import shutil
import string
import tempfile
from inspect import isclass
from typing import (
Any,
Dict,
List,
Optional,
Tuple,
TYPE_CHECKING,
)
from markupsafe import escape
from galaxy import util
from galaxy.datatypes.metadata import (
... | import abc
import logging
import mimetypes
import os
import shutil
import string
import tempfile
from inspect import isclass
from typing import (
Any,
Dict,
List,
Optional,
Tuple,
TYPE_CHECKING,
)
from markupsafe import escape
from galaxy import util
from galaxy.datatypes.metadata import (
... |
import json
import os
import pytest
from detect_secrets.core import baseline
from detect_secrets.core import plugins
from detect_secrets.core.secrets_collection import SecretsCollection
from detect_secrets.core.usage import ParserBuilder
from detect_secrets.settings import get_settings
from testing.mocks import mock_... | import json
import os
import pytest
from detect_secrets.core import baseline
from detect_secrets.core import plugins
from detect_secrets.core.secrets_collection import SecretsCollection
from detect_secrets.core.usage import ParserBuilder
from detect_secrets.settings import get_settings
from testing.mocks import mock_... |
#
# This source file is part of the EdgeDB open source project.
#
# Copyright 2008-present MagicStack Inc. and the EdgeDB 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... | #
# This source file is part of the EdgeDB open source project.
#
# Copyright 2008-present MagicStack Inc. and the EdgeDB 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... |
# -*- coding: utf-8 -*-
"""
TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-节点管理(BlueKing-BK-NODEMAN) available.
Copyright (C) 2017-2021 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in compliance ... | # -*- coding: utf-8 -*-
"""
TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-节点管理(BlueKing-BK-NODEMAN) available.
Copyright (C) 2017-2021 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in compliance ... |
import os
import time
import fero
from fero import FeroError
from typing import Optional, Union
from marshmallow import (
Schema,
fields,
validate,
EXCLUDE,
)
from .common import FeroObject
class DataSourceSchema(Schema):
class Meta:
unknown = EXCLUDE
uuid = fields.UUID(required=True... | import os
import time
import fero
from fero import FeroError
from typing import Optional, Union
from marshmallow import (
Schema,
fields,
validate,
EXCLUDE,
)
from .common import FeroObject
class DataSourceSchema(Schema):
class Meta:
unknown = EXCLUDE
uuid = fields.UUID(required=True... |
from custom_components.xiaomi_cloud_map_extractor.common.vacuum import XiaomiCloudVacuum
class XiaomiCloudVacuumV2(XiaomiCloudVacuum):
def __init__(self, connector, country, user_id, device_id, model):
super().__init__(connector, country, user_id, device_id, model)
def get_map_url(self, map_name):
... | from custom_components.xiaomi_cloud_map_extractor.common.vacuum import XiaomiCloudVacuum
class XiaomiCloudVacuumV2(XiaomiCloudVacuum):
def __init__(self, connector, country, user_id, device_id, model):
super().__init__(connector, country, user_id, device_id, model)
def get_map_url(self, map_name):
... |
# BSD 3-Clause License
# Copyright (c) 2019-2021, engageLively
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright notice, this
# ... | # BSD 3-Clause License
# Copyright (c) 2019-2021, engageLively
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright notice, this
# ... |
# Author: Zylo117
"""
COCO-Style Evaluations
put images here datasets/your_project_name/val_set_name/*.jpg
put annotations here datasets/your_project_name/annotations/instances_{val_set_name}.json
put weights here /path/to/your/weights/*.pth
change compound_coef
"""
import json
import os
import argparse
import tor... | # Author: Zylo117
"""
COCO-Style Evaluations
put images here datasets/your_project_name/val_set_name/*.jpg
put annotations here datasets/your_project_name/annotations/instances_{val_set_name}.json
put weights here /path/to/your/weights/*.pth
change compound_coef
"""
import json
import os
import argparse
import tor... |
import asyncio
from decimal import Decimal
from typing import Awaitable, Optional
from unittest import TestCase
from unittest.mock import AsyncMock
import hummingbot.connector.exchange.huobi.huobi_constants as CONSTANTS
from hummingbot.connector.exchange.huobi.huobi_exchange import HuobiExchange
from hummingbot.core.... | import asyncio
from decimal import Decimal
from typing import Awaitable, Optional
from unittest import TestCase
from unittest.mock import AsyncMock
import hummingbot.connector.exchange.huobi.huobi_constants as CONSTANTS
from hummingbot.connector.exchange.huobi.huobi_exchange import HuobiExchange
from hummingbot.core.... |
from werkzeug.exceptions import NotFound, BadRequest
from db import db
from helpers.data_preparation import data_preparate_for_commit
from helpers.loger_config import custom_logger
from models import TariffTypeModel
from models.tarif_el import TarifPiceModel
from schemas.request.tarif_price import TarifPriceRequestSch... | from werkzeug.exceptions import NotFound, BadRequest
from db import db
from helpers.data_preparation import data_preparate_for_commit
from helpers.loger_config import custom_logger
from models import TariffTypeModel
from models.tarif_el import TarifPiceModel
from schemas.request.tarif_price import TarifPriceRequestSch... |
import os
import sys
import time
from collections import namedtuple
import pendulum
from dagster import check, seven
from dagster.core.definitions.run_request import InstigatorType
from dagster.core.definitions.sensor_definition import DefaultSensorStatus, SensorExecutionData
from dagster.core.errors import DagsterErr... | import os
import sys
import time
from collections import namedtuple
import pendulum
from dagster import check, seven
from dagster.core.definitions.run_request import InstigatorType
from dagster.core.definitions.sensor_definition import DefaultSensorStatus, SensorExecutionData
from dagster.core.errors import DagsterErr... |
import re
from requests import get
from datetime import datetime
from time import sleep
from bs4 import BeautifulSoup
now = datetime.now()
time = datetime.strftime(now, "\n%d-%B-%Y\t%H:%M:%S:%f\n")
types = {
"dollar": {
"name": "DOLAR",
"path": "/serbest-piyasa/amerikan-dolari",
"tag": "di... | import re
from requests import get
from datetime import datetime
from time import sleep
from bs4 import BeautifulSoup
now = datetime.now()
time = datetime.strftime(now, "\n%d-%B-%Y\t%H:%M:%S:%f\n")
types = {
"dollar": {
"name": "DOLAR",
"path": "/serbest-piyasa/amerikan-dolari",
"tag": "di... |
from BaseUserHandler import *
import datetime as dt
class EditExerciseHandler(BaseUserHandler):
def get(self, course, assignment, exercise):
try:
if self.is_administrator() or self.is_instructor_for_course(course) or self.is_assistant_for_course(course):
exercises = self.content... | from BaseUserHandler import *
import datetime as dt
class EditExerciseHandler(BaseUserHandler):
def get(self, course, assignment, exercise):
try:
if self.is_administrator() or self.is_instructor_for_course(course) or self.is_assistant_for_course(course):
exercises = self.content... |
"""mycloud URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/4.0/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Cla... | """mycloud URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/4.0/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Cla... |
"""Driver module for `vara-cs`."""
import logging
import os
import re
import typing as tp
from argparse import ArgumentParser, ArgumentTypeError, _SubParsersAction
from enum import Enum
from pathlib import Path
from argparse_utils import enum_action
from plumbum import FG, colors, local
from varats.base.sampling_met... | """Driver module for `vara-cs`."""
import logging
import os
import re
import typing as tp
from argparse import ArgumentParser, ArgumentTypeError, _SubParsersAction
from enum import Enum
from pathlib import Path
from argparse_utils import enum_action
from plumbum import FG, colors, local
from varats.base.sampling_met... |
"""
Universe configuration builder.
"""
# absolute_import needed for tool_shed package.
import collections
import configparser
import errno
import ipaddress
import logging
import logging.config
import os
import re
import signal
import socket
import string
import sys
import tempfile
import threading
import time
from da... | """
Universe configuration builder.
"""
# absolute_import needed for tool_shed package.
import collections
import configparser
import errno
import ipaddress
import logging
import logging.config
import os
import re
import signal
import socket
import string
import sys
import tempfile
import threading
import time
from da... |
import os
import pandas as pd
from babel.numbers import format_currency, format_decimal
from notify.exceptions import EnvironmentVariablesError
def format_numbers(df: pd.DataFrame, currency_columns: list = None, number_columns: list = None):
"""
Deze functie converteerd currency (bedrag) en number (getal) k... | import os
import pandas as pd
from babel.numbers import format_currency, format_decimal
from notify.exceptions import EnvironmentVariablesError
def format_numbers(df: pd.DataFrame, currency_columns: list = None, number_columns: list = None):
"""
Deze functie converteerd currency (bedrag) en number (getal) k... |
# Copyright 2020 Google, LLC.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | # Copyright 2020 Google, LLC.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
"""Model classes representing a tensor comprehension.
These classes model the language more at an AST level as evaluat... | # Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
"""Model classes representing a tensor comprehension.
These classes model the language more at an AST level as evaluat... |
import logging
from tqdm import tqdm
from typing import Optional, Union
from brainscore.metrics import Score
from brainscore.model_interface import BrainModel
from brainscore.utils import fullname
from model_tools.activations.pca import LayerPCA
from model_tools.brain_transformation import TemporalIgnore
from model_to... | import logging
from tqdm import tqdm
from typing import Optional, Union
from brainscore.metrics import Score
from brainscore.model_interface import BrainModel
from brainscore.utils import fullname
from model_tools.activations.pca import LayerPCA
from model_tools.brain_transformation import TemporalIgnore
from model_to... |
import os
import sys
import io
import pytz
import yaml
from datetime import datetime
import rx
from rx import operators as ops
from concurrent.futures import ProcessPoolExecutor
from urllib.request import urlopen
from csv import DictReader
from functools import partial
from collections import namedtuple
from rich ... | import os
import sys
import io
import pytz
import yaml
from datetime import datetime
import rx
from rx import operators as ops
from concurrent.futures import ProcessPoolExecutor
from urllib.request import urlopen
from csv import DictReader
from functools import partial
from collections import namedtuple
from rich ... |
import urllib.request
from invoke import task
import json
import os
import logging
logging.basicConfig(level=logging.INFO,
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s')
logger = logging.getLogger(__name__)
def download_releases(base_dir, repo, target_dir):
if not base_dir:
... | import urllib.request
from invoke import task
import json
import os
import logging
logging.basicConfig(level=logging.INFO,
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s')
logger = logging.getLogger(__name__)
def download_releases(base_dir, repo, target_dir):
if not base_dir:
... |
##############################################################################
# Copyright by The HDF Group. #
# All rights reserved. #
# #
# Th... | ##############################################################################
# Copyright by The HDF Group. #
# All rights reserved. #
# #
# Th... |
import ssl
import smtplib
import imaplib
import email
class MailBot:
"""
Sending and receiving mail
This contains all methods to interact with smtp and imap servers
"""
# Configs - should not need to change
ssl_port = 465
smtp_server = "smtp.gmail.com"
imap_server = "imap.gmail.c... | import ssl
import smtplib
import imaplib
import email
class MailBot:
"""
Sending and receiving mail
This contains all methods to interact with smtp and imap servers
"""
# Configs - should not need to change
ssl_port = 465
smtp_server = "smtp.gmail.com"
imap_server = "imap.gmail.c... |
# pylint:disable=unused-variable
# pylint:disable=unused-argument
# pylint:disable=redefined-outer-name
import os
from copy import deepcopy
from typing import Dict
import aiohttp
import pytest
import tenacity
from minio import Minio
from servicelib.minio_utils import MinioRetryPolicyUponInitialization
from... | # pylint:disable=unused-variable
# pylint:disable=unused-argument
# pylint:disable=redefined-outer-name
import os
from copy import deepcopy
from typing import Dict
import aiohttp
import pytest
import tenacity
from minio import Minio
from servicelib.minio_utils import MinioRetryPolicyUponInitialization
from... |
# Copyright (c) Aishwarya Kamath & Nicolas Carion. Licensed under the Apache License 2.0. All Rights Reserved
import argparse
import json
import math
import os
import pickle
from collections import Counter, defaultdict
from copy import deepcopy
from functools import partial
from multiprocessing import Pool
from pathlib... | # Copyright (c) Aishwarya Kamath & Nicolas Carion. Licensed under the Apache License 2.0. All Rights Reserved
import argparse
import json
import math
import os
import pickle
from collections import Counter, defaultdict
from copy import deepcopy
from functools import partial
from multiprocessing import Pool
from pathlib... |
"""well.py: resqpy well module providing trajectory, deviation survey, blocked well, wellbore frame and marker frame and md datum classes.
Example::
# Wellbore interpretations
for well in model.iter_wellbore_interpretations():
print(well.title)
for trajectory in well.iter_trajectories():
p... | """well.py: resqpy well module providing trajectory, deviation survey, blocked well, wellbore frame and marker frame and md datum classes.
Example::
# Wellbore interpretations
for well in model.iter_wellbore_interpretations():
print(well.title)
for trajectory in well.iter_trajectories():
p... |
#!/usr/bin/env python3
"""
Defines the SeEpub class, the master class for representing and operating on
Standard Ebooks epub3 files.
"""
import base64
import datetime
import os
from pathlib import Path
from typing import Dict, List, Optional, Tuple, Union
from sys import getsizeof
import git
from lxml import etree
fr... | #!/usr/bin/env python3
"""
Defines the SeEpub class, the master class for representing and operating on
Standard Ebooks epub3 files.
"""
import base64
import datetime
import os
from pathlib import Path
from typing import Dict, List, Optional, Tuple, Union
from sys import getsizeof
import git
from lxml import etree
fr... |
from abc import ABC, abstractmethod
from collections import abc as cabc
from typing import Union, Optional, Type, ClassVar, TypeVar # Special types
from typing import Iterator, Mapping, Sequence # ABCs
from typing import Tuple, List, Dict # Generic base types
import numpy as np
import pandas as pd
from scipy.sparse... | from abc import ABC, abstractmethod
from collections import abc as cabc
from typing import Union, Optional, Type, ClassVar, TypeVar # Special types
from typing import Iterator, Mapping, Sequence # ABCs
from typing import Tuple, List, Dict # Generic base types
import numpy as np
import pandas as pd
from scipy.sparse... |
import asyncio
from datetime import datetime
from typing import Callable
import discord
from discord.ext import commands
class AoiTask:
def __init__(self, task: asyncio.Task, ctx: commands.Context, status: Callable[[], str]):
self.task = task
self.ctx = ctx
self._status = status
s... | import asyncio
from datetime import datetime
from typing import Callable
import discord
from discord.ext import commands
class AoiTask:
def __init__(self, task: asyncio.Task, ctx: commands.Context, status: Callable[[], str]):
self.task = task
self.ctx = ctx
self._status = status
s... |
# Copyright (C) 2019 The Raphielscape Company LLC.
#
# Licensed under the Raphielscape Public License, Version 1.c (the "License");
# you may not use this file except in compliance with the License.
""" Userbot module for having some fun with people. """
from asyncio import sleep
from random import choice, getrandbits... | # Copyright (C) 2019 The Raphielscape Company LLC.
#
# Licensed under the Raphielscape Public License, Version 1.c (the "License");
# you may not use this file except in compliance with the License.
""" Userbot module for having some fun with people. """
from asyncio import sleep
from random import choice, getrandbits... |
import jk_pypiorgapi
from datetime import datetime
import re
import requests
import time
from pprint import pprint
import json
import pickle
from multiprocessing import Pool
# set up autentification github
username = 'edigeze'
# token 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
token = 'ghp_AivkwMUfiMYhIjcHmYVHfzyylB35... | import jk_pypiorgapi
from datetime import datetime
import re
import requests
import time
from pprint import pprint
import json
import pickle
from multiprocessing import Pool
# set up autentification github
username = 'edigeze'
# token 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
token = 'ghp_AivkwMUfiMYhIjcHmYVHfzyylB35... |
from http import HTTPStatus
from api import app, database
from flask import jsonify, request, abort, make_response
def check_and_insert(company):
"""
Inserts the supplied company record if it doesnt already exists
"""
# Get the companies collection from the database
company_collection = database()
... | from http import HTTPStatus
from api import app, database
from flask import jsonify, request, abort, make_response
def check_and_insert(company):
"""
Inserts the supplied company record if it doesnt already exists
"""
# Get the companies collection from the database
company_collection = database()
... |
import os
import platform
from pathlib import Path
from torchaudio.datasets import tedlium
from torchaudio_unittest.common_utils import (
get_whitenoise,
save_wav,
skipIfNoSox,
TempDirMixin,
TorchaudioTestCase,
)
# Used to generate a unique utterance for each dummy audio file
_UTTERANCES = [
"... | import os
import platform
from pathlib import Path
from torchaudio.datasets import tedlium
from torchaudio_unittest.common_utils import (
get_whitenoise,
save_wav,
skipIfNoSox,
TempDirMixin,
TorchaudioTestCase,
)
# Used to generate a unique utterance for each dummy audio file
_UTTERANCES = [
"... |
#!/usr/bin/python3
# coding=utf-8
# pylint: disable=I0011,E0401,W0702,W0703
# Copyright 2019 getcarrier.io
#
# 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... | #!/usr/bin/python3
# coding=utf-8
# pylint: disable=I0011,E0401,W0702,W0703
# Copyright 2019 getcarrier.io
#
# 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... |
#!/usr/bin/env python
# coding: utf-8
"""Controllers for HebPhonics."""
# native
import os
from inspect import cleandoc
# lib
from flask import jsonify, render_template, request
from sqlalchemy.sql import and_, or_
from sqlalchemy.sql.expression import desc, false, func
from markdown import markdown
# pkg
from .. im... | #!/usr/bin/env python
# coding: utf-8
"""Controllers for HebPhonics."""
# native
import os
from inspect import cleandoc
# lib
from flask import jsonify, render_template, request
from sqlalchemy.sql import and_, or_
from sqlalchemy.sql.expression import desc, false, func
from markdown import markdown
# pkg
from .. im... |
# Copyright 2021 Amazon.com, Inc. or its affiliates. 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. A copy of the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "LICENSE.txt" file accom... | # Copyright 2021 Amazon.com, Inc. or its affiliates. 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. A copy of the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "LICENSE.txt" file accom... |
"""
Functions to do with masks and mixing matrices.
"""
import copy
import time
import warnings
import healpy as hp
import matplotlib.cm
import matplotlib.pyplot as plt
import numpy as np
import pymaster as nmt
def generate_mask(wmap_mask_path, nside, target_fsky, mask_save_path):
"""
Generate a Stage-IV-li... | """
Functions to do with masks and mixing matrices.
"""
import copy
import time
import warnings
import healpy as hp
import matplotlib.cm
import matplotlib.pyplot as plt
import numpy as np
import pymaster as nmt
def generate_mask(wmap_mask_path, nside, target_fsky, mask_save_path):
"""
Generate a Stage-IV-li... |
import copy
import json
import os
import pytest
import tempfile
from contextlib import contextmanager
from pathlib import Path
from unittest import mock
from requests import HTTPError
from RPA.Robocorp.WorkItems import (
BaseAdapter,
EmptyQueue,
FileAdapter,
RobocorpAdapter,
State,
WorkItems,
... | import copy
import json
import os
import pytest
import tempfile
from contextlib import contextmanager
from pathlib import Path
from unittest import mock
from requests import HTTPError
from RPA.Robocorp.WorkItems import (
BaseAdapter,
EmptyQueue,
FileAdapter,
RobocorpAdapter,
State,
WorkItems,
... |
import functools
import io
import pickle
from pathlib import Path
import pytest
import torch
from builtin_dataset_mocks import parametrize_dataset_mocks, DATASET_MOCKS
from torch.testing._comparison import assert_equal, TensorLikePair, ObjectPair
from torch.utils.data.datapipes.iter.grouping import ShardingFilterIterD... | import functools
import io
import pickle
from pathlib import Path
import pytest
import torch
from builtin_dataset_mocks import parametrize_dataset_mocks, DATASET_MOCKS
from torch.testing._comparison import assert_equal, TensorLikePair, ObjectPair
from torch.utils.data.datapipes.iter.grouping import ShardingFilterIterD... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright 2020 Marcel Bollmann <marcel@bollmann.me>
#
# 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/L... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright 2020 Marcel Bollmann <marcel@bollmann.me>
#
# 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/L... |
pessoas = {'nome': 'jonatan', 'sexo': 'M', 'idade': 39}
print('---'*15)
print(pessoas)
print(pessoas['idade'])
print(f'O {pessoas['nome']} tem {pessoas['idade']} anos')
print(pessoas.keys())
print(pessoas.values())
print(pessoas.items())
print('---'*15)
for k in pessoas.keys():
print(k)
print('---'*15)
for v in ... | pessoas = {'nome': 'jonatan', 'sexo': 'M', 'idade': 39}
print('---'*15)
print(pessoas)
print(pessoas['idade'])
print(f'O {pessoas["nome"]} tem {pessoas["idade"]} anos')
print(pessoas.keys())
print(pessoas.values())
print(pessoas.items())
print('---'*15)
for k in pessoas.keys():
print(k)
print('---'*15)
for v in ... |
import shutil
from glob import glob
from pathlib import Path
import pytest
_HERE = Path(__file__).parent
@pytest.fixture()
def test_data_folder():
return _HERE / 'data'
@pytest.fixture(scope='session')
def product_dir(tmp_path_factory):
prod = tmp_path_factory.mktemp('S1A_IW_20150621T120220_DVP_RTC10_G_sa... | import shutil
from glob import glob
from pathlib import Path
import pytest
_HERE = Path(__file__).parent
@pytest.fixture()
def test_data_folder():
return _HERE / 'data'
@pytest.fixture(scope='session')
def product_dir(tmp_path_factory):
prod = tmp_path_factory.mktemp('S1A_IW_20150621T120220_DVP_RTC10_G_sa... |
from fnmatch import fnmatch
from lxml.etree import Element
from Framework import Transform_Wrapper, Load_File, Load_Files, Plugin_Log
from .Support import Standardize_Match_Rules
from .Support import XML_Multiply_Int_Attribute
from .Support import XML_Multiply_Float_Attribute
__all__ = [
'Increase_AI_Script_Waits... |
from fnmatch import fnmatch
from lxml.etree import Element
from Framework import Transform_Wrapper, Load_File, Load_Files, Plugin_Log
from .Support import Standardize_Match_Rules
from .Support import XML_Multiply_Int_Attribute
from .Support import XML_Multiply_Float_Attribute
__all__ = [
'Increase_AI_Script_Waits... |
#!/usr/bin/env python3
import os
import shutil
import textwrap
from pathlib import Path
import pdoc.render_helpers
here = Path(__file__).parent
if os.environ.get("DOCS_ARCHIVE", False):
edit_url_map = {}
else:
edit_url_map = {
"mitmproxy": "https://github.com/mitmproxy/mitmproxy/blob/main/mitmproxy/"... | #!/usr/bin/env python3
import os
import shutil
import textwrap
from pathlib import Path
import pdoc.render_helpers
here = Path(__file__).parent
if os.environ.get("DOCS_ARCHIVE", False):
edit_url_map = {}
else:
edit_url_map = {
"mitmproxy": "https://github.com/mitmproxy/mitmproxy/blob/main/mitmproxy/"... |
import json
class Pdk(object):
def __init__(self):
"""Initialize empty container dict"""
self.pdk = {}
def __str__(self):
ret = ''
for key, value in self.pdk.items():
ret += f"{key}: {value}\n"
return ret
def __contains__(self, key):
return key... | import json
class Pdk(object):
def __init__(self):
"""Initialize empty container dict"""
self.pdk = {}
def __str__(self):
ret = ''
for key, value in self.pdk.items():
ret += f"{key}: {value}\n"
return ret
def __contains__(self, key):
return key... |
import pandas as pd
import numpy as np
from .engineobj import SqPandasEngine
from suzieq.utils import build_query_str, humanize_timestamp
class BgpObj(SqPandasEngine):
@staticmethod
def table_name():
return 'bgp'
def get(self, **kwargs):
"""Replacing the original interface name in retur... | import pandas as pd
import numpy as np
from .engineobj import SqPandasEngine
from suzieq.utils import build_query_str, humanize_timestamp
class BgpObj(SqPandasEngine):
@staticmethod
def table_name():
return 'bgp'
def get(self, **kwargs):
"""Replacing the original interface name in retur... |
import os
import requests as r
def urs_authenticate():
# AUTHENTICATION CONFIGURATION
from netrc import netrc
from subprocess import Popen
from getpass import getpass
urs = 'urs.earthdata.nasa.gov' # Earthdata URL to call for authentication
prompts = ['Enter NASA Earthdata Login Username \n... | import os
import requests as r
def urs_authenticate():
# AUTHENTICATION CONFIGURATION
from netrc import netrc
from subprocess import Popen
from getpass import getpass
urs = 'urs.earthdata.nasa.gov' # Earthdata URL to call for authentication
prompts = ['Enter NASA Earthdata Login Username \n... |
import pandas as pd
import logging
from datetime import datetime
from datetime import timedelta
from typing import Union
def validate_name_dob(dict_id: dict, flight_manifest: pd.DataFrame) -> pd.DataFrame:
# get idx where name matches, if more than one, check dob
idx_name = flight_manifest.query(
f"n... | import pandas as pd
import logging
from datetime import datetime
from datetime import timedelta
from typing import Union
def validate_name_dob(dict_id: dict, flight_manifest: pd.DataFrame) -> pd.DataFrame:
# get idx where name matches, if more than one, check dob
idx_name = flight_manifest.query(
f"n... |
# Copyright 2017 Alethea Katherine Flowers
#
# 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... | # Copyright 2017 Alethea Katherine Flowers
#
# 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... |
from py_imessage import imessage
from time import sleep
phone = "+66818726755"
if not imessage.check_compatibility(phone):
print("Not an iPhone.")
else:
print("Yes, he use iPhone.")
# guid = imessage.send(phone, "Hello World!")
#
# # Let the recipient read the message
# sleep(5)
# resp = imessage.status(guid... | from py_imessage import imessage
from time import sleep
phone = "+66818726755"
if not imessage.check_compatibility(phone):
print("Not an iPhone.")
else:
print("Yes, he use iPhone.")
# guid = imessage.send(phone, "Hello World!")
#
# # Let the recipient read the message
# sleep(5)
# resp = imessage.status(guid... |
# -*- coding: utf-8 -*-
import asyncio
import os
import signal
import asyncpg
from .App import App, AppData
from .AppConfig import AppConfig, KEY_EXPOSE, KEY_FORWARDS
from .Config import Config
from .Containers import Containers
from .DeploymentLock import DeploymentLock
from .Exceptions import StoryscriptError, TooM... | # -*- coding: utf-8 -*-
import asyncio
import os
import signal
import asyncpg
from .App import App, AppData
from .AppConfig import AppConfig, KEY_EXPOSE, KEY_FORWARDS
from .Config import Config
from .Containers import Containers
from .DeploymentLock import DeploymentLock
from .Exceptions import StoryscriptError, TooM... |
import asyncio
import base64
import hashlib
import json
import math
import os
import sys
import time
from dataclasses import asdict, dataclass, field, InitVar
from json import JSONDecodeError
from os.path import splitext, basename
from typing import Union, Any
from urllib import parse
from urllib.parse import quote
im... | import asyncio
import base64
import hashlib
import json
import math
import os
import sys
import time
from dataclasses import asdict, dataclass, field, InitVar
from json import JSONDecodeError
from os.path import splitext, basename
from typing import Union, Any
from urllib import parse
from urllib.parse import quote
im... |
import logging
import discord
from redbot.core import Config, commands
from redbot.core.bot import Red
from redbot.core.utils.chat_formatting import box, humanize_list
from .utils import Coordinate
log = logging.getLogger("red.craycogs.joinping")
guild_defaults = {
"ping_channels": [],
"delete_after": 2,
... | import logging
import discord
from redbot.core import Config, commands
from redbot.core.bot import Red
from redbot.core.utils.chat_formatting import box, humanize_list
from .utils import Coordinate
log = logging.getLogger("red.craycogs.joinping")
guild_defaults = {
"ping_channels": [],
"delete_after": 2,
... |
from contextlib import contextmanager
from pathlib import Path
from textwrap import indent
from typing import Tuple
import pytest
import sqlalchemy
import structlog
from click.testing import CliRunner
from datacube.drivers.postgres import PostgresDb
from datacube.drivers.postgres._core import METADATA as ODC_SCHEMA_ME... | from contextlib import contextmanager
from pathlib import Path
from textwrap import indent
from typing import Tuple
import pytest
import sqlalchemy
import structlog
from click.testing import CliRunner
from datacube.drivers.postgres import PostgresDb
from datacube.drivers.postgres._core import METADATA as ODC_SCHEMA_ME... |
import importlib
from types import ModuleType
from typing import Any, Dict
import click
from comeback import plugins
from comeback.utils import verbose_echo
def call(module: ModuleType,
**plugin_params: Dict[str, Any]) -> None:
try:
success, err = module.run_plugin(**plugin_params)
except T... | import importlib
from types import ModuleType
from typing import Any, Dict
import click
from comeback import plugins
from comeback.utils import verbose_echo
def call(module: ModuleType,
**plugin_params: Dict[str, Any]) -> None:
try:
success, err = module.run_plugin(**plugin_params)
except T... |
import json
import time
from typing import Callable, Iterator, Optional
import pandas as pd
from dagster_pandas import DataFrame
from dagster import (
Array,
AssetMaterialization,
Bool,
DagsterInvalidDefinitionError,
EventMetadataEntry,
Failure,
Field,
InputDefinition,
Int,
Non... | import json
import time
from typing import Callable, Iterator, Optional
import pandas as pd
from dagster_pandas import DataFrame
from dagster import (
Array,
AssetMaterialization,
Bool,
DagsterInvalidDefinitionError,
EventMetadataEntry,
Failure,
Field,
InputDefinition,
Int,
Non... |
#!/usr/bin/python3
import os
import boto3
import covid_scraper as cs
from botocore.exceptions import ClientError
from mimetypes import guess_type
INDEX='index.html'
CZECH_DATA='czechia_table.csv'
S3_DIR='data'
TMP='/tmp/'
# Client for operation with S3
# Requires IAM policy for S3 with following permissions:
# GetObj... | #!/usr/bin/python3
import os
import boto3
import covid_scraper as cs
from botocore.exceptions import ClientError
from mimetypes import guess_type
INDEX='index.html'
CZECH_DATA='czechia_table.csv'
S3_DIR='data'
TMP='/tmp/'
# Client for operation with S3
# Requires IAM policy for S3 with following permissions:
# GetObj... |
"""
A minimalistic version helper in the spirit of versioneer, that is able to run without build step using pkg_resources.
Developed by P Angerer, see https://github.com/flying-sheep/get_version.
"""
import re
import os
from pathlib import Path
from subprocess import run, PIPE, CalledProcessError
from typing import Nam... | """
A minimalistic version helper in the spirit of versioneer, that is able to run without build step using pkg_resources.
Developed by P Angerer, see https://github.com/flying-sheep/get_version.
"""
import re
import os
from pathlib import Path
from subprocess import run, PIPE, CalledProcessError
from typing import Nam... |
import random
import re
import datetime
import demjson
import requests
import time
import sys
sys.path.append('..')
from configure.settings import DBSelector, send_from_aliyun
from common.BaseService import BaseService
import warnings
warnings.filterwarnings("ignore")
now = datetime.datetime.now()
TODAY = now.strfti... | import random
import re
import datetime
import demjson
import requests
import time
import sys
sys.path.append('..')
from configure.settings import DBSelector, send_from_aliyun
from common.BaseService import BaseService
import warnings
warnings.filterwarnings("ignore")
now = datetime.datetime.now()
TODAY = now.strfti... |
"""
Copyright 2021 Dugal Harris - dugalh@gmail.com
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 applicab... | """
Copyright 2021 Dugal Harris - dugalh@gmail.com
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 applicab... |
from django.http import HttpResponse
from django.core.mail import send_mail
from django.template.loader import render_to_string
from django.conf import settings
from .models import Order, OrderLineItem
from products.models import Album
from profiles.models import UserProfile
import json
import time
class StripeWH_H... | from django.http import HttpResponse
from django.core.mail import send_mail
from django.template.loader import render_to_string
from django.conf import settings
from .models import Order, OrderLineItem
from products.models import Album
from profiles.models import UserProfile
import json
import time
class StripeWH_H... |
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... |
import textwrap
import jikanpy
import requests
def getPosterLink(mal):
# grab poster from kitsu
kitsu = getKitsu(mal)
image = requests.get(f'https://kitsu.io/api/edge/anime/{kitsu}').json()
return image['data']['attributes']['posterImage']['original']
def getKitsu(mal):
# get kitsu id from mal id... | import textwrap
import jikanpy
import requests
def getPosterLink(mal):
# grab poster from kitsu
kitsu = getKitsu(mal)
image = requests.get(f'https://kitsu.io/api/edge/anime/{kitsu}').json()
return image['data']['attributes']['posterImage']['original']
def getKitsu(mal):
# get kitsu id from mal id... |
#
# This file is part of LiteX.
#
# Copyright (c) 2020 Florent Kermarrec <florent@enjoy-digital.fr>
# Copyright (c) 2020 Dolu1990 <charles.papon.90@gmail.com>
# SPDX-License-Identifier: BSD-2-Clause
import os
from os import path
from migen import *
from litex import get_data_mod
from litex.soc.interconnect import w... | #
# This file is part of LiteX.
#
# Copyright (c) 2020 Florent Kermarrec <florent@enjoy-digital.fr>
# Copyright (c) 2020 Dolu1990 <charles.papon.90@gmail.com>
# SPDX-License-Identifier: BSD-2-Clause
import os
from os import path
from migen import *
from litex import get_data_mod
from litex.soc.interconnect import w... |
""""""
from typing import Callable, Dict, List
import pytz
from datetime import datetime
from time import sleep
from ..api import (
MdApi,
TdApi,
USTP_FTDC_AF_Delete,
USTP_FTDC_CAS_Accepted,
USTP_FTDC_CAS_Rejected,
USTP_FTDC_CAS_Submitted,
USTP_FTDC_CHF_Speculation,
USTP_FTDC_D_Buy,
... | """"""
from typing import Callable, Dict, List
import pytz
from datetime import datetime
from time import sleep
from ..api import (
MdApi,
TdApi,
USTP_FTDC_AF_Delete,
USTP_FTDC_CAS_Accepted,
USTP_FTDC_CAS_Rejected,
USTP_FTDC_CAS_Submitted,
USTP_FTDC_CHF_Speculation,
USTP_FTDC_D_Buy,
... |
import sys
from baselines.common.cmd_util import common_arg_parser
from baselines.run import parse_cmdline_kwargs
from baselines.her.metric_diversification import MetricDiversifier
from baselines.her.cover_measure import init_from_point
import gym
#import gym_maze
import numpy as np
import time
from baselines.her.paper... | import sys
from baselines.common.cmd_util import common_arg_parser
from baselines.run import parse_cmdline_kwargs
from baselines.her.metric_diversification import MetricDiversifier
from baselines.her.cover_measure import init_from_point
import gym
#import gym_maze
import numpy as np
import time
from baselines.her.paper... |
import asyncio
import dataclasses
import logging
import random
import time
import traceback
from pathlib import Path
from typing import Any, Callable, Dict, List, Optional, Set, Tuple, Union
import aiosqlite
from blspy import AugSchemeMPL
import chialite.server.ws_connection as ws # lgtm [py/import-and-import-from]
... | import asyncio
import dataclasses
import logging
import random
import time
import traceback
from pathlib import Path
from typing import Any, Callable, Dict, List, Optional, Set, Tuple, Union
import aiosqlite
from blspy import AugSchemeMPL
import chialite.server.ws_connection as ws # lgtm [py/import-and-import-from]
... |
# -*- coding: utf-8 -*-
from PyQt5 import QtCore, QtGui, QtWidgets
import numpy as np
import os
from GUI.audio_device_widget import AudioDeviceWidget
from GUI.plot_widget import PlotWidget, PlotWidget_HPIRs, PlotWidget_HPCF
use_vispy = True
try:
from GUI.vispyWidget import VispyCanvas
except ImportError:
use... | # -*- coding: utf-8 -*-
from PyQt5 import QtCore, QtGui, QtWidgets
import numpy as np
import os
from GUI.audio_device_widget import AudioDeviceWidget
from GUI.plot_widget import PlotWidget, PlotWidget_HPIRs, PlotWidget_HPCF
use_vispy = True
try:
from GUI.vispyWidget import VispyCanvas
except ImportError:
use... |
#!/usr/bin/env python3
import logging
import re
from telegram import InlineKeyboardButton, InlineKeyboardMarkup, Update
from telegram.ext import (CallbackQueryHandler, CommandHandler,
ConversationHandler, Filters, MessageHandler,
Updater)
from commons import checkI... | #!/usr/bin/env python3
import logging
import re
from telegram import InlineKeyboardButton, InlineKeyboardMarkup, Update
from telegram.ext import (CallbackQueryHandler, CommandHandler,
ConversationHandler, Filters, MessageHandler,
Updater)
from commons import checkI... |
# Copyright 2016-2021, Pulumi Corporation.
#
# 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 t... | # Copyright 2016-2021, Pulumi Corporation.
#
# 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 t... |
# Licensed to the .NET Foundation under one or more agreements.
# The .NET Foundation licenses this file to you under the MIT license.
# See the LICENSE file in the project root for more information.
from contextlib import contextmanager
from dataclasses import dataclass
from os import environ
from pathlib import Path... | # Licensed to the .NET Foundation under one or more agreements.
# The .NET Foundation licenses this file to you under the MIT license.
# See the LICENSE file in the project root for more information.
from contextlib import contextmanager
from dataclasses import dataclass
from os import environ
from pathlib import Path... |
import struct, io, collections, os, random, ipaddress
from . import enums, crypto
class Payload:
def __init__(self, type, critical=False):
self.type = enums.Payload(type)
self.critical = critical
self.data = None
@classmethod
def parse(cls, type, critical, stream, length):
s... | import struct, io, collections, os, random, ipaddress
from . import enums, crypto
class Payload:
def __init__(self, type, critical=False):
self.type = enums.Payload(type)
self.critical = critical
self.data = None
@classmethod
def parse(cls, type, critical, stream, length):
s... |
"""
Explanation of Code:
"""
# This file is a loose translation of Morgan Price's MultiCodes.pl into python.
import os
import logging
import re
import copy
import time
"""
Program Process:
"""
def RunMultiCodes(MC_d):
"""
(fp stands for filepath)
Inputs as listed in function 'CheckInputs'... | """
Explanation of Code:
"""
# This file is a loose translation of Morgan Price's MultiCodes.pl into python.
import os
import logging
import re
import copy
import time
"""
Program Process:
"""
def RunMultiCodes(MC_d):
"""
(fp stands for filepath)
Inputs as listed in function 'CheckInputs'... |
import random
import math
from typing import List, Dict
"""
This file can be a nice home for your move logic, and to write helper functions.
"""
def avoid_my_neck(my_head: Dict[str, int], my_body: List[dict],
possible_moves: List[str]) -> List[str]:
"""
my_head: Dictionary of x/y coordinates... | import random
import math
from typing import List, Dict
"""
This file can be a nice home for your move logic, and to write helper functions.
"""
def avoid_my_neck(my_head: Dict[str, int], my_body: List[dict],
possible_moves: List[str]) -> List[str]:
"""
my_head: Dictionary of x/y coordinates... |
################################################################################
# ForecasterAutoregMultiOutput #
# #
# This work by Joaquin Amat Rodrigo is licensed under a Creative Commons ... | ################################################################################
# ForecasterAutoregMultiOutput #
# #
# This work by Joaquin Amat Rodrigo is licensed under a Creative Commons ... |
# 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... |
"""Smoke tests ranging across the CIDC REST API.
This file doesn't contain tests for methods that don't directly correspond
to data resources, like endpoints that handle upload-related functionality.
"""
from cidc_api.models.templates.trial_metadata import ClinicalTrial
from collections import OrderedDict
from cidc_ap... | """Smoke tests ranging across the CIDC REST API.
This file doesn't contain tests for methods that don't directly correspond
to data resources, like endpoints that handle upload-related functionality.
"""
from cidc_api.models.templates.trial_metadata import ClinicalTrial
from collections import OrderedDict
from cidc_ap... |
import os
import subprocess
import sys
from invoke import task
class GoModule:
"""A Go module abstraction."""
def __init__(self, path, targets=None, condition=lambda: True, should_tag=True):
self.path = path
self.targets = targets if targets else ["."]
self.condition = condition
... | import os
import subprocess
import sys
from invoke import task
class GoModule:
"""A Go module abstraction."""
def __init__(self, path, targets=None, condition=lambda: True, should_tag=True):
self.path = path
self.targets = targets if targets else ["."]
self.condition = condition
... |
"""
Module containing a class for
calibrating multiple calibration classes at once.
"""
import os
from typing import List
import numpy as np
from aixcalibuha import CalibrationClass, data_types
from aixcalibuha.calibration import Calibrator
class MultipleClassCalibrator(Calibrator):
r"""
Class for calibratio... | """
Module containing a class for
calibrating multiple calibration classes at once.
"""
import os
from typing import List
import numpy as np
from aixcalibuha import CalibrationClass, data_types
from aixcalibuha.calibration import Calibrator
class MultipleClassCalibrator(Calibrator):
r"""
Class for calibratio... |
frase = str(input('Digite uma frase: ')).strip().upper()
print(f'A letra "A" aparece {frase.count('A')} vezes na frase.\n'
f'A primeira letra "A" aparece na posição {frase.find('A') + 1}.\n'
f'E a ultima letra "A" aparece 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 na frase.\n'
f'A primeira letra "A" aparece na posição {frase.find("A") + 1}.\n'
f'E a ultima letra "A" aparece na posição {frase.rfind("A") + 1}.')
|
import boto3
from typing import List
from botocore.exceptions import ClientError
from shelvery.aws_helper import AwsHelper
from shelvery.engine import SHELVERY_DO_BACKUP_TAGS
from shelvery.ec2_backup import ShelveryEC2Backup
from shelvery.entity_resource import EntityResource
from shelvery.backup_resource import Back... | import boto3
from typing import List
from botocore.exceptions import ClientError
from shelvery.aws_helper import AwsHelper
from shelvery.engine import SHELVERY_DO_BACKUP_TAGS
from shelvery.ec2_backup import ShelveryEC2Backup
from shelvery.entity_resource import EntityResource
from shelvery.backup_resource import Back... |
from pyrogram import filters
from pyrogram.types.bots_and_keyboards import callback_game
from pyrogram.types.bots_and_keyboards.inline_keyboard_button import InlineKeyboardButton
from pyrogram.types.bots_and_keyboards.inline_keyboard_markup import InlineKeyboardMarkup
from nksama import bot ,help_message
from typing i... | from pyrogram import filters
from pyrogram.types.bots_and_keyboards import callback_game
from pyrogram.types.bots_and_keyboards.inline_keyboard_button import InlineKeyboardButton
from pyrogram.types.bots_and_keyboards.inline_keyboard_markup import InlineKeyboardMarkup
from nksama import bot ,help_message
from typing i... |
from toolz.itertoolz import last
from web3 import Web3
import argparse
import time
import datetime
import sys
import json
import numpy as np
import random
from decimal import Decimal
with open('config.json') as f:
config = json.load(f)
# Connect our wallet
web3 = Web3(Web3.HTTPProvider("https://bsc-dataseed.binanc... | from toolz.itertoolz import last
from web3 import Web3
import argparse
import time
import datetime
import sys
import json
import numpy as np
import random
from decimal import Decimal
with open('config.json') as f:
config = json.load(f)
# Connect our wallet
web3 = Web3(Web3.HTTPProvider("https://bsc-dataseed.binanc... |
# -*- coding: utf-8 -*-
# See LICENSE.txt for licensing terms
'''
This module provides one useful class: NodeHandler
The NodeHandler class is designed to be subclassed. Each subclass
should support the processing that createpdf.RstToPdf needs to do
on a particular type of node that could appear in a document tree.
... | # -*- coding: utf-8 -*-
# See LICENSE.txt for licensing terms
'''
This module provides one useful class: NodeHandler
The NodeHandler class is designed to be subclassed. Each subclass
should support the processing that createpdf.RstToPdf needs to do
on a particular type of node that could appear in a document tree.
... |
from collections import Counter
import aiohttp
import asyncio
import functools
import json
import time
from pprint import pprint
from typing import List, Dict, Optional, Callable
from xcha.cmds.wallet_funcs import print_balance, wallet_coin_unit
from xcha.pools.pool_wallet_info import PoolWalletInfo, PoolSingletonSt... | from collections import Counter
import aiohttp
import asyncio
import functools
import json
import time
from pprint import pprint
from typing import List, Dict, Optional, Callable
from xcha.cmds.wallet_funcs import print_balance, wallet_coin_unit
from xcha.pools.pool_wallet_info import PoolWalletInfo, PoolSingletonSt... |
"""Example showing how you can transfer a big file to the instrument and from the instrument with showing the progress.
Since the SMW is quite fast on data transfer, we slow it down by waiting for 100ms between each chunk transfer (1MB)
This way we see the transfer progress better and we do not need a file that is so b... | """Example showing how you can transfer a big file to the instrument and from the instrument with showing the progress.
Since the SMW is quite fast on data transfer, we slow it down by waiting for 100ms between each chunk transfer (1MB)
This way we see the transfer progress better and we do not need a file that is so b... |
"""
Class that represents the execution level of nsight
@author: Alvaro Saiz (UC)
@date: Jul 2021
@version: 1.0
"""
import locale
from abc import ABC, abstractmethod # abstract class
import os, sys, inspect
currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
parentdir = os... | """
Class that represents the execution level of nsight
@author: Alvaro Saiz (UC)
@date: Jul 2021
@version: 1.0
"""
import locale
from abc import ABC, abstractmethod # abstract class
import os, sys, inspect
currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
parentdir = os... |
"""Utility for plotting test results."""
import argparse
from collections import defaultdict
import csv
import numpy as np
import os.path
import sys
import matplotlib.pyplot as plt
_TESTCASE, _DATASET, _PARAM, _CONDITION, _ROUND, _TIME = 'test', 'dataset', 'param', 'condition', 'round', 'time'
def _stats(iterable):... | """Utility for plotting test results."""
import argparse
from collections import defaultdict
import csv
import numpy as np
import os.path
import sys
import matplotlib.pyplot as plt
_TESTCASE, _DATASET, _PARAM, _CONDITION, _ROUND, _TIME = 'test', 'dataset', 'param', 'condition', 'round', 'time'
def _stats(iterable):... |
#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import os
import numpy as np
import pytest
import habitat
from habitat.utils.test_utils import sample_non_stop_action
... | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import os
import numpy as np
import pytest
import habitat
from habitat.utils.test_utils import sample_non_stop_action
... |
#!/usr/bin/evn python3
"""
Record Section plotting tool for seismic waveforms (observed and synthetic)
This is a refactor of Pysep's Python utility `plotw_rs`, a record section
plotting script. The intent of this script is to plot multiple time series'
based on source-receiver characteristics (i.e., src-rcv distance, ... | #!/usr/bin/evn python3
"""
Record Section plotting tool for seismic waveforms (observed and synthetic)
This is a refactor of Pysep's Python utility `plotw_rs`, a record section
plotting script. The intent of this script is to plot multiple time series'
based on source-receiver characteristics (i.e., src-rcv distance, ... |
import os
import sys
import time
import random
import string
import argparse
import torch
import torch.backends.cudnn as cudnn
import torch.nn.init as init
import torch.optim as optim
import torch.utils.data
import numpy as np
from utils import CTCLabelConverter, AttnLabelConverter, Averager
from dataset import hiera... | import os
import sys
import time
import random
import string
import argparse
import torch
import torch.backends.cudnn as cudnn
import torch.nn.init as init
import torch.optim as optim
import torch.utils.data
import numpy as np
from utils import CTCLabelConverter, AttnLabelConverter, Averager
from dataset import hiera... |
import pandas as pd
from matplotlib import pyplot as plt
import os
import sys
import seaborn as sns
import json
import argparse
from dotmap import DotMap
import numpy as np
# ================================================================
# SETTINGS
# ================================================================
... | import pandas as pd
from matplotlib import pyplot as plt
import os
import sys
import seaborn as sns
import json
import argparse
from dotmap import DotMap
import numpy as np
# ================================================================
# SETTINGS
# ================================================================
... |
import os
import dotenv
import logging
import time
import textwrap
import argparse
import stat
import glob
import pathlib
import datetime
import shutil
import subprocess
from irods.session import iRODSSession
from irods.meta import iRODSMeta
RESOURCE_ID_GLOB = "????????????????????????????????"
EXCLUDED = ["bags", "te... | import os
import dotenv
import logging
import time
import textwrap
import argparse
import stat
import glob
import pathlib
import datetime
import shutil
import subprocess
from irods.session import iRODSSession
from irods.meta import iRODSMeta
RESOURCE_ID_GLOB = "????????????????????????????????"
EXCLUDED = ["bags", "te... |
"""Generic step implementations for reports, subjects, metrics, and sources."""
import json
from asserts import assert_equal, assert_false, assert_true
from behave import given, when, then
@given("an existing {item}")
@given('an existing {item} with {attribute} "{value}"')
@given('an existing {item} with {attribute}... | """Generic step implementations for reports, subjects, metrics, and sources."""
import json
from asserts import assert_equal, assert_false, assert_true
from behave import given, when, then
@given("an existing {item}")
@given('an existing {item} with {attribute} "{value}"')
@given('an existing {item} with {attribute}... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.