text stringlengths 17 737k |
|---|
import enum
import inspect
from importlib.machinery import SourceFileLoader
from pathlib import Path
import numpy as np
import PIL.Image
import pytest
import torch
from prototype_common_utils import (
ArgsKwargs,
assert_equal,
make_bounding_box,
make_detection_mask,
make_image,
make_images,
... |
"""
Django settings for polio project.
For more information on this file, see
https://docs.djangoproject.com/en/1.6/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.6/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
impo... |
#!/usr/bin/python
"""take recent twitters and zephyr them to me"""
import urllib
import simplejson
import sys
import os
import getpass
import subprocess
import time
urllib.URLopener.version = "thok.org-ztwitgw.py-one-way-zephyr-gateway/0.1"
# from comick.py - either I should come up with my *own* library
# for thi... |
# ------------------------------------------------------------------------
# coding=utf-8
# ------------------------------------------------------------------------
#
# Created by Martin J. Laubach on 08.01.10.
#
# ------------------------------------------------------------------------
from django import forms
from ... |
from numpy import asarray
import numpy as np
import copy
ListType = list
TupleType = tuple
StringType = str
def abut(source, *args):
# comment: except for the repetition, this is equivalent to hstack.
"""\nLike the |Stat abut command. It concatenates two arrays column-wise
and returns the result. CAUTIO... |
from django.core import signals
from django.dispatch import dispatcher
from django import http
import sys
class BaseHandler:
def __init__(self):
self._request_middleware = self._view_middleware = self._response_middleware = self._exception_middleware = None
def load_middleware(self):
"""
... |
#!/usr/bin/env python
from __future__ import unicode_literals
from itertools import islice
from django_countries.conf import settings
from django.utils import six
from django.utils.encoding import force_text
from django.utils.translation import override
try:
import pyuca
except ImportError:
pyuca = None
# Us... |
import json
import bpy
from . import block
from .texture import create_texture_block
Block = block.Block
class Value:
def __init__(self, value, record_to=''):
self.value = value
self.record_to = record_to
class MaterialCreator:
def adjoin(self, opts):
new_node = self.tree.nodes.new('S... |
##############################################################################
#
# 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 Affero General Public L... |
__version__ = '0.1.43'
|
# -*- coding: utf-8 -*-
from django.conf import settings
from django.contrib import admin
from django.http import HttpResponse
from django.utils.text import Truncator
from django.utils.html import strip_tags
from django.forms.models import model_to_dict
from djspace.application.models import *
from djspace.core.admin ... |
"""
Sessionhandler for portal sessions
"""
from __future__ import print_function
from __future__ import division
import time
from collections import deque, namedtuple
from twisted.internet import reactor
from django.conf import settings
from evennia.server.sessionhandler import SessionHandler, PCONN, PDISCONN, \
... |
# -*- coding: utf-8 -*-
from datetime import datetime
import logging
import re
import time
from django.db import models
from django.db.models.fields import FieldDoesNotExist
from django.db.models.related import RelatedObject
from django.utils import timezone
from instagram.helper import timestamp_to_datetime
from inst... |
# 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 agreed to in writing, s... |
# -*- coding: utf-8 -*-
# @Author: twankim
# @Date: 2017-07-07 21:15:23
# @Last Modified by: twankim
# @Last Modified time: 2017-09-27 21:09:44
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
from skimage.io import imsave
import matpl... |
#
# Copyright (c) 2015 Juniper Networks, Inc. All rights reserved.
#
from analytic_client import AnalyticApiClient
import time, socket, os
from topology_uve import LinkUve
import gevent
from gevent.coros import Semaphore
from opserver.consistent_schdlr import ConsistentScheduler
class PRouter(object):
def __init__... |
#! /usr/bin/python
import os
from os.path import join
from os import path
from subprocess import call
PROVISION_DIR = path.dirname(path.realpath(__file__))
REPO_DIR = path.dirname(PROVISION_DIR)
TEMPLATE_DIR = path.join(PROVISION_DIR, 'templates')
SCHEMA_DIR = path.join(PROVISION_DIR, 'schema')
call('yum update -y'.... |
# Copyright 2018 Google 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 law or a... |
from kivy.uix.screenmanager import Screen
import subprocess
import atexit
import os
from kivy.clock import Clock
import system.gen as gen
from platform import system, architecture
class VanityScreen(Screen):
"""
Display the actions that work with vanity addresses
"""
def __init__(self, BippyApp, **kwargs):
sup... |
from django import template
from django.core.urlresolvers import reverse
from follow.models import Follow
import re
register = template.Library()
def _follow_link(object):
return reverse('follow', args=[object._meta.app_label, object._meta.object_name.lower(), object.pk])
def _unfollow_link(object):
return r... |
# 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 t... |
#!/usr/bin/python
########################################################################
##
##
## This script builds the panda source tarballs and zip-files
##
## usage: maketarball [version] [more options]
##
## The source tarball contains most of what is in CVS, but some of the
## control files (like the CVS di... |
# -*- coding: utf-8 -*-
# Copyright (c) 2010-2016, MIT Probabilistic Computing Project
#
# 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/LICENS... |
from __future__ import print_function
import os, sys
import json
import subprocess
import time
import tempfile
import threading
from io import BytesIO
import errno
import boto3
import botocore
import socket
debug = True
verbose = False
def _last_common_snapshot(source, target):
"""
Given a list of sna... |
import magic, os, logging
log = logging.getLogger(__name__)
class Magic(object):
##########################################################################
# internal helpers
##########################################################################
@classmethod
def _initialize(cls, magic_file=N... |
#!/usr/bin/env python
# * coding: utf8 *
'''
RasterPallet.py
A module that contains a forklift pallet definition for the Raster app.
'''
from json import loads
from os.path import dirname, join, realpath, basename
import arcpy
from forklift.models import Pallet
import raster_secrets as secrets
current_folder = di... |
"""
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this ... |
# Software License Agreement (BSD License)
#
# Copyright (c) 2009-2011, Eucalyptus Systems, Inc.
# All rights reserved.
#
# Redistribution and use of this software in source and binary forms, with or
# without modification, are permitted provided that the following conditions
# are met:
#
# Redistributions of source ... |
# -*- coding: utf-8 -*-
#
# Copyright 2018 German Aerospace Center (DLR)
#
# 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 requ... |
## $Id$
## CDSware Web Session utilities, implementing persistence.
## This file is part of the CERN Document Server Software (CDSware).
## Copyright (C) 2002, 2003, 2004, 2005 CERN.
##
## The CDSware is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## ... |
from __future__ import with_statement
import os
from django.conf import settings, global_settings
from django.test import TransactionTestCase, TestCase, signals
from django.test.utils import override_settings
# @override_settings(TEST='override')
class FullyDecoratedTranTestCase(TransactionTestCase):
def test_ov... |
import json
import re
from concurrent.futures.thread import ThreadPoolExecutor
from ytmusicapi import YTMusic
from mopidy_youtube import logger
from mopidy_youtube.youtube import Client, Playlist, Video
ytmusic = YTMusic()
# Direct access to YouTube Music API
#
class Music(Client):
endpoint = None
searchEn... |
from copy import copy
from datetime import datetime, timedelta
import json
from mock import patch, ANY
import pytz
from StringIO import StringIO
from boto.s3.connection import Location
from django.conf import settings
from django.core.management import call_command
from django.test import TestCase
from django.test.ut... |
#***************************************************************************
#* *
#* Copyright (c) 2015 - Przemo Firszt <przemo@firszt.eu> *
#* *
#* This pr... |
import argparse
import csv
import datetime
import os.path
import re
import sys
import tabulate
from openpyxl import load_workbook
filter_re = re.compile("(\\d+)(=|!=)(.+)")
PROGRESS_STEP = 500
class DataReader:
def __init__(self):
self.current_line = -1
self.returned_rows = 0
def __iter__(... |
from functools import wraps
import math
import logging
import StringIO
import sys
import cairo
from concurrent import futures
import numpy as np
from osgeo import gdal, gdal_array
from osgeo.ogr import CreateGeometryFromWkt
from osgeo.osr import SpatialReference
from PIL import Image
import httplib2
import TileStache
... |
# -*- coding: utf-8 -*-
# Standard library imports
import os
import shlex
# Local imports
from . import mappings, paths
from .repos import LocalRepo
from .reporter import get_reporter
from .module import Module, is_module, is_exact_match, best_match
__all__ = [
'ResolveError',
'Resolver',
'Activator',
... |
"""
Email users to verify citation information.
"""
import re
from framework.auth.utils import parse_name
from framework.email.tasks import send_email
from website.app import init_app
from website import models
from website import settings
app = init_app('website.settings', set_backends=True, routes=True)
email_te... |
# BEGIN_COPYRIGHT
#
# Copyright 2009-2014 CRS4.
#
# 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 a... |
# -*- coding: utf-8 -*-
#################################################################################
#
# Copyright (c) 2015-2019 Dubalu LLC
#
# 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 Softw... |
import unicodedata
from collections import defaultdict
from itertools import zip_longest
from .porter import Stemmer
def _normalize(s):
return unicodedata.normalize("NFKD", s)
def _check_type(s):
if not isinstance(s, str):
raise TypeError("expected str or unicode, got %s" % type(s).__name__)
def l... |
import subprocess, sys, os.path
class DRAC_NO_SUPP_PACK(Exception):
"""Base Exception class for all transfer plugin errors."""
def __init__(self, *args):
Exception.__init__(self, *args)
class DRAC_POWERON_FAILED(Exception):
"""Base Exception class for all transfer plugin errors."""
def... |
#!/usr/bin/env python
# -*- coding: utf8 -*-
# =============================================================================
# Copyright (c) 2013 by nexB, Inc. http://www.nexb.com/ - All rights reserved.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in complian... |
##############################################################################
#
# Copyright (C) 2015 ADHOC SA (http://www.adhoc.com.ar)
# All Rights Reserved.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# pub... |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2014 Pexego (<www.pexego.es>). All Rights Reserved
# $Omar Castiñeira Saavedra$
#
# This program is free software: you can redistribute it ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# This code of this example should be considered public domain.
"""
Just a very fake galaxy.
Astronomers and cosmologists will kill me !
"""
import os
from vispy import oogl
from vispy import app
from vispy import gl
from OpenGL import GL
import numpy as np
from transform... |
# Copyright (c) 2015 SONATA-NFV, UCL, NOKIA, NCSR Demokritos
# 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
#... |
#!/usr/bin/env python
# Environment.py
# Copyright (C) 2006 CCLRC, Graeme Winter
#
# This code is distributed under the BSD license, a copy of which is
# included in the root directory of this package.
#
# Maintained by Graeme Winter
# 18th September 2006
#
# A handler for matters of the operating environment, ... |
import mx.DateTime
from pyIEM import iemdb
i = iemdb.iemdb()
postgis = i['postgis']
tests = [
'LMK.TO.9', 'LMK.TO.13', 'LMK.TO.14', 'ICT.TO.7', 'PAH.TO.10', 'PAH.TO.11',
'PAH.TO.12','SGF.TO.13', 'JKL.TO.8', 'IND.TO.5', 'IND.TO.6', 'DDC.TO.2',
'DMX.TO.2', 'FSD.TO.2', 'FSD.TO.3', 'FSD.TO.4', 'FSD.TO.5', 'FSD.TO.6',
... |
from __future__ import absolute_import
from logging import getLogger
import rethinkdb as r
from future.builtins import range
from future.moves.queue import Queue
logger = getLogger("RethinkPool")
class ConnectionResource(object):
def __init__(self, queue, conn, **kwds):
self._queue = queue
if ... |
import json
import rospy
import subprocess
import threading
import re
from lg_msg_defs.msg import WindowGeometry
class ManagedWindow(object):
def __init__(self, w_name=None, w_class=None, w_instance=None,
geometry=None, visible=True, chrome_kiosk_workaround=False,
layer=None):
... |
"""
Build SVG diagrams from various csb objects.
"""
import math
from csb.bio.structure import SecondaryStructure, SecStructures
class SSCartoonBuilder(object):
"""
Creates a 2D vector diagram from a L{SecondaryStructure} object.
@param ss: source secondary structure (either a SS string or a SS obj... |
#!/usr/bin/env python
# encoding: utf-8
import httplib as http
import mock
from nose.tools import * # noqa
from website.addons.base import testing
from website.addons.figshare.model import FigshareClient
from website.addons.figshare.tests.utils import FigshareAddonTestCase
class TestAuthViews(FigshareAddonTestCase,... |
"""
Copyright 2013 Basho Technologies, Inc.
This file is provided to you 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 agr... |
"""
Copyright 2012 Basho Technologies, Inc.
This file is provided to you 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 a... |
# Harvest all the .ncml files in the FRF folder
# on the USACE CHL THREDDS Server
#
# docker run --rm -v $(pwd)/harvest_frf.py:/srv/harvest.py -v $(pwd)/iso:/srv/iso axiom/thredds_iso_harvester
from thredds_iso_harvester.harvest import ThreddsIsoHarvester
from thredds_crawler.crawl import Crawl
#skip = Crawl.SKIPS +... |
import argparse
import logging
import os
import tweepy
from flask import Flask, current_app, jsonify, request
from flask.ext.sqlalchemy import SQLAlchemy
from sqlalchemy import desc
from multiprocessing import Process
from multiprocessing.util import register_after_fork
# configure log
log = logging.getLogger(__name_... |
# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
from six.moves import range
from six import string_types
import frappe
import json
from frappe.utils import (getdate, cint, add_months, date_diff, add_days,
nowdate, get_datetim... |
# -*- test-case-name: vumi.transports.mtn_rwanda.tests.test_mtn_rwanda_ussd -*-
from twisted.internet import reactor
from twisted.web import xmlrpc, server, http
from twisted.internet.defer import inlineCallbacks
from vumi.transports.base import Transport
from vumi.config import ConfigServerEndpoint
class MTNRwanda... |
import time
import uuid
import base64
import typing
import asyncio
import hashlib
import logging
import weakref
import functools
from http import HTTPStatus
import aiohttp
from google.oauth2 import service_account
from waterbutler.core.path import WaterButlerPath
from waterbutler.core.provider import BaseProvider
fro... |
# This file is the actual code for the custom Python dataset looker-query_run-query
from dataiku.connector import Connector
import logging
import pprint
import json
from looker_sdk import client, models, error
class MyConnector(Connector):
def __init__(self, config, plugin_config):
logging.basicConfig... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
2014/12/04 OKADA Teruhisa make this file.
2015/05/02 okada remake it.
"""
import datetime
import netCDF4
import numpy as np
from numpy import dtype
#import matplotlib.pyplot as plt
import pandas as pd
import itertools
def make_ini_file(grdfile, inif... |
# Copyright 2012 the rootpy developers
# distributed under the terms of the GNU General Public License
from __future__ import absolute_import
from array import array
from itertools import product, izip
import operator
import uuid
import ROOT
from .. import asrootpy, QROOT, log; log = log[__name__]
from ..base import... |
import gc, os
from tempfile import mkstemp
import warnings
import numpy as np
import nose.tools
import neuroimaging.core.reference.coordinate_map as coordinate_map
from neuroimaging.modalities.fmri.api import FmriImageList, fmri_generator, fromimage
from neuroimaging.core.api import Image, data_generator, parcels
fr... |
# Copyright (c) 2012 OpenStack Foundation.
# 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... |
from subprocess import Popen, PIPE
from socket import inet_ntoa
from random import sample
from struct import pack
from glob import glob
from os import unlink
from os.path import abspath
from time import sleep
import re
import jinja2
import webbrowser
import argparse
import json
parser = argparse.ArgumentParser()
parse... |
from __future__ import absolute_import, division, print_function
import locale
import re
import os
import sys
import stat
from glob import glob
from os.path import (basename, dirname, join, splitext, isdir, isfile, exists,
islink, realpath, relpath)
try:
from os import readlink
except ImportEr... |
# -*- 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... |
"""
Modul to read status-informations from an AVM FritzBox.
"""
import time
from ..core.exceptions import FritzServiceError
from .fritzbase import AbstractLibraryBase
from .fritztools import format_num, format_rate, format_dB
def _integer_or_original(value):
"""
Tries to convert value to an integer. Returns... |
# -*- coding: utf-8 -*-
__author__ = 'glow'
import unittest
def all_tests():
suite = unittest.TestSuite()
loader = unittest.TestLoader()
suite.addTests(loader.discover('rwslib.tests'))
suite.addTests(loader.discover('rwslib.extras.audit_event'))
suite.addTests(loader.discover('rwslib.extras')) #... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of... |
# -*- coding: utf-8 -*-
import json
import traceback
from datetime import datetime
import web
from nailgun.notifier import notifier
from nailgun.logger import logger
from nailgun.api.models import Node
from nailgun.api.models import Network
from nailgun.api.models import NetworkAssignment
from nailgun.api.models imp... |
# -*- coding: utf-8 -*-
'''
Copyright 2013 Google 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 applic... |
# -*- coding: utf-8 -*-
'''
Git Fileserver Backend
With this backend, branches and tags in a remote git repository are exposed to
salt as different environments.
To enable, add ``git`` to the :conf_master:`fileserver_backend` option in the
Master config file.
.. code-block:: yaml
fileserver_backend:
- git... |
# -*- coding: utf-8 -*-
'''
Connection module for Amazon VPC
.. versionadded:: 2014.7.0
:configuration: This module accepts explicit VPC credentials but can also
utilize IAM roles assigned to the instance trough Instance Profiles.
Dynamic credentials are then automatically obtained from AWS API and no
fur... |
# -*- coding: utf-8 -*-
'''
Management of Docker Containers
.. versionadded:: 2014.1.0
.. note::
The DockerIO integration is still in beta; the API is subject to change
General Notes
-------------
As we use states, we don't want to be continuously popping dockers, so we
will map each container id (or image) wi... |
from pymp import logger, trace_function
from pymp.dispatcher import *
from multiprocessing import Pipe, Process
import threading
# Pretend datastructure
class Foo(object):
@trace_function
def __init__(self):
self.count = 0
self.lock = threading.RLock()
@trace_function
def test(self... |
'''
The Saltutil module is used to manage the state of the salt minion itself. It is
used to manage minion modules as well as automate updates to the salt minion
'''
# Import Python libs
import os
import hashlib
import shutil
import signal
import logging
import sys
# Import Salt libs
import salt.payload
import salt.s... |
"""Implementation of odin_data Meta Listener
This module listens on one or more ZeroMQ sockets for meta messages which it then passes
on to a MetaWriter to write. Also handles odin Ipc control messages.
Matt Taylor, Diamond Light Source
"""
import zmq
import logging
import re
import importlib
from odin_data.ipc_mess... |
#! /usr/bin/env python
#
# 1440 files took about 38 mins
#
from __future__ import print_function
from tkinter import filedialog
from tkinter import *
from astride import Streak
import glob
import sys
import shutil
import os
import tkinter as tk
import matplotlib.pyplot as plt
from astropy.io import fits
import numpy... |
import math
from interval_utils import *
import gui
import random
class Strategy:
def __init__(self):
self.target = (0,0)
self.has_target = False
self.target_cell = None
self.color = (0,0,0)
def process_frame(self,c):
runaway = False
my_smallest... |
#######################################################################
# Copyright (C) 2017 Shangtong Zhang(zhangshangtong.cpp@gmail.com) #
# Permission given to modify the code as long as you keep this #
# declaration at the top #
################################... |
# -*- coding: utf-8 -*-
import os
from subprocess import call, TimeoutExpired
from functools import reduce
import itertools
"""
Wrapper for calling the AarhusBSS-Research
collaborative communities simulation script
Author: Malte Lau Petersen, maltelau@protonmail.com
Edit options, folders, and combinations below a... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# ***** BEGIN LICENSE BLOCK *****
# Copyright (C) 2012 Hayaki Saito <user@zuse.jp>
#
# 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 versi... |
#! /usr/bin/env python3
import argparse
import functools
import gc
import logging
import sys
import numpy as np
import pandas as pd
import scipy.sparse
import tqdm
import yaml
import misc.bio_utils.bed_utils as bed_utils
import misc.logging_utils as logging_utils
import misc.math_utils as math_utils
import misc.panda... |
import subprocess
import os.path
try:
# don't get confused if our sdist is unzipped in a subdir of some
# other hg repo
if os.path.isdir('.hg'):
p = subprocess.Popen(['hg', 'parents', r'--template={rev}\n'],
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
if not... |
import simplejson as json
from mongrel2 import handler
import hashlib
import base64
sender_id = "82209006-86FF-4982-B5EA-D1E29E55D481"
conn = handler.Connection(sender_id, "tcp://127.0.0.1:9999",
"tcp://127.0.0.1:9998")
users = {}
user_list = []
def wsChallenge(v):
try:
x=hashl... |
#!/bin/python
# -*- coding: utf-8 -*-
import json, sys
from pandocfilters import Str, Space
import pandocfilters
import commands as c
from jinja2 import Template, Environment, FileSystemLoader
import os
import meta
def get_metadata_field(json_lst, field):
'''
Take a JSON list and a field name (str) and return... |
r"""
.. autofunction:: openpnm.models.physics.poisson_shape_factors.ball_and_stick
.. autofunction:: openpnm.models.physics.poisson_shape_factors.conical_frustum_and_stick
"""
import numpy as _np
import scipy as _sp
from scipy import pi as _pi
from numpy import arctanh as _atanh
from numpy import sqrt as _sqrt
def ... |
#
# Archiver-Related Pages
#
import pscheduler
from pschedulerapiserver import application
from flask import request
from .dbcursor import dbcursor_query
from .json import *
from .response import *
#
# Archivers
#
# All archivers
@application.route("/archivers", methods=['GET'])
def archivers():
return json_q... |
# Copyright (c) 2005 Iowa State University
# http://mesonet.agron.iastate.edu/ -- mailto:akrherz@iastate.edu
#
# 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... |
import os
import re
from datetime import datetime
import pytz
class AwsNexradFile(object):
"""
This class contains metadata about the remote NEXRAD file on AWS
:var key: AWS key for this NEXRAD file
:vartype key: str
:var last_modified: when the file was last modified on AWS
:vartype last_mo... |
"""
GeoIPExpert utilizes the pygeoip module for ip geolocation.
The DB needs to be separately downloaded from MaxMind,
http://www.maxmind.com/app/city
There is a free and a commercial versions of the DB, so please
check their licensing agreement if you are using the free
version in your deployment:
http://geolite.maxmi... |
"""
Export neuroimaging results created with feat in FSL following NIDM-Results
specification.
@author: Camille Maumet <c.m.j.maumet@warwick.ac.uk>
@copyright: University of Warwick 2013-2014
"""
import re
import os
import sys
import glob
import json
import numpy as np
import subprocess
# If "nidmresults" code is av... |
"""Provides access to configuration information"""
import os
import sys
from ConfigParser import ConfigParser, NoOptionError, NoSectionError
class IdleConfParser(ConfigParser):
# these conf sections do not define extensions!
builtin_sections = {}
for section in ('EditorWindow', 'Colors'):
builtin... |
from test.test_support import verbose, TestSkipped
import locale
import sys
if sys.platform == 'darwin':
raise TestSkipped("Locale support on MacOSX is minimal and cannot be tested")
oldlocale = locale.setlocale(locale.LC_NUMERIC)
if sys.platform.startswith("win"):
tlocs = ("en",)
else:
tlocs = ("en_US.UT... |
# Copyright 2014 The Oppia Authors. 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 ... |
# 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.
# Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
# for details. All rights reserved. Use of this source code is governed by a... |
# Copyright (c) 2019, Nordic Semiconductor
# SPDX-License-Identifier: BSD-3-Clause
# Tip: You can view just the documentation with 'pydoc3 devicetree.dtlib'
"""
A library for extracting information from .dts (devicetree) files. See the
documentation for the DT and Node classes for more information.
The top-level ent... |
# Edit this file to override the default graphite settings, do not edit settings.py!!!
# Turn on debugging and restart apache if you ever see an "Internal Server Error" page
#DEBUG = True
# Set your local timezone (django will try to figure this out automatically)
TIME_ZONE = 'Europe/Oslo'
# Setting MEMCACHE_HOSTS t... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.