src stringlengths 721 1.04M |
|---|
from block import *
from shard import *
from logging import ERROR, WARN, INFO, DEBUG
import time
class categorize_shard(Shard):
@classmethod
def initial_configs(cls, config):
return [config for i in range(config["nodes"])]
@classmethod
def node_type(self):
return {"name": "Categorize", "input_port"... |
# Copyright 2020 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... |
import sys
try:
from django.conf import settings
settings.configure(
DEBUG=True,
USE_TZ=True,
DATABASES={
"default": {
"ENGINE": "django.db.backends.sqlite3",
}
},
ROOT_URLCONF="djangocms_owl.urls",
INSTALLED_APPS=[
... |
from time import sleep
from logging import getLogger
from gofer import Thread
from gofer.messaging.adapter.reliability import YEAR
DELAY = 10
MAX_DELAY = 90
RETRIES = YEAR / MAX_DELAY
DELAY_MULTIPLIER = 1.2
log = getLogger(__name__)
def retry(*exception):
def _fn(fn):
def inner(connection):
... |
from lib import helps
from lib import utils
outputs = []
def process_message(data):
if data.get('text', '').split(' ')[0] == '!help':
admin_channel, botname, icon_emoji = utils.setup_bot(config)
message_attrs = {'icon_emoji': icon_emoji, 'username': botname}
# Translate channel id to cha... |
#!/usr/bin/env python
import IO
def freeze(v): return str(IO.encode(v))
def thaw(s): ret,e = IO.decode(s); assert(e==len(s)); return ret
g_state = {}
g_dirty = set() # keys that have been modified
from re import compile as re_compile
g_reLastNum = re_compile(r'(?:[^\d]*(\d+)[^\d]*)+')
g_undos,g_redos,g_undo = [],[]... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Tests various schema replication scenarios
#
# Copyright (C) Kamen Mazdrashki <kamenim@samba.org> 2011
#
# 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 Fo... |
#!/usr/bin/env python
#
# screensaverAutoAway.py - X-Chat script to monitor for the DBUS message
# emitted when the screensaver is activated and de-activated and set the user
# away.
#
# To install:
# o Copy this file to your ~/.xchat2/ directory and it will be loaded on startup.
# o To load without restart, run: /p... |
#Reads xbox inputs and returns desired l/r wheel powers
from MiniBotFramework.Lib.legopi.lib import xbox_read
from threading import Thread
class Xbox(object):
updated = False
left = 0
right = 0
def __init__(self):
self.thread_xbox = Thread(target = read_xbox)
self.thread_xbox.start()... |
from __future__ import division
import numpy as np
import climlab
from climlab.convection import emanuel_convection
from climlab.tests.xarray_test import to_xarray
import pytest
# These test data are based on direct single-column tests of the CONVECT43c.f
# fortran source code. We are just checking to see if we get... |
import os
from miura import runner
from .utils import get_method_from_module, format_path_to_module
from .data import load_data_from_path, filter_data
from .template import TemplateSet
from .exceptions import MiuraException
import logging
DEFAULT_DATA_DIRECTORY = os.path.join(os.curdir, 'data')
DEFAULT_TEMPLATE_DIRE... |
import MyDoubleLinkedList
class DoubleLinkedListStack:
def __init__(self):
self.front = None
self.rear = None
self.content = None
def push(self, val):
# push to empty queue
if self.content is None:
self.content = MyDoubleLinkedList.LinkedList(val)
... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import urllib2;
import re;
import string;
import sys;
from BeautifulSoup import BeautifulSoup
month_num = {
'Jan' : '01',
'Feb' : '02',
'Mar' : '03',
'Apr' : '04',
'May' : '05',
'Jun' : '06',
'Jul' : '07',
'Aug' : '08',
'Sep' : '09',
'Oct' : '10',
'Nov' : ... |
import sys
from distutils.core import setup
try:
import EUtils
except ImportError:
import __init__ as EUtils
def _dict(**kwargs):
return kwargs
d = _dict(
name = "EUtils",
version = EUtils.__version__,
description = "Client interface to NCBI's EUtils/Entrez server",
author = "Andrew Dalk... |
import asyncio
from contextlib import asynccontextmanager, AbstractAsyncContextManager, AsyncExitStack
import functools
from test import support
import unittest
from test.test_contextlib import TestBaseExitStack
def _async_test(func):
"""Decorator to turn an async function into a test case."""
@functools.wra... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# MyDomus
# Home Domotic Service
# Copyright (c) 2016 Salvatore Cavallero (salvatoe.cavallero@gmail.com)
# https://github.com/scavallero/mydomus
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General ... |
#!/usr/bin/env python3
import os, time, datetime, platform, urllib, hashlib
import qiniu
from mimetypes import MimeTypes
import pyperclip
from os.path import expanduser
import configparser
homedir = expanduser("~")
config = configparser.ConfigParser()
config.read(homedir+'/qiniu.cfg')
mime = MimeTypes()
now = datetim... |
"This module contains operation on baskets and lines"
from django.conf import settings
from oscar.core.loading import get_model, get_class
from oscar.core.utils import get_default_currency
from oscar.core.prices import Price
__all__ = (
'apply_offers',
'assign_basket_strategy',
'prepare_basket',
'get_b... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import re
import urlparse
from scrapy import log
from scrapy.http import Request
from base.base_wolf import Base_Wolf
class Wolf(Base_Wolf):
def __init__(self, *args, **kwargs):
super(Wolf, self).__init__(*args, **kwargs)
self.name = 'kuyi'
s... |
# -*- coding: utf-8 -*-
#
## This file is part of Invenio.
## Copyright (C) 2013 CERN.
##
## Invenio 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) an... |
# GNU MediaGoblin -- federated, autonomous media hosting
# Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either versio... |
#!/usr/bin/env python
#
# Electrum - lightweight Bitcoin client
# Copyright (C) 2012 thomasv@gitorious
#
# 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 witho... |
import smtplib
import smtpd
import asyncore
import email.utils
from email.mime.text import MIMEText
import threading
class SMTPReceiver(smtpd.SMTPServer):
def process_message(self, peer, mailfrom, rcpttos, data):
print 'Receiving message from:', peer
print 'Message addressed from:', mailfrom
... |
# -*- coding:utf-8 -*-
from django.contrib import messages
from django.shortcuts import redirect
from django.template.response import TemplateResponse
from django.utils.translation import ugettext_lazy as _
from satchless.order.app import order_app
def home_page(request):
messages.success(request, _(u'<strong>We... |
"""
Serializers common to all assessment types.
"""
from copy import deepcopy
import logging
from rest_framework import serializers
from rest_framework.fields import DateTimeField, IntegerField
from django.core.cache import cache
from openassessment.assessment.models import Assessment, AssessmentPart, Criterion, C... |
#!/usr/bin/env python2
from __future__ import division, absolute_import, print_function
__all__ = ['run_main', 'compile', 'f2py_testing']
import os
import sys
import subprocess
from . import f2py2e
from . import f2py_testing
from . import diagnose
from .info import __doc__
run_main = f2py2e.run_main
main = f2py2e.... |
"""
UNIVERSIDAD DE COSTA RICA Escuela de Ingeniería Eléctrica
IE0499 | Proyecto Eléctrico
Mario Alberto Castresana Avendaño
A41267
Programa: BVH_TuneUp
-------------------------------------------------------------------------------
archivo: Leg.py
descripción:
Este archivo contiene la clase Leg... |
# Copyright (c) 2014 The Bitcoin Core developers
# Copyright (c) 2014-2015 The Flowercoin developers
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Helpful routines for regression testing
#
# Add python-bitcoinrpc to modu... |
from __future__ import print_function
import sys
sys.path.append('..')
from src.sim import Sim
from src.packet import Packet
from dvrouting import DvroutingApp
from networks.network import Network
class BroadcastApp(object):
def __init__(self, node):
self.node = node
def receive_packet(self, pack... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('platforms', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='Runner',
fields=[
... |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import collections
import datetime
import pytz
from odoo import fields, http
from odoo.http import request
from odoo.tools import html_escape as escape, html2plaintext
class WebsiteEventTrackController(http.Controller... |
import github
import nbformat
from .gisthub import gisthub, _hashtags
import nbx.compat as compat
def parse_tags(desc):
# real tags and not system-like tags
tags = _hashtags(desc)
if '#notebook' in tags:
tags.remove('#notebook')
if '#inactive' in tags:
tags.remove('#inactive')
ret... |
#!/usr/bin/env python
# Copyright 2017 Google, 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 by applicable law or... |
import os
import nltk
from nltk.tokenize import word_tokenize
from nltk.stem import WordNetLemmatizer
#apagar wanings
os.environ['TF_CPP_MIN_LOG_LEVEL']='2'
import tensorflow as tf
import numpy as np
import pickle
import random
from collections import Counter
lemmatizer = WordNetLemmatizer()
hm_lines = 10000000
#fi... |
#!/usr/bin/env python3
# Easy eBook Viewer by Michal Daniel
# Easy eBook Viewer is free software; you can redistribute it and/or modify it under the terms
# of the GNU General Public Licence as published by the Free Software Foundation.
# Easy eBook Viewer is distributed in the hope that it will be useful, but WITHO... |
# Copyright (C) 2011 Dmitri Nikulin
#
# 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 wr... |
#!/usr/bin/python
import networkx as nx
import matplotlib.pyplot as plt
num_of_test = 0 # number of test case (N)
debug = 0
num_P = 0
num_W = 0
gown = 0
gthtn = 0
th = []
class node(object):
""" data = n
child = child nodes """
def __init__(self, data = 0, child = [], parent = [], level = 0):
... |
# Copyright (c) 2017-2018 {Flair Inc.} WESLEY PENG
#
# 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 agre... |
import yaml
import csv
class HandlerBase(object): pass
class CsvHandler(HandlerBase):
def __init__(self):
pass
def load(self):
csv.register_dialect('tabbed',delimiter="\t",quoting=csv.QUOTE_NONE)
self.data = []
with open(self.src,'r') as f:
reader = csv.r... |
import os
from flask_appbuilder.security.manager import (
AUTH_OID,
AUTH_REMOTE_USER,
AUTH_DB,
AUTH_LDAP,
AUTH_OAUTH,
)
basedir = os.path.abspath(os.path.dirname(__file__))
# Your App secret key
SECRET_KEY = "\2\1thisismyscretkey\1\2\e\y\y\h"
# The SQLAlchemy connection string.
SQLALCHEMY_DATABAS... |
r"""
Subsampling (:mod:`skbio.math.subsample`)
=========================================
.. currentmodule:: skbio.math.subsample
This module provides functionality for subsampling from vectors of counts.
Functions
---------
.. autosummary::
:toctree: generated/
subsample
"""
# -----------------------------... |
# coding=utf-8
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import absolute_import, division, print_function, unicode_literals
import ast
import keyword
import re
from functools import wraps
import six
from pants.c... |
"""Object specification for creating messages in MCL.
The :mod:`~.messages.messages` module provides a means for implementing MCL
message objects. This is done through the :class:`.Message` object. Since
:class:`.Message` objects derive from python dictionaries, they operate near
identically.
:class:`.Message` objec... |
# Module to run tests on BPMImage class
# Requires files in Development suite and an Environmental variable
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
# TEST_UNICODE_LITERALS
import os
import pytest
import glo... |
# Copyright 2015 Metaswitch Networks
#
# 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 w... |
# -*- coding: utf-8 -*-
"""centralize settings"""
from django.conf import settings as project_settings
from django.core.urlresolvers import reverse
def aloha_version():
"""return settings or default"""
return getattr(project_settings, 'DJALOHA_ALOHA_VERSION', "aloha.0.23.26")
def init_js_template():
""... |
#
# CORE
# Copyright (c)2010-2012 the Boeing Company.
# See the LICENSE file included in this distribution.
#
''' Sample user-defined service.
'''
import os
from core.service import CoreService, addservice
from core.misc.ipaddr import IPv4Prefix, IPv6Prefix
class CyberAttack(CoreService):
''' This is a sample u... |
"""
TupleBanditsPureExplorationDashboard
author: Nick Glattard, n.glattard@gmail.com
last updated: 4/24/2015
######################################
TupleBanditsPureExplorationDashboard
"""
import json
import numpy
import numpy.random
import matplotlib.pyplot as plt
from datetime import datetime
from datetime impor... |
__author__ = 'Ivan Dortulov'
import re
##
# This class represents an Http-Request to a server.
#
class HttpRequest(object):
##
# Default constructor.
#
# Creates an empty Http-Request.
def __init__(self, request_string = ''):
## @var contentEncoding
# The character set of the en... |
#!/usr/bin/env python
"""
This is a simple script to download and transform some example data from
sklearn.datasets.
:author: Michael Heilman (mheilman@ets.org)
:author: Aoife Cahill (acahill@ets.org)
:organization: ETS
"""
from __future__ import print_function, unicode_literals
import json
import os
import sys
im... |
from freki.serialize import FrekiDoc, FrekiBlock, FrekiLine
import codecs
import re
import chardet
import logging
import argparse
def run(args):
frek = read_and_convert(args.infile, args.igtfile, args.encoding, args.detect)
out = open(args.outfile, 'w', encoding='utf8')
out.write(str(frek))
def convert_... |
from __future__ import absolute_import
from __future__ import print_function
import os
from xml.dom import minidom
from collections import defaultdict
from pychess.System.prefix import addDataPrefix
from .PyDockLeaf import PyDockLeaf
from .PyDockComposite import PyDockComposite
from .ArrowButton import ArrowButton
... |
import sys
sys.path.insert(1,"../../../")
import h2o, tests
def deep_learning_metrics_test():
# connect to existing cluster
df = h2o.import_file(path=tests.locate("smalldata/logreg/prostate.csv"))
df.drop("ID") # remove ID
df['CAPSULE'] = df['CAPSULE'].asf... |
#!/usr/bin/python
#-*- coding: utf-8 -*-
import sys
from collections import defaultdict as ddict
def load_test(path):
test = ddict(list)
with file(path) as f:
for line in f:
elements = line.strip().split(',')
if elements[2] != '1': continue
uid = int(elements[0])
... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
import flask
from flask import request, url_for
import os
from sqlalchemy import desc
from autocloud.models import init_model
from autocloud.models import JobDetails
from autocloud.web.pagination import RangeBasedPagination
from autocloud.web.utils import ... |
#!/usr/bin/env python3
# -*- coding: UTF-8 -*-
import sys
from PIL import Image
import numpy as np
import math
import argparse
def getMatrix(image):
data = list(image.getdata())
width, height = image.size
matrix = np.array(data).reshape(height,width)
return matrix
def getData(matrix):
data = lis... |
# Copyright (c) 2001-2014, Canal TP and/or its affiliates. All rights reserved.
#
# This file is part of Navitia,
# the software to build cool stuff with public transport.
#
# Hope you'll enjoy and contribute to this project,
# powered by Canal TP (www.canaltp.fr).
# Help us simplify mobility and open public tr... |
#!/usr/bin/python
import sys
import re
from optparse import OptionParser
entrypoints = []
anchors = []
parser = OptionParser()
parser.add_option("--cpp", dest="cpp")
parser.add_option("--template", dest="template")
parser.add_option("--wrasterimage", dest="wrasterimage", action="store_true")
(options, args) = parser... |
# coding=utf-8
"""Try to make a layer valid."""
from qgis.core import QgsFeatureRequest
from safe.common.custom_logging import LOGGER
from safe.definitions.processing_steps import clean_geometry_steps
from safe.gis.sanity_check import check_layer
from safe.utilities.profiling import profile
__copyright__ = "Copyrigh... |
import find_overlap
scores = {
'zara': 0.5,
'vogue': 0.5,
'google': 0.5
}
def find_keyword_occurences_in_source(map, source):
freq = 0
for key, value in map.iteritems():
for k, v in value.iteritems():
if v['source'] == source:
freq += 1
# print freq
ret... |
"""
execfile('sim928.py')
sim=sim928()
sim.open()
sim.write('*IDN?\n')
sim.readline()
sim.setOutOn(1)
sim.getId()
sim.setVolts(2.7)
sim.getVolts()
sim.connport(8)
sim.disconnport()
sim.close()
In /etc/rc.local add these lines. it is supposed to make the two devices available to everyone
#added by tim madd... |
# -*- coding: utf-8 -*-
"""
Created on Wed Oct 1 2015
@author: noore
"""
import os
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import gridspec
from scipy.optimize import curve_fit
import definitions as D
import pandas as pd
#LOW_GLUCOSE = D.LOW_CONC['glucoseExt']
LOW_GLUCOSE = 1e-3 # in mM, i... |
# -*- coding: utf-8 -*-
# Copyright (c) 2013 Red Hat, Inc.
#
# This software is licensed to you under the GNU General Public
# License as published by the Free Software Foundation; either version
# 2 of the License (GPLv2) or (at your option) any later version.
# There is NO WARRANTY for this software, express or impli... |
# -*- coding: utf-8 -*-
#################################################################################################
import logging
import os
import xbmc
import xbmcaddon
import xbmcvfs
from mutagen.flac import FLAC, Picture
from mutagen.id3 import ID3
from mutagen import id3
import base64
import read_embyser... |
import os
import re
import sys
import platform
import subprocess
from setuptools import setup, Extension
from setuptools.command.build_ext import build_ext
from distutils.version import LooseVersion
class CMakeExtension(Extension):
def __init__(self, name, sourcedir=''):
Extension.__init__(self, name, so... |
class bokehLine(object):
def __init__(self, line, symbol = None, viewNum = None, parent = None):
self.line = line
self.symbol = symbol
self.viewNum = viewNum
self.style = None
self.val = {'name' : self.line.name,
'color' : self.line.line_color,
'width' : self.line.line_width,
's... |
"""
bpz: Bayesian Photo-Z estimation
Reference: Benitez 2000, ApJ, 536, p.571
Usage:
python bpz.py catalog.cat
Needs a catalog.columns file which describes the contents of catalog.cat
"""
from __future__ import print_function
from __future__ import division
from builtins import str
from builtins import ... |
#
# Copyright (c) 2014 Juniper Networks, Inc. All rights reserved.
#
import uuid
try:
from neutron.extensions import loadbalancer
except ImportError:
from neutron_lbaas.extensions import loadbalancer
from neutron.openstack.common import uuidutils
from vnc_api.vnc_api import IdPermsType
from vnc_api.vnc_api i... |
from datetime import timedelta
import pytest
from coaster.utils import utcnow
import funnel.models as models
def test_user(db_session):
"""Test for creation of user object from User model."""
user = models.User(username='hrun', fullname="Hrun the Barbarian")
db_session.add(user)
db_session.commit()
... |
# Copyright 2009-2011 Canonical Ltd. This software is licensed under the
# GNU Affero General Public License version 3 (see the file LICENSE).
"""Database class for table ArchiveSubscriber."""
__metaclass__ = type
__all__ = [
'ArchiveSubscriber',
]
from operator import itemgetter
import pytz
from storm.ex... |
#!/usr/bin/env python2
# Copyright 2015 Dejan D. M. Milosavljevic
#
# 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
#
# ... |
#!/usr/bin/python
# Copyright (c) 2012 The Native Client Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""NEXE building script
This module will take a set of source files, include paths, library paths, and
additional arguments, and ... |
from triton import *
import smt2lib
"""
Address 0x400547 progress
[+] Address <cmp argv[1][0] 0x41>
{'SymVar_0': "0x50, 'P'"}
{'SymVar_0': "0x60, '`'"}
{'SymVar_0': "0x5a, 'Z'"}
{'SymVar_0': "0x4a, 'J'"}
{'SymVar_0': "0x42, 'B'"}
{'SymVar_0': "0x62, 'b'"}
{'SymVar_0': "0x6a, 'j'"}
{'SymVar_0': "0x68, 'h'"}
{'SymVar_0... |
#!/usr/bin/python
from mininet.net import Mininet
from mininet.node import Controller, RemoteController, Node
from mininet.cli import CLI
from mininet.log import setLogLevel, info
from mininet.link import Link, Intf
"""
THis is from https://haryachyy.wordpress.com/2014/06/14/learning-pox-openflow-controller-proactive... |
from __future__ import unicode_literals
import datetime
import re
from datetime import date
from decimal import Decimal
from django import forms
from django.core.exceptions import ImproperlyConfigured
from django.db import models
from django.forms.models import (
BaseModelFormSet, _get_foreign_key, inl... |
##############################################################################
#
# OSIS stands for Open Student Information System. It's an application
# designed to manage the core business of higher education institutions,
# such as universities, faculties, institutes and professional schools.
# The core ... |
"""Definition of the Lessons content type.
"""
from zope.interface import implements
from Products.Archetypes import atapi
from Products.ATContentTypes.content import folder
from Products.ATContentTypes.content.schemata import finalizeATCTSchema
from eduintelligent.courses.interfaces import ICourseContent
from edui... |
#!/usr/bin/python
# -*- encoding: utf-8; py-indent-offset: 4 -*-
# +------------------------------------------------------------------+
# | ____ _ _ __ __ _ __ |
# | / ___| |__ ___ ___| | __ | \/ | |/ / |
# | | | | '_ \ / _ \/ __| |/ /... |
import os.path
import sys
import csv
from datetime import datetime
from django.contrib.auth import get_user_model
from django.core.management.base import BaseCommand
from django.utils import timezone
from hub.apps.content.types.green_funds import GreenFund
from hub.apps.content.models import Website
from hub.apps.met... |
import os
import sys
import pytest
test_pkg = 'pyemma'
cover_pkg = test_pkg
# where to write junit xml
junit_xml = os.path.join(os.getenv('CIRCLE_TEST_REPORTS', os.path.expanduser('~')),
'reports', 'junit.xml')
target_dir = os.path.dirname(junit_xml)
if not os.path.exists(target_dir):
os... |
#!/usr/bin/python
"""
Software package management library.
This is an abstraction layer on top of the existing distributions high level
package managers. It supports package operations useful for testing purposes,
and multiple high level package managers (here called backends). If you want
to make this lib to support ... |
from django import forms
from django.utils.translation import ugettext_lazy as _
from easytree import utils
from easytree.exceptions import EasyTreeException
pos_map = {
'first-sibling': _('First sibling'),
'left': _('Previous sibling'),
'right': _('Next sibling'),
'last-sibling': _('Last sibling'),
... |
# Image urls for the psat command
psat_memes = [
"http://i.imgur.com/5eJ5DbU.jpg",
"http://i.imgur.com/HBDnWVc.jpg",
"http://i.imgur.com/RzZlq2j.jpg",
"http://i.imgur.com/mVRNUIG.jpg",
"http://i.imgur.com/OvOmC6g.jpg",
"http://i.imgur.com/QqlSxaZ.png",
"http://i.imgur.com/finNuzx.jpg",
"... |
# local config helper stuff
try:
import ISStreamer.configutil as configutil
except ImportError:
import configutil
try:
import ISStreamer.version as version
except ImportError:
import version
import uuid
# python 2 and 3 conversion support
import sys
if (sys.version_info < (2,7,0)):
sys.stderr.write("You need at l... |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (C) 2004-2012 OpenERP SA (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of ... |
"""
Django settings for djangoserver project.
Generated by 'django-admin startproject' using Django 1.9.9.
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 ... |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# Copyright 2012 Hewlett-Packard Development Company, L.P.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not ... |
"""Config flow to configure the AsusWrt integration."""
import logging
import os
import socket
import voluptuous as vol
from homeassistant import config_entries
from homeassistant.components.device_tracker.const import (
CONF_CONSIDER_HOME,
DEFAULT_CONSIDER_HOME,
)
from homeassistant.const import (
CONF_H... |
import itertools
import xml.etree.cElementTree as et
import networkx as nx
import pandas as pd
import numpy as np
def trackmate_peak_import(trackmate_xml_path, get_tracks=False):
"""Import detected peaks with TrackMate Fiji plugin.
Parameters
----------
trackmate_xml_path : str
TrackMate XML... |
# F3AT - Flumotion Asynchronous Autonomous Agent Toolkit
# Copyright (C) 2010,2011 Flumotion Services, S.A.
# All rights reserved.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version... |
import asyncio
import unittest
from kobold import (
assertions,
compare,
doubles,
swap)
class Host(object):
def subject(self, arg, kwarg=None):
return "original subject"
async def subject_cr(self, arg, kwarg=None):
return "original subject"
class TestInstallP... |
import pygame
from pygame.locals import *
from OpenGL.GL import *
from OpenGL.GLU import *
import random
vertices = (
(1, -1, -1),
(1, 1, -1),
(-1, 1, -1),
(-1, -1, -1),
(1, -1, 1),
(1, 1, 1),
(-1, -1, 1),
(-1, 1, 1)
)
edges = (
(0,1),
(0,3),
(0,4),
(2,1),
(2,... |
"""Formats GPS log messages into a path KMZ file that Google Earth can read."""
#!/bin/env python
import collections
import json
import sys
from plot_points import get_kml
def main():
"""Main function."""
if len(sys.argv) <= 1:
print('Usage: {} <log file>'.format(sys.argv[0]))
return
in... |
#!/ur/bin/env python
# -*- coding: utf-8 -*-
"""
gst-gengui configuration:
* define here your pipelines in the pipeline_desc string
* define the named elements you would like to scan for properties
* define the properties you would like to skip
Copyright 2009, Florent Thiery, under the terms of LGPL
"""
ignore_list... |
# package org.apache.helix.messaging.handling
#from org.apache.helix.messaging.handling import *
#from java.util import HashMap
#from java.util import List
#from java.util import Map
#from java.util.concurrent import ConcurrentHashMap
#from java.util.concurrent import ConcurrentLinkedQueue
#from java.util.concurrent.at... |
import itertools
import os
from collections import OrderedDict
from datetime import date, datetime, timedelta
import requests
from requests.auth import HTTPBasicAuth
from . import db
from .app import app
from .utils import to_py_datetime
GH_DATE_FORMAT = '%Y-%m-%dT%H:%M:%SZ'
BEGINNING_OF_TIME = '1970-01-01T00:00:00Z... |
from typing import cast
import numpy as np
import tensorflow as tf
from neuralmonkey.dataset import Dataset
from neuralmonkey.encoders.recurrent import RecurrentEncoder
from neuralmonkey.decoders.decoder import Decoder
from neuralmonkey.logging import warn
from neuralmonkey.model.model_part import ModelPart, FeedDict... |
import os
import json
import random
import logging
import urlparse
import webapp2
from google.appengine.api import channel
from google.appengine.ext import db
from google.appengine.ext.webapp import template
class Client(db.Model):
username = db.StringProperty(required=True)
token = db.StringProperty(require... |
from __future__ import absolute_import
from rq import Queue
from rq.decorators import job
from .core import Router
class RQRouter(Router):
'Router specifically for RQ routing'
def __init__(self, redis_connection, *args, **kwargs):
'''\
Specific routing when using RQ
:param redis_conn... |
from enum import Enum
from SiddhiCEP3 import SiddhiLoader
from SiddhiCEP3.DataTypes.DataWrapper import unwrapData, wrapData
class ComplexEvent(object):
class Type(Enum):
CURRENT = SiddhiLoader._loadType("org.wso2.siddhi.pythonapi.proxy.core.event.complex_event.TypeProxy")().CURRENT(),
EXPIRED = S... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.