content string |
|---|
from django.db import models
from django.core.validators import MinLengthValidator
class KPP(str):
@property
def inspection_code(self):
return self[:4]
@property
def cause(self):
return self[4:6]
@property
def record_number(self):
return self[6:9]
class KPPField(mod... |
#!/usr/bin/python
#-*-coding:utf-8-*-
import types
from w3lib.html import remove_entities
from urlparse import urlparse, urljoin
NULL = [None,'null']
take_first_and_strip = lambda x:x[0] if x.strip('- ') else None
take_first = lambda x:x[0] if x else None
def strip_null(arg,null=None):
"""
strip list,... |
#!/usr/bin/env python3
import os
from wsgiref.handlers import CGIHandler
import sys
sys.path.append("..")
import custom_functions
try:
from custom_functions import group_by_metadata, group_by_range
except ImportError:
from philologic.runtime import group_by_metadata, group_by_range
try:
from custom_fun... |
from __future__ import absolute_import
from __future__ import unicode_literals
from dnfpluginscore import _, logger
from dnf.cli.option_parser import OptionParser
import dnf
import dnf.cli
import dnf.exceptions
import dnf.i18n
import dnf.subject
import dnf.util
import hawkey
import itertools
import os
import shutil
... |
{
'name': 'Product Web Visible',
'version': '0.1',
'author': 'Codeback Software',
'summary': '',
'description' : 'Permite seleccionar que productos serán visibles desde una web externa',
'website': 'http://codeback.es',
'images': [],
'depends': ['product'],
'category': '',
's... |
"""
Django settings for mainsite project.
Generated by 'django-admin startproject' using Django 1.10.3.
For more information on this file, see
https://docs.djangoproject.com/en/1.10/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.10/ref/settings/
"""
import o... |
import re
from tieba.utils import *
from tieba.Record import Recorder
class LoginException(Exception):
pass
class SigninException(Exception):
pass
class Tieba():
""" class `Tieba` contains user's name and corresponding infomation
"""
def __init__(self, username, usercookie=None):
... |
import math
from flask import Blueprint, render_template, request, flash, redirect, url_for, abort
from laniakea.db import session_scope, BinaryPackage, SoftwareComponent, ArchiveSuite, \
get_archive_sections
from sqlalchemy import String, func, cast
from sqlalchemy.orm import joinedload
from sqlalchemy.dialects.po... |
from gettext import gettext as _
from django.db import models
from mozdns.models import MozdnsRecord, LabelDomainMixin
import reversion
class TXT(MozdnsRecord, LabelDomainMixin):
"""
>>> TXT(label=label, domain=domain, txt_data=txt_data)
"""
id = models.AutoField(primary_key=True)
txt_data = ... |
import openvoronoi as ovd
import ovdvtk
import truetypetracer as ttt # https://github.com/aewallin/truetype-tracer
import time
import vtk
import math
import offset2vtk
def insert_polygon_points(vd, polygon):
pts = []
for p in polygon:
pts.append(ovd.Point(p[0], p[1]))
id_list = []
print "in... |
"""Runs fio benchmarks to simulate logging, database and streaming.
Man: http://manpages.ubuntu.com/manpages/natty/man1/fio.1.html
Quick howto: http://www.bluestop.org/fio/HOWTO.txt
Simulated logging benchmark does the following things (PD only):
0) Do NOT use direct IO for any tests below, simply go through the FS.
... |
# --------------------------------------------------------------------------
# Unit tests for the int module. Run with pytest.
# --------------------------------------------------------------------------
import textwrap
import int
# --------------------------------------------------------------------------
# Helper ... |
import sqlite3
import mock
from tests import test
from cloudferrylib.utils import local_db
class UnclosableConnection(sqlite3.Connection):
def close(self, *args, **kwargs):
# pylint: disable=unused-argument
if kwargs.get('i_mean_it'):
super(UnclosableConnection, self).close()
class... |
'''
Created on 2015/01/31
@author: Taiga
'''
from mt4 import get_mt4
from mt4 import DEFAULT_MT4_NAME
import logging
def has_divtag_with_style(tag):
return tag.name == 'div' and tag.has_attr('style')
class BaseReport(object):
"""
Notes:
this is a base class that has input of backtest
Attribute... |
'''
Created on Mar 24, 2016
@author: consultit
'''
import panda3d.core
from p3recastnavigation import RNNavMeshManager, RNNavMesh
from panda3d.core import load_prc_file_data, LPoint3f
from direct.showbase.ShowBase import ShowBase
dataDir = "../data"
crowdAgent = None
if __name__ == '__main__':
# Load your appl... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
This example shows how to draw multiple plots overlayed in a single diagram.
The x array is being used twice, once for each plot.plot() call.
Relevant tutorial section:
http://docs.enthought.com/chaco/user_manual/chaco_tutorial.html#multiple-plots
"""
from traits.api ... |
"""
You are given two arrays (without duplicates) nums1 and nums2 where nums1’s elements are subset of nums2. Find all the next greater numbers for nums1's elements in the corresponding places of nums2.
The Next Greater Number of a number x in nums1 is the first greater number to its right in nums2. If it does not ex... |
import os
import signal
import sys
from PyQt4.QtCore import pyqtSignal
from PyQt4.QtCore import pyqtSlot
from PyQt4.QtCore import Qt
from PyQt4.QtGui import QFontMetrics
from PyQt4.QtGui import QAction
from PyQt4.QtGui import QIcon
from PyQt4.QtGui import QInputDialog
from PyQt4.QtGui import QLabel
from PyQt4.QtGui im... |
import datetime
import pytest
from eth_utils import to_wei
from web3.contract import Contract
@pytest.fixture
def presale_freeze_ends_at() -> int:
"""How long presale funds stay frozen until refund."""
return int(datetime.datetime(2017, 1, 1).timestamp())
@pytest.fixture
def presale_milestone_pricing(chain... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Tests for the SkyDriveLog log parser."""
import unittest
from plaso.parsers import skydrivelog
from tests.parsers import test_lib
class SkyDriveLogUnitTest(test_lib.ParserTestCase):
"""Tests for the SkyDrive log parser."""
def testParseErrorLog(self):
"""T... |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Thu Aug 17 13:26:03 2017
@author: fespir
Name:PAR filename processor
modules: PAR_file_info, get_PAR_attributes
Purpose: Program to extrat the filename from a PAR file and output the month, year, time and filename
sub program used by PAR.py.
"""
def PA... |
import unittest
import hypothesis
import aioppspp.messages.protocol_options as protocol_options
from aioppspp.messages import (
MessageType,
)
from . import strategies as st
class ProtocolOptionsTestCase(unittest.TestCase):
@hypothesis.given(st.byte())
@hypothesis.example(b'\x01')
def test_version(... |
from __future__ import print_function
import os
import sys
import re
from sos.plugins import RedHatPlugin
from sos.policies import LinuxPolicy, PackageManager, PresetDefaults
from sos import _sos as _
from sos import SoSOptions
sys.path.insert(0, "/usr/share/rhn/")
try:
from up2date_client import up2dateAuth
... |
# -*- coding: utf-8 -*-
import os
from setuptools import find_packages
from setuptools import setup
base_dir = os.path.dirname(__file__)
setup(
name='elastalert',
version='0.0.77',
description='Runs custom filters on Elasticsearch and alerts on matches',
author='Quentin Long',
author_email='<EMAI... |
import os
import sys
import pkgutil
def LoadFolder(inputFolderPath):
infilePathList=[]
for root, dirs, files in os.walk(inputFolderPath):
for file in files:
infilePathList.append(inputFolderPath+file)
return infilePathList
def Loader(mainPath0):
flag=0
mainEntryPath=mainPa... |
""" Scans
"""
ID = 'id'
DATE = 'date'
LINE = 'line'
DIR = 'dir'
GEOM = 'geom'
USER_ID = 'user_id'
STOP = 'stop'
""" Pairs - Scans
"""
#ID = 'id'
ON_ID = 'on_id'
OFF_ID = 'off_id'
""" Pairs - Stops
"""
#ID = 'id'
#DATE = 'date'
#LINE = 'line'
#DIR = 'dir'
ON_STOP = 'on_stop'
OFF_STOP = 'off_stop'
#USER_ID = 'user_id'
... |
# -*- coding: utf-8 -*-
import re, random, math, textwrap, codecs
from collections import defaultdict, deque, Counter
import codecs, collections, sys, unicodedata, string, numpy as np, pylab as pl
import sys
import pickle
with open('lets_7.pickle','rb') as f:
let60, let65, let70, let75, let80, let85, l... |
from datetime import datetime, time
from django.core.exceptions import ValidationError
from django.db import models
from django.utils.functional import cached_property
from django.utils.translation import ugettext_lazy as _
from pagoeta.apps.core.models import Image as AbstractImage
from pagoeta.apps.places.models imp... |
"""a simple LRU (Least-Recently-Used) cache module
This module provides very simple LRU (Least-Recently-Used) cache
functionality.
An *in-memory cache* is useful for storing the results of an
'expensive' process (one that takes a lot of time or resources) for
later re-use. Typical examples are accessing data from the... |
from __future__ import (unicode_literals, division, absolute_import,
print_function)
__license__ = 'GPL v3'
__copyright__ = '2015, dloraine'
__docformat__ = 'restructuredtext en'
from functools import partial
from calibre.utils.zipfile import ZipFile, safe_replace
from calibre.ptempfile impo... |
"""Compressed sensing main script"""
# pylint: disable=C0301,C0103,C0111
from __future__ import division
import os
from argparse import ArgumentParser
import numpy as np
import utils
def main(hparams):
# Set up some stuff accoring to hparams
hparams.n_input = np.prod(hparams.image_shape)
utils.set_num_m... |
# -*- coding: utf-8 -*-
#
# Test links:
# http://speedy.sh/ep2qY/Zapp-Brannigan.jpg
import re
from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
class SpeedyshareCom(SimpleHoster):
__name__ = "SpeedyshareCom"
__type__ = "hoster"
__version__ = "0.07"
__status__ = "te... |
# coding=utf-8
import copy
import os
from mycodo.inputs.base_input import AbstractInput
# Measurements
measurements_dict = {
0: {
'measurement': 'cpu_load_1m',
'unit': 'cpu_load'
},
1: {
'measurement': 'cpu_load_5m',
'unit': 'cpu_load'
},
2: {
'measurement':... |
# -*- coding: utf-8 -*-
#= IMPORT ======================================================================
from src.enums import TO
from src.room import Destination
#= FUNZIONI ====================================================================
def after_look(entity, target, descr, detail, use_examine, behavioure... |
__version__ = '$Id: 20_context.py 422 2013-08-21 04:30:47Z <EMAIL> $'
__author__ = 'Gummbum, (c) 2011-2013'
__doc__ = """20_context.py - Linking contexts in Gummworld2.
This demo has two contexts, a main menu and a game. Contexts are placed on a
stack. Thus, they can be stacked and then unstacked in layered fashion,... |
import base64
try:
from cStringIO import StringIO
except ImportError:
from io import BytesIO as StringIO
from six import text_type, PY3, PY2
from ems.qt import QtCore, QtGui, QtWidgets
from ems.qt.graphics.tool import GraphicsTool, ToolAction
from ems.qt.richtext.inline_edit_graphicsitem import TextItem
from e... |
import time
from threading import Thread
""" Threading extensions that are used by continuous update processes """
class PollingThread(Thread):
""" Thread extension used to execute a callback function with a given delay after each loop """
def __init__(self, delayTime=0, group=None, target=None, completeCallba... |
from collections import OrderedDict
import random
from PyCIP.DataTypesModule.DataParsers import *
from PyCIP.DataTypesModule.DataTypes import *
from PyCIP.DataTypesModule.EPATH import LogicalSegment
class ConnectionManager():
def __init__(self, transport, **kwargs):
self.trans = transport
#vol 1 ... |
from time import time
from discord import Embed, File
from discord.ext import commands
from discord.ext.commands import Context
from wowspy import Region
import world_of_warships.war_gaming as wg
from bot import Yasen
from data_manager.data_utils import get_prefix
from world_of_warships.shell_handler import ConvertRe... |
import numpy
import freeimage
from . import ffmpeg
from . import colorize
from . import pyramid
def write_movie(image_generator, output_file, framerate=15):
"""Write a movie from images.
NB: This works when you have a set of pre-existing images (either in memory
or on disk). If you want/need to stream i... |
"""
XML data access classes for postqe.
"""
from collections import MutableMapping
import numpy as np
import xmlschema
class XMLData(MutableMapping):
"""
Dictionary-like class for mapping data from an XML file.
"""
def __init__(self, xmlfile=None, schema=None):
if xmlfile is not None:
... |
"""empty message
Revision ID: 751f83a991e6
Revises:
Create Date: 2017-01-31 01:11:39.503707
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '751f83a991e6'
down_revision = None
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto gene... |
# media.py
class Movie(object):
""" Movie class for creating a movie."""
def __init__(self,
title,
storyline,
poster_image_url,
trailer_youtube_url,
lead_actors,
release_date,
mpaa_rating,
... |
from twisted.trial import unittest
from sydent.http.auth import tokenFromRequest
from tests.utils import make_request, make_sydent
class AuthTestCase(unittest.TestCase):
"""Tests Sydent's auth code"""
def setUp(self):
# Create a new sydent
self.sydent = make_sydent()
self.test_token ... |
from better_choices import Choices
class ChoicesMetaMeta(type):
PROXIED_METHODS = ['__len__', '__iter__', '__getattr__', '__getitem__', '__eq__', '__contains__']
def __new__(cls, name, bases, dct):
"""
This method will take care of building/assembling ChoicesMeta.
We want to ... |
from __future__ import absolute_import
import tempfile
from bokeh.session import TestSession
from . import test_utils
from ..app import bokeh_app, app
from ..models import user
class TestMultiUserAuth(test_utils.FlaskClientTestCase):
options = {'multi_user' : True}
def test_register(self):
sess = Te... |
from . import base
from .file_system import FileSystem
from ..exceptions import NonUniqueTask
def get_or_create(task, candidate_list, creates_or_depends):
"""This is a factory function that instantiates resources from a
candidate_list.
"""
resources = []
for candidate in candidate_list:
if... |
#!/usr/bin/env python3
'''
t1_serialization.py - this file is part of S3QL (http://s3ql.googlecode.com)
Copyright © 2014 Nikolaus Rath <<EMAIL>>
This program can be distributed under the terms of the GNU GPLv3.
'''
if __name__ == '__main__':
import pytest
import sys
sys.exit(pytest.main([__file__] + sys.... |
from __future__ import absolute_import
from __future__ import print_function
import json
import logging
import requests
from .base import Provider as BaseProvider
logger = logging.getLogger(__name__)
def ProviderParser(subparser):
subparser.add_argument("--auth-token", help="specify API key used to authentica... |
from googler.utils import compat
from googler.utils.http import get_user_agent
import requests
# Base URL for the reCAPTCHA API
API_URL = 'www.google.com/recaptcha/api'
# HTML code for displaying the reCAPTCHA
DISPLAY_HTML = '''
<script type="text/javascript" src="%(api_url)s/challenge?k=%(public_key)s%(error_param)... |
"""REANA client output related commands."""
import json
import logging
import os
import sys
import traceback
import click
from reana_commons.utils import click_table_printer
from reana_client.api.utils import get_path_from_operation_id
from reana_client.cli.utils import (
add_access_token_options,
add_pagina... |
#!/usr/bin/env python3
import numpy as np
import pandas as pd
import argparse, sys, pickle
from sklearn.cross_decomposition import PLSRegression
from sklearn.linear_model import *
from sklearn.model_selection import KFold
from sklearn.metrics import *
from sklearn.svm import SVC
from sklearn.ensemble import RandomFore... |
"""Client for strava.
See README.md for instructions.
"""
import csv
from stravalib import client as client_mod
import sys
FIELD_NAMES = ('start_date', 'pr_rank', 'name', 'distance', 'elapsed_time', 'id')
def rank():
input_filename = sys.argv[2]
output_filename = sys.argv[3]
efforts_by_distance = {}
effor... |
"""Notebook class
This class create a Gtk.Notebook() widget supporting
a close button in every tab when the 'can-close-tabs' gproperty
is enabled (True)
STABLE.
"""
from gi.repository import Gtk
from gi.repository import GObject
class Notebook(Gtk.Notebook):
__gtype_name__ = 'SugarNotebook'
__gproperties... |
#!/usr/bin/env python
#This is the command line entry to the scoot daemon.
#This code uses docopt to parse the command line. docopt uses the __doc__ string below
#for both parsing the command line into a dict and for displaying help.
"""
Usage:
scoot.py snapshot create <srcDir>
scoot.py snapshot checkout <snapsh... |
# -*- coding: utf-8 -*-
"""
***************************************************************************
doFillNodata.py
---------------------
Date : November 2011
Copyright : (C) 2011 by Alexander Bruy
Email : alexander dot bruy at gmail dot com
***********... |
import argparse
import itertools
import sys
import urlparse
import xmlrpclib
import html5lib
import requests
from pkg_resources import safe_name
from pip.req import parse_requirements
from setuptools.package_index import distros_for_url
def installable(project, url):
normalized = safe_name(project).lower()
... |
#!/usr/bin/env python
r"""
Create a Kodi add-on repository from add-on sources
This tool extracts Kodi add-ons from their respective locations and
copies the appropriate files into a Kodi add-on repository. Each add-on
is placed in its own directory. Each contains the add-on metadata files
and a zip archive. In additi... |
import serial
#
#---------------------------
# Maestro Servo Controller
#---------------------------
#
# Support for the Pololu Maestro line of servo controllers
#
# Steven Jacobs -- Aug 2013
# https://github.com/FRC4564/Maestro/
#
# These functions provide access to many of the Maestro's capabilities using ... |
from __future__ import unicode_literals
import base64
import struct
import zlib
from Crypto.Cipher import ARC4
from Crypto.Hash import MD5
class BaseStantinkoDecryptor(object):
def __init__(self):
self.time = None
self.name = None
self.payload = None
self.errors = []
def _de... |
#!/usr/bin/env python
import sys
import rospkg
import numpy as np
PROJECT_PATH = rospkg.RosPack().get_path('grasper_plan')
sys.path.append(PROJECT_PATH+'/src')
import obj_file
import transformations
MESH_FILENAME = PROJECT_PATH+'/data/obj/pawn_lowpoly.obj'
FC_DATA_FILENAME = PROJECT_PATH+'/data/fc/pawn_points.csv'
GR... |
from O365.attachment import Attachment
from O365.contact import Contact
from O365.group import Group
import logging
import json
import requests
log = logging.getLogger(__name__)
class Message(object):
'''
Management of the process of sending, recieving, reading, and editing emails.
Note: the get and set... |
"""
Copyright (c) 2012-2021 (https://github.com/clippercard/clippercard-python)
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use,... |
# -*- coding: utf-8 -*-
__author__ = 'IVMIT KFU: Gataullin Ravil & Veselovkiy Sergei'
import cv2
import math
import numpy as np
from CFiles.CHelper import CHelper
import StringIO
def substractPoint(point1, point2):
return (point2[0] - point1[0], point2[1] - point1[1])
def median(A): # A cheat to find the medi... |
import superdesk
from liveblog.validator import LiveblogValidator
from superdesk import get_backend, get_resource_service
from superdesk.resource import Resource
from superdesk.services import BaseService
_preferences_key = 'global_preferences'
def init_app(app):
endpoint_name = _preferences_key
service = Gl... |
import json
import requests
from rest_framework import status
from rest_framework.response import Response
from rest_framework.views import APIView
import olympia.core.logger
from olympia.files.models import FileUpload
from olympia.github.tasks import process_webhook
from olympia.github.utils import GithubRequest, Gi... |
import json
import queue
import random
from typing import List, Any, Dict, Tuple, Set, TYPE_CHECKING
from mephisto.operations.logger_core import get_logger
from mephisto.abstractions.blueprint import SharedTaskState, TaskRunner
from omegaconf import DictConfig
if TYPE_CHECKING:
from mephisto.data_model.task impor... |
from datetime import datetime
from app.models import db
TICKET = 'ticket'
EVENT = 'event'
class DiscountCode(db.Model):
__tablename__ = "discount_codes"
id = db.Column(db.Integer, primary_key=True)
code = db.Column(db.String)
discount_url = db.Column(db.String)
value = db.Column(db.Float)
t... |
#!/usr/bin/env python
#
# Participants Editor - DEI-FCTUC IHC 2011
#
# Developers:
# - Renato Rodrigues
# - Rui Molar
#
from models import *
from datetime import datetime
from google.appengine.ext import webapp
from google.appengine.ext.webapp import template
#mainURL="http://participantseditor.appspot.com/"
mainURL... |
from decorator import decorator
from flask import g, url_for, request, session, redirect
from rallycaster import oauth
from rallycaster.api import api
from rallycaster.api.errors import AuthException
from rallycaster.users import users
SESSION_OAUTH_TYPE = 'oauth_type'
SESSION_OAUTH_TOKEN = 'oauth_token'
... |
"""
Email related settings
"""
from askbot.conf.settings_wrapper import settings
from askbot.conf.super_groups import LOGIN_USERS_COMMUNICATION
from askbot.deps import livesettings
from askbot import const
from django.utils.translation import ugettext_lazy as _
from django.conf import settings as django_settings
EMAIL... |
"""
Module to provide a callable interface to a Digi PortServer terminal server.
"""
import sys, os, string
import telnetlib
from socket import error
class DigiPort(object):
"""
Instances of this class represent an active connection to DigiPort terminal server.
DigiPort(devicename, password=None, timeout=20)
S... |
"""Emit commands needed for Mantaray during OTA installation
(installing the bootloader)."""
import common
def FullOTA_InstallEnd(info):
try:
bootloader_img = info.input_zip.read("RADIO/bootloader.img")
except KeyError:
print "no bootloader.img in target_files; skipping install"
else:
WriteBootloade... |
from langgen.langgen import *
import unittest
class Testlanggen(unittest.TestCase):
def test_with_one_syllable(self):
examples = ['na','nana','nanana','nanana']
for i in range(1,11):
for seed in xrange(10):
language = Language.language_from_samples(examples,frac_2s=i/1... |
# from __future__ import absolute_import
# from __future__ import division
# from __future__ import unicode_literals
# '''
# Creates a SAL transition system: DFT
# '''
# #TODO: rename to saltrans_dft.py
# #import sympy as sm
# import textwrap as tw
# from math import isinf
# from bmc.helpers.expr2str import Expr2Str... |
from __future__ import print_function
from bcc import BPF
from time import sleep, strftime
from socket import inet_ntop, AF_INET
import socket, struct
import argparse
import ctypes
# arguments
examples = """examples:
./tcprtt # summarize TCP RTT
./tcprtt -i 1 -d 10 # print 1 second summaries, 10 tim... |
"""
Module for reporting into http://www.blazemeter.com/ service
Copyright 2015 BlazeMeter Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unles... |
"""Filtering PeerList items by various values"""
from .. import rdns
from ..ttypes import TorrentPeer
from .base import BoolFilterSpec, CmpFilterSpec, Filter, FilterChain, FilterSpecDict
def _cmp_host_or_ip(p, op, v):
hostname = rdns.gethostbyaddr_from_cache(p['ip'])
if hostname is None:
return op(p[... |
#!/usr/bin/python3
"""
DESCRIPTION
Simple python script to import a csv into ElasticSearch. It can also update existing Elastic data if
only parameter --id-column is provided
HOW IT WORKS
The script creates an ElasticSearch API PUT request for
each row in your CSV. It is similar to running an bulk ins... |
# apis_v1/documentation_source/voter_guides_ignored_retrieve_doc.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
def voter_guides_ignored_retrieve_doc_template_values(url_root):
"""
Show documentation about voterGuidesIgnoredRetrieve
"""
required_query_parameter_list = [
{
... |
#!/usr/bin/env python
import datetime
import os
import sys
from distutils import dir_util
import numpy as np
from pytest import fixture
myPath = os.path.dirname(os.path.abspath(__file__))
sys.path.insert(0, myPath + '/../')
from kafka.utils import iterate_time_grid
def test_iterate_time_grid():
base_date = d... |
from __future__ import division
import atexit
import logging
import subprocess
import sys
import time
import Adafruit_BBIO.GPIO as GPIO
## In-house libraries and modules.
from Drive.Drive import Drive as Drive
from Hardware import *
from Sensors import *
from Navigate.Path.Path import Path
import demos
## Logging.
lo... |
"""Takes a Python AST and converts it to a corresponding StencilModel.
Throws an exception if the input does not represent a valid stencil
kernel program. This is the first stage of processing and is done only
once when a stencil class is initialized.
"""
from stencil_model import *
from assert_utils import *
import ... |
import pytest
pytest.importorskip("pygbm")
import os
import numpy as np
import pygbm as lgb
import vaex.ml.incubator.pygbm
import vaex.ml.datasets
from vaex.utils import _ensure_strings_from_expressions
import test_utils
# the parameters of the model
param = {'learning_rate': 0.1, # learning rate
'max_d... |
import ConfigParser
import functools
import os
import lockfile
import sqlalchemy
import sqlalchemy.exc
from mistral.openstack.common.gettextutils import _
from mistral.openstack.common import log as logging
from mistral.openstack.common import processutils
from mistral.openstack.common.py3kcompat import urlutils
from... |
from Screen import Screen
from Components.ActionMap import ActionMap
from Components.Sources.StaticText import StaticText
from Components.Harddisk import harddiskmanager
from Components.NimManager import nimmanager
from Components.About import about
import os
from Tools.DreamboxHardware import getFPVersion
class Abou... |
import unittest
import sys
from hexdumper import hexdumper
if __name__ == '__main__':
if "-l" in sys.argv:
sys.path.insert(0, "../") # Look locally first
sys.argv.remove("-l") # Needed because unittest has issues
# with extra arguments.
from pcs import PcapConnec... |
"""
Base classes for writing management commands (named commands which can
be executed through ``django-admin.py`` or ``manage.py``).
"""
import os
import sys
from optparse import make_option, OptionParser
import django
from django.core.exceptions import ImproperlyConfigured
from django.core.management.color import ... |
import threading
class ViewModelBase(object):
def __init__(self, view, change_view_model):
self._view = view
self._change_view_model = change_view_model
def set_enabled(self, enabled):
self._view.set_enabled(enabled)
def _update_display(self, info='', left_option='', right_option... |
import logging
import shutil
import tempfile
from urllib.parse import urlparse
from os.path import isdir, isfile, join
from mkdocs.commands.build import build
from mkdocs.config import load_config
from mkdocs.exceptions import Abort
from mkdocs.livereload import LiveReloadServer
log = logging.getLogger(__name__)
de... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import socket
import httplib
import urllib
import Queue
from common import *
from threading import Thread
socket.setdefaulttimeout(5)
log = logging.getLogger(__name__)
headers = {
'User-Agent':'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/53... |
from pycparser import c_generator, c_ast
class AbstractCGenerator(c_generator.CGenerator):
def visit_Constant(self, n):
return "CONST"
def visit_ID(self, n):
return "ID"
def visit_ArrayRef(self, n):
arrref = "ARR"
return arrref + '[' + self.visit(n.subscript) + ']'
d... |
''' MacroBug python Module, managing commands and events.'''
import neovim
class State(object):
''' Represents a state for cursor root positions and change root '''
def __init__(self, change_root, cursor_root):
self.change_root = change_root
self.cursor_root = cursor_root
class StateStack(obj... |
from __future__ import print_function
import sys
from troposphere import Template, Ref, Output, Parameter, Join, GetAtt, FindInMap
from troposphere.route53 import RecordSetType, RecordSet, RecordSetGroup, AliasTarget
from troposphere.s3 import Bucket, PublicRead, BucketOwnerFullControl, WebsiteConfiguration, RedirectA... |
import os, sys
import numpy as np
import flopy
import platform
import pyemu
# https://modflowpy.github.io/flopydoc/tutorial2.html
bin_folder = r"..\..\bin"
def model_setup():
# Model domain and grid definition
Lx = 1000.
Ly = 1000.
ztop = 10.
zbot = -50.
nlay = 1
nrow = 10
ncol = 10
... |
"""SCons.Tool.ifl
Tool-specific initialization for the Intel Fortran compiler.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# Copyright (c) 2001 - 2015 The SCons Foundation
#
# Permission is hereby gran... |
""" Starting from the PDP object, it makes the full chain of policies
It requires
ResourceStatus
{
Policies
{
AlwaysActiveForResource
{
matchParams
{
element = Resource
}
policyType = AlwaysActive
}
AlwaysBanne... |
'''
Created on 27 Nov 2013
@author: Ioannis
'''
'''
Models an Interruption that handles the operating of a Station by an ObjectResource
'''
# from SimPy.Simulation import Process, Resource, SimEvent
import simpy
from ObjectInterruption import ObjectInterruption
# from SimPy.Simulation import waituntil, now, hold, req... |
# coding=utf-8
"""A Norbits (https://norbits.net) provider"""
# URL: https://sick-rage.github.io
#
# This file is part of SickRage.
#
# SickRage 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 ... |
from __future__ import division
import itertools
import numpy as np
import chainer
from chainer.backends import cuda
import chainer.functions as F
from chainer.links import Convolution2D
from chainercv.links import Conv2DBNActiv
from chainercv import utils
from chainercv.links.model.yolo.yolo_base import YOLOBase
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.