text stringlengths 12 6.59M |
|---|
import sublime
import sublime_plugin
import io
import os
import subprocess
import base64
import tempfile
import mdpopups
import re
PLANTUML = 'Packages/SublimeRandomCrap/plantuml.jar'
def packages_path(pth):
"""Get packages path."""
return os.path.join(os.path.dirname(sublime.packages_path()), os.path.normp... |
#!/usr/bin/env python
"""Ninja toolchain abstraction"""
import sys
import os
import subprocess
import platform
import random
import string
import json
import zlib
import version
import android
import xcode
def supported_toolchains():
return ['msvc', 'gcc', 'clang', 'intel']
def supported_architectures():
return... |
# encoding: utf-8
# Copyright (c) Uncle Sam
import json
import math
import numpy as np
import pymatgen as pmg
import cage.utils as utils
import pymatgen.symmetry.analyzer as syman
from itertools import combinations
from monty.io import zopen
from monty.json import MSONable
from pymatgen.core.structure import Molecul... |
import unittest
import inspect
class Calculator:
def __init__(self):
self._accumulator = 0
self._current = 0
self._newOp = False
def display(self):
return str( self._current )
def pressDigit(self, digit):
try:
theDigit = int(digit)
if(not... |
# vim: set expandtab sw=4 ts=4:
'''
Interface to Travis CI API.
Copyright (C) 2014-2015 Dieter Adriaenssens <ruleant@users.sourceforge.net>
This file is part of buildtimetrend/python-lib
<https://github.com/buildtimetrend/python-lib/>
This program is free software: you can redistribute it and/or modify
it under the ... |
# vim: set expandtab sw=4 ts=4:
"""
Interface to Travis CI API.
Copyright (C) 2014-2015 Dieter Adriaenssens <ruleant@users.sourceforge.net>
This file is part of buildtimetrend/python-lib
<https://github.com/buildtimetrend/python-lib/>
This program is free software: you can redistribute it and/or modify
it under the ... |
#!/sw/bin/python2.5
from rocket_backend import *
from time import time
from time import sleep
points = []
manager = RocketManager()
manager.acquire_devices()
try:
rocket = manager.launchers[0]
except IndexError:
print "No rocket launchers"
exit(1)
DOWN = 0
UP = 1
LEFT = 2
RIGHT = 3
def wait_for(direct... |
#!/usr/bin/env python
"""calicoctl
Usage:
calicoctl master --ip=<IP>
[--etcd=<ETCD_AUTHORITY>]
[--master-image=<DOCKER_IMAGE_NAME>]
calicoctl node --ip=<IP>
[--etcd=<ETCD_AUTHORITY>]
[--node-image=<DOCKER_IMAGE_NAME>]
calicoctl status [--etc... |
import subprocess
def get_ansible_version():
"""
Return Ansible version installed.
"""
try:
proc = subprocess.Popen(['ansible', '--version'], stdout=subprocess.PIPE)
result = proc.communicate()[0]
stripped_result = result.lower().replace('ansible', '').strip()
return str... |
import argparse
import glob
import os
import pathlib
import re
import shutil
import subprocess
import sys
import zipfile
# A script to execute a main class of a Maven artifact
# which is available locally or from Maven Central.
#
# Works using the maven-dependency-plugin to stash the artifact
# and its deps to a tempo... |
import os
import AutoNetkit
import AutoNetkit.config as config
from pkg_resources import resource_filename
import logging
LOG = logging.getLogger("ANK")
import difflib
def test_dumps():
master_dir = (resource_filename(__name__, "comparisons"))
inet = AutoNetkit.internet.Internet("multias", netkit=True)
in... |
# 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, ... |
import os
import AutoNetkit
import AutoNetkit.config as config
from pkg_resources import resource_filename
import logging
LOG = logging.getLogger("ANK")
import difflib
def test_dumps():
master_dir = (resource_filename(__name__, "comparisons"))
inet = AutoNetkit.internet.Internet("multias", netkit=True)
in... |
import sys
from twisted.internet import defer, task
from twisted.internet.endpoints import clientFromString
from twisted.python.failure import Failure
from twisted.python import usage, log
import click
import txtorcon
from . import carml_readme
from . import carml_check_pypi
from . import carml_stream
from . import ... |
# 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 python2
import imaplib
import pynotify
from time import sleep
from os import getenv
from io import open
from re import compile as regex
sources = []
timeout = 10000
checkInterval = 60
class IncompleteSource(Exception):
def __init__(self, id, value):
self.id = id
self.va... |
#coding=utf-8
import os
from collections import OrderedDict
import tkinter as tk
from tkinter import ttk
import tkFileDialog as tkfd
import tkMessageBox as tkmb
from .frames import TraceableText, NumericSpinbox
from .frames.match import *
from .frames.network import *
from .frames.team import *
from .frames.translat... |
import os
import subprocess
import time
from django.conf import settings
from django.contrib.staticfiles.finders import find as static_finder
import jinja2
from jingo import register
try:
from build import BUILD_ID_CSS, BUILD_ID_JS, BUILD_ID_IMG, BUNDLE_HASHES
except ImportError:
BUILD_ID_CSS = BUILD_ID_JS ... |
#
# Copyright (C) 2015 Satoru SATOH <ssato at redhat.com>
#
import os.path
import os
import subprocess
import unittest
import jinja2_cli.cli as TT
import jinja2_cli.tests.common as C
CLI_SCRIPT = os.path.join(C.selfdir(), "..", "cli.py")
def run(args=[]):
"""
:throw: subprocess.CalledProcessError if someth... |
import copy
import pandas as pd
import requests
from requests import Request
from six.moves.urllib.parse import urlencode
import datetime
try:
import shipane_sdk
except:
pass
'''选择规则组合成一个量化策略'''
def select_strategy(context):
'''
策略选择设置说明, 策略由以下步骤规则组合,组合而成:
1.持仓股票的处理规则
2.调仓条件判断规则
3.Query选股规则... |
"""distutils.ccompiler
Contains CCompiler, an abstract base class that defines the interface
for the Distutils compiler abstraction model."""
# created 1999/07/05, Greg Ward
__revision__ = "$Id$"
import sys, os
from types import *
from copy import copy
from distutils.errors import *
from distutils.spawn import spaw... |
# Copyright 2013 Clemson University
#
# This file is part of python-anyvcs.
#
# python-anyvcs 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 l... |
# -*- coding: utf-8 -
"""Event driven concurrent framework for Python"""
import os
from .utils.version import get_version
VERSION = (1, 3, 6, 'alpha', 0)
__version__ = version = get_version(VERSION)
DEFAULT_PORT = 8060
ASYNC_TIMEOUT = None
SERVER_NAME = 'pulsar'
JAPANESE = b'\xe3\x83\x91\xe3\x83\xab\xe3\x82\xb5\x... |
#!/usr/bin/env python
import random
import math
cups = {}
torpvalue = -1
bdienst = 0
class Encounter:
def __init__(self, type, nation, tons, defense, asw):
self.type = type
self.nation = nation
self.tons = tons
self.defense = defense
self.asw = asw
self.visible = False
self.dilige... |
from __future__ import unicode_literals
from __future__ import absolute_import
import os
import logging
import collections
import urllib
from datetime import datetime, timedelta
from flask import (
Flask, render_template, abort, url_for,
Response, stream_with_context, redirect,
request
)
from pypuppe... |
from flask import Flask
import requests
import os
import re
import json
import urllib
import sys
sys.stdout = sys.stderr
app = Flask('hurtle-cc-api')
uri = os.environ.get('URI', False)
namespace = os.environ.get('NAMESPACE', False)
if not uri:
raise AttributeError('CC not configured properly! no URI found!')
if ... |
def cdfPacs1d(obsid, datadir, outdir, objname, aper_size=31.8):
"""
obsid = [obsid1, obsid2]
outdir: The output directory for the source. e.g. /CDF_archive/BHR71/
"""
import numpy as np
# to avoid X server error
import matplotlib as mpl
mpl.use('Agg')
from astropy.io import ascii, ... |
from parser import Parser
from scrapy import log
from scrapy.http import Request
from scrapy.selector import Selector
from FourmiCrawler.items import Result
"""
This parser will manage searching for chemicals through the ChemsSpider API,
and parsing the resulting ChemSpider page.
The token required for the API should... |
#!/usr/bin/env python
# -*- coding: Latin-1 -*-
""" Class to deal with Complex EOF
"""
import numpy
import numpy as np
from numpy import ma
from UserDict import UserDict
def ceof2D(data):
""" Estimate the complex EOF on a 2D array.
Time should be the first dimension, so that the PC (eigenvalues) will
... |
import argparse
import sys
import os
# Yaml for script parsing
import yaml
from yaml.composer import Composer
from yaml.constructor import Constructor
# Jinja2 for templating & code generation
import jinja2
class bcolors:
HEADER = '\033[95m'
OKBLUE = '\033[94m'
OKGREEN = '\033[92m'
WARNING = '\033[9... |
"""
Usage: pl-py2deb [OPTIONS] -- PIP_ACCEL_ARGS [PIP_ACCEL_OPTIONS]
Supported options:
-c, --config=FILE override the default configuration file
-p, --print-deps prints a valid value for the `Depends` line of a
debian control file with the package names and
pinn... |
# Copyright (c) 2012, GPy authors (see AUTHORS.txt).
# Licensed under the BSD 3-clause license (see LICENSE.txt)
import numpy as np
from scipy.special import gammaln, digamma
from ...util.linalg import pdinv
from domains import _REAL, _POSITIVE
import warnings
import weakref
class Prior(object):
domain = None
... |
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
# Copyright 2011-2016, Nigel Small
#
# 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
#
# Unle... |
from __future__ import unicode_literals
import logging
from django import forms
try:
from django.apps import apps
except ImportError:
# django.apps is not available until Django 1.7
apps = None
from django.db.models import get_model, ObjectDoesNotExist
from django.contrib.admin.widgets import AdminFileWid... |
# -*- coding: utf-8 -*-
"""
Created on Mon Apr 30 10:29:42 2012
@author: Muenker_2
"""
#
# Copyright (c) 2011 Christopher Felton, Christian Münker
#
# 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 F... |
import hashlib
import os
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
Base = declarative_base()
from .models import ImageFile
from .util import Util
def ScanFiles(session, FOLDER):
ut = Util()
for root, dirs, files in o... |
#!/usr/bin/env python
import atexit
import errno
import os
import re
import sys
import tempfile
class SettingCombinationError(StandardError):
"""You have tried to combine settings which are not combinable."""
class Locker(object):
"""
Filesystem-based atomic locking.
Please note that this class is not desi... |
# Copyright (C) 2016 Antoine Carme <Antoine.Carme@Laposte.net>
# All rights reserved.
# This file is part of the Python Automatic Forecasting (PyAF) library and is made available under
# the terms of the 3 Clause BSD license
import pandas as pd
import numpy as np
class cModelControl:
def __init__(self):
... |
# JSOn service
from django.http import HttpResponse
from pprint import pprint
import keystoneclient.v2_0.client as ksclient
import glanceclient,yaml
from django.views.decorators.csrf import csrf_exempt
from imagedist.models import site,credential
from imagedist.models import user
import json,datetime,threading,time,... |
#!/usr/bin/env python3
import sys
from argparse import ArgumentParser
import os
import pyparsing as pp
import hashlib
import json
import pprint
def lexical_analysis(src):
string = pp.Regex('[a-zA-Z0-9_{}"=+\-*/\.:; a-zA-Zぁ-ゔゞァ-・ヽヾ゛゜ー一-龯]+')
blank = pp.LineStart() + pp.LineEnd()
start = '['
end = ']'... |
import _pybinding
import numpy as _np
import matplotlib.pyplot as _plt
import pybinding.plot.utils as pltutils
from pybinding.utils import with_defaults
class Polygon(_pybinding.Polygon):
"""Shape defined by a list of vertices
Parameters
----------
*vertices : tuple
Polygon vertices. Must be ... |
import os
import sys
from pkg_resources import resource_filename
from functools import partial
import numpy
import matplotlib
from matplotlib import pyplot
import seaborn
import pandas
from statsmodels.tools.decorators import (
resettable_cache, cache_readonly
)
import wqio
from . import dataAcce... |
import logging
import logging.config
import threading
import time
import math
import traceback
import os
from ambercommon.common import runtime
from amberclient.common.listener import Listener
from amberdriver.drive_support import drive_support_logic
from amberdriver.tools import config, bound_sleep_interval
__au... |
# -*- coding: utf-8 -*-
"""This module contains pybooru object class."""
# urllib2 imports
from urllib import urlencode
from urllib2 import urlopen
from urllib2 import URLError
from urllib2 import HTTPError
# urlparse imports
from urlparse import urlparse
# hashlib imports
import hashlib
try:
# simplejson impo... |
import sys
import pygit2
import os.path
import unicodedata
from datetime import datetime, tzinfo, timedelta
import time
import email
import email.utils
import subprocess
import urllib
import re
import cPickle
import cProfile
old_path = sys.argv[1]
new_path = sys.argv[2]
if len(sys.argv) == 4:
hg_map_file = sys.a... |
"""
Augmenters that somehow change the size of the images.
Do not import directly from this file, as the categorization is not final.
Use instead ::
from imgaug import augmenters as iaa
and then e.g. ::
seq = iaa.Sequential([
iaa.Resize({"height": 32, "width": 64})
iaa.Crop((0, 20))
])
... |
"""A simple wrapper for Asterisk call files."""
from shutil import move
from time import mktime
from pwd import getpwnam
from tempfile import mkstemp
from os import path, chown, utime, fdopen
from path import path
from .call import Call
from .actions import Application, Context
from .errors import *
class CallFil... |
"""
>>> from blaze.expr.table import TableSymbol
>>> from blaze.compute.python import compute
>>> accounts = TableSymbol('{name: string, amount: int}')
>>> deadbeats = accounts['name'][accounts['amount'] < 0]
>>> data = [['Alice', 100], ['Bob', -50], ['Charlie', -20]]
>>> list(compute(deadbeats, data))
['Bob', 'Char... |
# -*- coding: utf-8 -*-
"""
Description: OPML parsing
Copyright (c) 2013—2014 Andrea Peltrin
Portions are copyright (c) 2013 Rui Carmo
License: MIT (see LICENSE.md for details)
"""
from xml.etree import ElementTree
from ..models import *
from coldsweat import log, favicon
from ..fetcher import add_subscription, add_... |
# Copyright 2015, Oliver Nagy <olitheolix@gmail.com>
#
# This file is part of Azrael (https://github.com/olitheolix/azrael)
#
# Azrael 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... |
from canvas_object import CanvasObject
from util import combine_kwargs
from paginated_list import PaginatedList
from exceptions import RequiredFieldMissing
class Course(CanvasObject):
def __str__(self):
return "%s %s %s" % (self.id, self.course_code, self.name)
def conclude(self):
"""
... |
# coding: utf-8
from pupa.scrape import Scraper
from utils import lxmlize, CanadianLegislator as Legislator
from urlparse import urljoin
import re
COUNCIL_PAGE = 'http://www.cityofkingston.ca/city-hall/city-council/mayor-and-council'
class KingstonPersonScraper(Scraper):
def get_people(self):
page = lxmliz... |
#
# Copyright (c) 2015 Cossack Labs 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... |
import re
_tinkoff_title_parser = re.compile(r'^([\w\s]+): .+', re.UNICODE)
_ya_news_author_name_parser = re.compile(r'.+yandsearch\?cl4url=.*?([\w.-]+).+', re.UNICODE)
def parse_tinkoff_author_name(entry, author_name):
if author_name and author_name != 'journal@tinkoff.ru':
return author_name
title... |
from concurrent import futures
import sys
import time
import grpc
import kv_pb2
import kv_pb2_grpc
from grpc_health.v1.health import HealthServicer
from grpc_health.v1 import health_pb2, health_pb2_grpc
class KVServicer(kv_pb2_grpc.KVServicer):
"""Implementation of KV service."""
def Get(self, request, con... |
# Copyright 2015, Oliver Nagy <olitheolix@gmail.com>
#
# This file is part of Azrael (https://github.com/olitheolix/azrael)
#
# Azrael 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... |
from datashape import *
from datashape.predicates import iscollection
import itertools
from toolz import curry
from .expressions import *
from .expressions import Field, Map
from .arithmetic import maxshape, Arithmetic, Add
from .math import Math, sin
from .datetime import DateTime
__all__ = ['broadcast', 'Broadcast'... |
# Copyright (C) 2015-2017 Chris Lalancette <clalancette@gmail.com>
# This library 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 of the License.
# This library is distributed in the ho... |
# Program to convert text with ANSI escape sequences to HTML.
#
# Author: Peter Odding <peter@peterodding.com>
# Last Change: May 17, 2017
# URL: https://coloredlogs.readthedocs.io
"""Convert text with ANSI escape sequences to HTML."""
# Standard library modules.
import codecs
import os
import pipes
import re
import ... |
import os, subprocess
def getLength(filename):
result = subprocess.Popen(["ffprobe", filename],stdout = subprocess.PIPE, stderr = subprocess.STDOUT).communicate()[0].decode('UTF-8')
for resultline in result.rsplit(sep="\n"): #quebra o resultado em linhas
if 'Duration' in resultline:
#print (re... |
from itertools import combinations
# Recebe dicionario de aulas de estrutura:
# { CLASS_ID:{
# T:{
# CLASS_T1,
# CLASS_T...
# },
# TP:{
# CLASS_TP...
# },
# ...
# }, ...
# }
# Devolve array de todas as combinacoes de turmas possiveis
# Refere-se aos elemen... |
# Copyright (C) 2015-2019 Chris Lalancette <clalancette@gmail.com>
# This library 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 of the License.
# This library is distributed in the ho... |
import os
import struct
import tracer
import random
import logging
from itertools import groupby
import binascii
import claripy
import angr
from angr.state_plugins.trace_additions import ChallRespInfo, ZenPlugin
from angr.state_plugins.preconstrainer import SimStatePreconstrainer
from angr.state_plugins.posix import ... |
""" Note that the calibration starts from the LBL files, not the IMG !!! """
from __future__ import division, print_function
import logging
import os
from os.path import join as pjoin
from pathlib import Path
import numpy as np
from pysis import IsisPool
from pysis.exceptions import ProcessError
from pysis.isis impo... |
import os
import tracer
import random
import claripy
from itertools import groupby
from operator import itemgetter
from .harvester import Harvester
from .pov import ColorguardExploit, ColorguardNaiveExploit
from rex.trace_additions import ChallRespInfo, ZenPlugin
from simuvex import s_options as so
from simuvex.plugins... |
from collections import defaultdict, OrderedDict
from datetime import datetime, timedelta
import dateutil
import twilio.twiml
from flask import Blueprint, Response, current_app, render_template, abort, request, jsonify
from werkzeug.datastructures import Headers
from sqlalchemy.sql import func, extract, distinct, cas... |
import re
from collections import defaultdict
graphviz_items = []
vindex_count = -1
def new_index():
global vindex_count
vindex_count += 1
return vindex_count
def init(random_seed=None): pass
class SimpleConcreteDim(object):
def __init__(self, nrows, ncols, inferred):
self.nrows = nrows
self.ncols =... |
# CAN bus device mapping tool
from __future__ import print_function
import sys
import argparse
import sets
import re
import time
import signal
import importlib
import traceback
import cancat
import cancat.uds
import cancat.uds.ecu
import cancat.uds.utils
import cancat.utils.types
from cancat.utils import log
c = No... |
#!/usr/bin/env python
"""Commands taken verbatim from chap. 2 of
Deep Learning with Python by François Chollet."""
### Import the MNIST Handwritten Digit Dataset
from keras.datasets import mnist
(train_images, train_labels), (test_images, test_labels) = mnist.load_data()
# Training Data:
print('\ntrain_images.... |
import numpy, pdb
import tabular_predDB.python_utils.data_utils as du
import tabular_predDB.python_utils.xnet_utils as xu
import tabular_predDB.LocalEngine as LE
import tabular_predDB.cython_code.State as State
from sklearn import metrics
def truth_from_permute_indices(data_inverse_permutation_indices, num_rows,num_c... |
# candidate/views_admin.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
from .controllers import candidates_import_from_master_server, candidates_import_from_sample_file, \
candidate_politician_match, find_duplicate_candidate, \
retrieve_candidate_photos, retrieve_candidate_politician_match_op... |
from pymol import cmd, stored
from pymol.cgo import *
from PIL import Image
from tempfile import mkdtemp
from shutil import rmtree
from math import sin,cos,pi,sqrt,log,acos,degrees,acos,atan2,floor
import os.path
import time
import string
from cgkit.cgtypes import *
import colorsys
import csv
from axes import *
import ... |
_version_ = "0.0.0"
_identifier_ = "richo@psych0tik.net:github:%s" % (_version_)
from groundstation.gref import Gref
from groundstation.objects.root_object import RootObject
from groundstation.objects.update_object import UpdateObject
from groundstation import logger
log = logger.getLogger(__name__)
__doc__ = """\
... |
from django.contrib.auth.models import User, Group
from candidates.models import (
TRUSTED_TO_MERGE_GROUP_NAME,
TRUSTED_TO_LOCK_GROUP_NAME,
TRUSTED_TO_RENAME_GROUP_NAME,
RESULT_RECORDERS_GROUP_NAME,
)
from official_documents.models import DOCUMENT_UPLOADERS_GROUP_NAME
class TestUserMixin(object):
... |
"""
### Usage: ctinit [projname] [-r] [--plugins=P1|P2|P3] [--cantools_path=PATH] [--web_backend=BACKEND]
### Options:
-h, --help show this help message and exit
-p PLUGINS, --plugins=PLUGINS
which plugins would you like to use in your project?
-c CANTOOLS_PATH, --canto... |
import sys, argparse, ConfigParser
sys.path.append("../common")
from tornado.wsgi import WSGIContainer
from tornado.httpserver import HTTPServer
from tornado.ioloop import IOLoop
from tornado.log import enable_pretty_logging
import flask
import flask.ext.sqlalchemy
import flask.ext.restless
from flask.ext.compress im... |
# Copyright 2016 DGraph Labs, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... |
import json
from flask import Blueprint, jsonify, url_for, abort, flash, redirect, request, \
render_template
from flask_login import current_user
from pycroft.model import session
from pycroft.lib.task import cancel_task, task_type_to_impl
from pycroft.model.facilities import Building
from pycroft.model.task im... |
from __future__ import absolute_import
import time
from copy import deepcopy
from warnings import filterwarnings, warn
from carto.kuvizs import KuvizManager
from carto.exceptions import CartoException
from .source import Source
from ..auth import get_default_credentials
from ..utils.columns import normalize_name
fro... |
#------------------------------------------------------------------------------
# Copyright (c) 2005, Enthought, Inc.
# All rights reserved.
#
# This software is provided without warranty under the terms of the BSD
# license included in enthought/LICENSE.txt and may be redistributed only
# under the conditions describe... |
""" Module for utilities such as emailing, password reset, etc """
import smtplib
import bcrypt
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from email.utils import formataddr
import api
from api.common import check, validate, safe_fail, WebException
from voluptuous import Requ... |
# No shebang line, this module is meant to be imported
#
# Copyright 2013 Oliver Palmer
#
# 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
#
# U... |
"""
pyhik.hikvision
~~~~~~~~~~~~~~~~~~~~
Provides api for Hikvision events
Copyright (c) 2016-2017 John Mihalic <https://github.com/mezz64>
Licensed under the MIT license.
Based on the following api documentation:
System:
http://oversea-download.hikvision.com/uploadfile/Leaflet/ISAPI/HIKVISION%20ISAPI_2.0-IPMD%20Servi... |
"""Process raw data into processed data
Performs batch queue operations to run pax.
"""
import datetime
import hashlib
import subprocess
import sys
import os
from collections import defaultdict
import pax
import hax
import checksumdir
from pymongo import ReturnDocument
from cax import qsub, config
from cax.task imp... |
# B isotope fns
import numpy as np
from cbsyst.helpers import ch
from .boron import chiB_calc
def alphaB_calc(**kwargs):
"""
Klochko alpha for B
"""
return 1.0272
def alphaB_calc(TempC):
"""
Temperature-sensitive alpha from Honisch et al, 2008
"""
# return 1.0293 - 0.000082 * T... |
import csv
import datetime
import gzip
import itertools
import os
import tarfile
import numpy as np
import requests
from pyhis import util
NCDC_GSOD_DIR = os.path.join(util._get_pyhis_dir(), 'ncdc_gsod')
NCDC_GSOD_STATIONS_FILE = os.path.join(NCDC_GSOD_DIR, 'ish-history.csv')
NCDC_GSOD_START_YEAR = 1929
def downlo... |
import RDF
import datetime
NS_CC='http://creativecommons.org/ns#'
NS_DC='http://purl.org/dc/elements/1.1/'
NS_DCQ='http://purl.org/dc/terms/'
JURI_RDF_PATH='./license.rdf/rdf/jurisdictions.rdf'
LIC_RDF_PATH ='./license.rdf/license_rdf/'
# FIXME: Use package.requires for JURI_RDF_PATH
class RdfHelperException(Exceptio... |
import csv
import datetime
import gzip
import itertools
import os
import tarfile
import numpy as np
import requests
from pyhis import util
NCDC_GSOD_DIR = os.path.join(util._get_pyhis_dir(), 'ncdc_gsod')
NCDC_GSOD_STATIONS_FILE = os.path.join(NCDC_GSOD_DIR, 'ish-history.csv')
NCDC_GSOD_START_YEAR = 1929
def downlo... |
import cStringIO as StringIO
import datetime
import logging
import isodate
from lxml.etree import iterparse
import requests
INSTANTANEOUS_URL = "http://waterservices.usgs.gov/nwis/iv/"
DAILY_URL = "http://waterservices.usgs.gov/nwis/dv/"
NS = "{http://www.cuahsi.org/waterML/1.1/}"
# configure logging
LOG_FORMAT = '... |
try:
from browser import window, document
from javascript import JSObject, JSConstructor
from ggame import *
jq = window.jQuery
if not jq(".inputScreen").length:
jq("body").append('<div class = "inputScreen" style = "position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0,0,0,0.2... |
import web
class PageHandler(web.HTTPHandler):
directory = '.'
page = 'index.html'
def format(self, page):
return page
def do_get(self):
self.response.headers.set('Content-Type', 'text/html')
with open(self.directory + '/' + self.page, 'r') as file:
page = file.r... |
try:
from browser import window, document
from javascript import JSObject, JSConstructor
from ggame import *
jq = window.jQuery
if not jq(".inputScreen").length:
jq("body").append('<div class = "inputScreen" style = "position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0,0,0,0.2... |
#!/usr/bin/env python3
# Copyright (c) 2014 Kontron Europe GmbH
#
# This library 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 2.1 of the License, or (at your option) any later vers... |
from __future__ import division
"""
Author: Keith Bourgoin
"""
__license__ = """
Copyright 2015 Parse.ly, 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/LIC... |
from .utils import PyKEArgumentHelpFormatter
import math
import numpy as np
from astropy.io import fits as pyfits
from scipy.optimize import leastsq
from copy import copy
from tqdm import tqdm
from . import kepio, kepmsg, kepkey, kepstat, kepfunc
__all__ = ['kepextract']
def kepextract(infile, outfile=None, qual=Fa... |
#!/usr/bin/python
import copy
import gyp.common
import optparse
import os.path
import re
import shlex
import subprocess
# A list of types that are treated as linkable.
linkable_types = ['application', 'executable', 'shared_library']
# A list of sections that contain links to other targets.
dependency_sections = ['d... |
from collections import Counter, defaultdict, Iterable, Sized
from functools import partial, total_ordering, reduce
from itertools import islice, product, chain, starmap, groupby
from math import sqrt, log, ceil
from operator import add
import concurrent.futures
import gzip
import heapq
import io
import json
import log... |
#!/usr/bin/python
# Copyright (c) 2011 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 compiler.ast import Const
from compiler.ast import Dict
from compiler.ast import Discard
from compiler.ast import List
from compi... |
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under th... |
"""
This module queries process memory allocation metrics from the operating
system. It provides a platform independent layer to get the amount of virtual
and physical memory allocated to the Python process.
Different mechanisms are implemented: Either the process stat file is read
(Linux), the `ps` command is execute... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.