edited_code stringlengths 17 978k | original_code stringlengths 17 978k |
|---|---|
import base64
import mimetypes
from typing import Any, Dict
from ....models.models import Resource
from ....shared.exceptions import ActionException
from ....shared.filters import And, FilterOperator
from ...action import original_instances
from ...generics.create import CreateAction
from ...util.default_schema import... | import base64
import mimetypes
from typing import Any, Dict
from ....models.models import Resource
from ....shared.exceptions import ActionException
from ....shared.filters import And, FilterOperator
from ...action import original_instances
from ...generics.create import CreateAction
from ...util.default_schema import... |
import argparse
import logging
import math
import os
from pathlib import Path
import random
import shutil
from typing import Dict, List
import cvdata.common
# ------------------------------------------------------------------------------
# set up a basic, global _logger which will write to the console
logging.basicC... | import argparse
import logging
import math
import os
from pathlib import Path
import random
import shutil
from typing import Dict, List
import cvdata.common
# ------------------------------------------------------------------------------
# set up a basic, global _logger which will write to the console
logging.basicC... |
# Copyright 2020-2021 Axis Communications AB.
#
# For a full list of individual contributors, please see the commit history.
#
# 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... | # Copyright 2020-2021 Axis Communications AB.
#
# For a full list of individual contributors, please see the commit history.
#
# 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... |
# Submit job to the remote cluster
import yaml
import sys
import time
import random
import os, subprocess
import pickle, datetime
def load_yaml_conf(yaml_file):
with open(yaml_file) as fin:
data = yaml.load(fin, Loader=yaml.FullLoader)
return data
def process_cmd(yaml_file):
yaml_conf = load_yam... | # Submit job to the remote cluster
import yaml
import sys
import time
import random
import os, subprocess
import pickle, datetime
def load_yaml_conf(yaml_file):
with open(yaml_file) as fin:
data = yaml.load(fin, Loader=yaml.FullLoader)
return data
def process_cmd(yaml_file):
yaml_conf = load_yam... |
from decimal import Decimal
from singer import get_logger
LOGGER = get_logger('target_snowflake')
# Ty to find faster json implementations
try:
import ujson as json
LOGGER.info("Using ujson.")
except ImportError:
try:
import simplejson as json
LOGGER.info("Using simplejson.")
except Im... | from decimal import Decimal
from singer import get_logger
LOGGER = get_logger('target_snowflake')
# Ty to find faster json implementations
try:
import ujson as json
LOGGER.info("Using ujson.")
except ImportError:
try:
import simplejson as json
LOGGER.info("Using simplejson.")
except Im... |
#Faça um programa que leia uma frase pelo teclado e mostre quantas vezes aparece a letra “A”,
# em que posição ela aparece a primeira vez e em que posição ela aparece a última vez.
frase = str(input('Digite uma frase ' )).upper().strip()
# Se colocar tudo em aspas simples da erro
print(f"A letra A na frase digitada ap... | #Faça um programa que leia uma frase pelo teclado e mostre quantas vezes aparece a letra “A”,
# em que posição ela aparece a primeira vez e em que posição ela aparece a última vez.
frase = str(input('Digite uma frase ' )).upper().strip()
# Se colocar tudo em aspas simples da erro
print(f"A letra A na frase digitada ap... |
"""
Classes encapsulating galaxy tools and tool configuration.
"""
import itertools
import json
import logging
import math
import os
import re
import tarfile
import tempfile
import threading
from pathlib import Path
from typing import (
Any,
cast,
Dict,
List,
NamedTuple,
Optional,
Set,
T... | """
Classes encapsulating galaxy tools and tool configuration.
"""
import itertools
import json
import logging
import math
import os
import re
import tarfile
import tempfile
import threading
from pathlib import Path
from typing import (
Any,
cast,
Dict,
List,
NamedTuple,
Optional,
Set,
T... |
#!/usr/bin/env python3
import asyncio
import errno
import json
import logging
import os
import stat
import sys
from functools import partial
from pathlib import Path
from platform import system
from shutil import rmtree, which
from subprocess import CalledProcessError
from sys import version_info
from tempfile import ... | #!/usr/bin/env python3
import asyncio
import errno
import json
import logging
import os
import stat
import sys
from functools import partial
from pathlib import Path
from platform import system
from shutil import rmtree, which
from subprocess import CalledProcessError
from sys import version_info
from tempfile import ... |
# Copyright (c) 2018-2022, NVIDIA CORPORATION.
from __future__ import annotations
import builtins
import pickle
import warnings
from types import SimpleNamespace
from typing import (
Any,
Dict,
List,
MutableSequence,
Optional,
Sequence,
Tuple,
TypeVar,
Union,
cast,
)
import cu... | # Copyright (c) 2018-2022, NVIDIA CORPORATION.
from __future__ import annotations
import builtins
import pickle
import warnings
from types import SimpleNamespace
from typing import (
Any,
Dict,
List,
MutableSequence,
Optional,
Sequence,
Tuple,
TypeVar,
Union,
cast,
)
import cu... |
import signal
import sys
import json
from contextlib import contextmanager
import matplotlib.pyplot as plt
import numpy as np
import requests
DELAY = INTERVAL = 4 * 60 # interval time in seconds
MIN_DELAY = MIN_INTERVAL = 2 * 60
KEEPALIVE_URL = "https://nebula.udacity.com/api/v1/remote/keep-alive"
TOKEN_URL = "ht... | import signal
import sys
import json
from contextlib import contextmanager
import matplotlib.pyplot as plt
import numpy as np
import requests
DELAY = INTERVAL = 4 * 60 # interval time in seconds
MIN_DELAY = MIN_INTERVAL = 2 * 60
KEEPALIVE_URL = "https://nebula.udacity.com/api/v1/remote/keep-alive"
TOKEN_URL = "ht... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Oct 14 18:23:18 2019
@author: ddd
"""
import tensorflow as tf
#tf.enable_eager_execution()
AUTOTUNE = tf.data.experimental.AUTOTUNE
from pycocotools.coco import COCO
#import IPython.display as display
#from PIL import Image
import numpy as np
import ... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Oct 14 18:23:18 2019
@author: ddd
"""
import tensorflow as tf
#tf.enable_eager_execution()
AUTOTUNE = tf.data.experimental.AUTOTUNE
from pycocotools.coco import COCO
#import IPython.display as display
#from PIL import Image
import numpy as np
import ... |
"""
Python library to fetch trending repositories/users using github-trending-api
Made by Hedy Li,
Code on GitHub
"""
from typing import Optional, List
import requests
def fetch_repos(
language: str = "",
spoken_language_code: str = "",
since: str = "daily",
) -> List[dict]:
"""Fetch trending repos... | """
Python library to fetch trending repositories/users using github-trending-api
Made by Hedy Li,
Code on GitHub
"""
from typing import Optional, List
import requests
def fetch_repos(
language: str = "",
spoken_language_code: str = "",
since: str = "daily",
) -> List[dict]:
"""Fetch trending repos... |
# coding: utf-8
# Author: Leo BRUNEL
# Contact: contact@leobrunel.com
# Python modules
from PyQt5 import QtWidgets, QtCore, QtGui
from PyQt5.QtCore import pyqtSignal
import os
import time
import logging
import traceback
import copy
# Wizard modules
from wizard.core import launch
from wizard.core import assets
from wi... | # coding: utf-8
# Author: Leo BRUNEL
# Contact: contact@leobrunel.com
# Python modules
from PyQt5 import QtWidgets, QtCore, QtGui
from PyQt5.QtCore import pyqtSignal
import os
import time
import logging
import traceback
import copy
# Wizard modules
from wizard.core import launch
from wizard.core import assets
from wi... |
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
from __future__ import division
from __future__ import print_function
import os
import re
import copy
import json
import yaml
import redis
import bisect
import shutil
import difflib
import hashlib
import datetime
import requests
import tempfile... | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
from __future__ import division
from __future__ import print_function
import os
import re
import copy
import json
import yaml
import redis
import bisect
import shutil
import difflib
import hashlib
import datetime
import requests
import tempfile... |
import os
import sys
from typing import List, Optional
helpData = {
"version": "prints the version",
"help": '''sobjects help [command]
Shows description of the command line interface.
Without an argument, prints help for all the commands. If one argument
is given, it should be one of the available command... | import os
import sys
from typing import List, Optional
helpData = {
"version": "prints the version",
"help": '''sobjects help [command]
Shows description of the command line interface.
Without an argument, prints help for all the commands. If one argument
is given, it should be one of the available command... |
""" Data manipulation routines """
def format_stock(stock):
"""
Formats stock in required formatting
"""
parsed_stock = {
"symbol": stock['symbol'],
"name": stock['name'],
"price": f"{stock["price"]:.2f}",
}
return parsed_stock
| """ Data manipulation routines """
def format_stock(stock):
"""
Formats stock in required formatting
"""
parsed_stock = {
"symbol": stock['symbol'],
"name": stock['name'],
"price": f"{stock['price']:.2f}",
}
return parsed_stock
|
'''
#Exemplo geral 1
#declaração de dicionário
pessoas = {'nome': 'Gustavo', 'sexo': 'M', 'idade': 22}
print(pessoas)
#print(pessoas[0])#dá erro, pois não existe índice 0
print(pessoas['nome'])#mostra o conteúdo do índice/key nome
print(pessoas['idade'])
print(f'O {pessoas['nome']} tem {pessoas['idade']} anos')
print... | '''
#Exemplo geral 1
#declaração de dicionário
pessoas = {'nome': 'Gustavo', 'sexo': 'M', 'idade': 22}
print(pessoas)
#print(pessoas[0])#dá erro, pois não existe índice 0
print(pessoas['nome'])#mostra o conteúdo do índice/key nome
print(pessoas['idade'])
print(f'O {pessoas["nome"]} tem {pessoas["idade"]} anos')
print... |
import logging
import argparse
import json
from datetime import datetime
from telegram.client import Telegram
import utils
logger = logging.getLogger(__name__)
def confirm(message):
sure = input(message + ' ')
if sure.lower() not in ['y', 'yes']:
exit(0)
def dump_my_msgs(tg, chat_id):
msg_id = 0... | import logging
import argparse
import json
from datetime import datetime
from telegram.client import Telegram
import utils
logger = logging.getLogger(__name__)
def confirm(message):
sure = input(message + ' ')
if sure.lower() not in ['y', 'yes']:
exit(0)
def dump_my_msgs(tg, chat_id):
msg_id = 0... |
# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | # Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... |
# Intro to Error Handling.
"""
Python has long history with errors.,
error are specially useful as they make code more readable.
We'll learn how you can create them, use them, or deal with them.,
at this very beginner stage no like errors.
"""
print(variable)
"""
Now, notice here, i haven't created my variable before p... | # Intro to Error Handling.
"""
Python has long history with errors.,
error are specially useful as they make code more readable.
We'll learn how you can create them, use them, or deal with them.,
at this very beginner stage no like errors.
"""
print(variable)
"""
Now, notice here, i haven't created my variable before p... |
# This software was developed by employees of the National Institute of
# Standards and Technology (NIST), an agency of the Federal Government.
# Pursuant to title 17 United States Code Section 105, works of NIST employees
# are not subject to copyright protection in the United States and are
# considered to be in the ... | # This software was developed by employees of the National Institute of
# Standards and Technology (NIST), an agency of the Federal Government.
# Pursuant to title 17 United States Code Section 105, works of NIST employees
# are not subject to copyright protection in the United States and are
# considered to be in the ... |
from typing import Any
import click
async def show_async(
rpc_port: int,
state: bool,
show_connections: bool,
exit_node: bool,
add_connection: str,
remove_connection: str,
block_header_hash_by_height: str,
block_by_header_hash: str,
) -> None:
import aiohttp
import time
im... | from typing import Any
import click
async def show_async(
rpc_port: int,
state: bool,
show_connections: bool,
exit_node: bool,
add_connection: str,
remove_connection: str,
block_header_hash_by_height: str,
block_by_header_hash: str,
) -> None:
import aiohttp
import time
im... |
from abc import ABCMeta, abstractmethod
from common.config_parser.config_error import ConfigError
class ConfigSection(metaclass=ABCMeta):
"""An abstract base class representing a base section of the
configuration file. Any specific section class must derive from it.
"""
def __init__(self, config, se... | from abc import ABCMeta, abstractmethod
from common.config_parser.config_error import ConfigError
class ConfigSection(metaclass=ABCMeta):
"""An abstract base class representing a base section of the
configuration file. Any specific section class must derive from it.
"""
def __init__(self, config, se... |
import os
import sys
import yaml
import textwrap
import subprocess
from cloudmesh.common.util import readfile, writefile, path_expand
from cloudmesh.common.util import yn_choice
from cloudmesh.common.Shell import Shell
class SBatch:
def __init__(self,
slurm_config,
account='ds601... | import os
import sys
import yaml
import textwrap
import subprocess
from cloudmesh.common.util import readfile, writefile, path_expand
from cloudmesh.common.util import yn_choice
from cloudmesh.common.Shell import Shell
class SBatch:
def __init__(self,
slurm_config,
account='ds601... |
#!/usr/bin/env python
import argparse
import copy
import indextools
# arrows: ↑ ↓ ← →
grid_base_arrows = """
→→→↓→→→→→↓
↑↓←←↑↓←←←↓
↑→→↓↑→↓→↑↓
↑↓←←↑↓←↑←←
↑→→→↑→→→→↓
↑←←←←↓←←←↓
→↓→→↑↓→↓↑↓
↑↓↑←←↓↑↓↑↓
↑→→→↑↓↑→↑↓
↑←←←←←↑←←←
"""
# converts arrows to UDLR text
grid_base = (
grid_base_arrows.translate(str.maketrans('↑↓... | #!/usr/bin/env python
import argparse
import copy
import indextools
# arrows: ↑ ↓ ← →
grid_base_arrows = """
→→→↓→→→→→↓
↑↓←←↑↓←←←↓
↑→→↓↑→↓→↑↓
↑↓←←↑↓←↑←←
↑→→→↑→→→→↓
↑←←←←↓←←←↓
→↓→→↑↓→↓↑↓
↑↓↑←←↓↑↓↑↓
↑→→→↑↓↑→↑↓
↑←←←←←↑←←←
"""
# converts arrows to UDLR text
grid_base = (
grid_base_arrows.translate(str.maketrans('↑↓... |
"""
Validating corpora
==================
"""
from __future__ import annotations
import multiprocessing as mp
import os
import subprocess
import sys
import time
import typing
from decimal import Decimal
from queue import Empty
from typing import TYPE_CHECKING, Dict, List, Optional
import sqlalchemy
import tqdm
from ... | """
Validating corpora
==================
"""
from __future__ import annotations
import multiprocessing as mp
import os
import subprocess
import sys
import time
import typing
from decimal import Decimal
from queue import Empty
from typing import TYPE_CHECKING, Dict, List, Optional
import sqlalchemy
import tqdm
from ... |
import datetime
import os
from kivy.animation import Animation
from kivy.app import App
from kivy.clock import Clock
from kivy.core.window import Window
from kivy.logger import Logger
from kivy.properties import BooleanProperty, ListProperty, NumericProperty, ObjectProperty, StringProperty
from kivy.storage.jsonstore ... | import datetime
import os
from kivy.animation import Animation
from kivy.app import App
from kivy.clock import Clock
from kivy.core.window import Window
from kivy.logger import Logger
from kivy.properties import BooleanProperty, ListProperty, NumericProperty, ObjectProperty, StringProperty
from kivy.storage.jsonstore ... |
import hashlib
import inspect
import logging
import os
import re
from abc import abstractmethod
from collections import Counter
from pathlib import Path
from typing import List, Union, Dict, Optional
import gensim
import numpy as np
import torch
from bpemb import BPEmb
from torch import nn
from transformers import Aut... | import hashlib
import inspect
import logging
import os
import re
from abc import abstractmethod
from collections import Counter
from pathlib import Path
from typing import List, Union, Dict, Optional
import gensim
import numpy as np
import torch
from bpemb import BPEmb
from torch import nn
from transformers import Aut... |
import os
import numpy as np
import pandas as pd
import ipywidgets as widgets
from .basemaps import xyz_to_plotly
from .common import *
from .osm import *
from . import examples
try:
import plotly.express as px
import plotly.graph_objects as go
except ImportError:
raise ImportError(
"This module re... | import os
import numpy as np
import pandas as pd
import ipywidgets as widgets
from .basemaps import xyz_to_plotly
from .common import *
from .osm import *
from . import examples
try:
import plotly.express as px
import plotly.graph_objects as go
except ImportError:
raise ImportError(
"This module re... |
"""
A Allen-Cahn equation
.. codeauthor:: David Zwicker <david.zwicker@ds.mpg.de>
"""
from typing import Callable # @UnusedImport
import numpy as np
from ..fields import ScalarField
from ..grids.boundaries.axes import BoundariesData
from ..tools.docstrings import fill_in_docstring
from ..tools.numba import jit, n... | """
A Allen-Cahn equation
.. codeauthor:: David Zwicker <david.zwicker@ds.mpg.de>
"""
from typing import Callable # @UnusedImport
import numpy as np
from ..fields import ScalarField
from ..grids.boundaries.axes import BoundariesData
from ..tools.docstrings import fill_in_docstring
from ..tools.numba import jit, n... |
from tests.integration.base import Base, LOG, run_command
import ipaddress
import json
import os
from pathlib import Path
from typing import Dict, Any, Optional
import pytest
class BuildInvokeBase:
class BuildInvokeBase(Base.IntegBase):
"""
BuildInvokeBase will test the following sam commands:
... | from tests.integration.base import Base, LOG, run_command
import ipaddress
import json
import os
from pathlib import Path
from typing import Dict, Any, Optional
import pytest
class BuildInvokeBase:
class BuildInvokeBase(Base.IntegBase):
"""
BuildInvokeBase will test the following sam commands:
... |
from typing import TYPE_CHECKING
if TYPE_CHECKING:
from haystack.nodes.retriever import BaseRetriever
import json
import logging
from pathlib import Path
from typing import Union, List, Optional, Dict, Generator
from tqdm.auto import tqdm
try:
import faiss
except ImportError:
faiss = None
import numpy as... | from typing import TYPE_CHECKING
if TYPE_CHECKING:
from haystack.nodes.retriever import BaseRetriever
import json
import logging
from pathlib import Path
from typing import Union, List, Optional, Dict, Generator
from tqdm.auto import tqdm
try:
import faiss
except ImportError:
faiss = None
import numpy as... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from json import JSONEncoder
import sys
import collections
from glob import glob
from ipaddress import ip_address, ip_network
from pathlib import Path
from urllib.parse import urlparse
try:
import jsonschema
HAS_JSONSCHEMA = True
except ImportError:
... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from json import JSONEncoder
import sys
import collections
from glob import glob
from ipaddress import ip_address, ip_network
from pathlib import Path
from urllib.parse import urlparse
try:
import jsonschema
HAS_JSONSCHEMA = True
except ImportError:
... |
# -*- coding: utf-8 -*-
"""OpenAPI schema converters and transformers."""
import re
import json
from jsonschema import validate
from openapi_schema_to_json_schema import to_json_schema
from typing import Dict
def resolve_schema_references(open_api: Dict[str, any]):
"""Resolve the $ref objects in the OpenAPI sch... | # -*- coding: utf-8 -*-
"""OpenAPI schema converters and transformers."""
import re
import json
from jsonschema import validate
from openapi_schema_to_json_schema import to_json_schema
from typing import Dict
def resolve_schema_references(open_api: Dict[str, any]):
"""Resolve the $ref objects in the OpenAPI sch... |
#!/usr/bin/env python3
# Copyright © 2020 Red Hat Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | #!/usr/bin/env python3
# Copyright © 2020 Red Hat Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... |
import datetime
import logging
import cartopy.crs as ccrs
import cartopy.feature as cfeature
import numpy as np
import matplotlib.pyplot as plt
from netCDF4 import Dataset
logging.basicConfig()
logger = logging.getLogger(__name__)
logger.setLevel(logging.INFO)
DIFF = 0.25
SKIP = 15
LONLAT = (-77.28, 39.14)
GO_OUT_L... | import datetime
import logging
import cartopy.crs as ccrs
import cartopy.feature as cfeature
import numpy as np
import matplotlib.pyplot as plt
from netCDF4 import Dataset
logging.basicConfig()
logger = logging.getLogger(__name__)
logger.setLevel(logging.INFO)
DIFF = 0.25
SKIP = 15
LONLAT = (-77.28, 39.14)
GO_OUT_L... |
""" manage PyTables query interface via Expressions """
import ast
from functools import partial
from typing import Any, Dict, Optional, Tuple
import numpy as np
from my_happy_pandas._libs.tslibs import Timedelta, Timestamp
from my_happy_pandas.compat.chainmap import DeepChainMap
from my_happy_pandas.core.dtypes.co... | """ manage PyTables query interface via Expressions """
import ast
from functools import partial
from typing import Any, Dict, Optional, Tuple
import numpy as np
from my_happy_pandas._libs.tslibs import Timedelta, Timestamp
from my_happy_pandas.compat.chainmap import DeepChainMap
from my_happy_pandas.core.dtypes.co... |
import insightconnect_plugin_runtime
from .schema import StopScanInput, StopScanOutput, Input, Output
# Custom imports below
class StopScan(insightconnect_plugin_runtime.Action):
def __init__(self):
super(self.__class__, self).__init__(
name="stop_scan",
description="Stop a curre... | import insightconnect_plugin_runtime
from .schema import StopScanInput, StopScanOutput, Input, Output
# Custom imports below
class StopScan(insightconnect_plugin_runtime.Action):
def __init__(self):
super(self.__class__, self).__init__(
name="stop_scan",
description="Stop a curre... |
# Version 82457
abilities = {41: {'ability_name': 'stop'}, 43: {'ability_name': 'move'}, 46: {'ability_name': 'attack'}, 67: {'ability_name': 'GhostHoldFire'}, 68: {'ability_name': 'GhostWeaponsFree'}, 70: {'ability_name': 'Explode'}, 72: {'ability_name': 'FungalGrowth', 'energy_cost': 75}, 73: {'ability_name': 'Guardi... | # Version 82457
abilities = {41: {'ability_name': 'stop'}, 43: {'ability_name': 'move'}, 46: {'ability_name': 'attack'}, 67: {'ability_name': 'GhostHoldFire'}, 68: {'ability_name': 'GhostWeaponsFree'}, 70: {'ability_name': 'Explode'}, 72: {'ability_name': 'FungalGrowth', 'energy_cost': 75}, 73: {'ability_name': 'Guardi... |
# AUTOGENERATED! DO NOT EDIT! File to edit: nbs/30_text.core.ipynb (unless otherwise specified).
__all__ = ['UNK', 'PAD', 'BOS', 'EOS', 'FLD', 'TK_REP', 'TK_WREP', 'TK_UP', 'TK_MAJ', 'spec_add_spaces',
'rm_useless_spaces', 'replace_rep', 'replace_wrep', 'fix_html', 'replace_all_caps', 'replace_maj',
... | # AUTOGENERATED! DO NOT EDIT! File to edit: nbs/30_text.core.ipynb (unless otherwise specified).
__all__ = ['UNK', 'PAD', 'BOS', 'EOS', 'FLD', 'TK_REP', 'TK_WREP', 'TK_UP', 'TK_MAJ', 'spec_add_spaces',
'rm_useless_spaces', 'replace_rep', 'replace_wrep', 'fix_html', 'replace_all_caps', 'replace_maj',
... |
#
# This source file is part of the EdgeDB open source project.
#
# Copyright 2016-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 2016-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... |
import asyncio
import base64
import hashlib
import hmac
import json
import os
import queue
import ssl
import time
import traceback
from datetime import date, datetime, timedelta
from threading import Thread
from typing import Dict, List, Optional, Tuple
import pandas as pd
import requests
import websocket
from pytz im... | import asyncio
import base64
import hashlib
import hmac
import json
import os
import queue
import ssl
import time
import traceback
from datetime import date, datetime, timedelta
from threading import Thread
from typing import Dict, List, Optional, Tuple
import pandas as pd
import requests
import websocket
from pytz im... |
import sys
import os
import argparse
import json
from collections import Counter
SETS = {
'hdl_10575_12033': {
'nuxeo_folder': '/asset-library/UCI/SCA_UniversityArchives/Publications/Anthill'
},
'hdl_10575_11968': {
'nuxeo_folder': '/asset-library/UCI/SCA_UniversityArchives/Publications... | import sys
import os
import argparse
import json
from collections import Counter
SETS = {
'hdl_10575_12033': {
'nuxeo_folder': '/asset-library/UCI/SCA_UniversityArchives/Publications/Anthill'
},
'hdl_10575_11968': {
'nuxeo_folder': '/asset-library/UCI/SCA_UniversityArchives/Publications... |
# vim:fileencoding=utf-8:noet
from __future__ import (unicode_literals, division, absolute_import, print_function)
import threading
import os
import sys
import re
import shutil
from time import sleep
from subprocess import call, PIPE
from powerline.lib import add_divider_highlight_group
from powerline.lib.dict impor... | # vim:fileencoding=utf-8:noet
from __future__ import (unicode_literals, division, absolute_import, print_function)
import threading
import os
import sys
import re
import shutil
from time import sleep
from subprocess import call, PIPE
from powerline.lib import add_divider_highlight_group
from powerline.lib.dict impor... |
"""PyVista plotting module."""
import platform
import ctypes
import sys
import pathlib
import collections.abc
from typing import Sequence
import logging
import os
import textwrap
import time
import warnings
import weakref
from functools import wraps
from threading import Thread
from typing import Dict
import numpy as... | """PyVista plotting module."""
import platform
import ctypes
import sys
import pathlib
import collections.abc
from typing import Sequence
import logging
import os
import textwrap
import time
import warnings
import weakref
from functools import wraps
from threading import Thread
from typing import Dict
import numpy as... |
import socket
import json
HOST = 'localhost' # maquina onde esta o par passivo
PORTA = 5000 # porta que o par passivo esta escutando
# cria socket
sock = socket.socket() # default: socket.AF_INET, socket.SOCK_STREAM
# conecta-se com o par passivo
sock.connect((HOST, PORTA))
connection = True
while connecti... | import socket
import json
HOST = 'localhost' # maquina onde esta o par passivo
PORTA = 5000 # porta que o par passivo esta escutando
# cria socket
sock = socket.socket() # default: socket.AF_INET, socket.SOCK_STREAM
# conecta-se com o par passivo
sock.connect((HOST, PORTA))
connection = True
while connecti... |
# coding=utf-8
# Copyright 2019 The Google Research 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/LICENSE-2.0
#
# Unless required by applicab... | # coding=utf-8
# Copyright 2019 The Google Research 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/LICENSE-2.0
#
# Unless required by applicab... |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# 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 applica... | # Copyright (c) Facebook, Inc. and its affiliates.
#
# 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 applica... |
import abc
import concurrent.futures
import json
import functools
import logging
import os.path
from tornado.ioloop import IOLoop
import tornado.websocket
import tornado.template
from . import instance_manager
class Error(Exception):
pass
class Application(tornado.web.Application):
def __init__(self):
... | import abc
import concurrent.futures
import json
import functools
import logging
import os.path
from tornado.ioloop import IOLoop
import tornado.websocket
import tornado.template
from . import instance_manager
class Error(Exception):
pass
class Application(tornado.web.Application):
def __init__(self):
... |
import argparse
import sys
import os
import boto3
import json
from botocore.exceptions import ProfileNotFound
import shutil
from shutil import make_archive, copytree
from colored import fg, attr
import yaml
from yaml.scanner import ScannerError
from types import SimpleNamespace
def get_install_properties():
confi... | import argparse
import sys
import os
import boto3
import json
from botocore.exceptions import ProfileNotFound
import shutil
from shutil import make_archive, copytree
from colored import fg, attr
import yaml
from yaml.scanner import ScannerError
from types import SimpleNamespace
def get_install_properties():
confi... |
import discord
from discord.ext import commands
import os
import random
import re
colors = {
'DEFAULT': 0x000000,
'WHITE': 0xFFFFFF,
'AQUA': 0x1ABC9C,
'GREEN': 0x2ECC71,
'BLUE': 0x3498DB,
'PURPLE': 0x9B59B6,
'LUMINOUS_VIVID_PINK': 0xE91E63,
'GOLD': 0xF1C40F,
'ORANGE': 0xE67E22,
'RED': 0xE74C3C,
'... | import discord
from discord.ext import commands
import os
import random
import re
colors = {
'DEFAULT': 0x000000,
'WHITE': 0xFFFFFF,
'AQUA': 0x1ABC9C,
'GREEN': 0x2ECC71,
'BLUE': 0x3498DB,
'PURPLE': 0x9B59B6,
'LUMINOUS_VIVID_PINK': 0xE91E63,
'GOLD': 0xF1C40F,
'ORANGE': 0xE67E22,
'RED': 0xE74C3C,
'... |
import abc
import logging
import re
from typing import List, Union
import twitter as twitter_lib
from django.conf import settings
from django.db import models
from django.utils.html import strip_tags
from certego_saas.settings import certego_apps_settings
__all__ = [
"Twitter",
]
class _TwitterInterface(metacl... | import abc
import logging
import re
from typing import List, Union
import twitter as twitter_lib
from django.conf import settings
from django.db import models
from django.utils.html import strip_tags
from certego_saas.settings import certego_apps_settings
__all__ = [
"Twitter",
]
class _TwitterInterface(metacl... |
import requests,json,csv,sqlite3,datetime
from datetime import date
class UserInteraction():
def __init__(self,woied=0,city='',user_date=''):
self.woied = woied
self.city = city
self.user_date = user_date
def isDateValid(self,user_date):
today = date.today()
try:
... | import requests,json,csv,sqlite3,datetime
from datetime import date
class UserInteraction():
def __init__(self,woied=0,city='',user_date=''):
self.woied = woied
self.city = city
self.user_date = user_date
def isDateValid(self,user_date):
today = date.today()
try:
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''quick_word
Usage:
quick_word <word_count>
quick_word -h | --help
quick_word --version
Options:
-h --help Show this screen.
--version Show version.
'''
from __future__ import unicode_literals, print_function
import sys
from docopt import docopt
from .... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''quick_word
Usage:
quick_word <word_count>
quick_word -h | --help
quick_word --version
Options:
-h --help Show this screen.
--version Show version.
'''
from __future__ import unicode_literals, print_function
import sys
from docopt import docopt
from .... |
#!/usr/bin/env python
# coding=utf-8
# Copyright 2021 The HuggingFace Inc. team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LI... | #!/usr/bin/env python
# coding=utf-8
# Copyright 2021 The HuggingFace Inc. team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LI... |
# coding=utf-8
# Copyright 2018 Google AI, Google Brain and Carnegie Mellon University Authors and the HuggingFace Inc. team.
# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the Lice... | # coding=utf-8
# Copyright 2018 Google AI, Google Brain and Carnegie Mellon University Authors and the HuggingFace Inc. team.
# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the Lice... |
import os
import json
import torch
from torch.utils.data import Dataset
from collections import defaultdict
from tqdm import tqdm
def parse_id(doc_pass_sent_id):
start_id, end_id = doc_pass_sent_id.split(':')
id_list = start_id.split('-')
doc_id = '-'.join(id_list[:-2])
pass_id = id_list[-2]
sent_start_id = id_... |
import os
import json
import torch
from torch.utils.data import Dataset
from collections import defaultdict
from tqdm import tqdm
def parse_id(doc_pass_sent_id):
start_id, end_id = doc_pass_sent_id.split(':')
id_list = start_id.split('-')
doc_id = '-'.join(id_list[:-2])
pass_id = id_list[-2]
sent_start_id = id_... |
from Jumpscale import j
import pytest
from JumpscaleLibs.clients.tfchain.stub.ExplorerClientStub import TFChainExplorerGetClientStub
from JumpscaleLibs.clients.tfchain.test_utils import cleanup
def main(self):
"""
to run:
kosmos 'j.clients.tfchain.test(name="atomicswap_verify_sender")'
"""
cle... | from Jumpscale import j
import pytest
from JumpscaleLibs.clients.tfchain.stub.ExplorerClientStub import TFChainExplorerGetClientStub
from JumpscaleLibs.clients.tfchain.test_utils import cleanup
def main(self):
"""
to run:
kosmos 'j.clients.tfchain.test(name="atomicswap_verify_sender")'
"""
cle... |
# uncompyle6 version 3.2.0
# Python bytecode 2.4 (62061)
# Decompiled from: Python 2.7.14 (v2.7.14:84471935ed, Sep 16 2017, 20:19:30) [MSC v.1500 32 bit (Intel)]
# Embedded file name: pirates.leveleditor.worldData.tortuga_area_jungle_a_1
from pandac.PandaModules import Point3, VBase3, Vec4, Vec3
objectStruct = {'Intera... | # uncompyle6 version 3.2.0
# Python bytecode 2.4 (62061)
# Decompiled from: Python 2.7.14 (v2.7.14:84471935ed, Sep 16 2017, 20:19:30) [MSC v.1500 32 bit (Intel)]
# Embedded file name: pirates.leveleditor.worldData.tortuga_area_jungle_a_1
from pandac.PandaModules import Point3, VBase3, Vec4, Vec3
objectStruct = {'Intera... |
# -*- coding: utf-8 -*-
import torch
import torch.utils.data
import numpy as np
import contextlib
import gc
import io
import inspect
import itertools
import math
import random
import re
import copy
import os
import tempfile
import unittest
import warnings
import types
import pickle
import textwrap
import subprocess
im... | # -*- coding: utf-8 -*-
import torch
import torch.utils.data
import numpy as np
import contextlib
import gc
import io
import inspect
import itertools
import math
import random
import re
import copy
import os
import tempfile
import unittest
import warnings
import types
import pickle
import textwrap
import subprocess
im... |
# MIT License
#
# Copyright (c) 2018-2020 Tskit Developers
#
# 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, modif... | # MIT License
#
# Copyright (c) 2018-2020 Tskit Developers
#
# 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, modif... |
import os
import csv
import random
# import numpy as np
# import matplotlib.pyplot as plt
import plotly.graph_objects as go
from plotly.subplots import make_subplots
# COLORS = {
# "train": "rgb(0,119,187)",
# "validation": "rgb(255,66,94)",
# }
COLORS = {
"abiu": {"train": "#4184f3", "validation": "#db4... | import os
import csv
import random
# import numpy as np
# import matplotlib.pyplot as plt
import plotly.graph_objects as go
from plotly.subplots import make_subplots
# COLORS = {
# "train": "rgb(0,119,187)",
# "validation": "rgb(255,66,94)",
# }
COLORS = {
"abiu": {"train": "#4184f3", "validation": "#db4... |
# ---
# Copyright 2021 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 wri... | # ---
# Copyright 2021 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 wri... |
import io
import time
import psycopg2
import psycopg2.extras
from .config import config
def _db():
connection_string = config["connection_string"]
con = psycopg2.connect(connection_string)
if not config.get("batch_mode", False):
con.set_session(autocommit=True)
return con
def init():
db... | import io
import time
import psycopg2
import psycopg2.extras
from .config import config
def _db():
connection_string = config["connection_string"]
con = psycopg2.connect(connection_string)
if not config.get("batch_mode", False):
con.set_session(autocommit=True)
return con
def init():
db... |
# (C) Datadog, Inc. 2018-present
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)
import json
import os
import re
import uuid
import click
import requests
from ....utils import file_exists, read_file, write_file
from ...constants import get_root
from ...utils import get_metadata_file,... | # (C) Datadog, Inc. 2018-present
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)
import json
import os
import re
import uuid
import click
import requests
from ....utils import file_exists, read_file, write_file
from ...constants import get_root
from ...utils import get_metadata_file,... |
#!/usr/bin/env python
import csv
import glob
import multiprocessing as mp
import os
import sys
import xml.etree.ElementTree as eT
from collections import defaultdict
from subprocess import run
import numpy as np
import pandas as pd
from lxml import etree
# TODO: implement all necessary objects and functions, in ord... | #!/usr/bin/env python
import csv
import glob
import multiprocessing as mp
import os
import sys
import xml.etree.ElementTree as eT
from collections import defaultdict
from subprocess import run
import numpy as np
import pandas as pd
from lxml import etree
# TODO: implement all necessary objects and functions, in ord... |
import csv
import json
import requests
class Okta:
"""Password spray Okta API"""
def __init__(self, host, port, timeout, fireprox):
self.timeout = timeout
self.url = f"https://{host}:{port}/api/v1/authn"
# Okta requires username posted to /api/v1/authn to get a stateToken, and then ... | import csv
import json
import requests
class Okta:
"""Password spray Okta API"""
def __init__(self, host, port, timeout, fireprox):
self.timeout = timeout
self.url = f"https://{host}:{port}/api/v1/authn"
# Okta requires username posted to /api/v1/authn to get a stateToken, and then ... |
import logging
import time
import signal
import socket
import subprocess
from shutil import which
import pycurl
import pytest
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support.ui import WebDriverWa... | import logging
import time
import signal
import socket
import subprocess
from shutil import which
import pycurl
import pytest
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support.ui import WebDriverWa... |
from datetime import datetime
from distutils.util import strtobool
import os
class TerminalColors:
HEADER = '\033[95m'
OKBLUE = '\033[94m'
OKCYAN = '\033[96m'
OKGREEN = '\033[92m'
WARNING = '\033[93m'
FAIL = '\033[91m'
ENDC = '\033[0m'
BOLD = '\033[1m'
UNDERLINE = '\033[4m'
class... | from datetime import datetime
from distutils.util import strtobool
import os
class TerminalColors:
HEADER = '\033[95m'
OKBLUE = '\033[94m'
OKCYAN = '\033[96m'
OKGREEN = '\033[92m'
WARNING = '\033[93m'
FAIL = '\033[91m'
ENDC = '\033[0m'
BOLD = '\033[1m'
UNDERLINE = '\033[4m'
class... |
import sqlite3
class Schema:
def __init__(self):
# connect to database
self.conn = sqlite3.connect('todo.db')
self.create_user_table()
self.create_to_do_table()
# Why are we calling user table before to_do table
# what happens if we swap them?
def create_to_do_t... | import sqlite3
class Schema:
def __init__(self):
# connect to database
self.conn = sqlite3.connect('todo.db')
self.create_user_table()
self.create_to_do_table()
# Why are we calling user table before to_do table
# what happens if we swap them?
def create_to_do_t... |
# Copyright (C) 2020 GreenWaves Technologies, SAS
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
# This progr... | # Copyright (C) 2020 GreenWaves Technologies, SAS
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
# This progr... |
"""
Configuration file for the Sphinx documentation builder.
isort:skip_file
"""
# flake8: NOQA: E402
# -- stdlib imports ------------------------------------------------------------
import os
import sys
import datetime
from pkg_resources import get_distribution
from packaging.version import Version
# -- Check for de... | """
Configuration file for the Sphinx documentation builder.
isort:skip_file
"""
# flake8: NOQA: E402
# -- stdlib imports ------------------------------------------------------------
import os
import sys
import datetime
from pkg_resources import get_distribution
from packaging.version import Version
# -- Check for de... |
import json
import re
from typing import Dict, List, Tuple
class AWSResource:
def __init__(self, resource_type: str, resource: dict, should_dump_json: bool = False) -> None:
self.aws_resource_type: str = resource_type
self.should_dump_json = should_dump_json
assert self.attr_map is not No... | import json
import re
from typing import Dict, List, Tuple
class AWSResource:
def __init__(self, resource_type: str, resource: dict, should_dump_json: bool = False) -> None:
self.aws_resource_type: str = resource_type
self.should_dump_json = should_dump_json
assert self.attr_map is not No... |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
from abc import ABC, abstractstaticmethod
import discord
from typing import Callable, Dict, List, Tuple
from cache import PssCache
import pss_core as core
class EntityDesignDetails(object):
def __init__(self, name: str = None, description: str = None, details_long: ... | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
from abc import ABC, abstractstaticmethod
import discord
from typing import Callable, Dict, List, Tuple
from cache import PssCache
import pss_core as core
class EntityDesignDetails(object):
def __init__(self, name: str = None, description: str = None, details_long: ... |
import json
import logging
import os
import pickle
import sys
from argparse import Namespace
from glob import glob
from pathlib import Path
from typing import Any, Dict, List, Union
from music21.converter import parse
from tqdm import tqdm
import harmonic_inference.models.initial_chord_models as icm
from harmonic_inf... | import json
import logging
import os
import pickle
import sys
from argparse import Namespace
from glob import glob
from pathlib import Path
from typing import Any, Dict, List, Union
from music21.converter import parse
from tqdm import tqdm
import harmonic_inference.models.initial_chord_models as icm
from harmonic_inf... |
import json
import ifb
import string
from secrets import choice
import random
import xlsxwriter
import time
import datetime
import os
import pprint
import logging
import urllib.parse
import itertools
def genPassword(n=8):
if n < 8:
n = 8
uppercase = string.ascii_uppercase
numbers = string.digits
... | import json
import ifb
import string
from secrets import choice
import random
import xlsxwriter
import time
import datetime
import os
import pprint
import logging
import urllib.parse
import itertools
def genPassword(n=8):
if n < 8:
n = 8
uppercase = string.ascii_uppercase
numbers = string.digits
... |
# one grows, one prunes
# have a process attach to a random node and start eating
# once enough nodes have been eaten, another process attaches to a random node
# and starts repairing links (don't destroy actual nodes, just toggle states)
from p5 import *
from random import random, choice, randint, shuffle
from math im... | # one grows, one prunes
# have a process attach to a random node and start eating
# once enough nodes have been eaten, another process attaches to a random node
# and starts repairing links (don't destroy actual nodes, just toggle states)
from p5 import *
from random import random, choice, randint, shuffle
from math im... |
# coding: utf-8
import itertools
from datetime import datetime
from .common import InfoExtractor
from ..utils import (
determine_ext,
ExtractorError,
float_or_none,
format_field,
int_or_none,
str_or_none,
traverse_obj,
unified_timestamp,
url_or_none,
)
_API_BASE_URL = 'https://pro... | # coding: utf-8
import itertools
from datetime import datetime
from .common import InfoExtractor
from ..utils import (
determine_ext,
ExtractorError,
float_or_none,
format_field,
int_or_none,
str_or_none,
traverse_obj,
unified_timestamp,
url_or_none,
)
_API_BASE_URL = 'https://pro... |
import secrets
import uuid
from collections import defaultdict, namedtuple
from time import time
from typing import Callable, Dict, Optional
from django.db import models
class UUIDT(uuid.UUID):
"""UUID (mostly) sortable by generation time.
This doesn't adhere to any official UUID version spec, but it is... | import secrets
import uuid
from collections import defaultdict, namedtuple
from time import time
from typing import Callable, Dict, Optional
from django.db import models
class UUIDT(uuid.UUID):
"""UUID (mostly) sortable by generation time.
This doesn't adhere to any official UUID version spec, but it is... |
import argparse
import os
import re
from argparse import Namespace
from logging import Logger
from typing import List, Tuple, Set
import util
def get_logger() -> Logger:
return util.get_logger(logger_name='generate_backlinks_files')
def markdown_filenames(folder_path: str) -> List[str]:
return [fn for fn i... | import argparse
import os
import re
from argparse import Namespace
from logging import Logger
from typing import List, Tuple, Set
import util
def get_logger() -> Logger:
return util.get_logger(logger_name='generate_backlinks_files')
def markdown_filenames(folder_path: str) -> List[str]:
return [fn for fn i... |
# AUTOGENERATED! DO NOT EDIT! File to edit: 50_time.ipynb (unless otherwise specified).
__all__ = ['TimeKeeper']
# Cell
import json
from typing import Union
import pandas as pd
# Cell
class TimeKeeper:
def __init__(self) -> None:
self.df = pd.DataFrame(columns=['time'])
self.df.index.name = 'c... | # AUTOGENERATED! DO NOT EDIT! File to edit: 50_time.ipynb (unless otherwise specified).
__all__ = ['TimeKeeper']
# Cell
import json
from typing import Union
import pandas as pd
# Cell
class TimeKeeper:
def __init__(self) -> None:
self.df = pd.DataFrame(columns=['time'])
self.df.index.name = 'c... |
#!/emj/bin/env python3
# -*- coding: utf-8 -*
#/// DEPENDENCIES
import discord #python3.7 -m pip install -U discord.py
import logging
from util import pages
from discord.ext import commands
from discord.ext.commands import Bot, MissingPermissions, has_permissions
from chk.enbl import enbl
##///----... | #!/emj/bin/env python3
# -*- coding: utf-8 -*
#/// DEPENDENCIES
import discord #python3.7 -m pip install -U discord.py
import logging
from util import pages
from discord.ext import commands
from discord.ext.commands import Bot, MissingPermissions, has_permissions
from chk.enbl import enbl
##///----... |
from datetime import datetime, timedelta
dateNow = datetime.now()
inDate = input('Enter date (yyyy/mm/dd): ')
daySubtract = timedelta(days = 1)
weekSubtract = timedelta(weeks = 1)
print(f'date now is : { str(dateNow) }')
print(f'date now is : { str(dateNow.month) }-{ str(dateNow.day) }-{ str(dateNow.year) }')
print... | from datetime import datetime, timedelta
dateNow = datetime.now()
inDate = input('Enter date (yyyy/mm/dd): ')
daySubtract = timedelta(days = 1)
weekSubtract = timedelta(weeks = 1)
print(f'date now is : { str(dateNow) }')
print(f'date now is : { str(dateNow.month) }-{ str(dateNow.day) }-{ str(dateNow.year) }')
print... |
import os, requests, json, dateparser, time, yaml, boto3, slack, random
from typing import List
from pathlib import Path
from pprint import pprint
from traceback import format_exc
from missing_data import get_missing_responses, get_missing_users
BATCH_SIZE = 500
wootric_session = requests.Session()
ACCESS_TOKEN = ... |
import os, requests, json, dateparser, time, yaml, boto3, slack, random
from typing import List
from pathlib import Path
from pprint import pprint
from traceback import format_exc
from missing_data import get_missing_responses, get_missing_users
BATCH_SIZE = 500
wootric_session = requests.Session()
ACCESS_TOKEN = ... |
# TODO(REST-API-Refactoring) Notes follow.
# - All these functions should be moved out of the example and into the code base proper. We should
# make a very simple example that extends it as a daemon app.
# - Remove the variables like VERSION, NETWORK, .... a good idea in theory but they overcomplicate
# things in ... | # TODO(REST-API-Refactoring) Notes follow.
# - All these functions should be moved out of the example and into the code base proper. We should
# make a very simple example that extends it as a daemon app.
# - Remove the variables like VERSION, NETWORK, .... a good idea in theory but they overcomplicate
# things in ... |
import concurrent
from base import settings, logger
from base.redis_db import get_redis
from base.utils import rate_limited
from base.constants import DEFAULT_REFRESH_INTERVAL, DEFAULT_RATE_LIMIT, DEFAULT_THREAD_MAX_WORKERS, \
DEFAULT_BEFORE_EXPIRES
import asyncio
import requests
import threading
import datetime
i... | import concurrent
from base import settings, logger
from base.redis_db import get_redis
from base.utils import rate_limited
from base.constants import DEFAULT_REFRESH_INTERVAL, DEFAULT_RATE_LIMIT, DEFAULT_THREAD_MAX_WORKERS, \
DEFAULT_BEFORE_EXPIRES
import asyncio
import requests
import threading
import datetime
i... |
"""
The MIT License (MIT)
Copyright (c) 2015-present Rapptz
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, merg... | """
The MIT License (MIT)
Copyright (c) 2015-present Rapptz
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, merg... |
#!/usr/bin/env python
__author__ = "Mageswaran Dhandapani"
__copyright__ = "Copyright 2020, The Spark Structured Playground Project"
__credits__ = []
__license__ = "Apache License"
__version__ = "2.0"
__maintainer__ = "Mageswaran Dhandapani"
__email__ = "mageswaran1989@gmail.com"
__status__ = "Education Purpose"
impo... | #!/usr/bin/env python
__author__ = "Mageswaran Dhandapani"
__copyright__ = "Copyright 2020, The Spark Structured Playground Project"
__credits__ = []
__license__ = "Apache License"
__version__ = "2.0"
__maintainer__ = "Mageswaran Dhandapani"
__email__ = "mageswaran1989@gmail.com"
__status__ = "Education Purpose"
impo... |
import aiohttp
from userbot import CMD_HELP
from userbot.events import register
@register(pattern=r".git (.*)", outgoing=True)
async def github(event):
URL = f"https://api.github.com/users/{event.pattern_match.group(1)}"
await event.get_chat()
async with aiohttp.ClientSession() as session:
async ... | import aiohttp
from userbot import CMD_HELP
from userbot.events import register
@register(pattern=r".git (.*)", outgoing=True)
async def github(event):
URL = f"https://api.github.com/users/{event.pattern_match.group(1)}"
await event.get_chat()
async with aiohttp.ClientSession() as session:
async ... |
# coding=utf-8
# Copyright 2022 The Google Research 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/LICENSE-2.0
#
# Unless required by applicab... | # coding=utf-8
# Copyright 2022 The Google Research 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/LICENSE-2.0
#
# Unless required by applicab... |
import datetime
import enum
import logging
import re
from dataclasses import dataclass
from io import BytesIO
from typing import Tuple, Any
import discord
from d4dj_utils.chart.chart import Chart
from d4dj_utils.chart.mix import get_best_mix, get_mix_data, calculate_mix_rating
from d4dj_utils.chart.score_calculator im... | import datetime
import enum
import logging
import re
from dataclasses import dataclass
from io import BytesIO
from typing import Tuple, Any
import discord
from d4dj_utils.chart.chart import Chart
from d4dj_utils.chart.mix import get_best_mix, get_mix_data, calculate_mix_rating
from d4dj_utils.chart.score_calculator im... |
# Copyright The IETF Trust 2012-2020, All Rights Reserved
# -*- coding: utf-8 -*-
import os
import datetime
import io
import lxml
import bibtexparser
import mock
import json
import copy
from http.cookies import SimpleCookie
from pathlib import Path
from pyquery import PyQuery
from urllib.parse import urlparse, parse... | # Copyright The IETF Trust 2012-2020, All Rights Reserved
# -*- coding: utf-8 -*-
import os
import datetime
import io
import lxml
import bibtexparser
import mock
import json
import copy
from http.cookies import SimpleCookie
from pathlib import Path
from pyquery import PyQuery
from urllib.parse import urlparse, parse... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
PUSH_EVENT_EXAMPLE = b"""{
"push": {
"changes": [
{
"links": {
"html": {
"href": "https://bitbucket.org/maxbittker/newsdiffs/branches/compare/e0e377d186e4f0e937bdb487a23384... | # -*- coding: utf-8 -*-
from __future__ import absolute_import
PUSH_EVENT_EXAMPLE = b"""{
"push": {
"changes": [
{
"links": {
"html": {
"href": "https://bitbucket.org/maxbittker/newsdiffs/branches/compare/e0e377d186e4f0e937bdb487a23384... |
import asyncio
import logging
import time
from pathlib import Path
from typing import Callable, Dict, List, Optional, Tuple
from blspy import PrivateKey, G1Element
from ceres.consensus.block_rewards import calculate_base_farmer_reward
from ceres.pools.pool_wallet import PoolWallet
from ceres.pools.pool_wallet_info im... | import asyncio
import logging
import time
from pathlib import Path
from typing import Callable, Dict, List, Optional, Tuple
from blspy import PrivateKey, G1Element
from ceres.consensus.block_rewards import calculate_base_farmer_reward
from ceres.pools.pool_wallet import PoolWallet
from ceres.pools.pool_wallet_info im... |
import json
import logging
from typing import Optional
from typing import Union
from urllib.parse import parse_qs
from urllib.parse import urlencode
from urllib.parse import urlparse
from cryptojwt import as_unicode
from cryptojwt import b64d
from cryptojwt.jwe.aes import AES_GCMEncrypter
from cryptojwt.jwe.utils impo... | import json
import logging
from typing import Optional
from typing import Union
from urllib.parse import parse_qs
from urllib.parse import urlencode
from urllib.parse import urlparse
from cryptojwt import as_unicode
from cryptojwt import b64d
from cryptojwt.jwe.aes import AES_GCMEncrypter
from cryptojwt.jwe.utils impo... |
import datetime
from email.headerregistry import Address
from typing import Any, Dict, Iterable, List, Mapping, Optional, TypeVar, Union
from unittest import mock
import orjson
from django.conf import settings
from django.contrib.contenttypes.models import ContentType
from django.contrib.sessions.models import Session... | import datetime
from email.headerregistry import Address
from typing import Any, Dict, Iterable, List, Mapping, Optional, TypeVar, Union
from unittest import mock
import orjson
from django.conf import settings
from django.contrib.contenttypes.models import ContentType
from django.contrib.sessions.models import Session... |
import argparse
import json
import os
import time
from collections import Counter
from functools import partial
from itertools import chain
from multiprocessing import Pool
from typing import List
import MeCab
INPUT_CORPUS = "./dataset/wiki/sample_ko-wiki-200420.txt"
OUTPUT_DIR = "./resources"
TOKENIZER = MeCab.Tagg... | import argparse
import json
import os
import time
from collections import Counter
from functools import partial
from itertools import chain
from multiprocessing import Pool
from typing import List
import MeCab
INPUT_CORPUS = "./dataset/wiki/sample_ko-wiki-200420.txt"
OUTPUT_DIR = "./resources"
TOKENIZER = MeCab.Tagg... |
"""
=====================================================================
Compute MNE inverse solution on evoked data with a mixed source space
=====================================================================
Create a mixed source space and compute an MNE inverse solution on an
evoked dataset.
"""
# Author: Annal... | """
=====================================================================
Compute MNE inverse solution on evoked data with a mixed source space
=====================================================================
Create a mixed source space and compute an MNE inverse solution on an
evoked dataset.
"""
# Author: Annal... |
import io
import json
import os
import re
import shutil
import sys
import tarfile
import tempfile
import time
import urllib.parse
import zipfile
from json import dumps
from logging import getLogger
import requests
from packaging.version import parse as parse_version, Version
try:
from nose.tools import nottest
exc... | import io
import json
import os
import re
import shutil
import sys
import tarfile
import tempfile
import time
import urllib.parse
import zipfile
from json import dumps
from logging import getLogger
import requests
from packaging.version import parse as parse_version, Version
try:
from nose.tools import nottest
exc... |
import os
import click
from linkml.generators import PYTHON_GEN_VERSION
from linkml.generators.pythongen import PythonGenerator
from linkml_runtime.utils.formatutils import split_line, be
from linkml.utils.generator import shared_arguments
class NamespaceGenerator(PythonGenerator):
generatorname = os.path.basen... | import os
import click
from linkml.generators import PYTHON_GEN_VERSION
from linkml.generators.pythongen import PythonGenerator
from linkml_runtime.utils.formatutils import split_line, be
from linkml.utils.generator import shared_arguments
class NamespaceGenerator(PythonGenerator):
generatorname = os.path.basen... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.