text stringlengths 475 200k |
|---|
#!/usr/bin/env python2.7
from subprocess import Popen, PIPE, check_call
from os import remove
# N.B., this MUST be run from within the source directory!
# local test
p1 = Popen(["./test/testLocal", "test/test.bw"], stdout=PIPE)
try:
p2 = Popen(["md5sum"], stdin=p1.stdout, stdout=PIPE)
except:
p2 = Popen(["md5... |
"""
Django settings for nnmm project.
Generated by 'django-admin startproject' using Django 1.11.7.
For more information on this file, see
https://docs.djangoproject.com/en/1.11/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.11/ref/settings/
"""
import os
#... |
# encoding: UTF-8
"""
基于King Keltner通道的交易策略,适合用在股指上,
展示了OCO委托和5分钟K线聚合的方法。
注意事项:
1. 作者不对交易盈利做任何保证,策略代码仅供参考
2. 本策略需要用到talib,没有安装的用户请先参考www.vnpy.org上的教程安装
3. 将IF0000_1min.csv用ctaHistoryData.py导入MongoDB后,直接运行本文件即可回测策略
"""
from __future__ import division
import numpy as np
import talib
from vnpy.trader.app.ctaStrategy.... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Cycle through i3 containers
"""
from argparse import ArgumentParser
from i3_tree import i3Tree
import i3
def find_focusable(node):
"""
Search for the first focusable window within the node tree
"""
if not node.children:
return node
if n... |
# -*- coding:utf-8 -*-
# Copyright 2015 NEC Corporation. #
# #
# Licensed under the Apache License, Version 2.0 (the "License"); #
# you may not use this file except in compliance with the License... |
# coding: utf-8
#
# Copyright 2018 The Oppia Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... |
from zerver.lib.test_classes import WebhookTestCase
from zerver.webhooks.gosquared.view import CHAT_MESSAGE_TEMPLATE
class GoSquaredHookTests(WebhookTestCase):
STREAM_NAME = "gosquared"
URL_TEMPLATE = "/api/v1/external/gosquared?stream={stream}&api_key={api_key}"
WEBHOOK_DIR_NAME = "gosquared"
# Note... |
# Copyright (c) 2012 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to ... |
#!/usr/bin/env python
"""
Re-write config file and optionally convert to python
"""
__revision__ = "$Id: writeCfg.py,v 1.1 2011/10/05 21:22:11 paus Exp $"
__version__ = "$Revision: 1.1 $"
import getopt
import imp
import os
import pickle
import sys
import xml.dom.minidom
from random import SystemRandom
from ProdCom... |
# Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
#Copyright ReportLab Europe Ltd. 2000-2012
#see license.txt for license details
#history http://www.reportlab.co.uk/cgi-bin/viewcvs.cgi/public/reportlab/trunk/reportlab/graphics/widgets/signsandsymbols.py
# signsandsymbols.py
# A collection of new widgets
# author: John Precedo ([EMAIL])
__version__=''' $Id$ '''
__doc... |
from toee import *
from utilities import *
from ed import *
from batch import *
###################################################################
### (18:55 20/04/06) A script written by Glen Wheeler (Ugignadl) for manipulating ToEE files.
### Requested by Cerulean the Blue from Co8.
##
### (13:05 22/04/06)... |
#!/usr/bin/env python
# coding=utf-8
"""
Site: http://www.beebeeto.com/
Framework: https://github.com/ff0000team/Beebeeto-framework
"""
import requests
from base64 import b64encode
from baseframe import BaseFrame
from utils.payload.webshell import PhpShell
from utils.payload.webshell import PhpVerify
class MyPoc(... |
from smashbox.utilities import *
__doc__ = """ This test moves files from one folder to another.
"""
testsets = [ {'dirMove_DIRA':'DIRA',
'dirMove_DIRB':'DIRB' }
]
import os.path
DIRA = os.path.normpath(config.get('dirMove_DIRA','DIRA'))
DIRB = os.path.normpath(config.get('dirMove_DIRB'... |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
# metadata
'''
Load metadata (DocType) class
Example:
meta = frappe.get_meta('User')
if meta.has_field('first_name'):
print("DocType" table has field "first_name")
'''
from __future__ import unicode_literals, ... |
from functools import wraps
def memoised_property(function):
@wraps(function)
def wrapper(self):
if not isinstance(self, MemoisableObject):
raise TypeError('Can only memoise properties of MemoisableObject instances')
try:
return self._memoised_properties[function]
... |
"""
Singularities
=============
This module implements algorithms for finding singularities for a function
and identifying types of functions.
The differential calculus methods in this module include methods to identify
the following function types in the given ``Interval``:
- Increasing
- Strictly Increasing
- Decre... |
import os
import json
import httplib
import contextlib
import jsonschema
import pydvid
import re
def get_json_generic( connection, resource_path, schema=None ):
"""
Request the json data found at the given resource path, e.g. '/api/datasets/info'
If schema is a dict, validate the response against it.
... |
import time
import datetime
import importlib
from ifind.search.query import Query
from ifind.search.cache import QueryCache
from ifind.search.engines import ENGINE_LIST
from ifind.search.exceptions import EngineLoadException
from ifind.search.exceptions import InvalidQueryException
class Engine(object):
"""
... |
# -*- coding: utf-8 -*-
#
# This file is part of django-taggit-autocomplete-modified.
#
# django-taggit-autocomplete-modified provides autocomplete functionality
# to the tags form field of django-taggit.
#
# Development Web Site:
# - http://www.codetrax.org/projects/django-taggit-autocomplete-modified
# Public... |
import random
import unittest
import sys
sys.path.append("../")
from steerstats.SteerStats import SteerStats
from steersuite.SteerStatsOptions import getOptions
class ORCATester(unittest.TestCase):
def setUp(self):
self.seq = list(range(10))
@unittest.skip("demonstrating skipping")
def test_skip... |
# Copyright (c) 2012 NTT DOCOMO, INC.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... |
#!/usr/bin/env python
# Copyright (c) 2017-2018 the Volcano Authors. Licensed under GPLv3.
# rep.py: a regexp search-and-replace tool
import errno
import os
import re
import sys
if len(sys.argv) != 5:
if len(sys.argv) != 6 or sys.argv[1] != "-":
print("Usage: %s input.txt output.txt pattern replacement" % sys.a... |
# Twisted Python OpenTSDB Client
# [EMAIL] (Adam Fletcher)
#
# Copyright 2012 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/lic... |
# -*- coding: utf-8 -*-
# Zararlı URL Duyuru istemcisi
# Author: Mert SARICA
# E-mail: mert [ . ] sarica [ @ ] gmail [ . ] com
# URL: http://www.mertsarica.com
# Consumer key:
# Consumer secret:
# Access Token key:
# Access Token secret:
import feedparser
import re
import urllib, urllib2, urlparse
impor... |
import os
from sst import actions, config
from collections import namedtuple
StoredContext = namedtuple(
'StoredContext',
'context base_url timeout poll args'
)
def populate_context(
context, path, browser_type,
javascript_disabled, arguments=None
):
"""Create the execution context ... |
import SofaPython.Quaternion as quat
import Tools
from Tools import cat as concat
from numpy import *
class Frame:
# a rigid frame, group operations are available.
# TODO kwargs
def __init__(self, value = None):
if value is not None:
self.translation = v... |
# -*- coding: utf-8 -*-
#$HeadURL$
#$LastChangedDate$
#$LastChangedRevision$
import os
from setuptools import setup, find_packages
version = '0.93'
def read(*rnames):
return open(os.path.join(os.path.dirname(__file__), *rnames)).read()
long_description = (
read('LICENSE.txt')
+ '\n' +
'Detailed Docu... |
# Copyright 2016 Casey Jaymes
# This file is part of PySCAP.
#
# PySCAP 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.
#
# PySCAP is ... |
###########################################
# IMPORTS
###########################################
from simtk.openmm import app
from simtk import unit, openmm
import numpy as np
import os
import random
from nose.tools import nottest
from pkg_resources import resource_filename
from perses.annihilation.relative import H... |
#!/usr/bin/env python
#
# Copyright 2007 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... |
"""SCons.Tool.Packaging.zip
The zip SRC packager.
"""
#
# Copyright (c) 2001 - 2015 The SCons Foundation
#
# 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
# ... |
import argparse
import unittest
from util import *
modify_actions1 = ['append', 'truncate']
modify_actions2 = ['concat', 'merge']
class TestMover(unittest.TestCase):
def test_double_actions1(self):
for action1 in modify_actions1:
for action2 in MOVE_TYPES:
file_path = create_... |
# encoding: utf-8
#
# Copyright © 2015 ATS Advanced Telematic Systems GmbH
#
# This file is part of Docker Launcher.
#
# Docker Launcher 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... |
""" Tests for subgraphs attributes
"""
from copy import deepcopy
from nose.tools import assert_equal
import networkx as nx
# deprecated in 2.1 for removal in 2.2
class TestSubgraphAttributesDicts:
def setUp(self):
self.undirected = [
nx.connected_component_subgraphs,
nx.biconnect... |
"""
GitLab API: https://docs.gitlab.com/ee/api/jobs.html#list-pipeline-bridges
"""
import pytest
import responses
from gitlab.v4.objects import ProjectPipelineBridge
@pytest.fixture
def resp_list_bridges():
export_bridges_content = {
"commit": {
"author_email": "[EMAIL]",
"author_... |
# Copyright 2013 IBM Corp.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... |
#!/usr/bin/python
#
# Copyright 2012 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... |
#!/usr/bin/env python3
#
# Copyright (C) 2015 Matthias Klumpp <[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.0 of the License, or (at your option) any later vers... |
from datetime import datetime, timedelta
import logging
from django.core.cache import cache
from django.db import models
import bleach
import caching.base as caching
from celeryutils import task
from tower import ugettext_lazy as _
import amo.models
from amo import helpers
from translations.fields import save_signal... |
# Checks database migration functions
import sys
import os
import io
import bsddb3
import unittest
import tempfile
import logging
import shutil
from argparse import Namespace
from xclib.dbmops import perform
from xclib.tests.iostub import iostub
from xclib.utf8 import utf8
from xclib.check import assertEqual
from xclib... |
#!/usr/bin/env python
# Copyright (c) 2017 The WebRTC project authors. All Rights Reserved.
#
# Use of this source code is governed by a BSD-style license
# that can be found in the LICENSE file in the root of the source
# tree. An additional intellectual property rights grant can be found
# in the file PATENTS. All ... |
#!/usr/bin/python
# -*- coding: UTF-8 -*-
__author__ = 'king-jojo'
from graphviz import Digraph
from AST_Process import Node_extract
import re
import os
RE_AZ = re.compile(r'-(.*?) ')
RE_C = re.compile(r'/(.*).c')
def node_graph(code_path, preprocess, same_list):
"""Show the syntax tree and display the same pa... |
#-*- coding=utf-8 -*-
#author: [EMAIL]
"""
try to get sip msg block in SIPp output msgs
1. msg may be sent or received.
2. seperator
"""
import os
import sys
import re
import sipparser
path = os.path.dirname(os.path.realpath(__file__))
sys.path.append(os.path.join(path+'/../'))
from logConf import ... |
from django.template import Library, Node, TemplateSyntaxError, Variable, VariableDoesNotExist
from django.template import resolve_variable
from django.core.cache import cache
from django.utils.encoding import force_unicode
from django.utils.http import urlquote
from django.utils.hashcompat import md5_constructor
regi... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (c) 2012 Jérémie DECOCK (http://www.jdhp.org)
# 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 witho... |
import sys
x = 0
y = 0
#Check if the args are correct
if len(sys.argv) == 3:
file_name = sys.argv[1]
colors = sys.argv[2]
vertexes = "0"
matrix = []
#Creating the output file
data_file=open('data.lsp','w')
#Opening the txt file
file = open(file_name)
line = file.... |
# Copyright (C) 2014-2016 Andrey Antukh <[EMAIL]>
# Copyright (C) 2014-2016 Jesús Espino <[EMAIL]>
# Copyright (C) 2014-2016 David Barragán <[EMAIL]>
# Copyright (C) 2014-2016 Alejandro Alonso <[EMAIL]>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General... |
# -*- coding: utf-8 -*-
#############################
# Light IMDb Ratings Update #
# by axlt2002 #
#############################
# changes by dziobak #
#############################
import xbmc, xbmcgui
import sys
if sys.version_info >= (2, 7): import json as jSon
else: import simplejson as jSon... |
import numpy as np
import numpy.matlib as matlib
import random
from math import sin, sqrt
''' Problem Definition'''
def MOP2(x):
n=len(x)
z1=1-np.exp(-np.sum(np.power((x-1/sqrt(n)),2))) #ckeck exp for single
z2=1-np.exp(-np.sum((x+1/sqrt(n))**2))
... |
# Copyright (C) 2002, Thomas Hamelryck ([EMAIL])
# This code is part of the Biopython distribution and governed by its
# license. Please see the LICENSE file that should have been included
# as part of this package.
"""Consumer class that builds a Structure object.
This is used by the PDBParser and MMCIFparser cla... |
# Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... |
"""
This is the base Player class to be used for representing players in the
tournament. It is assumed that the tournament will be held in the U.S.,
and under AGA rules.
"""
import unittest
from copy import copy
class Player(object):
"""Player Class that holds basic player information.
Players ... |
import time
from PLC.Faults import *
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
from PLC.Table import Row
from PLC.Auth import Auth
from PLC.Slices import Slice, Slices
from PLC.Sites import Site, Sites
from PLC.TagTypes import TagTypes
from PLC.SliceTags import SliceTags
from PLC.Method... |
from haystack import indexes
from django.conf import settings
from oscar.core.loading import get_model, get_class
# Load default strategy (without a user/request)
Selector = get_class('partner.strategy', 'Selector')
strategy = Selector().strategy()
class ProductIndex(indexes.SearchIndex, indexes.Indexable):
# S... |
#!/usr/bin/env python
from loginsightwebhookdemo import app, parse, callapi
from flask import request, json
import base64
import re
__author__ = "John Dias and Steve Flanders"
__license__ = "Apache v2"
__version__ = "1.3"
# vRealize Orchestrator server workflow hostname:port (default port is 8281)
VROHOSTNAME = ''
... |
from __future__ import unicode_literals, division, absolute_import
from builtins import * # noqa pylint: disable=unused-import, redefined-builtin
from future.moves import urllib
import logging
import json
import re
import http.cookiejar
from flexget import plugin
from flexget.config_schema import one_or_more
from fl... |
# -*- coding: utf-8 -*-
"""
Created on Thu Nov 26 20:07:31 2015
Common lists used on GSRT
@author: irnakat
"""
mode = ['sh-linear-elastic',
'sh-linear-viscoelastic',
'sh-linear-elastic-adv',
'sh-linear-viscoelastic-adv',
'sh-kennet',
'psv-p-linear-elastic-adv',
... |
import sys
sys.path.append('/nfs/xf05id1/src/nsls2-xf-utils')
import srxslit
import srxfe
import srxbpm
import tempdev
import srxm2
import math
from ophyd import (Device, PVPositionerPC, EpicsMotor, Signal, EpicsSignal,
EpicsSignalRO, Component as Cpt, FormattedComponent as FCpt,
... |
import cStringIO
import hashlib
import MySQLdb
import os
import random
import signal
import sys
import threading
import time
import string
CHARS = string.letters + string.digits
def sha1(x):
return hashlib.sha1(str(x)).hexdigest()
# Should be deterministic given an idx
def get_msg(do_blob, idx):
random.seed(idx)... |
"""This demo program solves Poisson's equation
- div grad u(x, y) = f(x, y)
on the unit square with source f given by
f(x, y) = exp(-100(x^2 + y^2))
and homogeneous Dirichlet boundary conditions.
Note that we use a simplified error indicator, ignoring
edge (jump) terms and the size of the interpolation con... |
# encoding: 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 'Playlist'
db.create_table('gadget_playlist', (
('id', self.gf('django.db.model... |
# File: main.py
# Library: DOPAL - DO Python Azureus Library
#
# 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; version 2 of the License.
#
# This program is distributed in the hope that it will ... |
import ctypes
import numpy as np
import os
libpath = os.path.dirname(os.path.realpath(__file__))
lib = ctypes.cdll.LoadLibrary(libpath+'\snip.so')
FWHM_c = lib.FWHM_c
FWHM_c.restype = ctypes.c_double # reset return types. default is c_int
FWHM_c.argtypes = [ctypes.c_double, ctypes.c_double, ctypes.c_double]
def FWHM... |
#!/usr/bin/env python
"""Contains the Comments and Job classes."""
import datetime
TIME_FORMAT = "%Y-%m-%d %H:%M:%S"
class Job(object):
"""This class describes a job that was discovered in a comment."""
name = None
time = None
url = None
# SUCCESS or FAILURE
result = None
# the raw j... |
"""Support for OwnTracks."""
from collections import defaultdict
import json
import logging
import re
from aiohttp.web import json_response
import voluptuous as vol
from homeassistant import config_entries
from homeassistant.components import mqtt
from homeassistant.const import (
ATTR_GPS_ACCURACY,
ATTR_LATI... |
import logging
from time import sleep
import os, tempfile
from overc.src.init import init_db_engine, init_db_session
from overc.lib.db import models
from overc.lib import alerts
logger = logging.getLogger(__name__)
# TODO: these routines should obtain an exclusive lock so multiple supervise processes does not issue ... |
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
#import gettext
#_ = gettext.gettext
class TextException(Exception):
"""docstring for TextException"""
def __init__(self, message):
super(TextException, self).__init__()
self.message = message
def __str__(self):
return self.message
class NoCellError(TextExc... |
# Copyright 2019 The Magenta Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... |
"""
Slightly customized python-social-auth backend for SAML 2.0 support
"""
import logging
from django.http import Http404
from django.utils.functional import cached_property
from social.backends.saml import SAMLAuth, OID_EDU_PERSON_ENTITLEMENT
from social.exceptions import AuthForbidden, AuthMissingParameter
log = lo... |
# using the 39 phone set proposed in (Lee & Hon, 1989)
# Table 3. Mapping from 61 classes to 39 classes, as proposed by Lee and Hon, (Lee & Hon,
# 1989). The phones in the left column are folded into the labels of the right column. The
# remaining phones are left intact.
phoneme_set_61_39 = {
'ao': 'aa', # 1
... |
#!/usr/bin/env python
# Copyright (C) 2006-2016 Music Technology Group - Universitat Pompeu Fabra
#
# This file is part of Essentia
#
# Essentia is free software: you can redistribute it and/or modify it under
# the terms of the GNU Affero General Public License as published by the Free
# Software Foundation ... |
/*
* Copyright (C) 2010 by RoboLab - University of Extremadura
*
* This file is part of RoboComp
*
* RoboComp 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 Lice... |
import unohelper
from com.sun.star.lang import XServiceName
from com.sun.star.lang import XMain
import string
import urllib
g_ImplementationHelper = unohelper.ImplementationHelper()
class getNode( unohelper.Base, XServiceName, XMain ):
def __init__( self, ctx ):
self.output = "No output"
def ge... |
# -*- coding: utf-8 -*-
# flake8: noqa
"""This file is useful for external code like tests and form compilers,
since it enables the syntax "from ufl.classes import CellFacetooBar" for getting
implementation details not exposed through the default ufl namespace.
It also contains functionality used by algorithms for deal... |
#----------------------------------------------------------------------------------------------------------------------
# Introdução a Programação de Computadores - IPC
# Universidade do Estado do Amazonas - UEA
# Prof. Jucimar Jr
# Alexandre Marques Uchôa 1715310028
# Carlos Eduardo Tapudima de Olive... |
import csv, sys, re, sys
from os import listdir
from os.path import isfile, join
from SQLManager import SQLManager
import time
'''
@Author: Brandon Harmon ([EMAIL])
@Sponsor: T.M. Rajkumar ([EMAIL])
Parser for Miami University's grade distribution CSV file format
into a SQLite database. Intended for use in conjuntion... |
import subprocess, time, os, threading, math
from intra.system import system_manager
from intra.cgroup import cgroup_manager
from intra.billing import billing_manager
class smart_controller:
def set_policy(policy):
smart_controller.policy = policy
def start(interval = 4):
thread = threading.Thread(target = ... |
"""
Backends for embarrassingly parallel code.
"""
import gc
import os
import warnings
import threading
import functools
import contextlib
from abc import ABCMeta, abstractmethod
from .my_exceptions import WorkerInterrupt
from ._multiprocessing_helpers import mp
if mp is not None:
from .pool import MemmappingPoo... |
# Copyright 2016, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... |
#!/usr/bin/env python
# -- Content-Encoding: UTF-8 --
"""
RequiresBest handler implementation
:author: Thomas Calmant
:copyright: Copyright 2020, Thomas Calmant
:license: Apache License 2.0
:version: 1.0.1
..
Copyright 2020 Thomas Calmant
Licensed under the Apache License, Version 2.0 (the "License");
y... |
import wx
import eos.db
import gui.mainFrame
from gui import globalEvents as GE
from gui.fitCommands.calc.shipModeChange import CalcChangeShipModeCommand
from gui.fitCommands.helpers import InternalCommandHistory
from service.fit import Fit
class GuiChangeShipModeCommand(wx.Command):
def __init__(self, fitID, i... |
# -*- coding: utf-8 -*-
#------------------------------------------------------------
# PalcoTV Parser de torrent-tv.ru
# Version 0.1 (17.10.2014)
#------------------------------------------------------------
# License: GPL (http://www.gnu.org/licenses/gpl-3.0.html)
# Gracias a la librería plugintools de Jesús (www.mim... |
# -*- coding: utf-8 -*-
"""
sphinx.cmdline
~~~~~~~~~~~~~~
sphinx-build command-line handling.
:copyright: 2008 by Georg Brandl.
:license: BSD.
"""
import os
import sys
import getopt
import traceback
from os import path
from docutils.utils import SystemMessage
from sphinx import __version__
from... |
# Copyright 2011 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... |
#
# Copyright (c) SAS Institute Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in w... |
# Generated by Django 2.1.7 on 2019-03-20 15:49
from django.db import migrations
def copy_access_level(apps, schema_editor):
"""
Sets new restriction field of states according to access_level.
"""
# We get the model from the versioned app registry;
# if we directly import it, it will be the wrong... |
##############################
# #
# Instructions #
# #
##############################
# To run, use the following command:
# $ python infiniteelves.py
# The original password
puzzle_input = 34000000
# Get a list of all the factors of x
def get_fact... |
#!/usr/bin/env python
#==============================================================================
# Copyright 2012 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Amazon Software License (the "License"). You may not use
# this file except in compliance with the License. A copy of the... |
# Copyright 2011 the Melange authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wr... |
import os
import subprocess
from gpaw.test.big.agts import Cluster
class NiflheimCluster(Cluster):
def __init__(self, asepath='', setuppath='$GPAW_SETUP_PATH'):
self.asepath = asepath
self.setuppath = setuppath
def submit(self, job):
dir = os.getcwd()
os.chdir(job.dir... |
#!/usr/bin/env python
# encoding: utf-8
import argparse
import os.path
from zstacklib import *
from datetime import datetime
def add_true_in_command(cmd):
return "%s || true" % cmd
# create log
logger_dir = "/var/log/zstack/"
create_log(logger_dir)
banner("Starting to deploy zstack network agent")
start_time = d... |
from __future__ import annotations
import logging
from typing import TYPE_CHECKING, Union, Tuple, List, Optional
from opentrons import types, commands as cmds, hardware_control as hc
from opentrons.commands import CommandPublisher
from opentrons.protocols.types import APIVersion
from opentrons.protocols.implementatio... |
from decimal import Decimal as D
from django.test import TestCase
from django.utils import unittest
from django.conf import settings
from paypal.payflow import gateway
@unittest.skipUnless(getattr(settings, 'PAYPAL_RUN_EXTERNAL_TESTS', False),
"External tests are not enabled")
class TestGateway(... |
#!/usr/bin/env python
# This is a mapping between the pixmap-mixed.c program written
# by Naofumi for GtkGLExt. I've changed that to Python in an
# OO manner. It's a simple test that mixes OpenGL and GDK drawing
# calls using a GdkPixmap. In the end we end up with a black
# rectangle drawn by GDK and a reddish sphere... |
import os
import logging
import argparse
from gii.core import Project, app
from gii.core.tools import Build
cli = argparse.ArgumentParser(
prog = 'gii build',
description = 'Build GII Host(s) for current project'
)
cli.add_argument( 'targets',
type = str,
nargs = '*',
default = 'native'
)
cli.add_argument( ... |
########################################################################
# File : CloudDirector.py
# Author : A.Tsaregorodtsev
########################################################################
""" The Cloud Director is a simple agent performing VM instantiations
"""
import os
import random
import socket
im... |
# Microhack, a PyGame reimplementation of TinyHack.
# Written by Jim MacArthur, January 2013
# TinyHack originally by Rob Beschizza: http://boingboing.net/rob/tinyhack/
import pygame
from pygame.locals import *
from tilereader import readMap
import random
# Enum definition from Alec Thomas on StackOverflow
def enum(... |
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... |
#!/usr/bin/python
#
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
# Common Development and Distribution License (the "License").
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
# or http://www.... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.