src stringlengths 721 1.04M |
|---|
from choco import lookup, compat
import unittest
from test.util import result_lines
class InheritanceTest(unittest.TestCase):
def test_basic(self):
collection = lookup.TemplateLookup()
collection.put_string('main', """
<%inherit file="base"/>
<%def name="header()">
main header.
</%def>
this ... |
"""
This module contains the logic to run the simulation.
"""
import sys
import os
import argparse
import numpy as np
sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
from robot_localisation.grid import Grid, build_transition_matrix
from robot_localisation.robot import Robot, Sensor
from robot_localisatio... |
"""
mtxPython - A framework to create matrix games.
Copyright (C) 2016 Tobias Stampfl <info@matrixgames.rocks>
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 in version 3 of the ... |
"""
Functions to support rapid interactive modification of Gurobi models.
For reference on Gurobi objects such as Models, Variables, and Constraints, see
http://www.gurobi.com/documentation/7.0/refman/py_python_api_overview.html.
"""
import csv
import json
try:
import gurobipy as gp
except ImportError:
raise ... |
from Numberjack import *
# Costas Array
# The costas array problem is to place N points on an N * N board such that each
# row and column contains only one point, and the pairwise distances between
# points is also distinct. i.e. such that each row of the triangular distance
# matrix constains no repeat distances.
... |
import os
from xml.etree.ElementTree import Element, SubElement
from xml.etree import ElementTree
from xml.dom import minidom
from .transformations import processTransformation
import zipfile
_warnings = []
# return a dictionary<int,list of rules>, where int is the Z value
# symbolizers are marked with a Z
#
# a rul... |
# -*- encoding: utf-8 -*-
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the ... |
# coding: utf-8
from __future__ import absolute_import
from datetime import datetime, timedelta
from dateutil.parser import parse as time_parse
from pytz import reference
from trello import TrelloClient
from config import (
TRELLO_CONFIG,
BOARD_ID,
DOING_LISTS,
DONE_LISTS,
DEV_MEMBERS
)
def get... |
#!/usr/bin/env python
import webbrowser
import tornado.ioloop
import tornado.web
__all__ = ['PrawOAuth2Server']
application = None
REDIRECT_URL = 'http://127.0.0.1:65010/authorize_callback'
SCOPES = ['identity', 'read']
REFRESHABLE = True
CODE = None
class AuthorizationHandler(tornado.web.RequestHandler):
de... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals
from six.moves import builtins
import inspect
import textwrap
import six
import sys
import functools
import os
from utool import util_print
from utool import util_time
from utool import util_iter
from utool import... |
import os
basedir = os.path.abspath(os.path.dirname(__file__))
class Config:
SECRET_KEY = os.environ.get('SECRET_KEY') or 'hard to guess string'
SSL_DISABLE = False
SQLALCHEMY_COMMIT_ON_TEARDOWN = True
SQLALCHEMY_RECORD_QUERIES = True
MAIL_SERVER = 'smtp.qq.com'
MAIL_PORT = 25
MAIL_USE_TL... |
#!/usr/bin/env python3
"""
Pymatrix
========
A lightweight, easy-to-use matrix module in pure Python. Supports a range of
basic linear algebra operations.
Sample syntax::
from pymatrix import matrix
m = matrix([
[1, 2],
[3, 4]
])
a = m + m * 2
b = m * m
c = m ** 3
d = m... |
"""Alignment object class"""
__author__ = "Grant Colasurdo"
class Alignment:
SHORT_TO_LONG = {
'N': 'Neutral',
'G': 'Good',
'E': 'Evil',
'C': 'Chaotic',
'L': 'Lawful',
'': ''
}
def __init__(self, short_string: str=""):
if "L" in short_string:
... |
import sys
from optparse import OptionParser
import os.path
import copy
from wheezy.template.engine import Engine
from wheezy.template.ext.core import CoreExtension
from wheezy.template.loader import FileLoader
script_dir = os.path.dirname(__file__) + os.sep
type_dic = {'BYTE' : '8',
'UNSIGNED_BYTE' : ... |
#!/usr/bin/env python
"""Make gamma-sky.net input data.
"""
import click
import gammasky
@click.group()
def cli():
"""The gamma-sky.net Python cli"""
pass
@cli.group()
def cat():
"""Dump catalog to JSON"""
@cli.group()
def source():
"""Dump source objects to JSON"""
@cat.command('all')
@click.pa... |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013 Midokura PTE LTD.
# 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/LICENS... |
#!/usr/bin/env python
# Fly ArduPlane in SITL
from __future__ import print_function
import math
import os
import time
from pymavlink import quaternion
from pymavlink import mavutil
from common import AutoTest
from common import AutoTestTimeoutException
from common import NotAchievedException
from common import Preco... |
from enigma import getPrevAsciiCode
from Tools.NumericalTextInput import NumericalTextInput
from Tools.Directories import resolveFilename, SCOPE_CONFIG, fileExists
from Components.Harddisk import harddiskmanager
from copy import copy as copy_copy
from os import path as os_path
from time import localtime, strftime
# Co... |
# Source Generated with Decompyle++
# File: item_lister_component.pyc (Python 2.5)
from __future__ import absolute_import
from ableton.v2.base import forward_property, index_if, listens, SlotManager, Subject
from ableton.v2.control_surface import Component, CompoundComponent
from ableton.v2.control_surface.control imp... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from pypermedia.client import HypermediaClient
import requests
if __name__ == '__main__':
siren_client = HypermediaClient.connect('http://localhost:8000/api/taskboa... |
from __future__ import division
import tensorflow as tf
import numpy as np
from utils import *
class Seq2Seq:
"""
"""
def __init__(self, config):
self.config = config
self.d1 = config['d1']
self.d2 = config['d2']
self.conv_layers = config['conv_layers']
self.fc_la... |
#!/usr/bin/env python
#----------------------------------------------------------------
# Author: Jason Gors <jasonDOTgorsATgmail>
# Creation Date: 11-19-2015
# Purpose:
#----------------------------------------------------------------
from Bep.core.release_info import name
from Bep.core import utils
from Bep import ... |
"""
Solution to simple exercises to get used to TensorFlow API
You should thoroughly test your code.
TensorFlow's official documentation should be your best friend here
CS20: "TensorFlow for Deep Learning Research"
cs20.stanford.edu
Created by Chip Huyen (chiphuyen@cs.stanford.edu)
"""
import os
os.environ['TF_CPP_MIN_... |
# -*- coding: latin -*-
import sys
#from PyQt5 import QtGui, QtCore, QtWidgets #, QTableWidget, QTableWidgetItem
from PyQt5.QtWidgets import QApplication, QWidget, QTableWidget, QTableWidgetItem, QLineEdit, QLabel
from PyQt5.QtCore import QSize, Qt
import pymysql
config = {
'host': 'localhost',
'port': 330... |
#!/usr/bin/env python
# This file is part of tcollector.
# Copyright (C) 2012 The tcollector Authors.
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, o... |
#!/usr/bin/env python
# processing.py -- various audio processing functions
# Copyright (C) 2008 MUSIC TECHNOLOGY GROUP (MTG)
# UNIVERSITAT POMPEU FABRA
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# publish... |
# ! /usr/bin/env python
# -*- coding: utf-8 -*-
"""mip.py
A utility to call mip from the command line
Usage:
mip.py <myfile> [--PDF --log]
mip.py -h | --help
Options:
-h --help Show this screen.
--PDF Print PDF to current directory
--log Take log of data first
"""
from docopt import d... |
#!/usr/bin/env python2.7
import sys
import os
# -*- coding: utf-8 -*-
"""
Created on Tue Oct 29 13:13:45 2013
CLASS-VERSION
@author: Kosai
"""
import cPickle as pickle
from datetime import datetime as dt
import time
import argparse
import gzip
class main:
'''
Class version of the cluster2fasta program
... |
from upseto import gitwrapper
from dirbalak.rackrun import solventofficiallabels
from dirbalak.rackrun import buildstate
from dirbalak.rackrun import traversefilterbuildbanned
from dirbalak import repomirrorcache
from dirbalak.server import tojs
import collections
import logging
class JobQueue:
NON_MASTER_DEPENDE... |
import unittest
import igraph as ig
import leidenalg
import random
from copy import deepcopy
from ddt import ddt, data, unpack
#%%
def name_object(obj, name):
obj.__name__ = name
return obj
graphs = [
###########################################################################
# Zachary karate network
... |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright 2011 Cisco Systems, 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... |
# -*- coding: utf-8 -*-
# Code for Life
#
# Copyright (C) 2016, Ocado Innovation Limited
#
# This program 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, either version 3 of the
# License, or (at your o... |
# Libraries
# Local
from lemur import models as m
from lemur import (app, db)
from lemur.utility_generate_and_convert import (check_existence,
generate_lab_id,
generate_experiment_id,
... |
# -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# 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... |
# -*- coding: utf-8 -*-
# Copyright 2010-2014, 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... |
# -*- coding: utf-8 -*-
import functools
import logging
import threading
from django.db.utils import ProgrammingError
from django.utils import timezone
from dynamic_logging.models import Trigger
logger = logging.getLogger(__name__)
class Scheduler(object):
"""
a special class that keep trace of the next ev... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright © 2008 Francesco Fumanti <francesco.fumanti@gmx.net>
#
# This file is part of Onboard.
#
# Onboard 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; eit... |
import collections
import datetime
#pypy import numpy
import random
import re
import struct
import subprocess
import sys
import zlib
import bio
import fasta
import features
import statistics
import vcf
SOFT_CLIP_CONFIDENCE = 0.0
class SamToMultiChromosomeVCF(object):
def __init__( self, sam, multi_fasta_reference... |
# -*- coding: utf-8 -*-
# Copyright (C) 2016 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
#
# This file is part of Kitty.
#
# Kitty 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 ver... |
# NixConfig
# Copyright (c) 2017 Mark Biciunas.
#
# 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 program is d... |
"""
Sponge Knowledge Base
Remote API security
"""
from org.openksavi.sponge.remoteapi.server.security import User
# Simple access configuration: role -> knowledge base names regexps.
ROLES_TO_KB = { "admin":[".*"], "anonymous":["public"], "standard":["public", "account", "service"]}
class RemoteApiCanUseKnowledgeBas... |
from sklearn.metrics import precision_recall_fscore_support
import pandas as pd
import numpy as np
from sklearn.ensemble import RandomForestClassifier
from sklearn.preprocessing import MinMaxScaler, normalize
df = pd.read_csv('../../Dataset/dataset.csv', delimiter='\t')
dataset = df.values
mask = np.random.rand(len... |
import sys
from PyQt5.QtWidgets import (QWidget, QHBoxLayout,
QLabel, QApplication, QLineEdit,
QFrame, QSplitter, QStyleFactory,
QComboBox)
from PyQt5.QtGui import QPixmap
from PyQt5.QtCore import Qt
class Example(QWidget):
def __init__(self):
super().__init__()
self.initUI(... |
"""This module is used to identify and filter out broadcast v2 broadcasts, which leads to significant
performance increases.
"""
import time
import struct
import collections
from typing import Dict
from iotile.cloud.utilities import device_id_to_slug
def packet_is_broadcast_v2(packet: bytearray) -> bool:
"""Simp... |
bl_info = {
"name": "Translate Datablock Names",
"author": "Joshua Zhang",
"version": (1, 0),
"blender": (2, 69, 0),
"location": "Search > (rename)",
"description": "A blender addon/plugin that helps to translate datablock \
names to English.",
"wiki_url": "",
"tracker_url": "",
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import abc
import os
from future.utils import with_metaclass
class BuildCommand(with_metaclass(abc.ABCMeta)):
def __init__(self, src_file, dst_dir, opts=None):
self.src_file = src_file
self.dst_dir = dst_dir
self.opts = opts or ''
@abc.... |
'''
async fetching of urls.
Assumes robots checks have already been done.
Success returns response object and response bytes (which were already
read in order to shake out all potential network-related exceptions.)
Failure returns enough details for the caller to do something smart:
503, other 5xx, DNS fail, connect... |
"""
This file is part of PUQ
Copyright (c) 2013 PUQ Authors
See LICENSE file for terms.
"""
from __future__ import absolute_import, division, print_function
import time, os, re, h5py, sys, string
import numpy as np
from puq.testprogram import TestProgram
from numpy import ndarray
from puq.hdf import get_output_names
f... |
#! /usr/bin/env python
###############################################################################
#
# Project: PySAR
# Purpose: Python Module for InSAR Time-series Analysis
# Author: Heresh Fattahi
# Created: July 2013
# Modified: Yunjun Zhang, Feb 2015
###########################################################... |
#!/usr/bin/env python
# -- Content-Encoding: UTF-8 --
"""
Pelix remote services implementation based on Herald messaging and xmlrpclib
:author: Thomas Calmant
:copyright: Copyright 2014, isandlaTech
:license: Apache License 2.0
:version: 0.0.3
:status: Alpha
..
Copyright 2014 isandlaTech
Licensed under the ... |
from django.shortcuts import render
from django.views.generic import ListView
from django.views.decorators.csrf import csrf_exempt
from django.http import HttpResponse, HttpResponseRedirect
# IMPORT REST
from rest_framework import status, generics, mixins, viewsets
from rest_framework.decorators import api_view
from re... |
# encoding: utf-8
#
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
#
# Author: Kyle Lahnakoski (kyle@lahnakoski.com)
#
from __future__ import absolute_import
from __... |
#
# Copyright (C) 2012-2019 Nexedi SA
#
# 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.
#
# This program is distributed... |
from __future__ import division
"""
Apply smoothing to rate computation
[Longer Description]
Author(s):
Myunghwa Hwang mhwang4@gmail.com
David Folch dfolch@asu.edu
Luc Anselin luc.anselin@asu.edu
Serge Rey srey@asu.edu
"""
__author__ = "Myunghwa Hwang <mhwang4@gmail.com>, David Folch <dfolch@asu.edu... |
import sys
import os
import glob
import argparse
from subprocess import call
from bounding_box import BoundingBox
import json
import itertools
import utils
def export_mesh(jar_file, image_width, image_height, out_fname, conf=None):
conf_args = utils.conf_args_from_file(conf, 'ExportMesh')
java_cmd = 'java -Xm... |
# Copyright 2013 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... |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 Red Hat, 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
#
#... |
__author__ = 'kaufmanno'
import numpy as np
from scipy.interpolate import pchip_interpolate, interp1d
import matplotlib.pyplot as plt
draw_graphs = True
#draw_graphs = False
load_calibration = True
save_calibration = False
calibration_file = 'calibration.txt'
single_flow = True # a varying flow otherwise a series o... |
import logging
import time
from typing import Tuple
from urllib.parse import urlsplit, urljoin
from bs4 import BeautifulSoup
from feedrsub.feeds.feedfinder.feedinfo import FeedInfo
from feedrsub.utils.requests_session import RequestsSession, requests_session
logger = logging.getLogger("feedfinder4")
def coerce_url... |
#!/usr/bin/env python
# encoding: utf-8
from __future__ import (absolute_import, division,
print_function, unicode_literals)
import os, sys, re
import logging
import argparse
import collections
logging.basicConfig(stream=sys.stderr, level=logging.INFO)
logger = logging.getLogger(__file__)
de... |
###########################################################
#
# Copyright (c) 2010, Southpaw Technology
# All Rights Reserved
#
# PROPRIETARY INFORMATION. This software is proprietary to
# Southpaw Technology, and is not to be reproduced, transmitted,
# or disclosed in any way without written permi... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = 'Jiri'
from lxml import etree
import requests
import csv
import xlrd
import sys
import argparse
from dateutil.parser import parse
import time
import datetime
import unicodedata
########################################
# checks if the file is a file or not ... |
# Copyright (C) 2015-2019 Magenta ApS, https://magenta.dk.
# Contact: info@magenta.dk.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#!/usr/bin/env python
import s... |
# ############################################################################
#
# Copyright (c) Microsoft Corporation.
#
# This source code is subject to terms and conditions of the Apache License, Version 2.0. A
# copy of the license can be found in the License.html file at the root of this distribution. If
# you ca... |
__author__ = 'mikael.brandin@devolver.se'
import argparse
from collections import namedtuple
import os
import datetime
from . import exceptions as exceptions
from client import output
import configparser
ConfigName = namedtuple('ConfigName', ['module', 'branch'])
# Constants
META_SECTION = 'general'
class Conf... |
#! /Users/rkrsn/anaconda/bin/python
from __future__ import print_function
from __future__ import division
from pdb import set_trace
from os import environ, getcwd
from os import walk
from os import remove as rm
from os.path import expanduser
from pdb import set_trace
import sys
# Update PYTHONPATH
HOME = expanduser('... |
#---------------------------------------------------------------------------
#
# DichotomousBranching.py: dichotomous branching pattern based on the
# combination of an activator-depleted substrate model and a vein
# formation substance Y.
#
# Y formation is triggered by the activator A. The vascular system to
# be for... |
from django.http import HttpResponse, HttpResponseRedirect, Http404
from django.utils import simplejson as json
import logging
from webui.agent.models import Agent
from django.template.loader import render_to_string
from webui.agent.form import create_action_form
from django.template.context import RequestContext
from ... |
# -*- coding: utf-8 -*-
import os
from setuptools import setup, find_packages
def read(*rnames):
return open(os.path.join(os.path.dirname(__file__), *rnames)).read()
version = '0.1.0'
long_description = (read('../../readme.rst'))
setup(name='nexiles.gateway.example',
version=version,
description="... |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.3 on 2017-08-25 09:57
from __future__ import unicode_literals
from django.db import migrations, models
def set_physical(apps, schema_editor):
StockItem = apps.get_model('monitoring', 'StockItem')
BookSpecimen = apps.get_model('library', 'BookSpecimen')
... |
import os
import math
import subprocess
########################################
#f = open("standard_model.church")
f = open("standard_model_uniform.church")
ch_model = [l.rstrip() for l in f.readlines()]
f.close()
#pfile = open("binned_priors.txt")
pfile = open("/Users/titlis/cogsci/projects/stanford/projects/theg... |
#!/usr/bin/python
from __future__ import (absolute_import, division, print_function)
# Copyright 2019 Fortinet, Inc.
#
# 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 Lic... |
import unittest
import pickle
from csv import DictReader
from collections import Counter
from districts import district_margins, all_states, all_state_rows
kALASKA = """LINE,STATE ABBREVIATION,STATE,D,FEC ID#,(I),CANDIDATE NAME (First),CANDIDATE NAME (Last),CANDIDATE NAME,TOTAL VOTES,PARTY,PRIMARY VOTES,PRIMARY %,RUN... |
import argparse
from ConfigParser import (
NoSectionError,
SafeConfigParser as ConfigParser
)
from getpass import getpass
from os import path
from socket import socket
import sys
import appdirs
from pjlink import Projector
from pjlink import projector
from pjlink.cliutils import make_command
def cmd_power(p,... |
#####################################################################################
#
# Copyright (C) Tavendo GmbH
#
# Unless a separate license agreement exists between you and Tavendo GmbH (e.g. you
# have purchased a commercial license), the license terms below apply.
#
# Should you enter into a separate licen... |
import re
from profileconf.executor import Executor
from profileconf.modules.xrandr import context
from tools import run_xrandr_command
__author__ = 'corvis'
class XrandrExecutor(Executor):
name = "xrandr"
def __init__(self, ref_name, definition):
super(XrandrExecutor, self).__init__()
self.... |
#!/usr/bin/env python
"""
see
A human alternative to dir().
>>> from see import see
>>> help(see)
Copyright (c) 2009 Liam Cooke
http://inky.github.com/see/
Licensed under the GNU General Public License v3. {{{
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU... |
# -*- coding: utf-8 -*-
import thread
import time
import sys
import os
from django.contrib.contenttypes.models import ContentType
from django.core.management.base import NoArgsCommand
from django.core.management import call_command
from django.utils.termcolors import colorize
from requests import get
from geoip.red... |
#!//usr/bin/env python
import argparse
import datetime
import os
import os.path
import requests
import re
import time
import urllib
import urlparse
from subprocess import check_call
def utc_mktime(utc_tuple):
"""Returns number of seconds elapsed since epoch
Note that no timezone are taken into consideration.
... |
# -*- coding: utf-8 -*-
"""Module providing event filter widget"""
import uuid as uuid_tool
from Acquisition import aq_inner
from Products.Five import BrowserView
from plone import api
from plone.i18n.normalizer import IIDNormalizer
from wildcard.media.behavior import IVideo
from zope.component import queryUtility
cl... |
import json
import os
import random
import string
import time
from datetime import datetime
from tempfile import TemporaryDirectory
from django.test import testcases
from rest_framework import status
from desecapi.replication import Repository
from desecapi.tests.base import DesecTestCase
class ReplicationTest(Dese... |
"""
Utility functions. This module is the "miscellaneous bin", providing a home for simple functions and
classes that don't really belong anywhere else.
"""
import msvcrt
import sys
import time
from .exceptions import TooFewItemsError, TooManyItemsError
__author__ = 'Aaron Hosford'
__all__ = [
'first',
'las... |
# -*- coding:utf-8 -*-
#!/usr/bin/env python
#
# Copyright 2012 Duoshuo
import binascii
import base64
import hashlib
import hmac
import time
import urllib.request, urllib.parse, urllib.error
import urllib.request, urllib.error, urllib.parse
import urllib.parse
import json
import jwt
try:
from django.conf import s... |
#!/usr/bin/env python
"""
Create a cluster job file to create an average insert length sparsity
discriminator track.
"""
from sys import argv,stdin,stdout,stderr,exit
def usage(s=None):
message = """
usage: create_script_insert_length_sparse [options] > insert_length_sparse.sh
<sub>_<samp>_<type> (require... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
import os
import logging
import time
import sqlite3
from os.path import basename
################################################################################
# STATIC DEF
################################################################################
PATH_GRA... |
#!/usr/bin/python
import ucloudapi
api='https://api.ucloudbiz.olleh.com/server/v1/client/api'
apikey='APIKEY'
secret='SECRETKEY'
cloudstack = ucloudapi.Client(api, apikey, secret)
vms = cloudstack.listVirtualMachines()
print "VmID\tName\tState\taccount\tdomian\tdomainid\tPassword"
for vm in vms:
print "%s\t%s... |
"""
Django settings for helv_test project.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.7/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
... |
import sys
import string
import socket
import select
import unittest
import threading
import time
import re
import struct
from memcacheConstants import REQ_MAGIC_BYTE, RES_MAGIC_BYTE
from memcacheConstants import REQ_PKT_FMT, RES_PKT_FMT, MIN_RECV_PACKET
from memcacheConstants import SET_PKT_FMT, DEL_PKT_FMT, INCRDECR... |
# anxt/NXT.py
# pyNXT - Python wrappers for aNXT
# Copyright (C) 2011 Janosch Gräf <janosch.graef@gmx.net>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the ... |
#!/usr/bin/python
#########################################################################################################
### File: UC1_DataCenter.py
### Author: Georgios Katsikas - katsikas@imdea.org
### Date: 24/03/2014
###########################################################################################... |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 OpenStack, LLC
# 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/... |
"""
This module contains various functionalities required by the
training algorithms such as rolling averages, predicion and
evaluation metrics.
"""
######## CHANGE LOG ##############################################
# 2012/04/23: Resolved the bug that caused MLIB to crash when
# logreg:SGD was called with ... |
#!/usr/bin/env python
# vim:sw=8:ts=8:et:nowrap
import sys
import os
import shutil
import string
import miscfuncs
import re
import tempfile
import optparse
# change current directory to pyscraper folder script is in
os.chdir(os.path.dirname(sys.argv[0]) or '.')
from resolvemembernames import memberList
toppath = mis... |
import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk
from locale import gettext as _
gi.require_version('Vte', '2.91') # vte-0.42
from gi.repository import Vte
from guake.customcommands import CustomCommands
import logging
log = logging.getLogger(__name__)
def mk_tab_context_menu(callback_object... |
"""
BrctlShow - command ``brctl show``
==================================
This module provides processing for the output of the ``brctl show`` command.
Class ``BrctlShow`` parses the output of the ``brctl show`` command.
Sample output of this command looks like::
---
bridge name bridge id S... |
def combination_sum(candidates, target):
"""
Leet code. Solution -> Accepted
Run Time: 100 ms. Not optimal but this gives a template for writing backtracking
problems
Given an array without duplicates. Find the list of candidates which are equal to
the target sum. Each element can be repeated ... |
from .singleton_form import *
from .monomial_form import *
from .polynomial_form import *
from .numerical_base_form import *
from .equivalent_form import *
from sympy import *
from sympy.abc import x,y,z
import unittest
'''
NOTE: Sympy doesn't honor expression flag evaluate=False
for the identity property... |
import logging
import time
import torch
from src.data_ops.wrapping import unwrap
from ..loss import loss
def half_and_half(a,b):
a = torch.stack([torch.triu(x) for x in a], 0)
b = torch.stack([torch.tril(x, diagonal=-1) for x in b], 0)
return a + b
def validation(model, data_loader):
t_valid = time... |
# -*- coding: utf-8 -*-
from twisted.internet.error import ConnectionRefusedError
from ooni.utils import log
from ooni.templates import tcpt
from twisted.python import usage
class UsageOptions(usage.Options):
optParameters = [
['target', 't', None, 'Specify a single host to test.'],
['port', 'p', ... |
# -*- coding: utf-8 -*-
#
# django cms documentation build configuration file, created by
# sphinx-quickstart on Tue Sep 15 10:47:03 2009.
#
# This file is execfile()d with the current directory set to its containing
# dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.