text stringlengths 17 737k |
|---|
import pprint
import re
import copy
import itertools
import operator
import pymongo
from bson.code import Code
from mongoengine import signals
__all__ = ['queryset_manager', 'Q', 'InvalidQueryError',
'DO_NOTHING', 'NULLIFY', 'CASCADE', 'DENY']
# The maximum number of items to display in a QuerySet.__rep... |
# -*- mode: python; coding: utf-8 -*-
# Copyright 2017 the HERA Collaboration
# Licensed under the BSD License.
"""Integration with the HERA on-site monitor-and-control (M&C) system.
This module is imported even if M&C reporting is disabled. If that's the case,
the various calls are all no-ops, as tested by seeing if... |
import collections
import copy
import functools
import itertools
import json
import time
import warnings
from sentinels import NOTHING
from .filtering import filter_applies, iter_key_candidates
from . import ObjectId, OperationFailure, DuplicateKeyError
from .helpers import basestring, xrange
try:
from collections... |
# 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, software
# distributed under t... |
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# If ex... |
import os
from fabric.api import local, task, run
from settings.base import INSTALLED_APPS
commands = {
'runserver': ['./manage.py runserver'],
'syncdb': [
'./manage.py migrate auth',
'./manage.py syncdb --noinput',
'./manage.py migrate'],
'static': ['./manage.py collectstatic --n... |
import pytest
from shadho.backend.base.tests.test_base_db import TestBaseBackend
from shadho.backend.json.db import JsonBackend
import json
import os
import shutil
import tempfile
class TestJsonBackend(object):
def test_init(self):
"""Ensure that initialization sets up the db and filepath."""
#... |
import decimal
import numpy
import math
# 1.4 becomes 1 and 1.6 becomes 2. special case: 1.5 becomes 2.
def round_half_up(number):
return int(decimal.Decimal(number).quantize(decimal.Decimal('1'), rounding=decimal.ROUND_HALF_UP))
def Stack_Frames(sig, sampling_frequency, frame_length=0.020, frame_stride=0.020, F... |
import functools
__all__ = ['combomethod', 'EnumValue', 'enums', 'enumrange', 'noreturn', 'clean_tb', 'clean_tb_twisted']
# thanks to:
# http://stackoverflow.com/questions/2589690/creating-a-method-that-is-simultaneously-an-instance-and-class-method
class combomethod(object):
def __init__(self, method):
... |
#!/usr/bin/env python2
import argparse
import pyximport;
pyximport.install()
import matplotlib.pyplot as plt
import numpy as np
if __name__ == '__main__':
parser = argparse.ArgumentParser(
description="Creates a plot from tabular file(s).")
parser.add_argument("x", type=str, help="Column for x")
... |
# $Id$
import random
import base64
import os
import os.path
import time
from PLC.Faults import *
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
from PLC.Auth import Auth
from PLC.Nodes import Node, Nodes
from PLC.Interfaces import Interface, Interfaces
from PLC.InterfaceSettings import Inter... |
import pygame, utils, animation, particles, os
from vector import Vec2d as Vector
util = utils.Utils()
class Character(pygame.sprite.Sprite):
def __init__(self, game, gMap, charType, pos, layer):
self.sprites = pygame.sprite.Group()
super(Character, self).__init__(self.sprites)
self.map = gMap
self.type = c... |
import os
import cmd
import signal
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
from blackwidow import BlackWidow
from blackwidow import parser
from blackwidow.network import *
from cStringIO import StringIO
f = plt.figure(2)
plt.ion()
class BlackWidowInteractive(cmd.Cmd):
def create_netw... |
import time
import platform # test if pi for cpu temp
import my_globals
from subprocess import check_output
FAKE_SENSORS = my_globals.NOT_PI
# sensor simulate
sim_temperature = 0 # needs to be global to simulate Sensors
sim_cpuTemp = 35 # needs to be global to simulate Sensors
# update all sensor valu... |
# Copyright 2016 Battelle Energy Alliance, LLC
#
# 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 agr... |
# Authors: Peter Prettenhofer <peter.prettenhofer@gmail.com> (main author)
# Mathieu Blondel (partial_fit support)
#
# License: BSD Style.
"""Classification and regression using Stochastic Gradient Descent (SGD)."""
import numpy as np
import scipy.sparse as sp
from abc import ABCMeta, abstractmethod
import w... |
#
# This file is part of Fidus Writer <http://www.fiduswriter.org>
#
# Copyright (C) 2013 Takuto Kojima, Johannes Wilm
#
# 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 o... |
import os
import sys
import numpy as np
import scipy.sparse as sp
from scipy import linalg, optimize, sparse
import pytest
from sklearn.base import clone
from sklearn.datasets import load_iris, make_classification
from sklearn.metrics import log_loss
from sklearn.metrics.scorer import get_scorer
from sklearn.model_se... |
from Settings import *
from Constants import *
from psychopy.event import xydist
import numpy as np
import random, os, pickle
class RandomAgent():
def __init__(self,nrframes,dispSize,pos,pdc,sd,moveRange):
self.offset=pos
self.ds=dispSize
self.nrframes=nrframes
self.traj=... |
#!/usr/bin/env python3
#
# Copyright (C) 2021 VyOS maintainers and contributors
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 or later as
# published by the Free Software Foundation.
#
# This program is distributed in the hope t... |
#!/usr/bin/env/python
"""
Parser from a "Simple Flatfile + ascii format" to SMTK
"""
import os
import csv
import numpy as np
import h5py
from sets import Set
from linecache import getline
from collections import OrderedDict
from datetime import datetime
# In order to define default fault dimension import scaling relat... |
from ggame import App, RectangleAsset, ImageAsset, Sprite, LineStyle, Color, Frame, PolygonAsset
from math import pi, cos, sin, atan2, sqrt
import time
SCREEN_WIDTH1 = 1024
hit = 0
t=1
maintain = False
lives = 4
heartlist = list(range(4))
SCREEN_HEIGHT = 571
black = Color(0, 1)
speed = 10
speed1=4
red = Color(0xff0000,... |
# -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2009, 2010, 2011, 2012 CERN.
##
## Invenio is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## published by the Free Software Foundation; either version 2 of the
## License, or ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
""" .draft -- a carrot for open science """
from __future__ import (division, print_function, absolute_import,
unicode_literals)
__all__ = ["webhook"]
import json
import logging
import os
import requests
import signal
import subprocess
import yam... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import errno
import json
import os
import shutil
import socket
import xml.etree.ElementTree as ET
import requests
HOST = socket.gethostbyname(socket.gethostname())
user = 'ipol'
compilation_path = os.path.join("/", "home", user, "ipolDevel", "ci_tests", "compilation_fold... |
# -*- coding: utf-8 -*-
from django.contrib.gis.db import models
from collections import defaultdict
UNIT_CHOICES = (
('mm', 'mm'),
('℃', '℃'),
('mo', 'mo'),
('', ''),
)
CLASS_LEVELS = (
(1, 'Family'),
(2, 'Subfamily'),
(3, 'Subsubfamily')
)
CLASSIFICATION_SCHEMES = (
('E', 'Ethnolog... |
#!/usr/local/bin/env python
# ==============================================================================
# MODULE DOCSTRING
# ==============================================================================
"""
Repex
=====
Replica-exchange simulation algorithms and specific variants.
This module provides a genera... |
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from django.test import TestCase
from profiles.models import Profile
from protocols.models import Protocol, Step, Action, Component
# from steps.models import Step
from organization.models import Organization, Membership
from prot... |
"""Parsing mechanisms should not be directly invoked publicly, as they are
subject to change."""
from TexSoup.utils import Token, Buffer, MixedBuffer, CharToLineOffset
from TexSoup.data import *
from TexSoup.data import arg_type
from TexSoup.tokens import (
TC,
tokenize,
SKIP_ENVS,
)
import functools
impor... |
# coding=utf-8
"""
Support for ANSI escape sequences which are used for things like applying style to text,
setting the window title, and asynchronous alerts.
"""
import functools
import re
from typing import Any, IO
import colorama
from colorama import Fore, Back, Style
from wcwidth import wcswidth
# On Windows, fi... |
from __future__ import print_function, division
import os
import sys
import shutil
import subprocess
import optparse
import math
import signal
import threading
import atexit
import imp
import pwd
import grp
try:
import Queue as queue
except ImportError:
import queue
from . import apxs_config
_py_version = '... |
"""
Highly experimental script that compiles the CPython standard library using Cython.
Execute the script either in the CPython 'Lib' directory or pass the
option '--current-python' to compile the standard library of the running
Python interpreter.
Pass '-j N' to get a parallel build with N processes.
Usage example... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
pgoapi - Pokemon Go API
Copyright (c) 2016 tjado <https://github.com/tejado>
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, ... |
# coding: utf-8
import sys
import mock
from django.contrib.auth import get_user_model
from django.core.urlresolvers import reverse
from publisher.models import PublisherStateModel
from publisher_test_project.fixtures import REPORTER_USER
from publisher_test_project.publisher_test_app.models import PublisherTestModel
... |
import numpy as np
from numpy.testing import assert_approx_equal
from pybug.warp import scipy_warp
from pybug.io import auto_import
from pybug import data_path_to
from pybug.transform import AffineTransform
from pybug.align.lucaskanade import ImageInverseCompositional, \
ImageForwardAdditive
from pybug.align.lucask... |
"""Standardized class and functions to test instruments for pysat libraries.
Note
----
Not directly called by pytest, but imported as part of test_instruments.py.
Can be imported directly for external instrument libraries of pysat instruments.
"""
import datetime as dt
from importlib import import_module
import temp... |
#!/usr/bin/env python
# vim: set expandtab sw=4 ts=4:
'''
Retrieve Travis CI build data and log to Keen.io
Copyright (C) 2014 Dieter Adriaenssens <ruleant@users.sourceforge.net>
This file is part of buildtimetrend/service
<https://github.com/buildtimetrend/service/>
This program is free software: you can redistribut... |
"""Utility functions for the j2cl_* build rules / macros"""
def _get_last_dir_occurrence_of(path, name):
"""Returns the index of the last occurrence of directory name in path."""
if path == name:
return 0
if path.endswith("/" + name):
return path.rfind(name)
index = path.rfind("/" + name + "/")
if in... |
#!/usr/bin/env python
import urllib
#import urllib.request
#import urllib2
from urllib.parse import urlparse, urlencode
from urllib.request import urlopen, Request
from urllib.error import HTTPError
import json
import os
#sir
#from google import search
#import requests
#from bs4 import BeautifulSoup
#import re
... |
# This is the entry point for the Pokemon Showdown Bot, and contain most of the
# permission checks for chat returns.
#
# It's derived from the base class PokemonShowdownBot, and as such hide a lot of
# it's core functions by simply calling functions from the base class.
# For any function called here not defined in th... |
import os
import json
from collections import defaultdict
from flask import Flask, request, g, session, redirect, url_for
from flask import jsonify
from flask import render_template
from flask.ext.github import GitHub as AuthGithub
from flask.ext.sqlalchemy import SQLAlchemy
from flask.ext.script import Manager
from fl... |
# -*- coding: utf-8 -*-
import os, config
from functools import wraps
from flask import (
Flask, request, json, jsonify,
render_template, send_from_directory,
session, url_for, redirect
)
from flask_oauthlib.client import OAuth
import mido
import melete.lyrics as Lyrics
import melete.rhythm... |
# Import flask
from flask import Flask
from flask import render_template, request, make_response, redirect
from flask import current_app
from flask.ext.sqlalchemy import SQLAlchemy
import hashlib
# Library for bitmarket
from swaper import Yolo
# Make app instance
app = Flask(__name__)
app.config['SQLALCHEMY_DATABASE_UR... |
import os
from flask import Flask, render_template, request, redirect, url_for
from flask_sqlalchemy import SQLAlchemy
from oauth2client import client, crypt
app = Flask(__name__)
# DATABASE_URL = os.environ.get('DATABASE_URL', 'sqlite:////tmp/flask_app.db')
DATABASE_URL = os.environ['DATABASE_URL']
app.config['SQL... |
#!/usr/bin/env python
import urllib
import json
import os
from flask import Flask
from flask import request
from flask import make_response
from flask import render_template
import sys
import logging
# import pickle
# Flask app should start in global layout
app = Flask(__name__)
app.logger.addHandler(logging.Strea... |
import os
import pyopenstates
import sys
apikey = os.environ.get('OPENSTATES_API_KEY')
# search = sys.argv[1]
search = 'firearms'
def outputAbbr(state):
print(state)
return state.get('abbreviation')
def queryState(state, search_terms):
file = state + '-data.txt'
output = open(file, 'w')
metada... |
import os
import tornado.httpserver
import tornado.ioloop
import tornado.web
from creds import *
from requests import Request
import requests
import json
import re
import tempfile
import redis
import uuid
import random
import string
import ast
from pydub import AudioSegment
def gettoken(uid):
red = redis.from_url(r... |
#!/usr/bin/env python
import urllib
import json
import os
from flask import Flask
from flask import request
from flask import make_response
import psycopg2
import urlparse
global name
global singletonObject
# Flask app should start in global layout
app = Flask(__name__)
@app.route('/webhook', methods=['POST','GET... |
import random
import sys
import time
from selenium import webdriver
from flask import Flask, jsonify, redirect
app = Flask(__name__)
app.debug = True
__email_chars = 'abcdefghijklmnopqrstuvwxyz1234567890'
def __random():
res = ''
while len(res) < 10:
res += random.choice(__email_chars)
return re... |
import os, sys
from urlparse import urlparse, urlunparse
from flask import Flask, send_from_directory, request, redirect
from jinja2.exceptions import TemplateNotFound
PROJECT_ROOT = os.path.dirname(__file__)
WWW_ROOT = os.path.join(PROJECT_ROOT, 'www')
STATIC_ROOT = os.path.join(WWW_ROOT, 'static')
WWW_URL = "www.YOU... |
import os
from functools import wraps
import base64
import json
import time
from flask import (
Flask, render_template, session, g, flash,
request, redirect, url_for, jsonify
)
import database
def login_required(f):
@wraps(f)
def wrapper(*args, **kwargs):
session_keys = (
'us... |
#!flask/bin/python
from flask import Flask, jsonify
import json
app = Flask(__name__)
@app.route('/', methods=['GET'])
def index():
return "OK"
@app.route('/shift', methods=['GET'])
def getShifts():
with open('./var/shifts.json') as data_file:
shifts = json.load(data_file)
return jsonify(shif... |
from flask import Flask, request, render_template
import numpy as np
import json
import codecs
import os
app = Flask(__name__)
W0 = 0
W1 = 0
APP_ROOT = os.path.dirname(os.path.abspath(__file__))
@app.route('/')
def index():
return render_template('index.html')
@app.route('/recognizer/', methods=['GET', 'POST'])... |
from flask import Flask
from redis import Redis, RedisError
import os
import socket
app = Flask(__name__)
# Connect to Redis
redis = Redis(host=os.environ.get('REDIS_HOST', 'redis'), port=6379)
@app.route("/")
def hello():
try:
visits = redis.incr('counter')
except RedisError:
visits = "<i>co... |
from datetime import date
import tornado.escape
import tornado.ioloop
import tornado.web
import rethinkdb as r
r.connect( "localhost", 28015).repl()
import json
import urlparse
import random
import string
import itertools
from datetime import datetime
def id_generator(size=6, chars=string.ascii_uppercase + string.digi... |
from flask import Flask, jsonify, request
from uno import admin_start_game, create_new_game, get_state, join_game, \
leave_game, play_card, player_draw_card
app = Flask(__name__)
@app.route('/newgame')
def new_game_route():
game_name = request.args.get('game_name')
player_name = request.args.get('player_... |
#!/usr/bin/env python
import os
import re
import sys
import json
import urllib2
import logging
from urllib import urlencode
from collections import defaultdict
from bottle import route, template, static_file, request, redirect, default_app
import config
logging.basicConfig(format = '%(asctime)-15s %(message)s', leve... |
from datetime import date
import tornado.escape
import tornado.ioloop
import tornado.web
import rethinkdb as r
r.connect( "localhost", 28015).repl()
import json
import urlparse
import random
import string
import itertools
def id_generator(size=6, chars=string.ascii_uppercase + string.digits):
return ''.join(random... |
from datetime import date
import tornado.escape
import tornado.ioloop
import tornado.web
import rethinkdb as r
r.connect( "localhost", 28015).repl()
import json
import urlparse
import random
import string
import itertools
from datetime import datetime
import requests
import os
def id_generator(size=6, chars=string.asc... |
"""Deals that really exist."""
import json
import os
import logging
import random
import bottlenose
import xmltodict
from flask import Flask, render_template
logging.basicConfig(level=logging.INFO)
AWS_ACCESS_KEY_ID = os.environ.get('AWS_ACCESS_KEY_ID')
AWS_SECRET_ACCESS_KEY = os.environ.get('AWS_SECRET_ACCESS_KEY'... |
from flask import Flask
application = Flask(__name__)
application.config.from_object("local_config")
application.config.from_object("config")
SECRET_KEY="WeAOcOqFruPTsb6bXKNU"
for blueprint in application.config["BLUEPRINTS"]:
application.register_blueprint(**blueprint)
if __name__ == "__main__":
applicatio... |
from __future__ import unicode_literals
from utils import CanadianScraper, CanadianPerson as Person
import csv
import json
import math
import re
import lxml.html
import requests
import scrapelib
from lxml import etree
from opencivicdata.divisions import Division
from pupa.utils import get_pseudo_id
from six import St... |
#!/usr/bin/python3
"""
Copyright (c) 2016, 2017 - o2r project
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... |
# Copyright 2010 Curtis McEnroe <programble@gmail.com>
# Licensed under the GNU GPLv3
from scope import Scope
class Base:
def __init__(self, data):
self.data = data
self.meta = {"name": None}
def __eq__(self, other):
# Must be of same type to compare
if self.__class__ == other... |
#Some house_ids with data:
#6 15 83 360 362 365 368 380 382 385 386 390 404 405 409
import sys
import pandas as pd
import numpy as np
#import matplotlib.pyplot as plt
pd.set_option('max_columns', 50)
if len(sys.argv)>1:
csvloss = pd.read_csv('../dat/curr_udplatency.csv', error_bad_line... |
# Copyright 2013-2015 DataStax, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... |
import os.path
from datetime import timedelta
from functools import partial
import pandas as pd
import numpy as np
from ceam import config
from ceam.tree import Node
from ceam.modules import DataLoaderMixin, ValueMutationNode, DisabilityWeightNode
from ceam.util import rate_to_probability
from ceam.state_machine imp... |
import asyncio
import datetime
import json
import math
import os
import random
import struct
import time
import traceback
import urllib.parse
from ast import literal_eval
from io import BytesIO
import aiohttp
import discord
import websockets
from PIL import Image
from discord.ext import commands
from discord.ext.comma... |
from rpython.rlib.debug import make_sure_not_resized
from rpython.rlib.rbigint import rbigint
from rpython.rlib.rrandom import Random
from rpython.rlib import jit
from som.interpreter.bc.interpreter import Interpreter
from som.interpreter.bc.bytecodes import Bytecodes
from som.interpreter.bc.frame import Frame
from s... |
# cerbero - a multi-platform build system for Open Source software
# Copyright (C) 2012 Andoni Morales Alastruey <ylatuya@gmail.com>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free Software Foundation; eit... |
"""Command line interface for chalice.
Contains commands for deploying chalice.
"""
import os
import json
import logging
import click
import botocore.exceptions
import botocore.session
from chalice import deployer
from chalice import __version__ as chalice_version
from chalice.logs import LogRetriever
from chalice ... |
# -*- coding: utf-8 -*-
import time
import filemanager
import telegram
import steam
import random
import osu
import hearthstone
import sys
import mumbleboxes
# Check per la modalità votazione del bot, corrisponde al numero della chat in cui è attiva la votazione
# 0 per disattivare la votazione
class Votazione:
c... |
from __future__ import absolute_import
from logging import getLogger
from .simple_flock import SimpleFlock
Logger = getLogger('chime.view_functions')
from os.path import join, isdir, realpath, basename, exists, sep, split, splitext
from datetime import datetime
from os import listdir, environ, walk
from urllib impor... |
import os
import re
import logging
import subprocess
from ... import constants
from ...config import get_config_value, assert_config_key
from ...demote import check_call_demoted, check_output_demoted
def _name_for_rule(forwarding_spec, protocol):
return '{}_{}_{}'.format(constants.VIRTUALBOX_RULE_PREFIX, forwardi... |
import datetime
import telebot
import logging
import sys
from telebot import types
reload(sys)
sys.setdefaultencoding("utf-8")
execfile("locale.py")
execfile("config.py")
logfile = open("bot.log", "a")
time = datetime.datetime.now()
logfile.write("Bot Started: " + str(time) + " with ")
print("Bot started: " + str... |
# By Timon Pike
# Discord bot for rolling dice for a variety of RPG systems
import discord, os
from discord.ext import commands
import re
from diceroller import *
description = """
A bot that can handle a large variety of simple and complex roll commands for Role-Playing Games.
"""
help_text = """
The ba... |
"""
Octeon rewrite
"""
import logging
import re
import warnings
from html import escape
from pprint import pformat
from uuid import uuid4
from telegram import (Bot, InlineKeyboardButton, InlineKeyboardMarkup,
InlineQueryResultArticle, InlineQueryResultCachedPhoto,
InlineQuer... |
import datetime
import telebot
import logging
from telebot import types
time = datetime.datetime.now()
print("Bot started: " + str(time))
# CONFIG
TOKEN = '116144035:AAHVDjt5VX-5bKGGrbtw6QJPEZF4reJcIjc' # BOT TOKEN
LOGGING = False # FOR DEBUGGING PURPOSES ONLY
SAFE_ECHO = False # DOONT REPLY TO MESSAGES SENT IN SUPE... |
#! /usr/bin/python
import asyncore
import logging
import re
import select
import signal
import subprocess
import sys
import time
from irc import Bot
from ircbot import SingleServerIRCBot, nm_to_n as get_nick
from listener import Listener
# FIXME figure out async subprocess
# FIXME use optparse and/or configreader
l... |
#!/usr/bin/env python
# bot.py runs domfuzz, jsfunfuzz, or Lithium for a limited amount of time.
# It stores jobs using ssh, using directory 'mv' for synchronization.
import os
import platform
import random
import shutil
import socket
import subprocess
import sys
import time
import uuid
import tempfile
from multiproc... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# vim: sw=4:ts=4:expandtab
""" Miscellaneous CKAN Datastore scripts """
from __future__ import (
absolute_import, division, print_function, with_statement,
unicode_literals)
import traceback
import sys
from pprint import pprint
from os import unlink, environ, pa... |
import copy
import os
import logging
from typing import List, Optional, Dict
from collections import OrderedDict, defaultdict
from sortedcontainers import SortedDict
import elftools
from elftools.elf import elffile, sections, dynamic, enums
from elftools.dwarf import callframe
from elftools.common.exceptions import EL... |
#!/usr/bin/python
import os
import re
import sys
import time
import json
import common
import hashlib
import getpass
import datetime
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support.ui import Select
def generateid(t):
return "%s-%s-%s-%s" % (t["date"],t... |
import json
import httplib
import ssl
import sys
from optparse import OptionParser
service_host = 'ec2-54-148-81-107.us-west-2.compute.amazonaws.com'
service_port = 4273
def main():
parser = OptionParser(usage="usage: %prog [options] or --help for options",
version="%prog 1.0")
par... |
import sys
import json
import urllib2
import traceback
class Ophion:
def __init__(self, host):
self.host = host
self.url = host + "/vertex/query"
# entry point
def query(self):
return OphionQuery(self)
# conditions
def eq(self, v):
return {'eq': v}
def neq(sel... |
#!/usr/bin/env python
"""Usage: %s COMMAND [OPTIONS] arguments...
Options:
-c <config file> Read config JSON from file or if `-` from STDIN.
-v Verbose output.
Commands:
create <file> <num_levels> <source>
Create an MBTiles file from a GDAL source.
-r Resume ... |
#!/usr/bin/env python
from docopt import docopt
import sys
from cloudmesh.cm_mongo import cm_mongo
from cloudmesh.config.cm_config import cm_config
from cloudmesh.user.cm_user import cm_user
from prettytable import PrettyTable
from cloudmesh_common.logger import LOGGER
from tabulate import tabulate
log = LOGGER(__fi... |
#!/usr/bin/env python
## top-level script for generating probability distributions for component scores as part of CMS 2.0.
## last updated: 09.21.16 vitti@broadinstitute.org
from dists.likes_func import get_old_likes, read_likes_file, plot_likes, get_hist_bins
from dists.freqbins_func import get_bin_strings, get_bin... |
import sys
import logging
import operator
from datetime import datetime, timedelta
from flask import (request, render_template, flash,
url_for, redirect, current_app)
from flask_babel import gettext
from sqlalchemy import desc
import conf
from web import __version__
from conf import API_ROOT, ADMIN_... |
#!/usr/bin/python
#
# Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... |
import json
import re
from collections import Iterable
from datetime import datetime as dt
from datetime import timedelta as td
from functools import lru_cache
from http.client import HTTPResponse
from urllib import error, parse, request
from .utils import REQUEST_SCHEMA, RUZ_API_ENDPOINTS, RUZ_API_URL, Logger
class... |
#!/usr/bin/python
import sys
import LowPassFilter
from twisted.internet import reactor
from twisted.python import log
from twisted.web.server import Site
from twisted.web.static import File
from autobahn.twisted.websocket import WebSocketServerFactory, \
WebSocketServerProtocol, \
listenWS
LPF=LowPassFilter.L... |
from time import sleep
from dtest import Tester
from assertions import *
from tools import *
class TestConsistency(Tester):
def quorum_quorum_test(self):
cluster = self.cluster
cluster.populate(3).start()
[node1, node2, node3] = cluster.nodelist()
cursor1 = self.cql_connection(no... |
#!/usr/bin/python
#
# bitehist.py Block I/O size histogram.
# For Linux, uses BCC, eBPF. Embedded C.
#
# Written as a basic example of using histograms to show a distribution.
#
# A Ctrl-C will print the gathered histogram then exit.
#
# Copyright (c) 2015 Brendan Gregg.
# Licensed under the Apache License, Version 2.... |
# Copyright (c) 2012 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 ntpath
import posixpath
import re
from buildbot.process import factory
from buildbot.process.properties import WithProperties
from buildbot.steps.... |
from ..tools.velocity_embedding import quiver_autoscale, velocity_embedding
from ..tools.utils import groups_to_bool
from .utils import default_basis, default_size, default_color, get_components, savefig_or_show, default_arrow, \
make_unique_list, get_basis
from .scatter import scatter
from .docs import doc_scatter... |
import itertools
import mock
import os
import random
from typing import Any, Callable, Dict, Iterable, List, \
Mapping, Optional, Sequence, Set, Tuple
import ujson
from django.conf import settings
from django.core.management import call_command
from django.core.management.base import BaseCommand, CommandParser
fro... |
"""
Django settings for WebApp_One project.
Generated by 'django-admin startproject' using Django 1.11.5.
For more information on this file, see
https://docs.djangoproject.com/en/1.11/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.11/ref/settings/
"""
import... |
#!/usr/bin/env python
# CommandLine.py
# Copyright (C) 2006 CCLRC, Graeme Winter
#
# This code is distributed under the BSD license, a copy of which is
# included in the root directory of this package.
#
# 12th June 2006
#
# A handler for all of the information which may be passed in on the command
# line. This... |
# -*- coding: utf-8 -*-
import json
import requests
from helpers import mc
class ShakeService(object):
"""This class is an implement of the Wechat service of shaking.
All request's urls come from the official documents.
(Link: https://mp.weixin.qq.com/wiki/home/index.html)
"""
def __init__(self... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.