text
stringlengths
2
999k
# -*- coding: utf-8 -*- ################################################################################ ## Form generated from reading UI file 'INTERFACE.ui' ## ## Created by: Qt User Interface Compiler version 5.15.2 ## ## WARNING! All changes made in this file will be lost when recompiling UI file! ########...
#!/usr/bin/env python # Copyright 2018 the Deno authors. All rights reserved. MIT license. # # The Rust compiler normally builds source code directly into an executable. # Internally, object code is produced, and then the (system) linker is called, # but this all happens under the covers. # # However Deno's build syste...
from __future__ import absolute_import, unicode_literals from django import forms from django.contrib.contenttypes.generic import generic_inlineformset_factory from django.contrib.contenttypes.models import ContentType from django.test import TestCase from .models import (TaggedItem, ValuableTaggedItem, Comparison, A...
""" Signals API Collection of endpoints for providing Signal Events, Definitions and Metadata # noqa: E501 The version of the OpenAPI document: 2.4.0 Contact: signals.api@factset.com Generated by: https://openapi-generator.tech """ import re # noqa: F401 import sys # noqa: F401 from fds.sdk....
from math import sqrt def main(): height = float(input("Input your height in meters: ")) weight = float(input("Input your weight in kilogram: ")) print("Your body mass index is: ", round(weight / (height * height), 2)) if __name__ == '__main__': main()
# Copyright 2019, OpenCensus 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 in w...
#!/usr/bin/env python # # 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 "Li...
import json import logging from typing import ( TYPE_CHECKING, Any, ClassVar, Iterator, Mapping, Optional, Union, cast, ) from requests import Response log = logging.getLogger(__name__) if TYPE_CHECKING: import globus_sdk class GlobusHTTPResponse: """ Response object tha...
#!/usr/bin/env python if __name__ == '__main__': import sys from spdx.parsers.tagvalue import Parser from spdx.parsers.loggers import StandardLogger from spdx.parsers.tagvaluebuilders import Builder from spdx.writers.xml import write_document file = sys.argv[1] p = Parser(Builder(), Standa...
#!/usr/bin/env python3 # Copyright (c) 2018-2020 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test RPC help output.""" from test_framework.test_framework import BlinkhashTestFramework from test_fr...
import cv2 as cv import tensorflow as tf import yaml import time import numpy as np from legoassembler.communication import Client from legoassembler.vision import remote_capture from legoassembler.utils import load_config tf.enable_eager_execution() def load_colors(fname): with open(fname, 'r') as f: ...
import logging from string import Template from datetime import date, timedelta from dateutil.relativedelta import relativedelta from babel.numbers import format_number from eco_counter_bot.counters import counters as all_counters from eco_counter_bot.models import CounterData, DataPoint, DateRange, Interval, Yesterd...
from collections import Iterable from mathsat import msat_term, msat_env from mathsat import msat_make_true, msat_make_false from mathsat import msat_make_constant, msat_declare_function from mathsat import msat_get_rational_type from mathsat import msat_make_and as _msat_make_and from mathsat import msat_make_or as _...
""" Copyright (c) 2018-2021 Intel Corporation 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 wri...
#!/usr/bin/env python # -*- coding: utf-8 -*- import sys, json, os, requests, logging, re, threading from .webhook import get, get_list from .parser import parse from pathlib import Path __DEFAULT_FILE__ = '/root/.github_release_notifier/versions' def version_compare(check, current): def normalize(v): r...
import frappe, subprocess, os from six.moves import input def setup_database(force, source_sql, verbose): root_conn = get_root_connection() root_conn.commit() root_conn.sql("DROP DATABASE IF EXISTS `{0}`".format(frappe.conf.db_name)) root_conn.sql("DROP USER IF EXISTS {0}".format(frappe.conf.db_name)) root_conn.s...
import synapse.exc as s_exc import synapse.common as s_common import synapse.tests.utils as s_t_utils from synapse.tests.utils import alist class TelcoModelTest(s_t_utils.SynTest): async def test_telco_simple(self): async with self.getTestCore() as core: typ = core.model.type('tel:mob:mcc') ...
#!/usr/bin/env python3 # # This module requires HatSploit: https://hatsploit.netlify.app # Current source: https://github.com/EntySec/HatSploit # from hatsploit.lib.module import Module from hatsploit.utils.http import HTTPClient class HatSploitModule(Module, HTTPClient): details = { 'Name': "MessageSol...
import cv2 import numpy as numpy import PhotoMagic def addweight(img1,img2,alpha=0.5,beta=0.5,height=None,width=None): if height==None and width==None: height=500 width=800 if height!=None and width==None: width=img1.shape[1] if height==None and width!=None: height=img1.shap...
""" Useful functions for xarray objects 1. joining data arrays to datasets 2. pydantic exentions model of xr.Dataset """ from typing import Any, List import numpy as np import xarray as xr def join_list_dataset_to_batch_dataset(datasets: list[xr.Dataset]) -> xr.Dataset: """Join a list of data sets to a dataset ...
import unittest import io from .utility import CaptureOutput, TestParser def one_str(text: str): pass def two_str(text1: str, text2: str): pass class TestPositional(TestParser): def test_one_str(self): self.assertParsed(one_str, 'foo', {'text': 'foo'}) def test_one_str_error(self): ...
import traceback import ssh_agent_setup import demistomock as demisto # noqa: F401 from CommonServerPython import * # noqa: F401 # Import Generated code from AnsibleApiModule import * # noqa: E402 host_type = 'local' # MAIN FUNCTION def main() -> None: """main function, parses params and runs command functi...
# turtle 海龟 海龟绘图很适合用来引导孩子学习编程。 最初来自于 Wally Feurzeig, Seymour Papert 和 Cynthia Solomon 于 1967 年所创造的 Logo 编程语言。 # import turtle # turtle.forward(150) # 它将(在屏幕上)朝所面对的 x 轴正方向前进 150 像素 # turtle.right(25) # 原地右转 25 度 # https://docs.python.org/zh-cn/3/library/turtle.html from turtle import * color('red', 'yellow') begin_fil...
from app import db class InvitedGuest(db.Model): __tablename__ = "invited_guest" id = db.Column(db.Integer(), primary_key=True) event_id = db.Column(db.Integer(), db.ForeignKey( "event.id"), nullable=False) user_id = db.Column(db.Integer(), db.ForeignKey( "app_user.id"), nullable=Fal...
import requests import urllib3 import time from datetime import datetime import sys def execute_http_requests(serverType, runNr): http_urls = [] http_unsafe_urls = [] http_times = [] if serverType == 'soliot': with open("http_uris_soliot.txt", 'r') as f: for url in f.readlines(): ...
""" Django settings for app project. Generated by 'django-admin startproject' using Django 3.1.1. For more information on this file, see https://docs.djangoproject.com/en/3.1/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/3.1/ref/settings/ """ from pathlib imp...
# -*- coding: utf-8 -*- """Tests for go.vumitools.api.""" import uuid from twisted.internet.defer import inlineCallbacks, returnValue from vumi.tests.helpers import VumiTestCase from vumi.errors import VumiError from go.vumitools.opt_out import OptOutStore from go.vumitools.contact import ContactStore from go.vumi...
'''Graphics ============ ''' from os.path import join, dirname import math from time import perf_counter from functools import partial from inspect import isclass from math import pow, fabs from kivy.lang import Builder from kivy.clock import Clock from kivy.properties import ( NumericProperty, ReferenceListProper...
""" Tests for the insults windowing module, L{twisted.conch.insults.window}. """ from twisted.trial.unittest import TestCase from twisted.conch.insults.window import TopWindow, ScrolledArea, TextOutput class TopWindowTests(TestCase): """ Tests for L{TopWindow}, the root window container class. """ ...
#!/usr/bin/env python """ Copyright 2012 Wordnik, 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 applica...
''' I_TC_1: Network Edge Device (NED) Functional operation 1. User authentication and Attestation: a) Test connection to NED (class test_01) b) Test logging in with invalid username (class test_01) c) Test logging in with invalid password (class test_01) d) Test logging in with valid username and password (class t...
# The MIT License (MIT) # Copyright (c) 2015 Adam Anh Doan Kim Caramés # 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,...
#!/usr/bin/env python # # Electrum - Lightweight Bitcoin Client # Copyright (C) 2015 Thomas Voegtlin # # 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...
"""A simple login system.""" import json #Classes #=============================================================================== class User(object): """A user.""" def __init__(self, name, pswd): """Setup this user.""" self.name = name self.pswd = pswd def __eq__(self, user): ...
import pandas as pd class OpenIE(object): """ Class that represents the data triples from an Information Extraction tool. Attributes: triples (pandas.DataFrame): DataFrame contanining all triples with the following columns: sentence id, triple id (within senten...
import sys import os import re from six import string_types, text_type, PY2 separator = re.compile(r' *[,;] *') if __name__ == "__main__": import docassemble.base.config docassemble.base.config.load(arguments=sys.argv) from docassemble.base.config import daconfig if 'timezone' in daconfig and daconfig[...
#!/usr/bin/env python from __future__ import print_function import sys, argparse, logging __author__ = "Ori Jacobovitz" __version__ = "1.0" def main(args, loglevel): print("Program Started") logging.debug("Arguments: %s" % args) if args.interactive: interactive() def interactive(): help_m...
from aws_cdk import ( core as cdk, aws_ecs as ecs, aws_iam as iam ) from fairflow.constructs.contruct_properties import FairflowChildConstructProps from fairflow.config import ( WORKER_AUTOSCALING_CONFIG, WORKER_CONFIG, WORKER_TASK_CONFIG ) class WorkerConstruct(cdk.Construct): def __init_...
import re import unittest try: from unittest.mock import patch except ImportError: from mock import patch import httpretty from .api import API, process_error_response from . import vk_exceptions class TestExceptions(unittest.TestCase): def test_correct_exception_classes_returned_by_error_code(self): ...
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ...
import sys from data_wrangling.process_data import StockDataAnalysis import datetime as dt import numpy as np import matplotlib.pyplot as plt import pandas as pd from sklearn import preprocessing from sklearn import linear_model from sklearn.ensemble import RandomForestRegressor from sklearn.metrics import mean_squar...
# THIS FILE IS GENERATED FROM TRAITS SETUP.PY version = '5.0.0' full_version = '5.0.0' git_revision = 'Unknown' is_released = True if not is_released: version = full_version
import platform import re import sys from pathlib import Path from setuptools import find_packages, setup def get_requires(): requires = [ "aioredis>=1.1.0, <2.0.0", "dataclasses; python_version < '3.7'", "async-timeout", ] if platform.python_implementation() == "CPython": ...
""" Django settings for djangobackend project. Generated by 'django-admin startproject' using Django 3.1.3. For more information on this file, see https://docs.djangoproject.com/en/3.1/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/3.1/ref/settings/ """ import ...
""" Source localization with MNE/dSPM/sLORETA/eLORETA ================================================= The aim of this tutorial is to teach you how to compute and apply a linear inverse method such as MNE/dSPM/sLORETA/eLORETA on evoked/raw/epochs data. """ import numpy as np import matplotlib.pyplot as plt import mn...
from django.conf import settings from common.services.redis import redisClient import ldclient KEY_PREFIX = 'watchtower:featureflag:' TTL = 60 # seconds # Flag Keys ACCOUNT_BALANCE_TIMINGS = 'accountbalancetiming' LOCAL_ACCOUNT_BALANCES = 'localaccountbalances' ALWAYS_HARD_REFRESH = 'alwayshardrefresh' UNCHAINED_REG...
"""Export resources.""" from .entities import named_fields
import numpy as np import CoolProp.CoolProp as CP #import grafici_termodinamici as gt import grafici_termodinamici_mixture as gt from scipy.optimize import fsolve import compressore as c import matplotlib.pyplot as plt class Funz: def __init__(self,eps,P_gc,T_gc,T_eva,eta_c,eta1,eta2,eta_mix,v,mix,mix_l,mix_g):...
""" Test the hashing module. """ # Author: Gael Varoquaux <gael dot varoquaux at normalesup dot org> # Copyright (c) 2009 Gael Varoquaux # License: BSD Style, 3 clauses. import nose import time import hashlib import tempfile import os import gc import io import collections from ..hashing import hash from ..func_insp...
""" Merge Sort O(nlog(n)) """ def merge_sort(input_array): if len(input_array) == 1: print("{}I{}".format(1, input_array)) return input_array elif len(input_array) == 2: if input_array[0] > input_array[1]: tmp = input_array[1] input_array[1] = input_array[0] ...
# pyre-strict import abc import os import unittest from typing import Generic, Optional, TypeVar class TestDriver(abc.ABC, unittest.TestCase): @classmethod @abc.abstractmethod def setUpClass(cls, template_repo: str) -> None: raise NotImplementedError() @classmethod @abc.abstractmethod ...
#def show(x,y): # return x+y show=lambda x,y:x+y print(show(3,7))
import socket from urllib.parse import urlparse from django import forms from django.conf import settings from django.core.exceptions import ValidationError from django.core.files.base import ContentFile from django.utils.timezone import now from django.utils.translation import ugettext_lazy as _ from hierarkey.forms ...
from typing import DefaultDict, List, Tuple from aoc import AOC from util.functions import digits from util.intcode.mode import Mode class State: def __init__( self, program: DefaultDict[int, int], pointer: int = 0, mode: Mode = Mode.POSITION, ): self.program = program ...
from vidstream import ScreenShareClient from vidstream import CameraClient from vidstream import VideoClient from colorama import Fore import socket as s import time import platform # Choose One os = platform.system() wi="\033[1;37m" #>>White# rd="\033[1;31m" #>Red # gr="\033[1;32m" #>Green # yl="\033[1;33m" #>Yello...
# -*- coding: utf-8 -*- import tempfile from pathlib2 import Path from mock import Mock from nose.tools import eq_ from ....core.storage.storage_test import StrategyCase from ..cryptor_test import generate_cryptor, config_factory from termius.cloud.client.transformers.many import ( BulkTransformer ) from termius.co...
# Copyright 2008-2015 Nokia Networks # Copyright 2016- Robot Framework Foundation # # 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 ...
import argparse import collections import itertools import linecache import matplotlib.pyplot as plt from matplotlib.patches import Polygon import matplotlib.patheffects as PathEffects import numpy as np LOG_PATH = 'log.txt' def parse_code(log, nlines=10): """Pull out code snippet from whatever file""" cod...
""" Testing model and regexp with groups. """ from __future__ import unicode_literals import pytest # noqa import sys from textx import metamodel_from_str if sys.version < '3': text = unicode # noqa else: text = str grammar = r""" Model: entries += Entry; Entry: 'data' '=' data=/(?ms)\"{3}(.*?)\"{3}/ ; ...
""" # SHORTEST UNSORTED CONTINUOUS SUBARRAY Given an integer array nums, you need to find one continuous subarray that if you only sort this subarray in ascending order, then the whole array will be sorted in ascending order. Return the shortest such subarray and output its length. Example 1: Input: nums = [2,6,4,...
def log(msg: str): print('termplayer: ' + msg)
# error.py - Mercurial exceptions # # Copyright 2005-2008 Matt Mackall <mpm@selenic.com> # # This software may be used and distributed according to the terms of the # GNU General Public License version 2 or any later version. """Mercurial exceptions. This allows us to catch exceptions at higher levels without forcing...
""" This example shows connecting to the PN532 and reading the GPIOs. """ import RPi.GPIO as GPIO from pn532 import * pn532 = PN532_SPI(reset=20, cs=4, debug=False) #pn532 = PN532_I2C(debug=False, reset=20, req=16) #pn532 = PN532_UART(reset=20, debug=False) ic, ver, rev, support = pn532.get_firmware_version() print...
import io import datetime import pytest from .util import ClientCase, Group, override_group_id from django.core.management import call_command from django.conf import settings from django.contrib.auth import get_user_model from peeringdb_server.models import REFTAG_MAP, UTC, Network from peeringdb_server.stats impor...
from stacknet.stacknet_funcs.sparse_funcs import from_sparse_to_file from stacknet.stacknet_funcs.datetime_funcs import getTimeFeatures from stacknet.stacknet_funcs.cat_feature_engineering import getCatFeatures
# Copyright 2021 The Kubeflow 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 in...
import numpy as np import scipy import json import sklearn.cross_validation from scipy import sparse from sklearn.feature_extraction.text import CountVectorizer def parse_file(filename): def parse(filename): movies = [] with open(filename) as f: for line in f: obj = js...
# Generated by Django 3.0.4 on 2020-03-19 15:12 from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='Employee', fields=[ ('id', models.AutoField...
#!env python3 # Time-Stamp: <2021-04-20 19:12:36> # Copyright 2021 Sho Iwamoto / Misho # # 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 # Unle...
# Taken from https://michael0x2a.com/blog/turtle-examples from turtle import * for i in range(50): fd(50) rt(144) done()
"""Plot spatial geometries, street networks, and routes.""" from pathlib import Path import matplotlib.cm as cm import matplotlib.colors as colors import matplotlib.pyplot as plt import networkx as nx import numpy as np import pandas as pd from . import graph from . import projection from . import settings from . im...
from typing import List, Set, Optional import nextcord import asyncio from util.function import get_member from util.exception import Forbidden, InvalidArgs, NotFound, ALEDException, BotError from util.decorator import only_owner from .utils import is_arbitre, is_civfr_guild_or_mp from .ReportParser import Report, Gam...
''' This module is for internal use, only. It contains datastore drivers to be used with the session and notification managers. ''' from copy import copy import zlib try: import cPickle as pickle except: import pickle class Driver(object): EXPIRE_SECONDS = 24 * 60 * 60 client = None def _to_dict(...
""" libraries """ import os import gc import re import ast import sys import copy import json import time import math import string import pickle import random import joblib import itertools import warnings from IPython.core.display_functions import display import scipy as sp import numpy as np import pandas as pd from...
from sympy import ( Abs, And, Derivative, Dummy, Eq, Float, Function, Gt, I, Integral, LambertW, Lt, Matrix, Or, Poly, Q, Rational, S, Symbol, Ne, Wild, acos, asin, atan, atanh, cos, cosh, diff, erf, erfinv, erfc, erfcinv, exp, im, log, pi, re, sec, sin, sinh, solve, solve_linear, sqrt, sstr, symbol...
import datetime import os import shutil import tempfile import unittest import nixio as nix import odml from nixodmlconverter import convert document_attributes = ['author', 'version', 'date', 'repository'] section_attributes = ['name', 'oid', 'definition', 'type', 'reference', 'repository', # ...
# Generated by Django 3.1.3 on 2020-11-30 23:58 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('earns', '0002_auto_20201130_2056'), ] operations = [ migrations.AlterField( model_name='earns', name='long_term', ...
""" CORE MARKDOWN BLOCKPARSER =========================================================================== This parser handles basic parsing of Markdown blocks. It doesn't concern itself with inline elements such as **bold** or *italics*, but rather just catches blocks, lists, quotes, etc. The BlockParser is made up ...
# coding: utf-8 from __future__ import absolute_import from __future__ import division from __future__ import print_function import glob import logging import os import setproctitle import shutil import json import sys import socket import subprocess import tempfile import time import numpy as np import pickle import...
import AppKit from PyObjCTools.TestSupport import TestCase, min_os_level import objc class TestNSDocumentController(TestCase): def testMethods(self): self.assertArgIsBOOL( AppKit.NSDocumentController.openUntitledDocumentAndDisplay_error_, 0 ) self.assertArgIsOut( Ap...
# -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: proto/bb_backend/go.chromium.org/luci/common/proto/srcman/manifest.proto """Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.pr...
import re import subprocess import sys import os.path as osp class Video(object): def __init__(self, path, max_frames=100, pic_name="frame-%03d.jpeg"): self.path = path self.max_frames = max_frames self.pic_name = pic_name def number_of_frames(path): # http://superuser.com/...
from typing import List, Optional import uvicorn from fastapi import FastAPI, Depends, Query, Body from pydantic import SecretStr from fastapi_keycloak import FastAPIKeycloak, OIDCUser, UsernamePassword, HTTPMethod, KeycloakUser, KeycloakGroup app = FastAPI() idp = FastAPIKeycloak( server_url="http://localhost:8...
# coding: utf-8 """ AYLIEN News API The AYLIEN News API is the most powerful way of sourcing, searching and syndicating analyzed and enriched news content. It is accessed by sending HTTP requests to our server, which returns information to your client. # noqa: E501 The version of the OpenAPI document: ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # This material is part of "The Fuzzing Book". # Web site: https://www.fuzzingbook.org/html/WebFuzzer.html # Last change: 2020-01-21 11:03:22+01:00 # #!/ # Copyright (c) 2018-2020 CISPA, Saarland University, authors, and contributors # # Permission is hereby granted, free...
# -*- coding: utf-8 -*- def capital_search_bank_number(self, account_number): """获取对私银行卡号开户银行 :param account_number: 银行卡号,示例值:'1234567890123' """ from urllib.parse import urlencode params = {} params.update({'account_number': self._core.encrypt(account_number)}) path = '/v3/capital/capital...
# -*- coding: utf-8 -*- # Generated by Django 1.11.15 on 2018-09-07 09:32 from __future__ import unicode_literals from django.db import migrations, connection from bluebottle.utils.utils import update_group_permissions from bluebottle.clients import properties from bluebottle.clients.models import Client from bluebo...
import numpy as np from .constants import * from .ais import R as R_AIS from .ais import Phi as A_AIS from .ais import C as C_AIS C_RADAR = np.array([[1.0, 0, 0, 0], [0, 1.0, 0, 0]], dtype=defaultType) H_radar = C_RADAR p = 2.5**2 # Initial system state variance P0 = np.array(np.diag([p, p, 0.3*p...
import abc __author__ = "Yves Auad" class Aperture_Controller(abc.ABC): def __init__(self): pass @abc.abstractmethod def set_val(self, which, value): """ Set the value of the correspondent aperture. """ @abc.abstractmethod def get_val(self, which): """ ...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models # Create your models here. class Bin(models.Model): binID = models.IntegerField() geoLocation = models.TextField(max_length=420, default='None') binStatus = models.IntegerField(default=0, ) requestUrgent = mo...
from __future__ import unicode_literals try: from django.utils.encoding import smart_unicode except ImportError: # Python 3 from django.utils.encoding import smart_text as smart_unicode try: from django.utils.timezone import localtime except ImportError: def localtime(value): return value ...
#!/usr/bin/env python # -*- coding: utf-8 -*- # Convenience wrapper for running Mountain directly from source tree. from mountain.mountain import main if __name__ == '__main__': main()
from backend.system.dao import BaseDao from backend.system.model import BaseModel from typing import ClassVar, Tuple, List, Dict, Any from backend.system.schema import DeleteSchema class BaseService(object): dao_cls: ClassVar = BaseDao def __init__(self): self._dao = self.dao_cls() @property ...
from rest_framework.compat import smart_text, urlparse from rest_framework.fields import get_attribute, empty, Field from rest_framework.reverse import reverse from rest_framework.utils import html from django.core.exceptions import ObjectDoesNotExist, ImproperlyConfigured from django.core.urlresolvers import resolve, ...
from tests.base import BaseTestCase from binpacking.solver.factory import Factory class FactoryTest(BaseTestCase): def test_factory_csp_backtracking(self) -> None: config = { "seed": 0, "dataStructure": "Domains", "OptimizationAlgorithm": "Backtracking", "B...
# Copyright 2019 Xanadu Quantum Technologies 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 agre...
from module_constants import * from header_items import * from header_operations import * from header_triggers import * import header_debug as dbg import header_lazy_evaluation as lazy #################################################################################################################### # Each ...
import logging from nfsinkhole.tests import TestCommon from nfsinkhole.apparmor import AppArmor from nfsinkhole.utils import popen_wrapper LOG_FORMAT = ('[%(asctime)s] [%(levelname)s] [%(filename)s:%(lineno)s] ' '[%(funcName)s()] %(message)s') logging.basicConfig(level=logging.DEBUG, format=LOG_FORMAT) l...
import os from dataclasses import dataclass, field TRANQL_SOURCE: str = "/graph/gamma/quick" @dataclass class Config: """ TODO: Populate description """ elastic_password: str = "changeme" redis_password: str = "changeme" elastic_host: str = "elasticsearch" elastic_port: int = 9200 ...
from collections.abc import Iterable from .solver import Solver, VarType, Parameter, default_parameters from .solution import Solution, Status from cplex import Cplex, infinity, SparsePair import sys from math import inf from warnings import warn def infinity_fix(val): if val == inf: return infinity ...