src stringlengths 721 1.04M |
|---|
from setuptools import setup, find_packages
# To use a consistent encoding
from codecs import open
from os import path
here = path.abspath(path.dirname(__file__))
# Get the long description from the README file
with open(path.join(here, 'README.rst'), encoding='utf-8') as f:
long_description = f.read()
setup(
... |
import datetime
from bitmovin import Bitmovin, Encoding, HTTPSInput, H264CodecConfiguration, \
AACCodecConfiguration, H264Profile, StreamInput, SelectionMode, Stream, EncodingOutput, ACLEntry, ACLPermission, \
MuxingStream, CloudRegion, MP4Muxing, S3Output
from bitmovin.errors import BitmovinError
from bitmovi... |
"""Module for exporting the data structure to .con format.
.. codeauthor:: Tomas Krizek <tomas.krizek1@tul.cz>
"""
INDENTATION = ' '
class Exporter:
"""Exporter from data structure to con files."""
def __init__(self):
"""Initialize the class."""
self.lines = ['']
self.indent_level ... |
import tornado.web
import tornado.ioloop
from emotionnaise_modules import face, misc
class MainHandler(tornado.web.RequestHandler):
def get(self):
self.write('<html><body><form action="/" method="POST" enctype="multipart/form-data">'
'<input type="file" name="image" accept="image/... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2012:
# Hartmut Goebel <h.goebel@crazy-compilers.com>
#
# This file is part of Shinken.
#
# Shinken 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... |
#!/usr/bin/python
from utils import l, params, setup_logging, __version__
from odl import opendaylight
import sys
import time
import re
ips = ( str(x) for x in params.ip_list )
def ip():
global ips
try:
return ips.next()
except StopIteration:
ips = ( str(x) for x in params.ip_list )
return ips.next()
def... |
from io import BytesIO
from django.core.exceptions import PermissionDenied
from django.http import HttpResponse
from django.utils.translation import ugettext_lazy
from django.views import generic as django_views
from django.views.decorators.csrf import ensure_csrf_cookie
from reportlab.lib.units import cm
from reportl... |
# Copyright 2012 Managed I.T.
#
# Author: Kiall Mac Innes <kiall@managedit.ie>
#
# 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 r... |
# Copyright (c) 2013 Mirantis 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 writi... |
"""
Test model API
"""
import random
import json
import copy
from datetime import datetime
import six
from botocore.client import ClientError
from pynamodb.compat import CompatTestCase as TestCase
from pynamodb.tests.deep_eq import deep_eq
from pynamodb.throttle import Throttle
from pynamodb.connection.util import py... |
##############################################################################
# Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... |
# -*- coding: utf-8 -*-
#
# ModisFromQgis documentation build configuration file, created by
# sphinx-quickstart on Sun Feb 12 17:11:03 2012.
#
# 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.
#... |
import datetime
import json
import logging
import maps
import queue
import state
import utils
import world
class GAME_STATUS(object):
""" Game status constants. """
lobby = 'lobby' # In matchmaking lobby, waiting for all players
playing = 'playing' # In game mode, waiting for turns
complete = 'comp... |
# Copyright (C) 2018 Linaro Limited
#
# Author: Matthew Hart <matthew.hart@linaro.org>
#
# This file is part of LAVA Dispatcher.
#
# LAVA Dispatcher 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 versi... |
"""Tests for solvers of systems of polynomial equations. """
from sympy import S, symbols, Integer, Rational, sqrt, I, Poly, QQ, \
all, flatten
from sympy.abc import x, y, z
from sympy.solvers.polysys import solve_poly_system, solve_triangulated
from sympy.utilities.pytest import raises
def test_s... |
#!/usr/bin/python
from macaroon.playback import *
import utils
sequence = MacroSequence()
sequence.append(utils.StartRecordingAction())
sequence.append(KeyComboAction("<Control>Home"))
sequence.append(utils.AssertPresentationAction(
"1. Top of file",
["BRAILLE LINE: 'MathML root test cases'",
" VIS... |
# 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 writing, software
# distributed under t... |
# -*- coding: utf-8 -*-
from django.db import models
from django.template.defaultfilters import date, time
from .reference import Reference
from .equipment import Equipment
from .approximate import Approximate
from .mixins import SeasonMixin, DescriptionMixin
from .time_base import TimeMixin
from . import fields
cla... |
import numpy as np
import os.path as op
from numpy.testing import (assert_array_almost_equal, assert_array_equal,
assert_equal)
import pytest
import mne
from mne import Epochs, read_events, pick_types, create_info, EpochsArray
from mne.io import read_raw_fif
from mne.utils import _TempDir, ... |
import json
from typing import Optional, Set
from django.contrib.postgres.fields import ArrayField as _ArrayField, JSONField
from django.core.validators import MaxValueValidator, MinValueValidator
from django.db import models, transaction
from django.db.models import Sum, F
from django.utils import timezone
from djang... |
from nose.tools import assert_true, assert_equal, assert_not_equal
from numpy.testing import assert_array_equal
import tempfile
from pathlib import Path
import os
from .schema_external import Attach
def test_attach_attributes():
""" test saving files in attachments """
# create a mock file
table = Attach... |
import requests
from pytest import fixture
from vk.session import APIBase
@fixture('session')
def v():
"""
Actual vk API version
"""
return '5.80'
class Attributable(object):
def set_attrs(self, attributes):
for attr_name, attr_value in attributes.items():
setattr(self, att... |
# coding=utf-8
#
# ROSREPO
# Manage ROS workspaces with multiple Gitlab repositories
#
# Author: Timo Röhling
#
# Copyright 2016 Fraunhofer FKIE
#
# 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 a... |
"""Script utility for running inner loop"""
import asyncio
import json
import logging
from concurrent import futures
from gameanalysis import regret
from egta import innerloop
from egta import schedgame
from egta.script import schedspec
from egta.script import utils
def add_parser(subparsers):
"""Create innerlo... |
# Copyright 2012-2017 The Meson development team
# 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... |
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
#
# Copyright (C) 2017-2018 Canonical Ltd
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3 as
# published by the Free Software Foundation.
#
# This program is distributed in ... |
# -*- coding: utf-8 -*-
"""Copyright (C) 2009-2012 Wolfgang Rohdewald <wolfgang@rohdewald.de>
kajongg 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 ... |
"""
Django settings for server project.
For more information on this file, see
https://docs.djangoproject.com/en/1.6/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.6/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
imp... |
# ###################################################
# Copyright (C) 2008-2017 The Unknown Horizons Team
# team@unknown-horizons.org
# This file is part of Unknown Horizons.
#
# Unknown Horizons is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published ... |
"""
composer.py
"""
from django import template
from django.conf import settings
from django.core.urlresolvers import reverse
from ..models import Element
register = template.Library()
class LazyContent:
"""
Wrapper around a `NodeList` that is lazily-evaluated to a string.
"""
def __init__(self, no... |
#!/bin/python3
from telnetlib import Telnet
import re
from hashlib import sha512
from typing import *
from time import sleep
from os import stat, path
import yaml
import argparse
import datetime
prognameMatch = re.compile("\(\(\( filename: (.+) \)\)\)")
progDependencyMatch = re.compile("\(\(\( dependsOn: (.+) \)\)\)")... |
import struct
from builtins import range
import six
from past.builtins import map
from .. import helpers
from ..constants import LITTLE_ENDIAN
from ..fuzzable import Fuzzable
def binary_string_to_int(binary):
"""
Convert a binary string to a decimal number.
@type binary: str
@param binary: Binary ... |
# Mailanie - Cute Mailbox Explorator
# Copyright 2009 Guillaume Ayoub <guillaume.ayoub@kozea.fr>
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation
# Mailanie is distributed in the hope ... |
from random import randint
board = []
for x in range(5):
board.append(["O"] * 5)
def print_board(board):
for row in board:
print " ".join(row)
print "Let's play Battleship!"
print_board(board)
def random_row(board):
return randint(0, len(board) - 1)
def random_col(board):
return randint(0,... |
import os.path
import utils
from subprocess import Popen, PIPE
import select
import sys
from config import logger
def execute(cmd, dburi, xmlpath, loglevel='info'):
username, password, uri = utils.parse_dburi(dburi)
if not loglevel:
loglevel = 'info'
elif loglevel.lower() in ['erro... |
# start 6 objectSwarmObserverAgentsAESOP.py
# 'project' is by default both the name of the application and of the subfolder
# that contains its code; the subfolder is supposed to be placed within the
# SLAPP tree
# the folder can can be placed outside the SLAPP tree if we place a file
# project.txt in the folder "6 ... |
# -*- coding: utf-8 -*-
#
# This file is part of CERN Analysis Preservation Framework.
# Copyright (C) 2017 CERN.
#
# CERN Analysis Preservation Framework 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... |
"""
Django settings for website project.
For more information on this file, see
https://docs.djangoproject.com/en/1.6/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.6/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
im... |
from flask import g,current_app
from babel.support import LazyProxy
from flask_babelplus import gettext, lazy_gettext, ngettext
from flask_babelplus import format_datetime as _format_datetime
from flask_babelplus import Domain, get_locale
from spotipo_plugins import get_enabled_plugins
import os
import subprocess
impo... |
#!/bin/env python
##############################################
# CompareBLASTs #
# A tool to compare the found hits from two #
# BLAST searches with the same search query. #
# #
# by Philipp B. Rentzsch #
# BCCDC Vancouver, ... |
"""Message functionality for Hermes"""
from datetime import datetime
import json
__author__ = "Michael Anckaert"
__copyright__ = "Copyright 2012, Michael Anckaert"
__credits__ = ["Michael Anckaert"]
__license__ = "GPLv3"
__version__ = "0.0.1"
__maintainer__ = "Michael Anckaert"
__email__ = "michael.anckaert@sinax.be"... |
from ssc32 import *
from time import sleep
from smooth import getPositions
# Run with sudo
ssc = SSC32('/dev/ttyUSB0', 115200)
ssc[0].degrees = 20
ssc[0].max = 2500
ssc[0].min = 500
ssc[0].deg_max = +90.0
ssc[0].deg_min = -90.0
#TODO: fix library so it doesn't take 100ms for the first instruction
# And which overrides... |
# -*- coding: utf-8 -*-
# Copyright (C) 1994-2017 Mag. Christian Tanzer. All rights reserved
# Glasauergasse 32, A--1130 Wien, Austria. tanzer@swing.co.at
#
#++
# Name
# lse_compile_language
#
# Purpose
# Compile emacs language definition
#
# Revision Dates
# 14-Nov-2007 (MG) Creation (ported from bash script)... |
# -*- coding: utf-8 -*-
from django.utils.translation import ugettext as _
from django.db import models
#adapted from http://www.djangosnippets.org/snippets/494/
#using UN country and 3 char code list from http://unstats.un.org/unsd/methods/m49/m49alpha.htm
#correct as of 17th October 2008
COUNTRIES = (
... |
# 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 "License"); you may not use ... |
from pytest import fixture
from unittest.mock import MagicMock
from knittingpattern.Dumper import JSONDumper
import json
from knittingpattern.ParsingSpecification import ParsingSpecification
@fixture
def obj():
return ["123", 123]
@fixture
def dumper(obj):
def dump():
return obj
return JSONDumpe... |
"""Copyright 2008 Orbitz WorldWide
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 writing, software... |
# -*- coding: utf-8 -*-
"""
String implementation.
"""
from __future__ import print_function, division, absolute_import
import flypy
from flypy import sjit, jit, typeof
from .bufferobject import Buffer, newbuffer, copyto
from .pointerobject import Pointer
@sjit
class String(object):
layout = [('buf', 'Buffer[ch... |
#!/usr/bin/env python
"""
NAME
C_stringCore
DESCRIPTION
'C_stringCore' is a wrapper about a python cStringIO
class. It provides a thins wrapper abstracting some
simple methods to write/read to and from a StringIO
object.
NOTES
HISTORY
06 Feb... |
"""
Usage:
cd to it's directory
python mac_setup.py py2app
"""
from setuptools import setup
import os, sys, shutil
NAME = 'Reggie!'
VERSION = '1.0'
plist = dict(
CFBundleIconFile=NAME,
CFBundleName=NAME,
CFBundleShortVersionString=VERSION,
CFBundleGetInfoString=' '.join([NAME, VERSION]),
... |
from django.db import models
from django.utils.text import slugify
from django.db import IntegrityError
from common.models import WebResource
from common.models import WebLink
from common.tools import fetch_from_web_api
from urllib.request import urlopen, quote
import json
import yaml
import logging
class Ligand(mod... |
def lines_to_list(_file):
with open(_file) as f:
_list = f.readlines()
return [x.strip() for x in _list]
def normalize(sublist):
m = .0
for trans in sublist:
m = m + sublist[trans]
for trans in sublist:
sublist[trans] = sublist[trans] / m
return sublist
def list_to_di... |
# -*- coding: utf-8 -*-
from easy_karabiner import __version__
from easy_karabiner import util
from easy_karabiner import query
from easy_karabiner.generator import *
def test_generator():
query.DefinitionBucket.clear()
KEYMAP_ALIAS = {
'flip': 'FlipScrollWheel',
}
DEFINITIONS = {
'BIL... |
import sys
import os
import math
import shutil as sh
resultDir = os.environ.get('RESULTS')
tempDir = os.environ.get('TMPDIR')
if resultDir == None or tempDir == None :
print ("WARNING! $RESULTS not set! Attempt to write results will fail!\n")
# Expecting input botConc, topConc, rateConstFull, sysSize, analInterv... |
from __future__ import unicode_literals
from . import BaseProvider
from . import date_time
from datetime import datetime
import random
class Provider(BaseProvider):
user_agents = ('firefox', 'chrome', 'internet_explorer', 'opera', 'safari')
windows_platform_tokens = (
'Windows NT 6.2', 'Windows NT 6.... |
################################################################################
#
# This program is part of the CIMMon Zenpack for Zenoss.
# Copyright (C) 2012 Egor Puzanov.
#
# This program can be used under the GNU General Public License version 2
# You can find full information here: http://www.zenoss.com/oss
#
###... |
"""Implement an algorithm that transform, in place, a sorted array
into a balance binary search tree.
Examples:
Input: [1, 2, 3]
Output: A Balanced BST
2
/ \
1 3
Input: [1, 2, 3, 4, 5, 6, 7]
Output: A Balanced BST
4
/ \
2 6
/ \ ... |
################################################################################
# Copyright (C) 2011-2012,2014 Jaakko Luttinen
#
# This file is licensed under the MIT License.
################################################################################
import numpy as np
import scipy.special as special
from bay... |
# Copyright (c) 2016 PaddlePaddle 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 applic... |
#
# Copyright (c) 2015 Autodesk 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 l... |
"""django_gateone URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Cl... |
# This file is part of MyPaint.
# Copyright (C) 2009-2018 by the MyPaint Development Team.
# Copyright (C) 2008-2014 by Martin Renold <martinxyz@gmx.ch>
#
# 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 Fou... |
# -*- coding: UTF-8 -*-
from collections import namedtuple
from yelp.obj.deal import Deal
from yelp.obj.gift_certificate import GiftCertificate
from yelp.obj.location import Location
from yelp.obj.response_object import ResponseObject
from yelp.obj.review import Review
Category = namedtuple('Category', 'name alias')... |
import random
class GasPoweredGenerator(object):
def __init__(self, env):
self.env = env
self.gas_price_per_kwh = 0.0655 # Euro
self.running = False
self.workload = 0
self.current_gas_consumption = 0 # kWh
self.current_thermal_production = 0 # kWh
self.... |
from twisted.internet.defer import inlineCallbacks
from autobahn import wamp
from autobahn.twisted.wamp import ApplicationSession
from autobahn.twisted.wamp import ApplicationRunner
class Locator(ApplicationSession):
@inlineCallbacks
def onJoin(self, details):
yield self.register(self)... |
#!/usr/bin/env python
# Chris Riederer
# Google, Inc
# 2014-07-25
import test_detect
import numpy as np
import os
import json
import random
import sys
def makeNegativeSnippets(runData, number, snipPrefixTime=100000000, snipPostfixTime=500000000):
return makeSnippets(runData, True, numberNegative=number, snipPrefi... |
import inflection
class Errors(object):
'''
The `Errors` object is a container of validation errors stored on an
instance of a :class:`Base` subclass. An object's validation
state (and the response to :meth:`Base.valid()`) is governed by the number
of errors collected: 0 means valid, and more mean... |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# 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 applicabl... |
# Generated on 2020-04-04 11:23:51.675046
from darglint.token import (
TokenType,
)
from darglint.parse.identifiers import (
NoqaIdentifier,
)
from darglint.parse.grammar import (
BaseGrammar,
P,
)
class ReceivesGrammar(BaseGrammar):
productions = [
P("receives-section", ([], "receives-h... |
"""
Functions for preparing various inputs passed to the DataFrame or Series
constructors before passing them to a BlockManager.
"""
from __future__ import annotations
from collections import abc
from typing import (
TYPE_CHECKING,
Any,
Hashable,
Sequence,
)
import warnings
import numpy as np
import n... |
#!/usr/bin/env python
# Copyright (c) 2013 Nick Groenen <nick@groenen.me>
import argparse
import chump
def main():
parser = argparse.ArgumentParser(description="Simple pushover client")
parser.add_argument('--token', required=True, help="your application's API token")
parser.add_argument('--user', requi... |
#!/usr/bin/env python
#-*- coding:utf-8 -*-
#TODO: Update for use with new API
#TODO: Read config, optionally disable rectangle.
#TODO: Create Destroy() method
#TODO: Implement file system organization, handle converting & uploading image to server.
#TODO: Use gstreamer for Linux instead of opencv - better performanc... |
r"""JSON (JavaScript Object Notation) <http://json.org> is a subset of
JavaScript syntax (ECMA-262 3rd edition) used as a lightweight data
interchange format.
:mod:`simplejson` exposes an API familiar to users of the standard library
:mod:`marshal` and :mod:`pickle` modules. It is the externally maintained
versi... |
#!/usr/bin/env python
# ------------------------------
# importacion
# ------------------------------
import socket, sys, time, ConfigParser
def poner_mensaje( tipo , mensaje ):
# -----------------------------
# Colocar mensajes con formato
# y marca de tiempo
# -----------------------------
print time.strftime(... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import urllib,urllib2,re,xbmcplugin,xbmcgui,sys,xbmcaddon,base64
pluginhandle = int(sys.argv[1])
addon = xbmcaddon.Addon(id='plugin.audio.vorleser_net')
translation = addon.getLocalizedString
def index():
addDir(translation(30001),"","listAllAuthors","")
addDi... |
import tak.ptn
import tak.proto
import attr
import os
import struct
import grpc
import numpy as np
import tensorflow as tf
def xread(fh, n):
b = fh.read(n)
if len(b) == 0:
raise EOFError
if len(b) != n:
raise IOError("incomplete read ({0}/{1} at off={2})".format(
len(b), n, fh.tell()))
return... |
# -*- coding: utf-8 -*-
import scrapy
import urlparse
from urllib2 import quote
from nbadraft_net import PlayerItem
class NbadraftSpider(scrapy.Spider):
name = "nbadraft"
allowed_domains = ["nbadraft.net"]
start_urls = (
'http://www.nbadraft.net/2016mock_draft',
)
def parse(self, respons... |
####
# Copyright 2000 by Timothy O'Malley <timo@alum.mit.edu>
#
# All Rights Reserved
#
# Permission to use, copy, modify, and distribute this software
# and its documentation for any purpose and without fee is hereby
# granted, provided that the above copyright notice appear in all
# copies and that bot... |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import base64
import codecs
import io
from PIL import Image
from PIL import ImageEnhance
from random import randrange
# Preload PIL with the minimal subset of image formats we need
from odoo.tools import pycompat
Image... |
# -*- coding: utf-8 -*-
"""
werkzeug.contrib.atom
~~~~~~~~~~~~~~~~~~~~~
This module provides a class called :class:`AtomFeed` which can be
used to generate feeds in the Atom syndication format (see :rfc:`4287`).
Example::
def atom_feed(request):
feed = AtomFeed("My Blog", feed... |
"""
# TOP2049 Open Source programming suite
#
# Microchip PIC12F629 DIP8
#
# Copyright (c) 2013 Pavel Stemberk <stemberk@gmail.com>
#
# 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 Foundat... |
#!/usr/bin/env python
"""
#
# By: Charles Brandt [code at charlesbrandt dot com]
# On: *2013.12.17 20:44:16
# License: GPLv3
# Requires:
#
# geopy
# Description:
Columbia provides lat/long coordinates with addresses, so import should be simpler.
"""
import os, sys, codecs, re, time
import csv
#import unicodecsv
... |
import json
import os
import re
import shutil
import xmltodict
import zipfile
from django.conf import settings
from django.conf.urls import url
from django.core.exceptions import MultipleObjectsReturned
from django.db.models import Q
from django.http import HttpResponse, Http404
from django.utils.translation import ug... |
# -*- coding: utf-8 -*-
from pandac.PandaModules import loadPrcFileData
JOYSTICK_WHEEL = 0
JOYSTICK_STICKS = 1
BUTTON_FORWARD = 1
BUTTON_BACKWARD = 10
BUTTON_START = 3
BUTTON_HORN = 2
BUTTON_WINTER = 10
BUTTON_CAM_LEFT = 0
BUTTON_CAM_RIGHT = 7
BUTTON_RESET = 7
AXIS_STEERINGWHEEL = 0
AXIS_ACCELERATE = 2
AXIS_BRAKE = 1
... |
from collections import namedtuple, defaultdict
import itertools
import math
Player = namedtuple('Player', 'pseudo rating')
PlayerRank = namedtuple('PlayerRank', 'pseudo rank')
Rank = namedtuple('Rank', 'value')
Rating = namedtuple('Rating', 'value')
def sort_player_by_rating(players):
return sorted(
pl... |
from __future__ import print_function # print utilities without systematic '\n' at EOL
import io
import re
# --- Day 8: Two-Factor Authentication ---
#
# You come across a door implementing what you can only assume is an
# implementation of two-factor authentication after a long game of
# requirements telephone.
#
# T... |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Deleting model 'TransportCompany'
db.delete_table(u'shops_transportcompany')
def backwards(self, orm... |
#!/usr/bin/python
import memlib
## EDIT HERE ###################################################################
keySizes = [1,3,4,5,7,8,9,10,12,13,15,16,17,24,25,28,84,128]
#valueSizes = [1,3,4,5,8,9,10,12,13,16,17,24,28,184,208,1024]
valueSizes = [1,3,4,5,8,9,10,12,13,16,17,24,28,184,208, 256]
seq1repeat = 5
key... |
"""
Sequence classes
"""
import gzip
import json
import logging
import os
import re
import string
from cgi import escape
from galaxy import util
from galaxy.datatypes import metadata
from galaxy.util.checkers import is_gzip
from galaxy.datatypes.metadata import MetadataElement
from galaxy.datatypes.sniff import get_h... |
import sys
sys.path += ['/usr/local/lib/python2.6/dist-packages/gtk-2.0']
import gtk
from gtk import gdk
import pango
import gtksheet
from bordercombo import BorderCombo
#from gtkextra import BorderCombo
#import gtkextra
class TestSheet(gtksheet.Sheet):
def __init__(self):
gtksheet.Sheet.__init__(self, 20,... |
import os
import sys
import time
from magnolia.utility import *
from magnolia.utility import LOG as L
from magnolia.script.sinoalice import testcase_normal
class TestCase(testcase_normal.TestCase):
def __init__(self, *args, **kwargs):
super(TestCase, self).__init__(*args, **kwargs)
@classmethod
d... |
#!/usr/bin/env python
from tree import *
class Solution:
def maxPathSum(self, root):
"""
:type root: TreeNode
:rtype: int
"""
if root == None:
return 0
self.maxSum = root.val
self.maxPathSumNode(root)
return self.maxSum
def maxPathSu... |
from django.shortcuts import render
from django.http import HttpResponse
from django.utils.decorators import method_decorator
from django.contrib.auth.decorators import login_required
from django.views.generic import View
from DailyDiary.forms import AddPostForm, RegisterForm, LoginForm
from django.contrib.auth import ... |
from __future__ import unicode_literals
import codecs
import logging
try:
from http.client import HTTPConnection, HTTPSConnection
except ImportError:
# pylint: disable=import-error
from httplib import HTTPConnection, HTTPSConnection
try:
from urllib.parse import urlparse
except ImportError:
# py... |
import unittest
from hazelcast.core import Address, Member
from hazelcast.util import get_possible_addresses
class AddressTest(unittest.TestCase):
def test_no_given_address(self):
addresses = get_possible_addresses([])
self.assertItemsEqual(addresses,
[Address("127.... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import django.contrib.sites.models
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='Site',
fields=[
... |
import os
from setuptools import setup, find_packages
def build_install_requires(path):
"""Support pip-type requirements files"""
basedir = os.path.dirname(path)
with open(path) as f:
reqs = []
for line in f:
line = line.strip()
if not line:
continu... |
import numpy as np
import pandas as pd
import time
from time import gmtime, strftime
from main import *
from sklearn import metrics
import lightgbm as lgb
from tensorflow.python.keras.models import load_model
from keras_train import DNN_Model
# len_train = 20905996
# len_valide = 20000001
# df = pd.read_pi... |
"""
============================
Base RPC Handler for Tornado
============================
This is a basic server implementation, designed for use within the
Tornado framework. The classes in this library should not be used
directly, but rather though the XML or JSON RPC implementations.
You can use the utility functio... |
"""
pyggle.event
This library (PYGGEL) is licensed under the LGPL by Matthew Roe and PYGGEL contributors.
The event module contains classes to grab and access events.
"""
from .include import *
from . import view
import string
import time
class Keyboard(object):
"""A simple class to store keyboard e... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.