text stringlengths 3.07k 22.1k |
|---|
# dataclean.py (flowsa)
# !/usr/bin/env python3
# coding=utf-8
"""
Common functions to clean and harmonize dataframes
"""
import numpy as np
from flowsa.settings import log
from flowsa.literature_values import get_Canadian_to_USD_exchange_rate
def clean_df(df, flowbyfields, fill_na_dict, drop_description=True):
... |
# -*- coding: utf-8 -*-
# This file as well as the whole tsfresh package are licenced under the MIT licence (see the LICENCE.txt)
# <NAME> (<EMAIL>), Blue Yonder Gmbh, 2016
"""
This file contains methods/objects for controlling which features will be extracted when calling extract_features.
For the naming of the featur... |
import os
import torch, cv2
import random
import numpy as np
def tens2image(im):
if im.size()[0] == 1:
tmp = np.squeeze(im.numpy(), axis=0)
else:
tmp = im.numpy()
if tmp.ndim == 2:
return tmp
else:
return tmp.transpose((1, 2, 0))
def crop2fullmask(crop_mask, bbox, im... |
import json
import os
import shutil
import hashlib
from shutil import copyfile
from .steady_download_and_compute_sha1 import steady_download_and_compute_sha1
import random
import time
from .filelock import FileLock
import mtlogging
# TODO: implement cleanup() for Sha1Cache
# removing .record.json and .hints.json files... |
from moveit_commander.conversions import list_to_pose
import copy
approach_height = 0.08
approach_offset = 0.05
positions = {}
positions["back"] = list_to_pose([0, 0, 0, 0, 0, 0])
positions["back_up"] = list_to_pose([0, 0, approach_height, 0, 0, 0])
positions["back_out"] = list_to_pose([-approach_offset, 0, 0, 0, 0, ... |
import pandas as pd
import os
import numpy as np
import pydicom
import json
import SimpleITK as sitk
import sys
import cv2
from os import listdir
from os.path import isfile, join
import random
from shutil import copyfile
random.seed(1)
"""
This script reads 3 csv files generated by BigQuery on MIMIC CXR. Each csv file... |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from... |
import inspect
import warnings
import pysb
from pysb.core import MultiState
import sympy
from sympy.printing import StrPrinter
# Alias basestring under Python 3 for forwards compatibility
try:
basestring
except NameError:
basestring = str
class BngGenerator(object):
def __init__(self, model, additional_i... |
import pandas as pd
from xml.etree import ElementTree as etree
from morphemeGloss import *
from pprint import pprint
from yattag import *
import pdb
#------------------------------------------------------------------------------------------------------------------------
# -*- coding: utf-8 -*-
#------------------------... |
from __future__ import division
from future import standard_library
standard_library.install_aliases()
from builtins import range
from past.utils import old_div
from builtins import object
import logging
import tkinter.messagebox
import PIL.Image
import PIL.ImageTk
import PIL.ImageChops
import PIL.ImageDraw
import tkin... |
import errno
import json
import os
from urllib.parse import unquote, urlsplit, urlunsplit
import cloudinary
import cloudinary.api
import cloudinary.uploader
import requests
from django.conf import settings
from django.contrib.staticfiles import finders
from django.contrib.staticfiles.storage import HashedFilesMixin, M... |
import hmac
from hashlib import sha512
from typing import Union
from ..base58 import base58check_decode, base58check_encode
from ..constants import BIP32_SEED_BYTE_LENGTH
from ..constants import Chain, XKEY_BYTE_LENGTH, XKEY_PREFIX_LIST, PUBLIC_KEY_COMPRESSED_PREFIX_LIST
from ..constants import XPUB_PREFIX_CHAIN_DICT,... |
# This module contains infrastructure for generating
# C-code loops of arbitrary dimension
# Author: <NAME>
# zachetie **at** gmail **dot* com
import sys # Standard Python modules for multiplatform OS-level functions
# loop1D() is just a special case of loop(), and in fact is called... |
import mxnet as mx
import numpy as np
def conv_act_layer(from_layer, name, num_filter, kernel=(1,1), pad=(0,0), \
stride=(1,1), act_type="relu", use_batchnorm=False):
"""
wrapper for a small Convolution group
Parameters:
----------
from_layer : mx.symbol
continue on which layer
nam... |
import torch
import torch.nn as nn
import numpy as np
import torch.nn.functional as F
import inspect
import os
from .genotypes import Genotype
from .operations import ReLUConvBN
from .operations import FactorizedReduce
from .operations import MixedLayer
from .operations import Identity
from .operations import OPS
def... |
# ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distrib... |
"""Tests for distutils.command.sdist."""
import os
import unittest
import shutil
import zipfile
import tarfile
# zlib is not used here, but if it's not available
# the tests that use zipfile may fail
try:
import zlib
except ImportError:
zlib = None
try:
import grp
import pwd
UID_GID_SUPPORT = True... |
import os
import yaml
import socket
def test(model, L=5, K=2, T=0.01, R=12, opts=[], gpu=0, force=False):
#--radius 40 --all-nn
# MODEL=moco
# MODEL=
# MODEL="--resume ${MODEL}"
# model="--model-type imagenet"
R = int(R)
if '---' in model:
model_split = model.split('---')
... |
# Utilities that don't fit elsewhere.
# Copyright (c) 2015, <NAME>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# n... |
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... |
import sys
from . import geometry
from .err_warn import ProfileError, profile_warning, profile_message
def lazy_property(fn):
"""Decorator that makes a property lazily evaluated.
From https://stevenloria.com/lazy-properties/.
"""
attr_name = '_lazy_' + fn.__name__
@property
def _lazy_prope... |
#!/usr/bin/env python3
#
# Sniffles2
# A fast structural variant caller for long-read sequencing data
#
# Created: 09.09.2021
# Author: <NAME>
# Contact: <EMAIL>
#
from dataclasses import dataclass
import collections
from sniffles import util
@dataclass
class Group:
"""
A sequence to which other sequences a... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2015, <NAME> <jcallen () csc.com>
# Copyright: (c) 2018, Ansible Project
# Copyright: (c) 2018, <NAME> <<EMAIL>>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, pri... |
import tkinter as tk
from tkinter import ttk, messagebox
from tkinter import filedialog
from lib.senario import Senario
from lib.gui import Primitives, Style
class Mine:
class Linker(Primitives.Combobox):
def __init__(self, parent, **kwargs):
super().__init__(parent, state="readonly", **kwargs... |
import os
import numpy as np
from PIL import Image
from shapely.geometry import LineString
from scipy.spatial.distance import cdist
import torch
import torch.utils.data as data
from misc import panostretch
class PanoCorBonDataset(data.Dataset):
'''
See README.md for how to prepare the dataset.
'''
... |
import io
import json
import luigi
from servicecatalog_puppet import manifest_utils
from servicecatalog_puppet.workflow import tasks as workflow_tasks
from servicecatalog_puppet.workflow import manifest as manifest_tasks
from servicecatalog_puppet.workflow.provisioning import LaunchTask
from servicecatalog_puppet.wor... |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import math
import types
import torch
import torch.optim
import torch.distributed as dist
from . import FairseqOptimizer, register_optimizer... |
"""
Investigate common correct examples to estimate potential
upside of using an ensemble.
Example output:
$ python ../scripts/analyze_report.py --path snli-16-back-cpu-1-eval.report,snli-17-enc-parse-0-eval.report,snli-16-parse-eval.report,snli-17-enc-back-0-eval.report,snli-17-enc-parse-0-eval.report --ensemble
m... |
# 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... |
# This code is part of Qiskit.
#
# (C) Copyright IBM 2017, 2020.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivat... |
# Copyright 2015 Mirantis Inc.
# 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... |
import math
import matplotlib
import matplotlib.pyplot as plt
import numpy
import skimage.exposure
import skimage.filters
import skimage.transform
import skimage.util
import skimage.measure
import skimage.draw
import skimage.morphology
from scipy import ndimage as ndi
"""
Note: Standardization and transforms assume... |
import torch
import torch.nn as nn
import torch.nn.functional as f
def weight_init(m):
if isinstance(m, (nn.Conv2d,)):
torch.nn.init.xavier_normal_(m.weight, gain=1.0)
if m.weight.data.shape[1] == torch.Size([1]):
torch.nn.init.normal_(m.weight, mean=0.0, )
if m.bias is not No... |
import unittest
import numpy as np
import openmdao.api as om
import dymos as dm
from openmdao.utils.assert_utils import assert_check_partials, assert_near_equal
from openmdao.utils.testing_utils import require_pyoptsparse
from dymos.examples.brachistochrone.brachistochrone_ode import BrachistochroneODE
from dymos.tra... |
from django.conf import settings
from django.db import models
from django.db.models.signals import post_save, pre_save
from django.dispatch.dispatcher import receiver
from django.utils.text import slugify
from django.utils.translation import ugettext_lazy as _
from PIL import Image
from shop import tasks
import uuid
... |
#!/bin/sh
"." "`dirname $0`/../../../../../trusty/vendor/google/aosp/scripts/envsetup.sh"
"exec" "$PY3" "$0" "$@"
# Copyright 2013-2017 Google Inc. +All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files
# (the "Softwa... |
from __future__ import absolute_import
__all__ = ["from_user", "from_member", "DEFAULT"]
import warnings
from django.conf import settings
from django.utils.functional import cached_property
import sentry_sdk
from sentry import roles
from sentry.auth.superuser import is_active_superuser
from sentry.auth.system impo... |
#!/usr/bin/python
# Copyright: (c) 2018, Pluribus Networks
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['... |
"""Display class to aggregate and print the results of many measurements."""
import collections
import enum
import itertools as it
from typing import DefaultDict, List, Optional, Tuple
from torch.utils.benchmark.utils import common
from torch import tensor as _tensor
__all__ = ["Compare"]
BEST = "\033[92m"
GOOD = "\... |
#! /Users/rkrsn/miniconda/bin/python
from __future__ import print_function, division
from os import environ, getcwd
from os import walk
from pdb import set_trace
import sys
# Update PYTHONPATH
HOME = environ['HOME']
axe = HOME + '/git/axe/axe/' # AXE
pystat = HOME + '/git/pystats/' # PySTAT
cwd = getcwd() # Curren... |
import re
from functools import reduce
from pyparsing import (
infixNotation,
opAssoc,
Optional,
Literal,
CharsNotIn,
ParseException,
)
import logging
from logging import Filter, _nameToLevel
from django.apps import apps
from django.db import models
from django.conf import settings
from awx.ma... |
import numpy as np
from numpy.testing import assert_, assert_raises, assert_array_almost_equal
from modpy.tests.test_util import run_unit_test
from modpy.special import *
class TestErf:
def test_result(self):
# values from: https://en.wikipedia.org/wiki/Error_function
x = np.array([-3.5... |
import logging as log
import sys
from galaxy.api.plugin import Plugin, create_and_run_plugin
from galaxy.api.consts import Platform, OSCompatibility
from galaxy.api.types import NextStep, Authentication, Game, LicenseInfo, LicenseType, LocalGame, LocalGameState
from version import __version__
from backend import Para... |
import argparse
import os
import pickle
import random
import matplotlib.pyplot as plt
import numpy as np
import seaborn as sns
import torch
import torchvision.transforms as transforms
import torchvision.datasets as datasets
import mdeq_lib.models as models
from mdeq_lib.config import config
from mdeq_lib.modules.adj_... |
import json
import logging
import multiprocessing as mp
import time
import traceback
from typing import Optional, Union
from django.core.exceptions import ObjectDoesNotExist
from actions.device import (
DEVICES,
SIMPLE,
)
from transport.interfaces import send_log
from actions.main import EventManager
from aler... |
# pylint: disable=W0611
'''
Kivy Base
=========
This module contains core Kivy functionality and is not intended for end users.
Feel free to look though it, but calling any of these methods directly may well
result in unpredicatable behavior.
Event loop management
---------------------
'''
__all__ = (
'EventLoo... |
from fontTools.misc.py23 import *
from fontTools.misc import sstruct
from fontTools.misc.textTools import safeEval
from . import DefaultTable
import pdb
import struct
METAHeaderFormat = """
> # big endian
tableVersionMajor: H
tableVersionMinor: H
metaEntriesVersionMajor: H
metaEntriesVersionMinor: H
u... |
# -*- coding: utf-8 -*-
from __future__ import print_function, unicode_literals, absolute_import, division
from six.moves import range, zip, map, reduce, filter
from six import string_types
import numpy as np
from collections import namedtuple
import sys, os, warnings
from ..utils import _raise, consume, axes_check_a... |
import functools
import importlib
import os
from typing import Callable, Tuple, Any
from PIL import Image, ImageDraw
from . import icons
from .dimensions import Dimension
from .point import Coordinate
anchors = {
"left": "la",
"right": "ra",
"centre": "ma",
}
class CachingText:
def __init__(self, a... |
#!/usr/bin/env python3
from datetime import datetime
from glob import glob
import hashlib
import itertools
import os
from pathlib import Path
import subprocess
import sys
from string import StringFileConverter
from make import ChangeFileLine
if sys.platform.startswith('win'):
PathVar = os.environ.get('Path')
... |
# coding: utf-8
from __future__ import print_function, unicode_literals, division
from tests.fixtures import fix_requests, fix_dump, ids_files, fix_input
import os
import pytest
MESSAGE_URL = "https://forum.camptocamp.org/t/topoguide-verifications-automatiques/201480/1"
def test_distance(fix_requests):
from ca... |
import torch
import torch.utils.data as data
import torchvision.transforms as transforms
from torch.autograd import Variable
from PIL import Image
import os.path
import csv
import math
import collections
from tqdm import tqdm
import datetime
import numpy as np
import numpy
#from watch import NlabelTovect... |
import fire
import itertools
import os
import signal
import sh
import sys
import traceback
from concurrent.futures import ThreadPoolExecutor
from random import uniform
from threading import Lock, Semaphore
from time import sleep
from tempfile import gettempdir, NamedTemporaryFile
from config import (active_config, wr... |
from __future__ import absolute_import, division, print_function
import scitbx.math
from scitbx.array_family import flex
from scitbx import lbfgsb as lbfgsb_core
import scitbx.lbfgs as lbfgs_core
import sys
floating_point_epsilon_double = scitbx.math.floating_point_epsilon_double_get()
class FunctionalException(Runti... |
# PyPi imports
import base64, io, sys
from collections import namedtuple
from typing import Dict
import dash_bootstrap_components as dbc
import numpy as np
import pandas as pd
import plotly.graph_objects as go
import yaml
from dash import dcc, html, dash_table
from numba import jit
from pandas.api.types import is_num... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright 2020-2022 F4PGA 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
#
# Unl... |
import enum
from enum import Enum
import typing
import time
import sys
import traceback
import threading
from .logging import logger
from .board import Board
@enum.unique
class StateStatus(Enum):
UNKNOWN = -1 # Unknown
NOT_RUNNING = 0 # the default state, should be restarted by Parent after transition o... |
# Copyright (c) 2019-present, <NAME>
# All rights reserved.
#
# This source code is licensed under the license found in the LICENSE file in
# the root directory of this source tree.
import json
import h5py
import numpy as np
import os
from typing import List, Iterable, Tuple, Optional, Dict, Union
from .record import... |
#! /usr/bin/env python
"""
@@ script: sra_proceduere_bowtie.py
@@ description: based on python3.5.2
@@ author: zhangq
"""
import argparse, datetime, os, sys, re, subprocess, tempfile
def printlg(log_message):
print(log_message, file = log_file)
def get_fa4sRNA(tag_fa):
tag_count={}
with open(tag_fa,'r') ... |
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
from IPython import embed as shell # for debugging
# import wrappers etc
from ibl_pipeline.utils import psychofit as psy
# ================================================================== #
# DEFINE PSYCHFUNCFIT TO WORK W... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Friday October 28 17:08:18 2021
@author: <NAME>
Calculates timeseries of annual, global mean variables for atmosphere and ocean. Time is given in years
Sea ice variables (area and extent) are calculated for March and September
(Please note that time is g... |
# Copyright 2017 NTRLab
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, softw... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2011 <NAME> <<EMAIL>>
# Copyright 2012 Google, Inc.
# Copyright 2014 <NAME> <<EMAIL>>
#
# 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 ... |
from django.db import models
from django.utils.translation import gettext_lazy
from modelcluster.fields import ParentalKey
from wagtail.admin.edit_handlers import TabbedInterface, ObjectList, FieldPanel, InlinePanel, PageChooserPanel, \
StreamFieldPanel
from wagtail.core import blocks
from wagtail.core.fields impo... |
import logging
import numpy as np
import scipy.integrate
class ZNDSolver(object):
"""Solver for steady solution"""
def __init__(self, config, reaction_rate):
self._config = config
self._reaction_rate = reaction_rate
self._max_lamda = 1.0 - self._config.lambda_tol
self._logge... |
# (C) Datadog, Inc. 2010-2017
# All rights reserved
# Licensed under Simplified BSD License (see LICENSE)
import array
from collections import defaultdict
import fcntl
import itertools
import os
import struct
import psutil
from six import iteritems
from datadog_checks.checks import AgentCheck
MIXED = "mixed"
DATA =... |
import os
import cv2
import csv
import random
import imageio
import datetime
import numpy as np
import pandas as pd
import rasterio as rs
import geopandas as gp
from tqdm import tqdm
from random import random
from skimage import img_as_ubyte
from scipy.ndimage import gaussian_filter
from skimage.transform import matc... |
"""
Support for Pollen.com allergen and cold/flu sensors.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sensor.pollen/
"""
import logging
from datetime import timedelta
from statistics import mean
import voluptuous as vol
import homeassistant.helpers.... |
import random
import sys
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from matplotlib.patches import Ellipse
import kmeans
def get_data_points(fname):
data_points_list = []
with open(fname) as f:
for line in f.readlines():
x, y = line.replace(' ', '').split(',')... |
from rpython.jit.metainterp.optimizeopt.intutils import IntBound, IntUpperBound, \
IntLowerBound, IntUnbounded
from rpython.jit.metainterp.optimizeopt.intbounds import next_pow2_m1
from copy import copy
import sys
from rpython.rlib.rarithmetic import LONG_BIT
def bound(a,b):
if a is None and b is None:
... |
import matplotlib as matplt
matplt.use('Agg')
import os, sys
sys.path.insert(0,os.path.abspath('..'))
sys.path.insert(0,os.path.abspath('.'))
sys.path.insert(0,os.path.abspath('../easy_reg'))
#sys.path.insert(0,os.path.abspath('../mermaid'))
import numpy as np
import torch
import random
torch.backends.cudnn.benchmark=T... |
# Copyright (c) 2018 PaddlePaddle Authors. 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 app... |
import hashlib
import secrets
import uuid
from collections import namedtuple
from datetime import datetime, timedelta
try:
import simplejson as json
except ImportError:
import json
from flask import Flask, request, make_response, Response
from io import StringIO
import zipfile
storage_events_partitions = {"c... |
# -*- coding: utf-8 -*-
import os
import sys
import json
import subprocess
import shutil
import glob
import uuid
from datetime import datetime
from tqdm import tqdm
import configparser
from loguru import logger
import javalang
from javalang import parse
core_config = configparser.ConfigParser()
core_config.read(os.p... |
# Copyright (c) 2015 OpenStack Foundation. 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 ... |
#!/usr/bin/python3
# encoding: utf-8
from termcolor import colored
def printTemplatesUsage(banner, currentApp):
print(colored(banner, 'green'))
templatesInfo = \
r"""
== Template usage ==
Templates can be called using -t, --template=TEMPLATE_NAME combined with other options.
Available templat... |
"""Build factory instances."""
import collections
from . import declarations, enums, errors, utils
DeclarationWithContext = collections.namedtuple(
'DeclarationWithContext',
['name', 'declaration', 'context'],
)
class DeclarationSet:
"""A set of declarations, including the recursive parameters.
At... |
import pytz
import json
from django.core.exceptions import ValidationError
from rest_framework import serializers as ser
from rest_framework import exceptions
from api.base.utils import absolute_reverse, get_user_auth
from website.project.metadata.utils import is_prereg_admin_not_project_admin
from website.exceptions... |
#! /usr/bin/env python
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
#
# Copyright (c) 2014 <NAME>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundatio... |
"""This script is responsible for creating sequence datasets from the main sketch dataset.
This script performs many important pipeline steps to prepare the data into a format that is suitable
for training deep learning models. In addition, it is also configurable with a number of filtering options,
in order to ensure... |
import yaml
from typing import Callable
from lusid import models
try:
from StringIO import StringIO
except ImportError:
from io import StringIO
# Common abbreviations
rev_abbrev = {
"FIFO": "TransactionConfiguration/default/TaxLotSelectionMethod=FirstInFirstOut",
"LIFO": "TransactionConfiguration/defa... |
"""Utility methods for flake8."""
import collections
import fnmatch as _fnmatch
import functools
import io
import logging
import os
import platform
import re
import sys
import textwrap
import tokenize
from typing import Dict
from typing import List
from typing import NamedTuple
from typing import Optional
from typing i... |
import graphene
import re
from django.db.models import Prefetch
from openstates.data.models import Bill, BillActionRelatedEntity, PersonVote
from .common import OCDBaseNode, DjangoConnectionField, CountableConnectionBase
from .core import (
LegislativeSessionNode,
OrganizationNode,
IdentifierNode,
Perso... |
import json
import os
from collections import namedtuple
import matplotlib.pyplot as plt
import numpy as np
import tensorflow as tf
from PIL import Image, ImageColor, ImageDraw, ImageFont
def draw_bbox(img_path: str, bbox: namedtuple, line_width=10):
""" Draw a bbox around the object.
:param str image_path:... |
import dataclasses
import dacite
import tensorflow as tf
from typing import List, Mapping, Optional
import vcm
from fv3fit._shared import SliceConfig
from fv3fit.emulation import thermo
from fv3fit.emulation.layers.normalization2 import (
NormFactory,
StdDevMethod,
MeanMethod,
)
from fv3fit.keras.adapters ... |
import datetime
import itertools as it
from abc import ABC, abstractmethod
from contextlib import suppress
import ipyvolume as ipv
import numpy as np
colors = [(0.923, 0.386, 0.209),
(0.368, 0.507, 0.71)]
colors_alpha = [tuple(list(c) + [1.0]) for c in colors]
def darker(color, factor=1.0):
r, g, b, ... |
"""Decodes css data and turns it into a dict"""
import cssutils, json
from pprint import pprint as pp
from .default import default
import logging, copy
# a maximum number of blank margin lines that can be created
max_vertical_margin_size = 2
def ppStyle(style):
"""Prints nice representation of StyleHandler class... |
import logging
import requests
import json
import time
from datetime import datetime
from django.conf import settings
from drf_yasg.utils import swagger_auto_schema
from rest_framework import permissions, status
from rest_framework.decorators import api_view, permission_classes
from rest_framework.response import Res... |
#!/usr/bin/env python3
from pathlib import Path
from multiprocessing import Queue
from threading import Thread
import depthai as dai
from enum import Enum
import cv2
class EncodingQuality(Enum):
BEST = 1 # Lossless MJPEG
HIGH = 2 # MJPEG Quality=97 (default)
MEDIUM = 3 # MJPEG Quality=93
LOW = 4 # H265... |
"""Mobject representing curly braces."""
from __future__ import annotations
__all__ = ["Brace", "BraceLabel", "ArcBrace", "BraceText", "BraceBetweenPoints"]
from typing import Sequence
import numpy as np
from manim._config import config
from manim.mobject.opengl_compatibility import ConvertToOpenGL
from ...animat... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Ansible module to manage Foreman subnet resources.
#
# This module is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your o... |
#!/usr/bin/env python3
# Copyright lowRISC contributors.
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
# SPDX-License-Identifier: Apache-2.0
"""HMAC-SHA256 Python implementation
"""
import argparse
import binascii
import hmac as hm
import hashlib # for comparison
import logging as log
imp... |
# Copyright (c) 2015, The MITRE Corporation. All rights reserved.
# See LICENSE.txt for complete terms.
"""Methods for merging MAEC documents"""
from copy import deepcopy
import itertools
from mixbox import idgen
from mixbox.namespaces import Namespace
from mixbox.vendor.six import iteritems
from cybox.core import ... |
import re,docx,os,difflib,time,traceback
from PyQt5.QtWidgets import *
from pathlib import Path
from datasketch import MinHash, MinHashLSH
from nltk import ngrams
def getText(filename):
doc = docx.Document(filename)
fullText = []
for para in doc.paragraphs:
fullText.append(para.text)
return '\n... |
"""Interface model.
Interface model is represented by Interface class.
Parser must provide an instance of this model as a result of parsing
interface definition file.
Generator must take an instance of this model as input for generating
output files.
"""
# In this module there are classes that are used as da... |
# Copyright (c) 2022 <NAME>
# OCR and Screen Image detection for fcmacros
import os
import cv2
import pyautogui
import pytesseract
import numpy as np
import fcmacros
from time import sleep
from keymaps import *
from locations import *
import logging
import glob
import zipfile
# Teserect installer for windows
# https:... |
"""ravdess dataset."""
import collections
import os
import numpy as np
import tensorflow as tf
import tensorflow_datasets.public_api as tfds
# Markdown description that will appear on the catalog page.
_DESCRIPTION = """
The Ryerson Audio-Visual Database of Emotional Speech and Song (RAVDESS) contains 7356 files ... |
import cv2
import os
import shutil
import quaternion
import torch
import numpy as np
from typing import Optional
import imageio
from tqdm import tqdm
from pytorch3d.structures import Meshes
from pytorch3d.renderer import TexturesVertex
from pytorch3d.structures import utils as struct_utils
from sparseplane.utils.camer... |
'''
Inference code for PropTR
Modified from VisTR (https://github.com/Epiphqny/VisTR)
'''
import argparse
import datetime
import json
import random
import time
from pathlib import Path
import numpy as np
import torch
from torch.utils.data import DataLoader, DistributedSampler
import datasets
import util.misc as utils... |
# -*- coding: utf-8 -*-
""" This is the script to reproduce the results on the Spiral dataset of
Section 3.4.1.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
import argparse
import os
from keras.layers import Input
from keras.models... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.