content
stringlengths
5
1.05M
import re from datetime import datetime from typing import List from . import Command from ...config import get_config_value from ...plugins.actions import ActionPlugin from ...utils.cyclic_list import CyclicList from ...utils.time_utils import is_it_late, is_today_a_workday, next_workday, now, next_workday_string, DA...
import os from shutil import copyfile import shutil base_folder = "Data_raw/house_test/" to_folder = "Data_raw/house_single_test/" fw_train = open(to_folder+"train.txt", "w+") fw_test = open(to_folder+"test.txt", "w+") total_count = 0 for name in os.listdir(base_folder): idx_count = 0 if not name.startswith(".") an...
import visualpriors import torch from config.config import device def mid_level_representations(input_image_tensor, representation_names): """ :param input_image_tensor: (batch_size, 3, 256, 256) :param representation_names: list :return: concatted image tensor to pass into FCN (batch_size, 8*len(re...
"""Main module.""" import csv import logging from io import StringIO from .client import CellarTrackerClient from .enum import CellarTrackerFormat, CellarTrackerTable _LOGGER = logging.getLogger(__name__) class CellarTracker(object): """ CellarTracker is the class handling the CellarTracker data export. ...
import json import pandas as pd import argparse import script_util as su import scipy.stats as st def compute_scores(summary_df, fc, bc): alpha = 0.05 summary_df["wald_reject"] = (summary_df["wald_p"].astype(float) < alpha).astype(int) summary_df["cmh_reject"] = (summary_df["cmh_p"].astype(float) < alph...
from saien import login_manager from saien.models import User from flask_login import current_user @login_manager.user_loader def load_user(user): if user is not None: return User.query.get(user) return None @login_manager.unauthorized_handler def unauthorized(): return "NO PERMISSION"...
import os from argparse import ArgumentParser, Namespace from pprint import pformat from urllib.parse import urlparse import numpy as np import pandas as pd import torch from attr import asdict from allrank.click_models.click_utils import click_on_slates from allrank.config import Config from allrank.data.dataset_loa...
# Copyright 2018 D-Wave Systems 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 o...
import hashlib def hashData(data: str) -> str: hashobj = hashlib.sha1(data.encode()) digest = hashobj.hexdigest() return digest d = hashData("This is my testing string") print(d) # hashlib.sha256(data.encode())
class NumberingException(Exception): pass
############################################################################# # # # CSS Style webGenFramework module to BFA c7 # # ############################################################################# """ This is a CSS style module for a simple HTML/JS/CSS generator/framework with the purpose of maintaining t...
import sys import os from os.path import join as pjoin import json import shutil from os import makedirs from textwrap import dedent from nose.tools import eq_, ok_ from .utils import (temp_working_dir, temp_working_dir_fixture, assert_raises, cat) from ..fileutils import touch from .. import buil...
from django.contrib import admin # Register your models here. from .models import Notion, NotionLike class NotionLikeAdmin(admin.TabularInline): model = NotionLike class NotionAdmin(admin.ModelAdmin): list_display = ['__str__', 'user'] search_fields = ['user__username', 'user__email'] class Meta: ...
from datetime import datetime import tensorflow as tf flags = tf.app.flags flags.DEFINE_string('DATA_PATH', "dataset/DATA_FILE_PATH", "") flags.DEFINE_string('LABEL_PATH', "dataset/LABEL_FILE_PATH", "") flags.DEFINE_string('DICT_PATH', "dictionary/DICT_FILE_PATH", "") flags.DEFINE_integer('VOCAB_SIZE', 20000, '') f...
# PyTrace: Prototyping iterative raytracing from math import sqrt import time class vec3: '3d vector class' def __init__(self, x = 0, y = 0, z = 0): self.x = x self.y = y self.z = z # settting new coordinates to vector def set(self, x, y, z): self.x = x ...
import wx import re from Properties import * from DynamicDialog import * class ChoiceWidget: def __init__(self, property): self.property = property self.isChecked = False def CreateWidget(self, parentFrame): box = wx.BoxSizer(wx.HORIZONTAL) checkId = wx.NewId() control = wx.Chec...
import urllib.parse import urllib.request import sys import socket import re def Main(): host = "67.222.1.194" port = 80 mysocket = socket.socket() mysocket.connect((host, port)) message = input("->") while message != 'q': mysocket.send(message.encode()) ...
# -*- coding: utf-8 -*- from __future__ import (absolute_import, division, print_function) import os from .. import Backend if os.environ.get('SYM_STRICT_TESTING', '0')[:1].lower() in ('1', 't'): AVAILABLE_BACKENDS = list(Backend.backends) else: AVAILABLE_BACKENDS = [] for k in Backend.backends: ...
"""WizardKit: repairs module init""" # vim: sts=2 sw=2 ts=2 import platform if platform.system() == 'Windows': from . import win
import torch import argparse def parameter_setup(): parser = argparse.ArgumentParser() # Training Parameters parser.add_argument("-p", "--pretrain", help="Turn on training model from scratch", action="store_true", ...
from pathlib import Path import pytest from hyperstyle.src.python.review.application_config import LanguageVersion from analysis.src.python.evaluation.common.pandas_util import ( equal_df, filter_df_by_language, get_solutions_df_by_file_path, ) from analysis.test.python.evaluation import PANDAS_UTIL_DIR_PATH from ...
import torch import os import glob from torch.utils.data import Dataset import numpy as np from PIL import Image from torchvision import transforms from monoscene.data.utils.helpers import ( vox2pix, compute_local_frustums, compute_CP_mega_matrix, ) class KittiDataset(Dataset): def __init__( s...
# # PySNMP MIB module HP-PROCURVE-420-PRIVATE-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/HP-PROCURVE-420-PRIVATE-MIB # Produced by pysmi-0.3.4 at Wed May 1 13:36:10 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python versio...
#!/usr/bin/env python """ Usage: python split_sequences_by_domain.py input_taxa_file input_fasta_to_split output_16S_fasta output_18S_fasta """ from sys import argv from cogent.parse.fasta import MinimalFastaParser input_taxa = open(argv[1], "U") input_fasta = open(argv[2], "U") output_bact_arch = open(argv[3], "w...
import numpy as np import pandas as pd import time, datetime #df_train = pd.read_csv('train_data/train_task_1_2.csv') answer_sorted = pd.read_csv('answer_metadata_sorted_1_2.csv') answer_sorted = np.array(answer_sorted) answer_dict = {} count = 0 quiz_dict = {} for item in answer_sorted: count+=1 ...
# -*- coding: utf-8 -*- """Predicting the price of house.ipynb Automatically generated by Colaboratory. Original file is located at https://colab.research.google.com/drive/1Xz1nrYtWKSFwecExkEnfzDlWIcdT2CK0 <h1>Predicting the price of house</h1> """ # Commented out IPython magic to ensure Python compatibility. i...
from pyspark.sql.functions import ( count, first, grouping, mean, stddev, covar_pop, variance, coalesce, sum as spark_sum, min as spark_min, max as spark_max ) __all__ = [ "SparkMethods", "ClassType", "ClassName", "InstanceError", "FormatRead", "PathWrite", "FormatW...
#!/usr/bin/env python3 # 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. from ..autograd_cryptensor import AutogradCrypTensor from .module import Module class _Loss(Module): """ Bas...
#!/usr/bin/env python # -*- coding: utf-8 -*- """Tests for the fake file system implementation.""" import unittest from dfvfs.path import fake_path_spec from dfvfs.resolver import context from dfvfs.vfs import fake_file_system from tests import test_lib as shared_test_lib class FakeFileSystemTest(shared_test_lib.B...
#!/usr/bin/python3 #=========================== begin_copyright_notice ============================ # # Copyright (c) 2020-2021 Intel Corporation # # 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 Sof...
# This is an additional feature for LCD in Ardupy on Wio Terminal class LCD_print: def __init__(self, lcd, font_size, bg_color=None, fg_color=None): self.prints = [] self.pl = 10 * font_size # Per line has 10 pixels height per font size self.lcd = lcd if bg_color == None: ...
# Copyright 2014 Amazon.com, Inc. or its affiliates. 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. A copy of # the License is located at # # https://aws.amazon.com/apache2.0/ # # or in the "license" file accomp...
# # voice-skill-sdk # # (C) 2020, Deutsche Telekom AG # # This file is distributed under the terms of the MIT license. # For details see the file LICENSE in the top directory. # # # Type hints processing # import inspect import logging from typing import AbstractSet, Any, Callable, Dict, List, Optional, Tuple, Type, ...
"""Contains utilities that extend the Django framework.""" from django.db import models class PycontModel(models.Model): """Base model for the entire application, adding created_at and last_updated_at columns.""" class Meta: """Make it abstract.""" abstract = True created_at = models.Da...
# The RenderPasses and UI code are kept in this file to make it executable in Blender without the need to install it as addon. import bpy import os import sys import random from mathutils import Vector class RenderPasses: COMBINED = 'Combined' ALPHA = 'Alpha' DEPTH = 'Depth' MIST = 'Mist' NORMAL = 'Normal...
import numpy as np import functions.kernel.conv_kernel as convKernel import tensorflow as tf def kernel_bspline_r4(): kernel_r4 = convKernel.convDownsampleKernel('bspline', 3, 15, normalizeKernel=1) kernel_r4 = np.expand_dims(kernel_r4, -1) kernel_r4 = np.expand_dims(kernel_r4, -1) kernel_r4 = tf.cons...
def render_graph_GBufferRT(): loadRenderPassLibrary("GBuffer.dll") tracer = RenderGraph("RtGbuffer") tracer.addPass(RenderPass("GBufferRT"), "GBufferRT") tracer.markOutput("GBufferRT.posW") tracer.markOutput("GBufferRT.normW") tracer.markOutput("GBufferRT.bitangentW") tracer.markOutput...
import warnings from typing import Any, Callable, Dict, List import numpy as np from gym.spaces import Box, Dict from multiworld.core.multitask_env import MultitaskEnv from rlkit import pythonplusplus as ppp from rlkit.core.distribution import DictDistribution from rlkit.envs.contextual import ContextualRewardFn from...
import hydra from omegaconf import DictConfig from src.toxic.data.data_module import DataModule from src.toxic.modelling.model import Model from src.toxic.training import Trainer from src.toxic.utils.random import set_seed @hydra.main(config_path='conf', config_name='config') def train(config: DictConfig): set_s...
import os HERE = os.path.abspath(os.path.dirname(__file__)) TEMPLATES_DIR = os.path.join(HERE, "templates")
from easydict import EasyDict as edict cfg = edict() cfg.nid = 1000 cfg.arch = "osnet_ain" # "osnet" or "res50-fc512" cfg.loadmodel = "trackers/weights/osnet_ain_x1_0_msmt17_256x128_amsgrad_ep50_lr0.0015_coslr_b64_fb10_softmax_labsmth_flip_jitter.pth" cfg.frame_rate = 30 cfg.track_buffer = 240 cfg.conf_thres =...
import re from collections import Counter, OrderedDict from poetics.patterning import assign_letters_to_dict ######################################################################################################################## # Tokenizing #########################################################################...
# -*- coding: utf-8 -*- # 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 "Lic...
import copy def main(): n, m = map(int, input().split()) bars = sorted(map(int, input().split())) dp = [[0] * (m + 1) for _ in range(2)] idx = 0 idx_prev = 1 for i in range(n): bar = bars[i] dp[idx] = copy.copy(dp[idx_prev]) for j in range(bar, m + 1): ...
# # PySNMP MIB module TPLINK-PROXYARP-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/TPLINK-PROXYARP-MIB # Produced by pysmi-0.3.4 at Wed May 1 15:25:41 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default...
# 3rd party from nose.plugins.attrib import attr # Agent from checks import AgentCheck from tests.checks.common import AgentCheckTest @attr(requires='gearman') class GearmanTestCase(AgentCheckTest): CHECK_NAME = "gearmand" def test_metrics(self): tags = ['first_tag', 'second_tag'] service_ch...
#!/usr/bin/env python # -*- coding:UTF-8 -*- # Server that adds an object to the database import rospy from object_recognition_core.db import models from object_recognition_core.db.tools import args_to_db_params import object_recognition_core.db.tools as dbtools import couchdb from ork_interface.srv import * DEFAU...
import numpy as np import pandas as pd from sklearn.metrics import r2_score from scipy.stats import norm def PICP(posterior, data, CI): final = pd.read_csv(posterior) final.set_index('Unnamed: 0', inplace=True) observed = pd.read_csv(data) upper_ci = (100-(100-CI)/2)/100 lower_ci = ((100-CI)/...
# Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under t...
from models.worker.macro_cnn_worker import MacroCNN, MacroCNNlight __all__ = ['MacroCNN', 'MacroCNNlight'] def get_worker(args, architecture=None) : if args.task_type == 'vision' : if args.worker_type == 'macro' : if args.controller == 'enas' : worker = MacroCNN(args, architecture) elif args.controller...
#Import Libraries from sklearn.datasets import load_breast_cancer from sklearn.model_selection import train_test_split from sklearn.linear_model import LogisticRegression from sklearn.metrics import confusion_matrix import seaborn as sns import matplotlib.pyplot as plt from sklearn.metrics import accuracy_score from sk...
# Exercício 1 - Crie uma estrutura que pergunte ao usuário qual o dia da semana. Se o dia for igual a Domingo ou # igual a sábado, imprima na tela "Hoje é dia de descanso", caso contrário imprima na tela "Você precisa trabalhar!" """ dia = str(input("Qual dia da semana é hoje? ")).lower() if dia == "sabado" or dia == "...
import asab class MinimailerService(asab.Service): def __init__(self, app, service_name="minimailer.MinimailerService"): super().__init__(app, service_name) # Key-value registry of mailers # where key is a user-defined mailer id # and value a MailerEngine id self.MailerRegistry = {} def register_mailer...
from elasticsearch import Elasticsearch, TransportError, RequestsHttpConnection from elasticsearch.helpers import streaming_bulk import certifi import time import getopt import sys import csv csv.field_size_limit(sys.maxsize) help = """ This python utility helps with uploading CSV files of any size to Elasticsearch. ...
from .this_file import function_name, other_function from ... top.middle.lower.filename import Class1, Class2 import pytest def test_alive(): """ Does our test file even run """ pass def test_function_name_exists(): """ can we see the basic function """ assert function_name @pytest.fixtur...
"""Test module for primary command line interface.""" import sys import unittest from unittest.mock import patch from io import StringIO from pylint_fail_under.__main__ import main class _MockPylintLinter: # pylint: disable=too-few-public-methods def __init__(self, score): self.stats = {"global_note":...
""" P(ssh = down | state = ok) = 0 P(ssh = up | state = ok) = 1 """ """ Determine the state based on the indicators """ def analyze(status): if not status['SSH'] and status['REASON'] == 'Not responding' and status['POWER'] == 'on': return 'NODE_KILLED_IPMI_ON' if not status['SSH'] and status['REASON'] ...
#!/usr/bin/env python3 # Copyright 2020 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...
""" Created By : Ubaidullah Effendi-Emjedi LinkedIn : Icon By : https://www.flaticon.com/authors/freepik """ import sys from PyQt5.QtGui import QIcon from PyQt5.QtWidgets import QApplication, QAction, qApp, QFileDialog from checksum import * from pyqt_creator import * class checksum_window(QMainWindow): """ ...
from freemium.tests import * from freemium.tests import Session, metadata class TestElixir(TestModel): def setUp(self): TestModel.setUp(self) def test_metadata(self): assert 'A collection of Tables and their associated schema constructs.' in metadata.__doc__ def test_session(self): ...
class Solution: def gcdOfStrings(self, str1: str, str2: str) -> str: n = math.gcd(len(str1), len(str2)) if str1 + str2 == str2 + str1: return str1[:n] return ''
# --------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # --------------------------------------------------------- from azure.ai.ml.constants import AutoMLConstants from azure.ai.ml._schema.automl.image_vertical.image_vertical import ImageVerticalSchema ...
from flask_appbuilder import Model from sqlalchemy import Table, Column, Integer, ForeignKey from sqlalchemy.orm import relationship from sqlalchemy.ext.declarative import declarative_base Base = declarative_base() from . import appbuilder, db """ You can use the extra Flask-AppBuilder fields and Mixin's AuditMixi...
# /bin/env python3 python3 main.py # Author: otonroad # Date: Dec. 2020 # Version: 1.0 # License: MIT # this is the main file of the project # Importing the libraries from translate import Translator, translate import os import requests from selenium import webdriver from time import sleep def get_html_snapshot(nam...
import django_filters from graphene_django.filter import GlobalIDMultipleChoiceFilter from ...shipping.models import ShippingZone from ..channel.types import Channel from ..core.types import FilterInputObjectType from ..utils import resolve_global_ids_to_primary_keys from ..utils.filters import filter_fields_containin...
# Importing the required modules from termcolor import colored from.get import get # The function to get your own balance def balance(currency_module) -> None: """ This function is used to get your own current balance, i.e, get the number of tokens that you hold. """ details = get(currency_module) ...
# coding: utf-8 """ Hydrogen Integration API The Hydrogen Integration API # noqa: E501 OpenAPI spec version: 1.3.1 Contact: info@hydrogenplatform.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ import pprint import re # noqa: F401 import six from integration_api.con...
import os import sys import glob import cc3d import pandas as pd import numpy as np import itertools sys.path.insert(0, os.path.abspath('../')) from core.metrics import numpy_soft_dice_coeff from core.generator import get_onehot_labelmap, get_unique_patient_finger_list from contextlib import redirect_stdout from cnn.c...
# Reference to https://github.com/AntonKueltz/fastecdsa from binascii import hexlify from os import urandom from typing import Callable, Tuple from cipher.curve import Curve, Point def gen_keypair(curve: Curve, randfunc: Callable = None) -> Tuple[int, Point]: randfunc = randfunc or urandom private_key = gen...
import unittest from django.test import TestCase from book.models import Book from model_mommy import mommy from .random_string_generator import random_string_generator from .unique_slug_field_generator import unique_slug_generator class TestStringMethods(TestCase): def test_random_string_generator_with_default_l...
"""Endpoint for submitting new tests and viewing results.""" import base64 import json import logging import os import urllib from ..shared import http, decorators, mongo, users, core, common from . import validators import azure.functions as func from bson import ObjectId import cerberus from jose import jws @deco...
import numpy as np # used to handle all the multi dimensional arrays within the picture import cv2 img = cv2.imread('scene_jpg.jpg', 1) # used to read an colourful image cv2.imshow('Original', img) # to display image cv2.waitKey(0) cv2.destroyAllWindows()
# ****************************************************************************** # Copyright (C) 2020-2021 Habana Labs, Ltd. an Intel Company # ****************************************************************************** import argparse import os def default_dataset_dir(dataset_dirs): for dir in dataset_dirs: ...
__author__ = 'Shaban Hassan [shaban00]' from typing import Callable, Dict, List from flask import Flask from flask_restful import Api, Resource from flask_socketio import SocketIO def add_api_resource(resource: Resource, urls: tuple, endpoint: str, api: Api) -> None: urls = tuple([f"/api/v1/{route}" for route in...
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'TranslatedEmailTemplate' db.create_table(u'post_office_tr...
# # PySNMP MIB module NTWS-SYSTEM-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/NTWS-SYSTEM-MIB # Produced by pysmi-0.3.4 at Wed May 1 14:25:49 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Mar 27...
# Generated by Django 4.0.3 on 2022-03-21 06:44 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='Address', fields=[ ...
from pprint import pprint from optparse import OptionParser from settings import load_env_variables from MixcloudSpider import LeftoSpider from TracklistParser import prepare_spotify_search from SpotifyPlaylistManager import search_track import spotipy.util as util import spotipy parser = OptionParser() parser.add_opt...
import discord import time client = discord.Client() prefixes = ["!qt",";;","!","!b"] @client.event async def on_ready(): print("The bot is ready!") def test_prefixes(message_content): if len(message_content) <= 2: return False if len(message_content) >= 3: if message_content[:1] == "!": ...
from .Account import Account from .User import User
from __future__ import print_function, absolute_import import netCDF4 import numpy import xarray as xr import pytest from hypothesis import given from hypothesis.strategies import text from tests.conftest import tmpnetcdf_filename as get_tmpnetcdf_filename import string from datacube.model import Variable from datacu...
#!/usr/bin/env python # Retrieved from http://ecdsa.org/ecdsa.py on 2011-10-17. # Thanks to ThomasV. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the # License, o...
import pytest from django.utils.timezone import now, timedelta from discount.models import Discount @pytest.mark.django_db def test_discount_model(): discount = Discount(code="DIS20", value=5, description="Some discount", created=now(), ended=now() + timedelta(days=2)) discount.save()...
import sys from PySide6.QtWidgets import QApplication from todo.main_window import MainWindow def main(): app = QApplication(sys.argv) mainWin = MainWindow() mainWin.show() sys.exit(app.exec_()) if __name__ == '__main__': main()
#!/usr/bin/env python """ """ import vtk def main(): colors = vtk.vtkNamedColors() fileName = get_program_parameters() # Read the image. readerFactory = vtk.vtkImageReader2Factory() reader = readerFactory.CreateImageReader2(fileName) reader.SetFileName(fileName) reader.Update() ca...
"""Test state getters for retrieving geometry views of state.""" import pytest from decoy import Decoy from typing import cast from opentrons.calibration_storage.helpers import uri_from_details from opentrons_shared_data.deck.dev_types import DeckDefinitionV2 from opentrons.protocols.models import LabwareDefinition fr...
# Copyright (c) 2018 The Regents of the University of Michigan # All rights reserved. # This software is licensed under the BSD 3-Clause License. from __future__ import absolute_import import unittest import os import io import warnings import logging import uuid import copy import random import json from contextlib im...
#!/bin/python3 import sys arr = [float(arr_i) for arr_i in input().strip().split(' ')] mean1 = arr[0] mean2 = arr[1] print(round(160+40*(mean1+mean1**2), 3)) print(round(128+40*(mean2+mean2**2), 3))
import numpy as np """ Attributes: n_units: int Number of units in the layer W: n_units_in_prev_layer * n_units_in_this_layer numpy array Weights of this layer b: n_units_in_current_layer * 1 numpy array biases of this layer activation: activation object activation_name: string Name of activation fun...
# -*- coding: utf-8 -*- # Resource object code # # Created: pt. sie 29 14:02:38 2014 # by: The Resource Compiler for PyQt (Qt v4.8.2) # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore qt_resource_data = b"\ \x00\x00\x07\xb3\ \x89\ \x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\...
from os import name from utilities import MODULE_CONTEXT, userutils from db import get_db from utilities import UserUtils from .response import post_error from datetime import datetime, timedelta from utilities import UserUtils, normalize_bson_to_json import time import config from config import USR_KEY_MONGO_COLLECTIO...
# -*- coding: utf-8 -*- # Generated by Django 1.10.3 on 2016-11-27 00:03 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('recipes', '0026_merge_20161127_0003'), ] operations = [ migrations.RemoveFi...
"""Read hosts from LSF.""" import re from subprocess import Popen, PIPE, check_output def parseval(val): """Parse a value that could be int, float, % or contain a memory unit.""" if val == "-": return None if re.match("\d+$", val): return int(val) if re.match("\d+(.\d+)?([eE][+-]\d+)?...
import factory from .models import DelStavbe from .models import Stavba from .models import Skupina from .models import Podskupina from .models import ProjektnoMesto class StavbaFactory(factory.DjangoModelFactory): class Meta: model = Stavba oznaka = factory.Sequence(lambda n: '{0}'.format(n)) ...
from sst.actions import * go_to('http://seleniumhq.org/') assert_title('Selenium - Web Browser Automation')
from basicobject import BasicObject, BasicObjectEncoder from odinconfigparser import OdinConfigParser from asthelpers import AsteriskHelper
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # FOGLAMP_BEGIN # See: http://foglamp.readthedocs.io/ # FOGLAMP_END """ Common module for the interaction with OSI OCS (OSIsoft Cloud Services) """ import requests import json __author__ = "Stefano Simonelli" __copyright__ = "Copyright (c) 2018 OSIsoft, LLC" __license_...
# -*- coding: utf-8 -*- class EscapeAlEscape(object): def solve(self, input_log): all_ones = all([bool(int(i)) for i in input_log]) all_zeroes = all([not bool(int(i)) for i in input_log]) if all_ones or all_zeroes: sep_long = 1 else: sep_long = ((len(input_...
# Generated by Django 2.1.2 on 2018-11-04 16:16 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('game_catalog', '0010_auto_20181104_1036'), ] operations = [ migrations.RemoveField( model_name=...
''' import random ## random choice will choose 1 option from the list randnum = random.choice(['True', 'False']) print(randnum) ''' class Enemy: def __init__(self): pass self.health = health self.attack = attack def health(self): pass def attack(self): pass class Player(Enemy): d...