text stringlengths 17 737k |
|---|
from __future__ import annotations
from flask import Flask
from abilian.core.models.subjects import Group, User
from abilian.core.sqlalchemy import SQLAlchemy
def test_non_ascii_password():
"""Ensure we can store and test non-ascii password without any
UnicodeEncodeError."""
user = User()
user.set_... |
# Copyright (c) 2015 Ultimaker B.V.
# Cura is released under the terms of the AGPLv3 or higher.
from UM.Qt.QtApplication import QtApplication
from UM.Scene.SceneNode import SceneNode
from UM.Scene.Camera import Camera
from UM.Scene.Platform import Platform
from UM.Math.Vector import Vector
from UM.Math.Quaternion impo... |
import argparse
import sys
import re
import json
import requests
from models import auth
import pdb
import pprint
def create(config, args):
url = config['url'] + "/api/user/"
data = {
"username": args['username'],
"password": args['password'],
"email": args['email'],
}
if args[... |
# -*- coding: utf-8 -*-
# Copyright 2015 OpenMarket Ltd
#
# 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 la... |
from __future__ import absolute_import, print_function, unicode_literals
from kolibri.core.webpack import hooks as webpack_hooks
from kolibri.plugins.base import KolibriPluginBase
class ManagementPlugin(KolibriPluginBase):
""" Required boilerplate so that the module is recognized as a plugin """
pass
class... |
# -*- coding: utf-8 -*-
# Copyright (C) 2012-2015 MUJIN Inc
import copy
from . import planningclient
import logging
log = logging.getLogger(__name__)
class RealtimeRobotControllerClient(planningclient.PlanningControllerClient):
"""mujin controller client for realtimerobot task
"""
_robotname = None # op... |
import time
import subprocess
from subprocess import check_call as call, PIPE;
import unittest
from jbrowse_selenium import JBrowseTest;
class AbstractVolvoxBiodbTest( JBrowseTest ):
data_dir = 'sample_data/json/volvox'
def setUp( self ):
call( "rm -rf sample_data/json/volvox/", shell=True )
... |
#!/usr/bin/env python
#
# extractor.py: extract function names from declarations in header files
#
# ====================================================================
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed wit... |
"""
Emulates exceptions raised by the Redis client, if necessary.
"""
try:
# Prefer actual exceptions to defining our own, so code that swaps
# in implementations does not have to swap in different exception
# classes.
from redis.exceptions import RedisError, ResponseError, WatchError
except ImportErro... |
"""
Field definitions for the Incentive Payment Report.
Takes a CommCareUser and points to the appropriate fluff indicators
for each field.
"""
from collections import defaultdict
from corehq.apps.reports.datatables import DTSortType
from custom.opm.constants import get_fixture_data
from custom.opm.utils import numeri... |
#
# Copyright 2018 Analytics Zoo 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... |
#https://www.youtube.com/watch?v=hqijNdQTBH8
def permute1(lst):
if len(lst) == 0:
yield []
elif len(lst) == 1:
yield lst
else:
for i in range(len(lst)):
x = lst[i]
xs = lst[:i]+lst[i+1:]
for p in permute1(xs):
yield [x] + p
def pe... |
#!/usr/bin/python2.5
#
# Copyright 2008 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 applicable... |
#!/usr/bin/python2.5
#
# Copyright 2008 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 applicable... |
#!/usr/bin/python2.5
#
# Copyright 2008 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 applicable... |
#!/bin/env python3
# -*- coding: utf-8 -*-
"""
Provides basic function to read a ContentMine CProject and CTrees into python datastructures.
"""
# import file io
import re
import os
from lxml import etree
import json
from collections import Counter
# import data handling
from bs4 import BeautifulSoup
__author__ =... |
# Copyright 2013 Mirantis, 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 ... |
# Copyright (c) 2011 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Dictionary of configuration types for cbuildbot.
Each dictionary entry is in turn a dictionary of config_param->value.
config_param's:
board -- T... |
"""
The newsletter template tag library
`{% load newsletter %}`
To use the newsletter template tags. It is required
to have jquery.forms.js installed.
This is included with the installation under the `static` directory.
"""
from django import template
from django.core.urlresolvers import reverse
register = templ... |
"""
Jedi is an autocompletion library for Python. It offers additonal
services such as goto / get_definition / pydoc support /
get_in_function_call / related names.
To give you a simple exmple how you can use the jedi library,
here is an exmple for the autocompletion feature:
>>> import jedi
>>> source = '''import js... |
# -*- coding: utf-8 -*-
from os import environ
import flask
from datetime import date
from datetime import datetime
import records
import utils
import filters
app = flask.Flask(__name__)
app.register_blueprint(filters.blueprint)
cache = {}
cache['day'] = date.today()
cache['record'] = records.records_date[str(cach... |
import os
import datetime
from glob import glob
from hashlib import md5
from uuid import uuid4
from mimetypes import guess_type
from zipfile import ZipFile
import users
from urls import get_URL
from fmfile import FMFile
from errors import hellraiser, FMBaseError, FMFileError
class Transfer(object):
"""
The T... |
'''Cluster-related search options'''
from flask import g
from sqlalchemy import (
or_,
sql,
)
from sqlalchemy.orm import joinedload
from .helpers import (
break_lines,
register_handler,
)
from api.location import location_from_string
from api.models import (
db,
AsDomain,
AsDomainProfile,
... |
"""
TODO: Implement other error handlers - http://flask.pocoo.org/docs/0.12/patterns/errorpages/
TODO: Shit-loads of refactoring
TODO: Proper Error Handling of Entries in report_filter()
TODO: Implement logout.html
TODO: Add button to point to rest.html on login page
"""
from flask import Flask, render_template, reque... |
import os
import users
from urls import getURL
from fmfile import FMFile
from errors import hellraiser, FMBaseError, FMFileError
class Transfer():
"""
The Transfer object is the gateway to sending and recieving files through
filemail.com.
:param user: `User` object with valid login status
:param... |
import os
import threading
import time
import pytest
from astropy import units as u
from pocs import hardware
from pocs.camera import create_cameras_from_config
from pocs.core import POCS
from pocs.dome import create_dome_from_config
from pocs.mount import create_mount_from_config
from pocs.observatory import Observa... |
#!/usr/bin/env python2.7
# Copyright (c) 2012 Jonathan Warren
# Copyright (c) 2012 The Bitmessage developers
# Distributed under the MIT/X11 software license. See the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#Right now, PyBitmessage only support connecting to stream 1. It does... |
# Copyright (c) 2014, Guillem Anguera <ganguera@gmail.com>
# All rights reserved.
#
# See LICENSE file for full license.
from . import AWSObject, AWSProperty, Tags
from .validators import integer
class StreamEncryption(AWSProperty):
props = {
'EncryptionType': (basestring, True),
'KeyId': (basest... |
"""Simple TCP sockets.
Each Actor has a TCP IPv4 port/socket that will accept incoming
connections for messages. Each connection from a remote Actor will
accept a single message per connection. The connection is dropped and
re-established for multiple messages; this is less efficient but has
more fairness.
This tra... |
import json
class EntityEncoder(json.JSONEncoder):
def default(self, obj):
# TODO - handle iterables
if isinstance(obj, list) or isinstance(obj, tuple):
return [ self.default(i) for i in obj ]
elif isinstance(obj, dict):
result = {}
for key, value in ... |
import pytest
import numpy as np
from foolbox.gradient_estimators import CoordinateWiseGradientEstimator
from foolbox.gradient_estimators import EvolutionaryStrategiesGradientEstimator
from foolbox.models import ModelWithEstimatedGradients
from foolbox.batch_attacks import GradientAttack as Attack
def test_untarge... |
'''
The MIT License (MIT)
Copyright (c) 2014-2018 William Ivanski
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify... |
import json
import datetime
from unittest.mock import Mock, patch, call
from django.test import TransactionTestCase
from data_refinery_common.job_lookup import Downloaders
from data_refinery_common.models import (
DownloaderJob,
SurveyJob,
SurveyJobKeyValue,
Organism,
Sample
)
from data_refinery_for... |
# Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and Contributors
# imports - standard imports
import gzip
import json
import os
import shlex
import subprocess
import sys
import unittest
import glob
# imports - module imports
import frappe
import frappe.recorder
from frappe.installer import add_to_installed_apps
f... |
# -*- coding: utf-8 -*-
# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4
__author__ = "Ole Christian Weidner"
__copyright__ = "Copyright 2011-2012, Ole Christian Weidner"
__license__ = "MIT"
# Using urlparse from Python 2.5
from bliss.utils import urlparse25 as urlparse
from bliss.saga.Object import... |
# -*- coding: utf-8 -*-
"""
pygments.lexers.math
~~~~~~~~~~~~~~~~~~~~
Lexers for math languages.
:copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import Lexer, RegexLexer, bygroups, include, \
combine... |
import matplotlib.pyplot as plt
from matplotlib.ticker import MaxNLocator
import numpy as np
from threeML.io.plotting.step_plot import step_plot
from threeML.config.config import threeML_config
from threeML.exceptions.custom_exceptions import custom_warnings
class ResidualPlot(object):
def __init__(self,**kwarg... |
"""Pages relating to the jobs app."""
import logging
from braces.views import GroupRequiredMixin
from django.contrib.auth.mixins import LoginRequiredMixin
from django.db.models import Q
from django.http import HttpResponseRedirect
from django.urls import reverse
from django.views import View
from django.views.generi... |
# -*- coding: utf-8 -*-
"""Tools for handling LaTeX."""
# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
from io import BytesIO, open
from base64 import encodestring
import os
import tempfile
import shutil
import subprocess
from IPython.utils.process import find_cm... |
# These are experimental IPython magics, providing quick shortcuts for simple
# tasks. None of these save any data.
# To use, run this in an IPython shell:
# ip = get_ipython()
# ip.register_magics(BlueskyMagics)
import asyncio
from bluesky.utils import ProgressBarManager
from bluesky import RunEngine, RunEngineInter... |
# -*- coding: utf-8 -*-
import asyncio
import uvloop
asyncio.set_event_loop_policy(uvloop.EventLoopPolicy())
# profiling
from pympler import tracker
import time
import re
import traceback
import logging
from random import SystemRandom
random = SystemRandom()
import discord
import josecommon as jcommon
import ext.jo... |
#from __pyjamas__ import debugger
# --------------------------------------------------------------------
# public interface
# flags
I = IGNORECASE = 1 # ignore case
L = LOCALE = 2 # assume current 8-bit locale
U = UNICODE = 4 # assume unicode locale
M = MULTILINE = 8 # make anchors look for newline
S = ... |
"""
---
pymdown.inlinehilite
Inline codehilite variant
This is a modification of the original CodeHilite extension.
It relies on codehilite's config, and adds a processor that
can highlite backtick regions content if it is preceeded with
a language specifier like so:
:::javascript`var test = 0;`
- or ... |
"""
Abstract Engine Class. From this all the engines should inherit
See CrossRef and arXiv for more information.
Things to cover in the docstring:
that all inherited classes should supply:
1) a query_url class attribute and what it should return.
2) a fetch_results method which returns a list of strings (or Result ob... |
""" Module containing the storage services.
Contains the standard :class:`~pypet.storageservice.HDF5StorageSerivce`
as well wrapper classes to allow thread safe multiprocess storing.
"""
__author__ = 'Robert Meyer'
import tables as pt
import tables.parameters as ptpa
import os
import warnings
import time
import has... |
"""Attempt to isolate platform dependencies in one place
Functions:
set_realtime -- Raise the Vision Egg to maximum priority
linux_but_not_nvidia -- Warn that platform is linux, but drivers not nVidia
sync_swap_with_vbl_pre_gl_init -- Try to synchronize buffer swapping and vertical retrace before starting OpenGL
sync... |
from __future__ import division, unicode_literals, print_function
import base64
import copy
import gzip
import os
import operator
import traceback
import random
import signal
import sys
from collections import defaultdict, OrderedDict
from functools import partial
from multiprocessing import Queue, Manager
from string ... |
from datetime import date
import tornado.escape
import tornado.ioloop
import tornado.web
import rethinkdb as r
r.connect( "localhost", 28015).repl()
import json
import urlparse
import random
import string
import itertools
from datetime import datetime
import requests
import os
def handle_query(payload, run=True):
... |
#!/usr/bin/env python
#
# Author: Qiming Sun <osirpt.sun@gmail.com>
# Timothy Berkelbach <tim.berkelbach@gmail.com>
#
import sys
import copy
from functools import reduce
import numpy
import scipy.linalg
import scipy.special
import scipy.optimize
from pyscf import lib
from pyscf.pbc import gto as pbcgto
from py... |
import unicodedata
from PyQt4.QtGui import (
QGridLayout, QTableView, QStandardItemModel, QStandardItem,
QItemSelectionModel, QItemSelection, QFont, QHeaderView, QBrush, QColor
)
from PyQt4.QtCore import Qt, QSize
import numpy
import sklearn.metrics as skl_metrics
import Orange
from Orange.widgets import wid... |
# -*- coding: utf-8 -*-
import logging
import os
from datetime import datetime, date
from dateutil.relativedelta import relativedelta
from django import forms
from django.conf import settings
from django.db import models
from django.db.models import Min, Max, Q
from django.contrib.auth.models import User
import rev... |
# -*- coding: utf-8 -*-
from collections import defaultdict
from datetime import date
from interval import IntervalSet
import logging
from dateutil.relativedelta import relativedelta
from django.http import HttpResponseRedirect, Http404, HttpResponse
from django.db.models import Q
from django.contrib.auth.models impo... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import yaml
from utils import *
def readConfig(configfile, logfile=None, loglevel=None, env=None, logger=None):
""" Read a config file or return the default config """
if not env:
env = os.environ.copy()
default_config = {
# Default... |
# -*- coding: utf-8 -*-
# Copyright 2014, 2015 Metaswitch Networks
#
# 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 ap... |
"""
Wrap the internal caffe C++ module (_caffe.so) with a clean, Pythonic
interface.
"""
from collections import OrderedDict
from itertools import izip_longest
import numpy as np
from ._caffe import Net, SGDSolver
import caffe.io
# We directly update methods from Net here (rather than using composition or
# inherita... |
## Copyright (c) 2012, 2013 Aldebaran Robotics. All rights reserved.
## Use of this source code is governed by a BSD-style license that can be
## found in the COPYING file.
""" Re-implementation of CTest in Python.
Necessary to by-pass some small ctest shortcomings.
"""
import Queue
import datetime
import errno
impo... |
"""
Errors raised during the Twitcher flow.
"""
class AccessTokenNotFound(Exception):
"""
Error indicating that an access token could not be read from the
storage backend by an instance of :class:`twitcher.store.AccessTokenStore`.
"""
pass
class ServiceNotFound(Exception):
"""
Error indi... |
from __future__ import absolute_import
import logging
import os
import hashlib
import yaml
from cassette.http_response import MockedHTTPResponse
log = logging.getLogger("cassette")
def _hash(content):
m = hashlib.md5()
m.update(content)
return m.digest()
class CassetteName(unicode):
"""
A Ca... |
# -*- coding: utf-8 -*-
from control_display.display_utils import run_display_command
from control_display.utils import set_destination_brightness
from django.conf import settings
from django.utils import timezone
from homedisplay.utils import publish_ws
from ledcontroller import LedController
import datetime
import i... |
"""This module contains classes and functions supporting common random numbers.
CEAM has some peculiar needs around randomness. We need to be totally consistent
between branches in a comparison. For example, if a simulant gets hit by a truck
in the base case in must be hit by that same truck in the counter-factual a... |
import os
from unipath import Path
from ..util import admin_emails
from django.conf import global_settings
# Repository root is 4 levels above this file
REPOSITORY_ROOT = Path(__file__).ancestor(4)
# This is the root of the Django project, 'cfgov'
PROJECT_ROOT = REPOSITORY_ROOT.child('cfgov')
V1_TEMPLATE_ROOT = PROJ... |
import csv
import json
import os
import shutil
import socket
import string
import sys
import time
import jsonschema
import M2Crypto
import requests
from letsencrypt.client import acme
from letsencrypt.client import apache_configurator
from letsencrypt.client import challenge
from letsencrypt.client import CONFIG
from... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from werkzeug.datastructures import FileStorage
from flask.ext.security import current_user
from udata import search
from udata.api import api, ModelAPI, ModelListAPI, API
from udata.models import User, FollowUser, Reuse, Dataset, Issue, Discussion
from... |
import unittest
from sbol import *
import random
import string
import os
import sys
#####################
# utility functions
#####################
URIS_USED = set()
RANDOM_CHARS = string.ascii_letters
NUM_FAST_TESTS = 10000
NUM_SLOW_TESTS = 100
TEST_LOCATION = os.path.join(os.path.dirname(os.path.abspath(__file__)... |
from datetime import datetime
from django.test.testcases import TestCase
from corehq.apps.accounting.tests import generator
from corehq.apps.commtrack.tests.util import make_loc
from corehq.apps.domain.models import Domain
from corehq.apps.sms.models import SMS
from corehq.apps.sms.tests.util import setup_default_sms... |
from copy import copy
from typing import Optional
from hdlConvertorAst.hdlAst import iHdlStatement, iHdlObj, HdlIdDef, \
HdlValueId, HdlTypeType, iHdlExpr, HdlStmBlock, HdlStmIf, HdlStmCase, \
HdlStmProcess, HdlStmAssign, HdlModuleDef, HdlModuleDec, \
HdlCompInst, HdlEnumDef
from hdlConvertorAst.hdlAst._st... |
"""
Code for python planner
"""
import blockSim as BlockDet
import twoWayDict as twd
import navigation.nav as nav
from datetime import datetime
import comm.serial_interface as comm
import math
import time
class Planner:
nextSeaLandBlock = [] #list of the next available sea or land block to pick up
nextAirBlock = ... |
'''
A forms system
Build a form template, build a handler for its submission, receive data from end users
'''
import json
import sys
import re
from datetime import datetime
from flask import Blueprint, request, abort, make_response, render_template, flash, redirect, url_for
from flask.ext.login import current_user
f... |
from __future__ import absolute_import, division, print_function
import sys
import numpy as np
from glue.external.qt import QtGui
from vispy import scene, app
from vispy.color import get_colormap, Color
from math import cos, sin, asin, radians, degrees, tan
from vispy.scene.cameras import MagnifyCamera, Magnify1DCame... |
from collections import OrderedDict, Counter, defaultdict, deque
import random
import math
import uuid
import datetime
from flask import Flask, render_template, current_app, Markup, abort, url_for
from flask import make_response, request
from flask.json import jsonify
from jinja2 import StrictUndefined
import markdown... |
import kdb, unittest
class KeySet(unittest.TestCase):
def setUp(self):
self.ks = kdb.KeySet(100,
kdb.Key("system:/key1"),
kdb.Key("system:/key2"),
kdb.Key("user:/key3"),
kdb.Key("user:/key4"),
kdb.KS_END,
kdb.Key("user:/lost")
)
def test_ctor(self):
self.assertIsInstance(self.ks, kdb.KeySet... |
import logging
from cwharaj.utils.crawl_utils import CrawlUtils
class PhoneNumberSet(object):
def __init__(self):
self.dict = {}
super(PhoneNumberSet, self).__init__()
def add_row(self, model_id, row):
self.dict[model_id] = row
logging.debug("Get ajax url and added to dict fo... |
# -*- encoding: UTF-8 -*-
import sublime
import sublime_plugin
import os
import sys
import traceback
import tempfile
import re
import json
import time
import codecs
import cgi
def is_ST3():
''' check if ST3 based on python version '''
return sys.version_info >= (3, 0)
if is_ST3():
from . import desktop
... |
import os
from flask import current_app
BASH_BAZEL_SETUP = """#!/bin/bash -eux
# Clean up any existing apt sources
sudo rm -rf /etc/apt/sources.list.d
# Overwrite apt sources
echo "{apt_spec}" | sudo tee /etc/apt/sources.list
# apt-get update, and try again if it fails first time
sudo apt-get -y update || sudo apt-... |
"""
Installation script for DANSE P(r) inversion perspective for SansView
"""
from distutils.core import setup
setup(
version = "0.9.1",
name="fittingview",
description = "Fitting module for SansView",
package_dir = {"sans.perspectives":"src/sans/perspectives",
"sans.... |
# Time: O(n)
# Space: O(1)
#
# Given a sorted linked list, delete all duplicates such that each element appear only once.
#
# For example,
# Given 1->1->2, return 1->2.
# Given 1->1->2->3->3, return 1->2->3.
#
# Definition for singly-linked list.
class ListNode(object):
def __init__(self, x):
self.val = ... |
#!/usr/bin/env python
# The contents of this file are subject to the Mozilla Public 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.mozilla.org/MPL/
#
# Software distributed under the License is distributed... |
"""
Basic Treant objects: the organizational units for :mod:`datreant`.
"""
import os
import sys
import shutil
from uuid import uuid4
import logging
import functools
import datreant
import datreant.backends.pytables
import datreant.backends.yaml
from datreant import limbs
from datreant import filesystem
from datreant... |
import bpy
import bmesh
import os
import io
from pathlib import Path
from . import (pdx_data, utils)
class PdxFileExporter:
def __init__(self, filename):
self.filename = filename
def export_mesh(self, name):
objects = []
objects.append(pdx_data.PdxAsset())
wor... |
import os
import logging
# server
LISTEN_PORT = 27851
# worker
N_THREAD_WORKER = 8
N_PROCESS_WORKER = 8
# common
CWD = os.path.dirname(__file__)
LOG_NAME = 'ramjet-driver'
LOG_DIR = '/tmp'
LOG_PATH = '{}.log'.format(os.path.join(LOG_DIR, LOG_NAME))
logger = logging.getLogger(LOG_NAME)
# web
OK = 0
ERROR = 1
# task... |
# Copyright (C) 2010 Linaro Limited
#
# Author: Zygmunt Krynicki <zygmunt.krynicki@linaro.org>
#
# This file is part of Launch Control.
#
# Launch Control is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License version 3
# as published by the Free Software F... |
#!/usr/bin/env python3
# Copyright (c) 2010 ArtForz -- public domain half-a-node
# Copyright (c) 2012 Jeff Garzik
# Copyright (c) 2010-2018 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Bitcoin P2P ... |
import pytest
from gaphor.core.modeling import ElementFactory
from gaphor.core.modeling.elementdispatcher import ElementDispatcher
from gaphor.diagram.tests.fixtures import allow, connect, disconnect
from gaphor.SysML import sysml
from gaphor.SysML.modelinglanguage import SysMLModelingLanguage
from gaphor.SysML.requir... |
# This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by Ansible
# still belong to the author of the module, and may assign their own license
# to the complete wo... |
#!/usr/bin/env python3
"""Find two numbers' GCD and its linear combination.
usage: euclidean.py [a b | INPUT OUTPUT]
Pass no arguments for interactive mode.
Pass two integer arguments 'a' and 'b' to see their GCD and linear combination.
pass two path arguments 'INPUT' and 'OUTPUT' to read 'a' and 'b' from a file.
"... |
import Queue
class DatabaseDefinition(object):
def __init__(self, cccall, cbexcepts, cccall_args=(), cccall_kwargs={}, xwcb=lambda e: True, acs=lambda x: None):
"""
@param cccall: A callable that can produce Connection objects
@param cbexcepts: Array of exception types that signify that con... |
# Licensed to the StackStorm, Inc ('StackStorm') under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use th... |
from flask import g, render_template, request, session, redirect, url_for
from scrimmage import app, db
from scrimmage.decorators import admin_required
from scrimmage.decorators import admin_required, set_flash
from scrimmage.models import Game, GameStatus
@app.route('/admin/')
@admin_required
def admin_index():
re... |
__version__ = "1.3.0"
|
#!/usr/bin/python
#
# There is a helper script to get your access_token and refresh token.
#
# You must first register at the google developer console and get a
# client id and secret.
#
# Do that at: https://console.developers.google.com
#
# Create a new project
#
# Use get_google_oauth_tokens.py:
# 1. Run script wit... |
import restkit
import json
import timeit
import random
import string
from astral.conf import settings
from astral.exceptions import NetworkError, NotFound
import logging
log = logging.getLogger(__name__)
class NodeAPI(restkit.Resource):
def __init__(self, uri, **kwargs):
kwargs.setdefault('timeout', 3)
... |
from __future__ import unicode_literals
import logging
logger = logging.getLogger(__name__)
from django.contrib import admin
from django.contrib import messages
import reversion
from stagecraft.apps.datasets.models.data_set import DataSet
from stagecraft.libs.backdrop_client import BackdropError
class DataSetAdmi... |
# -*- coding: utf-8 -*-
#
# MeshIO documentation build configuration file, created by
# sphinx-quickstart on Tue Oct 27 19:56:53 2015.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# Al... |
# Django settings for astrobin project.
import os
from django.conf import global_settings
local_path = lambda path: os.path.join(os.path.dirname(__file__), path)
DEBUG = False
TEMPLATE_DEBUG = DEBUG
MAINTENANCE_MODE = DEBUG
READONLY_MODE = False
MEDIA_VERSION = '34'
ADMINS = (
('Salvatore Iovene at AstroBin', 'a... |
# -*- coding: utf-8 -*-
# privacyIDEA is a fork of LinOTP
#
# 2015-11-03 Cornelius Kölbel <cornelius@privacyidea.org>
# Add memberfunction "exist"
# 2015-06-06 Cornelius Kölbel <cornelius@privacyidea.org>
# Add the possibility to update the user data.
# Nov 27, 2014 Cornelius Kölbel ... |
#!/usr/bin/env python3
# encoding: utf-8
"""reactor_bot - The best dang Discord poll bot around™"""
__version__ = '4.5.12'
__author__ = 'Benjamin Mintz <bmintz@protonmail.com>'
import json
import logging
import traceback
import discord
from discord.ext import commands
logging.basicConfig(level=logging.INFO)
prefi... |
#! /usr/bin/python
from __future__ import division, print_function
import sys
import argparse
import numpy as np
from gplot import *
from pause import *
from wstat import nanwsem, wmean, mlrms, wstd
try:
import gls
except:
print('Cannot import gls')
try:
import astropy.io.fits as pyfits
except:
print('... |
#!/usr/bin/env python3
import asyncio
import sys
sys.path.append("..")
import jauxiliar as jaux
import josecommon as jcommon
import decimal
import json
import os
import time
from random import SystemRandom
random = SystemRandom()
PRICE_TABLE = {
'api': ('Tax for Commands that use APIs', jcommon.API_TAX_PRICE, \
... |
# -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
The astropy.time package provides functionality for manipulating times and
dates. Specific emphasis is placed on supporting time scales (e.g. UTC, TAI,
UT1) and time representations (e.g. JD, MJD, ISO 8601) that are used in
astr... |
"""
homeassistant.components.device_tracker.mqtt
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
MQTT platform for the device tracker.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/device_tracker.mqtt.html
"""
import logging
from homeassistant import util
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.