text stringlengths 12 6.59M |
|---|
# Copyright 2013 Hewlett-Packard Development Company, L.P.
#
# 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... |
# -*- coding: utf-8 -*-
import os, thread
from queue import PersistentQueue
class QueueCollectionError(Exception):
pass
class QueueCollection(object):
def __init__(self, path):
if not os.path.isdir(path) and not os.access(path, os.W_OK):
try:
os.makedirs(path)
... |
"""
Supplies Pane, GridLayout and AdjointLayout. Pane extends View to
allow multiple Views to be presented side-by-side in a GridLayout. An
AdjointLayout allows one or two Views to be ajoined to a primary View
to act as supplementary elements.
"""
from functools import reduce
import numpy as np
import param
from .d... |
import discord
from discord import app_commands
from discord.ext import commands
import asyncio
import datetime
import copy
import ctypes
import importlib.metadata
import inspect
import os
import random
import subprocess
import sys
import time
import traceback
from typing import Optional
import chess.engine
import g... |
p3Path='../peano3/src'
p3RepositorySubpath='src'
p3Revision='1140' #Revision number or 'HEAD'
p3Build='release' #'debug', 'asserts', or 'release'
p3Parallel='yes' #'yes' or 'no'
p3Dimension='2' #'2' or '3'
def getPeano3Path():
return p3Path
def getPeano3RepositorySubpath():
return p3RepositorySubpath
def getPea... |
import itertools
import types
from numbers import Number
from itertools import groupby
from functools import partial
import numpy as np
import param
from . import traversal, util
from .dimension import OrderedDict, Dimension, ViewableElement
from .layout import Layout, AdjointLayout, NdLayout
from .ndmapping import U... |
import discord
from discord.ext import commands
import asyncio
from modules import utilities
from utilities import checks
async def setup(bot):
def emote_wrapper(emote):
async def emote_command(self, ctx):
await ctx.embed_reply(f":{emote}:")
return emote_command
for emote in (
"frog", "turtle", "gun"... |
# -*- coding: utf-8 -*-
import os
from codecs import open
from jinja2 import Environment, FileSystemLoader
from jinja2.exceptions import TemplateNotFound
from feedgenerator import Atom1Feed
from pelican.settings import read_settings
from pelican.utils import clean_output_dir
_TEMPLATES = ('index', 'tag', 'tags', 'ar... |
import os
import sys
def env(name, default=None):
val = os.environ.get(name)
if val == 'True':
return True
elif val == 'False':
return False
elif val is None:
return default
return val
PROJECT_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir))
PACKA... |
#!/usr/bin/python3
from PyQt4 import QtCore, QtGui
import UiFiles.Ui_MainWindow
from Scripts import GetListOfVideos, GetDataFromWeb, DatabaseOperations
import sys, os, subprocess
class pmm(QtGui.QMainWindow):
def __init__(self, parent = None):
super(pmm, self).__init__(parent)
self.ui = UiFiles.Ui... |
# -*- coding: utf-8 -*-
import os
import math
import random
import logging
import datetime
from collections import defaultdict
from functools import partial
from itertools import chain
from operator import attrgetter, itemgetter
from jinja2 import Environment, FileSystemLoader, PrefixLoader, ChoiceLoader
from jinja2.... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# pylint: disable=bad-whitespace, superfluous-parens
"""
Cookiecutter pre-gen hook.
This gets called with no arguments, and with the project directory
as the working directory. That is empty on the first run, but might
also already be populated when Cookie... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
'''This script is used to automaticaly tweet link of the last published post from
a Pelican blog.
Both Markdown and Rest syntax are supported. The 'Slug' tag **has** to be set
so the script can create the complete URL of the post.
'''
__author__ = 'quack1'
__version... |
#! /usr/bin/env python
import argparse
import logging
import keras
import pandas as pd
from uno_data import DataFeeder
from uno_baseline_keras2 import evaluate_prediction, log_evaluation
def log_evaluation(metric_outputs, description='Comparing y_true and y_pred:'):
print(description)
for metric, value in m... |
# -*- coding: utf-8 -*-
from contextlib import contextmanager
import base64
import collections
import hmac
import json
import os
import re
import sys
import time
from bs4 import BeautifulSoup
from flask import abort
from markdown import markdown
import psycopg2
import pycodestyle
import requests
import unidiff
import y... |
# -*- coding: utf-8 -*-
import sys, os
sys.path.append(os.path.abspath('_sphinx/exts'))
extensions = ['sphinxcontrib.issuetracker', 'sphinx.ext.extlinks', 'howto', 'codeliteral', 'key', 'srcref']
# Project variables
project = 'sbt'
version = os.environ['sbt.partial.version']
site_version = os.environ['sbt.site.vers... |
#! /usr/bin/env python
"""Convert a LaTeX .toc file to some PDFTeX magic to create that neat outline.
The output file has an extension of '.bkm' instead of '.out', since hyperref
already uses that extension. Let's avoid clashing.
"""
import getopt
import os
import re
import string
import sys
# Ench item in an ent... |
"""Routines related to PyPI, indexes"""
from __future__ import absolute_import
import logging
import cgi
import sys
import os
import re
import mimetypes
import posixpath
import warnings
from pip._vendor.six.moves.urllib import parse as urllib_parse
from pip._vendor.six.moves.urllib import request as urllib_request
f... |
#!/usr/bin/env python
# Accelerator for pip, the Python package manager.
#
# Author: Peter Odding <peter.odding@paylogic.eu>
# Last Change: April 11, 2013
# URL: https://github.com/paylogic/pip-accel
"""
Usage: pip-accel [ARGUMENTS TO PIP]
The pip-accel program is a wrapper for pip, the Python package manager. It
ac... |
#!/usr/bin/env python
# Copyright 2013 The LUCI Authors. All rights reserved.
# Use of this source code is governed under the Apache License, Version 2.0
# that can be found in the LICENSE file.
"""Archives a set of files or directories to an Isolate Server."""
__version__ = '0.9.0'
import collections
import errno
i... |
#!/usr/bin/env python
""" Soil Moisture Timeseries """
import sys
sys.path.insert(0, '/mesonet/www/apps/iemwebsite/scripts/lib')
import os
os.environ[ 'HOME' ] = '/tmp/'
os.environ[ 'USER' ] = 'nobody'
import datetime
import numpy
import sys
import iemtz
import cgitb
cgitb.enable()
import network
nt = network.Table("I... |
"""
A command-line patching program for Japanese PC game disk images.
Reads a json config file, looks for relevant disk images in
"""
import sys, logging, json
from os import curdir, listdir, remove, getcwd, chdir, access, W_OK, stat, _exit
from shutil import copyfile
from os.path import isfile, isdir... |
"""
Master configuration file for Evennia.
NOTE: NO MODIFICATIONS SHOULD BE MADE TO THIS FILE! All settings changes should
be done by copy-pasting the variable and its value to your game directory's
settings.py file.
"""
import os
# A list of ports to listen on. Can be one or many.
GAMEPORTS = [4000]
# While DEBUG i... |
#!/usr/bin/python
########################################################################
#
# Caution: there are two separate, independent build systems:
# 'makepanda', and 'ppremake'. Use one or the other, do not attempt
# to use both. This file is part of the 'makepanda' system.
#
# To build panda using this scrip... |
# -*- coding: utf-8 -*-
from __future__ import division, print_function, absolute_import
import math
import numpy as np
from numpy.random import RandomState
from scipy.stats import (binom,
ttest_ind)
from scipy.optimize import brentq
def permute_within_groups(group, condition, groups, see... |
#!/usr/bin/env python
# -*- coding: latin-1 -*-
'''GET an ENCODE collection and output a tsv of all objects and
their properties suitable for spreadsheet import'''
import json
import os.path
import encodedcc
import requests
from urllib.parse import urljoin
import logging
EPILOG = '''Limitations:
Gets all objects, no ... |
import sublime, sublime_plugin
import os, time
import subprocess
from sublime_lib.path import root_at_packages, get_package_name
class ManPagePreview(sublime_plugin.WindowCommand):
def run(self):
# exit if file is dirty, we can't run a man command against a file that doesn't exist
if self.window.active_v... |
from exceptions import *
import boto.ec2
import logging
import sys
import string
import random
import os.path
class Server(object):
log = logging.getLogger('Servers.Server')
log.setLevel(logging.DEBUG)
ch = logging.StreamHandler()
ch.setLevel(logging.DEBUG)
formatter = logging.Formatter(
... |
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2016 Compassion CH (http://www.compassion.ch)
# Releasing children from poverty in Jesus' name
# @author: Emanuel Cino <ecino@compassion.ch>
#
# The licence is in the file __opener... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Script to catch copyright violations.
The script use DB or API to get diffs, and sends inserts and replacements to an external service
to find copyright violations.
Output can be to console (default) or to wiki page
Command line options:
-report:Page page nam... |
#!/usr/bin/env python
# IntegraterFactory.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.
#
# A factory for Integrater implementations. At the moment this will
# support only Mosflm, XDS and th... |
import json
from django.http import HttpResponse
from django.contrib.auth.models import User
from django.conf import settings
from traceback import format_exc
class AnonymousAuthenticationMiddleware(object):
""" This middleware class tests whether the current user is the
anonymous user. If so, it replaces the... |
# Copyright 2011 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,... |
#!/usr/bin/python
########################################################################
#
# Caution: there are two separate, independent build systems:
# 'makepanda', and 'ppremake'. Use one or the other, do not attempt
# to use both. This file is part of the 'makepanda' system.
#
# To build panda using this scrip... |
from __future__ import division, absolute_import, print_function, unicode_literals
import json
import sys
import datetime
import threading
import requests
import dateutil.parser
from twisted.python import log
import plugin
API_URL = "https://api-v2launch.trakt.tv"
API_ACTIVITY = "/users/{0}/history/{1}"
class Tr... |
# Copyright (c) 2014 Cisco Systems 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 re... |
from django import http
from django.conf import settings
from utils import next_redirect, confirmation_view
from django.core.exceptions import ObjectDoesNotExist
from django.db import models
from django.shortcuts import render_to_response
from django.template import RequestContext
from django.template.loader import ren... |
# Treat all division as float division even in python2
from __future__ import division
import re
from enum import Enum
import numpy as np
from annotypes import add_call_types, TYPE_CHECKING
from malcolm.core import Future, Block, PartRegistrar, Put, Request
from malcolm.modules import builtin, scanning
from malcolm.m... |
# Copyright 2022 The HuggingFace Team. 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 applicabl... |
import contextlib
import os
import os.path
import shelve
import sys
import tempfile
import time
import webbrowser
import c4d
from c4d import documents, gui, plugins, storage, threading
# Add locale module path
local_modules_path = os.path.join(os.path.dirname(__file__),
'res',
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
This Bot uses the Updater class to handle the bot.
First, a few handler functions are defined. Then, those functions are passed to
the Dispatcher and registered at their respective places.
Then, the bot is started and runs until we press Ctrl-C on the command line.
U... |
from __future__ import division, absolute_import, print_function, unicode_literals
import json
import sys
import datetime
import threading
import requests
import dateutil.parser
from twisted.python import log
import plugin
API_URL = "https://api-v2launch.trakt.tv"
API_ACTIVITY = "/users/{0}/history/{1}"
class Tr... |
from decimal import Decimal
from django.contrib.gis.db.models.fields import BaseSpatialField, GeometryField
from django.contrib.gis.db.models.sql import AreaField, DistanceField
from django.contrib.gis.geometry.backend import Geometry
from django.contrib.gis.measure import (
Area as AreaMeasure, Distance as Distan... |
# 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... |
"""
Functions to interrogate and extract CTD data from the ctd.db SQLite3 database.
"""
from __future__ import print_function
from datetime import datetime
from pathlib import Path
from warnings import warn
import numpy as np
from netCDF4 import Dataset
from PyFVCOM.utilities.general import split_string, ObjectFro... |
#!/usr/bin/env python
########################################################################
#
# Caution: there are two separate, independent build systems:
# 'makepanda', and 'ppremake'. Use one or the other, do not attempt
# to use both. This file is part of the 'makepanda' system.
#
# To build panda using this s... |
# -*- coding: utf-8 -*-
import re
from httoop.util import CaseInsensitiveDict, iteritems
from httoop.meta import HTTPSemantic
from httoop.header.element import HEADER, HeaderElement
from httoop.exceptions import InvalidHeader
class Headers(CaseInsensitiveDict):
__metaclass__ = HTTPSemantic
# disallowed bytes for ... |
from django.core.management.base import NoArgsCommand
from django.core.management.color import no_style
import sys
try:
set
except NameError:
from sets import Set as set # Python 2.3 fallback
class Command(NoArgsCommand):
help = "Create the database tables for all apps in INSTALLED_APPS whose tables hav... |
"""
Carneades model of argumentation
================================
>>> a = PropLiteral('a')
>>> argset = ArgumentSet()
>>> v = argset.add_proposition(a)
Using a CAES
++++++++++++
>>> kill = PropLiteral('kill')
>>> intent = PropLiteral('intent')
>>> neg_intent = intent.negate()
>>> murder = PropLiteral('murder')
>... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
<<<<<<< HEAD
from django.db import models, migrations
=======
from django.db import migrations, models
>>>>>>> 07b5042b519a3e6c88661bf11541554fde18b19f
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
... |
# -*- coding: utf8 -*-
import sys
import os.path
import numpy as np
import Python.Calculator as Calculator
from PyQt5.QtWidgets import QPushButton, QWidget
from PyQt5.QtWidgets import QComboBox, QLabel, QLineEdit, QDoubleSpinBox
from PyQt5.QtWidgets import QVBoxLayout, QHBoxLayout, QFormLayout
from PyQt5.QtWidg... |
from .view import View
from .tools import Button, TextInput
from .scrolled_panel import ScrolledPanel
from .game_entry import GameEntry
import pygame
PADDING = 20
class OverviewView(View):
def __init__(self, display):
View.__init__(self, display)
self.display = display
self.screen_size = self.di... |
import mock
from django.test import TestCase
import json
from django.core.urlresolvers import reverse
from django.contrib.auth.models import User
from django.test import Client
class TestVersionViewer(TestCase):
url_django_version_viewer = reverse('django_version_viewer')
url_django_version_viewer_csv = reve... |
#!/usr/bin/env python
"""
Flush control for ep-engine.
Copyright (c) 2010 Dustin Sallings <dustin@spy.net>
"""
import sys
import socket
import string
import random
import struct
import exceptions
import time
import mc_bin_client
def usage():
print >> sys.stderr, "Usage: %s host:port start|stop" % sys.argv[0]
... |
#!/usr/bin/env python
###
# Copyright (c) 2002, Jeremiah Fincher
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice,
# ... |
from math import sqrt
import numpy as np
from numba import jit, njit, prange
@njit(nogil=True)
def mf_sgd_sweep(users_idx, items_idx, feedbacks, P, Q, eta, lambd, *args):
cum_error = 0
for k, a in enumerate(feedbacks):
i = users_idx[k]
j = items_idx[k]
pi = P[i, :]
qj = Q[j, :]... |
'''
Integration test cases for AlchemyModelViewSet
Uses Django test client
'''
from utils import SessionMixin, DeclarativeModel, ClassicalModel
from utils import CompositeKeysModel, ChildModel
from djangorest_alchemy.managers import AlchemyModelManager
from djangorest_alchemy.viewsets import AlchemyModelViewSet
from dj... |
#
# Copyright (c) 2004-2006 rPath, Inc.
#
# This program is distributed under the terms of the Common Public License,
# version 1.0. A copy of this license should have been distributed with this
# source file in a file called LICENSE. If it is not present, the license
# is always available at http://www.opensource.org/... |
#! /Library/Frameworks/Python.framework/Versions/2.7/bin/python
docstr = """
Polyjuice
Usage:
polyjuice.py (-h | --help)
polyjuice.py [-lz] (<input_path> <output_path>) [<config_file>]
polyjuice.py [-lzc] [<config_file>]
Options:
-h --help Show this message and exit
-z --zip ... |
"""
Flow Synchronous API Python Module.
All Flow API responses are represented with Python dicts.
"""
import sys
import subprocess
import platform as platform_module
import json
import threading
import Queue
import os
import string
import random
import logging
import requests
from . import definitions
LOG = logging... |
''' Implements the often needed split, map, combine paradigm '''
from __future__ import division
import os
import tempfile
import logging
import numpy as np
import tables as tb
from collections import Iterable
from pathos import multiprocessing
from pathos.pools import ProcessPool
class SMC(object):
def __init... |
from tests.base_test import BaseTest
from google.appengine.ext import ndb
import graphene
from graphene_gae import NdbNode, NdbConnectionField
from tests.models import Tag, Comment, Article, Author, Address, PhoneNumber
__author__ = 'ekampf'
schema = graphene.Schema()
@schema.register
class AddressType(NdbNode)... |
#***************************************************************************
#* *
#* Copyright (c) 2013 - Juergen Riegel <FreeCAD@juergen-riegel.net> *
#* *
#* This pr... |
# ***************************************************************************
# * *
# * Copyright (c) 2013 - Juergen Riegel <FreeCAD@juergen-riegel.net> *
# * *
# * Th... |
# ***************************************************************************
# * Copyright (c) 2015 - FreeCAD Developers *
# * Author: Bernd Hahnebach <bernd@bimstatik.org> *
# * *
# * Th... |
from __future__ import absolute_import, division, print_function
import ConfigParser
import datetime
import os
import os.path as path
import re
import sys
import psycopg2
from psycopg2.extras import RealDictCursor
from psycopg2.extensions import TRANSACTION_STATUS_INTRANS
from psycopg2.extensions import new_type, regi... |
#!/usr/bin/env python2
import matplotlib.pyplot as plt
import numpy as np
import nflgame
import random
import h5py
import os
from itertools import chain
from collections import Counter
from math import exp
'''
Directions:
1) Enter the teams below which you've already picked this season
2) Delete ratings.hdf (caches ... |
import datetime
import re
import sqlite3
from hubbot.moduleinterface import ModuleInterface
from pushbullet import PushBullet, InvalidKeyError
class Notify(ModuleInterface):
pb = None
APIKey = None
notifyTarget = "Hubbe.*"
def getAPIkey(self):
"""
Get the API key for pushbullet from t... |
#!/usr/bin/env python
#=============================================================================================
# MODULE DOCSTRING
#=============================================================================================
"""
Parameter handlers for the SMIRNOFF force field engine
This file contains standard ... |
# Copyright (c) 2014 "Hugo Herter"
# [http://hugoherter.com]
#
# This file is part of Hubbub.
#
# Vega is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your opti... |
from Bio import SeqIO
from mutation_orchestrator import Mutation_Orchestrator
import copy
import pandas as pd
import re
input_reference_fasta_file = "../data/subsampled_hg38.fa"
number_snvs = 30
number_indels = 415
number_of_tumorSVs = 100
output_normal_fasta_file = "tests/normalsim.fasta"
output_tumor_fasta_file = "... |
# TODO: Add parameters log output file to output folder
from __future__ import division
import os
import shutil
import networkx as nx
from pysurvey import basis_corr
from biom import load_table
from scipy.stats import spearmanr, pearsonr, kendalltau
from scipy.spatial.distance import jaccard, braycurtis, euclidean,... |
#####################################################################
# variables.py
#
# (c) Copyright 2013-2015, Benjamin Parzella. All rights reserved.
#
# 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 Soft... |
import os
import logging
from configparser import ConfigParser
class Env(object):
"""
NIAV Environment
"""
def __init__(self, caller=None):
"""
Parse env.ini file(s):
- from constructor
- from NIAV_ENV environment variable
:raises:... |
import pygame
import time
import random
pygame.init()
# Initialize variables
display_width = 800
display_heigth = 600
black = (0,0,0)
white = (255,255,255)
red = (200,0,0)
green = (0,200,0)
blue = (0,0,200)
bright_red = (255,0,0)
bright_green = (0,255,0)
car_width = 56
car_height = 70
pause = False
gameDisplay = p... |
import copy
from multiprocessing.sharedctypes import Value
import warnings
from collections.abc import Iterable
import numpy as np
from astropy.table import Table
from .gti import (generate_indices_of_segment_boundaries_binned,
generate_indices_of_segment_boundaries_unbinned)
from .utils import hist... |
#!/usr/bin/env python
#=============================================================================================
# MODULE DOCSTRING
#=============================================================================================
"""
Parameter handlers for the SMIRNOFF force field engine
This file contains standard ... |
import datetime
import logging
from django.db import models
from django.conf import settings
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from django.template.base import mark_safe
from django_longliving.util import pack, get_redis_client
from object_permissions import regis... |
# encoding: utf-8
'''string
'''
import sys, os
from smisk.core import URL, request
__all__ = ['parse_qvalue_header', 'tokenize_path', 'strip_filename_extension', 'normalize_url']
def parse_qvalue_header(s, accept_any_equals='*/*', partial_endswith='/*'):
'''Parse a qvalue HTTP header'''
vqs = []
highqs = []
p... |
import json
import logging
from jsonfield import JSONField
from django.db import models
from django.utils import timezone
from django.conf import settings
from django.contrib.auth import get_user_model
from sendgrid_events.signals import batch_processed
from drip.models import Drip
logger = logging.getLogger(__name_... |
"""
DogStatsApi is a tool for collecting application metrics without hindering
performance. It collects metrics in the application thread with very little overhead
(it just writes them to a `Queue <http://docs.python.org/library/queue.html>`_
with an aggressive timeout). The aggregation and network access is performed ... |
import tensorflow as tf
FLAGS = tf.app.flags.FLAGS
tf.app.flags.DEFINE_string("batch-size", 32, "")
tf.app.flags.DEFINE_float("dropout-prob", 0, "")
tf.app.flags.DEFINE_string("word-file", None, "")
|
"""
Deploy methods for Atmosphere
"""
from functools import wraps
import os
import sys
import time
from django.utils.timezone import datetime
from libcloud.compute.deployment import Deployment, ScriptDeployment,\
MultiStepDeployment
import redis
import subspace
from threepio import logger, logging, deploy_logg... |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Astropy affiliated package for image photometry utilities.
"""
# Affiliated packages may add whatever they like to this file, but
# should keep this content at the top.
# ----------------------------------------------------------------------------
fr... |
from itertools import groupby
import datetime
import os.path
import bisect
import iso8601
from flask import url_for
MIN_YEAR = 2006
ICONS = {
"member": "bill-introduced.png",
"committee": "committee-discussion.png",
"house": "house.png",
"president": "signed-by-president.png",
"unknown": "bill-i... |
import os
from config import settings
from core.db.connection import DataHubConnection
from schema.models import *
'''
Datahub DB Manager
@author: Anant Bhardwaj
@date: Mar 21, 2013
'''
class DataHubManager:
def __init__(self, user, repo_base=None):
settings.configure()
self.user = User.objects.get(usern... |
"""Portal view functions (i.e. not part of the API or auth)"""
import requests
#from cStringIO import StringIO
#from lxml import etree
from flask import current_app, Blueprint, jsonify, render_template
from flask import abort, redirect, request, session, url_for
from flask_login import login_user
from flask_user impor... |
"""
DAG module
A DAG is collection of tasks that makes sure they are executed in
the right order
"""
import warnings
import logging
from collections import OrderedDict
import collections
import subprocess
import tempfile
import networkx as nx
from dstools.pipeline.build_report import BuildReport
from dstools.pipeline... |
import copy
import warnings
from collections.abc import Iterable
import numpy as np
from .utils import histogram, show_progress, sum_if_not_none_or_initialize
from .gti import generate_indices_of_segment_boundaries_unbinned, generate_indices_of_segment_boundaries_binned
try:
import pyfftw
from pyfftw.interfac... |
import os
import os.path as op
import json
import boto3
import numpy as np
import nibabel as nib
import dipy.data as dpd
from dipy.data.fetcher import _make_fetcher
from AFQ.utils.streamlines import read_trk
__all__ = ["fetch_callosum_templates", "read_callosum_templates",
"fetch_templates", "read_templ... |
#!/usr/bin/env python
#=============================================================================================
# MODULE DOCSTRING
#=============================================================================================
"""
Parameter handlers for the SMIRNOFF force field engine
This file contains standard ... |
#!/usr/bin/env python
from __future__ import division
"""
@package mi.instrument.satlantic.par_ser_600m.driver Satlantic PAR driver module
@file mi/instrument/satlantic/par_ser_600m/driver.py
@author Steve Foley, Ronald Ronquillo
@brief Instrument driver classes that provide structure towards interaction
with the Sat... |
# 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... |
# -*- coding: utf-8 -*-
"""
hyper/http20/response
~~~~~~~~~~~~~~~~~~~~~
Contains the HTTP/2 equivalent of the HTTPResponse object defined in
httplib/http.client.
"""
import logging
import zlib
from ..common.decoder import DeflateDecoder
from ..common.headers import HTTPHeaderMap
log = logging.getLogger(__name__)
d... |
#!/usr/bin/env python
"""
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")... |
# sqlalchemy/events.py
# Copyright (C) 2005-2014 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""Core event interfaces."""
from . import event, exc
from .pool import Pool
f... |
#!/usr/bin/env python
import numpy as np
import argparse
import os
import time
from SULI import which
from SULI.execute_command import execute_command
from SULI.work_within_directory import work_within_directory
from astropy.io import fits
if __name__ == "__main__":
parser = argparse.ArgumentParser('Submit tran... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import calendar
import logging
from flask import Flask, abort, jsonify, render_template, request,\
make_response
from flask.json import JSONEncoder
from flask_compress import Compress
from datetime import datetime
from s2sphere import LatLng
from pogom.utils import get_ar... |
"""Main class ParticleFile for reading LADiM output
"""
# ---------------------------------
# Bjørn Ådlandsvik <bjorn@imr.no>
# Institute of Marine Research
# ---------------------------------
from typing import Any, List, Dict, Union, Tuple
import numpy as np
from netCDF4 import Dataset, num2date
class InstanceVa... |
import hashlib
import json
import logging
import os
import time
import functools
from threading import RLock
from node import constants, datastore, routingtable
from node.protocol import proto_store
class DHT(object):
def __init__(self, transport, market_id, settings, db_connection):
self.log = logging.g... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.