src
stringlengths
721
1.04M
__author__ = 'dstrohl' from AdvConfigMgr.utils.base_utils import list_in_list # =============================================================================== # Flag Manager # =============================================================================== class FlagList(object): def __init__(self): se...
# Copyright 2013 IBM Corp. # # 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...
# jhbuild - a tool to ease building collections of source packages # Copyright (C) 2001-2006 James Henstridge # # testmodule.py: testmodule type definitions. # # 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 Soft...
"""A board is a list of list of str. For example, the board ANTT XSOB is represented as the list [['A', 'N', 'T', 'T'], ['X', 'S', 'O', 'B']] A word list is a list of str. For example, the list of words ANT BOX SOB TO is represented as the list ['ANT', 'BOX', 'SOB', 'TO'] """ def is_v...
# -*- coding: utf-8 -*- # _srp.py # Copyright (C) 2015 LEAP # # 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 3 of the License, or # (at your option) any later version. # # This p...
from query_all import Query_All import modular, sigure, subtree from collections import OrderedDict import functools import operator import re re_escape = r'([+&|!(){}[\]"~*?:\\^-])' re_qvar = r'\bqvar\b' class Query: solr_url_math = '' n_row = 0 def __init__(self, solrurlmath, nrow): self.solr_u...
import random import string import os import platform # Defining the text file containing the list of words WORDLIST_FILENAME = "words.txt" MAX_GUESSES = 8 def loadWords(): # Returns a list of valid words. Words are taken from the file words.txt print "Loading word list from file..." # Open file for ...
# -*- coding: utf-8 -*- """ $Id: polynomials.py 629 2010-08-23 16:53:06Z sumpfralle $ Copyright 2008 Lode Leroy This file is part of PyCAM. PyCAM is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3...
""" WSGI config for fresh_life project. This module contains the WSGI application used by Django's development server and any production WSGI deployments. It should expose a module-level variable named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover this application via the ``WSGI_APPLICATION...
import time import numpy as np from .. import defaultParameters as dp def hausdorffDim(a, epsilon=2): """ #codes from # hausdorffDimensionTest.py # http://en.wikipedia.org/wiki/Hausdorff_dimension # http://en.wikipedia.org/wiki/Minkowski-Bouligand_dimension """ dims = [] a...
'''OpenGL extension ARB.robustness_isolation This module customises the behaviour of the OpenGL.raw.GL.ARB.robustness_isolation to provide a more Python-friendly API Overview (from the spec) GL_ARB_robustness and supporting window system extensions allow creating an OpenGL context supporting graphics reset noti...
# Generated by Django 2.2.4 on 2020-03-26 19:49 from django.db import migrations, models import economy.models class Migration(migrations.Migration): dependencies = [ ('avatar', '0008_auto_20200301_2047'), ] operations = [ migrations.CreateModel( name='AvatarTextOverlayInput...
#!/usr/bin/env python #coding=utf-8 ''' Definition of Action class. In AMREAGER, an action can be either 'shift', 'reduce', 'rarc' or 'larc'. When it's a shift, the argument is the subgraph triggered by the token. When it's a reduce, the argument is used to specify the optional reeentrant edge to create. For rarcs and...
from PySide import QtCore, QtGui from .query_widgets import QueryWidget from .results_widgets import ResultsWidget from . import app_config class Tabs(QtGui.QTabWidget): def __init__(self, parent=None): super().__init__(parent) self.tabBar().tabCloseRequested.connect(self.close_tab) def clos...
#!/usr/bin/env python # Convenience script to issue MySQL queries to the DB import cgi, cgitb import sys cgitb.enable() from common import * # ===================================== def showBadLogin(): print '<br><strong>You must have the proper credentials to access this page!</strong>' print '</body></html...
# -*- coding: utf-8 -*- import os import shutil import tempfile import unittest import logging import time from pprint import pprint import mock from mock import MagicMock import AnkiServer from AnkiServer.collection import CollectionManager from AnkiServer.apps.rest_app import RestApp, RestHandlerRequest, Collectio...
import os import sys import pexpect import pytest from .base import TempAppDirTestCase from .utils import get_http_prompt_path from http_prompt import config class TestInteraction(TempAppDirTestCase): def setUp(self): super(TestInteraction, self).setUp() # Use temporary directory as user confi...
import unittest import pytest from PyQt5 import QtGui from brown.core import brown from brown.interface.font_interface import FontInterface from brown.utils.units import Unit class MockUnit(Unit): CONVERSION_RATE = 0.5 class TestFontInterface(unittest.TestCase): def setUp(self): brown.setup() ...
# Copyright (C) 2013-2016 DNAnexus, Inc. # # This file is part of dx-toolkit (DNAnexus platform client libraries). # # 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.a...
# -*- coding: utf-8 -*- """ equip.analysis.block ~~~~~~~~~~~~~~~~~~~~ Basic block for the bytecode. :copyright: (c) 2014 by Romain Gaucher (@rgaucher) :license: Apache 2, see LICENSE for more details. """ from .ast import Statement class BasicBlock(object): """ Represents a basic block from the byte...
#!/usr/bin/python3 # apt-forktracer - a utility for managing package versions # Copyright (C) 2008,2010,2019 Marcin Owsiany <porridge@debian.org> # # 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...
import os, json, collections, copy from datetime import datetime, date from decimal import Decimal, InvalidOperation, DivisionByZero from django.db import models from django.db.models.signals import post_save from django.conf import settings from django.utils.html import mark_safe from django.core.files.storage impor...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ @author: zengchunyun """ from core.userverify import UserVerify from core.MyServer import MyServer from core.game import Soldier, MagicMaster import shelve import logging import time host, port = "0.0.0.0", 9999 # 定义服务器监听端口 connect_database = shelve.open("../databas...
import dsz.version.checks import dsz.lp import dsz.version import dsz.ui import dsz.path import dsz.file import dsz.control import dsz.menu import dsz.env tool = 'StLa' version = '1.2.0.1' resDir = dsz.lp.GetResourcesDirectory() logdir = dsz.lp.GetLogsDirectory() STLA_PATH = ('%s%s' % (resDir, tool)) def stlaverify(i...
import unittest from distance import WorkshopLevelInfos from distance.printing import PrintContext from . import common from .common import check_exceptions class Version0Test(unittest.TestCase): LEVEL_IDS = [469806096, 822049253, 738529116, 753242700, 819617632, 837765551, 895852129, 920857185, 922165443, 9233...
# methods are created using the def keyword and brackets def first_method (): print("I'm the first method") # methods are called as expected first_method() # methods can have arguments def parameter_method(param1, param2, param3): print("passed param1: " + param1) print("passed param2: " + param2) pri...
import os.path from gi.repository import Gtk import gourmet.GourmetRecipeManager import gourmet.recipeManager from gourmet.i18n import _ from gourmet.plugin import ShoppingListPlugin from gourmet.prefs import Prefs from .nutritionLabel import NutritionLabel class ShoppingNutritionalInfoPlugin (ShoppingListPlugin):...
# -*- coding: utf-8 -*- """ Created on Wed Apr 22 22:52:24 2015 @author: lorraine """ import json from pprint import pprint import numpy as np from scipy.stats import mstats from scipy import stats import csv import pandas as pd #json_data=open("data/{0}_B.json".format("pizza")).read() #data = json.loads(json_data) ...
#! /usr/bin/env python """ This page is in the table of contents. Inset will inset the outside outlines by half the edge width, and outset the inside outlines by the same amount. The inset manual page is at: http://fabmetheus.crsndoo.com/wiki/index.php/Skeinforge_Inset ==Settings== ===Add Custom Code for Temperature ...
"""Module containing majory of calulation functions and their helpers.""" from datetime import datetime from datetime import timedelta from collections import defaultdict from . import default_parse_fmt from . import log_function_entry_and_exit @log_function_entry_and_exit def parse_row(row, field_names, datetime_pa...
import tempfile from os import walk import os from django.contrib.auth.models import User, Group from quickstart.models import Image, ImageContainer from rest_framework import serializers from django.core.files import File import urllib.request from versatileimagefield.serializers import VersatileImageFieldSe...
# Copyright 2012 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requ...
""" dataclasses パッケージに関するサンプルです. 基本的な使い方について REFERENCES:: http://bit.ly/2KTZynw http://bit.ly/2KJCnwk http://bit.ly/2KHeNA9 http://bit.ly/2KFLGxc """ import dataclasses as dc from trypython.common.commoncls import SampleBase from trypython.common.commonfunc import pr @dc.data...
#--coding:utf-8-- # This file is part of 'NTLM Authorization Proxy Server' # Copyright 2001 Dmitry A. Rozmanov <dima@xenon.spb.ru> # # NTLM APS 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 ...
"""Meteo-France component constants.""" from homeassistant.components.weather import ( ATTR_CONDITION_CLEAR_NIGHT, ATTR_CONDITION_CLOUDY, ATTR_CONDITION_EXCEPTIONAL, ATTR_CONDITION_FOG, ATTR_CONDITION_HAIL, ATTR_CONDITION_LIGHTNING, ATTR_CONDITION_LIGHTNING_RAINY, ATTR_CONDITION_PARTLYC...
# -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import os import pytest import json import itertools from unittest import SkipTest from numpy.testing import assert_equal, assert_almost_equal f...
""" Mitmproxy Content Views ======================= mitmproxy includes a set of content views which can be used to format/decode/highlight data. While they are currently used for HTTP message bodies only, the may be used in other contexts in the future, e.g. to decode protobuf messages sent as WebSocket frames. Thus,...
# # The Qubes OS Project, https://www.qubes-os.org/ # # Copyright (C) 2010-2016 Joanna Rutkowska <joanna@invisiblethingslab.com> # Copyright (C) 2015-2016 Wojtek Porczyk <woju@invisiblethingslab.com> # Copyright (C) 2016 Bahtiar `kalkin-` Gadimov <bahtiar@gadimov.de> # # This program is free software; you can r...
import multiprocessing import os import signal from clisnips.tui.logging import logger from .message_queue import MessageQueue class Process(multiprocessing.Process): def __init__(self, message_queue: MessageQueue, target, args=(), kwargs=None): super().__init__(target=target, args=args, kwargs=kwargs o...
# -*- coding: utf-8; indent-tabs-mode: nil; tab-width: 4; c-basic-offset: 4; -*- """ - fest process helper - - fest.py [ --test ] | [ --stop ] | [ --start ] | [ --reload ] | [ --state ] | [ --version ] | - --path | --name - _ - fest.py --path='/usr/local/etc/fest/fest.yaml' --name='example.com' --test ...
#!/usr/bin/env python2.7 from __future__ import division import sys import json import argparse import collections parser = argparse.ArgumentParser() parser.add_argument("--predicted_results", required=True) parser.add_argument("--held_out_seed", required=True) parser.add_argument("--out_file", default=None) args ...
#!/usr/bin/env python # -*- coding: utf-8 -*- import datetime import re from saml2.httpbase import HTTPBase from saml2.mdstore import MetadataStore, MetaDataMDX from saml2.mdstore import destinations from saml2.mdstore import name from saml2 import md from saml2 import sigver from saml2 import BINDING_SOAP from saml2...
# Copyright (C) 2012 Hewlett-Packard Development Company, L.P. # 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/LICEN...
import pandas as pd import numpy as np from sklearn import cross_validation import xgboost as xgb class RmspeObjective: hessian = None def __call__(self, predicted, target): target = target.get_label() # I suspect this is necessary since XGBoost is using 32 bit floats # and ...
#!/usr/bin/python import networkx as nx import time import networkx.algorithms.approximation as nxaa import matplotlib.pyplot as plt import numpy as np from networkx.utils import powerlaw_sequence """Code for ATTEMPTING to approximate the maximal independent set in a graph of conflicting sequences (e.g. aligned > thr...
""" Copyright (c) 2002 Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and t...
import sys,os,json,pprint class PDA(): """ Represents a Push-Down Automaton """ EPSILON = '_e' MAX_STEPS = 10000 def __init__(self): pass def testAutomata(self, pda, testcases): """ Tests whether the given PDA accepts or rejects the given testcases appropriately Args: * pda: PDA object to be ...
#!/usr/bin/python2.6 # This file is a part of Metagam project. # # Metagam is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # any later version. # # Metagam is distributed ...
from __future__ import unicode_literals from django.utils import six from djblets.util.decorators import augment_method_from from djblets.webapi.decorators import (webapi_login_required, webapi_response_errors, webapi_request_fields) from dj...
""" sample variance decay of two level QG system """ from __future__ import division from __future__ import absolute_import from firedrake import * from quasi_geostrophic_model import * import numpy as np import matplotlib.pyplot as plot # define mesh hierarchy mesh = UnitSquareMesh(5, 5) L = 4 mesh_hierarchy ...
# Copyright (C) 2015 OpenStack 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 # # Unless required by applicable law or agreed to ...
""" Support for Google BigQuery. Does not support actually connecting to BQ. Directly derived from the mssql dialect with minor modifications """ import sqlalchemy.dialects.mssql.base as mssql_base from sqlalchemy.dialects.mssql.base import MSDialect from sqlalchemy.sql import compiler from sqlalchemy.sql import sql...
# Copyright (C) 2012 W. Trevor King <wking@tremily.us> # # This file is part of pygrader. # # pygrader is free software: you can redistribute it and/or modify it under the # terms of the GNU General Public License as published by the Free Software # Foundation, either version 3 of the License, or (at your option) any l...
# -*- coding: utf-8 -*- """ Created on Sat Mar 18 13:28:29 2017 @author: dukekuang """ #Exercise 7.3. The mathematician Srinivasa Ramanujan #found an infinite series that can be used to #generate a numerical approximation of 1/p: #Write a function called estimate_pi that uses this formula to compute #a...
# install numpy # # sudo apt install python-pip # pip install --user --upgrade pip # pip install --user numpy scipy matplotlib ipython jupyter pandas sympy nose # import sys import timeit import numpy as np print (sys.version_info) # fiedler matrix 25 x 25 A = [ [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,...
import os import unittest from parameterized import parameterized from integration_tests.dataproc_test_case import DataprocTestCase class KafkaTestCase(DataprocTestCase): COMPONENT = 'kafka' INIT_ACTIONS = ['kafka/kafka.sh'] TEST_SCRIPT_FILE_NAME = 'validate.sh' def verify_instance(self, name): ...
#!/usr/bin/python # # Fishfeedtime powers down Powerheads/Filters/Pumps of your choice (which are connected to 433.92MHz power socket controllers) # for a set duration. # ## GPIO Pin Definitions # Pin with button circuit GPIO Pullup BUTTON = 25 # LED Pin if present... LED = True LEDPIN = 11 # Pin connect to 434MHz tra...
############################################################################# ## ## Copyright (C) 2016 The Qt Company Ltd. ## Contact: https://www.qt.io/licensing/ ## ## This file is part of the test suite of PySide2. ## ## $QT_BEGIN_LICENSE:GPL-EXCEPT$ ## Commercial License Usage ## Licensees holding valid commercial ...
# Script name : tune_scale.py # Semantics version: semantics-4 # Description : Tento skript umoznuje ladeni scaling faktoru # SCALE_CONCEPT12 a SCALE_PUSHPOP. Vychozi hodnoty jsou # brany ze souboru settings, vychozi rozsah je +-0.6 a krok # 0.2. Pro ot...
# -*- coding: utf-8 from __future__ import unicode_literals from __future__ import print_function from pygments.token import Token def create_toolbar_handler(is_long_option, is_fuzzy): assert callable(is_long_option) assert callable(is_fuzzy) def get_toolbar_items(_): """ Return bottom ...
## Copyright 2006-2009 Luc Saffre ## This file is part of the TimTools project. ## TimTools is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation; either version 3 of the License, or ## (at your option) any la...
# -*- coding: utf-8 -*- # 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...
# Copyright 2016 Isotoma Limited # 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,...
# encoding: utf-8 from __future__ import unicode_literals from AppChains import AppChains class UsageExample(object): token = '<your token goes here>' url = 'api.sequencing.com' def __init__(self): self.chains = AppChains(self.token, self.url) #print(self.get_public_beacon_test()) ...
from __future__ import division from socket import socket, AF_INET, SOCK_STREAM from time import time from select import select from struct import pack, unpack from threading import Lock RQT_GET = 0x00 RQT_ASSIGN = 0x01 RQT_DELETE = 0x02 def REQ_to_bytes(request, tablespace, key, value): return pack('!BBLL', re...
from glob import glob import os from os import path import itertools import re from Bio import AlignIO import pandas import sys import copy import argparse from slr import * species_RE = re.compile("([A-Z]+)") yeast_RE = re.compile("Y[A-P][LR][0-9]{3}[WC]") def grouper(iterable, n, fillvalue=None): args = [iter...
# Copyright 2021 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 # https://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law or agreed to in writing, sof...
'''NO NO YES YES YES YES NO YES NO NO''' def main(): # t tests # n elems #t, case = readFromFile('sherlock_and_array_sample3.input.txt') t, case = readFromStdin() for n in range(t): #print("processing ", n) if findIndex(case[n]): print("YES") else: print("NO") def readFro...
# 135. Candy QuestionEditorial Solution My Submissions # Total Accepted: 60931 # Total Submissions: 257062 # Difficulty: Hard # Contributors: Admin # There are N children standing in a line. Each child is assigned a rating value. # # You are giving candies to these children subjected to the following requirements: ...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from contextlib import closing from django.conf import settings from celery.utils.log import get_task_logger from .base_task import BaseTask from testrunner.ssh import SSHConnection logger = get_task_logger(__name__) class Deploy(BaseTask): PACKAG...
# Copyright 2015 The Chromium OS Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Unittest for statsd mock.""" from __future__ import print_function import unittest from chromite.lib.graphite_lib import statsd_mock as statsd clas...
size(512,512) background(None) def bar(x, y, w, depth, filled=1.0): d1 = depth*filled colormode(HSB) f = fill() s = stroke() if f != None and f.brightness != 1: s = color(f.hue, f.saturation+0.2, f.brightness-0.4) nostroke() #front if f != None: fill(f) rect(x, y...
""" .. module:: views.reports.immunization :synopsis: Indivo view implementations for the immunization report. .. moduleauthor:: Daniel Haas <daniel.haas@post.harvard.edu> .. moduleauthor:: Ben Adida <ben@adida.net> """ from django.http import HttpResponseBadRequest, HttpResponse from indivo.lib.view_decorators i...
import django.views.generic as generic import django.views.generic.edit as edit from django.shortcuts import redirect from django.core.urlresolvers import reverse_lazy from django.forms import ModelChoiceField from django.contrib.contenttypes.models import ContentType from django.db import IntegrityError import django....
from accelerator_abstract.models import ( FORM_ELEM_FEEDBACK_TO_MC, FORM_ELEM_FEEDBACK_TO_STARTUP, FORM_ELEM_OVERALL_RECOMMENDATION, ) from accelerator.models import ( ACTIVE_PROGRAM_STATUS, ASSIGNED_PANEL_ASSIGNMENT_STATUS, COMPLETE_PANEL_ASSIGNMENT_STATUS, FEEDBACK_DISPLAY_DISABLED as DIS...
import re import sys from .._compat import integer_types, long from ..helpers.classes import Reference from .base import SQLAdapter from . import adapters, with_connection_or_raise @adapters.register_for('') class Oracle(SQLAdapter): dbengine = 'oracle' drivers = ('cx_Oracle',) cmd_fix = re.compile( ...
# -*- coding: utf-8 -*- """ """ __version__ = '$Id: 51e0909e61b550a9cec8e27c364c596df6e90a13 $' # # (C) Francesco Cosoleto, 2006 # # Distributed under the terms of the MIT license. # import sys import httplib, socket, re, time import wikipedia as pywikibot import config, catlib, pagegenerators, query from urllib i...
#!/usr/bin/env python3 # Copyright (c) 2017 Brendon Caligari <caligari@cypraea.co.uk> # This file is released under GPL v3.0 import logging import pathlib import unfile import json class FileDedup(object): """Dedup existing files in a directory and add more unique files. The directory is first scanned and d...
# -*- coding: utf-8 -*- import subprocess import sys import tempfile import execnet import py import pytest MINOR_VERSIONS = {"3": "543210", "2": "76"} def _find_version(suffix=""): name = "python" + suffix executable = py.path.local.sysfind(name) if executable is None: if sys.platform == "win32...
#!/bin/python # Error handing import socket, sys host = sys.argv[1] textport = sys.argv[2] filename = sys.argv[3] try: s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) except socket.error, e: print "Strange error creating socket: %s" % e sys.exit(1) try: port = int(textport) except ValueError: ...
"""The graphics module implements a simple GUI library.""" import sys import math try: import tkinter except Exception as e: print('Could not load tkinter: ' + str(e)) FRAME_TIME = 1/30 class Canvas(object): """A Canvas object supports drawing and animation primitives. draw_* methods return the id ...
#!/usr/bin/env python3 from flask import Flask, request, abort, jsonify from timeout_decorator import timeout import logging import socket import platform import os # App for uwsgi app = Flask(__name__) ENDPOINT = os.getenv('ENDPOINT', '192.168.1.104') ENDPOINT_PORT = 8899 INTERNAL_ADDRESS = [0x11, 0x0e, 0x59] BUFFE...
#!/usr/bin/env python from __future__ import division import optparse, os from Bio.Seq import Seq from Bio.Alphabet import generic_dna #This script uses an aligned fasta file and a tab deliminted file containing CDS coordinates to create a nexus input for BEAST #In version 2.0, added a flag to throw if you only want...
############################################################################## # # OSIS stands for Open Student Information System. It's an application # designed to manage the core business of higher education institutions, # such as universities, faculties, institutes and professional schools. # The core ...
import sys import datetime from subprocess import Popen, PIPE import json #container ID extraction container_id = sys.argv[1] print("Check :"+container_id) cmd=['docker', 'inspect', "--format='{{json .State}}'", container_id] print(cmd) process = Popen(cmd, stdout=PIPE, stderr=PIPE) stdout, stderr = process.communic...
# char encode: # the value can be: utf-8, ascii, windows-1252, ... char_encode = 'ascii' import os import os_base import codecs # mat_data = [] ftxt = "materials_data.txt" m3d_ex = "_export.m3d" # name_list = ['sinon'] name_list += ['pepper'] name_list += ['nino'] name_list += ['black_warrior'] # mat_start = {} mat...
# -*- coding: utf-8 -*- # # Copyright © 2012 - 2017 Michal Čihař <michal@cihar.com> # # This file is part of Weblate <https://weblate.org/> # # 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, eith...
from urllib2 import Request, build_opener, HTTPCookieProcessor, HTTPHandler import cookielib import urllib import urllib2 import bz2 import re import requests import xmlrpclib if __name__ == '__main__': info = '' i=0 # while (i<400): # if i == 0: # url = url = "http://www.pythonchallenge.com/pc/def...
# Original Author : Simon Wessing # From : TU Dortmund University # # 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 3 of the License, or # (at your option) any l...
#!/usr/bin/env python ################################################## # Ocvc Python Flow Graph # Title: Affinity Set Test ################################################## from ocvc import eng_notation from ocvc import gr from ocvc import blocks from ocvc import filter from ocvc.eng_option import eng_option #from ...
### # Copyright 2016 Miler T. Lee, University of Pittburgh # This file is part of the RESA Suite # # RESA Suite is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your op...
from setuptools import Command from setuptools.archive_util import unpack_archive from distutils import log, dir_util import os, pkg_resources class install_egg_info(Command): """Install an .egg-info directory for the package""" description = "Install an .egg-info directory for the package" user_options...
# Copyright edalize contributors # Licensed under the 2-Clause BSD License, see LICENSE for details. # SPDX-License-Identifier: BSD-2-Clause import os.path from edalize.edatool import Edatool from edalize.yosys import Yosys from importlib import import_module class Trellis(Edatool): argtypes = ['vlogdefine', 'v...
"""Provide configuration end points for Automations.""" import asyncio from collections import OrderedDict import uuid from homeassistant.const import CONF_ID from homeassistant.components.config import EditIdBasedConfigView from homeassistant.components.automation import ( PLATFORM_SCHEMA, DOMAIN, async_reload) i...
# # Copyright (C) 2014 Richard Dean # # 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, or (at your option) # any later version. # # This Program is distributed in the ...
""" chatrelater.visualization ~~~~~~~~~~~~~~~~~~~~~~~~~ Visualize relations between chat partners using GraphViz_ (has to be installed). .. _GraphViz: http://www.graphviz.org/ :Copyright: 2007-2021 Jochen Kupperschmidt :License: MIT, see LICENSE for details. """ import math from typing import List, Tuple from grap...
# -*- coding: utf-8 -*- """ ****************** Super TN3270 Field ****************** Super TN3270 Field - stn3270.field - implements the field manipulation on a 3270 virtual screen: read, write, verify and find fields. """ class Field: """It's a representation of a 3270 field, with a *start of field* sequence, ...
''' Common parallel/serial design patterns This module defines a set of common tasks that can be performed in parallel or serial. .. Created on Jun 23, 2012 .. codeauthor:: Robert Langlois <rl2528@columbia.edu> ''' import process_queue import logging import numpy.ctypeslib import multiprocessing.sharedctypes _logge...
#!/usr/bin/env python3 # Copyright (c) 2015-2018 The Energi Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # Copyright (c) 2014-2016 The Bitcoin Core developers # Distributed under the MIT software license, see the...
from django.db import models #from django.views.generic import * #from main.views import * # Create your models here. class Portfolio(models.Model): item_name = models.CharField(max_length=50) slug = models.SlugField(max_length=255,unique=True) client = models.CharField(max_length=50) picture = models.ImageField(...