content string |
|---|
import glob
import mock
import os
import sys
import traceback
import time
from django.db.transaction import commit_on_success
from django.conf import settings
from django.core.management.base import BaseCommand
from flooding_presentation.models import PresentationType
from flooding_lib import models
from flooding_lib... |
# -*- coding: utf-8 -*-
__author__ = 'vadim'
import json
import urllib2
import time
import requests as r
from bson import ObjectId
from flask import Flask, jsonify, request
from pymongo import MongoClient
app = Flask(__name__)
client = MongoClient('localhost', 27017)
db = client['more-gym']
@app.route('/auth', meth... |
rows = 'ABCDEFGHI'
cols = '123456789'
boxes = [r + c for r in rows for c in cols]
history = {} # history must be declared here so that it exists in the assign_values scope
def assign_value(values, box, value):
"""You must use this function to update your values dictionary if you want to
try using the provided... |
"""
Various functions for py3k compatibility
"""
__builtins__['unicode'] = str
__builtins__['basestring'] = str |
"""
simulator.py: A simulator of the UART and 1-wire devices for use in testcases.
Copyright (C) 2013 Anders Englund
This file is part of RPi_UART_1-wire.
RPi_UART_1-wire 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 Foun... |
import hashlib
def generate_luigi(config_file, link_file, dest="test.py"):
fh = open(dest, 'w')
fh.write('import luigi\n')
fh.write('from luigi.contrib.external_program'
' import ExternalProgramTask\n')
fh.write('\n\n')
for module in config_file.modules:
module_link_data = ... |
#!/usr/bin/env python
import starexecparser
import telescope
def toAddJob(te_creds, job_id, problem_set_id, name, description, job_fields, commit, config_ids):
dbcon = telescope.connectUsingCredentials(te_creds)
with dbcon:
dbcur = dbcon.cursor()
cpu, wc, mem, email = job_fields
telesc... |
"""Utilities shared by tests."""
import asyncio
import contextlib
import gc
import inspect
import ipaddress
import os
import socket
import sys
from abc import ABC, abstractmethod
from types import TracebackType
from typing import (
TYPE_CHECKING,
Any,
Callable,
Iterator,
List,
Optional,
Typ... |
from openerp.osv import fields, osv
from openerp.tools.translate import _
class profitStatementreportWizard(osv.osv_memory):
_inherit = "account.report.wiz"
_name = "profit.statement.report.wiz"
_description = "Profit Statement Report Wizard"
#=====================================================... |
# -*- coding: utf-8 -*-
"""
Unit tests for the runtime.mil.simulator module.
---
type:
python_module
validation_level:
v00_minimum
protection:
k00_public
copyright:
"Copyright 2016 High Integrity Artificial Intelligence Systems"
license:
"Licensed under the Apache License, Version 2.0 (the Lice... |
"""CSTATS
cstats provides statistic and information about your directories.
Usage:
cst (ls | list) [<path>]
cst (l | largest) [-r] [<path>]
cst (s | size) [-r] [<path>]
cst (c | count) [-r] [<path>]
cst (t | type) [-r] [<path>]
cst (e | extension) [-r] [<path>]
cst (a | all) [-r] [<path>]
... |
import pytest
from plenum.test.delayers import ppgDelay, req_delay
from plenum.test.node_request.test_propagate.helper import sum_of_request_propagates
from plenum.test.spy_helpers import get_count, getAllReturnVals
from plenum.test.test_node import getNonPrimaryReplicas
from plenum.test.helper import sdk_send_random_a... |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'Category'
db.create_table(u'duelify_app_category', (
(u'id', self.gf('django.db.... |
#!/usr/bin/env python
# ignore-tidy-linelength
# This is a small script that we use on CI to collect CPU usage statistics of
# our builders. By seeing graphs of CPU usage over time we hope to correlate
# that with possible improvements to Rust's own build system, ideally diagnosing
# that either builders are always fu... |
from django.db import models
from django.utils.translation import ugettext_lazy as _
from mezzanine.conf import settings
from mezzanine.core.fields import RichTextField
from mezzanine.core.models import Orderable, RichText
from mezzanine.forms import fields
from mezzanine.pages.models import Page
class Form(Page, Ri... |
from chainer.backends import cuda
from chainer import function_node
import chainer.functions
from chainer import utils
from chainer.utils import type_check
class _SetItemZero(function_node.FunctionNode):
"""Write values to mask of zero-initialized array"""
def __init__(self, mask):
self.mask = mask
... |
""" Toolbar example """
from gnr.core.gnrbag import Bag
class GnrCustomWebPage(object):
py_requires = 'public:Public,standard_tables:TableHandler'
def main(self, root, **kwargs):
root.css('.specialToobar .dijitToolbar', """background-image:none; background-color:#d5d5d5;""")
rootBc, top, bott... |
import subprocess
import pytest
from ..helpers import BaseWFC3
class TestUVIS17Single(BaseWFC3):
"""
Test pos UVIS2 LSPM data
"""
detector = 'uvis'
def _single_raw_calib(self, rootname):
raw_file = '{}_raw.fits'.format(rootname)
# Prepare input file.
self.get_input_... |
import os
import urllib2
import tarfile
import urlparse
import shutil
import sys
script_dir = os.path.dirname(os.path.realpath(__file__))
chrome_src = os.path.abspath(os.path.join(script_dir, os.pardir))
dir_path = os.path.join(chrome_src, 'third_party/libnetxt')
if (os.path.isdir(dir_path) == False):
print "LibNe... |
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... |
import os
import gc
import shutil
import numpy as np
from mock import MagicMock
from ..utility import QtTest, click_button, click_checkbox
from qtpy import QtCore, QtWidgets
from qtpy.QtTest import QTest
from ...widgets.integration import IntegrationWidget
from ...controller.integration.ImageController import ImageC... |
#!/usr/bin/env python
# -- Content-Encoding: UTF-8 --
"""
Node composer instrument
:author: Thomas Calmant
:license: Apache Software License 2.0
:version: 1.1.0
..
Copyright 2014 isandlaTech
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance wi... |
from django.contrib.auth.models import User
from rest_framework.generics import GenericAPIView
from rest_framework.viewsets import GenericViewSet
from rest_framework.mixins import CreateModelMixin
from rest_framework.permissions import AllowAny
from ..serializers.users import RegisterSerializer, LoginSerializer, BaseAu... |
'''
Copyright 2013 Cosnita Radu Viorel
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 use, copy, modify, merge, publish, distribute... |
import email
import logging
import mailbox
import sys
from gettext import gettext as _
from bongo.cmdparse import Command
from bongo.BongoError import BongoError
from libbongo.libs import bongojson, msgapi
from bongo.store.StoreClient import DocTypes, StoreClient
from bongo.storetool.ExportMailbox import MboxMailbox,... |
"""
Provides PublishHandler, the handler for publishing assignments
Event type: PUBLISH
"""
import os
from tempfile import TemporaryDirectory
from gkeepcore.csv_files import CSVError
from gkeepcore.git_commands import git_init, git_push, git_add_all, git_commit
from gkeepcore.local_csv_files import LocalCSVReader
fr... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
This file is part of XBMC Mega Pack Addon.
Copyright (C) 2014 Wolverine (<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 Software Foundation, e... |
import gtk
import gobject
import threading, time
class StatusBar(gtk.Statusbar):
def __init__(self):
super(StatusBar, self).__init__()
self.set_has_resize_grip(True)
self.push(0, 'All ready')
self.__progressmeter = gtk.ProgressBar()
self.pack_start(self.__progressmeter... |
#!/usr/bin/python
from sys import path
import os
from threading import Thread
import time
import json
path.insert(0, os.path.realpath (os.path.dirname(__file__)) + '/modules/')
import microl_server
import command_block
def main ():
microl_server.init ()
cfg_str = ''
conf = open ('/etc/microl/... |
from datetime import datetime
from time import strptime
class XsdValueLibrary:
def date_should_be_younger(self, youngvalue, oldvalue):
assert date_is_younger(youngvalue, oldvalue), (
"Expected date time %s to be younger than %s" % (
youngvalue, oldvalue))
def date... |
import os
import tempfile
import unittest
import funsize.utils.fetch as fetch
TEST_URL = 'https://ftp.mozilla.org/pub/mozilla.org/firefox/releases/29.0/KEY'
TEST_SHA512 = '6f445230407ae4e4c73a73d345de8b349e975f08adcdfafc713e9ba05e40a3'\
'8f8dd287055ddbbcc59aef21a814f7b1a0488492e2be116242bbbdbee62f5ab997'
WRONG_SH... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
charmap = {
}
charmap['independent_vowels'] = {
u'\u0B85': (u'அ', u"A"),
u'\u0B86': (u'ஆ ', u"AA"),
u'\u0B87': (u'இ', u"I"),
u'\u0B88': (u'ஈ', u"II"),
u'\u0B89': (u'உ', u"U"),
u'\u0B8A': (u'ஊ', u"UU"),
u'\u0B8B': (u'', u"<reserved>"),
u'\u0... |
from __future__ import absolute_import
import inspect
from . import slb
from . import mie_grueneisen_debye as mgd
from . import birch_murnaghan as bm
from . import birch_murnaghan_4th as bm4
from . import modified_tait as mt
from . import dks_liquid
from . import dks_solid
from . import hp
from . import cork
from . im... |
"""
PythonDBAGraphs: Graphs to help with Oracle Database Tuning
Copyright (C) 2016 Robert Taft Durrett (Bobby Durrett)
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... |
from django.test import TestCase
from django import forms
from unittest.mock import MagicMock
from bejmy.transactions.forms import TransactionForm
class TransactionFormTest(TestCase):
def test_transaction_form_setup_facade(self):
TransactionForm._set_source_initial = MagicMock()
TransactionForm.... |
__author__ = 'nikhilalmeida'
from argparse import ArgumentParser
import json
import sys
import codecs
import ast
import itertools
import collections
ARGS = {}
parser = ArgumentParser(description='JSON utilities.')
parser.add_argument("command", help='The command to be performed. List of commands are:\n1. intersect. \... |
# -*- coding: utf-8 -*-
"""JSON Schemas."""
affiliation_record = {
"title": "AffiliationRecord",
"type": "object",
"properties": {
"id": {"type": "integer", "format": "int64"},
"put-code": {"type": ["string", "null", "integer"]},
"local-id": {"type": ["string", "null"]},
"ex... |
# -*- coding: utf-8 -*-
from copy import deepcopy
from django import forms
from django.conf import settings
from django.core import urlresolvers
from django.db.models import Q, Model
from django.forms.forms import BoundField
from django.forms.util import ErrorDict
from django.utils.http import urlencode
from django.ut... |
from html.parser import HTMLParser
from django.contrib.contenttypes.models import ContentType
from django.db import models, transaction, IntegrityError
from django.db.models.signals import pre_save
from bleach import clean
from janitor import whitelists
def _register(callback, content_type_list):
"""Connects th... |
import os
import logging
from datetime import datetime
from middleware.graphers.turtle_utils import generate_hash, generate_uri as gu, link_uris
from middleware.blazegraph.upload_graph import upload_graph
from SPARQLWrapper import SPARQLWrapper, JSON
from rdflib import Literal, Graph
import config
from modules.loggingF... |
from datetime import datetime
from django.db import models
from django.utils import timezone
from sport.models import Base, Sport, Venue, Competition, Season
from cbe.party.models import Individual, Organisation
class Team(Organisation):
sport = models.ForeignKey(Sport)
competition = models.ForeignKey(Compet... |
"""
@author: dhoomakethu
"""
from setuptools import setup
from apocalypse import __version__
import platform
PSUTIL_ALPINE_LINUX = "4.1.0"
long_description = None
with (open('README.md')) as readme:
long_description = readme.read()
def fix_ps_util(install_requires):
for i, req in enumerate(install_requires... |
"""
Utilities for working with lists of model instances which represent
trees.
"""
from __future__ import unicode_literals
import copy
import csv
import itertools
import sys
from django.utils.six import next, text_type
from django.utils.six.moves import zip
__all__ = ('previous_current_next', 'tree_item_iterator',
... |
# coding: spec
from harpoon.executor import docker_context as docker_context_maker
from harpoon.option_spec.harpoon_specs import HarpoonSpec
from harpoon.ship.builder import Builder
from harpoon.ship.runner import Runner
from tests.helpers import HarpoonCase
from delfick_project.norms import Meta
import codecs
impor... |
#! /usr/bin/env python
"""
Usage:
calc-blast-cover.py reference.fa query.x.reference.blastn minmatch query.fa
calc-blast-cover calculates the fraction of bases in 'reference.fa' that are
covered by BLAST matches from 'query.fa', for sequence in 'query.fa' that are
longer than 'minmatch'.
"""
import sys
import bla... |
from django.conf.urls import url
from bedrock.mozorg.util import page
from bedrock.privacy import views
urlpatterns = (
url(r'^/$', views.privacy, name='privacy'),
page('/tips', 'privacy/privacy-day.html'),
page('/principles', 'privacy/principles.html'),
url(r'^/firefox/$', views.firefox_notices, name... |
import itertools
from oslo_config import cfg
from magnum.i18n import _
glance_group = cfg.OptGroup(name='glance_client',
title='Options for the Glance client')
glance_client_opts = [
cfg.StrOpt('region_name',
help=_('Region in Identity service catalog to use for '
... |
import warnings
from selenium.webdriver.remote.webdriver import WebDriver as RemoteWebDriver
from .remote_connection import ChromeRemoteConnection
from .service import Service
from .options import Options
class WebDriver(RemoteWebDriver):
"""
Controls the ChromeDriver and allows you to drive the browser.
... |
"""Converts a frozen graph into a TFLite FlatBuffer."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import enum # pylint: disable=g-bad-import-order
import os as _os
import platform as _platform
import subprocess as _subprocess
import tempfile as _tem... |
"""Tests for the Plugwise Climate integration."""
from homeassistant.config_entries import ENTRY_STATE_LOADED
from tests.components.plugwise.common import async_init_integration
async def test_adam_climate_entity_attributes(hass, mock_smile_adam):
"""Test creation of adam climate device environment."""
entr... |
import github.GithubObject
class InputGitTreeElement(object):
"""
"""
def __init__(self, path, mode, type, content=github.GithubObject.NotSet, sha=github.GithubObject.NotSet):
"""
:param path: string
:param mode: string
:param type: string
:param content: string
... |
#!/usr/bin/env python2
# encoding=utf8
"""
start imports
"""
"""
General utils imports
"""
import os
import os.path
import atexit
import sys
reload(sys)
"""
Time Managmente imports
"""
import time
from datetime import datetime
"""
set aditional path
"""
sys.path.append(os.path.join(os.path.dirname(__file__), 'p... |
#Forked from: https://github.com/countercept/doublepulsar-detection-script
import binascii
import socket
import argparse
import struct
import threading
from leviathan_config import BASE_DIR
from lib.utils import id_generator, discovery_parse, compromise_save
# Packets
negotiate_protocol_request = binascii.unhexlify... |
# -*- coding: utf8 -*-
from mock import MagicMock, patch
from twisted.trial import unittest
from brainer.client import Brainer
class BrainerClientTest(unittest.TestCase):
"""Making sure that if someone changes the base implementation (or lack of it)
it will be accused in the tests.
"""
def setUp(self... |
import sys
import datetime
# Print usage message and abort
def usage(msg1):
msg1 += "\n"
sys.stderr.write(msg1)
msg = \
"""
usage: vcf2gtp [options] filename.vcf [geneticMapFile]
where options may include:
-r <x> or --recombPerBP <x> Set recombination rate per nucleotide.
If two filenames a... |
"""
The API basically only provides one class. You can create a :class:`Script` and
use its methods.
Additionally you can add a debug function with :func:`set_debug_function`.
Alternatively, if you don't need a custom function and are happy with printing
debug messages to stdout, simply call :func:`set_debug_function`... |
"""
Provides classes and data used for organizing and interpreting ARINC 429
data.
"""
from abc import ABCMeta, abstractmethod
from decimal import Decimal
from typing import NamedTuple, Union
class BitFieldRange(NamedTuple):
"""A named and typed tuple for specifying the range of a bit field."""
lsb: int
... |
"""Ensure emitted events contain the fields legacy processors expect to find."""
from collections import namedtuple
import pytest
import ddt
from django.test.utils import override_settings
from mock import sentinel
from openedx.core.lib.tests.assertions.events import assert_events_equal
from .. import transformers
... |
import logging
_L = logging.getLogger(__name__)
from datetime import datetime
from django import template
from django.conf import settings
from django.utils import safestring as ss
import cothread
import cothread.catools as ca
from cothread.cadef import ECA_DISCONN
register = template.Library()
MODE = getattr(set... |
"""PyNEST Microcircuit: Helper Functions
-------------------------------------------
Helper functions for network construction, simulation and evaluation of the
microcircuit.
"""
from matplotlib.patches import Polygon
import matplotlib.pyplot as plt
import os
import sys
import numpy as np
if 'DISPLAY' not in os.envi... |
# http://clouddbs.blogspot.kr/2010/10/googles-mapreduce-in-98-lines-of-python.html
# https://docs.google.com/leaf?id=0Byb_6xqE_1ZxODVkMGIyNTMtYzNiMy00YTQzLThlZDYtODBmM2M5YTU3YWZj&hl=en
import threading
import Queue
import operator
import urllib
import re
class MapReduce:
''' MapReduce - to use, subclass by defini... |
#!/usr/bin/env python
"""Define :mod:`X12.parse` structures for some standard X12 Segments.
These are definitions of some standard Segments without a lot
of supporting detail. This can be used (or extended) to cover
cases where X12 segment metadata is not available.
This module includes a conversion to emit "... |
"""
The MIT License (MIT)
Copyright © 2015 RealDolos
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 use, copy, modify, merge, publi... |
done = False
headers = '''
#include <stdint.h>
#include <string>
#include <vector>
#include <map>
#include "Boost.hh"
#include "Exception.hh"
#include "AvroSerialize.hh"
#include "AvroParse.hh"
#include "Layout.hh"
'''
typeToC= { 'int' : 'int32_t', 'long' :'int64_t', 'float' : 'float', 'double' : 'double',
'boolean'... |
"""The test for switch device automation."""
import pytest
import homeassistant.components.automation as automation
from homeassistant.components.device_automation import (
_async_get_device_automations as async_get_device_automations,
)
from homeassistant.components.switch import DOMAIN
from homeassistant.const i... |
from sklearn.feature_extraction.text import TfidfTransformer
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.naive_bayes import MultinomialNB
categories=['healthy', 'unhealthy']
training=[
('data/healthy.csv', 0),
('data/unhealthy.csv', 1)
]
testing=[
('data/healthy_test.csv',0),
('data/... |
#!/usr/bin/env python3
'''
Version 1 2016.10.18
Copyright (c) 2014-2016, OmegaPhil - <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 Software Foundation, either version 3 of the License, or (at your
option) any ... |
"""
RenderPipeline
Copyright (c) 2014-2016 tobspr <<EMAIL>>
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 use, copy, mo... |
"""\
elements.py: Miscellaneous data about elements
This program is part of the PyQuante quantum chemistry program suite.
"""
symbol = [
"X","H","He",
"Li","Be","B","C","N","O","F","Ne",
"Na","Mg","Al","Si","P","S","Cl","Ar",
"K", "Ca", "Sc", "Ti", "V", "Cr", "Mn", "Fe",
"Co", "Ni", "Cu", "Zn",
... |
import unittest
from datetime import datetime
from openS3 import OpenS3
from tests.constants import BUCKET, ACCESS_KEY, SECRET_KEY
class OpenS3TestCase(unittest.TestCase):
@classmethod
def setUpClass(cls):
cls.datetime = datetime.now()
def setUp(self):
self.content = ''.join(['file uplo... |
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import six
from .metabase import MetaParams
class OrderExecutionBit(object):
def __init__(self,
dt=None, size=0, price=0.0,
closed=0, closedvalue=0.0, closedcomm=0.0,
... |
"""Argmax matcher implementation.
This class takes a similarity matrix and matches columns to rows based on the
maximum value per column. One can specify matched_thresholds and
to prevent columns from matching to rows (generally resulting in a negative
training example) and unmatched_theshold to ignore the match (gene... |
# -*- coding: utf-8 -*-
import routing
import logging
import xbmcaddon
from resources.lib import kodiutils
from resources.lib import kodilogging
from xbmcgui import ListItem
from xbmcplugin import addDirectoryItem, endOfDirectory, setResolvedUrl
from xbmc import log
import urllib3
from resources.lib import simple
A... |
"""Data generators for CoNLL dataset."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import zipfile
from tensor2tensor.data_generators import generator_utils
from tensor2tensor.data_generators import problem
from tensor2tensor.data_generators... |
import io
import os
import pickle
import torch
from nupic.research.frameworks.pytorch.model_utils import (
deserialize_state_dict,
set_module_attr,
)
from nupic.torch.modules.sparse_weights import SparseWeightsBase
# ----------------
# Main utils
# ----------------
def load_state_from_checkpoint(
model... |
#!/usr/bin/python
import random
from numpy import sqrt
from random import choice, randint
import comfort
class Autofingerer(object):
base_weights_2sd_lo = (0.4, 0.25, 0.15, 0.12, 0.08)
base_weights_1sd_lo = (0.2, 0.4, 0.2, 0.1, 0.1)
base_weights_med = (0.1, 0.2, 0.4, 0.2, 0.1)
base_weights_1sd_hi =... |
import proto # type: ignore
__protobuf__ = proto.module(
package='google.cloud.automl.v1beta1',
manifest={
'VideoClassificationDatasetMetadata',
'VideoObjectTrackingDatasetMetadata',
'VideoClassificationModelMetadata',
'VideoObjectTrackingModelMetadata',
},
)
class Video... |
"""
WSGI config for mpr 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`` sett... |
#!/usr/bin/python
import json
import time
import math
import spidev
import thread
import RPi.GPIO as GPIO
try:
import ConfigParser as configparser #python2
except:
import configparser #python3
class grpycfg:
"""Class that returns an object with variables read from the ini file"""
def __init__(self, cfg_file):... |
#!/usr/bin/python
import os, sys, string, anydbm
from low import *
from orthomcl import OrthoMCLCluster
# =============================================================================
def usage():
print >> sys.stderr, "add significant BLAST hits (e.g. in-paralogs) to an existing orthomcl cluster.\n"
print >> sys.... |
# -*- coding: utf-8 -*-
"""
This is part of WebScout software
Docs EN: http://hack4sec.pro/wiki/index.php/WebScout_en
Docs RU: http://hack4sec.pro/wiki/index.php/WebScout
License: MIT
Copyright (c) Anton Kuzmin <http://anton-kuzmin.ru> (ru) <http://anton-kuzmin.pro> (en)
Class of ips module
"""
from libs.common impor... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import os
from ConfigParser import SafeConfigParser
import sys
from yowsup.stacks import YowStackBuilder
from yowsup.layers.auth import AuthError
from yowsup.layers.network import YowNetworkLayer
from yowsup.layers import YowLayerEvent
import log
from layer import WaarLayer
... |
try:
from ecdsa.ellipticcurve import PointJacobi
JACOBI = True
except ImportError:
from ecdsa.ellipticcurve import Point
JACOBI = False
from ecdsa.ellipticcurve import CurveFp, INFINITY
from ecdsa.numbertheory import gcd, jacobi
oneseventwoeight = 1728
def lucasPQ(p, q, n, m):
"""
nth element... |
"""Splash screen window."""
__id__ = "$Id$"
__version__ = "$Revision$"
__date__ = "$Date$"
__copyright__ = "Copyright (c) 2010 Consorcio Fernando de los Rios."
__license__ = "LGPL"
import os
import sys
import debug
from gi.repository import Gdk
from gi.repository import Gtk
from gi.repository import G... |
import contextlib
import os
import logging
from django.test.runner import DiscoverRunner
from django.conf import settings
from django.db import connections
logger = logging.getLogger(__name__)
class LegacyDiscoverRunner(DiscoverRunner):
"""
See https://docs.djangoproject.com/en/1.7/topics/testing/advanced/#... |
# Modified by: echel0n
import os
import platform
import shutil
import subprocess
import re
import urllib
import tarfile
import stat
import traceback
import gh_api as github
import nzbtomedia
from nzbtomedia import logger
class CheckVersion():
"""
Version check class meant to run as a thread object with the S... |
"""Environment with keyboard."""
import itertools
from absl import logging
import dm_env
import numpy as np
import tensorflow.compat.v1 as tf
import tensorflow_hub as hub
import tree
from option_keyboard import smart_module
class EnvironmentWithLogging(dm_env.Environment):
"""Wraps an environment with addition... |
#!/usr/bin/env python
#
# Check if specified PMDAs have been installed already.
#
# USAGE:
# progname <pmcd.conf path> [list of PMDAs...]
#
#
# @see http://www.pcp.io/books/PCP_UAG/html/LE63226-PARENT.html
#
import sys
import re
pmcd_conf_path = ""
pmda_to_be_checked = []
pmda_already_installed = []
pmda_need... |
from __future__ import absolute_import
import ssl
import pytest
from urllib3.connectionpool import (
connection_from_url,
HTTPConnection,
HTTPConnectionPool,
HTTPSConnectionPool,
)
from urllib3.response import httplib, HTTPResponse
from urllib3.util.timeout import Timeout
from urllib3.packages.six.mov... |
import pulsar as psr
def load_ref_system():
""" Returns dibutylether as found in the IQMol fragment library.
All credit to https://github.com/nutjunkie/IQmol
"""
return psr.make_system("""
C 1.6842 -0.6124 1.5782
C 0.6215 0.3802 1.1155
O 0.05... |
'''
Created on Apr 5, 2016
@author: leegc
'''
from re import match
from engine.objects import Result
from time import strptime
import logging
import sre_constants
main_type = "main_type"
detail_type = "detail_type"
number_min = "number_min"
number_max = "number_max"
number_average = "number_average"
number_std_dev ... |
__author__ = 'joaquin'
from web.models import FSUser
from django.core.management.base import BaseCommand
from django.contrib.auth.models import User
import csv
import os.path
import sys
PROJECT_ROOT = os.path.abspath(os.path.dirname(__file__))
class Command(BaseCommand):
def handle(self, *args, **options):
... |
import sys
from setuptools import setup
from setuptools import find_packages
version = '1.3.11'
# Please update tox.ini when modifying dependency version requirements
install_requires = [
'ebclient.py>=0.1.20',
'cmd2>=0.6.9',
'pycrypto>=2.6',
'cryptography>=0.7', # load_pem_x509_certificate
'pa... |
'''
A collection of classes (mostly named tuples) that are useful for holding data
related to accelerator elements and details of the simulated beam.
'''
from collections import namedtuple
import warnings
Param = namedtuple('Param', ['val', 'unit'])
Param.__repr__ = lambda self: str(self.val) if self.unit is None els... |
from core.util.data import StockHistory, Featurizer
from core.util.graphics import plot
import pickle
from pybrain.datasets import SupervisedDataSet
from pybrain.structure import TanhLayer
from pybrain.supervised.trainers import BackpropTrainer
from pybrain.tools.shortcuts import buildNetwork
from time import time
def... |
"""Test of vusion.persist.content_variable.content_variable_manager"""
from pymongo import MongoClient
from twisted.trial.unittest import TestCase
from tests.utils import ObjectMaker
from vusion.persist import (
ContentVariableManager, ContentVariable, ContentVariableTable)
class TestContentVariableManager(Test... |
from filecmp import dircmp
import shutil
import os
def walk_recursively_and_update(dcmp):
#for different Files Copy from right to left
for name in dcmp.diff_files:
srcpath = dcmp.right + "/" + name
destpath = dcmp.left + "/" + name
print("Updating %s" % (destpath))
if os.path.i... |
from django.db import models
import netifaces
import subprocess
class Tools:
def list_physical_nics():
all_nics = netifaces.interfaces()
physical_nics = []
for nic in all_nics:
cmd = "ethtool -i %s | grep bus-info" % nic
p = subprocess.Popen(cmd, stdin=subproces... |
import sys
import ConfigParser
class OpenIHMConfig(ConfigParser.SafeConfigParser):
"""
Configuration file parser based on
ConfigParser.SafeConfigParser
The parser is setup with defaults for most of the
settings.
config = OpenIHMConfig()
config.read(CONFIGFILE)
The config fi... |
import os
import shutil
import subprocess
import time
import unittest
from collections import namedtuple
from .. import *
from bfg9000.backends import list_backends
from bfg9000.iterutils import listify
from bfg9000.path import InstallRoot, Path, Root
this_dir = os.path.abspath(os.path.dirname(__file__))
examples_di... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.