text stringlengths 12 6.59M |
|---|
###########################################################################
#
# 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
#
# https://www.apache.org/... |
# Copyright 2015 Ericsson AB
#
# 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 writing,... |
def name_time_series(result):
'''
Name the retrieved time series based on the full name of the time series (including variable and location)
'''
return result.get('TimeSeriesName', result.get('Name', '%s/%s/%s' % (result['NetworkElement'], result['RecordingElement'], result['RecordingVariable'])))
... |
#!/usr/bin/env python
import rospy
from strands_executive_msgs.msg import Task, TaskEvent
import mongodb_store.util as dc_util
import actionlib
from actionlib_msgs.msg import GoalStatus
from geometry_msgs.msg import Pose, Point, Quaternion
from mongodb_store.message_store import MessageStoreProxy
from strands_execu... |
# pylint: disable=W0231,E1101
import collections
import warnings
import operator
import weakref
import gc
import numpy as np
import pandas.lib as lib
import pandas as pd
from pandas.types.common import (_coerce_to_dtype,
_ensure_int64,
needs_i8_conve... |
import numpy as np
import time
import cv2
class Analyzer():
def __init__(self):
self.avg_bpm = self.cnt = self.fps = self.bpm = 0
self.index = 1
self.incoming_frame = self.outgoing_frame = np.zeros((10, 10))
self.face = False
self.find = True
self.buffer_size = 250
self.buffer_data = self.times = self.... |
"""Test AdsSymbol class.
:author: Stefan Lehmann <stlm@posteo.de>
:license: MIT, see license file or https://opensource.org/licenses/MIT
:created on: 2020-11-16
"""
import time
import struct
from ctypes import sizeof, pointer
import unittest
import pyads
from pyads.testserver import AdsTestServer, AdvancedHandler, P... |
from UM.Qt.ListModel import ListModel
from PyQt5.QtCore import pyqtProperty, Qt, pyqtSignal, pyqtSlot, QUrl
from PyQt5.QtWidgets import QMessageBox
from UM.Application import Application
from UM.Logger import Logger
from UM.Message import Message
from UM.Platform import Platform
from UM.PluginRegistry import PluginRe... |
import os
import os.path
import sys
sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), os.pardir))
from pyrouge import Rouge155
from textrank.textrank import textrank
ROUGE_PATH = os.path.join(os.getcwd(), 'ROUGE-RELEASE-1.5.5')
Rouge155(ROUGE_PATH)
with open('datasets/cmplg/001/text.txt') as ... |
import os
import sys
import shutil
import random
import string
import getpass
from . import custom_settings
import config
# Development Mode
DEBUG = custom_settings.DEV_MODE
DESKTOP_MODE = custom_settings.DESKTOP_MODE
BASE_DIR = custom_settings.BASE_DIR
HOME_DIR = custom_settings.HOME_DIR
SESSION_COOKIE_SECURE = custo... |
# -*- coding: utf-8 -*-
import difflib
import httplib as http
import logging
from bs4 import BeautifulSoup
from flask import request
from framework.mongo.utils import from_mongo, to_mongo_key
from framework.exceptions import HTTPError
from framework.auth.utils import privacy_info_handle
from website.project.views.n... |
# -*- coding: utf-8 -*-
#Copyright (c) 2010, Walter Bender
#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, copy, modify, me... |
import pprint
__author__ = 'Volodymyr Varchuk'
__email__ = "vladimir.varchuk@rackspace.com"
from d_utils import *
DELETE_TMPL = 'DELETE FROM {table} WHERE {condition};'
UPDATE_TMPL = 'UPDATE {table} SET {statement} WHERE {condition};'
# UPDATE_TMPL2 = 'UPDATE %s SET %s WHERE (root_id="%s") and (idx=%s);'
# {"templ... |
import configparser
import logging
import os
from datetime import datetime, timedelta
import click
from scrapy.crawler import CrawlerProcess
from scrapy.utils.log import configure_logging
from scrapy.utils.project import data_path, get_project_settings
from twisted.python import failure
from feeds.cache import cleanu... |
#!/usr/bin/env python
#
# meza command
#
import sys, getopt, os
def load_yaml ( filepath ):
import yaml
with open(filepath, 'r') as stream:
try:
return yaml.load(stream)
except yaml.YAMLError as exc:
print(exc)
defaults = load_yaml( "/opt/meza/config/core/defaults.yml" )
# Hard-coded for now, because ... |
# Copyright 2012 OpenStack Foundation
# 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 requ... |
import httplib2
import json
from pprint import pprint
from auth import reauth, need_to_reauth
import devices
class Wink(object):
"""Main object for making API calls to the Wink cloud servers.
Constructor requires a persistence object,
e.g. persist.ConfigFile.
"populate_devices" reads the device lis... |
#!/usr/bin/env python
## \file parallel_regression.py
# \brief Python script for automated regression testing of SU2 examples
# \author Aniket C. Aranake, Alejandro Campos, Thomas D. Economon, Trent Lukaczyk
# \version 3.2
#
# Stanford University Unstructured (SU2) Code
# Copyright (C) 2012-2014 Aerospace Design L... |
#!/usr/bin/env python
"""Tests for Tablib."""
import datetime
import doctest
import json
import pickle
import unittest
from uuid import uuid4
from MarkupPy import markup
import tablib
from tablib.core import Row, detect_format
from tablib.formats import _csv as csv_module
class BaseTestCase(unittest.TestCase):
... |
# Copyright (c) 2016 Ultimaker B.V.
# Uranium is released under the terms of the AGPLv3 or higher.
import collections
from PyQt5.QtCore import Qt, QAbstractListModel, QVariant, QModelIndex, pyqtProperty, pyqtSignal, pyqtSlot
from UM.Logger import Logger
from UM.Preferences import Preferences
import UM.Settings
## ... |
# Copyright (C) Frederick Dean 2009, All rights reserved
"""
Unit tests for L{OpenSSL.rand}.
"""
from unittest import main
import os
import stat
from OpenSSL.test.util import TestCase
from OpenSSL import rand
class RandTests(TestCase):
def test_bytes_wrong_args(self):
"""
L{OpenSSL.rand.bytes} ... |
# -*- coding: utf-8 -*-
"""STEREO LightCurve sources subclass definitions"""
from __future__ import absolute_import
__authors__ = ["Ankit Kumar"]
__email__ = "ankitkmr.iitk@gmail.com"
# This module was developed with funding from
# Google Summer of Code 2015
from datetime import timedelta,datetime
import pandas ... |
# Copyright (c) 2016 Ultimaker B.V.
# Uranium is released under the terms of the AGPLv3 or higher.
from enum import Enum
from UM.Logger import Logger
class ValidatorState(Enum):
Exception = "Exception"
Unknown = "Unknown"
Valid = "Valid"
MinimumError = "MinimumError"
MinimumWarning = "MinimumWarn... |
import traceback
from PLC.Method import Method
from PLC.Auth import Auth
from PLC.Faults import *
from PLC.Parameter import *
from PLC.Nodes import Node, Nodes
from PLC.Accessors.Accessors_standard import * # import node accessors
class GetNodeFlavour(Method):
"""
Returns detailed informatio... |
# Copyright 2012 OpenStack Foundation
# 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 requ... |
#!/usr/bin/env python
import argparse
import yaml
import os
import os.path
import guessit
import re
import logging
import sys
from titlecase import titlecase
import transmissionrpc
import shutil
import subprocess
import copy
import sqlite3
default_config = os.path.join(os.getenv("HOME"), '.organize', 'config.yml')
de... |
from __future__ import division
import stft
import scipy
import numpy
import pytest
@pytest.fixture(params=[1, 2, 4])
def channels(request):
return request.param
@pytest.fixture(params=[0, 1, 4])
def padding(request):
return request.param
@pytest.fixture(params=[2, 4, 5])
def length(request):
return r... |
# Universal Subtitles, universalsubtitles.org
#
# Copyright (C) 2011 Participatory Culture Foundation
#
# 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 version 3 of the
# License, ... |
from base64 import standard_b64decode
from flask import Blueprint, request, url_for
from ipynbsrv.contract.backends import *
from ipynbsrv.contract.errors import *
from ipynbsrv.hostapi import config
from ipynbsrv.hostapi.http.responses import *
"""
Flask blueprint collecting the /containers routes.
"""
blueprint = B... |
#views.py
"""
views.py
provides the endpoints for this particular blueprint.
"""
import datetime
import os
from flask import jsonify, request
from flask_wtf import Form
from wtforms import StringField
from wtforms.validators import DataRequired
from werkzeug import secure_filename
from superphy.shared import sparql
f... |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 OpenStack, LLC
# 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/... |
#!/usr/bin/env python
# ###################################################################
#
# Disclaimer and Notice of Copyright
# ==================================
#
# Copyright (c) 2015, Los Alamos National Security, LLC
# All rights reserved.
#
# Copyright 2015. Los Alamos National Security, LLC.
# Thi... |
# -*- coding: utf-8 -*-
"""
Tests for the uflash module.
"""
import ctypes
import os
import os.path
import sys
import tempfile
import time
import threading
import pytest
import uflash
try:
from unittest import mock
except ImportError:
import mock
else:
# mock_open can't read binary data in < 3.4.3
# h... |
from django.conf import settings
import jsonschema
from django.db import transaction
from django.utils.text import slugify
from rest_framework.decorators import (
api_view,
permission_classes,
)
from rest_framework.permissions import IsAuthenticated
from rest_framework.response import Response
from rest_framework.... |
# -*- coding: utf-8 -*-
import datetime
import re
from django import forms
from django.utils.translation import ugettext as _
from apps.userprofile.models import UserProfile
class UserProfileForm(forms.ModelForm):
class Meta:
model = UserProfile
fields = ('nick', 'date_of_birth', 'address', 'zi... |
#!/usr/bin/env python3
# -*- coding: ascii -*-
# An init script for running Instant and a number of bots.
import sys, os, re, time, inspect
import string, uuid
import errno, signal, socket
import shlex
import logging
import subprocess
import argparse
import coroutines
try: # Py3K
from configparser import Config... |
from copy import deepcopy
import gzip
import hashlib
import json
import logging
import re
import StringIO as sio
from model.graph import Attr_Diff
from model.graph import Topo_Diff
from model.model import Link, RZDoc
from neo4j_cypher import DB_Query, DB_result_set
import neo4j_schema
from neo4j_util import cfmt
from ... |
from flask import Blueprint, request, url_for
from ipynbsrv.contract.backends import *
from ipynbsrv.contract.errors import *
from ipynbsrv.hostapi import config
from ipynbsrv.hostapi.http.responses import *
"""
Flask blueprint collecting the /containers routes.
"""
blueprint = Blueprint('containers', __name__, url_p... |
'''
--------------------------------------------------------
Authors:
- Brin Rosenthal (sbrosenthal@ucsd.edu)
- Aaron Gary (agary@ucsd.edu)
- Mikayla Webster (m1webste@ucsd.edu)
--------------------------------------------------------
'''
# import some packages
from __future__ import print_function
from... |
# Copyright (C) 2011 O. Can Bascil <ocanbascil at gmail com>
"""
PerformanceEngine
v1.0
https://github.com/ocanbascil/Performance-AppEngine
==============================
PerformanceEngine is a simple wrapper module that enables layered
data model storage and cached queries in Google Application Engine.
I... |
#!/usr/bin/env python
import sys
import os
import pysam
import gzip
from argparse import ArgumentParser
from collections import defaultdict
def consensus_caller(input_reads, cutoff, tag, length_check):
nuc_identity_list = [0, 0, 0, 0, 0, 0] # In the order of T, C, G, A, N, Total
nuc_key_dict = {0: 'T', 1: 'C', 2... |
import traceback
import sys
from django.conf import settings
from django.utils import translation
import logging
logger = logging.getLogger(__name__)
class ExceptionLoggingMiddleware(object):
def process_exception(self, request, exception):
logger.error('\n'.join(traceback.format_exception(*sys.exc_inf... |
#!/usr/bin/env python3
# -*- coding: ascii -*-
"""
An init script for running Instant and a number of bots.
"""
import sys, os, re, time, operator, inspect
import string, uuid
import errno, signal, socket
import shlex
import logging
import subprocess
import argparse
import coroutines
try: # Py3K
from configpars... |
from argparse import Namespace
from types import SimpleNamespace
from database_testing import DatabaseTest
from flask import current_app
import manage
from database import db
from models import User, Gene, Cancer, Page
from miscellaneous import make_named_temp_file, use_fixture
class ManageTest(DatabaseTest):
... |
# -*- coding: utf-8 -*-
# Copyright (c) 2015, Vispy Development Team.
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
"""
Graph Visual
============
This visual can be used to visualise graphs or networks.
"""
from ..visual import CompoundVisual
from ..line import ArrowVisual
from ..markers i... |
"""Colorize an object to show heatmaps, false color images, etc.
"""
from OpenGL.raw.GL.VERSION.GL_1_1 import GL_NONE
from ..robotsim import *
from ..math import vectorops
try:
import numpy as np
except Exception:
HAVE_NUMPY = False
def colorize(object,value,colormap=None,feature=None,vrange=None,lighting=No... |
##
# Copyright (C) 2013-2015 Jessica Tallon & Matt Molyneaux
#
# This file is part of Inboxen.
#
# Inboxen 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 version 3 of the License,... |
# Python script that downloads data from the UCDavis SFTP server
# SFTP credentials are retrieved from the environment.
# The script will process all directories under a given root,
# and skip files that have already been downloaded.
# Usage examples:
# - python ucdavis_sftp_download.py /labcas-data/UCDavis/
# - pyth... |
"""
Filename: plot_hilbert.py
Author: Damien Irving, d.irving@student.unimelb.edu.au
Description: Plot the components of a Hilbert transform
"""
# Import general Python modules
import sys, os, pdb
import argparse
import numpy
import matplotlib.pyplot as plt
import xray
import seaborn
seaborn.set_context(... |
# -*- python -*-
# stdlib imports ---
import os
import os.path as osp
# waf imports ---
import waflib.Utils
import waflib.Logs as msg
import waflib.Configure
import waflib.Build
import waflib.Task
import waflib.Tools.ccroot
from waflib.Configure import conf
from waflib.TaskGen import feature, before_method, after_met... |
"""Tests for aiohttp/worker.py"""
import asyncio
import sys
from unittest import mock
import pytest
from aiohttp import helpers
base_worker = pytest.importorskip('aiohttp.worker')
try:
import uvloop
except ImportError:
uvloop = None
class BaseTestWorker:
def __init__(self):
self.servers = []
... |
"""Kraken - builders module.
Classes:
Builder -- Base builder object to build objects in DCC.
"""
from collections import deque
from kraken.core.kraken_system import KrakenSystem
from kraken.core.configs.config import Config
from kraken.core.profiler import Profiler
from kraken.core.objects.scene_item import Scene... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import gdb
import gdb.printing
import uuid
import argparse
import re
from operator import attrgetter
from collections import defaultdict
import sys
import struct
import random
import bisect
def template_arguments(gdb_type):
n = 0
while True:
try:
... |
import os, sys
sys.path.append(os.getcwd())
import time
import functools
import numpy as np
import tensorflow as tf
import sklearn.datasets
import tflib as lib
import tflib.ops.linear
import tflib.ops.conv2d
import tflib.ops.batchnorm
import tflib.ops.deconv2d
import tflib.save_images
import tflib.small_imagenet
imp... |
# -*- coding: utf-8 -*-
"""
flask.app
~~~~~~~~~
This module implements the central WSGI application object.
:copyright: (c) 2015 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import os
import sys
from threading import Lock
from datetime import timedelta
from itertools import ... |
import sys
import unittest
import requests
from yubico_client import yubico
from yubico_client.otp import OTP
from yubico_client.py3 import PY3
from yubico_client.yubico_exceptions import StatusCodeError
from yubico_client.yubico_exceptions import InvalidClientIdError
from yubico_client.yubico_exceptions import Signa... |
'''
Created on 2016/5/30
:author: hubo
'''
from vlcp.config.config import defaultconfig
from vlcp.server.module import depend, publicapi, callAPI
from vlcp.service.sdn.flowbase import FlowBase
from vlcp.service.sdn.ofpmanager import FlowInitialize
from vlcp.utils.flowupdater import FlowUpdater
from vlcp.utils.networ... |
#!/usr/bin/env python3
from autobahn.asyncio.websocket \
import WebSocketServerProtocol, WebSocketServerFactory
import logging as lg
import asyncio
import json
import random
import time
import os
import sys
lg.basicConfig(stream = sys.stdout , level = lg.DEBUG)
PROCESSORS_SERVER_IP = '0.0.0.0'
PROCESSORS_SERVER_PO... |
import math
import random as rand
import itertools as it
from collections import namedtuple
from copy import copy
from copy import deepcopy
import numpy as np
import networkx as nx
from wepy.resampling.resamplers.resampler import Resampler
from wepy.resampling.decisions.clone_merge import MultiCloneMergeDecision
c... |
"""drafting and designing a manager for python written modules.
the current plan is that there'll be a Manager that the PythonScriptModule
instanciates, and which then loads the python modules that are to be autoloaded,
and handles their event registrations, passing incoming events to them etc.
that will be prototy... |
"""Simple Graph Data Structure."""
class SimpleGraph(object):
"""A simple graph class.
.nodes(): return a list of all nodes in the graph
.edges(): return a list of all edges in the graph
.add_node(n): adds a new node ‘n’ to the graph
.add_edge(n1, n2): adds a new edge to the graph connecting ‘n1’... |
from flask import Flask
from flask_caching import Cache
import main
app = Flask(__name__)
cache = Cache(app, config={'CACHE_TYPE': 'simple'})
@app.route('/')
def display_available():
content = ('<html>' +
'<head>' +
'<title>Restaurant Menu Parser</title>' +
'</head>'... |
from functools import lru_cache
import os.path
import pickle
import glob
import time
import json
import numpy as np
from scipy.stats import truncnorm
from scipy.optimize import minimize
import pymultinest as pmn
import matplotlib.pyplot as plt
import corner
import astropy.units as u
from . import photometry
from . im... |
"""
SkCode elements tree test code.
"""
import unittest
from skcode.etree import (TreeNode,
RootTreeNode,
ROOT_NODE_NAME,
TEXT_NODE_NAME,
NEWLINE_NODE_NAME,
debug_print_ast)
from skcode.ta... |
'''utilites for handling vmd files and motions
'''
import math
import bisect
from collections import defaultdict
from collections import Iterable
from functools import wraps
from . import vmddef
from . import vmdbezier
EPS = 1e-10
QUATERNION_IDENTITY = (0, 0, 0, 1)
def clamp(v, min_v, max_v):
return max(min(v, ... |
import functools
import operator
import westpa.tools.binning
from abc import ABC, abstractmethod
from westpa.core.h5io import WESTPAH5File
class WESTDataset:
"""A record of a WESTPA simulation.
Parameters
----------
h5filename : str, default 'west.h5'
Pathname of a WESTPA HDF5 data file.
... |
"""
Tensorflow implementation of WV-DR algorithm wrapper class(sklearn style)
:authro: Fido Wang (wanghailin317@gmail.com)
:refer: http://papers.nips.cc/paper/5021-distributed-representations-of-words-and-phrases-and-their-compositionality.pdf
"""
import tensorflow as tf
import numpy as np
from option import Option
... |
# coding:utf-8
#
# The MIT License (MIT)
#
# Copyright (c) 2016-2018 yutiansut/QUANTAXIS
#
# 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 th... |
#!/usr/local/bin/env python
#=============================================================================================
# MODULE DOCSTRING
#=============================================================================================
"""
Set up YANK calculations.
"""
#============================================... |
#! /usr/bin/env python
# -*- coding:utf-8 -*-
from random import SystemRandom
def luhn(cardNumber):
result = 0
cardNumber = str(cardNumber)
tmp = (len(cardNumber) % 2 == 1)
for n in cardNumber:
n = int(n)
tmp = not tmp
if(tmp):
result += n*2 - (0 if n < 5 else 9)
... |
import sys
import re
from datetime import datetime
from pkg_resources import safe_version, parse_version
from packaging.version import VERSION_PATTERN
# PEP440 version spec
_version_regex = re.compile('^' + VERSION_PATTERN + '$',
re.VERBOSE | re.IGNORECASE)
_stamp_regex = re.compile(r'(\d{... |
from polyaxon.config_settings.cors import *
from polyaxon.config_settings.dirs import *
from polyaxon.config_settings.k8s import *
from polyaxon.config_settings.spawner import *
from polyaxon.config_settings.registry import *
from polyaxon.config_settings.volume_claims import *
from .apps import *
|
from kivy.utils import platform
from kivy.clock import Clock
if platform == 'linux': # Enable Mp3
import gobject
from kivy.core.audio.audio_pygst import SoundPyGst
else:
from kivy.core.audio import SoundLoader as _SoundLoader
if platform == "linux":
class SoundLoader(object):
"""
Supp... |
# This file was automatically generated by SWIG (http://www.swig.org).
# Version 3.0.8
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.
"""
Klamp't Core Python bindings
------------------------------
"""
from sys import version_info
if version_inf... |
from django.shortcuts import get_object_or_404
from django.db.models import Q
from rest_framework import viewsets, status
from rest_framework.response import Response
from rest_framework.permissions import IsAuthenticated , AllowAny
from rest_framework.decorators import detail_route, list_route
from ipware.ip import g... |
import json
import uuid
import logging
from collections import namedtuple
from functools import partial
from pkgutil import simplegeneric
from boto.swf.layer1 import Layer1
from boto.swf.layer1_decisions import Layer1Decisions
from boto.swf.exceptions import SWFTypeAlreadyExistsError, SWFResponseError
__all__ = ['Cl... |
# -*- coding: utf-8 -*-
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2010-2012, GEM Foundation.
#
# OpenQuake 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 version 3 of the Lice... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
#-------------------------------------------------------------------------------
# Name: RapidEyeNDVIfromCutRegions
# Purpose: Calculates the NDVI of a defined region based on centroid of features from a shapefile.
#
# Author: leandro.biondo@florestal.go... |
import json
import hmac
import os
import hashlib
try:
from urllib.parse import urlencode
import unittest.mock as mock
except ImportError:
from urllib import urlencode
import mock
from tornado.testing import AsyncHTTPTestCase
from conda_forge_webservices.webapp import create_webapp
class TestHandlerB... |
"""
The ``wind_turbine`` module contains the class WindTurbine that implements
a wind turbine in the windpowerlib and functions needed for the modelling of a
wind turbine.
"""
__copyright__ = "Copyright oemof developer group"
__license__ = "GPLv3"
import pandas as pd
import logging
import sys
import requests
import ... |
import os
class VideoCache:
def __init__(self, filename):
self.filename = filename
def get_line_list(self, line):
items = line.strip().split(" ")
for i in range(len(items)):
items[i] = int(items[i])
return items
def get_next_line_list(self):
line = self... |
# coding=utf-8
# Copyright 2018 The Tensor2Tensor Authors.
#
# 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... |
from __future__ import print_function
from __future__ import with_statement
import os, sys, re, sqlite3
from cStringIO import StringIO
from xml.etree.cElementTree import ElementTree
from helpers import gzread
import gettext
#t = gettext.translation("jblite")
#_ = t.ugettext
gettext.install("jblite")
c... |
import json
import threading
import socket
import ssl
import datetime
from ..exceptions import SocketError
from ..compat import is_py3
class BetfairStream(object):
"""Socket holder, connects to betfair and
pushes any received data to listener
"""
__host = 'stream-api.betfair.com'
__port = 443
... |
import io
import sys
import time
import picamera
from PIL import Image
import argparse
def capture_image(resolution=(1024, 768), size=(320, 240), sleep=2):
"""
Captures image from raspberry pi camera
resolution -- resolution of capture
size -- size of output
sleep -- sleep time in seconds
"""
... |
import os, sys, time
ignore = ['download rate', 'disk block buffers']
keys = ['upload rate', 'download rate', 'downloading torrents', \
'seeding torrents', 'peers', 'connecting peers', 'disk block buffers']
axes = ['x1y2', 'x1y2', 'x1y1', 'x1y1', 'x1y1', 'x1y1', 'x1y1']
out = open('session_stats.gnuplot', 'wb')
pr... |
# Copyright (C) 2015 Allen Li
#
# 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 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the ... |
from .engine import Engine
import pyglet
from pyglet import gl
from gem import vector
import ctypes as ct
import math
# This is to make up for some missing functionality from GEM and fix some bugs
class Vector(vector.Vector):
def clone(self):
return Vector(self.size, data=self.vector[:]) # fix slight ... |
# coding:utf-8
#
# The MIT License (MIT)
#
# Copyright (c) 2016-2018 yutiansut/QUANTAXIS
#
# 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 th... |
#Human is the agent implemented by you
from agent import Human
#this will raise NotImplementedError owing to how we don't have an AGI yet
#(also it definitely wouldn't really be aligned)
from alba import ALBA
putative_aligned_AI = ALBA(Human, 20)
#this is a simplified version that consults the expert whenever it enco... |
from bika.lims import bikaMessageFactory as _
from bika.lims.utils import t
from bika.lims import PMF
from bika.lims.browser.bika_listing import WorkflowAction
from bika.lims.idserver import renameAfterCreation
from bika.lims.permissions import *
from bika.lims.utils import changeWorkflowState
from bika.lims.utils impo... |
#! /usr/bin/env python
# Copyright Arvid Norberg 2008. Use, modification and distribution is
# subject to the Boost Software License, Version 1.0. (See accompanying
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
import os, sys, time, os
stat = open(sys.argv[1])
line = stat.readline()
while no... |
# @ 2019 Akretion - www.akretion.com.br -
# Magno Costa <magno.costa@akretion.com.br>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo.tests.common import TransactionCase
class InvoicingPickingTest(TransactionCase):
"""Test invoicing picking"""
def setUp(self):
super(... |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Addons modules by CLEARCORP S.A.
# Copyright (C) 2009-TODAY CLEARCORP S.A. (<http://clearcorp.co.cr>).
#
# This program is free software: you can redistribute... |
#!/usr/bin/env python
import subprocess
import sys
import os
from glob import glob
from ififuncs import diff_textfiles
import datetime
import time
import csv
import uuid
import lxml.etree as ET
from ififuncs import create_csv
from ififuncs import append_csv
from ififuncs import send_gmail
from ififuncs import hashlib_... |
__description__ = 'The Onion Box: WebInterface to monitor Tor node operations.'
__version__ = '4.2.dev0'
__stamp__ = '20180322|195222' |
##############################################################################
#
# Copyright (c) 2004 TINY SPRL. (http://tiny.be) All Rights Reserved.
# Fabien Pinckaers <fp@tiny.Be>
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsabili... |
#! /usr/bin/env python
# Copyright Arvid Norberg 2008. Use, modification and distribution is
# subject to the Boost Software License, Version 1.0. (See accompanying
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
import os, sys, time, os
stat = open(sys.argv[1])
line = stat.readline()
while no... |
# @ 2019 Akretion - www.akretion.com.br -
# Magno Costa <magno.costa@akretion.com.br>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo.tests.common import TransactionCase
class InvoicingPickingTest(TransactionCase):
"""Test invoicing picking"""
def setUp(self):
super(... |
import constants
from datetime import datetime
from django.db import models
from django.db.models.query_utils import Q
from django.utils.translation import ugettext as _
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from core.models import BaseModel
from publishers.models i... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.