text stringlengths 17 737k |
|---|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Publish the documentation on GitHub Pages.
Prerequisites
-------------
1. Create empty gh-pages branch:
git branch gh-pages
git checkout gh-pages
git symbolic-ref HEAD refs/heads/gh-pages
rm .git/index
git clean -fdx
2. Setup sphinx.
python... |
import os
from optparse import make_option
from subprocess import call
from django.core.management import call_command
from django.core.management.base import BaseCommand, CommandError
from openbudget.settings import local as settings
from modeltranslation.models import autodiscover as register_models_translations
cl... |
"""
Reads the subset of the dBase III file format used by ESRI shapefiles.
The dBase III format was never specified publicly but it has been
reverse-engineered. The best documentation on the subject can be found
at http://www.clicketyclick.dk/databases/xbase/format/dbf.html.
"""
from collections import namedtuple
from... |
# -*- coding: utf-8 -*-
# pylint: disable=bad-continuation
"""
Certificate HTML webview.
"""
import logging
import urllib
from datetime import datetime
from uuid import uuid4
import MySQLdb as mdb
import pytz
from django.conf import settings
from django.contrib.auth.models import User
from django.http import Http404, ... |
# -*- coding: utf-8 -*-
import itertools
from sqlparse import sql
from sqlparse import tokens as T
try:
next
except NameError: # Python < 2.6
next = lambda i: i.next()
def _group_left_right(tlist, ttype, value, cls,
check_right=lambda t: True,
check_left=lambda ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import re
import logging
import serial
import gobject
import pykka
from mopidy import exceptions
from mopidy.utils import encoding
logger = logging.getLogger(__name__)
class SerialMonoboxController(pykka.ThreadingActor):
def... |
# Drived from the rpi_ws281x library. A buffer class used to create layers for then passing
# a flattened set of values to rxi_ws281x for dsiplay on the neoPixels
# this is so that multiple simultanious animiation elements can be complied together easily
# Author: Karl Grindley (karlg100@gmail.com)
from neopixel impo... |
# -*- coding: utf-8 -*-
###############################################################################
#
# ODOO (ex OpenERP)
# Open Source Management Solution
# Copyright (C) 2001-2015 Micronaet S.r.l. (<http://www.micronaet.it>)
# Developer: Nicola Riolini @thebrush (<https://it.linkedin.com/in/thebrush>)
# This prog... |
#!/usr/bin/env python
# Copyright (c) 2009, Anton Korenyushkin
# 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 software was developed by the University of Tennessee as part of the
#Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
#project funded by the US National Science Foundation.
#
#See the license text in lic... |
#!/usr/bin/env python
"""
Copyright (c) 2014, <47bytes@gmail.com>
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 l... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2013 Matt Martz
# 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/lic... |
#!/usr/bin/env python
import os,sys
import numpy as np
try:
import fitsio
except:
from astropy.io import fits
from astropy.stats import sigma_clip
from ninetyprime import ampOrder,colbias
import matplotlib.pyplot as plt
from matplotlib import ticker
def _data2arr(data,minVal=0,maxVal=65335):
return np.ma.masked_... |
"""Simple phase
This example illustrates the simple usage of the
:py:class:`qpimage.QPImage` class for reading and managing
quantitative phase data. The attribute ``QPImage.pha`` yields
the background-corrected phase data and the attribute
``QPImage.bg_pha`` yields the background phase image.
"""
import matplotlib.p... |
import logging
from rex import Vulnerability
from rex.exploit import Exploit, CannotExploit
from ..technique import Technique
l = logging.getLogger("rex.exploit.techniques.call_shellcode")
class CallShellcode(Technique):
name = "call_shellcode"
applicable_to = ['unix']
def apply(self, **kwargs):
... |
#!/usr/bin/python
# -*- coding: utf8 -*-
import os
import psycopg2
import time
import config
import argparse
import urllib
import urllib2
import requests
import datetime
import json
import pprint
import sys
'''
ะกะธััะตะผะฐ ััั ัะฐะบะฐั.
ะัะตะดะฒะฐัะธัะตะปัะฝะพ, ะพะฑัะฐะฑะพัะฐะฝะฝัะต ะดะฐะฝะฝัะต ะทะฐะณััะถะฐัััั ะฒ NextGIS Web.
ะะฝ ัะผะตะตั ะธั
ัะตะฝะดัะธัั ัะต... |
# coding= utf-8
# Copyright (c) 2014 Rackspace, 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 o... |
# Sam Greydanus and Luke Chang 2015
# Some code taken from nilearn searchlight implementation: https://github.com/nilearn/nilearn/blob/master/nilearn/decoding/searchlight.py
import os
import time
import sys
import warnings
from distutils.version import LooseVersion
import random
import cPickle
import numpy as np
im... |
# Copyright (c) 2019-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same directory.
from __future__ import a... |
"""
Mail reader functions
Adapted from
* http://www.ianlewis.org/en/parsing-email-attachments-python
* http://stackoverflow.com/questions/1225586/checking-email-with-python
"""
import poplib
from email.Header import decode_header
from email.Parser import Parser as EmailParser
from email.utils import parseaddr
from ... |
# -*- coding: utf-8 -*-
# Copyright (C) 2015-2020 by Brendt Wohlberg <brendt@ieee.org>
# All rights reserved. BSD 3-clause License.
# This file is part of the SPORCO package. Details of the copyright
# and user license can be found in the 'LICENSE.txt' file distributed
# with the package.
"""Linear algebra functions."... |
#!/usr/bin/env python
#
#CustomScript extension
#
# Copyright 2014 Microsoft 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
#
#... |
# -*- coding:utf-8 -*-
import string
import numpy as np
def str2list(rawstr):
rawlist = rawstr.strip(string.whitespace).split(' ')
# Remove space elements in list.
cleanlist = [x for x in rawlist if x != ' ' and x != '']
return cleanlist
def line2list(line, field=' ', dtype=float):
"Convert te... |
# -*- coding: utf-8 -*-
"""
werkzeug.routing
~~~~~~~~~~~~~~~~
An extensible URL mapper.
Map creation::
>>> m = Map([
... # Static URLs
... Rule('/', endpoint='static/index'),
... Rule('/about', endpoint='static/about'),
... Rule('/help', endpoin... |
"""
App Launch Hook - Rez
This hook is executed to launch applications, potentially in a Rez context.
https://github.com/nerdvegas/rez
Rez packages can be requested via app_launchers.yml,
as part of the "extras" section and in a key called "rez_packages". Also be sure
to override the default "hook_app_launch" with t... |
# ******************************************************************************
# Cloud jukebox
# Copyright Paul Dardeau, SwampBits LLC, 2014
# BSD license -- see LICENSE file for details
#
# (1) create a directory for the jukebox (e.g., ~/jukebox)
#
# This cloud jukebox uses an abstract object storage system.
# (2) c... |
#
# Parse tree nodes for expressions
#
from __future__ import absolute_import
import cython
cython.declare(error=object, warning=object, warn_once=object, InternalError=object,
CompileError=object, UtilityCode=object, TempitaUtilityCode=object,
StringEncoding=object, operator=object,
... |
#-------------------------------------------------------------------------------
# Name: cs-578-project 3
# Description: A prototype trainer for a K-Nearest Neighbor classifier that
# attempts to predict smoaking status for unlabeled patients as one of three categories: 'SMOKER, 'NON-SMOKER'
# , or 'UNKNOWN... |
__version__ = "0.7b1"
|
#
# Pyrex - Parse tree nodes for expressions
#
import operator
from string import join
from Errors import error, warning, InternalError
from Errors import hold_errors, release_errors, held_errors, report_error
from Cython.Utils import UtilityCode
import StringEncoding
import Naming
from Nodes import Node
import Pyr... |
'''SQL query strings'''
CLUSTER_BY_TYPE_OR_DESCRIPTION = """
WITH RECURSIVE all_subtypes AS (
SELECT
bgc_type_id
FROM antismash.bgc_types
WHERE
term = %s
OR
lower(description) LIKE lower(%s)
UNION SELECT
t.bgc_type_id
FROM antismash.bgc_types t
JOIN all_subty... |
import multiprocessing
import clip_year_tiles
import subprocess
import glob
import shutil
import utilities
# creates a 10x10 degree wgs 84 tile of .00025 res burned year. Download all modis hv tile from s3,
# make a mosaic for each year, and clip to hansen extent. Files are uploaded to s3
for year in range(2000, 2018... |
#!/usr/bin/env python
"""
Estimate epidemic model parameters by comparing simulations to "observed" phylogeny.
"""
import sys
import os
import multiprocessing as mp
from phyloK2 import PhyloKernel
import random
import rcolgem
from Bio import Phylo
from copy import deepcopy
import time
from cStringIO import StringIO
im... |
# -*- coding: utf-8 -*-
"""This preprocessor replaces bibliography code in markdowncell
"""
#-----------------------------------------------------------------------------
# Copyright (c) 2015, Julius Schulz
#
# Distributed under the terms of the Modified BSD License.
#
#-----------------------------------------------... |
"""
This module contains multiple functions in order to run MSAF algorithms.
"""
from copy import deepcopy
from joblib import Parallel, delayed
import librosa
import logging
import numpy as np
import os
import msaf
from msaf import input_output as io
from msaf import utils
from msaf import plotting
from msaf.features ... |
from __future__ import unicode_literals
import copy
import logging
import re
from django.conf import settings
from django.core import validators
from django.contrib.auth import password_validation
from django.db import transaction
from django.db.models import Q
from django.template.defaultfilters import slugify
from ... |
"""Settings for AutoShare"""
# Youtube url and api settings
Youtube_playlistId = " "
Youtube_api_key = " "
Youtube_base_url = "https://www.googleapis.com/youtube/v3/playlistItems?part=snippet&maxResults=1&playlistId="+Youtube_playlistId+"&key="+Youtube_api_key
Youtube_watch_url = "https://www.youtube.com/watch?v="
... |
import os
import signal
import threading
import time
import rospy
from appctl_support import ProcController
from lg_common.msg import ApplicationState
from lg_common.helpers import is_valid_state
SIG_RETRY_DELAY = 0.05
class ManagedApplication(object):
def __init__(self, cmd, shell=False, window=None, initial_s... |
"""Base class for activities written in Python
This is currently the only definitive reference for what an
activity must do to participate in the Sugar desktop.
A Basic Activity
All activities must implement a class derived from 'Activity' in this class.
The convention is to call it ActivitynameActivity, but thi... |
import SimpleHTTPServer
import SocketServer
import json
import logging
import os
import traceback
import urlparse
DEPLOYED_PACKAGE = 'build'
DEVELOPMENT_PACKAGE = 'web'
class KcaaHTTPRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
GET_NEW_OBJECTS = '/get_new_objects'
GET_OBJECT = '/get_object'
... |
# -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Copyright 2015-2018 by ExopyHqcLegacy Authors, see AUTHORS for more details.
#
# Distributed under the terms of the BSD license.
#
# The full license is in the file LICENCE, distributed with this software.
# ------... |
#! /usr/bin/env python
# coding=UTF-8
'''
Created on 9. mars 2010
@author: Harald Hauknes(harald@hauknes.org)
'''
# The with statement is not available in Python 2.5, so import it
from __future__ import with_statement
import GnuPGInterface
from hashlib import md5
import random
import re
import time
... |
#!/usr/bin/env python
# encoding: utf-8
"""
process.py
Created by Thomas Mangin on 2011-11-29.
Copyright (c) 2011 Exa Networks. All rights reserved.
"""
from threading import Thread
import subprocess
import errno
import os
import re
import time
import socket
from Queue import Empty
from .http import Header
from .... |
from __future__ import absolute_import
import sublime, sublime_plugin
import re, string, os, sys, functools, mmap, pprint, imp, threading
from collections import Counter
from plistlib import readPlistFromBytes
try:
from . import vhdl_module
from .util import vhdl_util
from .util import sublime_util
fr... |
from aiida.orm import Code, DataFactory
from aiida.orm.workflow import Workflow
from aiida.orm.calculation.inline import make_inline
from aiida.workflows.wf_gruneisen_pressure import WorkflowGruneisen
from aiida.workflows.wf_phonon import WorkflowPhonon
from aiida.orm import load_workflow
StructureData = DataFactory... |
import MySQLdb
import datetime
class SQL:
_unnamed_category = "unnamed"
_unused_category_type = 0
_income_category_type = 1
_expense_category_type = 2
_general_category_type = 3
_db = None
_cursor = None
def __init__(self):
self._host = "localhost"
self._user = "root"
... |
# coding=utf-8
# Copyright 2017 The DLT2T 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 ... |
from custom_settings import *
MANAGERS = ADMINS
LANGUAGE_CODE = 'en-us'
SITE_ID = 1
USE_I18N = True
USE_L10N = True
ADMIN_MEDIA_PREFIX = '/media/'
# Make this unique, and don't share it with anybody.
SECRET_KEY = 'f6h^bz8&0+ad@+qsntr)_onhx2(y^^u%$434byw3l^q!*n078v'
TEMPLATE_LOADERS = (
'django.template.loaders... |
from hlsclient.balancer import Balancer
def test_balancer_returns_active_server_if_its_the_only_one():
PATH = '/path'
SERVER = 'server'
paths = {PATH: [SERVER]}
b = Balancer()
b.update(paths)
active_playlists = list(b.actives)
assert 1 == len(active_playlists)
assert PATH == active_playlists[0].path
assert SE... |
"""
Copyright 2019, Institute for Systems Biology
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... |
#!/usr/bin/env python
from __future__ import absolute_import
from collections import defaultdict
import importlib
import os
from django.contrib import messages
import settingshelper as helper
# odd celery fix
import djcelery
djcelery.setup_loader()
DEBUG = True
LESS_DEBUG = DEBUG
# clone http://github.com/dimagi/V... |
"""
Wikipedia Tools library
Get the plain text, wikitext, HTML, or parse tree of an article via
MediaWiki API. You may get the whole article in those formats, just
the "lead" section (summary), or just the Infobox (if extant).
"""
__author__ = "Archer4499(originally by siznax)"
__contact__ = "https://github.com/Arche... |
# -*- coding: utf-8 -*-
# vim: set ts=4
import sys
from reportlab.lib.enums import TA_LEFT, TA_CENTER, TA_RIGHT
from reportlab.lib.pagesizes import A4
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.lib.units import inch
from reportlab.platypus import Image, Paragraph, SimpleDocTemp... |
"""
Adds audit trail to any NDB entity (including Expando-based models)
For more details see README.md
"""
import base64
import datetime
import hashlib
import logging
import os
from google.appengine.ext import ndb
__version__ = '1.1.3'
HASH_LENGTH = 8 # (in bytes out of 20 bytes for SHA-1)
class AuditMixin(object)... |
import unittest
from cobe.commands import LearnIrcLogCommand
class testIrcLogParsing(unittest.TestCase):
def setUp(self):
self.command = LearnIrcLogCommand()
def testNonPubmsg(self):
msg = "this is some non-pubmsg text found in a log"
cmd = self.command
self.assertEqual(None,... |
#!/usr/bin/env python2
# Copyright (c) 2013 phrack. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import argparse
from canvas_manager import CanvasManager
import cv2
import glob
import imp
import logging
import os
from PIL import Image, Imag... |
from oldowan.mtconvert.coverage import calc_coverage
from oldowan.mtconvert.coverage import Coverage
from oldowan.mtconvert.sites2seq import sites2seq
def test_single_rcrs_segment():
ranges = [(16024,16365),
(73,340),
(16000,340),
(16000,577),
(577,15992),
... |
import sys
import logging
import json
import pycurl
from urllib import urlencode
from cStringIO import StringIO
from pprint import pprint as pp
from flask import Flask, request, abort
APP_CONFIG = 'bot.cfg'
BASE_URL = 'https://api.telegram.org/bot'
GOOGLE_URL = 'http://finance.google.com/finance/info?client=ig&q='
D... |
import base64
from contextlib import ExitStack
from io import StringIO
import json
import os
from pathlib import Path
import re
import subprocess
import sys
from tempfile import TemporaryDirectory
import time
from unittest.mock import patch
import uuid
import warnings
import weakref
from xml.etree import ElementTree as... |
import pytest
from rasa_core.policies import Policy
from rasa_core.policies.ensemble import (PolicyEnsemble, InvalidPolicyConfig,
SimplePolicyEnsemble)
from rasa_core.domain import Domain
from rasa_core.trackers import DialogueStateTracker
from rasa_core.events import UserUtter... |
#!/usr/bin/python
# vim: ts=4 et sts filetype=python
# This file is part of RCubic
#
# Copyright (c) 2012 Wireless Generation, Inc.
#
# 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 r... |
import json
import io
import zipfile
from django.core.files import File
from django.test import TestCase
from greenwich.raster import Raster
from rest_framework.test import APIRequestFactory
from spillway import generics
from spillway.renderers import GeoJSONRenderer
from .models import Location, RasterStore
from .te... |
from unittest import TestCase
from massapk import __version__
def test_version():
assert __version__ == '0.1.0'
class TestAdb(TestCase):
def test_start_server(self):
from massapk import adb
try:
adb.stop_server()
adb.start_server()
adb.stop_server()
... |
import re
import django
import core
import features
from core import tests
from features.associations import models as associations
from features.contributions import models as contributions
from features.memberships import test_mixins as memberships
def _get_adjusted_event_args(missing_keys=None, **kwargs):
""... |
# Released under The MIT License (MIT)
# http://opensource.org/licenses/MIT
# Copyright (c) 2014 SCoT Development Team
import unittest
from scot.parallel import parallel_loop
def f(x):
return x**2 - 1
def g(x, y, z):
return x**y - z
def h(x):
return x, x**2
class TestFunctions(unittest.TestCase):
... |
# Copyright 2015-2016 ARM Limited
#
# 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... |
# Make sure to set configuration, needs to be before any galpy imports
import pytest
from galpy.util import config
config.__config__.set('astropy','astropy-units','True')
import numpy
from astropy import units, constants
sdf_sanders15= None #so we can set this up and then use in other tests
sdf_sanders15_nou= None #so ... |
import Action
import Node
from Params import error
xsubpp_str = '${PERL} ${XSUBPP} -noprototypes -typemap ${EXTUTILS_TYPEMAP} ${SRC} > ${TGT}'
def xsubpp_file(self, node):
gentask = self.create_task('xsubpp', nice=1)
gentask.set_inputs(node)
gentask.set_outputs(node.change_ext('.c'))
cctask = self.cr... |
#!/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
from email.message import Message
#Parse config
config = ConfigParser()
config.r... |
import os.path
import importlib
import collections
from django.conf import settings
from .utils import get_url
from waliki.rst2html5 import HTML5Writer
def _get_default_data_dir():
settings_mod = importlib.import_module(settings.SETTINGS_MODULE)
project_dir = os.path.abspath(os.path.dirname(settings_mod.__nam... |
import discord
import os
import json
import subprocess
from datetime import datetime
greetings = "Arcoex stands for **ar**bitrary **co**de **ex**ecution, and that's what this bot does! There are two ways to use me (you can use both at the same time if you want to):\n\n**1.** Mention me among with the language of the c... |
"""
This is a set of RPC calls using the ZeroRPC library. This is used by the
tonetrainer web project to call Pyrapt's RAPT functionality for use in showing
vocal pitch. See the tonetrainer github repo for more details:
https://github.com/dgaspari/tonetrainer
"""
import zerorpc
from pyrapt import pyrapt
class Pyrapt... |
# coding: utf8
"""
weasyprint.draw
---------------
Take an "after layout" box tree and draw it onto a cairo surface.
:copyright: Copyright 2011-2012 Simon Sapin and contributors, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from __future__ import division, unicode_literals
import co... |
#!/usr/bin/env python
import os
import sys
from optparse import OptionParser
from wsgiref.simple_server import make_server, WSGIServer, WSGIRequestHandler
CONFIG = 'tilelite.cfg'
MAP_FROM_ENV = 'MAPNIK_MAP_FILE'
parser = OptionParser(usage="""
python liteserv.py <mapfile.xml> [options]
""")
parser.add_o... |
import getpass
import logging
import os
import re
import sys
import textwrap
import xmlrpclib
from ConfigParser import ConfigParser
from datetime import datetime
try:
from docutils.core import publish_parts
except ImportError:
print >> sys.stderr, \
'docutils is required to convert the PyFITS chang... |
# -*- coding: utf-8 -*-
import re
import weakref
import six
import unittest
from parsel import Selector
class SelectorTestCase(unittest.TestCase):
sscls = Selector
def test_simple_selection(self):
"""Simple selector tests"""
body = u"<p><input name='a'value='1'/><input name='b'value='2'/></p... |
import os
import uuid
from pathlib import Path
from typing import Dict, List, Optional, Set
import pytest
from pydantic import BaseModel, BaseSettings, Field, NoneStr, ValidationError, dataclasses
from pydantic.env_settings import SettingsError, read_env_file
try:
import dotenv
except ImportError:
dotenv = N... |
#!/usr/bin/python
# :Author: a Pygments author|contributor; Felix Wiemann; Guenter Milde
# :Date: $Date: 2007-06-13 12:20:42 +0200 (Wed, 13 Jun 2007) $
# :Copyright: This module has been placed in the public domain.
#
# This is a merge of `Using Pygments in ReST documents`_ from the pygments_
# documentation, and a `... |
#!/usr/bin/env python
__author__ = 'Thomas R. Lennan, Michael Meisinger'
__license__ = 'Apache 2.0'
from uuid import uuid4
import couchdb
from couchdb.http import ResourceConflict, ResourceNotFound
from pyon.core.bootstrap import IonObject
from pyon.core.exception import BadRequest, Conflict, NotFound
from pyon.dat... |
#
# Copyright 2016 The BigDL 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 ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# vim: set sw=3 sts=3 ts=3
"""(Tool) Bench Marking Tool
THis tool does some simple benchmaking of the circuits library.
"""
import sys
import math
import time
import hotshot
import optparse
import hotshot.stats
try:
import psyco
except ImportError:
psyco = None
from ... |
# coding: utf-8
'''
App: Webhook
description: permitir hook de conversรฃo pandoc em "documentos/artigos"
author: Adriano dos Santos Vieira
character encoding: UTF-8
'''
from flask import Flask, request, json
import requests
import ConfigParser
app = Flask(__name__)
'''
commentMR: post comment to Merge Request
'''
def ... |
import os
from concurrent.futures import ThreadPoolExecutor
from pandaharvester.harvesterconfig import harvester_config
from pandaharvester.harvestercore import core_utils
from pandaharvester.harvestercore.plugin_base import PluginBase
from pandaharvester.harvestermisc.k8s_utils import k8s_Client
# logger
baseLogge... |
"""
Col -- SQLObject columns
Note that each column object is named BlahBlahCol, and these are used
in class definitions. But there's also a corresponding SOBlahBlahCol
object, which is used in SQLObject *classes*.
An explanation: when a SQLObject subclass is created, the metaclass
looks through your class definition... |
#!/usr/bin/env python2.5
#
# Copyright 2011 the Melange 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 applic... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import os
from django.db import models
from django.shortcuts import get_object_or_404
from django.utils.cache import add_never_cache_headers
from django.utils.translation import get_language_from_request
from rest_framework import generics
from rest_fra... |
from discord.ext import commands
import hashlib
import zlib
from cryptography.hazmat.backends.openssl import backend as openssl_backend
from cryptography.hazmat.primitives import hashes as crypto_hashes
import pygost.gost28147
import pygost.gost28147_mac
import pygost.gost34112012
import pygost.gost341194
import pyg... |
๏ปฟ# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect 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 Lice... |
#__BEGIN_LICENSE__
# Copyright (c) 2015, United States Government, as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All rights reserved.
#
# The xGDS platform is licensed under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance ... |
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright 2012-2013 Camptocamp SA (Guewen Baconnier)
# Copyright (C) 2010 Sรฉbastien Beau
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affer... |
from . import Plugin
class CatchallStatsdPlugin(Plugin):
priority = -4
"""
Like catchall, but for targets from statsd (presumably)
"""
targets = [
{
'match': '^stats\.gauges\.?(?P<n1>[^\.]*)\.?(?P<n2>[^\.]*)\.?(?P<n3>[^\.]*)\.?(?P<n4>[^\.]*)\.?(?P<n5>[^\.]*)\.?(?P<n6>[^\.]*)\.... |
import ipaddress
from BaseHTTPServer import BaseHTTPRequestHandler
from StringIO import StringIO
from twisted.internet.protocol import DatagramProtocol
from paradrop.base import settings
from paradrop.core.system import system_info
SSDP_ADDR = "239.255.255.250"
PARADROP_URN = "urn:schemas-upnp-org:service:Paradro... |
#!/usr/bin/python
"""
Memset API interactive shell
Copyright (C) 2012 Memset Ltd; http://www.memset.com/
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... |
# -*- coding: utf8 -*-
#***************************************************************************
#* *
#* Copyright (c) 2009, 2010 *
#* Yorik van Havre <yorik@uncreated.net>, Ken Cline <cline@fr... |
import datetime
import main
from flask import flash, redirect, render_template, request, session, url_for
from flask.views import View
from .db.models import ShoppingList, ShoppingItem, ShoppingListManager, User
from .forms import LoginForm, CreateShoppingItemForm
from .utils.helpers import json_serial, check_name, ge... |
import random
import fireplace.cards
from ..actions import *
from ..enums import CardType, Race, Zone
from ..targeting import *
def hand(func):
"""
@hand helper decorator
The decorated event listener will only listen while in the HAND Zone
"""
func.zone = Zone.HAND
return func
drawCard = lambda self, *args: se... |
#
# Copyright (c) 2015 nexB Inc. and others. All rights reserved.
# http://nexb.com and https://github.com/nexB/scancode-toolkit/
# The ScanCode software is licensed under the Apache License version 2.0.
# Data generated with ScanCode require an acknowledgment.
# ScanCode is a trademark of nexB Inc.
#
# You may not use... |
#!/usr/bin/env python
# Created by Pearu Peterson, September 2002
""" Test functions for fftpack.basic module
"""
from __future__ import division, print_function, absolute_import
__usage__ = """
Build fftpack:
python setup_fftpack.py build
Run tests if scipy is installed:
python -c 'import scipy;scipy.fftpack.test... |
#file : InMoov3.hand+arm+rockpaperscissors.py
from java.lang import String
import threading
import time
import random
# this will run with versions of MRL above 1695
# a very minimal script for InMoov
# although this script is very short you can still
# do voice control of a right hand or finger box
# It uses WebkitS... |
import unittest
from django.core.exceptions import FieldDoesNotExist
from django.db import connection, migrations, models, transaction
from django.db.migrations.migration import Migration
from django.db.migrations.operations import CreateModel
from django.db.migrations.operations.fields import FieldOperation
from djan... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.