text stringlengths 12 6.59M |
|---|
import discord
import re
import csv
from discord.ext import commands
class MCOCTools:
'''Tools for Marvel Contest of Champions'''
lookup_links = {
'event': (
'Tiny MCoC Schedule',
'<http://simians.tk/MCOC-Sched>',
'Josh Morris Schedule',
... |
# -*- coding: utf-8 -*-
"""
Copyright (C) 2017 IBM Corporation
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 agre... |
from __future__ import division
from functools import partial
from menpo.transform import Scale, AlignmentSimilarity
from menpo.feature import no_op
from menpofit.builder import normalization_wrt_reference_shape, scale_images
from menpofit.fitter import MultiFitter, noisy_align
from menpofit.result import MultiFitterRe... |
import sys, json, ConfigParser
from datetime import datetime
from twisted.internet import reactor, stdio
from twisted.internet.protocol import Factory, Protocol
from twisted.protocols import basic
from LHServerKeys import *
# Class for getting input from the console
class Echo(basic.LineReceiver):
from os import line... |
import random
from unittest import TestCase, main
from zbj import Card, Hand, Deck
class CardBasics(TestCase):
SUITS = ('C', 'S', 'H', 'D')
VALUES = {'A':1, '2':2, '3':3, '4':4, '5':5, '6':6, '7':7, '8':8, '9':9, 'T':10, 'J':10, 'Q':10, 'K':10}
def setUp(self):
self.ac = Card('C', 'A')
class Card... |
#!/usr/bin/env python
#-----------------------------------------------------------------------
#
# Core video, sound and interpreter loop for Gigatron TTL microcomputer
# - 6.25MHz clock
# - Rendering 160x120 pixels at 6.25MHz with flexible videoline programming
# - Must stay above 31 kHz horizontal sync --> 200 cy... |
#!/usr/bin/env python3
"""
Created on 1 Mar 2017
@author: Bruno Beloff (bruno.beloff@southcoastscience.com)
"""
from scs_core.data.json import JSONify
from scs_core.data.localized_datetime import LocalizedDatetime
from scs_core.gas.afe_baseline import AFEBaseline
from scs_core.gas.sensor_baseline import SensorBasel... |
HEADER = """" Name: hydrangea.vim --- Hydrangea theme for Vim
" Author: Yuta Taniguchi <yuta.taniguchi.y.t@gmail.com>
" URL: https://github.com/yuttie/hydrangea-vim
" Version: 6.2.0
" License: MIT License
"""
from collections import OrderedDict
try:
import vim
# When executed in Vim, directly e... |
"""
Switchvox common methods
"""
# 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.
#
# ... |
# Copyright 2018-2020 Arm Limited.
# SPDX-License-Identifier: Apache-2.0
#
# 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... |
# Copyright 2018 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, ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#-----------------------------------------------------------------------------
# Copyright 2013 Carona Sustentavel
#
# 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 Sof... |
# import gevent.monkey
# gevent.monkey.patch_socket()
import sys
import os
import random
import threading
import collections
import functools
import time
import thread
import traceback
import concurrent.futures
from PyQt4 import QtCore, QtGui
Qt = QtCore.Qt
from sgfs import SGFS
sgfs = SGFS()
threadpool = concur... |
import collections
import copy
import datetime
import re
import itertools
import shotgun_api3
class ShotgunError(Exception):
pass
class Fault(ShotgunError):
pass
_no_arg_sentinel = object()
class _IsFilter(object):
def __init__(self, field, value):
self.field = field
self.value ... |
import os, sys
import neovim
class IPythonPlugin(object):
def __init__(self, vim):
self.vim = vim
self.create_outbuf()
self.vim.subscribe("ipy_runline")
def create_outbuf(self):
vim = self.vim
for b in vim.buffers:
if "[ipython]" in b.name:
se... |
"""
Tools for drawing Python object reference graphs with graphviz.
You can find documentation online at http://mg.pov.lt/objgraph/
Copyright (c) 2008-2013 Marius Gedminas <marius@pov.lt>
Copyright (c) 2010 Stefano Rivera <stefano@rivera.za.net>
Released under the MIT licence.
"""
# Permission is hereby granted, fre... |
import itertools
import re
import networkx
from .io import open_read_file
def read_obo(path_or_file):
"""
Return a networkx.MultiDiGraph of the ontology serialized by the
specified path or file.
This function attempts to follow the specifications provided at:
http://owlcollab.github.io/oboforma... |
# Copyright 2012 Anton Beloglazov
#
# 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 writ... |
from __future__ import annotations
from typing import Iterator
import operator
import uuid
import collections
import json
import io
class Features:
def __init__(self, elt: Element) -> None:
self._elt = elt
self._data = collections.defaultdict(list)
def has(self, key: str) -> bool:
ret... |
"""Extract files Microsoft Access OLE object fields"""
import struct
import sys
from pprint import pprint
def sformat(s):
return '%d:%r' % (len(s), s if len(s) < 30 else (s[:40]+'...'+s[-20:]))
def unwrap(s, spec):
"""Unwrap binary `s` according to `spec`, return (consumed_length, data)
Basically it's ... |
"""data.py: different ProjectElementData classes"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import numpy as np
import properties
from .base import UidModel, ContentModel, ProjectElementData
from .serializers i... |
"""
Django settings for share project.
Generated by 'django-admin startproject' using Django 1.9.5.
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/1.9/ref/settings/
"""
import os
# B... |
import numpy as np
from Space import Space
class Field(Space):
def __init__(self, name, field_type):
self.type = str(field_type)
super(Field, self).__init__(name, coordinate_system=None)
def __str__(self):
return 'Field: %s (%s)' % (self.name, self.type)
def add_element(self, el... |
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use ... |
VERSION = '1.6.1'
|
import tweepy
import time
import sys
import os
import random
#keep the quotes, replace this with your information
consumer_key = '123abc...'
consumer_sec = '123abc...'
access_key = '123abc...'
access_sec = '123abc...'
auth = tweepy.OAuthHandler(consumer_key, consumer_sec)
auth.set_access_token(access_key, access_sec... |
# The MIT License (MIT)
#
# Copyright (C) 2014 OpenBet Limited
#
# 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, m... |
import batoid
import numpy as np
from test_helpers import timer
import time
@timer
def parallel_trace_timing(args):
if args.nthread is not None:
print("setting nthread to {}".format(args.nthread))
batoid._batoid.setNThread(args.nthread)
print("Using {} threads".format(batoid._batoid.getNThread... |
# The MIT License (MIT)
#
# Copyright (C) 2014 OpenBet Limited
#
# 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,... |
import unittest.mock as mock
from tests.plugins import PluginTestCase
f = 'plugins.owleague.get_owl_data'
class OwleaguePluginTest(PluginTestCase):
def create_plugin(self):
from plugins.owleague import OwleaguePlugin
return OwleaguePlugin(self.bot, self.channel)
def test_returns_current_and_next_match(self):
... |
import os, re, urllib2
scrapeUrl = "http://interfacelift.com/wallpaper/downloads/date/widescreen_16:9/1920x1080/"
host = 'http://interfacelift.com'
saveDir = 'scraped'
# how many you want to download, 0 to download all
goal = 0
done = 0
# go to your scrape url, note down how many pages there are. this should not exce... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# vim: set fileencoding=UTF-8 :
"""
dboperator
Makes connection to MS SQL Server database at init and offers basic
SQL operations.
Holds the number of affrected rows within (count).
Offers also a function to close the connection which is good to
remember to call at the end.
"... |
# -*- coding: utf-8 -*-
"""
Copyright (c) 2012, Davyd McColl; 2013, Jaime Soffer
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 cop... |
# The MIT License (MIT)
#
# Copyright (C) 2014 OpenBet Limited
#
# 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, m... |
# This program computes for each game a set of features
# based on the evaluation of the sequence of positions
# in the game.
#
# This script requires: python-chess==0.5.0
# <http://python-chess.readthedocs.org/en/latest/>
#
# Running this takes about 5 minutes
import chess
import re
# <http://en.wikipedia.org/wik... |
#!/usr/bin/env python
# ----------------------------------------------------------------------------
# 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 ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import glob
import sys
from nose.tools import *
from utilities import execution_path
import os, mapnik
# make the tests silent since we intentially test error conditions that are noisy
mapnik.logger.set_severity(mapnik.severity_type.None)
def setup():
# All of the pa... |
from __future__ import absolute_import
from subprocess import call
import logging
import os
import shutil
from django.conf import settings
from django.contrib.auth.models import User
from pandas.io.parsers import read_csv
from pandas import DataFrame
from tslib.readers import PiXmlReader
from datetime import datetime... |
# -*- coding: utf-8 -*-
import logging as _logging
from collections import (namedtuple as _namedtuple,
OrderedDict as _OrderedDict)
from enum import Enum as _Enum
from sys import version_info as _py_version_info
_logr = _logging.getLogger(__name__)
_logr.addHandler(_logging.NullHandler())
cl... |
"""
nefarious.py: Nefarious IRCu protocol module for PyLink.
"""
import base64
import struct
from ipaddress import ip_address
from pylinkirc import utils, structures
from pylinkirc.classes import *
from pylinkirc.log import log
from pylinkirc.protocols.ircs2s_common import *
class P10UIDGenerator(utils.IncrementalUI... |
"""
I/O for Medit's format/Gamma Mesh Format,
Latest official up-to-date documentation and a reference C implementation at
<https://github.com/LoicMarechal/libMeshb>
"""
import logging
import struct
from ctypes import c_double, c_float
import numpy
from .._common import _pick_first_int_data
from .._exceptions import ... |
#!/usr/bin/env python3
import sys
import smtplib
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from email.parser import Parser
from configparser import ConfigParser
from email.utils import parseaddr
#Parse config
basedir = '/scripts/mailforward/'
config = ConfigParser()
config.r... |
# -*- coding:utf-8 -*-
# Copyright (c) 2009-2014 - Simon Conseil
# Copyright (c) 2013 - Christophe-Marie Duquesne
# 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, i... |
"""
`FlowCal`'s Microsoft Excel User Interface.
This module contains functions to read, gate, and transform data from a set
of FCS files, according to an input Microsoft Excel file. This file should
contain the following tables:
- "Instruments" table (TODO: describe fields of the table)
- "Beads" table (TODO: ... |
#!/usr/bin/env python
# -*- coding:utf-8 -*-
#
# The most stupid IRC bot
#
import socket
from time import ctime
import feedparser
# Config
# ------
server = "irc.freenode.net"
channel = "#zdroid"
nick = "XDroid"
# Connect to server
# -----------------
irc = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
irc.co... |
#!/usr/bin/env python
"""
:Author Patrik Valkovic
:Created 15.08.2017 15:31
:Licence GNUv3
Part of grammpy
"""
from unittest import main, TestCase
from grammpy import *
from .grammar import *
class RulesTest(TestCase):
def setUp(self):
self.g = Grammar(terminals=[0, 1, 2,
... |
# Copyright 2019 The DDSP Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... |
# Copyright 2012-2015 The Meson development team
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agree... |
from django.contrib.postgres.aggregates import ArrayAgg
from django.core.cache import cache
from django.db.models import F, Q
from django.http import HttpResponse, JsonResponse
from django.shortcuts import render, redirect
from django.views.decorators.cache import cache_page
from django.views.generic import TemplateVie... |
# The MIT License (MIT)
#
# Copyright (c) 2015-2017 Sebastien Maccagnoni <sebastien@maccagnoni.eu>
#
# 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 lim... |
#!/usr/bin/env python
""" Unit tests for zeroconf._services.browser. """
import logging
import socket
import time
import os
import unittest
from threading import Event
from unittest.mock import patch
import pytest
import zeroconf as r
from zeroconf import DNSPointer, DNSQuestion, const, current_time_millis, millis... |
# Copyright 2013-2014 The Meson development team
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agree... |
# -*- coding: iso-8859-1 -*-
#
"""
@ 2009 by Uche ogbuji <uche@ogbuji.net>
This file is part of the open source Akara project,
provided under the Apache 2.0 license.
See the files LICENSE and NOTICE for details.
Project home, documentation, distributions: http://wiki.xml3k.org/Akara
Module name:: moinrest
= Define... |
from scipy import optimize as opt
import aclab3 as lab3
xfoil_path = "C:/Users/Elijah/Documents/XFoil/"
def one_dim_opt(cl, file_path, xfoil_path):
"""
Performs a one dimensional optimization using minimize_scalar. This
function optimizes for point u(2) between 0.6 and 1.3.
cl -- target coefficient... |
# ------------------------------------- #
# Python Package Importing #
# ------------------------------------- #
# Importing Necessary System Packages
import sys, os, math
import numpy as np
import matplotlib as plt
import time as tp
import random as rp
from optparse import OptionParser
import glob
# Imp... |
# Time: O(logm + logn)
# Space: O(1)
#
# Write an efficient algorithm that searches for a value in an m x n matrix. This matrix has the following properties:
#
# Integers in each row are sorted from left to right.
# The first integer of each row is greater than the last integer of the previous row.
# For example,
#
... |
from collections import OrderedDict
import operator
from StringIO import StringIO
class SMParser(object):
TOKENS = (
'TITLE', 'SUBTITLE', 'ARTIST',
'TITLETRANSLIT', 'SUBTITLETRANSLIT',
'ARTISTTRANSLIT', 'CREDIT', 'BANNER',
'BACKGROUND', 'LYRICSPATH', 'CDTITLE',
'MUSIC', 'OF... |
'''
(c) 2011, 2012 Georgia Tech Research Corporation
This source code is released under the New BSD license. Please see
http://wiki.quantsoftware.org/index.php?title=QSTK_License
for license details.
Created on Sep 27, 2011
@author: John Cornwell
@contact: JohnWCornwellV@gmail.com
@summary: Various simple trading st... |
#!/usr/bin/env python
#
# This is a generic script to convert a relational database (RDB)
# into an RDF serialization using Direct Mapping approach.
#
# Author: Arnold Kuzniar
# Version: 0.1
import os, sys
import argparse as argp
# parse command-line args
parser = argp.ArgumentParser(
description = 'This script co... |
import logging
from main.models import Station
import csv
def populate_stations(path='/opt/code/vvs_data/HaltestellenVVS_simplified_utf8_stationID.csv'):
with open(path, 'r') as f:
reader = csv.reader(f, delimeter=',')
# skip first row
next(reader, None)
for row in reader:
... |
# This relies on each of the submodules having an __all__ variable.
from .core import *
from .constructors import *
__all__ = (['__version__']
+ core.__all__
+ constructors.__all__
)
__version__ = '0.2.2'
|
# Lec 3.4, slide 4
# convert decimal float to binary
# Ask to input a decimal float number
a = float(raw_input('Enter a decimal number:'))
if a < 0:
ifNeg = True
a = -a
else:
ifNeg = False
p = 1
# Convert the input float into integer by multiplying 2 iteratively
# As long as the input float... |
from cStringIO import StringIO
import logging
from django.db.models import ForeignKey, OneToOneField
from deep_collector.serializers import MultiModelInheritanceSerializer
logger = logging.getLogger(__name__)
class RelatedObjectsCollector(object):
"""
This class is used to introspect an object, to get ever... |
"""
@brief test log(time=1s)
"""
import sys
import os
import unittest
try:
import src
except ImportError:
path = os.path.normpath(
os.path.abspath(
os.path.join(
os.path.split(__file__)[0],
"..",
"..")))
if path not in sys.path:
... |
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2011 - 2014 Agile Business Group sagl
# (<http://www.agilebg.com>)
# Copyright (C) 2011 Domsense srl (<http://www.domsense.com>)
#
# This program is free software: you can redistribute it... |
# -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (c) 2008 Zikzakmedia S.L. (http://zikzakmedia.com) All Rights Reserved.
# Jordi Esteve <jesteve@zikzakmedia.com>
# $Id$
#
# ... |
#!/usr/bin/env python
import os
import sys
import time
import string
import socket
import shutil
import subprocess
from optparse import OptionParser
class MathMate(object):
def __init__(self):
self.cacheFolder = '/tmp/tmjlink'
self.mlargs = ["-linkmode", "launch", "-linkname", "/Applications/Mathem... |
#!/usr/bin/env python
# Copyright (c) 2012 - 2014 Lars Hupfeldt Nielsen, Hupfeldt IT
# All rights reserved. This work is under a BSD license, see LICENSE.TXT.
# Demonstrate that the flow can be dynamically calculated by the script
from __future__ import print_function
import sys, os, tempfile
import logging
from co... |
#!/usr/bin/env python
import datetime
import logging
log = logging.getLogger('activecalls.scrapecalls')
from dateutil import parser
from django.conf import settings
from django.core.management.base import BaseCommand
from django.core.serializers.json import DjangoJSONEncoder
import lxml.etree
import lxml.html
import... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
###############################################################################
#
# Copyright (C) 2001-2014 Micronaet SRL (<http://www.micronaet.it>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero Genera... |
# -*- coding: utf-8 -*-
from odoo import api, fields, models, _
from odoo.exceptions import UserError
from odoo.osv import expression
from odoo.tools import pycompat
from odoo.tools.misc import formatLang
class AccountReconciliation(models.AbstractModel):
_name = 'account.reconciliation.widget'
_description ... |
# -*- coding: utf-8 -*-
from odoo import models, fields, api
from odoo.tools.translate import _
class AccountMoveReversal(models.TransientModel):
"""
Account move reversal wizard, it cancel an account move by reversing it.
"""
_name = 'account.move.reversal'
_description = 'Account Move Reversal'
... |
"""
Classes that represent different GEO entities
"""
import os
import re
import abc
import sys
import gzip
import json
import time
import subprocess
from . import utils
from sys import stderr, stdout
from pandas import DataFrame, concat
try:
from urllib.error import HTTPError
except ImportError:
from urllib2 ... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import os
import subprocess
from epubcheck import samples
from epubcheck import const as c
from epubcheck.checker import EpubCheck
def java_version():
"""Call java and return version information.
:return unicode: Java version string
"""
... |
from . import GLWindow
from . import keys
class Window:
'''
Window
'''
def __init__(self, width = None, height = None, samples = 16, fullscreen = False, title = None):
self.wnd = GLWindow.create_window(width, height, samples, fullscreen, title)
def fullscreen(self):
'''
fullscreen()
set the window ... |
# Copyright (c) 2012, GPy authors (see AUTHORS.txt).
# Licensed under the BSD 3-clause license (see LICENSE.txt)
import numpy as np
from scipy import weave
from kern import Kern
from ...util.linalg import tdot
from ...util.misc import fast_array_equal, param_to_array
from ...core.parameterization import Param
from ..... |
import logging
import re
import formencode
from formencode import ForEach, htmlfill, validators
from pylons import config, request, response, session, tmpl_context as c
from pylons.controllers.util import redirect
from pylons.decorators import validate
from pylons.i18n import _
from babel import Locale
from webob.ex... |
#!/usr/local/bin/python
"""Graphical offsetter.
History:
2005-05-24 ROwen
"""
import Tkinter
import RO.Constants
import RO.KeyVariable
import RO.Wdg
import TUI.TUIModel
import TUI.TCC.TCCModel
def addWindow(tlSet):
"""Create the window for TUI.
"""
tlSet.createToplevel(
name = "TCC.Nudger",
defGeom = "+50+507"... |
#!/usr/bin/env python
# Copyright (c) 2012 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.
"""Entry point for both build and try bots
This script is invoked from XXX, usually without arguments
to package an SDK. It automa... |
"""
TWLight email sending.
TWLight generates and sends emails using https://bameda.github.io/djmail/ .
Any view that wishes to send an email should do so using a task defined here.
Templates for these emails are available in emails/templates/emails. djmail
will look for files named {{ name }}-body-html.html, {{ name ... |
"""
========================================
Regression on continuous data (rER[P/F])
========================================
This demonstrates how rERPs/regressing the continuous data is a
generalisation of traditional averaging. If all preprocessing steps
are the same and if no overlap between epochs exists and if ... |
from kivy.app import App
from kivy.lang import Builder
from kivy.clock import Clock
from kivy.properties import ListProperty
from kivy.animation import Animation
from kivy.metrics import dp
KV = '''
#:import RGBA kivy.utils.rgba
<ImageButton@ButtonBehavior+Image>:
size_hint: None, None
size: self.texture_size... |
"""Caching decorator for dictionary/tuples."""
import json
import os
from functools import wraps
import gzip
import sys
from string import punctuation
import codecs
from hashlib import md5
class _DumpAdapter(object):
""" Flexible interlace to blindly use codecs module or
gzip module
"""
def __ini... |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... |
# -*- coding: utf-8 -*-
"""Docx renderer module."""
import sys
if not sys.version_info >= (3, 0):
from pydocx.parsers import Docx2Html
from mfr import RenderResult
def render_docx(fp, *args, **kwargs):
"""Generate an html representation of the docx file using PyDocx
:param fp: File point... |
# -*- encoding: utf-8 -*-
import os
import time
from tarfile import filemode
import StringIO
import base64
import logging
import errno
import glob
import fnmatch
import pooler
import netsvc
import os
from service import security
from osv import osv
#from document.nodes import node_res_dir, node_res_obj
from document.... |
#!/usr/bin/env python
#
# 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 "Li... |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
import os
from glob import glob
import re
import logging
import shutil
import time
import gzip
from astropy.table import Table
import astropy.io.fits as pyfits
import numpy as np
import numpy.ma as ma
import argparse
import collections
import tables
from i... |
import numpy as np
from sympy import (Function, Indexed, Number, Symbol, cos, count_ops, lambdify,
preorder_traversal, sin)
from devito.dimension import Dimension, t
from devito.interfaces import SymbolicData
from devito.logger import warning
from devito.tools import flatten
__all__ = ['estimate_co... |
from __future__ import absolute_import
import re
from ConfigParser import RawConfigParser, NoSectionError, NoOptionError, DEFAULTSECT
from ..basis.ordered_dict import OrderedDictCaseInsensitive
from ..utils import SYS_ENCODING
class IniFile(RawConfigParser):
def __init__(self, filename=None, encoding=Non... |
#!/usr/bin/env python3
import logging
import argparse
import bottle
from bottle import route, run, template, response, request
import subprocess
import json
import sys
import os
import ipaddress
logging.basicConfig(
level=logging.INFO,
format='%(asctime)-15s %(levelname)-8s %(name)-12s %(message)s'
)
logger = ... |
#!/usr/bin/env python
#
# Copyright 2015 Flavio Garcia
#
# 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 ... |
# Copyright (c) 2014 Balazs Nemeth
#
# This file is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This file is distributed in the ho... |
#################################################################################
# Copyright (C) 2019 Advanced Micro Devices, Inc. All rights reserved.
#
# 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 t... |
# Copyright 2013 Scott Duckworth
#
# This file is part of django-sshkey.
#
# django-sshkey 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) any late... |
from __future__ import absolute_import
from decimal import Decimal
import locale
import os
import requests
import sys
import warnings
from flask import current_app, g
import flask_sqlalchemy
from flask_babel import Babel, get_locale
from flask_wtf.csrf import CsrfProtect
import six
from sqlalchemy.engine import Engine
... |
#Initializes
op = 0;
edgechoice = "L4" #Default choice
save = True #Default
printText = False #Default
while(op != 3):
# Main menu
print("\n\n\n\n")
print("Image to ascii software.")
print("Choose an option:")
# Main menu choices
print("\t1- Transform image.")
print("\t2- Set options.")
print("\t3- Close prog... |
# Copyright (c) 2022, Manfred Moitzi
# License: MIT License
"""
This module provides support for fonts stored as SHX and SHP files.
(SHP is not the GIS file format!)
The documentation about the SHP file format can be found at Autodesk:
https://help.autodesk.com/view/OARX/2018/ENU/?guid=GUID-DE941DB5-7044-433C-AA68-... |
# All the times here are in hours
# These are the times for non-pgo
import requests
import logging
from mozci.mozci import query_repo_url_from_buildername, query_repo_name_from_buildername, trigger_all_talos_jobs, trigger_range
from mozci.query_jobs import TreeherderApi
from mozci.platforms import build_talos_builderna... |
SHORTNAME = "Python"
PASSWORD = "Spam"
SECTION_TITLES = {
1: "General information and availability",
2: "Python in the real world",
3: "Building Python and Other Known Bugs",
4: "Programming in Python",
5: "Extending Python",
6: "Python's design",
7: "Using Python on non-UNIX platforms",
}
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.