src stringlengths 721 1.04M |
|---|
#-----------------------------------------------------------#
# Heads Up Omaha Challange - Starter Bot #
#===========================================================#
# #
# Last update: 22 May, 2014 #
# ... |
import os, sys, shutil, errno, time, signal
from StringIO import StringIO
from twisted.python import usage
from twisted.internet import defer
from twisted.scripts import twistd
# does "flappserver start" need us to refrain from importing the reactor here?
# A: probably, to allow --reactor= to work
import foolscap
fro... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#----------------------------------------------------------------------
# js.typeahead.release
#----------------------------------------------------------------------
# Copyright (c) 2013 Merchise Autrement and Contributors
# All rights reserved.
#
# This is free software; ... |
# coding: utf-8
from flask import request
from quokka.modules.cart.pipelines.base import CartPipeline
from quokka.utils import get_current_user
from .models import CourseSubscription, Subscriber
class SetSubscriber(CartPipeline):
def process(self):
name = request.form.get("name")
email = request... |
# -*- coding: utf-8 -*-
import re
from oslo_log import log as logging
from py_windows_tools.utilities import misc
LOG = logging.getLogger(__name__)
class WindowsEvents(object):
@staticmethod
def get_command_get_events(category, n):
return ['powershell', 'Get-EventLog %s -newest %d' % (category, n)]
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# 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 dist... |
class DirectedAdjacencyMatrix:
def __init__(self, n):
self.n = n
self.data = [[0] * n for i in range(n)]
def connect(self, i_from, i_to):
self.data[i_from][i_to] += 1
def disconnect(self, i_from, i_to):
self.data[i_from][i_to] = max(0, self.data[i_from][i_to] - 1)
def ... |
#!/usr/bin/env python
#coding=utf-8
"""
die-rolling simulator
Roll a single n-sided die. Number of sides can be specified on the
command line; default is 6.
"""
__author__ = 'Chris Horn <hammerhorn@gmail.com>'
import argparse, sys
try:
if sys.version_info.major == 2:
import Tkinter as tk
elif sys.ve... |
# Clean
import datetime as dt
import time
import datetime
from utils import *
def is_present(date_text): return date_text.upper() == 'NOW'
def get_current(): return dt.datetime.now().date()
def clean_datetime(date_text):
if not isinstance(date_text, basestring):
return None
# Parse from text
date... |
import os
from collections import Counter
# List for disallows from file
disallow = []
def list_all_files():
"""Lists all files in robots folder"""
os.chdir("robots")
robot_files = os.listdir(os.curdir)
print "[*] Found number of files:" + str(len(robot_files))
return robot_files
def open_txt_f... |
from __future__ import division, absolute_import, print_function
__all__ = ['matrix', 'bmat', 'mat', 'asmatrix']
import sys
import numpy.core.numeric as N
from numpy.core.numeric import concatenate, isscalar, binary_repr, identity, asanyarray
from numpy.core.numerictypes import issubdtype
# make translation table
_n... |
import sys
import sassie.interface.input_filter as input_filter
import sassie.interface.sld_mol_filter as sld_mol_filter
import sassie.calculate.sld_mol.sld_mol as sld_mol
class Drv():
module = 'sld_mol'
def run_me(self):
# BEGIN USER EDIT
# BEGIN USER EDIT
# BEGIN USER EDIT
runname =... |
#!/usr/bin/env python
# vim: set expandtab:
"""
**********************************************************************
GPL License
***********************************************************************
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public Lic... |
# -*- coding: utf-8 -*-
#/usr/bin/python2
'''
By kyubyong park. kbpark.linguist@gmail.com.
https://www.github.com/kyubyong/tacotron
'''
from __future__ import print_function
import tensorflow as tf
import numpy as np
import librosa
import os
from tqdm import tqdm
from hyperparams import Hyperparams as hp
from prepr... |
# -*- coding: utf-8 -*-
from __future__ import print_function
import argparse
import os
import stat
import sys
# find the import for catkin's python package - either from source space or from an installed underlay
if os.path.exists(os.path.join('/opt/ros/indigo/share/catkin/cmake', 'catkinConfig.cmake.in')):
sys.p... |
import textwrap
import sys
import os
import matplotlib.pyplot as plt
lib_path = os.path.abspath(r'E:\Tamuz\Utils\RobotQAUtils')
sys.path.append(lib_path)
import plateReader
tinyNum = 0.000001
def print3DGraph(listOfaxisLists = None,Xlabel = None,Ylable = None,Zlabel = None,title = None):
'''for each expiriment pr... |
# encoding: utf-8
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2008 PC Solutions (<http://pcsol.be>). All Rights Reserved
# $Id$
#
# This program is free software: you can redistribute it and/or modify
# i... |
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2004-2011
# Pexego Sistemas Informáticos. (http://pexego.es)
# Luis Manuel Angueira Blanco (Pexego)
#
# Copyright (C) 2013
# Ignacio Ibeas - Acysos S.L. (http://acysos.com)... |
# -*- coding: utf-8 -*-
# Description: generates an svg file based on Praat pitch data
# Example usage:
# python pitch_to_svg.py data/open_audio_weekend.Pitch output/open_audio_weekend_pitch.svg 1200 240 80 240 0.1 0.1 6
from pprint import pprint
from praat import fileToPitchData
import svgwrite
import sys
import t... |
# -*- coding: utf-8 -*-
"""
werkzeug.testsuite.cache
~~~~~~~~~~~~~~~~~~~~~~~~
Tests the cache system
:copyright: (c) 2014 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import os
import time
import unittest
import tempfile
import shutil
from werkzeug.testsuite import Werkzeug... |
from django import forms
from rango.models import Bares, Tapas
class BaresForm(forms.ModelForm):
nombre = forms.CharField(max_length=128, help_text="Introduzca el nombre del bar.")
visitas = forms.IntegerField(widget=forms.HiddenInput(), initial=0)
direccion = forms.CharField(max_length=128, help_text="Int... |
import nose, os, shutil, multiprocessing, StringIO
from sets import Set
from nose.tools import with_setup
from parFDS import build_input_files, input_file_paths, build_pool
from helper_functions import dict_product, dict_builder, input_directory_builder,\
build_input_files, input_file_paths
#### tests ####
c... |
# peppy Copyright (c) 2006-2009 Rob McMullen
# Licenced under the GPLv2; see http://peppy.flipturn.org for more info
"""Edje programming language editing support.
Major mode for editing Edje files.
Supporting actions and minor modes should go here only if they are uniquely
applicable to this major mode and can't be u... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Tests for the Windows Event Log resources."""
import unittest
from winevtrc import resources
from tests import test_lib
class EventLogProviderTest(test_lib.BaseTestCase):
"""Tests for the Windows Event Log provider."""
def testSetCategoryMessageFilenames(self):... |
from tests.base_test import BaseTest
from testfixtures import log_capture
from tests import config
from core.sessions import SessionURL
from core import modules
from core import messages
import subprocess
import tempfile
import datetime
import logging
import os
def setUpModule():
subprocess.check_output("""
BASE_F... |
import re
import json
import hearthbreaker
from hearthbreaker.cards.heroes import hero_from_name
import hearthbreaker.constants
from hearthbreaker.engine import Game, card_lookup, Deck
import hearthbreaker.game_objects
import hearthbreaker.cards
import hearthbreaker.proxies
from hearthbreaker.serialization.move import... |
## begin license ##
#
# "Meresco Solr" is a set of components and tools
# to integrate Solr into "Meresco."
#
# Copyright (C) 2011-2013 Seecr (Seek You Too B.V.) http://seecr.nl
# Copyright (C) 2012 SURF http://www.surf.nl
# Copyright (C) 2012-2013 Stichting Kennisnet http://www.kennisnet.nl
#
# This file is part of "... |
# Jacob Orner (jayc0b0)
# Caesar Cypher script
def main():
# Declare variables and take input
global alphabet
alphabet = ['a', 'b', 'c', 'd', 'e', 'f',
'g', 'h', 'i', 'j', 'k', 'l',
'm', 'n', 'o', 'p', 'q', 'r',
's', 't', 'u', 'v', 'w', 'x',
... |
#!/usr/bin/env python
#
# Copyright (c) 2010 Matteo Boscolo
#
# This file is part of PythonCAD.
#
# PythonCAD 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 opt... |
"""
AUTHOR : Lang
PURPOSE : Multi Self Deep Learning
"""
__author__ = 'Lang'
import tensorflow as tf, sys
import os
# change this as you see fit
graph_path_temple = sys.argv[1]
label_path_temple = sys.argv[2]
graph_path = os.path.abspath(graph_path_temple)
label_path = os.path.abspath(label_path_temple)
# Loa... |
#!/usr/bin/env python
###############################################################################
# Copyright (C) 1994 - 2009, Performance Dynamics Company #
# #
# This software is licensed as described in the file COP... |
# Copyright (c) 2017 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Presubmit script for Android Java code.
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
for more details about the presub... |
#MenuTitle: Reorder Unicodes of Selected Glyphs
# -*- coding: utf-8 -*-
from __future__ import division, print_function, unicode_literals
__doc__="""
Reorders Unicodes so that default Unicode comes first.
"""
from Foundation import NSArray
thisFont = Glyphs.font # frontmost font
selectedLayers = thisFont.selectedLaye... |
###########################################################################
# Export of Script Module: netmri_easy
# Language: Python
# Category: Internal
# Description: Object oriented library for Python scripting support
###########################################################################
import datetime
impor... |
# -*- coding: utf-8 -*-
"""
/***************************************************************************
ok
QAD Quantum Aided Design plugin
funzioni per stirare oggetti grafici
-------------------
begin : 2013-11-11
copyright : iiiii... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2009 Benoit Chesneau <benoitc@e-engura.org>
#
# This software is licensed as described in the file LICENSE, which
# you should have received as part of this distribution.
#
import codecs
import os
import sys
import urlparse
import urllib
# compatibility with... |
"""
MamboVision is separated from the main Mambo class to enable the use of the drone without the FPV camera.
If you want to do vision processing, you will need to create a MamboVision object to capture the
video stream.
This module relies on the opencv module, which can a bit challenging to compile on the Raspberry P... |
import pytest
import os
import time
import subprocess
bitcoin_path = None
bitcoin_conf = None
bitcoin_rpcpassword = None
bitcoin_rpcusername = None
miniircd_procs = []
def local_command(command, bg=False, redirect=''):
if redirect == 'NULL':
if OS == 'Windows':
command.append(' > NUL 2>&1')
... |
from __future__ import division
import random
import os
import numpy as np
import pickle
import datetime
import json
class Decision(object):
def __init__(self, pair, result, reviewer, time):
self.pair = pair
self.result = result
self.reviewer = reviewer
self.time = time
def dic... |
"""
Instantiate a new node and its child nodes from a node type.
"""
import logging
from opcua import Node
from opcua import ua
from opcua.common import ua_utils
from opcua.common.copy_node import _rdesc_from_node, _read_and_copy_attrs
logger = logging.getLogger(__name__)
def instantiate(parent, node_type, nodeid=... |
# 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 ... |
# Copyright (c) 2015 SUSE Linux GmbH. All rights reserved.
#
# This file is part of kiwi.
#
# kiwi 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 la... |
# 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 u... |
from PyQt5 import QtWidgets as QW
from PyQt5 import QtCore as QC
from lsjuicer.inout.db.sqla import SyntheticData
from lsjuicer.ui.widgets.fileinfowidget import MyFormLikeLayout
from lsjuicer.ui.widgets.clicktrees import EventClickTree, Events
from actionpanel import ActionPanel
from lsjuicer.ui.widgets.mergewidget i... |
# Copyright (c) 2010-2012 OpenStack, 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 agreed to ... |
#!/usr/bin/env python
# This file is part of MAUS: http://micewww.pp.rl.ac.uk:8080/projects/maus
#
# MAUS 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 op... |
import re
import requests
import xbmc
import json
try:
from BeautifulSoup import BeautifulSoup
except ImportError:
from bs4 import BeautifulSoup
_JSON_URL = "http://fast.wistia.com/embed/medias/%s.json"
_IFRAME_URL = "http://fast.wistia.net/embed/iframe/%s"
class ResolveError(Exception):
def _... |
"""
==============================================
Illustration of the definition of a Tomek link
==============================================
This example illustrates what is a Tomek link.
"""
# Authors: Guillaume Lemaitre <g.lemaitre58@gmail.com>
# License: MIT
# %%
print(__doc__)
import matplotlib.pyplot as pl... |
#!/usr/bin/env python3
#######################
# ACEX Setup Script #
#######################
import os
import sys
import shutil
import platform
import subprocess
import winreg
######## GLOBALS #########
MAINDIR = "z"
PROJECTDIR = "acex"
##########################
def main():
FULLDIR = "{}\\{}".format(MAINDIR,... |
from __future__ import generators
from parserutils import generateLogicalLines, maskStringsAndComments, maskStringsAndRemoveComments
import re
import os
import compiler
from bike.transformer.save import resetOutputQueue
TABWIDTH = 4
classNameRE = re.compile("^\s*class\s+(\w+)")
fnNameRE = re.compile("^\s*def\s+(\w+)"... |
# uk.po
val = {" days." : "",
"(all)" : "",
"(any)" : "",
"(anyone)" : "",
"(available)" : "",
"(blank)" : "",
"(both)" : "",
"(everyone)" : "",
"(master user, not editable)" : "",
"(no change)" : "",
"(no deduction)" : "",
"(none)" : "",
"(unknown)" : "",
"(use system)" : "",
"({0} given, {1} remaining)" : "",
"1 tre... |
#!/usr/bin/env python
#
# Copyright (c) 2001 - 2016 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
# without limitation the rights to us... |
# Copyright 2011 Eldar Nugaev
# 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 ... |
# Import packages
import music21
from os import listdir
from os.path import isfile, join
# Import modules
#from utils import *
#== Main class ==#
# Main tonics for key shifting
c_tonic = dict([("G#", 4),("A-", 4),("A", 3),("A#", 2),("B-", 2),("B", 1),("C", 0),("C#", -1),("D-", -1),("D", -2),("D#", -3),
... |
#------------------------------------------------------------------------------
# netboa/websocket/ws_service.py
# Copyright 2012 Jim Storch
# 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 Licen... |
# Razttthon, a python-implemented Tic-tac-toe game.
# Copyright Eetu 'Razbit' Pesonen, 2014
#
# This file is a part of Razttthon, which 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.
#
# Razttthoni... |
from superdesk.tests import TestCase
from superdesk import es_utils
class ESUtilsTestCase(TestCase):
def test_filter2query(self):
"""Check that a saved_searches style filter is converted correctly to Elastic Search DSL"""
filter_ = {"query": {"spike": "exclude", "notgenre": '["Article (news)"]'}}... |
# coding=utf-8
"""
Cadasta Widget -**Edit Text Dialog**
This module provides: Login : Login for cadasta and save authnetication
.. 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; ei... |
from lmp_types import *
from lmp_particlesAndInteractions import *
from lmp_creator import LmpCreator
from lmpObj import LmpObj
import lmp_helpers as helpers
import numpy as np
import itertools as it
import sets
import pandas as pd
import PolyLibScan.Database.db as db
from scipy.spatial.distance import cdist
class Env... |
#!/usr/bin/python2.4 -tt
# Copyright 2010 Google Inc.
# Licensed under the Apache License, Version 2.0
# http://www.apache.org/licenses/LICENSE-2.0
# Google's Python Class
# http://code.google.com/edu/languages/google-python-class/
# Additional basic string exercises
# D. verbing
# Given a string, if its length is a... |
import arcpy, os, getpass
newServer = "NEWSERVERNAME"
user = getpass.getuser()
#user_dir = os.path.join(u'C:\\Users\\', user) ### used for local machine
user_dir = u'Input path to directory here'
os.chdir(user_dir)
################create logfile################
logfile = open("logfile_for_server_upgrade.txt", "w... |
import re
from glob import glob
from tests import TestCase
class TestTranslations(TestCase):
def runTest(self, verbose=False):
'''Sanity check translation files'''
pot_creation_date = None
for file in ['translations/zim.pot'] + glob('translations/*.po'):
if verbose:
print 'Checking %s' % file
t = ... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# This file is part of box-linux-sync.
#
# Copyright (C) 2013 Vítor Brandão <noisebleed@noiselabs.org>
#
# box-linux-sync 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... |
# Author: Sarah Knepper <sarah.knepper@intel.com>
# Copyright (c) 2014 Intel Corporation.
#
# 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
# without limitation... |
# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
### BEGIN LICENSE
# 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 the hop... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from gaebusiness.business import CommandExecutionException
from tekton.gae.middleware.json_middleware import JsonResponse
from amigo_app import facade
def index():
cmd = facade.list_amigos_cmd()
amigo_list = cmd()
short_form=... |
# 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 distributed in the hope that it will be useful,
# bu... |
# coding=utf-8
#
# Copyright 2014 F5 Networks 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 a... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Authors : Roberto Majadas <roberto.majadas@openshine.com>
# Cesar Garcia Tapia <tapia@openshine.com>
# Oier Blasco <oierblasco@gmail.com>
# Alvaro Peña <alvaro.pena@openshine.com>
#
# Copyright (c) 2003-2012, Telefonica Móviles España S.A.U.
#
... |
from unittest import TestCase
from unittest.mock import mock_open, patch
from dakara_base.resources_manager import get_file
from path import Path
from dakara_player_vlc.text_generator import (
IDLE_TEMPLATE_NAME,
TextGenerator,
TRANSITION_TEMPLATE_NAME,
)
from dakara_player_vlc.resources_manager import g... |
# AFM font Palatino-Roman (path: /usr/share/fonts/afms/adobe/pplr8a.afm).
# Derived from Ghostscript distribution.
# Go to www.cs.wisc.edu/~ghost to get the Ghostcript source code.
from . import dir
dir.afm["Palatino-Roman"] = (
500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, ... |
import copy
import json
import uuid
import pathlib
import itertools
import subprocess
import re
from collections import OrderedDict
import xml.etree.ElementTree as etree
from xml.etree.ElementTree import Element, SubElement
from ..bundle import parse_desktop_layout
from ..base import get_logger
from ..cldr import CP_... |
from __future__ import unicode_literals
import os
from flask import send_from_directory, make_response
from flask_classy import route
from mongoengine.errors import DoesNotExist
from core.web.api.crud import CrudApi
from core import exports
from core.web.api.api import render
from core.helpers import string_to_timed... |
# -*- coding: utf-8 -*-
# Copyright 2004-2011 Luis Manuel Angueira Blanco (http://pexego.es)
# Copyright 2013 Ignacio Ibeas (http://acysos.com)
# Copyright 2016 Antonio Espinosa <antonio.espinosa@tecnativa.com>
# Copyright 2016 Angel Moya <odoo@tecnativa.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agp... |
from django_lare import VERSION
class Lare(object):
enabled = False
current_namespace = ""
previous_namespace = ""
version = VERSION
supported_version = "1.0.0"
def __init__(self, request):
super(Lare, self).__init__()
if 'HTTP_X_LARE' in request.META:
if 'HTTP_X_... |
#!/usr/bin/env python
import argparse
import subprocess
from cyvcf2 import VCF
import random
import annoutils
import os
import re
import sys
logger = annoutils.getlogger('pcgr-vcfanno')
global debug
def __main__():
parser = argparse.ArgumentParser(description='Run brentp/vcfanno - annotate a VCF file against mu... |
#!/usr/bin/env python
"""
django-mailwhimp
======
Django-mailwhimp is a django application for interacting with MailChimp.
"""
from setuptools import setup, find_packages
setup(
name='django-mailwhimp',
version='0.1',
author='Kit Sunde',
author_email='kit@mediapop.co',
url='http://github.com/Celc... |
"""Add SoundcloudTrack model
Revision ID: 3160b5df63b4
Revises: 8cbc3d8dd55
Create Date: 2016-08-31 11:29:40.489495
"""
# revision identifiers, used by Alembic.
revision = '3160b5df63b4'
down_revision = '8cbc3d8dd55'
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto generated by ... |
# -*- coding: utf-8 -*-
try:
from unittest import mock
except ImportError:
import mock
import six
from django.db import models
from django.test import TestCase
from tests.testapp.models import (
DummyRelationModel, InheritedFromPostWithUniqFieldCompat, PostWithUniqFieldCompat,
ReverseModelCompat, Secon... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# --- BEGIN_HEADER ---
#
# html_writer - [insert a few words of module description on this line]
# Copyright (C) 2003-2009 The MiG Project lead by Brian Vinter
#
# This file is part of MiG.
#
# MiG is free software: you can redistribute it and/or modify
# it under the terms ... |
# encoding: utf-8
from miniworld.model.singletons.Singletons import singletons
from collections import OrderedDict
import geojson
from .Road import Road
__author__ = "Patrick Lampe"
__email__ = "uni at lampep.de"
class Roads:
"""
Attributes
----------
list_of_roads : ... |
#!/usr/bin/python3
import sys
from kerasndl.utils import Numberer
class EventFileHandler:
"""Interface to manage file with events and keep track of number of cues and outcomes.
Parameters
----------
event_file: str or path
path to file with events
lowercase: boolean, optional
... |
'''
Created on 18/12/2013
@author: Nacho
'''
from lpentities.computation import Computation
from lpentities.dataset import Dataset
from lpentities.indicator import Indicator
from lpentities.value import Value
class Observation(object):
'''
classdocs
'''
def __init__(self, chain_for_id, int_for_id, r... |
import json
import webapp2
from controllers.api.api_base_controller import ApiBaseController
from consts.district_type import DistrictType
from consts.event_type import EventType
from datetime import datetime
from database.event_query import DistrictEventsQuery
from google.appengine.ext import ndb
from database.tea... |
#!/usr/bin/env python
import vtk
from vtk.util.colors import *
from tgdataReader import tgdataReader
import sys
stlineModel = tgdataReader( sys.argv[1] )
mapStreamLine = vtk.vtkPolyDataMapper()
mapStreamLine.SetInput( stlineModel )
streamLineActor = vtk.vtkActor()
streamLineActor.SetMapper(mapStreamLine)
streamL... |
#!/usr/bin/env python3
# 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... |
#!/usr/bin/env python3
"""
GO compiler wrapper (sets GOROOT automatically)
"""
import glob
import os
import signal
import sys
import command_mod
import subtask_mod
class Main:
"""
Main class
"""
def __init__(self) -> None:
try:
self.config()
sys.exit(self.run())
... |
#!/usr/bin/env python3
# __init__.py
#
# Copyright © 2016 Patrick Griffis <tingping@tingping.se>
#
# 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 ... |
#Author Yukun Chen
#email: cykustc@gmail.com
#Date: Sept 04 2015
import getopt
import argparse
import sys
import re
from collections import defaultdict
def displaymatch(match):
if match is None:
return None
return '<Match: %r, groups=%r>' % (match.group(), match.groups())
def bib2rest(input_bibfile... |
#!usr/bin/python
"""
Meta Data Extension for Python-Markdown
=======================================
This extension adds Meta Data handling to markdown.
Basic Usage:
>>> import markdown
>>> text = '''Title: A Test Doc.
... Author: Waylan Limberg
... John Doe
... Blank_Data:... |
"""
Tool to quickly make a dummy mask with user-supplied dimensions
The resulting mask will be a rectangle (.25*xDim X .25*yDim) positioned in the
middle of the middle slice of the given volume dimensions
"""
import os
from os.path import join
import sys
import argparse
import nibabel as nib
import numpy as np
def ... |
'''
Created on Mar 16, 2012
@author: Bartosz Alchimowicz
'''
import unittest
import regexpgen
import re
class Test(unittest.TestCase):
def testDefault(self):
regexp = regexpgen.date("%Y")
self.assertTrue(re.match(regexp, "1990"))
self.assertTrue(re.match(regexp, "2099"))
self.assertTrue(re.match(regexp, "1... |
from django.test import TestCase, SimpleTestCase
from qanda.parser import parse_qa, ParserError
from qanda.models import Question, Answer
from qanda.factory import get_question, get_answer
class QAParserTestCase(SimpleTestCase):
def test_extract_question_and_url(self):
qa = 'How do I do the thing? http://... |
import numpy as np
from sklearn.model_selection import LeaveOneOut
from sklearn.ensemble import RandomForestClassifier
from sklearn.metrics import *
from timeit import default_timer as timer
from sklearn.feature_selection import *
helmet_data = np.genfromtxt ('helmet.csv', delimiter=",")
face_data = np.genfromtxt ('fa... |
#-*- encoding: utf-8 -*-
import csv, math, time, re, threading, sys
try:
from urllib.request import urlopen
except ImportError:
from urllib import urlopen
class ErAPI():
# Metodo constructor, seteos basicos necesarios de configuracion, instancia objetos utiles
def __init__(self):
self.data = ... |
#!/usr/bin/env python3
# -*- coding: UTF-8 -*-
"""Battery model.
Models a battery on an frc robot.
"""
import logging
import pandas as pd
import numpy as np
# Pandas options
pd.set_option('max_rows', 121)
pd.set_option('max_columns', 132)
pd.set_option('expand_frame_repr', False)
# just a convenience, so we dont h... |
"""A patch to the select.poll object."""
from .base_patcher import BasePatcher
import select as select_lib
class MockPollObject(object):
"""A mock poll object."""
def __init__(self, clock, event_pool):
"""Initialize the object."""
self.clock = clock
self.event_pool = event_pool
... |
#http://code.activestate.com/recipes/52219-associating-multiple-values-with-each-key-in-a-dic/
#https://www.oreilly.com/library/view/python-cookbook/0596001673/ch01s06.html
def repeatedValue():
# this method allows duplicate values for the same key
d = dict()
# To add a key->value pair, do this:
#d.set... |
# Copyright 2019 The gRPC 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 wri... |
"""Given lines in SLP1, converts them to patterns of laghus and gurus."""
from __future__ import absolute_import, division, print_function, unicode_literals
try: xrange
except NameError: xrange = range
import re
import slp1
_SYLLABLE_RE = slp1.VOWEL_RE + slp1.CONSONANT_RE + '*'
def ScanVerse(lines):
cleaned_line... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.