src
stringlengths
721
1.04M
# Copyright 2010 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...
"""votos URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.8/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') Class-based...
from enigma import eTimer from Components.config import config, ConfigSelection, ConfigSubDict, ConfigYesNo from Tools.CList import CList from Tools.HardwareInfo import HardwareInfo # The "VideoHardware" is the interface to /proc/stb/video. # It generates hotplug events, and gives you the list of # available and pre...
""" RealXtend character exporter """ import os import b2rexpkg from b2rexpkg.siminfo import GridInfo from b2rexpkg.simconnection import SimConnection from b2rexpkg.ogre_exporter import OgreExporter from b2rexpkg.hooks import reset_uuids from ogrepkg.base import indent from ogrepkg.armatureexport import GetArmatureObj...
# # Copyright (c) 2015 nexB Inc. and others. All rights reserved. # http://nexb.com and https://github.com/nexB/scancode-toolkit/ # The ScanCode software is licensed under the Apache License version 2.0. # Data generated with ScanCode require an acknowledgment. # ScanCode is a trademark of nexB Inc. # # You may not use...
#!/usr/bin/python # TODO: issues with new oauth2 stuff. Keep using older version of Python for now. # #!/usr/bin/env python from participantCollection import ParticipantCollection import re import datetime import pyperclip # Edit Me! # This script gets run on the first day of the following month, and that month's UR...
"""Sort Cards. https://www.codewars.com/kata/56f399b59821793533000683 Write a function sort_cards() that sorts a shuffled list of cards, so that any given list of cards is sorted by rank, no matter the starting collection. All cards in the list are represented as strings, so that sorted list of cards looks like this...
import hashlib import hmac import json import re import uuid from arq.utils import to_unix_ms from buildpg import MultipleValues, Values from datetime import date, datetime, timedelta, timezone from operator import itemgetter from pytest_toolbox.comparison import RegexStr from urllib.parse import urlencode from morphe...
''' Test the ssh_known_hosts state ''' # Import python libs import os import shutil # Import Salt Testing libs from salttesting import skipIf from salttesting.helpers import ( destructiveTest, ensure_in_syspath, with_system_account ) ensure_in_syspath('../../') # Import salt libs import integration KNOW...
#! /usr/bin/env python3 """ Filters a file, classifying output in errors, warnings and discarding the rest. Given a set of regular expressions read from files named *.conf in the given configuration path(s), of the format: # # Comments for multiline regex 1... # MULTILINEPYTHONREGEX MULTILINEPYTHONREGEX M...
import time from decorator import decorator from fabric import state from fabric.api import execute, get, put, run, parallel, settings from fabric.exceptions import CommandTimeout from logger import logger from perfrunner.helpers.misc import uhex @decorator def all_hosts(task, *args, **kargs): self = args[0] ...
#!/usr/bin/env python """ Fenced Code Extension for Python Markdown ========================================= This extension adds Fenced Code Blocks to Python-Markdown. >>> import markdown >>> text = ''' ... A paragraph before a fenced code block: ... ... ~~~ ... Fenced code block ... ~~~...
#!/usr/bin/env python2 import unittest from mock import Mock, patch, mock_open from clu.common.config import classloader class ClassLoaderTestCase(unittest.TestCase): def test_load_class_witouht_module(self): """ Test that a classname without a module raiase an exception """ with self.assertRaisesR...
import os import shutil import time import json from datetime import datetime import asyncio from functools import partial import glob import random from biothings.utils.common import timesofar, get_timestamp, \ dump, rmdashfr, loadobj, md5sum from biothings.utils.mongo import id_feeder, get_target_db, get_previou...
import codecs import os import re from setuptools import setup, find_packages ############################################################################### NAME = "drf_timeordered_pagination" PACKAGES = find_packages(where="src") META_PATH = os.path.join("src", "timeordered_pagination", "__init__.py") KEYWORDS = ...
from micropython import const from machine import * import sys import framebuf import time import esp import ustruct _DISPLAY_BLINK_CMD = 0x80 _DISPLAY_BLINK_DISPLAYON = 0x01 _DISPLAY_CMD_BRIGHTNESS = 0xE0 _DISPLAY_OSCILATOR_ON = 0x21 SET_CONTRAST = const(0x81) SET_ENTIRE_ON = const(0xa4) SET_NORM_INV ...
''' This module handles unit testing for the package. If this module is ran as a script, it will run all of the tests for the entire package. These tests are denoted by the <__test__> module level functions. ''' import unittest import pkgutil import warnings __all__ = ['UnitTest', 'mock', 'test_everything'] _lo...
#!/usr/bin/env python """ Train random forest classifier Inputs: CSV from build_att_table, small area cutoff Outputs: Packaged up Random Forest model @authors: Kylen Solvik Date Create: 3/17/17 """ # Load libraries import pandas as pd from sklearn import model_selection from sklearn import preprocessing from sklearn....
# Copyright 2014 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...
#!/usr/bin/env python # coding=utf8 import numpy as np import sympy as sp class ModelRoutine: def __init__(self, matrix, args, pars, ufunc, reduced=False): self.pars = list(pars) + ['periodic'] self.matrix = matrix self.args = args self._ufunc = ufunc def __r...
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) import os from spack import * from spack.pkg.builtin.fftw import FftwBase class Amdfftw(FftwBase): """FFTW (AMD Opti...
#!/usr/bin/env python # Safe Eyes is a utility to remind you to take break frequently # to protect your eyes from eye strain. # Copyright (C) 2019 Gobinath # 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...
# -*- coding: utf-8 -*- import hashlib import time from django.core.cache import caches from ...conf import settings from ..deprecations import warn __all__ = ['RateLimit'] TIME_DICT = { 's': 1, 'm': 60} def validate_cache_config(): try: cache = settings.CACHES[settings.ST_RATELIMIT_CACHE] ...
# coding=utf-8 # ------------------------------------ # Copyright (c) Microsoft Corporation. # Licensed under the MIT License. # ------------------------------------ # pylint: disable=protected-access # pylint: disable=too-many-lines from typing import ( Any, List, Union, cast, TYPE_CHECKING ) imp...
""" CLI Tool for building FIRST Robotics (FRC) C++ projects w/ WPILib """ from setuptools import find_packages, setup dependencies = ['click'] setup( name='frcbuild', version='0.1.0', url='https://github.com/WardBenjamin/frc-build', license='BSD', author='Benjamin Ward', author_email='ward.pro...
# Copyright 2013 Hewlett-Packard Development Company, L.P. # # Author: Kiall Mac Innes <kiall@hp.com> # # 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/L...
from huuey.hue.state import State from huuey.paths import Paths class Light: """ Description: Holds data for a single Light from the hues API Attrs: state: Holds instance of State() name: Name of the group modelid: Type of Light swversion: Software Version ...
import asyncio import json import time import unittest from pprint import pprint import rocket_snake with open("tests/config.json", "r") as config_file: config = json.load(config_file) def async_test(f): def wrapper(*args, **kwargs): future = f(*args, **kwargs) loop = args[0].running_loop ...
#!/usr/bin/env python # -*- coding: utf-8 -*- # File: paste.py # Author: Yuxin Wu <ppwwyyxxc@gmail.com> from .base import ImageAugmentor from abc import abstractmethod import numpy as np __all__ = ['CenterPaste', 'BackgroundFiller', 'ConstantBackgroundFiller', 'RandomPaste'] class BackgroundFiller(object):...
# -*- coding: utf-8 -*- ## Copyright © 2012, Matthias Urlichs <matthias@urlichs.de> ## ## 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 op...
#!/usr/bin/env python # -*- encoding: utf-8 -*- # vim: set et sw=4 ts=4 sts=4 ff=unix fenc=utf8: # Author: Binux<i@binux.me> # http://binux.me # Created on 2014-02-15 22:10:35 import os import json import copy import time import httpbin import umsgpack import subprocess import unittest2 as unittest from multip...
from django.db import models from django.contrib.contenttypes import generic from django.contrib.contenttypes.models import ContentType from django.contrib.auth.models import User class SimpleText(models.Model): """A Testing app""" firstname = models.CharField(blank=True, max_length=255) lastname = models....
# Optimize SchwefelA function with differential evolution # Collect cost function and plot progress from pyopus.optimizer.de import DifferentialEvolution from pyopus.problems import glbc from pyopus.optimizer.base import Reporter, CostCollector, RandomDelay import pyopus.wxmplplot as pyopl from numpy import array, zer...
# -*- coding: utf-8 -*- class CookieStorage(object): """Interface between Cookies and Database. Args: db (Database): The Database class instance to wrap. """ def __init__(self, db): self.db = db def get(self, key): """Get the value of the given cookie key. Args:...
from apiwrapper.endpoints.installation import Installation from tests.endpoints.test_endpoint import EndpointTest class InstallationTest(EndpointTest): __base_endpoint_url = "/installation" @property def _base_endpoint(self): return self.__base_endpoint_url def setUp(self): super().s...
import argparse import os import pickle import numpy as np import matplotlib.pyplot as plt plt.style.use('ggplot') parser = argparse.ArgumentParser(description='PyTorch MNIST Example') parser.add_argument('--mnist', action='store_true', default=False, help='open mnist result') args = parser.parse_a...
import datetime import psutil # import cpuinfo import platform import json import re # import tojson def info(): jsondata = '"network":{"info":{' jsondata += '},"usage":{' jsondata += networkConnectionsInfo() jsondata += '}}' return jsondata def networkConnectionsInfo(): networkConnections = p...
"""add new notification type Revision ID: 1431e7094e26 Revises: 2b89912f95f1 Create Date: 2015-05-14 13:02:12.165612 """ from alembic import op import sqlalchemy as sa from sqlalchemy.sql import table, column from datetime import timedelta, date from sqlalchemy import and_ from ggrc import db from ggrc_workflows.mo...
# -*- coding: utf-8 -*- """This file is part of the TPOT library. TPOT was primarily developed at the University of Pennsylvania by: - Randal S. Olson (rso@randalolson.com) - Weixuan Fu (weixuanf@upenn.edu) - Daniel Angell (dpa34@drexel.edu) - and many more generous open source contributors TPOT is f...
# -*- coding: utf-8 -*- import argparse import json # import logging import os import sys import time # noqa: F401 from os import _exit from traceback import format_tb # ------------------------------------------------------------------------------ # logging.basicConfig(level=logging.INFO) # ------------------------...
# -*- coding: utf-8 -*- """ Copyright (C) 2014 Michael Davidsaver License is GPL3+, see file LICENSE for details """ import logging _log=logging.getLogger(__name__) import os, os.path from PyQt4 import QtCore, QtGui from PyQt4.QtCore import Qt from .fileframe_ui import Ui_FileFrame class FileFrame(QtGui.QFrame): ...
# Copyright (C) 2017 by # Fredrik Erlandsson <fredrik.e@gmail.com> # All rights reserved. # BSD license. # """Algorithm to compute influential seeds in a graph using voterank.""" from networkx.utils.decorators import not_implemented_for __all__ = ['voterank'] __author__ = """\n""".join(['Fredrik Erlandsson <fr...
#!/usr/bin/env python import os try: from setuptools import setup from setuptools.extension import Extension except ImportError: raise RuntimeError('setuptools is required') import versioneer DESCRIPTION = ('A set of functions and classes for simulating the ' + 'performance of photovolt...
try: paraview.simple except: from paraview.simple import * import numpy as np from mpi4py import MPI import os import csv from scipy import interpolate import gc import sys gc.enable() comm = MPI.COMM_WORLD label = 'm_25_3b' labelo = 'm_25_3b' basename = 'mli' ## READ archive (too many points... somehow) # args: n...
# -*- encoding: utf-8 -*- ############################################################################## # # Copyright (C) 2013-2016 Didotech SRL # # 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 F...
# -*- coding: utf-8 -*- # This file is part of wger Workout Manager. # # wger Workout Manager 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 option) any ...
from rpython.rlib import jit from . import pretty class ImmutableEnv(object): _immutable_fields_ = ['_w_slots[*]', '_prev'] def __init__(self, w_values, prev): self._w_slots = w_values self._prev = prev @jit.unroll_safe def at_depth(self, depth): #depth = jit.promote(depth) ...
from __future__ import absolute_import, division, unicode_literals import datetime import os import sys from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.core.management.base import BaseCommand from django.db import transaction from django.utils.timezone import now f...
__author__ = 'Kal Ahmed' from itertools import dropwhile import re import git from quince.core.repo import git_dir, QUINCE_DIR, QuinceStore LINE_REGEX = re.compile(r"(?P<s>" + QuinceStore.IRI_MATCH + r")\s+(?P<p>" + QuinceStore.IRI_MATCH + r")\s+" + r"(?P<o>" + QuinceStore.URI_OR_L...
# # Copyright 2013, 2014 # by Arnold Krille for bcs kommunikationsloesungen # <a.krille@b-c-s.de> # # 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:...
# Задача №2: # Сформировать словарь, ключами которого являются квадраты чисел с шагом 0.01, # а значениями - кубический корень из ключа # # Вариант решения №1, через цикл for # # =!!= Запускать с помощью Python3 =!!= # Печатать словарь будем функцией pprint from pprint import pprint # Количество элементов N = 50 # С...
import json import os #TODO: handle unicode better instead of just ignoring it from unidecode import unidecode from abc import ABC, abstractmethod import src.util.callbackUtil import src.data.messages import src.data.polls class API(ABC): def __init__(self, token): self.apiName = "" self.client...
# -*- 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): # Adding field 'Makey.is_staff_pick' db.add_column(u'catalog_makey', 'is_staff_pick', ...
import json from bson.json_util import loads, dumps from flask import Flask, request, jsonify from flask_pymongo import PyMongo from meter.ml.tfidf import TermFreqInverseDocFreq app = Flask(__name__) app.config.from_object('config') mongo = PyMongo(app) midi_tfidf = TermFreqInverseDocFreq() midi_tfidf.load('./meter/r...
# Copyright (C) 2009, 2010 Roman Zimbelmann <romanz@lavabit.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 Foundation, either version 3 of the License, or # (at your option) any later version. # # ...
""" The PLAIN server mechanism. """ from ..log import logger from .base import Mechanism class PlainServer(object): def __call__(self): return PlainServerMechanism() class PlainServerMechanism(Mechanism): name = b'PLAIN' as_server = True @classmethod async def _read_plain_hello(cls, r...
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ...
''' A Graph class implementation. The aim for this implementation is 1. To reflect implementation methods in literature as much as possible 3. To have something close to a "classic" object-oriented design (compared to previous versions) This implementation can be considered as a compromise between a graph class design...
# -*- coding: utf-8 -*- # Copyright (c) 2019, Frappe Technologies and contributors # For license information, please see license.txt from __future__ import unicode_literals import frappe from frappe.model.document import Document from frappe.desk.form import assign_to import frappe.cache_manager from frappe import _ ...
# -*- coding: utf-8 -*- # Author: Hynek Hanke <hynek.hanke@auto-mat.cz> # # Copyright (C) 2010 o.s. Auto*Mat # # 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...
# -*- coding: utf-8 -*- import operator from django.conf import settings from django.contrib.contenttypes.models import ContentType from django.contrib.contenttypes import generic from django.db import models from django.db.models.signals import post_delete from django.utils.html import strip_tags from django.utils imp...
#!/usr/bin/env python3 # -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- import os import sys from itertools import takewhile, dropwhile try: import DistUtilsExtra.auto except ImportError: print('To build ulauncher you need "python3-distutils-extra"', file=sys.stderr) sys.exit(1)...
#!/usr/bin/env python """ Test parsing of units """ import unittest, time, datetime import parsedatetime.parsedatetime as pt # a special compare function is used to allow us to ignore the seconds as # the running of the test could cross a minute boundary def _compareResults(result, check): target, t_flag = ...
"""A human agent manages its own board and displays a board and adds moveable pieces so a human agent can play pieces on the board from his or her hand""" import Agent import Move import queue import Board import BoardCanvas import Player import Building import Tile import Location import GameConstants import threadin...
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). import os import re from pants.base.build_environment import get_buildroot from pants.testutil.pants_run_integration_test import PantsRunIntegrationTest from pants.util.contextutil import...
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
from django.test import override_settings from rest_framework.reverse import reverse from rest_framework.test import APITestCase from mymoney.transactions.models import Transaction from ..factories import UserFactory class ConfigAPITestCase(APITestCase): @classmethod def setUpTestData(cls): cls.us...
# coding=utf-8 # Copyright 2021 The Tensor2Robot 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 ...
import tensorflow as tf from tensorflow.python.ops.rnn_cell import LSTMStateTuple from memory import Memory import utility import os class Dual_DNC_Dual: def __init__(self, controller_class, input_size1, input_size2, output_size1, output_size2, memory_words_num = 256, memory_word_size = 64, memor...
from django.db import models from oPOSum.libs import utils as pos_utils from django.utils.translation import ugettext as _ from decimal import Decimal from django.core.validators import RegexValidator # Create your models here. class Client(models.Model): first_name = models.CharField(_("First Name"), max_length=1...
import os os.environ['TF_CPP_MIN_LOG_LEVEL']='3' import common import gzip import matplotlib.pyplot as plt import numpy as np import pandas as pd import pickle as pkl import sys from data import load_data from itertools import product from os.path import join from sklearn.model_selection import train_test_split # Defa...
# - coding: utf-8 - # Copyright (C) 2007 Patryk Zawadzki <patrys at pld-linux.org> # Copyright (C) 2008, 2010 Toms Bauģis <toms.baugis at gmail.com> # This file is part of Project Hamster. # Project Hamster is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License...
### generate temporary images using GIT commits ### dependencies : imagemagick import os def genTempImage( gitImage, options, outputName, outputExt, outputDir ): os.system( 'convert ' + gitImage + ' ' + options + ' ' + outputDir + outputName ...
# coding=<utf-8> import numpy as np import cv2 from matplotlib import pyplot as plt from matplotlib.widgets import Slider from numpy import * import copy import time import sys import math import operator import os pic_path = 'dataset/true/1.png' pic_dir = 'dataset/true_resize_rotate/' rect_scale = 5 r...
# Time: O(n * d), n is length of string, d is size of dictionary # Space: O(d) # # Given two words (start and end), and a dictionary, find the length of shortest transformation sequence from start to end, such that: # # Only one letter can be changed at a time # Each intermediate word must exist in the dictionary # F...
# -*- coding: utf-8 -*- import sys import os sys.path.insert(0, '.') sys.path.insert(0, '..') # -- General configuration ------------------------------------------------ # If your documentation needs a minimal Sphinx version, state it here. #needs_sphinx = '1.0' # Add any Sphinx extension module names here, as str...
""" Classes used to represent the configuration tree. """ from itertools import chain from collections import defaultdict class MultipleSectionsWithThisNameError(Exception): """ Exception raised if only one section is expected, but multiple returned. """ class Position(object): """ Position of a stat...
#!/usr/bin/env python # Licensed to Cloudera, Inc. under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. Cloudera, Inc. licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you ma...
from flask import make_response, request from flask_restful import abort from funcy import project from redash import models from redash.utils.configuration import ConfigurationContainer, ValidationError from redash.permissions import require_admin, require_permission, require_access, view_only from redash.query_runne...
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals, print_function import frappe import unittest, json, sys, os import time import xmlrunner import importlib from frappe.modules import load_doctype_module, get_module_name import ...
import getpass import uuid import time import os import pprint from pwd import getpwuid from tabulate import tabulate import pandas as pd from .object_helpers import ( set_docstring, Workspace, format_timestamp, MetList, MetUnicode, MetFloat, MetInstance, MetInt, MetEnum, MetBool, HasTraits, Stub ) #Makin...
import base64 import random import time import base58 import pytest from common.serializers import serialization from common.serializers.serialization import state_roots_serializer from crypto.bls.bls_multi_signature import MultiSignature, MultiSignatureValue from plenum.bls.bls_store import BlsStore from plenum.comm...
#!/usr/bin/env python # -*- coding: utf-8 -*- # pywws - Python software for USB Wireless Weather Stations # http://github.com/jim-easterbrook/pywws # Copyright (C) 2008-14 Jim Easterbrook jim@jim-easterbrook.me.uk # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU...
# -*- coding: utf-8 -*- from datetime import datetime, timedelta import time from openerp import pooler from openerp.osv import fields, osv from openerp.tools.translate import _ class is_secteur_activite(osv.osv): _name = 'is.secteur.activite' _description = u"Secteurs d'activités" _columns = { ...
# Copyright 2015 Internap. # # 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, so...
import numpy as np from erukar.system.engine.inventory import ArcaneWeapon class Focus(ArcaneWeapon): Probability = 1 BaseName = "Focus" EssentialPart = "devotion" AttackRange = 3 RangePenalty = 3 BaseWeight = 1.0 # Damage DamageRange = [2, 5] DamageType = 'force' DamageModifi...
# -*- coding: utf-8 -*- """ line.client ~~~~~~~~~~~ LineClient for sending and receiving message from LINE server. :copyright: (c) 2014 by Taehoon Kim. :license: BSD, see LICENSE for more details. """ import re import requests import sys from api import LineAPI from models import LineGroup, LineC...
# -*- coding: utf-8 -*- ########################################################################### # OCRFeeder - The complete OCR suite # Copyright (C) 2009 Joaquim Rocha # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as publ...
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'Fix' db.create_table('lint_fix', ( ('id', self.gf('django.db.models.fields.Aut...
# This file is part of the GOsa project. # # http://gosa-project.org # # Copyright: # (C) 2016 GONICUS GmbH, Germany, http://www.gonicus.de # # See the LICENSE file in the project's top-level directory for details. import pytest import uuid from tornado.concurrent import Future from tornado.testing import AsyncTestCa...
# -*- coding: utf-8 -*- # test_sync_target.py # Copyright (C) 2013, 2014 LEAP # # 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 v...
import os import sys from stopwords_video import vid_stopwords from stop_words import stopword import nltk import re from nltk import stem stemmer = stem.PorterStemmer() from operator import itemgetter import math try: folder_name=sys.argv[1] folder_name="output/"+folder_name.split(".txt")[0] max_gram=sys.argv[2] ...
import sys from setuptools import setup from setuptools.command.test import test as TestCommand class PyTest(TestCommand): user_options = [('pytest-args=', 'a', "Arguments to pass to py.test")] def initialize_options(self): TestCommand.initialize_options(self) self.pytest_args = [] def fi...
# -*- coding: utf-8 -*- """ Spectrum class for running starlight on spectra. Particularly for MUSE cubes """ import matplotlib matplotlib.use('Agg') import os import numpy as np import scipy as sp import shutil import time import platform import matplotlib.pyplot as plt import logging from ..MUSEio.museio impor...
#!/usr/bin/env python # -*- coding: utf-8 -*- import os, ConfigParser, tweepy, inspect, hashlib path = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe()))) # read config config = ConfigParser.SafeConfigParser() config.read(os.path.join(path, "config")) # your hashtag or search query and tweet l...
#!/usr/bin/env python """Manually send commands to the RC car.""" import argparse import json import pygame import pygame.font import socket import sys from common import server_up UP = LEFT = DOWN = RIGHT = False QUIT = False # pylint: disable=superfluous-parens def dead_frequency(frequency): """Returns an app...
from stock.models import Item,Unit,Transaction from stock.serializers import ItemSerializer,UnitSerializer,TransactionSerializer #from django.shortcuts import render #from django.http import HttpResponse from django.http import Http404 #lives in the django.http module from django.template import RequestContext,loader...
from time_utils import time_constrains def prepare_nsi_attributes(connAttributes): params = {} params['gid'] = "NSI-REST service" params['desc'] = connAttributes['description'] params['src'] = "%(src_domain)s:%(src_port)s" % connAttributes params['dst'] = "%(dst_domain)s:%(dst_port)s" % connAttr...
# -*- coding: utf-8 -*- ############################################################################################### # # MediaPortal for Dreambox OS # # Coded by MediaPortal Team (c) 2013-2017 # # This plugin is open source but it is NOT free software. # # This plugin may only be distributed to and executed...
import re from model.contact import Contact class ContactHelper: def __init__(self, app): self.app = app def return_to_home_page(self): wd = self.app.wd wd.find_element_by_link_text("home page").click() def create(self, contact): wd = self.app.wd # init contact ...