text stringlengths 12 6.59M |
|---|
#!/usr/bin/env python
# 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/.
# Copyright (c) 2014 Mozilla Corporation
#
# Contributors:
# Jeff Bryner jbryner@mozilla.com
impo... |
import tensorflow as tf
from tensor_train_base import TensorTrainBase
from tensor_train import TensorTrain
from tensor_train_batch import TensorTrainBatch
import shapes
import utils
# TODO: add complexities to the comments.
def full(tt):
"""Converts a TensorTrain into a regular tensor or matrix (tf.Tensor).
Ar... |
# Python script to migrate new answers to answers format.
import yaml
from pymongo import MongoClient
import pprint
f = open('config.yaml')
config = yaml.safe_load(f)
f.close()
pp = pprint.PrettyPrinter()
pp.pprint(config)
client = MongoClient(config['mongo']['host'],config['mongo']['port'])
db = client.users
collect... |
#!/usr/bin/env python
# written by brady [r3dact3d]
from bs4 import BeautifulSoup
import requests
import tweepy
from config import *
url = 'http://www.urbandictionary.com/'
page = requests.get(url)
soup = BeautifulSoup(page.text, "lxml")
data = dict()
data['def'] = soup(class_ = 'meaning')[0].text
data['word'] = soup(... |
# -*- test-case-name: twext.who.test.test_aggregate -*-
##
# Copyright (c) 2006-2013 Apple 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/... |
##
# Copyright (c) 2006-2013 Apple 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 l... |
#!/usr/bin/env ambari-python-wrap
"""
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... |
# coding: utf-8
"""
mistune
~~~~~~~
The fastest markdown parser in pure Python, inspired by marked.
:copyright: (c) 2014 by Hsiaoming Yang.
"""
import re
__version__ = '0.2.0'
__author__ = 'Hsiaoming Yang <me@lepture.com>'
__all__ = [
'BlockGrammar', 'BlockLexer',
'InlineGrammar', 'InlineLex... |
#! /usr/bin/env python
import glob
import os
import traceback
from random import randint
import argparse
import signal
import time
from keras.callbacks import Callback
from keras.layers.convolutional import Convolution2D, MaxPooling2D
from keras.layers.core import Dense, Flatten, Activation
from keras.models import ... |
import collections
import os
from tempfile import NamedTemporaryFile as tempfile
from OpenSSL.crypto import verify, X509, PKey, Error as OpenSSL_crypto_Error
from cryptography.hazmat.backends.openssl.backend import backend
from cryptography.hazmat.primitives import serialization
from utlz import flo
from ctutlz.utils... |
import pandas as pd
import plotly.plotly as py
import time
import copy
# from plotly.graph_objs import *
import plotly.graph_objs as go
from collections import defaultdict
from IPython.display import display,Image
from .exceptions import CufflinksError
from .colors import normalize,get_scales,colorgen,to_rgba,get_color... |
import os
import sys
from converter import Converter
from extensions import valid_input_extensions, valid_output_extensions
from qtfaststart import processor
class MkvtoMp4:
def __init__(self, file, FFMPEG_PATH="FFMPEG.exe", FFPROBE_PATH="FFPROBE.exe", delete=True, output_extension='mp4', relocate_moov=True, vide... |
import pandas as pd
import time
import copy
import numpy as np
# from plotly.graph_objs import *
from plotly.graph_objs import Figure, Layout, Bar, Box, Scatter, FigureWidget, Scatter3d, Histogram, Heatmap, Surface, Pie
import plotly.figure_factory as ff
from collections import defaultdict
from IPython.display import d... |
#!/bin/env python3
import json
import sys
import argparse
import glob
import re
import itertools
#import math
from collections import defaultdict
from time import gmtime, strftime
import numpy
def curtimestr():
return strftime("%Y-%m-%d %H:%M:%S", gmtime())
def document_generator(path):
with... |
from django.core.management.base import BaseCommand
from django.db import transaction
from sampledatahelper.helper import SampleDataHelper
from cinemair.users.models import User
from cinemair.cinemas.models import Cinema
from cinemair.films.models import Film
from cinemair.shows.models import Show
NUM_CINEMAS = 6
N... |
from __future__ import unicode_literals
from builtins import object
import base64
import datetime
import json
import logging
import os
import pickle
import re
from collections import OrderedDict
import hiyapyco
import raven
import sarge
from simple_salesforce import Salesforce
import yaml
import requests
from distu... |
#!/usr/bin/env python
# Get a permission denied error when running the script in the shell? chmod 755 the script .py file
import sys
import os
import subprocess
import shutil
import httplib, urllib
# COMIC_TAGGER_PATH = 'COMIC_TAGGER_PATH/Applications/ComicTagger.app/Contents/MacOS/ComicTagger'
COMIC_TAGGER_PATH = ... |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
# PanLex ToolKit
import unicodedata
import regex as re
from unidecode import unidecode
from bs4 import Tag
from time import sleep
def preprocess(entries):
# perform across-the-board preprocessing of things that should !ALWAYS! be done
result = []
for entry in... |
# -*- coding: utf-8 -*-
__author__ = "Ponzoni, Nelson"
__copyright__ = "Copyright 2015"
__credits__ = ["Ponzoni Nelson"]
__maintainer__ = "Ponzoni Nelson"
__contact__ = "npcuadra@gmail.com"
__email__ = "npcuadra@gmail.com"
__license__ = "GPL"
__version__ = "1.0.0"
__status__ = "Produ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Provides the is_empty() method."""
def get_member_count(my_sequence):
"""Returns the number of members of a list object.
Args:
my_sequence (sequence): The sequence object being measured.
Returns:
mixed: If the object can be measured it retur... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Task 10"""
MOVIE = 'dr. strangelove or: how i learned to stop worrying and love the bomb'
ENTITLED = MOVIE.title()
|
# chromatic-generator.py
import glob, os, argparse
from PIL import Image
# Decode command line arguments
parser = argparse.ArgumentParser(description='Prepares images and creates a JSON file for consumption with chromatic.js')
parser.add_argument('inputdir', help='Source directory with the images')
parser.add_argumen... |
#!/usr/bin/env python
# encoding: utf-8
import argparse
import mm1
import sim
import time
### Parse command line arguments
parser = argparse.ArgumentParser(description="M/M/1 queue simulation -- Main script")
parser.add_argument('sim_duration', metavar='simulation_duration',
type=int, help='simul... |
#!/usr/bin/env python3
# -*- coding: ascii -*-
import sys, os, re, time
import operator, collections
import base64
import fnmatch
import threading
import subprocess
import sqlite3
from xml.sax.saxutils import escape
try:
from queue import Queue
except ImportError:
from Queue import Queue
import basebot
INB... |
import ctypes
import mmap
import os
import sys
import tempfile
import libgettid
PAGESIZE = mmap.PAGESIZE
BUFFER_IDX_TYPE = ctypes.c_byte
LABEL_SZ_TYPE = ctypes.c_ushort
WRITE_BUFFER_UNUSED = 255
DEFAULT_PATH = os.environ.get('MMSTATS_PATH', tempfile.gettempdir())
class DuplicateStatName(Exception):
"""Cannot a... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import datetime as dt
import time
import io
import os
import json
import logging
import requests
import shutil
import tempfile
from django.core import serializers
from django.core.management.base import BaseCommand
from django.contrib.contenttypes.models ... |
"""
Terrain generating algorithm
"""
# Imports, sorted alphabetically.
# Python packages
from math import sqrt
# Third-party packages
# Nothing for now
# Modules from this project
from blocks import *
from utils import FastRandom, fast_floor, fast_abs
# Improved Perlin Noise based on Improved Noise reference impl... |
# -*- coding: utf-8 -*-
VERSION = (0, 1, 0)
__author__ = 'Vincent Lara'
__contact__ = "vincent.lara@data.gouv.fr"
__homepage__ = "https://github.com/"
__version__ = ".".join(map(str, VERSION))
from flask import Flask, request_started, request, request_finished, g
from flask_bootstrap import Bootstrap
import os
from f... |
"""Functions to plot M/EEG data e.g. topographies
"""
from __future__ import print_function
# Authors: Alexandre Gramfort <gramfort@nmr.mgh.harvard.edu>
# Denis Engemann <d.engemann@fz-juelich.de>
# Martin Luessi <mluessi@nmr.mgh.harvard.edu>
# Eric Larson <larson.eric.d@gmail.com>
#
# Licen... |
#!/usr/bin/env python
import ujson as json
import logging
import zmq
import cif.hunter
from cifsdk.client.zeromq import ZMQ as Client
from cif.constants import HUNTER_ADDR, ROUTER_ADDR, HUNTER_SINK_ADDR
from csirtg_indicator import Indicator
from csirtg_indicator.exceptions import InvalidIndicator
import multiprocessi... |
# -*- coding: utf-8 -*-
import calendar, time
from flask.ext.restplus import fields, abort, marshal, Resource, reqparse
from flask.ext.security import login_required, current_user, roles_accepted
from flask import request, redirect, url_for, jsonify, current_app
from ..models import (taxis as taxis_models,
administ... |
#!/usr/bin/env python
############################################################################
#
# Copyright 2017-2018
#
# https://github.com/HPC-buildtest/buildtest-framework
#
# This file is part of buildtest.
#
# buildtest is free software: you can redistribute it and/or modify
# it under the terms o... |
import datetime
from functools import wraps
import logging
import os
from typing import Any, Callable, Dict, Optional, TypeVar, Tuple
import ujson
from django.conf import settings
from django.db import transaction
from django.utils.translation import ugettext as _
from django.utils.timezone import now as timezone_now
... |
IDX = 12
import time
# Import class definitions from the class definition file
import classDef
# Initialize a list of objects
sampleList = []
for i in range(IDX):
# Initialize an object
t = classDef.sample()
# Assign the time as the current iteration counter
t.time = i*i
t.heartRate = i + 140
t.... |
# 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... |
import musicbrainzngs as mb
mb.set_useragent("opmuse", "DEV", "http://opmu.se/")
class Musicbrainz:
def get_album(self, album_entity):
artistname = album_entity.artists[0].name if len(album_entity.artists) > 0 else None
result = mb.search_releases(release=album_entity.name, artistname=artistname)
... |
import os, shutil, sys, datetime
import PyQt4.QtGui
import PyQt4.QtCore
import PyQt4.uic
import PIL.Image, PIL.ImageOps
import numpy as np
import pickle
form, base = PyQt4.uic.loadUiType('./mainUI.ui')
form1, base1 = PyQt4.uic.loadUiType('./dialogUI.ui')
form2, base2 = PyQt4.uic.loadUiType('./modelselectUI.ui')
MODEL... |
# Copyright 2015 Intel
# 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 applica... |
# -*- coding: utf-8 -*-
import calendar, time
from flask.ext.restplus import fields, abort, marshal, Resource, reqparse
from flask.ext.security import login_required, current_user, roles_accepted
from flask import request, redirect, url_for, jsonify, current_app
from ..models import (taxis as taxis_models, vehicle as v... |
from django.shortcuts import render, get_object_or_404, redirect
from django.views.decorators.csrf import requires_csrf_token
from django.http import HttpResponse
from django.core.exceptions import PermissionDenied
from django.contrib.auth.models import User #to get auth_user table
from .models import user as csv2_use... |
import time
import yaml
import json
import re
import base64
from StringIO import StringIO
from zipfile import ZipFile
import base
log = base.genlog('bukkit') # Generate a log instance for the parser.
def run():
'''Parser Runtime Function
Here is where we will be actually running all fo the code below. This ... |
#!/usr/bin/env python
# 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
#
# Authors:
# - Paul Nilsson, paul.nilsson@cern.ch, 2018
from .services impo... |
# -*- coding: utf-8 -*-
import gevent.monkey
gevent.monkey.patch_all()
import gevent
from gevent.queue import Queue
import twitter
from threading import Thread
# debuggerin
import requests
__version__ = "0.1.0"
class Correct(object):
def __init__(self, auth, phrases=None):
""" Create a new correctional b... |
#!/usr/bin/env python3
# vim:fileencoding=utf-8:ts=8:et:sw=4:sts=4:tw=79
"""
papatcher.py: simple python PA patcher
Copyright (c) 2014 Pyrus <pyrus@coffee-break.at>
See the file LICENSE for copying permission.
"""
from concurrent import futures
from getpass import getpass
from gzip import decompress
from hashlib imp... |
# 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... |
"""A (less & less) simple Python editor"""
import W
import Wtraceback
from Wkeys import *
import macfs
import MacOS
import Win
import Res
import Evt
import os
import imp
import sys
import string
import marshal
import regex
_scriptuntitledcounter = 1
_wordchars = string.letters + string.digits + "_"
class Editor(W.... |
import io
import os
import time
import subprocess
import re
import cherrypy
import calendar
import datetime
import fcntl
import select
from pydispatch import dispatcher
def log(msg):
cherrypy.log(msg, context='transcoding')
class FFMPEGError(Exception):
pass
class FFMPEGTranscoderSubprocessTool(cherrypy.T... |
from math import ceil
from annotypes import add_call_types
from malcolm.core import NumberMeta, PartRegistrar, Widget
from malcolm.modules import ADCore, builtin, scanning
APartName = builtin.parts.APartName
AMri = builtin.parts.AMri
TETRAMM_BASE_FREQ = 100000.0
TETRAMM_MIN_VALUES_PER_READ = 5
@builtin.util.no_sav... |
# Copyright 2010 OpenStack Foundation
# Copyright 2013 NTT corp.
# 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/LIC... |
#!/usr/bin/env python
r"""
This module provides functions which are useful to plug-in call point programs.
"""
import sys
import os
import re
import collections
import gen_print as gp
import gen_valid as gv
import gen_misc as gm
import gen_cmd as gc
PLUG_VAR_PREFIX = os.environ.get("PLUG_VAR_PREFIX", "AUTOBOOT")
... |
# -*- coding: utf-8 -*-
import calendar, time, hashlib, math
from flask_restplus import fields, abort, marshal, Resource, reqparse
from flask_security import login_required, current_user, roles_accepted
from flask import request, current_app, g
import APITaxi_models as models
from APITaxi_models import db
from APITaxi_... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2007-2009 Christopher Lenz
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
from datetime import datetime
import doctest
import os
import os.path
import shutil
from StringIO im... |
"""Module to assemble families from ttfs and diff families"""
import os
import re
import uuid
from copy import deepcopy
from diffenator.font import DFont
from diffenator.diff import DiffFonts
from diffenator.dump import dump_glyphs
from gfregression import downloadfonts
import json
current_dir = os.path.dirname(__file... |
"""
Modules package holds EngineModule implementations
Copyright 2015 BlazeMeter 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... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from django.db import models
from django.utils import timezone
from polymorphic import PolymorphicManager
class PublishableManager(models.Manager):
def all_published(self):
return super(PublishableManager, self).get_query_set().filter(
date_avail... |
# pylint: disable=E1103
import pandas as pd
import os.path
from . import resource_usage as ru
TRANSCRIPT_GTF_FILE = "TRANSCRIPT_GTF_FILE"
GENOME_FASTA_DIR = "GENOME_FASTA_DIR"
SIMULATED_READS = "SIMULATED_READS"
LEFT_SIMULATED_READS = "LEFT_SIMULATED_READS"
RIGHT_SIMULATED_READS = "RIGHT_SIMULATED_READS"
FASTQ_READS... |
import jsonfield
from datetime import datetime
from decimal import Decimal
from django.db import models
class EmergencyOrderStatusUpdate(models.Model):
STATUS_PENDING = 'PENDING'
STATUS_RECEIVED = 'RECEIVED'
STATUS_REJECTED = 'REJECTED'
STATUS_APPROVED = 'APPROVED'
STATUS_CANCELLED = 'CANCELLED'
... |
from __pyjamas__ import JS
class HTTPRequest:
# also callable as: asyncPost(self, url, postData, handler)
def asyncPost(self, user, pwd, url, postData=None, handler=None):
if postData == None:
return self.asyncPostImpl(None, None, user, pwd, url)
return self.asyncPostImpl(user, pwd,... |
# -*- coding: utf-8 -*-
import calendar, time
from flask.ext.restplus import fields, abort, marshal, Resource, reqparse
from flask.ext.security import login_required, current_user, roles_accepted
from flask import request, current_app, g
from APITaxi_models import (taxis as taxis_models, administrative as administrativ... |
from __future__ import print_function
from subprocess import PIPE, Popen
import re
import sys
def main():
parser = Parser()
parser.parse_files(sys.argv[1:])
WrapperGenerator(parser).generate()
print('\nDone.', file=sys.stderr)
class WrapperGenerator(object):
def __init__(self, parser):
... |
"""Unit tests for collections.py."""
import unittest, doctest
import inspect
from test import support
from collections import namedtuple, Counter, OrderedDict
from test import mapping_tests
import pickle, copy
from random import randrange, shuffle
import operator
from collections import Hashable, Iterable, Iterator
fr... |
# -*- coding: utf-8 -*-
# Copyright 2016 KMEE - Hendrix Costa <hendrix.costa@kmee.com.br>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from openerp import fields, models
class HrContract(models.Model):
_inherit = 'hr.contract'
payment_mode_id = fields.Many2one(
string="Forma de Pa... |
#!/usr/bin/env python
"""
An unofficial API for pitchfork.com reviews.
author: Michal Czaplinski
email: mmczaplinski@gmail.com
"""
import json
import re
import difflib
import sys
from bs4 import BeautifulSoup
if sys.version_info >= (3, 0):
from urllib.parse import urljoin
from urllib.request import urlopen... |
#!/usr/bin/python
import datetime
import json
ANSIBLE_METADATA = {
'metadata_version': '1.0',
'status': ['preview'],
'supported_by': 'community'
}
DOCUMENTATION = '''
---
module: ceph_volume
short_description: Create ceph OSDs with ceph-volume
description:
- Using the ceph-volume utility available i... |
from marshmallow import (
EXCLUDE,
fields,
Schema,
validate,
validates,
validates_schema,
ValidationError,
)
from marshmallow.schema import SchemaMeta
from geopy.distance import geodesic
from APITaxi_models2 import (
Hail,
Town,
ZUPC,
)
from APITaxi_models2.hail import (
IN... |
import copy
from typing import (
Callable,
Dict,
Generator,
Iterable,
List,
Mapping,
MutableMapping,
MutableSequence,
Optional,
Tuple,
Union,
cast,
)
from ruamel.yaml.comments import CommentedMap
from schema_salad.exceptions import ValidationException
from schema_salad.s... |
from data.logic import _ast_factory, _dimension_factory, _dimension_slice
from spec.mamba import *
with description('_dimension_slice._DimensionSlice'):
with before.each:
self.factory = _dimension_factory._DimensionFactory()
with description('constructor'):
with it('handles simple input'):
expect(ca... |
"""
Module holds selenium stuff
"""
from abc import abstractmethod
import os
import time
import shutil
import sys
import subprocess
import urwid
from bzt.engine import ScenarioExecutor, Scenario
from bzt.utils import RequiredTool, shell_exec, shutdown_process, BetterDict, JavaVM
from bzt.six import string_types, text... |
#!/usr/bin/env python
"""
An unofficial API for pitchfork.com reviews.
author: Michal Czaplinski
email: mmczaplinski@gmail.com
"""
import json
import re
import difflib
import sys
from bs4 import BeautifulSoup
if sys.version_info >= (3, 0):
from urllib.parse import urljoin
from urllib.request import urlopen... |
#!/usr/env/python
"""
flow_accum_bw.py:
Implementation of Braun & Willett (2012) algorithm for calculating drainage
area and (optionally) water discharge. Assumes each node has only one downstream
receiver. If water discharge is calculated, the result assumes steady flow
(that is, hydrologic equilibrium).
The main p... |
from collections import OrderedDict
import ckan.plugins as plugins
import ckan.plugins.toolkit as toolkit
import ckan.lib.helpers as h
from webhelpers.html import literal
from ckan.common import request
import os
import json
from natsort import natsorted
qchoices = {}
with open(os.path.dirname(os.path.realpath(_... |
"""
Perform an NBO analysis through Gaussian on every step of an IRC path.
Takes an IRC computed from Gaussian, extract all intermediate geometries,
then create input files, run them, and analyse the output.
"""
# pylint: disable=invalid-name
import argparse
import os
import sys
import logging
from concurrent.futures... |
# -*- coding: utf-8 -*-
"""
Created on Sat May 30 14:01:10 2015.
@author: gtucker
"""
from __future__ import print_function
from landlab import ModelParameterDictionary, Component, FieldError, \
FIXED_VALUE_BOUNDARY
from landlab.core.model_parameter_dictionary import MissingKeyError
from landlab.c... |
"""
A cmdset holds a set of commands available to the object or to other
objects near it. All the commands a player can give (look, @create etc)
are stored as the default cmdset on the player object and managed using the
CmdHandler object (see cmdhandler.py).
The power of having command sets in CmdSets like this is th... |
# Copyright 2016 Capital One Services, LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... |
#!/bin/env python
import discord
from discord.ext import commands
from utils import aiohttp_wrap as aw
from datetime import datetime
class IPLookup:
def __init__(self, bot):
self.bot = bot
self.aio_session = bot.aio_session
self.api_uri = 'http://ip-api.com/json/{}'
@commands.command(... |
# coding: utf-8
from pupa.scrape import Scraper
from utils import lxmlize, CanadianLegislator as Legislator
import re
from urlparse import urljoin
COUNCIL_PAGE = 'http://www.calgary.ca/General/Pages/Calgary-City-Council.aspx'
MAYOR_PAGE = 'http://calgarymayor.ca/forms_all.php'
class CalgaryPersonScraper(Scraper):
... |
import Tkinter as tk
import ttk
class ToolButton(ttk.Button):
'''A button designed to be placed on a toolbar
This has the behavior of looking flat until you hover over it. It
also supports tooltips.
'''
def __init__(self, parent, imagedata=None, tooltip="the tooltip", text=None,command=None, width... |
#!/user/bin/env/ python
import csv
import os
import sys
import re
import copy
from initial_scan import *
from csv_to_html import *
#### RUN NMAP SCAN ####
filename = sys.argv[1]
networkrange = sys.argv[2]
def run_nmap():
command = 'nmap -O -oA ' + filename + ' ' + networkrange
print command
#coutput = ... |
"""
The MIT License (MIT)
Copyright (c) Serenity Software, LLC
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, m... |
import types
from rx.concurrency import current_thread_scheduler
from rx.disposables import Disposable
from .autodetachobserver import AutoDetachObserver
from .observable import Observable
class AnonymousObservable(Observable):
"""Class to create an Observable instance from a delegate-based
implementation of... |
#!/usr/bin/env python
import random
# Not supposed to be something dynamic, for now.
class Load_Balancer(object):
def __init__(self):
# Edge output ports in order of preference
# It will be calculated in the load_balance method
self.edge_out_ports = {}
def lb_policy(self, edge_core):
... |
# Copyright (C) 2011, 2012 Nippon Telegraph and Telephone Corporation.
# Copyright (C) 2011, 2012 Isaku Yamahata <yamahata at valinux co jp>
#
# 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
#
... |
##
## This file is auto-generated by ../s2client-api-build/buildpylib/update_version_file.py
##
import subprocess
def game_version():
return "5.0.4.82457.0"
def read_command_output(cmd):
lines = []
handle = subprocess.Popen(cmd, stdout=subprocess.PIPE)
while True:
line = handle.stdout.readlin... |
import saga.cpi.base
import saga.cpi.job
######################################################################
#
# adaptor meta data
#
_adaptor_name = 'saga.adaptor.localjob'
_adaptor_registry = [{ 'name' : _adaptor_name,
'type' : 'saga.job.Job',
'class' :... |
from __future__ import unicode_literals
from datetime import date
from decimal import Decimal
from django.conf import settings
from django.db import models
from django.utils.translation import pgettext, pgettext_lazy
from django.utils.encoding import python_2_unicode_compatible, smart_text
from django_countries import... |
# -*- coding: utf-8 -*-
'''
OpenStack Nova Cloud Module
===========================
PLEASE NOTE: This module is currently in early development, and considered to
be experimental and unstable. It is not recommended for production use. Unless
you are actively developing code in this module, you should use the OpenStack
... |
# -*- coding: utf-8 -*-
'''
OpenStack Nova Cloud Module
===========================
PLEASE NOTE: This module is currently in early development, and considered to
be experimental and unstable. It is not recommended for production use. Unless
you are actively developing code in this module, you should use the OpenStack
... |
# -*- coding: utf-8 -*-
# This software released into the public domain. Anyone is free to copy,
# modify, publish, use, compile, sell, or distribute this software,
# either in source code form or as a compiled binary, for any purpose,
# commercial or non-commercial, and by any means.
from __future__ import absolute_i... |
from __future__ import unicode_literals, absolute_import, print_function
import calendar
from decimal import Decimal
import random
import datetime
import uuid
import mock
from django.conf import settings
from django.core.management import call_command
from dimagi.utils.data import generator as data_gen
from corehq.a... |
#
# Copyright 2015 Horde Software Inc.
#
import math
import json
from kraken.ui.Qt import QtWidgets, QtGui, QtCore
from port import InputPort, OutputPort, IOPort
class NodeTitle(QtWidgets.QGraphicsWidget):
__color = QtGui.QColor(25, 25, 25)
__font = QtGui.QFont('Decorative', 14)
__font.setLetterSpacing... |
from django.contrib.humanize.templatetags.humanize import naturaltime
from django.core.urlresolvers import reverse
from django.utils.safestring import mark_safe
from django.utils.translation import ugettext as _, ugettext_lazy, ugettext_noop
from dimagi.utils.decorators.memoized import memoized
from corehq.apps.group... |
## -*- coding: utf-8 -*-
'''
The networking module for Debian based distros
'''
# Import python libs
import logging
import os.path
import os
import re
import StringIO
# Import third party libs
import jinja2
import jinja2.exceptions
# Import salt libs
import salt.utils
import salt.utils.templates
import salt.utils.va... |
"""
@package mi.instrument.teledyne.workhorse.test.test_driver
@file marine-integrations/mi/instrument/teledyne/workhorse/test/test_driver.py
@author Sung Ahn
@brief Test Driver for Workhorse
Release notes:
Generic test Driver for ADCPS-K, ADCPS-I, ADCPT-B and ADCPT-DE
"""
__author__ = 'Sung Ahn'
__license__ = 'Apach... |
import os
import string
import contextlib
from subprocess import Popen, PIPE
check_output = None
def replace_check_output(command_args, **kwargs):
kwargs['stdout'] = PIPE
return Popen(' '.join(command_args), **kwargs).stdout.read()
try:
from subprocess import check_output
except ImportError:
check_out... |
from corehq.apps.reports.commtrack.data_sources import StockStatusDataSource, ReportingStatusDataSource, SimplifiedInventoryDataSource
from corehq.apps.reports.generic import GenericTabularReport
from corehq.apps.reports.datatables import DataTablesHeader, DataTablesColumn
from corehq.apps.commtrack.models import Commt... |
# -*- coding: utf-8 -*-
'''
Management of Docker Containers
.. versionadded:: 2015.8.0
.. versionchanged:: 2017.7.0
This module has replaced the legacy docker execution module.
:depends: docker_ Python module
.. _`create_container()`: http://docker-py.readthedocs.io/en/stable/api.html#docker.api.container.Contai... |
#!/usr/bin/env python3
# vim:fileencoding=utf-8:ts=8:et:sw=4:sts=4:tw=79
"""
command.py
Handle commands received on IRC.
Copyright (c) 2015 Twisted Pear <tp at pump19 dot eu>
See the file LICENSE for copying permission.
"""
import aiohttp
import aiomc
import aiomumble
import asyncio
import bs4
import dbutils
import... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from distutils.version import LooseVersion
import math
import numpy as np
import os
import six
import tensorflow as tf
import tensorflow.contrib.slim as slim
from tensorf... |
# A test run filter allows a user to produce an ordered list of results of
# interest.
# The data that makes up a filter are:
#
# * A non-empty set of bundle streams
# * A possibly empty set of (attribute-name, attribute-value) pairs
# * A possibly empty list of tests, each of which has a possibly empty list of
# t... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.