content stringlengths 4 20k |
|---|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Planets filters manager.
"""
import sys
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from oroboros.core.planetsfilters import PlanetsFilter, all_planets_filters_names
from oroboros.gui.plntfilterdialog import PlanetsFilterDialog
__all__ = ['PlanetsFilters... |
from nose.tools import (
assert_equal, assert_not_equal, assert_true, assert_false,
assert_is_instance, assert_raises
)
from datetime import timedelta
from utcdatetime import utcdatetime
UNEQUAL_TEST_CASES = [
((2015, 6, 25, 16, 0, 0, 0), (2015, 6, 25, 16, 0, 0, 100)), # microsec
((2015, 6, 25, 16, ... |
"""Test label RPCs.
RPCs tested are:
- getaddressesbylabel
- listaddressgroupings
- setlabel
"""
from collections import defaultdict
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import assert_equal, assert_raises_rpc_error
from test_framework.wallet_util import t... |
"""Forms for Tasks and related entities."""
from bootstrap3_datetime.widgets import DateTimePicker
from django import forms
from django.db.models import Q
from django.forms import Textarea, Select, CheckboxInput
from editorial.models import (
Project,
Story,
Task,
Event,
)
from editoria... |
"""Layers for a StarGAN model.
This module contains basic layers to build a StarGAN model.
See https://arxiv.org/abs/1711.09020 for details about the model.
See https://github.com/yunjey/StarGAN for the original pytorvh implementation.
"""
from __future__ import absolute_import
from __future__ import division
from ... |
"""
This modules handles exif data for files.
"""
import os
import datetime
try:
import pyexiv2
hasPyExif2=True
except:
hasPyExif2=False
if not hasPyExif2:
try:
import EXIF
hasEXIF=True
except:
hasEXIF=False
import sys
import stat
import subprocess
import wx
import io
i... |
from .modulefilter import Filter
from collections import defaultdict, MutableMapping
from threading import Lock
class IRegistrant():
def __init__(self, loader, plg_filter):
self.plg_filter = plg_filter
self.loader = loader
self.start_loading()
self.load()
self.end_loading(... |
#!/usr/bin/env python
#
# l o d e 3 . p y
#
import time, ttyLinux
from util import *
class Player :
def setDirection (self, ch) : pass
def move (self) :
global inPlay, you
spot = getSpot(self.row,self.col)
lspot = getSpot(self.row,self.col-1)
rspot = getSpot(self.row,self.col+1)
horz,vert = self.dir
... |
# -*- coding: utf-8 -*-
import sys
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
install_requires = ['requests >= 1.2.0']
if sys.version_info < (3, 2):
install_requires.insert(0, 'futures >= 2.1.3')
setup(name='tinys3',
version='0.1.11',
description=("... |
import os
import pytest
import six
from six.moves import configparser
from rebasehelper.cli import CLI
from rebasehelper.config import Config
class TestConfig(object):
CONFIG_FILE = 'test_config.cfg'
@pytest.fixture
def config_file(self, config_args):
config = configparser.ConfigParser()
... |
import time
from waterbutler import tasks
from waterbutler.server.api.v0 import core
from waterbutler.core import remote_logging
class MoveHandler(core.BaseCrossProviderHandler):
JSON_REQUIRED = True
ACTION_MAP = {
'POST': 'move'
}
async def post(self):
if not self.source_provider.ca... |
from .identifiable import Identifiable
class Response(Identifiable):
"""Defines a response. All schemas that could be returned at the root of a
response should inherit from this.
You probably want to use the sub-classes and not this class directly. Known
sub-classes are: SearchResponse, Thing, Answer... |
#!/usr/bin/env python
import logging
from math import floor
import time
import traceback
from panda.tasks.base import AbortableTask
from django.conf import settings
from django.utils import simplejson as json
from django.utils.translation import ugettext
from livesettings import config_value
from panda import solr, ... |
# coding: utf-8
from time import time
from typing import Tuple, Any
from .camera import Camera
from .._global import OptionalModule
import numpy as np
try:
import cv2
except (ModuleNotFoundError, ImportError):
cv2 = OptionalModule("opencv-python")
try:
from picamera import PiCamera
except (ModuleNotFoundError,... |
from a10sdk.common.A10BaseClass import A10BaseClass
class Static(A10BaseClass):
"""Class Description::
Static MAC commands.
Class static supports CRUD Operations and inherits from `common/A10BaseClass`.
This class is the `"PARENT"` class for this module.`
:param dest: {"default": 0, "option... |
#!/usr/bin/env python
class SecurityGrant:
def __init__(self, cidr_ip, name, owner_id):
self.cidr_ip = cidr_ip
self.name = name
self.owner_id = owner_id
def to_s(self):
if self.cidr_ip == None:
return "name=%s owner=%s" % (self.name, self.owner_id)
else:
... |
__author__ = "Michael Cohen <<EMAIL>>"
"""A plugin to install relevant kernel modules to enable live analysis.
The intention is to allow the user to launch:
rekall live
and have Rekall install the right kernel module and connect to the driver on all
supported operating systems.
"""
import os
import platform
import ... |
from __future__ import absolute_import
import os
import pyinotify
__all__ = ('DirWatcher',)
class _EventHandler(pyinotify.ProcessEvent):
def __init__(self, callback, notify_once):
pyinotify.ProcessEvent.__init__(self)
self._callback = callback
self._notify_once = notify_once
sel... |
""" The SANSConfigurations class holds instrument-specific configs to centralize instrument-specific magic numbers"""
# pylint: disable=too-few-public-methods
from __future__ import (absolute_import, division, print_function)
class Configurations(object):
class LARMOR(object):
# The full wavelength rang... |
import logging
from ..i18n import sanitize_language_code, set_request_lang
from .._compat import string_type
from ..support.converters import asbool
from ..configuration.utils import coerce_config
from .base import ApplicationWrapper
log = logging.getLogger(__name__)
class I18NApplicationWrapper(ApplicationWrapper):... |
__license__ = "MIT"
__all__ = [
'LXMLTreeBuilderForXML',
'LXMLTreeBuilder',
]
try:
from collections.abc import Callable # Python 3.6
except ImportError , e:
from collections import Callable
from io import BytesIO
from StringIO import StringIO
from lxml import etree
from bs4.element import (
C... |
"""Ordinary Least Squares regression classes."""
__author__ = "Luc Anselin <EMAIL>, David C. Folch <EMAIL>"
import numpy as np
import copy as COPY
import numpy.linalg as la
import user_output as USER
import summary_output as SUMMARY
import robust as ROBUST
from utils import spdot, sphstack, RegressionPropsY, Regressio... |
from django.db import models
from django.contrib.auth.models import Group, User
class BaseModel(models.Model):
"""
A set of common model attributes for every table in the OARN model.
"""
created_by = models.ForeignKey(
User,
verbose_name='created_by',
related_name='%(class)s_... |
from tensorflow.examples.tutorials.mnist import input_data
import tensorflow as tf
import numpy as np
def batches(batch_size, features, labels):
"""
Create batches of features and labels
Parameters
----------
batch_size: The batch size
features: List of features
labels: List of labels
... |
import io
import re
import os
from nltk.stem.snowball import SnowballStemmer
from b4msa.params import OPTION_NONE
from nltk.stem.porter import PorterStemmer
idModule = "language_dependency"
PATH = os.path.join(os.path.dirname(__file__), 'resources')
_HASHTAG = '#'
_USERTAG = '@'
_sURL_TAG = '_url'
_sUSER_TAG = '_us... |
import numpy as np
import pytest
import pandas as pd
from pandas import Series, Timedelta, timedelta_range
from pandas.util.testing import assert_series_equal
class TestSlicing:
def test_slice_keeps_name(self):
# GH4226
dr = pd.timedelta_range('1d', '5d', freq='H', name='timebucket')
asse... |
# -*- coding: utf-8 -*-
'''
Tulip routine libraries, based on lambda's lamlib
Author Twilight0
License summary below, for more details please read license.txt file
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License... |
import sys
import os
def export_layer(input, outdir):
inkscape = "/Applications/Inkscape.app/Contents/Resources/bin/inkscape"
outdir += ".".join(os.path.basename(input).split('.')[:-1])
try:
os.mkdir(outdir)
except:
pass
olddefs = {
"arm-right": ["layer0"],
"torso": ... |
#!/usr/bin/env python3
import sys
import os
import subprocess
import getpass
import sendtoclipboard
def puaq():
print("Usage: %s password_file" % os.path.basename(__file__))
sys.exit(1)
def getpasswordfromcontents(contents):
local_contents = contents
ID_PATTERN_S="pw=["
ID_PATTERN_E="]"
o... |
from temboo.core.choreography import Choreography
from temboo.core.choreography import InputSet
from temboo.core.choreography import ResultSet
from temboo.core.choreography import ChoreographyExecution
import json
class XMLToCSV(Choreography):
def __init__(self, temboo_session):
"""
Create a new ... |
from datetime import datetime
from unittest.mock import patch
from odoo.addons.website_event_track.tests.common import TestEventTrackOnlineCommon
from odoo.fields import Datetime as FieldsDatetime
from odoo.tests.common import users
class TestSponsorData(TestEventTrackOnlineCommon):
@classmethod
def setUpCl... |
#!/usr/bin/env python
import json_compare
def test_list_of_hashes():
a = [
{"wtf": "omg"},
{"wtf1": "omg1"}
]
b = [
{"wtf": "omg"},
{"wtf1": "omg1"}
]
assert json_compare.are_same(a, b)[0]
def test_list_of_hashes_unordered():
a = [
{"wtf1": "omg1"},
... |
import os, sys
from opus_core.database_management.configurations.database_server_configuration import DatabaseServerConfiguration
from opus_core.database_management.opus_database import OpusDatabase
def opusRun(progressCB,logCB,params):
param_dict = {}
for key, val in params.iteritems():
param_dict[str... |
# -*- coding: utf-8 -*-
'''
Exodus Add-on
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This progra... |
'''
Used to convert the Microsoft Sentence Completion Challnege (MSCC) learning corpus into a one-sentence-per-line format.
'''
import sys
from nltk.tokenize import word_tokenize, sent_tokenize
def write_paragraph_lines(paragraph_lines):
paragraph_str = ' '.join(paragraph_lines)
for sent in sent_to... |
#!/usr/bin/env python
"""future04thread.py: Use ThreadPoolExecutor.
Usage:
future04thread.py
"""
from concurrent.futures import (
ThreadPoolExecutor, as_completed)
from urllib.request import urlopen
URLS = (
'https://twitter.com/showa_yojyo',
'http://www.geocities.jp/showa_yojyo/',
'https://github.c... |
# This script takes a BNF code mapping spreadsheet, and generates a new
# spreadsheet with the subset of the rows corresponding to VMP/AMP/VMPP/AMPP
# records in the database.
#
# Usage:
#
# python gen_test_snomed_mapping.py [inp_path] [outp_path]
import os
import sys
from openpyxl import Workbook, load_workbook
i... |
"""
Module providing easy API for working with remote files and folders.
"""
from __future__ import with_statement
import hashlib
import os
from StringIO import StringIO
from functools import partial
from fabric.api import run, sudo, hide, settings, env, put, abort
from fabric.utils import apply_lcwd
def exists(pa... |
__author__ = "mozman <<EMAIL>>"
import unittest
from dxfwrite.tableentries import Linetype
from dxfwrite import DXFEngine, dxfstr
class TestLinetypeTableEntry(unittest.TestCase):
pattern = Linetype.make_line_pattern_definition([0.6, 0.5, -0.1])
expected = " 0\nLTYPE\n 2\nDASHED\n 70\n0\n 3\nstrichliert\n%... |
from __future__ import unicode_literals
import re
import unicodedata
from gzip import GzipFile
from io import BytesIO
from django.utils import six
from django.utils.encoding import force_text
from django.utils.functional import (
SimpleLazyObject, keep_lazy, keep_lazy_text, lazy,
)
from django.utils.safestring im... |
'''
Created on 23 Jan 2011
@author: Mike Thomas
'''
from PyQt4 import QtGui
_ICON_CACHE = {"drumburp": "drumburp",
"repeat": "view-refresh",
"score": "audio-x-generic",
"copy": "edit-copy",
"paste": "edit-paste",
"delete": "edit-delete"}
de... |
from openerp import api, fields, models
from openerp.tools.float_utils import float_compare
class AccountInvoice(models.Model):
_inherit = 'account.invoice'
purchase_id = fields.Many2one('purchase.order', string='Add Purchase Order',
help='Encoding help. When selected, the associated purchase order l... |
import os
from django.core.urlresolvers import reverse
from django.contrib.auth import authenticate
from rest_framework import status
from rest_framework.test import APITestCase
from mock import patch, MagicMock
from django.core.files import File
from django.contrib.auth.models import User
from api.models import Us... |
from __future__ import unicode_literals
from six.moves.urllib import parse as urlparse
from keystoneclient import base
from keystoneclient.v3.contrib.oauth1 import utils
try:
from oauthlib import oauth1
except ImportError:
oauth1 = None
class RequestToken(base.Resource):
def authorize(self, roles):
... |
#! /usr/bin/env python
info = """
###############################################################################
# #
# switchcfg.py #
# Accessory of Contexo - (c) Scalado AB 200... |
"""
Welcome to the encoding dance!
In a nutshell, text columns are actually a proxy class for byte columns,
which just encode/decodes contents.
"""
from mitmproxy.tools.console import signals
from mitmproxy.tools.console.grideditor import col_bytes
class Column(col_bytes.Column):
def __init__(self, heading, enc... |
from odoo import http, _
from odoo.addons.portal.controllers.portal import _build_url_w_params
from odoo.http import request, route
class PaymentPortal(http.Controller):
@route('/invoice/pay/<int:invoice_id>/form_tx', type='json', auth="public", website=True)
def invoice_pay_form(self, acquirer_id, invoice_i... |
import random,sys
fname=sys.argv[1]
lines=map(lambda x:x.split("\t"),open(fname).readlines())
names=map(lambda x:(x[2],int(x[4])-int(x[3])),lines)
random.shuffle(names)
m={}
goodLines=[]
for (name,dim) in names:
line=lines.pop()
c=0
while m.has_key(line[3]) and m[line[3]].has_key(name):
c=c+1... |
# -*- coding: utf-8 -*-
from setuptools import setup, find_packages
setup(
name='ciworker',
version='0.2.2',
description='Cytoscape CI ciworker service template',
long_description='Template worker code for Cytoscape CI.',
author='Keiichiro Ono',
author_email='<EMAIL>',
url='https://github.... |
from oslo_config import cfg
from nova.tests.functional.api_sample_tests import test_servers
CONF = cfg.CONF
CONF.import_opt('osapi_compute_extension',
'nova.api.openstack.compute.legacy_v2.extensions')
class ServersMetadataJsonTest(test_servers.ServersSampleBase):
extends_name = 'core_only'
... |
"""
Unified Volume driver for IBM XIV and DS8K Storage Systems.
"""
from oslo_config import cfg
from oslo_utils import importutils
from cinder import exception
from cinder.openstack.common import log as logging
from cinder.volume.drivers.san import san
xiv_ds8k_opts = [
cfg.StrOpt(
'xiv_ds8k_proxy',
... |
from django.conf import settings
def server(request):
"""
Puts IS_LOCAL setting, the VERSION and the Orbited configuration into context.
"""
if settings.ORBITED_PORT == "auto":
oport = request.META["SERVER_PORT"]
else:
oport = settings.ORBITED_PORT
return {'IS_LOCAL': settings.IS_LOCAL,
'ORBITED_SERVER'... |
"""Arm Compute Library supported operators."""
import tvm
from tvm.relay.expr import const
from tvm.relay import transform
from tvm.relay.build_module import bind_params_by_name
from ...dataflow_pattern import wildcard, is_op, is_constant, is_expr
from .register import register_pattern_table
def is_arm_compute_runti... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import division
import time
import os
import sys
import serial
import argparse
"""
Read sensor values from an Arduino with a Piezo sensor. This script will read
in values from a serial connection with the Arduino and calculate the walking
speed or the nu... |
from astropy import config as _config
class Conf(_config.ConfigNamespace):
"""
Configuration parameters for `astroquery.vo_conesearch`.
"""
# Config related to remote database of "reliable" services.
vos_baseurl = _config.ConfigItem(
'https://astroconda.org/aux/vo_databases/',
'URL... |
"""
pdlearn.utils
~~~~~~~~~~~~~
Collection of utility functions for the pdlearn package.
"""
import logging
import warnings
from functools import wraps
import pandas as pd
LOGGER = logging.getLogger(__name__)
class CompatabilityWarning(Warning):
""" Warning to be used when models trained on a different type ... |
import typing
from defx.base.source import Base as Source
from defx.source.file.list import Source as SourceList
from defx.source.file import Source as SourceFile
from defx.context import Context
from defx.sort import sort
from defx.util import Nvim
from defx.util import cd, error
from pathlib import Path
Candidate ... |
#!/usr/bin/env python3
import database
import api
db = database.Database()
api = api.Api("json")
# Ensure the correct post keys were sent
if api.check_keys(("member_id", "session_id")):
member_id = api.request["member_id"].value
session_id = api.request["session_id"].value
if db.check_session(member... |
import pygame
import random
from pygame.surface import Surface
from core.entity.entity_body import EntityBody
from core.graph.point import Point
def load_half_image(name):
return pygame.image.load(name)
images_man = (
load_half_image('asset/man.png'),
load_half_image('asset/man2.png'),
load_half_imag... |
#!/usr/bin/env python
"""A registry based configuration parser."""
# NOTE: Running a 32 bit compiled client and 64 bit compiled client on a 64 bit
# system will run both clients on _DIFFERENT_ hives according to the WOW64
# scheme. This means that GRR will appear to have different clients for the same
# system. The cl... |
import os
import sys
import time
import PythonQt
from PythonQt import QtCore, QtGui, QtUiTools
from director.timercallback import TimerCallback
from director.consoleapp import ConsoleApp
from director import applogic
from director import transformUtils
from director import filterUtils
from director import visualizati... |
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import json
import time
from ansible.module_utils._text import to_text
from ansible.module_utils.connection import ConnectionError
from ansible.module_utils.network.common.utils import to_list
from ansible.plugins.httpapi import H... |
'''
Created on 21/2/2015
@author: usuario.apellido
'''
class Articulos:
def __init__(self):
self.data = []
def add(self, x):
self.data.append(x)
def addtwice(self, x):
self.add(x)
self.add(x)
print()
#Herencia
class Palabras (Articulos):
def __ini... |
from playlist.models import SlackUser, Song
import simplejson as json
import pickle
from Queue import Queue
class PlaylistService:
def __init__(self, reco_service):
self.reco_service = reco_service
self.load()
def enqueue(self, song):
self.load()
self.reco_service.next_reco_for... |
import sys
import os
from paddle.trainer_config_helpers import *
def seq_to_seq_data(data_dir,
is_generating,
dict_size=30000,
train_list='train.list',
test_list='test.list',
gen_list='gen.list',
ge... |
#!/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... |
"""
An implementation of semantics and validations described in RFC 3986.
See http://rfc3986.readthedocs.io/ for detailed documentation.
:copyright: (c) 2014 Rackspace
:license: Apache v2.0, see LICENSE for details
"""
from .api import iri_reference
from .api import IRIReference
from .api import is_valid_uri
from .a... |
from __future__ import with_statement
import sqlite3
import logging
logger = logging.getLogger('zim.notebook.index')
try:
import gobject
except ImportError:
gobject = None
from zim.newfs import LocalFile, File, Folder, FileNotFoundError
from zim.signals import SignalEmitter
from zim.utils import natural_sort_ke... |
#!/usr/bin/env python
"""
:Author Patrik Valkovic
:Created 31.08.2017 11:55
:Licence MIT
Part of grammpy
"""
from unittest import TestCase, main
from grammpy.exceptions import TreeDeletedException
from grammpy.old_api import Nonterminal, Rule
class A(Nonterminal): pass
class B(Nonterminal): pass
class C(Nontermin... |
import codecs
import logging
import mimetypes
import os
log = logging.getLogger(__name__)
class Writer(object):
"""
Writer only cares about the ``filters`` and ``base_path`` in the
``index``. It doesn't know anything about the routes, but only knows
how to render them once they're received.
"""
... |
from twisted.python import usage
from ConfigParser import ConfigParser
from AZTKServer import AZTKServer
import Image, ImageFile, sys, errors, validation, pprint, md5, time, socket, zsp_packets
from twisted.internet.protocol import Factory
from twisted.internet.app import Application
from twisted.internet import defer,... |
import contextlib
import threading
import time
import weakref
from dogpile.cache import api
from dogpile.cache import proxy
from dogpile.cache import region
from dogpile.cache import util as dogpile_util
from dogpile.core import nameregistry
from oslo_config import cfg
from oslo_log import log
from oslo_utils import i... |
import unittest
import re
import sys
from webkitpy.common.host_mock import MockHost
from webkitpy.layout_tests.port import test
from webkitpy.layout_tests.servers.http_server import Lighttpd
from webkitpy.layout_tests.servers.http_server_base import ServerError
class TestHttpServer(unittest.TestCase):
def test_s... |
#!/usr/bin/env python
from __future__ import print_function
import argparse
import subprocess
import json
import os
import requests
import subprocess
import sys
from marathon import Marathon
from cli.utils import printException, printErrorMsg
requests.packages.urllib3.disable_warnings()
# we probably need to remove (... |
def f1(name, q_list):
print(type(q_list))
for q in q_list:
print(q)
q_list.append('xxx')
q_list.sort()
print(name)
def read_bin_file(file_name):
with open(file_name,'rb') as f:
for line in f.readlines():
s = line.decode()
print('line = %s' %l... |
#!/usr/bin/env python3
import subprocess
import time
from enum import Enum
import threading
import os
import signal
import serial
import json
import mmap
import sys
from rct_udp_command import CommandListener
import sys
import shlex
import argparse
import datetime
import sys
import glob
WAIT_COUNT = 60
init_thread_op... |
from paddle.trainer.config_parser import *
__all__ = [
'ParamAttr', 'ExtraAttr', 'ParameterAttribute', 'ExtraLayerAttribute'
]
def convert_and_compare(x, Type):
"""
Convert x to be the same type as Type and then convert back to
check whether there is a loss of information
:param x: object to be ch... |
HIGH = 0x01 # define HIGH 0x1
LOW = 0x00 # define LOW 0x0
#===============================================================================
# CONSTANTS - Pin modes
#===============================================================================
INPUT = 0x00 # define INPUT 0x0
OUTPUT = 0x01 # define OUTPUT 0x1
#==... |
import unittest
import numpy
from mantid.kernel import logger
from mantid.simpleapi import CreateWorkspace, Fit, mtd, SaveNexus
from mantid.api import AnalysisDataService
import sys
class DSFinterp1DTestTest(unittest.TestCase):
def generateWorkspaces(self, nf, startf, df, e=False, seed=10):
'''Helper function... |
#!/usr/bin/python
from macaroon.playback import *
import utils
sequence = MacroSequence()
#sequence.append(WaitForDocLoad())
sequence.append(PauseAction(5000))
sequence.append(utils.StartRecordingAction())
sequence.append(KeyComboAction("<Control>Home"))
sequence.append(utils.AssertPresentationAction(
"1. Top o... |
__author__ = 'julien'
import SimpleITK as sitk
import numpy as np
# from __future__ import print_function
import matplotlib.pyplot as plt
# %matplotlib inline
# from IPython.html.widgets import interact, fixed
OUTPUT_DIR = "Output"
print(sitk.Version())
import numpy as np
def point2str(point, precision=1):
"... |
from setuptools import setup, find_packages
from setup_helpers import get_version
setup(
# metadata
name='django-configglue',
version=get_version('django_configglue/__init__.py'),
author='Ricardo Kirkner',
author_email='<EMAIL>',
description='Django commands for managing configglue generated ... |
from copy import deepcopy
from time import time
from numpy.random import uniform, normal
from numpy import pi, sqrt, mod
from numpy import dot
from .geometry import Tet
from .graph import packing_graph
from .graph import exact_igraph
def uniform_sample(packing, cell, N_add):
"""Uniformally sample the cell volume a... |
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()
mobi... |
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
# The server side implementation of the user cache
# This is an abstract superclass that can be implemented with couchbase, azure,
# or our builtin solution.
# Note also... |
'''Module for the tor client'''
import os
import re
import time
import subprocess
import threading
import socket
import random
from murmeli.system import System, Component
from murmeli.message import Message
from murmeli.decrypter import DecrypterShim
from murmeli import dbutils
from murmeli import guinotification
c... |
# encoding: UTF-8
"""
一个ATR-RSI指标结合的交易策略,适合用在股指的1分钟和5分钟线上。
注意事项:
1. 作者不对交易盈利做任何保证,策略代码仅供参考
2. 本策略需要用到talib,没有安装的用户请先参考www.vnpy.org上的教程安装
3. 将IF0000_1min.csv用ctaHistoryData.py导入MongoDB后,直接运行本文件即可回测策略
"""
import talib
import numpy as np
from ctaBase import *
from ctaTemplate import CtaTemplate
####################... |
import random
import json
import time
import glob
import os
from constants import TMPSTORE_DIR, CW_SESSION_TIMEOUT, ALPHABET, H_METHOD
import db_interface as db
#### temporary storage facility using plaintext files ####
"""
Obviously, this is NOT the ideal alternative of implementing a temporary storage.
Some file... |
from __future__ import print_function
import espressomd._system as es
import espressomd
from espressomd import thermostat
from espressomd import code_info
from espressomd import analyze
from espressomd import integrate
from espressomd import electrostatics
import numpy
print("""
=======================================... |
#!/usr/bin/env python
# --!-- coding: utf8 --!--
from PyQt5.QtCore import pyqtSignal, QTimer
from PyQt5.QtWidgets import QWidget, qApp
from manuskript.ui.editors.locker_ui import Ui_locker
class locker(QWidget, Ui_locker):
locked = pyqtSignal()
unlocked = pyqtSignal()
lockChanged = pyqtSignal(bool)
... |
import urllib2
import numpy as np
aadict = { 'A' : 0,
'R' : 1,
'N' : 2,
'D' : 3,
'C' : 4,
'Q' : 5,
'E' : 6,
'G' : 7,
'H' : 8,
'I' : 9,
'L' : 10,
'K' : 11,
'M' : 12,
'F' : 13,
'P' : 14,
'S' : 15,
'T' : 16,
'W' : 17,
'Y' : 18,
'V' : 19,
'U' ... |
from builtins import range
import os, json
import numpy as np
import h5py
BASE_DIR = 'cs231n/datasets/coco_captioning'
def load_coco_data(base_dir=BASE_DIR,
max_train=None,
pca_features=True):
data = {}
caption_file = os.path.join(base_dir, 'coco2014_captions.h5')
wit... |
"""pytest for iddgroups"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from io import StringIO
import eppy.EPlusInterfaceFunctions.iddgroups as iddgroups
iddtxt = """! W/m2, W or deg C
! W/s
! W/W
!... |
import spotipy
import spotipy.util as util
from spotipy.oauth2 import SpotifyClientCredentials
import pandas as pd
import numpy as np
import json
# Returns dataframe of IDs and features for each input track
def get_features_for_tracks(track_ids_array):
client_credentials_manager = SpotifyClientCredentials()
s... |
from .forms import GroupAdminForm, CustomUserForm
from .forms import PageForm
from .models import UserProfile, Log
from django.contrib import admin
from django.contrib.auth.admin import UserAdmin, GroupAdmin
from django.contrib.auth.decorators import login_required
from django.contrib.auth.models import User, Group
fro... |
class Response(object):
'''Response facade.
This class provides a common interface to response classes provided by
various HTTP client libraries.
It should not perform any caching; webracer's own Response will take
care of that.
Instances of this class are meant to be constructed ... |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'designer/mainwindow.ui'
#
# by: pyside-uic 0.2.15 running on PySide 1.2.1
#
# WARNING! All changes made in this file will be lost!
from PySide import QtCore, QtGui
class Ui_MainWindow(object):
def setupUi(self, MainWindow):
... |
import github.GithubObject
import github.NamedUser
import github.CommitStats
import github.Gist
class GistHistoryState(github.GithubObject.CompletableGithubObject):
"""
This class represents GistHistoryStates
"""
@property
def change_status(self):
"""
:type: :class:`github.Commit... |
"""A setuptools based setup module.
See:
https://packaging.python.org/en/latest/distributing.html
https://github.com/pypa/sampleproject
"""
# Always prefer setuptools over distutils
from setuptools import setup, find_packages
# To use a consistent encoding
from codecs import open
from os import path
here = path.absp... |
#!/usr/bin/python
#
# CRAN submissions use the R CMD CHECK --as-cran approach.
# But that unfortunately does not do a good job of flagging errors in a way that can be automated.
#
# This tool goes combs through the output and returns 0 if it's good and nonzero if it's bad.
#
import sys
import os
import re
class Che... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.