content stringlengths 4 20k |
|---|
import random
from google.appengine.api import memcache
_sidChars='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
_defaultTimeout=30*60 # 30 min
_defaultCookieName='gsid'
#----------------------------------------------------------------------
class Session(dict):
"""A secure lightweight memcache-backed sessio... |
#!/usr/bin/python
import sys
from opencv.cv import *
from opencv.highgui import *
src = 0;
image = 0;
dest = 0;
element = 0;
element_shape = CV_SHAPE_RECT;
global_pos = 0;
def Opening(pos):
element = cvCreateStructuringElementEx( pos*2+1, pos*2+1, pos, pos, element_shape, None );
cvErode(src,image,element,1);
... |
from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = r'Y \m. E j \d.'
TIME_FORMAT = 'H:i:s'
DATETIME_FORMAT = r'Y \m. E j \d., H:i:s'
YEAR_MONTH_FORMAT = r'Y \m. F'
MONTH_DAY_FORMAT = r'E ... |
import hr_recruitment_create_partner_job
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
#!/usr/bin/python
# -*- coding: UTF-8 -*-
## Automatically crop book margins
## ================================================================
## Use SimpleCV
from SimpleCV import *
from math import sqrt
import sys
import numpy as np
from subprocess import call
import cv
import cv2
standard_height = 1600.0 #1430.... |
"""
Milestone related tests for the mobile_api
"""
from mock import patch
from courseware.access_response import MilestoneError
from courseware.tests.helpers import get_request_for_user
from courseware.tests.test_entrance_exam import answer_entrance_exam_problem, add_entrance_exam_milestone
from util.milestones_helper... |
# -*- coding: utf-8 -*-
# Define here the models for your scraped items
#
# See documentation in:
# https://doc.scrapy.org/en/latest/topics/items.html
import scrapy
from scrapy import Item, Field
class ZhihuItem(scrapy.Item):
# define the fields for your item here like:
id = Field()
name = Field()
ac... |
import logging
class Observation(object):
"""Describes certificate observation."""
def __init__(self, description, reason=None, details=None):
self.description = description
self.reason = reason
self.details = details
def __repr__(self):
return "%s(%s, %s, %s)" % (self.__cl... |
"""
Tests for moving applications between nodes.
"""
from twisted.trial.unittest import TestCase
from .testtools import (require_cluster,
MONGO_APPLICATION, MONGO_IMAGE,
get_mongo_application, require_flocker_cli)
class MovingApplicationTests(TestCase):
"""
Tes... |
import sys
import argparse
import os
from subprocess import *
compilerList = ["GCC", "ICC", "LLVM", "PGI"]
def getParameters():
parser = argparse.ArgumentParser(description='Extract function level code features for toolchain identification')
parser.add_argument("--filelist", help="A list of binaries to extrac... |
#!/usr/bin/env python2.7
# Parse and decode an ARM-EABI MAP file
from optparse import OptionParser
from subprocess import Popen, PIPE, STDOUT
import binascii
import re
import struct
import sys
demangle_cache = {}
def parse_map_file(mapf):
symbols = {}
text_section = False
symcre = re.compile(r'^\s+(0x[... |
import uuid
from keystoneclient.auth.identity.generic import token
from keystoneclient.auth.identity import v2
from keystoneclient.auth.identity import v3
from keystoneclient.auth.identity.v3 import token as v3_token
from keystoneclient.tests.unit.auth import utils
class TokenTests(utils.GenericPluginTestCase):
... |
import json
from django import forms
from django_webtest import WebTest
from . import build_test_urls
class FileInputForm(forms.Form):
test_field = forms.FileField()
data_field = forms.BooleanField(required=False, widget=forms.HiddenInput,
help_text='To produce non empty P... |
from __future__ import division, print_function, absolute_import
import numpy as np
from numpy.testing import assert_allclose, assert_equal
from scipy import linalg
import cvxopt
import cvxpy
from cvxpy.tests.base_test import BaseTest
class TestNonOptimal(BaseTest):
def test_singular_quad_form(self):
"""... |
from __future__ import absolute_import, division, print_function
import inspect
import datetime
import tempfile
import os
import shutil
import numpy as np
from contextlib import contextmanager
from multiprocessing.pool import ThreadPool
from multipledispatch import Dispatcher
from datashape import dshape, Record
f... |
#-*- coding: utf-8 -*-
# Create your views here.
from django.http import HttpResponse, HttpResponseRedirect
from django.views.generic.simple import direct_to_template
from django.core.urlresolvers import reverse
from django.db import connection, transaction
from django.shortcuts import get_object_or_404
from helpers.... |
import logging
import os
import sys
import time
from gpu_tests import gpu_integration_test
from gpu_tests import pixel_test_pages
from gpu_tests import skia_gold_integration_test_base
from telemetry.util import image_util
test_harness_script = r"""
var domAutomationController = {};
domAutomationController._proc... |
import unittest
from mock import MagicMock, patch
from airflow import configuration
from airflow.contrib.operators.emr_terminate_job_flow_operator import EmrTerminateJobFlowOperator
TERMINATE_SUCCESS_RETURN = {
'ResponseMetadata': {
'HTTPStatusCode': 200
}
}
class TestEmrTerminateJobFlowOperator(uni... |
"""
refcounting
~~~~~~~~~~~
Reference count annotations for C API functions. Has the same
result as the sphinx.ext.refcounting extension but works for all
functions regardless of the signature, and the reference counting
information is written inline with the documentation instead of a
sepa... |
from cwrap import BaseCClass
from ecl import EclPrototype
class WellSegment(BaseCClass):
TYPE_NAME = "well_segment"
_active = EclPrototype("bool well_segment_active(well_segment)")
_main_stem = EclPrototype("bool well_segment_main_stem(well_segment)")
_nearest_wellhead = EclPrototype(... |
__rev_id__ = """$Id: Row.py,v 1.6 2005/08/11 08:53:48 rvk Exp $"""
import BIFFRecords
from Deco import *
from Worksheet import Worksheet
import Style
import Cell
import ExcelFormula
import datetime as dt
class Row(object):
__slots__ = ["__init__",
"__adjust_height",
"__adjust_... |
#!/usr/bin/env python3
import csv
import sys
from django.contrib.auth import get_user_model
from django.core.management.base import BaseCommand
class Command(BaseCommand):
help = "Update counselor information"
def add_arguments(self, parser):
parser.add_argument("filename", type=str, help="Path to ... |
import IMP
import IMP.test
import sys
import IMP.em
import IMP.multifit
import os
class Tests(IMP.test.TestCase):
"""Tests for sampled density maps"""
def setUp(self):
"""initialize IMP environment create particles"""
IMP.test.TestCase.setUp(self)
# init IMP model ( the environment)
... |
import errno
import functools
import glob
import logging
import os
import shutil
from functools import partial
from multiprocessing.pool import ThreadPool
from typing import AnyStr
from typing import Dict
from typing import List
from typing import Optional
from urllib.parse import unquote
from urllib.parse import urljo... |
"""Runs verify/test-go checks for kubernetes/kubernetes."""
import argparse
import os
import re
import subprocess
import sys
BRANCH_VERSION = {
'1.2': '1.4',
'1.3': '1.4',
'master': '1.7',
}
VERSION_TAG = {
'1.4': '1.4-v20161130-8958f82',
'1.5': '1.5-v20161205-d664d14',
'1.6': '1.6-v20161205... |
from m5.params import *
from m5.objects import *
from BaseTopology import SimpleTopology
class Pt2Pt(SimpleTopology):
description='Pt2Pt'
def __init__(self, controllers):
self.nodes = controllers
def makeTopology(self, options, network, IntLink, ExtLink, Router):
nodes = self.nodes
... |
import BoostBuild
t = BoostBuild.Tester(use_test_config=False)
# In order to correctly link this app, 'b.cpp', created by a 'make' rule, should
# be compiled.
t.write("jamroot.jam", "import gcc ;")
t.write("jamfile.jam", r'''
import os ;
if [ os.name ] = NT
{
actions create
{
echo int main() {} > $(... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import itertools
import math
import numpy as np
import tensorflow as tf
from tensorflow.contrib import learn
### Training data
CORPUS_FILENAME = "europarl-v6.fr-en.en"
MAX_DOC_LENGTH = 10
def training_data(... |
#!/usr/bin/env python
"""
@package mi.dataset.parser.test.test_zplsc_c_dcl
@file mi-dataset/mi/dataset/parser/test/test_zplsc_c_dcl.py
@author Richard Han (Raytheon), Ronald Ronquillo (Raytheon)
@brief Test code for a zplsc_c_dcl data parser
"""
import os
from nose.plugins.attrib import attr
from mi.core.log import... |
"""Linear least squares with bound constraints on independent variables."""
from __future__ import division, print_function, absolute_import
import numpy as np
from numpy.linalg import norm, lstsq
from scipy.sparse import issparse, csr_matrix
from scipy.sparse.linalg import LinearOperator, lsmr
from scipy.optimize imp... |
#!/usr/bin/env python2
"""Tool for extending via equivalences a set of segments."""
from __future__ import absolute_import, print_function
import argparse
import copy
import os
import webbrowser
import neuroglancer
from neuroglancer.json_utils import decode_json, encode_json
neuroglancer.set_static_content_source(u... |
# -*- coding: utf-8 -*-
"""
Calculates rho(z) to maintain hydrostatic equilibrium in a thin disc.
Assumes uniform temperature in the disc, and an infinite disc where
rho can be treated (at least locally) as only a function of z.
Created on Mon Jan 20 12:30:06 2014
@author: ibackus
"""
# ICgen packages
import isaac... |
import maya.OpenMaya as OpenMaya
import maya.cmds as cmds
import IECoreMaya
import IECore
def __getFloat3PlugValue(plug):
# Retrieve the value as an MObject
object = plug.asMObject()
# Convert the MObject to a float3
numDataFn = OpenMaya.MFnNumericData(object)
xParam = OpenMaya.MScriptUtil()
xParam.createFrom... |
#!/usr/bin/python
import cPickle as pickle
import numpy as np
import ROOTInterface.Import
import ROOTInterface.Export
from sys import argv
nEvents = -1
doMultiThread = False
def divide(a):
return a[0]/a[1]
def bin(a,b,m):
return min(int(a[0]/b),m)
def angleTruncate(a):
return min(6.28,max(0,a[0]))
print "star... |
#file : InMoov2.minimalTorso.py
# this will run with versions of MRL 1.0.107
# a very minimal script for InMoov
# although this script is very short you can still
# do voice control of a right Arm
# for any command which you say - you will be required to say a confirmation
# e.g. you say -> test stomach, InMoov will a... |
"""
Person module (imdb package).
This module provides the Person class, used to store information about
a given person.
Copyright 2004-2010 Davide Alberani <<EMAIL>>
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 Sof... |
from __future__ import absolute_import, division, unicode_literals
try:
from collections import OrderedDict
except ImportError:
try:
from ordereddict import OrderedDict
except ImportError:
OrderedDict = dict
import gettext
_ = gettext.gettext
import re
from six import text_type
from . im... |
""" Sahana Eden Automated Test - HRM004 Create Volunteer Training
@copyright: 2011-2012 (c) Sahana Software Foundation
@license: MIT
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 Sof... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Ansible module to manage A10 Networks slb server objects
(c) 2014, Mischa Peters <<EMAIL>>,
2016, Eric Chou <<EMAIL>>
This file is part of Ansible
Ansible is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as publ... |
'''
VGDL example: Boulder Dash.
@author: Julian Togelius and Tom Schaul
'''
boulderdash_level = """
wwwwwwwwwwwwwwwwwwwwwwwwww
w...o.xx.o......o..xoxx..w
w...oooooo........o..o...w
w....xxx.........o.oxoo.ow
wx...............oxo...oow
wwwwwwwwww........o...wxxw
wb ...co..............wxxw
w ........Ao....o....wxxw
wo... |
#!/usr/bin/env python
from misc_parser import *
from gh_parser import *
from asset_parser import *
from docs_parser import *
from deploy_setup import *
import copy, os
parse_misc()
unity_vers = parse_unity_version()
unity_vers_url = get_available_unity_vers()[unity_vers]
rebuild_yml = {
"language": ["objective... |
import signal
import weakref
from functools import wraps
__unittest = True
class _InterruptHandler(object):
def __init__(self, default_handler):
self.called = False
self.default_handler = default_handler
def __call__(self, signum, frame):
installed_handler = signal.getsignal(signal.... |
import gym
import time
import MultiNEAT as NEAT
import MultiNEAT.viz as viz
import random as rnd
import pickle
import numpy as np
import cv2
from tqdm import tqdm
rng = NEAT.RNG()
rng.TimeSeed()
params = NEAT.Parameters()
params.PopulationSize = 150
params.DynamicCompatibility = True
params.WeightDiffCoeff = 1.0
par... |
# IDLEX EXTENSION
"""
Documentation Viewer Extension
Version: 0.2
Author: Roger D. Serwy
<EMAIL>
Date: 2009-05-29
Date: 2011-12-26 - modified to work with IdleX and Python 3
It provides "Documentation Viewer" under "Help"
Add these lines to config-extensions.def
Parts of this code is based on a patch subm... |
from m5.SimObject import SimObject
from m5.params import *
from m5.proxy import *
from Device import BasicPioDevice, DmaDevice, PioDevice
class PciConfigAll(BasicPioDevice):
type = 'PciConfigAll'
cxx_header = "dev/pciconfigall.hh"
platform = Param.Platform(Parent.any, "Platform this device is part of.")
... |
from __future__ import print_function, division, unicode_literals, absolute_import
import random
from nltk.corpus import wordnet as wn
import click
def transitive_closure(synsets):
hypernyms = set([])
for s in synsets:
paths = s.hypernym_paths()
for path in paths:
hypernyms.update... |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {
'status': ['preview'],
'supported_by': 'community',
'metadata_version': '1.0'
}
from ansible.module_utils.fortios import fortios_argument_spec, fortios_required_if
from ansible.module_utils.fortios ... |
from __future__ import print_function
import time, sys, signal, atexit
from upm import pyupm_abp as abp
def main():
# Instantiate a Honeywell ABP Pressure sensor on the I2C bus 0
abp_sensor = abp.ABP(0, 0x28);
## Exit handlers ##
# This function stops python from printing a stacktrace when you hit con... |
"""
Django admin commands related to verify_student
"""
from django.core.management.base import BaseCommand
from lms.djangoapps.verify_student.models import SoftwareSecurePhotoVerification
class Command(BaseCommand):
"""
This method finds those PhotoVerifications with a status of
MUST_RETRY and attempts... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.test import TestCase
from opps.utils.text import split_tags
class SplitTags(TestCase):
def test_common(self):
source = 'gabriela pugliesi e Ricardo,NOVIDADE,instagram'
output = ['gabriela pugliesi e... |
import os.path
import time
from twisted.internet import threads
from twisted.web import server, static
from twisted.web.error import PageRedirect
from coherence.upnp.core.utils import ReverseProxyUriResource
from twisted.internet import task
from coherence.upnp.core import utils
from coherence.upnp.core imp... |
from __future__ import with_statement
from fabric.api import *
from fabric.contrib.console import confirm
env.project_name = 'info-reborn'
env.www_user = 'www-data'
env.project_dir = '/var/www/%s/'%env.project_name
env.sites_available = '/etc/apache2/sites-available/'
def check_uncommitted_changes():
num_changes_st... |
{
'name': 'Lunch Orders',
'author': 'OpenERP SA',
'version': '0.2',
'depends': ['base'],
'category' : 'Tools',
'summary': 'Lunch Order, Meal, Food',
'description': """
The base module to manage lunch.
================================
Many companies order sandwiches, pizzas and other, from u... |
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import distutils.spawn
import os
import os.path
import pipes
import subprocess
import traceback
from ansible import constants as C
from ansible.errors import AnsibleError
from ansible.plugins.connection import ConnectionBase
BUF... |
#!/usr/bin/python
# -*- coding: iso-8859-15 -*-
from xml.sax import make_parser
from xml.sax.handler import ContentHandler
class SmallSMILHandler(ContentHandler):
def __init__(self):
self.lista_dic = []
self.tags = ['root-layout', 'region', 'img', 'audio', 'textstream']
self.attrs = {
... |
from __future__ import (absolute_import, division, print_function)
import unittest
from mantid.api import Sample
from mantid.simpleapi import CreateWorkspace
from mantid.simpleapi import SetSampleMaterial
from mantid.geometry import CrystalStructure
class SampleTest(unittest.TestCase):
def setUp(self):
s... |
__author__ = 'drobisch'
from server import db, flask_bcrypt, orm
from wtforms.validators import Email
import random
import base64
import datetime
import marshmallow
class User(db.Model):
ACCESSTYPE_NO_ACCESS = 0
ACCESSTYPE_DAILY_ACCESS_PERIOD = 1
ACCESSTYPE_ACCESS_DAYS = 2
ACCESSTYPE_LIFETIME_ACCESS =... |
import json
import pytest
from units.compat import mock
from ansible.module_utils import basic
from ansible.module_utils._text import to_bytes
from ansible.modules.remote_management.lxca import lxca_nodes
from ansible.module_utils.remote_management.lxca.common import setup_conn
from ansible.module_utils.remote_managem... |
"""The tests for SleepIQ sensor platform."""
import unittest
from unittest.mock import MagicMock
import requests_mock
from homeassistant.components.sensor import sleepiq
from tests.components.test_sleepiq import mock_responses
from tests.common import get_test_home_assistant
class TestSleepIQSensorSetup(unittest.T... |
#!/usr/bin/env python
import json
try:
import urllib2 as request
from urllib import quote
except:
from urllib import request
from urllib.parse import quote
from tk import calc_tk
class Translator:
tran_table = [(',,,,', ',null,null,null,'), (',,,', ',null,null,'),
(',,', ',null,'... |
# -*- coding: utf-8 -*-
citation = {'ref': u"Rose, R.W., T. Brüser,. J. C. Kissinger, and M. "
u"Pohlschröder. 2002. Adaptation of protein secretion "
u"to extremely high salt concentrations by extensive use "
u"of the twin arginine translocation pathway. Mol. M... |
"""
English-language mappings for language-dependent features of
reStructuredText.
"""
__docformat__ = 'reStructuredText'
directives = {
# language-dependent: fixed
u'\u05ea\u05e9\u05d5\u05de\u05ea \u05dc\u05d1': 'attention',
u'\u05d6\u05d4\u05d9\u05e8\u05d5\u05ea': 'caution',
u'\... |
"""Tests for sending large-size data through tfdbg grpc channels.
"Large-size data" includes large GraphDef protos and large Tensor protos.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
from six.moves import xrange # pylint: disabl... |
# -*- coding: utf-8 -*-
"""
pygments.styles.murphy
~~~~~~~~~~~~~~~~~~~~~~
Murphy's style from CodeRay.
:copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.style import Style
from pygments.token import Keyword, Name, Comment,... |
# encoding: utf-8
"""
Copyright 2013 Jérémie BOUTOILLE
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 version.
This program is distri... |
"""
This module is for the miscellaneous GEOS routines, particularly the
ones that return the area, distance, and length.
"""
from ctypes import c_int, c_double, POINTER
from django.contrib.gis.geos.libgeos import GEOM_PTR, GEOS_PREPARE
from django.contrib.gis.geos.prototypes.errcheck import check_dbl, check_string
f... |
# -*- coding: utf-8 -*-
# This is a hack of the builtin todo extension, to make the todo_list
# more user friendly.
from sphinx.ext.todo import *
import re
def _(s):
return s
def process_todo_nodes(app, doctree, fromdocname):
if not app.config['todo_include_todos']:
for node in doctree.traverse(tod... |
"""
Tests for the crypto submodule.
"""
from leap.common.testing.basetest import BaseLeapTest
from leap.common import crypto
from Crypto import Random
class CryptoTestCase(BaseLeapTest):
def setUp(self):
pass
def tearDown(self):
pass
def test_encrypt_decrypt_sym(self):
# gener... |
import asyncio
import unittest
import aiohttp
from slack.web.classes.attachments import Attachment, AttachmentField
from slack.web.classes.blocks import SectionBlock, ImageBlock
from slack.webhook import AsyncWebhookClient, WebhookResponse
from tests.helpers import async_test
from tests.webhook.mock_web_api_server im... |
import time
import sys
import smtplib
from email.mime.multipart import MIMEMultipart
from email.mime.base import MIMEBase
from email.mime.text import MIMEText
from email import Encoders
from email.Utils import COMMASPACE, formatdate
from Peach.publisher import Publisher
from Peach.Engine.common import PeachException
... |
""" generic mechanism for marking and selecting python functions. """
import inspect
class MarkerError(Exception):
"""Error in use of a pytest marker/attribute."""
def pytest_namespace():
return {'mark': MarkGenerator()}
def pytest_addoption(parser):
group = parser.getgroup("general")
group._addo... |
import contextlib
import logging
import os
import sys
from pylib import constants
sys.path.append(os.path.join(
constants.DIR_SOURCE_ROOT, 'third_party', 'requests', 'src'))
sys.path.append(os.path.join(
constants.DIR_SOURCE_ROOT, 'third_party', 'appurify-python', 'src'))
handlers_before = list(logging.getLog... |
from traits.api import HasTraits, Any, Instance, Float, Event, \
Property, Bool, on_trait_change
from traitsui.api import View, Item, Handler, HGroup, ButtonEditor, spring, VGroup, Spring, UItem, RangeEditor
# import apptools.sweet_pickle as pickle
# ============= standard library imports ========================
#... |
from __future__ import unicode_literals
import frappe
def execute():
index_map = {
"Account": ["parent_account", "lft", "rgt"],
"GL Entry": ["posting_date", "account", 'party', "voucher_no"],
"Sales Invoice": ["posting_date", "debit_to", "customer"],
"Purchase Invoice": ["posting_date", "credit_to", "supplie... |
import pytest
import tornado.web
import jsonpickle
from arteria import *
from arteria.configuration import ConfigurationService
from siswrap.app import *
from siswrap.handlers import *
from siswrap.wrapper_services import *
# Some unit tests for siswrap.handlers
API_URL = "/api/1.0"
@pytest.fixture
def app():
... |
"""
Views for the maintenance app.
"""
import logging
from django.db import transaction
from django.core.validators import ValidationError
from django.utils.decorators import method_decorator
from django.utils.translation import ugettext as _
from django.views.generic import View
from edxmako.shortcuts import render_t... |
"""
Brazilian Portuguese-language mappings for language-dependent features of
reStructuredText.
"""
__docformat__ = 'reStructuredText'
directives = {
# language-dependent: fixed
u'aten\u00E7\u00E3o': 'attention',
'cuidado': 'caution',
u'code (translation required)': 'code',
'perigo': 'd... |
#! /usr/bin/env python
import csv, os, sys
# The directory of this UDF file
BASE_DIR = os.path.dirname(os.path.realpath(__file__))
# Load the spouse dictionary for distant supervision.
# A person can have multiple spouses
spouses = set()
married_people = set()
lines = open(BASE_DIR + '/../data/spouses.tsv').readline... |
#!/usr/bin/env python
# How to use
# >python genDocDb.influx.py -h localhost -P 8086 -u root -p password -d database -m measurement -n 1000 -t 1 -r default
import datetime
import logging
import argparse
import random
import time
import sys
from influxdb import InfluxDBClient
def get_args_parser():
parser = argparse.... |
from unittest import TestCase
try:
from opencog.atomspace import AtomSpace, TruthValue, Atom #, Handle
from opencog.atomspace import types, get_type, get_type_name # is_a
except ImportError:
from atomspace_remote import AtomSpace, TruthValue, Atom #, Handle
from atomspace_remote import types, get_type,... |
import sys
from whoosh import query
from whoosh.compat import text_type
from whoosh.qparser import syntax
from whoosh.qparser.common import print_debug, QueryParserError
# Query parser object
class QueryParser(object):
"""A hand-written query parser built on modular plug-ins. The default
configuration imple... |
from resource_management import *
class EagleServiceCheck(Script):
def service_check(self,env):
import params
env.set_params(params)
import actions
eagle_service_exec(action="status")
if __name__ == "__main__":
EagleServiceCheck().execute() |
# -*- coding: utf-8 -*-
"""
requests.structures
~~~~~~~~~~~~~~~~~~~
Data structures that power Requests.
"""
import collections
from .compat import OrderedDict
class CaseInsensitiveDict(collections.MutableMapping):
"""
A case-insensitive ``dict``-like object.
Implements all methods and operations of... |
# -*- coding: utf-8 -*-
"""
***************************************************************************
QGISAlgorithmProvider.py
---------------------
Date : December 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
***************... |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}
try:
from zabbix_api import ZabbixAPI, ZabbixAPISubClass
from zabbix_api import Alr... |
# -*- coding: utf-8 -*-
from nose.tools import * # PEP8 asserts
from modularodm import fields, StoredObject
from modularodm.query.query import RawQuery as Q
from tests.base import ModularOdmTestCase
class TestForeignQueries(ModularOdmTestCase):
def define_objects(self):
class Foo(StoredObject):
... |
from django.contrib import messages
from django.contrib.auth.decorators import login_required
from django.forms import ModelForm
from django.http import HttpResponseRedirect
from django.shortcuts import render
from contracts.models import Advertiser
__author__ = 'roger'
class AdvertiserForm(ModelForm):
class M... |
"""
This package contains modules for standard tree transforms available
to Docutils components. Tree transforms serve a variety of purposes:
- To tie up certain syntax-specific "loose ends" that remain after the
initial parsing of the input plaintext. These transforms are used to
supplement a limited syntax... |
"""
Bindings for sending notifications to file objects.
"""
from distutils.util import strtobool
from ..abc.configurations import Configurable
from ..abc.files import Path
from ..abc.notifications import Notifier
from ..configurations import ConfigManager
from ..exceptions import OperationNotSupportedError, verify_... |
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import string
import textwrap
from ansible import constants as C
from units.compat import mock
from units.compat import unittest
from ansible.module_utils.six import string_types
from ansible.module_utils._text import to_text
from... |
import datetime
import openerp
from openerp import api, models
from openerp.osv import fields, osv
class stock_production_lot(osv.osv):
_inherit = 'stock.production.lot'
def _get_date(dtype):
"""Return a function to compute the limit date for this type"""
def calc_date(self, cr, uid, context=... |
"""
Views for courses info API
"""
from rest_framework import generics, status
from rest_framework.response import Response
from courseware.access import is_mobile_available_for_user
from student.models import CourseEnrollment
from lms.djangoapps.mobile_api.social_facebook.courses import serializers
from ...users.... |
import logging
import click
from flask.cli import with_appcontext
from scout.commands.utils import builds_option
from scout.export.transcript import export_transcripts
from scout.server.extensions import store
LOG = logging.getLogger(__name__)
@click.command("transcripts", short_help="Export transcripts")
@builds_... |
"""
Python Interchangeable Virtual Instrument Library
Copyright (c) 2012-2014 Alex Forencich
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... |
# -*- coding: utf-8 -*-
"""
***************************************************************************
SetRasterStyle.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
************************... |
#
# Unpacker for Dean Edward's p.a.c.k.e.r, a part of javascript beautifier
# by Einar Lielmanis <<EMAIL>>
#
# written by Stefano Sanfilippo <<EMAIL>>
#
# usage:
#
# if detect(some_string):
# unpacked = unpack(some_string)
#
"""Unpacker for Dean Edward's p.a.c.k.e.r"""
import re
import string
class Unpacking... |
# -*- coding: iso-8859-1 -*-
"""Parser for command line options.
This module helps scripts to parse the command line arguments in
sys.argv. It supports the same conventions as the Unix getopt()
function (including the special meanings of arguments of the form `-'
and `--'). Long options similar to those supported by... |
class ProblemSolver (object):
def __init__ (self, robot):
self.client = robot.client.basic
self.robot = robot
## \name Initial and goal configurations
# \{
## Set initial configuration of specified problem.
# \param dofArray Array of degrees of freedom
# \throw Error.
def s... |
"""
Webcore is a basic web server framework based on the SocketServer-based
BaseHTTPServer that comes with Python. The big difference is that this
one can carve up URL-space by prefix, such that "/foo/*" gets handled by
a different request handler than "/bar/*". I refer to this as "splitting".
You should also be abl... |
import os
import time
from django.conf import settings
from django.db import connections
from django.dispatch import receiver, Signal
from django.utils import timezone
from django.utils.functional import empty
template_rendered = Signal(providing_args=["template", "context"])
setting_changed = Signal(providing_args=... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.