src
stringlengths
721
1.04M
import sys import traceback from django.conf import settings class AppNotFoundError(Exception): pass class ClassNotFoundError(Exception): pass def get_class(module_label, classname): return get_classes(module_label, [classname, ])[0] def get_classes(module_label, classnames): """ Imports a set ...
import cherrypy from cherrypy.lib.static import serve_file from cherrypy.process.plugins import SimplePlugin from queue import Queue, Empty from collections import namedtuple from concurrent import Crawler import parsing import json import traceback import random from urllib.parse import unquote from ws4py.websocket i...
# =============================================================================== # Copyright 2020 ross # # 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/LICE...
from smtpcom.sendapi.send import SendAPI from smtpcom.sendapi.report import ReportAPI from smtpcom.sendapi.campaign import CampaignAPI from smtpcom.sendapi.template import TemplateAPI class API(object): def __init__(self, content_type='json'): self.__report = ReportAPI(content_type) self.__templat...
# coding=utf-8 # Copyright 2021 The Uncertainty Baselines Authors. # # 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 ap...
# -*- coding: utf-8 -*- ''' Salt-specific interface for calling Salt Cloud directly ''' # Import python libs from __future__ import absolute_import import os import logging import copy # Import salt libs try: import salt.cloud HAS_SALTCLOUD = True except ImportError: HAS_SALTCLOUD = False import salt.uti...
import numpy as np import io,operator,sys,os,re,mimetypes,csv,itertools,json,shutil,glob,pickle,tarfile,collections import hashlib,itertools,types,inspect,functools,random,time,math,bz2,typing,numbers,string import multiprocessing,threading,urllib,tempfile,concurrent.futures,matplotlib,warnings,zipfile from concurren...
# encoding = utf-8 import os import sys import time import datetime import json def validate_input(helper, definition): api_env = definition.parameters.get('api_env', None) instanceid = definition.parameters.get('instance_id', None) apikey = definition.parameters.get('apikey', None) api_limit = defin...
# -*- coding: utf-8 -*- # Copyright (c) 2007 - 2014 Detlev Offenbach <detlev@die-offenbachs.de> # """ Module implementing a dialog to add a new Python package. """ from __future__ import unicode_literals from PyQt5.QtWidgets import QDialog, QDialogButtonBox from PyQt5.QtCore import pyqtSlot from .Ui_NewPythonPacka...
import os import sys import numpy as np import pymconvolve import numpy.ma as ma import fitsio from mask_or_fit import GetSExObj from runsexfunc import RunSex def QuarterMask(z, zm, xcntr, ycntr, bbya, pa, quarter): nxpts, nypts = z.shape zmm = np.ones_like(z) co = np.cos(pa * np.pi / 180.0) si = np.s...
import os import sys import distutils.spawn from vex.run import run from vex import exceptions PYDOC_SCRIPT = """#!/usr/bin/env python from pydoc import cli cli() """.encode('ascii') PYDOC_BATCH = """ @python -m pydoc %* """.encode('ascii') def handle_make(environ, options, make_path): if os.path.exists(make_...
from __future__ import division, print_function, absolute_import from scipy import array, arange, ones, sort, cos, pi, rand, \ set_printoptions, r_ from scipy.sparse.linalg import lobpcg from scipy import sparse from pylab import loglog, show, xlabel, ylabel, title set_printoptions(precision=8,linewidth=90...
# -*- coding: utf-8 -*- """ Test for: command line arguments """ from nose.tools import eq_, assert_raises from m2bk import app, config, const import os def _get_arg_cfg_file_name(arg, filename): try: app.init_parsecmdline([arg, filename]) except FileNotFoundError: pass return config.get...
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import webnotes from webnotes import _, msgprint from webnotes.utils import flt import time from accounts.utils import get_fiscal_year from controllers.trends import ...
# Backend configuration options are stored here from collections import OrderedDict class Conf: def __init__(self): self.WEB_ROOT = "/var/www/html/" self.PLUGIN_DIRECTORY = "/usr/lib/nagios/plugins/" self.DATABASE_USERNAME = "root" self.DATABASE_PASSWORD = "" self.DATABAS...
#!/usr/bin/env python # # Copyright 2016 Google Inc. # # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Download an updated VS toolchain""" import argparse import common import json import os import shlex import shutil import subprocess import sys import utils...
#!/usr/bin/env python import click import zmq import logging import socket import urlparse import time import h5py import os def to_bind(address): """Parse an address to a bind address.""" parsed = urlparse.urlparse(address) hostname = socket.gethostbyname(parsed.hostname) return "{0.scheme}://{hostn...
# -*- coding: utf-8 -*- import os # Random Spiral Fractals # FB36 - 20130929 import math import random from collections import deque from PIL import Image imgx = 512 imgy = 512 image = Image.new("RGB", (imgx, imgy)) pixels = image.load() xa = -1.5 xb = 1.5 ya = -1.5 yb = 1.5 # view n = random.randint(2, 9) # of s...
import networkx as nx from .s_c_c import filter_big_scc from .s_c_c import get_big_sccs import os.path import sys sys.setrecursionlimit(5500000) def get_agony(edge, players): u, v = edge return max(players[u] - players[v], 0) def get_agonies(edges, players): edges_agony_dict = {} for edge in edges:...
import os import unittest import h5py import numpy as np import bald from bald.tests import BaldTestCase def _fattrs(f): f.attrs['rdf__type'] = 'bald__Container' group_pref = f.create_group('bald_prefix_list') group_pref.attrs['bald__'] = 'https://www.opengis.net/def/binary-array-ld/' group_pref.attr...
import pytest import re import capybara from capybara.exceptions import ElementNotFound class TestAssertSelector: @pytest.fixture(autouse=True) def setup_session(self, session): session.visit("/with_html") def test_does_not_raise_if_the_given_selector_is_on_the_page(self, session): sessi...
<<<<<<< HEAD from ListNode import ListNode class Solution(object): def swapPairs(self, head): if not head or not head.next : return head resNode = head.next while head : pre = head head = head.next.next ======= # https://leetcode.com/problems/swap-nodes-i...
# defining the base filter curve classes import os from scipy import interpolate from wsynphot.spectrum1d import SKSpectrum1D as Spectrum1D import pandas as pd from wsynphot.io.cache_filters import load_filter_index, load_transmission_data from astropy import units as u, constants as const from astropy import uti...
# encoding: utf-8 import nose.tools import ckan.tests.helpers as helpers import ckan.tests.factories as factories import ckan.logic as logic import ckan.model as model import ckan.plugins as p import ckan.lib.search as search assert_equals = nose.tools.assert_equals assert_raises = nose.tools.assert_raises class T...
# Created By: Virgil Dupras # Created On: 2004-12-27 # Copyright 2010 Hardcoded Software (http://www.hardcoded.net) # # This software is licensed under the "BSD" License as described in the "LICENSE" file, # which should be included with this package. The terms are also available at # http://www.hardcoded.net/licens...
#!/usr/bin/env python import logging import optparse import traceback import unittest import sys import os import utils import framework from queryservice_tests import cache_tests from queryservice_tests import nocache_tests from queryservice_tests import stream_tests from queryservice_tests import status_tests from...
# Copyright 2015 Dell Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agree...
""" #------------------------------------------------------------------------------- # Name: arcapi_test # Purpose: Tests for arcapi module. # # Author: Filip Kral, Caleb Mackay # # Created: 01/02/2014 # Updated: 05/15/2014 # Licence: LGPL v3 #--------------------------------------...
# 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...
"""Regression tests for optimize. """ from __future__ import division, print_function, absolute_import import numpy as np from numpy.testing import TestCase, run_module_suite, assert_almost_equal, \ assert_raises import scipy.optimize class TestRegression(TestCase): def test_newton_x0_is...
# -*- coding: utf-8 -*- """ """ import logging from pp.apiaccesstoken.tokenmanager import Manager from pp.apiaccesstoken.tokenmanager import AccessTokenInvalid from pp.apiaccesstoken.headers import WSGI_ENV_ACCESS_TOKEN_HEADER def get_log(e=None): return logging.getLogger("{0}.{1}".format(__name__, e) if e else ...
# Copyright (c) 2016-present, Facebook, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed...
try: import unittest2 as unittest except ImportError: import unittest from sourcemap.objects import Token, SourceMapIndex class TokenTestCase(unittest.TestCase): def test_eq(self): assert Token(1, 1, 'lol.js', 1, 1, 'lol') == Token(1, 1, 'lol.js', 1, 1, 'lol') assert Token(99, 1, 'lol.js',...
#!/usr/bin/env python # _*_ coding: utf-8 _*_ # @Time : 2018/4/1 16:24 # @Author : Soner # @version : 1.0.0 # @license : Copyright(C), Your Company from appium import webdriver from selenium.webdriver.common.by import By from time import sleep import unittest import xlutils,xlrd,xlwt class Anewnotest1(unittest.T...
#!/usr/bin/env python ############################################################################### ## ## Copyright (C) 2014 Greg Fausak ## ## 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...
# -*- coding: utf-8 -*- """ Django staging settings for knowledge_base project. """ import os import urlparse from . import * # noqa DEBUG = False TEMPLATE_DEBUG = DEBUG ALLOWED_HOSTS = [ 'kb.pythonballz.com' ] # Application definition INSTALLED_APPS += ( 'opbeat.contrib.django', ) MIDDLEWARE_CLASSES +=...
"""This demo program solves the incompressible Navier-Stokes equations on an L-shaped domain using Chorin's splitting method.""" # Copyright (C) 2010-2011 Anders Logg # # This file is part of DOLFIN. # # DOLFIN is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Publi...
# coding: utf8 from __future__ import print_function, absolute_import import datetime import inspect import re import sys import time import traceback import types import os import multiprocessing from collections import defaultdict from spinoff.util.python import dump_method_call try: import colorama except Impo...
from __future__ import unicode_literals from ..helpers import assert_equal, fixture from subprocess import Popen, PIPE def test_unicode(): data_in = fixture('utf8-demo.txt').read() p = Popen('logtag -f init_txt | logtext', shell=True, stdout=PIPE, stdin=PIPE) dat...
# coding: utf-8 # # Copyright 2014 The Oppia Authors. 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 requi...
#!/usr/bin/env python3 """ hexdump(1) for Unicode data """ from typing import IO from unidump.output import sanitize_char, print_line, fill_and_print from unidump.env import Env VERSION = '1.1.3' def unidump(inbytes: IO[bytes], env: Env) -> None: """take a list of bytes and print their Unicode codepoints ...
# -*- coding: utf-8 -*- """ Test function name mangling. The mangling affects the ABI of numba compiled binaries. """ from numba.core import types, utils from numba.core.funcdesc import default_mangler from numba.tests.support import unittest, TestCase class TestMangling(TestCase): def test_one_args(self): ...
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2015 XCG Consulting # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Publ...
import numpy as np import datetime as dt import os.path default_undef_val=1.0e33 def read_data_direct(inputfilename,nx,ny,nz,dtypein,undef_in=default_undef_val,undef_out=default_undef_val,seq_acces=False): #dtypein is the native input data format. #>f32 for big endian data format with single precission. #f32 for litt...
#!/usr/bin/python import logging logging.basicConfig(level=logging.INFO) from ftplib import FTP import os ftp = FTP('10.0.0.6') while not ftp.login(): os.sleep(5) #ftp.cwd('/media/...') for d in ftp.nlst(): if os.path.isdir(d): logging.info('Already have directory %s' % d) if False: ...
from django.shortcuts import render, redirect from .models import Disk, Box from django.contrib import auth from django.contrib import messages from django.http import HttpResponse from django.core import serializers from .disk import save_db from os import system from django.shortcuts import render_to_response from ....
from collections import OrderedDict from Orange.data import Table from Orange.classification.tree import TreeLearner from Orange.widgets import gui from Orange.widgets.settings import Setting from Orange.widgets.utils.owlearnerwidget import OWBaseLearner class OWClassificationTree(OWBaseLearner): name = "Classif...
""" Test the Newton solver """ import unittest import numpy # pylint: disable=F0401,E0611 from openmdao.lib.drivers.newton_solver import NewtonSolver from openmdao.lib.optproblems.scalable import Discipline from openmdao.lib.optproblems.sellar import Discipline1_WithDerivatives, \ ...
# # gPrime - A web-based genealogy program # # Copyright (C) 2016 Gramps Development Team # # 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 of the License, or # (at your o...
from django.contrib.auth.models import User from django.test import TestCase from django.urls import reverse from foodlust.tests.factories import UserFactory, MealFactory class MemberTestCase(TestCase): """ This class will establish the test cases for the member model.""" def setUp(self): """ Setup f...
""" Sets the global freeze status for the course run to "complete" """ from celery.result import GroupResult from django.core.cache import caches from django.core.management import BaseCommand, CommandError from courses.models import CourseRun from grades.models import CourseRunGradingStatus from grades.tasks import C...
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( determine_ext, int_or_none, unescapeHTML, unified_timestamp, ) class ExpressenIE(InfoExtractor): _VALID_URL = r'''(?x) https?:// (?:www\.)?expres...
import logging import socket import threading import SocketServer import time from recvall import * from calc import * logging.basicConfig( level = logging.DEBUG, format = "%(name)s: %(message)s", ) class MyTCPRequestHandler(SocketServer.BaseRequestHandler): def __init__(self, request, client_address, server): se...
# Copyright (c) 2013-2014 Rackspace, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to ...
import falcon # from main.settings import DB as db # from main.helpers import QueryParser import json import urlparse from werkzeug.http import parse_options_header from werkzeug.formparser import parse_form_data from cStringIO import StringIO from werkzeug.wsgi import LimitedStream from werkzeug import secure_filename...
#!/usr/bin/python ######################################################################## ####################### FLAC Batch Re-encode ######################### # A Python 2.7 script for batch parallel re-encoding many FLAC files. # # This is useful to make sure that your whole FLAC library is using # # the lat...
# # Copyright 2019 The FATE Authors. 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 appli...
import nltk class PosTags: def tag(self, t, as_dicts=True): ''' With a list of tokens, mark their part of speech and return a list dicts (no native tuple type in dataframes it seems). ''' pos = nltk.pos_tag(t) if as_dicts: return self.to_dicts(pos) ...
import matplotlib.pyplot as plt from numpy import array, dot from numpy.linalg import norm from explauto.environment.environment import Environment from explauto.utils import bounds_min_max class SliderEnvironment(Environment): ''' Add a slider to an environment ''' def __init__(self, env_cls, env_config, m_...
############################################################################### # # file: common.py # # Purpose: holds common helper functions used by termsaver code. # # Note: This file is part of Termsaver application, and should not be used # or executed separately. # #############################...
# -*- coding: UTF-8 -*- # Copyright 2012-2017 Luc Saffre # License: BSD (see file COPYING for details) """ Creates fictive demo bookings with monthly purchases. See also: - :mod:`lino_xl.lib.finan.fixtures.demo_bookings` - :mod:`lino_xl.lib.sales.fixtures.demo_bookings` - :mod:`lino_xl.lib.invoicing.fixtures.demo_bo...
#!/usr/bin/python import abc import math import common from color import Color class Filter(common.ChainLink): def __init__(self): self.next = None super(Filter, self).__init__() def call_filter(self, t, col): if self.next: return self.next.filter(t, col) return co...
"""DHCPv4 options part1""" # pylint: disable=invalid-name,line-too-long import pytest import srv_control import misc import srv_msg @pytest.mark.v4 @pytest.mark.options @pytest.mark.subnet def test_v4_options_subnet_mask(): # Checks that server is able to serve subnet-mask option to clients. misc.test_set...
# encoding: utf-8 """ peer.py Created by Thomas Mangin on 2009-08-25. Copyright (c) 2009-2015 Exa Networks. All rights reserved. """ import time # import traceback from exabgp.bgp.timer import ReceiveTimer from exabgp.bgp.timer import SendTimer from exabgp.bgp.message import Message from exabgp.bgp.fsm import FSM fr...
""" Reference level checker (existence of given references or all refs/heads ans refs/tags). """ from common import Common from utils import check_diff def __filter(reference_list): return set(reference for reference in reference_list if reference.split('/')[1] in ('heads', 'tags')) def check():...
#!/usr/bin/python from __future__ import absolute_import, division, print_function, unicode_literals import picamera import time import pi3d W, H = 800, 600 with picamera.PiCamera() as camera: camera.resolution = (W, H) camera.framerate = 24 camera.start_preview() #NB layer argument below, fps as sl...
# coding: utf-8 from datetime import datetime, timedelta import time from django import template from django.db.models import Q, F from zds.article.models import Reaction, ArticleRead from zds.forum.models import TopicFollowed, never_read as never_read_topic, Post, TopicRead from zds.mp.models import PrivateTopic, P...
from __future__ import absolute_import, unicode_literals from chatpro.profiles.tasks import sync_org_contacts from dash.orgs.models import Org from django.contrib.auth.models import User from django.db import models from django.utils.translation import ugettext_lazy as _ class Room(models.Model): """ Corresp...
#!/usr/bin/env python3 from urllib.request import urlopen from bs4 import BeautifulSoup import pandas as pd import html5lib import pdb from collections import OrderedDict import json import csv import contextlib url = "https://kenpom.com/index.php" #url = "https://kenpom.com/index.php?y=2017" #past year testing over...
import csv import itertools import random import ast import sys #usage # python parseResults.py results.txt fname = '../results/model_results/'+sys.argv[1] file_names = [fname] itemfile = open("items.txt") items = [" ".join(l.rstrip().split()) for l in itemfile.readlines()] itemfile.close() print items lines = []...
from functools import reduce from django.shortcuts import render, get_object_or_404 from django.core.paginator import Paginator from django.db.models import Q, Prefetch from squad.core.models import Project, Group, Build from squad.core.comparison import TestComparison, MetricComparison from squad.frontend.utils impo...
#!/usr/bin/env python3 from __future__ import (absolute_import, division, print_function) import json import numpy as np import pandas as pd from datetime import datetime ### plotly from plotly import tools as toolsly from plotly.offline import plot import plotly.graph_objs as go ### matplotlib #import matplotlib #imp...
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2015 CERN. # # Invenio 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 of the # License, or (at your option) any later...
import unittest from conans.test.tools import TestClient, TestServer from conans.test.utils.test_files import hello_source_files from conans.client.manager import CONANFILE import os from conans.model.ref import ConanFileReference, PackageReference from conans.paths import CONAN_MANIFEST, CONANINFO from conans.util.fil...
#SBaaS base from SBaaS_base.postgresql_orm_base import * class data_stage03_quantification_dG0_f(Base): __tablename__ = 'data_stage03_quantification_dG0_f' id = Column(Integer, Sequence('data_stage03_quantification_dG0_f_id_seq'), primary_key=True) reference_id = Column(String(100)) met_name = Column(St...
"""Pushsafer platform for notify component.""" import base64 import logging import mimetypes import requests from requests.auth import HTTPBasicAuth import voluptuous as vol from homeassistant.components.notify import ( ATTR_DATA, ATTR_TARGET, ATTR_TITLE, ATTR_TITLE_DEFAULT, PLATFORM_SCHEMA, B...
import logging import os from pulp.server.compat import json from pulp.plugins.util.metadata_writer import JSONArrayFileContext from pulp_docker.common import constants from pulp_docker.plugins.distributors import configuration _LOG = logging.getLogger(__name__) class RedirectFileContext(JSONArrayFileContext): ...
#!/usr/bin/python import sys, traceback import cv2 import numpy as np import argparse import string import plantcv as pcv ### Parse command-line arguments def options(): parser = argparse.ArgumentParser(description="Imaging processing with opencv") parser.add_argument("-i", "--image", help="Input image file.", req...
# Copyright 2016 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 agreed to in writing, s...
#!/usr/bin/env python """Open Annotation JSON-LD support functions for Eve.""" __author__ = 'Sampo Pyysalo' __license__ = 'MIT' import json import urlparse import hashlib import re import flask import mimeparse import oajson import seqid from settings import TARGET_RESOURCE # whether to expand @id values to abso...
""" pynamodb attributes tests """ import six import json from base64 import b64encode from datetime import datetime from delorean import Delorean from mock import patch from pynamodb.compat import CompatTestCase as TestCase from pynamodb.constants import UTC, DATETIME_FORMAT from pynamodb.models import Model from pynam...
from ..generator import Generator import logging import os import subprocess import textwrap import hashlib class PkgConfigJamGenerator(Generator): @staticmethod def identifier(): return 'pkgconfig-jam' def generate(self, needy): path = os.path.join(needy.needs_directory(), 'pkgconfig.j...
# -*- coding: utf-8 -*- # from rest_framework import serializers from django.utils.translation import ugettext_lazy as _ from django.db.models import Prefetch, Q from orgs.mixins.serializers import BulkOrgResourceModelSerializer from perms.models import AssetPermission, Action from assets.models import Asset, Node,...
import requests import os import time import random from flask import Flask, request, redirect, session, url_for, render_template from flask.json import jsonify, dumps, loads from requests_oauthlib import OAuth2Session import requests import json import urllib2 import mechanize from bs4 import BeautifulSoup from urlpa...
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
# coding=utf-8 # Copyright (c) 2001-2014, Canal TP and/or its affiliates. All rights reserved. # # This file is part of Navitia, # the software to build cool stuff with public transport. # # Hope you'll enjoy and contribute to this project, # powered by Canal TP (www.canaltp.fr). # Help us simplify mobility an...
#!/usr/bin/python3 -i import RPi.GPIO as GPIO import time import threading GPIO.setmode(GPIO.BOARD) #class control: # GPIO.setmode(GPIO.BOARD) # def change(self,arg): # GPIO.remove_event_detect(self.IN) # while GPIO.input(self.IN): 1 # if self.flag11: GPIO.output(self.OUT,GPIO.HIGH) # ...
# -*- 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...
from django.conf.urls import url from django.urls import include, path from . import views from django.conf import settings from django.conf.urls.static import static base_urlpatterns = [ url(r'^upload/$', views.plugins.upload_view, name='sign_in'), #LOGIN url(r'^$', views.login.index, name='login'), ...
#!/usr/local/bin/python # -*- coding: utf-8 -*- # # # OpenERP, Open Source Management Solution # Copyright (C) 2016 Didotech SRL # # # 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...
# 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 -*- # Author: Milan Nikolic <gen2brain@gmail.com> # # 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. ...
#!/usr/bin/env python2 # -*- coding: utf-8 -*- ################################################## # GNU Radio Python Flow Graph # Title: Amrx # Generated: Tue Aug 8 20:51:18 2017 ################################################## from gnuradio import analog from gnuradio import blocks from gnuradio import eng_notatio...
#!/usr/bin/env python3 import re # s = "3[a]2[bc]", return "aaabcbc". # s = "3[a2[c]]", return "accaccacc". # s = "2[abc]3[cd]ef", return "abcabccdcdcdef". class Solution: def decodeString(self, s): stack, n, t = [], 0, '' for c in s: if c.isdigit(): n = 10*n + int(c) ...
import math import random import re import socket import sys import threading import time import types import xml.dom.minidom import errno try: from cStringIO import StringIO except ImportError: from io import StringIO protocols = frozenset([ 'PROTOCOL_SSLv3', 'PROTOCOL_TLSv1_2', 'PROTOCOL_TLSv1_1...
import sys from flask import _request_ctx_stack def wrap_app_logger(app): """ This function given Application and add logger for that. :param app: Application Object :type app: Object """ app.debug_log_format = app.config['LOG_FORMAT'] app._logger = None app._logger = LoggerWrapper(ap...
from geoserver.wps import process from com.ziclix.python.sql import zxJDBC jdbc_url = "jdbc:postgresql://192.168.40.5:3389/research" username = "modeluser" password = "modeluser" driver = "org.postgresql.Driver" cgi_url = "http://model.geodan.nl/main/gmi/cgi-bin/" @process( title='MakeLcp', description='...
#!/usr/bin/env python3 """ Implement message filtering based on a routing table from MetPX-Sundew. Make it easier to feed clients exactly the same products with sarracenia, that they are used to with sundew. the pxrouting option must be set in the configuration before the on_message plugin is configured, ...
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Author: Evan Laske # @Date: 2014-03-01 21:45:31 # @Last Modified by: Evan Laske # @Last Modified time: 2015-09-15 23:51:12 import urllib import urllib2 from bs4 import BeautifulSoup import html5lib import re from StockQuote import StockQuote from MutualFundData impo...
"""Tests for pip.""" from typing import Dict, List import unittest from absl.testing import parameterized import mock from perfkitbenchmarker.linux_packages import pip from perfkitbenchmarker.linux_packages import python from tests import pkb_common_test_case # executed remote commands NEED_PIP_27 = [ 'curl http...