src stringlengths 721 1.04M |
|---|
import os
import shutil
import threading
import traceback
import fsui
from fsbc.path import is_same_file
from fsgamesys.amiga.rommanager import ROMManager
from fsgamesys.filedatabase import FileDatabase
from fsgamesys.FSGSDirectories import FSGSDirectories
from ...i18n import gettext
from ...launcher_signal import La... |
# 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 unde... |
# -*- coding: utf-8 -*-
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from __future__ import absolute_import
from flask import current_app
from typing import List
fro... |
# At the time of this writing,
# 4XSLT generates a traceback when you do an apply-templates on a result tree
# fragment. It should generate a friendly (but equally fatal) error.
#
from Xml.Xslt import test_harness
sheet_1 = """\
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://ww... |
# Copyright 2014 The Oppia 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 applicable ... |
# -*- coding: utf-8 -*-
#
# This file is part of CERN Analysis Preservation Framework.
# Copyright (C) 2014, 2015 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; ... |
import os
import pytest
from unittest import mock
from ..environment import EnvironmentProvider
from ..base import Environment
@pytest.fixture
def simpleenv():
filename = os.path.join(os.path.dirname(__file__), "environments.yml")
return EnvironmentProvider(filename)
@pytest.mark.asyncio
async def test_get_... |
#!/usr/bin/env python
#from waflib.Configure import conf
#from waflib.TaskGen import feature
def options(ctx):
ctx.add_option('-B', '--build', action='store', default="release",
help='Specifies which build to run.')
ctx.add_option('--list-builds', action='store_true',
help='Lists all available builds and the... |
# -*- coding: utf-8 -*-
# Copyright 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 requi... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
try:
from unittest.mock import call, Mock
except ImportError:
from mock import call, Mock
import pytest
from oled.device import sh1106
from oled.render import canvas
import baseline_data
serial = Mock(unsafe=True)
def setup_function(function):
serial.reset... |
import pytest
import mock
from skipper.creds import Creds, JSONStorage
@pytest.fixture()
def creds():
storage = mock.MagicMock()
storage.retrieve.return_value = {}
creds = Creds(storage=storage)
return creds
def test_creds(creds):
assert creds == {}
creds['foo'] = 'bar'
assert creds == ... |
# Copyright 2018 The TensorFlow 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 applica... |
###############################################################################
#
# Tests for XlsxWriter.
#
# Copyright (c), 2013-2016, John McNamara, jmcnamara@cpan.org
#
from ..excel_comparsion_test import ExcelComparisonTest
from ...workbook import Workbook
class TestCompareXLSXFiles(ExcelComparisonTest):
"""... |
#
# This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not
# distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
import glob
import os
import sys
Import('*')
vars = Variables()
vars.AddVariables(
('architecture', 'Sets the ta... |
# system imports
import multiprocessing
import pickle
import sys
from itertools import *
# anaconda imports
import networkx as nx
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
class NetTS:
''' Network Time Series '''
### member vars ###
# self.nts - list of networks repres... |
import os
import dask.array as da
import numpy as np
from distributed import Client, LocalCluster
from sklearn.datasets import load_svmlight_file
import lightgbm as lgb
if __name__ == "__main__":
print("loading data")
X, y = load_svmlight_file(os.path.join(os.path.dirname(os.path.realpath(__file__)),
... |
# -*- coding: utf-8 -*-
# © Copyright 2009 Andre Engelbrecht. All Rights Reserved.
# This script is licensed under the BSD Open Source Licence
# Please see the text file LICENCE for more information
# If this script is distributed, it must be accompanied by the Licence
import re
from django import template
from djan... |
#!/usr/bin/env python
#
# Copyright 2012 The CSSCheckStyle 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
#
... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Formatter to de/format omor style analyses for omrfi."""
# (c) Omorfi contributors <omorfi-devel@groups.google.com> 2015
# see AUTHORS file in top-level dir of this project, or
# <https://github.com/flammie/omorfi/wiki/AUTHORS>
# This program is free software: you c... |
"""
Serializers for the courseware API
"""
from rest_framework import serializers
from courseware import models
from video.serializers import VideoSerializer
from quiz.serializers import QuizSerializer
from document.serializers import DocumentSerializer
class AddGroupSerializer(serializers.ModelSerializer):
cl... |
# coding=UTF8
# Строчка выше нужна на случай использования Non-ASCII символов, например кириллицы.
# Корректирующий множитель для таймаута SNMP-операций. Чем медленнее CPU устройства, тем больше должен быть множитель.
# Этот параметр используется (если задан) для swtoolz-core. Остальные параметры целиком определяются ... |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'ui_normal.ui'
#
# Created: Sun Jun 22 22:19:12 2014
# by: PyQt4 UI code generator 4.10.4
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
from QtRec import QtGui as QtRecGui
try:
_fromUtf8 = ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2015 Red Hat, Inc
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless req... |
"""
Example code showing how to draw an interactive matplotlib figure
in Excel.
While the figure is displayed Excel is still useable in the background
and the chart may be updated with new data by calling the same
function again.
"""
from pyxll import xl_func
from pandas.stats.moments import ewma
# matplotlib imports... |
import sublime_plugin
class ReversePipeJoinMultilineCommand(sublime_plugin.TextCommand):
def run(self, edit):
"""
BEFORE
blue
red
green
purple
orange
yellow
AFTER
yellow|
red|
purpl... |
"""praw constants."""
import sys
__version__ = '5.2.1.dev0'
API_PATH = {
'about_edited': 'r/{subreddit}/about/edited/',
'about_log': 'r/{subreddit}/about/log/',
'about_modqueue': 'r/{subreddit}/about/modqueue/',
'about_reports': 'r/{subreddit}/about/reports/',
... |
# pylibjit can be used to statically resolve method calls in object-oriented
# code. A call from a compiled method to a compiled method (in the same or
# in a different class) bypasses all dynamic lookups if the dynamic type of
# the receiver is declared. Note that all instances at runtime must be of
# exactly the decl... |
#!/usr/bin/env python
''' Jottings to work out format for __function_workspace__ matrix at end
of mat file.
'''
from __future__ import division, print_function, absolute_import
from os.path import join as pjoin, dirname
import sys
from io import BytesIO
from numpy.testing import \
assert_array_equ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#-------------------------------------------------------------------------------
# Name: navitia2OSM.py
#
# Author: @nlehuby - noemie.lehuby(at)gmail.com
#
# Created: 04/06/2014
# Licence: WTFPL
#---------------------------------------------------------... |
# 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 ... |
import unittest
import abstract
from soyprice.model import database as db
from soyprice.model.soy import Chicago
import os
import datetime
import requests
class TestChicago(abstract.TestCase):
def setUp(self):
self.remove('cache*')
self.cache = db.open()
self.var = Chicago(self.cache)
... |
#!/usr/bin/python
from __future__ import (absolute_import, division, print_function)
# Copyright 2019 Fortinet, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the Lic... |
#!/usr/bin/python
# Ubuntu Tweak - PyGTK based desktop configure tool
#
# Copyright (C) 2007-2008 TualatriX <tualatrix@gmail.com>
#
# Ubuntu Tweak 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 versio... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# lazyscraper documentation build configuration file
#
# 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.
#
# All configuration values have a defa... |
#
# Copyright 2013 Quantopian, 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 wr... |
# -*- coding: utf-8 -*-
import logging
import re
import scrapy
from votes import items
__author__ = 'Arthur Cheysson <arthur.cheysson@opusline.fr>'
logger = logging.getLogger(__file__)
RE_VOTE = r'([0-9]+)(\*?)'
RE_SCRUTIN_URL = r'\(legislature\)/(?P<legislature>[0-9]+)/\(num\)/(?P<scrutin>[0-9]+)$'
RE_SCRUTIN_DA... |
import collections
import fudge
from nose.tools import eq_, assert_raises
from oedipus import S
from oedipus.tests import Biscuit, SphinxMockingTestCase, BaseSphinxMeta
from oedipus.results import ObjectResults, DictResults, TupleResults
class ResultsTestCase(SphinxMockingTestCase):
"""Tests for various result f... |
import os
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/1.9/howto/deployment/checklist/
# SECURITY WARNING: keep the... |
# -*- coding: utf-8 -*-
#
#
# TheVirtualBrain-Scientific Package. This package holds all simulators, and
# analysers necessary to run brain-simulations. You can use it stand alone or
# in conjunction with TheVirtualBrain-Framework Package. See content of the
# documentation-folder for more details. See also http://www... |
#!/usr/bin/env python
"""
Functions to do automatic visualization of activation-like maps.
For 2D-only visualization, only matplotlib is required.
For 3D visualization, Mayavi, version 3.0 or greater, is required.
"""
# Author: Gael Varoquaux <gael dot varoquaux at normalesup dot org>
# License: BSD
# Standard libr... |
#!/usr/bin/env python
import numpy
import os
import tensorflow as tf
from multiprocessing import Pool
from tqdm import tqdm
import numpy as np
import h5py
from generic.data_provider.nlp_utils import DummyTokenizer
from generic.data_provider.iterator import Iterator
def extract_features(
img_input,
ft... |
import unittest
from diffie_hellman import private_key, public_key, secret
# Tests adapted from `problem-specifications//canonical-data.json`
class DiffieHellmanTest(unittest.TestCase):
def test_private_key_is_greater_than_1_and_less_than_p(self):
primes = [5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, ... |
# Copyright 2008, 2015 Oleg Plakhotniuk
#
# This file is part of Toothris.
#
# Toothris 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.... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
import six
import mock
import irc
from fortunebot import bot
MODULE = 'fortunebot.botrunner'
EXAMPLE_CHANNEL = "#test"
EXAMPLE_NICK = "fortunebot"
EXAMPLE_MSG = "abcdefg"
EXAMPLE_MSG2 = "星空"
EXAMPLE_SCRIPT_RETURN = EXAMPLE_MSG2
class TestFortunebot(object):
def s... |
import os
from setuptools import setup, find_packages
here = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(here, 'README.txt')) as f:
README = f.read()
with open(os.path.join(here, 'CHANGES.txt')) as f:
CHANGES = f.read()
requires = [
'pyramid',
'pyramid_chameleon',
'pyramid_j... |
# -*- coding: utf-8 -*-
# Copyright 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 requi... |
# Git repo support.
# Copyright (C) 2019-2020 Free Software Foundation, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later ve... |
# Copyright (c) 2013-2015 Siphon Contributors.
# Distributed under the terms of the BSD 3-Clause License.
# SPDX-License-Identifier: BSD-3-Clause
"""Support reading and parsing the dataset.xml documents from the netCDF Subset Service."""
from __future__ import print_function
import logging
import re
import numpy as ... |
# jsb/container.py
#
#
""" container for bot to bot communication. """
__version__ = "1"
## jsb imports
from jsb.lib.persist import Persist
from jsb.utils.name import stripname
from jsb.lib.gozerevent import GozerEvent
from jsb.imports import getjson
## basic imports
import hmac
import uuid
import time
import has... |
# -*- coding: utf-8 -*-
#
# This tool helps you to rebase package to the latest version
# Copyright (C) 2013-2014 Red Hat, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2... |
# -*- coding: utf-8 -*-
#
# Copyright (c) 2013 Clione Software
# Copyright (c) 2010-2013 Cidadania S. Coop. Galega
#
# 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.or... |
# Copyright (C) 2011 Brad Misik
#
# 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
# use, copy, modify, merge, publish, distribu... |
"""Module holding the functions for the db."""
import logging
from django.conf import settings
from mobsf.MobSF.utils import python_dict, python_list
from mobsf.StaticAnalyzer.models import StaticAnalyzerIOS
from mobsf.StaticAnalyzer.models import RecentScansDB
logger = logging.getLogger(__name__)
def get_context_... |
# Copyright (c) 2007-2019 UShareSoft, 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 requi... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
################################################################################
#
# RMG - Reaction Mechanism Generator
#
# Copyright (c) 2002-2010 Prof. William H. Green (whgreen@mit.edu) and the
# RMG Team (rmg_dev@mit.edu)
#
# Permission is hereby granted, free of c... |
#
# 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... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2012-2019 Snowflake Computing Inc. All right reserved.
#
from sqlalchemy.types import (
BIGINT,
BINARY,
BOOLEAN,
CHAR,
DATE,
DATETIME,
DECIMAL,
FLOAT,
INT,
INTEGER,
REAL,
SMALLINT,
TIME,
TIMESTAMP,
... |
import os
import appdirs
from PyQt5 import QtWidgets, QtCore, QtGui
from .projectdialog_ui import Ui_Form
class ProjectDialog(QtWidgets.QWidget, Ui_Form):
projectSelected = QtCore.pyqtSignal(str)
def __init__(self, mainwindow: QtWidgets.QWidget):
self.mainwindow = mainwindow
super().__init_... |
# Licensed to the StackStorm, Inc ('StackStorm') 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 th... |
#!/usr/bin/env python
#
# (C)2011 Red Hat, Inc., Lukas Czerner <lczerner@redhat.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 2 of the License, or
# (at your option) any ... |
# Copyright 2012 Jose Blanca, Peio Ziarsolo, COMAV-Univ. Politecnica Valencia
# This file is part of seq_crumbs.
# seq_crumbs 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, ... |
# -*-coding:Utf-8 -*
# Copyright (c) 2012 LE GOFF Vincent
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice, this
# lis... |
#
# This file is part of Scalable COncurrent Operations in Python (SCOOP).
#
# SCOOP is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as
# published by the Free Software Foundation, either version 3 of
# the License, or (at your option)... |
from __future__ import print_function, with_statement
import os
import sys
import stat
import json
import etcd
from functools import wraps
from fabric.api import *
from fabric.colors import red, yellow, white, green
from fabric.contrib.console import confirm
from fabric.contrib.files import exists
__doc__ = """\
Help... |
# Copyright 2015 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.
import contextlib
import datetime
import distutils.util
import json
import logging
import os
import re
import shutil
import subprocess
import sys
import temp... |
# Copyright (C) 2017 Siavoosh Payandeh Azad, Stephen Oyeniran
# for each new function we start from empty set!
import Logger
import sys
import copy
import itertools
import time
import package
package.generate_folders(package.generated_files_folder)
sys.stdout = Logger.Logger(package.generated_files_folder)
if "-sp" i... |
"""
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.
Written (W) 2013 Heiko Strathmann
Written (W) 2013 Dino Sejdinovic
"""
fro... |
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
# Copyright 2014 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.
import os
import pickle
import re
import shutil
import tempfile
import time
import unittest
from telemetry.core import util
from telemetry import decorators... |
# -*- coding: utf-8 -*-
"""
Tests for the spike train dissimilarity measures module.
:copyright: Copyright 2016 by the Elephant team, see `doc/authors.rst`.
:license: Modified BSD, see LICENSE.txt for details.
"""
import unittest
from neo import SpikeTrain
import numpy as np
from numpy.testing import assert_array_equ... |
import os
from configparser import ConfigParser
import string
from numpy import std, mean
def read_config(file = 'configdata.cfg'):
"""
read the configuration file, by default configdata.cfg.
returns a dict containing relevant config info.
"""
config = ConfigParser()
config.read(file)
asse... |
import time
from liblinearutil import *
from sklearn import cluster
from src.landmark import *
from src.projection import *
def learning(train_x,train_y,test_x,test_y,printf=print,CLUS=1,PCA_BOOL=False,LIN=True,LAND=10):
t2 = time.time()
if CLUS > 1:
# get clusterer
clusterer = cluster.MiniB... |
# Pyctools - a picture processing algorithm development kit.
# http://github.com/jim-easterbrook/pyctools
# Copyright (C) 2019-20 Pyctools contributors
#
# 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 Softwa... |
"""
This module provides an abstraction for working with XModuleDescriptors
that are stored in a database an accessible using their Location as an identifier
"""
import logging
import re
from collections import namedtuple
from abc import ABCMeta, abstractmethod
from .exceptions import InvalidLocationError, Insuffic... |
"""
The module for drawing the game world
"""
# Standard Library packages
import sys
# External dependenices
import pygame
# Internal dependencies
import world
# Rendering settings
SCREEN_X = 450
SCREEN_Y = 450
HALF_SCREEN_X = SCREEN_X // 2
HALF_SCREEN_Y = SCREEN_Y // 2
SQUARE_SIZE = 18
SCREEN_BG = ... |
# Copyright 2020 Google LLC.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
import pytest
from pandas._libs.tslibs import frequencies as libfrequencies, resolution
from pandas._libs.tslibs.frequencies import (
FreqGroup, _period_code_map, get_freq, get_freq_code)
import pandas.tseries.offsets as offsets
@pytest.fixture(params=list(_period_code_map.items()))
def period_code_item(request... |
# -*- coding: utf8 -*-
from __future__ import absolute_import, division, print_function
import av
from av.video.frame import VideoFrame
from av.video.stream import VideoStream
# В этом списке будем хранить кадры в виде numpy-векторов.
array_list = []
# Откроем контейнер на чтение
input_container = av.open('input.mp... |
# Dated : Aug 25, 2017
# About : Sample Pyspark (1.6.0) code to count number of Rows in a Kudu Table
# Pyspark Version : 1.6.0
# Kudu Version : 1.2.0
# Coder : Ankit Sarraf
import ConfigParser
from pyspark import SparkContext
from pyspark import SparkConf
from pyspark.sql import SQLCon... |
from django.shortcuts import render
from django.http import HttpResponse
from django.shortcuts import render_to_response
from django.views.decorators.csrf import csrf_exempt
from django.template import RequestContext
import markov_functions.mk_functions as ma
from core import development_tools as log
from mark... |
from HTMLComponent import HTMLComponent
from GUIComponent import GUIComponent
from VariableText import VariableText
from skin import parseColor
from ConditionalWidget import ConditionalWidget, BlinkingWidget, BlinkingWidgetConditional
from enigma import eLabel
class Label(VariableText, HTMLComponent, GUIComponent):
... |
# ----------------------------------------------------------------------------
# pyglet
# Copyright (c) 2006-2008 Alex Holkner
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistribu... |
import win32pipe
import win32console
import win32process
import time
import win32con
import codecs
import ctypes
user32 = ctypes.windll.user32
CONQUE_WINDOWS_VK = {
'3' : win32con.VK_CANCEL,
'8' : win32con.VK_BACK,
'9' : win32con.VK_TAB,
'12' : win32con.VK_CLEAR,
'13' : win32con.V... |
#/usr/bin/python
# -*- coding: utf-8 -*-
"""! @package utils.uid
"""
# Get command line arguments
from optparse import OptionParser
parser = OptionParser()
parser.add_option("-i", "--input", dest="input", action="store", help="input MDF file")
parser.add_option("-o", "--output", dest="output", action="store", help="o... |
import ignorance
import os
try:
# pathlib is in python stdlib in python 3.5+
from pathlib import Path
except ImportError:
from pathlib2 import Path
import pytest
def test_basic_walk(tmpdir_builder):
path = tmpdir_builder.setup('git/basic_match')
files = []
for r, d, f in ignorance.git.walk(pat... |
#! /bin/python
import os
import re
from AppOptions import AppOptions
class DNGConverter(object):
"""handle optional DNG conversion"""
regexDNGsrc = re.compile(r'(.*)\.RW2')
@classmethod
def filetype_search(cls, Filename):
return cls.regexDNGsrc.search(Filename)
def __init__(self, Options=AppOptions())... |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
__author__="Josh Montague"
__license__="MIT License"
import sys
import unittest
from StringIO import StringIO
from foursquare_acs import *
# valid activity from source (eg from data/)
VALID_ACTIVITY = """{"id":"tag:gnip.foursquare.com:2013:checkin/53910e5c498eb98e8cadf5... |
from django.conf import settings
from django.conf.urls import include, url
from django.conf.urls.i18n import i18n_patterns
from django.contrib import admin
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from django.views.generic import RedirectView, TemplateView
from django.views.static import serv... |
# coding: utf-8
from django.test import TestCase
from django_factory_boy import auth
from journalmanager import (
models,
modelmanagers,
)
from journalmanager.tests import modelfactories
class JournalManagerTests(TestCase):
def _make_user(self, *collection):
user = auth.UserF(is_active=True)
... |
# coding=utf-8
# Copyright 2018 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import itertools
imp... |
import re
from django.core.urlresolvers import reverse
import pytest
from selenium.common.exceptions import NoSuchElementException
@pytest.mark.browser_test
def test_add_url_form(browser, user_with_perm, live_server):
url = reverse("us_add_url_form")
browser.get(live_server.url + url)
_login(browser)
... |
from __future__ import unicode_literals, division, absolute_import
from builtins import * # pylint: disable=unused-import, redefined-builtin
from future.moves.urllib.parse import quote
import logging
import re
import feedparser
from flexget import plugin
from flexget.entry import Entry
from flexget.event import eve... |
#!/usr/bin/env python
#-----------------------------------------------------------------------------
# Copyright (c) 2013, The BiPy Development Team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed with this software.
#--------------------------... |
"""Create billing_plan table
Revision ID: 3e56c7e0a4a4
Revises: 3aaddd5707bd
Create Date: 2015-11-05 13:30:32.460413
"""
revision = '3e56c7e0a4a4'
down_revision = '3aaddd5707bd'
from alembic import op, context
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
from sqlalchemy.types import Enum
def... |
#!/usr/bin/env python
# -*- encoding: utf-8
import datetime as dt
import os
from travistooling import git, ROOT
def get_rfc_readmes(repo):
rfcs_dir = os.path.join(repo, "docs", "rfcs")
for root, _, filenames in os.walk(rfcs_dir):
for f in filenames:
if f == "README.md":
y... |
# -*- coding: utf-8 -*-
import unittest
import matplotlib.pyplot as plt
import numpy as np
from .. import scene
from ...patch.pint import ureg
class test_scene(unittest.TestCase):
def test_images(self):
n0, n1 = 5, 10
img = np.arange(n0 * n1).reshape(n0, n1)
unit0 = ureg.mm
uni... |
"""
Defines (morphological) measures for different geometries
Finds the distance between points, polygon area, etc.
.tree
.tree.arbor
* total length (implies information about metric)
* diameter (along segement, or at start/endpoints)
* number of spines
* spine density
* mean spine length
* relative populations of spi... |
#!/usr/bin/python
"""comment storage for blogs, photo site, etc
see also:
sioc:Post sioc:has_reply sioc:Post / types:Comment
sioc:content
content:encoded
dcterms:created
types:BlogPost
types:Comment
"""
import web, time, logging, pystache, trac... |
#!/usr/bin/python -u
# Copyright or Copr. INRIA/Scilab - Sylvestre LEDRU
#
# Sylvestre LEDRU - <sylvestre.ledru@inria.fr> <sylvestre@ledru.info>
#
# This software is a computer program whose purpose is to generate C++ wrapper
# for Java objects/methods.
#
# This software is governed by the CeCILL license under Fren... |
# ############################################################################
#
# Copyright (C) 2015 Minzhang Cheng
# Contact: minzhangcheng@gmail.com
#
# This file is part of the Minzhang's Python Library, a Python library with many utils by Minzhang Cheng.
#
# GNU Lesser General Public License Usage
# This file may ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.