src stringlengths 721 1.04M |
|---|
import subprocess
import zipfile
import os
import shutil
from angular_gen.jinja_filters import sub_routes_filter
from jinja2 import Environment, FileSystemLoader
from main.common import BColors, FrontendGenerator
_MSG_HEADER_INFO = BColors.OKBLUE + "ANGULAR GENERATOR:" + BColors.ENDC
_MSG_HEADER_FAIL = BColors.FAIL +... |
# Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... |
"""Portal view functions (i.e. not part of the API or auth)"""
from datetime import datetime
from pprint import pformat
from time import strftime
from urllib.parse import urlencode
from celery.exceptions import TimeoutError
from celery.result import AsyncResult
from flask import (
Blueprint,
Response,
abo... |
# -*- coding: utf-8 -*-
# Copyright (c) 2015 Detlev Offenbach <detlev@die-offenbachs.de>
#
"""
Module implementing the Flash Cookies Manager configuration page.
"""
from __future__ import unicode_literals
from E5Gui.E5PathPicker import E5PathPickerModes
from .ConfigurationPageBase import ConfigurationPageBase
from... |
import re
import logging
from lymph.core.interfaces import Component
from lymph.core import trace
logger = logging.getLogger(__name__)
class Event(object):
def __init__(self, evt_type, body, source=None, headers=None, event_id=None):
self.event_id = event_id
self.evt_type = evt_type
sel... |
"""modelsimp_array_test.py - test model reduction functions
RMM, 30 Mar 2011 (based on TestModelSimp from v0.4a)
"""
import numpy as np
import pytest
from control import StateSpace, forced_response, tf, rss, c2d
from control.exception import ControlMIMONotImplemented
from control.tests.conftest import slycotonly, m... |
"""Constant definitions.
This file is loaded during the program initialisation before the main module is
imported. Consequently, this file must not import any other modules, or those
modules will be initialised before the main module, which means that the DEBUG
value may not have been set correctly.
This module is in... |
from machine import enable_irq, disable_irq
import time
# this onewire protocol code tested with Pycom LoPy device and AM2302/DHT22 sensor
def getval(pin):
ms = [1]*700 # needs long sample size to grab all the bits from the DHT
time.sleep(1)
pin(0)
time.sleep_us(10000)
pin(1)
irqf = dis... |
from rdkit.ML import FeatureSelect as FS
from rdkit import DataStructs as DS
from rdkit import RDConfig
import unittest
class TestCase(unittest.TestCase):
def setUp(self) :
pass
def test0FromList(self) :
examples = []
bv = DS.ExplicitBitVect(5)
bv.SetBitsFromList([0,2,4])
examples.app... |
# Django settings for example project.
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@example.com'),
)
MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle... |
import pickle
from tensorflow.python.platform import gfile
import util.tokenizer
import re
import os
import special_vocab as config
_PAD = config._PAD
_GO = config._GO
_EOS = config._EOS
_UNK = config._UNK
_START_VOCAB = config._START_VOCAB
PAD_ID = config.PAD_ID
EOS_ID = config.EOS_ID
GO_ID = config.GO_ID
UNK_ID = c... |
# Week 3 - 6) Write the pseudocode and code for a function that reverses the
# words in a sentance. Input: "This is awesome" Output: "awesome
# this Is". Give the Big O notation.
'''
PSEUDOCODE - ITERATIVE
----------------------
REVERSE_ORDER(s)
rev <- SPLIT s BY " "
reversed <- ""
... |
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
import time
import psutil
import mozcrash
from mozprocess import ProcessHandler
from threading import Event
from mozlog... |
#!/usr/bin/env python2.6
#-*- coding: utf-8 -*-
# Copyright [OnePanel]
#
# 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 b... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Copyright 2014 Message Bus
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... |
from __future__ import absolute_import
from django.core.signing import SignatureExpired
from sentry.models import OrganizationMember
from sentry.testutils import TestCase
from sentry.web.frontend.msteams_extension_configuration import MsTeamsExtensionConfigurationView
from sentry.utils.compat.mock import patch
from s... |
#
# client.py
#
import os
import os.path
import re
import shutil
import fnmatch
import time
from string import ascii_letters, digits
from datetime import datetime
from mimetypes import guess_type
import subprocess
import dulwich.errors
import dulwich.repo
import dulwich.objects
from dulwich.pack import Pack
from dul... |
from functools import wraps
import json
from flask import request, Response
from flask.ext.classy import FlaskView
def get_request_type():
types = {
'application/json': 'json',
'application/xml': 'xml'
}
if 'Content-Type' in request.headers:
if request.headers['Content-Type'] in types:
retur... |
#!/usr/bin/env python
#-*- coding: utf-8 -*-
'''
# This file is part of Matching Pursuit Python program (python-MP).
#
# python-MP 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 ... |
#!/usr/bin/python
# <armadev> mikeperry: v3 fetchers fetch about 8 times a day
# <armadev> v2 fetchers fetch about 48 times a day
# <armadev> except, as karsten pointed out, the v2 fetchers might fetch
# more than that, since some fail and they retry
# So v2 fetches are 6.0 times more frequent than v3 fetche... |
import warnings
from copy import copy, deepcopy
from datetime import datetime, timedelta
from textwrap import dedent
import numpy as np
import pandas as pd
import pytest
import pytz
from xarray import Coordinate, Dataset, IndexVariable, Variable, set_options
from xarray.core import dtypes, duck_array_ops, indexing
fr... |
"""
File: fitjet_3d.py
Fits a geometric model to mock jet data. Uses image subtraction;
otherwise same as fitjet.py
"""
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
from matplotlib import cm
import scipy.optimize as op
import emcee
import triangle
import sys
# These mock data are pr... |
import datetime
import json
import os
from . import data
def new_db(data_path):
return Db(open(data_path, 'wb+'))
def open_db(data_path):
return Db(open(data_path, 'rb+'))
class Db(object):
def __init__(self, fd):
self.fd = fd
def add_blueprint(self, raw_bp):
self.fd.seek(0, os.S... |
from django.http import Http404
from django.shortcuts import get_object_or_404
from django.template.response import TemplateResponse
from us_ignite.common import pagination
from us_ignite.common.response import json_response
from us_ignite.maps.utils import get_location_dict
from us_ignite.testbeds.models import Testb... |
# Copyright I. Nabney, N.Lawrence and James Hensman (1996 - 2014)
# Scaled Conjuagte Gradients, originally in Matlab as part of the Netlab toolbox by I. Nabney, converted to python N. Lawrence and given a pythonic interface by James Hensman
# Modified from GPy SCG optimisation
from __future__ import print_function
i... |
import datetime as dt
import time
import sys
import zmq
from utils import convert_size, dump_to_csv, parseSize, row_print, utf8len
def zeromq_client(lim='10 MB', rounds = 0):
context = zmq.Context()
publisher = context.socket(zmq.PUB)
publisher.bind("tcp://*:5563")
cnt = 0
running_bytes = 0
client_start =... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
import datetime as dt
import decimal
from datetime import datetime
import mongoengine as me
from marshmallow import validate, Schema
import pytest
from marshmallow_mongoengine import (fields, fields_for_model, ModelSchema,
... |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
from six import iteritems, string_types
import datetime
import frappe, sys
from frappe import _
from frappe.utils import (cint, flt, now, cstr, strip_html, getdate, get_datetime, ... |
# Copyright 2016 The TensorFlow 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 applica... |
#-*- coding: utf-8 -*-
import os
import sys
from macaca import WebDriver
sys.path.append(os.path.split(os.path.split(os.path.abspath(''))[0])[0])
from Public.Log import Log
from Public.ReportPath import ReportPath
from Public.BasePage import BasePage
from THhealth.PageObject.THhealthHomePage import THhealthHomePage... |
import re
import time
import tempfile
import platform
import datetime
import subst
import threading
import serial
import socket
from math import pi,cos,acos,sin,atan2
import utils
if __name__ == "__main__":
import gettext
gettext.install("D-RATS")
TEST = "$GPGGA,180718.02,4531.3740,N,12255.4599,W,1,07,1.4,... |
import sys
try:
from django.conf import settings
from django.test.utils import get_runner
settings.configure(
DEBUG=True,
USE_TZ=True,
DATABASES={
"default": {
"ENGINE": "django.db.backends.sqlite3",
}
},
ROOT_URLCONF="time_me... |
# -*- coding: utf-8 -*-
"""
Make API calls.
.. moduleauthor:: Jiwen Xin <kevinxin@scripps.edu>
"""
from collections import defaultdict
from copy import deepcopy
from itertools import groupby
from operator import itemgetter
from .registry import Registry
from .apicall import BioThingsCaller
from .api_output_parser im... |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... |
import sys
sys.path.insert(1,"../../")
import h2o
from tests import pyunit_utils
def confusion_matrices_check():
local_data = [[1, 'a'],[1, 'a'],[1, 'a'],[1, 'a'],[1, 'a'],[1, 'a'],[1, 'a'],[1, 'a'],[1, 'a'],[1, 'a'],[0, 'b'],
[0, 'b'],[0, 'b'],[0, 'b'],[0, 'b'],[0, 'b'],[0, 'b'],[0, 'b'],[0... |
#!/usr/bin/env python
# coding=utf-8
# Copyright [2017] [B2W Digital]
#
# 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... |
#!/usr/bin/env python
from migrate.versioning import api
from config import SQLALCHEMY_DATABASE_URI
from config import SQLALCHEMY_MIGRATE_REPO
from app import db
from app.models import Role, Setting
import os.path
import time
import sys
def start():
wait_time = get_waittime_from_env()
if not connect_db(wait_... |
#!/usr/bin/env python
# coding: utf8
"""
Tests for cssselect
===================
These tests can be run either by py.test or by the standard library's
unittest. They use plain ``assert`` statements and do little reporting
themselves in case of failure.
Use py.test to get fancy error reporting ... |
#!/usr/bin/env python
# -*- coding:utf-8 -*-
import datetime
import matplotlib.pyplot as plt
import argparse
import os
if __name__=='__main__':
parser = argparse.ArgumentParser(description='Draw pictures based on the data of input file.')
parser.add_argument('-i', '--ifile', type=str, required=True)
parse... |
#!/usr/bin/python
# ----------------------------------------------------------------------
# Copyright (2010) Aram Davtyan and Garegin Papoian
# Papoian's Group, University of Maryland at Collage Park
# http://papoian.chem.umd.edu/
# Last Update: 03/04/2011
# ---------------------------------------------------------... |
#!/usr/bin/env python3
# Copyright (c) 2009-2019 The Bitcoin Core developers
# Copyright (c) 2014-2019 The DigiByte Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test behavior of -maxuploadtarget.
* Verify tha... |
# vim: ts=4:sw=4:expandtabs
__author__ = 'zach.mott@gmail.com'
from django.conf import settings
from django.views import generic
from django.contrib import messages
from django.shortcuts import redirect
from django.template.loader import get_template
from django.utils.translation import ugettext_lazy as _
from email... |
from django.db import models
from .models import BaseLogEntry
all_known_log_models = {}
def define_log_model(
model_class,
base_class=BaseLogEntry,
on_delete=models.CASCADE,
allow_null_target=False,
):
"""
Define a log model for a given Django model class ("parent model").
The log entry... |
# -*- coding: utf-8 -*-
from Plugins.Extensions.MediaPortal.plugin import _
from Plugins.Extensions.MediaPortal.resources.imports import *
from Plugins.Extensions.MediaPortal.resources.simpleplayer import SimplePlayer, SimplePlaylist
from Plugins.Extensions.MediaPortal.resources.twagenthelper import twAgentGetPage
ST... |
# --------------------------------------------------------------------------
# The MIT License (MIT)
#
# Copyright (c) 2014-2016 Digital Sapphire
#
# 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 Soft... |
import boto3, botocore
import os, uuid, json, sys
from urlparse import urlparse
from boto3.s3.transfer import S3Transfer
from pyntaws.services._session import AWSSession
import __builtin__
__builtin__.validated_templates = list()
class AWSCloudFormation(AWSSession):
def __init__(self, **kwargs):
super(self.__... |
"""
Command line interface programs for the GA4GH reference implementation.
TODO: document how to use these for development and simple deployment.
"""
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import argparse
import logging
import unittest
import uni... |
from HTMLComponent import HTMLComponent
from GUIComponent import GUIComponent
from config import KEY_LEFT, KEY_RIGHT, KEY_HOME, KEY_END, KEY_0, KEY_DELETE, KEY_BACKSPACE, KEY_OK, KEY_TOGGLEOW, KEY_ASCII, KEY_TIMEOUT, KEY_NUMBERS, config, configfile, ConfigElement, ConfigText, ConfigPassword
from Components.ActionMap im... |
import os
import sys
from types import *
from distutils.errors import *
from distutils.dep_util import newer_group
from distutils.core import Extension as old_Extension
from distutils.command.build_ext import build_ext as _build_ext
from distutils import log
from utils import fullsplit
class external_ob... |
# Copyright (c) 2016 EMC Corporation
# 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 requir... |
# Copyright (c) 2015 Dell 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 a... |
from django.test import TestCase
from school.models import Semester, StaffMember, Department, Subject, SchoolClass, Student, Enrolment
from sync.google_admin import GoogleSync
from django.conf import settings
import datetime
#class SchoolTest(TestCase):
class SchoolTest(TestCase):
def setUp(self):
#import ... |
import os, sys, cookbook
from env import *
_ensembl_data_dir = os.path.join(get_data_dir(), 'ensembl')
def gene_location_filename( genome ):
return os.path.normpath(
os.path.join(
_ensembl_data_dir,
'gene_locations-%s.txt' % genome
)
)
def ense... |
""" Test functions for stats module
WRITTEN BY LOUIS LUANGKESORN <lluang@yahoo.com> FOR THE STATS MODULE
BASED ON WILKINSON'S STATISTICS QUIZ
https://www.stanford.edu/~clint/bench/wilk.txt
Additional tests by a host of SciPy developers.
"""
from __future__ import division, print_function, absolute_imp... |
# -*- coding: utf-8 -*-
#
# libcbor documentation build configuration file, created by
# sphinx-quickstart on Sun Jun 8 13:27:19 2014.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# A... |
#------------------------------------------------------------------------------
#
# Copyright (c) 2006, Enthought, Inc.
# All rights reserved.
#
# This software is provided without warranty under the terms of the BSD
# license included in enthought/LICENSE.txt and may be redistributed only
# under the conditions d... |
"""
The latest version of this package is available at:
<http://github.com/jantman/biweeklybudget>
################################################################################
Copyright 2016 Jason Antman <jason@jasonantman.com> <http://www.jasonantman.com>
This file is part of biweeklybudget, also known as bi... |
# -*- coding: utf-8 -*-
"""
Online Analysis Configuration Editor - Base class with logging functions
Version 2.0
Michele Devetta (c) 2013
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 ver... |
from end_to_end_test import EndToEndTest
import test_config as config
#=============================================================
# This tests that an account with permission to manage a farm
# can delete another account management with farm management
# Permissions.
# Requires test farm, test farmer, and test far... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
# @Author: dbirman
# @Date: 2017-06-14 16:51:24
import sys
import csv
import random
import webbrowser
import os
import numpy as np
# other functions
def n... |
import http.client
import urllib
import logging
import redis
from rq import Queue
import blockbuster.config as config
import blockbuster.bb_auditlogger as bb_auditlogger
# Set up RQ queue
conn = redis.from_url(config.REDIS_URL)
q = Queue(connection=conn)
log = logging.getLogger(__name__)
def send_push_notification... |
import os
from collections import defaultdict
from tempfile import NamedTemporaryFile
from lxml import etree
from django.contrib import messages
from django.contrib.admin.utils import construct_change_message
from django.contrib.auth.mixins import LoginRequiredMixin, PermissionRequiredMixin
from django.contrib.messag... |
import json
import os
import subprocess
import uuid
import passlib.hash
import pytest
import gen
import gen.build_deploy.aws
import release
from dcos_installer import backend
from dcos_installer.config import Config, make_default_config_if_needed, to_config
os.environ["BOOTSTRAP_ID"] = "12345"
@pytest.fixture(scop... |
# -*- coding: utf-8 -*-
#
# Author: Alexandre Fayolle, Leonardo Pistone
# Copyright 2014-2015 Camptocamp SA
#
# 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... |
from SerialConnection import SerialConnection
from time import sleep
class AgilentInstrument(SerialConnection):
"""Generic SCPI interface to Agilent power supply instruments. The SCPI commands below are handled.
MEASure
:CURRent[:DC]?
[:VOLTage][:DC]?
[SOURce]
:CURRent[:LEVel][:IMMedi... |
from setuptools import setup
from setuptools.command.test import test as TestCommand
import sys
class PyTest(TestCommand):
user_options = [('pytest-args=', 'a', 'Arguments to pass to py.test')]
def initialize_options(self):
TestCommand.initialize_options(self)
self.pytest_args = []
def ... |
"""
Helper script for starting up bolts and spouts.
"""
import argparse
import importlib
import os
import sys
from pystorm.component import _SERIALIZERS
RESOURCES_PATH = 'resources'
def main():
"""main entry point for Python bolts and spouts"""
parser = argparse.ArgumentParser(description='Run a bolt/spout ... |
"""@file angspec.py
contains the angular spectrum feature computer"""
import numpy as np
import base
import feature_computer
from sigproc import snip
class Angspec(feature_computer.FeatureComputer):
"""the feature computer class to compute angular spectrum feature"""
def comp_feat(self, sig, rate):
... |
"""
Load mean geopotential heights and plot in colour
"""
import os, sys
import matplotlib.pyplot as plt
import matplotlib.cm as mpl_cm
from mpl_toolkits.basemap import Basemap
import iris
import numpy as np
import imp
import h5py
import cartopy.crs as ccrs
import scipy.interpolate
from textwrap import wrap
model... |
from wfuzz.externals.moduleman.plugin import moduleman_plugin
from wfuzz.plugin_api.base import BasePayload
from wfuzz.exception import FuzzExceptBadOptions
from wfuzz.fuzzobjects import FuzzWordType
@moduleman_plugin
class permutation(BasePayload):
name = "permutation"
author = ("Xavi Mendez (@xmendez)",)
... |
from __future__ import absolute_import
from django.conf import settings
try:
from django.conf.urls import url, patterns
except ImportError:
# for Django version less than 1.4
from django.conf.urls.defaults import url, patterns # NOQA
from django.http import HttpResponse
def handler404(request):
ret... |
# -*- coding: utf-8 -*-
# Copyright 2014 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Script to mount a built image and run tests on it."""
from __future__ import print_function
import os
import sys
import unitt... |
# -*- coding: utf-8 -*-
###
# (C) Copyright (2012-2016) Hewlett Packard Enterprise Development LP
#
# 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 limi... |
import sys
import Pyro4
import logging
sys.path.extend(['..', '../../..'])
from mupif import *
import mupif.Physics.PhysicalQuantities as PQ
log = logging.getLogger()
@Pyro4.expose
class application2(Model.Model):
"""
Simple application that computes an arithmetical average of mapped property
"""
def... |
from django.contrib.auth.models import User
from django.core.exceptions import ObjectDoesNotExist, PermissionDenied
from django.http import Http404
from oioioi.base.permissions import make_request_condition
from oioioi.problems.models import Problem
def join_paths(path1, path2):
if not path1:
return path2... |
# -*- coding: utf-8 -*-
'''
Exodus Add-on
Copyright (C) 2016 Exodus
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 l... |
# Samba-specific bits for optparse
# Copyright (C) Jelmer Vernooij <jelmer@samba.org> 2007
#
# 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... |
# Test that after 18 failed attempts at two factor authentication the account
# is logged out and suspended
from sst.actions import (
assert_displayed,
assert_element,
wait_for,
)
from u1testutils.sst import config
from acceptance import helpers
from acceptance.devices import (
add_device,
enter_ot... |
from datetime import datetime
import os
import requests
import json
from pheme.util.config import Config
def url_builder(predicate=None, resource=None, view=None, query_params={}):
"""Build webAPI url from config and passed values
:param predicate: desired action or type of document
:param resource: fil... |
# coding: utf-8
from test.lib.testing import eq_, assert_raises, assert_raises_message
import decimal
import datetime, os, re
from sqlalchemy import *
from sqlalchemy import exc, types, util, schema, dialects
for name in dialects.__all__:
__import__("sqlalchemy.dialects.%s" % name)
from sqlalchemy.sql import operat... |
# -*- coding: utf-8 -*-
# Copyright 2020 Google 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... |
"""
Testing tools for running cmdline methods
"""
import sys
import os
import imp
import logging
from functools import update_wrapper
import inspect
import textwrap
from contextlib import closing
import subprocess
from mock import patch
import execnet
from six.moves import cPickle # @UnresolvedImport
from . impo... |
'''Base Class for Efflux Telemetry Data'''
from abc import ABCMeta
import thread
import logging
from logging.handlers import TimedRotatingFileHandler
from os.path import expanduser
import requests
import efflux.logger as log
logger = log.get_logger(__name__)
def _handle_resp(resp, *args, **kwargs):
if resp.sta... |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Deleting field 'TeachingAssignment.default_skill_level'
db.delete_column(u'gsaudit_teachingassignment', 'd... |
from __future__ import (absolute_import, division, print_function,
unicode_literals)
from .scale import scale
from copy import deepcopy
class scale_fill_funfetti(scale):
"""
Make your plots look like funfetti
Parameters
----------
type: string
One of confetti or sp... |
# -*- coding: utf-8 -*-
# vim:sw=4:et:ai
# etk.docking documentation build configuration file, created by
# sphinx-quickstart on Thu Sep 23 17:46:41 2010.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogen... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from pwnpwnpwn import *
from pwn import *
#host = "10.211.55.28"
#port = 8888
host = "54.179.187.55"
port = 2301
r = remote(host,port)
def add(data):
r.recvuntil(":")
r.sendline("add")
r.recvuntil(":")
r.sendline(data)
for i in range(9):
add("61"*16... |
#!/usr/bin/python
from gi.repository import Gtk
import sys,re,os,time
import urllib2
import subprocess,signal
bitRates={
"QVGA":(1,[128,256,384,512]),
"VGA":(0,[128,256,384,512,640,768,896,1024]),
"720P":(3,[128,256,384,512,640,768,896,1024,1280,1536,1792,2048,2560,3072,3584,4096])
}
frameRates=range(1,31)
# ... |
#!/usr/bin/env python
"""This program inputs a MemberHub directory dump, and analyzes it.
"""
import family
import roster
import os
from openpyxl import load_workbook
MIN_NUM_ROSTER_FIELDS = 5
def ReadRosterAdultsFromMostRecent(file_name=None):
""" roster_tools.ReadRosterAdultsFromMostRecent
PURPOSE:
Gene... |
from setuptools import setup # Always prefer setuptools over distutils
import os
README = open(os.path.join(os.path.dirname(__file__), 'README.md')).read()
# allow setup.py to be run from any path
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))
setup(
name='django-ga-puller',
... |
import json
import requests
from cfg.config import (
CI_STAGES,
DEPLOY_STAGES,
VERSION_CONTROL_TYPE
)
def send_to_slack(body, webhook_url):
requests.post(webhook_url, data=json.dumps(body))
def message_builder(gocd_details, changeset, dashboard_url):
if VERSION_CONTROL_TYPE == 'GIT':
... |
import mock
from rest_framework import generics
from rest_framework import serializers
from rest_framework import status
from rest_framework.test import APIRequestFactory
from olympia.amo.tests import TestCase
from olympia.api.pagination import (
CustomPageNumberPagination, OneOrZeroPageNumberPagination,
ESPa... |
# -*- coding: utf-8 -*-
#
# Copyright © 2017 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions
# of the GNU General Public License v.2, or (at your option) any later
# version. This program is distributed in th... |
from __future__ import absolute_import, unicode_literals
import environ
import os
# Commented to be implemented later.
ROOT_DIR = environ.Path(__file__) - 3 # (/a/b/myfile.py - 3 = /)
APPS_DIR = ROOT_DIR.path('crm_core')
# Loading environment variables, and including the file for local environment
# definition
env =... |
"""add ignore and dev note to genomics models.
Revision ID: 434fb0f05794
Revises: 994dfe6e53ee
Create Date: 2020-09-30 14:39:16.244636
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '434fb0f05794'
down_revision = '994dfe6e53ee'
branch_labels = None
depends_on =... |
# -*- coding: UTF-8 -*-
from markdown_plugin_libs.markdown import markdown
from markdown_plugin_libs.markdown.extensions.fenced_code import FencedCodeExtension
from markdown_plugin_libs.markdown.extensions.codehilite import CodeHiliteExtension
from markdown_plugin_libs.markdown.extensions.tables import TableExtension
... |
# -*- coding: utf-8 -*-
"""
Analog In Plugin
Copyright (C) 2011-2012 Olaf Lüke <olaf@tinkerforge.com>
Copyright (C) 2014-2016 Matthias Bolte <matthias@tinkerforge.com>
analog_in.py: Analog In Plugin Implementation
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU Gener... |
# coding: utf-8
from smartbot import Behaviour
from smartbot import Utils
from smartbot import ExternalAPI
import re
import os
import random
class JokeBehaviour(Behaviour):
def __init__(self, bot):
super(JokeBehaviour, self).__init__(bot)
self.language = self.bot.config.get('main', 'language') if... |
#!/usr/bin/env python
import string
import ctypes
import os
from os import path
from threading import Thread
from time import sleep
import re
# For headless browsing. Life made easy.
from selenium import webdriver
from selenium.common.exceptions import NoSuchElementException
# Tkinter main
from Tkinter import Tk,... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from dateutil.parser import parse
from pprint import pformat
from traceback import format_exc
from model.dataset import Dataset
from model.species import Species
from model.leaflet_map import LeafletMap
from model.scatter_plot import ScatterPlot
from view.spatial_analysi... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.