src stringlengths 721 1.04M |
|---|
#coding:utf-8
# -*- coding: utf-8 -*-
"""
Django settings for sport project.
Generated by 'django-admin startproject' using Django 1.9.4.
For more information on this file, see
https://docs.djangoproject.com/en/1.9/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en... |
# -*- coding: utf-8 -*-
"""
Django settings for cacao_app project.
For more information on this file, see
https://docs.djangoproject.com/en/dev/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/dev/ref/settings/
"""
# Build paths inside the project like this: os.p... |
# -*- coding: utf-8 -*-
import pkg_resources
import colander
from pyramid.httpexceptions import HTTPFound
from pyramid.renderers import get_renderer
from briefkasten import _, is_equal
title = "ZEIT ONLINE Briefkasten"
version = pkg_resources.get_distribution("briefkasten").version
class _FieldStorage(colander.Schem... |
# This file is part of Indico.
# Copyright (C) 2002 - 2020 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.
from __future__ import unicode_literals
from flask import current_app, redirect, request
from indico.mod... |
# Configuration.py -- Configuration container
# Copyright (C) 2007-2014 CEA
#
# This file is part of shine
#
# 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... |
#!/usr/bin/env python3
import picamera
import numpy
import io
import time
def get_png_image(resolution=(640, 480)):
width, height = resolution
image_stream = io.BytesIO()
with picamera.PiCamera() as camera:
camera.resolution = resolution
camera.start_preview()
camera.capture(imag... |
from random import choice
from mapcache import MapCache
from chunk import Chunk
class ChunkManager:
def __init__(self, world):
self.world = world
self.chunkCache = []
self.mapCache = MapCache(self, self.world.seed)
self.maxCacheSize = 64
def getChunk(self, x, y):
chunkX = int(x) >> 4
chunkY = int(y) ... |
# -*-coding:Utf-8 -*
# ====================================================================
# Packages
# ====================================================================
import configparser as cp
import copy
import glob
import muLAn
import muLAn.packages.general_tools as gtools
import muLAn.packages.algebra as alge... |
"""This module defines magic IPython functions to run pyslave from the IPython shell."""
import time, os, logging, inspect, logging.handlers, sys, io
from collections import OrderedDict
import configparser
import traceback
import sys
from matplotlib.pyplot import figure
from IPython.core.magic import register_line_mag... |
__author__ = 'Andrew'
from zipfile import ZipFile
import os
import os.path
import argparse
includes = [
"resources/img/award.png",
"resources/img/bmc.png",
"resources/img/climbing.png",
"resources/img/competitions.png",
"resources/img/films.png",
"resources/img/gear.png",
"resources/img/kmf.png",
"resources/img/m... |
# coding=utf8
"""
time util.
"""
__author__ = 'didicout <i@julin.me>'
import time
import datetime
def date_str_2_stamp(date_str, millisecond=False):
if millisecond:
return int(time.mktime(time.strptime(date_str, '%Y-%m-%d'))) * 1000
else:
return int(time.mktime(time.strptime(date_str, '%Y-... |
# Copyright 2014 The Native Client 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 shlex
import string
from naclports.error import PkgFormatError
VALID_KEYS = ['NAME', 'VERSION', 'URL', 'ARCHIVE_ROOT', 'LICENSE', 'DEPENDS',
... |
# -*- coding: utf-8 -*-
import os
import unittest
from memacs.kodi import Kodi
class TestKodi(unittest.TestCase):
def setUp(self):
log_file = os.path.join(
os.path.dirname(os.path.abspath(__file__)), 'data',
'kodi_audio.log')
argv = []
argv.append("-f")
ar... |
# -*- encoding: utf-8 -*-
################################################################################
# #
# Copyright (C) 2013-Today Carlos Eduardo Vercelino - CLVsol #
# ... |
import pygame, sys
from pygame.locals import *
pygame.init()
FPS = 30 # frames per second setting
fpsClock = pygame.time.Clock()
# set up the window
DISPLAYSURF = pygame.display.set_mode((400, 300), 0, 32)
pygame.display.set_caption('Animation')
WHITE = (255, 255, 255)
catImg = pygame.image.load('cat.p... |
#! /usr/bin/env python
# coding=utf8
"""Add PWN30 synset ids to HuWN XML
Author: Ivan Mittelholcz
"""
import os.path
import argparse
import copy
import xml.etree.cElementTree as ET
def check_xml(xml_file):
"""Fájl létezésének és xml-ségének ellenőrzése.
- input: fájlnév
- output: xml tree
"""... |
from __future__ import print_function
import json
import xml.etree.ElementTree as xmlElementTree
import base64
import os
import sys
from os.path import isfile, join
import gzip
import datetime
import random
import traceback
import sys
import features_JSON
import features_XML
VERSION="StackTraces-2018-08-16... |
# -*- coding: utf-8 -*-
#
# gPodder - A media aggregator and podcast client
# Copyright (c) 2005-2010 Thomas Perl and the gPodder Team
#
# gPodder 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... |
#*********************************************************************************
#
# Inviwo - Interactive Visualization Workshop
#
# Copyright (c) 2013-2021 Inviwo Foundation
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the f... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2013 GNS3 Technologies 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 version.
... |
# coding=utf-8
from backend_candidate.tests import SoulMateCandidateAnswerTestsBase
from elections.models import Candidate
from django.contrib.auth.models import User
from django.urls import reverse
from backend_candidate.models import (Candidacy,
is_candidate,
... |
"""Config flow for Yeelight integration."""
import logging
import voluptuous as vol
import yeelight
from homeassistant import config_entries, exceptions
from homeassistant.components.dhcp import IP_ADDRESS
from homeassistant.const import CONF_DEVICE, CONF_HOST, CONF_ID, CONF_NAME
from homeassistant.core import callba... |
# encoding: utf-8
from __future__ import absolute_import, print_function, unicode_literals, division
import pbr.version
from six import text_type as unicode_type
from six import string_types as basestring_type
from six import binary_type as bytes_type
_BYTES_TYPES = (bytes_type, type(None))
_UNICODE_TYPES ... |
# 361. Bomb Enemy Add to List
# DescriptionHintsSubmissionsSolutions
# Total Accepted: 14111
# Total Submissions: 36526
# Difficulty: Medium
# Contributor: LeetCode
# Given a 2D grid, each cell is either a wall 'W', an enemy 'E' or empty '0' (the number zero), return the maximum enemies you can kill using one bomb.
# T... |
import io
import os
from setuptools import setup, find_packages
def read(rel_path):
here = os.path.abspath(os.path.dirname(__file__))
with io.open(os.path.join(here, rel_path), 'r') as fp:
return fp.read()
def get_version(rel_path):
for line in read(rel_path).splitlines():
if line.start... |
#!/usr/bin/env python
# Copyright (c) 2012, Adobe Systems Incorporated
# 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 not... |
"""
Wordlist generator tool.
Generates extended wordlist based on an initial list of possible words
Used mainly with hash cracking tools: hashcat, john, etc.
TO DO:
- Add logging function
"""
import datetime
import itertools
import sys
import os
def usage():
""" Usage function """
usage_message = """Us... |
from tests.test_basic import TestDocument
class TestDocStart(TestDocument):
"""
Test case intended to show that summary pages of a document are correctly
ignored.
"""
def test_107190_page_1(self):
file_name = 'tests/samples/107190.pdf'
self._run_test(file_name, [0])
self.a... |
#!/usr/bin/env python
#
# 2014-08-04 Sebastian Rockel (rockel@informatik.uni-hamburg.de)
# Provides a service interface to read the robot motion parameters
# uses the dynamic_reconfigure client
#
import roslib; roslib.load_manifest('robot_motion_param')
from robot_motion_param.srv import *
import rospy
import dynamic_r... |
# Copyright (c) 2013 Per Unneberg
#
# 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,... |
#!/usr/bin/env python
# coding: utf-8
""" Translate GDAY output file
Match the NCEAS format and while we are at it carry out unit conversion so that
we matched required standard. Data should be comma-delimited
"""
import shutil
import os
import numpy as np
import csv
import sys
import matplotlib.pyplot as plt
import... |
'''
Author: Hans Erik Heggem
Email: hans.erik.heggem@gmail.com
Project: Master's Thesis - Autonomous Inspection Of Wind Blades
Repository: Master's Thesis - CV (Computer Vision)
'''
################### UNIT TEST ########################
import unittest
from Settings.TestData import TestData
from TestUnits.Test_ma... |
"""
Range of numeric values
"""
from .jsonval import *
from .psjson import *
from .sinumber import *
class NumericRange(object):
"Range of numbers"
def __init__(self, nrange):
"""Construct a range from a JSON NumericRange."""
# TODO: Would be nice if this class could treat missing
#... |
from numpy import *
class Region:
xllc = 0 #<--x
yllc = 0 #<--y
nrows = 3 #<-- b
ncols = 3 #<-- a
step = 50
grid = [[1,2,3], [4,5,6], [3,8,9] ]
#Reading files, retrieving integers and creating an array.
def read (self, filename):
if filename is None:
print("Your ... |
###
# Copyright (c) 2005, Jeremiah Fincher
# Copyright (c) 2006, Jon Phillips
# Copyright (c) 2006, Creative Commons
# All rights reserved.
###
import time
import rfc822
import poplib
import textwrap
from cStringIO import StringIO as sio
import supybot.utils as utils
import supybot.world as world
from supybot.command... |
import os
import traceback
from onedrivee.common.utils import OS_USER_ID, OS_USER_GID
from onedrivee.drives import errors
from onedrivee.common import hasher
from onedrivee.common.dateparser import datetime_to_timestamp
from onedrivee.workers.tasks.task_base import TaskBase
from onedrivee.store.items_db import ItemRec... |
#-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2020, Anaconda, Inc., and Bokeh Contributors.
# All rights reserved.
#
# The full license is in the file LICENSE.txt, distributed with this software.
#-------------------------------------------------------------------... |
from django.template import loader
from django_peeringdb.models import NetworkIXLan, IXLan, InternetExchange
from peercollect.models import Peering
from prettytable import PrettyTable
from peermatch.utils import find_peering_poc
# FIXME
from django.core.management.base import CommandError
def peering_matrix(us, them... |
from typing import Callable, Optional, Any
from rx import operators as ops
from rx.core import Observable, pipe
def _buffer(boundaries: Observable) -> Callable[[Observable], Observable]:
return pipe(
ops.window(boundaries),
ops.flat_map(pipe(ops.to_iterable(), ops.map(list)))
)
def _buf... |
"""
Project Euler Problem 8: https://projecteuler.net/problem=8
Largest product in a series
The four adjacent digits in the 1000-digit number that have the greatest
product are 9 × 9 × 8 × 9 = 5832.
73167176531330624919225119674426574742355349194934
96983520312774506326239578318016984801869478851843
8586... |
import datetime
from decimal import Decimal as D
from django.test import TestCase
from oscar.apps.offer import models
from oscar.core.compat import get_user_model
from oscar.test.factories import (
OrderDiscountFactory, UserFactory, create_order)
User = get_user_model()
class TestAPerUserConditionalOffer(TestC... |
#!/usr/bin/env python
import sys, os
use_message = '''
'''
def get_aligners():
mac = (sys.platform == "darwin")
if not os.path.exists("aligners"):
os.mkdir("aligners")
os.chdir("aligners")
if not os.path.exists("bin"):
os.mkdir("bin")
programs = ["HISAT", "Bowtie2", "Bowtie", "TopH... |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 OpenStack LLC.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/... |
# Copyright 2016 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... |
import os
import numpy as np
import warnings
from shutil import copyfile
from doris.doris_stack.main_code.resdata import ResData
import datetime
import subprocess
def baselines(dir_in,inputfile,start_date='2014-01-01',end_date='2018-01-01',doris=''):
# This function calculates the baselines and plots a baseline p... |
#!/usr/bin/env python
import sys, os, re, subprocess
# begin loop:
# - reading from stdin
# - forking a child
# - executing a new process in the child
def main():
while True:
sys.stdout.write(os.environ['PROMPT'])
line = sys.stdin.readline()
commands = split_on_pipes(line)
placeholder_in = sys.stdin
plac... |
#以下来自廖雪峰的Python学习之Python数据库
#SQLite////////////////////////////////////////////////////
#SQLite是一种嵌入式数据库,它的数据库就是一个文件。由于SQLite本身是C写的,而且体积很小
#所以,经常被集成到各种应用程序中,甚至在iOS和Android的App中都可以集成。
#Python就内置了SQLite3,所以,在Python中使用SQLite,不需要安装任何东西,直接使用。
# 导入SQLite驱动:
import sqlite3
# 连接到SQLite数据库
# 数据库文件是test.db
# 如果文件不存在,会自动在当前目录创建... |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import sys
import copy
import reportlab
import re
from reportlab.pdfgen import canvas
from reportlab import platypus
import utils
import color
import os
import logging
import traceback
from lxml import etree
import base... |
from UnitTest import UnitTest
try:
builtin_value = builtin.value
except:
builtin_value = None
if False:
import builtin
import builtin
class Foo:
pass
class BuiltinTest(UnitTest):
def testMinMax(self):
self.assertEqual(max(1,2,3,4), 4)
self.assertEqual(min(1,2,3,4), 1)
sel... |
# coding: utf-8
import aioamqp
import uuid
import logging
from core.utils import async_wait_for
log = logging.getLogger(__name__)
class AsyncQueueProducer(object):
messages = {}
connection = None
channel = None
consumer_tag = None
responses_queue = None
commands_queue = None
def __init... |
from collections import defaultdict
from optparse import make_option
from django.core.management.base import BaseCommand
from casexml.apps.case.cleanup import rebuild_case
from casexml.apps.case.models import CommCareCase
from corehq.elastic import stream_es_query, ES_URLS, ADD_TO_ES_FILTER
import dateutil.parser as dp... |
from __future__ import unicode_literals
import json
from six.moves.urllib.parse import urlparse, parse_qs
from moto.core.responses import BaseResponse
from .models import managedblockchain_backends
from .utils import (
region_from_managedblckchain_url,
networkid_from_managedblockchain_url,
proposalid_from... |
'''
Drop-Down List
==============
.. versionadded:: 1.4.0
A versatile drop-down list that can be used with custom widgets. It allows you
to display a list of widgets under a displayed widget. Unlike other toolkits,
the list of widgets can contain any type of widget: simple buttons,
images etc.
The positioning of the... |
import psycopg2
import getpass
username = getpass.getuser()
password = getpass.getpass("Database password for {}: ".format(username))
database = "wate"
def create_user_table(cursor):
user_schema = """
CREATE TABLE users (
id serial PRIMARY KEY,
name text NOT NULL,
use... |
# Licensed to the Software Freedom Conservancy (SFC) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The SFC licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... |
from __future__ import division, print_function
import math
def interpolate(color, val, base = (0, 0, 0)):
return tuple(b + (c-b)*val for c, b in zip(color, base))
def avg(xs):
xs = list(xs)
return sum(xs)/len(xs)
#function from Simpson's Rule Wikipedia example: https://en.wikipedia.org/wiki/Simpso... |
from django import forms
from django.contrib.admin import widgets
from django.db.models.query_utils import Q
from django.forms.extras.widgets import SelectDateWidget
from django.forms.widgets import HiddenInput, Textarea, DateInput
from django.forms import ModelForm, CheckboxSelectMultiple
from django.contrib.auth.mode... |
# Copyright (c) 2016 The Johns Hopkins University/Applied Physics Laboratory
# 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/LICEN... |
import os, sys, re, shutil
if __name__ == '__main__':
used_map = {}
resPath = "./MagnetPF/Res/"
depDir = "Deprecated"
skipDir = ["message"]
for root, dirs, files in os.walk("./"):
for file in files:
if file.endswith(".m"):
filepath = os.path.join(root,... |
# Do some preliminary analysis on the results of the DECaLS-Galaxy Zoo data.
from astropy.io import fits
from astropy.cosmology import WMAP9
from matplotlib import pyplot as plt
from matplotlib import cm
from matplotlib.colors import LogNorm
from collections import Counter
import numpy as np
import re
import pandas... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# h5features documentation build configuration file, created by
# sphinx-quickstart on Mon Nov 2 16:02:53 2015.
#
# 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
# ... |
from django.shortcuts import render, render_to_response, get_object_or_404
from django.contrib.auth.models import User
from mainapp.models import Photo, Comment
from mainapp.forms import PhotoForm, CommentForm, ContactForm
from django.http import HttpResponse, HttpResponseRedirect
from django.template import RequestCon... |
# Copyright (c) 2014, ALDO HOEBEN
# Copyright (c) 2012, STANISLAW ADASZEWSKI
#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
# ... |
#
# Copyright (c) SAS Institute 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 w... |
# -*- coding: utf-8 -*-
# (c) 2015 Tuomas Airaksinen
#
# This file is part of automate-arduino.
#
# automate-arduino 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 yo... |
"""a module for compositional bias calculation.
The module contains site wrappers, function for site digitizing, and
dumper-loader functions for wrapped site collections. Each wrapper class
implements a method of compositional bias calculation.
"""
import cPickle
from decimal import Decimal
__all__ = [
"hash_str... |
# -*- coding: utf-8 -*-
"""
Created on Sat Apr 5 15:28:13 2014
@author: deokwooj
"""
from __future__ import division # To forace float point division
import numpy as np
from scipy import stats
from scipy.interpolate import interp1d
from sklearn import mixture
#from sklearn.cluster import Ward
from sklearn.cluster imp... |
#!/bin/python
import os, shutil
import numpy as np
import matplotlib.pyplot as plt
import np_helper as nph
# generate 3D points around points in pts_center using gaussian distribution
def generate_points(Rt_inv, pts_center, pts_sigma, pts_fixed, pts_num, axis_range):
# allocate mem for points
points = np.zeros... |
#
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License a... |
import pytest
from conftest import TEST_MESSAGES
from fints.formals import NumericField
from fints.parser import FinTS3Parser, FinTS3Serializer
from fints.segments.base import FinTS3Segment
def test_serialize_1():
class ITST1(FinTS3Segment):
a = NumericField(count=3)
i1 = ITST1(a=[1, 3])
i1.heade... |
"""adam.adam_1
"""
# pylint: disable=C0111
import operator
from math import * # noqa: F401,F403
# Add mutation points for comparison operators.
def constant_number():
return 42
def constant_true():
return True
def constant_false():
return False
def bool_and():
return object() and None
def ... |
# coding=utf-8
import struct
import bpy
import bmesh
from bpy_extras.io_utils import ExportHelper
import mathutils
import os.path
import math
#===========================================================================
# Custom exception class
#==========================================================================... |
#! /usr/bin/env python
##########################################################################
# Import modules
##########################################################################
import sys
import os
import re
import h5py as h5
import numpy as np
import pandas as pd
from matplotlib.backends.backend_pdf imp... |
# coding=utf-8
# Copyright 2021 The Google Research 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 applicab... |
# Copyright (c) 2013-2017 Christian Geier et al.
#
# 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, ... |
#!/usr/bin/env python
import urllib2, json, sys
CONFIG = {
'API_KEY': ' ',
'API_HOST': 'http://<ip>',
'DOOR_TARGET': 0
}
def main():
if 'open' in sys.argv:
print 'sent open: %s' % sendCmd('/set/open')
if 'close' in sys.argv:
print 'sent close: %s' % sendCmd('/set/close')
if 'cycle' in sys.... |
"""Interface to inherit from for *Display classes."""
from textwrap import fill
from core.core import Core
from core.messagecore import MessageCore
from core.stablecore import StableCore
from core.pasturecore import PastureCore
from core.towncore import TownCore
from core.contractercore import ContracterCore
from supp... |
from pymc3 import Normal, sample, Model, plots, Potential, variational, HalfCauchy
from theano import scan, shared
import numpy as np
"""
ARMA example
It is interesting to note just how much more compact this is that the original STAN example
The original implementation is in the STAN documentation by Gelman et al an... |
# -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015 CERN.
#
# Invenio 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... |
import math
import scipy.interpolate
from autoscaler.server.request_history import RequestHistory
from autoscaler.server.scaling.utils import parse_interval
class SplineScalingAlgorithm:
def __init__(self, algorithm_config):
self.interval_seconds = parse_interval(
algorithm_config['interval'... |
# -*- coding: utf-8 -*-
# This file is part of beets.
# Copyright 2016, Fabrice Laporte, Yevgeny Bezman, and Adrian Sampson.
#
# 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 restrict... |
#!/usr/bin/env python
################################################################################
# This file is part of LibreELEC - https://libreelec.tv
# Copyright (C) 2016-2017 Team LibreELEC
# Copyright (C) 2017 Tnds82 (tndsrepo@gmail.com)
#
# LibreELEC is free software: you can redistribute it... |
"""
This module contains the occurrences highlighter mode.
"""
from pyqode.qt import QtGui
from pyqode.core.api import Mode, DelayJobRunner, TextHelper, TextDecoration
from pyqode.core.backend import NotRunning
from pyqode.core.backend.workers import findall
class OccurrencesHighlighterMode(Mode):
""" Highlights ... |
# THIS FILE IS PART OF THE CYLC WORKFLOW ENGINE.
# Copyright (C) NIWA & British Crown (Met Office) & 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 Software Foundation, either version 3 of the Licen... |
# -*- coding: utf-8 -*-
# Copyright 2017 Open Net Sàrl
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
import logging
import odoo.tests.common as common
from datetime import datetime, timedelta
from odoo.fields import Date
_logger = logging.getLogger(__name__)
class TestMaxLPP(common.TransactionCase... |
# -*- coding: utf-8 -*-
###########################################################################
## Python code generated with wxFormBuilder (version Dec 18 2018)
## http://www.wxformbuilder.org/
##
## PLEASE DO *NOT* EDIT THIS FILE!
###########################################################################
impor... |
# -*- coding: utf-8 -*-
import logging
from threading import Timer, Lock
from ..promise import Deferred, CancelledError
_logger = logging.getLogger(__name__)
class PeriodicTask(object):
"""Generic Thread-based service, executing a task at regular interval.
The task is executed first right after the call to... |
import os
import shutil
import unittest
from collections import namedtuple
from io import StringIO
from jpp.cli import main as cli_entry_point
CURR_DIR = os.path.dirname(os.path.realpath(__file__))
class TestCli(unittest.TestCase):
TMP_TEST_FILES = os.path.join(CURR_DIR, '__tmp__')
_dir_bk = None
@clas... |
from __future__ import print_function
import argparse
from antk.core import loader
import numpy
def return_parser():
parser = argparse.ArgumentParser(description="Command line utility for performing grid search on a matrix factorization model.")
parser.add_argument("datadir", type=str,
... |
# overlap coefficient join
from joblib import delayed, Parallel
from six import iteritems
import pandas as pd
import pyprind
from py_stringsimjoin.filter.overlap_filter import OverlapFilter
from py_stringsimjoin.index.inverted_index import InvertedIndex
from py_stringsimjoin.utils.generic_helper import convert_datafra... |
# -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (http://tiny.be). All Rights Reserved
#
#
# This program is free software: you can redistribute it and/or modify
# ... |
# -*- coding: utf-8 -*-
#
# hookable documentation build configuration file, created by
# sphinx-quickstart on Wed Jan 4 21:12:53 2012.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# Al... |
# coding: utf-8
# This file is part of Thomas Aquinas.
#
# Thomas Aquinas 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.
#
# Thomas Aq... |
#coding=utf-8
import os
from collections import OrderedDict
import Tkinter as tk
import ttk
import tkFileDialog as tkfd
import tkMessageBox as tkmb
from .frames import TraceableText, NumericSpinbox
from .frames.match import *
from .frames.network import *
from .frames.team import *
from .frames.translations import *... |
#!/usr/bin/python3
from random import randint, random
from operator import itemgetter
minlen = 1
maxlen = 15
tasks = 1000
for intensivity in [0.1]:
# for intensivity in [i/1000 for i in range(1, 100, 2)]:
# print('INTENSIVITY = {}'.format(intensivity), end=' => ') ## DEBUG
time = 0
waiting_sum = 0
tasks_left =... |
import logging
import tornado
import tornado.template
import os
from tornado.options import define, options
# import environment
# import logconfig
# Make filepaths relative to settings.
path = lambda root,*a: os.path.join(root, *a)
ROOT = os.path.dirname(os.path.abspath(__file__))
define("port", default=8888, help=... |
# -*- coding: utf-8 -*-
"""
Oyster
~~~~~
**A Python parser of shell commands.**
This module strives to support commands executed within the sh, bash
and zsh shells alike. An important limitation to mention is that Oyster
does not support parsing of scripted commands, i.e:
for i in... |
from django.http import HttpResponse, HttpResponseRedirect
from django.shortcuts import render, get_object_or_404
from django.core.urlresolvers import reverse
from ..models import VMPlayground
from ..forms import VMPlaygroundForm, VMPlaygroundDescriptionForm, VMPlaygroundUserAccessForm, VMPlaygroundGroupAccessForm
fr... |
import typing as T
import pytest
from docstring_parser.numpydoc import parse
@pytest.mark.parametrize(
"source, expected",
[
("", None),
("\n", None),
("Short description", "Short description"),
("\nShort description\n", "Short description"),
("\n Short description\n... |
# Copyright 2017 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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.