code stringlengths 1 199k |
|---|
"""AWS Adapter osid manager implementations."""
from ...abstract_osid.osid import managers as abc_osid_managers
from ..osid import markers as osid_markers
from ..primitives import Id
from ..osid.osid_errors import NullArgument, IllegalState, NotFound
class OsidProfile(abc_osid_managers.OsidProfile, osid_markers.Sourcea... |
from setuptools import setup
setup(
name="scotch",
version="1.0",
description="Simulating continuous-time Markov chains in Python.",
url="http://github.com/qcaudron/scotch2",
author="Quentin CAUDRON",
author_email="quentincaudron@gmail.com",
license="MIT",
packages=["scotch"],
zip_sa... |
VERSION = "0.1.1" |
"""
vix-term-structure.utils
Some helper functions for evaluating the data.
:copyright: (c) 2017 Thomas Leyh
"""
import datetime
import os
from collections import namedtuple
import pandas as pd
import numpy as np
ModelParameters = namedtuple("ModelParameters", ("datetime", "hostname", "depth", "width", "days",
... |
import copy
import typing
import logging
import os.path as path
from itertools import chain
from typing import Iterable, Optional
from .abstract_model import AbstractModel
from ..utils import load_config
from ..cli.common import create_model
from ..datasets import AbstractDataset, StreamWrapper
from ..types import Batc... |
"""
build_component.py --- build a component of the Seattle Testbed.
NOTE: This script is not meant to be called individually, but through
a wrapper script, build.py. See the Seattle build instructions wiki
for details: https://seattle.poly.edu/wiki/BuildInstructions
This script first erases all the files in a targ... |
from django.shortcuts import get_object_or_404
from rest_framework.decorators import api_view
from rest_framework.response import Response
from rest_framework.exceptions import APIException, NotFound
from common.utils import nhs_titlecase, parse_date
from frontend.models import Practice, PCT, STP, RegionalTeam, PCN, NC... |
import asyncio
import time
from unittest.mock import Mock
from azure_devtools.perfstress_tests import PerfStressTest
from azure.core.credentials import AccessToken
from azure.core.pipeline import AsyncPipeline, Pipeline
from azure.core.pipeline.policies import AsyncBearerTokenCredentialPolicy, BearerTokenCredentialPoli... |
import functools
from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union
import warnings
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.core.paging import ItemPaged
from azure.core.pipeline impo... |
import json
from time import sleep
import pytest
from datetime import datetime, timedelta
from math import ceil
from azure.storage.blob.changefeed import (
ChangeFeedClient,
)
from devtools_testutils.storage import StorageTestCase
from settings.testcase import ChangeFeedPreparer
@pytest.mark.playback_test_only
clas... |
import json
import time
import requests
from logger import other
class YDMHttp:
apiurl = 'http://api.yundama.com/api.php'
username = ''
password = ''
appid = ''
appkey = ''
def __init__(self, name, passwd, app_id, app_key):
self.username = name
self.password = passwd
self... |
from setuptools import setup
setup(
name='mite',
version='0.1.0',
author='Samuel "mansam" Lucidi',
author_email="mansam@csh.rit.edu",
packages=['mite'],
url='http://pypi.python.org/pypi/validator.py/',
license='LICENSE',
install_requires=['webob'],
tests_require=['pytest', 'validator... |
from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar
import warnings
from azure.core.async_paging import AsyncItemPaged, AsyncList
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.core.pipeline i... |
__author__ = 'rhtang'
import unittest
import dictdiff
import benchmark
class FlattenTest(unittest.TestCase):
# @unittest.skip("")
def test_flatten_1(self):
obj = {'a': 1}
fobj = dictdiff.flatten(obj)
self.assertEqual(len(fobj), 1)
self.assertEqual(fobj['a'], 1)
# @unittest.sk... |
from itertools import izip
def pairwise(iterable):
"s -> (s0,s1), (s2,s3), (s4, s5), ..."
a = iter(iterable)
return izip(a, a) |
from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class Title(_BaseTraceHierarchyType):
# class properties
# --------------------
_parent_path_str = "scattergeo.marker.colorbar"
_path_str = "scattergeo.marker.colorbar.title"
_valid_props = {"font... |
import csv
from datetime import datetime
from django.contrib.auth.decorators import login_required
from django.views.decorators.cache import never_cache
from django.contrib.auth import login as auth_login, authenticate
from django.contrib.auth.views import login
from django.core.urlresolvers import reverse
from django.... |
from puq import *
import numpy as np
def run():
# Create a host
host = InteractiveHost()
# either should work
#valarray = [[-1,0,1],[-1,0,1]]
#v1 = DParameter('x', 'x description')
#v2 = DParameter('y', 'y description')
#uq = SimpleSweep([v1,v2], valarray)
#
v1 = DParameter('x', 'x d... |
from django.db import migrations, models
import karspexet.ticket.models
class Migration(migrations.Migration):
dependencies = [
('ticket', '0013_discount'),
]
operations = [
migrations.RenameField(
model_name='voucher',
old_name='rebate_amount',
new_name='... |
'''
This program reads the text in "demlibsin.txt" file and replaces
the ADJECTIVE, NOUN, ADVERB, or VERB words literally with the words
specified by the user. It prints out the new sentence to the screen
and to the "demlibs.out" file.
'''
'''
Create a Mad Libs program that reads in text files and lets the user
add the... |
'''
Networks for audio classification
As a goal, we want to train a network to classify sections from
particular songs.
Procedure:
1. Grab three songs; isolate 30 seconds; convert to WAV.
2. Arbitrarily select 5 seconds from each song to be out-of-sample data.
3. Select a network from one of the below designs.
4. Train... |
from selenium import webdriver
import pymysql
import unittest,time
print("test07")
wf = webdriver.Firefox()
ps=pymysql
bp=ps.connect(host='192.168.17.66',port=3306,user='root',passwd='123456',db='lexian',charset='utf8')
res=bp.cursor()
n=0
mark_01=0
mark_02=0
try:
res.execute("UPDATE manager SET password = '456456'... |
from sys import exit
def gold_room():
print "This room is full of gold. How much do you take?"
next = raw_input("> ")
if "0" in next or "1" in next:
how_much = int(next)
else:
dead("Man, learn to type a number.")
if how_much < 50:
print "Nice, you're not greedy, you win!"
exit(0)
else:
dead("You greedy ... |
"""
A peak element is an element that is greater than its neighbors.
Given an input array where num[i] != num[i+1], find a peak element and return
its index.
The array may contain multiple peaks, in that case return the index to any one
of the peaks is fine.
You may imagine that num[-1] = num[n] = infinity small
For ex... |
import random
import urllib
class Checker:
"""Gets your public-facing IP from a website."""
def __init__(self, list_location):
self.list_location = list_location
self.list = []
self.init_list()
def init_list(self):
# Adds each line in the file to a list with
# whitespace removed
temp_list = open(self.lis... |
from makefile import Makefile
from makefilecc import MakefileCC
def get_gcc_profile(cfg):
make = Makefile(cfg)
return make
def get_gpp_profile(cfg):
make = MakefileCC(cfg)
return make
table = {
"gcc": get_gcc_profile,
"g++": get_gpp_profile
} |
__all__ = ["TileSpecs", "Mojo", "HDF5", "Datasource", "ImageStack"]
from .TileSpecs import TileSpecs
from .Mojo import Mojo
from .HDF5 import HDF5
from .Datasource import Datasource
from .ImageStack import ImageStack |
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('browser', '0007_auto_20150320_0719'),
]
operations = [
migrations.AlterModelOptions(
name='sbehaviour',
options={'verbose_name': ... |
from numpy import array, mat, shape, transpose
from scipy import cov, linalg
from pylab import load, arange
data2 = mat(array(load('raw3.dat', delimiter='\t',usecols=arange(0,13,1), unpack=True)))
time_series = mat(cov(data2, rowvar=1))
print 'covariance matrix : ', shape(time_series)
eval, evec = linalg.eig(mat(time_s... |
'''
modules for audio searching that directly record from the microphone.
Requires PyAudio and portaudio to be installed (http://www.portaudio.com/download.html)
To download pyaudio for windows 64-bit go to http://www.lfd.uci.edu/~gohlke/pythonlibs/
users of 64-bit windows but 32-bit python should download the win32 po... |
from django.shortcuts import render,render_to_response
from django.shortcuts import render, get_object_or_404, redirect
from django.http import Http404, HttpResponse
from .models import Log
from .models import Peer
import functools
import warnings
from django.contrib.auth.decorators import login_required
from program_... |
"""Custom structures for Grow."""
from bisect import bisect_left
from bisect import bisect_right
class AttributeDict(dict):
"""Allows using a dictionary to reference keys as attributes."""
def __getattr__(self, attr):
try:
return self.__getitem__(attr)
except KeyError:
ra... |
import os
import numpy as np
import nibabel as nib
from nilabels.tools.detections.check_imperfections import check_missing_labels
from nilabels.tools.aux_methods.label_descriptor_manager import LabelsDescriptorManager
from tests.tools.decorators_tools import pfo_tmp_test, \
write_and_erase_temporary_folder_with_dum... |
import os
import sys
import requests
from time import sleep
import json
import Adafruit_CharLCD as LCD
import Adafruit_GPIO.MCP230xx as MCP
import RPi.GPIO as IO # For standard GPIO methods.
DEBUG = True
PRESS_ID = '136' # This does not change!
api_url = 'http://10.130.0.42' # Web API URL
rst_btn = 18 # INPUT - Man... |
import _plotly_utils.basevalidators
class TsrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(self, plotly_name="tsrc", parent_name="scatter", **kwargs):
super(TsrcValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
edit_type=kw... |
from include.controller import WFController
if __name__ == "__main__":
controller = WFController()
controller.run() |
import os
import sys
import time
root = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
sys.path.append(root + '/python')
import ccxt # noqa: E402
def style(s, style):
return style + s + '\033[0m'
def green(s):
return style(s, '\033[92m')
def blue(s):
return style(s, '\033[94m'... |
'''
Created by auto_sdk on 2015.09.11
'''
from top.api.base import RestApi
class MtopUploadTokenGetRequest(RestApi):
def __init__(self,domain='gw.api.taobao.com',port=80):
RestApi.__init__(self,domain, port)
self.param_upload_token_request = None
def getapiname(self):
return 'taobao.mtop.upload.token.get' |
from django.http import HttpResponse, Http404, HttpResponseRedirect
from django.shortcuts import get_object_or_404, render
from django.core.urlresolvers import reverse
from django.views import generic
from braces.views import LoginRequiredMixin
from .models import Question, Choice
class IndexView(LoginRequiredMixin, ge... |
"""
Analysis module for the email analysis project
"""
from copy import deepcopy
from mailstat.metric import *
from mailstat.reader import *
from mailstat.exceptions import *
METRICS = [DomainDistribution,]
class Analysis(object):
"""
The analysis and data processing harness
"""
def __init__(self, csvfi... |
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('faculty', '0001_initial'),
('bookings', '0001_initial'),
]
operations = [
migrations.AddField... |
PLAINTEXT = "01010101010101010101010101010101";
KEY = "0000010000100010100011100000000010000110000011001001111000010001"
ROUNDS = 528
ptextl = list(PLAINTEXT);
keyl = list(KEY);
ciphertext = list();
ctext1="";
ptext1="";
def core(a,b,c,d,e):
return (d+e+a*c+a*e+b*c+b*e+c*d+d*e+a*d*e+a*c*e+a*b*d+a*b*c) % 2;
def shiftp... |
import question_template
game_type = 'bullseye'
source_language = 'C'
parameter_list = [
['$t0','target'],['$x1','int'],
]
tuple_list = [
['list_lib_find_two_',
[True,None],
]
]
global_code_template = '''\
d #include <stdlib.h>
x #include <stdlib.h>
d #include <stdio.h>
x #include <stdio.h>
dx
dx #define LL_... |
from django.conf.urls import patterns, url
from pizza import views
from pyalp.utils import redirect
urlpatterns = patterns(
'',
url(r'^$', views.pizza, name='pizza-index')
)
legacy_patterns = patterns(
'',
# these are here to rewrite urls from the original mod_pizza
url(r'^admin_news\.php$', redirec... |
import time
def convert(path):
content = ""
with open(path, 'rb') as f:
content = f.read()
content = content.decode("gbk")
with open(path + "_" + str(time.time()), 'w') as f:
f.write(content)
if __name__ == "__main__":
convert("myself.html") |
from . import ROS_ENABLED
if ROS_ENABLED:
import rospy
import baxter_artist.msg
QUEUE_SIZE = 100
BPM = 45
DURKS_PER_SECOND = 8.0 * float(BPM) / 60.0
SECONDS_PER_DURK = 1.0 / float(DURKS_PER_SECOND)
class NotePublisher(object):
"""
Publish notes to the baxter_artist_notes rostopic
"""
def __init_... |
import math
from datetime import datetime
from scipy.integrate import ode
from igrf12py import igrf12syn as igrf12
from ..gpstk import PyPosition
def differential(t, s):
r_km, theta, phi = s
Bt, Bp, Br, B = igrf12(0,
date_dt.year,
2, # geocentric
... |
"""Command-line tools for authenticating via OAuth 2.0
Do the OAuth 2.0 Web Server dance for a command line application. Stores the
generated credentials in a common file that is used by other example apps in
the same directory.
"""
__author__ = 'jcgregorio@google.com (Joe Gregorio)'
__all__ = ['argparser', 'run_flow',... |
from django.core.management.base import BaseCommand, CommandError
from portal.models import Location
from geopy import geocoders
import geopy.geocoders.google
from django.contrib.gis.geos import GEOSGeometry
from optparse import make_option
import time, random
class Command(BaseCommand):
"""
Geocode a set of mo... |
"""
name = "Lorenz"
variables = "x y z"
parameters = "r b tau"
inputs = "I1"
eq = "dx = (11.0*(y - x)+I1)/tau;dy = (x*(r - z) - y)/tau;dz = (x*y - b*z)/tau;"
"""
try:
import pyext
except:
print "ERROR: This script must be loaded by the PD/Max pyext external"
import pypdod... |
Test.assert_equals(my_automaton.read_commands(['1']), True)
Test.assert_equals(my_automaton.read_commands(['1', '0', '0', '1']), True) |
from firebase_admin import messaging
from firebase_admin.exceptions import FirebaseError, InvalidArgumentError, InternalError, UnavailableError
from firebase_admin.messaging import QuotaExceededError, SenderIdMismatchError, ThirdPartyAuthError, UnregisteredError
from mock import patch, Mock, ANY
import unittest2
from g... |
'''
总的来说就是通过搜狗搜索中的微信搜索入口来爬取
2017-04-12 by Jimy_fengqi
'''
import sys
reload(sys)
sys.setdefaultencoding('utf-8')
from urllib import quote
from pyquery import PyQuery as pq
from selenium import webdriver
class weixin_spider:
def __init__(self, keywords):
' 构造函数 '
self.keywords = keywords
# 搜狐微信搜索链接入口
#self.sogo... |
from django.core.exceptions import ImproperlyConfigured
from django.shortcuts import render
from sitesngine.elfinder.conf import settings
def tinymce_filebrowser_script_view(request):
"""
View for rendering JS with TnyMCE file browser callback function.
"""
return render(request, "elfinder_tinymce_fileb... |
import zmq
from cereal import car
from selfdrive.config import Conversions as CV
from selfdrive.services import service_list
from selfdrive.swaglog import cloudlog
import selfdrive.messaging as messaging
TS = 0.01 # 100Hz
YAW_FR = 0.2 # ~0.8s time constant on yaw rate filter
LPG = 2 * 3.1415 * YAW_FR * TS / (1 + 2 * 3... |
from django.conf.urls.defaults import patterns, url
from verbs import views
urlpatterns = patterns("",
url(regex=r'^(?P<slug>[-\w]+)/$',
view=views.VerbDetailView.as_view(),
name='verb_detail'),
url(regex=r'^$',
view=views.VerbListView.as_view(),
name='verb_list'),
) |
import logging
import datetime
from assigner.config import requires_config
from assigner.backends.gitlab import GitlabRepo
help = "Interactively initialize a new configuration"
logger = logging.getLogger(__name__)
def prompt(explanation, default=None):
prompt_string = ''
if default is not None:
prompt_s... |
import re
try:
# Block it from trying to import something which should not be on the python sys.path
# https://github.com/hktonylee/SublimeNumberKing/issues/4
import expand_region_handler
import utils
except:
from . import utils
def expand_to_symbols(string, selection_start, selection_end):
opening_symbols ... |
from Target import Target
import ConfigParser
importSuccessful = True
try:
import twitter
except ImportError:
print("TwitterTarget: twitter module missing, check out:")
print("TwitterTarget: https://pypi.python.org/pypi/twitter/1.10.0")
importSuccessful = False
class TwitterTarget(Target):
plugi... |
"""
Copyright (c) 2014-2022 Maltrail developers (https://github.com/stamparm/maltrail/)
See the file 'LICENSE' for copying permission
"""
import re
from core.common import retrieve_content
__url__ = "https://malc0de.com/bl/ZONES"
__check__ = "malc0de"
__info__ = "malware distribution"
__reference__ = "malc0de.com"
def ... |
import unittest
import numpy as np
import simpy
class MyTestCase(unittest.TestCase):
def test_something(self):
n_epoch = 10
n_batch = 100
ra = simpy.ResultAppender(['d', 'l'], {'d': simpy.data_concat, 'l': simpy.data_concat}, {'d': simpy.data_single, 'l': simpy.data_mean})
for _ in r... |
__author__ = 'rcj1492'
__created__ = '2016.01'
__license__ = 'MIT' |
from xdist.scheduler.each import EachScheduling # noqa
from xdist.scheduler.load import LoadScheduling # noqa
from xdist.scheduler.loadfile import LoadFileScheduling # noqa
from xdist.scheduler.loadscope import LoadScopeScheduling # noqa
from xdist.scheduler.loadgroup import LoadGroupScheduling # noqa |
def helper():
pass
def helper(): # TS9520 duplicate func
pass |
from runner.koan import *
class AboutAsserts(Koan):
def test_assert_truth(self):
"""
We shall contemplate truth by testing reality, via asserts.
"""
# Confused? This video should help:
#
# http://bit.ly/about_asserts
<<<<<<< HEAD
self.assertTrue(True) # Thi... |
def largest(lastnumber):
number = raw_input("Next number: ")
if number == "":
return lastnumber
elif lastnumber < float(number):
lastnumber = float(number)
return largest(lastnumber)
else:
return largest(lastnumber)
def main():
out = largest(-float('Inf'))
print "... |
from django.conf.urls import url
from users.views import (
UserProfileView, UserLoginView, UserLogoutView, UserRegisterView
)
urlpatterns = [
url(
r'^login/$',
UserLoginView.as_view(),
name='login'
),
url(
r'^logout/$',
UserLogoutView.as_view(),
name='logo... |
import click
from regparser.builder import tree_and_builder
from regparser.notice.changes import node_to_dict, pretty_change
from regparser.tree.struct import find
@click.command()
@click.argument('node_label')
@click.argument('filename',
type=click.Path(exists=True, dir_okay=False, readable=True))
@cli... |
OUTPUT_DIR = ''
API_BASE = ''
META = {}
CFR_TITLES = [
None,
"General Provisions",
"Grants and Agreements",
"The President",
"Accounts",
"Administrative Personnel",
"Domestic Security",
"Agriculture",
"Aliens and Nationality",
"Animals and Animal Products",
"Energy",
"Fed... |
import sys
import os
import re
import argparse
import mmap
def search_files(log_files, arguments):
parser = return_parser()
parsed_arguments = parser.parse_args(arguments)
files = []
for log_file in log_files:
try:
with open(log_file, 'r') as f:
with mmap.mmap(f.filen... |
import sys
def makeJson(name, value):
return '"' + name + '":"' + value.rstrip() + '"'
if len(sys.argv) >= 2:
f = open(sys.argv[1])
else:
f = sys.stdin
f.readline()
for line in f:
# line = line.rstrip()
uid, query, time, rank, url = line.split('\t')
print '{' + ','.join(map(lambda x: makeJson(x[0], x[1]), [('uid'... |
from django.db import models
from common.utils import activation
from tasks.models import TaskModel
from practice.models import StudentModel
from datetime import datetime
class FlowRating(object):
UNKNOWN = 0
VERY_DIFFICULT = 1
DIFFICULT = 2
RIGHT = 3
EASY = 4
@classmethod
def from_key(cls, ... |
import gettext
from Tools.Directories import SCOPE_LANGUAGE, resolveFilename
import language_cache
class Language:
def __init__(self):
gettext.install('enigma2', resolveFilename(SCOPE_LANGUAGE, ""), unicode=0, codeset="utf-8")
self.activeLanguage = 0
self.lang = {}
self.langlist = []
# FIXME make list dynami... |
"""Tools for creating and manipulating SON, the Serialized Ocument Notation.
Regular dictionaries can be used instead of SON objects, but not when the order
of keys is important. A SON object can be used just like a normal Python
dictionary."""
import copy
import re
RE_TYPE = type(re.compile(""))
class SON(dict):
"... |
from django.shortcuts import render_to_response
def index(request):
return render_to_response('opendata.html',{
"user":request.user if request.user.is_authenticated() else None
}) |
'''
Tree structured Operator classes.
Operator -> Base class for operators.
* Bilinear -> Elemental(leaf) Operator in the form of { factor * c^\dag c }.
* BBilinear -> Bilinear defined on the bond.
* Qlinear -> Elemental(leaf) Operator in the form of { factor * c^\dag c^\dag c c }.
* Operator_C -> E... |
'''
Given an array of integers, find two numbers such that they add up to
a specific target number.
The function twoSum should return indices of the two numbers such that
they add up to the target, where index1 must be less than
index2. Please note that your returned answers (both index1 and
index2) are not zero-based.... |
"""
Created on Tue Jan 06 12:27:02 2015
@author: Acer
"""
from Global_meaning_list import Global_meaning_list
def Purpose_Finder_Collectors(word):
for i in range(len(Global_meaning_list.collectors)):
if word in Global_meaning_list.collectors[i]:
print Global_meaning_list.collectors[i][1]
... |
"""
Copyright 2016, 2017 UFPE - Universidade Federal de Pernambuco
Este arquivo é parte do programa Amadeus Sistema de Gestão de Aprendizagem, ou simplesmente Amadeus LMS
O Amadeus LMS é um software livre; você pode redistribui-lo e/ou modifica-lo dentro dos termos da Licença Pública Geral GNU como publicada pela Funda... |
import sqlite3
import pprint
from time import time
BackendType = "sqlite"
pp = pprint.PrettyPrinter(indent=4)
class Stats:
def __init__(self, Config):
self._config = Config
self._db = sqlite3.connect('/var/tmp/ogslb-stats.db')
try:
self._setupDB()
except:
""" """
def _set... |
"""Script used to generate the extensions file before building the actual documentation."""
import os
import re
import sys
import sphinx
from pylint.constants import MAIN_CHECKER_NAME
from pylint.lint import PyLinter
from pylint.utils import get_rst_title
def builder_inited(app):
"""Output full documentation in ReS... |
"""A class to process BUFR messages."""
import array, time
import string, traceback, sys
__version__ = '1.0'
class Bufr:
"""This class is a very basic BUFR processing.
end() returns where the BUFR message ends
start() returns where the BUFR message starts
length() the length according to the bufr's ... |
import os,MySQLdb,time
t= time.time()
dateNow = time.strftime('%Y-%m-%d',time.localtime(time.time()))
data = open('C:\\Users\\suchao\\Desktop\\phone_20121108\\fufei_zhongjie_short_20121108.log').readlines()
data2 = open('C:\\Users\\suchao\\Desktop\\phone_20121108\\mianfei_geren_short_20121108.log').readlines()
data3 = ... |
import os
import libcalamares
from libcalamares.utils import check_chroot_call
CONF_DIR = "/boot/extlinux"
def retrieve_kernels(root_mount_point):
boot_dir = os.path.join(root_mount_point, "boot")
kernels = []
for filename in os.listdir(boot_dir):
if filename[:8] in ("vmlinuz-", "bzImage-"):
... |
import urlparse,re
import urllib
import datetime
import time
from core import api
from core import logger
from core import config
from core import scrapertools
from core.item import Item
from core import suscription
DEBUG = config.get_setting("debug")
CHANNELNAME = "api_programas"
def mainlist(item):
logger.info("t... |
import cmd2
from pprint import pformat
from ext.tabulate import tabulate
import conf_parser
class ConfCli(cmd2.Cmd):
'''kkross interactive command line interface for exploit/template/payload configuration'''
def generate_options(self):
'''Generate a nice summary table of module options'''
option... |
"""Change the title of records whose author is too young."""
from datetime import datetime
argument_schema = {
'new_title': {'type': 'string', 'label': 'New Record Title'},
# 'anumber': {'type': 'float'},
# 'adt': {'type': 'datetime'},
# 'atext': {'type': 'text'},
'minimum_birthdate': {'type': 'date... |
import unittest2
from unittest.mock import Mock
from tuned.exports.controller import ExportsController
import tuned.exports as exports
class ControllerTestCase(unittest2.TestCase):
@classmethod
def setUpClass(cls):
cls._controller = ExportsController()
def test_is_exportable_method(self):
self.assertFalse(self._... |
class MergePane(edlib.Pane):
def __init__(self, focus):
edlib.Pane.__init__(self, focus)
self.marks = None
self.conflicts = 0
self.call("doc:request:doc:replaced")
def fore(self, m, end, ptn):
if not m:
return None
m = m.dup()
try:
... |
import unittest
from ns.core import Simulator, Seconds, Config, int64x64_t
import ns.core
import ns.network
import ns.internet
import ns.mobility
import ns.csma
import ns.applications
UINT32_MAX = 0xFFFFFFFF
class TestSimulator(unittest.TestCase):
## @var _received_packet
# received packet
## @var _args_re... |
import json
import threading
from config import config
from mastermind_core import helpers
class CachedResponse(object):
"""Mastermind cached response
Use CachedResponse to store mastermind handle's response data that requires
significant calculation.
Instance's reentrant ``lock`` object is designed to ... |
from . import base
from .. import stats
from .. import items
from .. import dialogue
from .. import context
from .. import aibrain
from .. import effects
from .. import animobs
from .. import targetarea
from .. import invocations
from . import animals
from .. import spells
import random
from .. import enchantments
from... |
import os, sys
import gc
import vtktools
import numpy as np
import matplotlib as mpl
mpl.use('pdf')
import matplotlib.pyplot as plt
import myfun
from scipy import interpolate
gc.enable()
label = 'm_50_6b_3D_particles'
basename = 'mli_checkpoint'
dayi = 0
dayf = 1
days = 1
path = '/tamay2/mensa/fluidity/'+label+'/'
try... |
import array
from gamera.plugin import PluginFunction, PluginModule
from gamera.args import ImageType, Args, Check, FloatVector, Class
from gamera.enums import ONEBIT
class Feature(PluginFunction):
self_type = ImageType([ONEBIT])
return_type = FloatVector(length=1)
feature_function = True
doc_examples =... |
from south.utils import datetime_utils as 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 'EmailScheduler.sched_time'
db.alter_column(u'crma_emailscheduler', 'sched_time', s... |
from PySide import QtCore, QtGui
from pydaruma.pydaruma import tEnviarSms_MODEM_DarumaFramework
from scripts.modem.retornomodem import tratarRetornoModem
class Ui_ui_modem_tenviarsms(QtGui.QWidget):
def __init__(self):
super(Ui_ui_modem_tenviarsms, self).__init__()
self.setupUi(self)
self.pu... |
"""
This file contains the .frm file utility for reading .frm files to construct
CREATE TABLE commands and display diagnostic information.
"""
import os
import sys
from mysql.utilities.common.tools import (check_python_version,
check_connector_python)
from mysql.utilities impor... |
from dictlib.exceptions import ValidationError, SchemaFieldNotFound
from dictlib.utils import update_recursive
import collections
import datetime
import re
import time
import types
import uuid
class SchemaDefinitionError(Exception):
pass
class Field(object):
""" The base class for schema fields. Do not use this... |
import sys
import time
sys.path.append('../framework')
import pclases, sqlobject, time
def id_propia_empresa_proveedor():
"""
Devuelve el id de la propia empresa en la tabla proveedores.
"""
try:
empresa = pclases.DatosDeLaEmpresa.select()[0]
except IndexError:
print "ERROR: No hay d... |
'''
Created on 3 Oct 2014
@author: dpetkovic
'''
import xmlrpc.client
import http.client
import ssl
from _ssl import CERT_NONE
class ClientHttpsTransport(xmlrpc.client.SafeTransport):
def __init__(self, privkey, pubkey, use_datetime=0 ):
xmlrpc.client.SafeTransport.__init__(self, use_datetime=use_datetime)
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.