src stringlengths 721 1.04M |
|---|
#!/usr/bin/env python
from sys import argv,stderr
#Prende in input il nome di un file che contiene, i dati di coppie di residui per ogni frame.
#Ogni riga ha il seguente formato:
#frame atom1_id res1_name res1_id atom1_name atom2_id res2_name res2_id atom2_name ...........
#0 8661 T 273 N3 ... |
from base64 import b64encode
from django.contrib.auth.models import User
admin_test_credentials = ('admin1', 'admin@taverna.com', 'qwerty123',)
normal_user_credentials = ('user1', 'user1@taverna.com', 'qwerty123',)
endpoint = '/api'
def obtain_api_key(client):
credentials = '{}:{}'.format(
admi... |
# -*- coding: utf-8 -*-
#
# Copyright © 2012 Red Hat, Inc.
#
# This software is licensed to you under the GNU General Public
# License as published by the Free Software Foundation; either version
# 2 of the License (GPLv2) or (at your option) any later version.
# There is NO WARRANTY for this software, express or impli... |
#
# Copyright 2015, Jack Poulson
# All rights reserved.
#
# This file is part of Pumps, which was produced as part of the DARPA XDATA
# project, and is under the BSD 2-Clause License, which can be found at
# http://opensource.org/licenses/BSD-2-Clause
#
import bz2, gzip, os, pandas, time
# import utils
home_dir ... |
# -*- coding: utf-8 -*-
""" Command line interface for working with qdiscs """
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import logging
import os
import subprocess
import sys
import argparse
from synapse_tools.haproxy.qdisc_util import check_setup
fr... |
import baseLogic as logic
from LogicUtils import itot
from LogicUtils import ttoi
from LogicUtils import getRandomInts
from LogicUtils import invertTuple
from LogicUtils import states
from LogicUtils import appendTuple
def checkNot(logic):
state1 = logic(0)
state2 = logic(1)
print("0 : %d" % (state1))
... |
#!/usr/bin/env python
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
__license__ = 'GPL v3'
__copyright__ = '2010, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
import textwrap
from PyQt4.Qt import QAbstractTableModel, QVariant, QFont, Qt
from calibre.gui2.preferences import Confi... |
import sys
import os
import time
from robot.libraries.BuiltIn import BuiltIn
from robot.output.logger import LOGGER
class runKeywordAsync:
def __init__(self):
self._thread_pool = {}
self._last_thread_handle = 1
#self._robot_log_level = BuiltIn().get_variable_value("${LOG_LEVEL}")
def r... |
#!/usr/bin/python
"""
Copyright 2013 Paul Willworth <ioscode@gmail.com>
This file is part of Galaxy Harvester.
Galaxy Harvester 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 th... |
# Django settings for hackeragenda project.
import os
from collections import OrderedDict
PROJECT_PATH = os.path.abspath(os.path.split(__file__)[0])
SUBPROJECT_PATH = os.path.split(PROJECT_PATH)[0]
BASE_DIR = PROJECT_PATH # to avoid stupid warning from django 1.6
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
... |
"""Support for the Hive binary sensors."""
from homeassistant.components.binary_sensor import BinarySensorDevice
from . import DATA_HIVE, DOMAIN
DEVICETYPE_DEVICE_CLASS = {"motionsensor": "motion", "contactsensor": "opening"}
def setup_platform(hass, config, add_entities, discovery_info=None):
"""Set up Hive se... |
import os
import json
from datetime import datetime, timedelta
from selfdrive.swaglog import cloudlog
from selfdrive.version import version, terms_version, training_version, get_git_commit, get_git_branch, get_git_remote
from common.hardware import HARDWARE
from common.api import api_get
from common.params import Para... |
import warnings
from datetime import datetime, timedelta
from pandas import DataFrame, Panel, DatetimeIndex, date_range
class DifferentIndexes(object):
goal_time = 0.2
def setup(self):
self.data_frames = {}
start = datetime(1990, 1, 1)
end = datetime(2012, 1, 1)
for x in rang... |
#!/usr/bin/env python2
# This file is part of Archivematica.
#
# Copyright 2010-2013 Artefactual Systems Inc. <http://artefactual.com>
#
# Archivematica 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, ... |
# -*- coding: utf-8 -*-
# Copyright 2014 Mirantis, 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 requi... |
# Book.py
'''Controls book functions and holds book data'''
import os
import json
import struct
from sqlite3 import connect
from datetime import datetime
from cStringIO import StringIO
from shutil import copy
from calibre.ebooks.mobi import MobiError
from calibre.ebooks.metadata.mobi import MetadataUpdater
from cali... |
# -*- coding: utf-8 -*-
#
# Copyright © 2012 - 2015 Michal Čihař <michal@cihar.com>
#
# This file is part of Weblate <http://weblate.org/>
#
# 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, eithe... |
import os
import time as tm
import sys
# Handles the creation of condor files for a given set of directories
# -----------------------------------------------------------------------------
def createCondorFile(dataDir,outDir,run,day,time):
# Condor submission file name convention: run-day-time.condor
with open... |
from allauth.socialaccount import providers
from allauth.socialaccount.providers.base import ProviderAccount
from allauth.socialaccount.providers.oauth2.provider import OAuth2Provider
class VKAccount(ProviderAccount):
def get_profile_url(self):
return self.account.extra_data.get('link')
def get_avata... |
"""Tools for creating Raw objects from numpy arrays"""
# Authors: Eric Larson <larson.eric.d@gmail.com>
#
# License: BSD (3-clause)
import numpy as np
from ..base import _BaseRaw
from ...utils import verbose, logger
class RawArray(_BaseRaw):
"""Raw object from numpy array
Parameters
----------
dat... |
#!/usr/bin/env python
"""
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License");... |
# coding: utf-8
# import unittest
# from unittest.mock import patch, Mock
from unittest.mock import patch
import flask
from flask import url_for, g, current_app
# from flask import render_template
# from flask_babelex import gettext as _
from .base import BaseTestCase
from . import utils
class TestArticleDetailV3A... |
# Copyright (C) 2010 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the ... |
#-*- coding: utf-8 -*-
""" EOSS catalog system
extract metadata from SQS messages and generate Catalog_dataset objects
"""
__author__ = "Thilo Wehrmann, Steffen Gebhardt"
__copyright__ = "Copyright 2016, EOSS GmbH"
__credits__ = ["Thilo Wehrmann", "Steffen Gebhardt"]
__license__ = "GPL"
__version__ = "1.0.0"
__mainta... |
from flask_dance.consumer import OAuth2ConsumerBlueprint
from flask_dance.consumer.requests import OAuth2Session
from functools import partial
from flask.globals import LocalProxy, _lookup_app_object
from flask import _app_ctx_stack as stack
__maintainer__ = "Justin Georgeson <jgeorgeson@lopht.net>"
class NoVerify... |
"""gerenciador URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class... |
from __future__ import absolute_import, unicode_literals
import json
import logging
import six
from django.utils.translation import ugettext_lazy as _
from edx_rest_api_client.exceptions import SlumberHttpBaseException
from oscar.core.loading import get_model
from ecommerce.core.constants import ENROLLMENT_CODE_SEAT... |
"""
Contains NWS DAO implementations.
"""
from resttools.mock.mock_http import MockHTTP
import re
from resttools.dao_implementation.live import get_con_pool, get_live_url
from resttools.dao_implementation.mock import get_mockdata_url
import logging
logger = logging.getLogger(__name__)
class File(object):
"""
... |
# Generated by YCM Generator at 2016-10-18 10:13:21.653665
# This file is NOT licensed under the GPLv3, which is the license for the rest
# of YouCompleteMe.
#
# Here's the license text for this file:
#
# This is free and unencumbered software released into the public domain.
#
# Anyone is free to copy, modify, publis... |
#!/usr/bin/env python
# AWSBucketDump is a tool to quickly enumerate AWS S3 buckets to look for loot.
# It's similar to a subdomain bruteforcer but is made specifically to S3
# buckets and also has some extra features that allow you to grep for
# delicous files as well as download interesting files if you're not
# afr... |
# -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2017-05-02 09:52
from __future__ import unicode_literals
import django.db.models.deletion
import django.utils.timezone
import model_utils.fields
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies ... |
#!/usr/bin/env python
# xwindow.py
#
# Copyright (C) 2015 Kano Computing Ltd.
# License: GNU General Public License v2 http://www.gnu.org/licenses/gpl-2.0.txt
#
# low level Xlib utilities
#
# Be careful mixing calls to this with Gtk.
from contextlib import contextmanager
import Xlib.display
from kano.logging import l... |
from __future__ import print_function
import errno
import os
import re
import shutil
import subprocess
import sys
def clean_dir(path):
"""
Removes directory at path (and all its subdirectories) if it exists,
and creates an empty directory in its place.
"""
try:
rmtree(path)
except OSE... |
[
#'formv.validators.base:VBase', # ABC; reqiured, strip
#'formv.validators.base:VConstant', #
#'formv.validators.base:VBool', # bool(value)
#'formv.validators.base:VEmpty', #
#'formv.validators.base:VLength', # min/max
#'formv.validators.base:VRange', # min < val < max
#'formv.validators.base:VList', # i... |
"""
Django settings for lark project.
For more information on this file, see
https://docs.djangoproject.com/en/dev/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/dev/ref/settings/
"""
import os
from .base import *
# Build paths inside the project like this: os... |
from . import util
from . import Atomic
import os
from docker.errors import NotFound
from operator import itemgetter
class Verify(Atomic):
DEBUG = False
def verify(self):
"""
Primary def for atomic verify
:return: None
"""
def fix_layers(layers):
"""
... |
##########################################################################
# (C) Vrije Universiteit, Amsterdam (the Netherlands) #
# #
# This file is part of AmCAT - The Amsterdam Content Analysis Toolkit #
# ... |
from abc import ABCMeta, abstractmethod
from plebnet.agent.config import PlebNetConfig
from plebnet.controllers import market_controller
from plebnet.controllers.cloudomate_controller import calculate_price, calculate_price_vpn
from plebnet.settings import plebnet_settings
from plebnet.utilities import logger
from ple... |
# coding=utf-8
# Copyright 2020 The TF-Agents 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... |
import graph
import qca
import e
# Converte para um grafo de portas e elementos, seguindo a regra que mudanca de clocks, birfucacoes e celulas que forma portas
# Sao vertices aresta do grafo.
def process_nodes(graphElements, graphCells, nodeCell, nodeElement):
#print("node cell %d node element %d %s" % (nodeCell.... |
# -*- coding: utf8 -*-
# Construct server info messages
greeting_text = \
"""<h1>Welcome to SpiceCM!</h1>
SpiceCM allows you to manage your SPICE VDI connections.<br />
<br />
SpiceCM licensed under Terms and Conditions of GNU General
Public License version 3 or any higher version.<br />
<br />
<a href="http://spice-... |
from django.test import TestCase
from mock import Mock, patch
from paymentexpress.facade import Facade
from paymentexpress.gateway import AUTH, PURCHASE
from paymentexpress.models import OrderTransaction
from tests import (XmlTestingMixin, CARD_VISA, SAMPLE_SUCCESSFUL_RESPONSE,
SAMPLE_DECLINED_RESPO... |
#!/usr/bin/env python3
import os
import unittest
import gc
import weakref
import rospy
from appctl_support import ProcRunner
import collections
PKG = 'appctl'
NAME = 'test_proc_runner'
TEST_CMD = ['sleep', '5']
GRACE_DELAY = 0.5 # seconds
# http://stackoverflow.com/questions/568271/
def check_pid(pid):
""" C... |
def graph(z, q, gamma, t, P):
'''
Plot the willow tree.
Input
---------------------------------------------------------------------------
z, q: np.arrays, required arguments. The discrete density pairs, output of
the function 'sampling'.
gamma: float, required argument. Weighting para... |
# -*- coding: utf-8 -*-
"""
@author: Chris Lucas
"""
import numpy as np
import pandas as pd
def merge_dataframes(dfs, key_field_name):
"""
Merges dataframes containing data of one class into one dataframe with
the class in a column.
Parameters
----------
dfs : dict of DataFrames
Dic... |
import tensorflow as tf
from datasets import dataset_utils
from datasets import flowers
import matplotlib.pyplot as plt
import tensorflow.contrib.slim as slim
from datasets import download_and_convert_flowers
import numpy as np
from preprocessing import inception_preprocessing
flowers_data_dir = '../../data/flower'
t... |
from django.forms import ValidationError
from stjornbord.user.models import validate_username
import datetime
def slugify(name):
import unicodedata as ud
import string
name = unicode(name)
slug = u''.join(c for c in ud.normalize('NFD', name.lower()) if ud.combining(c) == 0)
slug = slug.repla... |
#!/usr/bin/env python
"""
A very simple script to export tweets from a JSONL file in CSV format.
Sample usage:
python jsonl-tweet-export.py sample/sample-tweets-500.jsonl -o sample/sample-tweets.csv
"""
import sys, fileinput, codecs, re
from datetime import datetime
from optparse import OptionParser
import logging as ... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
class BaseWsMiddleware(object):
"""
This is a base class for custom Scrapy middleware.
"""
# Class Members
# Instantiation
def __init__(self):
pass
# Static Methods
# Class Methods
# Public Methods
... |
private512 = b'''
-----BEGIN RSA PRIVATE KEY-----
MIIBPAIBAAJBAIWmlgix/84GJ+dfgjm7LTc9EPdfkftlgiPpCq4/kbDAZmU0VvYK
DljjleJ1dfvS+CGy9U/kk1tG3EeEvb82xAcCAwEAAQJADbuWQwJ3NGYxh3aq3N+8
v6ZIrgJl75z4iFQTwt/JSo3ytJ5i8EANzscQBd8Iy0VxSqxRZlCFPB7br9od4gQl
EQIhAPo6e0Oj759j/Lr0SWmsgEf7C8Sm0TEQsBJDe68Un4g9AiEAiLvAKc1QQw31
kzJVJ/lSXN... |
#!/usr/bin/env python
# This file is part of VoltDB.
# Copyright (C) 2008-2016 VoltDB Inc.
#
# 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 limitati... |
# Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import datetime
from testing_utils import testing
from model.wf_build import WfBuild
from waterfall import buildbot
from waterfall import build_util
clas... |
# coding: utf-8
#
# Copyright (C) 2010 C.D. Immanuel Albrecht
#
# 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 Li... |
#
# GeoTiler - library to create maps using tiles from a map provider
#
# Copyright (C) 2014 by Artur Wroblewski <wrobell@pld-linux.org>
#
# 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 ... |
#!/usr/bin/python
class Stack:
def __init__(self, size=10):
self.items = size * [None] # utworzenie tablicy
self.n = 0 # liczba elementow na stosie
self.size = size
def is_empty(self):
return self.n == 0
def is_full(self):
return self.siz... |
import pymysql as pm
import time
from django.contrib.auth.hashers import make_password
qike = pm.connect(host='localhost',user='root',passwd='root',db='qike',port=3306,charset='utf8')
sport = pm.connect(host='localhost',user='root',passwd='root',db='sport',port=3306,charset='utf8')
try:
qc = qike.cursor()
sc = ... |
# -*- coding: UTF-8 -*-
"""
Title: Dumpscript management command
Project: Hardytools (queryset-refactor version)
Author: Will Hardy (http://willhardy.com.au)
Date: June 2008
Usage: python manage.py dumpscript appname > scripts/scriptname.py
$Revision: 217 $
Description:
Generates a Py... |
# -*- 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... |
# Copyright 2014 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... |
#!/usr/bin/env python
'''
Feb 28, 2015
@author Hideki Ikeda
'''
import os
import sys
import filecmp
import tempfile
import unittest
sys.path.append(os.path.join(os.path.abspath(os.path.dirname(__file__)), '..'))
import reducer as target
from testmapper import StdioSwitcher
class TestReducer(unittest.TestCase):
'... |
from setuptools import setup, find_packages
# from codecs import open
# from os import path
# here = path.abspath(path.dirname(__file__))
# # Get the long description from the README file
# with open(path.join(here, 'README.rst'), encoding='utf-8') as f:
# long_description = f.read()
setup(
# Application nam... |
# -*-coding:Utf-8 -*
# Copyright (c) 2010 LE GOFF Vincent
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice, this
# l... |
#!/usr/bin/env python
"""
Author: David Wolinsky
Version: 0.02
Description:
The XmlRpc API for this library is:
get(base64 key)
Returns the value and ttl associated with the given key using a dictionary
or an empty dictionary if there is no matching key
Example usage:
rv = rpc.get(Binary("key"))... |
import requests
import logging
import time
class MarketoClient:
"""Basic Marketo Client"""
def __init__(self, identity, client_id, client_secret, api):
self.api_endpoint = api
self.identity_endpoint = identity
self.client_id = client_id
self.client_secret = client_secret
... |
from datetime import date
from datetime import datetime
from os import linesep
from django.test import TestCase
from django.test.client import RequestFactory
import icalendar
import pytz
from django_ical import utils
from django_ical.feedgenerator import ICal20Feed
from django_ical.views import ICalFeed
class Test... |
import sys
import olrcdb
import os
import datetime
from bulkupload import env_vars_set
# Globals
COUNT = 0
FAILED = 0
REQUIRED_VARIABLES = [
"MYSQL_HOST",
"MYSQL_USER",
"MYSQL_PASSWD",
"MYSQL_DB",
]
def prepare_upload(connect, directory, table_name):
'''Given a database connection, directory a... |
"""DecMeg2014 example code.
Simple prediction of the class labels of the test set by:
- pooling all the triaining trials of all subjects in one dataset.
- Extracting the MEG data in the first 500ms from when the
stimulus starts.
- Using a linear classifier (logistic regression).
"""
import numpy as np
from sklearn.... |
# Copyright (c) 2010 Citrix Systems, 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 la... |
from matplotlib.colors import LinearSegmentedColormap
from numpy import nan, inf
cm_data = [[1., 1., 1.],
[1., 1., 1.],
[0.498039, 0.498039, 0.498039],
[0., 0., 0.513725],
[0., 0., 0.533333],
[0., 0., 0.54902],
[0., 0., 0.564706],
[0., 0., 0.580392],
[0., 0., 0.6],
[0., 0., 0.615686],
[0., 0., 0.568627],
[0., 0., 0.584... |
#!/usr/bin/env python
import os
from setuptools import setup, find_packages
try:
# Workaround for http://bugs.python.org/issue15881
import multiprocessing
except ImportError:
pass
VERSION = '0.4.6'
if __name__ == '__main__':
setup(
name = 'django-tastypie-mongoengine',
version = VER... |
#* This file is part of the MOOSE framework
#* https://www.mooseframework.org
#*
#* All rights reserved, see COPYRIGHT for full restrictions
#* https://github.com/idaholab/moose/blob/master/COPYRIGHT
#*
#* Licensed under LGPL 2.1, please see LICENSE for details
#* https://www.gnu.org/licenses/lgpl-2.1.html
import os
im... |
# -*- coding: utf-8 -*-
#
# This file is part of INSPIRE.
# Copyright (C) 2016 CERN.
#
# INSPIRE is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later... |
import unittest
from unittest.mock import create_autospec
import docker
from docker.errors import NotFound
from dockerenforcer.config import Config
from dockerenforcer.docker_image_helper import DockerImageHelper
class DockerHelperTests(unittest.TestCase):
def setUp(self):
self._config = Config()
... |
# coding: utf-8
from __future__ import unicode_literals, division, print_function
"""
Workflows for GW calculations:
VaspGWFWWorkFlow fireworks wf for vasp
SingleAbinitGWWorkFlow workflow for abinit
Under construction:
general GW workflow that should manage all the code independent logic
"""
__author__ = "Michie... |
# Copyright 2014-2018 The PySCF Developers. 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 appl... |
from distutils.core import setup
from Cython.Build import cythonize
from distutils.extension import Extension
import numpy as np
import mpi4py as mpi4py
import sys
import platform
# Now get include paths from relevant python modules
include_path = [mpi4py.get_include()]
include_path += [np.get_include()]
include_path... |
# 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 ... |
#Copyright ReportLab Europe Ltd. 2000-2012
#see license.txt for license details
#history http://www.reportlab.co.uk/cgi-bin/viewcvs.cgi/public/reportlab/trunk/reportlab/platypus/flowables.py
__version__=''' $Id$ '''
__doc__="""
A flowable is a "floating element" in a document whose exact position is determined by the
o... |
import unittest
import smartfilesorter
import os
import tempfile
import shutil
class TestIntegrationTests(unittest.TestCase):
"""
Broader test cases
"""
def setUp(self):
self.source_dir = tempfile.mkdtemp()
self.dest_dir = os.path.join(self.source_dir, 'dest/')
os.mkdir(self.de... |
import jinja2
from jingo import register, env
from tower import ugettext as _
from . import buttons
from amo.utils import chunked
import amo
register.function(buttons.install_button)
register.function(buttons.big_install_button)
register.function(buttons.mobile_install_button)
@register.filter
@jinja2.contextfilt... |
# TODO: Refactor this to consolidate it with `ecommerce.programs.views`.
from __future__ import absolute_import
import logging
from django.contrib import messages
from django.urls import reverse
from django.utils.translation import ugettext_lazy as _
from django.views.generic import CreateView, ListView, TemplateView... |
class Cypher:
def __init__(self):
pass
# user procedures
allowed_emails = (
' MATCH '
' (e: Emails) '
' RETURN '
' e.allowed '
)
user_allowed_emails = (
' MATCH '
' (u:User) '
' WITH '
' COLLECT (DISTINCT u.email) as registered_emails '
' MATCH '
' (user:User {'
' username_lower : toLower(... |
import doctest
from ...parsers.installed_product_ids import InstalledProductIDs
from ...parsers import installed_product_ids
from ...tests import context_wrap
COMMAND_OUTPUT = """
+-------------------------------------------+
Product Certificate
+-------------------------------------------+
Certificate:
Path: /e... |
# -*- coding: utf8 -*-
"""
Tests for pika.adapters.blocking_connection.BlockingChannel
"""
from collections import deque
import unittest
import mock
from pika.adapters import blocking_connection
from pika import channel
BLOCKING_CHANNEL = 'pika.adapters.blocking_connection.BlockingChannel'
BLOCKING_CONNECTION = 'pi... |
from pyspark import SparkContext, SparkConf
import re
class Utils():
COMMA_DELIMITER = re.compile(''',(?=(?:[^"]*"[^"]*")*[^"]*$)''')
if __name__ == "__main__":
conf = SparkConf().setAppName('StackOverFlowSurvey').setMaster("local[*]")
sc = SparkContext(conf = conf)
total = sc.accumulator(0)
miss... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import cherrypy
import pytunes
import math
from pytunes.proxy import get_image
from urllib2 import urlopen, quote
from json import loads
import logging
class Newznab:
def __init__(self):
self.logger = logging.getLogger('modules.newznab')
... |
# -*- coding: utf-8 -*-
__doc__ = """
WSGI entities to support WebSocket from within gevent.
Its usage is rather simple:
.. code-block: python
from gevent import monkey; monkey.patch_all()
from ws4py.websocket import EchoWebSocket
from ws4py.server.geventserver import WSGIServer
from ws4py.server.wsg... |
#!/usr/bin/env python3
import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk, GLib, GdkPixbuf
try:
gi.require_version('AppIndicator3', '0.1')
from gi.repository import AppIndicator3 as AppIndicator
except:
from gi.repository import AppIndicator
import re,subprocess,socket
import urllib.... |
# -*- coding: utf-8 -*-
#------------------------------------------------------------------------------
# file: $Id$
# auth: Philip J Grabner <grabner@cadit.com>
# date: 2013/08/20
# copy: (C) Copyright 2013 Cadit Health Inc., All Rights Reserved.
#-----------------------------------------------------------------------... |
"""Support for representing current time of the day as binary sensors."""
from datetime import datetime, timedelta
import logging
import pytz
import voluptuous as vol
from homeassistant.components.binary_sensor import PLATFORM_SCHEMA, BinarySensorEntity
from homeassistant.const import (
CONF_AFTER,
CONF_BEFOR... |
import tokenize
LOGFILE = '/tmp/log.txt'
def translate(readline):
for type, name,_,_,_ in tokenize.generate_tokens(readline):
if type ==tokenize.NAME and name =='myprint':
yield tokenize.NAME, 'print'
else:
yield type,name
import codecs, cStringIO, encodings
from encodings ... |
#coding:utf-8
import ConfigParser
import requests
from github import Github
import json
import networkx as nx
from networkx.readwrite import json_graph
import os
def readcfg():
'''
read config.cfg file
:return:github username,password
'''
config=ConfigParser.ConfigParser()
with open('./RecGithu... |
# -*- coding: utf-8 -*-
"""Testing module for the Heap classes."""
from heap import Heap
import pytest
import random
# ------------------Heap Initialization Tests--------------------
# [x] Test default initialization of a heap is a heap.
# [x] Test the inital size of a heap is 0.
# [x] Test the default initializtion... |
from __future__ import division
import itertools
import logging
from flask import abort, flash
from sqlalchemy.exc import OperationalError
from sqlalchemy import func
from chanjo.store.models import Transcript, TranscriptStat, Sample
from chanjo.sex import predict_sex
from chanjo_report.server.constants import LEVELS... |
#!/usr/bin/env python
# Texas A&M University
# Department of Computer Science and Engineering
# Robert A. Baykov
import sys,datetime,time,csv,os,argparse,smtplib
from email.MIMEMultipart import MIMEMultipart
from email.MIMEText import MIMEText
from rukovod_datatypes import Course,Section,Student
#... |
# Copyright (c) 2012 The Khronos Group Inc.
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and /or associated documentation files (the "Materials "), to deal in the Materials without restriction, including without limitation the rights to use, copy, modify, merge, publis... |
from collections import OrderedDict as OD
from util import Data, control_cb, monitor_cb, alarm_trace_cb, dev_io_cb
def status_fmt_cb(val, read=True, n=0):
val = int(val, 16)
return '1' if val & (1 << n) else '0'
def get_ctrl(dev):
ctrl = Data(name='Settings', send=True, io_cb=dev_io_cb)
ctrl.add('chu... |
#! /usr/bin/env python
#
# Copyright (c) 2008-2014 University of Utah and the Flux Group.
#
# {{{GENIPUBLIC-LICENSE
#
# GENI Public License
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and/or hardware specification (the "Work") to
# deal in the Work without rest... |
import sys
import pylab as plt
sys.path.append("/mnt/brand01-00/mbrand_analysis/lib/matplotlib_venn/")
from venn3 import venn3, venn3_circles
from venn_util import venn3_unweighted, venn2_unweighted
import itertools
from subsetClass import subsetWraper
class buildVennDiagram():
def __init__(self,data):
se... |
# Copyright 2009-present MongoDB, 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 wri... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.