code
stringlengths
1
199k
""" Jamdict Test Scripts """ import os from chirptext.cli import setup_logging TEST_DIR = os.path.abspath(os.path.dirname(__file__)) TEST_DATA = os.path.join(TEST_DIR, 'data') setup_logging(os.path.join(TEST_DIR, 'logging.json'), os.path.join(TEST_DIR, 'logs'))
""" WSGI config for mnm 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`` setti...
import numpy as np from abf_header_defs import * abf_header_dtype = np.dtype([\ ('fid_size_info', ### size: 40, offset: 0 [\ ('lFileSignature' , np.int32), ('fFileVersionNumber' , np.float32), ('nOperationMode' , np.int16), ('lActualAcqLength' , np.int32), ...
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('events', '0060_delete_single_image_from_event'), ] operations = [ migrations.AlterField( model_name='event', name='super_event_ty...
"""Top-level package for lintjenkins.""" __author__ = """westdoorblowcola""" __email__ = '510908220@qq.com' __version__ = '0.1.11' import pendulum try: from urllib.parse import urljoin except: from urlparse import urljoin from pyquery import PyQuery as pq import jenkins from . import template from . import cred...
from flask import request, session, redirect, url_for, current_app from .base import authlib_oauth_client from ..models.setting import Setting def google_oauth(): if not Setting().get('google_oauth_enabled'): return None def fetch_google_token(): return session.get('google_token') def update...
from __future__ import unicode_literals from djblets.webapi.errors import WebAPIError class WebAPITokenGenerationError(Exception): """An error generating a Web API token.""" pass UNSPECIFIED_DIFF_REVISION = WebAPIError( 200, "Diff revision not specified.", http_status=400) # 400 Bad Request INVALID...
from evy import patcher from evy.patched import httplib from evy.patched import socket patcher.inject('test.test_httplib', globals(), ('httplib', httplib), ('socket', socket)) if __name__ == "__main__": test_main()
""" WSGI config for djanblog 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/dev/howto/deployment/wsgi/ """ import os os.environ.setdefault("DJANGO_SETTINGS_MODULE", "djanblog.settings") from django.core.wsg...
from ...orders import Order from ...accounts import Account from ...adapters.quotes import QuoteAdapter from ...estimators import Estimator from copy import deepcopy from .MarketAdapter import MarketAdapter from ...logic.fill_order import fill_order from ...logic.close_expired_options import close_expired_options from ...
import pytest from django.core.urlresolvers import reverse from autobreadcrumbs.resolver import PathBreadcrumbResolver @pytest.mark.parametrize("path,segments", [ ('/foo/', [ '/', '/foo/', ]), ('foo/', [ '/', '/foo/', ]), ('/foo', [ '/', '/foo/', ]...
""" Tests for Main.py """ import pytest @pytest.fixture() def fixture_name(): return '' class TestCase1: def test_situation_1(self, fixture_name): assert fixture_name == '' def test_situation_1_error(self, fixture_name): with pytest.raises(ValueError): int(fixture_name)
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('news', '0005_auto_20180723_1631'), ] operations = [ migrations.AlterField( model_name='event', name='ingress_content', ...
def distance(p1, p2): """Return the Euclidean distance between `p1` and `p2`""" from math import sqrt return sqrt((p1.x - p2.x)**2 + (p1.y - p2.y)**2) def nearest(search_points, point, k=1): """Find the `k`th nearest point in `search_points` to `point`""" if k > len(search_points): raise Exc...
from __future__ import unicode_literals from .conf import settings from .fields import JSONField from .utils.choices import Choices from .utils.general import abspath from django.db import models from django.core.urlresolvers import reverse from django.core.urlresolvers import reverse_lazy from django.core.cache import...
import socket import unittest from redis import Redis from threading import Thread from time import sleep import subprocess import os import signal class UdpLoadBalancerTestCase(unittest.TestCase): LOAD_BALANCER_PORT = 8137 SERVERS_LIST = [ ('localhost', 9239), ('127.0.0.1', 9240), ('127...
import itertools import random from sqlalchemy import alias from sqlalchemy import and_ from sqlalchemy import bindparam from sqlalchemy import case from sqlalchemy import CHAR from sqlalchemy import column from sqlalchemy import create_engine from sqlalchemy import exc from sqlalchemy import exists from sqlalchemy imp...
from greengraph.graph import Greengraph from greengraph.map import Map from mock import Mock, patch, call import geopy from nose.tools import assert_equal import yaml import os import numpy as np start = 'London' end = 'Manchester' def test_graph_init(): with patch.object(geopy.geocoders,'GoogleV3') as mock_get: ...
__author__ = "stux!"
__author__ = 'jhlee' import cPickle import numpy as np import csv import sys import time import os.path EVENT = {'Ev101': 1, 'Ev102': 2, 'Ev103': 3, 'Ev104': 4, 'Ev105': 5, 'Ev106': 6, 'Ev107': 7, 'Ev108': 8, 'Ev109': 9, 'Ev110': 0} RATIO = {'Training': 0, 'Test': 1} class YLIMED(): def __init__(self, pathInfo, pat...
import os import math from textgrid import TextGrid, IntervalTier from polyglotdb.structure import Hierarchy from ..helper import guess_type, guess_trans_delimiter from ..types.parsing import * from ..parsers import TextgridParser def calculate_probability(x, mean, stdev): """ Calculates the probability that a ...
""" Created on Mon Feb 16 11:51:47 2015 Author: Oren Freifeld Email: freifeld@csail.mit.edu """ import numpy as np from of.utils import * from cpa.cpa1d.TransformWrapper import TransformWrapper from ClosedFormInt import ClosedFormInt from pylab import plt if __name__ == "__main__": nC = 20 nC = 50 nC = 100 ...
''' Created on 02/06/2013 @author: pablo ''' class Room(object): ''' Class representing a channel ''' DUPLICATED_MEMBER = "Duplicated member session" DUPLICATED_MODERATOR = "Duplicated moderator session" _room_id = "" _private = True _members = [] _moderators = [] _created_by = "...
from __future__ import absolute_import, unicode_literals import logging import os from datetime import datetime try: from subvertpy import ra, SubversionException, __version__ from subvertpy.client import Client as SVNClient, api_version, get_config has_svn_backend = (__version__ >= (0, 9, 1)) except Import...
import base64 import json import logging try: from urllib.parse import urlencode, urljoin from urllib.request import urlopen, Request from urllib.error import HTTPError except ImportError: from urllib.parse import urlencode from urllib.request import urlopen, Request from urllib.error import HTT...
from django.http import HttpResponse, HttpResponseRedirect, Http404 from django.template import RequestContext from django.shortcuts import render_to_response, get_object_or_404 from django.core.urlresolvers import reverse from django.core.context_processors import csrf from django.views.decorators.csrf import csrf_pro...
from base import IfbyphoneApiBase class Clicktofindme(IfbyphoneApiBase): def _call(self, **kwargs): """Connect a caller to a number defined in a findme application keyword arguments: phone_to_call -- phone number to initiate the call to findme_id -- ID of the findme used in t...
import os import sys root = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) sys.path.append(root + '/python') import ccxt # noqa: E402 kraken = ccxt.kraken({ 'apiKey': 'YOUR_API_KEY', 'secret': 'YOUR_SECRET', }) kraken.load_markets() for symbol in kraken.symbols: print( ...
from __future__ import absolute_import, unicode_literals from django import template register = template.Library() @register.simple_tag def get_model_fields(object_to_query): return dict( (field.name, field.value_to_string(object_to_query)) for field in object_to_query._meta.fields ) @register.simple_ta...
n = int(input()) socks = input().split(" ") print(sum([socks.count(s) // 2 for s in list(set(socks))]))
import mysql.connector import re if __name__ == "__main__": import catdb else: from lib import catdb class ConnectionLoader(object): def __init__(self, catalogconn, nodeconn, tableinfo, data): self.nodeconn = nodeconn self.catalogconn = catalogconn self.tableinfo = tableinfo ...
import matplotlib.pyplot as plt import numpy as np pointsA = np.random.normal(loc=[40, 60], scale=15, size=[200, 2]) plt.scatter(pointsA.T[0], pointsA.T[1], marker='o', label="A") pointsB = np.random.normal(loc=[80, 100], scale=12, size=[100, 2]) plt.scatter(pointsB.T[0], pointsB.T[1], marker='^', label="B") pointsC = ...
from jenkins_job_manager.version_control_constants import \ VersionControlConstants class RepositorySettings: @property def repository_type(self) -> str: return self._repository_type @repository_type.getter def repository_type(self) -> str: return self._repository_type @repositor...
from podiomirror.query import Select from podiomirror.remote_data_store import RemoteDataStore from podiomirror.transactions.merged_relation_transaction import \ MergedRelationTransaction from podiomirror.transactions.noop_transaction import NoOpTransaction from podiomirror.transactions.transaction import ADD_RELAT...
import mysql.connector as mariadb import logging from tqdm import * verbose = False def dbConnect(DB_USER, DB_HOST, DB_SCHEMA, DB_PASSWORD = None): if not DB_PASSWORD: DB_PASSWORD = input("Enter password: ") print("Opening connection to database...", end=" ") try: connection = mariadb.connec...
from mock import patch from findd.queue import HashTask from . import TestCase from findd.services import HashQueue class HashQueueTest(TestCase): @patch('findd.queue.hashfile') def test_should_not_raise_on_ioerrors(self, hashfile): sut = HashQueue(None) sut.append(HashTask('a.txt', 1, {}, False...
class Repo(object): def __init__(self, path): pass
import datetime import unittest from azure.cli.testsdk.scenario_tests import AllowLargeResponse from azure.cli.testsdk import ScenarioTest, ResourceGroupPreparer class AcrTokenCommandsTests(ScenarioTest): @AllowLargeResponse() @ResourceGroupPreparer() def test_repository_token_create(self): self.kwa...
import recipe_classes import transform def reconstruct(r): fs = '' fs += '%s\ttransformed to fit the following criteria: %s' % (r.name, r.transformation) fs += "\n\nIngredients:\n" for ing in r.in_list: fs += '\t-%s %s %s\n' % (ing.name, str(ing.amount), ing.amount_unit) fs += '\nSteps:\n' ...
from __future__ import unicode_literals from six.moves import range import json, os from semantic_version import Version import frappe import requests import subprocess # nosec from frappe.utils import cstr from frappe.utils.gitutils import get_app_branch from frappe import _, safe_decode import git def get_change_log(...
"""A coil/driver in the PKONE platform.""" import logging from collections import namedtuple from typing import Optional from mpf.core.platform import DriverConfig, SwitchSettings from mpf.platforms.interfaces.driver_platform_interface import DriverPlatformInterface, PulseSettings, HoldSettings MYPY = False if MYPY: #...
from itertools import izip import gzip import sys from collections import defaultdict as dd LIMIT = 10000 # do not go beyond this number of instance for one type lemma = [] pos = [] for l, p in izip(gzip.open(sys.argv[1]), gzip.open(sys.argv[2])): l = l.split() p = p.split() assert(len(l) == len(p)) for...
"""This module provides a subclass of `~webtest.runner.WebtestRunner` designed to aid you with finding parameter values in HTTP responses. It does this by attempting to match parameter names found in each request to the response body of any HTTP request that preceded it. To use it, simply call `get_correlation_runner` ...
''' @author: rtermondt ''' from django.http import HttpResponse, HttpResponseRedirect def about(request): return HttpResponse("Hello, world. You're at the innohub index.") def index(request): return HttpResponse("Hello, world. You're at the innohub index.") def isSessionValid(request): ret = False if 'p...
import os import sys import subprocess from zaifbot.errors import ZaifBotError def install_ta_lib(): if sys.platform.startswith('linux'): # fixme cwd = os.path.dirname(__file__) subprocess.call(['tar', '-xzf', 'ta-lib-0.4.0-src.tar.gz'], cwd=cwd) talib_path = os.path.join(cwd, 'ta-li...
from __future__ import unicode_literals from django.db import migrations, models import django.utils.crypto import functools class Migration(migrations.Migration): dependencies = [ ('groups', '0004_auto_20151128_1855'), ] operations = [ migrations.AlterField( model_name='accessto...
SCRIPT_NAME = "autoconnect" SCRIPT_AUTHOR = "arno <arno@renevier.net>" SCRIPT_VERSION = "0.3.1" SCRIPT_LICENSE = "GPL3" SCRIPT_DESC = "reopens servers and channels opened last time weechat closed" SCRIPT_COMMAND = "autoconnect" try: import weechat except: print "This script must be run under WeeChat." ...
from fastapi import FastAPI app = FastAPI() @app.get("/items/{item_id}") async def read_user_item( item_id: str, needy: str, skip: int = 0, limit: int | None = None ): item = {"item_id": item_id, "needy": needy, "skip": skip, "limit": limit} return item
class Decoder: # In a class method, always list self as first parameter def __init__(self): print() def decode(self, aString, aCipher): aString = aString.lower() decodedString = '' for aChar in aString: decodedString = decodedString + aCipher[aChar] return ...
import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "readbin.settings") from django.core.management import execute_from_command_line execute_from_command_line(sys.argv)
from PyQt4 import QtCore, QtGui try: _fromUtf8 = QtCore.QString.fromUtf8 except AttributeError: _fromUtf8 = lambda s: s class Ui_MainWindow(object): def setupUi(self, MainWindow): MainWindow.setObjectName(_fromUtf8("MainWindow")) MainWindow.setEnabled(True) MainWindow.resize(745, 514...
from __future__ import print_function from __future__ import unicode_literals from __future__ import absolute_import from __future__ import division import matplotlib.pyplot as plt import numpy as np from random import seed from concept_formation.examples.examples_utils import avg_lines from concept_formation.evaluatio...
from rest_framework import serializers from service.quickstart.models import Account, Message class AccountSerializer(serializers.HyperlinkedModelSerializer): class Meta: model = Account fields = ('label', 'cc', 'phone', 'sms_code', 'api_password', 'mcc') class MessageSerializer(serializers.Hyperlin...
import sys sys.path.append("..") from datetime import timedelta from werkzeug.exceptions import PreconditionFailed, NotFound from mongoengine import Q from hackathon import Component, RequiredFeature, Context from hackathon.constants import EStatus, VERemoteProvider, VE_PROVIDER, VEStatus, ReservedUser, \ HACK_NOTI...
import requests import logging def do_request(server_url, name, data=None): files = None if 'photo' in data: files = {'photo': ('route.png', data['photo'], 'image/png')} del data['photo'] r = requests.post('/'.join([server_url, name]), data=data, files=files) if r: logging.warnin...
vals = [0,10,-30,173247,123,19892122] formats = ['%x','%020x','%X', '%020X', '%-20x', '%#x'] for val in vals: for fmt in formats: print(fmt+":", fmt % val)
""" This code is released under the GNU Affero General Public License. OpenEnergyMonitor project: http://openenergymonitor.org Updated by Francisco Zamora-Martinez to be compatible with raspi-monitoring-system. """ import serial import time import datetime import socket import select import traceback import r...
from books.model.Address import Address class Organization: """This class is used to create object for organization.""" def __init__(self): """Initialize parameters for organization object. """ self.organization_id = '' self.name = '' self.is_default_org = None self.accou...
from __future__ import absolute_import from rest_framework.decorators import list_route, detail_route from rest_framework.response import Response from rest_framework.viewsets import GenericViewSet, ViewSet from rest_framework_rules.decorators import permission_required from rest_framework_rules.mixins import Permissio...
import pygame as pg black = (0, 0, 0) white = (255, 255, 255) red = (200, 0, 0) green = (0, 255, 0) blue = (0, 0, 200) yellow = (255, 255, 0) aqua = (0, 255, 255) silver = (192, 192, 192) dark_silver = (220, 220, 220) bright_red = (255, 0, 0) bright_blue = (0, 0, 255) light_grey = (100, 100, 100) dark_grey = (40, 40, 4...
from firecares.settings.base import * INSTALLED_APPS += ('debug_toolbar', 'fixture_magic') MIDDLEWARE_CLASSES += ('debug_toolbar.middleware.DebugToolbarMiddleware', ) INTERNAL_IPS = ( '127.0.0.1', ) DEBUG_TOOLBAR_CONFIG = { 'INTERCEPT_REDIRECTS': False, 'SHOW_TEMPLATE_CONTEXT': True, 'HIDE_DJANGO_SQL': ...
import pickle import cPickle import numpy from sklearn import cross_validation from sklearn.feature_extraction.text import TfidfVectorizer from sklearn.feature_selection import SelectPercentile, f_classif def preprocess(words_file = "../tools/word_data.pkl", authors_file="../tools/email_authors.pkl"): """ t...
import markdown from markbook import db class Note(db.Model): __tablename__ = "notes" id = db.Column(db.Integer, primary_key=True) title = db.Column(db.String, unique=True, nullable=False) text = db.Column(db.String, nullable=False) def __init__(self, title, text): self.title = title ...
def ispalin(s): return str(s)==str(s)[::-1] max=0 for i in xrange(999,99,-1): a,b,c = i/100, (i/10)%10, i%10 n = 1000*i + 100*c + 10*b + a #print i,n for j in xrange(101, 1000): if n%j==0 and n/j<999: print n break if j!=999: break
from powerprompt.core import ColorBlock from powerprompt.segments import BaseSegment import os class RootSegment(BaseSegment): name = 'root' def __init__(self, settings): super(RootSegment, self).__init__(settings) if os.environ.get('LAST_EXIT', '0') <> '0': self.bg_color = self.sett...
""" Created on Mon Oct 31 15:45:22 2016 @author: wang """ from read_wav_xml_good_1 import* from matrix_24_2 import* from max_matrix_norm import* import numpy as np filename = 'francois_filon_pure_3.wav' filename_1 ='francois_filon_pure_3.xml' word ='ne' wave_signal_float,framerate, word_start_point, word_length_point, ...
import os import shlex import subprocess import time import unittest class MapZipDaemonWatchTestCase(unittest.TestCase): def setUp(self): setup() def test_watchdog(self): # Check if setup worked correct self.assertTrue(os.path.exists('/tmp/webdir/fastdownload/maps')) self.assertT...
from traveler import app from .backend import process_entry, process_update, save_entry @app.route('/fake/save_entry', methods=['GET', 'POST']) def fake_save(): """Save new info to the database. The info is user input that arrives in the http request object.""" data = process_entry() # Put custom code h...
import os from urllib.request import urlretrieve import pandas as pd FREMONT_URL = 'https://data.seattle.gov/api/views/65db-xm6k/rows.csv?accessType=DOWNLOAD' def get_fremont_data(filename='Fremont.csv',url=FREMONT_URL, force_download=False): """Download and cache the Fremont data Parameters ========== filenam...
from server import db from server.models import * db.create_all()
from activitylog import * from datetime import datetime from datetime import date def createDB(): db.create_tables([Person, ActivityType, Activity, MeasurementType, Measurement, Location]) def defaultActivities(): root = ActivityType.create(name="BaseActivityType", is_abstract=True) mindful = ActivityType.c...
import os, sys import mercadopago import json def index(req, **kwargs): preference = { "items": [ { "title": "Multicolor kite", "quantity": 1, "currency_id": "CURRENCY_ID", # Available currencies at: https://api.mercadopago.com/currencies "unit_price": 10.0 } ], "shipments": { "mode": "m...
a=input("digite para qual unidade vc quer converter H(hexadecimal)B(binario)O(octal): ") if a =='B': x=int(input("digite um numero : ")) c="{:b}".format(x) print (c) if a =='H': x=int(input("digite um numero : ")) c='{:x}'.format(x) print(c) if a =='O': x=int(input("digite um numero : ")) ...
from flask import request with app.test_request_context('/hello', method='POST'): # now you can do something with the request until the # end of the with block, such as basic assertions: assert request.path == '/hello' assert request.method == 'POST' with app.request_context(environ): assert request...
__author__ = "Ole Christian Weidner" __copyright__ = "Copyright 2012, Ole Christian Weidner" __license__ = "MIT"
from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('app', '0005_playlistitem_url'), ] operations = [ migrations.AddField( model_name='playlist', name='name', field=model...
import os import pytest import optimus from optimus.setup_project import setup_project from optimus import PROJECT_DIR_ENVVAR, SETTINGS_NAME_ENVVAR from optimus.conf.loader import import_project_module def test_fail_basedir(monkeypatch, caplog, fixtures_settings, flush_settings): """ Fail because project base d...
"""create colormaps with user-specified number of intervals. """ import matplotlib.pyplot as plt import numpy as np from matplotlib.colors import from_levels_and_colors def setup_colormap(vmin, vmax, nlevs=5, cmap=plt.get_cmap('Greens'), extend='both'): """ create a discret...
import mimetypes import os.path import time class Staticfile: """ Generic class that you can use to dispatch static files You must use it like this: static=Staticfile("/rootpath/") evhttp.http_cb("/static/",static) NOTE: you must be consistent between /rootpath/ and /static/ concerning the endin...
from pylab import * from numpy import * """ try: from pylab import * pylabload = 'y' except ImportError: print "pylab could not be imported." pylabload = 'n' try: from matplotlib.font_manager import fontManager, FontProperties matplotload = 'y' except ImportError: print "maplotlib features could not be imported....
"""zchat 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-based...
import json import copy from typing import Optional, TypeVar, TypedDict from zirc.event import Event from zirc.wrappers import connection_wrapper class SeenDB(TypedDict): time: float message: str class UserDB(TypedDict): hostmask: str host: str account: str modes: str seen: list[SeenDB] _KT ...
""" smsc.exceptions module. This module contains the set of smsc' exceptions. :copyright: (c) 2017 by Alexey Shevchenko. :license: MIT, see LICENSE for more details. """ class SMSCException(Exception): """There was an ambiguous exception that occurred while handling your SMSC API request.""" class SendError(SMSCExc...
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('sites', '0001_initial'), ] operations = [ migrations.CreateModel( name='Redirect', fields=[ ('id', models.AutoFie...
from init import * import glob from computed import * import xlrd import datetime from util import (notify, throwException, kilDist, mileDist, getDate, getDateNum, getClockTime, getSeconds, getMinutes, getHours, getDateTime, getDateNumForChile, xldate_to_datetime, getExcelDate) COMPUTED = None SAMPLE_...
"""Main Shell file. Here we try to import modules, get system information, and start the main shell loop.""" import os import sys import platform import getpass import subprocess import shlex import execute from memesh_builtins import memesh_help from status import Status try: import readline READLINE = True e...
from __future__ import unicode_literals THOUSAND_SEPARATOR = ','
from modeledcommandparameter import * from pseudoregion import * class Refp(ModeledCommandParameter, PseudoRegion): """ Reference particle """ begtag = 'REFP' endtag = '' models = { 'model_descriptor': {'desc': 'Phase model', 'name': 'phmodref', ...
""" Flex Messaging implementation. This module contains the message classes used with Flex Data Services. .. seealso:: `RemoteObject on OSFlash <http://osflash.org/documentation/amf3#remoteobject>`_ .. versionadded: 0.1 """ import pyamf from plasma.flex.messaging.messages import operations __all__ = [ 'AsyncMes...
from __future__ import absolute_import from klass import NativeClass from classtypes import Method from classconstants import * class PrintStream(NativeClass): def __init__(self): NativeClass.__init__(self) self.methods = { 'println': Method(0, 'println', '(Ljava/lang/String;)V', [])...
"""Test RPCs related to blockchainstate. Test the following RPCs: - gettxoutsetinfo - getdifficulty - getbestblockhash - getblockhash - getblockheader - getnetworkhashps - verifychain Tests correspond to code in rpc/blockchain.cpp. """ from decimal import Decimal from test_framework.test_fra...
from __future__ import print_function import setuptools import os import shutil import subprocess import sys from setuptools import setup, find_packages with open("README.md") as fh: long_description = fh.read() setup( name="dynapython", version="__dynizer_version__", author="Dynactionize NV", autho...
""" Current WsgiDAV version number. http://peak.telecommunity.com/DevCenter/setuptools#specifying-your-project-s-version http://peak.telecommunity.com/DevCenter/setuptools#tagging-and-daily-build-or-snapshot-releases """ __version__ = "1.1.0"
from InputParser import InputParser from CacheManager import CacheManager def process_file(filename): parser = InputParser() parser.parse("in/" + filename + ".in") manager = CacheManager() manager.videos = parser.getVideos() manager.caches = parser.getCaches() manager.endpoints = parser.getEndPo...
from google.appengine.ext import ndb class Guest(ndb.Model): first = ndb.StringProperty() last = ndb.StringProperty() def AllGuests(): return Guest.query() def UpdateGuest(id, first, last): guest = Guest(id=id, first=first, last=last) guest.put() return guest def InsertGuest(first, last): gu...
import _plotly_utils.basevalidators class LegendgroupValidator(_plotly_utils.basevalidators.StringValidator): def __init__(self, plotly_name="legendgroup", parent_name="candlestick", **kwargs): super(LegendgroupValidator, self).__init__( plotly_name=plotly_name, parent_name=parent_na...
import structlog from eth_utils import is_binary_address, to_checksum_address, to_normalized_address from raiden.constants import GAS_LIMIT_FOR_TOKEN_CONTRACT_CALL from raiden.exceptions import RaidenUnrecoverableError, TransactionThrew from raiden.network.rpc.client import check_address_has_code from raiden.network.rp...
class ChecksumTuple: def __init__(self, filename, absolute_filename, checksum): pass
import os from flask import Flask, request app = Flask(__name__) @app.route("/command1") def command_injection1(): files = request.args.get('files', '') # Don't let files be `; rm -rf /` os.system("ls " + files)
from runner.koan import * class AboutMultipleInheritance(Koan): class Nameable: def __init__(self): self._name = None def set_name(self, new_name): self._name = new_name def here(self): return "In Nameable class" class Animal: def legs(self): ...