code
stringlengths
9
256k
<s> from __future__ import absolute_import <EOL> from . import util as testutil <EOL> from sqlalchemy import pool , orm , util <EOL> from sqlalchemy . engine import default , create_engine , url <EOL> from sqlalchemy import exc as sa_exc <EOL> from sqlalchemy . util import decorator <EOL> from sqlalchemy import types a...
<s> """<STR_LIT>""" <EOL> from . . exc import CircularDependencyError <EOL> from . . import util <EOL> __all__ = [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] <EOL> def sort_as_subsets ( tuples , allitems ) : <EOL> edges = util . defaultdict ( set ) <EOL> for parent , child in tuples : <EOL> edges [ child ] . add ( paren...
<s> from kokoropy . controller import Crud_Controller <EOL> from . . models . _all import G_Table_Name <EOL> class G_Table_Name_Controller ( Crud_Controller ) : <EOL> __model__ = G_Table_Name <EOL> G_Table_Name_Controller . publish_route ( ) </s>
<s> class HTTPRequest ( object ) : <EOL> "<STR_LIT>" <EOL> def __init__ ( self , serveraddr , rmtaddr , req ) : <EOL> self . rmtaddr = rmtaddr <EOL> self . _serveraddr = serveraddr <EOL> self . environ = self . _parse_req ( req ) <EOL> def _parse_req ( self , req ) : <EOL> reqlines = req . split ( b'<STR_LIT:\r\n>' if ...
<s> from datetime import datetime , timedelta <EOL> from time import sleep as delay <EOL> from thespian . system . utilis import timePeriodSeconds <EOL> class RateThrottle ( object ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , maximumRate ) : <EOL> "<STR_LIT>" <EOL> self . _maxRate = maximumRate <EOL> self . _r...
<s> import unittest <EOL> import random <EOL> import thespian . test . helpers <EOL> from thespian . actors import * <EOL> from thespian . test import ActorSystemTestCase <EOL> class RoutedMsg : <EOL> def __init__ ( self , routes ) : <EOL> self . originator = None <EOL> self . routes = routes <EOL> self . response = [ ...
<s> from unittest import TestCase <EOL> from thespian . actors import ActorExitRequest , ActorSystemMessage <EOL> class TestExitRequestMsg ( TestCase ) : <EOL> scope = '<STR_LIT>' <EOL> def test_equality ( self ) : <EOL> m1 = ActorExitRequest ( ) <EOL> self . assertEqual ( m1 , ActorExitRequest ( ) ) <EOL> self . asser...
<s> import unittest <EOL> import pytest <EOL> import mock <EOL> import six <EOL> import codecs <EOL> import docker <EOL> import os <EOL> import json <EOL> import logging <EOL> import shutil <EOL> import sys <EOL> import tarfile <EOL> import io <EOL> from io import BytesIO <EOL> import uuid <EOL> from docker_squash . sq...
<s> import unittest <EOL> from collections import defaultdict <EOL> from decimal import Decimal <EOL> from wikipedia import wikipedia <EOL> from request_mock_data import mock_data <EOL> class _wiki_request ( object ) : <EOL> calls = defaultdict ( int ) <EOL> @ classmethod <EOL> def __call__ ( cls , params ) : <EOL> cls...
<s> import datetime <EOL> import logging <EOL> import multiprocessing <EOL> import os <EOL> import re <EOL> import signal <EOL> import simplejson <EOL> import setproctitle <EOL> import time <EOL> import types <EOL> from smoker . server . exceptions import * <EOL> import smoker . util . command <EOL> lg = logging . getL...
<s> from pylearn2 . utils import serial <EOL> import sys <EOL> _ , model_path = sys . argv <EOL> model = serial . load ( model_path ) <EOL> space = model . generator . get_output_space ( ) <EOL> from pylearn2 . config import yaml_parse <EOL> from pylearn2 . gui . patch_viewer import PatchViewer <EOL> import numpy as np...
<s> class GoogkitError ( Exception ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , message ) : <EOL> """<STR_LIT>""" <EOL> self . _message = message <EOL> @ property <EOL> def message ( self ) : <EOL> return self . _message <EOL> def __str__ ( self ) : <EOL> return self . message <EOL> class InvalidOptionError ( ...
<s> import unittest <EOL> import doctest <EOL> import googkit . lib . logutil <EOL> def load_tests ( loader , tests , ignore ) : <EOL> tests . addTests ( doctest . DocTestSuite ( googkit . lib . logutil ) ) <EOL> return tests <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> unittest . main ( ) </s>
<s> """<STR_LIT>""" <EOL> __author__ = '<STR_LIT>' <EOL> import os <EOL> import unittest2 <EOL> from anvil import async <EOL> from anvil import cache <EOL> from anvil . context import * <EOL> from anvil . module import * <EOL> from anvil . rule import * <EOL> from anvil . project import * <EOL> from anvil . task import...
<s> __author__ = '<STR_LIT>' <EOL> import inspect <EOL> import os <EOL> import re <EOL> import string <EOL> import sys <EOL> import time <EOL> if sys . platform == '<STR_LIT:win32>' or sys . platform == '<STR_LIT>' : <EOL> timer = time . clock <EOL> else : <EOL> timer = time . time <EOL> def get_anvil_path ( ) : <EOL> ...
<s> """<STR_LIT>""" <EOL> from google . apputils import basetest <EOL> from googleapis . codegen import csharp_generator <EOL> class NestedClassNameTest ( basetest . TestCase ) : <EOL> NESTED_API = { <EOL> '<STR_LIT:name>' : '<STR_LIT>' , <EOL> '<STR_LIT:version>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : { } , <EOL> '<STR_L...
<s> """<STR_LIT>""" <EOL> __author__ = '<STR_LIT>' <EOL> from googleapis . codegen import api <EOL> from googleapis . codegen import api_library_generator <EOL> from googleapis . codegen import data_types <EOL> from googleapis . codegen import language_model <EOL> from googleapis . codegen import utilities <EOL> from g...
<s> """<STR_LIT>""" <EOL> __author__ = '<STR_LIT>' <EOL> import HTMLParser <EOL> class HTMLStripper ( HTMLParser . HTMLParser ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self ) : <EOL> HTMLParser . HTMLParser . __init__ ( self ) <EOL> self . reset ( ) <EOL> self . fed = [ ] <EOL> def handle_data ( self , d ) : <EOL>...
<s> """<STR_LIT>""" <EOL> __author__ = '<STR_LIT>' <EOL> import aclgenerator <EOL> class Error ( Exception ) : <EOL> """<STR_LIT>""" <EOL> pass <EOL> class UnsupportedArubaAccessListError ( Error ) : <EOL> """<STR_LIT>""" <EOL> pass <EOL> class Term ( aclgenerator . Term ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( s...
<s> """<STR_LIT>""" <EOL> import time <EOL> import gflags <EOL> import push_exceptions as exceptions <EOL> import logging <EOL> FLAGS = gflags . FLAGS <EOL> gflags . DEFINE_float ( '<STR_LIT>' , <EOL> <NUM_LIT> , <EOL> '<STR_LIT>' ) <EOL> gflags . DEFINE_float ( '<STR_LIT>' , <EOL> <NUM_LIT> , <EOL> '<STR_LIT>' ) <EOL>...
<s> """<STR_LIT>""" <EOL> import plistlib <EOL> import xml . parsers . expat <EOL> class Error ( Exception ) : <EOL> """<STR_LIT>""" <EOL> class ApplePlist ( object ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , str_xml ) : <EOL> self . _xml = str_xml <EOL> self . plist = None <EOL> def Parse ( self ) : <EOL> tr...
<s> """<STR_LIT>""" <EOL> import cookielib <EOL> import unittest <EOL> import urllib2 <EOL> import mox <EOL> import stubout <EOL> from cauliflowervest . client import base_client <EOL> class CauliflowerVestClientTest ( mox . MoxTestBase ) : <EOL> """<STR_LIT>""" <EOL> def setUp ( self ) : <EOL> super ( CauliflowerVestC...
<s> """<STR_LIT>""" </s>
<s> """<STR_LIT>""" <EOL> __author__ = ( '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' ) <EOL> import re <EOL> from closure_linter import ecmalintrules <EOL> from closure_linter import error_check <EOL> from closure_linter import errors <EOL> from closure_linter import javascripttokenizer <EOL> from closure_linte...
<s> """<STR_LIT>""" <EOL> import encoder <EOL> import optimizer <EOL> import os <EOL> import test_tools <EOL> import time <EOL> import unittest <EOL> import vp8 <EOL> import file_codec <EOL> class CopyingCodec ( file_codec . FileCodec ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , name = '<STR_LIT>' ) : <EOL> su...
<s> """<STR_LIT>""" <EOL> import encoder <EOL> import optimizer <EOL> import test_tools <EOL> import unittest <EOL> import vp8 <EOL> class TestVp8 ( test_tools . FileUsingCodecTest ) : <EOL> def test_Init ( self ) : <EOL> codec = vp8 . Vp8Codec ( ) <EOL> self . assertEqual ( codec . name , '<STR_LIT>' ) <EOL> def test_...
<s> """<STR_LIT>""" <EOL> import math <EOL> import operator <EOL> import re <EOL> import bigquery_client <EOL> import common_util as util <EOL> import ebq_crypto as ecrypto <EOL> _UNARY_OPERATORS = { <EOL> '<STR_LIT>' : lambda a : not a , <EOL> '<STR_LIT>' : operator . invert <EOL> } <EOL> _BINARY_OPERATORS = { <EOL> '...
<s> class Options : <EOL> def __init__ ( self , inline_consts = False , prune_store_loads = False , <EOL> copy_propagation = False , remove_unused_regs = False , dup2ize = False , <EOL> sort_registers = False , split_pool = False , delay_consts = False ) : <EOL> self . inline_consts = inline_consts <EOL> self . prune_s...
<s> """<STR_LIT>""" <EOL> import argparse <EOL> import json <EOL> import logging <EOL> import os <EOL> import shutil <EOL> import subprocess <EOL> import sys <EOL> import tempfile <EOL> sys . path . append ( os . path . realpath ( os . path . join ( os . path . dirname ( __file__ ) , <EOL> os . path . pardir ) ) ) <EOL...
<s> """<STR_LIT>""" <EOL> import sys <EOL> import setup_path <EOL> from admin_sdk_directory_api import users_api <EOL> from utils import admin_api_tool_errors <EOL> from utils import auth_helper <EOL> from utils import common_flags <EOL> from utils import log_utils <EOL> from utils import validators <EOL> def AddFlags ...
<s> """<STR_LIT>""" <EOL> import unittest <EOL> from directory_api_users_test_base import DirectoryApiUsersTestBase <EOL> from test_utils import GetExpectedPrintOutput <EOL> class DirectoryApiPrintUserStdoutTest ( DirectoryApiUsersTestBase ) : <EOL> """<STR_LIT>""" <EOL> def setUp ( self ) : <EOL> """<STR_LIT>""" <EOL>...
<s> __version__ = "<STR_LIT>" <EOL> import logging <EOL> try : <EOL> from logging import NullHandler <EOL> except ImportError : <EOL> class NullHandler ( logging . Handler ) : <EOL> def emit ( self , record ) : <EOL> pass <EOL> logging . getLogger ( __name__ ) . addHandler ( NullHandler ( ) ) </s>
<s> """<STR_LIT>""" <EOL> from __future__ import print_function <EOL> __author__ = '<STR_LIT>' <EOL> import argparse <EOL> import sys <EOL> from googleapiclient . errors import HttpError <EOL> from googleapiclient import sample_tools <EOL> from oauth2client . client import AccessTokenRefreshError <EOL> argparser = argp...
<s> """<STR_LIT>""" <EOL> import pprint <EOL> from googleapiclient . discovery import build <EOL> SHOPPING_API_VERSION = '<STR_LIT>' <EOL> DEVELOPER_KEY = '<STR_LIT>' <EOL> def main ( ) : <EOL> """<STR_LIT>""" <EOL> client = build ( '<STR_LIT>' , SHOPPING_API_VERSION , developerKey = DEVELOPER_KEY ) <EOL> resource = cl...
<s> """<STR_LIT>""" <EOL> __author__ = '<STR_LIT>' <EOL> import atexit <EOL> import pkg_resources <EOL> def _Call ( func , name ) : <EOL> """<STR_LIT>""" <EOL> pkg_name , resource_name = name . split ( '<STR_LIT::>' , <NUM_LIT:1> ) <EOL> return func ( pkg_name , resource_name ) <EOL> def GetResource ( name ) : <EOL> ""...
<s> """<STR_LIT>""" <EOL> from grr . lib import flags <EOL> from grr . lib import test_lib <EOL> from grr . lib . checks import checks_test_lib <EOL> from grr . parsers import linux_pam_parser <EOL> class PamConfigTests ( checks_test_lib . HostCheckTest ) : <EOL> @ classmethod <EOL> def setUpClass ( cls ) : <EOL> cls ....
<s> """<STR_LIT>""" <EOL> import os <EOL> import mock <EOL> import mox <EOL> from grr . lib import flags <EOL> from grr . lib import osx_launchd as testdata <EOL> from grr . lib import test_lib <EOL> class OSXClientTests ( test_lib . OSSpecificClientTests ) : <EOL> """<STR_LIT>""" <EOL> def setUp ( self ) : <EOL> super...
<s> """<STR_LIT>""" <EOL> __author__ = "<STR_LIT>" <EOL> import logging <EOL> from logging import handlers <EOL> from grr . client import actions <EOL> from grr . client . client_actions import tempfiles <EOL> from grr . lib import config_lib <EOL> try : <EOL> import chipsec_types <EOL> except ImportError : <EOL> from ...
<s> """<STR_LIT>""" <EOL> from grr . client . windows import installers <EOL> from grr . client . windows import regconfig </s>
<s> """<STR_LIT>""" <EOL> from grr . endtoend_tests import base <EOL> from grr . lib import aff4 <EOL> from grr . lib . rdfvalues import client as rdf_client <EOL> class TestDarwinPersistenceMechanisms ( base . AutomatedTest ) : <EOL> """<STR_LIT>""" <EOL> platforms = [ "<STR_LIT>" ] <EOL> flow = "<STR_LIT>" <EOL> test...
<s> """<STR_LIT>""" <EOL> from grr . gui import api_call_router <EOL> from grr . lib import flags <EOL> from grr . lib import test_lib <EOL> class DummyApiCallRouter ( api_call_router . ApiCallRouter ) : <EOL> """<STR_LIT>""" <EOL> @ api_call_router . Http ( "<STR_LIT:GET>" , "<STR_LIT>" ) <EOL> def SomeRandomMethod ( ...
<s> """<STR_LIT>""" <EOL> import functools <EOL> import itertools <EOL> import operator <EOL> import logging <EOL> from grr . gui import api_aff4_object_renderers <EOL> from grr . gui import api_call_handler_base <EOL> from grr . gui import api_call_handler_utils <EOL> from grr . gui import api_value_renderers <EOL> fr...
<s> """<STR_LIT>""" <EOL> from grr . gui import runtests_test <EOL> from grr . lib import flags <EOL> from grr . lib import test_lib <EOL> class TestAPIDocs ( test_lib . GRRSeleniumTest ) : <EOL> """<STR_LIT>""" <EOL> def testStatsMetricRouteIsShown ( self ) : <EOL> self . Open ( "<STR_LIT>" ) <EOL> self . WaitUntil ( ...
<s> """<STR_LIT>""" <EOL> import json <EOL> import re <EOL> from django . utils import html as django_html <EOL> from rekall import session <EOL> from rekall . ui import json_renderer <EOL> import logging <EOL> from grr . client . components . rekall_support import grr_rekall <EOL> from grr . gui import renderers <EOL>...
<s> """<STR_LIT>""" <EOL> import __builtin__ <EOL> import abc <EOL> import itertools <EOL> import StringIO <EOL> import time <EOL> import zlib <EOL> import logging <EOL> from grr . lib import access_control <EOL> from grr . lib import config_lib <EOL> from grr . lib import data_store <EOL> from grr . lib import lexer <...
<s> """<STR_LIT>""" <EOL> from grr . lib import registry <EOL> class Blobstore ( object ) : <EOL> """<STR_LIT>""" <EOL> __metaclass__ = registry . MetaclassRegistry <EOL> def StoreBlob ( self , content , token = None ) : <EOL> return self . StoreBlobs ( [ content ] , token = token ) [ <NUM_LIT:0> ] <EOL> def ReadBlob (...
<s> """<STR_LIT>""" <EOL> from grr . lib import aff4 <EOL> from grr . lib import keyword_index <EOL> from grr . lib import rdfvalue <EOL> from grr . lib import utils <EOL> from grr . lib . rdfvalues import client as rdf_client <EOL> MAIN_INDEX = rdfvalue . RDFURN ( "<STR_LIT>" ) <EOL> class ClientIndex ( keyword_index ...
<s> """<STR_LIT>""" <EOL> import shutil <EOL> from grr . lib import access_control <EOL> from grr . lib import data_store <EOL> from grr . lib import data_store_test <EOL> from grr . lib import flags <EOL> from grr . lib import test_lib <EOL> from grr . lib import utils <EOL> from grr . lib . data_stores import sqlite_...
<s> """<STR_LIT>""" <EOL> from grr . lib . flows . cron import compactors <EOL> from grr . lib . flows . cron import data_retention <EOL> from grr . lib . flows . cron import filestore_stats <EOL> from grr . lib . flows . cron import system </s>
<s> """<STR_LIT>""" <EOL> from grr . lib import aff4 <EOL> from grr . lib import flow <EOL> from grr . lib . aff4_objects import filetypes <EOL> from grr . lib . rdfvalues import structs as rdf_structs <EOL> from grr . proto import flows_pb2 <EOL> class PlistValueFilterArgs ( rdf_structs . RDFProtoStruct ) : <EOL> prot...
<s> """<STR_LIT>""" <EOL> import logging <EOL> from grr . lib import aff4 <EOL> from grr . lib import flags <EOL> from grr . lib import flow <EOL> from grr . lib import hunts <EOL> from grr . lib import queues <EOL> from grr . lib import rdfvalue <EOL> from grr . lib import test_lib <EOL> from grr . lib import utils <E...
<s> """<STR_LIT>""" <EOL> FILTERED_COUNT = <NUM_LIT> <EOL> class FakeCFDict ( object ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , value ) : <EOL> self . value = value <EOL> def __contains__ ( self , key ) : <EOL> return key in self . value <EOL> def __getitem__ ( self , key ) : <EOL> return self . value [ key ...
<s> """<STR_LIT>""" <EOL> import hashlib <EOL> import struct <EOL> from M2Crypto import BIO <EOL> from M2Crypto import EVP <EOL> from M2Crypto import RSA <EOL> from M2Crypto import util <EOL> from M2Crypto import X509 <EOL> import logging <EOL> from grr . lib import rdfvalue <EOL> from grr . lib import type_info <EOL> ...
<s> """<STR_LIT>""" <EOL> from grr . lib . rdfvalues import structs <EOL> from grr . proto import sysinfo_pb2 <EOL> class BrowserHistoryItem ( structs . RDFProtoStruct ) : <EOL> protobuf = sysinfo_pb2 . BrowserHistoryItem </s>
<s> """<STR_LIT>""" </s>
<s> """<STR_LIT>""" <EOL> import os <EOL> from grr . lib import flags <EOL> from grr . lib import test_lib <EOL> from grr . lib . rdfvalues import client as rdf_client <EOL> from grr . lib . rdfvalues import paths as rdf_paths <EOL> from grr . parsers import osx_file_parser <EOL> class TestOSXFileParsing ( test_lib . G...
<s> """<STR_LIT>""" <EOL> from BaseHTTPServer import BaseHTTPRequestHandler <EOL> from BaseHTTPServer import HTTPServer <EOL> import socket <EOL> import SocketServer <EOL> import time <EOL> import urlparse <EOL> import uuid <EOL> try : <EOL> import urllib3 <EOL> from urllib3 import connectionpool <EOL> except ImportErr...
<s> """<STR_LIT>""" <EOL> import argparse <EOL> import os <EOL> from grr . lib import access_control <EOL> from grr . lib import action_mocks <EOL> from grr . lib import aff4 <EOL> from grr . lib import data_store <EOL> from grr . lib import flags <EOL> from grr . lib import flow <EOL> from grr . lib import output_plug...
<s> """<STR_LIT>""" <EOL> import datetime <EOL> import hashlib <EOL> from optparse import OptionParser <EOL> import os <EOL> import re <EOL> import shutil <EOL> import subprocess <EOL> import sys <EOL> import urllib2 <EOL> BUILD = '<STR_LIT>' <EOL> TMPDIR = '<STR_LIT>' <EOL> TMPINDEX = os . path . join ( TMPDIR , '<STR...
<s> """<STR_LIT>""" <EOL> import os <EOL> from . import gmacpyutil <EOL> from . import defaults <EOL> from . import systemconfig <EOL> _NETWORK_SETUP = '<STR_LIT>' <EOL> _SYSTEM_PROFILER = '<STR_LIT>' <EOL> _SECURITY_TYPES = ( '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT...
<s> """<STR_LIT>""" <EOL> import db <EOL> import schema <EOL> class Error ( Exception ) : pass <EOL> class NoPrimaryKey ( Error ) : pass <EOL> class PrimaryKeyRange ( object ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , dbh , table_schema , table_name ) : <EOL> """<STR_LIT>""" <EOL> self . _dbh = dbh <EOL> self...
<s> r'''<STR_LIT>''' <EOL> import logging <EOL> from nogotofail . mitm import util <EOL> from nogotofail . mitm . connection . handlers . connection import LoggingHandler <EOL> from nogotofail . mitm . connection . handlers . connection import handlers <EOL> from nogotofail . mitm . connection . handlers . store import...
<s> r'''<STR_LIT>''' <EOL> import routing <EOL> from ca import CertificateAuthority <EOL> from ip import get_interface_addresses <EOL> from constant import Constants <EOL> from socket import close_quietly <EOL> import vuln <EOL> import http <EOL> import extras </s>
<s> r'''<STR_LIT>''' <EOL> VULN_TLS_SELF_SIGNED = "<STR_LIT>" <EOL> VULN_TLS_INVALID_HOSTNAME = "<STR_LIT>" <EOL> VULN_TLS_ANON_SERVER = "<STR_LIT>" <EOL> VULN_TLS_CLIENT_HEARTBLEED = "<STR_LIT>" <EOL> VULN_CLEARTEXT_HTTP = "<STR_LIT:http>" <EOL> VULN_CLEARTEXT_AUTH = "<STR_LIT>" <EOL> VULN_ANDROID_JAVASCRIPT_RCE = "<S...
<s> """<STR_LIT>""" <EOL> import json <EOL> import logging <EOL> import warnings <EOL> import httplib2 <EOL> from six . moves import http_client <EOL> from six . moves import urllib <EOL> from oauth2client . _helpers import _from_bytes <EOL> from oauth2client import util <EOL> from oauth2client . client import HttpAcce...
<s> import errno <EOL> import os <EOL> import sys <EOL> import tempfile <EOL> import mock <EOL> import unittest2 <EOL> from oauth2client . contrib import locked_file <EOL> class TestOpener ( unittest2 . TestCase ) : <EOL> def _make_one ( self ) : <EOL> _filehandle , filename = tempfile . mkstemp ( ) <EOL> os . close ( ...
<s> """<STR_LIT>""" <EOL> import base64 <EOL> from json import JSONEncoder <EOL> from openhtf . exe import test_state <EOL> from openhtf . util import data <EOL> class OutputToJSON ( JSONEncoder ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , filename_pattern = None , inline_attachments = True , ** kwargs ) : <EO...
<s> """<STR_LIT>""" <EOL> from openhtf . exe import phase_data <EOL> def CreateStubTest ( phases = None ) : <EOL> """<STR_LIT>""" <EOL> test_metadata = phase_data . TestMetadata ( '<STR_LIT:foo>' ) <EOL> return phase_data . phase_data ( test_metadata , phases or [ ] ) </s>
<s> """<STR_LIT>""" <EOL> import inspect <EOL> import unittest <EOL> from pinject import arg_binding_keys <EOL> from pinject import bindings <EOL> from pinject import binding_keys <EOL> from pinject import decorators <EOL> from pinject import errors <EOL> from pinject import injection_contexts <EOL> from pinject import...
<s> """<STR_LIT>""" <EOL> __author__ = '<STR_LIT>' <EOL> __copyright__ = '<STR_LIT>' <EOL> import os <EOL> import stat <EOL> import sys <EOL> import pygtrie <EOL> print '<STR_LIT>' <EOL> print '<STR_LIT>' <EOL> print <EOL> ROOT_DIR = '<STR_LIT>' <EOL> SUB_DIR = os . path . join ( ROOT_DIR , '<STR_LIT>' ) <EOL> SUB_DIRS...
<s> _GOODBYE_MESSAGE = u'<STR_LIT>' <EOL> def web_socket_do_extra_handshake ( request ) : <EOL> """<STR_LIT>""" <EOL> request . ws_extension_processors = [ ] <EOL> def web_socket_transfer_data ( request ) : <EOL> """<STR_LIT>""" <EOL> while True : <EOL> line = request . ws_stream . receive_message ( ) <EOL> if line is ...
<s> """<STR_LIT>""" <EOL> import Queue <EOL> import threading <EOL> from mod_pywebsocket import common <EOL> from mod_pywebsocket . stream import StreamHixie75 <EOL> class _MockConnBase ( object ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self ) : <EOL> self . _write_data = [ ] <EOL> self . remote_addr = '<STR_LIT>'...
<s> """<STR_LIT>""" <EOL> import difflib <EOL> import subprocess <EOL> import vim <EOL> rfmt_cmd = vim . eval ( '<STR_LIT>' ) <EOL> text = '<STR_LIT:\n>' . join ( vim . current . buffer ) <EOL> try : <EOL> p = subprocess . Popen ( rfmt_cmd , <EOL> stdout = subprocess . PIPE , stderr = subprocess . PIPE , <EOL> stdin = ...
<s> """<STR_LIT>""" <EOL> import unittest <EOL> from nototools . unittests import font_tests <EOL> import run_general_tests <EOL> FONTS = font_tests . load_fonts ( <EOL> [ '<STR_LIT>' ] , <EOL> expected_count = <NUM_LIT> ) <EOL> class TestItalicAngle ( run_general_tests . TestItalicAngle ) : <EOL> loaded_fonts = FONTS ...
<s> import sys <EOL> athresh = <NUM_LIT:100> <EOL> border = <NUM_LIT:20> <EOL> segf = sys . argv [ <NUM_LIT:1> ] <EOL> if len ( sys . argv ) > <NUM_LIT:2> : <EOL> pref = sys . argv [ <NUM_LIT:2> ] <EOL> else : <EOL> pref = '<STR_LIT>' <EOL> rects = [ ] <EOL> starts = { } <EOL> for l in file ( segf ) . xreadlines ( ) : ...
<s> """<STR_LIT>""" <EOL> import datetime <EOL> import urllib <EOL> from google . appengine . api import users <EOL> from simian import settings <EOL> from simian . mac import admin <EOL> from simian . mac import common <EOL> from simian . mac import models <EOL> from simian . mac . admin import xsrf <EOL> from simian ...
<s> """<STR_LIT>""" <EOL> import datetime <EOL> import json <EOL> import os <EOL> import urllib <EOL> from simian . mac import common <EOL> class Error ( Exception ) : <EOL> """<STR_LIT>""" <EOL> class SerializeError ( Error ) : <EOL> """<STR_LIT>""" <EOL> class DeserializeError ( Error ) : <EOL> """<STR_LIT>""" <EOL> ...
<s> """<STR_LIT>""" <EOL> import getopt <EOL> import logging <EOL> import sys <EOL> import os <EOL> sys . path . append ( '<STR_LIT>' ) <EOL> PYTHON_VERSION = '<STR_LIT>' % ( sys . version_info [ <NUM_LIT:0> ] , sys . version_info [ <NUM_LIT:1> ] ) <EOL> PYTHON_LIB_ROOT = ( <EOL> '<STR_LIT>' % PYTHON_VERSION ) <EOL> sy...
<s> """<STR_LIT>""" <EOL> import mox <EOL> import stubout <EOL> from google . apputils import app <EOL> from google . apputils import basetest <EOL> from simian . mac . common import gae_util <EOL> class GaeUtilModuleTest ( mox . MoxTestBase ) : <EOL> def setUp ( self ) : <EOL> mox . MoxTestBase . setUp ( self ) <EOL> ...
<s> """<STR_LIT>""" <EOL> import mox <EOL> import stubout <EOL> from google . apputils import app <EOL> from google . apputils import basetest <EOL> from simian . mac . munki import pkgs <EOL> class MunkiPackageInfoTest ( mox . MoxTestBase ) : <EOL> def setUp ( self ) : <EOL> mox . MoxTestBase . setUp ( self ) <EOL> se...
<s> import codecs <EOL> import os <EOL> from pkg_resources import resource_string <EOL> import re <EOL> import string <EOL> class FileParseError ( Exception ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , line_number , msg ) : <EOL> self . msg = ( "<STR_LIT>" % <EOL> ( line_number , msg ) ) <EOL> def __str__ ( se...
<s> from __future__ import absolute_import <EOL> import transitfeed <EOL> from tests import util <EOL> class AgencyValidationTestCase ( util . ValidationTestCase ) : <EOL> def runTest ( self ) : <EOL> agency = transitfeed . Agency ( name = '<STR_LIT>' , url = '<STR_LIT>' , <EOL> timezone = '<STR_LIT>' , id = '<STR_LIT>...
<s> import codecs <EOL> import cStringIO as StringIO <EOL> import csv <EOL> import os <EOL> import re <EOL> import zipfile <EOL> import gtfsfactory as gtfsfactory_module <EOL> import problems <EOL> import util <EOL> class Loader : <EOL> def __init__ ( self , <EOL> feed_path = None , <EOL> schedule = None , <EOL> proble...
<s> """<STR_LIT>""" <EOL> from vimdoc import codeline <EOL> from vimdoc import docline <EOL> from vimdoc import error <EOL> from vimdoc import regex <EOL> def IsComment ( line ) : <EOL> return regex . comment_leader . match ( line ) <EOL> def IsContinuation ( line ) : <EOL> return regex . line_continuation . match ( li...
<s> """<STR_LIT>""" <EOL> import copy <EOL> from yapf . yapflib import format_token <EOL> from yapf . yapflib import pytree_utils <EOL> from yapf . yapflib import split_penalty <EOL> from yapf . yapflib import style <EOL> _COMPOUND_STMTS = frozenset ( { '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>...
<s> """<STR_LIT>""" <EOL> import sys <EOL> import textwrap <EOL> import unittest <EOL> from yapf . yapflib import format_token <EOL> from yapf . yapflib import pytree_unwrapper <EOL> from yapf . yapflib import pytree_utils <EOL> from yapf . yapflib import pytree_visitor <EOL> from yapf . yapflib import subtype_assigner...
<s> """<STR_LIT>""" <EOL> from datetime import datetime <EOL> from googleads import adwords <EOL> def main ( client ) : <EOL> managed_customer_service = client . GetService ( <EOL> '<STR_LIT>' , version = '<STR_LIT>' ) <EOL> today = datetime . today ( ) . strftime ( '<STR_LIT>' ) <EOL> operations = [ { <EOL> '<STR_LIT>...
<s> """<STR_LIT>""" <EOL> from googleads import adwords <EOL> AD_GROUP_ID = '<STR_LIT>' <EOL> CRITERION_ID = '<STR_LIT>' <EOL> def main ( client , ad_group_id , criterion_id ) : <EOL> ad_group_criterion_service = client . GetService ( <EOL> '<STR_LIT>' , version = '<STR_LIT>' ) <EOL> operations = [ <EOL> { <EOL> '<STR_...
<s> """<STR_LIT>""" <EOL> from googleads import adwords <EOL> PAGE_SIZE = <NUM_LIT> <EOL> def main ( client ) : <EOL> media_service = client . GetService ( '<STR_LIT>' , version = '<STR_LIT>' ) <EOL> offset = <NUM_LIT:0> <EOL> selector = { <EOL> '<STR_LIT>' : [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<...
<s> """<STR_LIT>""" <EOL> from googleads import adwords <EOL> def main ( client ) : <EOL> constant_data_service = client . GetService ( <EOL> '<STR_LIT>' , version = '<STR_LIT>' ) <EOL> languages = constant_data_service . getLanguageCriterion ( ) <EOL> for language in languages : <EOL> print ( '<STR_LIT>' <EOL> % ( lan...
<s> """<STR_LIT>""" <EOL> from googleads import adwords <EOL> AD_GROUP_ID = '<STR_LIT>' <EOL> AD_ID = '<STR_LIT>' <EOL> def main ( client , ad_group_id , ad_id ) : <EOL> ad_group_ad_service = client . GetService ( '<STR_LIT>' , version = '<STR_LIT>' ) <EOL> operations = [ { <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR...
<s> """<STR_LIT>""" <EOL> from googleads import adwords <EOL> PLACEHOLDER_TYPE_SITELINKS = <NUM_LIT:1> <EOL> SITE_LINK_FIELDS = { <EOL> '<STR_LIT>' : <NUM_LIT:1> , <EOL> '<STR_LIT>' : <NUM_LIT:2> , <EOL> '<STR_LIT>' : <NUM_LIT:3> , <EOL> '<STR_LIT>' : <NUM_LIT:4> , <EOL> '<STR_LIT>' : <NUM_LIT:5> , <EOL> '<STR_LIT>' : ...
<s> """<STR_LIT>""" <EOL> import uuid <EOL> from googleads import adwords <EOL> BUDGET_ID = '<STR_LIT>' <EOL> MERCHANT_ID = '<STR_LIT>' <EOL> def main ( client , budget_id , merchant_id ) : <EOL> campaign_service = client . GetService ( '<STR_LIT>' , version = '<STR_LIT>' ) <EOL> ad_group_service = client . GetService ...
<s> """<STR_LIT>""" <EOL> from googleads import adwords <EOL> AD_GROUP_ID = '<STR_LIT>' <EOL> AD_ID = '<STR_LIT>' <EOL> def main ( client , ad_group_id , ad_id ) : <EOL> ad_group_ad_service = client . GetService ( '<STR_LIT>' , version = '<STR_LIT>' ) <EOL> operations = [ { <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR...
<s> """<STR_LIT>""" <EOL> from googleads import adwords <EOL> PAGE_SIZE = <NUM_LIT> <EOL> def main ( client ) : <EOL> media_service = client . GetService ( '<STR_LIT>' , version = '<STR_LIT>' ) <EOL> offset = <NUM_LIT:0> <EOL> selector = { <EOL> '<STR_LIT>' : [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<...
<s> """<STR_LIT>""" <EOL> from googleads import dfp <EOL> from googleads import oauth2 <EOL> CLIENT_ID = '<STR_LIT>' <EOL> CLIENT_SECRET = '<STR_LIT>' <EOL> REFRESH_TOKEN = '<STR_LIT>' <EOL> APPLICATION_NAME = '<STR_LIT>' <EOL> def main ( client_id , client_secret , refresh_token , application_name ) : <EOL> oauth2_cli...
<s> """<STR_LIT>""" <EOL> from googleads import dfp <EOL> CONTACT_ID = '<STR_LIT>' <EOL> def main ( client , contact_id ) : <EOL> contact_service = client . GetService ( '<STR_LIT>' , version = '<STR_LIT>' ) <EOL> values = [ { <EOL> '<STR_LIT:key>' : '<STR_LIT:id>' , <EOL> '<STR_LIT:value>' : { <EOL> '<STR_LIT>' : '<ST...
<s> """<STR_LIT>""" <EOL> from googleads import dfp <EOL> def main ( client ) : <EOL> custom_field_service = client . GetService ( <EOL> '<STR_LIT>' , version = '<STR_LIT>' ) <EOL> statement = dfp . FilterStatement ( ) <EOL> while True : <EOL> response = custom_field_service . getCustomFieldsByStatement ( <EOL> stateme...
<s> """<STR_LIT>""" <EOL> from googleads import dfp <EOL> def main ( client ) : <EOL> label_service = client . GetService ( '<STR_LIT>' , version = '<STR_LIT>' ) <EOL> statement = dfp . FilterStatement ( ) <EOL> while True : <EOL> response = label_service . getLabelsByStatement ( statement . ToStatement ( ) ) <EOL> if ...
<s> """<STR_LIT>""" <EOL> from googleads import dfp <EOL> PLACEMENT_ID = '<STR_LIT>' <EOL> def main ( client , placement_id ) : <EOL> placement_service = client . GetService ( '<STR_LIT>' , version = '<STR_LIT>' ) <EOL> values = [ { <EOL> '<STR_LIT:key>' : '<STR_LIT>' , <EOL> '<STR_LIT:value>' : { <EOL> '<STR_LIT>' : '...