text
stringlengths
8.04k
46.5k
#+= imports =+# import sys import os import time if sys.version_info < (3, 8): os.system('cls' if os.name == 'nt' else 'clear') print('[Warning] Your version of Python is lower than the recommended Python version') print('This program officially supports Python version 3.8 and higher') print(sys.version_inf...
import os from dataclasses import dataclass, asdict from neural_compilers.utils.tokenization import GCC from typing import * import logging import time import uuid import git from bleu import list_bleu from neural_compilers.utils.tokenization import PygmentsTokenizer import lizard import re, itertools from copy import ...
import torch import torch.nn.functional as F import numpy as np ''' Rotation Converter This function is borrowed from https://github.com/kornia/kornia ref: https://kornia.readthedocs.io/en/v0.1.2/_modules/torchgeometry/core/conversions.html# Repre: euler angle(3), axis angle(3), rotation matrix(3x3), quaternion(4...
import os.path import logging import pandas as pd import numpy as np import re from datetime import date, timedelta from dotenv import find_dotenv, load_dotenv from PIL import Image, ImageFilter from src.enum.PlotType import PlotType def main(project_dir): ''' main method ''' # get logger logger ...
import unittest from nose.tools import assert_equal, assert_list_equal, nottest, raises from py_stringmatching.tokenizer.delimiter_tokenizer import DelimiterTokenizer from py_stringmatching.tokenizer.qgram_tokenizer import QgramTokenizer import pandas as pd from py_stringsimjoin.filter.suffix_filter import SuffixFilt...
# Copyright 2021 The TensorFlow 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 applica...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Copyright (c) 2013 <NAME> <<EMAIL>> # # 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 ...
from collections import OrderedDict import os, sys import astropy.io.fits as fits from astropy.nddata import NDData import numpy as np import matplotlib.pyplot as plt import scipy.interpolate as sciint import logging _log = logging.getLogger('webbpsf') from . import conf _DISABLE_FILE_LOGGING_VALUE = 'none' _Stre...
# coding: utf-8 from datetime import datetime, timedelta from re import compile from openerp import SUPERUSER_ID from openerp.osv import fields, osv from documentos_discente import _MESES class Registro(osv.Model): _name = "ud.monitoria.registro" _description = u"Modelo de configuração e registro de semestr...
import copy import logging import math import os import re import shutil import time from itertools import cycle from typing import Union import torch import torch.nn as nn from torch.nn import BCEWithLogitsLoss, KLDivLoss from torch.nn.functional import log_softmax from torch.nn.parallel import DataParallel from torc...
"""The implementation of a Hera task for Argo workflows""" import copy import inspect import json import textwrap from typing import Any, Callable, Dict, List, Optional, Set, Union from argo_workflows.model_utils import ( ApiTypeError, ModelSimple, cached_property, convert_js_args_to_python_args, ) fr...
#!/usr/bin/env python3 from itertools import combinations import networkx as nx import numpy as np from causallearn.graph.Edge import Edge from causallearn.graph.Endpoint import Endpoint from causallearn.graph.GeneralGraph import GeneralGraph from causallearn.graph.Graph import Graph from causallearn.utils.GraphUtils...
"""Program listening to the UDP Broadcast from a WeatherFlow Weather Station and publishing sensor data to MQTT. """ import json from typing import OrderedDict import paho.mqtt.client as mqtt import asyncio import logging import time from datetime import datetime import sys import os from weatherflow2mqtt.aioud...
""" Based on https://github.com/rusty1s/pytorch_geometric/blob/master/torch_geometric/nn/conv/message_passing.py MIT License Copyright (c) 2020 <NAME> <<EMAIL>> Copyright (c) 2021 The CWN Project Authors Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated docu...
# -*- coding: utf-8 -*- #%% Module for doing curve tracing with OpenCV import numpy as np import cv2 import math #%% Arrowboard defines geometry of 'arrow' shape for generation and extrapolation class ArrowBoard: def __init__(self): self.board_rows = 7 self.board_cols = 7 # triplets of id,...
#!/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 from copy import deepcopy from typing import Dict, List, Optional, Set, Tuple from .cache import Cache, CacheEntry from .constants import ConstantCo...
# -*- coding: utf-8 -*- """ This script loads the PhoREAL GUI which executes getAtlMeasuredSwath_auto.py Copyright 2019 Applied Research Laboratories, University of Texas at Austin This package is free software; the copyright holder gives unlimited permission to copy and/or distribute, with or without modifica...
#!/usr/bin/env python2 from __future__ import print_function import pygame from pygame.locals import * import sys import random import copy WINDOW_WIDTH = 640 WINDOW_HEIGHT = 480 BOARD_WIDTH = 7 BOARD_HEIGHT = 7 ROTATE_TIME = 3 BLACK = (0, 0, 0) WHITE = (255, 255, 255) RED = (250, 0, 0) GREEN = (0, 255, 0) BLUE = (...
#!/usr/bin/python # -*- coding: utf-8 -*- ################################################################################ # # RMG - Reaction Mechanism Generator # # Copyright (c) 2002-2017 Prof. <NAME> (<EMAIL>), # Prof. <NAME> (<EMAIL>) and the RMG Team (<EMAIL>) # # Permission is hereby granted, free of ch...
from dataset.pycocotools.coco import COCO from dataset.pycocotools import mask as maskUtils import numpy as np import cv2 import os import colorsys import random import skimage from skimage import morphology from skimage.measure import find_contours from matplotlib.patches import PathPatch from matplotlib.path import P...
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Created on Wed Mar 29 15:57:42 2017 @author: robert """ import scapy from scapy.all import IP, UDP,TCP import logging from . import mono_tools from . import mono_packet from . import mono_constant as mc from mono import mono_packet_conversation as mono_pc import ...
# -*- coding: utf-8 -*- # python-holidays # --------------- # A fast, efficient Python library for generating country, province and state # specific sets of holidays on the fly. It aims to make determining whether a # specific date is a holiday as fast and flexible as possible. # # Authors: dr-prodigy <<EMAIL>> ...
# ---------------------------------------------------------------------------- # Copyright (c) 2017-2020, QIIME 2 development team. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file LICENSE, distributed with this software. # ------------------------------------------------...
import argparse import os import numpy as np from tqdm import tqdm import json from mypath import Path from dataloaders import make_data_loader from dataloaders.custom_transforms import denormalizeimage from modeling.sync_batchnorm.replicate import patch_replication_callback from modeling.deeplab import * from utils.l...
#!/usr/bin/python3 """ Perform Ordering-Dependency (OD) and Task-Consistency (TC) method. Composed by <NAME> @THU_IVG Last revision: <NAME> @THU_IVG @Oct 3rd, 2019 CST """ import argparse import os.path import pickle as pkl import json import scipy.io as sio import numpy as np import itertools import concurrent.fut...
# -*- coding: utf-8 -*- import io import xlsxwriter from flask_login import current_user from flask import abort, current_app, make_response, redirect, \ render_template, request, session, url_for, flash, Response from dmutils.formats import DateFormatter from dmutils.forms import DmForm, render_template_with_cs...
import csv import logging import os import uuid import subprocess import json import jwt from os import listdir from os.path import isfile, join from pathlib import Path from typing import List import time from common.OfflineDeal import OfflineDeal from common.config import read_config from common.swan_client import Sw...
""" Module for bulk-exporting IsisCB data. The strategy here is to favor extensibility/flexibility in defining output columns, at the expense of performance. The performance hit is probably OK, since these jobs will be performed asynchronously. """ from __future__ import print_function from __future__ import unicode_l...
import matplotlib import matplotlib.pyplot as plt import NURBS import math import numpy import random from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg from tkinter import Grid, Tk, Canvas, VERTICAL, FALSE, Spinbox, LEFT, BOTH, YES, N, S, E, W, END import tkinter.ttk as ttk matplotlib.use('TkAgg') # UI...
"""Testing strategy for dynamic testing via folder structure.""" # Python import os import re import sys import glob import json import logging import inspect import pathlib import argparse import traceback import importlib from unittest.mock import Mock # pyATS from pyats import aetest from pyats.easypy import run f...
# Copyright(c) 2015-2018 Association of Universities for Research in Astronomy, Inc. # by <NAME>. # Draft module to execute IRAF tasks with PyRAF. # This works quite well but could do with refactoring for modularity after # growing a bit ... erm ... organically as the the concept has been sketched # out and features ...
""" Code for compressing and decompressing using Huffman compression. """ from nodes import HuffmanNode, ReadNode # ==================== # Helper functions for manipulating bytes def get_bit(byte, bit_num): """ Return bit number bit_num from right in byte. @param int byte: a given byte ...
import numpy as np import os import h5py import json from .utils import asymptotic_error_quantile, bootstrap,\ dict_to_margins, margins_to_dict, matrix_to_list from sklearn.utils import check_random_state from scipy.stats import gaussian_kde, norm from .vinecopula import Conversion class ListDependenceResult(li...
from JumpScale import j # from SpecModelactorsGenerator import SpecModelactorsGenerator class Specbase(j.tools.code.classGetBase()): def __init__(self, linenr): self.name = "" self.description = "" self.tags = "" self.comment = "" self.linenr = linenr def addDefaults(...
import networkx as nx from networkx.utils import pairwise import math from tsp_christofides import christofides_tsp import numpy as np import itertools import os import json from itertools import combinations, groupby import random as rd import numpy as np def get_underlay_graph(underlay_name='gaia', upl...
# Resource object code (Python 3) # Created by: object code # Created by: The Resource Compiler for Qt version 5.15.0 # WARNING! All changes made in this file will be lost! from PySide2 import QtCore qt_resource_data = b"\ \x00\x00\x152\ <\ ?xml version=\x221.\ 0\x22 encoding=\x22UTF\ -8\x22 standalone=\x22\ no\x22?>...
import logging import time from typing import Dict, Optional import numpy as np from pymatgen.core.structure import Structure from pymatgen.electronic_structure.core import Spin from pymatgen.util.coord import pbc_diff """ 6-------7 /| /| / | / | 4-------5 | | 2----|--3 | / | / |/ ...
"""Database interface for the qrscp application. Unique Keys ----------- * At each level one attribute is unique * A unique key shall uniquely identify a single instance at a given level * Unique keys **may** be in a C-FIND request's Identifier * Unique keys **shall** be in a C-MOVE or C-GET request's Identifier * C-F...
from __future__ import absolute_import from __future__ import division from __future__ import print_function from six.moves import xrange from collections import namedtuple, OrderedDict import tensorflow as tf from tensorflow.python.training import moving_averages _BATCH_NORM_DECAY = 0.9 #0.997 _BATCH_NORM_EPSILON = ...
""" Algorithms to solve Sudoku on a (k*k)^2 size grid, for varying sizes of k Author: <NAME> Student ID: 12547190 Algorithms implemented: - Propagation - Satisfiability (SAT) solver encoding with PySAT https://github.com/pysathq/pysat - Constraint Satisfaction Probl...
import ops.utils import networkx as nx import pandas as pd import numpy as np import scipy.spatial.kdtree from collections import Counter from scipy.spatial.distance import cdist from scipy.interpolate import UnivariateSpline from statsmodels.stats.multitest import multipletests def format_stats_wide(df_stats): ...
""" DISCLAIMER The Software and code samples available on this repository are provided "as is" without warranty of any kind, either express or implied. Use at your own risk. Original source code can be found at: https://github.com/marcosimioni/omigood Contributors - <NAME> - <NAME> - <NAME> """ import sys import l...
"""PyTypes wrappers.""" import abc from collections import deque from enum import Enum, unique from collections import abc as abc_coll from rustypy.type_checkers import prev_to_37 from .ffi_defs import * c_backend = get_rs_lib() class MissingTypeHint(TypeError): pass @unique class PyEquivType(Enum): Stri...
# external imports import numpy as np import matplotlib.pyplot as plt from scipy.linalg import block_diag # internal inputs from pympc.dynamics.discrete_time_systems import AffineSystem, PieceWiseAffineSystem from pympc.optimization.parametric_programs import MultiParametricQuadraticProgram, MultiParametricMixedIntege...
import os import asyncio import subprocess import datetime import json import re import random import numpy as np import tensorflow as tf from mrts_rl import DQNAgent import common.utils as utils HOST = '127.0.0.1' PORT = 9898 # connection counter conn_count = 0 # remember the player for each connection conn_player...
# Copyright 1999-2021 Alibaba Group Holding Ltd. # # 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 a...
# cashierAccount from Tkinter import * import tkMessageBox , ttk , pickle , datetime , re class NegativeError(Exception) : pass class PositiveError(Exception) : pass class iteminfo(object): def __init__(self): self.icode = StringVar() self.item = StringVar() self.p...
import torch import torch.nn as nn import torch.nn.functional as F from typing import Union, List, Dict, Any, cast import numpy as np from copy import deepcopy import math from hilbert import decode, encode from pyzorder import ZOrderIndexer from timm.data import IMAGENET_DEFAULT_MEAN, IMAGENET_DEFAULT_STD from .help...
from __future__ import annotations import igraph import copy import numpy from typing import List from dataclasses import dataclass, field def observed_graph(g): """ Constructs a subgraph containing only observed edges :param g: Input graph :return: Subgraph containing only observed edges """ ...
import math import os import re import logging import torch from torch import nn from torch.nn import CrossEntropyLoss, MSELoss from typing import Any, Callable, Dict, List, Optional, Set, Tuple, Union def swish(x): return x * torch.sigmoid(x) def gelu(x): """ """ return x * 0.5 * (1.0 + torch.erf(x /...
#!/usr/bin/env python # coding: utf-8 import sys import argparse from datetime import datetime import math import pandas as pd from numpy.random import default_rng import simpy from pathlib import Path class VaccineClinic(object): def __init__(self, env, num_greeters, num_reg_staff, num_vaccinators, num_schedul...
import numpy as np import cv2 import math ############################## # # # ### RBox gt ### # # # ############################## def rbox2poly(rboxes): ctr_x = rboxes[:, 0:1] ctr_y = rboxes[:, 1:2] width = rboxes[:, 2:3] height = rbo...
# coding=utf-8 import json import base64 import datetime import time import re from django.contrib.auth.decorators import login_required from django.shortcuts import render_to_response from django.template.context import RequestContext from django.http import HttpResponse, HttpResponseRedirect, HttpResponseNotFound f...
""" This class implements Gromov-Wasserstein Optimal Transport. Several parts are copied from Alvarez-Melis and Jaakkola (2018) and adapted to the use at hand. """ import numpy as np import scipy as sp import matplotlib.pyplot as plt import ot from otalign.src import gw_optim from typing import List, Dict, Tuple, A...
import os, glob, warnings import numpy as np from collections import OrderedDict from typing import Union, Dict, List from pygromos.files import imd, repdat from pygromos.utils import bash import reeds.function_libs.analysis.free_energy import reeds.function_libs.analysis.parameter_optimization import reeds.function...
import datetime import json import locale import os import re import traceback from flask_babel import _, lazy_gettext as _l from web import app from web.actions import worker as w, mapping from common.config import globals from common.utils import converters, fiat # Treat *.plot files smaller than this as in-transi...
import os import pprint import re import click import yaml from flask.cli import FlaskGroup from networkx import draw, has_path from g2p import make_g2p from g2p._version import VERSION from g2p.api import update_docs from g2p.app import APP, network_to_echart from g2p.exceptions import MappingMissing from g2p.log im...
"""General functions for mathematical and numerical operations. Functions --------- - spline - Create a general spline interpolation function. - cumtrapz_loglog - Perform a cumulative integral in log-log space. - extend - Extend the given array by extraplation. - sa...
import numpy as np import time IP = [58, 50, 42, 34, 26, 18, 10, 2, 60, 52, 44, 36, 28, 20, 12, 4, 62, 54, 46, 38, 30, 22, 14, 6, 64, 56, 48, 40, 32, 24, 16, 8, 57, 49, 41, 33, 25, 17, 9, 1, 59, 51, 43, 35, 27, 19, 11, 3, 61, 53, 45, 37, 29, 21, 13, 5, 63, 55, 47, 39, 31, 23, ...
# This work was created by participants in the DataONE project, and is # jointly copyrighted by participating institutions in DataONE. For # more information on DataONE, see our web site at http://dataone.org. # # Copyright 2009-2019 DataONE # # Licensed under the Apache License, Version 2.0 (the "License"); # you ma...
#!/usr/bin/python # Some of the user elements are from the user_sessions.py script # made by <NAME> and <NAME> # Other parts of the script from Paul Bowden's scripts found on his Github # # To enable the msupdate parts: # sudo defaults write org.munkireport.ms_office msupdate_check_enabled -bool true import subproce...
# -*- coding: utf-8 -*- # Created on Feb 17, 2013 # Last updated on September 22, 2016 # @author: <NAME> import os import re import _file_utils as utils import inspect import unicodedata from copy import deepcopy from itertools import chain class HierarchyManager: def __init__(self, text_path, header_regex, ta...
""" Toronto Waste Wizard skill for Alexa (c) 2018 Laumoda Inc """ from __future__ import print_function import urllib.request import csv from datetime import datetime, timedelta import json from dateutil import tz import calendar import codecs import re import logging import string import shapefile from shapely.geomet...
import os import numpy as np import gzip import pickle from pathlib import Path from proseco.core import StarsTable import pytest from proseco import get_aca_catalog from proseco.characteristics import aca_t_ccd_penalty_limit, MonFunc, MonCoord import agasc from Quaternion import Quat import Ska.Sun from proseco.test...
#!/usr/bin/env python # # Copyright (C) 2021 Vy # # Distributed under terms of the MIT license. """ An AWS Lambda function for collecting and reporting metrics associated with AWS Step Functions state machines. """ from concurrent.futures import ThreadPoolExecutor as PoolExecutor from timeit import default_timer as ti...
import numpy as np import pandas as pd import matplotlib.pyplot as plt import seaborn as sns import math from sklearn.preprocessing import MinMaxScaler from sklearn.cluster import DBSCAN class ClusterBound: def __init__(self, x1, y1, w, h): self.x1 = x1 self.x2 = x1 + w self.y1 = y1 ...
import tensorflow as tf from utils.reprocessing import create_queue from tensorflow.contrib.framework import nest def linear(args, output_size, bias, bias_start=0.0): """Linear map: sum_i(args[i] * W[i]), where W[i] is a variable. Args: args: a 2D Tensor or a list of 2D, batch x n, Tensors. o...
import os import errno import numpy as np import pandas as pd import splitfolders import pathlib import torch import torchaudio import zipfile import glob import fnmatch from ast import literal_eval # old xeno canto functions import requests import json from collections import Counter import csv from torchvision.util...
#!/usr/bin/env python # -*- coding: utf-8 -*- #from Vision.vision import Vision from utils import * import rospy import sys import numpy as np import tf from geometry_msgs.msg import PoseStamped import json from std_msgs.msg import String from std_msgs.msg import Float32, Int64 from robobreizh.msg import CloudIndexed...
""" Migrate the DOAJ to index-per-type; migrating application and journal types, copies others directly. Adds 'type' to every record, which is the model __type__ (necessary for index-per-type) Source index (sconn) MUST be index-per-project, based on config from settings.py (or overrides): ELASTIC_SEARCH_HOST E...
import pytest from pg13 import pgmock, sqparse2, pg, sqex, pgmock_dbapi2, table def prep(create_stmt): "helper for table setup" tables=pgmock.TablesDict() tables.apply_sql(sqparse2.parse(create_stmt),(),None) def runsql(stmt,vals=()): return tables.apply_sql(sqparse2.parse(stmt),vals,None) return tables,runs...
import copy import xml.etree.ElementTree as ET from xml.dom import minidom from collections import defaultdict import numpy as np from PyQt5.QtCore import QObject, pyqtSignal, Qt from urh import constants from urh.awre.FormatFinder import FormatFinder from urh.cythonext import signalFunctions from urh.cythonext.signa...
"""ElementWorld experiment script """ import os import tqdm import pickle import random import argparse import warnings import numpy as np from sacred import Experiment from sacred.observers import MongoObserver from pprint import pprint from datetime import datetime from concurrent import futures from unimodal_ir...
__author__ = 'alexander' from lingvodoc.exceptions import CommonException from lingvodoc.models import ( BaseGroup, Client, DBSession, DictionaryPerspective, Group, LexicalEntry, User, Entity, Field, PublishingEntity, ObjectTOC ) from sqlalchemy import ( func, or_, ...
import json import sys import threading as th import time from io import open from os import path from serial.serialutil import SerialException from modi2_firmware_updater.util.message_util import parse_message, unpack_data from modi2_firmware_updater.util.modi_winusb.modi_serialport import ModiSerialPort, list_modi_...
import itertools from enum import auto, Enum from typing import Union, Optional, List, Sequence, Set, Tuple, Generic, TypeVar import numpy as np from webdnn.util import json from webdnn.util.misc import mul class PlaceholderOperator(Enum): Add = auto() # v1 + v2 Mul = auto() # v1 * v2 Mod = auto() # ...
from collections import Iterable from dataclasses import dataclass import numpy as np from mlib.boot.lang import cn, enum, is_non_str_itr, isdict, isinstsafe, isitr, islist, isnumber, isstr, istuple, will_break_numpy enable_debug = False def roll(aa): import random ll = len(aa) i = random.randint(0, ll ...
#!/usr/bin/env python3 # -*- coding: UTF-8 -*- import traceback,math LOGLEVEL={0:"DEBUG",1:"INFO",2:"WARN",3:"ERR",4:"FATAL"} def log(msg,l=1,end="\n"): st=traceback.extract_stack()[-2] lstr=LOGLEVEL[l] now_str="%s %03d"%(time.strftime("%y/%m/%d %H:%M:%S",time.localtime()),math.modf(time.time())[0]*1000) ...
r""" lists ~~~~~ The `lists` module contains standard collections based on Python lists. Included collections are :class:`List` and :class:`Deque`. Each collection stores its values in a Redis `list <http://redis.io/commands#list>`_ structure. .. note:: If you need to store mutable values like :class:`list`\s or ...
# 대신증권 API # 주식 주문 체결 실시간 처리 예제 # 주문 체결 데이터를 받아 처리 하는 샘플 코드입니다. # # 설명: # 주식 한 종목의 매수/정정/취소 주문 처리 및 실시간 시세와 주문 체결 처리 예제 # > 매수주문 - 현재가/10차 호가를 구해 10차 호가로 매수 주문 냄 # > 정정주문 - 누를 때 마다 호가를 9차 > 8차 > 7차 매수호가식으로 올려 정정주문 (가격은 실시간으로 업데이트 된 가격임) # > 취소주문 - 취소 주문 # # CpEvent: 실시간 현재가 수신 클래스 - 아래 3가지 실시간 시...
# ##### 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...
""" Solve Tolman-Oppenheimer-Volkoff equations with ode from scipy TOV equations are (3.6a-f) in Damour & Esposito-Farese 1996 * Note: this script is using cgs units - From "Einstein units" to cgs units, one needs the following replacements - tilde_epsilon * (G/C^4) -> e - tilde_p * (G...
"""Configuration tree classes. This module contains the classes that make up the resulting PyRADS configuration object. In particular the :class:`rads.config.tree.Config` class. """ from abc import ABC, abstractmethod from dataclasses import dataclass, field from datetime import datetime from numbers import Integral...
''' Classes for sparse vectors, lists of related tensors and tensors describing molecular graphs ''' from __future__ import division, print_function, absolute_import import numpy as np import pickle as pkl from .utils import mol_dims_to_shapes, mol_shapes_to_dims class SparseTensor(object): ''' An immutable clas...
from typing import Optional from QuickProject import * from QuickProject import __sub_path from rich.prompt import Prompt templateProjectUrls_not_CN = { 'c': ['https://github.com/Rhythmicc/QproCTemplate.git', 'QproCTemplate'], 'cpp': ['https://github.com/Rhythmicc/QproCppTemplate.git', 'QproCppTemplate'], ...
#coding:utf8 from sqlalchemy import Column, Integer, String, create_engine, Date, Boolean from sqlalchemy.ext.declarative import declarative_base Base = declarative_base() class WorkTicket_Class_One(Base): __tablename__ = 'BUSS_WORK_TICKET_1' WORK_WRITE_ID = Column('WORK_WRITE_ID', String(50), primary_ke...
#!/usr/bin/python import csv import os import rpm import shutil import subprocess import sys import getopt class BinPackage(object): def __init__(self, path, ts): fdno = os.open(path, os.O_RDONLY) hdr = ts.hdrFromFdno(path) os.close(fdno) self.source = hdr[rpm.RPMTAG_SOURCERPM] ...
#################### text base version of Stupid Card Game #################### # Python 2.7 # By <NAME> # ============================================================================= # Welcome to SCG. This is a card game I learned about from my Sister-in-Law's #Family. They affectionatly refered to i...
""" Orbitscalc Copyright 2021 <NAME> Licensed under the Apache License, Version 2.0 """ from orbitscalc.general_utility import data_with_unit, average_time, format_time, merge_sort from orbitscalc.models import Link from orbitscalc.errors import ContactRetrieveTimeError, AddContactChronologicalError from enum import E...
#!/usr/bin/env python3 # --------------------------------------- import argparse import configparser import os import shutil import subprocess from pprint import pprint from time import sleep import i3ipc import i3_swallow rootMark = "root" masterMark = "master" slaveMark = "slave" class I3MasterConfig(object): ...
import warnings import numpy as np from bitstring import Bits def _byte_array_to_bit_list(arr): """Converts a byte array into a list of the corresponding bits Example: b'123' -> [0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0, 1, 1] Args: arr (bytes): The bytes to conve...
#%% # %load_ext autoreload # %autoreload 2 """ app.py ====== Main Lambda function code for QPCR Analyzer. The Lambda entry point is the function handler() below. Flow ---- 1. handler() 1. Get settings from the event, and download all input and config files 2. Run QPCRUpdater on all input files if remote_ta...
# -*- coding: utf-8 -*- """ .. invisible: _ _ _____ _ _____ _____ | | | | ___| | | ___/ ___| | | | | |__ | | | |__ \ `--. | | | | __|| | | __| `--. \ \ \_/ / |___| |___| |___/\__/ / \___/\____/\_____|____/\____/ Created on Dec 4, 2013 Unit test for pooling layer forward prop...
import numpy as np def get_data(model_type, TRAIN, words, EMB, enforce_gen, n_side_pixl): import numpy as np EMBEDDINGS, OBJ_ctr_sd_enf_gen = {}, [] # 0. Get dictionary of ALL our embedding words EMB_dict = build_emb_dict(words, EMB) # 1. Get the RELEVANT training instances (filtering for 'predi...
# Copyright (c) 2016,2017 MetPy Developers. # Distributed under the terms of the BSD 3-Clause License. # SPDX-License-Identifier: BSD-3-Clause """Contains a collection of generally useful calculation tools.""" import functools import warnings import numpy as np import numpy.ma as ma from scipy.spatial import cKDTree ...
from __future__ import absolute_import from __future__ import division from __future__ import print_function import math import os from copy import deepcopy import builtins import tensorflow as tf from trident.models.pretrained_utils import _make_recovery_model_include_top from trident.backend.common import * from tr...
# -------------------------------------------------------------------------------------------------------------------- # # standard distribution imports # ----------------------------- import logging import os from copy import deepcopy from abc import abstractmethod, ABCMeta # additional module imports (> requirements...
# -*- coding: UTF-8 -*- import datetime from random import shuffle from nose.tools import eq_, raises, assert_raises from pivottable import ( PivotTable, GroupBy, Sum ) from pivottable.pivottable import PivotTableError class TestError(Exception): pass class DummyData(object): def __init__(self, team, city, ...
#!/usr/bin/env python3 # Copyright 2020-present NAVER Corp. Under BSD 3-clause license """ Script to import a RIO10 model into a kapture. The RGB-D Dataset RIO10 data structure is defined here: https://github.com/WaldJohannaU/RIO10#dataformat Sequence seq<scene_id>_01 is always the training sequence (with *.color...
# -*- coding: utf-8 -*- """ Main file for SEIR model """ from . import school_closure # DEBUG - dev_utils decorator from . import dev_utils dev_utils.decorate_all_in_module(school_closure, dev_utils.base_decorator) import numpy as np import pandas as pd import datetime as dt from scipy import stats np...