src stringlengths 721 1.04M |
|---|
import vim # pylint: disable=F0401
import re
import vwtask
import viewport
import regexp
import store
class TaskCache(object):
"""
A cache that holds all the tasks in the given file and prevents
multiple redundant taskwarrior calls.
"""
def __init__(self):
# Determine defaults
d... |
"""
A component which allows you to send data to an Influx database.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/influxdb/
"""
import logging
import voluptuous as vol
from homeassistant.const import (
EVENT_STATE_CHANGED, STATE_UNAVAILABLE, STA... |
from discord.ext import commands
from rubybot.utils import llparser
from seiutils import linkutils, discordutils
MAX_CHAR = 2000
class Info(commands.Cog):
def __init__(self, bot):
self.bot = bot
@commands.group()
async def lyrics(self, ctx):
pass
async def send_lyrics... |
# To change this license header, choose License Headers in Project Properties.
# To change this template file, choose Tools | Templates
# and open the template in the editor.
class socket_protocol:
def __init__(self):
self.response = ""
pass
def pack_request(self, request):
request... |
#
# Copyright (c) 2008--2012 Red Hat, Inc.
#
# This software is licensed to you under the GNU General Public License,
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
# implied, including the implied warranties of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. You should have received a c... |
# Licensed to the StackStorm, Inc ('StackStorm') 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 "License"); you may not use th... |
#!/usr/bin/python3
import os
import sys
from sqlalchemy import Column, ForeignKey, Integer, String, DateTime, Boolean
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import relationship
from sqlalchemy import create_engine
from marshmallow import Schema, fields
from flask_sqlalchemy import ... |
from __future__ import print_function
import sys
import time
import pytest
from yamicache import Cache, nocache, override_timeout
c = Cache(prefix="myapp", hashing=False, debug=False)
class MyApp(object):
@c.cached()
def test1(self, argument, power):
"""running test1"""
return argument ** pow... |
#!/usr/bin/env python
import numpy as np
import chainer
import chainer.functions as F
import chainer.links as L
import chainer.datasets.image_dataset as ImageDataset
import six
import os
from PIL import Image
from chainer import cuda, optimizers, serializers, Variable
import cv2
class ImageAndRefDataset(chainer.dat... |
#
# anaconda_optparse.py: option parsing for anaconda (CLI and boot args)
#
# Copyright (C) 2012 Red Hat, Inc. All rights reserved.
#
# 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 vers... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
coinrpc
~~~~~
:copyright: (c) 2014 by Halfmoon Labs
:license: MIT, see LICENSE for more details.
"""
import os
from commontools import log
NAMECOIND_ENABLED = True
BITCOIND_ENABLED = False
DEBUG = True
#--------------------------------------------------
if NAM... |
import threading
import logging
import time
import os
logging.basicConfig( level=logging.DEBUG, format='[%(levelname)s] - %(threadName)-10s : %(message)s')
def worker(x):
logging.debug('Lanzado')
importer = 'bin/mallet import-svmlight --input archivoEntrenamiento%s.txt --output training%s.mallet' % (x,x)
... |
from __future__ import print_function, absolute_import
import os.path as osp
from ..utils.data import Dataset
from ..utils.osutils import mkdir_if_missing
from ..utils.serialization import write_json
class Market1501(Dataset):
url = 'https://drive.google.com/file/d/0B8-rUzbwVRk0c054eEozWG9COHM/view'
md5 = '6... |
#!/usr/bin/env python3
import db
# The limits on character fields were determined by looking at a sample of logs
# and figuring out how big things could be.
CREATE_TABLE_STATEMENTS = [
"""CREATE TABLE characters (
id SERIAL PRIMARY KEY,
name varchar(16)
);""",
"""CREATE TABLE items (
id SERIAL PRI... |
# -*- coding: utf-8 -*-
# pylint: disable=E1101, I1101, C0103, C0301, R0913, E0401, C0413
"""Maya standalone context."""
import os
import sys
MAYA_LOCATION = r'C:\Program Files\Autodesk\Maya2018'
MAYA_BIN = r'C:\Program Files\Autodesk\Maya2018\bin'
MTOA_EXTENSIONS_PATH = r'C:\solidangle\mtoadeploy\2018\extensions'
Q... |
#!/usr/bin/env python
import vim
import os
# Given an object, returns a str object that's utf-8 encoded.
def ToUtf8IfNeeded(value):
if isinstance(value, unicode):
return value.encode('utf8')
if isinstance(value, str):
return value
return str(value)
def PresentYesOrNoDialog(message):
return int(vim.eva... |
# -*- coding: utf-8 -*-
#
# Yolapy documentation build configuration file, created by
# sphinx-quickstart on Thu Aug 27 12:47:53 2015.
#
# 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.
#
# Al... |
# Copyright 2015, Kay Hayen, mailto:kay.hayen@gmail.com
#
# Part of "Nuitka", an optimizing Python compiler that is compatible and
# integrates with CPython, but also works on its own.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in complianc... |
# This file is part of Indico.
# Copyright (C) 2002 - 2020 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.
import pytest
from indico.modules.events.registration.models.forms import RegistrationForm
from indico.mo... |
#!/usr/bin/env python
from __future__ import print_function
import os
import shutil
import sys
import tempfile
import django
from django.apps import AppConfig,apps
from django.utils.encoding import smart_text
TEST_ROOT = os.path.realpath(os.path.dirname(__file__))
RUNTESTS_DIR = os.path.join(TEST_ROOT, 'xtests')
sy... |
import requests
import bs4
import json
import re
def _comment( story , index = 0):
path = "http://www.hs.fi/ajax/keskustelut/" + story + "?startIndex=" + str(index) + "&order=a"
r = requests.get( path )
text = r.text.strip()
## no more comments left
if text == '':
return False
html ... |
# Adagios is a web based Nagios configuration interface
#
# Copyright (C) 2014, Pall Sigurdsson <palli@opensource.is>
#
# 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, either version 3 of... |
# -*- coding: utf-8 -*-
#------------------------------------------------------------
# pelisalacarta - XBMC Plugin
# Conector para rtve
# http://blog.tvalacarta.info/plugin-xbmc/tvalacarta/
#------------------------------------------------------------
import urlparse,urllib2,urllib,re
import os
from core import scra... |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe, erpnext
import frappe.defaults
from frappe.utils import cint, flt
from frappe import _, msgprint, throw
from erpnext.accounts.party impor... |
#!/usr/bin/env python
try:
import gi
gi.require_version('NumCosmo', '1.0')
gi.require_version('NumCosmoMath', '1.0')
except:
pass
import ctypes
from math import *
from gi.repository import NumCosmoMath as Ncm
from gi.repository import NumCosmo as Nc
from gi.repository import GObject
#
# Initializing the lib... |
__author__ = 'OmerMahgoub'
#!/usr/bin/env python
import time
import ast
import random
import pika
from common.VM import OpenStackAdapterVMInstance
from settings import settings
objSettings = settings.StackSettings()
# The below settings are coming from settings/setting.py which in return getting al... |
# 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
# "License"); you may not u... |
#tetris.py
from Tkinter import *
import random
def tetrisMousePressed(canvas,event):
tetrisRedrawAll(canvas)
def tetrisKeyPressed(canvas,event):
if event.keysym == "r":
tetrisInit(canvas)
if (canvas.data.isTetrisGameOver == False):
if event.keysym == "Left":
moveFallingPiece(c... |
# -*- coding: utf-8 -*-
import os
from setuptools import setup, find_packages
version = __import__('sequere').__version__
root = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(root, 'README.rst')) as f:
README = f.read()
setup(
name='django-sequere',
version=version,
description='... |
# Copyright (C) 2015 ycmd contributors
#
# This file is part of ycmd.
#
# ycmd 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.
#
# ycmd... |
"""
Copyright 2013 Rackspace
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... |
import os
import time
from pprint import pprint
from pathlib import Path
from prompt_toolkit import prompt, AbortAction
from prompt_toolkit.contrib.completers import WordCompleter
from prompt_toolkit.history import FileHistory
from prompt_toolkit.auto_suggest import AutoSuggestFromHistory
from prompt_toolkit.styles im... |
import os
import sys
from django.conf import settings
from django.utils.encoding import smart_str
from django.utils.translation import check_for_language
from django.utils.translation.trans_real import get_language_from_path
_default = None
_supported = []
def get_default_language():
"""
Detects the default... |
import logging; logger = logging.getLogger("morse." + __name__)
from morse.core.services import async_service
import morse.core.sensor
import bge
from functools import partial
class StereoUnitClass(morse.core.sensor.MorseSensorClass):
""" Base for stereo pairs
It is used to link two camera objects, and export... |
# -*- coding: utf-8 -*-
#
# Copyright 2008 GAEO Team
#
# 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 o... |
#!/usr/bin/env python
import os
import numpy as np
from functools import partial
from astropy.io import fits
from astropy.table import Table,hstack
from astropy import cosmology
from . import sqbase
from . import sqgrids as grids
from . import hiforest
from . import dustextinction
from . import sqphoto
from . import ... |
"""Tests for the `logging_tree.format` module."""
import logging
import logging.handlers
import unittest
import sys
from logging_tree.format import build_description, printout
from logging_tree.tests.case import LoggingTestCase
if sys.version_info >= (3,):
from io import StringIO
else:
from StringIO import Str... |
#!/usr/bin/env python3
#
# In this example script, we create a Gyoto Scnenery with a
# PatternDisk, save it, read it and check that the re-read scenery is
# identical to the saved one.
# This is the same example as yorick/check-patterndisk.i
import gyoto.core, gyoto.std
import numpy
import os
import matplotlib.pyplot ... |
# -*- coding: utf-8 -*-
import sys
from setuptools import setup
from setuptools.command.test import test as TestCommand
requires = ['click', 'boto3', 'six']
tests_require = ['pytest', 'pytest-cache', 'pytest-cov']
dev_require = ['tox', 'bumpversion', 'twine']
class PyTest(TestCommand):
def finalize_options(self... |
#
# Construct a logger given a standard set of command line arguments
#
# Oct-2019, Pat Welch, pat@mousebrains.com
import logging
import logging.handlers
import argparse
def addArgs(parser: argparse.ArgumentParser):
""" Add my options to an argparse object """
grp = parser.add_argument_group('Log related opti... |
# coding=utf-8
"""This module, c_compiler.py, is a utility program to compiling c programs."""
from universal_code.shell_abstraction.shell_command_runner import run_shell_command_and_get_results
def create_object_file(source_file_path, object_output_path):
"""Creates an object file."""
return _run_command_and_ret... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from datetime import datetime
from operator import itemgetter
from functools import wraps
from logging import getLogger
import re
from six import (iterkeys, binary_type, text_type, string_types, integer_types,
iteritems, PY3)
from six.move... |
import sys
from epub import open_epub
import simplejson as json
from bs4 import BeautifulSoup, Tag
class SimpleChapter(object):
def __init__(self, name, text):
self.name = name
self.text = text
class Parser(object):
def __init__(self, epub_path):
self.epub_file = open_epub(epub_path,... |
import unittest
from mock import Mock, patch
from malcolm.core import Process
from malcolm.modules.builtin.controllers import StatefulController
from malcolm.modules.ca.parts import CAActionPart
class caint(int):
ok = True
class ca_nothing(object):
ok = False
@patch("malcolm.modules.ca.util.catools")
cl... |
#!/usr/bin/env pythonw
# -*- coding: UTF-8 -*-
#
# dojo_11.py
#
# Created by Giovanni Porcari on 2007-03-24.
# Copyright (c) 2007 Softwell. All rights reserved.
# --------------------------- GnrWebPage subclass ---------------------------
from gnr.web.gnrwebpage_proxy.frontend.dojo_base import GnrBaseDojoFrontend
f... |
# -*- 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 'UtilitySummary.end_date'
db.alter_column(u'utility_utilitysummary', 'end_date', self.gf('... |
from abc import abstractmethod
from app import db
class BaseModel(db.Model):
__abstract__ = True
def __init__(self, **kwargs):
"""
Initialize the BaseModel. This method will receive a unknown list with key=value elements
From that list, will use just the key matching with a column nam... |
import datetime
import json
from werkzeug.exceptions import BadRequest
from server.models import db, Backup, Group, Message, Version, Score
from tests import OkTestCase
class TestRevision(OkTestCase):
"""Tests revision API submission and scoring."""
def setUp(self):
""" Add submissions for 3 users. ... |
#
# Copyright (c) SAS Institute, 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 in ... |
import splunktaforpuppetenterprise_declare
import os
import sys
import time
import datetime
import json
import modinput_wrapper.base_modinput
from solnlib.packages.splunklib import modularinput as smi
import input_module_puppet_enterprise_metrics as input_module
bin_dir = os.path.basename(__file__)
'''
Do no... |
from rest_framework import status
from rest_framework.permissions import AllowAny
from rest_framework.response import Response
from rest_framework.views import APIView
from django.contrib.auth import authenticate
from .serializers import (
UserAuthSerializer,
UserLoginSerializer
)
class UserLoginView(APIView)... |
''' Run OpenDSS and plot the results for arbitrary circuits. '''
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import networkx as nx
import math
import os
import warnings
try:
import opendssdirect as dss
except:
warnings.warn('opendssdirect not installed; opendss functionality disabled.')
fr... |
'''
This sample will read all event messages from a queue.
MQWeb runs on localhost and is listening on port 8081.
'''
import json
import httplib
import socket
import argparse
parser = argparse.ArgumentParser(
description='MQWeb - Python sample - Browse Event Queue',
epilog="For more information: http://www.mqweb.... |
from panda3d.core import *
from panda3d.direct import *
from toontown.toonbase.ToonBaseGlobal import *
from direct.interval.IntervalGlobal import *
from direct.task import Task
from direct.directnotify import DirectNotifyGlobal
from math import *
from direct.distributed.ClockDelta import *
from toontown.golf import Gol... |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'ui_main.ui'
#
# Created: Sun Apr 3 16:50:44 2016
# by: PyQt4 UI code generator 4.11.2
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
except Attrib... |
import pybindgen
def generate(file_):
mod = pybindgen.Module('_rabinkarprh')
mod.add_include('"rabinkarp.h"')
mod.add_container('std::list<unsigned int>', 'unsigned int', 'list')
mod.add_container('std::list<double>', 'double', 'list')
cls = mod.add_class('RabinKarpHash')
cls.add_constructor(... |
# This class loads the data
# 1. Skeleton (.skel or .mat)
# 2. Video (a folder with frames XXXXXX_[index].png or .jpg or .jpeg
# if you have actual video you can use ffmpeg to split it.
# 3. Choreography (.svl)
# 4. Music beats (.txt)
import os
import DanceAnno_Application
__author__ = 'DIMITRIOS'
from tkinter ... |
# Copyright 2017-present Adtran, 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 in writ... |
# -*- coding: utf8
from django.http import HttpResponseBadRequest, HttpResponse
from django.views.decorators.csrf import csrf_exempt
from django.views.decorators.http import require_POST
from django.shortcuts import render
from buysafe.models import PaymentMethod
from buysafe.forms import SunTechReceiveForm, BuySafeSe... |
# -*- coding: utf-8 -*-
# Copyright (c) 2008 Alberto García Hierro <fiam@rm-fr.net>
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rig... |
#!/usr/bin/env python
# encoding: utf-8
from __future__ import print_function
from waflib import Build, ConfigSet, Configure, Context, Errors, Logs, Options, Utils
from waflib.Configure import conf
from waflib.Scripting import run_command
from waflib.TaskGen import before_method, feature
import os.path, os
from collec... |
#!/usr/bin/env python
from __future__ import division
import optparse, os
#This script uses an aligned fasta file and a tab deliminted file containing CDS coordinates to create a nexus input for BEAST
#In version 2.0, added a flag to throw if you only want coding sequence to be included in the nexus file
def main()... |
# -*- coding: utf-8 -*-
#歧視無邊,回頭是岸。鍵起鍵落,情真情幻。
import ConfigParser
Config = ConfigParser.ConfigParser()
Config.read("config.ini")
dir_src = Config.get("Directory",'source')
dir_out = Config.get("Directory",'outcome')
fn_suffix = Config.get("Filename",'suffix')
fn_datasrc= Config.get("Filename",'datasource')
fn_mappi... |
# Copyright 2014 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... |
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import absolute_import
from sqlalchemy import create_engine, MetaData
from sqlalchemy.orm import sessionmaker
from sqlalchemy.orm import scoped_session
from sqlalchemy.exc import (
DatabaseError,
IntegrityError,
O... |
"""Utils functions for module MOL
"""
import os
import numpy as np
from frankenstein.tools.io_utils import zmat2xyz
from frankenstein.data.atom_data import get_atomic_number
def get_enuc(Zs, xyzs):
"""Compute nuclear repulsion for a give molecule
Note:
The coordinates must be in unit of Bohr. (1 B... |
#!/usr/bin/python
# coding:utf8
'''
Created on 2015-06-22
Update on 2017-05-16
Author: Lockvictor/片刻
《推荐系统实践》协同过滤算法源代码
参考地址:https://github.com/Lockvictor/MovieLens-RecSys
更新地址:https://github.com/apachecn/AiLearning
'''
import sys
import math
import random
from operator import itemgetter
# 作用:使得随机数据可预测
random.seed(0)
... |
#!/bin/python
# -*- coding: utf-8 -*-
colors = {'indigo' : '#4e017e',
'darkTurquoise': '#045751',
'darkBlue' : '#032697',
'turquoise' : '#039f8f',
'yellow' : '#fab309',
'blue' : '#3b80f5',
'purple' : '#9628de',
'gree... |
#
# Copyright (c) 2015 nexB Inc. and others. All rights reserved.
# http://nexb.com and https://github.com/nexB/scancode-toolkit/
# The ScanCode software is licensed under the Apache License version 2.0.
# Data generated with ScanCode require an acknowledgment.
# ScanCode is a trademark of nexB Inc.
#
# You may not use... |
# -*- coding: utf-8 -*-
from py2neo import authenticate, Graph, Node, Relationship
from scrapy import signals, exceptions
from scrapy.exporters import JsonLinesItemExporter, PprintItemExporter
from .latex import utils as latexutils
class EquationscraperPipeline(object):
def __init__(self):
self.jsl_expo... |
from functools import lru_cache
from datetime import datetime
from conditional.util.ldap import ldap_get_active_members
from conditional.util.ldap import ldap_get_intro_members
from conditional.util.ldap import ldap_get_current_students
from conditional.util.ldap import ldap_get_roomnumber
from conditional.util.ldap i... |
# coding=utf-8
#########################################################################
# File Name: forms.py
# Original Author: 段凯强
# Mail: duankq@ios.ac.cn
# Created Time: 2013-12-26
# Update:
#########################################################################
################################################... |
# -*- coding: utf-8 -*-
#
# MathJax documentation build configuration file, created by
# sphinx-quickstart on Sun May 16 23:18:19 2010.
#
# 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... |
import copy, utils.log
from logic.smbool import SMBool, smboolFalse
from logic.smboolmanager import SMBoolManager
from collections import Counter
class ItemLocation(object):
__slots__ = ( 'Item', 'Location', 'Accessible' )
def __init__(self, Item=None, Location=None, accessible=True):
self.Item = It... |
#!/usr/local/bin/python
# -*- coding: utf-8 -*-
from flask import Flask, jsonify, g, request, render_template
import json
import os
import re
import sqlite3
import time
from pprint import pprint
app = Flask(__name__)
app.config.update(
DATABASE = 'db/samples.db',
#DATABASE = 'db/catcafe.db',
DEBUG = True
... |
import re
import textwrap
import logging
import MySQLdb
from MySQLdb import OperationalError
from MySQLdb.constants.CLIENT import INTERACTIVE
__all__ = [
'connect',
'MySQLClient',
'OperationalError',
'ProgrammingError',
'DatabaseError'
]
LOGGER = logging.getLogger(__name__)
class MySQLClient(obje... |
"""
A component which allows you to send data to an Influx database.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/influxdb/
"""
import logging
from blumate.helpers.entity import Entity
import blumate.util as util
from blumate import bootstrap
from bl... |
## Copyright (c) 2012-2015 Aldebaran Robotics. All rights reserved.
## Use of this source code is governed by a BSD-style license that can be
## found in the COPYING file.
""" Toolchain feeds
"""
import os
import sys
import hashlib
import urlparse
from xml.etree import ElementTree
from qisys import ui
import qisys
... |
"""
Copyright 2007, 2008, 2009 Free Software Foundation, Inc.
This file is part of GNU Radio
OpenCV Companion 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) a... |
# import MySQLdb
def getPlaylistInformation(client, user_id, favoritesCount):
favoritesList = list()
favorite_url = '/users/' + str(user_id) + '/favorites'
for i in range(0, favoritesCount, 50):
favorites = client.get(favorite_url, offset=i)
favoritesList.append(favorites)
return... |
import doctest
import pytest
from insights.parsers import firewall_config
from insights.parsers.firewall_config import FirewallDConf
from insights.tests import context_wrap
from insights.parsers import SkipException
FIREWALLD_CONFIG = """
# firewalld config file
# default zone
# The default zone used if an empty zone... |
import json
from django.db import models
from django.utils import timezone
from django.conf import settings
class Client(models.Model):
RESPONSE_TYPE_CHOICES = [
('code', 'code (Authorization Code Flow)'),
('id_token', 'id_token (Implicit Flow)'),
('id_token token', 'id_token token (Impl... |
# Copyright (c) 2013, Patrick Uiterwijk <puiterwijk@gmail.com>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice... |
# =========================================================================
# Copyright 2012-present Yunify, Inc.
# -------------------------------------------------------------------------
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this work except in compliance with the Licens... |
from .default import * # noqa
# import djcelery
# ===================
# = Global Settings =
# ===================
DEBUG = False
# ===================
# = Server Settings =
# ===================
DATABASES['default']['CONN_MAX_AGE'] = 60
RAVEN_CONFIG = {
'dsn': '{{ cookiecutter.sentry_dsn}}',
}
CACHES = {
... |
import Tkinter as tk
from itertools import cycle
from Tkinter import *
from PIL import Image, ImageTk # pip install pillow + sudo apt-get install python-imaging-tk
# based on example found on
# https://raspberrypi.stackexchange.com/questions/18261/how-do-i-display-an-image-file-png-in-a-simple-window
class SlideSho... |
from Screen import Screen
from Components.ActionMap import ActionMap
from Components.Sources.StaticText import StaticText
from Components.Harddisk import harddiskmanager
from Components.NimManager import nimmanager
from Components.About import about
from Components.ScrollLabel import ScrollLabel
from Components.Button ... |
#!/usr/bin/env python
from __future__ import (print_function, unicode_literals, division,
absolute_import)
"""
This script will output the Datera AppInstances that are being managed
by an OpenStack Cinder (or Glance) instance.
It does this by retrieving all the AppInstances on the Datera back... |
# -*- coding: utf8 -*-
# Copyright (C) 2017 - Philipp Temminghoff <phil65@kodi.tv>
# This program is Free Software see LICENSE file for details
import os
import sys
import codecs
import logging
RESULTS_FILE = "results.txt"
settings = {"kodi_path": "C:/Kodi",
"portable_mode": True,
"language_... |
import sys
import os
import glob
import argparse
from subprocess import call
from bounding_box import BoundingBox
import json
import itertools
import utils
# common functions
def match_layers_by_max_pmcc(jar_file, tiles_file1, tiles_file2, models_file, image_width, image_height,
fixed_layers, out_fname, meshe... |
# -*- coding: utf-8 -*-
from gluon import current
def tagQuery(tags, ctbl, ttbl, query = 0, op = 'or', field =
'texto_id'):
'''
Busca no banco de dados por conteúdo marcado pelas tags em <tags>.
A operação é recursiva, tag por tag, juntando o resultado de uma
busca ao resultado referente à tag an... |
#!/usr/bin/python
#
# This script will flatten out a folder based docbook manual into a docbot friendly "flat" structure
# (and update links in files accordingly)
# Author: Michael Neale
#
import os, sys, shutil
def flatten(root, output) :
if not os.path.isdir(output):
os.mkdir(output)
if not os.pa... |
from __future__ import unicode_literals, absolute_import
from datetime import datetime, timedelta
from django.conf import settings
from django.core.files.base import ContentFile
import logging
from openpyxl import load_workbook
import os
from six import BytesIO
import subprocess
import unicodecsv
# Python 2 can't ser... |
"""
#pycclone.source
Provides a class for handling source files. The primary goal is to create a
generator yielding (docs, code) tuples from a source file.
"""
import logging
import re
import os
import pycclone.utils as utils
import pycclone.languages as languages
try:
from StringIO import StringIO
except ImportE... |
"""
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.
"""
from __future__ import unicode_literals
import json
import os
from atomic_reactor.build import InsideBuilder
from atomic_reactor.util impor... |
#!/usr/bin/env python2.7
"""Registration script.
Usage:
registration.py [-h] [-d <sample>] [-U] [-u <upfile>] [-c <camfile>] <source> <drivemap> <footprint> <output>
Positional arguments:
source Source LAS file
drivemap Target LAS file to map source to
footprint Footprint for the source LAS file
... |
#!/usr/bin/python
#coding=utf-8
#@+leo-ver=5-thin
#@+node:bob07.20140715160011.1575: * @file hrngpS2.py
#@@first
#@@first
#@@language python
#@@tabwidth -4
import os
import sys
import leo.core.leoBridge as leoBridge
from leo_lib import lib_leo03
#@+others
#@+node:bob07.20140715160011.1576: ** gnxRepeats()
def gnxRe... |
from dnfpy.core.map2D import Map2D
import numpy as np
from sklearn.cluster import DBSCAN
import scipy.spatial.distance as dist
from dnfpyUtils.stats.statistic import Statistic
class ClusterMap(Statistic):
"""
Params:
"continuity" : float if different of 0.0, we assume that the cluster are continuous
... |
import pytest
import os
import time
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.common.exceptions import TimeoutException, NoSuchElementException
from .. import run_nbgrader
from .con... |
#!/usr/bin/python -tt
# -*- coding: utf-8 -*-
# (c) 2012, Afterburn <http://github.com/afterburn>
# (c) 2013, Aaron Bull Schaefer <aaron@elasticdog.com>
# (c) 2015, Indrajit Raychaudhuri <irc+code@indrajit.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it un... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.