src stringlengths 721 1.04M |
|---|
#!/usr/bin/env python
from __future__ import print_function
import json, sys
def assert_non_empty_string(obj, field):
assert field in obj, 'Missing field "%s"' % field
assert isinstance(obj[field], basestring), \
'Field "%s" must be a string' % field
assert len(obj[field]) > 0, 'Field "%s" must ... |
from unittest import TestCase
import pytest
from parsita import *
class LiteralTestCase(TestCase):
def test_literals(self):
class TestParsers(GeneralParsers):
a = lit('a')
bb = lit('bb')
self.assertEqual(TestParsers.a.parse('a'), Success('a'))
self.assertEqual(Te... |
from __future__ import unicode_literals
import unittest
import six
from openid.consumer.discover import OPENID_1_0_TYPE, OPENID_1_1_TYPE, OpenIDServiceEndpoint
from openid.yadis.services import applyFilter
XRDS_BOILERPLATE = '''\
<?xml version="1.0" encoding="UTF-8"?>
<xrds:XRDS xmlns:xrds="xri://$xrds"
... |
from __future__ import print_function
import os
import sys
import sh
try: from distutils.core import setup
except ImportError: from setuptools import setup
setup(
name="sh",
version=sh.__version__,
description="Python subprocess interface",
author="Andrew Moffat",
author_email="andrew.robert.moff... |
#!/usr/bin/env python
#
# Copyright (C) 2006 Jens Gutzeit <jens@jgutzeit.de>
#
# 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 2 of the License, or
# (at your option) any later ve... |
# Copyright (c) 2011 OpenStack Foundation
# 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 ... |
import random, math
import pandas as pd
import numpy as np
import scipy.io
import matplotlib
from mpl_toolkits.mplot3d import Axes3D
import matplotlib.pyplot as plt
# If you'd like to try this lab with PCA instead of Isomap for dimensionality
# reduction technique:
Test_PCA = False
matplotlib.style.use('ggplot') # ... |
# stdlib imports
import contextlib
# vendor imports
# local imports
from spgill.printer import commands
class FormattingModule:
"""Mixin for text formatting functions."""
# Default flags
_flags = {
"encoding": None,
"inverted": False, # Flag for inverted text
"justification": 0... |
import argparse
from importer.rashodi_manager import RashodiDataImporter
from importer.prihodi_manager import PrihodiDataImporter
rashodi_importer = RashodiDataImporter()
prihodi_importer = PrihodiDataImporter()
def main_importer(data, municipalities):
mun_list = municipalities.split(",")
data_source = data.s... |
"""INSTEON Set IM Configuration Message."""
from insteonplm.messages.message import Message
from insteonplm.constants import (
MESSAGE_SET_IM_CONFIGURATION_0X6B,
MESSAGE_SET_IM_CONFIGURATION_SIZE,
MESSAGE_SET_IM_CONFIGURATION_RECEIVED_SIZE,
MESSAGE_ACK,
MESSAGE_NAK,
)
class SetIMConfiguration(Mes... |
"""
===============================================================
Trial Program for PE 18
Goal: Find the greatest path-sum.
https://projecteuler.net/problem=18
Note: The program uses FILE IO
===============================================================
"""
_FILE_NAME = "data.pe"
def extract(... |
#!/usr/bin/env python
from collections import defaultdict
from numpy import mean
__author__ = "Donovan Park"
__copyright__ = "Copyright 2014, The tax2tree project"
__credits__ = ["Donovan Park"]
__license__ = "BSD"
__version__ = "1.0"
__maintainer__ = "Donovan Park"
__email__ = "donovan.parks@gmail.com"
__status__ =... |
"""
ANSI color code escapes for output
Copyright (c) 2010-2012 Mika Eloranta
See LICENSE for details.
"""
from __future__ import print_function
CODES = {
'reset': '\033[0;m',
'gray' : '\033[1;30m',
'red' : '\033[1;31m',
'green' : '\033[1;32m',
'yellow' : '\033[1;33m',
'blue' : '\033[1;34m',
... |
import sys
from test.picardtestcase import PicardTestCase
from picard import config
from picard.file import File
from picard.metadata import Metadata
from picard.script import register_script_function
from picard.util.scripttofilename import script_to_filename
settings = {
'ascii_filenames': False,
'enabled... |
# Copyright (c) 2015 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 required by applicable law or agreed to in writin... |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013 Centrin Data Systems Ltd.
#
# 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/LIC... |
"""
Structure Walker
================
A utility used to aid in structure validation.
"""
from inspect import isclass
from scalymongo.errors import ValidationError
class StructureWalker(object):
"""A helper class to recurse a :class:`dict`-like object in accordance with
a structure.
:param field_transl... |
"""
sphinx.ext.apidoc
~~~~~~~~~~~~~~~~~
Parses a directory tree looking for Python modules and packages and creates
ReST files appropriately to create code documentation with Sphinx. It also
creates a modules index (named modules.<suffix>).
This is derived from the "sphinx-autopackage" script... |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import DataMigration
from django.db import models
from django.core.management import call_command
class Migration(DataMigration):
def forwards(self, orm):
call_command("loaddata", "assessment_categories.json")
f... |
# ===============================================================================
# Copyright 2013 Jake Ross
#
# 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... |
# Copyright (c) 2015 Rackspace, 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 wr... |
#!/usr/bin/env python
"""
Thug daemon
By thorsten.sick@avira.com
For the iTES project (www.ites-project.org)
"""
import argparse
import pika
import sys
import json
import six
import subprocess
import os
import shutil
import six.moves.configparser as ConfigParser
class Thugd(object):
"""
A class waiting... |
#!/usr/bin/env python
import argparse, sys, os, gzip
from shutil import rmtree
from multiprocessing import cpu_count
from tempfile import mkdtemp, gettempdir
def main(args):
chrcovs = {}
total = {}
inf = gzip.open(args.input)
for line in inf:
f = line.rstrip().split("\t")
chr = f[0]
start = i... |
# -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'DocumentMeta.source_datapoint_count'
db.add_column('docum... |
# -*- coding: utf-8 -*-
"""
pygments.styles.algorithm
~~~~~~~~~~~~~~~~~~~~~~~~~
Simple print-friendly style for displaying algorithms.
:copyright: Copyright 2012 Noah K. Tilton
:license: BSD, same as Pygments. See LICENSE file
:acknowledgements: Thanks to Hugo Maia Vieira for the setuptools ... |
import logging
import select
import pyorient
import time
import random
from topology import nodes, edges
from multiprocessing import Process, Queue
logger = logging.getLogger("idrs")
listenTo = ['alertcontext']
name = 'PrioSimAlertContextOrient'
class PlugIn (Process):
def __init__(self, q, dbs):
Proc... |
# -*- coding: utf-8 -*-
from logging import getLogger
from os.path import join
from django.conf import settings
from django.contrib.auth import get_permission_codename
from django.contrib.sites.models import Site
from django.core.exceptions import ValidationError
from django.core.urlresolvers import reverse
from djang... |
# -=- encoding: utf-8 -=-
#
# Copyright (C) 2014 Savoir-faire Linux Inc.
#
# 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 later versio... |
#!/usr/bin/env python
#
# Copyright 2015 The AMP HTML 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
#
# Unl... |
"""Models for the ``people`` app."""
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
from django.utils.translation import ugettext_lazy as _
from cms.models.pluginmodel import CMSPlugin
from filer.fields.file import FilerFileField
from hvad.models import TranslatedFields, Tra... |
# -*- coding: utf8 -*-
#!/usr/bin/python
#
# This is derived from a cadquery script for generating PDIP models in X3D format
#
# from https://bitbucket.org/hyOzd/freecad-macros
# author hyOzd
# This is a
# Dimensions are from Microchips Packaging Specification document:
# DS00000049BY. Body drawing is the same as QFP g... |
from django.shortcuts import render, get_object_or_404
from django.core.mail import send_mail, BadHeaderError
from django.contrib import messages
from django.conf import settings
from django.contrib.auth.decorators import login_required
from content.models import Mentee, Mentor, Content_Summary
from blog.models import ... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from __future__ import print_function
"""
This module implements a friendly (well, friendlier) interface between the raw JSON
responses from JIRA and the Resource/dict abstractions provided by this library. Users
will construct a JIRA ob... |
# -*- coding: iso-8859-1 -*-
# Copyright (C) 2003-2007, 2009, 2010 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
# provided that the above copyright notice and this permission notice
# appear in all copies.
... |
import matplotlib
matplotlib.use('Agg')
import matplotlib.pylab as plt
import matplotlib.colors as mat_col
from matplotlib.colors import LinearSegmentedColormap
import scipy
import scipy.cluster.hierarchy as sch
from scipy.cluster.hierarchy import set_link_color_palette
import numpy as np
import pandas as pd
import glo... |
from six import string_types
from builtins import object
import logging
import threading
from slackminion.slack import SlackChannel, SlackIM, SlackUser, SlackRoom
class BasePlugin(object):
def __init__(self, bot, **kwargs):
self.log = logging.getLogger(type(self).__name__)
self._bot = bot
... |
import urllib2
# If you are using Python 3+, import urllib instead of urllib2
import json
data = {
"Inputs": {
"input1":
{
"ColumnNames": ["Sepal.Length", "Sepal.Width", "Petal.Length", "Petal.Width", "Species"],
"Values": [ [ "1", "... |
"""Monkey patch os._exit when running under coverage so we don't lose coverage data in forks, such as with `pytest --boxed`."""
from __future__ import (absolute_import, division, print_function)
def pytest_configure():
try:
import coverage
except ImportError:
coverage = None
try:
... |
#!/usr/bin/env python
'''
Atomix project, lpinput.py, (TODO: summary)
Copyright (c) 2015 Stanford University
Released under the Apache License v2.0. See the LICENSE file for details.
Author(s): Manu Bansal
'''
import numpy as np
import sys
def main():
inpfile = sys.argv[1]
(inp, out) = lpinput(inpfile)
print in... |
#! /usr/bin/env python
# -*- coding: UTF-8 -*-
#
"""Отправка RSS на E-mail
Требования:
- Python версии 3.0 и выше.
- config.py
- typo.py
Рекомендации:
- наличие в системе локали ru_RU.UTF-8
Использование:
- создать config.json
- (опционально) mkdir archive_<config name>; ARCHIVE -> True
- $ nohup nice -19 python3 rs... |
# -*- coding: utf-8 -*-
#
# installation_process.py
#
# Copyright 2013 Antergos
#
# 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 2 of the License, or
# (at your option)... |
def join_rev_matra(rev_word, rev_vowel):
# rev_vowel_list = ["a","A","i","I","u","U","WR","WA","e","E","YE","WO","o","O","YO","x","M","X"]
# rev_consonant_list = ["k","K","g","G","Fd","c","C","j","J","Z","T","HT","D","HD","N","t","Ht","d","Hd","n","Q","p","P","b","B","m","y","r","R","l","v","L","Hz","s","S"... |
"""Perform upgrades between version, e.g. adding a new config parameter"""
#pylint: disable=W0611
import os
import os.path as op
from pyrevit.coreutils import appdata
def upgrade_user_config(user_config): #pylint: disable=W0613
"""Upgarde user configurations.
Args:
user_config (:obj:`pyrevit.userc... |
# -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2012 Tiny SPRL (http://tiny.be). All Rights Reserved
#
# This module,
# Copyright (C) 2015 Jordi Llinares López - bigandopen@bigandopen.c... |
#Importing helper class for RBPRM
from hpp.corbaserver.rbprm.rbprmbuilder import Builder
from hpp.corbaserver.rbprm.rbprmfullbody import FullBody
from hpp.corbaserver.rbprm.problem_solver import ProblemSolver
from hpp.gepetto import Viewer
#reference pose for hyq
from hyq_ref_pose import hyq_ref
from hpp.corbaserver.r... |
"""
APIs for updating project metadata, as well as creating or deleting projects
"""
import json
import logging
from django.contrib.auth.decorators import login_required
from django.db.models import Count, Q
from django.utils import timezone
from django.views.decorators.csrf import csrf_exempt
from matchmaker.models ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# archive_whisper_store.py: Backup Whisper Store to a Gzipped Tar Archive.
#
# Author: Lior Goikhburg <goikhburg at gmail.com>
#
# Set the 'WHISPER_LOCK_WRITES = True' parameter in carbon.conf for consistent backups
import argparse
import fcntl
import tarfile
import logg... |
# Copyright (C) 2011 Equinor ASA, Norway.
#
# The file 'ecl_region.py' is part of ERT - Ensemble based Reservoir Tool.
#
# ERT 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 Lice... |
#!/usr/bin/env python
# Copyright mldb.ai inc 2016
# Author: Jean Raby <jean@mldb.ai>
# TODO:
# - configure logging so that access/error logs go somewhere else than stderr
import fcntl
import functools
import grp
import jinja2
import os
import pwd
import pytz
import sys
import time
import tornado.web
from tornado.... |
#
# Copyright (c) 2013 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 t... |
#!/usr/bin/env python
#
# Electrum - lightweight Bitcoin client
# Copyright (C) 2011 thomasv@gitorious
#
# 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... |
""" Combine several other nodes together in parallel
This is useful to be combined with the
:class:`~pySPACE.missions.nodes.meta.flow_node.FlowNode`.
"""
import numpy
from pySPACE.environments.chains.node_chain import NodeChainFactory
from pySPACE.missions.nodes.base_node import BaseNode
from pySPACE.resources.data_... |
# Copyright (c) 2018 PaddlePaddle 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 app... |
class Classifier(object):
def __init__(self):
self._rules = dict()
def inc(self, rule, class_id):
classes = self._rules.get(rule, None)
if classes is None:
classes = dict()
self._rules[rule] = classes
classes[class_id] = classes.get(class_id, 0) + 1
... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2003-2006 Edgewall Software
# Copyright (C) 2003-2005 Jonas Borgström <jonas@edgewall.com>
# Copyright (C) 2005-2006 Christian Boos <cboos@neuf.fr>
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of... |
# This file is part of Indico.
# Copyright (C) 2002 - 2021 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.
from uuid import uuid4
from sqlalchemy.dialects.postgresql import UUID
from indico.core.db import db
fro... |
"""
A module of multilayer perceptrons modified from the Deep Learning Tutorial.
This implementation is based on Theano and stochastic gradient descent.
Copyright (c) 2008-2013, Theano Development Team All rights reserved.
Modified by Yifeng Li
CMMT, UBC, Vancouver
Sep 23, 2014
Contact: yifeng.li.cn@gmail.com
"""
fr... |
#!/usr/bin/env python
###############################################################################
# #
# This library is free software; you can redistribute it and/or #
# modify it under the terms of the GNU Lesser General P... |
"""
Django settings for testproject project.
Generated by 'django-admin startproject' using Django 1.8.7.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.8/ref/settings/
"""
# Build ... |
# (c) 2014, James Tanner <tanner.jc@gmail.com>
#
# Ansible 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 version.
#
# Ansible is distributed i... |
# -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (c) 2010 Acysos S.L. (http://acysos.com) All Rights Reserved.
# Ignacio Ibeas <ignacio@acysos.com>
# $Id$
#
# This program i... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = 'Ben Lopatin'
__email__ = 'ben@wellfire.co'
__version__ = '0.1.0'
import os
import re
import logging
from .data import EnvDict
logger = logging.getLogger(__name__)
def read_file_values(env_file, fail_silently=True):
"""
Borrowed from Honcho
"... |
from setuptools import setup, find_packages
with open('README.md', encoding='utf8') as fh:
long_description = fh.read()
setup(name='webdiff',
version='0.15.0',
description='Two-column web-based git difftool',
long_description=long_description,
long_description_content_type='text/markdown... |
# -*- coding: utf-8 -*-
''' Taken from example 2-005 of the SAP 2000 verification manual.'''
# The obtained error is near 1.8% it can be the aspect ratio
# of the element. See comments on page EXAMPLE 2-005 - 7
# in the SAP 2000 manual.
__author__= "Luis C. Pérez Tato (LCPT) and Ana Ortega (AOO)"
__copyright__= "Copyr... |
# Copyright 2015 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... |
#!/usr/bin/python2
import os
import argparse
import subprocess
import shutil
import time
def parse_arguments():
parser = argparse.ArgumentParser(
prog="cache_monitor.py", description="This program monitors a directory and clears it if the size is above a certain limit")
parser.add_argument("path", n... |
#!/usr/bin/python3
import yaml, argparse, sys, os, textwrap, collections
__dict_type__=collections.OrderedDict
__default_sw__=2
def yml2sif_version():
return '0.2.4b1'
class Integer(yaml.YAMLObject):
yaml_tag =u'!Integer'
def __init__(self, data):
if type(data) is list:
self.data = [... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import sys
import logging
import language_typology as lang_typ
import star_wars as sw
class LogFactory(object):
"""
Helper class to provide standard logging
"""
logger = None
@classmethod
def get_logger(cls):
"""
... |
def createSexParam(name, doassoc):
param = name + '.param'
if doassoc == True:
va = "VECTOR_ASSOC"
na = "NUMBER_ASSOC"
else:
va = "#VECTOR_ASSOC"
na = "#NUMBER_ASSOC"
fout = open(param, 'w')
fout.write("""
NUMBER Running object number
#EXT_NUMBER ... |
# coding: utf-8
"""
Qc API
Qc API # noqa: E501
The version of the OpenAPI document: 3.0.0
Contact: cloudsupport@telestream.net
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
import unittest
import datetime
import telestream_cloud_qc
from telestream_cl... |
#!/import/monstrum/Applications/epd-7.1/bin/python
from nipype.interfaces import fsl
import xnatmaster30 as xnatmaster
import argparse
import sys
import array
import subprocess
import os
import fnmatch
import shutil
import uuid
'''
By Chadtj
V1 Initial Version
V2 Uses new bbl:bet datatype and checks for existing nifti ... |
"""
taskmaster.progressbar
~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010 DISQUS.
:license: Apache License 2.0, see LICENSE for more details.
"""
from __future__ import absolute_import
from progressbar import ProgressBar, UnknownLength, Counter, Timer
from progressbar.widgets import Widget
class Speed(Widget):
'W... |
'''
Created on Sep 7, 2014
@author: gearsad
'''
import lcm
#Import the user types
from user_update_t import user_update_t
#Import the bot types
from bot_update_t import bot_update_t
from bot_control_command_t import bot_control_command_t
#Import the role types
from role_response_t import role_response_t
class LCMM... |
# -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2017-06-17 12:17
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependenc... |
'''
pytz setup script
'''
import pytz
import os
import os.path
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
me = 'Stuart Bishop'
memail = 'stuart@stuartbishop.net'
packages = ['pytz']
resources = ['zone.tab', 'locales/pytz.pot']
for dirpath, dirnames, filenames in os... |
import six
from six import text_type
import time
from mwclient.util import parse_timestamp
import mwclient.listing
import mwclient.errors
class Page(object):
def __init__(self, site, name, info=None, extra_properties=None):
if type(name) is type(self):
self.__dict__.update(name.__dict__)
... |
#!/usr/bin/env python
import os
import sys
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
if sys.argv[-1] == 'publish':
os.system('python setup.py sdist upload')
sys.exit()
with open('README.rst') as f:
readme = f.read()
with open('HISTORY.rst') as f:
... |
from mysqlConn import DbConnect
import argparse
import operator
from math import log
import pprint
#DB connector and curosor
db = DbConnect()
db_conn = db.get_connection()
cur2 = db_conn.cursor();
#Argument parser
parser = argparse.ArgumentParser()
parser.add_argument("ACTOR_ID")
parser.add_argument("MODEL")
args = p... |
#!/usr/bin/env python3
## Copyright (c) MIT. All rights reserved.
## lux (vjlux@gmx.at) 2016
############################################################
# Imports
############################################################
import logging
import LuxImage
import open3d as o3d
import numpy as np
##################... |
########
# Copyright (c) 2016 GigaSpaces Technologies Ltd. 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... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import os
import sys
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
LIKERT_DIR = os.path.join(os.path.dirname(os.path.dirname(BASE_DIR)))
sys.path.append(BASE_DIR)
sys.path.append(LIKERT_DIR)
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ALLOWED_HOSTS = ... |
from __future__ import unicode_literals
import unittest
class TestStates(unittest.TestCase):
def test0Pass(self):
"This test will print output to stdout, and then pass."
print("Sunshine and daisies")
def test1Fail(self):
"This test will print output to stdout, and then fail an ass... |
# -*- 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.
"""Unittests for the process_util.py module."""
from __future__ import print_function
import os
import signal
from chromite.lib... |
#!/usr/bin/python
import json
import urllib
import urllib2
url = 'http://inet-sochi.ru:7003/'
params = {
# The category of the results, 09 - for australian sites
'c' : '09',
# number of results per page, i.e. how many results will be returned
'ps': 10,
# result page number, starting with 0
'np' : 0,
# sy... |
#! /bin/sh
""":"
exec python3 "$0" ${1+"$@"}
"""
import argparse
import csv
import re
from datetime import datetime
from html_format import HTML_FORMAT
def readStyles(format_csv_fname):
formats = {}
f = open(format_csv_fname, encoding='sjis')
reader = csv.reader(f)
category_header = next(reader)[0]
... |
#!/usr/bin/env python3
'Unit test for trepan.processor.command.cmdfns'
import unittest
from trepan.processor import cmdfns as Mcmdfns
class TestCommandHelper(unittest.TestCase):
def setUp(self):
self.errors = []
return
def errmsg(self, msg):
self.errors.append(msg)
return
... |
import distutils.spawn
import os.path
import sys
import subprocess
import pprint
import types
import json
import base64
import signal
import pprint
import time
import http.cookiejar
import urllib.parse
import ChromeController.filter_funcs as filter_funcs
from ChromeController.cr_exceptions import ChromeResponseNotRec... |
import os
from decouple import config, Csv
from dj_database_url import parse as dburl
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
# Quick-start development settings - unsuitable for production
# See https://docs.django... |
#!/usr/bin/env python
# *********************************************************************
# * Copyright (C) 2014 Luca Baldini (luca.baldini@pi.infn.it) *
# * *
# * For the license terms see the file LICENSE, distributed *
# * along ... |
# Generated by Django 2.2.9 on 2020-04-26 23:18
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Install',
fields=[
('id', models.AutoField(... |
# wsse/server/django/tests/test_store.py
# coding=utf-8
# pywsse
# Authors: Rushy Panchal, Naphat Sanguansin, Adam Libresco, Jérémie Lumbroso
# Date: September 1st, 2016
# Description: Test the Django database store.
from django.test import TransactionTestCase
from wsse.server.default.tests import test_store
from wss... |
# Django imports
from django.shortcuts import render, redirect
from django.views.generic import View, ListView
from django.views.generic.edit import CreateView, UpdateView, DeleteView, FormView
from django.utils.decorators import method_decorator
from django.views.decorators.csrf import csrf_protect, csrf_exempt
from d... |
from .. lib import (
ecs,
format as fmt,
parameters
)
from . import (
version
)
import os
import json
import argparse
def get_argument_parser():
parser = argparse.ArgumentParser("ebzl ecs")
parameters.add_profile(parse, required=False)
parameters.add_region(parser, required=False)
... |
# Copyright 2016-2017 Sergey Solokhin (Neill3d)
#
# Github repo - https://github.com/Neill3d/MoPlugs
# Licensed under BSD 3-clause
# https://github.com/Neill3d/MoPlugs/blob/master/LICENSE
#
# Script description:
# Creating property views for the Composition Toolkit components
#
# Topic: Composition Toolkit
#
from pyfb... |
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# 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 ... |
# -*- coding: utf-8 -*-
# PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
from ccxt.async_support.base.exchange import Exchange
import math
from ccxt.base.errors import ExchangeError
from ccxt.base.errors import A... |
# -*- coding: utf-8 -*-
from setuptools import setup
DESCRIPTION = """
This Django app is intended for **dump data from apps or models via HTTP**. Basically exposes
dumdata command to http.
Features:
- Just accesible by superusers
- Ability to include or exclude any specific app or model
Requirements:
-... |
'''
Created on 01.06.2014
@author: ionitadaniel19
'''
def show_answer_hybrid_simple(driver,scenario):
from modularframework.login import LoginPage
from modularframework.testframeworks import TestFrameworksPage
from config.utilities import get_simple_hybrid_driven_scenario_values
from config.co... |
#!/usr/bin/env python
# Copyright (c) 2015-2016 The Oakcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
'''
Perform basic ELF security checks on a series of executables.
Exit status will be 0 if successful, and ... |
# 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 ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.