content stringlengths 4 20k |
|---|
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'C:\Documents and Settings\Christoffer Klang\My Documents\workspace\opus_trunk\opus_gui\general_manager\views\variable_editor.ui'
#
# by: PyQt4 UI code generator 4.4.3
#
# WARNING! All changes made in this file will be lost!
fro... |
# -*- coding: utf-8 -*-
import unittest2
from mock import patch
import shippo
from shippo.test.helper import (
create_mock_shipment,
INVALID_SHIPMENT,
ShippoTestCase,
)
from shippo.test.helper import shippo_vcr
class ShipmentTests(ShippoTestCase):
request_client = shippo.http_client.RequestsClient
... |
# -*- coding: utf-8 -*-
from datetime import timedelta
from django.conf import settings
from django.contrib.auth.models import User
from django.db import models
from django.db.models.signals import post_save
from django.dispatch import receiver
from django.utils import timezone
from rest_framework.authtoken.models i... |
import unittest
from katas.beta.replace_multiples_with_string import getNumber, getNumberRange
class ReplaceMultiplesWithStringTestCase(unittest.TestCase):
def test_equals(self):
self.assertEqual(getNumber(0), 'BOTH')
def test_equals_2(self):
self.assertEqual(getNumber(1), 1)
def test_e... |
"""Upgrade TestSuite for validating Satellite Orgs existence and
associations post upgrade
:Requirement: Upgraded Satellite
:CaseAutomation: Automated
:CaseLevel: System
:CaseComponent: OrganizationsLocations
:TestType: nonfunctional
:CaseImportance: High
:SubType1: installability
:Upstream: No
"""
import pytes... |
import os
from superdesk.tests import TestCase
from superdesk.io.feed_parsers.ninjs import NINJSFeedParser
class NINJSTestCase(TestCase):
vocab = [{"_id": "genre", "items": [{"name": "Current"}]}]
def setUp(self):
with self.app.app_context():
self.app.data.insert("vocabularies", self.voca... |
"""
I am the support module for making a ftp server with mktap.
"""
from twisted.protocols import ftp
from twisted.python import usage
from twisted.application import internet
from twisted.cred import error, portal, checkers, credentials
import os.path
class Options(usage.Options):
synopsis = """Usage: mktap ft... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''Harmonic calculations for frequency representations'''
import numpy as np
import scipy.interpolate
import scipy.signal
from ..util.exceptions import ParameterError
__all__ = ['salience', 'interp_harmonics']
def salience(S, freqs, h_range, weights=None, aggregate=None... |
import re
import traceback
import json
import argh
import random
from openpyxl import Workbook
from openpyxl import load_workbook
class Pair(object):
'''
Represents a pairing in a round.
If the scores are no present that means the round has not been concluded
'''
def __init__(self, player1, playe... |
#!/usr/bin/env python
import os
from collections import Counter
import click
import feedparser
from html2text import html2text
@click.command()
@click.argument('url')
def fetch(url):
response = feedparser.parse(url)
if response.get('status') != 200:
return click.echo("There was a problem fetching %... |
# -*- coding: utf-8 -*-
import scipy
# from scipy.linalg import eigh, inv, eig
import scipy.linalg as sp
from scipy.linalg import eig as namivan
import BeamFE2.Results as Results
from BeamFE2.helpers import *
# todo: more rigorous conditions on the solvability of the problems.
# clamped-clamped with a single element?... |
import sys
sys.path.append("../")
from time import time
import pandas as pd
from utilities import *
def run():
#################################################################################
# Miscellaneous Q-Learning Training
########################################################... |
#!/usr/bin/env python
import os, re, math, sys, argparse, subprocess, numpy, tarfile
from daltools import one, mol, dens, prop, lr
from daltools.util import full, blocked, subblocked, timing
from operator import attrgetter
from applequistbreader import *
import unittest
FILE = os.path.join(os.path.dirname(__file__), '... |
"""The IPython kernel spec for Jupyter"""
# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
from __future__ import print_function
import errno
import json
import os
import shutil
import sys
import tempfile
from jupyter_client.kernelspec import KernelSpecManager
pj... |
"""
# https://code.google.com/p/promisedata/source/browse/#svn%2Ftrunk%2Feffort%2Falbrecht
Standard header:
"""
from __future__ import division,print_function
import sys
sys.dont_write_bytecode = True
from lib import *
"""
@attribute Input numeric
@attribute Output numeric
@attribute Inquiry numeric
@attribute File... |
import os
import yaml
import json
import re
import requests
import logging
import socket
from datetime import datetime
import teuthology
from .config import config
from .job_status import get_status, set_status
report_exceptions = (requests.exceptions.RequestException, socket.error)
def init_logging():
"""
... |
# coding=utf-8
import os
import re
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
setup (
name = 'krakenio',
version = '0.1.0',
description = 'Kraken.io API Client',
long_description = 'With this official Python client you can plug into the power and sp... |
import logging
from superdesk.metadata.item import ITEM_TYPE, CONTENT_TYPE
from superdesk.metadata.utils import is_takes_package
formatters = []
logger = logging.getLogger(__name__)
class FormatterRegistry(type):
"""Registry metaclass for formatters."""
def __init__(cls, name, bases, attrs):
"""Reg... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from unidecode import unidecode
from FeatureBooleanizer import *
class SetFeatureBooleanizer(FeatureBooleanizer):
def __init__(self, featureName, featuresData, featureId):
FeatureBooleanizer.__init__(self, featureName, featuresData, featureId)
self.goodChars ... |
#!/bin/python
import os
import sys
from flask_script import Server, Manager, Shell
from flask_migrate import Migrate, MigrateCommand
from %(project_name)s.db import Query
from %(project_name)s import app,db
from %(project_name)s import config
import unittest
import json
from openedoo.core.libs.get_modul import *
impor... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from pwnpwnpwn import *
from pwn import *
#host = "10.211.55.28"
#port = 8888
host = "78.46.224.83"
port = 1456
r = remote(host,port)
def add(size,name,txt_size,text):
r.recvuntil("Action:")
r.sendline("0")
r.recvuntil(":")
r.sendline(str(size))
r.recv... |
from .. utils import TranspileTestCase, UnaryOperationTestCase, BinaryOperationTestCase, InplaceOperationTestCase
class StrTests(TranspileTestCase):
def test_setattr(self):
self.assertCodeExecution("""
x = "Hello, world"
x.attr = 42
print('Done.')
""")
... |
from django.conf.urls import url
from lensmanagerserver import views
urlpatterns = [
url(r'^calibration/$', views.calibration),
url(r'^offset/$', views.offset),
url(r'^motorposition/(?P<motor_id_param>[0-9])/$', views.motorposition),
url(r'^motordirection_right/(?P<motor_id_param>[0-9])/$', views.moto... |
# -*- coding: utf-8 -*-
import os
from nose.tools import with_setup, eq_ as eq, ok_ as ok
from common import vim, cleanup
@with_setup(setup=cleanup)
def test_receiving_events():
vim.command('call send_event(%d, "test-event", 1, 2, 3)' % vim.channel_id)
event = vim.next_message()
eq(event[1], 'test-event')... |
# -*- 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 'List'
db.create_table(u'todo_list', (
(u'id', self.gf('django.db.models.fields.A... |
import json
from django.shortcuts import get_object_or_404
from django.core.exceptions import ObjectDoesNotExist
from django.utils.feedgenerator import Atom1Feed, rfc3339_date
from django.contrib.contenttypes.models import ContentType
from django.contrib.syndication.views import Feed, add_domain
from django.contrib.si... |
import time
import signal
from optparse import OptionParser
from lib import log
from lib import utils
from connection import OpsConnection
from connection import GobgpConnection
def main():
usage = 'usage: python ./openswitch.py [options]... '
parser = OptionParser(usage=usage)
parser.add_option('-u', '-... |
"""
This module contains a Google Cloud Storage to BigQuery operator.
"""
import json
from airflow import AirflowException
from airflow.models import BaseOperator
from airflow.providers.google.cloud.hooks.bigquery import BigQueryHook
from airflow.providers.google.cloud.hooks.gcs import GCSHook
from airflow.utils.deco... |
import types
import pycurl
import threading
from itmagesd.tools import *
from itmagesd.common import ActionType
try:
import cStringIO as StringIO
stringio_type = StringIO.OutputType
except ImportError:
import StringIO
stringio_type = StringIO.StringIO
TRUE = 1
FALSE = 0
RESPMSG = '<response><status>... |
import lxml.html
from urllib.parse import urljoin
def fetch_item_field(cur_url, itemelement, field_rules):
elements = [itemelement]
for rule in field_rules:
elements = select_by_rules(elements, rule)
if 'modifiers' in rule:
for modifier in rule['modifiers']:
if mod... |
__ALL__ = ['remove_enclosing_new_line', 'format_card', 'print_card']
####################################################################################################
def remove_enclosing_new_line(text):
""" Return a copy of the string *text* with leading and trailing newline removed.
"""
i_min =... |
class GnomeScheduleDB:
VERSION = 1
# Format:
# [title, time, preview, line, output]
crontab = []
# Format:
# [title, date, time, preview, script, output]
at = []
def __init__ (self):
pass
def setcrontab (self, c):
self.crontab = c
def setat (self, a):
self.at = a |
from pyspark.mllib.common import JavaModelWrapper
__all__ = ["ChiSqTestResult"]
class ChiSqTestResult(JavaModelWrapper):
"""
.. note:: Experimental
Object containing the test results for the chi-squared hypothesis test.
"""
@property
def method(self):
"""
Name of the test me... |
import platform
import xbmc
import lib.common
from lib.common import log, dialog_yesno
from lib.common import upgrade_message as _upgrademessage
__addon__ = lib.common.__addon__
__addonversion__ = lib.common.__addonversion__
__addonname__ = lib.common.__addonname__
__addonpath__ = lib.common.__addonpath__... |
"""
Shared management code for DC/OS mocks used by AR instances, both EE and Open.
"""
import concurrent.futures
import logging
from mocker.endpoints.marathon import MarathonEndpoint
from mocker.endpoints.mesos import MesosEndpoint
from mocker.endpoints.mesos_dns import MesosDnsEndpoint
from mocker.endpoints.reflecto... |
from typing import List
from hwt.interfaces.std import Rst, Rst_n, Clk
from hwt.pyUtils.arrayQuery import where
from hwt.serializer.ip_packager import IpPackager
from hwt.synthesizer.interface import Interface
from ipCorePackager.component import Component
from ipCorePackager.intfIpMeta import IntfIpMeta, VALUE_RESOL... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division
import ndef
import pytest
import _test_record_base
def pytest_generate_tests(metafunc):
_test_record_base.generate_tests(metafunc)
class TestUriRecord(_test_record_base._TestRecordBase):
RECORD = ndef.uri.UriRecord
ATTRIB = "iri,... |
from netforce.model import Model, fields, get_model
class BarcodeValidate(Model):
_inherit= "barcode.validate"
def validate(self, ids, context={}):
obj = self.browse(ids)[0]
if not obj.lines:
raise Exception("Product list is empty")
pick = obj.picking_id
if obj.mod... |
import http.server
from thrift.server import TServer
from thrift.transport import TTransport
class ResponseException(Exception):
"""Allows handlers to override the HTTP response
Normally, THttpServer always sends a 200 response. If a handler wants
to override this behavior (e.g., to simulate a misconfigured ... |
import json
with open('medalofhonor-old.json') as input:
data = json.load(input)
months = {
'January': 1,
'February': 2,
'March': 3,
'April': 4,
'May': 5,
'June': 6,
'July': 7,
'August': 8,
'September': 9,
'October': 10,
'November': 11,
'December': 12,
}
d... |
import zstackwoodpecker.test_state as ts_header
import os
TestAction = ts_header.TestAction
def path():
return dict(initial_formation="template5", checking_point=1, faild_point=100000, path_list=[
[TestAction.create_mini_vm, 'vm1', 'cluster=cluster2'],
[TestAction.destroy_vm, 'vm1'],
[TestAction.recover_vm, ... |
import unittest
# from unittest.mock import , call, MagicMock, patch, sentinel
from unittest.mock import ANY, MagicMock, patch, sentinel
from conjureup.controllers.deploy.tui import DeployController
class DeployTUIRenderTestCase(unittest.TestCase):
def setUp(self):
self.utils_patcher = patch(
... |
# This script tests the go-to commands. To be run asynchronously.
# Created by Toni Sagrista
from py4j.clientserver import ClientServer, JavaParameters
gateway = ClientServer(java_parameters=JavaParameters(auto_convert=True))
gs = gateway.entry_point
gs.disableInput()
gs.cameraStop()
gs.minimizeInterfaceWindow()
gs... |
# -*- coding: utf-8 -*-
import datetime
import pendulum
from flexmock import flexmock, flexmock_teardown
from orator import Model, SoftDeletes
from orator.orm import Builder
from orator.query import QueryBuilder
from ... import OratorTestCase
t = pendulum.now()
class SoftDeletesTestCase(OratorTestCase):
def te... |
# flake8: noqa pylint: skip-file
"""Tests for the TelldusLive config flow."""
import asyncio
from unittest.mock import Mock, patch
import pytest
from homeassistant import data_entry_flow
from homeassistant.components.tellduslive import (
APPLICATION_NAME, DOMAIN, KEY_HOST, KEY_SCAN_INTERVAL, SCAN_INTERVAL,
co... |
from __future__ import print_function
import unittest
import numpy as np
from op_test import OpTest
import paddle.fluid.core as core
from paddle.fluid.op import Operator
class TestLookupSpraseTable(OpTest):
def check_with_place(self, place):
scope = core.Scope()
# create and initialize W Variabl... |
import errno
import os
from eventlet import patcher
from oslo_log import log as logging
from nova.i18n import _LE
LOG = logging.getLogger(__name__)
native_threading = patcher.original('threading')
class IOThread(native_threading.Thread):
def __init__(self, src, dest, max_bytes):
super(IOThread, self).... |
from nose.tools import assert_equal, assert_true, assert_false, assert_is_instance
from spout.streams import Stream, FilterStream, MapStream
from spout.utils import TruePredicate, FalsePredicate, PassThroughFunction, NullOperation
class SimpleTestingStream(Stream):
def __init__(self):
self.data = ['test1'... |
"""
Identifier for course resources.
"""
from __future__ import absolute_import
import logging
import inspect
import re
from abc import abstractmethod
from bson.objectid import ObjectId
from bson.errors import InvalidId
from opaque_keys import OpaqueKey, InvalidKeyError
from xmodule.modulestore.keys import CourseKe... |
"""
.. module:: utils
:synopsis: Various little helper functions to be re-used within this
package.
.. moduleauthor:: Gerhard Weis <<EMAIL>>
"""
from decimal import Decimal
from plone.app.uuid.utils import uuidToObject
from org.bccvl.site.api.dataset import getdsmetadata
from org.bccvl.site.interfaces... |
from puzzle.puzzlepedia import puzzle
def get():
return puzzle.Puzzle('Puzzle 1.2: True-False Test', SOURCE)
SOURCE = """
(name, hand) in ({Beth, Charles, David, Frank, Jessica, Karen, Taylor}, {1, 2})
suit in {Club*4, Diamond*4, Heart*3, Spade*3}
def has(person, suit):
a, b = person
return a[suit] + b[suit]... |
"""Deletion of frozen archives"""
import shared.returnvalues as returnvalues
from shared.freezefunctions import freeze_flavors, is_frozen_archive, \
get_frozen_archive, delete_frozen_archive
from shared.functional import validate_input_and_cert, REJECT_UNSET
from shared.handlers import correct_handler
from shared... |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['stableinterface'],
'supported_by': 'community'}
import traceback
try:
from botocore.exceptions import ClientError, BotoCoreErr... |
# -*- coding: utf-8 -*-
from decimal import Decimal
from django.test.testcases import TestCase
from django.utils.encoding import force_text
from shop.models import (
LazyProduct,
LazyOrder,
LazyOrderItem,
)
Product = LazyProduct()
Order = LazyOrder()
OrderItem = LazyOrderItem()
class ProductTestCase(Test... |
from mien.xml.xmlclass import BaseXMLObject
import re, copy, os
from mien.math.array import ArrayType, any, nonzero1d
notinname=(re.compile(r"[\s/?:]"))
integertail=re.compile(r"(\D*)(\d*)(.*)$")
DONOTCONVERT=['Url', 'FileName']
def uniqueName(name, used):
if not name in used:
return name
parts=integertail.matc... |
import beanbag
import requests
import requests_kerberos
import warnings
import json
import sys
from os.path import expanduser, isfile
import monkey_patch
monkey_patch.monkey_patch_kerberos()
GLOBAL_CONFIG_FILE = '/etc/pdc/client_config.json'
USER_SPECIFIC_CONFIG_FILE = expanduser('~/.config/pdc/client_config.json')
... |
import logging
from tempest_lib.common.utils import data_utils
from tempest.api.messaging import base
from tempest import config
from tempest import test
LOG = logging.getLogger(__name__)
CONF = config.CONF
class TestMessages(base.BaseMessagingTest):
@classmethod
def resource_setup(cls):
super(Te... |
import numpy as np
import ctypes
def _getpath():
return r"/home/tim/dev/signals/build"
def _load_signals_lib():
return np.ctypeslib.load_library("libsignals", _getpath())
def barrier(vals, rbarrier, maxlen):
#requires = ["CONTIGUOUS", "ALIGNED"]
lib = _load_signals_lib()
lib.c_barrier.restype... |
import unittest
import ossie.utils.testing
import os
from omniORB import any
class ComponentTests(ossie.utils.testing.ScaComponentTestCase):
"""Test for all component implementations in sample_and_hold_ff"""
def testScaBasicBehavior(self):
##############################################################... |
from django.core.management.base import BaseCommand
from apps.captable.factories import *
import datetime
from dateutil.relativedelta import relativedelta
# Time-based globals
today = datetime.date.today()
six_months_ago = today - relativedelta(months=6)
one_year_ago = today - relativedelta(years=1)
two_years_ago =... |
__all__ = ['crop_image',
'crop_indices',
'decrop_image']
from .get_mask import get_mask
from ..core import ants_image as iio
from .. import utils
def crop_image(image, label_image=None, label=1):
"""
Use a label image to crop a smaller ANTsImage from within a larger ANTsImage
ANT... |
"""
Tests for L{eliot._traceback}.
"""
from __future__ import unicode_literals
from unittest import TestCase, SkipTest
import traceback
import sys
try:
from twisted.python.failure import Failure
except ImportError:
Failure = None
from .._traceback import write_traceback, writeFailure, _writeTracebackMessage... |
"""Test case runner."""
import os
import re
import sys
import unittest
TESTS_DIR = os.path.dirname(__file__)
def collect_test_modules():
"""Collects and yields test modules."""
for fname in os.listdir(TESTS_DIR):
if not re.match(r'test_.*\.py$', fname):
continue
try:
yield __import__(fname[:... |
#!/usr/bin/env python
"""
Parse a the test runner XML output generated by Check and convert it to the
junit XML format.
usage: check2junitxml.py [-h] [-o OUTPUT_PATH] input_path
"""
import sys
import argparse
import re
import types
import dateutil.parser
import xml.etree.ElementTree as ET
NS_SPLIT_PATTERN = re.comp... |
from qpid.client import Client, Closed
from qpid.queue import Empty
from qpid.content import Content
from qpid.testlib import TestBase
class QueueTests(TestBase):
"""Tests for 'methods' on the amqp queue 'class'"""
def test_purge(self):
"""
Test that the purge method removes messages from the ... |
from __future__ import division
import numpy as np
import six
from chainercv.visualizations.vis_image import vis_image
def vis_point(img, point, visible=None, ax=None):
"""Visualize points in an image.
Example:
>>> import chainercv
>>> import matplotlib.pyplot as plt
>>> dataset = ... |
"""Django settings for example project."""
import os
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
# Quick-start development settings - unsuitable for production
SECRET_KEY = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890'
DEBUG = True
TEMPLATE_DEBUG = True
# Application definition
INSTALLED_APPS = (
'djang... |
from ....common.db.sql import VARCHAR, Numeric as NUMBER, DateTime as DATETIME, Column, BaseModel, CLOB, DATE
VARCHAR2 = VARCHAR
class ChinaETFWeekPchRedm(BaseModel):
"""
4.87 中国ETF每周申购赎回
Attributes
----------
object_id: VARCHAR2(100)
对象ID
s_info_windcode: VARCHAR2(40)
基金Wi... |
class Command(object):
"""
Defines constants for the standard WebDriver commands.
While these constants have no meaning in and of themselves, they are
used to marshal commands through a service that implements WebDriver's
remote wire protocol:
http://code.google.com/p/selenium/wiki/Jso... |
from io import BytesIO
from pycmark.taggedtext.TaggedCmarkDocument import TaggedTextDocument
class RtfRenderer(object):
COLOR_TABLE = b"{\colortbl ;\\red255\\green255\\blue255;\\red0\\green0\\blue0;\\red192\\green192\\blue192;}"
@classmethod
def styleTT(cls, tt):
txt = tt.text.encode()
if... |
import fnmatch
import os
import pytest
import six
import spack
from llnl.util.filesystem import LibraryList, HeaderList
from llnl.util.filesystem import find_libraries, find_headers, find
@pytest.fixture()
def library_list():
"""Returns an instance of LibraryList."""
# Test all valid extensions: ['.a', '.dyl... |
import unittest
from libredact import config, cli
from libredact.redact import Redactor
from io import StringIO
import hashlib
from contextlib import closing
import logging
import json
config_string = u"""
INPUT_FILE /home/bcadmin/Desktop/jowork.raw
DFXML_FILE /home/bcadmin/Desktop/jofiwalk.xml
OUTPUT_FILE /tmp/jowork... |
import os.path
import sys
import string
import tempfile
separator = "OUTPUT:"
test_dir = os.path.join(os.path.dirname(sys.argv[0]), 'ol_parser_tests')
overlog_binary = os.path.join(os.path.dirname(sys.argv[0]), 'overlog')
for t in [t[:-4] for t in os.listdir(test_dir) if t [-4:] == '.tst']:
print "Running test '%s'.... |
#!/usr/bin/env python
# Get dataId hash
# This file is part of https://github.com/hh-italian-group/hh-bbtautau.
import ROOT
import pandas
import re
def LoadIdFrames(file_name, id_collections):
"""Load pandas DataFrame from root file."""
file = ROOT.TFile(file_name, "READ")
aux = file.Get('aux')
id_val... |
#!/usr/bin/python
import time #sleep
import sys #exit
import signal #signal
import netServer
import RPi.GPIO as GPIO
def signal_handler(signal, frame):
app.exit()
class App():
def main(self):
print("Raspi template v1.0")
signal.signal(signal.SIGINT, signal_handler)
#to disable Runtim... |
import os
from .base import AnnotatedNineMLObject
from nineml.exceptions import NineMLUsageError
from nineml.base import DocumentLevelObject
class BaseReference(AnnotatedNineMLObject):
"""
Base class for references to model components that are defined in the
abstraction layer.
Parameters
-------... |
import os
import pytest
import zipfile
from thefuck.rules.dirty_unzip import match, get_new_command, side_effect
from tests.utils import Command
@pytest.fixture
def zip_error(tmpdir):
path = os.path.join(str(tmpdir), 'foo.zip')
def reset(path):
with zipfile.ZipFile(path, 'w') as archive:
... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from future import standard_library
standard_library.install_aliases()
__title__ = 'Logical Interconnect Groups'
__version__ = '0.0.1'
__copyright__ = '(C) Copyright (2... |
from openerp.osv import fields, osv
class calendar_event(osv.Model):
_inherit = "calendar.event"
def create(self, cr, uid, values, context=None):
user_id = context.get("default_user_id")
if user_id and not user_id in values:
values = dict(values)
values["user_id"] = use... |
from gourmet.plugin import PluginPlugin
import re
class FoodNetworkPlugin (PluginPlugin):
target_pluggable = 'webimport_plugin'
def test_url (self, url, data):
if 'foodnetwork.com' in url:
return 5
def get_importer (self, webpage_importer):
class FoodNetworkParser (webpage_i... |
from __future__ import division
from entity import Entity
class WorkflowEntity(Entity):
type_id = 2
def __init__(self, workflow=None):
Entity.__init__(self)
self.id = None
self.update(workflow)
@staticmethod
def create(*args):
entity = WorkflowEntity()
entity.... |
from core.himesis import Himesis
import uuid
class Hlayer3rule0(Himesis):
def __init__(self):
"""
Creates the himesis graph representing the DSLTrans rule layer3rule0.
"""
# Flag this instance as compiled now
self.is_compiled = True
super(Hlayer3rule0, self).__init__(name='Hlayer3rule0', num_nodes=0, edg... |
import json
from typing import Iterable
from cached_property import cached_property
from airflow.models import BaseOperator
from airflow.providers.amazon.aws.hooks.sagemaker import SageMakerHook
from airflow.utils.decorators import apply_defaults
class SageMakerBaseOperator(BaseOperator):
"""
This is the ba... |
from openerp.osv import osv
from openerp.osv import fields
class wakf_assesment(osv.osv):
"""
Open ERP Model
"""
_name = 'wakf.assesment'
_description = 'wakf.assesment'
_columns = {
'name':fields.char('name', size=128, required=True),
'wakf_id':fields.many2one('w... |
# -*- coding: utf-8 -*
"""UI performance tests on Control."""
from cfme.fixtures import pytest_selenium as sel
from utils.conf import perf_tests
from utils.pagestats import analyze_page_stat
from utils.pagestats import navigate_accordions
from utils.pagestats import pages_to_csv
from utils.pagestats import pages_to_sta... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
def add_sessions(apps, schema_editor):
Session = apps.get_model('hpc', 'Session')
Session.objects.filter(name="البرنامج العام وبرنامج الأبحاث").update(time_slot=None, code_name='main')
Session.objects... |
import json
from datetime import datetime
from django.http import HttpResponse
from django.shortcuts import render
from spiderhandler.models import QueryJob
from spiderhandler.spider_action import SpiderAction
# def search_form(request):
# request.session['username'] = "zhuhao"
# return render_to_response('searc... |
import sys
import signal
import os.path
import logging
import argparse
from . import VERSION, ev
from .wm import WM
from .actions import Actions
from .testwm import TestWM
logger = logging.getLogger(__name__)
def load_config(wm, config):
import orcsome
orcsome._wm = wm
env = {}
sys.path.insert(0, o... |
#!/usr/bin/env python
import socket
import Util
import sys
import argparse
"""
The Master class represents the Master to control the Bots in the Botnet.
The Master reads the Bot data from bots_list.txt and communicates with the
Bots. It tells each Bot when to attack the target and at what time. It also
takes into acc... |
import os, argparse
import json
import pickle
import numpy
import sklearn.cluster as cl
from nltk import cluster # for the distances
from scipy.stats import itemfreq
# load the keys that are the SOURCE+DOI of the documents
# source can be UCBL or Istex, UCBL can also contain documents that are in istex but none of the... |
#!/usr/bin/env python
"""
This module contains the :class:`Column` class, which defines a "vertical"
array of tabular data. Whereas :class:`.Row` instances are independent of their
parent :class:`.Table`, columns depend on knowledge of both their position in
the parent (column name, data type) as well as the rows that... |
#-*- coding: utf8 -*
#
# Max E. Kuznecov <<EMAIL>> 2009
#
import threading
import libxyz.ui as uilib
from libxyz.core.utils import ustring, bstring
from libxyz.core.plugins import BasePlugin
from box_copy import CopyBox
class XYZPlugin(BasePlugin):
"""
Plugin vfsutils
"""
NAME = u"vfsutils"
AU... |
"""This script implements the Taylor remainder convergence test
for an individual form.
Imagine we have an expression F(u) that is a function of velocity. We
can check the correctness of the derivative dF/du by noting that
||F(u + du) - F(u)|| converges at first order
but that
||F(u + du) - F(u) - dF/du . du|| conv... |
"""
Experimental module for importing/exporting raster data from Iris cubes using
the GDAL library.
See also: `GDAL - Geospatial Data Abstraction Library <http://www.gdal.org>`_.
TODO: If this module graduates from experimental the (optional) GDAL
dependency should be added to INSTALL
"""
import numpy as np
fr... |
"""tabled-cte-report-cte-id
Revision ID: 48b2bb4f986a
Revises: 8939e1ee328
Create Date: 2016-06-30 12:21:07.236513
"""
# revision identifiers, used by Alembic.
revision = '48b2bb4f986a'
down_revision = '8939e1ee328'
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto generated by A... |
"""
jobs.py - pdf rasterization routines
Author
Sacha Zyto <<EMAIL>>
License
Copyright (c) 2010-2012 Massachusetts Institute of Technology.
MIT License (cf. MIT-LICENSE.txt or http://www.opensource.org/licenses/mit-license.php)
"""
import sys,os
import datetime
if "" not in sys.path:
sys.path.append... |
class MongodbFilesPipeline(FilesPipeline):
"""
This is for download the book file and then define the book_file_id
field to the file's gridfs id in the mongodb.
"""
MEDIA_NAME = 'mongodb_openslackfile'
EXPIRES = 90
FILE_CONTENT_TYPE = ['image/png', 'image/jpeg', "image/gif"]
URL... |
"""
LsDev - Command ``ls -lanR /dev``
=================================
The ``ls -lanR /dev`` command provides information for the listing of the
``/dev`` directory.
Sample input is shown in the Examples. See ``FileListing`` class for
additional information.
Examples:
>>> LS_DEV = '''
... /dev:
... total... |
# -*- 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):
# Deleting model 'PlanetFeatures'
db.delete_table(u'starsystemmaker_planetfeatures')
# Adding model... |
"""Collection of all deploy related views
"""
from deploy_board.settings import SITE_METRICS_CONFIGS, TELETRAAN_DISABLE_CREATE_ENV_PAGE, TELETRAAN_REDIRECT_CREATE_ENV_PAGE_URL
from django.middleware.csrf import get_token
import json
from django.shortcuts import render
from django.views.generic import View
from django.t... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.