content string |
|---|
import qm
import qm.test.runnable
########################################################################
# Classes
########################################################################
class Resource(qm.test.runnable.Runnable):
"""A 'Resource' sets up before a test and cleans up afterwards.
Some tests t... |
# -*- coding: utf-8 -*-
"""
1D-asthenospheric-counterflow.py
A script for plotting velocity magnitudes for 1D counterflow in the
asthenosphere.
dwhipp 01.16
"""
#--- User-defined input variables
hl = 100.0 # Thickness of lithosphere [km]
h = 200.0 ... |
import math
def hello():
ret_string = "This is the explosion math package! Some help info is below."
print(ret_string)
def general_bomb_equation(mass_kg, radius_m):
"""
General Sadovsky bomb overpressure equation, surface explosion at standard atmospheric condidtions.
:param mass_kg: Mass in k... |
import sys
import numpy as np
import os
from os import path
class DependencyWriter:
"""
Dependency writer class
"""
def __init__(self):
pass
def save(self, language, heads_pred):
"""Saves predicted dependency trees."""
base_deppars_dir = path.join(path.dirname(__file__), ... |
import oemedical_gynecology_and_obstetrics
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
from dependencies.dependency import ClassSecurityInfo
from dependencies.dependency import registerWidget
from dependencies.dependency import TypesWidget
from dependencies.dependency import getToolByName
from lims.browser import BrowserView
from lims import bikaMessageFactory as _
from lims.utils import t
from lims.brow... |
from __future__ import unicode_literals
import os
import re
from unittest import skipUnless
from django.contrib.gis.gdal import HAS_GDAL
from django.contrib.gis.geos import HAS_GEOS
from django.test import TestCase, ignore_warnings, skipUnlessDBFeature
from django.utils._os import upath
from django.utils.deprecation ... |
__doc__="""
DaetTools model that describes the behavior of a water flowing in a pipe with the effect of biofim formation.
"""
from daetools.pyDAE import *
from daetools_extended.daemodel_extended import daeModelExtended
from pyUnits import m, kg, s, K, Pa, J, W, rad
from water_properties import density, viscosity, c... |
"""Utilities related to disk I/O."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from collections import defaultdict
import numpy as np
import six
from tensorflow.python.util.tf_export import keras_export
try:
import h5py
except ImportError:
h5py ... |
# encoding: utf-8
"""
change.py
Created by Thomas Mangin on 2009-11-05.
Copyright (c) 2009-2017 Exa Networks. All rights reserved.
License: 3-clause BSD. (See the COPYRIGHT file)
"""
class Source(object):
UNSET = 0
CONFIGURATION = 1
API = 2
NETWORK = 3
class Change(object):
SOURCE = Source.UNSE... |
# same as pipe1.py, but wrap pipe input in stdio file object
# to read by line, and close unused pipe fds in both processes
import os, time
def child(pipeout):
zzz = 0
while True:
time.sleep(zzz) # make parent wait
msg = ('Spam %03d\n' % zzz).encode() # pi... |
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
from ansible.errors import AnsibleParserError
from ansible.parsing.splitter import split_args, parse_kv
from ansible.parsing.yaml.objects import AnsibleBaseYAMLObject, AnsibleMapping
from ansible.playbook.attribute impor... |
#!/usr/bin/env python
'''
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License")... |
from django.conf.urls import url
from django.contrib.admindocs import views
urlpatterns = [
url(r'^$',
views.BaseAdminDocsView.as_view(template_name='admin_doc/index.html'),
name='django-admindocs-docroot'),
url(r'^bookmarklets/$',
views.BookmarkletsView.as_view(),
name='django-... |
from django.db import models
class ThingItem(object):
def __init__(self, value, display):
self.value = value
self.display = display
def __iter__(self):
return (x for x in [self.value, self.display])
def __len__(self):
return 2
class Things(object):
def __iter__(se... |
from __future__ import absolute_import
from __future__ import print_function
import numpy as np
np.random.seed(1337) # for reproducibility
from keras.datasets import mnist
from keras.models import Sequential
from keras.layers.core import Dense, Activation
from keras.initializations import normal, identity
from keras.... |
import sendmail
import sys
import subprocess
import tempfile
import config
import socket
import os
try:
hostname = socket.gethostbyaddr(socket.gethostname())[0]
except:
try:
hostname = os.uname()[0]
except:
hostname = "unknown"
cmd = ' '.join(sys.argv[1:])
OUT=open('out.txt', 'w')
ER... |
from django.contrib.gis.geos import GEOSGeometry, LinearRing, Polygon, Point
from django.contrib.gis.maps.google.gmap import GoogleMapException
from math import pi, sin, log, exp, atan
# Constants used for degree to radian conversion, and vice-versa.
DTOR = pi / 180.
RTOD = 180. / pi
class GoogleZoom(object):
"""... |
"""Functionality for loading events from a record file."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from tensorflow.core.util import event_pb2
from tensorflow.python import pywrap_tensorflow
from tensorflow.python.framework import errors
from tensorfl... |
"""
Webcore is a basic web server framework based on the SocketServer-based
BaseHTTPServer that comes with Python. The big difference is that this
one can carve up URL-space by prefix, such that "/foo/*" gets handled by
a different request handler than "/bar/*". I refer to this as "splitting".
You should also be abl... |
import scipy.optimize as opt
import birch_murnaghan as bm
import debye
import numpy as np
from equation_of_state import equation_of_state
import warnings
import matplotlib.pyplot as plt
class slb_base(equation_of_state):
"""
Base class for the finite strain-Mie-Grueneiesen-Debye equation of state detailed
... |
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import re
from ansible.errors import AnsibleConnectionFailure
from ansible.plugins.terminal import TerminalBase
class TerminalModule(TerminalBase):
terminal_stdout_re = [
re.compile(br"[\r\n](?:! )?(?:\* )?(?:\(.*\)... |
from __future__ import with_statement
from google.appengine.api import files, images
from google.appengine.ext import blobstore, deferred
from google.appengine.ext.webapp import blobstore_handlers
import json
import re
import urllib
import webapp2
WEBSITE = 'https://blueimp.github.io/jQuery-File-Upload/'
MIN_FILE_SIZE... |
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.db.backends.postgresql_psycopg2.creation import DatabaseCreation
from django.utils.functional import cached_property
class PostGISCreation(DatabaseCreation):
geom_index_type = 'GIST'
geom_index_ops = 'GIST_GEO... |
from __future__ import with_statement
import collections
import errno
import filecmp
import os.path
import re
import tempfile
import sys
# A minimal memoizing decorator. It'll blow up if the args aren't immutable,
# among other "problems".
class memoize(object):
def __init__(self, func):
self.func = func
s... |
import urllib2
from bs4 import BeautifulSoup as Soup
from urlparse import urlparse, urljoin
### URL's Retriever
def retrieve_links (url):
"""This function retrieve links from the URL provided
The URL must be in any of these formats:
http://
"""
opener = urllib2.build_opener ()
try:
t = opener.open... |
import unittest
import tempfile
import uuid
import os
import platform
import pkg_resources
from build_with_buck import *
XCODE_DWARF = "dwarf"
XCODE_DSYM = "dwarf-with-dsym"
class TestBuildWithBuck(unittest.TestCase):
def run_with_data(self,
platform_name,
archs,
... |
#!/usr/bin/env python3
import sys
import os
import tempfile
import json
from subprocess import call
import github
import reddit
def _get_settings():
main_dir = os.path.dirname(os.path.realpath(__file__))
settings = None
settings_filename= os.path.join(main_dir, 'settings.json')
if os.path.exists(se... |
KEYIDS = {
"KEY_RESERVED": 0,
"KEY_ESC": 1,
"KEY_1": 2,
"KEY_2": 3,
"KEY_3": 4,
"KEY_4": 5,
"KEY_5": 6,
"KEY_6": 7,
"KEY_7": 8,
"KEY_8": 9,
"KEY_9": 10,
"KEY_0": 11,
"KEY_MINUS": 12,
"KEY_EQUAL": 13,
"KEY_BACKSPACE": 14,
"KEY_TAB": 15,
"KEY_Q": 16,
"KEY_W": 17,
"KEY_E": 18,
"KEY_R": 19,
"KEY_T": 20,
"KEY_Y": 21,
"KEY_U... |
import xmlrpclib
DB = 'training3'
USERID = 1
USERPASS = 'admin'
sock = xmlrpclib.ServerProxy('http://%s:%s/xmlrpc/object' % ('localhost',8069))
ids = sock.execute(DB, USERID, USERPASS, 'account.account', 'search', [], {})
account_lists = sock.execute(DB, USERID, USERPASS, 'account.account', 'read', ids, ['parent_id... |
from __future__ import absolute_import, division, unicode_literals
from jx_base.expressions import (
BasicStartsWithOp as BasicStartsWithOp_,
Variable as Variable_,
is_literal,
)
from jx_base.language import is_op
from jx_elasticsearch.es52.expressions.false_op import MATCH_NONE
from jx_elasticsearch.es52.... |
from __future__ import absolute_import
from django.core.exceptions import FieldError
from django.test import TestCase
from .models import Author, Article
class CustomColumnsTests(TestCase):
def test_db_column(self):
a1 = Author.objects.create(first_name="John", last_name="Smith")
a2 = Author.obj... |
# -*- coding: utf-8 -*-
from markdown.extensions import Extension
from markdown.inlinepatterns import Pattern
from markdown.util import etree
url_re = r'(' \
r'(?P<plainurl>((?P<itemprop>[^\s\:]+)\:\:)?(?P<url>\w+://' \
r'[a-zA-Z0-9\~\!\@\#\$\%\^\&\*\-\_\=\+\[\]\\\:\;\"\'\,\.\'' \
r'\?/]' \... |
#!/usr/bin/env python2.7
"""
File : mit_db.py
Author : Bjorn Barrefors <bjorn dot peter dot barrefors AT cern dot ch>
Description: MIT DB service access module
"""
# system modules
import logging
import MySQLdb
# package modules
from cuadrnt.data_management.services.generic import GenericService
class MITD... |
ANSIBLE_METADATA = {'metadata_version': '1.0',
'status': ['preview'],
'supported_by': 'community'}
import os
import traceback
try:
from dopy.manager import DoError, DoManager
HAS_DOPY = True
except ImportError:
HAS_DOPY = False
from ansible.module_utils.basic impo... |
# coding: utf-8
from PySide import QtGui, QtCore
import mdiEditor_rc
# import subprocess
# cmd = 'C:/Python27/Lib/site-packages/PySide/pyside-rcc.exe -o mdiEditor_rc.py images/mdiEditor.qrc'
# subprocess.Popen(cmd, stdout=subprocess.PIPE)
class MainWindow(QtGui.QMainWindow):
def __init__(self, parent=None):
... |
# -*- coding: utf-8 -*-
"""
1st RUN:
- Run update check if needed.
- Import the S3 Framework Extensions
- If needed, copy deployment specific templates to the live installation.
Developers: note that the templates are version-controlled, while their
site-specific copies are not ... |
from enum import IntEnum
from .path import Path
from .inklist import InkList
from .object import Object
class ValueType(IntEnum):
INT = 0
FLOAT = 1
LIST = 2
STRING = 3
DIVERT_TARGET = 4
VAR_POINTER = 5
class Value(Object):
def __init__(self, value, *, vtype):
super().__init__()
... |
from mu import Mu, MuObject, MuTransform, MuMesh, MuTagLayer
from multiprocessing import Pool
def read_vertices(input):
count = input.read_int()
verts = [None] * count
for i in range(count):
verts[i] = input.read_vector()
return verts
class Face:
pass
def read_face(input):
f = Face()
... |
import mtgsdk as mtg
import traceback
import phibot
def magic_card_by_name(name, chat_id):
answer = ''
cards = mtg.Card.where(name=name).all()
# noinspection PyBroadException
try:
for card in cards:
if card.name == name:
res = ''
res += card.name + '... |
"""
Verifies libraries (in identical-names) are properly handeled by xcode.
The names for all libraries participating in this build are:
libtestlib.a - identical-name/testlib
libtestlib.a - identical-name/proxy/testlib
libproxy.a - identical-name/proxy
The first two libs produce a hash collision in Xcode when Gyp is... |
"""Runs semi-automated update testing on a non-rooted device."""
import logging
import optparse
import os
import shutil
import sys
import time
from pylib import android_commands
def _SaveAppData(adb, package_name, from_apk=None, data_dir=None):
def _BackupAppData(data_dir=None):
adb.Adb().SendCommand('backup %... |
from spack import *
import os.path
class RnaSeqc(Package):
"""RNA-SeQC is a java program which computes a series of quality control
metrics for RNA-seq data."""
homepage = "http://archive.broadinstitute.org/cancer/cga/rna-seqc"
url = "http://www.broadinstitute.org/cancer/cga/tools/rnaseqc/RNA-Se... |
from __future__ import absolute_import, print_function
from tweepy.utils import parse_datetime, parse_html_value, parse_a_href
class ResultSet(list):
"""A list like object that holds results from a Twitter API query."""
def __init__(self, max_id=None, since_id=None):
super(ResultSet, self).__init__()... |
import unittest
import numpy as np
from tick.linear_model import SimuLinReg
class Test(unittest.TestCase):
def test_SimuLinReg(self):
"""...Test simulation of a Linear Regression
"""
n_samples = 10
n_features = 3
idx = np.arange(n_features)
weights = np.exp(-idx /... |
#!/usr/bin/python
"""
This example shows basic document generation functionality.
.. :copyright: (c) 2014 by Jelte Fennema.
:license: MIT, see License for more details.
"""
# begin-doc-include
from pylatex import Document, Section, Subsection, Command
from pylatex.utils import italic, NoEscape
def fill_documen... |
import Gaffer
import GafferUI
import GafferUITest
class CompoundPlugValueWidgetTest( GafferUITest.TestCase ) :
def testChildAccess( self ) :
n = Gaffer.Node()
n["c"] = Gaffer.CompoundPlug()
n["c"]["i"] = Gaffer.IntPlug()
n["c"]["s"] = Gaffer.StringPlug()
pw = GafferUI.CompoundPlugValueWidget( n["c"] ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
import socketserver
import urllib
from http.server import SimpleHTTPRequestHandler
from typing import Optional
from jumeaux.logger import Logger
logger: Logger = Logger(__name__)
class MyServerHandler(SimpleHTTPRequestHandler):
def do_GET(self):
... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import warnings
from django.forms import *
from django.test import TestCase
from django.utils.translation import ugettext_lazy, override
from forms_tests.models import Cheese
from django.test.utils import TransRealMixin
class FormsRegressionsTestCase(... |
import time
from openerp.report import report_sxw
class pos_details(report_sxw.rml_parse):
def _get_invoice(self, inv_id):
res={}
if inv_id:
self.cr.execute("select number from account_invoice as ac where id = %s", (inv_id,))
res = self.cr.fetchone()
return res[... |
from django.contrib import admin
# Register your models here.
from counter.models import Filename, Product, Country, OS, Arch, Version, Language, LogEntry, Query
class ProductAdmin(admin.ModelAdmin):
pass
class CountryAdmin(admin.ModelAdmin):
pass
class OSAdmin(admin.ModelAdmin):
pass
class ArchAdm... |
"""Ops for hybrid model training."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import threading
from tensorflow.python.framework import load_library
from tensorflow.python.framework import ops
from tensorflow.python.ops import array_ops
from tensorflo... |
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import os
import shutil
from pants.backend.jvm.subsystems.jvm_tool_mixin import JvmToolMixin
from pants.backend.jvm.targets.jar_dependency import JarDependency
from p... |
import wx
from configtool.data import (BSIZESMALL, reFloat, reInteger, offsetChLabel,
offsetTcLabel)
class CalcBelt(wx.Dialog):
def __init__(self, parent, font, cbUse):
wx.Dialog.__init__(self, parent, wx.ID_ANY,
"Steps calculator for belt driven axes",
... |
# -*- coding: utf-8 -*-
"""
httpbin.helpers
~~~~~~~~~~~~~~~
This module provides helper functions for httpbin.
"""
import json
import base64
from hashlib import md5
from werkzeug.http import parse_authorization_header
from flask import request, make_response
try:
from urlparse import urlparse, urlunparse
excep... |
from typing import Any, Callable, Dict, Generic, Optional, TypeVar
import warnings
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.core.pipeline import PipelineResponse
from azure.core.pipeline.transport import AsyncHttpRe... |
"""Methods to allow dask.DataFrame (deprecated).
This module and all its submodules are deprecated. See
[contrib/learn/README.md](https://www.tensorflow.org/code/tensorflow/contrib/learn/README.md)
for migration instructions.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ i... |
#!/usr/bin/python
__author__ = "James Sams <<EMAIL>>"
import unittest
from gdata import test_data
import gdata.books
import atom
class BookEntryTest(unittest.TestCase):
def testBookEntryFromString(self):
entry = gdata.books.Book.FromString(test_data.BOOK_ENTRY)
self.assert_(isinstance(entry, ... |
*** xx/configure.py.orig 2005-05-11 20:01:53.719957680 +0400
--- xx/configure.py 2005-05-11 20:05:29.699123856 +0400
@@ -721,7 +721,7 @@
from distutils.sysconfig import get_confi... |
"""This script searches for unused art assets listed in a .grd file.
It uses git grep to look for references to the IDR resource id or the base
filename. If neither is found, the file is reported unused.
Requires a git checkout. Must be run from your checkout's "src" root.
Example:
cd /work/chrome/src
tools/reso... |
from __future__ import unicode_literals
import errno
import os
import re
import socket
import sys
from datetime import datetime
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.core.management.base import BaseCommand, CommandError
from django.core.servers.basehttp i... |
"""A POP3 client class.
Based on the J. Myers POP3 draft, Jan. 96
"""
# [heavily stealing from nntplib.py]
# Updated: Piers Lauder <<EMAIL>> [Jul '97]
# String method conversion and test jig improvements by ESR, February 2001.
# Added the POP3_SSL class. Methods loosely based on IMAP_SSL. Hector Urtub... |
import Components.Task
from Components.config import config
from Components import Harddisk
from Components.GUIComponent import GUIComponent
from Components.VariableText import VariableText
import time
import os
import enigma
from enigma import pNavigation
def getTrashFolder(path=None):
# Returns trash folder without... |
import re
import logging
import random
from autotest.client.shared import error
from virttest import qemu_monitor, utils_test, utils_misc
class BallooningTest(object):
"""
Provide basic functions for memory ballooning test cases
"""
def __init__(self, test, params, env):
self.test = test
... |
#!/usr/bin/env python3
from __future__ import unicode_literals
import hashlib
import urllib.request
import json
versions_info = json.load(open('update/versions.json'))
version = versions_info['latest']
URL = versions_info['versions'][version]['bin'][0]
data = urllib.request.urlopen(URL).read()
# Read template page
... |
# from winbase.h
STDOUT = -11
STDERR = -12
try:
from ctypes import windll
except ImportError:
windll = None
SetConsoleTextAttribute = lambda *_: None
else:
from ctypes import (
byref, Structure, c_char, c_short, c_uint32, c_ushort
)
handles = {
STDOUT: windll.ker... |
#!/usr/bin/env python
#
# Bitbang'd SPI interface with an MCP3008 ADC device
# MCP3008 is 8-channel 10-bit analog to digital converter
# Connections are:
# CLK => SCLK
# DOUT => MISO
# DIN => MOSI
# CS => CE0
import time
import sys
import spidev
spi = spidev.SpiDev()
spi.open(0,0)
spi.max_speed_hz... |
# -*- coding: utf-8 -*-
"""
/***************************************************************************
Climb
begin : 2019-05-15
copyright : (C) 2019 by Håvard Tveite
email : <EMAIL>
********************************************************************... |
# -*- encoding: utf-8 -*-
import frappe
from datetime import date
from fm.api import PENDING
@frappe.whitelist()
def get_next_repayment_schedule(chasis_no):
loan_id = frappe.get_value("Loan", { "asset": chasis_no }, "name")
if not loan_id:
next_month = frappe.utils.add_months(date.today(), 1)
return next_mon... |
"""A Telemetry page_action that performs the "seek" action on media elements.
Action parameters are:
- seconds: The media time to seek to. Test fails if not provided.
- selector: If no selector is defined then the action attempts to seek the first
media element on the page. If 'all' then seek all media ele... |
"""
Support for Sybase via the python-sybase driver.
http://python-sybase.sourceforge.net/
Connect strings are of the form::
sybase+pysybase://<username>:<password>@<dsn>/[database name]
Unicode Support
---------------
The python-sybase driver does not appear to support non-ASCII strings of any
kind at this ti... |
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}
DOCUMENTATION = r'''
---
module: win_user_right
version_added: '2.4'
short_description: Manage Windows User Rights
description:
- Add, remove or set User Rights for a group or user... |
"""distutils.spawn
Provides the 'spawn()' function, a front-end to various platform-
specific functions for launching another program in a sub-process.
Also provides the 'find_executable()' to search the path for a given
executable name.
"""
# This module should be kept compatible with Python 2.1.
__revision__ = "$I... |
"""
Simple polygon visual based on MeshVisual and LineVisual
"""
from __future__ import division
import numpy as np
from .visual import CompoundVisual
from .mesh import MeshVisual
from .line import LineVisual
from ..color import Color
from ..geometry import PolygonData
from ..gloo import set_state
class PolygonVis... |
import sys
import re
"""Baby Names exercise
Define the extract_names() function below and change main()
to call it.
For writing regex, it's nice to include a copy of the target
text for inspiration.
Here's what the html looks like in the baby.html files:
...
<h3 align="center">Popularity in 1990</h3>
....
<tr align... |
"""Tests for tensorflow.contrib.graph_editor."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import re
from tensorflow.contrib import graph_editor as ge
from tensorflow.python.framework import constant_op
from tensorflow.python.framework import ops as o... |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}
import os
from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.one... |
# coding: utf-8
from __future__ import absolute_import
import hashlib
from google.appengine.ext import ndb
from webargs.flaskparser import parser
from webargs import fields as wf
from api import fields
import model
import util
import config
class User(model.Base):
name = ndb.StringProperty(required=True)
user... |
from __future__ import unicode_literals
import cgi
import codecs
import logging
import sys
from io import BytesIO
from threading import Lock
import warnings
from django import http
from django.conf import settings
from django.core import signals
from django.core.handlers import base
from django.core.urlresolvers impo... |
#!/usr/bin/env python
"""Implementation of a router class that does no ACL checks."""
from typing import Optional
from grr_response_server.gui import api_call_context
from grr_response_server.gui import api_call_router
from grr_response_server.gui.api_plugins import artifact as api_artifact
from grr_response_server.... |
from sqlparse import sql, tokens as T
from sqlparse.compat import text_type
from sqlparse.utils import offset, indent
class AlignedIndentFilter(object):
join_words = (r'((LEFT\s+|RIGHT\s+|FULL\s+)?'
r'(INNER\s+|OUTER\s+|STRAIGHT\s+)?|'
r'(CROSS\s+|NATURAL\s+)?)?JOIN\b')
spl... |
import gc
import pickle
import threading
from unittest import mock
import pytest
from xarray.backends.file_manager import CachingFileManager
from xarray.backends.lru_cache import LRUCache
from xarray.core.options import set_options
@pytest.fixture(params=[1, 2, 3, None])
def file_cache(request):
maxsize = reque... |
microcode = '''
# FSTSW
def macroop FNSTSW_R {
rdval t1, fsw
mov rax, rax, t1, dataSize=2
};
def macroop FNSTSW_M {
rdval t1, fsw
st t1, seg, sib, disp, dataSize=2
};
def macroop FNSTSW_P {
rdip t7
rdval t1, fsw
st t1, seg, riprel, disp, dataSize=2
};
''' |
"""Publish tool for SCons."""
# List of published resources. This is a dict indexed by group name. Each
# item in this dict is a dict indexed by resource type. Items in that dict
# are lists of files for that resource.
__published = {}
#-----------------------------------------------------------------------------... |
import os, sys, shutil, subprocess
assert os.path.isfile( "setup.py" ) and open( ".git/description" ).read().strip() == "Nuitka Staging"
nuitka_version = subprocess.check_output( "./bin/nuitka --version", shell = True ).strip()
branch_name = subprocess.check_output( "git name-rev --name-only HEAD".split() ).strip()
... |
"""
This module contains the class that represents a single todo item.
"""
import re
from datetime import date
from topydo.lib.TodoParser import parse_line
from topydo.lib.Utils import is_valid_priority
class TodoBase(object):
"""
This class represents a single todo item in a todo.txt file. It maintains
... |
"""Provide interface for RPC to cluster nodes."""
# Copyright (c) 2014 - I.T. Dev Ltd
#
# This file is part of MCVirt.
#
# MCVirt 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 2 of the Licens... |
from telemetry.page import page as page_module
from telemetry.page import page_set as page_set_module
from page_sets import top_pages
def _IssueMarkerAndScroll(action_runner):
interaction = action_runner.BeginGestureInteraction(
'ScrollAction', is_smooth=True)
action_runner.ScrollPage()
interaction.End()... |
import json
import csv
import io
from modules.OsmoseTranslation import T_
from .Analyser_Merge_Dynamic import Analyser_Merge_Dynamic, SubAnalyser_Merge_Dynamic
from .Analyser_Merge import SourceDataGouv, CSV, Load, Conflate, Select, Mapping
class Analyser_Merge_Healthcare_FR_Finess(Analyser_Merge_Dynamic):
def _... |
STDOUT = -11
STDERR = -12
try:
import ctypes
from ctypes import LibraryLoader
windll = LibraryLoader(ctypes.WinDLL)
from ctypes import wintypes
except (AttributeError, ImportError):
windll = None
SetConsoleTextAttribute = lambda *_: None
else:
from ctypes import byref, Structure, c_char, PO... |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}
import time
from ansible.module_utils.azure_rm_common import AzureRMModuleBase
from ansible... |
from flask.ext.wtf import Form
CFG_GROUPS_META = {
'classes': None,
'indication': None,
'description': None
}
class InspireForm(Form):
"""Generic Form class to be used in INSPIRE forms. """
def __init__(self, *args, **kwargs):
super(InspireForm, self).__init__(*args, **kwargs)
def ... |
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from units.compat.mock import patch
from units.modules.utils import set_module_args
from .onyx_module import TestOnyxModule, load_fixture
from ansible.modules.network.onyx import onyx_facts
class TestOnyxFacts(TestOnyxModule):
... |
import sys
import os
import os.path
import svn.core
import svn.client
import svn.wc
FORCE_COMPARISON = 0
def usage():
print("Usage: " + sys.argv[0] + " FILE_OR_DIR1 FILE_OR_DIR2\n")
sys.exit(0)
def run(files):
for f in files:
dirpath = fullpath = os.path.abspath(f)
if not os.path.isdir(dirpath):
... |
"""
Implementation of "reverification" service to communicate with Reverification XBlock
"""
import logging
from django.core.exceptions import ObjectDoesNotExist
from django.core.urlresolvers import reverse
from django.db import IntegrityError
from opaque_keys.edx.keys import CourseKey
from student.models import Us... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Authors: Jose & Alberto #
from glob import glob
from sys import argv
from re import sub,findall,match,compile,DOTALL
from nltk.corpus import stopwords
from nltk.stem import SnowballStemmer
import codecs
try: from cPickle import dump,HIGHEST_PROTOCOL
except: from pickle i... |
import os
import sys
from fabric.api import *
from fabtastic import db
from fabtastic.fabric.util import _current_host_has_role
def get_remote_db(roles='webapp_servers'):
"""
Retrieves a remote DB dump and dumps it in your project's root directory.
"""
if _current_host_has_role(roles):
dump_fil... |
import unittest
import time
from pymongo import MongoClient
from moquag import MongoQueryAggregator
from time import sleep
from .settings import MONGO_DB_SETTINGS, logger
from collections import Counter
class TestBulk(unittest.TestCase):
def setUp(self):
self.conn = MongoClient(**MONGO_DB_SETTINGS)
... |
"""Monitor outputs, weights, and gradients for debugging."""
from __future__ import absolute_import
import re
import ctypes
import logging
from math import sqrt
from .ndarray import NDArray
from .base import NDArrayHandle, py_str
from . import ndarray
class Monitor(object):
"""Monitor outputs, weights, and grad... |
# -*- coding: utf-8 -*-
import logging
import os
import time
from os import listdir
from os.path import join
from threading import Thread, Lock
from select import select
from Queue import Queue, Empty
import openerp
import openerp.addons.hw_proxy.controllers.main as hw_proxy
from openerp import http
from openerp.http ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.