text
stringlengths
3.07k
22.1k
#!/usr/bin/python3 """ Binary heat map generator ``binheat`` converts a description of a binary relation into a PDF image of the relation as a binary heat map (a.k.a. matrix display, adjacency matrix, comparison chart, and probably a bunch of other names as well). Each line of the input (except for blank lines and co...
# -*- coding: utf-8 -*- # Copyright 2020 Google 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 ...
from enum import Enum import ipaddress from typing import List class ROLES(Enum): COSTUMER = -1 PEER = 0 PROVIDER = 1 class MESSAGE_TYPE(Enum): ADVERTISE = 1 WITHDRAW = -1 PATH_CONST = "path" RANGE_IP_CONST = "range_ip" MESSAGE_TYPE_CONST = "message_type" class LinkedAS: def __init__(sel...
#!/usr/bin/env python """ CX input generation script. """ import logging import sys import h5py import numpy as np import matplotlib as mpl import matplotlib.animation as anim import matplotlib.image import matplotlib.cm as cm import matplotlib.pyplot as plt try: from shutil import which except: from shuti...
# Copyright 2019 The TensorTrade 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 applicable law or agreed to...
from copy import deepcopy import numpy as np from ml_recsys_tools.data_handlers.interactions_with_features import ItemsHandler from ml_recsys_tools.recommenders.recommender_base import BaseDFSparseRecommender from ml_recsys_tools.utils.parallelism import map_batches_multiproc from ml_recsys_tools.utils.similarity imp...
### This script produces a window where it plots current tracking position ### and also history of tracked position. ### By <NAME>, January 2018, UCL import sys import pyqtgraph as pg from PyQt5 import QtWidgets, QtGui import numpy as np from PyQt5.QtCore import QTimer from time import sleep, time from scipy import n...
import io import logging import os import shutil from tempfile import mkdtemp from zipfile import ZipFile from django.conf import settings from django.conf.urls import url from django.core.exceptions import ObjectDoesNotExist from django.core.files.base import File from django.core.files.storage import default_storage...
"""Utilities related to metrics.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from enum import Enum from .. import backend as K from . import losses_utils NEG_INF = -1e10 class Reduction(object): """Types of metrics reduction. Contains th...
import torch from torch.utils.data import Dataset, Sampler import numpy as np import random import cv2 def apply_smart_batching(epoch_sample_indexes, seq_lenghts, batch_size): """Sort indexes by samples length to make LSTM training faster. May affect the quality of the training. """ epoch_seq_lengths ...
"""Peewee+ :constant SQLITE_DEFAULT_VARIABLE_LIMIT: The default number of variables that a single SQL query can contain when interfacing with SQLite. The actual number is set at compile time and is not easily ...
# -*- coding: utf-8 -*- #!/usr/bin/python2 import math import os import fileinput import sys def countFrequency(fname): """ get the frequency of each byte """ nodeDic = {} if isinstance(fname, list):#work for stdin/stdout part for e in fname: if e in nodeDic.keys(): ...
from random import randint import icontract from django.contrib import messages from django.core.paginator import Paginator from django.shortcuts import render, redirect from rest_framework import viewsets from pharmacies import settings from pharmacies.permission import IsAdminOrReadOnly, IsStaffOrReadOnly, IsStaff ...
# coding: utf8 from decimal import Decimal from django.core.urlresolvers import reverse from django.apps import apps from django.test import TestCase from django.test.client import Client from django.utils import six import mock import getpaid import getpaid.backends.payu from getpaid_test_project.orders.models impor...
import os import sys import math import json import torch import numpy as np import scipy.io from scipy import ndimage import matplotlib # from skimage import io # matplotlib.use("pgf") matplotlib.rcParams.update({ # 'font.family': 'serif', 'font.size':8, }) from matplotlib import pyplot as plt import pytorch...
#!/usr/bin/env python3 from __future__ import annotations """The purpose of this script is to rename fasta headers using regex. The patterns to look for are given as a .csv file with the following organisation: patterns,new_id,new_description, ...
# -*- coding: utf-8 -*- from datetime import datetime, timedelta from django.http import Http404 from django.views.decorators.csrf import ensure_csrf_cookie from django.http import HttpResponseRedirect from django.shortcuts import render_to_response, redirect, HttpResponse, get_object_or_404 from django.template import...
import random import json import csv import numpy as np import os import spacy import regression SRC_FCT_FOLDER_PATH = "human_eval/processed_data/" dataset_meta_info ={ 'dstc6': { 'context':1, 'num_references':1, 'annotations': ['overall'], 'aggregation':np.median}, 'dstc7...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ GarfieltBlog(webpy) is a light weight blog system base on web.py.It is similar to WordPress that provides commonly functions and featurs of a blog system. Homepage and details: http://www.iscsky.net/ Copyright (c) 2012, Garfielt <<EMAIL>>. License: MIT (see ...
# -*- coding: utf-8 -*- # cython: language_level=3 # Copyright (c) 2020 Nekokatt # Copyright (c) 2021-present davfsa # # 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, inc...
#!/usr/bin/env python3 import argparse,parsl,os,sys,glob,shutil from os.path import * from mappertrac.subscripts import * script_dir = abspath(os.path.dirname(os.path.realpath(__file__))) cwd = abspath(os.getcwd()) def parse_args(args): parser = argparse.ArgumentParser() if not '--test' in sys.argv: ...
# -*- coding: utf-8 -*- """ Copyright (c) [2021] Huawei Technologies Co.,Ltd.ALL rights reserved. This program is licensed under Mulan PSL v2. You can use it according to the terms and conditions of the Mulan PSL v2. http://license.coscl.org.cn/MulanPSL2 THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHO...
""" Slow feature analysis <NAME>, <NAME>, and <NAME>, “Slow feature analysis for change detection in multispectral imagery,” IEEE Trans. Geosci. Remote Sens., vol. 52, no. 5, pp. 2858–2874, 2014. This implementation is based on the one available here: https://github.com/I-Hope-Peace/ChangeDetectionRepository/tree/mast...
""" Script updates list of technical tasks in russian Wikipedia. Usage: python techtasks.py """ import re import pywikibot import mwparserfromhell CATEGORY_NAME = "Категория:Википедия:Обсуждения с нерешёнными техническими задачами" TEMPLATE_NAME = "техзадача" DONE_PARAM = "выполнено" SORT_PARAM = "дата" DEFAULT_...
from datetime import datetime from csv import DictReader from math import exp, log, sqrt from pickle import dump, load import gzip from sys import argv, stdout, stderr import random import argparse ############################################################################## # class, function, generator d...
import weakref import collections import typing from ..exceptions import MissingConcept from ..information import Vertex from .concept import Concept, ConceptSet from .instance import Instance from .rule import Rule import logging log = logging.getLogger(__name__) class RelationConceptSet(ConceptSet): """ Holds...
#! /usr/bin/env python3 # PLOTS HOW CABLES LENGTHS VARIATE OVER TIME import os import argparse import subprocess import numpy as np import matplotlib # select matplotlib backend matplotlib.use('pdf') import matplotlib.pyplot as plt def load_configuration(robot_file): """ Read from file robot configuration g...
from __future__ import annotations import json from typing import Union, Optional, Generic, TypeVar, Dict, TYPE_CHECKING, Type, Collection import requests from ravendb import constants from ravendb.documents.conventions.document_conventions import DocumentConventions from ravendb.documents.operations.compare_exchange...
from analysis.jobAnalysis import (get_jobs_data, produce_inter_times, calculate_histogram, calculate_probability_map) from analysis import ProbabilityMap import os class Machine(object): """ Machine class models a system and its workload to...
from __future__ import absolute_import from __future__ import division from __future__ import print_function import copy import torch import torch.nn as nn from torch.autograd import Variable import torch.optim as optim from torch.utils.data import DataLoader import numpy as np import os import time import sys import ...
# Author : <NAME> # Copyright: MIT License # e-mail: <EMAIL> # General import for python and sklearn import pandas as pd import seaborn as sns import numpy as np import time as t import matplotlib.pyplot as plt import itertools import os import warnings from matplotlib.colors import ListedColormap from time import...
################################################################################################################################ # *** Copyright Notice *** # # "Price Based Local Power Distribution Management System (Local Power Distribution Manager) v1.0" # Copyright (c) 2016, The Regents of the University of Calif...
from SimPEG.utils import mkvc, sdiag from SimPEG import props from ...simulation import BaseSimulation from ...base import BasePDESimulation from ..base import BasePFSimulation import scipy.constants as constants from scipy.constants import G as NewtG import numpy as np class Simulation3DIntegral(BasePFSimulation): ...
# -*- coding: utf8 -*- # Author: <NAME> # pylint: disable=redefined-outer-name """Coq integration tests.""" from typing import Generator, List, Tuple from unittest.mock import MagicMock, patch import pytest from coqtop import Coqtop from xmlInterface import XMLInterface, join_tagged_tokens # Test Helpers # # TODO:...
"""This script is a hack which hijacks sys.argv when the arguments are passed by wandb server. It converts them into the format understood by the local scripts and runs the entrypoint for all local scripts""" import sys from copy import deepcopy import re from typing import List, Iterable, Dict, Union, Optional, Calla...
#coding:utf-8 import cv2 import math import numpy as np import os import random import xml.etree.cElementTree as ET import sys #用于抠图。 counts=0 class GEN_Annotations: def __init__(self,filename): self.root=ET.Element("annotation") child1=ET.SubElement(self.root,"folder") child1.text="VOC2012...
""" Peasauce - interactive disassembler Copyright (C) 2012-2017 <NAME> Licensed using the MIT license. """ from dataclasses import dataclass import io import logging import os import struct from typing import Any, IO, List, Optional, Tuple from . import amiga from . import atarist from . import binary fro...
# MIT License # # Copyright (c) 2019 LABSS(<NAME>, <NAME>) # # 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 logging from pathlib import Path from time import sleep from typing import List, Tuple import finviz import numpy as np import pandas as pd import pandas_market_calendars as mcal import pendulum import requests import yfinance as yf from airflow.decorators import dag, task from airflow.models import Variable fr...
import os from functools import partial from pathlib import Path from typing import Dict, List, Optional, Tuple import albumentations as albu import matplotlib.pyplot as plt import numpy as np import pandas as pd import pytorch_lightning as pl from hydra.utils import get_original_cwd from omegaconf import DictConfig, ...
#!/usr/bin/env python import os import glob import yaml from functools import lru_cache import django from django import conf from django.db import transaction import click from utils import (get_data_dir, get_jurisdiction_id, get_all_abbreviations, get_districts, get_settings) try: from yaml imp...
#!/usr/bin/env python3 """ Filename: id3.py Author: <NAME> Course: CS 404 Machine Learning and Data Mining Semester: Spring 2016 Description: The ID3 algorithm Book: Machine Learning: An Algorithmic Perspective Github: https://github.com/GhostofGoes/cgoes-cs404 """ import fileinput import ma...
from collections import Counter import pandas as pd import numpy as np import argparse import json import h5py import sys import os import re PAD_ID, UNK_ID, EOS_ID = [0, 1, 2] def pad_seq(seq, maxlen): if len(seq) < maxlen: seq = np.append(seq, [PAD_ID] * (maxlen - len(seq))) seq = seq[:maxlen].asty...
""" In this project, you'll create a program that calculates the total cost of a customers shopping basket, including shipping. - If a customer spends over $100, they get free shipping - If a customer spends < $100, the shipping cost is $1.20 per kg of the baskets weight Print the customers...
#coding=utf-8 from flask import Blueprint, flash, redirect, render_template, request, url_for, session, send_from_directory, abort from sqlalchemy import desc from . import blueprint from .models import * from main.superadmin.forms import AddTemplateForm,AddTemplateContextForm,AddTemplateCategoryAttrForm from main.u...
import numpy as np import re import array import matplotlib.pyplot as plt from scipy.constants import golden from matplotlib.ticker import NullFormatter from astropy.stats import bootstrap def getSEDs(basepath, temp_filt='photz.tempfilt'): ### Load EAZY stuffs ### with open(temp_filt,'rb') as f: s = a...
#!/usr/bin/env python ''' api.py: Singularity Hub helper functions for python Copyright (c) 2016-2017, <NAME>. All rights reserved. "Singularity" Copyright (c) 2016, The Regents of the University of California, through Lawrence Berkeley National Laboratory (subject to receipt of any required approvals from the U.S....
"""Built-in implementations of rotation systems.""" from typing import ClassVar from tetris.engine.abcs import RotationSystem from tetris.types import Minos from tetris.types import Piece from tetris.types import PieceType KickTable = dict[tuple[int, int], tuple[tuple[int, int], ...]] # pardon class SRS(RotationS...
import argparse import numpy as np import pandas as pd import os import ast import cv2 as cv import glob import matplotlib.pyplot as plt import os import time import tqdm import torch import torch.backends.cudnn as cudnn import torch.nn as nn from torch.utils.data import Dataset, DataLoader, ConcatDataset from torchv...
# Copyright (c), <NAME> <<EMAIL>>, 2016 # This code was copied from Ansible and is licensed under the terms of the BSD license: # # 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 mus...
import time from django.http import HttpResponse, HttpResponseRedirect from django.template import loader from .models import * from forum.models import ForumMember import operator #for sorting objects from different tables in one aggregated list from .forms import UploadSonForm, SubscribeForm from django.shortcuts i...
import asyncio import sys import os import pathlib from contextlib import suppress from collections import deque import random import time import uuid import i2plib import i2plib.utils from kote.fs import load_contacts, save_contacts, load_destination from kote.protocol import MAX_MESSAGE_LENGTH, Message, ValidationE...
import atexit import logging as l import sys import numpy as np from argparse import ArgumentParser from enum import Enum from pathlib import Path from time import sleep, time import RPi.GPIO as GPIO from marcs.CubeSolver.logger import log, set_log_level from marcs.CubeSolver.stepper import Stepper from marcs.RubiksCu...
""" Copyright 2018 Novartis Institutes for BioMedical Research 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 or agr...
'''utils functions, variables ''' import random import readline import numpy as np import torch try: import kornia except ModuleNotFoundError: pass from utils import constant_var def confirm(question='OK to continue?'): """ Ask user to enter Y or N (case-insensitive). :return: True if the answe...
''' MIT License Copyright (c) 2021 <NAME> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distri...
from gen.javaLabeled.JavaLexer import JavaLexer import os try: import understand as und except ImportError as e: print(e) from antlr4 import * from antlr4.TokenStreamRewriter import TokenStreamRewriter from gen.javaLabeled.JavaParserLabeled import JavaParserLabeled from gen.javaLabeled.JavaParserLabeledListe...
# -*- coding: utf-8 -*- """Load models from the native binary format released by Facebook. The main entry point is the :func:`~gensim.models._fasttext_bin.load` function. It returns a :class:`~gensim.models._fasttext_bin.Model` namedtuple containing everything loaded from the binary. Examples -------- Load a model f...
import os, sys import types import typing sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), os.pardir)) import torch import cv2 import time from utils.utils import current_milli_time, ensure_exists from utils.image_utils import imwrite from PIL import Image import numpy as np import segmen...
# coding=utf-8 import codecs import logging import re from collections import defaultdict import io import argparse import os from git import Repo logging.basicConfig(level=logging.INFO) NNO, NOB = 'nno', 'nob' URLS = {NNO: 'https://github.com/UniversalDependencies/UD_Norwegian-Nynorsk', NOB: 'https://githu...
import click import zmq """ defining all of the address bases, from lbox_addr.h """ su704_pre_base = 0x100 su736_dis_base = 0x280 su738_sfp0_base = 0x400 su738_sfp1_base = 0x500 su707_scsn_base = 0x000 class TrdboxCommand: def __init__(self, connect): self.context = zmq.Context() self.socket = se...
# Copyright (c) 2013, jan and contributors # For license information, please see license.txt from __future__ import unicode_literals import frappe from erpnext.stock.stock_ledger import get_previous_sle def get_columns(filters): columns = [ {"label": "Item Code", "fieldname": "item_code", "fieldtype": "Link","opti...
from typing import Optional windows_icon = ":fontawesome-brands-windows:" macos_icon = ":fontawesome-brands-apple:" linux_icon = ":fontawesome-brands-linux:" warning_icon = ":fontawesome-solid-exclamation-triangle:" stop_icon = ":fontawesome-solid-times-circle:" artifacts_url_base = 'https://artifacts.metaborg.org' a...
import logging from typing import Any, Optional, Union, Callable, List import numpy as np import torch import torch.nn as nn import torch.nn.functional as F from torch.utils.data import DataLoader from tqdm.auto import trange from ..backbone import BackBone from ..basemodel import BaseTorchClassModel from ..config im...
import os from copy import deepcopy import torch import cv2 import numpy as np import glob from src.loftr import LoFTR, default_cfg, Pruned_Backbone import pandas as pd def check_validity(mkpts0,mkpts1,H_scaled): total_distance = 0 valid_distance = 0 mask = np.zeros(len(mkpts0)) for j in range(len(mk...
import requests import binascii import time from merkletools import MerkleTools from blockchain_certificates import cred_protocol from blockchain_certificates import network_utils from blockchain_certificates import utils CHAINPOINT_CONTEXT = 'https://w3id.org/chainpoint/v2' CHAINPOINT_HASH_TYPES = {'sha224': 'Chainpo...
import torch import torch.nn as nn import torch.nn.functional as F import torchaudio import warnings from utils import notes_to_pc # following FFT parameters are designed for a 22.5k sampling rate sr = 22050 n_fft = 512 resolution = 256/22050*3 with warnings.catch_warnings(): warnings.simplefilter("ignore") ...
# test_h_style from opyprint import PPContext class Foo: def __str__(self, ppc: PPContext = None): ppc = ppc or PPContext() ppc("A Foo with:") ppc({'k_1': "v_1", 'k_2': "v_2"}, style='cyan') return ppc.flush() def test_ppc_style_1(): ppc = PPContext() # print("#1.1:") ...
import struct import time import os from TLS.protocols import Protocol, versions from TLS.extensions import Extension from TLS.ciphers import Cipher, ciphers_ssl2, ciphers_tls from TLS.constants import HandshakeType, HandshakeTypeSsl2, ContentType, CompressionMethod, NamedCurve from TLS.constants import KeyExchangeAlg...
# # Pix2Pix (https://www.tensorflow.org/alpha/tutorials/generative/pix2pix) import os import time import matplotlib.pyplot as plt import tensorflow as tf from ivory.utils.path import cache_dir # ## Load the dataset _URL = ( "https://people.eecs.berkeley.edu/~tinghuiz/projects/" "pix2pix/datasets/facades.tar...
import time import requests import re import bv_dec_or_enc as bv from GetVideoCID import GetVideoCid from GetVideoTitle import GetVideoTitle from LocalBulitTimeList import LocalBulitTimeList from RemoteBulitTimeList import RemoteBulitTimeList import dm_protobuf.dm_pb2 as dm_pb2 from google.protobuf.json_format import M...
import json from abc import ABC, abstractmethod from argparse import ArgumentParser from collections import OrderedDict from urllib.parse import urlencode import requests from bs4 import BeautifulSoup from pkg_resources import require from prettytable import PrettyTable from termcolor import colored import utils from...
import errno import hashlib import os import re import shutil import sys import tempfile import zipfile import tarfile import warnings import logging from urllib.parse import urlparse from urllib.request import Request, urlopen from tqdm import tqdm from typing import Optional import oneflow as flow HASH_REGEX = re.c...
import subprocess, os, sys import datetime TRAJANJA = {1: 1, 5: 0.95, 10: 0.85} PAKETI = {'velik': 200, 'majhen': 150} ŠTEVILKE = '0123456789' def DANAŠNJI_DATUM(): return str(datetime.datetime.now())[8:10] + '.' + str(datetime.datetime.now())[5:7] + '.' + str(datetime.datetime.now())[:4] def vsebuje_številke(niz...
''' @author: shylent ''' from os import fstat from tftp.errors import Unsupported, FileExists, AccessViolation, FileNotFound from tftp.util import deferred from twisted.python.filepath import FilePath, InsecurePath import shutil import tempfile from zope import interface class IBackend(interface.Interface): """An ...
''' implement the python interface to the SmartBasic cmd manager application ''' import time import logging import sys import re ''' these values work well to connect, usually first or second try ''' CONN_TIMEOUT_MS = 4000 MIN_CONN_INT_US = 7500 MAX_CONN_INT_US = 0 # link supervisor timeout N_SUPER_TOUT_US = 500 MANA...
#!/usr/bin/python # (c) 2018, NetApp, Inc # 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': ['preview'], ...
# -*- coding: utf-8 -*- # # Copyright © 2017 Spyder Project Contributors # Licensed under the terms of the MIT License # (see LICENSE.txt for details) """Model and view classes for storing and displaying test results.""" # Standard library imports from collections import Counter from operator import attrgetter # Thir...
# User Model import jwt import datetime as dt from datetime import datetime from flask_login import UserMixin from werkzeug.security import \ generate_password_hash,\ check_password_hash from sqlalchemy.dialects import sqlite from app import db, app, login_manager, ma from marshmallow import fields class User...
# Copyright 2018 The Exoplanet ML 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 applicable law or agreed t...
import numpy as np """ All of these processors take input in the following format state1 = 2D array state2 = 2D array statePair = np.stack([state1, state2], axis=2) """ """ Preprocessors from pycolab pixel data to feature vector for linear methods. Note that more complex representations c...
# # BSD 3-Clause License # # Copyright (c) 2022 University of Wisconsin - Madison # 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 copyrig...
import os import random from typing import List import numpy as np import pytest from neuraxle.base import ExecutionContext as CX from neuraxle.hyperparams.distributions import (Choice, DistributionMixture, HPSampledValue, ...
import os import re import io from os import devnull import sys from .customized_errors import ParsingError,MultipleMoleculesinSDF,InvalidMoleculeFileExtension from django.conf import settings from subprocess import Popen, PIPE from rdkit.Chem import ForwardSDMolSupplier, AssignAtomChiralTagsFromStructure, MolToSmiles,...
import logging import six import chainer import chainer.functions as F import chainer.links as L import numpy as np from chainer import cuda from espnet.nets.chainer_backend.nets_utils import _subsamplex from espnet.nets.e2e_asr_common import get_vgg2l_odim # TODO(watanabe) explanation of BLSTMP class RNNP(chainer...
# Copyright 2018 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
#===================================================================================================================================== #Copyright #===================================================================================================================================== #Copyright (C) 2017 <NAME>. #This soft...
#!/usr/bin/python from __future__ import print_function, absolute_import ####################################################################### # pyQRC.py # # A Python implementation of Silva and Goodman's QRC approach # # From a Gaussian frequency c...
""" This test is launched as part of the existing tox command It tests the function used to check both the promoter-staging integration job and the functional tests on the promoter Uses standard pytest fixture as a setup/teardown method """ import logging import os import dlrnapi_client import pytest try: impo...
# -*- coding: utf8 -*- import pygame import groups import string import random import assets import xml.etree.ElementTree as ET from colors import * # from assets import assets """ Sisältää tekstin käsittelyyn liittyvät jutut """ num_images = {} last_scores = [0, 0] last_score_images = [None, None] def init_scores()...
import os import errno import argparse import sys import logging import torch import subprocess sys.path.insert(0, os.path.dirname(os.path.abspath(os.path.join(__file__, os.pardir)))) if os.environ.get("ALLENNLP_DEBUG"): LEVEL = logging.DEBUG else: LEVEL = logging.INFO logging.basicConfig(format='%(asctime)s...
# Copyright (C) 2015 <NAME> <<EMAIL>> # # This script is published under the terms of the MIT license. # See http://opensource.org/licenses/mit-license.php # Python 3 is required import itertools from sudoku import Clue class _Data: pass class _Ceil: def __init__(self, data): self.data = data ...
import torch.nn as nn class ContentEncoder(nn.Module): def __init__(self, input_nc=3, nf=64, n_downsampling=3, n_blocks=2): assert(n_blocks >= 0) super(ContentEncoder, self).__init__() self.input_nc = input_nc self.nf = nf self.n_blocks = n_blocks self.n_downsampling...
# Copyright (c) OpenMMLab. All rights reserved. import os.path as osp import random from .builder import DATASETS from .custom import CustomDataset from collections import OrderedDict from mmseg.core import eval_metrics, intersect_and_union, pre_eval_to_metrics import mmcv import numpy as np from mmcv.utils import pr...
import errno import functools import logging from os import devnull, mkdir from os.path import splitext, basename, isdir import sys import warnings import webbrowser from urllib.parse import urlparse import click from server.app.app import Server from server.app.util.errors import ScanpyFileError from server.app.util...
import copy import json import os import unittest from django.core.management import call_command from django.db.models import Count from django.test import TestCase from django.utils.six import StringIO from magic_cards.models import Card, CardSubtype, Printing, Set from magic_cards.utils.import_cards import Everyth...
# STANDARD LIB import asyncio import contextlib import logging import os import queue # EXTERNAL LIB import discord import requests import youtube_dl # LOCAL LIB from ._const import * import pdb def link_valid(link): try: request = requests.head(link) code = request.status_code if (code ...
#! /usr/bin/python3 # -*- coding: utf-8 -*- #-------------------------------------------------------------------------------------------------- # Script to parse English Wiktionary XML stream and make a Japanese-English grossary file # # Usage: # make_wiktionary_gross_jaen.py [--quiet] # (It reads the standard inpu...
# Copyright (c) 2015 Cisco, 2018 NEC, 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...
#!/usr/bin/env python2 # -*- coding: utf-8 -*- # # Author: <NAME> 2018 # http://blog.onlinux.fr # # # Import required Python libraries import os import logging import logging.config from thermostat import Thermostat from thermostat import Constants from hermes_python.hermes import Hermes from snipshelpers.config_pars...