src
stringlengths
721
1.04M
# -*- coding: utf-8 -*- # The MIT License (MIT) # # Copyright (c) 2016 SeungHoon Han (issess) # # 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 limitati...
from eden.paginator import Paginator import unittest class PaginatorTest(unittest.TestCase): def setUp(self): result = [_ for _ in range(1, 10)] self.p = Paginator(result, 100, 10, 5, '/test') def test_next_link(self): self.assertEqual(self.p.next_link('next'), '<a href="/test?page=1...
WIDTH = 640 HEIGHT = 480 class Ball(ZRect): pass # # The ball is a red square halfway across the game screen # ball = Ball(0, 0, 30, 30) ball.center = WIDTH / 2, HEIGHT / 2 ball.colour = "red" # # The ball moves one step right and one step down each tick # ball.direction = 1, 1 # # The ball moves at a s...
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ This experiment was created using PsychoPy2 Experiment Builder (v1.82.00), Mon Jun 22 22:53:33 2015 If you publish work using this script please cite the relevant PsychoPy publications Peirce, JW (2007) PsychoPy - Psychophysics software in Python. Journal of Neurosci...
from fontTools.misc import sstruct from fontTools.misc.textTools import safeEval, num2binary, binary2num from fontTools.ttLib.tables import DefaultTable import bisect import logging log = logging.getLogger(__name__) # panose classification panoseFormat = """ bFamilyType: B bSerifStyle: B bWeight: ...
# -*- coding: utf-8 -*- # Generated by Django 1.9 on 2016-01-22 14:55 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateMo...
# -*- coding: utf-8 -*- ############################ Copyrights and license ############################ # # # Copyright 2012 Steve English <steve.english@navetas.com> # # Copyright 2012 Vincent Jacques <vincent@vincent-ja...
#!/usr/bin/env python3 import itertools class solution: def __init__(self, n, total, operator, cel_string): self.combinations=[] self.n=n self.total=total self.operator=operator self.cel_string=cel_string def checkduplicate(item, solution): if item in solution.combinations: return True return False d...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Initiate the HTTP server according to settings """ import os import sys import cherrypy import pytunes import logging from cherrypy.process.plugins import Daemonizer, PIDFile from cherrypy.lib.auth_digest import get_ha1_dict_plain def start(): """ Main function f...
# -*- coding: utf-8 -*- """ Main Space Trader Galaxy class. Created on Thu Jul 6 01:59:38 2017 @author: mjm """ import logging import logging.config import character as char import good as good def trade(seller, buyer, commodity, pay): """ Seller sells commodity to the buyer who pays with pay. Argument...
from django.contrib import admin from image_cropping import ImageCroppingMixin from .models import Performer from qsic.core.admin import QsicModelAdmin class PerformerAdmin(ImageCroppingMixin, QsicModelAdmin): list_display = ('first_name', 'last_name', 'it_url', 'is_active',) search_fields = ('first_name', ...
""" Copyright (c) 2015 Red Hat, Inc All rights reserved. This software may be modified and distributed under the terms of the BSD license. See the LICENSE file for details. Python API for atomic-reactor. This is the official way of interacting with atomic-reactor. """ from atomic_reactor.inner import DockerBuildWork...
# -*- coding: utf-8 -*- """ requests.auth ~~~~~~~~~~~~~ This module contains the authentication handlers for Requests. """ import os import re import time import hashlib import threading from base64 import b64encode from .compat import urlparse, str from .cookies import extract_cookies_to_jar fr...
# All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in...
# -*- coding: utf-8 -*- """ mediatum - a multimedia content repository Copyright (C) 2011 Arne Seifert <arne.seifert@tum.de> 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 ...
#!/usr/bin/env python2 import numpy as np from time import time import heapq from matplotlib import pyplot as plt from eft_calculator import EFT_calculator, Water import tools def load_coordinates(name): lines = open('test.dat/random/'+name).readlines()[-7:-1] coors = [[float(item) for item in line.split()[...
# Copyright 2013 The Servo Project Developers. See the COPYRIGHT # file at the top-level directory of this distribution. # # Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or # http://www.apache.org/licenses/LICENSE-2.0> or the MIT license # <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your #...
# -*- coding: utf-8 -*- # Generated by Django 1.10.8 on 2018-03-08 14:09 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('authorization', '0006_auto_20180228_1538'), ] operations = [ migrations.Alt...
# Dorrie - Web interface for building Fedora Spins/Remixes. # Copyright (C) 2009 Red Hat Inc. # Author: Shreyank Gupta <sgupta@redhat.com> # 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...
from test.ditestcase import DITestCase from mock import Mock, patch from os.path import expanduser class ConfigurationTests(DITestCase): def setUp(self): super(ConfigurationTests, self).setUp() self.patchers = { 'configparser': patch('scrolls.configuration.configparser'), ...
#!/usr/bin/env python # -*- coding: utf-8 -*- # Author: Arne Neumann """ The ``exmaralda`` module converts a ``DiscourseDocumentGraph`` (possibly containing multiple annotation layers) into an Exmaralda ``*.exb`` file and vice versa. """ import os import sys from collections import defaultdict from lxml import etree ...
#!/usr/bin/python import sys import numpy as np from numpy import float_ from numpy import absolute as abs from numpy import random as ran import matplotlib from scipy.signal.signaltools import convolve2d from scipy.interpolate.interpolate import interp1d def A_l(Rv,l): l=l/10000.; #Amstrongs to Microns x=1/l...
# -*- coding: UTF-8 -*- # django dependencies from django.contrib.auth.views import redirect_to_login from django.contrib.auth import REDIRECT_FIELD_NAME from django.conf import settings # from reia import settings # python dependencies from re import compile #---# EXEMPT_URLS = [compile(settings.LOGIN_URL.lstrip('...
__author__ = 'alisonbento' import basedao from src.entities.hsappliance import HomeShellAppliance import datetime import configs class ApplianceDAO(basedao.BaseDAO): def __init__(self, connection): basedao.BaseDAO.__init__(self, connection, 'hs_appliances', 'appliance_id') def convert_row_to_object(...
""" Implements a client class to query the `Deezer API <http://developers.deezer.com/api>`_ """ import json try: # pragma: no cover - python 2 from urllib import urlencode from urllib2 import urlopen except ImportError: # pragma: no cover - python 3 from urllib.parse import urlencode from urllib.requ...
# # ***** BEGIN LICENSE BLOCK ***** # # Source last modified: $Id: thread.py,v 1.3 2006/04/24 23:34:02 jfinnecy Exp $ # # Copyright Notices: # # Portions Copyright (c) 1995-2006 RealNetworks, Inc. All Rights Reserved. # # Patent Notices: This file may contain technology protected by one or # m...
import numpy as np import cv2, time, sys, threading, json, os from PyQt4 import QtCore, QtGui from controller import * class CamnistGUI(QtGui.QMainWindow): def __init__(self, controller_obj): super(CamnistGUI, self).__init__() self.controller = controller_obj pkg_dir = os.path.dirname(__...
# -*- coding: iso-8859-1 -*- """ MoinMoin - OrphanedPages Macro @copyright: 2001 Juergen Hermann <jh@web.de> @license: GNU GPL, see COPYING for details. """ Dependencies = ["pages"] def macro_OrphanedPages(macro): _ = macro.request.getText if macro.request.mode_getpagelinks: # prevent recursion ...
import queue import threading from glob import glob from os import chdir from tkinter import * from tkinter import ttk, filedialog, messagebox from mutagen.mp4 import MP4, MP4StreamInfoError from utils import get_external_tags __author__ = 'Derek' TAGS = [["Title:\t", "\xa9nam"], ["Album:\t", "\xa9alb"], ["Artist:...
from src.analysis.error_table import ErrorTable from src.animation.animation import Animation from src.animation.timeline import Timeline from src.selection.selection import Selection from src.selection.selector import Selector class Greedy(Selector): def __init__(self, name: str, animation: Animation, error_tabl...
#! env python2.7 import sys, subprocess import json def main(): argv = sys.argv argc = len(argv) if (argc != 2 or (argv[1] != "--svm" and argv[1] != "--knn")): print("Use --knn or --svm option!") sys.exit() print("\033[34m\033[1m================================================\033[0m\0...
# -*- 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 #...
#!/usr/bin/python # this assumes you have the socks.py (http://phiral.net/socks.py) # and terminal.py (http://phiral.net/terminal.py) in the # same directory and that you have tor running locally # on port 9050. run with 128 to 256 threads to be effective. # kills apache 1.X with ~128, apache 2.X / IIS with ~256 # n...
#!/usr/bin/python import getopt, sys import encode from encode import * def regions_complement(regions): comp_regions = encode.regions() for region_name in regions.keys(): # store an alias for the region with name region_name - just readability data = regions[region_name] comp_regions...
""" Configuration for every video player / site. - Properties (prefix none): names of video properties (e.g., autoplay on?) - Events (prefix EVT): names of video events (e.g., video_play) To add a new target, simply copy an existing block, paste, and modify. - normal values: boolean or string or list with one item - d...
import unittest import json from django.test import Client from webhookmq import settings from webhookmq.util.get_message import get_message from webhookmq.util import randomstring class IntegrationTest(unittest.TestCase): def setUp(self): self.client = Client() self.nested = { "first"...
""" RAPD agent for fast integration with XDS """ __license__ = """ This file is part of RAPD Copyright (C) 2011-2018, Cornell University All rights reserved. RAPD 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 Foun...
from __future__ import unicode_literals import requests import json from json.encoder import JSONEncoder JNE = 'jne' POS = 'pos' TIKI = 'tiki' ALL_COURIER = 'all' class ApiRequest(object): """Basic Api request with using requests library """ json_encoder_class = JSONEncoder def __init__(self, endpo...
# Authors: Travis Oliphant, Trent Oliphant # with support from Lee Barford's group at Agilent, Inc. # """This module allows for the loading of an array from an ASCII Text File """ __all__ = ['read_array', 'write_array'] # Standard library imports. import os import re import sys import types # Numpy imports. impor...
# coding=utf-8 import json, time, threading, random, logging from .funciones import nuevosMensajes class Partida: partidasEnCurso = [] def finder(self, host): posicionPartida = 0 for e in self.partidasEnCurso: if e["host"] == host: return posicionPartida ...
#Copyright 2013 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...
import config from deluge_client import DelugeRPCClient import werkzeug as wz import base64 ######################################################## ########### Deluge Methods ################ ######################################################## def connect_to_deluge(): client = DelugeRPCClient(c...
from olv_dialog_controller import OlvDialogController from wound_assessment import WoundAssessment from patient_identification import PatientIdentification from skeleton_model import SkeletonModel from sqlalchemy.sql import func class WoundAssessmentController(OlvDialogController): """ Controller class for Wo...
#!/usr/bin/python """ This code uses .strip formatting once to remove the \n and another time to remove the \t from the below lists. For readability, the script uses a print("\n") to add a new line between the two lists """ island_list = ['Armstrong Island', 'Atchafalaya Island', 'Immokalee Island', 'Moultrie Island'...
# django imports from django.contrib.auth.models import User from django.contrib.auth.models import AnonymousUser from django.contrib.sessions.backends.file import SessionStore from django.shortcuts import get_object_or_404 from django.test import TestCase from django.test.client import Client from django.core.urlresol...
#!/usr/bin/env python # PyMtGoxMon v1.0 - Python-based monitor for MtGox BTC trading! # Copyright (C) 2013 Albert Huang. # # 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 th...
#import sys #import cairo #import math import rsvg from random import random # for myfn import widgets #from widgets.texteditor import TextEditor #from core.mathlib import MathLib #from core.world import TheWorld from ontology.movingthing import MovingThing SIZE = 0.05 # scaling constant class Human(MovingThing):...
############################################################################## # # Copyright (c) 2006 Zope Foundation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # THIS SOFT...
import enum class TarantoolError(Exception): """ Base Tarantool Exception class """ pass class TarantoolSchemaError(TarantoolError): """ Exception is raised when any problems with schema occurred """ pass class TarantoolDatabaseError(TarantoolError): """ Excepti...
from django.conf import settings from django.test import TestCase from django.core.files.base import ContentFile from file_manager.models import Asset, Folder from file_manager import s3_utils import logging logging.basicConfig( filename=settings.LOGFILE, level=logging.INFO, format=' %(asctime)s - %(le...
import pytest import os import Adafruit_BBIO.GPIO as GPIO def teardown_module(module): GPIO.cleanup() class TestGPIOOutput: def test_output_high(self): GPIO.setup("P8_10", GPIO.OUT) GPIO.output("P8_10", GPIO.HIGH) value = open('/sys/class/gpio/gpio68/value').read() assert int(...
# coding: utf-8 # Copyright (c) 2015 Fabian Barkhau <fabian.barkhau@gmail.com> # License: MIT (see LICENSE file) from kivy.uix.gridlayout import GridLayout from kivy.uix.scrollview import ScrollView class AbstractScrollView(ScrollView): def __init__(self, *args, **kwargs): # Setup scroll view ...
#!/usr/bin/env python # encoding: utf-8 import re import os try: from setuptools import setup, Extension from setuptools.command.build_ext import build_ext as _build_ext except ImportError: from distutils.core import setup, Extension from distutils.command.build_ext import build_ext as _build_ext de...
#!/usr/bin/python # coding: utf-8 -*- # (c) 2015, Hewlett-Packard Development Company, L.P. # # This module 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 optio...
from __future__ import print_function, division from sympy.core import S, sympify, cacheit, pi, I, Rational from sympy.core.add import Add from sympy.core.function import Function, ArgumentIndexError, _coeff_isneg from sympy.functions.combinatorial.factorials import factorial, RisingFactorial from sympy.functions.elem...
""" 5-fold cv - log loss 0.468809065953 """ import graphlab as gl import numpy as np import logging import os from hyperopt import fmin, hp, tpe from sklearn.base import BaseEstimator from sklearn.svm import LinearSVC from sklearn import preprocessing from otto_utils import consts, utils MODEL_NAME = 'model_11_xgb...
#!/usr/bin/env python # # Electrum - lightweight Bitcoin client # Copyright (C) 2012 thomasv@gitorious # # 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 witho...
""" mediatum - a multimedia content repository Copyright (C) 2010 Arne Seifert <seiferta@in.tum.de> 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...
# encoding: utf-8 # Copyright (C) 2013 John Törnblom # # This file is part of LLVM-P86. # # LLVM-P86 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...
import os; import sys; import traceback; ##################################################################### ## Create MQ Queues at cluster level ##################################################################### def createQueues(clusterName, DisplayName, jndiName, queueName, queueMgrName): clusterid=Adm...
import os import binascii import base64 import datetime import logging import queue import uuid from iotile.core.exceptions import IOTileException, ArgumentError, HardwareError from iotile.core.hw.transport.adapter import DeviceAdapter from iotile.core.hw.reports.parser import IOTileReportParser from iotile.core.dev.re...
import numpy as np from qutip import * from pylab import * from scipy.fftpack import fft import matplotlib.pyplot as plt import yaml from scipy.interpolate import interp1d class parameters: def __init__(self, wc, wq, eps, g, chi, kappa, gamma, t_levels, c_levels): self.wc = wc self.wq = wq ...
# -*- coding: utf-8 -*- import json from manager import Manager import os import subprocess from collections import defaultdict import psycopg2 from mview import MaterializedView from table import TableSelect from column import Column import settings from cursor import PyPgCursor import time import os import platform ...
from typing import Any, Dict from collections import OrderedDict from keras import backend as K class FixedRecurrence: ''' This recurrence class simply performs a fixed number of memory network steps and returns the memory representation and representation of the background knowledge generated by the...
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals # IMPORTANT: only import safe functions as this module will be included in jinja environment import frappe import operator import re, urllib, datetime, math import babel.dates fr...
#!/usr/bin/env python # -*- coding: utf-8 -*- # Import smtplib for the actual sending function import sys, os import smtplib import email # Import the email modules we'll need from email.mime.text import MIMEText from email.mime.multipart import MIMEMultipart from email.mime.text import MIMEText from email.header impo...
from __future__ import unicode_literals import tunigo from tunigo import utils class Playlist(object): def __init__( self, created=0, description='', id='', image='', location='', main_genre=None, main_genre_template...
#!/usr/bin/env python3 """ cylindrical-density.py : compute the density of atoms ("targets") around a centering selection, output a 2D histogram in r,z The expected use-case for this is looking at lipid packing around a membrane protein, when for whatever...
"""Scenario implementation. The pytest will collect the test case and the steps will be executed line by line. Example: test_publish_article = scenario( feature_name="publish_article.feature", scenario_name="Publishing the article", ) """ import collections import inspect import os import re import pytest f...
#!/usr/bin/env python """ toc.py, module definition of TOC class. This defines the Table of Contents of the presentation. """ # modules loading # standard library modules: these should be present in any recent python distribution import re # modules not in the standard library from yattag import Doc # global variables ...
from apgl.version import __version__ def checkImport(name): """ A function to check if the given module exists by importing it. """ try: import imp imp.find_module(name) return True except ImportError as error: return False def getPythonVersion(): """ Get ...
#!/usr/bin/env python ## SearchAndReplace.py import re input_string = "one hello is like any other hello" #(A) input_string = re.sub( 'hello', 'armadello', input_string ) #(B) print input_string #(C) # one armadello is lik...
""" Classes for use with genshi, these are the basic datastructres that are used to create populate the values of the templaes. """ __author__ = "Alex Warren" __copyright__ = "Copyright 2015, Autonomous Mapping Project" __credits__ = ["Alex Warren", "Rachel Powers", "Thomas Schuker", "Travis Kible...
import os import json import time import sys DeviceList = sys.argv[1] #this takes device list as argument TagList = sys.argv[2] #this takes Tag list as argument dir = os.path.dirname(__file__) json_file = os.path.join(dir, '../datapull/ekstepv3data/data/ME_SESSION_SUMMARY.json') output_file = os.path.join(dir, '../da...
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) import pytest from spack.main import SpackCommand versions = SpackCommand('versions') def test_safe_only_versions(): ...
""" The code that should be run on Travis """ import os import shlex import shutil import subprocess import sys import glob from cryptography.fernet import Fernet def decrypt_file(file, key): """ Decrypts the file ``file``. The encrypted file is assumed to end with the ``.enc`` extension. The decryp...
# -*- coding: utf-8 -*- """ Support for CFFI. Allows checking whether objects are CFFI functions and obtaining the pointer and numba signature. """ from __future__ import print_function, division, absolute_import from numba import * from numba.minivect.minitypes import * from numba.minivect import minitypes, minierror...
#!/usr/bin/env python # # x12c.c # # Bar chart demo. import sys import os module_dir = "@MODULE_DIR@" if module_dir[0] == '@': module_dir = os.getcwd () sys.path.insert (0, module_dir) # main # # Does a simple bar chart, using color fill. If color fill is # unavailable, pattern fill is used instead (automatic). ...
from ase import * from ase.lattice import bulk from ase.dft import monkhorst_pack from ase.parallel import paropen from gpaw import * from gpaw.wavefunctions.pw import PW from gpaw.xc.exx import EXX # Monkhorst-Pack grid shifted to be gamma centered k = 8 kpts = monkhorst_pack([k, k, k]) kpts += [1. / (2 * k), 1. / ( ...
"""Test User model manager""" from datetime import datetime from django.test import TestCase from improved_user.managers import UserManager from improved_user.models import User class UserManagerTestCase(TestCase): """Test User model manager""" def test_create_user_email_domain_normalize_rfc3696(self): ...
# ############################################################################ # 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 business i...
#-*- coding: utf-8 -*- from resources.lib import utils import base64 import hashlib import json import urllib import urllib2 import urlparse from resources.lib import globalvar title=['TF1','NT1','HD1','TMC','XTRA'] img=['tf1','nt1','hd1','tmc','xtra'] readyForUse=True #urlCatalog='http://api.mytf1.tf1....
import numpy as np from scipy.stats import ttest_ind from sklearn.metrics import accuracy_score def _diff_means(m, arr): """Calculate the difference-in-means statistic. This is based on an input array, `arr`, where the first `m` observations correspond to a particular class. Parameters ----------...
from warcio.limitreader import LimitReader from contextlib import closing from io import BytesIO class TestLimitReader(object): def test_limit_reader_1(self): assert b'abcdefghji' == LimitReader(BytesIO(b'abcdefghjiklmnopqrstuvwxyz'), 10).read(26) def test_limit_reader_2(self): assert b'abcde...
from player import Player class Action(): """The base class for all actions""" def __init__(self, method, name, hotkey, **kwargs): """Creates a new action :param method: the function object to execute :param name: the name of the action :param ends_turn: True if the player is e...
"""Common settings and globals.""" from os.path import abspath, basename, dirname, join, normpath from sys import path ########## PATH CONFIGURATION # Absolute filesystem path to the Django project directory: DJANGO_ROOT = dirname(dirname(abspath(__file__))) # Absolute filesystem path to the top-level project fold...
from ..utils import * ## # Free basic minions class CS2_122: """Raid Leader""" update = Refresh(FRIENDLY_MINIONS - SELF, buff="CS2_122e") CS2_122e = buff(atk=1) class CS2_222: """Stormwind Champion""" update = Refresh(FRIENDLY_MINIONS - SELF, buff="CS2_222o") CS2_222o = buff(+1, +1) class CS2_226: """Fr...
#!/usr/bin/env python # -*- coding: utf-8 -*- # vim:fileencoding=utf-8 # vim:tabstop=2 from random import Random from optparse import OptionParser from pydhcplib.dhcp_packet import DhcpPacket from pydhcplib.dhcp_network import DhcpClient from pydhcplib.type_hw_addr import hwmac from pydhcplib.type_ipv4 import ipv4 imp...
def oa(o): for at in dir(o): print at, ''' Sample calls and output for oa() below: # object attributes of a dict: oa({}) __class__ __cmp__ __contains__ __delattr__ __delitem__ __doc__ __eq__ __format__ __ge__ __getattribute__ __getitem__ __gt__ __hash__ __init__ __iter__ __le__ __len__ __lt__ __ne__ __ne...
import rnftools.rnfformat import re reg_lrn = re.compile(r"^([!-?A-^`-~]*)__([0-9a-f]+)__([!-?A-^`-~]+)__([!-?A-^`-~]*)$") reg_prefix_part = re.compile(r"^[!-?A-^`-~]*$") reg_id_part = re.compile(r"^[0-9a-f]+$") reg_segmental_part = re.compile(r"^(?:(\([0-9FRN,]*\))(?:,(?!$)|$))+$") reg_suffix_part = re.compile(r"^(?:...
__source__ = 'https://leetcode.com/problems/coin-change/description/' # https://github.com/kamyu104/LeetCode/blob/master/Python/create-maximum-number.py # Time: O(n * k), n is the number of coins, k is the amount of money # Space: O(k) # # Description: Leetcode # 322. Coin Change # # Note: # Good to note that the name...
""" Estimate contains functions to esimate aspects of blocks, either using internal models or by making calls out to external tool chains. """ from __future__ import print_function, unicode_literals import re import os import math import tempfile import subprocess import sys from ..core import working_block from .....
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models import django.utils.timezone from django.conf import settings class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ('aparcamiento...
from __future__ import division, print_function, absolute_import import unittest from .. import common import tempfile import os import platform import numpy as num from pyrocko import util, model from pyrocko.pile import make_pile from pyrocko import config, trace if common.have_gui(): # noqa from pyrocko.gui....
"""Routes and wsgi app creation""" import yaml import os import json import requests from pyramid.config import Configurator from pyramid.renderers import JSON from mist.io.resources import Root from mist.io import config import logging logging.basicConfig(level=config.PY_LOG_LEVEL, format=conf...
#!/usr/bin/env python import httplib import endpoints from protorpc import messages, message_types class ConflictException(endpoints.ServiceException): """ConflictException -- exception mapped to HTTP 409 response""" http_status = httplib.CONFLICT class ProfileMiniForm(messages.Message): """ProfileMini...
# -*- coding: utf-8 -*- """ _app_name_.helpers ~~~~~~~~~~~~~~~~ _app_name_ helpers module """ import pkgutil import importlib from flask import Blueprint from flask.json import JSONEncoder as BaseJSONEncoder def register_blueprints(app, package_name, package_path): """Register all Blueprint instanc...
# -*- coding: utf-8 -*- import six from shoop.xtheme.layout import Layout, LayoutCell from shoop.xtheme.plugins.text import TextPlugin from shoop.xtheme.rendering import get_view_config, render_placeholder from shoop.xtheme.theme import override_current_theme_class from shoop_tests.utils import printable_gibberish fro...
# -*- 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...
import os import logging import urllib.request class Downloader: def __init__(self, dataset, output_dir): self.dataset = dataset self.output_dir = output_dir def download(self): # Create data directory if it doesn't already exists if not os.path.isdir(self.output_dir): ...