code stringlengths 1 199k |
|---|
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
import json
import sys
from nose.plugins.skip import SkipTest
if sys.version_info < (2, 7):
raise SkipTest("F5 Ansible modules require Python >= 2.7")
from ansible.module_utils.basic import AnsibleModule
try:
from ... |
from test.common_helper import TEST_FW, TEST_TEXT_FILE
from .conftest import decode_response
UID_1 = 'deadbeef' * 8 + '_1'
UID_2 = 'decafbad' * 8 + '_2'
def test_bad_request(test_app):
result = decode_response(test_app.put('/rest/compare'))
assert 'Input payload validation failed' in result['message']
resul... |
import socket
import time
from classes.EASecure import EASecure
EASecure = EASecure()
testKey = '29dQrqxAJOgHA3IC5kXYNscvfjAOEB7u'
testData = b'\x02\x00\x00\x00\x07\x010\xe7\x03\x00\x00\x03|d14c4814e3834bc508ba8be48b1ea99a|999201705265.13:54:24.98541'
for i in range(0, 200):
sk = socket.socket()
sk.connect(("12... |
from __future__ import unicode_literals
from django.db import models
class ServerFunCateg(models.Model):
id = models.IntegerField(verbose_name="服务功能分类ID", primary_key=True, db_column='ID')
server_categ_name = models.CharField(verbose_name=u'服务功能分类名称', max_length=90)
def __unicode__(self):
return sel... |
theBoard = {'top-L': ' ', 'top-M': ' ', 'top-R': ' ',
'mid-L': ' ', 'mid-M': ' ', 'mid-R': ' ',
'low-L': ' ', 'low-M': ' ', 'low-R': ' '}
def printBoard(board):
print(board['top-L'] + '|' + board['top-M'] + '|' + board['top-R'])
print('-+-+-')
print(board['mid-L'] + '|' + board['mid-... |
import numpy as np
from datetime import datetime
import pickle
word_vecs = {}
csv_header = "word"
for x in range(1, 201):
csv_header = csv_header + " V" + str(x)
csv_header = csv_header + "\n"
output_vocab_size=0
in_1 = 'data/wikipedia-pubmed-and-PMC-w2v.bin'
out_1 = 'data/w2v_2.csv'
vocab_pkl = 'data/vocab.pkl'
wi... |
"""
Dummy preposttask
Qudi is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Qudi is distributed in the hope that it will be useful,
but WITHOU... |
from __future__ import print_function
import optparse
import sys
sys.path.insert(0, 'bin/python')
import os
import samba
import samba.getopt as options
import random
import tempfile
import shutil
import time
import itertools
from samba.netcmd.main import cmd_sambatool
try:
from samba.tests.subunitrun import Subunit... |
"""
WSGI config for words 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.8/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTINGS_MOD... |
import firebase_admin
from firebase_admin import credentials
cred = credentials.Certificate('res/serviceAccountKey.json')
default_app = firebase_admin.initialize_app(cred) |
"""
The Macro-Etymological Analyzer.
Author: Jonathan Reeve, jonathan@jonreeve.com
License: GPLv3
This program looks up all the words in your text, using the Etymological
Wordnet.
I made the file included here, etymwn-smaller.tsv, by running these unix
commands on the Etymological Wordnet:
First, get only those entries... |
from pyclt.interface.interface import Interface
class CmdProgram(Interface):
def __init__(self,word,__type):
'''进行继承'''
super().__init__(__type)
self.word = word
self.__type__ = 'gui'
def run(self):
'''进行翻译'''
result = self.api.getCmdResult(self.word)
prin... |
import threading, copy
import task
class MainData:
start_acct_list = []
end_acct_list = []
now_acct_list = []
start_pwd_list = []
end_pwd_list = []
now_pwd_list = []
main_data_mutex = threading.Lock()
def init(this, start_acct_str, start_pwd_str, end_acct_str, end_pwd_str):
"""
... |
"""Constants in the math module.
"""
import math
print 'π: %.30f' % math.pi
print 'e: %.30f' % math.e |
import re
import os
import base64
__all__ = ["read_newick", "write_newick", "print_supported_formats"]
_ILEGAL_NEWICK_CHARS = ":;(),\[\]\t\n\r="
_NON_PRINTABLE_CHARS_RE = "[\x00-\x1f]+"
_NHX_RE = "\[&&NHX:[^\]]*\]"
_FLOAT_RE = "[+-]?\d+\.?\d*(?:[eE][-+]\d+)?"
_NAME_RE = "[^():,;\[\]]+"
DEFAULT_DIST = 1.0
DEFAULT_NAME =... |
from __future__ import with_statement
import datetime
import threading
import sickbeard
from sickbeard import db, scheduler, helpers
from sickbeard import search_queue
from sickbeard import logger
from sickbeard import ui
from sickbeard import common
from sickbeard.search import wantedEpisodes
NORMAL_BACKLOG = 0
LIMITE... |
"""
Utilities for loading spaCy models.
NOTE: imports spaCy, so *only* import this from module execute.py files.
"""
import spacy
from spacy.cli.download import get_json, get_compatibility, get_version, download_model
from spacy import about
from importlib import reload
import pkg_resources
def load_spacy_model(model_n... |
from __future__ import absolute_import
import os, sys, random, string, traceback, json, datetime, re
from django.contrib.auth.models import User
from django.db.models import Q
from karaage.people.models import Person
from karaage.people.forms import AddPersonForm, AdminPersonForm, PersonForm
from karaage.projects.model... |
from ...exports import hook
from .helpers import close_databases
@hook('shutdown')
def shutdown(supervisor):
close_databases()
@hook('immediate_shutdown')
def immediate_shutdown(supervisor):
close_databases() |
import xml.etree.ElementTree as ET
import rospy
import rospkg
_xml_path = rospkg.RosPack().get_path("recognition_enemy_tracker") + '/def/enemy_tracker_properties.xml'
class EnemyTrackerProperties():
"""Properties of enemy_tracker_node"""
def __init__(self, xml=_xml_path):
xml_root = ET.parse(xml).getroo... |
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from ansible import constants as C
from ansible import context
from ansible.cli import CLI
from ansible.cli.arguments import option_helpers as opt_help
from ansible.errors import AnsibleError, AnsibleOptionsError
from ansible.execut... |
from xlrd import open_workbook
from django.contrib import admin
from django.conf.urls import url
from django.shortcuts import HttpResponse, redirect, render
from django.core.urlresolvers import reverse
from django.contrib import messages
from .models import Page
from .forms import ImportAndGenerateStaticPage
@admin.reg... |
from distutils.core import setup
setup(
name='ApertiumPluginUtils',
version='0.1.0',
author='Sergio Balbuena',
author_email='sbalbp@gmail.com',
packages=['apertiumpluginutils'],
license='GPLv3',
description='Utils used with apetiuma-apy.',
) |
"""
util.py - utility functions for the SKIMMR modules, namely the following
(including implementation of the minimalistic tensor and fuzzy set data
structures, and wrapper for parallel computations)
Copyright (C) 2012 Vit Novacek (vit.novacek@deri.org), Digital Enterprise
Research Institute (DERI), National University... |
import json
import datetime, time
from datetime import timedelta
import urllib,urllib2
import xbmc,xbmcplugin,xbmcgui,xbmcaddon
from xml.dom.minidom import parseString
import re
from utils import *
from common import *
import vars
def videoDateMenu():
video_tag = vars.params.get("video_tag")
dates = []
curr... |
from __future__ import absolute_import, division, print_function
import os
import pkg_resources
import pytest
from mock import patch
from six import binary_type
from inspirehep.modules.workflows.tasks.classifier import classify_paper
from mocks import MockEng, MockObj
HIGGS_ONTOLOGY = '''<?xml version="1.0" encoding="U... |
import RPi.GPIO as GPIO
import time
GPIO.setmode(GPIO.BCM)
pinList = [17]
for i in pinList:
GPIO.setwarnings(False)
GPIO.setup(i, GPIO.OUT)
GPIO.output(i, GPIO.HIGH)
def trigger() :
for i in pinList:
GPIO.output(i, GPIO.LOW)
break
try:
trigger()
except KeyboardInterrupt:
pr... |
def count_substring(string, sub_string):
count = 0
i = 0
while i < len(string):
a = string.find(sub_string,i,len(string))
if a == -1:
a = 0
else:
count += 1
i += a + 1
return count
if __name__ == '__main__':
string = raw_input().strip()
sub... |
import os
import site
site.addsitedir(os.path.dirname(__file__),'packages')
from flask import Flask
app = Flask(__name__)
app.DEBUG=True
@app.route("/")
def hello():
return "Hello yuc!"
if __name__ == "__main__":
app.run() |
from django.conf.urls import patterns, url
urlpatterns = patterns('training.views',
url(r'^submit', 'submitandregister', name="submit"),
url(r'^controlpanel/(?P<courseid>[0-9]+)/$', 'control_panel', name="controlpanel"),
url(r'^selectcourse/', 'select... |
import urllib2,cookielib
import requests,json,time
global idtext
idtext=[]
class sql_att():
def __init__(self,id,url,post,cookie):
self.id=id
self.url=url
self.post=post
self.cookie=cookie
self.start_time=time.time()
self.master_id=31323131323132
self.master_u... |
from urlparse import urlparse, urljoin
from flask import request, url_for, redirect
def is_safe_url(target):
ref_url = urlparse(request.host_url)
test_url = urlparse(urljoin(request.host_url, target))
return test_url.scheme in ('http', 'https') and \
ref_url.netloc == test_url.netloc
def get_redirec... |
'''
Mixin for publishing messages to a topic's listeners. This will be
mixed into topicobj.Topic so that a user can use a Topic object to
send a message to the topic's listeners via a publish() method.
:copyright: Copyright since 2006 by Oliver Schoenborn, all rights reserved.
:license: BSD, see LICENSE.txt for details... |
import re
import pyproj
from bycycle.core.geometry import Point, LineString
__all__ = ['is_coord', 'length_in_meters', 'split_line', 'trim_line']
def is_coord(value):
"""Is ``value`` a valid coordinate?
Args:
value (str): A string representing an integer or a simple float
Returns:
bool: Whet... |
FORWARDWORDBIND=('w')
BACKWARDWORDBIND=('s')
LEFTWORDBIND=('a')
RIGHTWODBIND=('d')
QUITWORDBIND=('q')
import pygame.event
import pygame.key
import pygame.display
import pygame.image
import pygame.mixer
import pygame
import time
import os
from pygame.locals import *
import xml.etree.ElementTree as ET
if 'mazefilepath' i... |
from distutils.core import setup
import sys
if len(sys.argv) > 1 and sys.argv[1] == 'py2exe':
import py2exe
import version
setup(
# The first three parameters are not required, if at least a
# 'version' is given, then a versioninfo resource is built from
# them and added to the executables.
name = v... |
from smtplib import SMTP
from time import strftime
from lib.interface.Relay import Relay
class Email(Relay):
def get(self, key=""):
super().get(key)
def __init__(self, mail_to, mail_server, mail_from, mail_password):
super().__init__(mail_to, mail_server, mail_from)
self.password = mail_... |
import socket
import os
import sys
import logging as log
import pwd
import subprocess
import auth
from helper import *
log.basicConfig(format="[%(levelname)s] %(message)s", level=log.DEBUG)
class ServerError(Exception):
pass
class RequestHandler:
COMMAND_PREFIX = 'command__'
def __init__(self):
met... |
import zipfile
zf = zipfile.ZipFile('t06.zip')
def findnext(nstr):
text = zf.read(nstr+'.txt')
start = text.find('Next nothing is ')+16
if start<16: return text
return text[start:]
def dofind(bgnum = '90052'):
collect = []
while True:
collect.append(bgnum)
bgnum = findnext(bgnum)... |
import hashlib
import os
from Crypto.Cipher import AES
SALT_LENGTH = 32
DERIVATION_ROUNDS = 1337
BLOCK_SIZE = 16
KEY_SIZE = 32
def encrypt(password, plaintext):
"""Encrypt a users password.
:param password: ``str``
:param plaintext: ``str``
:return: ``object``
"""
mode = AES.MODE_CBC
salt = ... |
def getBoundaryVariables(QL, QR, neqn, naux, wallXYZ, wallAvec):
import numpy as np
print neqn+ naux
qinfSize = neqn + naux
print 'Vector size', qinfSize
# QL is the raw value the raw boundary variables (non-dimensional) - hard set BC
# QR is the value in the ghost cell - soft set BC
# compu... |
def data_year(data_string):
if (data_string % 400 == 0) or ((data_string % 4 == 0) and (data_string % 100 != 0)):
print(u"%d 是闰年" % data_string)
else:
print(u"%d 不是闰年" % data_string)
if __name__ == "__main__":
data_string = int(input("Please input year:"))
data_year(data_string) |
import re
from core import jsunpack
from core import logger
from core import scrapertools
headers = [['User-Agent','Mozilla/5.0 (Windows NT 10.0; WOW64; rv:46.0) Gecko/20100101 Firefox/46.0']]
host = "http://powvideo.net/"
def test_video_exists(page_url):
logger.info("pelisalacarta.servers.powvideo test_video_exist... |
from webob import Request, Response
import threading
from paste.util import threadedprint
from Queue import Queue
from itertools import count
import tempita
from paste.urlparser import StaticURLParser
from paste.util.filemixin import FileMixin
import os
import sys
import simplejson
here = os.path.dirname(os.path.abspat... |
"""
Main window functionality
"""
from __future__ import absolute_import, division, print_function
import base64
import cProfile
import os.path
import pstats
import time
from functools import partial
import numpy as np
from argos.collect.collector import Collector
from argos.config.abstractcti import AbstractCti
fr... |
import logging
import time
import os
import sys
import uuid
try:
import netns
except ImportError:
pass
class NetNSWrapper(object):
def __init__(self, loglevel = logging.INFO, enable_dump = False):
super(NetNSWrapper, self).__init__()
# holds reference to all C++ objects and variables in the ... |
"""Really dumb test code for iiif.generators.julia_p28_p008.py."""
import unittest
import cmath
from iiif.generators.julia_p28_p008 import PixelGen
class TestAll(unittest.TestCase):
"""Tests."""
def test01_set_c(self):
"""Test set_c."""
gen = PixelGen()
gen.set_c(complex(0, 1))
s... |
from decimal import *
from struct import pack
coinsPrecision = getcontext().prec = 16 # Currency precision
MIN = 60 # Minute in seconds
HOUR = 60 * 60 # Hour in seconds
DAY = 60 * 60 * 24 # Day in seconds
INITIAL_TARGET = (2**(256 - 20)) # Initial target
INITIAL_DIFFICULTY = 1
MAX_NONCE = 2**32
MAX_COINS = Decimal('420... |
from __future__ import absolute_import, division, print_function, \
unicode_literals
from flask import Blueprint, request
from ...error import FormattedError
from ...type.enum import FigureType
from ..util import HTTPRedirect, \
require_admin, require_auth, send_file, send_json, templated, url_for
def create_fa... |
"""
Pure-Python interface to Apple Bonjour and compatible DNS-SD libraries
pybonjour provides a pure-Python interface (via ctypes) to Apple
Bonjour and compatible DNS-SD libraries (such as Avahi). It allows
Python scripts to take advantage of Zero Configuration Networking
(Zeroconf) to register, discover, and resolve ... |
"""
This script shows moving cirecles made of dots and measures the
participants' sway
"""
import viz, viztask, vizact, vizinput, vizshape
import math
import random
import oculus
import time
import datetime
from datetime import date
from string import maketrans
import itertools, csv, time
vrpn = viz.addExtension('vrpn... |
import unittest
import decodes.core as dc
from decodes.core import *
class Tests(unittest.TestCase):
def test_empty_constructor(self):
pgon = PGon()
self.assertEqual(len(pgon.pts),0,"a polygon constructed with no arguments contains an empty list of verts")
def test_segs_and_edges(self):
... |
"""
This is a small script for calculating the repayment of a given loan at each
term. This was created just to learn how to do it, and get a feeling of the
numbers, as I have no clue about finances.
"""
import sys, getopt
def usage(exitcode=0):
print "Usage: %s <loan> <rate per year> <# of years> <# of terms per y... |
class shape:
def __init__(this):
'''initializes a shape object, used by the camera to render to the screen'''
this.color = (255, 255, 255)
this.pos = (0, 0)
this.angle = 0
this.thickness = 0
this.scale = 1
this.fill = None |
import sys
import os
import carmaWrap as ch
import shesha as ao
import time
import hdf5_util as h5u
import numpy as np
print("TEST SHESHA\n closed loop: call loop(int niter)")
if (len(sys.argv) != 2):
error = 'command line should be:"python -i test.py parameters_filename"\n with "parameters_filename" the path to th... |
import json
import os
import sys
import getopt
import re
import salt.config
import salt.runner
import salt.client
def doHighState( servers, __opts__ ):
local = salt.client.LocalClient()
jobids = []
# Redirect output to /dev/null, to eat error output.
stdout_bak = sys.stdout
with open(os.devnull, 'wb... |
import numpy
import scipy.sparse
from exp.util.SparseUtils import SparseUtils
numpy.set_printoptions(suppress=True, precision=3, linewidth=150)
shape = (15, 20)
r = 10
k = 50
X, U, s, V = SparseUtils.generateSparseLowRank(shape, r, k, verbose=True)
X = numpy.array(X.todense())
Y = numpy.zeros(X.shape)
Y[X.nonzero()] = ... |
from qgis.core import QgsFeatureRequest
from qgis.core import QgsGeometry
from qgis.core import QgsProject
from ThreeDiToolbox.tool_commands.custom_command_base import CustomCommandBase
from ThreeDiToolbox.tool_commands.predict_calc_points.predict_calc_points_dialog import (
AddConnectedPointsDialogWidget,
)
from T... |
import csv, os, sys, cgi
import sqlite3
import geojson
parametri = cgi.FieldStorage()
myjson=parametri["json"].value
if os.path.exists('catasto_cart_4326.sqlite'):
#os.remove('MyDatabase.sqlite')
conn = sqlite3.connect('catasto_cart_4326.sqlite')
conn.enable_load_extension(True)
conn.execute('SELECT load_extens... |
from django.conf import settings
from django.db import models
from djutil.models import TimeStampedModel
from feature_toggle.exceptions import FeatureToggleAttributeAlreadyExists
from .constants import Environments, Attributes
from .utilities import django_model_choices_from_iterable, make_meanigful_id
ENV_CHOICES = dj... |
import sys, rospy, tf, moveit_commander, random
from geometry_msgs.msg import Pose, Point, Quaternion
class R2ChessboardWrapper:
def __init__(self):
self.left_arm = moveit_commander.MoveGroupCommander("left_arm")
def setPose(self, x, y, z, phi, theta, psi):
orient = \
Quaternion(*tf.transformations.qu... |
import sys
sys.path.append("../luna-data-pre-processing")
sys.path.append("../common")
from NoduleSerializer import NoduleSerializer
from Prophet import Prophet
import multiprocessing
import numpy as np
from scan import Scanner
def dataScanner(dataPath, phase, dataQueue):
scanner = Scanner(dataPath, phase, dataQueu... |
import numpy as np
import pandas as pd
import pyflux as pf
from sklearn.gaussian_process import GaussianProcessRegressor
from sklearn.gaussian_process.kernels import RBF, ConstantKernel
import scipy.stats as st
from pyFTS.common import SortedCollection, fts
from pyFTS.probabilistic import ProbabilityDistribution
class ... |
import sys, os, re, urllib2, urllib
import datetime
from Pagehandler import Pagehandler
from bs4 import BeautifulSoup
from utils import urlstring_to_date
import config
try:
import xbmc, xbmcgui, xbmcplugin, xbmcaddon
except ImportError:
pass
def make_list(href):#to do everything to get all videos for that game
PH = ... |
"""
W tym pliku zawarta jest definicja wirnika, która zostanie zinterpretowana w programie GMSH, a następnie użyta jako plik wsadowy w programie Calculix.
"""
import numpy as np
from gmshClass import Part, PSurface, RSurface
def przygotujPlik(Goniec,frt):
"""
Idea zawartej procedury polega na zgromadzeniu infor... |
import discord
from discord.ext import commands
from cogs.utils import checks
from __main__ import set_cog, send_cmd_help, settings
from .utils.dataIO import fileIO
import importlib
import traceback
import logging
import asyncio
import threading
import datetime
import glob
import os
import time
import aiohttp
log = log... |
from __future__ import unicode_literals
from indico.modules.events.controllers.admin import (RHReferenceTypes, RHCreateReferenceType, RHEditReferenceType,
RHDeleteReferenceType)
from indico.modules.events.controllers.display import RHExportEventICAL
from indico.modul... |
import unittest
from diffcalc.hkl.vlieg.constraints import ModeSelector, VliegParameterManager
from diffcalc.util import DiffcalcException
from test.diffcalc.hkl.vlieg.test_calc import \
createMockHardwareMonitor, createMockDiffractometerGeometry
import pytest
class TestModeSelector(object):
def setup_method(se... |
"""Resources test.
.. note:: 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 version.
"""
__author__ = 'r.nijssen@terglobo... |
{
'name': "Internal Refference",
'summary': """
This module add Internal Refference Dropdown
""",
'author': "Aditya Nugraha ",
'website': "",
# Categories can be used to filter modules in modules listing
# for the full list
'category': 'Purchase',
'version': '8.0.0.1.0',
'lic... |
from . import _mixin as mixin
from ..base import peer as base
class ListPeersCmd(base.ListPeersCmdbase,
mixin.make_request,
mixin.select_torrents,
mixin.create_list_widget):
provides = {'tui'}
def make_peer_list(self, tfilter, pfilter, sort, columns):
... |
__author__ = 'steffen' |
import numpy as np
from yaff import *
ffatype_rules = [
('Si_4', '14'),
('O_B', '8'),
]
rvecs = np.loadtxt('rvecs.txt')*angstrom
system = System.from_file('struct.xyz', rvecs=rvecs)
system.set_standard_masses()
system.detect_ffatypes(ffatype_rules)
system.to_file('init.chk') |
"""debootstrap command.
@author: Tobias Hunger <tobias.hunger@gmail.com>
"""
from cleanroom.binarymanager import Binaries
from cleanroom.command import Command
from cleanroom.exceptions import ParseError
from cleanroom.helper.debian.apt import debootstrap
from cleanroom.location import Location
from cleanroom.systemcon... |
"""
MAP Client, a program to generate detailed musculoskeletal models for OpenSim.
Copyright (C) 2012 University of Auckland
This file is part of MAP Client. (http://launchpad.net/mapclient)
MAP Client is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public Lice... |
import sys
sys.path.append("..\\..")
import os
from api.providers.opensubtitles import provider as opensubtitlesprovider
from api.providers.opensubtitles import OpenSubtitlesRequestsManager
OpenSubtitlesProvider = opensubtitlesprovider.OpenSubtitlesProvider
from api.languages import Languages
from api.title import Movi... |
import mock
import unittest
from timelinelib.calendar.gregorian import from_date
from timelinelib.dataimport.tutorial import TutorialTimelineCreator
from timelinelib.time.timeline import Time
from timelinelib.view.periodbase import SelectPeriodByDragInputHandler
class SelectperiodByDragInputHandler(unittest.TestCase):
... |
import numpy as np
import spm1d
dataset = spm1d.data.uv0d.anova3nested.SouthamptonNested3()
y,A,B,C = dataset.get_data()
print( dataset )
np.random.seed(0)
alpha = 0.05
snpmlist = spm1d.stats.nonparam.anova3nested(y, A, B, C)
snpmilist = snpmlist.inference(alpha, iterations=1000)
print( 'Non-parametric resu... |
import socket
import subprocess
import os #NEW IMPORT ... FILE OPERATION
def transfer(s,path):
if os.path.exists(path):
f = open(path, 'rb')
packet = f.read(1024)
while packet != '':
s.send(packet)
packet = f.read(1024)
s.send('DONE')
f.close()
e... |
import pandas
df1 = pandas.DataFrame({
'B': ['B0', 'B1', 'B2', 'B3']
})
df2 = pandas.DataFrame({'A': ['A4', 'A5', 'A6', 'A7'],
'B': ['B4', 'B5', 'B6', 'B7'],
'C': ['C4', 'C5', 'C6', 'C7'],
'D': ['D4', 'D5', 'D6', 'D7']}, index=[4, 5, 6, 7])
fra... |
"""
Copyright 2011 Dmitry Nikulin
This file is part of Captchure.
Captchure 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 ve... |
"""
Script para renomear arquivos recursivamente, trocando espaços por underscores
e caracteres unicode por equivalentes em ascii.
./renamer -amp "_and_": Troca '&' por '_and_';
./renamer -ru: Troca unicode por ascii;
./renamer -rs: Troca espaços por underscores;
./renamer -rp: Troca pontuação por underscore;
./renamer... |
import json, os, numpy as np
SROWS=40000
S = 8 # RBF grid division
params = json.loads(open(os.environ['HOME'] + "/Downloads/campdata/nomterr.conf").read())
if os.path.isdir("/tmp"): os.environ['TMPDIR'] = "/tmp"
gps_coord_sample_file = 'gps_coord_sample.npy'
gpxbegin = '''<?xml version="1.0" encoding="UTF-8"?>
<gpx cr... |
'''
This is a main module. It was created for reading/writing data to/from process memory.
© DOCTOR_RABB
'''
from ptrace.debugger import PtraceDebugger
import struct
from lib.memwork import data
class ProcessDebugger (object):
def __init__(self, pid):
self.debugger = PtraceDebugger ()
self.p... |
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('repoapi', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='jenkinsbuildinfo',
name='param_release',
... |
from __future__ import with_statement
import os.path
import time
import urllib
import re
import threading
import datetime
import operator
from Cheetah.Template import Template
import cherrypy
import cherrypy.lib
import metadata.helpers
from sickbeard import config
from sickbeard import history, notifiers, processTV, se... |
from django.core.urlresolvers import resolve
from django.test import TestCase
from wechat.models import User, Activity, Ticket, ConfBasic, UserLogin
from userpage.views import *
from userpage.urls import *
from django.contrib.auth.models import User as Superuser
from django.test import Client
import unittest
class Test... |
import numpy as np
import matplotlib.pyplot as plt
import galsim
tfile = 'ps.wmap7lcdm.2000.dat'
tdata = np.loadtxt(tfile)
tell = tdata[:,0]
tcell = tdata[:,1]
tdel = tcell*(tell**2)/(2.*np.pi)
tab = galsim.LookupTable(tell, tdel, x_log=True, f_log=True)
galsim_file = 'output/ps.results.input_pe.pse.dat'
galsim_data = ... |
import os
import sys
import numpy as np
from PyQt5.QtWidgets import (QWidget, QPushButton,QLabel,QFileDialog,QComboBox,
QHBoxLayout, QVBoxLayout, QGridLayout, QLineEdit, QApplication,QRadioButton,QErrorMessage)
from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FigureCanvas
from matplotlib.backends... |
"""Module for database operations."""
import os
import time
import sqlite3
"""
Changelog:
Date: Init: Comment:
*******************************************************************************
13.06.2016 AA Version 1.
11.07.2016 AA Version 1. cont. inserted initial tables with
... |
from __future__ import print_function
from __future__ import division
from __future__ import unicode_literals
from gnuradio import gr, filter
import math
import cmath
class fm_deemph(gr.hier_block2):
r"""
FM Deemphasis IIR filter
Args:
fs: sampling frequency in Hz (float)
tau: Time constant ... |
"""
Submit jobs to DIRAC WMS
Example:
$ dirac-wms-job-submit Simple.jdl
JobID = 11
"""
import os
import DIRAC
from DIRAC.Core.Utilities.DIRACScript import DIRACScript as Script
@Script()
def main():
Script.registerSwitch("f:", "File=", "Writes job ids to file <value>")
Script.registerSwitch("r:", "UseJobRep... |
import unittest
from persispy.phc import Intersect
from persispy.points import sphere
import timeit as t
class TestPHCPack(unittest.TestCase):
def setUp(self):
self.points = 500
def test_sampling_points_2sphere(self):
selection = "x^2 + y^2 + z^2 - 1"
Intersect(eqn=selection, num_points=... |
def getSequenceEqualsToNum(array, num):
def main():
array = (4, 3, 6, 5, 24, 11, 8, 10, 21)
num = 20
print getSequenceEqualsToNum(array, num)
if __name__ == '__main__':
main() |
class uploadr:
domain = "0.0.0.0"
port = 5000
uploads = './uploads' # uploaded files will be stored
qrcodes = './qrcodes' # qr codes will be stored
bind = "0.0.0.0:" + str(uploadr.port) |
from mpi4py import MPI
from array import array
import pickle, time, random, os, json
RANK_MASTER = 0
comm = MPI.COMM_WORLD
size = comm.Get_size()
rank = comm.Get_rank()
name = MPI.Get_processor_name()
class Scheduler(object):
OUTPUT_PICKLED = '__pickled__'
OUTPUT_JSON = '__json__'
RES_FAILED = '__failed__'
... |
"""
Created on 5/02/2016
@author: javgar119
"""
import os
import sqlite3
import numpy as np
import pandas as pd
path = 'C:/Users/javgar119/Documents/Dropbox/Trabajo'
databas_path = os.path.join(path, "database.db")
conn = sqlite3.connect(databas_path)
pd.options.display.float_format = '{:20,.2f}'.format
qry = ('SELECT ... |
from subprocess import Popen, PIPE
import sqlite3 as sql
from spg import BINARY_PATH
class Queue:
queue_type = "base"
ENVIRONMENT = {}
def __init__(self, name, max_workers, workers_sleep = 5):
self.name = name
self.max_workers = max_workers
self.workers= []
self.workers_sleep... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import unittest
import datetime
import json
from mock import MagicMock
from DIRAC.DataManagementSystem.Agent.RequestOperations.ReplicateAndRegister import ReplicateAndRegister
from DIRAC.DataManagementSystem.Age... |
from __future__ import with_statement
import datetime
import hashlib
import htmlentitydefs
import itertools
import os
import re
import shutil
import socket
import string
import sys
import time
import traceback
import urllib
import urlparse
import xml.sax.saxutils #@TODO: Remove in 0.4.10
import zlib
try:
import si... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.