CombinedText stringlengths 4 3.42M |
|---|
from flask import render_template, redirect,url_for, g
from flask_googleauth import GoogleAuth
from app import app
auth = GoogleAuth(app)
def getEmail(user):
return user.get(u'email', None)
def isCMU(email):
return email.split('@')[1] == 'andrew.cmu.edu'
def andrewID(email):
return email.split('@')[0]
... |
from sys import version_info
from django.conf import settings
from django.db.models import Exists
from django.db.models import Max
from django.db.models import OuterRef
from django.db.models.query import Q
from django.http.response import HttpResponseBadRequest
from django_filters.rest_framework import DjangoFilterBac... |
""" Utility functions related to HTTP requests """
import re
import logging
from django.conf import settings
from django.core.handlers.base import BaseHandler
from django.test.client import RequestFactory
from opaque_keys import InvalidKeyError
from opaque_keys.edx.keys import CourseKey
from opaque_keys.edx.locations... |
from __future__ import unicode_literals
import frappe
from frappe.custom.doctype.custom_field.custom_field import create_custom_field
def execute():
#auto repeat is not submittable in v12
frappe.reload_doc("automation", "doctype", "Auto Repeat")
frappe.db.sql("update `tabDocPerm` set submit=0, cancel=0, amend=0 whe... |
import re
import keyword
def hash_schema(schema, hashfunc=hash):
"""Compute a unique hash for a (nested) schema
Unlike the built-in hash() function, this handles
dicts, lists, and sets in addition to tuples.
"""
def make_hashable(val):
if isinstance(val, list):
return tuple(mak... |
##############################################################################
# Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... |
"""Module to initialise and configure the flask app and the db."""
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from configuration.config import app_config
db = SQLAlchemy()
def create_app(configuration):
"""Initialise and cofigure the app and db."""
app = Flask(__name__)
app.config.f... |
import simplejson
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from django.http import (HttpResponse, HttpResponseRedirect,
Http404, HttpResponsePermanentRedirect)
from django.shortcuts import get_object_or_404
from django.views.generic.list_detail i... |
from __future__ import (absolute_import, division, print_function, unicode_literals)
import numpy as np
import os
import random
from .helpers.corner import corner
import matplotlib.pyplot as plt
from matplotlib import colorbar
def draw_spectra(model, dataset):
""" Generate best-fit spectra for all the test object... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
interact with a local/remote libvirt daemon
"""
from defaults import TEMPLATES
import docker
from distutils.spawn import find_executable
from iptools import IpRange
from netaddr import IPAddress, IPNetwork
from libvirt import open as libvirtopen
import os
import socket... |
# Copyright (C) 2019-2020 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 that it will be usefu... |
# Generated by Django 2.2.9 on 2020-01-21 08:09
from django.db import migrations
NOTIFICATION_TYPES = (
'unpublished_event_deleted',
'event_published',
'draft_posted'
)
LANGUAGES = ['fi']
DEFAULT_LANGUAGE = 'fi'
FOOTER_FI = 'Tämä on automaattinen viesti Helsingin kaupungin tapahtumarajapinnasta. Viestiin... |
import numpy as np
import os
# imports for type hinting
from typing import Any, Tuple, TYPE_CHECKING
if TYPE_CHECKING:
from .network import Network
from functools import wraps
try:
from . import plotting # will perform the correct setup for matplotlib before it is called below
import matplotlib.pyplot ... |
#
# this test corresponds to the branch4 (using prerefl) in test_shadow4_mirrors.ows in shadow4/oasys_workspaces
#
import numpy
from syned.beamline.beamline import BeamlineElement
from syned.beamline.optical_elements.mirrors.mirror import Mirror as SyMirror
from syned.beamline.element_coordinates import ElementCoo... |
# -*- coding: utf-8 -*-
"""
treebeard.ns_tree
-----------------
Nested Sets Tree.
:copyright: 2008-2010 by Gustavo Picon
:license: Apache License 2.0
An implementation of Nested Sets trees for Django 1.0+, as described by
`Joe Celko`_ in `Trees and Hierarchies in SQL for Smarties`_.
... |
#!/usr/bin/env python2.5
#
# Copyright 2011 the Melange authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applic... |
import datetime
import json
import logging
import re
from BeautifulSoup import BeautifulSoup as soup
from xml.sax.saxutils import escape as xhtml_escape
from tornado.httpclient import AsyncHTTPClient
import tornado.web
from util.cache import Cache
from util.route import route
@route(r'/atom/(\d+)')
class AtomHandler... |
from mohawk import Receiver
from rest_framework import permissions
class IsStaffOrReadOnly(permissions.BasePermission):
"""
The request is authenticated as an admin staff (eg. sheriffs), or is a read-only request.
"""
def has_permission(self, request, view):
return (request.method in permiss... |
#!/usr/bin/env python
"""Representation of calls in ELAPS:PlayMat."""
from __future__ import division, print_function
from elaps import signature
from elaps.qt import QDataArg
from PyQt4 import QtCore, QtGui
from PyQt4.QtCore import pyqtSlot
class QCall(QtGui.QListWidgetItem):
"""Representation of a call in EL... |
# Copyright (C) 2013 Nippon Telegraph and Telephone Corporation.
# Copyright (C) 2015 Brad Cowie, Christopher Lorier and Joe Stringer.
# Copyright (C) 2015 Research and Education Advanced Network New Zealand Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in c... |
from flask import Flask, jsonify, request, abort, make_response, render_template, url_for, redirect
from models import *
from app import db, app
import datetime, requests, json
from pprint import pprint
@app.route('/', methods = ['GET'])
def index():
return redirect (url_for('get_all_blobs'))
@app.route('/blob/',... |
from __future__ import absolute_import, division, print_function, unicode_literals
import boto3
from configparser import ConfigParser, NoSectionError
from datetime import datetime
import logging
from os.path import expanduser, join
from os import environ
import requests
from warrant.aws_srp import AWSSRP
from amaasco... |
# -*- coding: utf-8 -*-
#
# Copyright 2019 Benjamin Kiessling
#
# 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... |
# Copyright 2013-2018 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class PyPygobject(PythonPackage):
"""bindings for the GLib, and GObject,
to be used in Py... |
#!/usr/bin/env python
import sys
import locale
import argparse
import tweepy
def write(data, stream = sys.stdout):
"""
Write "data" on the given stream, then flush, silently handling broken pipes.
"""
try:
stream.write(data)
stream.flush()
# Silently handle broken pipes
exce... |
from django.contrib import admin
from .models import Artist, Song
admin.AdminSite.site_title = 'Chords administration'
admin.AdminSite.site_header = 'Chords Administration'
class ArtistAdmin(admin.ModelAdmin):
exclude = ['slug']
actions = ['delete_selected']
def delete_selected(self, request, queryset)... |
from __future__ import print_function
import os, sys
import subprocess
import time
import tempfile
import threading
def _merge_snapshots(list1, list2):
"""
Given a list of snapshots, return a list of
common snapshots (sorted by creation time).
The return list is simply an array of names.
N.B.: Snap... |
#!/usr/bin/env python
import json
import argparse
import docker
class SwarmInspect:
def __init__(self, func=None):
cli = docker.from_env()
if func:
self.execute = func(cli)
def execute(self):
print("No EndPoint Resource Provided")
def discovery_nodes(cli):
node_list... |
# Copyright (c) 2014 by Ecreall under licence AGPL terms
# avalaible on http://www.gnu.org/licenses/agpl.html
# licence: AGPL
# author: Amen Souissi
import colander
import deform.widget
from pyramid.view import view_config
from dace.processinstance.core import DEFAULTMAPPING_ACTIONS_VIEWS
from dace.util import get... |
#!/usr/bin/env python2.5
#
# Copyright 2009 the Melange authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applic... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2012 Cyril Bonté
#
# 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 2015 Red Hat, 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 ... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright 2017 Ingo R.Keck
#
# 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 you... |
# ! /usr/bin/python
# Copyright 2014 Jeremy Carroll
#
# 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... |
""" venv_prompt
"""
import os
from threading import Thread
from smashlib.util import get_prompt_t, set_prompt_t
from smashlib.plugins import Plugins, SmashPlugin
def this_venv():
result = os.environ.get('VIRTUAL_ENV','')
result = result.replace(os.environ['HOME'],'~')
result = os.path.sep.join(result.split... |
from PyQt5.QtWidgets import QFrame, QAction, QMenu, QSizePolicy, QInputDialog, QDialog, \
QVBoxLayout, QTabWidget, QWidget, QLabel
from sakia.gui.widgets.dialogs import dialog_async_exec
from PyQt5.QtCore import QObject, QT_TRANSLATE_NOOP, Qt, QLocale
from .toolbar_uic import Ui_SakiaToolbar
from .about_uic import ... |
from flask import render_template, flash, redirect, request, session
from app import app
import requests
import json
import time
CLIENT_ID = os.environ['CLIENT_ID']
CLIENT_SECRET = os.environ['CLIENT_SECRET']
def error_healing(error_code):
if error_code == 1:
return 'Произошла неизвестная оши... |
#!/usr/bin/env ccp4-python
__author__ = "Jens Thomas, and Felix Simkovic"
__date__ = "22 Mar 2019"
__version__ = "1.0"
import argparse
import os
import logging
import multiprocessing
from ample.util import argparse_util
from ample.util.sequence_util import Sequence
from ample.util import logging_util
from ample.mode... |
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class RReticulate(RPackage):
"""Interface to 'Python' modules, classes, and functions. When call... |
import re
import itertools
from django.template.defaultfilters import slugify
def greek_to_english(string):
"""
Converts all greek letters to the corresponding english letters.
Useful for creating song slugs from greek song titles.
"""
GREEK_MAP = {
'α':'a', 'β':'b', 'γ':'g', 'δ':'d', 'ε'... |
# stdlib, alphabetical
import os
# Django core, alphabetical
from django.contrib import messages
from django.core.urlresolvers import reverse
from django.db import models
from django.db.models import Q
from django.http import Http404
from django.shortcuts import get_object_or_404
from django.shortcuts import redirect
... |
from __future__ import print_function
import os, sys
import json
import subprocess
import time
import tempfile
import threading
from io import BytesIO
import errno
import boto3
import botocore
import socket
debug = True
verbose = False
def _find_snapshot_index(name, snapshots):
"""
Given a list of sna... |
#!/usr/bin/env python3
#
# Copyright (c) 2017, Linaro Limited
#
# SPDX-License-Identifier: Apache-2.0
#
# vim: ai:ts=4:sw=4
import sys
from os import listdir
import os, fnmatch
import re
import yaml
import argparse
import collections
from devicetree import parse_file
from extract.globals import *
class Loader(yaml.... |
# -*- coding: utf-8 -*-
#
# Copyright 2019 Benjamin Kiessling
#
# 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 ... |
#!usr/bin/env python
"""
Custom library for interfacing with MediaWiki through API
Released under the MIT License
(C) Legoktm 2008-2009
See COPYING for full License
"""
import urllib2, urllib, re, time, getpass, cookielib
from datetime import datetime
import config
import simplejson, sys, os
class NotLoggedIn(Excep... |
#! /usr/bin/env python
""" NIPAP shell command
A shell command to interact with NIPAP.
"""
import ConfigParser
import csv
import os
import pipes
import re
import shlex
import string
import subprocess
import sys
import pynipap
from pynipap import Pool, Prefix, Tag, VRF, NipapError
from command import Command
#... |
import spotify
import random
import logging
def get_login_details():
file = open('.authentication', 'r')
csv = file.read()
details = csv.split(',')
file.close()
return details
logging.basicConfig(level=logging.DEBUG)
login = get_login_details()
print(login[0])
print(login[1])
session = spotify.... |
#!/usr/bin/python3 -i
#
# Copyright (c) 2017 The Khronos Group Inc.
# Copyright (c) 2017 Valve Corporation
# Copyright (c) 2017 LunarG, 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
#
... |
from django.shortcuts import get_object_or_404
from django.template import defaultfilters
from django.utils.translation import ugettext_lazy as _
from django.template.defaultfilters import truncatechars
from django import forms
from django import http
from django.views.generic import TemplateView
from django_cradmin.vi... |
# Load in core dependencies
import os
import re
import shutil
import subprocess
import sys
import tempfile
import time
import unittest
# Load in 3rd party dependencies
from jinja2 import Template
# Set up constants
__dir__ = os.path.dirname(os.path.abspath(__file__))
# TODO: Break this up into the core (split_sel, r... |
#!/usr/bin/env python2.7
# -*- coding: utf-8 -*-
"""
nr_openSMILE.py
Run selected openSMILE scripts on files with noises replaced by various methods
(see `openSMILE_preprocessing/noise_replacement` for noise replacement
details).
Author:
– Jon Clucas, 2016–2017 (jon.clucas@childmind.org)
© 2017, Child Mind Insti... |
from __future__ import print_function
import os, sys
import subprocess
import time
import tempfile
import threading
debug = True
def _merge_snapshots(list1, list2):
"""
Given a list of snapshots, return a list of
common snapshots (sorted by creation time).
The return list is simply an array of names.
... |
#!/usr/bin/env python
"""
Utilities for administering elasticsearch
These can be run locally when connected to the VPN
"""
from argparse import ArgumentParser, RawDescriptionHelpFormatter
from collections import namedtuple
import json
import sys
from elasticsearch import Elasticsearch
from elasticsearch.client import... |
import json
import os
import numpy
import sklearn
import pandas
from elephant.estimator import Estimator
def main(data_set_name):
with open(os.path.join('../specs', data_set_name + '.json')) as specs_file:
specs = json.load(specs_file)
data_set = pandas.read_csv(os.path.join('../data', specs['file'])... |
from __future__ import print_function
try:
# python 2
from Queue import Empty
except:
# python 3
from queue import Empty
import platform
from time import sleep
import logging
import os
try:
# IPython 3
from IPython.nbformat import NotebookNode
except ImportError:
from IPython.nbformat.cur... |
#!/usr/bin/env python
# encoding: utf-8
from rpcudp.rpcserver import RPCServer, rpccall, rpccall_n
from utils import period_task
import hashlib
KBUCKET_SIZE = 20
TREE_HEIGHT = 160
ALPHA = 3
"""
implement rpc call in kademlia
"""
class KademliaRpc(RPCServer):
@rpccall
def ping(self, dest):
pass
... |
from pyspark import SparkContext
import json
import time
print 'loading'
sc = SparkContext("spark://ec2-54-200-174-121.us-west-2.compute.amazonaws.com:7077", "Simple App")
# Replace `lay-k.json` with `*.json` to get a whole lot more data.
lay = sc.textFile('s3n://AKIAJFDTPC4XX2LVETGA:lJPMR8IqPw2rsVKmsSgniUd+cLhpItI42... |
import argparse
import os
import requests
import sys
import time
API_URL = "https://api.assemblyai.com/v2/"
def get_transcription(transcription_id):
"""Requests the transcription from the API and returns the JSON
response."""
endpoint = "".join([API_URL, "transcript/{}".format(transcription_id)])
he... |
from app import app
from flask import Flask, request, jsonify
import kairos
DEFAULT_GALLERY = 'default_gallery'
# App Logic
@app.route('/', methods=['GET'])
def index():
return 'yo'
@app.route('/upload', methods=['POST'])
def upload(name):
img_url = request.data['img_url']
name = request.data['name']
... |
# coding: utf-8
import hashlib
import json
import socket
import time
import uuid
from datetime import datetime, timedelta as td, timezone
from cronsim import CronSim
from django.conf import settings
from django.core.mail import mail_admins
from django.core.signing import TimestampSigner
from django.db import models
f... |
# -*- coding: utf-8 -*-
"""
surveybot main
"""
from slackbot import db, app
def vote (user, action_text):
"""
Vote for a survey
"""
survey_id = ""
option = ""
try:
parameters = action_text.split(' ',1)[1]
survey_id = parameters.split(' ')[0]
option = param... |
from os import path
from fabric import api as fab
from fabric.contrib.project import rsync_project as rsync_project
fab.env.shell = "/bin/csh -c"
def _git_base():
return fab.local('git rev-parse --show-toplevel', capture=True)
def _default_vars():
import ansible
pb = fab.env.server.get_playbook('../../... |
import re
import sys
import shutil
import os.path
import subprocess
import reindent
import untabify
def n_files_str(count):
"""Return 'N file(s)' with the proper plurality on 'file'."""
return "{} file{}".format(count, "s" if count != 1 else "")
def status(message, modal=False, info=None):
"""Decorator... |
Test person data building for Django
|
# Copyright (c) 2009-2021 The Regents of the University of Michigan
# This file is part of the HOOMD-blue project, released under the BSD 3-Clause
# License.
"""Logging infrastructure."""
from copy import deepcopy
from enum import Flag, auto
from itertools import count
from functools import reduce
from hoomd.util imp... |
from osgeo import gdal
import numpy as np
import subprocess
import datetime
import sys
sys.path.append('../')
import constants_and_names as cn
import universal_util as uu
# Calculates a range of tile statistics
def create_tile_statistics(tile):
tile_stats = '{}_{}'.format(uu.date_today, cn.tile_stats_pattern)
... |
# 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 unittest
import mock
from socorro.external.hb import connection_context
from socorro.lib.util import SilentFakeL... |
"""UNIX event loop and related classes.
The event loop can be broken up into a selector (the part responsible
for telling us when file descriptors are ready) and the event loop
proper, which wraps a selector with functionality for scheduling
callbacks, immediately or at a given time in the future.
Whenever a public A... |
Use test_utils.build_module instead of building with AstroidBuilder in some tests.
|
#!/usr/bin/python
import json
import sys
import os
def main():
'''
This script works by coming up with a list of possible completions and printing
those suggestions, separated by spaces to stdout
'''
completer = Completer()
completions = completer.get_completions()
if completions is not No... |
"""
Created on 27 Sep 2018
@author: Bruno Beloff (bruno.beloff@southcoastscience.com)
QueueReport.STATUS_NONE: "",
QueueReport.STATUS_INHIBITED: "PUBLISHING INHIBITED",
QueueReport.STATUS_DISCONNECTED: "CONNECTING",
QueueReport.STATUS_PUBLISHING: "PUBLISHING DA... |
from ncolony import ctllib
BOREDBOT_MAIN_OK = True
def main(dummyArgs):
place = os.path.abspath('boredbot-config')
shutil.rmtree(place)
os.mkdir(place)
ctllib.
froop
import os
import shutil
import sys
from ncolony import ctllib
def calcCommandline():
argv0 = sys.argv[0]
if not argv0.endswi... |
from django.views.generic import View
from django.http import HttpResponse
from django.shortcuts import get_object_or_404
from trix.trix_core import models
import json
class HowsolvedView(View):
"""docstring for UpdateHowSolvedView"""
http_method_names = ['post']
def post(self, request, *args, **kwargs... |
#!/usr/bin/env python3
import glob
import numpy as np
import codecs
import json
import argparse
from collections import defaultdict
from collections import OrderedDict
import Bio.PDB
from utilities import *
from pdb_utilities import *
nested_dict = lambda: defaultdict(nested_dict)
def parse_args(args):
"""Parse... |
# coding=utf-8
"""
Copyright 2014 Xabier Crespo Álvarez
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 applicab... |
from __future__ import unicode_literals
__version__ = "0.1b2"
Changed version to 0.2rc2
from __future__ import unicode_literals
__version__ = "0.2rc2"
|
from app import app
import os
from flask import render_template, \
request, \
send_from_directory
from helpers import is_authenticated, \
parse_address
from database import db, \
Address, \
Domain
from mailgun import mailg... |
Rename option
|
# Copyright 2021 The Kubric Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in w... |
import os
import webbrowser
def pytest_unconfigure(config):
htmlcov_path = os.path.join("htmlcov", "index.html")
if 'html' in config.option.cov_report and os.path.isfile(htmlcov_path):
try:
webbrowser.open_new_tab(htmlcov_path)
except webbrowser.Error:
pass
conftest: C... |
import geopy
from django.views import generic
from django.conf import settings
from django.http import HttpResponseRedirect
from django.core.urlresolvers import reverse_lazy
from django.shortcuts import get_object_or_404
from django.contrib import messages
from django.contrib.auth import get_user_model, authenticate, ... |
from __future__ import print_function
import sys
import inspect
import numpy as np
from warnings import warn
from datetime import datetime
from netCDF4 import Dataset, MFDataset, num2date
class ncwrite():
"""
Save data in a dict to a netCDF file.
Notes
-----
1. Unlimited dimension (None) can o... |
Open FTP session on the last moment possible
Used to open fp = open(file_path,'wb') a few lines before it was needed. This shouldn't be too much of a problem but opening and closing it right after eachother keeps the session open for less time and there are less chances on failure.
|
import logging
import os
from abc import ABCMeta, abstractmethod
from pathlib import Path
from yurl import URL
from tumdlr.downloader import sanitize_filename, download
"""
Post Containers
---
Classes that extend the TumblrPost class are used for parsing and storing post metadata using API response data.
They do no... |
# Copyright (c) 2006-2010 Mitch Garnaat http://garnaat.org/
# Copyright (c) 2010, Eucalyptus Systems, Inc.
# All rights reserved.
#
# 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 res... |
import settings
import elife_fi_test_data as elife
import fluidinfo
import urllib
import json
import logging
from time import sleep
# Configure logging to console
logger = logging.getLogger('myapp')
logger.setLevel(logging.DEBUG)
ch = logging.StreamHandler()
formatter = logging.Formatter('%(asctime)s %(levelname)s %(m... |
__author__ = 'jeddy'
import sys, os, re, argparse, time
"""generate_fc_batch_submit
This script is used to generate a batch submit file for Globus Genomics Galaxy,
with all parameters specified for the selected Workflow for each library
(sample).
Inputs:
-u / --unalignedDir : directory with unaligned FASTQs from... |
# coding=UTF-8
from django.db.models import Q
from ladder.models import Challenge, Rank
from math import ceil
def _open_challenges_exist(user, ladder):
"""Returns True if there are challenges open in the provided ladder for the user."""
open_challenges = Challenge.objects.filter( (Q(challenger=user)|Q(challen... |
from time import time
from app import db
from flask import render_template, g, request, session, url_for, Blueprint
mod_root = Blueprint('root', __name__, url_prefix='/')
@mod_root.route('/')
def index():
return render_template('index.html')
@mod_root.before_app_request
def before_request():
# Save current... |
"""
fs.errors: error class definitions for FS
"""
import sys
import errno
from fs.path import *
try:
from functools import wraps
except ImportError:
def wraps(func):
def decorator(wfunc):
wfunc.__name__ == func.__name__
wfunc.__doc__ == func.__doc__
wfunc.__mo... |
'''
@author Bill Bollenbacher
@author Swarbhanu Chatterjee
@author David Stuebe
@file ion/services/dm/presentation/test/user_notification_test.py
@description Unit and Integration test implementations for the user notification service class.
'''
from pyon.util.int_test import IonIntegrationTestCase
from pyon.util.unit_... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
try:
from neo4j.exceptions import ConstraintError
except ImportError:
from neo4j.v1.api import CypherError as ConstraintError # Backwards compatability with version <1.2
from norduniclient.testing import Neo4jTestCase
from norduniclient import c... |
# -*- encoding: utf-8 -*-
#################################################################################
# #
# Copyright (C) 2009 Renato Lima - Akretion #
# ... |
#!/usr/bin/env python
######################################################
#
# howdoi - instant coding answers via the command line
# written by Benjamin Gleitzman (gleitz@mit.edu)
# inspired by Rich Jones (rich@anomos.info)
#
######################################################
import gc
gc.disable()
import argp... |
import json
from flask import session
from PyPaste import app
from PyPaste.models.pastes import Paste
class TestBase(object):
def setUp(self):
app.config['CSRF_ENABLED'] = False
self.app = app.test_client()
Paste.init_table()
def tearDown(self):
# drop the table so we can
... |
Disabled condor email notifications
|
#!/usr/bin/env python3
import argparse
import json
import numpy
import os
import random
import re
import subprocess
import sys
import time
args = None
logFile = None
unlockTimeout = 99999999999
fastUnstakeSystem = './fast.refund/eosio.system/eosio.system.wasm'
systemAccounts = [
'eosio.bpay',
'eosio.msig',
... |
#!/usr/bin/python3
import tkinter
import turtle
from functools import partial
from pdb import set_trace as debug
class CalculatorTurtle(turtle.RawTurtle):
def __init__(self, canvas):
turtle.RawTurtle.__init__(self, canvas)
self.penup()
self.width = 48
self.height = 80
... |
# Copyright (c) 2006,2007 Mitch Garnaat http://garnaat.org/
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modi... |
#
# handler.py
# Lamba functions for scheduling check-ins via the Southwest API
#
import json
import logging
import os
import sys
import uuid
import boto3
# Add vendored dependencies to path
sys.path.append('./vendor')
from lib import swa, email, exceptions # NOQA
# Set up logging
log = logging.getLogger(__name__... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.