code stringlengths 1 199k |
|---|
from abjad.tools import mathtools
def join_subsequences_by_sign_of_elements(sequence):
'''Join subsequences in `sequence` by sign of elements.
::
>>> sequence = [[1, 2], [3, 4], [-5, -6, -7], [-8, -9, -10], [11, 12]]
>>> sequencetools.join_subsequences_by_sign_of_elements(sequence)
[[1, ... |
from jedi.inference.cache import inference_state_method_cache
from jedi.inference.filters import DictFilter
from jedi.inference.names import ValueNameMixin, AbstractNameDefinition
from jedi.inference.base_value import Value
from jedi.inference.value.module import SubModuleDictMixin
from jedi.inference.context import Na... |
"""Import all the autofixes defined in settings.
Note, unlike checks, using a sortable data object so fixes are applied in desired order.
"""
from weblate.utils.classloader import ClassLoader
AUTOFIXES = ClassLoader("AUTOFIX_LIST")
def fix_target(target, unit):
"""Apply each autofix to the target translation."""
... |
"""
Copyright (C) 2009 Sergey Koposov
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distr... |
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from builtins import * # noqa
import contextlib
from nose.tools import eq_, ok_
from mock import patch
from ycm.tests.test_utils import MockVimModule
vim_mock = MockVimMo... |
""" CSAPI exposes update functionalities to the Configuration.
Most of these functions can only be done by administrators
"""
from DIRAC import gLogger, gConfig, S_OK, S_ERROR
from DIRAC.Core.DISET.RPCClient import RPCClient
from DIRAC.Core.Utilities import List, Time
from DIRAC.Core.Security.X509Chain import X509C... |
import logging
from coilsnake.model.eb.table import eb_table_from_offset
from coilsnake.modules.eb.EbModule import EbModule
from coilsnake.util.common.yml import yml_load
from coilsnake.util.eb.pointer import write_asm_pointer, from_snes_address, to_snes_address
class AsmPointer(object):
def __init__(self, offset):... |
import os
import logging
import sys
import socket
import platform
if os.name != 'nt':
import pwd
import psutil
import datetime
import time
import json
import cherrypy
import bin.shngversion as shngversion
from lib.shpypi import Shpypi
from lib.shtime import Shtime
from lib.utils import Utils
import lib.config
impor... |
import logging
from typing import Any, Dict
logger = logging.getLogger(__name__)
def start_trading(args: Dict[str, Any]) -> int:
"""
Main entry point for trading mode
"""
# Import here to avoid loading worker module when it's not used
from freqtrade.worker import Worker
# Create and run worker
... |
from sdl2.ext import Resources, \
Entity
from components.frames import Frames
from components.motion import MotionType
from components.facing import Facing
from components.velocity import Velocity
RESOURCES = Resources(__file__, 'resources')
class Player(Entity):
def __init__(self, world, sprite, posx=0, posy=0... |
cats = 2 # A single equal sign ( = ),
tuna = 3 # is used to set a variable to a
salmon = 4 # new value.
lobster = 1.0 # cats, tuna and salmon are integers (int), lobster is float (real) number
prawn = 10
cats_ate_fish = tuna + salmon # variable name can not contain spaces, use underscore instead
s... |
import account_invoice_seq_number |
from urllib.parse import urljoin
CACHE_PATH = []
def version_cache_buster(request, subpath, kw):
# TODO get cache version from server caching?
cache_version = request.registry.settings.get('cache_version')
return urljoin(cache_version + '/', subpath), kw
class CachebusterTween:
''' Get back the cachebus... |
from django.db import models |
# Copyright (c) 2011, 2012 Free Software Foundation
"""XML-RPC methods of Gstudio metaWeblog API"""
import os
from datetime import datetime
from xmlrpclib import Fault
from xmlrpclib import DateTime
from django.conf import settings
from django.contrib.auth.models import User
from django.contrib.sites.models import Si... |
__author__ = 'Team Machine'
import arrow
import riak
import uuid
import logging
import ujson as json
from riak.datatypes import Map
from schematics import models
from schematics import types
from schematics.types import compound
class Team(models.Model):
'''
(ORG) Team
'''
uuid = types.UUIDType(defau... |
import os
import shutil
from unittest import mock
import superdesk.commands.data_updates
from superdesk import get_resource_service
from superdesk.commands.data_updates import (
get_data_updates_files, GenerateUpdate, Upgrade, Downgrade
)
from superdesk.tests import TestCase
DEFAULT_DATA_UPDATE_DIR_NAME = '/tmp/dat... |
"""Send messages to Principals."""
from copy import copy
from collections.abc import Sequence
from logging import getLogger
from urllib.request import quote
from pyramid.registry import Registry
from pyramid.renderers import render
from pyramid_mailer.interfaces import IMailer
from pyramid_mailer.message import Message... |
{
'name': 'Pentaho res.partner report sample',
'version': '1.0',
'category': 'Reporting subsystems',
'sequence': 14,
'summary': '',
'description': """
Titile of pentaho res.partner report sample
===========================================
This is a sample of a pentaho report using a custom wizar... |
{
'name': 'Purchase Procurement Analytic',
'summary': 'This module sets analytic account in purchase order line from '
'procurement analytic account',
'version': '8.0.1.0.0',
'category': 'Analytic',
'license': 'AGPL-3',
'author': "Tecnativa, "
"Odoo Community Associa... |
import os
from json import loads
from .subjectcodes import get_parent_subjectcode
import logging
logger = logging.getLogger(__name__)
class MediaTopicsIndex:
def __init__(self):
# A map for mapping from an IPTC subject code to a Media Topic
self.subject_media_topic_map = dict()
# A map for m... |
from django.test import TestCase
from cl.corpus_importer.dup_helpers import case_name_in_candidate
from cl.corpus_importer.lawbox.import_law_box import get_docket_number
from cl.corpus_importer.lawbox.judge_extractor import get_judge_from_str, REASONS
class DocketNumberTest(TestCase):
def test_extracting_docket_num... |
from __future__ import unicode_literals, print_function, absolute_import
import logging
import shutil
import os
import time
import locale
from sys import platform
from tempfile import mkdtemp
import pytz
from pelican.generators import TemplatePagesGenerator
from pelican.writers import Writer
from pelican.settings impor... |
import sale
import l10n_br_delivery
import delivery
import account_invoice
import stock |
import os, re, sys, subprocess, shutil, tempfile, commands, signal
import time, datetime
import errno, socket
import xml.dom.minidom
import scsiutil
import statvfs
import stat
import xs_errors
import XenAPI,xmlrpclib
import base64
import syslog
import resource
import exceptions
import traceback
import glob
import copy
... |
from spack import *
class Jellyfish(AutotoolsPackage):
"""JELLYFISH is a tool for fast, memory-efficient counting of k-mers in
DNA."""
homepage = "http://www.cbcb.umd.edu/software/jellyfish/"
url = "https://github.com/gmarcais/Jellyfish/releases/download/v2.2.7/jellyfish-2.2.7.tar.gz"
list_u... |
def run(options, configure, input_files, extra_args=None, filters=None, accepted_errors=None):
import os
import sys
import inspect
import shlex
import subprocess
from .exceptions import TestFailedError, BadFilterError, FilterKeywordError
from .copy import copy_path
from .check import che... |
import sys
from services.spawn import MobileTemplate
from services.spawn import WeaponTemplate
from resources.datatables import WeaponType
from resources.datatables import Difficulty
from resources.datatables import Options
from java.util import Vector
def addTemplate(core):
mobileTemplate = MobileTemplate()
mobileTe... |
"""
Parses replies from the control socket.
**Module Overview:**
::
convert - translates a ControlMessage into a particular response subclass
ControlMessage - Message that's read from the control socket.
|- SingleLineResponse - Simple tor response only including a single line of information.
|
|- from_s... |
"""Integration tests for :func:`iris.fileformats.rules.load_cubes`."""
import iris.tests as tests
import iris
from iris.fileformats import pp
from iris.fileformats.pp_load_rules import convert
from iris.fileformats.rules import load_cubes
class Test(tests.IrisTest):
@tests.skip_data
def test_pp_with_stash_const... |
import sys
sys.path.insert(0, "../")
from osa.wsdl import *
from osa.method import *
from osa.message import *
from osa.xmltypes import *
from tests.base import BaseTest
import xml.etree.cElementTree as etree
import unittest
wsdl_url = 'test.wsdl'
ns1 = "de.mpg.ipp.hgw.boz.gsoap.helloworld"
ns2 = "de.mpg.ipp.hgw.boz.gs... |
from __future__ import unicode_literals
import re
import json
import random
import string
from .common import InfoExtractor
from ..utils import find_xpath_attr
class HowStuffWorksIE(InfoExtractor):
_VALID_URL = r'https?://[\da-z-]+\.howstuffworks\.com/(?:[^/]+/)*\d+-(?P<id>.+?)-video\.htm'
_TESTS = [
{
... |
from __future__ import absolute_import, division, print_function, unicode_literals
class AddressLookupError(Exception):
"""Raised by various modules when an address can't be resolved. Use this common base class so
other modules can trap the error at each node along the path and construct a useful diagnostic.
:A... |
from dockerspawner import DockerSpawner
from jupyter_client.localinterfaces import public_ips
from tornado import gen
import base64, os
import os.path, pwd
import socket, random, errno
class _Spawner(DockerSpawner):
def _volumes_to_binds(self, *args, **kwargs):
binds = super(_Spawner, self)._volumes_to_bind... |
"""C interfacing code.
This namespace contains everything that interacts with C code.
Most TVM C related object are ctypes compatible, which means
they contains a handle field that is ctypes.c_void_p and can
be used via ctypes function calls.
Some performance critical functions are implemented by cython
and have a ctyp... |
'''
Created on 26 Oct 2015
@author: Ruben.Alonso
@Description: Module created to manage all different errors and exceptions.
'''
import utils.logger.handler as LH
class Error(Exception):
"""Base class for exceptions in this module."""
pass
class InputError(Error):
"""Exception raised for errors in the input... |
import pytest
from django.conf import settings
from django.core.exceptions import ValidationError
from rest_framework.exceptions import \
ValidationError as RestFameworkValidationError
from ..models import Condition
from ..serializers.v1 import ConditionSerializer
from ..validators import ConditionUniqueURIValidato... |
"""A handler that provides an interactive console."""
import threading
from google.appengine.tools.devappserver2 import server
from google.appengine.tools.devappserver2.admin import admin_request_handler
class ConsoleRequestHandler(admin_request_handler.AdminRequestHandler):
"""Provides an interactive console for ser... |
import os
import cv2
import numpy as np
import math
from SmithWaterman import *
from GetCandidateMatchSet import *
from merge import *
from transform import *
from GetMergedImage import *
from Fragment import *
from config import *
from Image import *
from transform import *
import random
from GetThreshold import *
res... |
"""Spanner read-write transaction support."""
from google.cloud.proto.spanner.v1.transaction_pb2 import TransactionSelector
from google.cloud.proto.spanner.v1.transaction_pb2 import TransactionOptions
from google.cloud._helpers import _pb_timestamp_to_datetime
from google.cloud.spanner._helpers import _options_with_pre... |
from __future__ import absolute_import
import six.moves.configparser as ConfigParser
import datetime
import json
import re
import requests
import warnings
try:
import keyring
except ImportError:
keyring = None
import pyrax
from pyrax import exceptions as exc
from .resource import BaseResource
from . import util... |
"""
The class task_gen encapsulates the creation of task objects (low-level code)
The instances can have various parameters, but the creation of task nodes (Task.py)
is delayed. To achieve this, various methods are called from the method "apply"
The class task_gen contains lots of methods, and a configuration table:
* ... |
import sys, os, traceback, optparse
import time
import re
import requests
from bs4 import BeautifulSoup
import csv
f_SC = open(r'D:\Web_Crawler\f_SC.txt', 'r')
f_NF = open(r'D:\Web_Crawler\f_NF.txt', 'r')
f_NOTL = open(r'D:\Web_Crawler\F_NOTL.txt', 'r')
f_SC_new = open(r'D:\Web_Crawler\f_SC_new.txt', 'w')
f_NF_new = op... |
from Pegasus.api import *
wf = Workflow("sleep-wf")
sleep_1 = Job("sleep").add_args(2)
sleep_2 = Job("sleep").add_args(2)
wf.add_jobs(sleep_1, sleep_2)
wf.add_dependency(job=sleep_1, children=[sleep_2])
wf.write(file="inner_sleep_workflow.yml") |
"""mixup: Beyond Empirical Risk Minimization.
Adaption to SSL of MixUp: https://arxiv.org/abs/1710.09412
"""
import functools
import os
from absl import app
from absl import flags
from easydict import EasyDict
from libml import data, utils, models
import tensorflow as tf
FLAGS = flags.FLAGS
class Mixup(models.MultiMode... |
__author__ = 'mariosky'
import json
import os
import time
from redis_cola import Cola, Task
server = Cola("python")
code = """
def suma(a,b):
print a,b
return a+b
"""
test = '''
class TestExcercise(unittest.TestCase):
def test_Action(self):
"""Debes sumar mal"""
self.assertEqual(suma( 1,... |
import errno
import os
import re
import subprocess
import sys
def get_keywords():
# these strings will be replaced by git during git-archive.
# setup.py/versioneer.py will grep for the variable names, so they must
# each be defined on a line of their own. _version.py will just call
# get_keywords().
... |
"""Handles function calls, by generating compiled function names and calls."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import types
import gast
from tensorflow.contrib.py2tf.pyct import anno
from tensorflow.contrib.py2tf.pyct import templates
class Fu... |
from builtins import bytes
import logging
import subprocess
from subprocess import STDOUT
from airflow.models import BaseOperator
from airflow.utils import apply_defaults
from airflow.utils import AirflowException
class SSHTempFileContent():
"""This class prvides a functionality that creates tempfile
with given... |
from oslo_log import log as logging
import six
from heat.common.i18n import _LI
from heat.engine import dependencies
from heat.engine import resource
from heat.engine import scheduler
from heat.objects import resource as resource_objects
LOG = logging.getLogger(__name__)
class StackUpdate(object):
"""
A Task to... |
import requests
from framework.auth import Auth
from addons.wiki.models import WikiPage
from website import settings
from osf.models import MailRecord
from api.base.utils import waterbutler_api_url_for
from website.exceptions import NodeStateError
from django.core.exceptions import ValidationError
from django.core.vali... |
from _Framework.ChannelStripComponent import ChannelStripComponent
TRACK_FOLD_DELAY = 5
class SpecialChannelStripComponent(ChannelStripComponent):
' Subclass of channel strip component using select button for (un)folding tracks '
__module__ = __name__
def __init__(self):
ChannelStripComponent.__init... |
from collections import OrderedDict
import argparse
import httplib
import json
import os.path
import sys
import time
ADMIN_FILE_TIMEOUT_SECS = 20
def GenerateNewConfig(original_json, admin_address, updated_json):
# Get original listener addresses
with open(original_json, 'r') as original_json_file:
# Import ori... |
import os
from mock import patch
from oslo.config import cfg
import webob.exc
import neutron.common.test_lib as test_lib
from neutron.extensions import portbindings
from neutron.manager import NeutronManager
from neutron.tests.unit import _test_extension_portbindings as test_bindings
import neutron.tests.unit.test_db_p... |
"""Tests for the Yeelight integration."""
import asyncio
from datetime import timedelta
from ipaddress import IPv4Address
from unittest.mock import AsyncMock, MagicMock, patch
from async_upnp_client.search import SsdpSearchListener
from yeelight import BulbException, BulbType
from yeelight.main import _MODEL_SPECS
from... |
import functools
import sys
from django.utils.translation import ugettext_lazy as _
import horizon
from manila_ui.api import manila
from openstack_dashboard.api import base
from openstack_dashboard.dashboards.admin.defaults import tables as quota_tbl
from openstack_dashboard.dashboards.admin.defaults import views \
... |
import uuid
from tempest.api.hybrid_cloud.volume import base
from tempest.common.utils import data_utils
from tempest.common import waiters
from tempest.lib import exceptions as lib_exc
from tempest import test
class VolumesV2NegativeTest(base.BaseVolumeTest):
@classmethod
def setup_clients(cls):
super(... |
import logging
import json
from django.http import HttpResponse, HttpResponseBadRequest, \
HttpResponseRedirect
from django.shortcuts import render, Http404
from django.urls import reverse
from django.core.exceptions import ObjectDoesNotExist
from django.forms.models import modelformset_factory
from django.contrib ... |
''' submit.py '''
import glob
import logging
import os
import tempfile
import requests
import subprocess
import urlparse
from heron.common.src.python.utils.log import Log
from heron.proto import topology_pb2
from heron.tools.cli.src.python.result import SimpleResult, Status
import heron.tools.cli.src.python.args as cli... |
ACCOUNT_NAME = 'John Lewis' |
"""Tests for wrapping an eager op in a call op at runtime."""
import time
from tensorflow.python.data.ops import dataset_ops
from tensorflow.python.eager import benchmarks_test_base
from tensorflow.python.eager import context
from tensorflow.python.eager import test
from tensorflow.python.framework import constant_op
f... |
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import os
from pants.backend.jvm.tasks.jvmdoc_gen import Jvmdoc, JvmdocGen
from pants.java.distribution.distribution import DistributionLocator
from pants.java.executor... |
def extract_logger_level(logger_name, list_jsons):
print("Extracting logger level for {}".format(logger_name))
try:
list_jsons = eval(list_jsons)
if not isinstance(list_jsons, list):
print("Given object is not instance of list.")
return None
except SyntaxError:
... |
from datetime import datetime
import doctest
import os
import os.path
import shutil
from StringIO import StringIO
import time
import tempfile
import threading
import unittest
import urlparse
from couchdb import client, http
from couchdb.tests import testutil
class ServerTestCase(testutil.TempDatabaseMixin, unittest.Tes... |
"""Implementation of an image service that uses Glance as the backend"""
from __future__ import absolute_import
import copy
import datetime
import json
import random
import time
from urlparse import urlparse
from glance.common import exception as glance_exception
from nova import exception
from nova import flags
from n... |
"""
jbmst_search_jsp.py
Created on 2013/06/28
Copyright (C) 2011-2013 Nippon Telegraph and Telephone Corporation
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/LI... |
import datetime
import re
from flask import abort
from flask import current_app as app
from flask import redirect, request, session, url_for
from CTFd.cache import cache
from CTFd.constants.teams import TeamAttrs
from CTFd.constants.users import UserAttrs
from CTFd.models import Fails, Teams, Tracking, Users, db
from C... |
"""
Project name: Open Methodology for Security Tool Developers
Project URL: https://github.com/cr0hn/OMSTD
Copyright (c) 2014, cr0hn<-AT->cr0hn.com
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
1. Redi... |
import argparse
import base64
import re
import logging
import time
from hashlib import sha1
from urlparse import parse_qs
from Cookie import SimpleCookie
import os
from saml2 import server
from saml2 import BINDING_HTTP_ARTIFACT
from saml2 import BINDING_URI
from saml2 import BINDING_PAOS
from saml2 import BINDING_SOAP... |
"""Original NetworkX graph tests"""
import copy
from nose.tools import *
import networkx
import networkx as nx
from networkx import convert_node_labels_to_integers as cnlti
from historical_tests import HistoricalTests
class TestGraphHistorical(HistoricalTests):
def setUp(self):
HistoricalTests.setUp(self)
... |
import os
from prequ._pip_compat import (
create_package_finder, install_req_from_editable, install_req_from_line)
from prequ.exceptions import (
IncompatibleRequirements, NoCandidateFound, UnsupportedConstraint)
from .dirs import FAKE_PYPI_WHEELS_DIR
from .test_repositories import get_pypi_repository
try:
... |
"""
This module contains some relatively quick tests that don't load any
fixtures.
To run only this test::
$ go min1
$ python manage.py test
"""
from django.conf import settings
from django.core.exceptions import ValidationError
from django.utils import translation
from atelier.test import TestCase
from django.cont... |
from django.conf.urls import url
from .views import (ReportCreateView, ReportListView,
ReportDetailView, ReportCloseView)
urlpatterns = [
url('^reports/(?P<pk>\d+)/create/$',
ReportCreateView.as_view(),
name='report_create'),
url('^reports/(?P<pk>\d+)/detail/$',
Repor... |
from django.conf import settings
from . import __title__
NAME_FEED_AUTHOR_NAME = getattr(settings, 'NAME_FEED_AUTHOR_NAME', __title__)
NAME_FEED_AUTHOR_EMAIL = getattr(settings, 'NAME_FEED_AUTHOR_EMAIL', None)
NAME_FEED_AUTHOR_LINK = getattr(settings, 'NAME_FEED_AUTHOR_LINK', None)
NAME_APP_TITLE = getattr(settings, 'N... |
from recipe_engine import post_process
from PB.go.chromium.org.luci.swarming.proto.api import swarming as swarming_pb
from PB.recipe_modules.recipe_engine.led import properties as led_properties_pb
PYTHON_VERSION_COMPATIBILITY = 'PY2+3'
DEPS = [
'tryserver',
'recipe_engine/buildbucket',
'recipe_engine/prope... |
__author__ = "ohenry"
__date__ = "2017-09-28 16:06"
__version__ = "1.1"
__all__ = ['TimeToDecimalYear']
import egads.core.egads_core as egads_core
import egads.core.metadata as egads_metadata
import egads
class TimeToDecimalYear(egads_core.EgadsAlgorithm):
"""
FILE time_to_decimal_year.py
VERSION ... |
from __future__ import division, print_function, absolute_import
from warnings import warn
import numpy as np
from numpy import asarray, empty, ravel, nonzero
from scipy.sparse import (isspmatrix_csc, isspmatrix_csr, isspmatrix,
SparseEfficiencyWarning, csc_matrix)
from . import _superlu
noSci... |
import abc
from collections import defaultdict, OrderedDict
import numpy as np
from .utils import deserialize_class
__all__ = ['BaseHighLevelWCS', 'HighLevelWCSMixin']
def rec_getattr(obj, att):
for a in att.split('.'):
obj = getattr(obj, a)
return obj
def default_order(components):
order = []
f... |
import functools
import itertools
import operator
import sys
import warnings
import numbers
import numpy as np
from . import multiarray
from .multiarray import (
_fastCopyAndTranspose as fastCopyAndTranspose, ALLOW_THREADS,
BUFSIZE, CLIP, MAXDIMS, MAY_SHARE_BOUNDS, MAY_SHARE_EXACT, RAISE,
WRAP, arange, arra... |
import io
import os
import stat
import sys
import shutil
import re
import subprocess as sp
from copy import deepcopy
try:
from nbformat import read, write
from nbconvert.preprocessors import ClearOutputPreprocessor
except ImportError:
print("Warning: nbformat and/or nbconvert could not be imported, some tas... |
from master import gitiles_poller
def Update(config, active_master, c):
master_poller = gitiles_poller.GitilesPoller(
'https://chromium.googlesource.com/chromium/src')
c['change_source'].append(master_poller) |
cfg={} # Will be updated by CK (meta description of this module)
work={} # Will be updated by CK (temporal data)
ck=None # Will be updated by CK (initialized CK kernel)
def init(i):
"""
Input: {}
Output: {
return - return code = 0, if successful
... |
from . import util
def compile_fn(api, checkout_root, out_dir):
skia_dir = checkout_root.join('skia')
configuration = api.vars.builder_cfg.get('configuration')
target_arch = api.vars.builder_cfg.get('target_arch')
# TODO(kjlubick): can this toolchain be replaced/shared with chromebook?
toolchain_dir = ... |
from pymel.all import * # safe to import into main namespace
s = polySphere()[0] # second in list is the history node, if construction history is on
c = polyCube()[0]
print c, s
c.setTranslation( [0,2,0] )
s.setTranslation( [1,-2,0] )
g = group( s, c, n='newGroup' )
print "The children of %s are %s" % (g, g.getChi... |
import warnings
from django.template.base import TemplateSyntaxError
from django.template.loader import get_template
from django.test import SimpleTestCase
from django.utils.deprecation import RemovedInDjango20Warning
from ..utils import render, setup
class FirstOfTagTests(SimpleTestCase):
@setup({'firstof01': '{% ... |
"""A simple host test module.
This module runs on the host machine and is responsible for creating 2
task machines, waiting for them, and running RPC calls on them.
"""
import sys
sys.path.append('../../')
import argparse
import logging
import time
import test_controller
class ExampleTestController(test_controller.Test... |
from __future__ import division, absolute_import, print_function
from numpy.testing import *
import numpy.distutils.fcompiler
g77_version_strings = [
('GNU Fortran 0.5.25 20010319 (prerelease)', '0.5.25'),
('GNU Fortran (GCC 3.2) 3.2 20020814 (release)', '3.2'),
('GNU Fortran (GCC) 3.3.3 20040110 (prereleas... |
"""Unit tests for error_handlers.py."""
import unittest
from webkitpy.style.checker import StyleProcessorConfiguration
from webkitpy.style.error_handlers import DefaultStyleErrorHandler
from webkitpy.style.filter import FilterConfiguration
class DefaultStyleErrorHandlerTest(unittest.TestCase):
"""Tests the DefaultS... |
"""
=============
TAP plus
=============
@author: Juan Carlos Segovia
@contact: juan.carlos.segovia@sciops.esa.int
European Space Astronomy Centre (ESAC)
European Space Agency (ESA)
Created on 30 jun. 2016
"""
import os
import pytest
from astroquery.utils.tap.model.job import Job
from astroquery.utils.tap.conn.tests.Du... |
"""Django settings for CAPCollector project."""
__author__ = "arcadiy@google.com (Arkadii Yakovets)"
import os
import sys
from sensitive import *
from settings_prod import *
SITE_URL = SITE_SCHEME + "://" + SITE_DOMAIN
CAP_SCHEMA_FILE = "cap1.2.xsd"
CAP_NS = "urn:oasis:names:tc:emergency:cap:1.2"
CERT_NS = "http://www.... |
"""
This software was developed by the University of Tennessee as part of the
Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
project funded by the US National Science Foundation.
See the license text in license.txt
copyright 2009, University of Tennessee
"""
import wx
import sys
CHILD_FRAME = wx.MD... |
from test.support import verbose, is_android, check_warnings
import unittest
import locale
import sys
import codecs
class BaseLocalizedTest(unittest.TestCase):
#
# Base class for tests using a real locale
#
@classmethod
def setUpClass(cls):
if sys.platform == 'darwin':
import os
... |
from __future__ import print_function
__author__ = 'Daan Wierstra and Tom Schaul'
from scipy import dot, argmax
from random import shuffle
from math import isnan
from pybrain.supervised.trainers.trainer import Trainer
from pybrain.utilities import fListToString
from pybrain.auxiliary import GradientDescent
class Backpr... |
import sys, os
import mysql.connector
"""
Example using MySQL Connector/Python showing:
* the usefulness of unicode, if it works correctly..
* dropping and creating a table
* inserting and selecting a row
"""
info = """
For this to work you need to make sure your terminal can output
unicode character correctly. Check i... |
"""
Introduction to lamba syntax and simple use cases. Open up an interpreter
and play around. This is forming the building blocks to do some useful things
later on.
"""
def increment_func(x):
return x + 1
increment_lambda = lambda x: x + 1
val = 40
print 'increment_func(val)=', increment_func(val)
print 'increme... |
from decimal import *
from math import ceil, floor, log
from subprocess import PIPE, Popen
if __name__ == "__main__":
"""
http://secgroup.dais.unive.it/wp-content/uploads/2012/11/Practical-Padding-Oracle-Attacks-on-RSA.html
"""
n = 120357855677795403326899325832599223460081551820351966764960386843755808... |
"""This module contains an object that represents a Telegram Voice."""
from telegram import TelegramObject
class Voice(TelegramObject):
"""This object represents a Telegram Voice.
Attributes:
file_id (str):
duration (int):
mime_type (str):
file_size (int):
Args:
file_... |
"""
pyboard interface
This module provides the Pyboard class, used to communicate with and
control the pyboard over a serial USB connection.
Example usage:
import pyboard
pyb = pyboard.Pyboard('/dev/ttyACM0')
pyb.enter_raw_repl()
pyb.exec('pyb.LED(1).on()')
pyb.exit_raw_repl()
To run a script from t... |
""" generic mechanism for marking and selecting python functions. """
import pytest, py
def pytest_namespace():
return {'mark': MarkGenerator()}
def pytest_addoption(parser):
group = parser.getgroup("general")
group._addoption('-k',
action="store", dest="keyword", default='', metavar="KEYWORDEXPR",
... |
from bs4 import BeautifulSoup
from urllib2 import urlopen
from datetime import datetime
import csv
import sys
import os
import smtplib
import config
BASE_URL = ('http://chicago.craigslist.org/search/'
'?sort=rel&areaID=11&subAreaID=&query={0}&catAbb=sss')
def parse_results(search_term):
results = []
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.