src
stringlengths
721
1.04M
# # This file is part of the CCP1 Graphical User Interface (ccp1gui) # # (C) 2002-2005 CCLRC Daresbury Laboratory # # 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 ...
# Copyright 2014 Mirantis, 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 ...
# file eulfedora/server.py # # Copyright 2010,2011 Emory University Libraries # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # ...
#!/usr/bin/python2 # coding: utf-8 """ Sea la declaracion sobre la diversidad: “The Python Software Foundation and the global Python community welcome and encourage participation by everyone. Our community is based on mutual respect, tolerance, and encouragement, and we are working to help each other live up to thes...
from django.core.management.base import BaseCommand from order.models import Order from member.models import Client from datetime import datetime from django.contrib.admin.models import LogEntry, ADDITION, CHANGE class Command(BaseCommand): help = 'Generate orders for all clients using his preferences' def a...
from functools import partial import json from PyQt5.QtCore import QCoreApplication, Qt from PyQt5.QtGui import QCursor, QIcon, QKeySequence from PyQt5.QtWidgets import ( QMainWindow, QMenu, ) from plover import log from plover.oslayer import wmctrl from plover.registry import registry from plover.resource i...
from __future__ import print_function import numpy as np from grid import standard_grid, negative_grid from iterative_policy_evaluation import print_values, print_policy import matplotlib.pyplot as plt from monte_carlo_exploring_starts import max_dict EPS = 1e-4 GAMMA = 0.9 ALL_POSSIBLE_ACTIONS = {'U', 'D', 'L', 'R'} ...
from mupdfbase import MuPdfBase, Matrix, Rect, BBox from ctypes import cdll,c_float, c_int, c_void_p, Structure, c_char_p,POINTER FZ_STORE_UNLIMITED=0 class MuPdf(MuPdfBase): def __init__(self): self.dll=cdll.libmupdf self.dll.fz_bound_page.argtypes=[c_void_p, c_void_p, POINTER(Rect)] self.dll...
#!/usr/bin/env python3 # coding: utf-8 from __future__ import with_statement, print_function, absolute_import, division """ Data Analysis RPC server over Tango: Tango device server """ __author__ = "Jérôme Kieffer" __contact__ = "Jerome.Kieffer@ESRF.eu" __license__ = "MIT" __copyright__ = "European Synchrotron Radia...
import logging import requests import re from requests.adapters import HTTPAdapter from requests.packages.urllib3.util.retry import Retry from datetime import datetime, timezone, timedelta from collections import namedtuple from anytree import RenderTree, NodeMixin from .exceptions import McxNetworkError, McxParsingE...
# -*- coding: utf-8 -*- import errno import io import platform import re import sys import warnings import pep8 from flake8 import __version__ from flake8 import callbacks from flake8.reporter import (multiprocessing, BaseQReport, FileQReport, QueueReport) from flake8 import util _flake8...
#!/usr/bin/python # bpio.py # # Copyright (C) 2008-2018 Veselin Penev, https://bitdust.io # # This file (bpio.py) is part of BitDust Software. # # BitDust 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,...
import sys from pymonad.Reader import curry from Parser import * def item(): return Parser(lambda cs: [] if cs == "" else [(cs[0], cs[1:])]) def sat(cond): return item() >> (lambda c: unit(Parser, c) if cond(c) else mzero(Parser)) def char(c): return sat(lambda x: c == x) def space(): return char(' ...
# Copyright (c) 2014 Mirantis, 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...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # async - A tool to manage and sync different machines # Copyright 2012,2013 Abdó Roig-Maranges <abdo.roig@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 # th...
# Copyright 2018-2020 by Christopher C. Little. # This file is part of Abydos. # # Abydos 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 versio...
# beamsearch.py - breadth-first search with limited queueing # # Copyright 2016-2019 NetworkX developers. # # This file is part of NetworkX. # # NetworkX is distributed under a BSD license; see LICENSE.txt for more # information. """Basic algorithms for breadth-first searching the nodes of a graph.""" import networkx ...
# coding: utf-8 """ EVE Swagger Interface An OpenAPI for EVE Online OpenAPI spec version: 0.4.6 Generated by: https://github.com/swagger-api/swagger-codegen.git """ from pprint import pformat from six import iteritems import re class GetCharactersCharacterIdNotFound(object): """ NOTE...
# -*- coding: utf-8 -*- #------------------------------------------------------------ # pelisalacarta - XBMC Plugin # Conector para aragontv # http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/ #------------------------------------------------------------ import urlparse,urllib2,urllib,re import os from core impo...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('admin', '0002_migrate_from_modoboa_admin'), ] operations = [ migrations.CreateModel( name='Record', ...
import pulsar as psr def run_test(): tester=psr.PyTester("Testing the Atom class") H, H2=psr.create_atom([0.0,0.0,0.0],1), psr.create_atom([0.0,0.0,0.0],1,1) tester.test_return("create_atom works",True,True,H.__eq__,H2) tester.test_equal("correct Z",1,H.Z) tester.test_equal("correct isotope",1,H.i...
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP module # Copyright (C) 2010 Micronaet srl (<http://www.micronaet.it>) and the # Italian OpenERP Community (<http://www.openerp-italia.com>) # # ###############################################...
from django.db import models from django.db.models import Q from django.utils.translation import ugettext_lazy as _ from parliament.models.member import Member from parliament.models.session import Term class FundingSource(models.Model): TYPES = ( ('co', _('Corporation')), ('ind', _('Individual')...
# Copyright 2015 Google Inc. 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 a...
# # Copyright (C) 2011, 2012 Pablo Barenbaum <foones@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. # # Th...
#------------------------------------------------------------------------------- # Copyright (c) 2012 Gael Honorez. # All rights reserved. This program and the accompanying materials # are made available under the terms of the GNU Public License v3.0 # which accompanies this distribution, and is available at # http://w...
from random import randint, seed from time import time # region: change # from window import * from Zpaw import * from cards import * card_list = [card_0, card_1, card_2, card_3, card_4, card_5, card_6, card_7, card_8, card_9] # endregion def game(): print 'Welcome to WAR V5!' print asking = True while...
#!/usr/bin/env python # # Copyright (c) 2015 Intel Corporation. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of works must retain the original copyright notice, this # list of conditions and t...
import copy import unittest from poly import Poly, monomial def pass_to(func, convert=(True, True), star=False): def wrapper(meth): def inner(self): for value, expected in meth(self).items(): if convert[0] and not star: value = Poly(value) if...
config = { "interfaces": { "google.devtools.cloudtrace.v1.TraceService": { "retry_codes": { "idempotent": ["DEADLINE_EXCEEDED", "UNAVAILABLE"], "non_idempotent": [] }, "retry_params": { "default": { "init...
try: import Queue as queue except ImportError: import queue from helpers import Struct class uiParameter(Struct): """uiParameter represents a single GUI element that is used to build a parameter window in the UI (simulator event "make_param_window"). It has one parameter, ``type``, that d...
#!/usr/bin/python # -*- coding: utf-8 -*- # 2014 Wells Riley import os import web import json import RPi.GPIO as GPIO import pigpio import time urls = ('/.*', 'hooks') app = web.application(urls, globals()) PIN = 17 LEFT = 500 RIGHT = 2700 CENTER = LEFT + ((RIGHT - LEFT)/2) STEP = 100 SLEEP = 0.02 pigpio_instance =...
''' Author: Michael Asquith, Aaron Gruneklee Created: 2014.12.08 Last Modified: 2014.12.23 Interpreter for a simple functional programming language. Access with interpret(command) Based on Peter Norvig's Lispy interpreter, http://norvig.com/lispy.html ''' import math, operator as op from robotio import RobotIO Symbo...
# Generated by Django 2.2.16 on 2021-01-20 13:44 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('social', '0011_auto_20190807_1056'), ] operations = [ migrations.AlterModelOptions( name='carousel', options={'verb...
# -*- coding: utf-8 -*- ############################################################################### # # Copyright (C) 2013-Today Carlos Eduardo Vercelino - CLVsol # # 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 #...
import json import socket import collections def parse_knx_address(address): """Parse physical/individual KNX address. Address structure (A=Area, L=Line, B=Bus device): -------------------- |AAAA|LLLL|BBBBBBBB| -------------------- 4 Bit|4 Bit| 8 Bit parse_knx_address(99999) '8.6.159'...
import json import os import re import glob import shutil from contextlib import contextmanager from functools import partialmethod from test.support import EnvironmentVarGuard import pytest import requests_mock from click.testing import CliRunner from sentinelsat import SentinelAPI, InvalidChecksumError from sentine...
#!/usr/bin/env python3 supported_extensions = ['jpeg', 'jpg', 'gif', 'png'] import errno import os import json import numpy as np import cv2 # Load and preprocess image def load_image(image_path, # Full path to processing image target_size, # Desired size of resulting image ...
import time import pygame import buzzbox import tricolourleds8 import buttons8 import wear_multiplexer import wear_sensor_heat import wear_sensor_light import wear_sensor_motion from twisted.internet.protocol import Protocol, Factory from twisted.internet import reactor, task i2cBus = 1 #This depends on the model of ...
# 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, software # dist...
""" This is a basic "Null" user interface which does nothing at all. """ ############################################################################## from __future__ import absolute_import from __future__ import division LICENSE = """\ This file is part of pagekite.py. Copyright 2010-2020, the Beanstalks Project eh...
# -*- 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...
# -*- coding: utf-8 -*- __license__ = 'GPL v3' __copyright__ = '2009, John Schember <john at nachtimwald.com>' __docformat__ = 'restructuredtext en' ''' Generic USB Mass storage device driver. This is not a complete stand alone driver. It is intended to be subclassed with the relevant parts implemented for a partic...
#!/usr/bin/env python # Copyright 2014-2018 The PySCF Developers. 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 # # U...
#!/usr/bin/python3 """ From: https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks The commit-msg hook takes one parameter, which again is the path to a temporary file that contains the commit message written by the developer. If this script exits non-zero, Git aborts the commit process, so you can use it to valid...
#pylint: disable=C0111 #pylint: disable=W0621 from lettuce import world, step from re import sub from nose.tools import assert_equals from xmodule.modulestore.django import modulestore from common import * from logging import getLogger logger = getLogger(__name__) def check_for_errors(): e = world.browser.find_...
import sqlite3 import urllib import re from urllib.request import urlopen from bs4 import BeautifulSoup def main(): # The collection URL below. collURL = 'http://www.thelatinlibrary.com/germanicus.html' collOpen = urllib.request.urlopen(collURL) collSOUP = BeautifulSoup(collOpen, 'html5lib') autho...
''' Copyright 2011 Mikel Azkolain This file is part of Spotimc. Spotimc 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. Spotimc ...
import os import contextlib from .errors import CLEError, CLEFileNotFoundError # https://code.woboq.org/userspace/glibc/include/libc-pointer-arith.h.html#43 def ALIGN_DOWN(base, size): return base & -size # https://code.woboq.org/userspace/glibc/include/libc-pointer-arith.h.html#50 def ALIGN_UP(base, size): ...
#! /usr/bin/env python import unittest import os import sys import math from cStringIO import StringIO import pymsbayes from pymsbayes.test.support.pymsbayes_test_case import PyMsBayesTestCase from pymsbayes.test.support import package_paths from pymsbayes.workers import PosteriorWorker from pymsbayes.utils import pa...
""" WSGI config for hn_main 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`` ...
# Copyright 2021, Kay Hayen, mailto:kay.hayen@gmail.com # # Python tests originally created or extracted from other peoples work. The # parts were too small to be protected. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the ...
""" Set up the plot figures, axes, and items to be done for each frame. This module is imported by the plotting routines and then the function setplot is called to set the plot parameters. """ import numpy as np # Plot customization import matplotlib # Markers and line widths matplotlib.rcParams['lines.line...
#!/usr/bin/python ########################################################################## # # MTraceCheck # Copyright 2017 The Regents of the University of Michigan # Doowon Lee and Valeria Bertacco # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance ...
#!/usr/bin/python2 # # Copyright (c) 2012 The Native Client Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. # """ Responsible for generating actual decoders based on parsed table representations. Note: We define a notion of "actual" a...
# import unittest import os from jinger.site import create_empty_site, createdir from jinger.test import DIR_PLAYGROUND, JingerPlaygroundTest class SiteTest(JingerPlaygroundTest): def test_create_dir(self): mysite = createdir(DIR_PLAYGROUND, 'mysite') self.assertTrue(os.path.exists(mysite)) ...
import pytest from tests.integration.services.policy_engine.engine.policy.gates import ( GateUnitTest, cls_no_feeds_test_env, ) from anchore_engine.db import Image, ImagePackageManifestEntry from anchore_engine.services.policy_engine.engine.policy.gates.packages import ( PackagesCheckGate, RequiredPacka...
# !/usr/local/bin/python3.4.2 # ----Copyright (c) 2016 Carnegie Hall | The MIT License (MIT)---- # ----For the full license terms, please visit https://github.com/CarnegieHall/quality-control/blob/master/LICENSE---- # run script with 3 or more arguments: # argument 0 is the script name # argument 1 is the path to the m...
#!/usr/bin/env python # -- coding: utf-8 -- # Licensed to Cloudera, Inc. under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. Cloudera, Inc. licenses this file # to you under the Apache License, Version 2.0 (th...
import logging class TransferFunction(object): ''' Base (and abstract) class to provide TFs in python programming language. Usage: python TF implementations must extend this class and provide, as a minimum, the implementation of the transfer method. It is the python equivalent of the JavaTransfer...
import os import logging import warnings import requests import urllib3 from sqlalchemy.exc import SAWarning # shut up useless SA warning: warnings.filterwarnings('ignore', 'Unicode type received non-unicode bind param value.') warnings.filterwarnings('ignore', category=SAWarning) # using SSL...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.utils.encoding import python_2_unicode_compatible import logging import os import uuid import hashlib from datetime import timedelta from django.db import models from django.db.models.signals import post_save, pre_save, post_delete from djang...
import ckan.plugins as plugins import ckan.plugins.toolkit as toolkit import logging import ckan.logic as logic log = logging.getLogger(__name__) def get_organizations(): organization_list = [] organizations = logic.get_action('organization_list')({}, {}) for organization_id in organizations: con...
# coding=utf-8 import zmq import threading import uuid from google.protobuf.message import DecodeError from fysom import Fysom import machinetalk.protobuf.types_pb2 as pb from machinetalk.protobuf.message_pb2 import Container class Subscribe(object): def __init__(self, debuglevel=0, debugname='Subscribe'): ...
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Changing field 'Building.energy_score' db.alter_column(u'building_building', 'energy_score', self.gf('dja...
import os import glob import re from Utils import getLimitsFromFile class SignalModel: def __init__(self, path): """ Initalise: * _path = stats output for this signal model * _model = name of signal model (taken from the path) """ path = path.replace('\n','') ...
# -*- coding: utf-8 -*- # Copyright (C) 2010-2013 Trémouilles David #This file is part of Thunderstorm. # #ThunderStrom is free software: you can redistribute it and/or modify #it under the terms of the GNU Lesser General Public License as published by #the Free Software Foundation, either version 3 of the License, o...
import json import pytest import networkx as nx from networkx.readwrite.json_graph import cytoscape_data, cytoscape_graph class TestCytoscape: def test_graph(self): G = nx.path_graph(4) H = cytoscape_graph(cytoscape_data(G)) nx.is_isomorphic(G, H) def test_graph_attributes(self): ...
import warnings import pytest import sqlalchemy as sa from sqlalchemy import create_engine from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.ext.hybrid import hybrid_property from sqlalchemy.orm import sessionmaker from sqlalchemy_json_api import CompositeId, QueryBuilder warnings.filterwarning...
# File: CentralEngineWebUi.py ; This file is part of Twister. # version: 2.007 # Copyright (C) 2012-2013 , Luxoft # Authors: # Adrian Toader <adtoader@luxoft.com> # Andrei Costachi <acostachi@luxoft.com> # Andrei Toma <atoma@luxoft.com> # Cristi Constantin <crconstantin@luxoft.com> # Daniel Cioata <d...
#!/usr/bin/env python # -*- coding: utf-8 -*- from pip.req import parse_requirements from io import open try: from setuptools import setup except ImportError: from distutils.core import setup with open('Version', 'r', encoding='utf-8') as f: version = next(f).strip() with open('README.rst', encoding='utf...
#!/usr/bin/python # # Copyright 2002-2019 Barcelona Supercomputing Center (www.bsc.es) # # 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 ...
#!/usr/bin/python # -*- coding: utf-8 -*- ''' CNB Matrix Module - encode ''' import string import urllib import base64 from cnb.cnbMatrixModule import CNBMatrixModule class CNBMMEncode(CNBMatrixModule): """ """ name = 'encode' usage = '' desc = 'Encode a string using different algorithm' al...
# DataProcessing.py # Libraries # Third-Party Libraries import pandas as pd import numpy as np def augment(data: np.array, size: int) -> np.array: import scipy.ndimage augmented_data = data[np.random.randint(data.shape[0], size=size), :] for i, aug in enumerate(augmented_data): random_values = np....
# Copyright 2015 NEC Corporation. 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 l...
#----------------------------------------------------------- # # QGIS setting manager is a python module to easily manage read/write # settings and set/get corresponding widgets. # # Copyright : (C) 2013 Denis Rouzaud # Email : denis.rouzaud@gmail.com # #-------------------------------------------------------...
""" Functions to pick earthquakes detected by EQcorrscan. Designed primarily locate stacks of detections to give family locations. Extensions may later be written, not tested for accuracy, just simple wrappers. :copyright: EQcorrscan developers. :license: GNU Lesser General Public License, Version 3 (htt...
""" tint.data_utils =============== Tools for obtaining and handling radar data. """ import tempfile from boto.s3.connection import S3Connection from datetime import datetime, timedelta import pyart def read_nexrad_key(key): """ Returns pyart radar object from nexrad S3 key. """ tmp = tempfile.Nam...
import enaml from enaml.qt.qt_application import QtApplication from atom.api import * import numpy as np import os import h5py import urllib from matplotlib.figure import Figure from matplotlib.axes import Axes from matplotlib.lines import Line2D import itertools from xray_vision.backend.mpl import cross_section_2d as ...
#!/usr/bin/env python3 # blocktools.py - utilities for manipulating blocks and transactions # Copyright (c) 2015-2016 The Presidentielcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. from .mininode import * fro...
# -*- coding: utf-8 -*- ''' def __xxx(): # alexandermendes/marc2excel def __xxx2(): # Flask-Z3950 # github.com/alexandermendes/Flask-Z3950 # pythonhosted.org/Flask-Z3950/ # apt install libxml2-dev libxslt-dev python-dev lib32z1-dev # pip install Flask-Z3950 from flask_z3950 import Z395...
# Copyright 2015 Metaswitch Networks # # 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 w...
import functools import wrapt from myhdl import SignalType, ResetSignal, delay, always, instance, Simulation class Clock(SignalType): """Clock class for use in simulations""" def __init__(self, period=2): self.period = period if period % 2 != 0: raise ValueError("period must be di...
from ..osid import records as osid_records class QuestionRecord(osid_records.OsidRecord): """A record for a ``Question``. The methods specified by the record type are available through the underlying object. """ class QuestionQueryRecord(osid_records.OsidRecord): """A record for a ``Questio...
import pickle from scipy.spatial.distance import squareform import os from mlutils.anomalyDetection.anomalyCalculator import AnomalyCalculator from RankingEntry import RankingEntry class Ranker: def __init__(self, projectRoot): self.projectRoot = projectRoot def loadTermDocMatrix(self): ...
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
# encoding: utf-8 """ address.py Created by Thomas Mangin on 2010-01-19. Copyright (c) 2009-2015 Exa Networks. All rights reserved. """ from struct import pack from struct import unpack # =================================================================== AFI # http://www.iana.org/assignments/address-family-number...
from bs4 import BeautifulSoup # from list[43] is the real list def resolve_list(raw_list): start = 0 end = 6 lists = [] soup = BeautifulSoup(raw_list, 'html.parser') soup_list = soup.text.split() soup_list = soup_list[43:-3] #soup_tuple = tuple(soup_list) for msg in soup_list: i...
# Copyright 2018, OpenCensus 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 applicable law or agreed to in w...
#!/usr/bin/env python ''' This ROS Node records all of the available Wi-Fi Scans received from Wavemon and saves it in a file named Wavemon_Log_YYY-MM-DD_HHMM.log. This log file is saved in wherever the user desires it by passing it as a parameter called "log_folder". Else, the log file is saved in the home director...
# vim: set fileencoding=utf-8 : # # (C) 2012 Intel Corporation <markus.lehtonen@linux.intel.com> # (C) 2013 Guido Günther <agx@sigxcpu.org> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundat...
# -*- coding: utf-8 -*- """Utilities to discover and load health checks.""" import importlib import inspect import pkgutil import unittest from hospital.core import is_healthcheck def is_package(module): """Return True if module object is a package. >>> import hospital >>> is_package(hospital) True ...
import json, urllib2 from util import hook, http @hook.command def stock(inp): '''.stock <symbol> -- gets stock information''' symbols = inp.split(',') # who needs more than 3 symbols url = ('http://finance.google.com/finance/info?client=ig&q=%s' % ','.join(symbols[:3])) try: raw = ht...
# Django imports from django.test import TestCase from django.test.client import RequestFactory from django.contrib.auth.models import AnonymousUser from django.core.exceptions import PermissionDenied # Local Django imports from exam.views import ListCustomExams from user.models import User, Patient, HealthProfessiona...
"""Allows the creation of a sensor that breaks out state_attributes.""" import logging from typing import Optional import voluptuous as vol from homeassistant.core import callback from homeassistant.components.sensor import ( ENTITY_ID_FORMAT, PLATFORM_SCHEMA, DEVICE_CLASSES_SCHEMA, ) from homeassistant.c...
# -*- coding: utf-8 -*- # # gpyconf documentation build configuration file, created by # sphinx-quickstart on Wed Aug 19 22:09:56 2009. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All...
from django.core.urlresolvers import reverse, get_script_prefix import autocomplete_light from rest_framework.relations import HyperlinkedRelatedField class AutocompleteHyperlinkedRelatedField(HyperlinkedRelatedField): """ Used in hyperlinked autocomplete fields. Converts the 'id' or full url path of th...
import lxml.html import re import requests from openstates.utils import State from .people import AZPersonScraper from .bills import AZBillScraper # from .committees import AZCommitteeScraper # from .events import AZEventScraper class Arizona(State): scrapers = { "people": AZPersonScraper, # 'com...
#!/usr/bin/env python # # Credentials # # Collates and stores in memory user credentials needed for downloads # # Author P G Jones - 2014-03-23 <p.g.jones@qmul.ac.uk> : New file. #################################################################################################### import getpass import logging logger = l...
import time import hashlib from datetime import timedelta from passlib.hash import bcrypt from sqlalchemy import * from sqlalchemy.orm import relationship, backref, exc from sqlalchemy.dialects.mysql import INTEGER as Integer from sqlalchemy.ext.hybrid import hybrid_property, hybrid_method from sqlalchemy.sql.express...