text stringlengths 12 6.59M |
|---|
import cv2
import numpy as np
from scipy.ndimage.filters import correlate
VIDEO = "data/fish_video.mp4"
def draw_flow(im,flow,step=16):
""" Plot optical flow at sample points spaced step pixels apart. """
h,w = im.shape[:2]
y,x = np.mgrid[step/2:h:step,step/2:w:step].reshape(2,-1)
fx,fy = flow[y,x].T
... |
import os
from os import path
import urlparse
try:
# Current version of glob2 does not let us access has_magic :/
import glob2 as glob
from glob import has_magic
except ImportError:
import glob
from glob import has_magic
import warnings
from filter import get_filter
from merge import (FileHunk, UrlH... |
from django.shortcuts import get_object_or_404
from django_filters.rest_framework import DjangoFilterBackend
from django_filters.rest_framework import FilterSet
from django_filters.rest_framework import NumberFilter
from rest_framework.exceptions import APIException
from rest_framework.response import Response
from res... |
import cv2
import numpy as np
from scipy.ndimage.filters import correlate
VIDEO = "data/fish_video.mp4"
def draw_flow(im,flow,step=16):
""" Plot optical flow at sample points spaced step pixels apart. """
h,w = im.shape[:2]
y,x = np.mgrid[step/2:h:step,step/2:w:step].reshape(2,-1)
fx,fy = flow[y,x].T
... |
#!/usr/bin/env python
"""
Given a BAM file and a genomic reference, for each position covered in the
BAM file, show the reference base, and the number of A/T/C/G's and InDels.
You can also optionally filter out all bases whose quality score is below a
threshold, bases that aren't covered by enough reads, bases that... |
from collections import defaultdict
from celery.task import task
from pandas import concat, DataFrame
from bamboo.core.aggregator import Aggregator
from bamboo.core.frame import BambooFrame, NonUniqueJoinError
from bamboo.core.parser import Parser
from bamboo.lib.mongo import MONGO_ID
from bamboo.lib.parsing import p... |
# -*- coding: utf-8 -*-
#
# Copyright (c) 2016 Intel Corp.
#
"""
Implements a resource_control plugin for Slurm to control compute nodes.
"""
from __future__ import print_function
import os
from ...plugin.manager import PluginMetadataInterface
from ..resource_control import ResourceControl
from ...utilities.utilities i... |
#!/usr/bin/python
#
# offwaketime Summarize blocked time by kernel off-CPU stack + waker stack
# For Linux, uses BCC, eBPF.
#
# USAGE: offwaketime [-h] [-p PID | -u | -k] [-U | -K] [-f] [duration]
#
# Copyright 2016 Netflix, Inc.
# Licensed under the Apache License, Version 2.0 (the "License")
#
# 20-Ja... |
#!/usr/bin/python -u
import sys
import redis
import csv
import posixpath
import datetime
import logging
import logging.handlers
from email.utils import parsedate
PRECISIONS = [
("hour", "%y-%m-%d-%H", datetime.timedelta(days=2)),
("daily", "%y-%m-%d", datetime.timedelta(days=32)),
]
logger = logging.getLog... |
# -*- coding: utf-8 -*-
# © 2016 Antiun Ingeniería S.L. - Jairo Llopis
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp import api, SUPERUSER_ID
from psycopg2.extensions import AsIs
import logging
_logger = logging.getLogger(__name__)
def pre_init_hook_for_submodules(cr, model, fiel... |
# -*- coding: utf-8 -*-
###############################################################################
# #
# sale_project for OpenERP #
# Copyright (C) 2010-2013 Akretion LDTA (<http://www.a... |
import time
from tools.url import UrlMgr, LargeDownload
from tools.helper import textextract, textextractall
import config
from tools.extension import Extension
import logging
log = logging.getLogger('streams')
class BaseStream(object):
def __init__(self):
self.flvUrl = ''
def get(self, VideoInfo, ... |
import os
import re
import subprocess
import collections
import tempfile
import logging
import json
import tabulate
import numpy as np
STATS_FULL_TIME_MEAN = "full time mean"
STATS_FULL_TIME_STD = "full time std"
STATS_STW_TIME_MEAN = "stw time mean"
STATS_STW_TIME_STD = "stw time std"
STATS_STW_TIME_... |
# -*- coding: utf-8 -*-
# @Author: Cody Kochmann
# @Date: 2017-04-27 12:49:17
# @Last Modified by: Cody Kochmann
# @Last Modified time: 2017-07-10 15:12:58
"""
battle_tested - automated function fuzzing library to quickly test production
code to prove it is "battle tested" and safe to use.
Example... |
from collections import OrderedDict
import json
import os
import uuid
import bottle
from bottle import request, response
import sqlalchemy as sa
import sqlalchemy.orm as orm
import bauble.db as db
import bauble.error as error
import bauble.i18n
from bauble.model.family import Family, FamilySynonym, FamilyNote
from b... |
# -*- coding: utf-8 -*-
""" License
Copyright (C) 2013 YunoHost
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, or
(at your option) any l... |
import numpy as np
import logging
import matplotlib.pyplot as plt
import scipy.stats
from copy import copy, deepcopy
from gp import GP, GaussianKernel, PeriodicKernel
from . import bq_c
from . import util
logger = logging.getLogger("bayesian_quadrature")
DTYPE = np.dtype('float64')
MIN = np.log(np.exp2(np.float64(np... |
# -*- coding: utf-8 -*-
""" License
Copyright (C) 2013 YunoHost
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, or
(at your option) any l... |
import numpy as np
import logging
import matplotlib.pyplot as plt
import scipy.stats
from copy import copy, deepcopy
from gp import GP, GaussianKernel, PeriodicKernel
from . import bq_c
from . import linalg_c as la
from . import util
logger = logging.getLogger("bayesian_quadrature")
DTYPE = np.dtype('float64')
MIN =... |
import subprocess, sys, threading
from queue import Queue
from math import ceil
def get_auth_methods(hostname, port=22, timeout=5.0, verbose=False):
try:
if sys.version_info.minor < 3:
success_output = subprocess.check_output([
'ssh',
# prevents ominous error on ... |
#!/usr/bin/env python
"""
This is a simple lightweight monitor that ensures that cleanup has been done.
This is only required on Windows where our cleanup handler doesn't ever get
called.
Notes:
* This possibly could be rewritten to use python multiprocessing.
* If pids get reused, it's possible that innocent proce... |
import gettext
#: Version information (major, minor, revision[, 'dev']).
version_info = (0, 0, 15)
#: Version string 'major.minor.revision'.
version = __version__ = ".".join(map(str, version_info))
gettext.install('stalker')
|
#!/usr/bin/env python
""" setuptools for stalkerweb """
from setuptools import setup, find_packages
from stalkerweb import __version__ as version
with open('requirements.txt') as f:
REQUIRED = f.read().splitlines()
setup(
name='stalkerweb',
version=version,
author="Florian Hines",
author_email="s... |
#from ConfigParser import SafeConfigParser
from . import defaults
import os
import logging
import configparser
## empty class to hold "current" settings
class Settings:
pass
## module-wide collection of settings
__DEFAULTS = Settings()
__DEFAULTS.CACHE_DIR = defaults.CACHE_DIR
__DEFAULTS.SEED = defaults.SEED
__DE... |
# -*- coding: utf-8 -*-
""" License
Copyright (C) 2013 YunoHost
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, or
(at your option) any l... |
"""Module to import and decode zs2 files."""
import gzip as _gzip
import struct as _struct
# Author: Chris Petrich
# Copyright: Copyright 2015,2016,2017, Chris Petrich
# License: MIT
#####################################
#
# Python 2/3 compatibility
#
# turn byte/str/int/unicode character into ordinal value
_... |
#!/usr/bin/env python
from __future__ import print_function
import sys
import stackexchange
from stackexchange import Sort
# A good testing URL: http://stackoverflow.com/questions/16800049/changepassword-test
# The approved answer ID: 16800090
import requests
import webbrowser
import subprocess
import argparse
import ... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
def rename_content_types(apps, schema_editor):
"""Rename old content types if necessary."""
ContentType = apps.get_model("contenttypes", "ContentType")
for ct in ContentType.objects.filter(app_label="... |
# -*- coding: utf-8 -*-
import os
import time
import bunch
import colorclass
import requests
from .compat import string_type
from .utils import run_from_ipython
debug_messages = {
'request': (
'{blue}Executing {method} request:{/blue}\n'
'{hiblack}'
' URL: {url}\n'
' h... |
"""
The MIT License
Copyright (c) 2007-2010 Leah Culver, Joe Stump, Mark Paschal, Vic Fryzel
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 ... |
#
# Copyright (C) 2007-2017 by frePPLe bvba
#
# This library 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, or
# (at your option) any later version.
#
# This library is... |
#!/usr/bin/env python
#coding:utf-8
import os
import functools
from sqlalchemy import create_engine
ISOLATION_LEVEL = {
1 : 'READ COMMITTED',
2 : 'READ UNCOMMITTED',
3 : 'REPEATABLE READ',
4 : 'SERIALIZABLE'
}
class DBEngine(object):
def __init__(self,config, **kwargs):
self.config = conf... |
# Copyright 2016 Osvaldo Santana Neto <staty@osantana.me>
#
# 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 .models import Tournament, Match, Team, MatchPoint, TeamMatchPoint, TeamStat
from django.utils import timezone
from operator import attrgetter
def getTeamList(tournament_id):
""" get list of team in a tournament """
matchs = Match.objects.filter( tournament = tournament_id ).order_by( "round" ).o... |
__author__ = 'Jaka & Jani'
#coding UTF-8
"""
##############################################
###############Operandi#######################
##############################################
"""
from operands import *
# True
Tru()
# False
Fls()
# Variable
V("imeSpremenljivke")
# And
a1 = And([V("X"), V("Y")]) # Enostav... |
from steerclear import app
from flask import request, json, abort
from models import *
from forms import *
"""
list_rides
----------
Lists all of the rides in the ride queue.
Returns a list of Ride dictionaries
"""
def list_rides():
rides = Ride.query.all()
return map(Ride.as_dict, rides)
"""
list_ride
------... |
import inspect
import os
import pprint
import re
import sqlite3
import traceback
from datetime import datetime
import pymysql
import znc
# noinspection PyPep8Naming
class zlog_sql(znc.Module):
module_types = [znc.CModInfo.GlobalModule]
description = 'Log all channels to a MySQL/SQLite database.'
has_args... |
import logging
import numpy as np
import scipy.spatial
import scipy.sparse.csgraph as graph
import scipy.sparse
import shapely.geometry
import matplotlib.pyplot as plt
import matplotlib.tri as tri
import cppimport.import_hook
import tectosaur.util.geometry
import tectosaur.nearfield.edge_adj_setup as edge_adj_setup
im... |
# -*- coding: utf 8 -*-
"""
Functions for importing Canstrat ASCII files.
:copyright: 2016 Agile Geoscience
:license: Apache 2.0
"""
import datetime as dt
from .utils import null, skip, are_close
from .canstrat_codes import rtc
from .canstrat_codes import fwork
from .canstrat_codes import grains
from .canstrat_codes... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2004-2014 Edgewall Software
# Copyright (C) 2004 Daniel Lundin <daniel@edgewall.com>
# Copyright (C) 2005-2006 Christopher Lenz <cmlenz@gmx.de>
# Copyright (C) 2006-2007 Christian Boos <cboos@edgewall.org>
# All rights reserved.
#
# This software is licensed as described in the... |
# Copyright (C) 2007 Samalyse SARL
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://svn.parisson.org/telemeta/TelemetaLicense.
#
# Author: Olivier Guilyardi <olivier@samalyse.com... |
#!/usr/bin/env python
"""
Code related to the Magellanic Satellites Survey (MagLiteS).
"""
import os,sys
import logging
import copy
from collections import OrderedDict as odict
import numpy as np
from obztak.field import FieldArray, SISPI_DICT, SEP
from obztak.survey import Survey
from obztak.scheduler import Schedul... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2004-2007 Edgewall Software
# Copyright (C) 2004 Daniel Lundin <daniel@edgewall.com>
# Copyright (C) 2005-2006 Christopher Lenz <cmlenz@gmx.de>
# Copyright (C) 2006-2007 Christian Boos <cboos@neuf.fr>
# All rights reserved.
#
# This software is licensed as described in the file... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2004-2006 Edgewall Software
# Copyright (C) 2004 Daniel Lundin <daniel@edgewall.com>
# Copyright (C) 2005-2006 Christopher Lenz <cmlenz@gmx.de>
# Copyright (C) 2006 Christian Boos <cboos@neuf.fr>
# All rights reserved.
#
# This software is licensed as described in the file COPY... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2004-2006 Edgewall Software
# Copyright (C) 2004 Daniel Lundin <daniel@edgewall.com>
# Copyright (C) 2005-2006 Christopher Lenz <cmlenz@gmx.de>
# Copyright (C) 2006 Christian Boos <cboos@neuf.fr>
# All rights reserved.
#
# This software is licensed as described in the file COPY... |
"""Global django settings for academicspam project"""
########## IMPORTS
import os, dj_database_url#, urllib
########## END IMPORTS
########## DEBUG CONFIGURATION
DEBUG = TEMPLATE_DEBUG = eval(os.environ.get('DEBUG', 'False'))
########## END DEBUG CONFIGURATION
########## GENERAL CONFIGURATION
# Hosts
ALLOWED_HOSTS ... |
# from __future__ import unicode_literals
from django.contrib.gis import forms, admin
from django.contrib.gis.geos import GEOSGeometry
from django.core.management import settings
from django.forms import CharField
from django.forms import ModelForm
from django.forms import TypedChoiceField
from django.http import HttpR... |
from scripts import settings, streaming
# Query keys categorize tweets
# Each key or category corresponds to an array of keywords
queries = {'ETH': ['ETH', 'Ethereum'],
'LTC': ['LTC', 'Litecoin'],
'BTC': ['BTC', 'Bitcoin'],
'XRP': ['XRP', 'Ripple'],
'XLM': ['XLM', 'Stellar']... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2004-2006 Edgewall Software
# Copyright (C) 2004 Oliver Rutherfurd
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://trac.edgewall.org/wi... |
#!/usr/bin/python
from style_grader_functions import *
#TODO: Set up standard error to print properly
def main():
sys.stderr = codecs.StreamReaderWriter(sys.stderr,
codecs.getreader('utf8'),
codecs.getwriter('utf8'),
... |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import logging
import requests
import pprint
from werkzeug import urls
from odoo import api, models, fields, _
from odoo.exceptions import ValidationError
from odoo.addons.payment_stripe_sca.controllers.main import Strip... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2016 Georg Seifert. 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... |
from __future__ import absolute_import, division, print_function
import numpy as np
from datashape import *
from datashape.predicates import isscalar, isnumeric
def unit_to_dtype(ds):
"""
>>> unit_to_dtype('int32')
dtype('int32')
>>> unit_to_dtype('float64')
dtype('float64')
>>> unit_to_dtype... |
# -*- coding: utf-8 -*-
import os.path
import shutil
from nimp.utilities.perforce import *
from nimp.utilities.processes import *
from nimp.utilities.file_mapper import *
from nimp.utilities.deployment import *
#---------------------------------------------------------------------------
def build_wwise_banks(e... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2004-2009 Edgewall Software
# Copyright (C) 2004 Oliver Rutherfurd
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://trac.edgewall.org/wi... |
"""
S3-based storage backend
Object Keys
http://docs.aws.amazon.com/AmazonS3/latest/dev/UsingMetadata.html
"""
import os
import sys
import time
import json
from boto.s3.connection import S3Connection
from boto.s3.key import Key
from boto.exception import S3ResponseError
import requests
# Get settings module
settings ... |
# Function to convert simple ETS project names and versions to a requirements
# spec that works for both development builds and stable builds. Allows
# a caller to specify a max version, which is intended to work along with
# Enthought's standard versioning scheme -- see the following write up:
# https://svn.enthou... |
from pypy.rlib.rstring import StringBuilder
from pypy.rlib.rsre.rsre_core import (OPCODE_LITERAL, OPCODE_LITERAL_IGNORE,
OPCODE_SUCCESS, OPCODE_ASSERT, OPCODE_MARK, OPCODE_REPEAT, OPCODE_ANY,
OPCODE_ANY_ALL, OPCODE_MAX_UNTIL, OPCODE_MIN_UNTIL, OPCODE_GROUPREF,
OPCODE_AT, OPCODE_BRANCH, OPCODE_RANGE, OPCODE_... |
#!/usr/bin/env python3
import argparse
import os
import sys
import bioannotation
import biocodeutils
import biothings
import sqlite3
import re
## constants
DEFAULT_PRODUCT_NAME = "hypothetical protein"
def main():
parser = argparse.ArgumentParser( description='Parses multiple sources of evidence to generate a co... |
# -*- coding: utf-8 -*-
###############################################################################
#
# ODOO (ex OpenERP)
# Open Source Management Solution
# Copyright (C) 2001-2015 Micronaet S.r.l. (<http://www.micronaet.it>)
# Developer: Nicola Riolini @thebrush (<https://it.linkedin.com/in/thebrush>)
# This pro... |
"""
MultiCall - a class which inherits its methods from a Tkinter widget (Text, for
example), but enables multiple calls of functions per virtual event - all
matching events will be called, not only the most specific one. This is done
by wrapping the event functions - event_add, event_delete and event_info.
MultiCall r... |
from datetime import datetime, timedelta
from sqlalchemy.sql import func
from sqlalchemy import distinct, and_
from ogn.db import session
from ogn.model import ReceiverBeacon
from ogn.model.receiver_device import ReceiverDevice
back_24h = datetime.utcnow() - timedelta(days=1)
receiver_messages_per_24h = 24*60 / 5
... |
"""
Transformer used to apply basic transformations on MRI data.
"""
# Author: Gael Varoquaux, Alexandre Abraham
# License: simplified BSD
import numpy as np
from sklearn.externals.joblib import Memory
from nibabel import Nifti1Image
from .. import masking
from .. import resampling
from .. import utils
from .base_m... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2004-2006 Edgewall Software
# Copyright (C) 2004 Oliver Rutherfurd
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://trac.edgewall.org/wi... |
def run(host, port):
import server.config as config
from flask import Flask
from geventwebsocket.handler import WebSocketHandler
from gevent.pywsgi import WSGIServer
http_server = WSGIServer(
(host, port), config.app, handler_class=WebSocketHandler
)
http_server.serve_forever()
|
# Function to convert simple ETS project names and versions to a requirements
# spec that works for both development builds and stable builds. Allows
# a caller to specify a max version, which is intended to work along with
# Enthought's standard versioning scheme -- see the following write up:
# https://svn.enthou... |
# Copyright 2018 The Bazel Authors. 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 la... |
""" Optimization Tools
A collection of general-purpose optimization routines.
fmin -- Nelder-Mead Simplex algorithm
(uses only function calls)
fmin_bfgs -- Quasi-Newton method (can use function and gradient)
fmin_ncg -- Line-search Newton Conjugate Gradient (can use
... |
import os
import re
import time
import copy
from datetime import datetime, timedelta
import sys, requests, json
import bdd_test_util
OPENCHAIN_REST_PORT = 5000
class ContainerData:
def __init__(self, containerName, ipAddress, envFromInspect, composeService):
self.containerName = containerName
s... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2004-2006 Edgewall Software
# Copyright (C) 2004-2005 Daniel Lundin <daniel@edgewall.com>
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http... |
## Copyright 2016 Sayak Brahmachari
##
## 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 la... |
# -*- coding: utf-8 -*-
import telebot # Library of API bot.
from telebot import types # Types from API bot
import time
import random
import datetime
import codecs
import sys
import json
from os.path import exists
import os
import token
import user
import feedparser
import owners
#import re
import logging
import comman... |
'''PipelinePreprocess.py - Tasks for processing short read data sets
====================================================================
Processing reads is a common task before mapping. Different sequencing
technologies and applications require different read processing. This
module provides utility functions to ab... |
# -*- coding: utf-8 -*-
import copy
from jsrn import exceptions
__all__ = ('BooleanField', 'StringField', 'IntegerField', 'FloatField', 'ObjectField', 'ArrayField')
class NOT_PROVIDED:
pass
class Field(object):
"""
Base class for all fields.
"""
default_validators = []
default_error_message... |
# Copyright (c) 2016-present, Gregory Szorc
# All rights reserved.
#
# This software may be modified and distributed under the terms
# of the BSD license. See the LICENSE file for details.
import os
from distutils.extension import Extension
zstd_sources = ['zstd/%s' % p for p in (
'common/entropy_common.c',
... |
import sys
from test_support import *
class Empty:
def __repr__(self):
return '<Empty>'
class Coerce:
def __init__(self, arg):
self.arg = arg
def __repr__(self):
return '<Coerce %s>' % self.arg
def __coerce__(self, other):
if isinstance(other, Coerce):
re... |
import logging
import datetime
import twitter
from oktwitter import settings
from parliament.models import Parliament
from government.models import Government
logger = logging.getLogger(__name__)
api = twitter.Api(
consumer_key=settings.TWITTER_CONSUMER_KEY,
consumer_secret=settings.TWITTER_CONSUMER_SECRET... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2003-2006 Edgewall Software
# Copyright (C) 2003-2006 Jonas Borgström <jonas@edgewall.com>
# Copyright (C) 2005 Christopher Lenz <cmlenz@gmx.de>
# Copyright (C) 2006 Christian Boos <cboos@neuf.fr>
# All rights reserved.
#
# This software is licensed as described in the file COP... |
# coding: utf-8
# Natural Language Toolkit: vader
#
# Copyright (C) 2001-2015 NLTK Project
# Author: C.J. Hutto <Clayton.Hutto@gtri.gatech.edu>
# Ewan Klein <ewan@inf.ed.ac.uk>
# URL: <http://nltk.org/>
# For license information, see LICENSE.TXT
#
"""
If you use the VADER sentiment analysis tools, please cite:... |
#sys to exit
import sys
import hashlib
import pyperclip
import time
# getpass for no echo on user input
from getpass import getpass
from database import checkUserCredentials, addUser, getAllServices, addService, checkIfServiceExists, removeService, getServiceByName, setDBUsername
def quit():
print("\nSee you lat... |
#! /usr/bin/env python
"""Test script for the dumbdbm module
Original by Roger E. Masse
"""
import io
import os
import unittest
import dumbdbm
from test import test_support
_fname = test_support.TESTFN
def _delete_files():
for ext in [".dir", ".dat", ".bak"]:
try:
os.unlink(_fname + ext)
... |
import warnings
import logging
import numpy as np
import scipy.fftpack as fft
from scipy.signal import medfilt
from scipy.stats import sem
import dpath.util
from .io import import_data
from .utils import (
nm_to_ir_wavenumbers, nm_to_wavenumbers, X_PIXEL_INDEX, Y_PIXEL_INDEX,
FRAME_AXIS_INDEX, PIXEL, PP_INDEX... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Main onebot class and the command line runner"""
import locale
import irc3
__author__ = 'Thom Wiggers'
__email__ = 'thom@thomwiggers.nl'
__version__ = '0.1.0'
class OneBot(irc3.IrcBot):
"""Main class, extensions of IrcBot"""
def __init__(self, *args, **kwar... |
# Natural Language Toolkit: Tokenizers
#
# Copyright (C) 2001-2009 NLTK Project
# Author: Edward Loper <edloper@gradient.cis.upenn.edu>
# Steven Bird <sb@csse.unimelb.edu.au>
# Trevor Cohn <tacohn@csse.unimelb.edu.au>
# URL: <http://nltk.sourceforge.net>
# For license information, see LICENSE.TXT
"""
T... |
import unittest
import praw
import httplib
import re
from itertools import groupby
def getLiquipediaEvents():
conn = httplib.HTTPConnection('wiki.teamliquid.net')
conn.connect()
request = conn.putrequest('GET','/starcraft2/api.php?format=txt&action=query&titles=Liquipedia:Tournament_News&prop=revisions&rvprop=co... |
import errno
from http import client
import io
import os
import array
import socket
import unittest
TestCase = unittest.TestCase
from test import support
here = os.path.dirname(__file__)
# Self-signed cert file for 'localhost'
CERT_localhost = os.path.join(here, 'keycert.pem')
# Self-signed cert file for 'fakehostna... |
from calendar import Calendar, SUNDAY
from collections import namedtuple, defaultdict
from datetime import timedelta, date, datetime, time
from functools import partial
from itertools import chain
from operator import attrgetter
import pytz
from django.conf import settings
from django.contrib.auth.decorators import lo... |
# -*- coding: utf-8 -*-
'''
The top level interface used to translate configuration data back to the
correct cloud modules
'''
# Import python libs
from __future__ import print_function
import copy
import os
import traceback
import glob
import time
import signal
import logging
import multiprocessing
from itertools imp... |
# file: op_webgui/tests.py
from django.test import TestCase
from django.urls import reverse
from django.contrib.auth.models import User
from netdevice.models import router, network_os
from netdevice.tests import create_router
from bgp.models import aut_num
class WebGUIViewTests(TestCase):
def setUp(self):
... |
#!/usr/bin/env python
from __future__ import print_function
import colorama
import vdc_api_call as vdc
import sys
import time
import multiprocessing
import datetime
import socket
import argparse
import logging
import random
from pprint import pprint
from vdc_api_call.config import Config
# Check Python version
if sys.... |
# Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
import re
import time
from . import parse_metric
class Metric(object): # pragma: no cover
OLD_STYLE_DELIMITER = '-'
NEW_STYLE_DELIMITER = '... |
import mailbox
import os
import test_support
# create a new maildir mailbox to work with:
curdir = os.path.join(test_support.TESTFN, "cur")
newdir = os.path.join(test_support.TESTFN, "new")
try:
os.mkdir(test_support.TESTFN)
os.mkdir(curdir)
os.mkdir(newdir)
# Test for regression on bug #117490:
#... |
#coding:utf-8
import sys
import os
import json
import re
if sys.version_info < (3, 3):
raise RuntimeError('The Evernote plugin works with Sublime Text 3 only')
# NOTE: OAuth was not implemented, because the Python 3 that is built into Sublime Text 3 was
# built without SSL. So, among other things, this means no h... |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... |
#!/usr/bin/env python
'''
Simple utility to listen to the Execute button and save the latest image and joystick control input and save them as bag files
'''
import roslib
roslib.load_manifest('slytherin_dagger')
import rospy
from geometry_msgs.msg import Twist
from std_msgs.msg import Empty
from sensor_msgs.msg import... |
"""Supporting definitions for the Python regression tests."""
if __name__ != 'test.test_support':
raise ImportError('test_support must be imported from the test package')
import contextlib
import errno
import socket
import sys
import os
import os.path
import shutil
import warnings
import unittest
class Error(Exc... |
# -*- coding: utf-8 -*-
'''
Send events based on a script's stdout
Example Config
.. code-block:: yaml
engines:
- script:
cmd: /some/script.py -a 1 -b 2
output: json
interval: 5
Script engine configs:
cmd: Script or command to execute
output: Any available saltstack ... |
import Tkinter
import pyxdevkit
import requests
import re
class MainFrame(Tkinter.Frame):
def __init__(self, parent):
self.parent = parent
self.ip_addr = Tkinter.StringVar()
self.squad_id = Tkinter.StringVar()
self.goalie_name = Tkinter.StringVar()
self.card_color = Tkinte... |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... |
import json
import hashlib
from decimal import Decimal
import datetime
import time
from pycoin.key.BIP32Node import BIP32Node
from walrus.database import Hash, List, Set, ZSet, Database
from bitcoinrpc import connect_to_local
from constants import MINUTES_IN_MONTH, NODE_UP_EMAIL
db = Database()
class SimpleKVPai... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.