src
stringlengths
721
1.04M
from __future__ import (unicode_literals, print_function, division, absolute_import) import uuid import itertools from filestore.handlers_base import HandlerBase import numpy as np from filestore.utils import install_sentinels conn = None db_name = "fs_testing_disposable_{}".format(str(uuid.uu...
# -*- coding: utf-8 -*- # Copyright (c) 2016, Thierry Lemeunier <thierry at lemeunier dot net> # All rights reserved. # # Redistribution and use in source and binary forms, with or without modification, # are permitted provided that the following conditions are met: # # 1. Redistributions of source code must retain th...
# coding=utf-8 # # Copyright 2014 Sascha Schirra # # This file is part of Ropper. # # Ropper 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 ver...
#!/usr/bin/env python import sys import os import json import re import anchore from anchore import anchore_utils gate_name = "IMAGECHECK" triggers = { 'BASEOUTOFDATE': { 'description':'triggers if the image\'s base image has been updated since the image was built/analyzed', 'params':'None' ...
from __future__ import absolute_import from django import template from django.core.urlresolvers import reverse from experiments.utils import participant from experiments.manager import experiment_manager from experiments import conf from uuid import uuid4 register = template.Library() @register.inclusion_tag('ex...
# encoding: 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 'Concern.reporter' db.alter_column('concerns_concern', 'reporter_id', self.gf('django.db....
# This file is a part of MediaDrop (http://www.mediadrop.net), # Copyright 2009-2013 MediaCore Inc., Felix Schwarz and other contributors. # For the exact contribution history, see the git revision log. # The source code contained in this file is licensed under the GPLv3 or # (at your option) any later version. # See L...
# -*- coding: utf-8 -*- # # Copyright 2019 Romain Boman # # 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 a...
# 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 may ...
# Copyright (c) 2012 LE GOFF Vincent # 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, this # list of conditions and th...
#!/usr/bin/env python2 # Copyright (C) 2011-2012 by Imperial College London # Copyright (C) 2013 University of Oxford # Copyright (C) 2014-2016 University of Edinburgh # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by ...
import uuid import pytest from elasticmagic import Document, Field from elasticmagic.types import Text def pytest_addoption(parser): parser.addoption("--es-url", action="store", default="localhost:9200") def pytest_generate_tests(metafunc): # This is called for every test. Only get/set command line argume...
import paramiko import json import time # ath0 21 channels in total; available frequencies : # Channel 01 : 2.412 GHz # Channel 31 : 2.414 GHz # Channel 02 : 2.417 GHz # Channel 32 : 2.419 GHz # Channel 03 : 2.422 GHz # Channel 33 : 2.424 GHz # ...
from __future__ import print_function import argparse import os import random import torch import torch.nn as nn import torch.nn.parallel import torch.backends.cudnn as cudnn import torch.optim as optim import torch.utils.data import torchvision.datasets as dset import torchvision.transforms as transforms import torchv...
#!/usr/bin/env python # coding=utf-8 """Sample script that demonstrates `pydocusign` usage for managing accounts. See also http://iodocs.docusign.com/#tabEndpoint6 """ import os import pydocusign try: raw_input except NameError: raw_input = input def prompt(environ_key, description, default): try: ...
import tensorflow as tf class CBOW(object): def __init__(self, args): self.__args = args self.__ngram_size = args.ngram_size self.__input_size = self.__ngram_size - 1 self.__vocab_size = args.vocab_size + 1 self.__embedding_dim = args.embedding_dim self.__learning_r...
# Written by Shlomi Fish, under the MIT Expat License. import unittest from pysollib.acard import AbstractCard from pysollib.hint import FreeCellSolver_Hint, PySolHintLayoutImportError import pysollib.stack class MockItem: def __init__(self): pass def tkraise(self): return def addtag(se...
#Utility functions for the IO part of TARDIS import os import pandas as pd import numpy as np import collections from collections import OrderedDict import yaml from astropy import constants, units as u from tardis.util import element_symbol2atomic_number import logging logger = logging.getLogger(__name__) def quan...
import os import sys from multiprocessing.connection import Client import bcrypt from sqlalchemy import create_engine from sqlalchemy.orm import sessionmaker from sqlalchemy.orm.exc import NoResultFound from terms.server.scripts.webserver import get_config from terms.server.schemata import Schema from terms.server.p...
# -*- coding: utf-8 -*- import os import sqlite3 import weakref from collections import OrderedDict from functools import reduce from ..helpers import (repeat_to_match, key_depth, expand_key, extend_functions, tuple_, ...
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. from datetime import datetime from marionette import MarionetteTestCase from marionette_driver.date_time_value import D...
# -*- coding: utf-8 -*- import time from module.plugins.internal.Account import Account class SimplydebridCom(Account): __name__ = "SimplydebridCom" __type__ = "account" __version__ = "0.15" __status__ = "testing" __config__ = [("mh_mode" , "all;listed;unlisted", "Filter hosters to us...
import argparse import itertools import json import collections import datetime import sys import mercantile import shapely.geometry MIN_DATE = '0000-00-00' MAX_DATE = '9999-99-99' MIN_ZOOM = 0 MAX_ZOOM = 19 cache_down = {} cache_up = {} cache_center = {} cache_date = {} cache_in_bound = {} def get_down_tiles(x, ...
# coding: utf8 { '!langcode!': 'es', '!langname!': 'Español', '"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"actualice" es una expresión opcional como "campo1=\'nuevo_valor\'". No se puede actualizar o eliminar resultados de un JOIN', '%s %%{row} de...
import argparse import browser import sys latest_channels = { 'firefox': 'nightly', 'chrome': 'dev', 'safari': 'preview', 'safari_webdriver': 'preview', 'servo': 'nightly' } channel_by_name = { 'stable': 'stable', 'release': 'stable', 'beta': 'beta', 'nightly': latest_channels, ...
# -*- encoding: utf-8 -*- ################################################################################ # # # Copyright (C) 2013-Today Carlos Eduardo Vercelino - CLVsol # # ...
#! /usr/bin/env python from __future__ import print_function import sys import json import requests import struct import argparse def load_all_packages(elm_version, url=None): if url is None: url = "http://package.elm-lang.org/all-packages?elm-package-version=" payload = requests.get("{url}{elm_versi...
import types class CorpyRuntime: def __init__(self, configuration): self.configuration = configuration def get_components(self): return dict(self.configuration.__dict__) def component(class_or_foo): if isinstance(class_or_foo, type): clazz = class_or_foo elif isinstance(class...
from collections import namedtuple from math import sin, cos, radians import os import time import cv2 import numpy as np from caffew import caffe_classifier import shm from vision.modules import ModuleBase, gui_options capture_source = 'downward' vision_options = [gui_options.BooleanOption('debugging', False), gui...
# -*- coding: utf-8 -*- # Copyright 2008 Jaap Karssenberg <jaap.karssenberg@gmail.com> '''Spell check plugin based on gtkspell''' import os import gobject from zim.config import get_environ from zim.plugins import PluginClass from zim.gui.widgets import ErrorDialog from zim.signals import SIGNAL_AFTER try: imp...
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (C) 2004-2005 Tristan Seligmann and Jonathan Jacobs # Copyright (C) 2012-2014 Bastian Kleineidam # Copyright (C) 2015-2016 Tobias Gruetzmacher '''update languages.py from pycountry''' from __future__ import absolute_import, division, print_function import os import...
#!/usr/bin/env python2 # vim:fileencoding=utf-8 from __future__ import (unicode_literals, division, absolute_import, print_function) __license__ = 'GPL v3' __copyright__ = '2014, Kovid Goyal <kovid at kovidgoyal.net>' # Implement the StatusNotifierItem spec for creating a system tray icon in #...
# -*- coding: utf-8 -*- from django.core.management.base import BaseCommand import xml.etree.ElementTree as ET from time import sleep import os from applications.product.models import Category __author__ = 'AlexStarov' def search_in_category(name, id_1c, parent=None, ): try: cat = Category.objects.get(t...
import random import agents from subprocess import Popen, PIPE, STDOUT import time import json import sys last_score = 0 ind = 0 p = Popen(['th', 'gameStateQ.lua'], stdout=PIPE, stdin=PIPE, stderr=STDOUT) score_record = [] max_score = 0 ave_score = 550 class Move: up, right, down, left = list(range(4)) def ...
# The Hazard Library # Copyright (C) 2012-2017 GEM Foundation # # 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 the # License, or (at your option) any later version. #...
""" Tests for Course Blocks forms """ from urllib import urlencode import ddt from django.http import Http404, QueryDict from opaque_keys.edx.locator import CourseLocator from rest_framework.exceptions import PermissionDenied from openedx.core.djangoapps.util.test_forms import FormTestMixin from student.models import...
import numpy as np from matplotlib.colors import LinearSegmentedColormap def map_to_table(cmap,nvals=256): ''' Takes a LinearSegmentedColormap, and returns a table of RGBA values spanning that colormap. arguments: cmap - the LinearSegmentedColormap instance nvals- the number of values to span...
# win32.py - utility functions that use win32 API # # Copyright 2005-2009 Matt Mackall <mpm@selenic.com> and others # # This software may be used and distributed according to the terms of the # GNU General Public License version 2 or any later version. import ctypes, errno, os, struct, subprocess, random _kernel32 = ...
# -*- coding: utf-8 -*- # # GPAW documentation build configuration file, created by # sphinx-quickstart on Fri Jun 20 09:39:26 2008. # # This file is execfile()d with the current directory set to its containing dir. # # The contents of this file are pickled, so don't put values in the namespace # that aren't pickleable...
#!/usr/bin/env python __author__ = 'paulp' import argparse from casperfpga.casperfpga import CasperFpga parser = argparse.ArgumentParser( description='Program an FPGA.', formatter_class=argparse.ArgumentDefaultsHelpFormatter) parser.add_argument(dest='hostname', type=str, action='store', ...
import fileinput RECORD_ID_INDEX = 0 ISSUE_FIELD_INDEX = 3 DECIMAL_LAT_FIELD_INDEX = 1 DECIMAL_LON_FIELD_INDEX = 2 MAJOR_ISSUES = ['COORDINATE_INVALID', 'COORDINATE_OUT_OF_RANGE', 'ZERO_COORDINATE', 'COUNTRY_COORDINATE_MISMATCH'] MINOR_ISSUES = ['GEODETIC_DATUM_INVALID', 'COORDINATE_REPROJECTION_FAILED', 'COORDINATE_R...
# coding=utf-8 r""" This code was generated by \ / _ _ _| _ _ | (_)\/(_)(_|\/| |(/_ v1.0.0 / / """ from tests import IntegrationTestCase from tests.holodeck import Request from twilio.base.exceptions import TwilioException from twilio.http.response import Response class SyncMapPermissionTestCase...
import json import time import logging import random import string import uuid import numpy import tornado.gen import tornado.httpclient import tornado.options async_http_client = tornado.httpclient.AsyncHTTPClient() id_counter = 0 batch_upload_took = [] upload_data_count = 0 def delete_index(idx_name): try: ...
''' Created on Apr 25, 2014 @author: Gregory Kramida @copyright: (c) Gregory Kramida 2014 @license: GNU v3 ''' import gpxanalyzer.gpxanalyzer_internals as gi import numpy as np import sys import math import timeit amplitude_thresholds = np.array([0.0, 0.000000000001, 0.037, 0.08, 0.195, 0.32],dtype=np.float64) n_ampl...
# -*- coding: utf-8 -*- ######################################################################### ## Customize your APP title, subtitle and menus here ######################################################################### response.title = request.application response.subtitle = T('customize me!') response.meta.au...
#!/usr/bin/env python # Copyright (C) 2006-2021 Music Technology Group - Universitat Pompeu Fabra # # This file is part of Essentia # # Essentia 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 (FSF), e...
#!/usr/bin/env python3 from olegdb.oleg import OlegDB import lz4.block, json, psycopg2, time, multiprocessing import mmap olegdb_c = OlegDB(db_name="waifu") values_file = open("./data/waifu.val", "r+b") values_file_map = mmap.mmap(values_file.fileno(), 0) def insert_post(conn, oconn, okey, od, should_commit=True): ...
#! /usr/bin/env python import sqlite3 import unittest import psycopg2 from psycopg2.extras import DictCursor import dictorm test_db_login = { 'database': 'postgres', 'user': 'postgres', 'password': 'dictorm', 'host': 'localhost', 'port': '54321', 'connect_timeout': 3, } def _no_refs(o): ...
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). import logging import os import subprocess import sys from abc import ABC, abstractmethod from contextlib import contextmanager from pants.util.collections import ensure_str_list from pan...
# Copyright (C) 2010-2011 Richard Lincoln # # 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 # rights to use, copy, modify, merge, publish...
# -*- encoding: utf-8 -*- ########################################################################### # Module Writen to OpenERP, Open Source Management Solution # # Copyright (c) 2011 Vauxoo - http://www.vauxoo.com/ # All Rights Reserved. # info Vauxoo (info@vauxoo.com) ####################################...
bl_info = { 'name': 'RayPump Online Accelerator', 'author': 'michal.mielczynski@gmail.com, tiago.shibata@gmail.com', 'version': '(0, 3, 4)', 'blender': (2, 6, 6), 'location': 'Properties > Render > RayPump.com', 'description': 'Easy to use free online GPU-farm for Cycles', 'category': 'Rende...
#!/usr/bin/env python import threading from alarmcode.colors import bcolors import paho.mqtt.client as mqtt import random import json import os import smtplib from email.mime.text import MIMEText from collections import OrderedDict import subprocess import sys import re import requests import logging logging = loggin...
"""Support for X10 dimmer over Mochad.""" import logging import voluptuous as vol from homeassistant.components.light import ( ATTR_BRIGHTNESS, SUPPORT_BRIGHTNESS, Light, PLATFORM_SCHEMA, ) from homeassistant.components import mochad from homeassistant.const import CONF_NAME, CONF_PLATFORM, CONF_DEVIC...
from __future__ import print_function import sys import os import subprocess import time try: from StringIO import StringIO # Python2 except ImportError: from io import StringIO # Python3 PY2 = sys.version_info < (3,) PY3 = sys.version_info > (3,) TMP_SED = 'tmp.sed' TMP_INPUT = 'tmp.input' TMP_PY = 'tmp....
import xbmc import xbmcgui import xbmcvfs import xml.etree.ElementTree as ET from contextlib import closing from lib.libs.pykodi import log, localize as L FILENAME = 'special://userdata/advancedsettings.xml' FILENAME_BAK = FILENAME + '.beef.bak' ROOT_TAG = 'advancedsettings' VIDEO_TAG = 'videolibrary' MUSIC_TAG = 'm...
import os import tempfile import unittest import logging from pyidf import ValidationLevel import pyidf from pyidf.idf import IDF from pyidf.internal_gains import SurfaceContaminantSourceAndSinkGenericBoundaryLayerDiffusion log = logging.getLogger(__name__) class TestSurfaceContaminantSourceAndSinkGenericBoundaryLaye...
import json from urllib.request import urlopen, URLError from django.core.management.base import BaseCommand, CommandError from ...models import ZipcodeMapping # https://www.data.gouv.fr/en/datasets/codes-postaux/ DEFAULT_JSON_URL = 'https://www.data.gouv.fr/en/datasets/r/34d4364c-22eb-4ac0-b179-7a1845ac033a' class...
from __future__ import print_function # This file is part of BurnMan - a thermoelastic and thermodynamic toolkit for the Earth and Planetary Sciences # Copyright (C) 2012 - 2017 by the BurnMan team, released under the GNU # GPL v2 or later. import numpy as np def material_property(func): """ Decorator @mater...
#--------------------------------------------------------------------------- # Introdução a Programação de Computadores - IPC # Universidade do Estado do Amazonas - UEA # Prof. Jucimar Jr # # Ulisses Antonio Antonino da Costa 1515090555 # Walter Nobre da Silva conceição 1715310057 # Jandinne Duarte de Oliveira ...
# Rekall Memory Forensics # Copyright 2014 Google 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 version 2 of the License, or (at # your option) any later ver...
# # 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 us...
""" CorosyncCmapctl - Command ``corosync-cmapctl [params]`` ======================================================= This module parses the output of the ``corosync-cmapctl [params]`` command. """ from insights import parser, CommandParser from insights.parsers import SkipException, ParseException from insights.specs ...
#----------------------------------------------------------------------- # # Copyright (C) 2000, 2001 by Autonomous Zone Industries # Copyright (C) 2002 Gregory P. Smith # # License: This is free software. You may use this software for any # purpose including modification/redistribution, so long as ...
#========================================================================== # # Copyright Insight Software Consortium # # 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 # # ...
#!/usr/bin/python # coding:utf-8 import os import re import fnmatch import zipfile import shutil import getpass import glob PATH = "/Users/"+ getpass.getuser() + "/Downloads" ProtectImagePath = "/Users/wzg/Downloads/testimage/help_images" prefix = "FS_HelpGuide_" #获取替换文件的路径 def realProtectImagePath(): global Pro...
#!/usr/bin/python """Global version file. This program is used to manage versions. Prior to each release, please run it with update. """ import argparse import json import os import yaml _VERSION_CODE = ''' import json import os import subprocess try: # We are looking for the git repo which contains this file....
#!python """Bootstrap setuptools installation If you want to use setuptools in your package's setup.py, just include this file in the same directory with it, and add this to the top of your setup.py:: from ez_setup import use_setuptools use_setuptools() If you want to require a specific version of setuptools...
#!/usr/bin/python # # from PIL import Image from PIL import ImageFont from PIL import ImageDraw # # Scales and centers img into a box of size (box_x_size, box_y_size). # Scaling keeps original img aspect ratio. # Returns an image of size (box_x_size, box_y_size) # def PIL_resize_proportional(img, layout, dic_key, CAN...
__author__ = 'jcorbett' from slickqaweb.app import app from flask import request, Response from bson import ObjectId from slickqaweb.model.storedFile import StoredFile from slickqaweb.model.fileChunk import FileChunk from slickqaweb.model.serialize import deserialize_that from .standardResponses import JsonResponse, r...
# © 2016 ADHOC SA # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from odoo import models, fields import datetime class AccountPayment(models.Model): _inherit = "account.payment" def _get_liquidity_move_line_vals(self, amount): vals = super()._get_liquidity_move_line_vals(amount) ...
# script for making a physics joints chain # use all the joints heirarchy # Steps are: # 1 - make nulls between joints # 2 - make marker capsule for joints collision # 3 - make a physics joint and setup all the connections # setup physics joints # Github repo - https://github.com/Neill3d/MoPlugs # Licensed unde...
import logging from nymms.reactor.handlers.Handler import Handler from nymms.utils.aws_helper import ConnectionManager from jinja2 import Template from nymms.utils.templates import SimpleUndefined logger = logging.getLogger(__name__) class SESHandler(Handler): """ A basic handler to send alerts to people via e...
import discord import injector import database import pymongo class Events: """Events""" def __init__(self, bot): self.bot = bot async def on_connect(self): try: await database.client.server_info() except pymongo.errors.ServerSelectionTimeoutError as error: ...
class Timer: def __init__(self, interrupts): self.interrupts = interrupts self.div = 0 # FF04 self.sub_div = 0 self.tima = 0 # FF05 self.sub_tima = 0 self.tma = 0 # FF06 # FF07 bits 2-0 self.timer_run = False ...
""" Django settings for LcvSearch project. Generated by 'django-admin startproject' using Django 1.11. For more information on this file, see https://docs.djangoproject.com/en/1.11/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.11/ref/settings/ """ import os...
# Copyright (c) 2011 Justin Santa Barbara # # 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 applicab...
#!/usr/bin/env python __cmdname__ = 'activate_metrics' __cmdopts__ = '' import sys import log import util class Module(object): def __init__(self, api, account): self.api = api self.account = account def command(self, opts, pattern, *metrics_to_enable): """Activate metrics for checks...
# This file helps to compute a version number in source trees obtained from # git-archive tarball (such as those provided by githubs download-from-tag # feature). Distribution tarballs (built by setup.py sdist) and build # directories (produced by setup.py build) will contain a much shorter file # that just contains t...
from galaxy.test.base.twilltestcase import TwillTestCase class UcscTests(TwillTestCase): def test_00_first(self): # will run first due to its name """Clearing history""" self.clear_history() def test_Biomart_Uniprot(self): """Connection to Biomart""" # some button indices...
''' @author: Pengtao.Zhang ''' import zstackwoodpecker.test_util as test_util import zstackwoodpecker.test_lib as test_lib import zstackwoodpecker.operations.resource_operations as res_ops import zstackwoodpecker.test_state as test_state import zstackwoodpecker.operations.vm_operations as vm_ops import zstackwoodpeck...
# -*- coding=utf-8 -*- import os from setuptools import setup, find_packages from version import get_version version = get_version() setup(name='edem.group.about', version=version, description="Customization of the GroupServer About Group box", long_description=open("README.txt").read() + "\n" + ...
import numpy as np import fnmatch import os import re from vsmlib.misc.data import detect_archive_format_and_open import logging logger = logging.getLogger(__name__) _default_tokenizer_patter = r"[\w\-']+|[.,!?…]" class LineTokenizer: def __init__(self, re_pattern=_default_tokenizer_patter): self.re_to...
#!/usr/bin/env python3 # UserSocket接口,用于浏览器通信 import json import tornado.websocket from home.handler.xiaoTianHandler import xiao_tian_answer from setting import logger def send_to_one_user(user_client, message): user_client.write_message(json.dumps(message)) def send_to_many_user(user_clients, message): ...
import numpy as np import matplotlib.pyplot as plt from sklearn.metrics import roc_curve, auc from sklearn.model_selection import KFold from sklearn.linear_model import LogisticRegression from sklearn.metrics import * from timeit import default_timer as timer from random import randint from sklearn.feature_selection im...
# Vantage Linguistics AnserWorks ActiveX Controls # CVE-2007-6387 import logging log = logging.getLogger("Thug") def GetHistory(self, arg): if len(arg) > 215: log.ThugLogging.log_exploit_event(self._window.url, "AnswerWorks ActiveX", ...
# encoding: utf-8 # module PyKDE4.kdeui # from /usr/lib/python2.7/dist-packages/PyKDE4/kdeui.so # by generator 1.135 # no doc # imports import PyKDE4.kdecore as __PyKDE4_kdecore import PyQt4.QtCore as __PyQt4_QtCore import PyQt4.QtGui as __PyQt4_QtGui import PyQt4.QtSvg as __PyQt4_QtSvg class KWidgetItemDelegate(__P...
#!/usr/bin/env python3 # -*- coding: UTF-8 -*- import os, time, sys from sys import argv, stdout # Global variables INPUT = None OUTPUT = None LENGTH = None VERBOSE = False AUTOOUT = False AUTOLEN = False # Console colors W = '\033[0m' # white (normal) R = '\033[31m' # red G = '\033[92m' # green B = '\033[34m' ...
# coding=utf-8 r""" This code was generated by \ / _ _ _| _ _ | (_)\/(_)(_|\/| |(/_ v1.0.0 / / """ from twilio.base import deserialize from twilio.base import serialize from twilio.base import values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import...
import os import sys import unittest from selenium.webdriver import Firefox from expecter import expect from mock import Mock path = os.path.dirname(os.path.abspath(__file__)) sys.path.append(os.path.join(path, '..')) from seleasy import Seleasy, SmartElementSet, NoElementsError WEBSERVER_ADDRESS = 'http://127.0....
# -*- coding: utf-8 -*- """Module for user management and dashboard asignment""" from Acquisition import aq_inner from AccessControl import Unauthorized from five import grok from plone import api from zope.component import getMultiAdapter from zope.schema.vocabulary import SimpleVocabulary from Products.CMFPlone.ut...
from time import sleep from PIL import Image import os import math import random from .utils import * from UpdatedImageProcessing import * from .settings import GCSSettings from .converter_functions import inverse_haversine, get_mission_json from .location import Location """ This file contains our image processing log...
#/u/GoldenSights import praw import time import datetime import sqlite3 '''USER CONFIGURATION''' APP_ID = "" APP_SECRET = "" APP_URI = "" APP_REFRESH = "" # https://www.reddit.com/comments/3cm1p8/how_to_make_your_bot_use_oauth2/ USERAGENT = "" #This is a short description of what the bot does. For example "/u/GoldenS...
# -*- coding: utf-8 -*- from __future__ import absolute_import from .utils import get_db_type SQL = { "sqlite": [""" CREATE TABLE "category" ( id INTEGER NOT NULL, name VARCHAR(255) NOT NULL, PRIMARY KEY (id) );""", 'ALTER TABLE "thread" ADD COLUMN cat...
import os import logging import sys import tempfile from nose.plugins.base import Plugin from nose.case import FunctionTestCase # Solution from # http://stackoverflow.com/questions/17583443/what-is-the-correct-way-to-share-package-version-with-setup-py-and-the-package from pkg_resources import get_distribution, Distri...
"""Kraken - objects.components.component_input module. Classes: ComponentInput -- ComponentInput representation. """ from kraken.core.objects.object_3d import Object3D class ComponentInput(Object3D): """ComponentInput object.""" def __init__(self, name, parent=None, metaData=None): super(Component...
#!/usr/bin/python """ Library used to determine a file MIME type by its magic number, it doesn't have any external dependencies. Based on work of Jason Petrone (jp_py@jsnp.net), adapted to autotest. Command Line Usage: Running as 'python magic.py file_path' will print a mime string (or just a description) of t...
import collections import unittest from typing import List import utils neighbors = [ [0, -1], [0, 1], [-1, 0], [1, 0], ] next_neighbor_indexes = [ [0, 2, 3], [1, 2, 3], [0, 1, 2], [0, 1, 3], ] # DFS, BFS. class Solution: def shortestBridge(self, grid: List[List[int]]) -> int: ...
import os import urlparse from lib import gdata import lib.gdata.youtube.client import secrets GDATA_API_CLIENT_ID = 'CrowdTube-Connector' class YouTubeCaptionEditor(object): def __init__(self, google_email, google_password, youtube_username): self.youtube_username = youtube_username self.youtub...
# -*- coding: utf-8 -*- #!/usr/bin/python #===============================# #CODE PROPERTY OF LUKAS G. OLSON# #https://github.com/lukasdragon # #===============================# #Color variables! COKBLUE = '\033[94m'; COKGREEN = '\033[92m'; CWARNING = '\033[93m'; CFAIL = '\033[91m'; CRESET ='\033[0m'; CBOLD = '\033[0...