code
stringlengths
1
199k
from pythoncz import app as application # NOQA application.config['SERVER_NAME'] = 'python.cz'
import sys import math while 1: enemy_1 = input() # name of enemy 1 dist_1 = int(input()) # distance to enemy 1 enemy_2 = input() # name of enemy 2 dist_2 = int(input()) # distance to enemy 2 # Write an action using print # To debug: print("Debug messages...", file=sys.stderr) # You have...
"""Base units.""" meter = 1.0 kilogram = 1.0 second = 1.0 ampere = 1.0 kelvin = 1.0 mole = 1.0 candela = 1.0
__author__ = 'Eric Higgins' __email__ = 'erichiggins@gmail.com' __version__ = '0.4.1'
from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('clients', '0016_auto_20170123_1038'), ] operations = [ migrations.AlterField( model_name='drugusage', name='application', ...
""" Flask-Pillow ------------ This is the description for that library """ from setuptools import setup setup( name='Flask-Pillow', version='0.9-002', url='http://github.com/hrharkins/flask_pillow/', license='BSD', author='Rich Harkins', author_email='rich.harkins+restify@gmail.com', descrip...
from pyramid.traversal import find_root from snovault import upgrade_step @upgrade_step('target', '', '2') def target_0_2(value, system): # http://redmine.encodedcc.org/issues/1295 # http://redmine.encodedcc.org/issues/1307 if 'status' in value: value['status'] = value['status'].lower() @upgrade_ste...
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('articles', '0001_initial'), ] operations = [ migrations.CreateModel( name='Outlet', fields=[ ('id', models.AutoFi...
from django.conf import settings from django.db.models import signals from django.utils.translation import ugettext_noop as _ from django.apps import apps if "notification" in settings.INSTALLED_APPS: from notification import models as notification notification_appconfig = apps.get_app_config('notification') ...
"""Handle multiple samples present on a single flowcell Merges samples located in multiple lanes on a flowcell. Unique sample names identify items to combine within a group. """ import os import shutil import subprocess from bcbio import bam, utils from bcbio.distributed.transaction import file_transaction, tx_tmpdir f...
from azure.core.credentials import AccessToken, AzureKeyCredential from azure.mixedreality.authentication._shared.aio.mixed_reality_token_credential import get_mixedreality_credential, MixedRealityTokenCredential from azure.mixedreality.authentication._shared.aio.static_access_token_credential import StaticAccessTokenC...
import os from sys import stdin,argv def split_blast_line(line): """function to split the blast line into its components""" queryId, subjectId, percIdentity, alnLength, mismatchCount, \ gapOpenCount, queryStart, queryEnd, subjectStart, \ subjectEnd, eVal, bitScore = line.split("\t") ...
"""Defines an Error Message.""" from enum import IntEnum from pyof.foundation.base import GenericMessage from pyof.foundation.basic_types import BinaryData, UBInt16 from pyof.foundation.exceptions import PackException from pyof.v0x01.common.header import Header, Type __all__ = ('ErrorMsg', 'ErrorType', 'BadActionCode',...
import re import urllib def slugify_name(string): """ Transforms a string in CammelCase in cammel_case """ s1 = re.sub('(.)([A-Z][a-z]+)', r'\1_\2', string) return re.sub('([a-z0-9])([A-Z])', r'\1-\2', s1).lower() def make_url(payload, url): """ Makes the url with the payload (QueryString) ...
import rdflib as R from .biology import BiologyType from .cell_common import CELL_RDF_TYPE from .channel_common import CHANNEL_RDF_TYPE from .channelworm import ChannelModel from owmeta_core.dataobject import DatatypeProperty, ObjectProperty, Alias class ExpressionPattern(BiologyType): class_context = BiologyType.c...
""" Agent code for the model described in (https://arxiv.org/abs/1811.00945). """ from typing import Optional from parlai.core.params import ParlaiParser from parlai.core.opt import Opt from parlai.core.agents import Agent from parlai.core.dict import DictionaryAgent from parlai.utils.misc import round_sigfigs from .mo...
""" A custom manager for working with trees of objects. """ from __future__ import unicode_literals import contextlib import django from django.db import models, transaction, connections, router from django.db.models import F, Max, Q from django.utils.translation import ugettext as _ from mptt.exceptions import CantDis...
from __future__ import print_function from sklearn import datasets import matplotlib.pyplot as plt import math import numpy as np from mlfromscratch.deep_learning import NeuralNetwork from mlfromscratch.utils import train_test_split, to_categorical, normalize from mlfromscratch.utils import get_random_subsets, shuffle_...
from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('publicbody', '0013_auto_20180306_1519'), ] operations = [ migrations.AlterField( model_name='publicbody', ...
from __future__ import print_function import time import os import pytest from azure.keyvault.keys import KeyType from _shared.test_case import KeyVaultTestCase from _test_case import client_setup, get_decorator, KeysTestCase all_api_versions = get_decorator(only_vault=True) only_hsm = get_decorator(only_hsm=True) def ...
from PyQt4.QtCore import * from PyQt4.QtGui import * from decimal import Decimal from electrum_arg.util import format_satoshis_plain class MyLineEdit(QLineEdit): frozen = pyqtSignal() def setFrozen(self, b): self.setReadOnly(b) self.setFrame(not b) self.frozen.emit() class AmountEdit(MyL...
""" File: voice.py Purpose: A voice is a Line, but has an associated instrument and an interval tree for note searches relative to whole note time. """ from misc.interval_tree import IntervalTree from misc.interval import Interval from structure.line import Line from structure.dynamics import Dynamics from tim...
import _plotly_utils.basevalidators class ThicknessValidator(_plotly_utils.basevalidators.NumberValidator): def __init__( self, plotly_name="thickness", parent_name="layout.coloraxis.colorbar", **kwargs ): super(ThicknessValidator, self).__init__( plotly_name=plotly_name, ...
import os from os.path import join from common import readList, quote, keywordsAndSymbolsFrequencies languages = readList("langs.txt") results = dict() for language in languages: print "Language: ", language files = [f for f in os.listdir(language) if os.path.isfile(join(language, f))] fileno = 1 kws =...
""" Production Configurations - Use Amazon's S3 for storing static files and uploaded media - Use mailgun to send emails - Use Redis for cache - Use sentry for error logging """ from __future__ import absolute_import, unicode_literals from boto.s3.connection import OrdinaryCallingFormat from django.utils import six imp...
import os.path import numpy as np import numpy as np from numpy import convolve import matplotlib.pyplot as plt import re import os def movingaverage(values, window): weights = np.repeat(1.0, window) / window sma = np.convolve(values, weights, 'valid') return sma comp_re = re.compile(r"[^0-9]") plt.style.us...
import os.path import numpy as np from face_preproc import FaceDetector, FaceAligner, clip_to_range from cnn import CNN from tpe import build_tpe GREATER_THAN = 32 BATCH_SIZE = 128 IMSIZE = 217 IMBORDER = 5 class FaceVerificatorError (Exception): pass class FileNotFoundError (FaceVerificatorError): pass class F...
the_count = [1, 2, 3, 4, 5] fruits = ["apples", "oranges", "pears", "apricots"] change = [1, "pennies", 2, "dimes", 3, "quarters"] for number in the_count: print "This is count %d" % number for f in fruits: print "A fruit of type: %r" % f for i in change: print "I got %r" % i elements = [] for i in range(0,...
if __name__ == '__main__': print("Hello, World!")
if __name__ == '__main__': print("")
from django.utils.translation import gettext_lazy as _ # noqa: N812 class HealthCheckException(Exception): message_type = _("unknown error") def __init__(self, message): self.message = message def __str__(self): return "%s: %s" % (self.message_type, self.message) class ServiceWarning(Health...
import re from urllib.parse import urlparse import hashlib import logging class GBFUriMatcher: def __init__(self, regex): logging.debug('Using {0}'.format(regex)) self.pattern = re.compile(regex) def matches(self, uri): return bool(self.pattern.match(uri)) class GBFHeadersMatcher: de...
"""Tests for basic fields without substantial logic""" import numbers import pytest import six from swimlane.core.fields import resolve_field_class, _FIELD_TYPE_MAP, Field, _build_field_type_map from swimlane.core.fields.base import ReadOnly, FieldCursor from swimlane.core.fields.list import ListField from swimlane.exc...
from time import sleep import requests import json import argparse import configparser headers = {'Authorization': ''} baseUrl = '' owner = '' url = 'http://172.19.106.227' teamDevs = {} latestPR = {} def post_to_printer(pr, repo): title = pr['title'] user = teamXdevs[pr['head']['user']['login']] message = ...
num = 200 if number < 100: print("Your number is smaller than 100") else: print("Your number is greater than 100")
"""Auto-generated file, do not edit by hand. SA metadata""" from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata PHONE_METADATA_SA = PhoneMetadata(id='SA', country_code=966, international_prefix='00', general_desc=PhoneNumberDesc(national_number_pattern='1\\d{7,8}|(?:[2-467]|92)\\d{7}|5\\d{8}|8\...
""" WSGI config for topthecharts project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/1.11/howto/deployment/wsgi/ """ import os from django.core.wsgi import get_wsgi_application os.environ.setdefault("DJANGO_SETT...
""" @brief test log(time=1s) You should indicate a time in seconds. The program ``run_unittests.py`` will sort all test files by increasing time and run them. """ import unittest from teachpyx.examples.construction_classique import ( recherche, minindex, text2mat, compte, integrale, vect2mat, mat2vect, rec...
from abc import ABCMeta, abstractmethod from PyCIP. DataTypesModule.NumericTypes import * class VirtualBaseData(): __metaclass__ = ABCMeta @abstractmethod def import_data(self, bytes, offset=0): ''' must convert bytes to internal state, return bytes it used ''' pass ...
import toolbox import numpy as np import pylab pylab.rcParams['image.interpolation'] = 'sinc' if __name__ == "__main__": #import dataset print "initialising dataset" #set gather order to shot gather params['primary'] = None params['secondary'] = None #display
fiboValuePre = 0 fiboValueNext = 1 sumValue = 0 fiboValueNextNext = 0 while fiboValueNextNext <= 4000000 : fiboValueNextNext = fiboValuePre+fiboValueNext if fiboValueNextNext%2==0 : sumValue += fiboValueNextNext fiboValuePre = fiboValueNext fiboValueNext = fiboValueNextNext print(str(sumValue))
X=0 TURNS=1 LABEL=2 BUFFERTHRES=13 import time,sys,os,csv try: import serial except ImportError: pass try: import termios except ImportError: pass class Machine(): def windingWind(self,which): self.windingDisplayRoute(which) self.windingWhich = which route = self.windings[whi...
""" Euler Problem 26 https://projecteuler.net/problem=26 Problem Statement: A unit fraction contains 1 in the numerator. The decimal representation of the unit fractions with denominators 2 to 10 are given: 1/2 = 0.5 1/3 = 0.(3) 1/4 = 0.25 1/5 = 0.2 1/6 = 0.1(6) 1/7 = 0.(142857) 1/8 = 0.125 1/9 = 0.(1) 1/10 = ...
import sys import pexpect import pytest py2_only = pytest.mark.skipif(sys.version_info[0] >= 3, reason='Python 2') py3_later = pytest.mark.skipif(sys.version_info[0] <= 2, reason='Python 3+') HELLO_PY = """\ from __future__ import print_function import sys input_func = input if sys.version_info[0] >= 3 else...
""" Created on Mon Feb 24 00:25:25 2014 @author: Pau Rodríguez López """ import ctypes as ct import numpy as np import os class Alpha(ct.Structure): """Ctypes Structure for RP alpha parameter. Fields: data: A pointer to an array of doubles. size: The number of elements in the array. """ ...
""" A setuptools based setup module. See: https://packaging.python.org/en/latest/distributing.html https://github.com/pypa/sampleproject """ from setuptools import setup, find_packages from os import path from RiboCode import __version__ import sys if sys.version_info[0] == 2 and sys.version_info[1] < 6: sys.stderr...
from ._abstract import AbstractScraper from ._utils import get_minutes, get_yields, normalize_string class Mindmegette(AbstractScraper): @classmethod def host(cls): return "www.mindmegette.hu" def title(self): return self.soup.find("h1", {"class": "title"}).get_text() def total_time(self...
"""General Unpack utils for python-openflow. This package was moved from kytos/of_core for the purpose of creating a generic method to perform package unpack independent of the OpenFlow version. """ from pyof import v0x01, v0x04 from pyof.foundation.exceptions import UnpackException from pyof.v0x01.common import utils ...
import time import logging from threading import Lock LOG = logging.getLogger(__name__) class LifeManager(object): def __init__(self): self._callbacks = [] self._should_stop = False self._lock = Lock() self._stopped = False def register(self, func, *args, **kwargs): with ...
import re __author__ = 'kinpa200296' class FormattedLogger(object): def __init__(self, **kwargs): self._logs = [] if 'format' in kwargs: specifiers = [spec[1:-1] for spec in re.findall('{\w*}', kwargs['format'])] for spec in specifiers: if spec not in ['func_n...
"""mysite URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.10/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Class-base...
"""YoroTime URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.11/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Class-ba...
from turtle import * def ruut(): i = 0 while (i < 4): forward(100) left(90) i = i + 1 ruut() pikslit right(45) ruut() exitonclick()
from flask_restful import Resource, reqparse, abort import json from user_db_model import UserModel from app import api, ma, db, MOODLE_URL from urllib2 import urlopen, URLError, HTTPError from marshmallow import fields class Users(Resource): def __init__(self): self.reqparse = reqparse.RequestParser() ...
from django.conf.urls import url from apps.api.utils import SharedAPIRootRouter from apps.events import views urlpatterns = [ url(r'^$', views.index, name='events_index'), url(r'^(?P<event_id>\d+)/attendees/pdf$', views.generate_pdf, name='event_attendees_pdf'), url(r'^(?P<event_id>\d+)/attendees/json$', vi...
import math def deg2rad(degrees): return math.pi*degrees/180.0 def rad2deg(radians): return 180.0*radians/math.pi WGS84_a = 6378137.0 # Major semiaxis [m] WGS84_b = 6356752.3 # Minor semiaxis [m] def WGS84EarthRadius(lat): # http://en.wikipedia.org/wiki/Earth_radius An = WGS84_a*WGS84_a * math.cos(lat...
from .matplotlib import pylab_style
from django.conf.urls import url from .views import (MyRequestsView, FollowingRequestsView, account_settings, new_terms, logout, login, signup, confirm, send_reset_password_link, change_password, password_reset_confirm, change_user, change_email, go, delete_account, ) urlpatterns = [ url(r'^$', MyRe...
mem = {} def cnt(n, e): if n == 0: return 1 if e else 0 if (n,e) in mem: return mem[(n,e)] res = cnt(n-1, e) + cnt(n-1, not e) mem[(n,e)] = res return res def nth(n, k, e): if n == 0: return "" if k < cnt(n-1, e): return "0" + nth(n-1, k, e) else: ...
from gnuradio import blocks from gnuradio import digital from gnuradio import eng_notation from gnuradio import gr from gnuradio import uhd from gnuradio.eng_option import eng_option from gnuradio.filter import firdes from optparse import OptionParser import numpy import pmt import time import vtgs class tx_scram_rand_...
import sys import argparse import shutil from phylib import * class BSP_BBLayerFile(BoardSupportPackage): """ Setup project priority list """ def __init__(self): super(BSP_BBLayerFile, self).__init__() project_priority = [] # ignore repos with layer.conf in unusual places ...
import truss.truss import truss.truss_visual import time import random def test_simulation_of_truss(): design = truss.truss.Truss() display = truss.truss_visual.truss_visual() display.display(design) design.rule_check() design.evaluate() print('') print('Rule: 1') print('Deletable:', des...
import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "nublas.tests.settings") from django.core.management import execute_from_command_line execute_from_command_line(sys.argv)
from __future__ import absolute_import, division, print_function, \ with_statement import sys import os import signal import select import time import argparse from subprocess import Popen, PIPE python = 'python' parser = argparse.ArgumentParser(description='test Shadowsocks') parser.add_argument('-c', '--client-co...
from setuptools import setup, find_packages import io import sys with io.open("README.rst", encoding="utf-8") as f: description = f.read() setup( name="pyffx", url="http://github.com/emulbreh/pyffx/", version="0.3.0", packages=find_packages(), license=u"MIT License", author=u"Johannes Dollin...
""" This module defines tools to generate and analyze phase diagrams. """ import re import collections import itertools import math import logging from monty.json import MSONable, MontyDecoder from functools import lru_cache import numpy as np from scipy.spatial import ConvexHull from pymatgen.core.composition import C...
raw_ages = [23, 24, 23, 35, 12, 13, 10, 7, 99, 13, 17, 12, 12, 12, 13] hist = {} bad_hist = [0] * (max(raw_ages) + 1) for age in raw_ages: bad_hist[age] = bad_hist[age] + 1 print(bad_hist) for age in raw_ages: if age in hist: hist[age] = hist[age] + 1 else: hist[age] = 1 print(hist)
import copy import pytest from molecule import config from molecule import scenario from molecule import scenarios @pytest.fixture def _instance(config_instance): config_instance_1 = copy.deepcopy(config_instance) config_instance_2 = copy.deepcopy(config_instance) config_instance_2.config['scenario']['name'...
""" TestCases for checking set_get_returns_none. """ import os, string import unittest from test_all import db, verbose, get_new_database_path class GetReturnsNoneTestCase(unittest.TestCase): def setUp(self): self.filename = get_new_database_path() def tearDown(self): try: os.remove(...
class word_emotion_marker: def __init__(self,text,feeling): textfile = open(text,"r") feelingfile = open(feeling,"r") punctuation = ['.',',','!','?','"','-',':',')','(',']','[','}','{','<','>','\\','/','*','&','^','%','$','+','-','=','|'] self.textfeel_dict = dict() feelings ...
import os import json from django.test import TestCase from edge.models import Genome, Operation, Fragment, Genome_Fragment from edge.blastdb import build_all_genome_dbs, fragment_fasta_fn from edge.crispr import find_crispr_target, crispr_dsb from Bio.Seq import Seq class GenomeCrisprDSBTest(TestCase): def build_g...
import re import commands SLAVE_IO = "cat /tmp/slave.status | grep Slave_IO_Running | cut -d ':' -f 2" SLAVE_SQL = "cat /tmp/slave.status | grep Slave_SQL_Running | cut -d ':' -f 2" SECS_BEHIND = "cat /tmp/slave.status | grep Seconds_Behind_Master | cut -d ':' -f 2" OK = 0 ERR = 1 SECS_BEHIND_ERR = -1 class MysqlSlaveM...
class Vocab(object): def __init__(self, tokens, embedding_dim, delimiter=' ', vocab_size=None, bos_token='SEQ_BEG', eos_token='SEQ_END', unk_token='UNK'): """ :param embedding_dim: :param tokens: list of tokens :param delimiter: delimiter between symbols, if '' then ...
import unittest class MainTests(unittest.TestCase): def test_can_pass(self): assert True
""" Memory usage of Python < 3.3 grows between some function calls, randomly, whereas it should stay stable. The final memory usage should be close to the initial memory usage. Example with Python 2.6: Initial memory: VmRSS: 3176 kB After call #1: VmRSS: 4996 kB After call #2: ...
""" Identify which PHAT brick+field each AST field corresponds to. 2015-07-08 - Created by Jonathan Sick """ import numpy as np from sklearn.cluster import KMeans from matplotlib.figure import Figure from matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCanvas import matplotlib.gridspec as gridspec from ...
__author__ = 'Pedro' import datetime import json import random import time import logging import traceback import abc logger = logging.getLogger('myLogger') logger.setLevel(logging.DEBUG) fm = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s') fh = logging.FileHandler('./logs/evolution-{}.log'.fo...
from django.contrib import admin from apps.userstuff.models import UserProfile admin.site.register(UserProfile)
"""Test multiwallet. Verify that a bitcoind node can load multiple wallet files """ import os import shutil import time from decimal import Decimal from threading import Thread from test_framework.authproxy import JSONRPCException from test_framework.test_framework import BitcoinTestFramework from test_framework.test_n...
""" The MIT License (MIT) Copyright (c) 2016 Louis-Philippe Querel l_querel@encs.concordia.ca 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 r...
from . import constants from django.dispatch import receiver from django.db.models.signals import post_save from contracts.models import Contract from source import constants as source_constants @receiver(signal=post_save, sender=Contract) def process_contract_change(instance, created, **kwargs): """ If the...
import datetime import random import re import shortuuid from sqlalchemy import sql from sqlalchemy.dialects.postgresql import JSONB from app import db from app import logger from http_cache import http_get from oa_local import find_normalized_license from pdf_to_text import convert_pdf_to_txt from oa_pmc import query_...
"""Google Cloud Platform DNS Tool This is an open source tool to management domains in Google Cloud DNS using JSON files as reference more informations please consulte the README.md """ import json import time from argparse import ArgumentParser try: from google.cloud import dns except ImportError: ...
import rospy from std_msgs.msg import String def callback(message): rospy.loginfo("%s",message.data) rospy.init_node('PlayMusicRobot') sub = rospy.Subscriber('HandOff',String,callback) rospy.spin()
import uuid, sys, os, mimetypes, codecs, markdown, re from twisted.python import log from twisted.internet import reactor from twisted.web.server import Site from twisted.web.wsgi import WSGIResource from autobahn.websocket import WebSocketServerFactory, \ WebSocketServerProtocol from autobah...
from mock import ANY from pytest import mark from pyquery import PyQuery from riot.expression import parse_document_expressions, evaluate_attribute_expression, parse_markup_expression, identify_document, evaluate_markup_expression, evaluate_each_expression, mark_dirty, render_document @mark.parametrize('html, result', ...
def primes(maxp): """ Returns a two item tuple. The first item is a list of prime numbers less than maxp in increasing order. The second is the set constructed from the same list of primes for faster lookups. """ # Implemented using the Sieve of Eratosthenes sieve = [True for x in xrange(max...
""" The MIT License Copyright (c) 2011 Olle Johansson Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publi...
import urllib, urllib2, smartAutocompleteDaemon, sys, os, argparse parser = argparse.ArgumentParser(description='run autocomplete server daemon') parser.add_argument("-p", "--port", type=int, default=8080, help="set port on which server listens for http requests") parser.add_argument("-d", "--direct...
import os from unittest import TestCase import pytest from ..file_comparison_panda import FileComparisonPanda from ..file_comparison_exceptions import ( UnsupportedFileType, FileDoesNotExist, PermissionDeniedOnFile) class TestFileComparison(TestCase): test_files_path = os.path.dirname(__file__) def test_con...
from .proxy_resource import ProxyResource class RestorePoint(ProxyResource): """Database restore points. Variables are only populated by the server, and will be ignored when sending a request. :ivar id: Resource ID. :vartype id: str :ivar name: Resource name. :vartype name: str :ivar typ...
from flask import request from flask_api import status from flask_restful import Resource from app.models.user_token_model import token_generate from app.modules import frest from app.modules.auth.login import verify_password _URL = '/auth' class Auth(Resource): """ @api {post} /auth Authenticate with user info...
import flask import pandas as pd import numpy as np import blaze as bz from odo import odo from bokeh.embed import components from bokeh.resources import INLINE from bokeh.templates import RESOURCES from bokeh.util.string import encode_utf8 from bokeh.models import ColumnDataSource import bokeh.plotting as plt app = fl...
from buildstep import BuildStep from libpepper import builtins from libpepper.cpp.cpprenderer import PepCppRenderer from libpepper.environment import PepEnvironment class RenderBuildStep( BuildStep ): def read_from_file( self, fl ): return fl.read() def process( self, val ): env = PepEnvironment...
""" Usage: ping [-c <count>] [-i <interval>] [-W <timeout>] <destination> Options: -c <count>, --count=<count> [default: 5] -i <interval>, --interval=<interval> [default: 1.0] Wait interval seconds between sending each packet. The default is to wait for one second between each packet normally. ...
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('mentoring', '0014_auto_20161203_1646'), ] operations = [ migrations.AlterField( model_name='menteepreference', name='first_choice...
""" Surprisingly there are only three numbers that can be written as the sum of fourth powers of their digits: 1634 = 1^4 + 6^4 + 3^4 + 4^4 8208 = 8^4 + 2^4 + 0^4 + 8^4 9474 = 9^4 + 4^4 + 7^4 + 4^4 As 1 = 1^4 is not a sum it is not included. The sum of these numbers is 1634 + 8208 + 9474 = 19316. Find t...
import _env import json import requests from pprint import pprint from lib._db import get_collection from config.config import CONFIG DB = CONFIG.MONGO.DATABASE try: from Queue import Queue except ImportError: from queue import Queue URL = 'http://api.xianguo.com/i/status/get.json?key=36d979af3f6cecd87b89720d32...
import _plotly_utils.basevalidators class TicksuffixValidator(_plotly_utils.basevalidators.StringValidator): def __init__( self, plotly_name="ticksuffix", parent_name="layout.polar.radialaxis", **kwargs ): super(TicksuffixValidator, self).__init__( plotly_name=plotly_name, ...
import sys def compare_the_triplets(a, b): score = lambda t1, t2: sum(t1[i] > t2[i] for i in range(3)) return score(a, b), score(b, a) if __name__ == '__main__': f = sys.stdin a = tuple(map(int, f.readline().split())) b = tuple(map(int, f.readline().split())) print(' '.join(map(str, compare_the_...