text stringlengths 17 737k |
|---|
# -*- coding: utf-8 -*-
#
# Copyright 2016 Taŭga Tecnologia
# Aristides Caldeira <aristides.caldeira@tauga.com.br>
# License AGPL-3 or later (http://www.gnu.org/licenses/agpl)
#
import logging
from odoo import api, fields, models
from ..constante_tributaria import (
TIPO_CERTIFICADO,
TIPO_CERTIFICADO_A1,
)
f... |
from twisted.application import service, internet
from twisted.python.log import ILogObserver
from twisted.internet import reactor, task
from twisted.python import log
from kademlia.network import Server
import os
import sys
import thread
class Kserver(object):
"""docstring for Kserver"""
def __init__(self, a... |
# lda_tag.py
#
#
# Title: Topic extraction using Latent Dirichlet Allocation
# Author: Rebecca Bilbro
# Date: 1/9/16
# Organization: Commerce Data Service, U.S. Department of Commerce
"""
Notes: In LDA, time complexity is proportional to (n_samples * iterations).
"""
############################... |
#
#
# Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Google Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
... |
import re
import os
import codecs
import threading
import shutil
import queue
import uuid
import zipfile
import requests
import sys
from bs4 import BeautifulSoup
debug = 1
downloadQueue = queue.Queue()
#从volist中提取每一卷的网址
def parseList(url):
r = requests.get(url)
r.encoding = 'utf-8'
soup... |
# -*- coding: utf-8 -*-
from django.views.decorators.csrf import csrf_exempt
from django.core.exceptions import PermissionDenied
from django.shortcuts import get_object_or_404
from django.http import HttpResponse, Http404
from django.conf import settings
from .models import Application, Crash
import xml.etree.ElementTr... |
import sys
import csv
# Module csv in Python 2 doesn't natively support unicode, so utf-8
# encoding/decoding must be done manually. Python 2 csv also requires
# for files to be opened in binary mode.
if sys.version_info[0] == 3:
def encode(s):
return s
def decode(s):
return s
def csvopen(f... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
import base64
import hashlib
import hmac
import re
from time import gmtime, strftime
from requests import request
from requests.exceptions import HTTPError
from . import utils
try:
from urllib.parse import quote
except ImportError:
from urllib i... |
from random import choice, randint
from struct import pack
from binascii import unhexlify
from array import array
from socket import inet_aton, htons, IPPROTO_TCP
from re import search
class Ethernet_raw:
# +---------------------------------------------------------------+
# | Ethernet destination addre... |
import threading
import logging
import subprocess
import protocol
import pycountry
import gnupg
import obelisk
import pybitcointools
from pybitcointools import *
import tornado.websocket
from zmq.eventloop import ioloop
from twisted.internet import reactor
from backuptool import BackupTool, Backup, BackupJSONEncoder
i... |
import os
import imp
from setuptools import find_packages
class Package(dict):
#Maindata
NAME = 'run-python'
PACKAGE_DATA={
'': ['files/*'],
}
INSTALL_REQUIRES = ['run-core']
TEST_SUITE = 'nose.collector'
TESTS_REQUIRE = ['nose']
#Metadata
DESCRIPTION = 'P... |
import signal
import sys
import traceback
from datetime import datetime, timedelta
from bus import Bus
from messages import read_messages, subscribe_to_cmd
from outbound import request_sensor_data, CMD_RETURN_SENSOR_DATA, \
set_motor_speed, set_right_motor_speed, set_left_motor_speed
bus = Bus()
# Update frequen... |
"""
picture.py
Author: Dina
Credit: <list sources used, if any>
Assignment:
Use the ggame library to "paint" a graphical picture of something (e.g. a house, a face or landscape).
Use at least:
1. Three different Color objects.
2. Ten different Sprite objects.
3. One (or more) RectangleAsset objects.
4. One (or more)... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
'''
1638. Bookworm
Time limit: 1.0 second
Memory limit: 64 MB
[Description]
Petya bought a 100-volume edition of Advice of Veterans of Programming Contests
and hoped that the succession of his failures would come to an end. He mounted
a bookshelf on the wall and put the volum... |
import single_robot_composite_behavior
import behavior
import main
import role_assignment
import enum
import robocup
import skills
import constants
import skills.pivot_kick
## This class is currently not used for anything
# This was ported from our old C++ gameplay system and served a purpose then, but is unused now
... |
# Echo client program
import socket
import sys
arg = sys.argv[1]
HOST = 'research.inf.usi.ch' # The remote host
PORT = 50000 # The same port as used by the server
s = None
for res in socket.getaddrinfo(HOST, PORT, socket.AF_UNSPEC, socket.SOCK_STREAM):
af, socktype, proto, canonname, sa = res
... |
import asyncio
import discord
import random
import math
from operator import itemgetter
from discord.ext import commands
from Cogs import ReadableTime
from Cogs import Nullify
from Cogs import DisplayName
def setup(bot):
# Add the cog
bot.remove_command("help")
bot.add_cog(Help(bot))
# This is the Help m... |
##
# Copyright (c) 2005-2009 Apple Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... |
#!/usr/bin/env python
#Copyright (C) 2009-2010 :
# Gabes Jean, naparuba@gmail.com
# Gerhard Lausser, Gerhard.Lausser@consol.de
#
#This file is part of Shinken.
#
#Shinken is free software: you can redistribute it and/or modify
#it under the terms of the GNU Affero General Public License as published by
#the Fre... |
# coding=utf-8
import gzip
import threading
from autobahn.twisted.websocket import WebSocketClientFactory, \
WebSocketClientProtocol, \
connectWS
from twisted.internet import reactor, ssl
from twisted.internet.protocol import ReconnectingClientFactory
from twisted.internet.error import ReactorAlreadyRunning
im... |
# Copyright (c) 2008,2009 Citrix Systems, Inc.
#
# This program 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; version 2.1 only. with the special
# exception on linking described in file LICENSE.
#
# T... |
import os.path
from datetime import date
from urllib.request import urlretrieve
from zipfile import ZipFile
import numpy as np
import pandas as pd
from .reimbursements import Reimbursements
class ChamberOfDeputiesDataset:
YEARS = [n for n in range(2009, date.today().year+1)]
def __init__(self, path):
... |
#!/usr/bin/env python3
# encoding: UTF-8
# This file is part of Addison Arches.
#
# Addison Arches is free software: you can redistribute it and/or modify it
# under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option)... |
#!/usr/bin/env python
import rospy
from autobot.msg import drive_param
from autobot.msg import wall_dist
from autobot.msg import pathFinderState
from autobot.msg import detected_object
from autobot.srv import *
from sensor_msgs.msg import Image
from pathFinder import PathConfig
from obstruction import *
from stopsign ... |
from yaml import safe_dump as dump, safe_load as load
class modeldef():
'''
Should eventually inherit the PyMad API...
'''
def __init__(self,modelfile,modelname):
self._dict=load(open(modelfile,'r'))[modelname]
self.name=modelname
self._init_attr('sequences')
self.... |
# -*- coding: utf-8 -*-
import urllib
import re
import urllib2
import sys
def info_extractor(url):
_VALID_URL = r'(?:http://)?(?:www\.)?watchcartoononline\.com/([^/]+)'
mobj = re.match(_VALID_URL, url)
video_id = mobj.group(1)
user_agent = 'Mozilla/5.0 (Windows NT 5.1; rv:10.0.1) Gecko/20100101 Firefox... |
# -*- 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... |
#!/usr/bin/env python
# This script will download and extract required tools into the current directory.
# Tools list is obtained from package/package_esp8266com_index.template.json file.
# Written by Ivan Grokhotkov, 2015.
#
from __future__ import print_function
import urllib
import os
import shutil
import errno
impor... |
# vim: set fileencoding=utf-8 :
import re
import os
import urllib2
import urllib
from logging import LogHandler
import config
import sys
import time
import threading
from tools.helper import textextract
log = LogHandler('download')
try:
from keepalive import HTTPHandler
except:
pass
else:
keepalive_handle... |
# Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
#
# Use of this source code is governed by a BSD-style license
# that can be found in the LICENSE file in the root of the source
# tree. An additional intellectual property rights grant can be found
# in the file PATENTS. All contributing project au... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2003-2009 Edgewall Software
# Copyright (C) 2003-2005 Jonas Borgström <jonas@edgewall.com>
# Copyright (C) 2005 Christopher Lenz <cmlenz@gmx.de>
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have ... |
from django.contrib.sites.shortcuts import get_current_site
from django.core.urlresolvers import reverse
from django.http.response import HttpResponseRedirect, JsonResponse
from django.views.generic.edit import FormView
from .managers import FormManager
class StepsHelper(object):
done_name = 'done'
def __in... |
from django.test import TestCase
from .models import User,ParameterList,ValueEntry,ParameterIdeals
class CreateUser(TestCase):
def setUp(self):
User.objects.create(username="Nazrul Islam",password="password1")
User.objects.create(username="Anjan Bashak",password="password2")
# User.objects.create(username="Naz... |
from System import *
from System.Diagnostics import *
from System.IO import *
from Deadline.Plugins import *
from Deadline.Scripting import *
######################################################################
# This is the function that Deadline calls to get an instance of the
# plugin. It allows us to abstract a... |
#!/usr/bin/python
# Copyright (c) 2009 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.
"""Client-side script to send a try job to the try server. It communicates to
the try server by either writting to a svn repository or b... |
"""
Low-level objects
=================
These classes are used to describe a nengo model (Model).
Model is the input to a *simulator* (see e.g. simulator.py).
"""
import numpy as np
"""
Set assert_named_signals True to raise an Exception
if model.signal is used to create a signal with no name.
This can help to ide... |
"""
The Bookalope module contains a simple object model to make Bookalope's REST API
more accessible. See http://bookalope.net/
"""
import base64
import json
import re
import datetime
import http.client
import urllib.parse
import babel
def _is_token(token_s):
"""
Given a string, returns True if the string con... |
from django.contrib.contenttypes.fields import GenericForeignKey, GenericRelation
from django.contrib.contenttypes.models import ContentType
from django.utils.functional import cached_property
from django.contrib.auth.models import User
from django.contrib.auth import get_user_model
from django.db.models import Q
from ... |
'''
This module allows to load texture and to sample from it
'''
import numpy as np
from vulkbare import load_image
from vulk import vulkanobject as vo
from vulk import vulkanconstant as vc
class RawTexture():
'''A Raw texture is not initialized with an image file but can be filled
manually'''
def __ini... |
import datetime
from django.views.generic import DetailView, TemplateView
from wafer.schedule.models import Venue, Slot, Day
from wafer.schedule.admin import check_schedule
class ScheduleRow(object):
"""This is a helpful containter for the schedule view to keep sanity"""
def __init__(self, schedule_day, slot... |
import sys
import logging
# NOTE: Be sure to keep the logging level commented out before commiting. See:
# https://github.com/numba/numba/issues/31
# A good work around is to make your tests handle a debug flag, per
# numba.tests.test_support.main().
logging.basicConfig(#level=logging.DEBUG,
for... |
import ast
import ast as ast_module
import __builtin__ as builtins
from numba import functions
from numba.typesystem.typemapper import have_properties
try:
import numbers
except ImportError:
# pre-2.6
numbers = None
from numba import error
import logging
logger = logging.getLogger(__name__)
class Cooper... |
#!/usr/bin/env python -W ignore::DeprecationWarning
__copyright__ = "Copyright 2017 Birkbeck, University of London"
__author__ = "Martin Paul Eve & Andy Byers"
__license__ = "AGPL v3"
__maintainer__ = "Birkbeck Centre for Technology and Publishing"
"""
Django settings for core project.
Generated by 'django-admin star... |
# coding: utf8
# WeasyPrint converts web documents (HTML, CSS, ...) to PDF.
# Copyright (C) 2011 Simon Sapin
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of t... |
#!/usr/bin/env python3
import io
import os
import re
import csv
import types
from urllib.parse import quote
import rdflib
from rdflib.extras import infixowl
from IPython import embed
from utils import makeGraph, add_hierarchy, rowParse
from obo_io import OboFile
from scigraph_client import Graph, Vocabulary
sgg = Graph... |
"""
This a Random Multitone Signal Generator module. |br|
It is able to generate *N* multitone random signals according to settings
given by a user. |br|
An input dictionary, which is a sole argument to the *main*
function contains all the settings given to the generator.
*Author*:
Jacek Pierzchlewski, Aalborg Un... |
""" shrunk - Rutgers University URL Shortener
Sets up a Flask application for the main web server.
"""
from flask import Flask, render_template, make_response, request, redirect, g, session
from flask_sso import SSO
from shrunk.forms import BlockLinksForm, LinkForm, BlacklistUserForm, AddAdminForm
from shrunk.util im... |
"""WSGI config for saleor project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICATION`` se... |
from silk import *
from silk.webreq import Request as BaseRequest, Response as BaseResponse, HTTP, format_status
import base64
import collections
import sys
import traceback
import wsgiref.util
import wsgiref.headers
class Request(BaseRequest):
"""An object representing the request's environment.
"""
def __init_... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import abc
import copy
import datetime
import math
import pickle
import random
import signal
import sys
import time
def round_figures(x, n):
"""Returns x rounded to ... |
"""
Manage VMware vCenter servers and ESXi hosts.
.. versionadded:: 2015.8.4
:codeauthor: Alexandru Bleotu <alexandru.bleotu@morganstaley.com>
Dependencies
============
- pyVmomi Python Module
- ESXCLI
pyVmomi
-------
PyVmomi can be installed via pip:
.. code-block:: bash
pip install pyVmomi
.. note::
... |
'''
A module to manage software on Windows
:depends: - pythoncom
- win32com
- win32con
- win32api
'''
# Import third party libs
try:
import pythoncom
import win32com.client
import win32api
import win32con
HAS_DEPENDENCIES = True
except ImportError:
HAS_DEP... |
# -*- coding: utf-8 -*-
'''
Output data in YAML, this outputter defaults to printing in YAML block mode
for better readability.
'''
# Import third party libs
import yaml
# Define the module's virtual name
__virtualname__ = 'yaml'
def __virtual__():
return __virtualname__
def output(data):
'''
Print ou... |
# -*- coding: utf-8 -*-
'''
Manage ELBs
.. versionadded:: 2014.7.0
Create and destroy ELBs. Be aware that this interacts with Amazon's
services, and so may incur charges.
This module uses ``boto``, which can be installed via package, or pip.
This module accepts explicit elb credentials but can also utilize
IAM role... |
# -*- coding: utf-8 -*-
'''
Manage Docker containers
========================
`Docker <https://www.docker.io>`_
is a lightweight, portable, self-sufficient software container
wrapper. The base supported wrapper type is
`LXC <https://en.wikipedia.org/wiki/Linux_Containers>`_,
`cgroups <https://en.wikipedia.org/wiki/Cgr... |
#!/usr/bin/env python
#
# Electrum - lightweight Bitcoin client
# Copyright (C) 2012 thomasv@gitorious
#
# 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 witho... |
# -*- coding: utf-8 -*-
import collections
import threading
from .func import synchronized
__all__ = ['LRU']
class LRU(object):
"""
Implementation of a length-limited O(1) LRU map.
Original Copyright 2003 Josiah Carlson, later rebuilt on OrderedDict.
"""
def __init__(self, count, pairs=()):
... |
# -*- coding: utf-8 -*-
'''
Template render systems
'''
from __future__ import absolute_import
# Import python libs
import codecs
import os
import imp
import logging
import tempfile
import traceback
import sys
# Import third party libs
import jinja2
import jinja2.ext
# Import salt libs
import salt.utils
from salt.e... |
'''
The EC2 Cloud Module
====================
The EC2 cloud module is used to interact with the Amazon Elastic Cloud
Computing. This driver is highly experimental! Use at your own risk!
To use the EC2 cloud module the following configuration parameters need to be
set in the main cloud config:
.. code-block:: yaml
... |
from collections import deque
import sys
import greenlet
from . import event, hubs
from .support import reraise
__all__ = ['sleep', 'spawn', 'spawn_n', 'kill', 'spawn_after', 'GreenThread']
def sleep(seconds=0):
"""Yield control to the hub until at least `seconds` have elapsed
:param float seconds: time to... |
from collections import OrderedDict
import re
import os
from xml.etree import ElementTree as ET
import openmc.checkvalue as cv
from numbers import Real
from openmc.data import NATURAL_ABUNDANCE, atomic_mass
class Element(str):
"""A natural element that auto-expands to add the isotopes of an element to
a mate... |
__version__ = '0.4.0'
|
import re
from hamper.commander import registerCommand
class Command(object):
"""Base class for a simple command."""
onlyDirected = True
caseSensitive = False
regex = ''
priority = 0
def __call__(self, commander, options):
pass
@registerCommand
class FriendlyCommand(Command):
... |
# -*- coding: utf-8 -*-
import os.path
import geoip2.database
from flask import Flask
from flask_migrate import Migrate
from flask_assets import Bundle
from flask_rq import RQ
from flask_mail import Mail
from flask_redis import FlaskRedis
from flask_lastuser import Lastuser
from flask_lastuser.sqlalchemy import UserMa... |
from .connectionpools import ConnectionPool
from .cloudvolume import CloudVolume
from .lib import Bbox
from .provenance import DataLayerProvenance
from .skeletonservice import PrecomputedSkeleton, SkeletonEncodeError, SkeletonDecodeError
from .storage import Storage
from .threaded_queue import ThreadedQueue
from .excep... |
"""Test the CLTK.
TODO: Write test for copy_dir_contents
"""
__author__ = 'Kyle P. Johnson <kyle@kyle-p-johnson.com>'
__license__ = 'MIT License. See LICENSE.'
import os
import unittest
from cltk.corpus.greek.beta_to_unicode import Replacer
from cltk.corpus.greek.tlgu import TLGU
from cltk.utils.file_operations imp... |
"""Unit tests for CLTK"""
__author__ = 'Kyle P. Johnson <kyle@kyle-p-johnson.com>'
__license__ = 'MIT License. See LICENSE.'
import unittest
from cltk.corpus.common.compiler import Compile
from cltk.corpus.greek.beta_to_unicode import Replacer
from cltk.stem.latin.j_and_v_converter import JVReplacer
from cltk.tag.po... |
from __future__ import absolute_import, unicode_literals
from django.contrib.auth import get_user_model
from django.contrib.auth.models import Permission
from django.core.urlresolvers import reverse
from django.test import TestCase
from django.utils.text import capfirst
from wagtail.contrib.settings.registry import S... |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compli... |
# coding: utf-8
# maposmatic, the web front-end of the MapOSMatic city map generation system
# Copyright (C) 2009 David Decotigny
# Copyright (C) 2009 Frédéric Lehobey
# Copyright (C) 2009 Pierre Mauduit
# Copyright (C) 2009 David Mentré
# Copyright (C) 2009 Maxime Petazzoni
# Copyright (C) 2009 Thomas Petazzoni... |
#!/usr/bin/env python3
from lxml import etree
from collections import OrderedDict
from wand.drawing import Drawing
from wand.image import Image
from wand.font import Font
from wand.color import Color
import base64
import cgi
import cgitb
import pydoc
import sys
import string
import random
import datetime
import co... |
import sys
import os
import anydbm
import unittest
import tempfile
from argparse import Namespace
from xclib.dbmops import perform
from xclib.tests.iostub import iostub
class TestDBM(unittest.TestCase, iostub):
@classmethod
def setup_class(cls):
global dbname, dbfile, dirname
dirname = tempfil... |
#!/usr/bin/env python
import logging
import os
import pickle
import socket
import struct
import time
_module_instance = None
__version__ = "0.3.3"
default_graphite_pickle_port = 2004
default_graphite_plaintext_port = 2003
default_graphite_server = 'graphite'
log = logging.getLogger(__name__)
class GraphiteSendExcep... |
import os
import imp
import inspect
import time
import sys
import traceback
import commands
import threading
import json
import pdb
import pprint
from datetime import datetime
from collections import defaultdict
from core.models import *
from django.db.models import F, Q
from django.db import connection
from django.d... |
"""
Parsers
"""
import ujson
from rest_framework import parsers
from rest_framework.exceptions import ParseError
from rest_framework_json_api import utils, renderers, exceptions
class JSONParser(parsers.JSONParser):
"""
A JSON API client will send a payload that looks like this:
{
"data"... |
# Copyright 2014 OpenStack Foundation
#
# 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... |
# Copyright (C) 2013 Google Inc., authors, and contributors <see AUTHORS file>
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
# Created By: mouli@meics.org
# Maintained By: dan@reciprocitylabs.com
from flask import current_app, request
import ggrc_workflows.models as models
from ggrc.n... |
# -*- coding: utf-8 -*-
# pylint: disable=bad-continuation, too-few-public-methods
""" CLI commands.
"""
# Copyright © 2015 Jürgen Hermann <jh@web.de>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the Li... |
from __future__ import annotations
import argparse
import codecs
import grp
import itertools
import logging
import os
import pwd
import typing
from contextlib import closing
from dataclasses import dataclass
from datetime import datetime, timedelta, timezone
from typing import Any, Callable, Dict, Iterable, Optional, T... |
# =============================================================================
# json_rpc.py
#
# This file implements the JSON-RPC frontent.
#
# December 2015
#
# Copyright (c) 2015 by cisco Systems, Inc.
# All rights reserved.
# =============================================================================
import jso... |
#!/usr/bin/env python
"""
Minor version changes:
- cleaned up
Input:
- genbank file
- dictionary
- specific features : 16S, 5S
- upstream, downstream widths
Output:
-dir containing DNA fastas in their
"""
# import re
import os
# import csv
# import subprocess
import datetime
import time
import argparse
import sys
fr... |
""" module to run pylint """
import os
PYLINT_CMD = "PYTHONPATH=%s pylint --rcfile=%s -f parseable -r no -dI %s"
PYLINT_FAIL_MSG = "Rejecting due to increased pylint score: %s %s"
class Pylint(object):
""" wrapper class around pylint """
def __init__(self, modules, config, path='.'):
self.modules = ... |
"""
test_core.py
Created by Kang Zhang on 2009-08-09
"""
import unittest
import os
import sys
import tempfile
import shutil
import subprocess
import keyring.backend
import keyring.core
import keyring.util.platform
PASSWORD_TEXT = "This is password"
PASSWORD_TEXT_2 = "This is password2"
KEYRINGRC = "keyringrc.cfg"
c... |
'''
Navigation Drawer
=================
`Material Design spec page <https://material.io/guidelines/patterns/navigation-drawer.html>`_
API
---
'''
from kivy.lang import Builder
from kivy.metrics import dp
from kivy.properties import StringProperty, ObjectProperty, NumericProperty, ListProperty, BooleanProperty,\
... |
#!/usr/bin/env python
# Copyright 2017 Google, 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... |
class ValidateException(Exception):
pass
class BaseValidator(object):
def __init__(self):
self.empty_values = []
def prepare_value(self, value):
return value
def to_python(self, value):
return value
def is_valid(self,value):
return False
def validate(self, v... |
# Copyright (c) 2014, The MITRE Corporation. All rights reserved.
# See LICENSE.txt for complete terms.
import os
from collections import defaultdict
from lxml import etree
class XmlSchemaValidator(object):
NS_XML_SCHEMA_INSTANCE = "http://www.w3.org/2001/XMLSchema-instance"
NS_XML_SCHEMA = "http://www.w3.or... |
# -*- coding: utf-8 -*-
# See LICENSE.txt for licensing terms
#$HeadURL$
#$LastChangedDate$
#$LastChangedRevision$
__docformat__ = 'reStructuredText'
import sys
import os
import tempfile
import re
from os.path import abspath, dirname, expanduser, join
from string import ascii_lowercase
from urlparse import urljoin, u... |
#!/usr/bin/env python
import pysam
import os
import sys
import argparse
from Bio import SeqIO
from Bio import Restriction
def parse_args():
"""Pass command line arguments"""
parser = argparse.ArgumentParser(description='Remove PCR duplicates from bam file')
#input files
parser.add_argument('-i', '--inp... |
# 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.
from master import master_config
from master.factory import chromium_factory
defaults = {}
helper = master_config.Helper(defaults)
B = helper.Builder
F... |
# -*- Mode: Python -*-
import os
import time
execfile ('util/clean.py')
os.system ('../svn2cl-0.12/svn2cl.sh')
os.chdir ('..')
tarball = 'irken.%s.tar.gz' % (time.strftime ('%y%m%d'),)
# COPYFILE_DISABLE is a hack to turn off storing resource forks in Leopard.
os.system ('COPYFILE_DISABLE=true tar --exclude .svn -zcv... |
"""
Classes providing GUI windows for PlotGroups, allowing sets of related plots
to be displayed.
$Id$
"""
__version__='$Revision$'
import copy
from inspect import getdoc
from math import floor
import ImageTk
import Pmw
import bwidget
import Tkinter, _tkinter
from Tkinter import Frame, TOP, YES, BOTH, BOTTOM, X,... |
#
# Copyright SAS Institute
#
# 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
#Find_gcdt.py
# Find a common step size dt of a timeseries.
import numpy as np
import decimal
def gcdt(ts, dp=False):
"""Find the greatest common step size dt.
inputs:
ts - the timeseries for which to find the step dt.
dp - the number of decimal places accuracy required
... |
# -*- coding: utf-8 -*-
from django.contrib import messages
from django.shortcuts import get_object_or_404, redirect
from django.template.response import TemplateResponse
from django.utils.translation import ugettext as _
from django.views.decorators.http import require_POST
from ..util import JSONResponse
from . impo... |
import itertools
import numpy
import re
import sympy
from hermite_helper import INT_TYPE_DEF, hnf_col, hnf_row, normal_hnf_col
from sympy_helper import expressions_to_variables, unique_array_stable, monomial_to_powers
class ODESystem(object):
''' A class which represents a system of differential equations '''
... |
import logging
from datetime import datetime
clog = logging.getLogger('console_logger')
class Enum(object):
__name__= "Enum"
def __init__(self, **enums):
self.enums = enums
def __getattr__(self, item):
return self.enums[item]
def __iter__(self):
return self.enums.itervalues(... |
import sys, os
if len(sys.argv) > 1 and sys.argv[1] == '--debug':
sys.path.insert(0, os.path.normpath(os.getcwd() + "/.."))
from sharppy.viz import SkewApp
from PySide.QtCore import *
from PySide.QtGui import *
from PySide.QtWebKit import *
import datetime as date
import numpy as np
import sys
# Create an appli... |
import logging
import arrow
import datetime
import os
import json
import boto
import requests
from collections import Counter
from collections import defaultdict
import flask
# these imports need to be here for sqlalchemy
from totalimpactwebapp import snap
from totalimpactwebapp import metric
from totalimpactwebapp im... |
import time
from twisted.internet import defer, reactor
from ooni import errors as e
from ooni.settings import config
from ooni import otime
class BaseTask(object):
_timer = None
_running = None
def __init__(self):
"""
If you want to schedule a task multiple times, remember to create f... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.