code stringlengths 1 1.49M | vector listlengths 0 7.38k | snippet listlengths 0 7.38k |
|---|---|---|
# Copyright 2008-2011 Nokia Siemens Networks Oyj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | [
[
1,
0,
0.1339,
0.0089,
0,
0.66,
0,
540,
0,
1,
0,
0,
540,
0,
0
],
[
3,
0,
0.5804,
0.8482,
0,
0.66,
1,
207,
0,
20,
0,
0,
186,
0,
29
],
[
14,
1,
0.1696,
0.0089,
1,
0.... | [
"import re",
"class DataRow(object):\n _row_continuation_marker = '...'\n _whitespace_regexp = re.compile('\\s+')\n _ye_olde_metadata_prefix = 'meta:'\n\n def __init__(self, cells):\n self.cells, self.comments = self._parse(cells)",
" _row_continuation_marker = '...'",
" _whitespace_r... |
# Copyright 2008-2011 Nokia Siemens Networks Oyj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | [
[
1,
0,
0.8824,
0.0588,
0,
0.66,
0,
496,
0,
1,
0,
0,
496,
0,
0
],
[
1,
0,
0.9706,
0.1176,
0,
0.66,
1,
722,
0,
5,
0,
0,
722,
0,
0
]
] | [
"from datarow import DataRow",
"from model import (TestCaseFile, TestDataDirectory, ResourceFile,\n TestCase, UserKeyword)"
] |
# Copyright 2008-2011 Nokia Siemens Networks Oyj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | [
[
1,
0,
0.3077,
0.0192,
0,
0.66,
0,
516,
0,
1,
0,
0,
516,
0,
0
],
[
1,
0,
0.3269,
0.0192,
0,
0.66,
0.125,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.3654,
0.0192,
0,
0... | [
"import tempfile",
"import os",
"from docutils.core import publish_cmdline",
"from htmlreader import HtmlReader",
"from docutils.parsers.rst import directives",
"ignorer = lambda *args: []",
"ignorer.content = 1",
"directives.register_directive('sourcecode', ignorer)",
"class RestReader(HtmlReader):... |
# Copyright 2008-2011 Nokia Siemens Networks Oyj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | [
[
1,
0,
0.0792,
0.005,
0,
0.66,
0,
217,
0,
1,
0,
0,
217,
0,
0
],
[
1,
0,
0.0842,
0.005,
0,
0.66,
0.2,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.0891,
0.005,
0,
0.66,
... | [
"import HTMLParser",
"import sys",
"from htmlentitydefs import entitydefs",
"extra_entitydefs = {'nbsp': ' ', 'apos': \"'\", 'tilde': '~'}",
"class HtmlReader(HTMLParser.HTMLParser):\n IGNORE = 0\n INITIAL = 1\n PROCESS = 2\n\n def __init__(self):\n HTMLParser.HTMLParser.__init__(self)\n... |
# Copyright 2008-2011 Nokia Siemens Networks Oyj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | [
[
2,
0,
0.4531,
0.2344,
0,
0.66,
0,
207,
0,
1,
1,
0,
0,
0,
12
],
[
2,
1,
0.3906,
0.0781,
1,
0.47,
0,
553,
0,
1,
1,
0,
0,
0,
3
],
[
14,
2,
0.375,
0.0156,
2,
0.36,
... | [
"def encode_basestring(string):\n def get_matching_char(c):\n val = ord(c)\n if val < 127 and val > 31:\n return c\n return '\\\\u' + hex(val)[2:].rjust(4,'0')\n # TODO: Our log doesn't contain all these control chars\n string = string.replace('\\\\', '\\\\\\\\')",
" de... |
# Copyright 2008-2011 Nokia Siemens Networks Oyj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | [
[
1,
0,
0.1524,
0.0095,
0,
0.66,
0,
735,
0,
1,
0,
0,
735,
0,
0
],
[
3,
0,
0.4333,
0.5143,
0,
0.66,
0.3333,
553,
0,
10,
0,
0,
0,
0,
19
],
[
8,
1,
0.2095,
0.0476,
1,
... | [
"from robot import utils",
"class XUnitWriter:\n \"\"\"Provides an xUnit-compatible result file.\n\n Attempts to adhere to the de facto schema guessed by Peter Reilly, see:\n http://marc.info/?l=ant-dev&m=123551933508682\n \"\"\"\n\n def __init__(self, output):",
" \"\"\"Provides an xUnit-comp... |
# Copyright 2008-2011 Nokia Siemens Networks Oyj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | [
[
1,
0,
0.1515,
0.0101,
0,
0.66,
0,
355,
0,
1,
0,
0,
355,
0,
0
],
[
1,
0,
0.1616,
0.0101,
0,
0.66,
0.1429,
596,
0,
2,
0,
0,
596,
0,
0
],
[
1,
0,
0.1818,
0.0101,
0,
... | [
"from robot.common import Statistics",
"from robot.output import LOGGER, process_outputs",
"from outputwriter import OutputWriter",
"from xunitwriter import XUnitWriter",
"from builders import LogBuilder, ReportBuilder, XUnitBuilder, OutputBuilder",
"import jsparser",
"class ResultWriter(object):\n\n ... |
# Copyright 2008-2011 Nokia Siemens Networks Oyj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | [
[
1,
0,
0.0309,
0.0021,
0,
0.66,
0,
373,
0,
1,
0,
0,
373,
0,
0
],
[
1,
0,
0.0329,
0.0021,
0,
0.66,
0.0417,
177,
0,
1,
0,
0,
177,
0,
0
],
[
1,
0,
0.035,
0.0021,
0,
0... | [
"import zlib",
"import base64",
"from operator import itemgetter",
"from robot import utils",
"class _Handler(object):\n\n def __init__(self, context, attrs=None):\n self._context = context\n self._data_from_children = []\n self._handlers = {\n 'robot' : _RobotHandler... |
# Copyright 2008-2011 Nokia Siemens Networks Oyj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | [
[
1,
0,
0.0765,
0.0051,
0,
0.66,
0,
654,
0,
1,
0,
0,
654,
0,
0
],
[
1,
0,
0.0816,
0.0051,
0,
0.66,
0.1429,
735,
0,
1,
0,
0,
735,
0,
0
],
[
1,
0,
0.0918,
0.0051,
0,
... | [
"import time",
"from robot import utils",
"import json",
"from robot.result.elementhandlers import TextIndex",
"class DataModel(object):\n\n def __init__(self, robot_data, split_results=None):\n self._robot_data = robot_data\n self._split_results = split_results\n self._settings = No... |
# Copyright 2008-2011 Nokia Siemens Networks Oyj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | [
[
1,
0,
0.25,
0.0167,
0,
0.66,
0,
777,
0,
1,
0,
0,
777,
0,
0
],
[
1,
0,
0.2667,
0.0167,
0,
0.66,
0.1667,
324,
0,
1,
0,
0,
324,
0,
0
],
[
1,
0,
0.3,
0.0167,
0,
0.66,... | [
"from __future__ import with_statement",
"from xml import sax",
"from robot.result.elementhandlers import RootHandler, Context",
"from robot.result.jsondatamodel import DataModel",
"def create_datamodel_from(input_filename, split_log=False):\n context = Context(split_log)\n robot = _RobotOutputHandler... |
# Copyright 2008-2011 Nokia Siemens Networks Oyj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | [
[
1,
0,
1,
0.0625,
0,
0.66,
0,
548,
0,
1,
0,
0,
548,
0,
0
]
] | [
"from resultwriter import ResultWriter"
] |
# Copyright 2008-2011 Nokia Siemens Networks Oyj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | [
[
1,
0,
0.6,
0.04,
0,
0.66,
0,
596,
0,
1,
0,
0,
596,
0,
0
],
[
3,
0,
0.84,
0.28,
0,
0.66,
1,
416,
0,
2,
0,
0,
137,
0,
2
],
[
2,
1,
0.82,
0.08,
1,
0.37,
0,
5... | [
"from robot.output import XmlLogger",
"class OutputWriter(XmlLogger):\n\n def __init__(self, path):\n XmlLogger.__init__(self, path, generator='Rebot')\n\n def message(self, msg):\n self._write_message(msg)",
" def __init__(self, path):\n XmlLogger.__init__(self, path, generator='R... |
# Copyright 2008-2011 Nokia Siemens Networks Oyj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | [
[
8,
0,
0.3418,
0.3878,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.551,
0.0102,
0,
0.66,
0.125,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.5714,
0.0102,
0,
0.66,
... | [
"\"\"\"Public logging API for test libraries.\n\nThis module provides a public API for writing messages to the log file\nand the console. Test libraries can use this API like `logger.info('My\nmessage')` instead of logging through the standard output like `print\n'*INFO* My message'`. In addition to a programmatic ... |
# Copyright 2008-2011 Nokia Siemens Networks Oyj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | [] | [] |
# Copyright 2008-2011 Nokia Siemens Networks Oyj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | [
[
1,
0,
0.0877,
0.0058,
0,
0.66,
0,
970,
0,
1,
0,
0,
970,
0,
0
],
[
14,
0,
0.1228,
0.0058,
0,
0.66,
0.0714,
755,
1,
0,
0,
0,
0,
1,
0
],
[
14,
0,
0.1287,
0.0058,
0,
... | [
"import utils",
"INFO_PRINTED = 251 # --help or --version",
"DATA_ERROR = 252 # Invalid data or cli args",
"STOPPED_BY_USER = 253 # KeyboardInterrupt or SystemExit",
"FRAMEWORK_ERROR = 255 # Unexpected error",
"class RobotError(Exception):\n \"\"\"Base class for Robot Framework errors.\... |
# Copyright 2008-2011 Nokia Siemens Networks Oyj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | [
[
1,
0,
0.0536,
0.0036,
0,
0.66,
0,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.0607,
0.0036,
0,
0.66,
0.1667,
735,
0,
1,
0,
0,
735,
0,
0
],
[
1,
0,
0.0643,
0.0036,
0,
... | [
"import os",
"from robot import utils",
"from robot.errors import DataError, FrameworkError",
"from robot.output import LOGGER",
"class _BaseSettings(object):\n _cli_opts = {'Name' : ('name', None),\n 'Doc' : ('doc', None),\n 'Metadata' : (... |
# Copyright 2008-2011 Nokia Siemens Networks Oyj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | [
[
1,
0,
1,
0.0667,
0,
0.66,
0,
168,
0,
2,
0,
0,
168,
0,
0
]
] | [
"from settings import RobotSettings, RebotSettings"
] |
# Copyright 2008-2011 Nokia Siemens Networks Oyj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | [
[
1,
0,
0.1168,
0.0073,
0,
0.66,
0,
735,
0,
1,
0,
0,
735,
0,
0
],
[
1,
0,
0.1241,
0.0073,
0,
0.66,
0.1667,
299,
0,
1,
0,
0,
299,
0,
0
],
[
14,
0,
0.1752,
0.0657,
0,
... | [
"from robot import utils",
"from robot.errors import DataError",
"LEVELS = {\n \"NONE\" : 100,\n \"ERROR\" : 60,\n \"FAIL\" : 50,\n \"WARN\" : 40,\n \"INFO\" : 30,\n \"DEBUG\" : 20,\n \"TRACE\" : 10,",
"class AbstractLogger:\n\n def __init__(self, level='TRACE'):\n self._is_logged = IsLog... |
# Copyright 2008-2011 Nokia Siemens Networks Oyj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | [
[
1,
0,
0.0857,
0.0057,
0,
0.66,
0,
735,
0,
1,
0,
0,
735,
0,
0
],
[
1,
0,
0.0914,
0.0057,
0,
0.66,
0.25,
299,
0,
1,
0,
0,
299,
0,
0
],
[
1,
0,
0.0971,
0.0057,
0,
0.... | [
"from robot import utils",
"from robot.errors import DataError",
"from robot.version import get_full_version",
"from loggerhelper import IsLogged",
"class XmlLogger:\n\n def __init__(self, path, log_level='TRACE', generator='Robot'):\n self._log_message_is_logged = IsLogged(log_level)\n sel... |
# Copyright 2008-2011 Nokia Siemens Networks Oyj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | [
[
1,
0,
0.1807,
0.012,
0,
0.66,
0,
471,
0,
1,
0,
0,
471,
0,
0
],
[
1,
0,
0.2048,
0.012,
0,
0.66,
0.1429,
426,
0,
1,
0,
0,
426,
0,
0
],
[
1,
0,
0.2169,
0.012,
0,
0.6... | [
"from robot.common.statistics import Statistics",
"from loggerhelper import AbstractLogger",
"from logger import LOGGER",
"from xmllogger import XmlLogger",
"from listeners import Listeners",
"from debugfile import DebugFile",
"from stdoutlogsplitter import StdoutLogSplitter",
"class Output(AbstractLo... |
# Copyright 2008-2011 Nokia Siemens Networks Oyj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | [
[
1,
0,
0.124,
0.0083,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.1405,
0.0083,
0,
0.66,
0.2,
735,
0,
1,
0,
0,
735,
0,
0
],
[
1,
0,
0.1488,
0.0083,
0,
0.66... | [
"import sys",
"from robot import utils",
"from highlighting import Highlighter, NoHighlighting",
"from loggerhelper import IsLogged",
"class CommandLineMonitor:\n\n def __init__(self, width=78, colors='AUTO'):\n self._width = width\n self._highlighter = StatusHighlighter(colors)\n se... |
# Copyright 2008-2011 Nokia Siemens Networks Oyj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | [
[
1,
0,
0.0424,
0.0028,
0,
0.66,
0,
79,
0,
1,
0,
0,
79,
0,
0
],
[
1,
0,
0.048,
0.0028,
0,
0.66,
0.0435,
735,
0,
1,
0,
0,
735,
0,
0
],
[
1,
0,
0.0508,
0.0028,
0,
0.6... | [
"import os.path",
"from robot import utils",
"from robot.errors import DataError",
"from robot.common import BaseTestSuite, BaseTestCase, BaseKeyword",
"from robot.output import LOGGER",
"from robot.output.loggerhelper import IsLogged, Message",
"def process_outputs(paths, settings):\n if not paths:\... |
# Copyright 2008-2011 Nokia Siemens Networks Oyj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | [
[
1,
0,
0.2586,
0.0172,
0,
0.66,
0,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.2931,
0.0172,
0,
0.66,
0.5,
426,
0,
1,
0,
0,
426,
0,
0
],
[
3,
0,
0.6724,
0.6724,
0,
0.6... | [
"import os",
"from loggerhelper import AbstractLogger",
"class FileLogger(AbstractLogger):\n\n def __init__(self, path, level):\n AbstractLogger.__init__(self, level)\n self._writer = self._get_writer(path)\n\n def _get_writer(self, path):\n # Hook for unittests",
" def __init__(... |
# Copyright 2008-2011 Nokia Siemens Networks Oyj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | [
[
1,
0,
0.1468,
0.0092,
0,
0.66,
0,
735,
0,
1,
0,
0,
735,
0,
0
],
[
1,
0,
0.1651,
0.0092,
0,
0.66,
0.25,
532,
0,
1,
0,
0,
532,
0,
0
],
[
1,
0,
0.1743,
0.0092,
0,
0.... | [
"from robot import utils",
"from logger import LOGGER",
"from loggerhelper import IsLogged",
"def DebugFile(path):\n if path == 'NONE':\n LOGGER.info('No debug file')\n return None\n try:\n LOGGER.info('Debug file: %s' % path)\n return _DebugFileWriter(path)\n except:",
... |
# Copyright 2008-2011 Nokia Siemens Networks Oyj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | [
[
1,
0,
0.0655,
0.0044,
0,
0.66,
0,
878,
0,
1,
0,
0,
878,
0,
0
],
[
1,
0,
0.0699,
0.0044,
0,
0.66,
0.125,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.0786,
0.0044,
0,
0... | [
"import inspect",
"import sys",
"from robot import utils",
"from robot.errors import DataError",
"from loggerhelper import AbstractLoggerProxy",
"from logger import LOGGER",
"if utils.is_jython:\n from java.lang import Object\n from java.util import HashMap",
" from java.lang import Object",
... |
# Copyright 2008-2011 Nokia Siemens Networks Oyj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | [
[
8,
0,
0.3208,
0.0943,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.3962,
0.0189,
0,
0.66,
0.1667,
715,
0,
1,
0,
0,
715,
0,
0
],
[
1,
0,
0.434,
0.0189,
0,
0.66,... | [
"\"\"\"Module to configure Python's standard `logging` module.\n\nAfter this module is imported, messages logged with `logging` module\nare, by default, propagated to Robot's log file.\n\"\"\"",
"import logging",
"from robot.api import logger",
"class RobotHandler(logging.Handler):\n\n def emit(self, recor... |
# Copyright 2008-2011 Nokia Siemens Networks Oyj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | [
[
1,
0,
0.0833,
0.0052,
0,
0.66,
0,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.0938,
0.0052,
0,
0.66,
0.125,
735,
0,
1,
0,
0,
735,
0,
0
],
[
1,
0,
0.1042,
0.0052,
0,
0... | [
"import os",
"from robot import utils",
"from loggerhelper import AbstractLogger, AbstractLoggerProxy, Message",
"from filelogger import FileLogger",
"from monitor import CommandLineMonitor",
"class Logger(AbstractLogger):\n \"\"\"A global logger proxy to which new loggers may be registered.\n\n Whe... |
# Copyright 2008-2011 Nokia Siemens Networks Oyj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | [
[
1,
0,
0.1496,
0.0079,
0,
0.66,
0,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.1575,
0.0079,
0,
0.66,
0.1429,
509,
0,
1,
0,
0,
509,
0,
0
],
[
7,
0,
0.1772,
0.0315,
0,
... | [
"import os",
"import sys",
"try:\n from ctypes import windll, Structure, c_short, c_ushort, byref\nexcept ImportError: # Not on Windows or using Jython\n windll = None",
" from ctypes import windll, Structure, c_short, c_ushort, byref",
" windll = None",
"def Highlighter(stream):\n if os.s... |
# Copyright 2008-2011 Nokia Siemens Networks Oyj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | [
[
1,
0,
0.2679,
0.0179,
0,
0.66,
0,
540,
0,
1,
0,
0,
540,
0,
0
],
[
1,
0,
0.3036,
0.0179,
0,
0.66,
0.3333,
19,
0,
2,
0,
0,
19,
0,
0
],
[
1,
0,
0.3214,
0.0179,
0,
0.... | [
"import re",
"from robot.output.loggerhelper import Message, LEVELS",
"from robot import utils",
"class StdoutLogSplitter(object):\n \"\"\"Splits messages logged through stdout (or stderr) into Message objects\"\"\"\n\n _split_from_levels = re.compile('^(?:\\*'\n '(%s|... |
# Copyright 2008-2011 Nokia Siemens Networks Oyj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | [
[
1,
0,
0.3137,
0.0196,
0,
0.66,
0,
886,
0,
1,
0,
0,
886,
0,
0
],
[
1,
0,
0.3333,
0.0196,
0,
0.66,
0.1429,
532,
0,
1,
0,
0,
532,
0,
0
],
[
1,
0,
0.3529,
0.0196,
0,
... | [
"from output import Output",
"from logger import LOGGER",
"from monitor import CommandLineMonitor",
"from xmllogger import XmlLogger",
"from loggerhelper import LEVELS, Message",
"from readers import process_output, process_outputs",
"OUTPUT = None",
"def TestSuite(outpath):\n \"\"\"Factory method ... |
#!/usr/bin/env python
# Copyright 2008-2011 Nokia Siemens Networks Oyj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless req... | [
[
8,
0,
0.502,
0.8735,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.9447,
0.004,
0,
0.66,
0.25,
509,
0,
1,
0,
0,
509,
0,
0
],
[
7,
0,
0.9625,
0.0237,
0,
0.66,
... | [
"\"\"\"Rebot -- Robot Framework Report and Log Generator\n\nVersion: <VERSION>\n\nUsage: rebot [options] robot_outputs\n or: interpreter /path/robot/rebot.py [options] robot_outputs\n or python -m robot.rebot [options] robot_outputs",
"import sys",
"try:\n import pythonpathsetter\nexcept ImportError:... |
#!/usr/bin/env python
# Copyright 2008-2011 Nokia Siemens Networks Oyj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless req... | [
[
8,
0,
0.5016,
0.9003,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.9564,
0.0031,
0,
0.66,
0.25,
509,
0,
1,
0,
0,
509,
0,
0
],
[
7,
0,
0.9704,
0.0187,
0,
0.66,
... | [
"\"\"\"Robot Framework -- A keyword-driven test automation framework\n\nVersion: <VERSION>\n\nUsage: pybot [options] data_sources\n or: jybot [options] data_sources\n or: interpreter /path/robot/runner.py [options] data_sources\n or: python -m robot.runner [options] data_sources",
"import sys",
"try:\... |
# Copyright 2008-2011 Nokia Siemens Networks Oyj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | [
[
1,
0,
0.4054,
0.027,
0,
0.66,
0,
299,
0,
1,
0,
0,
299,
0,
0
],
[
3,
0,
0.7432,
0.5405,
0,
0.66,
1,
290,
0,
3,
0,
0,
0,
0,
1
],
[
8,
1,
0.5811,
0.1622,
1,
0.41,
... | [
"from robot.errors import DataError",
"class UserErrorHandler:\n \"\"\"Created if creating handlers fail -- running raises DataError.\n\n The idea is not to raise DataError at processing time and prevent all\n tests in affected test case file from executing. Instead UserErrorHandler\n is created and i... |
# Copyright 2008-2011 Nokia Siemens Networks Oyj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | [
[
3,
0,
0.7857,
0.4643,
0,
0.66,
0,
776,
0,
2,
0,
0,
0,
0,
2
],
[
2,
1,
0.75,
0.25,
1,
0.88,
0,
555,
0,
6,
0,
0,
0,
0,
0
],
[
14,
2,
0.6786,
0.0357,
2,
0.09,
0,... | [
"class BaseKeyword:\n\n def __init__(self, name='', args=None, doc='', timeout='', type='kw'):\n self.name = name\n self.args = args or []\n self.doc = doc\n self.timeout = timeout\n self.type = type",
" def __init__(self, name='', args=None, doc='', timeout='', type='kw')... |
# Copyright 2008-2011 Nokia Siemens Networks Oyj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | [
[
1,
0,
0.0356,
0.0024,
0,
0.66,
0,
715,
0,
1,
0,
0,
715,
0,
0
],
[
1,
0,
0.0404,
0.0024,
0,
0.66,
0.1429,
35,
0,
1,
0,
0,
35,
0,
0
],
[
1,
0,
0.0428,
0.0024,
0,
0.... | [
"import random",
"from statistics import Stat",
"from robot import utils",
"from robot.errors import DataError",
"class _TestAndSuiteHelper:\n\n def __init__(self, name, parent=None):\n self.name = name\n self.doc = ''\n self.parent = parent\n self.setup = None\n self.t... |
# Copyright 2008-2011 Nokia Siemens Networks Oyj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | [
[
1,
0,
0.0515,
0.0034,
0,
0.66,
0,
540,
0,
1,
0,
0,
540,
0,
0
],
[
1,
0,
0.0584,
0.0034,
0,
0.66,
0.0833,
735,
0,
1,
0,
0,
735,
0,
0
],
[
3,
0,
0.0962,
0.0584,
0,
... | [
"import re",
"from robot import utils",
"class Statistics:\n\n def __init__(self, suite, suite_stat_level=-1, tag_stat_include=None,\n tag_stat_exclude=None, tag_stat_combine=None, tag_doc=None,\n tag_stat_link=None):\n self.tags = TagStatistics(tag_stat_include, tag_st... |
# Copyright 2008-2011 Nokia Siemens Networks Oyj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | [
[
1,
0,
0.5161,
0.0323,
0,
0.66,
0,
299,
0,
1,
0,
0,
299,
0,
0
],
[
3,
0,
0.8065,
0.4194,
0,
0.66,
1,
411,
0,
3,
0,
0,
0,
0,
3
],
[
2,
1,
0.7419,
0.1613,
1,
0.82,
... | [
"from robot.errors import DataError",
"class BaseLibrary:\n\n def get_handler(self, name):\n try:\n return self.handlers[name]\n except KeyError:\n raise DataError(\"No keyword handler with name '%s' found\" % name)",
" def get_handler(self, name):\n try:\n ... |
# Copyright 2008-2011 Nokia Siemens Networks Oyj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | [
[
1,
0,
0.8,
0.05,
0,
0.66,
0,
722,
0,
2,
0,
0,
722,
0,
0
],
[
1,
0,
0.85,
0.05,
0,
0.66,
0.25,
454,
0,
1,
0,
0,
454,
0,
0
],
[
1,
0,
0.9,
0.05,
0,
0.66,
0.5,
... | [
"from model import BaseTestSuite, BaseTestCase",
"from keyword import BaseKeyword",
"from handlers import UserErrorHandler",
"from libraries import BaseLibrary",
"from statistics import Statistics"
] |
#!/usr/bin/env python
# Copyright 2008-2011 Nokia Siemens Networks Oyj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless req... | [
[
8,
0,
0.2554,
0.1304,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.337,
0.0109,
0,
0.66,
0.1667,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.3478,
0.0109,
0,
0.66,... | [
"\"\"\"fixml.py -- A tool to fix broken Robot Framework output files\n\nUsage: fixml.py inpath outpath\n\nThis tool can fix Robot Framework output files that are not properly finished\nor are missing elements from the middle. It should be possible to generate\nreports and logs from the fixed output afterwards with... |
#!/usr/bin/env python
# Copyright 2008-2011 Nokia Siemens Networks Oyj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless req... | [
[
8,
0,
0.2455,
0.1786,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.3482,
0.0089,
0,
0.66,
0.0909,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.3571,
0.0089,
0,
0.66... | [
"\"\"\"Robot Framework Start/End/Elapsed Time Reporter\n\nUsage: times2csv.py input-xml [output-csv] [include-items]\n\nThis script reads start, end, and elapsed times from all suites, tests and/or\nkeywords from the given output file, and writes them into an file in\ncomma-separated-values (CSV) format. CSV files... |
#!/usr/bin/env python
# tool2html.py -- Creates HTML version of given tool documentation
#
# First part of this file is Pygments configuration and actual
# documentation generation follows it.
#
# Pygments configuration
#
# This code is from 'external/rst-directive.py' file included in Pygments 0.9
# distribution. F... | [
[
8,
0,
0.2254,
0.2465,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.3873,
0.007,
0,
0.66,
0.0455,
281,
1,
0,
0,
0,
0,
4,
0
],
[
1,
0,
0.4014,
0.007,
0,
0.66,
... | [
"\"\"\"\n The Pygments MoinMoin Parser\n ~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n This fragment is a Docutils_ 0.4 directive that renders source code\n (to HTML only, currently) via Pygments.\n\n To use it, adjust the options below and copy the code into a module",
"INLINESTYLES = False",
"from pygments.... |
# Copyright 2008-2011 Nokia Siemens Networks Oyj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | [
[
1,
0,
0.0949,
0.0063,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.1013,
0.0063,
0,
0.66,
0.1667,
878,
0,
1,
0,
0,
878,
0,
0
],
[
1,
0,
0.1076,
0.0063,
0,
... | [
"import sys",
"import inspect",
"import traceback",
"from StringIO import StringIO",
"from SimpleXMLRPCServer import SimpleXMLRPCServer",
"try:\n import signal\nexcept ImportError:\n signal = None",
" import signal",
" signal = None",
"class RobotRemoteServer(SimpleXMLRPCServer):\n al... |
#!/usr/bin/env python
import os
import sys
class ExampleRemoteLibrary:
def count_items_in_directory(self, path):
return len(i for i in os.listdir(path) if not i.startswith('.'))
def strings_should_be_equal(self, str1, str2):
print "Comparing '%s' to '%s'" % (str1, str2)
if str1 != s... | [
[
1,
0,
0.15,
0.05,
0,
0.66,
0,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.2,
0.05,
0,
0.66,
0.3333,
509,
0,
1,
0,
0,
509,
0,
0
],
[
3,
0,
0.55,
0.45,
0,
0.66,
0.6... | [
"import os",
"import sys",
"class ExampleRemoteLibrary:\n\n def count_items_in_directory(self, path):\n return len(i for i in os.listdir(path) if not i.startswith('.'))\n\n def strings_should_be_equal(self, str1, str2):\n print(\"Comparing '%s' to '%s'\" % (str1, str2))\n if str1 != s... |
import sys
from SimpleXMLRPCServer import SimpleXMLRPCServer
class SimpleLibrary(SimpleXMLRPCServer):
def __init__(self, port=8270):
SimpleXMLRPCServer.__init__(self, ('localhost', int(port)))
self.register_function(self.get_keyword_names)
self.register_function(self.run_keyword)
... | [
[
1,
0,
0.027,
0.027,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.0541,
0.027,
0,
0.66,
0.3333,
73,
0,
1,
0,
0,
73,
0,
0
],
[
3,
0,
0.5135,
0.7838,
0,
0.66,... | [
"import sys",
"from SimpleXMLRPCServer import SimpleXMLRPCServer",
"class SimpleLibrary(SimpleXMLRPCServer):\n\n def __init__(self, port=8270):\n SimpleXMLRPCServer.__init__(self, ('localhost', int(port)))\n self.register_function(self.get_keyword_names)\n self.register_function(self.run... |
# Can be used in the test data like ${MyObject()} or ${MyObject(1)}
class MyObject:
def __init__(self, index=''):
self.index = index
def __str__(self):
return '<MyObject%s>' % self.index
UNICODE = (u'Hyv\u00E4\u00E4 y\u00F6t\u00E4. '
u'\u0421\u043F\u0430\u0441\u0438\u0431\u043E!')
LI... | [
[
3,
0,
0.25,
0.3125,
0,
0.66,
0,
605,
0,
2,
0,
0,
0,
0,
0
],
[
2,
1,
0.2188,
0.125,
1,
0.21,
0,
555,
0,
2,
0,
0,
0,
0,
0
],
[
14,
2,
0.25,
0.0625,
2,
0.53,
0,
... | [
"class MyObject:\n def __init__(self, index=''):\n self.index = index\n def __str__(self):\n return '<MyObject%s>' % self.index",
" def __init__(self, index=''):\n self.index = index",
" self.index = index",
" def __str__(self):\n return '<MyObject%s>' % self.ind... |
import sys
class RemoteTestLibrary:
_unicode = (u'Hyv\u00E4\u00E4 y\u00F6t\u00E4. '
u'\u0421\u043F\u0430\u0441\u0438\u0431\u043E!')
def get_server_language(self):
lang = sys.platform.startswith('java') and 'jython' or 'python'
return '%s%d%d' % (lang, sys.version_info[0], sys... | [
[
1,
0,
0.0032,
0.0032,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
3,
0,
0.4792,
0.9359,
0,
0.66,
0.25,
637,
0,
81,
0,
0,
0,
0,
65
],
[
14,
1,
0.0208,
0.0064,
1,
0... | [
"import sys",
"class RemoteTestLibrary:\n\n _unicode = (u'Hyv\\u00E4\\u00E4 y\\u00F6t\\u00E4. '\n u'\\u0421\\u043F\\u0430\\u0441\\u0438\\u0431\\u043E!')\n\n def get_server_language(self):\n lang = sys.platform.startswith('java') and 'jython' or 'python'\n return '%s%d%d' % (lang... |
class regular:
ROBOT_LIBRARY_SCOPE = 'TEST SUITE'
"""This is a very regular test library"""
def __init__(self, arg1='hello', arg2='world'):
"""Constructs a new regular test library
See `keyword`
Examples:
| regular | foo | bar |
| regular | | # defaul... | [
[
3,
0,
0.5167,
1,
0,
0.66,
0,
2,
0,
3,
0,
0,
0,
0,
0
],
[
14,
1,
0.0667,
0.0333,
1,
0.2,
0,
305,
1,
0,
0,
0,
0,
3,
0
],
[
8,
1,
0.1333,
0.0333,
1,
0.2,
0.25,
... | [
"class regular:\n ROBOT_LIBRARY_SCOPE = 'TEST SUITE'\n\n \"\"\"This is a very regular test library\"\"\"\n\n def __init__(self, arg1='hello', arg2='world'):\n \"\"\"Constructs a new regular test library",
" ROBOT_LIBRARY_SCOPE = 'TEST SUITE'",
" \"\"\"This is a very regular test library\"\... |
class RequiredArgs:
def __init__(self, required, arguments, default="value"):
"""This library always needs two arguments and has one default.
Keyword names are got from the given arguments.
"""
self.__dict__[required] = lambda: None
self.__dict__[arguments] = lambda arg: No... | [
[
3,
0,
0.5,
0.9091,
0,
0.66,
0,
764,
0,
1,
0,
0,
0,
0,
0
],
[
2,
1,
0.5909,
0.7273,
1,
0.09,
0,
555,
0,
4,
0,
0,
0,
0,
0
],
[
8,
2,
0.5,
0.3636,
2,
0.66,
0,
... | [
"class RequiredArgs:\n\n def __init__(self, required, arguments, default=\"value\"):\n \"\"\"This library always needs two arguments and has one default.\n\n Keyword names are got from the given arguments.\n \"\"\"\n self.__dict__[required] = lambda: None",
" def __init__(self, r... |
class new_style_no_init(object):
"""No __init__ on this one."""
def kw(self):
"""The only lonely keyword."""
| [
[
3,
0,
0.5833,
1,
0,
0.66,
0,
886,
0,
1,
0,
0,
186,
0,
0
],
[
8,
1,
0.5,
0.1667,
1,
0.69,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
2,
1,
0.9167,
0.3333,
1,
0.69,
1,
... | [
"class new_style_no_init(object):\n\n \"\"\"No __init__ on this one.\"\"\"\n\n def kw(self):\n \"\"\"The only lonely keyword.\"\"\"",
" \"\"\"No __init__ on this one.\"\"\"",
" def kw(self):\n \"\"\"The only lonely keyword.\"\"\"",
" \"\"\"The only lonely keyword.\"\"\""
] |
class no_arg_init:
def __init__(self):
"""This doc not shown because there are no arguments."""
def keyword(self):
"""A keyword.
See `get hello` for details and *never* run this keyword.
"""
1/0
def get_hello(self, arg):
"""Returns 'Hello `arg`!'.
... | [
[
3,
0,
0.5,
0.95,
0,
0.66,
0,
941,
0,
3,
0,
0,
0,
0,
0
],
[
2,
1,
0.175,
0.1,
1,
0.11,
0,
555,
0,
1,
0,
0,
0,
0,
0
],
[
8,
2,
0.2,
0.05,
2,
0.78,
0,
0,
... | [
"class no_arg_init:\n\n def __init__(self):\n \"\"\"This doc not shown because there are no arguments.\"\"\"\n\n def keyword(self):\n \"\"\"A keyword.",
" def __init__(self):\n \"\"\"This doc not shown because there are no arguments.\"\"\"",
" \"\"\"This doc not shown becaus... |
class dynamic:
def get_keyword_names(self):
return ['Keyword 1', 'KW 2']
def run_keyword(self, name, args):
print name, args
def get_keyword_arguments(self, name):
return [ 'arg%d' % (i+1) for i in range(int(name[-1])) ]
def get_keyword_documentation(self, name):
retu... | [
[
3,
0,
0.5192,
1,
0,
0.66,
0,
670,
0,
4,
0,
0,
0,
0,
3
],
[
2,
1,
0.1346,
0.0769,
1,
0.03,
0,
768,
0,
1,
1,
0,
0,
0,
0
],
[
13,
2,
0.1538,
0.0385,
2,
0.66,
0,
... | [
"class dynamic:\n\n def get_keyword_names(self):\n return ['Keyword 1', 'KW 2']\n\n def run_keyword(self, name, args):\n print(name, args)",
" def get_keyword_names(self):\n return ['Keyword 1', 'KW 2']",
" return ['Keyword 1', 'KW 2']",
" def run_keyword(self, name, ar... |
u"""Module test library.
With some non-ascii stuff:
Hyv\u00E4\u00E4 y\u00F6t\u00E4.
\u0421\u043F\u0430\u0441\u0438\u0431\u043E!
"""
ROBOT_LIBRARY_VERSION = '0.1-alpha'
def keyword():
"""A keyword
See `get hello` for details"""
pass
def get_hello():
"""Get the intialization variables
See `imp... | [
[
8,
0,
0.1739,
0.3043,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.3913,
0.0435,
0,
0.66,
0.3333,
466,
1,
0,
0,
0,
0,
3,
0
],
[
2,
0,
0.6087,
0.2174,
0,
0.66,... | [
"u\"\"\"Module test library.\n\nWith some non-ascii stuff:\n\nHyv\\u00E4\\u00E4 y\\u00F6t\\u00E4.\n\\u0421\\u043F\\u0430\\u0441\\u0438\\u0431\\u043E!\n\"\"\"",
"ROBOT_LIBRARY_VERSION = '0.1-alpha'",
"def keyword():\n \"\"\"A keyword\n\n See `get hello` for details\"\"\"\n pass",
" \"\"\"A keyword\... |
#!/usr/bin/env python
# Copyright 2008-2011 Nokia Siemens Networks Oyj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless req... | [
[
8,
0,
0.1446,
0.0783,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.1928,
0.006,
0,
0.66,
0.1429,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.1988,
0.006,
0,
0.66,
... | [
"\"\"\"Robot Framework Debugfile Viewer\n\nUsage: fileviever.py [path]\n\nThis tool is mainly targeted for viewing Robot Framework debug files set\nwith '--debugfile' command line option when running test. The idea is to\nprovide a tool that has similar functionality as 'tail -f' command in \nunixy systems.",
"i... |
#!/usr/bin/env python
# Copyright 2008-2011 Nokia Siemens Networks Oyj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless req... | [
[
8,
0,
0.1532,
0.1183,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.2204,
0.0054,
0,
0.66,
0.0833,
540,
0,
1,
0,
0,
540,
0,
0
],
[
1,
0,
0.2312,
0.0054,
0,
0.66... | [
"\"\"\"Robot Framework Test Status Checker\n\nUsage: statuschecker.py infile [outfile]\n\nThis tool processes Robot Framework output XML files and checks that test case\nstatuses and messages are as expected. Main use case is post-processing output\nfiles got when testing Robot Framework test libraries using Robot... |
#!/usr/bin/env python
"""qs2html.py -- Creates HTML version of Robot Framework Quick Start Guide
Usage: qs2html.py [ cr(eate) | dist | zip ]
create .. Creates the HTML version of the Quick Start Guide.
dist .... Creates the Quick Start Guide and copies it and all its dependencies
under directory named '... | [
[
8,
0,
0.1076,
0.1519,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.2025,
0.0127,
0,
0.66,
0.1,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.2152,
0.0127,
0,
0.66,
... | [
"\"\"\"qs2html.py -- Creates HTML version of Robot Framework Quick Start Guide\n\nUsage: qs2html.py [ cr(eate) | dist | zip ]\n\ncreate .. Creates the HTML version of the Quick Start Guide.\n\ndist .... Creates the Quick Start Guide and copies it and all its dependencies \n under directory named 'robotfra... |
import os
import sys
import subprocess
class LoginLibrary:
def __init__(self):
self._sut_path = os.path.join(os.path.dirname(__file__),
'..', 'sut', 'login.py')
self._status = ''
def create_user(self, username, password):
self._run_command('creat... | [
[
1,
0,
0.0303,
0.0303,
0,
0.66,
0,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.0606,
0.0303,
0,
0.66,
0.3333,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.0909,
0.0303,
0,
... | [
"import os",
"import sys",
"import subprocess",
"class LoginLibrary:\n\n def __init__(self):\n self._sut_path = os.path.join(os.path.dirname(__file__),\n '..', 'sut', 'login.py')\n self._status = ''\n\n def create_user(self, username, password):",
" ... |
def simple_keyword():
"""Log a message"""
print 'You have used the simplest keyword.'
def greet(name):
"""Logs a friendly greeting to person given as argument"""
print 'Hello %s!' % name
def multiply_by_two(number):
"""Returns the given number multiplied by two
The result is always a floa... | [
[
2,
0,
0.1,
0.15,
0,
0.66,
0,
30,
0,
0,
0,
0,
0,
0,
1
],
[
8,
1,
0.1,
0.05,
1,
0.85,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
8,
1,
0.15,
0.05,
1,
0.85,
1,
535,
... | [
"def simple_keyword():\n \"\"\"Log a message\"\"\"\n print('You have used the simplest keyword.')",
" \"\"\"Log a message\"\"\"",
" print('You have used the simplest keyword.')",
"def greet(name):\n \"\"\"Logs a friendly greeting to person given as argument\"\"\"\n print('Hello %s!' % name)"... |
#!/usr/bin/env python
"""pt2html.py -- Creates HTML version of Python Tutorial
Usage: pt2html.py
"""
import sys
import os
import shutil
import time
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..', 'userguide'))
import ug2html # This also initializes docutils and pygments
def create_tutorial():
... | [
[
8,
0,
0.125,
0.1111,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.2222,
0.0278,
0,
0.66,
0.125,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.25,
0.0278,
0,
0.66,
... | [
"\"\"\"pt2html.py -- Creates HTML version of Python Tutorial\n\nUsage: pt2html.py\n\"\"\"",
"import sys",
"import os",
"import shutil",
"import time",
"sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..', 'userguide'))",
"import ug2html # This also initializes docutils and pygments",
"de... |
#!/usr/bin/env python
"""Usage: lib2html.py [ library | all ]
Libraries:
BuiltIn (bu)
Collections (co)
Dialogs (di)
OperatingSystem (op)
Screenshot (sc)
String (st)
Telnet (te)
"""
import sys
import tempfile
import os
import re
ROOT = os.path.normpath(os.path.join(os.path.abspath(__file__),'..','..',... | [
[
8,
0,
0.16,
0.22,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.3,
0.02,
0,
0.66,
0.0833,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.32,
0.02,
0,
0.66,
0.1667,... | [
"\"\"\"Usage: lib2html.py [ library | all ]\n\nLibraries:\n BuiltIn (bu)\n Collections (co)\n Dialogs (di)\n OperatingSystem (op)\n Screenshot (sc)",
"import sys",
"import tempfile",
"import os",
"import re",
"ROOT = os.path.normpath(os.path.join(os.path.abspath(__file__),'..','..','..'))",
"LIBRA... |
#!/usr/bin/env python
"""ug2html.py -- Creates HTML version of Robot Framework User Guide
Usage: ug2html.py [ cr(eate) | dist | zip ]
create .. Creates the user guide so that it has relative links to images,
library docs, etc. This version is stored in the version control
and distributed with th... | [
[
8,
0,
0.0455,
0.072,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0871,
0.0038,
0,
0.66,
0.0435,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.0909,
0.0038,
0,
0.66,... | [
"\"\"\"ug2html.py -- Creates HTML version of Robot Framework User Guide\n\nUsage: ug2html.py [ cr(eate) | dist | zip ]\n\ncreate .. Creates the user guide so that it has relative links to images,\n library docs, etc. This version is stored in the version control\n and distributed with the source ... |
#!/usr/bin/env python
"""Usage: check_test_times.py inpath [outpath]
Reads result of a test run from Robot output file and checks that no test
took longer than 3 minutest to execute. If outpath is not given, the
result is written over the original file.
"""
import sys
from robot.output import TestSuite
def check_... | [
[
8,
0,
0.1618,
0.1765,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.2941,
0.0294,
0,
0.66,
0.2,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.3235,
0.0294,
0,
0.66,
... | [
"\"\"\"Usage: check_test_times.py inpath [outpath]\n\nReads result of a test run from Robot output file and checks that no test \ntook longer than 3 minutest to execute. If outpath is not given, the\nresult is written over the original file.\n\"\"\"",
"import sys",
"from robot.output import TestSuite",
"def c... |
class CheckMultipleItemsLibrary:
def items_should_not_contain(self, value, *items):
"""Checks that none of the given 'items' contains the given 'value'."""
items_containing_value = [ item for item in items if value in item ]
if items_containing_value:
message = "Items '%s' cont... | [
[
3,
0,
0.55,
1,
0,
0.66,
0,
960,
0,
1,
0,
0,
0,
0,
2
],
[
2,
1,
0.65,
0.8,
1,
0.76,
0,
121,
0,
3,
0,
0,
0,
0,
2
],
[
8,
2,
0.4,
0.1,
2,
0.06,
0,
0,
1,
... | [
"class CheckMultipleItemsLibrary:\n\n def items_should_not_contain(self, value, *items):\n \"\"\"Checks that none of the given 'items' contains the given 'value'.\"\"\"\n\n items_containing_value = [ item for item in items if value in item ]\n if items_containing_value:\n message ... |
"""Robot Framework test library example that calls C code.
This example uses Python's standard `ctypes` module, which requires
that the C code is compiled into a shared library.
It is also possible to execute this file from the command line
to test the C code manually.
"""
from ctypes import CDLL, c_char_p
LIBRARY... | [
[
8,
0,
0.1552,
0.2759,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.3448,
0.0345,
0,
0.66,
0.25,
182,
0,
2,
0,
0,
182,
0,
0
],
[
14,
0,
0.4138,
0.0345,
0,
0.66,... | [
"\"\"\"Robot Framework test library example that calls C code.\n\nThis example uses Python's standard `ctypes` module, which requires\nthat the C code is compiled into a shared library.\n\nIt is also possible to execute this file from the command line \nto test the C code manually.\n\"\"\"",
"from ctypes import C... |
from robot import run as run_robot
import cProfile
import pstats
filename = 'robot.profile'
cProfile.run('run_robot("/home/husa/workspace/robotframework/atest/testdata/misc/")', filename)
p = pstats.Stats(filename)
p.strip_dirs().sort_stats(-1).print_stats()
| [
[
1,
0,
0.1,
0.1,
0,
0.66,
0,
735,
0,
1,
0,
0,
735,
0,
0
],
[
1,
0,
0.2,
0.1,
0,
0.66,
0.1667,
686,
0,
1,
0,
0,
686,
0,
0
],
[
1,
0,
0.3,
0.1,
0,
0.66,
0.3333,
... | [
"from robot import run as run_robot",
"import cProfile",
"import pstats",
"filename = 'robot.profile'",
"cProfile.run('run_robot(\"/home/husa/workspace/robotframework/atest/testdata/misc/\")', filename)",
"p = pstats.Stats(filename)",
"p.strip_dirs().sort_stats(-1).print_stats()"
] |
from os.path import dirname, join
import subprocess
basedir = dirname(__file__)
cmd = ['pybot', '--outputdir', join(basedir, 'results'), join(basedir, 'vacalc')]
pythonpath = '%s:%s' % (join(basedir, 'lib'), join(basedir, '..', 'src'))
subprocess.call(' '.join(cmd), shell=True, env={'PYTHONPATH': pythonpath})
| [
[
1,
0,
0.125,
0.125,
0,
0.66,
0,
79,
0,
2,
0,
0,
79,
0,
0
],
[
1,
0,
0.25,
0.125,
0,
0.66,
0.2,
394,
0,
1,
0,
0,
394,
0,
0
],
[
14,
0,
0.5,
0.125,
0,
0.66,
0.4... | [
"from os.path import dirname, join",
"import subprocess",
"basedir = dirname(__file__)",
"cmd = ['pybot', '--outputdir', join(basedir, 'results'), join(basedir, 'vacalc')]",
"pythonpath = '%s:%s' % (join(basedir, 'lib'), join(basedir, '..', 'src'))",
"subprocess.call(' '.join(cmd), shell=True, env={'PYTHO... |
import os
import sys
import subprocess
import datetime
import tempfile
import vacalc
class VacalcLibrary(object):
def __init__(self):
self._db_file = os.path.join(tempfile.gettempdir(),
'vacalc-atestdb.csv')
def count_vacation(self, startdate, year):
res... | [
[
1,
0,
0.0217,
0.0217,
0,
0.66,
0,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.0435,
0.0217,
0,
0.66,
0.1667,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.0652,
0.0217,
0,
... | [
"import os",
"import sys",
"import subprocess",
"import datetime",
"import tempfile",
"import vacalc",
"class VacalcLibrary(object):\n\n def __init__(self):\n self._db_file = os.path.join(tempfile.gettempdir(),\n 'vacalc-atestdb.csv')\n\n def count_vacati... |
from __future__ import with_statement
import os
import sys
import csv
import datetime
import tempfile
class VacalcError(Exception): pass
class EmployeeStore(object):
def __init__(self, db_file):
self._db_file = db_file
if self._db_file and os.path.isfile(self._db_file):
self._employ... | [
[
1,
0,
0.0068,
0.0068,
0,
0.66,
0,
777,
0,
1,
0,
0,
777,
0,
0
],
[
1,
0,
0.0137,
0.0068,
0,
0.66,
0.0909,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.0205,
0.0068,
0,
... | [
"from __future__ import with_statement",
"import os",
"import sys",
"import csv",
"import datetime",
"import tempfile",
"class VacalcError(Exception): pass",
"class EmployeeStore(object):\n\n def __init__(self, db_file):\n self._db_file = db_file\n if self._db_file and os.path.isfile(... |
VALUE_FROM_VAR_FILE='Expected Value'
| [
[
14,
0,
1,
1,
0,
0.66,
0,
246,
1,
0,
0,
0,
0,
3,
0
]
] | [
"VALUE_FROM_VAR_FILE='Expected Value'"
] |
def this_keyword_is_in_funnylib():
print 'jee'
| [
[
2,
0,
0.75,
1,
0,
0.66,
0,
708,
0,
0,
0,
0,
0,
0,
1
],
[
8,
1,
1,
0.5,
1,
0.01,
0,
535,
3,
1,
0,
0,
0,
0,
1
]
] | [
"def this_keyword_is_in_funnylib():\n print('jee')",
" print('jee')"
] |
# Copyright 2008-2011 Nokia Siemens Networks Oyj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | [
[
1,
0,
0.0542,
0.0034,
0,
0.66,
0,
777,
0,
1,
0,
0,
777,
0,
0
],
[
1,
0,
0.0576,
0.0034,
0,
0.66,
0.0833,
394,
0,
1,
0,
0,
394,
0,
0
],
[
1,
0,
0.061,
0.0034,
0,
0... | [
"from __future__ import with_statement",
"import subprocess",
"import time",
"from random import randint",
"import os",
"import re",
"import sys",
"from robot.libraries import BuiltIn",
"from robot.utils import html_escape, ArgumentParser",
"from robot.version import get_version",
"class Paralle... |
from Queue import Queue
from threading import Event
try:
from multiprocessing.managers import BaseManager
except ImportError:
class Python26Required(object):
def __call__(self, *args):
raise RuntimeError('Requires Python > 2.6')
def __getattr__(self, name):
raise Runt... | [
[
1,
0,
0.0057,
0.0057,
0,
0.66,
0,
952,
0,
1,
0,
0,
952,
0,
0
],
[
1,
0,
0.0114,
0.0057,
0,
0.66,
0.25,
83,
0,
1,
0,
0,
83,
0,
0
],
[
7,
0,
0.0398,
0.0511,
0,
0.66... | [
"from Queue import Queue",
"from threading import Event",
"try:\n from multiprocessing.managers import BaseManager\nexcept ImportError:\n class Python26Required(object):\n def __call__(self, *args):\n raise RuntimeError('Requires Python > 2.6')\n def __getattr__(self, name):\n... |
# -*- python -*-
# ex: set syntax=python:
import os
ROBOT_FRAMEWORK_REPOSITORY = 'http://robotframework.googlecode.com/svn/trunk/'
# This is the dictionary that the buildmaster pays attention to. We also use
# a shorter alias to save typing.
c = BuildmasterConfig = {}
####### BUILDSLAVES
from buildbot.buildslave impo... | [
[
1,
0,
0.0213,
0.0071,
0,
0.66,
0,
688,
0,
1,
0,
0,
688,
0,
0
],
[
14,
0,
0.0355,
0.0071,
0,
0.66,
0.0278,
358,
1,
0,
0,
0,
0,
3,
0
],
[
14,
0,
0.0567,
0.0071,
0,
... | [
"import os",
"ROBOT_FRAMEWORK_REPOSITORY = 'http://robotframework.googlecode.com/svn/trunk/'",
"c = BuildmasterConfig = {}",
"from buildbot.buildslave import BuildSlave",
"c['slaves'] = [BuildSlave(\"debian-py2.4\", \"robotci\")]",
"c['slavePortnum'] = 9989",
"from buildbot.changes.svnpoller import SVNP... |
from javax.swing import JFrame, JList, JPanel, JLabel, JTextField, JButton, Box, BoxLayout, JTable
from javax.swing.event import ListSelectionListener
from javax.swing.table import AbstractTableModel
from java.awt.event import ActionListener
from java.awt import FlowLayout, BorderLayout, Dimension, Font, Color
class ... | [
[
1,
0,
0.0043,
0.0043,
0,
0.66,
0,
828,
0,
9,
0,
0,
828,
0,
0
],
[
1,
0,
0.0085,
0.0043,
0,
0.66,
0.0833,
182,
0,
1,
0,
0,
182,
0,
0
],
[
1,
0,
0.0128,
0.0043,
0,
... | [
"from javax.swing import JFrame, JList, JPanel, JLabel, JTextField, JButton, Box, BoxLayout, JTable",
"from javax.swing.event import ListSelectionListener",
"from javax.swing.table import AbstractTableModel",
"from java.awt.event import ActionListener",
"from java.awt import FlowLayout, BorderLayout, Dimens... |
from vacalcapp import VacalcApplication
| [
[
1,
0,
1,
1,
0,
0.66,
0,
545,
0,
1,
0,
0,
545,
0,
0
]
] | [
"from vacalcapp import VacalcApplication"
] |
#!/usr/bin/env python
"""Packaging script for Robot Framework
Usage: package.py command version_number [release_tag]
Argument 'command' can have one of the following values:
- sdist : create source distribution
- wininst : create Windows installer
- all : create both packages
- version : update on... | [
[
8,
0,
0.0798,
0.1387,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.1555,
0.0042,
0,
0.66,
0.0233,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.1597,
0.0042,
0,
0.66... | [
"\"\"\"Packaging script for Robot Framework\n\nUsage: package.py command version_number [release_tag]\n\nArgument 'command' can have one of the following values:\n - sdist : create source distribution\n - wininst : create Windows installer\n - all : create both packages",
"import sys",
"import os",... |
'''
一阶字典读
'''
def getElement_twolevel(dic, key1, key2):
if dic.has_key(key1):
if dic[key1][0] == 0:
return 0.0
if dic[key1].has_key(key2):
return 1.0 * dic[key1][key2] / dic[key1][0]
return 0.0
'''
一阶字典写
'''
def getElement_onelevel(dic, key):
if dic[0] == 0:
return 0.0
if dic.has_key(key):
return 1.0 ... | [
[
8,
0,
0.0588,
0.0882,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
2,
0,
0.2059,
0.2059,
0,
0.66,
0.2,
516,
0,
3,
1,
0,
0,
0,
2
],
[
4,
1,
0.2059,
0.1471,
1,
0.97,
... | [
"'''\n一阶字典读\n'''",
"def getElement_twolevel(dic, key1, key2):\n\tif dic.has_key(key1):\n\t\tif dic[key1][0] == 0:\n\t\t\treturn 0.0\n\t\tif dic[key1].has_key(key2):\n\t\t\treturn 1.0 * dic[key1][key2] / dic[key1][0]\n\treturn 0.0",
"\tif dic.has_key(key1):\n\t\tif dic[key1][0] == 0:\n\t\t\treturn 0.0\n\t\tif di... |
'''
prerequisite:
1) allocate the term-id and doc-id;
2) build a language model for each passage (fixed window)
3) get an initialed translation model
'''
from ML import ML
from QueryManager import QueryManager
from Query import Query
from Lexicon import Lexicon
from TranslationModel import TranslationModel
from time i... | [
[
8,
0,
0.0184,
0.0246,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0328,
0.0041,
0,
0.66,
0.0714,
455,
0,
1,
0,
0,
455,
0,
0
],
[
1,
0,
0.0369,
0.0041,
0,
0.66... | [
"'''\nprerequisite:\n1) allocate the term-id and doc-id;\n2) build a language model for each passage (fixed window)\n3) get an initialed translation model\n'''",
"from ML import ML",
"from QueryManager import QueryManager",
"from Query import Query",
"from Lexicon import Lexicon",
"from TranslationModel i... |
from os.path import exists, join
from Document import Document
from Lexicon import Lexicon
from config import *
from Query import Query
class QueryManager:
def create(self):
query_id = 0
query_file = open(query_path, 'w')
for i in xrange(doccount):
paper = Document(i)
comment_list = paper.getComments()
... | [
[
1,
0,
0.0263,
0.0263,
0,
0.66,
0,
79,
0,
2,
0,
0,
79,
0,
0
],
[
1,
0,
0.0526,
0.0263,
0,
0.66,
0.2,
920,
0,
1,
0,
0,
920,
0,
0
],
[
1,
0,
0.0789,
0.0263,
0,
0.66,... | [
"from os.path import exists, join",
"from Document import Document",
"from Lexicon import Lexicon",
"from config import *",
"from Query import Query",
"class QueryManager:\n\n\tdef create(self):\n\t\tquery_id = 0\n\t\tquery_file = open(query_path, 'w')\n\t\tfor i in xrange(doccount):\n\t\t\tpaper = Docum... |
from Lexicon import Lexicon
from ML import ML
from config import *
from TranslationModel import TranslationModel
class OfflineTranslationModel:
'''
compute offline sum P(q|w)*P(w|D)
'''
def create(self):
lexicon = Lexicon()
lexicon.load()
doc_list = []
offline_tm = []
for doc in xrange(doccount):
ml =... | [
[
1,
0,
0.0164,
0.0164,
0,
0.66,
0,
16,
0,
1,
0,
0,
16,
0,
0
],
[
1,
0,
0.0328,
0.0164,
0,
0.66,
0.2,
455,
0,
1,
0,
0,
455,
0,
0
],
[
1,
0,
0.0492,
0.0164,
0,
0.66,... | [
"from Lexicon import Lexicon",
"from ML import ML",
"from config import *",
"from TranslationModel import TranslationModel",
"class OfflineTranslationModel:\n\t'''\n\tcompute offline sum P(q|w)*P(w|D)\n\t'''\n\tdef create(self):\n\t\tlexicon = Lexicon()\n\t\tlexicon.load()\n\t\tdoc_list = []",
"\t'''\n\tc... |
from config import OfflineTMSingle_path
from os.path import join
class OfflineTMSingle:
def __init__(self, docId):
self.path = join(OfflineTMSingle_path, str(docId))
def load(self):
self.model = {}
f = open(self.path, 'r')
line = f.readlines()[0]
f.close()
items = line.split()
for item in items:
s... | [
[
1,
0,
0.0435,
0.0435,
0,
0.66,
0,
308,
0,
1,
0,
0,
308,
0,
0
],
[
1,
0,
0.087,
0.0435,
0,
0.66,
0.3333,
79,
0,
1,
0,
0,
79,
0,
0
],
[
3,
0,
0.5,
0.6957,
0,
0.66,
... | [
"from config import OfflineTMSingle_path",
"from os.path import join",
"class OfflineTMSingle:\n\tdef __init__(self, docId):\n\t\tself.path = join(OfflineTMSingle_path, str(docId))\n\t\n\tdef load(self):\n\t\tself.model = {}\n\t\tf = open(self.path, 'r')\n\t\tline = f.readlines()[0]",
"\tdef __init__(self, do... |
import os
from config import *
import logging
class Document:
'''
一篇文档的对象
'''
def __init__(self, docnum):
self.path = os.path.join(datapath, str(docnum))
if not os.path.exists(self.path):
logging.error('Not exists %s' % self.path)
f = open(self.path, 'r')
lines = f.readlines()
f.close()
self.title =... | [
[
1,
0,
0.0263,
0.0263,
0,
0.66,
0,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.0526,
0.0263,
0,
0.66,
0.3333,
308,
0,
1,
0,
0,
308,
0,
0
],
[
1,
0,
0.0789,
0.0263,
0,
... | [
"import os",
"from config import *",
"import logging",
"class Document:\n\tdef __init__(self, docnum):\n\t\tself.path = os.path.join(datapath, str(docnum))\n\t\tif not os.path.exists(self.path):\n\t\t\tlogging.error('Not exists %s' % self.path) \n\t\tf = open(self.path, 'r')\n\t\tlines = f.readlines()\n\t\tf.... |
from os.path import exists, join
from Document import Document
from Lexicon import Lexicon
from config import *
class Query:
'''
for a specific query indexed by its number
'''
def __init__(self, query_id, ans_doc, query):
self.query_id = query_id
self.ans_doc = ans_doc
self.query = query
#query有三个属性,ansdo... | [
[
1,
0,
0.0333,
0.0333,
0,
0.66,
0,
79,
0,
2,
0,
0,
79,
0,
0
],
[
1,
0,
0.0667,
0.0333,
0,
0.66,
0.25,
920,
0,
1,
0,
0,
920,
0,
0
],
[
1,
0,
0.1,
0.0333,
0,
0.66,
... | [
"from os.path import exists, join",
"from Document import Document",
"from Lexicon import Lexicon",
"from config import *",
"class Query:\n\t\n\t'''\n\tfor a specific query indexed by its number\n\t'''\n\tdef __init__(self, query_id, ans_doc, query):\n\t\tself.query_id = query_id\n\t\tself.ans_doc = ans_doc... |
from config import *
from os.path import exists
from Document import Document
from Lexicon import Lexicon
from os import mkdir,rmdir
import os.path
class ML:
'''Generate collection-wise and document-wise information , namely P(w|C), P(w|D)'''
'''doc是一个字符串形式,字符串字面可以为数字或collection,前者代表文档的ML,后者代表集合的ML'''
def __init__(... | [
[
1,
0,
0.0088,
0.0088,
0,
0.66,
0,
308,
0,
1,
0,
0,
308,
0,
0
],
[
1,
0,
0.0177,
0.0088,
0,
0.66,
0.1667,
79,
0,
1,
0,
0,
79,
0,
0
],
[
1,
0,
0.0265,
0.0088,
0,
0.... | [
"from config import *",
"from os.path import exists",
"from Document import Document",
"from Lexicon import Lexicon",
"from os import mkdir,rmdir",
"import os.path",
"class ML:\n\t'''Generate collection-wise and document-wise information , namely P(w|C), P(w|D)'''\n\t'''doc是一个字符串形式,字符串字面可以为数字或collection... |
from Lexicon import Lexicon
from ML import ML
from config import *
from TranslationModel import TranslationModel
from multiprocessing import Pipe, Process
import os
from os.path import join, exists
class OfflineTranslationModel:
'''
compute offline sum P(q|w)*P(w|D)
'''
def create_multi(self, begin, end, doc_list... | [
[
1,
0,
0.0103,
0.0103,
0,
0.66,
0,
16,
0,
1,
0,
0,
16,
0,
0
],
[
1,
0,
0.0206,
0.0103,
0,
0.66,
0.125,
455,
0,
1,
0,
0,
455,
0,
0
],
[
1,
0,
0.0309,
0.0103,
0,
0.6... | [
"from Lexicon import Lexicon",
"from ML import ML",
"from config import *",
"from TranslationModel import TranslationModel",
"from multiprocessing import Pipe, Process",
"import os",
"from os.path import join, exists",
"class OfflineTranslationModel:\n\t'''\n\tcompute offline sum P(q|w)*P(w|D)\n\t'''\... |
from os.path import exists, join
from Document import Document
from Lexicon import Lexicon
from config import *
class TranslationModel:
def load(self, is_filt=False):
self.tm = []
for i in xrange(lexicon_size+1):
self.tm.append({})
tm_file = open(TM_path, 'r')
lines = tm_file.readlines()
tm_file.close()... | [
[
1,
0,
0.0076,
0.0076,
0,
0.66,
0,
79,
0,
2,
0,
0,
79,
0,
0
],
[
1,
0,
0.0153,
0.0076,
0,
0.66,
0.25,
920,
0,
1,
0,
0,
920,
0,
0
],
[
1,
0,
0.0229,
0.0076,
0,
0.66... | [
"from os.path import exists, join",
"from Document import Document",
"from Lexicon import Lexicon",
"from config import *",
"class TranslationModel:\n\n\tdef load(self, is_filt=False):\n\t\tself.tm = []\n\t\tfor i in xrange(lexicon_size+1):\n\t\t\tself.tm.append({})\n\t\ttm_file = open(TM_path, 'r')\n\t\tli... |
'''
prerequisite:
1) allocate the term-id and doc-id;
2) build a language model for each passage (fixed window)
3) get an initialed translation model
'''
from ML import ML
from QueryManager import QueryManager
from Query import Query
from Lexicon import Lexicon
from TranslationModel import TranslationModel
from time im... | [
[
8,
0,
0.02,
0.0343,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.04,
0.0057,
0,
0.66,
0.1,
455,
0,
1,
0,
0,
455,
0,
0
],
[
1,
0,
0.0457,
0.0057,
0,
0.66,
0... | [
"'''\nprerequisite:\n1) allocate the term-id and doc-id;\n2) build a language model for each passage (fixed window)\n3) get an initialed translation model\n'''",
"from ML import ML",
"from QueryManager import QueryManager",
"from Query import Query",
"from Lexicon import Lexicon",
"from TranslationModel i... |
from os.path import join, exists
from config import *
from Document import Document
class Lexicon:
'''
整个数据集的词典表示
words are 1-indexed.
'''
def create(self):
word_dict = {}
for doc in xrange(doccount):
print 'Processing %d' % doc
paper = Document(doc)
comments = ''
for com in paper.getComments():... | [
[
1,
0,
0.0159,
0.0159,
0,
0.66,
0,
79,
0,
2,
0,
0,
79,
0,
0
],
[
1,
0,
0.0317,
0.0159,
0,
0.66,
0.25,
308,
0,
1,
0,
0,
308,
0,
0
],
[
1,
0,
0.0476,
0.0159,
0,
0.66... | [
"from os.path import join, exists",
"from config import *",
"from Document import Document",
"class Lexicon:\n\n\t'''\n\t整个数据集的词典表示\n\twords are 1-indexed.\n\t'''\n\n\tdef create(self):",
"\t'''\n\t整个数据集的词典表示\n\twords are 1-indexed.\n\t'''",
"\tdef create(self):\n\t\tword_dict = {}\n\t\tfor doc in xrange(... |
#预处理之后的原始数据路径
datapath='/mnt/disk1/luyang/paper_new/prunned_data/'
#文档个数
doccount=29353
#alpha=0.2
#beta=0.3
#translation model的截断数,即1个词最多翻译到filter_num个词
filter_num=1000
#词典的路径
lexicon_path='/mnt/disk1/luyang/paper_new/prunned_data/lexicon'
#collection model的路径
collection_path='/mnt/disk1/luyang/paper_new/ML_data/colle... | [
[
14,
0,
0.0625,
0.0312,
0,
0.66,
0,
716,
1,
0,
0,
0,
0,
3,
0
],
[
14,
0,
0.125,
0.0312,
0,
0.66,
0.0714,
878,
1,
0,
0,
0,
0,
1,
0
],
[
14,
0,
0.25,
0.0312,
0,
0.66... | [
"datapath='/mnt/disk1/luyang/paper_new/prunned_data/'",
"doccount=29353",
"filter_num=1000",
"lexicon_path='/mnt/disk1/luyang/paper_new/prunned_data/lexicon'",
"collection_path='/mnt/disk1/luyang/paper_new/ML_data/collection'",
"ML_path='/mnt/disk1/luyang/paper_new/ML_data/'",
"query_path='/mnt/disk1/lu... |
#!/usr/bin/python2.6
#
# Simple http server to emulate api.playfoursquare.com
import logging
import shutil
import sys
import urlparse
import SimpleHTTPServer
import BaseHTTPServer
class RequestHandler(BaseHTTPServer.BaseHTTPRequestHandler):
"""Handle playfoursquare.com requests, for testing."""
def do_GET(self... | [
[
1,
0,
0.0588,
0.0118,
0,
0.66,
0,
715,
0,
1,
0,
0,
715,
0,
0
],
[
1,
0,
0.0706,
0.0118,
0,
0.66,
0.125,
614,
0,
1,
0,
0,
614,
0,
0
],
[
1,
0,
0.0824,
0.0118,
0,
0... | [
"import logging",
"import shutil",
"import sys",
"import urlparse",
"import SimpleHTTPServer",
"import BaseHTTPServer",
"class RequestHandler(BaseHTTPServer.BaseHTTPRequestHandler):\n \"\"\"Handle playfoursquare.com requests, for testing.\"\"\"\n\n def do_GET(self):\n logging.warn('do_GET: %s, %s',... |
#!/usr/bin/python
import os
import subprocess
import sys
BASEDIR = '../main/src/com/joelapenna/foursquare'
TYPESDIR = '../captures/types/v1'
captures = sys.argv[1:]
if not captures:
captures = os.listdir(TYPESDIR)
for f in captures:
basename = f.split('.')[0]
javaname = ''.join([c.capitalize() for c in basena... | [
[
1,
0,
0.1111,
0.037,
0,
0.66,
0,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.1481,
0.037,
0,
0.66,
0.1429,
394,
0,
1,
0,
0,
394,
0,
0
],
[
1,
0,
0.1852,
0.037,
0,
0.6... | [
"import os",
"import subprocess",
"import sys",
"BASEDIR = '../main/src/com/joelapenna/foursquare'",
"TYPESDIR = '../captures/types/v1'",
"captures = sys.argv[1:]",
"if not captures:\n captures = os.listdir(TYPESDIR)",
" captures = os.listdir(TYPESDIR)",
"for f in captures:\n basename = f.split('... |
#!/usr/bin/python
"""
Pull a oAuth protected page from foursquare.
Expects ~/.oget to contain (one on each line):
CONSUMER_KEY
CONSUMER_KEY_SECRET
USERNAME
PASSWORD
Don't forget to chmod 600 the file!
"""
import httplib
import os
import re
import sys
import urllib
import urllib2
import urlparse
import user
from xml.... | [
[
8,
0,
0.0631,
0.0991,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.1261,
0.009,
0,
0.66,
0.05,
2,
0,
1,
0,
0,
2,
0,
0
],
[
1,
0,
0.1351,
0.009,
0,
0.66,
0.... | [
"\"\"\"\nPull a oAuth protected page from foursquare.\n\nExpects ~/.oget to contain (one on each line):\nCONSUMER_KEY\nCONSUMER_KEY_SECRET\nUSERNAME\nPASSWORD",
"import httplib",
"import os",
"import re",
"import sys",
"import urllib",
"import urllib2",
"import urlparse",
"import user",
"from xml.... |
#!/usr/bin/python
import datetime
import sys
import textwrap
import common
from xml.dom import pulldom
PARSER = """\
/**
* Copyright 2009 Joe LaPenna
*/
package com.joelapenna.foursquare.parsers;
import com.joelapenna.foursquare.Foursquare;
import com.joelapenna.foursquare.error.FoursquareError;
import com.joel... | [
[
1,
0,
0.0201,
0.0067,
0,
0.66,
0,
426,
0,
1,
0,
0,
426,
0,
0
],
[
1,
0,
0.0268,
0.0067,
0,
0.66,
0.0769,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.0336,
0.0067,
0,
... | [
"import datetime",
"import sys",
"import textwrap",
"import common",
"from xml.dom import pulldom",
"PARSER = \"\"\"\\\n/**\n * Copyright 2009 Joe LaPenna\n */\n\npackage com.joelapenna.foursquare.parsers;\n\nimport com.joelapenna.foursquare.Foursquare;",
"BOOLEAN_STANZA = \"\"\"\\\n } else i... |
#!/usr/bin/python
import logging
from xml.dom import minidom
from xml.dom import pulldom
BOOLEAN = "boolean"
STRING = "String"
GROUP = "Group"
# Interfaces that all FoursquareTypes implement.
DEFAULT_INTERFACES = ['FoursquareType']
# Interfaces that specific FoursqureTypes implement.
INTERFACES = {
}
DEFAULT_CLA... | [
[
1,
0,
0.0263,
0.0088,
0,
0.66,
0,
715,
0,
1,
0,
0,
715,
0,
0
],
[
1,
0,
0.0439,
0.0088,
0,
0.66,
0.0833,
290,
0,
1,
0,
0,
290,
0,
0
],
[
1,
0,
0.0526,
0.0088,
0,
... | [
"import logging",
"from xml.dom import minidom",
"from xml.dom import pulldom",
"BOOLEAN = \"boolean\"",
"STRING = \"String\"",
"GROUP = \"Group\"",
"DEFAULT_INTERFACES = ['FoursquareType']",
"INTERFACES = {\n}",
"DEFAULT_CLASS_IMPORTS = [\n]",
"CLASS_IMPORTS = {\n# 'Checkin': DEFAULT_CLASS_IMP... |
#!/usr/bin/python
# Copyright 2011 Google, Inc. All Rights Reserved.
# simple script to walk source tree looking for third-party licenses
# dumps resulting html page to stdout
import os, re, mimetypes, sys
# read source directories to scan from command line
SOURCE = sys.argv[1:]
# regex to find /* */ style commen... | [
[
1,
0,
0.0816,
0.0102,
0,
0.66,
0,
688,
0,
4,
0,
0,
688,
0,
0
],
[
14,
0,
0.1224,
0.0102,
0,
0.66,
0.0714,
792,
6,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.1531,
0.0102,
0,
... | [
"import os, re, mimetypes, sys",
"SOURCE = sys.argv[1:]",
"COMMENT_BLOCK = re.compile(r\"(/\\*.+?\\*/)\", re.MULTILINE | re.DOTALL)",
"COMMENT_LICENSE = re.compile(r\"(license)\", re.IGNORECASE)",
"COMMENT_COPYRIGHT = re.compile(r\"(copyright)\", re.IGNORECASE)",
"EXCLUDE_TYPES = [\n \"application/xml\... |
#!/usr/bin/python2.6
#
# Copyright 2011 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required... | [
[
8,
0,
0.065,
0.0036,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.0722,
0.0036,
0,
0.66,
0.0385,
777,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.0794,
0.0036,
0,
0.66,
... | [
"\"\"\"Build the BITE Extension.\"\"\"",
"__author__ = 'ralphj@google.com (Julie Ralph)'",
"import logging",
"import optparse",
"import os",
"import shutil",
"import subprocess",
"import urllib",
"import zipfile",
"CHECKOUT_ACE_COMMAND = ('git clone git://github.com/ajaxorg/ace.git')",
"CHECKOUT... |
'''
este script parsea los atributos de personajes y ciudades descargando los datos de
la url especificada en URL, y los guarda en formato JSON.
require python 2.7
'''
import urllib2
import re
import json
from __builtin__ import file
URL = r'http://www.gamefaqs.com/sms/588168-where-in-the-world-is-ca... | [
[
8,
0,
0.0276,
0.0472,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0709,
0.0079,
0,
0.66,
0.0714,
345,
0,
1,
0,
0,
345,
0,
0
],
[
1,
0,
0.0787,
0.0079,
0,
0.66... | [
"'''\neste script parsea los atributos de personajes y ciudades descargando los datos de\nla url especificada en URL, y los guarda en formato JSON.\n\nrequire python 2.7\n'''",
"import urllib2",
"import re",
"import json",
"from __builtin__ import file",
"URL = r'http://www.gamefaqs.com/sms/588168-where-i... |
#!/usr/bin/python
# Copyright 2011 Google, Inc. All Rights Reserved.
# simple script to walk source tree looking for third-party licenses
# dumps resulting html page to stdout
import os, re, mimetypes, sys
# read source directories to scan from command line
SOURCE = sys.argv[1:]
# regex to find /* */ style commen... | [
[
1,
0,
0.0816,
0.0102,
0,
0.66,
0,
688,
0,
4,
0,
0,
688,
0,
0
],
[
14,
0,
0.1224,
0.0102,
0,
0.66,
0.0714,
792,
6,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.1531,
0.0102,
0,
... | [
"import os, re, mimetypes, sys",
"SOURCE = sys.argv[1:]",
"COMMENT_BLOCK = re.compile(r\"(/\\*.+?\\*/)\", re.MULTILINE | re.DOTALL)",
"COMMENT_LICENSE = re.compile(r\"(license)\", re.IGNORECASE)",
"COMMENT_COPYRIGHT = re.compile(r\"(copyright)\", re.IGNORECASE)",
"EXCLUDE_TYPES = [\n \"application/xml\... |
#!/usr/bin/env python
# encoding: utf-8
"""
Created by Jaime Blasco on 2009-09-15
Uploaed to Labs on 2011-09-26 <--- First contribution :P
License:
Copyright (c) 2009 AlienVault
All rights reserved.
This package is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public Lic... | [
[
8,
0,
0.0437,
0.0713,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0828,
0.0023,
0,
0.66,
0.04,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.0851,
0.0023,
0,
0.66,
... | [
"\"\"\"\nCreated by Jaime Blasco on 2009-09-15\nUploaed to Labs on 2011-09-26 <--- First contribution :P\n\nLicense:\n\nCopyright (c) 2009 AlienVault\nAll rights reserved.",
"import sys",
"import getopt",
"import fileinput",
"import commands",
"import re",
"from xmlobject import XMLFile",
"import libx... |
#!/usr/bin/env python
# encoding: utf-8
"""
Created by Jaime Blasco on 2009-09-15
Uploaed to Labs on 2011-09-26 <--- First contribution :P
License:
Copyright (c) 2009 AlienVault
All rights reserved.
This package is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public Lic... | [
[
8,
0,
0.0437,
0.0713,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0828,
0.0023,
0,
0.66,
0.04,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.0851,
0.0023,
0,
0.66,
... | [
"\"\"\"\nCreated by Jaime Blasco on 2009-09-15\nUploaed to Labs on 2011-09-26 <--- First contribution :P\n\nLicense:\n\nCopyright (c) 2009 AlienVault\nAll rights reserved.",
"import sys",
"import getopt",
"import fileinput",
"import commands",
"import re",
"from xmlobject import XMLFile",
"import libx... |
'''GTK User Interface code for ClearCutter'''
__author__ = "CP Constantine"
__email__ = "conrad@alienvault.com"
__copyright__ = 'Copyright:Alienvault 2012'
__credits__ = ["Conrad Constantine"]
__version__ = "0.1"
__license__ = "BSD"
__status__ = "Prototype"
__maintainer__ = "CP Constantine"
import gtk, gtk.glade, py... | [
[
8,
0,
0.0312,
0.0312,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.0938,
0.0312,
0,
0.66,
0.0909,
777,
1,
0,
0,
0,
0,
3,
0
],
[
14,
0,
0.125,
0.0312,
0,
0.66,... | [
"'''GTK User Interface code for ClearCutter'''",
"__author__ = \"CP Constantine\"",
"__email__ = \"conrad@alienvault.com\"",
"__copyright__ = 'Copyright:Alienvault 2012'",
"__credits__ = [\"Conrad Constantine\"]",
"__version__ = \"0.1\"",
"__license__ = \"BSD\"",
"__status__ = \"Prototype\"",
"__mai... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.