edited_code stringlengths 17 978k | original_code stringlengths 17 978k |
|---|---|
import torch
import re
import copy
import numpy
from torch.utils.data.dataloader import default_collate
from netdissect import nethook, imgviz, tally, unravelconv, upsample
def acts_image(model, dataset,
layer=None, unit=None,
thumbsize=None,
cachedir=None,
... | import torch
import re
import copy
import numpy
from torch.utils.data.dataloader import default_collate
from netdissect import nethook, imgviz, tally, unravelconv, upsample
def acts_image(model, dataset,
layer=None, unit=None,
thumbsize=None,
cachedir=None,
... |
import django_filters
import json
from django import forms
from django.db.models import Count
from django.conf import settings
from django.contrib.auth.models import User
from django.forms import BoundField
from django.urls import reverse
from taggit.forms import TagField
from .constants import *
from .fields import ... | import django_filters
import json
from django import forms
from django.db.models import Count
from django.conf import settings
from django.contrib.auth.models import User
from django.forms import BoundField
from django.urls import reverse
from taggit.forms import TagField
from .constants import *
from .fields import ... |
import difflib
import os
from functools import partial
ANSI_ESCAPE_CODES = {
"green": "\x1b[32m",
"red": "\x1b[31m",
"reset": "\x1b[39m",
}
# Recipe from https://github.com/ActiveState/
# code/recipes/Python/577452_memoize_decorator_instance/recipe-577452.py
class memoize:
"""cache the return value ... | import difflib
import os
from functools import partial
ANSI_ESCAPE_CODES = {
"green": "\x1b[32m",
"red": "\x1b[31m",
"reset": "\x1b[39m",
}
# Recipe from https://github.com/ActiveState/
# code/recipes/Python/577452_memoize_decorator_instance/recipe-577452.py
class memoize:
"""cache the return value ... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
""" Handles the exchange data and communication """
import logging
import inspect
import time
import os
import json
from distutils.util import strtobool
from . import errors
log = logging.getLogger('crypto-exporter')
def short_msg(msg, chars=75):
""" Truncates the... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
""" Handles the exchange data and communication """
import logging
import inspect
import time
import os
import json
from distutils.util import strtobool
from . import errors
log = logging.getLogger('crypto-exporter')
def short_msg(msg, chars=75):
""" Truncates the... |
# -*- coding: utf-8 -*-
"""Dimensional reduction and batch correction using Harmony."""
if __name__ == "__main__":
import anndata as ad
import matplotlib.pyplot as plt
import scanpy as sc
import scanpy.external as sce
from helpers.logs.get_logger import get_logger
from helpers.logs.sc_logs impor... | # -*- coding: utf-8 -*-
"""Dimensional reduction and batch correction using Harmony."""
if __name__ == "__main__":
import anndata as ad
import matplotlib.pyplot as plt
import scanpy as sc
import scanpy.external as sce
from helpers.logs.get_logger import get_logger
from helpers.logs.sc_logs impor... |
import random
from collections import Counter
from typing import Optional
import discord
from discord.ext import commands
class Plural:
"""Converts a text to plural when used in a f string
Examples
--------
>>> f"{Plural(1):time}"
'1 time'
>>> f"{Plural(5):time}"
'5 times'
>>> f"{Plu... | import random
from collections import Counter
from typing import Optional
import discord
from discord.ext import commands
class Plural:
"""Converts a text to plural when used in a f string
Examples
--------
>>> f"{Plural(1):time}"
'1 time'
>>> f"{Plural(5):time}"
'5 times'
>>> f"{Plu... |
"""Reads vehicle status from BMW connected drive portal."""
from __future__ import annotations
import logging
from bimmer_connected.account import ConnectedDriveAccount
from bimmer_connected.country_selector import get_region_from_name
import voluptuous as vol
from homeassistant.components.notify import DOMAIN as NO... | """Reads vehicle status from BMW connected drive portal."""
from __future__ import annotations
import logging
from bimmer_connected.account import ConnectedDriveAccount
from bimmer_connected.country_selector import get_region_from_name
import voluptuous as vol
from homeassistant.components.notify import DOMAIN as NO... |
import functools
import logging.config
import multiprocessing
import os
from datetime import date
from datetime import datetime as dt
from pathlib import Path
from typing import List, Mapping, Optional, Tuple
from cdsapi import Client
from miranda.scripting import LOGGING_CONFIG
logging.config.dictConfig(LOGGING_CON... | import functools
import logging.config
import multiprocessing
import os
from datetime import date
from datetime import datetime as dt
from pathlib import Path
from typing import List, Mapping, Optional, Tuple
from cdsapi import Client
from miranda.scripting import LOGGING_CONFIG
logging.config.dictConfig(LOGGING_CON... |
students = []
filepath = "./datastore/students.txt"
def print_students_titlecase():
for student in students:
stud = {"roll_number": student['roll_number'],
"name": student['name'], "student_age": student['student_age']}
print(stud)
def save_file(student):
try:
f = op... | students = []
filepath = "./datastore/students.txt"
def print_students_titlecase():
for student in students:
stud = {"roll_number": student['roll_number'],
"name": student['name'], "student_age": student['student_age']}
print(stud)
def save_file(student):
try:
f = op... |
import functools
import json
import logging
import os
import re
import socket
import ssl
import threading
from asyncio.selector_events import BaseSelectorEventLoop
from typing import Dict, List, Match, Optional, Union
from urllib.parse import parse_qs, unquote, urlencode, urlparse
import requests
from flask_cors impor... | import functools
import json
import logging
import os
import re
import socket
import ssl
import threading
from asyncio.selector_events import BaseSelectorEventLoop
from typing import Dict, List, Match, Optional, Union
from urllib.parse import parse_qs, unquote, urlencode, urlparse
import requests
from flask_cors impor... |
# -*- coding: utf-8 -*-
# ======================================================================================================================
# Copyright (©) 2015-2021 LCS - Laboratoire Catalyse et Spectrochimie, Caen, France.
# =
# CeCILL-B FREE SOFTWARE LICENSE AGREEMENT - See full LICENSE agreement in the roo... | # -*- coding: utf-8 -*-
# ======================================================================================================================
# Copyright (©) 2015-2021 LCS - Laboratoire Catalyse et Spectrochimie, Caen, France.
# =
# CeCILL-B FREE SOFTWARE LICENSE AGREEMENT - See full LICENSE agreement in the roo... |
import time
import logging
import functools
import slack_sdk
from slack_sdk.web.async_client import AsyncWebClient
from typing import Any, Dict, List, Optional
from tenacity import TryAgain, retry, retry_if_exception_type, stop_after_attempt
from .config import SlackConversationConfiguration
log = logging.getLogge... | import time
import logging
import functools
import slack_sdk
from slack_sdk.web.async_client import AsyncWebClient
from typing import Any, Dict, List, Optional
from tenacity import TryAgain, retry, retry_if_exception_type, stop_after_attempt
from .config import SlackConversationConfiguration
log = logging.getLogge... |
# 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... |
#Get everything that the base depends on.
import math
from numpy.lib.utils import source
from workers.worker_base import *
import sqlalchemy as s
import time
import math
#This is a worker base subclass that adds the ability to query github/gitlab with the api key
class WorkerGitInterfaceable(Worker):
def __init__... | #Get everything that the base depends on.
import math
from numpy.lib.utils import source
from workers.worker_base import *
import sqlalchemy as s
import time
import math
#This is a worker base subclass that adds the ability to query github/gitlab with the api key
class WorkerGitInterfaceable(Worker):
def __init__... |
#!/usr/bin/env python3
import os
from urllib.parse import urljoin
import requests
from requests.auth import HTTPBasicAuth
def Run(user, key, contribution):
repo_names_zup = [
"charlescd",
"charlescd-docs"
]
insights = []
contributors = []
base_url_zup = f"https://api.github.com/re... | #!/usr/bin/env python3
import os
from urllib.parse import urljoin
import requests
from requests.auth import HTTPBasicAuth
def Run(user, key, contribution):
repo_names_zup = [
"charlescd",
"charlescd-docs"
]
insights = []
contributors = []
base_url_zup = f"https://api.github.com/re... |
import json
from ssl import SSLContext
from typing import Optional, Dict, Any, Union, List
import ast
import status
from urllib3 import Retry, HTTPResponse
from urllib3.exceptions import HTTPError, MaxRetryError
from urllib3.poolmanager import PoolManager
from urllib3.util import parse_url
from bxcommon import consta... | import json
from ssl import SSLContext
from typing import Optional, Dict, Any, Union, List
import ast
import status
from urllib3 import Retry, HTTPResponse
from urllib3.exceptions import HTTPError, MaxRetryError
from urllib3.poolmanager import PoolManager
from urllib3.util import parse_url
from bxcommon import consta... |
import asyncio
import os
import math
from typing import Optional, Dict, List, Tuple
import aiohttp
from PIL import Image, ImageDraw, ImageFont, ImageFilter
from src.libraries.maimaidx_music import total_list
scoreRank = 'D C B BB BBB A AA AAA S S+ SS SS+ SSS SSS+'.split(' ')
combo = ' FC FC+ AP AP+'.split(' ')
diffs... | import asyncio
import os
import math
from typing import Optional, Dict, List, Tuple
import aiohttp
from PIL import Image, ImageDraw, ImageFont, ImageFilter
from src.libraries.maimaidx_music import total_list
scoreRank = 'D C B BB BBB A AA AAA S S+ SS SS+ SSS SSS+'.split(' ')
combo = ' FC FC+ AP AP+'.split(' ')
diffs... |
import pytest
from mock import MagicMock
from zmon_worker_monitor.zmon_worker.common.http import get_user_agent
from zmon_worker_monitor.zmon_worker.notifications.slack import NotifySlack, NotificationError
URL = 'http://slack-webhook'
HEADERS = {
'User-agent': get_user_agent(),
'Content-type': 'application... | import pytest
from mock import MagicMock
from zmon_worker_monitor.zmon_worker.common.http import get_user_agent
from zmon_worker_monitor.zmon_worker.notifications.slack import NotifySlack, NotificationError
URL = 'http://slack-webhook'
HEADERS = {
'User-agent': get_user_agent(),
'Content-type': 'application... |
import logging
import tkinter
from tkinter import ttk, font as font, messagebox, _setit
from typing import Union, List, Tuple, Dict, Mapping
import mouse
import lifxlan
import win32api
from lifxlan import (
ORANGE,
YELLOW,
GREEN,
CYAN,
BLUE,
PURPLE,
PINK,
WHITE,
COLD_WHITE,
WAR... | import logging
import tkinter
from tkinter import ttk, font as font, messagebox, _setit
from typing import Union, List, Tuple, Dict, Mapping
import mouse
import lifxlan
import win32api
from lifxlan import (
ORANGE,
YELLOW,
GREEN,
CYAN,
BLUE,
PURPLE,
PINK,
WHITE,
COLD_WHITE,
WAR... |
import inspect
from typing import List
from ormx.constants import *
from ormx.exceptions import *
from ormx.types import *
class Table:
"""
Sub-class of Database, itself one table of Database
Have same methods but without table name argument
Attributes
----------
name : str
Name of ta... | import inspect
from typing import List
from ormx.constants import *
from ormx.exceptions import *
from ormx.types import *
class Table:
"""
Sub-class of Database, itself one table of Database
Have same methods but without table name argument
Attributes
----------
name : str
Name of ta... |
import logging
import os
import random
import sys
from subprocess import Popen, PIPE
import matplotlib.pyplot as plt
import mlflow
import numpy as np
import torch
from PIL import Image
from .utils import tensor2im, mk_clean_dir, mkdirs
if sys.version_info[0] == 2:
VisdomExceptionBase = Exception
else:
VisdomE... | import logging
import os
import random
import sys
from subprocess import Popen, PIPE
import matplotlib.pyplot as plt
import mlflow
import numpy as np
import torch
from PIL import Image
from .utils import tensor2im, mk_clean_dir, mkdirs
if sys.version_info[0] == 2:
VisdomExceptionBase = Exception
else:
VisdomE... |
import uuid
from django.db.models import Sum
from django.template.defaultfilters import date as date_filter
from django.utils.translation import gettext_lazy as _
from .helpers import get_calculation_annotation
from .registry import field_registry
class SlickReportField(object):
"""
Computation field respon... | import uuid
from django.db.models import Sum
from django.template.defaultfilters import date as date_filter
from django.utils.translation import gettext_lazy as _
from .helpers import get_calculation_annotation
from .registry import field_registry
class SlickReportField(object):
"""
Computation field respon... |
import os, re, glob
import logging
from pathlib import Path
from typing import Dict, List, Optional, Tuple, Union
import yaml
import numpy as np
import pandas as pd
import xarray as xr
from astrild.rays.rayramses import RayRamses
from astrild.particles.ecosmog import Ecosmog
dir_src = Path(__file__).parent.absolute(... | import os, re, glob
import logging
from pathlib import Path
from typing import Dict, List, Optional, Tuple, Union
import yaml
import numpy as np
import pandas as pd
import xarray as xr
from astrild.rays.rayramses import RayRamses
from astrild.particles.ecosmog import Ecosmog
dir_src = Path(__file__).parent.absolute(... |
# -*- coding: utf-8 -*-
# Copyright (c) 2021, Lin To and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.website.website_generator import WebsiteGenerator
class SalesInvoice(WebsiteGenerator):
def validate(self):
self.valida... | # -*- coding: utf-8 -*-
# Copyright (c) 2021, Lin To and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.website.website_generator import WebsiteGenerator
class SalesInvoice(WebsiteGenerator):
def validate(self):
self.valida... |
# pylint: disable=no-self-use,invalid-name
from unittest import TestCase
from allennlp.models.archival import load_archive
from allennlp.service.predictors import Predictor
from propara.service.predictors.prostruct_prediction import ProStructPredictor
class TestProParaPredictor(TestCase):
def test_uses_named_inp... | # pylint: disable=no-self-use,invalid-name
from unittest import TestCase
from allennlp.models.archival import load_archive
from allennlp.service.predictors import Predictor
from propara.service.predictors.prostruct_prediction import ProStructPredictor
class TestProParaPredictor(TestCase):
def test_uses_named_inp... |
'''
USAGE:
python test.py --img A_test.jpg
'''
import torch
import joblib
import torch.nn as nn
import numpy as np
import cv2
import argparse
import torchvision.transforms as transforms
import torch.nn.functional as F
import time
import cnn_models
from PIL import Image
# construct the argument parser and parse the arg... | '''
USAGE:
python test.py --img A_test.jpg
'''
import torch
import joblib
import torch.nn as nn
import numpy as np
import cv2
import argparse
import torchvision.transforms as transforms
import torch.nn.functional as F
import time
import cnn_models
from PIL import Image
# construct the argument parser and parse the arg... |
import logging
import os
import sys
from functools import partial, partialmethod
from inspect import stack
import yaml
from bunch import Bunch
from emoji import emojize
from loguru import logger
from rich.console import Console
from yaml import FullLoader as Full_Loader
from about import name as about_name
emoji = p... | import logging
import os
import sys
from functools import partial, partialmethod
from inspect import stack
import yaml
from bunch import Bunch
from emoji import emojize
from loguru import logger
from rich.console import Console
from yaml import FullLoader as Full_Loader
from about import name as about_name
emoji = p... |
# -*- coding: utf-8 -*-
"""
Command Line Watcher for auto compile Qt ui to python file.
Usage Example:
"""
# Import future modules
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
# Import built-in modules
import argparse
import copy
import fnmatch
from fun... | # -*- coding: utf-8 -*-
"""
Command Line Watcher for auto compile Qt ui to python file.
Usage Example:
"""
# Import future modules
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
# Import built-in modules
import argparse
import copy
import fnmatch
from fun... |
#-----------------------------------------------------------------------------
# Title : Top Level Navigation Budget Sheet
#-----------------------------------------------------------------------------
# This file is part of the TID ID Smartsheets software platform. It is subject to
# the license terms in the LICE... | #-----------------------------------------------------------------------------
# Title : Top Level Navigation Budget Sheet
#-----------------------------------------------------------------------------
# This file is part of the TID ID Smartsheets software platform. It is subject to
# the license terms in the LICE... |
#!/usr/bin/env python
# coding: utf-8
import os
from flask import request, abort, jsonify
from app.auxiliary.query_tools import initialProcessing, logFail, logSuccess
# Загрузка компонента
@initialProcessing
def storage_upload(parameters, start_time, query_id):
if 'file' not in request.files or not request.files... | #!/usr/bin/env python
# coding: utf-8
import os
from flask import request, abort, jsonify
from app.auxiliary.query_tools import initialProcessing, logFail, logSuccess
# Загрузка компонента
@initialProcessing
def storage_upload(parameters, start_time, query_id):
if 'file' not in request.files or not request.files... |
"""
VSAN Policy Maker for Cisco Intersight, v2.0
Author: Ugo Emekauwa
Contact: uemekauw@cisco.com, uemekauwa@gmail.com
Summary: The VSAN Policy Maker for Cisco Intersight automates the creation
of VSAN Policies.
GitHub Repository: https://github.com/ugo-emekauwa/cisco-imm-automation-tools
"""
#####... | """
VSAN Policy Maker for Cisco Intersight, v2.0
Author: Ugo Emekauwa
Contact: uemekauw@cisco.com, uemekauwa@gmail.com
Summary: The VSAN Policy Maker for Cisco Intersight automates the creation
of VSAN Policies.
GitHub Repository: https://github.com/ugo-emekauwa/cisco-imm-automation-tools
"""
#####... |
import uuid
import traceback
from flask import redirect
from lyrebird import application
from lyrebird.version import VERSION
from flask_restful import Resource, request
from urllib.parse import urlencode
from lyrebird.mock import context
from lyrebird.log import get_logger
logger = get_logger()
class SanpshotImpor... | import uuid
import traceback
from flask import redirect
from lyrebird import application
from lyrebird.version import VERSION
from flask_restful import Resource, request
from urllib.parse import urlencode
from lyrebird.mock import context
from lyrebird.log import get_logger
logger = get_logger()
class SanpshotImpor... |
import discord, csv, json, random, re
from discord.ext import commands
from .. import converters, embeds, services, utils, views
from ..artifacts import Source
class HeraldryMisc(utils.MeldedCog, name = "General", category = "Heraldry"):
MOTTO_PARTS = re.compile("([&|!]\\w\\w\\w)")
RAND_SUB = re.compile("\n|\t")
... | import discord, csv, json, random, re
from discord.ext import commands
from .. import converters, embeds, services, utils, views
from ..artifacts import Source
class HeraldryMisc(utils.MeldedCog, name = "General", category = "Heraldry"):
MOTTO_PARTS = re.compile("([&|!]\\w\\w\\w)")
RAND_SUB = re.compile("\n|\t")
... |
import sys
import shlex
import logging
import threading
import urwid
import logzero
from logzero import logger
from typing import Any, Iterable, Optional, Dict, TYPE_CHECKING
from .model import Model
from .view import View
from ..extra.player import PlayerEvent, BasePlayer
from ..extra.utils import load_playlist, s... | import sys
import shlex
import logging
import threading
import urwid
import logzero
from logzero import logger
from typing import Any, Iterable, Optional, Dict, TYPE_CHECKING
from .model import Model
from .view import View
from ..extra.player import PlayerEvent, BasePlayer
from ..extra.utils import load_playlist, s... |
# IBM_PROLOG_BEGIN_TAG
#
# Copyright 2021 IBM International Business Machines Corp.
#
# 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... | # IBM_PROLOG_BEGIN_TAG
#
# Copyright 2021 IBM International Business Machines Corp.
#
# 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... |
# Copyright (C) 2021 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import numpy as np
import os
import pytest
from openvino import Core, Blob, TensorDesc, StatusCode
def image_path():
path_to_repo = os.environ["DATA_PATH"]
path_to_img = os.path.join(path_to_repo, "validation_set", "224x224", "dog.... | # Copyright (C) 2021 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import numpy as np
import os
import pytest
from openvino import Core, Blob, TensorDesc, StatusCode
def image_path():
path_to_repo = os.environ["DATA_PATH"]
path_to_img = os.path.join(path_to_repo, "validation_set", "224x224", "dog.... |
#!/usr/bin/env python
'''
Check glossary YAML file.
Usage: check-glossary.py [-A] [-c LL] yaml-config-file glossary-file
Flags:
- `-A`: report all missing definitions for all languages.
- `-c LL`: report missing definitions for language with code `LL` (e.g., 'fr').
Checks always performed:
- Only languages li... | #!/usr/bin/env python
'''
Check glossary YAML file.
Usage: check-glossary.py [-A] [-c LL] yaml-config-file glossary-file
Flags:
- `-A`: report all missing definitions for all languages.
- `-c LL`: report missing definitions for language with code `LL` (e.g., 'fr').
Checks always performed:
- Only languages li... |
# -*- coding: utf-8 -*-
# Copyright (c) 2013 Spotify AB
#
# 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... | # -*- coding: utf-8 -*-
# Copyright (c) 2013 Spotify AB
#
# 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... |
from datetime import datetime
import requests
import time
import polyline
from os.path import exists
from os import environ
import json
import sys
import webbrowser
from builtins import input as askForInput
from activity_db_client import ActivityDBClient
from dotenv import load_dotenv
load_dotenv()
CLIENT_ID = enviro... | from datetime import datetime
import requests
import time
import polyline
from os.path import exists
from os import environ
import json
import sys
import webbrowser
from builtins import input as askForInput
from activity_db_client import ActivityDBClient
from dotenv import load_dotenv
load_dotenv()
CLIENT_ID = enviro... |
"""Legacy device tracker classes."""
import asyncio
from datetime import timedelta
import hashlib
from typing import Any, List, Sequence
import voluptuous as vol
from homeassistant import util
from homeassistant.components import zone
from homeassistant.config import async_log_exception, load_yaml_config_file
from ho... | """Legacy device tracker classes."""
import asyncio
from datetime import timedelta
import hashlib
from typing import Any, List, Sequence
import voluptuous as vol
from homeassistant import util
from homeassistant.components import zone
from homeassistant.config import async_log_exception, load_yaml_config_file
from ho... |
#!/usr/bin/env python3
"""Linting script for rsp-environments.yaml."""
from __future__ import annotations
import argparse
import sys
from dataclasses import dataclass
from pathlib import Path
from typing import Any, Dict, List, Sequence
import requests
import yaml
def main() -> None:
args = parse_args()
f... | #!/usr/bin/env python3
"""Linting script for rsp-environments.yaml."""
from __future__ import annotations
import argparse
import sys
from dataclasses import dataclass
from pathlib import Path
from typing import Any, Dict, List, Sequence
import requests
import yaml
def main() -> None:
args = parse_args()
f... |
import json
from json.decoder import JSONDecodeError
import logging
import re
import requests
from .entity import AtlasClassification, AtlasEntity
from .typedef import BaseTypeDef
from .util import AtlasException, PurviewLimitation, PurviewOnly
class AtlasClient():
"""
Provides communication between your app... | import json
from json.decoder import JSONDecodeError
import logging
import re
import requests
from .entity import AtlasClassification, AtlasEntity
from .typedef import BaseTypeDef
from .util import AtlasException, PurviewLimitation, PurviewOnly
class AtlasClient():
"""
Provides communication between your app... |
#===============================================================================
# splitbam.py
#===============================================================================
"""Split a BAM file into two subsamples"""
import os.path
import pysam
import subprocess
import tempfile
from argparse import ArgumentParser
... | #===============================================================================
# splitbam.py
#===============================================================================
"""Split a BAM file into two subsamples"""
import os.path
import pysam
import subprocess
import tempfile
from argparse import ArgumentParser
... |
import demistomock as demisto
from CommonServerPython import *
from CommonServerUserPython import *
""" IMPORTS """
import urllib3
import traceback
from typing import List, Dict, Optional, Tuple, Generator
# disable insecure warnings
urllib3.disable_warnings()
INTEGRATION_NAME = "Cofense Feed"
_RESULTS_PER_PAGE = 50... | import demistomock as demisto
from CommonServerPython import *
from CommonServerUserPython import *
""" IMPORTS """
import urllib3
import traceback
from typing import List, Dict, Optional, Tuple, Generator
# disable insecure warnings
urllib3.disable_warnings()
INTEGRATION_NAME = "Cofense Feed"
_RESULTS_PER_PAGE = 50... |
from typing import Dict
import os
import ujson
import shutil
from multiprocessing import Pool
from ncc import tasks
from collections import Counter
from ncc.data import (
Dictionary,
indexed_dataset,
)
from ncc.tokenizers import tokenization
from ncc.data.tools.binarizer import Binarizer
from ncc.utils.file_ops... | from typing import Dict
import os
import ujson
import shutil
from multiprocessing import Pool
from ncc import tasks
from collections import Counter
from ncc.data import (
Dictionary,
indexed_dataset,
)
from ncc.tokenizers import tokenization
from ncc.data.tools.binarizer import Binarizer
from ncc.utils.file_ops... |
import os
import json
from airflow.decorators import dag, task
from airflow.utils.dates import days_ago
from airflow.operators.dummy_operator import DummyOperator
import ray
from ray_provider.decorators.ray_decorators import ray_task
import numpy as np
import xgboost_ray as xgbr
import xgboost as xgb
from ray import tu... | import os
import json
from airflow.decorators import dag, task
from airflow.utils.dates import days_ago
from airflow.operators.dummy_operator import DummyOperator
import ray
from ray_provider.decorators.ray_decorators import ray_task
import numpy as np
import xgboost_ray as xgbr
import xgboost as xgb
from ray import tu... |
import argparse
from datasets import PhototourismDataset
import numpy as np
import os
import pickle
def get_opts():
parser = argparse.ArgumentParser()
parser.add_argument('--root_dir', type=str, required=True,
help='root directory of dataset')
parser.add_argument('--img_downscale',... | import argparse
from datasets import PhototourismDataset
import numpy as np
import os
import pickle
def get_opts():
parser = argparse.ArgumentParser()
parser.add_argument('--root_dir', type=str, required=True,
help='root directory of dataset')
parser.add_argument('--img_downscale',... |
#!/usr/bin/env python3
"""Create trendbargraphs for various periods of electricity use and production."""
import argparse
from datetime import datetime as dt
import matplotlib.pyplot as plt
import numpy as np
import constants
# noinspection PyUnresolvedReferences
import libkamstrup as kl
DATABASE = constants.TREND... | #!/usr/bin/env python3
"""Create trendbargraphs for various periods of electricity use and production."""
import argparse
from datetime import datetime as dt
import matplotlib.pyplot as plt
import numpy as np
import constants
# noinspection PyUnresolvedReferences
import libkamstrup as kl
DATABASE = constants.TREND... |
# -*- coding: utf-8 -*-
# Copyright 2018 IBM Corp. 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by a... | # -*- coding: utf-8 -*-
# Copyright 2018 IBM Corp. 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by a... |
import numpy as np
import os
import torch
import time
import matplotlib.pyplot as plt
from isaacgym import gymutil, gymtorch, gymapi
from isaacgym.torch_utils import *
from isaacgym.gymtorch import *
from isaacgymenvs.utils.torch_jit_utils import *
from tasks.base.vec_task import VecTask
class TenseBot(VecTask):
... | import numpy as np
import os
import torch
import time
import matplotlib.pyplot as plt
from isaacgym import gymutil, gymtorch, gymapi
from isaacgym.torch_utils import *
from isaacgym.gymtorch import *
from isaacgymenvs.utils.torch_jit_utils import *
from tasks.base.vec_task import VecTask
class TenseBot(VecTask):
... |
import logging
import os
from random import shuffle
import nltk
from utils import remove_ngram, tokenise
DIR_PATH = os.path.dirname(os.path.realpath(__file__))
def random_ngrams(ngrams, number_of_ngrams):
relevant_ngrams = ngrams[:number_of_ngrams]
remaining_ngrams = ngrams[number_of_ngrams:]
relevant... | import logging
import os
from random import shuffle
import nltk
from utils import remove_ngram, tokenise
DIR_PATH = os.path.dirname(os.path.realpath(__file__))
def random_ngrams(ngrams, number_of_ngrams):
relevant_ngrams = ngrams[:number_of_ngrams]
remaining_ngrams = ngrams[number_of_ngrams:]
relevant... |
"""Accessor class for columns containing single-level key/value mappings
The FlatSampleReader container is used to store data (in any backend) in a column
containing a single level key/value mapping from names/ids to data.
All backends are supported.
"""
from contextlib import ExitStack
from pathlib import Path
from ... | """Accessor class for columns containing single-level key/value mappings
The FlatSampleReader container is used to store data (in any backend) in a column
containing a single level key/value mapping from names/ids to data.
All backends are supported.
"""
from contextlib import ExitStack
from pathlib import Path
from ... |
"""
It compares human and machine attention weights.
"""
import json
import logging
import os
import re
from tqdm import tqdm
import abc
from abc import ABCMeta
import pandas as pd
import numpy as np
import random
from copy import deepcopy
import matplotlib.pyplot as plt
import seaborn as sns
import matplotlib.image ... | """
It compares human and machine attention weights.
"""
import json
import logging
import os
import re
from tqdm import tqdm
import abc
from abc import ABCMeta
import pandas as pd
import numpy as np
import random
from copy import deepcopy
import matplotlib.pyplot as plt
import seaborn as sns
import matplotlib.image ... |
import json
from pathlib import Path
import subprocess
from sherlock.config import Config
from sherlock.core import Sherlock
def run_sherlock(robot_output, source, report=None, resource=None):
config = Config(from_cli=False)
config.output = robot_output
config.path = source
if report is not None:
... | import json
from pathlib import Path
import subprocess
from sherlock.config import Config
from sherlock.core import Sherlock
def run_sherlock(robot_output, source, report=None, resource=None):
config = Config(from_cli=False)
config.output = robot_output
config.path = source
if report is not None:
... |
from datetime import datetime, timedelta
from os import listdir, mkdir
from os.path import exists, join
import sys
from typing import List, Tuple, TypeVar
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
import matplotlib.ticker as ticker
from math import floor
from multiprocessing import Proce... | from datetime import datetime, timedelta
from os import listdir, mkdir
from os.path import exists, join
import sys
from typing import List, Tuple, TypeVar
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
import matplotlib.ticker as ticker
from math import floor
from multiprocessing import Proce... |
from random import randint
import random
# You've built an inflight entertainment system with on-demand movie streaming.
# Users on longer flights like to start a second movie right when their first one ends, but they complain that the plane usually lands before they can see the ending.
# So you're building a feature... |
from random import randint
import random
# You've built an inflight entertainment system with on-demand movie streaming.
# Users on longer flights like to start a second movie right when their first one ends, but they complain that the plane usually lands before they can see the ending.
# So you're building a feature... |
from collections import defaultdict
#T composition table
T=defaultdict(dict)
U={'<','>','d','di','o','oi','m','mi','s','si','f','fi','='}
dur={'d','s','f'}
con={'di','si','fi'}
O={'d','s','f','di','si','fi','o','oi','='} #big overlap
T['<']={'<':{'<'},'>':U,'d':{'<','o','m','d','s'},
'di':{'<'},'o':{'<'},'oi'... | from collections import defaultdict
#T composition table
T=defaultdict(dict)
U={'<','>','d','di','o','oi','m','mi','s','si','f','fi','='}
dur={'d','s','f'}
con={'di','si','fi'}
O={'d','s','f','di','si','fi','o','oi','='} #big overlap
T['<']={'<':{'<'},'>':U,'d':{'<','o','m','d','s'},
'di':{'<'},'o':{'<'},'oi'... |
# Copyright The PyTorch Lightning team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | # Copyright The PyTorch Lightning team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... |
import random
import json
import logging
import asyncio
import secrets
import sortedcontainers
from hailtop.utils import (
Notice,
run_if_changed,
WaitableSharedPool,
time_msecs,
retry_long_running,
secret_alnum_string,
AsyncWorkerPool,
periodically_call,
)
from ..batch_format_version ... | import random
import json
import logging
import asyncio
import secrets
import sortedcontainers
from hailtop.utils import (
Notice,
run_if_changed,
WaitableSharedPool,
time_msecs,
retry_long_running,
secret_alnum_string,
AsyncWorkerPool,
periodically_call,
)
from ..batch_format_version ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.