content stringlengths 4 20k |
|---|
#!/usr/bin/env python
from setuptools import setup, find_packages
entry_points = {'console_scripts': [
'semeval2014task5-setview = libsemeval2014task5.setview:main',
'semeval2014task5-evaluate = libsemeval2014task5.evaluation:main',
]}
setup(
name = "libsemeval2014task5",
version = "0.1",
author = "... |
from __future__ import unicode_literals, print_function
import os.path
from lnc.lib.exceptions import ProgramError
from lnc.lib.io import mkdir_p
_TOC_READ_ERROR_MSG = _(
"Error while reading Table of Contents file '{file}':\n{error}")
_ENCODING_ERROR_MSG = _(
"Incorrect encoding name at the first line of ... |
import chainer
import chainer.functions as F
class GoogLeNet(chainer.FunctionSet):
insize = 224
def __init__(self):
super(GoogLeNet, self).__init__(
conv1=F.Convolution2D(3, 64, 7, stride=2, pad=3),
conv2_reduce=F.Convolution2D(64, 64, 1),
conv2=F.Convolution2D(... |
from __future__ import (nested_scopes, generators, division, absolute_import, with_statement,
print_function, unicode_literals)
import collections
from hashlib import sha1
import os
from twitter.common.lang import Compatibility
from pants.base.build_environment import get_buildroot
from pants... |
#!/usr/bin/env python
"""
Show how to make date plots in matplotlib using date tick locators and
formatters. See major_minor_demo1.py for more information on
controlling major and minor ticks
All matplotlib date plotting is done by converting date instances into
days since the 0001-01-01 UTC. The conversion, tick lo... |
#!/usr/bin/python
"""
This program is demonstration for face and object detection using haar-like features.
The program finds faces in a camera image or video stream and displays a red box around them,
then centers the webcam via two servos so the face is at the center of the screen
Based on facedetect.py in the OpenCV... |
#!/usr/bin/python
from tabulate import tabulate
class State:
#Constructor, add self on function for non-static methods / variables
def __init__(self, transition, name):
self.accept_state = False
self.accept_num = 0
self.transition = transition
self.next_state = []
se... |
ANSIBLE_METADATA = {'status': ['stableinterface'],
'supported_by': 'committer',
'version': '1.0'}
try:
import boto.ec2
HAS_BOTO = True
except ImportError:
HAS_BOTO = False
def main():
argument_spec = ec2_argument_spec()
argument_spec.update(dict(
re... |
"""properties_dialog.py - Properties dialog that displays information about the archive/file."""
import gtk
import os
import time
import stat
try:
import pwd
except ImportError:
# Running on non-Unix machine.
pass
from mcomix import i18n
from mcomix import strings
from mcomix import properties_page
class... |
"""Define text roles for GitHub
* ghissue - Issue
* ghpull - Pull Request
* ghuser - User
Adapted from bitbucket example here:
https://bitbucket.org/birkenfeld/sphinx-contrib/src/tip/bitbucket/sphinxcontrib/bitbucket.py
Authors
-------
* Doug Hellmann
* Min RK
"""
#
# Original Copyright (c) 2010 Doug Hellmann. All... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Creates a regular polygon (triangles, pentagons, ...) as a special case of a
:class:`~psychopy.visual.ShapeStim`"""
# Part of the PsychoPy library
# Copyright (C) 2002-2018 Jonathan Peirce (C) 2019-2021 Open Science Tools Ltd.
# Distributed under the terms of the GNU G... |
# -*- coding: utf-8 -*-
import lilylib as ly
import book_snippets as BookSnippet
from book_snippets import *
import re
global _;_=ly._
progress = ly.progress
warning = ly.warning
error = ly.error
########################################################################
# Helper functions
#############################... |
"""Reader objects to abstract out different body response types.
This module is package-private. It is not expected that these will
have any clients outside of httpplus.
"""
from __future__ import absolute_import
try:
import httplib
httplib.HTTPException
except ImportError:
import http.client as httplib
... |
#!/usr/bin/env python
"""
MIT License
Copyright (c) 2016 Pieter-Jan Briers
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, cop... |
"""
Views to render a learner's achievements.
"""
from django.template.loader import render_to_string
from lms.djangoapps.certificates import api as certificate_api
from openedx.core.djangoapps.certificates.api import certificates_viewable_for_course
from openedx.core.djangoapps.content.course_overviews.models import ... |
"""OpenSSL/M2Crypto RSA implementation."""
from .cryptomath import *
from .rsakey import *
from .python_rsakey import Python_RSAKey
#copied from M2Crypto.util.py, so when we load the local copy of m2
#we can still use it
def password_callback(v, prompt1='Enter private key passphrase:',
pro... |
# Django
from django import template
from django.utils.safestring import mark_safe
register = template.Library()
@register.simple_tag
def print_none(obj):
if obj is None:
return ''
else:
return str(obj)
HTML_GLOBAL_ATTRS = ['accesskey',
'class',
'cont... |
import sys
import os
import hal
from PyQt5.QtCore import QProcess, QByteArray
from PyQt5 import QtGui, QtWidgets, uic
from qtvcp.widgets.widget_baseclass import _HalWidgetBase
from qtvcp.core import Action, Status, Info
from qtvcp import logger
ACTION = Action()
STATUS = Status()
INFO = Info()
LOG = logger.getLogger(_... |
from tamkin import *
# Load the gaussian data:
mol_react = load_molecule_g03fchk("react.fchk")
mol_ts = load_molecule_g03fchk("ts.fchk")
# Perform the normal mode analysis
nma_react = NMA(mol_react, ConstrainExt())
nma_ts = NMA(mol_ts, ConstrainExt(2e-4))
# Construct the two partition functions.
pf_react = PartFun(nma... |
#!/usr/bin/env python3
'''Khronos sync extensions for EGL.
This module contains two "sync object" extensions available in EGL.
A "reusable sync object" is similar to a semaphore, and is used to
synchronize activity between client APIs or threads. Each thread can
manually signal and unsignal the sync object to releas... |
"""Cholesky decomposition functions."""
from __future__ import division, print_function, absolute_import
from numpy import asarray_chkfinite, asarray
# Local imports
from .misc import LinAlgError, _datacopied
from .lapack import get_lapack_funcs
__all__ = ['cholesky', 'cho_factor', 'cho_solve', 'cholesky_... |
"""The tests for the USGS Earthquake Hazards Program Feed platform."""
import datetime
from unittest.mock import MagicMock, call, patch
from homeassistant.components import geo_location
from homeassistant.components.geo_location import ATTR_SOURCE
from homeassistant.components.usgs_earthquakes_feed.geo_location import... |
import base64
import getpass
import os
import socket
import sys
import traceback
import paramiko
from paramiko.py3compat import input
# setup logging
paramiko.util.log_to_file("demo_sftp.log")
# Paramiko client configuration
UseGSSAPI = True # enable GSS-API / SSPI authentication
DoGSSAPIKeyExchange = True
Port = ... |
import numpy as np
from numpy.testing import assert_almost_equal, assert_array_almost_equal
from menpo.shape import PointCloud, DirectedGraph, UndirectedGraph
from menpo.math import as_matrix
from .. import GMRFModel, GMRFVectorModel
def _compute_sum_cost_block_sparse(
samples, test_sample, graph, n_features_pe... |
from questions import *
class Question(RandomizedQuestion):
module = __file__
video = 'ratio-test-example'
forum = 10115
title = 'apply the ratio test on a series involving powers'
textbook = 'example:n-to-fifth-over-five-to-n'
def good_enough(self):
return self.ell != 1
def pertu... |
import mock
from nova import exception
from nova import test
from nova.tests.unit.virt.libvirt import fakelibvirt
from nova import utils
from nova.virt.libvirt import host
from nova.virt.libvirt.volume import volume
SECRET_UUID = '2a0a0d6c-babf-454d-b93e-9ac9957b95e0'
class FakeSecret(object):
def __init__(sel... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Based on AboutNil in the Ruby Koans
#
from runner.koan import *
class AboutNone(Koan):
def test_none_is_an_object(self):
"Unlike NULL in a lot of languages"
self.assertEqual(True, isinstance(None, object))
def test_none_is_universal(self):
... |
# encoding=utf-8
'''Basic HTTP Client.'''
import functools
import gettext
import logging
import warnings
from trollius import From, Return
import trollius
from wpull.abstract.client import BaseClient, BaseSession, DurationTimeout
from wpull.backport.logging import BraceMessage as __
from wpull.body import Body
from w... |
'''A generic plugin manager.
The plugin manager finds files with plugins and loads them. It looks
for plugins in a number of locations specified by the caller. To add
a plugin to be loaded, it is enough to put it in one of the locations,
and name it *_plugin.py. (The naming convention is to allow having
other modules ... |
import unittest as ut
import unittest_decorators as utx
import numpy as np
import espressomd
BOX_L = 50.
@utx.skipIfMissingFeatures("LENNARD_JONES")
class AnalyzeDistance(ut.TestCase):
system = espressomd.System(box_l=3 * [BOX_L])
system.seed = system.cell_system.get_state()['n_nodes'] * [1234]
np.random... |
# implementation of card game - Memory
import simplegui
import random
# helper function to initialize globals
def new_game():
global cards, exposed, open_cards, turns
cards = range(8) * 2
random.shuffle(cards)
exposed = [False] * 16
open_cards = list()
turns = 0
label.set_text('Turns = %s' ... |
from typing import TYPE_CHECKING
from kivy.app import App
from kivy.clock import Clock
from kivy.factory import Factory
from kivy.properties import ObjectProperty
from kivy.lang import Builder
from decimal import Decimal
from kivy.uix.popup import Popup
from electrum_ltc.gui.kivy.i18n import _
from ...util import add... |
from iaasgw.exception.iaasException import IaasException
from iaasgw.log.log import IaasLogger
from iaasgw.utils.stringUtils import isNotEmpty, isEmpty
from iaasgw.utils.readIniFile import getAzureDeviceProperty
from ConfigParser import NoSectionError
import traceback
class azureVolumeController(object):
logger =... |
"""Base class for creating split nodes using one or more features."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import abc
import six
from tensorflow.contrib.boosted_trees.python.ops import batch_ops_utils
from tensorflow.python.ops import control_f... |
from sympy.core.function import Derivative
from sympy.vector.vector import Vector
from sympy.vector.coordsysrect import CoordSysCartesian
from sympy.simplify import simplify
from sympy.core.symbol import symbols
from sympy.core import S
from sympy import sin, cos
from sympy.vector.functions import (curl, divergence, gr... |
from Xlib.protocol import request
from Xlib.xobject import resource
class Cursor(resource.Resource):
__cursor__ = resource.Resource.__resource__
def free(self, onerror = None):
request.FreeCursor(display = self.display,
onerror = onerror,
cursor = ... |
import struct
import socket
import time
import sys
import re
import numpy
class Kei2600A:
PORT = 5025
def __init__(self, host, port=PORT):
self.host = host
self.s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
self.s.connect((host, port))
#self.s.settimeout(100)
se... |
"""Tests for the private `override_threadpool()` transformation."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import threading
from absl.testing import parameterized
import numpy as np
from tensorflow.core.framework import graph_pb2
from tensorflow.p... |
from __future__ import absolute_import
import time
from telemetry.internal.actions import page_action
import py_utils
class RepaintContinuouslyAction(page_action.PageAction):
"""Continuously repaints the visible content by requesting animation frames
until self.seconds have elapsed AND at least three RAFs have ... |
#!/usr/bin/env python
#
#
'''
Using solvent model in the CASCI calculations. There are two ways to
incorporate solvent effects. One is allow solvent to response to the
electron density. The other is to freeze the solvent effects for certain
electron density.
'''
from pyscf import gto, scf, mcscf
from pyscf import sol... |
from page_sets import repeatable_synthesize_scroll_gesture_shared_state
from telemetry.page import page as page_module
from telemetry import story
class SwiffyPage(page_module.Page):
def __init__(self, url, page_set):
super(SwiffyPage, self).__init__(url=url, page_set=page_set,
... |
import os
import generic
from sickbeard import encodingKludge as ek
class PS3Metadata(generic.GenericMetadata):
"""
Metadata generation class for Sony PS3.
The following file structure is used:
show_root/cover.jpg (poster)
show_root/Season ##/filename.ext (*)... |
from django.urls import reverse
from django.utils.translation import ugettext_lazy as _
from horizon import tabs
class OverviewTab(tabs.Tab):
name = _("Overview")
slug = "overview"
template_name = ("project/cgroups/_detail_overview.html")
def get_context_data(self, request):
cgroup = self.ta... |
"""Tests for the HTML classes"""
from pytest import mark, raises
from translate.storage import base, html
def test_guess_encoding():
"""Read an encoding header to guess the encoding correctly"""
h = html.htmlfile()
assert h.guess_encoding('''<META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=UT... |
'''The script excludes genes that have more than a given number of isoforms.
The default is 50.
'''
import sys
import csv
def parse_BED(filename):
reader = csv.reader(open(filename), dialect='excel-tab')
for row in reader:
transcript_id = row[3].replace(':', '-')
yield transcript_id, row
... |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
################################################################################
# Documentation
################################################################################
ANSIBLE_METADATA = {'metadata_version': '1.1', 'statu... |
from __future__ import absolute_import
from flask import url_for, redirect, current_app
from flask.ext.login import current_user
from invenio.modules.oauthclient.models import RemoteToken
from invenio.modules.oauthclient.handlers import authorized_signup_handler, \
oauth_error_handler
from invenio.modules.oauthcl... |
import os
from setuptools import setup, find_packages
README = open(os.path.join(os.path.dirname(__file__), 'README.rst')).read()
# allow setup.py to be run from any path
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))
setup(
name = 'cmsplugin-rt',
version = '0.5.1',
packag... |
""" Copyright (c) 2003-2006 LOGILAB S.A. (Paris, FRANCE).
http://www.logilab.fr/ -- mailto:<EMAIL>
utilities for PyLint configuration :
_ pylintrc
_ pylint.d (PYLINT_HOME)
"""
import pickle
import os
import sys
from os.path import exists, isfile, join, expanduser, abspath, dirname
# pylint home is used to s... |
# coding: utf-8
from __future__ import absolute_import
from django.core import mail
from sentry.models import OrganizationMember
from sentry.testutils import TestCase
class OrganizationMemberTest(TestCase):
def test_counter(self):
organization = self.create_organization(name='Foo')
user2 = sel... |
#!/usr/bin/env python
'''
Run this script every time you change one of the png files. Using pngcrush, it will optimize the png files, remove various color profiles, remove ancillary chunks (alla) and text chunks (text).
#pngcrush -brute -ow -rem gAMA -rem cHRM -rem iCCP -rem sRGB -rem alla -rem text
'''
import os
impor... |
from __future__ import print_function
import os
import sys
assert sys.argv[1] == '-frontend'
if '-primary-file' in sys.argv:
primaryFile = sys.argv[sys.argv.index('-primary-file') + 1]
else:
primaryFile = None
if primaryFile and primaryFile.endswith(".bc"):
sys.exit()
filelistFile = sys.argv[sys.argv.index('... |
import unittest, random, sys, time
sys.path.extend(['.','..','../..','py'])
import h2o, h2o_cmd, h2o_glm, h2o_import as h2i, h2o_nn
def define_params():
paramDict = {
'destination_key' : [None, 'NN2_model'],
'ignored_cols' : [None, 0, 1, '0,1'],
'classification... |
__author__ = 'mpetyx'
from django.db import models
import tweepy
class TwitterInteraction(models.Model):
user_name = models.TextField()
post_id = models.TextField()
created = models.DateTimeField(auto_now_add=True)
updated = models.DateTimeField(auto_now=True)
screen_name = models.TextField()
... |
def pp(x):
print("=======[]=======")
print(x)
print("------------------")
def foo(a):
return a+1
rr = list(map(foo, [1,2,3]))
pp(rr)
ll = []
for i in [1,2,3]:
ll.append(foo(i))
pp(ll)
lst = list(map(lambda x: x**2, [1,2,3]))
pp(lst)
lst = list(filter(lambda x: not x%2, [1... |
from tempest_lib import exceptions as lib_exc
from tempest.api.image import base
from tempest import test
class ImagesMemberNegativeTest(base.BaseV2MemberImageTest):
@test.attr(type=['negative'])
@test.idempotent_id('b79efb37-820d-4cf0-b54c-308b00cf842c')
def test_image_share_invalid_status(self):
... |
"Thread-based monitoring of a stenotype machine using the passport protocol."
from plover.machine.base import SerialStenotypeBase
from itertools import izip_longest
# Passport protocol is documented here:
# http://www.eclipsecat.com/?q=system/files/Passport%20protocol_0.pdf
STENO_KEY_CHART = {
'!': None,
'#'... |
"""Utilities for dealing with the python unittest module."""
import fnmatch
import sys
import unittest
class _TextTestResult(unittest._TextTestResult):
"""A test result class that can print formatted text results to a stream.
Results printed in conformance with gtest output format, like:
[ RUN ] autofi... |
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from qgis.core import *
from qgis.gui import *
class RectangleMapTool(QgsMapToolEmitPoint):
def __init__(self, canvas):
self.canvas = canvas
QgsMapToolEmitPoint.__init__(self, self.canvas)
self.rubberBand = QgsRubberBand( self.canvas, QGis.Polyg... |
# Absolute Optical Flow Rotation/Scale
#
# This example shows off using your OpenMV Cam to measure
# rotation/scale by comparing the current and a previous
# image against each other. Note that only rotation/scale is
# handled - not X and Y translation in this mode.
# To run this demo effectively please mount your Ope... |
import csv
import cffi
# IN-PROGRESS. See the demo at the end of the file
def _make_ffi_from_dialect(dialect_name):
dialect = csv.get_dialect(dialect_name)
ffi = cffi.FFI()
ffi.cdef("""
long parse_line(char *rawline, long inputlength);
""")
d = {'quotechar': ord(dialect.quotechar),
... |
from unittest import TestCase
import itertools
import Agent
import numpy as np
__author__ = "Tamas Simon"
__copyright__ = "Copyright 2017, Tamas Simon"
__license__ = "GPLv3"
class MockEnvironment(object):
pass
class TestAgent(TestCase):
def test_exploit_choses_randomly_among_equals(self):
mock_en... |
from Screens.Screen import Screen
from Screens.ChoiceBox import ChoiceBox
from Screens.InputBox import InputBox
from Screens.MessageBox import MessageBox
from Screens.HelpMenu import HelpableScreen
from Components.ActionMap import HelpableActionMap, ActionMap
from Components.Sources.List import List
from Components.Sou... |
"""
=============================================================================
Manifold learning on handwritten digits: Locally Linear Embedding, Isomap...
=============================================================================
An illustration of various embeddings on the digits dataset.
The RandomTreesEmbed... |
from django.contrib.gis.db import models
class SimpleModel(models.Model):
class Meta:
abstract = True
required_db_features = ['gis_enabled']
class Location(SimpleModel):
point = models.PointField()
def __str__(self):
return self.point.wkt
class City(SimpleModel):
name = mo... |
from gimpfu import *
gettext.install("gimp20-python", gimp.locale_directory, unicode=True)
def make_gradient(palette, num_segments, num_colors):
gradient = pdb.gimp_gradient_new(palette)
if (num_segments > 1):
pdb.gimp_gradient_segment_range_split_uniform(gradient, 0, -1,
... |
from sickbeard import helpers
from sickbeard import logger
def getShowImage(url, imgNum=None):
image_data = None # @UnusedVariable
if url is None:
return None
# if they provided a fanart number try to use it instead
if imgNum is not None:
tempURL = url.split('-')[0] + ... |
#
# simple test program
#
# $Id: ex1.py 868 2005-05-16 19:39:22Z max $
#
import async
import ex1
import socket
import sys
import posix
global i
i = 5
def cb(err,res,cli):
print "err=", err, "& res=", res
global i
if i == 0:
print "Calling exit"
async.core.nowcb ( async.core.exit );
el... |
from django.conf.urls import patterns, url
from django.contrib.auth.decorators import login_required
from django.views.generic import TemplateView
from .views import DocumentUploadView, DocumentUpdateView
js_info_dict = {
'packages': ('geonode.documents',),
}
urlpatterns = patterns('geonode.documents.views',
... |
import mock
from nose.tools import *
from tests.base import OsfTestCase
from tests.factories import ProjectFactory, AuthUserFactory
from framework.auth import Auth
from website.addons.figshare import model
from website.addons.figshare import exceptions
from website.addons.figshare import settings as figshare_settings... |
#!/usr/bin/env python
from mimetypes import guess_type
from django.conf.urls.defaults import url
from django.core.exceptions import ObjectDoesNotExist
from django.core.servers.basehttp import FileWrapper
from django.http import HttpResponse
from django.utils.translation import ugettext_lazy as _
from tastypie import ... |
from __future__ import (absolute_import, division, print_function)
from six.moves import (filter, input, map, range, zip) # noqa
# import iris tests first so that some things can be initialised before importing anything else
import iris.tests as tests
import numpy as np
import iris.coords
from iris.coords import Ce... |
import fleosa_unidades |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'Recipe'
db.create_table('topchef_recipe', (
('id', self.gf('django.d... |
from importlib import abc
from importlib import machinery
import inspect
import unittest
class InheritanceTests:
"""Test that the specified class is a subclass/superclass of the expected
classes."""
subclasses = []
superclasses = []
def __init__(self, *args, **kwargs):
super().__init__(... |
__author__ = 'alanseciwa'
import sys
import json
import csv
from datetime import datetime, timedelta
from textblob import TextBlob
from elasticsearch import Elasticsearch
from scripts.spam_detection import SpamBotDetection
es = Elasticsearch()
def check_obj(c):
if not c:
c = ''
else:
c = c
... |
import os
import logging
from autotest.client.shared import error
from autotest.client import utils
from virttest import data_dir
from virttest import utils_selinux
from virttest import virt_vm
from virttest import virsh
from virttest import utils_config
from virttest import utils_libvirtd
from virttest.utils_test im... |
"""Spawn interface using subprocess.Popen
"""
import os
import threading
import subprocess
import sys
import time
import signal
import shlex
try:
from queue import Queue, Empty # Python 3
except ImportError:
from Queue import Queue, Empty # Python 2
from .spawnbase import SpawnBase, SpawnBaseUnicode, PY3
fr... |
"""oslo.i18n integration module.
See http://docs.openstack.org/developer/oslo.i18n/usage.html .
"""
import oslo_i18n as i18n
DOMAIN = 'cinder'
_translators = i18n.TranslatorFactory(domain=DOMAIN)
# The primary translation function using the well-known name "_"
_ = _translators.primary
# Translators for log level... |
#!/usr/bin/env python
from __future__ import print_function
import os, re, sys
# == globals
printDebug = False
try:
unicode
except NameError:
unicode = str
# ==
class yamlValue(unicode):
linenumber = None
def __new__(cls, value, linenumber=None):
if isinstance(value, unicode):
... |
""" 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... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import logging; logging.basicConfig(level=logging.INFO)
import asyncio, os, json, time
from datetime import datetime
from aiohttp import web
from jinja2 import Environment, FileSystemLoader
from config import configs
import orm
from web_framework import add_routes, add... |
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import re
import json
from units.compat.mock import patch
from ansible.modules.network.cnos import cnos_interface
from units.modules.utils import set_module_args
from .cnos_module import TestCnosModule, load_fixture
class TestCn... |
"""Test class for Host CLI
:Requirement: Lifecycleenvironment
:CaseAutomation: Automated
:CaseLevel: Component
:CaseComponent: LifecycleEnvironments
:Assignee: ltran
:TestType: Functional
:CaseImportance: High
:Upstream: No
"""
from math import ceil
import pytest
from fauxfactory import gen_string
from robott... |
"""
The ORM mappings for both Joomla's MySQL and the member registry's Postgres
databases and related functions.
"""
# imports
from datetime import (date, datetime, timedelta)
import pickle
import sys
from sqlalchemy import (Column, ForeignKey, String, DateTime, Integer, Text,
Numeric)
from sq... |
"""Auxiliary classes for the default graph drawer in igraph.
This module contains heavy metaclass magic. If you don't understand
the logic behind these classes, probably you don't need them either.
igraph's default graph drawer uses various data sources to determine
the visual appearance of vertices and edges. These ... |
from __future__ import absolute_import
from django.conf import settings
from typing import Text
from zerver.lib.utils import make_safe_digest
if False:
# Typing import inside `if False` to avoid import loop.
from zerver.models import UserProfile
import hashlib
def gravatar_hash(email):
# type: (Text) -... |
import numpy as np
import rasterio
from osgeo import gdal, ogr
from rasterstats.utils import (bbox_to_pixel_offsets, shapely_to_ogr_type, get_features,
raster_extent_as_bounds)
from shapely.geometry import shape, box, MultiPolygon
"""Contains untested raster functions."""
def from_geo... |
import json, requests, os
# available on the main machine, set up an nginx pass to the script
# check status endpoint - if all fine, do nothing
# check if local machine has any running instances of the meteor app
# if it does, what screen names are they running in?
# (start instances in named screens to make this mor... |
# -*- coding: utf-8-*-
import re
import datetime
import struct
import urllib
import feedparser
import requests
import bs4
from client.app_utils import getTimezone
from semantic.dates import DateService
WORDS = ["WEATHER", "TODAY", "TOMORROW"]
def replaceAcronyms(text):
"""
Replaces some commonly-used acronym... |
# pylint: disable=invalid-name
"""
Utility library for working with the edx-milestones app
"""
from django.conf import settings
from django.utils.translation import ugettext as _
from opaque_keys import InvalidKeyError
from opaque_keys.edx.keys import CourseKey
from openedx.core.djangoapps.content.course_overviews.m... |
from future import standard_library
standard_library.install_aliases()
import logging
import os
import sys
from desktop.lib.conf import Config
from libsolr import conf as libsolr_conf
from libzookeeper import conf as libzookeeper_conf
if sys.version_info[0] > 2:
from urllib.parse import urlparse
from django.utils... |
#!/usr/bin/env python
# -*- coding: utf-8 -*- #
from __future__ import unicode_literals
# This file is only used if you use `make publish` or
# explicitly specify it as your config file.
import os
AUTHOR = 'KMOL'
SITENAME = '2015FALL KMOL 課程'
SITEURL = ''
PATH = 'content'
TIMEZONE = 'Asia/Taipei'
DEFAULT_LANG = '... |
import cPickle
import test_support
import unittest
from cStringIO import StringIO
from pickletester import AbstractPickleTests, AbstractPickleModuleTests
class cPickleTests(AbstractPickleTests, AbstractPickleModuleTests):
def setUp(self):
self.dumps = cPickle.dumps
self.loads = cPickle.loads
... |
from tastypie.serializers import Serializer
from indicator.models import *
from api.v3.resources.helper_resources import *
class RegionResource(ModelResource):
class Meta:
queryset = Region.objects.all()
resource_name = 'regions'
include_resource_uri = False
serializer = Serializ... |
import zookeeper, zktestbase, unittest, threading
ZOO_OPEN_ACL_UNSAFE = {"perms":0x1f, "scheme":"world", "id" :"anyone"}
class GetSetTest(zktestbase.TestBase):
def setUp( self ):
zktestbase.TestBase.setUp(self)
try:
zookeeper.create(self.handle, "/zk-python-getsettest", "on",[ZOO_OPEN_A... |
#!/usr/bin/python3
#
# Read a plain-text description of a data structure from standard input and
# serialize it to standard output.
#
# An input line consists of the following fields:
# <field_name> <type> <value> [<count>]
# where:
# <field_name> -- is annotation for humans which is not used by the tool.
# <type... |
# encoding: utf-8
"""
Modulestore configuration for test cases.
"""
import datetime
import pytz
from uuid import uuid4
from mock import patch
from django.conf import settings
from django.contrib.auth.models import User
from django.test import TestCase
from django.test.utils import override_settings
from request_cache... |
'''
Test cases for pyclbr.py
Nick Mathewson
'''
from test.test_support import run_unittest
import sys
from types import ClassType, FunctionType, MethodType, BuiltinFunctionType
import pyclbr
from unittest import TestCase
StaticMethodType = type(staticmethod(lambda: None))
ClassMethodType = type(classmethod(lambd... |
from marionette_driver import By, Wait
from ...base import UIBaseLib
class Wizard(UIBaseLib):
def __init__(self, *args, **kwargs):
UIBaseLib.__init__(self, *args, **kwargs)
Wait(self.marionette).until(lambda _: self.selected_panel)
def _create_panel_for_id(self, panel_id):
"""Creat... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.