code
stringlengths
1
199k
import frappe from frappe.templates.pages.style_settings import default_properties def execute(): frappe.reload_doc('website', 'doctype', 'style_settings') style_settings = frappe.get_doc("Style Settings", "Style Settings") if not style_settings.apply_style: style_settings.update(default_properties) style_settin...
from __future__ import absolute_import, print_function, unicode_literals import os import sys from os.path import exists from os.path import join from os.path import dirname from os.path import abspath if __name__ == "__main__": base_path = dirname(dirname(abspath(__file__))) print("Project path: {0}".format(ba...
from __future__ import absolute_import, division, print_function from .common import Benchmark, TYPES1, squares import numpy as np class AddReduce(Benchmark): def time_axis_0(self): [np.add.reduce(a, axis=0) for a in squares.values()] def time_axis_1(self): [np.add.reduce(a, axis=1) for a in squ...
from __future__ import (absolute_import, division) __metaclass__ = type import sys import json import syslog from ansible.compat.tests import unittest from ansible.compat.tests.mock import patch, MagicMock from units.mock.procenv import swap_stdin_and_argv import ansible.module_utils.basic try: # Python 3.4+ fr...
"""Helpers to deal with manifests.""" import json import pathlib component_dir = pathlib.Path("homeassistant/components") def iter_manifests(): """Iterate over all available manifests.""" manifests = [ json.loads(fil.read_text()) for fil in component_dir.glob("*/manifest.json") ] return sorted(m...
"""QGIS Unit tests for QgsProjectTimeSettings. .. note:: 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 2 of the License, or (at your option) any later version. """ __author__ = 'Samwe...
import sys import MacOS import sys from bgenlocations import TOOLBOXDIR, BGENDIR sys.path.append(BGENDIR) from scantools import Scanner, Scanner_OSX def main(): print "---Scanning CarbonEvents.h---" input = ["CarbonEvents.h"] output = "CarbonEventsgen.py" defsoutput = TOOLBOXDIR + "CarbonEvents.py" ...
''' DOCUMENTATION: cache: memory short_description: RAM backed, non persistent description: - RAM backed cache that is not persistent. version_added: historical author: core team (@ansible-core) ''' from __future__ import (absolute_import, division, print_function) __metaclass__ = type from ...
from __future__ import unicode_literals import frappe from frappe.utils import cint, flt from frappe import _ from frappe.model.document import Document class SalaryManager(Document): def get_emp_list(self): """ Returns list of active employees based on selected criteria and for which salary structure exists ...
'''Add syntax highlighting to Python source code''' __author__ = 'Raymond Hettinger' import keyword, tokenize, cgi, re, functools try: import builtins except ImportError: import __builtin__ as builtins def is_builtin(s): 'Return True if s is the name of a builtin' return hasattr(builtins, s) def combine...
from __future__ import (absolute_import, division, print_function) __metaclass__ = type DOCUMENTATION = ''' name: constructed plugin_type: inventory version_added: "2.4" short_description: Uses Jinja2 to construct vars and groups based on existing inventory. description: - Uses a YAML config...
from inc_cfg import * test_param= TestParam( "Callee=no SRTP, caller=optional SRTP", [ InstanceParam("callee", "--null-audio --max-calls=1"), InstanceParam("caller", "--null-audio --use-srtp=1 --srtp-secure=0 --max-calls=1") ] )
import unittest from django.contrib.gis.gdal import HAS_GDAL from django.contrib.gis.tests.utils import (no_mysql, no_oracle, oracle, postgis, spatialite, HAS_SPATIALREFSYS, SpatialRefSys) from django.db import connection from django.utils import six test_srs = ({'srid': 4326, 'auth_name': ('EPSG', Tru...
import os from telemetry.page.actions import page_action class PinchAction(page_action.PageAction): def __init__(self, selector=None, text=None, element_function=None, left_anchor_ratio=0.5, top_anchor_ratio=0.5, scale_factor=None, speed_in_pixels_per_second=800): super(PinchAction, ...
from __future__ import (absolute_import, division, print_function) __metaclass__ = type import os def main(): # required by external automated processes and should not be moved, renamed or converted to a symbolic link original = 'examples/scripts/ConfigureRemotingForAnsible.ps1' # required to be packaged wi...
""" Command-line utility to start a stub service. """ import sys import time import logging from .comments import StubCommentsService from .xqueue import StubXQueueService from .youtube import StubYouTubeService from .ora import StubOraService from .lti import StubLtiService from .video_source import VideoSourceHttpSer...
ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'community'} DOCUMENTATION = r''' --- module: win_timezone version_added: '2.1' short_description: Sets Windows machine timezone description: - Sets machine time to the specified timezone. optio...
from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( ExtractorError, urlencode_postdata, ) class StreamcloudIE(InfoExtractor): IE_NAME = 'streamcloud.eu' _VALID_URL = r'https?://streamcloud\.eu/(?P<id>[a-zA-Z0-9_-]+)(?:/(?P<fname>[^#?]*)\.html)?' ...
import warnings from django.contrib.gis.db.models.fields import ( GeometryField, LineStringField, PointField, get_srid_info, ) from django.contrib.gis.db.models.lookups import GISLookup from django.contrib.gis.db.models.sql import ( AreaField, DistanceField, GeomField, GMLField, ) from django.contrib.gis.geomet...
ANSIBLE_METADATA = {'metadata_version': '1.0', 'status': ['preview'], 'supported_by': 'community'} DOCUMENTATION = ''' --- module: solaris_zone short_description: Manage Solaris zones description: - Create, start, stop and delete Solaris zones. This module doesn't currently al...
from __future__ import (absolute_import, division, print_function) __metaclass__ = type from ansible.module_utils._text import to_native from ansible.plugins.connection import ConnectionBase DOCUMENTATION = """ connection: localconn short_description: do stuff local description: - does stuff opt...
from lib2to3.fixes.fix_basestring import FixBasestring
from __future__ import unicode_literals import logging import sys import warnings from logging import NullHandler # NOQA from logging.config import dictConfig # NOQA from django.conf import settings from django.core import mail from django.core.mail import get_connection from django.utils.deprecation import RemovedIn...
import unittest from test import test_support import os class BoolTest(unittest.TestCase): def assertIs(self, a, b): self.assert_(a is b) def assertIsNot(self, a, b): self.assert_(a is not b) def test_subclass(self): try: class C(bool): pass except...
"""Classes and functions for turning a piece of text into an indexable stream of "tokens" (usually equivalent to words). There are three general classes involved in analysis: * Tokenizers are always at the start of the text processing pipeline. They take a string and yield Token objects (actually, the same token obje...
from __future__ import unicode_literals from django import http from django.db import models from django.contrib.databrowse.datastructures import EasyModel from django.contrib.databrowse.sites import DatabrowsePlugin from django.shortcuts import render_to_response from django.utils.html import format_html, format_html_...
from .commitinfo import CommitInfo from webkitpy.common.config.committers import CommitterList from webkitpy.common.net.bugzilla.bugzilla_mock import _mock_reviewers from webkitpy.common.system.filesystem_mock import MockFileSystem class MockCommitMessage(object): def message(self): return "This is a fake c...
from client import Cookies, Element, Find, Session, Timeouts, Window from error import ( ElementNotSelectableException, ElementNotVisibleException, InvalidArgumentException, InvalidCookieDomainException, InvalidElementCoordinatesException, InvalidElementStateException, InvalidSelectorExcepti...
import os import sys import unicodedata from subprocess import Popen as _Popen, PIPE as _PIPE def _which_dirs(cmd): result = set() for path in os.environ.get('PATH', '').split(os.pathsep): filename = os.path.join(path, cmd) if os.access(filename, os.X_OK): result.add(path) return...
""" Make sure the link order of object files is the same between msvs and ninja. """ import TestGyp import sys if sys.platform == 'win32': test = TestGyp.TestGyp(formats=['msvs', 'ninja']) CHDIR = 'linker-flags' test.run_gyp('link-ordering.gyp', chdir=CHDIR) test.build('link-ordering.gyp', test.ALL, chdir=CHDIR...
from django.db import migrations, models import django.utils.timezone class Migration(migrations.Migration): dependencies = [ ('relaydomains', '0005_auto_20161105_1426'), ] operations = [ migrations.AlterField( model_name='relaydomain', name='last_modification', ...
from netadmin.exceptions import ParseError from protocol import ReceivedMessage, IRCString, Channel, User BINARY_COMMANDS = ( 'PING', 'PONG', ) TERNARY_COMMANDS = ( ) def get_event_name(msg): return 'on_' + msg.command.lower() def parse_line(line): msg = ReceivedMessage() msg.line = clean_line = lin...
from core.himesis import Himesis import uuid class HEFactory(Himesis): def __init__(self): """ Creates the himesis graph representing the DSLTrans rule EFactory. """ # Flag this instance as compiled now self.is_compiled = True super(HEFactory, self).__init__(name='HEF...
import feedparser import json import urllib import webbrowser hot = feedparser.parse("http://www.billboard.com/rss/charts/hot-100") print "================================" print "= BILLBOARD HOT 100 =" print "================================" print "" for x in range(0,25): #search = hot['entries'][x]['c...
from smugcli import task_manager import io_expectation as expect import datetime import freezegun import itertools from parameterized import parameterized import sys import unittest class TaskManagerTests(unittest.TestCase): def except_status(self, status_string): expect_escape = expect.Regex(r'\033\[J|' ...
import tensorflow as tf import numpy as np import random from carmunk import Game import pygame import math n_hidden = [32] + [64]*6 + [32] n_min_epsilon = 0.01 # minimum value of epsilon for an epsilon reinforcement learner n_input = 6 # the number of state values we'll use as input to our network n_actions = 3 # the...
from twisted.internet import pollreactor pollreactor.install() from twisted.internet import reactor reactor.run()
""" Known Issues: ------------- - GlyphLineView does not properly handle fonts that are not saved to a file. this is because there is not good way to find the font index for a given font and the preview control requires a font index. so, the best thing i can do at this point is get the font index by comparing fil...
from distutils.core import setup setup(name='MRSspendfrom', version='1.0', description='Command-line utility for Marsmello "coin control"', author='Gavin Andresen', author_email='gavin@Marsmellofoundation.org', requires=['jsonrpc'], scripts=['spendfrom.py'], )
import os import sys from math import log10 def main(*args, **kwargs): fpath = os.path.join(os.getcwd(), args[-2]) f = open(fpath, 'r') seq = f.readline().strip() gc_array = map(float, f.readline().strip().split()) f.close() opath = os.path.join(os.getcwd(), args[-1]) fo = open(opath, 'w') ...
r"""Runs idealized jump and sloped 1d shelf tests""" import sys from clawpack.riemann import layered_shallow_water_1D import clawpack.clawutil.runclaw as runclaw from clawpack.pyclaw.plot import plot import multilayer as ml def jump_shelf(num_cells,eigen_method,**kargs): r"""Shelf test""" # Construct output and...
from __future__ import (absolute_import, division, print_function) from qtpy import QtCore from qtpy.QtWidgets import QApplication from addie.processing.mantid.master_table.import_from_database.conflicts_solver import ConflictsSolverHandler from addie.processing.mantid.master_table.table_row_handler import TableRowHand...
""" Default parameters of the energy storage systems. The dictionary is used. """ import configuration.configuration_time_line as timeline BESS = \ { "AREA": 1, "CAP": 10000, "PMAX_DIS": 1000, "PMAX_CH": 1000, "EFF_DIS": 0.95, "EFF_CH": 0.95, "SOC_MAX": 1, ...
import os import re import sys import logging import fnmatch logger = logging.getLogger(__name__) class Linter(object): name = '' default_pattern = '' def __init__(self, working_dir, problems, options=None): self.working_dir = working_dir self.problems = problems self.options = optio...
import hashlib import logging import tempfile from datetime import datetime from enum import Enum from itertools import product from pathlib import Path from typing import Any, Dict, List, Optional from pydantic import BaseModel, Extra, validator from ruamel.yaml import YAMLError from .common import HarrierProblem, Pat...
import i3ipc import subprocess as proc import re import signal import sys FA_CALCULATOR = '\uf1ec' FA_CHROME = '\uf268' FA_COMMENTS_O = '\uf0e6' FA_CODE = '\uf121' FA_FILE_PDF_O = '\uf1c1' FA_FILE_TEXT_O = '\uf0f6' FA_FILES_O = '\uf0c5' FA_FIREFOX = '\uf269' FA_ENVELOPE_O = '\uf0e0' FA_EYEDROPPER = '\uf1fb' FA_MUSIC = ...
""" AccountintegrationApi.py Copyright 2015 SmartBear Software 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...
""" """ from . import core, geometry, string, misc # noqa execute = core.OdhQLFunction.execute create = core.OdhQLFunction.create
'''Expense views implementation.''' from django.contrib.admin.views.decorators import staff_member_required from django.contrib.auth.decorators import login_required from django.shortcuts import get_object_or_404, redirect, render from . import forms, models @login_required def new_budget(request): '''Create new bu...
import decimal from django.core.exceptions import ValidationError class IntegerValueType: @classmethod def template_name(cls): return "indicators/_integer_value.html" @classmethod def validate(cls, value): try: int(value) except ValueError: raise Validatio...
ROWS = 8 COLS=12 LETTER_BLOCK_ZERO = [ ' /$$$$$$ ', ' /$$$_ $$', '| $$$$\ $$', '| $$ $$ $$', '| $$\ $$$$', '| $$ \ $$$', '| $$$$$$/', ' \______/ ' ] LETTER_BLOCK_DOTS = [ ' ', ' /$$ ', ' |__/ ', ' ', ' /$$ ', ' |__/ ', ' ', ' ' ] LETTER_BLOCK_ONE = [ ' /$$ ', ' /$$$$ ', ...
"""Maximum path sum I Problem 18 Published on 31 May 2002 at 06:00 pm [Server Time] By starting at the top of the triangle below and moving to adjacent numbers on the row below, the maximum total from top to bottom is 23. 3 7 4 2 4 6 8 5 9 3 That is, 3 + 7 + 4 + 9 = 23. Find the maximum total from top to bottom of the ...
def array_sum(arr): sum = 0 for item in arr: if isinstance(item, list): sum = sum + array_sum(item) else: sum = sum + item return sum print array_sum([1,2,[3,4,[5]]]) def array_sum(arr): """ 1. Converts the array into the string and removes characters - '[', '...
import openpnm as op import numpy as np from openpnm.algorithms import MixedInvasionPercolationCoop as mpc import matplotlib.pyplot as plt import openpnm.models.geometry as gm plt.close('all') wrk = op.Workspace() wrk.loglevel = 50 class MixedPercolationCoopTest: def setup_class(self, Np=5): wrk.clear() ...
def get_country_names_list(): # Get a sorted list of all recognised country names # Used for the checkout form to make Country a drop down list return sorted(COUNTRIES.keys()) def get_country_codes(country): # Get the tuple of (alpha2, alpha3, numeric) codes for a country try: return COUNTRI...
import ast import logging import os from .model import (OWNER_CONST, GROUP_TYPE, Group, Node, Call, Variable, BaseLanguage, djoin) def get_call_from_func_element(func): """ Given a python ast that represents a function call, clear and create our generic Call object. Some calls have no ch...
''' MNIST Digit recognizer using Keras keras 2.0.6 ''' import pandas as pd import numpy as np np.random.seed(1337) # for reproducibility from keras import backend as K from keras.models import Sequential from keras.layers.core import Dense, Dropout, Activation, Flatten from keras.layers.convolutional import Conv2D, Max...
import datetime from types import FloatType, IntType from theape import BaseClass from theape import ApeError from theape import Component from theape.parts.eventtimer import EventTimer, wait IN_PWEAVE = __name__ == '__builtin__' class TheBigSleep(Component): """ A sleeper """ def __init__(self, end=Non...
import sqlite3 import urllib.error import ssl from urllib.parse import urljoin from urllib.parse import urlparse from urllib.request import urlopen from bs4 import BeautifulSoup scontext = None conn = sqlite3.connect('spider.sqlite') cur = conn.cursor() cur.execute('''CREATE TABLE IF NOT EXISTS Pages (id INTEGER PR...
from test.assert_json import assert_json from topcoder.binary_cardinality import solution def test_binary_cardinality (): assert_json('binary_cardinality', solution)
class Options(object): def __init__(self): self.font = None self.hotkey = None def read(self, settings): """Read options from the settings file.""" self.hotkey = settings.get('Options', 'HotKey') self.modifiers = None self.key_code = None if self.hotkey: ...
import sys import logging from datetime import datetime from pathlib import Path TRACE_API_NUM = 9 TRACE_API = "TRACE" class MaxLevelFilter(logging.Filter): """Filters (lets through) all messages with level < LEVEL""" def __init__(self, level: int, allow_trace: bool): self.level = level self.all...
from __future__ import print_function from __future__ import unicode_literals from __future__ import division from __future__ import absolute_import from future import standard_library standard_library.install_aliases() from hpOneView.resources.resource import ResourceClient from hpOneView.exceptions import HPOneViewEx...
from django.db import models class RelatedResource1(models.Model): name = models.CharField(max_length=255) active = models.BooleanField(default=True) def __str__(self): return self.name class RelatedResource2(models.Model): name = models.CharField(max_length=255) active = models.BooleanField...
from ..base import HaravanResource class Cart(HaravanResource): pass
""" lilkv.merkletree This module implements a basic Merkle Tree, which is used for comparing chunks of information in trees. """ class Child(object): def __init__(self, data): self.left, self.right = None, None self.data = data class MerkleTree(object): def __init__(self): se...
import os import subprocess from dallinger import db class TestDemos(object): """Verify all the built-in demos.""" def test_verify_all_demos(self): demo_paths = os.listdir(os.path.join("demos", "dlgr", "demos")) for demo_path in demo_paths: if demo_path == '__pycache__': ...
from django.conf.urls import url from . import views urlpatterns = [ url(r'^$', views.index, name='index'), url(r'^dashboard', views.dashboard, name='dashboard'), url(r'^user_feed', views.user_feed, name='user_feed'), url(r'^api/upload', views.upload, name='upload') ]
from .base import * # noqa from .base import env SECRET_KEY = env("DJANGO_SECRET_KEY") ALLOWED_HOSTS = env.list("DJANGO_ALLOWED_HOSTS", default=["realpython.com"]) DATABASES["default"] = env.db("DATABASE_URL") # noqa F405 DATABASES["default"]["ATOMIC_REQUESTS"] = True # noqa F405 DATABASES["default"]["CONN_MAX_AGE"]...
''' ================================================================================ This confidential and proprietary software may be used only as authorized by a licensing agreement from Thumb o'Cat Inc. In the event of publication, the following notice is applicable: Copyright (C) 2013 - 2014 Thumb o'Cat ...
try: from setuptools import setup, find_packages except ImportError: import ez_setup ez_setup.use_setuptools() from setuptools import setup, find_packages setup(name="pipexample", # semantic versioning is a simple way to define versions # http://semver.org/ version="0.0.1", descripti...
def test_get_news(sa_session, sa_backend, sa_child_news): assert(sa_child_news == sa_backend.get_news(sa_child_news.id)) assert(sa_backend.get_news(None) is None) def test_get_news_list(sa_session, sa_backend, sa_child_news): assert(sa_child_news in sa_backend.get_news_list()) assert(sa_child_news in sa...
from instanotifier.parser.rss import utils RSS_FEED_INFO_FIELDS = ["title", "link", "author", "published_parsed", "generator"] RSS_FEED_ENTRY_FIELDS = [ "title", "summary", "link", "published_parsed", "id", # hash or leave as is ] class RssParser(object): """ Parses RSS feed fetched by the RssF...
from FlaskApp import app as application if __name__ == "__main__": application.run()
import json config_complex = { 'main': 'assemble.scad', 'scad_type': 'openSCAD', 'requires': { 'neat_finger': {'scad_type': 'openSCAD', 'main': 'finger.scad'}, 'rocking_palm': {'scad_type': 'openSCAD', 'main': 'palm.scad'}}, 'working_directory': '/home/uploads/whatever/', 'output_dir...
from __future__ import absolute_import, division, print_function from astropy.coordinates import SkyCoord import numpy as np from os import path from io import StringIO from .WCSUtilsRunner import WCSUtilsRunner class XY2Sky(WCSUtilsRunner): def __init__(self, translator=None): # base implementation of __in...
import numpy as np import matplotlib.pyplot as plt from collections import defaultdict import zipfile from time import clock import percolations as perc import pretty_print as pp d_node_age = {} d_age_params = {} d_save_I_tstep = defaultdict(list) d_save_R_tstep = defaultdict(list) numsims = 1000 # number of simulatio...
def make_bricks(small, big, goal): return goal <= (small +big *5) and goal % 5 <= small
import codecs import glob import fnmatch import os import posixpath import shutil import subprocess import sys import time import re import urllib from datetime import datetime from http.server import HTTPServer, SimpleHTTPRequestHandler import markdown MARKDOWN_HEADER = re.compile(r'#+ ') FORMAT_ANCHOR = re.compile(r'...
import asyncio import mimetypes from pathlib import Path from .response import DataResponse, ResponseNotFound @asyncio.coroutine def index(request, writer, settings): full_path = (Path(settings.webapp_root) / 'index.html').resolve() with full_path.open('rb') as f: return DataResponse(writer, data=f.read...
"""Twitter API Listener. This program listens the tweets for specified keywords. If retrieved tweet is contains at least one of the keywords, it will written to the database. Location of the tweet is also recorded if tweet contains location data. Enis B. Tuysuz, 2016 enisbt.com enisbtuysuz@gmail.com github.com/enisbt Y...
import json from django.core.urlresolvers import reverse from rest_framework import status from rest_framework.test import APIClient from openslides import __version__ as version from openslides.core.config import ConfigVariable, config from openslides.core.models import CustomSlide, Projector from openslides.utils.res...
from blocks.model import Model def global_push_initialization_config(brick, initialization_config, filter_type=object): #TODO: this needs proper selectors! NOW! if not brick.initialization_config_pushed: raise Exception("Please push_initializatio_config first to pre...
"""Interface object framework. """ from __future__ import division from pyglet.window import key mode_directory = {} def get_handler(name, *args, **kwds): """Return a handler for the given mode name or None. Additional arguments are passed to the mode constructer. :Parameters: `name` : str ...
""" mir.py: A simple, single-file package of music information retrieval utilities for Python that emphasizes simplicity, modularity, and visualizations. Authors: Brennan Keegan, Steve Tjoa Institution: Signals and Information Group, University of Maryland Created: February 2, 2011 Last Modified: March 3, 2011 Basic fu...
""" Created on 27 Jan 2021 @author: Bruno Beloff (bruno.beloff@southcoastscience.com) example document: { "rec": "2021-11-02T10:53:15Z", "tag": "scs-opc-1", "ver": 1.0, "val": { "hostname": "scs-cube-001", "packs": { "scs_core": { "repo": "scs_core", ...
from django.db import migrations class Migration(migrations.Migration): dependencies = [ ("spectator_events", "0042_auto_20200407_1039"), ] operations = [ migrations.RenameField( model_name="event", old_name="ticket", new_name="thumbnail", ), ]
from __future__ import absolute_import from logging import getLogger from vcf_parser import Genotype from . import (build_info_dict, build_vep_annotation, check_info_annotation, build_compounds_dict, build_rank_score_dict, build_models_dict) def format_variant(line, header_parser, check_info=False): """ Yield t...
""" WSGI config for something_sunshine project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/1.7/howto/deployment/wsgi/ """ import os os.environ.setdefault("DJANGO_SETTINGS_MODULE", "something_sunshine.settings") ...
from __future__ import unicode_literals from django.db import models, migrations import mainstay.models import mptt.fields class Migration(migrations.Migration): dependencies = [ ] operations = [ migrations.CreateModel( name='Directory', fields=[ ('id', models...
"""Module to read from screts.ini.""" from ConfigParser import ConfigParser def get_secret(name): """ Read a secret from secrets.ini. :param basestring name: name of the secret :returns: value of the secret :rtype: basestring """ config = ConfigParser() config.read('/srv/oclubs/secrets.i...
from tweepy import OAuthHandler from tweepy import Stream from tweepy.streaming import StreamListener import socket import json import os from listener import listener def api_access(): config = {} with open('src/config.json') as f: config.update(json.load(f)) return config def keyword_load(): keyword = '' with ...
SUFFIX = None NAMESPACE_SUFFIX = None ARTIFACT_SUFFIX = None NAMESPACE_FORMAT = None ARTIFACT_FORMAT = None OUTPUT_FOLDER_FORMAT = None MAVEN_URL = 'https://repo1.maven.org/maven2/{group_id}/{artifact_id}/{version}/{artifact_id}-{version}.jar' SDK_ROOT = '../../../' # related to file dir AUTOREST_CORE_VERSION = '3.7.6...
""" This is a Tool to Evaluate a Synctool database """ import argparse from collections import namedtuple, Sequence import logging import sys from sqlalchemy import create_engine, and_ from sqlalchemy.orm import sessionmaker from base import Folder, File import database_logging __author__ = 'konsti' logger = logging.ge...
import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "widget_customization.settings") from django.core.management import execute_from_command_line execute_from_command_line(sys.argv)
def is_power(a,b): """ Check if a is a power of b """ if a==1: print 'power' elif a%b!=0: print 'NAh ,not a power' else: a = a/b is_power(a,b) print "Check if a is a power of b" a=raw_input("enter a : ") b = raw_input("enter b : ") is_power(int(a),int(b))
import numpy as np import tensorflow as tf class Optimizee: def __init__(self): self.coord_vector = None self.coord_pos = 0 self.coord_vars = {} self.vars_ = set() def custom_getter(self, getter, name, shape=None, *args, **kwargs): #print('getter', name, shape) de...
from optparse import OptionParser import sys import os import netsnmp import pickle import socket import struct import time os.environ['MIBS'] = 'all' # install mibs in net-snmp mibs directory # usually /usr/share/snmp/mibs package = ([]) def fetchOID(host, community, graphiteroot, diskio, ve...
from __future__ import print_function, unicode_literals import os, sys, json, ast import six from twisted.application import service from foolscap.api import Tub from foolscap.appserver.services import build_service from foolscap.util import move_into_place class UnknownVersion(Exception): pass def load_service_dat...
''' Created by auto_sdk on 2014-12-17 17:22:51 ''' from top.api.base import RestApi class LogisticsAddressRemoveRequest(RestApi): def __init__(self,domain='gw.api.taobao.com',port=80): RestApi.__init__(self,domain, port) self.contact_id = None def getapiname(self): return 'taobao.logistics.address.remove'