text stringlengths 17 737k |
|---|
import csv
import mimetypes
import socket
import StringIO
import urllib2
from datetime import datetime
from urlparse import urlparse
from django.conf import settings
from django.contrib import messages
from django.contrib.admin.views.decorators import staff_member_required
from django.contrib.auth import get_user_mode... |
# Django settings for ielex project.
import sys
import os.path
# import logging
# DEBUG = True
# TEMPLATE_DEBUG = DEBUG
ROOTDIR = os.path.abspath(os.path.dirname(__file__))
VERSION = "0.9"
# set this in local_settings.py
# ADMINS = ( ('Your Name', 'your_email@domain.com'),)
# MANAGERS = ADMINS
# Local time zone for... |
#TODO: Nitya
class GlobalConsnesus:
# List of frozensets , where a[i] corresponds to the new blocks from a tick stored in a
# frozenset
ledger = []
@classmethod
def consensus_tick(cls, nodes):
pass
# run global consensus, update ledger
class ConsensusNode():
# Simulated consensus node
... |
import logging
import os
import numpy as np
def nonzeros(m, row):
""" returns the non zeroes of a row in csr_matrix """
for index in range(m.indptr[row], m.indptr[row+1]):
yield m.indices[index], m.data[index]
_checked_blas_config = False
def check_blas_config():
""" checks to see if using Op... |
import random
import os.path
import copy
from Bio import SeqIO
from Bio.Seq import Seq
from Bio.SeqRecord import SeqRecord
from Bio.Alphabet import generic_dna
class Nucleic_Acid(object):
class DNA:
def __init__(self, length=1000, seq=None):
"""DNA class takes a length parameter and generates a sequence of
t... |
# -*- coding: utf-8 -*-
###
# (C) Copyright (2012-2019) Hewlett Packard Enterprise Development LP
#
# 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 limi... |
from __future__ import division
import time
from math import log, sqrt
from random import choice
class MonteCarlo(object):
def __init__(self, board, **kwargs):
self.board = board
self.history = []
self.wins = {}
self.plays = {}
self.max_depth = 0
self.data = {}
... |
#!/usr/bin/env python3
import sys
import time
import signal
import serial
import struct
import requests
import urllib.parse
from datetime import datetime
from typing import List, Optional
from cereal import messaging
from common.params import Params
from system.swaglog import cloudlog
from system.hardware import TICI
... |
# Copyright (C) 2015 Huawei Technologies India Pvt Ltd.
# 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
#
# Unl... |
import matplotlib.pyplot as plt
import numpy as np
import pymc as pm
import scipy.stats as stats
import scipy.optimize as sop
def main():
plt.subplot(311)
x = np.linspace(0, 60000, 200)
sp1 = plt.fill_between(x, 0, stats.norm.pdf(x, 35000, 7500),
color="#348ABD", lw=3, alpha=0.6... |
# -*- coding: utf-8 -*-
"""
@file
@brief Default values for the Sphinx configuration.
"""
import sys
import os
import datetime
import re
import warnings
from sphinx.builders.html import Stylesheet
from sphinx.errors import ExtensionError
from .style_css_template import style_figure_notebook
if sys.version_info[0] =... |
import numpy as np
from .lazy import *
import numbers
class TimeSeries():
'''
"""
Help on package TimeSeries:
NAME
TimeSeries
DESCRIPTION
TimeSeries
=====
Provides
1. An sequence or any iterable objects
How to use the documentation
----------------------------
Documentatio... |
# Copyright 2015 The TensorFlow 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 applica... |
import os
import shutil
import zipfile
from datetime import datetime
from inspect import isclass
# Required PIL classes may or may not be available from the root namespace
# depending on the installation method used.
try:
import Image
import ImageFile
import ImageFilter
import ImageEnhanc... |
import os
import sys
import argparse
import agasc
from kadi import events
from Ska.engarchive import fetch, fetch_sci
from astropy.table import Table, Column
from Chandra.Time import DateTime
import mica.archive.obspar
from mica.starcheck import get_starcheck_catalog, get_starcheck_catalog_at_date
import tables
import ... |
#!/usr/bin/env python
#
# cvs2svn: ...
#
# $LastChangedRevision$
import rcsparse
import os
import sys
import sha
import re
import time
import fileinput
import string
import getopt
import stat
import string
import md5
import anydbm
import marshal
# Make sure this Python is recent enough.
import sys
# Warnings and er... |
# -*- coding: utf-8 -*-
# Lindley Graham 3/10/2014
"""
This modules contains functions for adaptive random sampling. We assume we are
given access to a model, a parameter space, and a data space. The model is a
map from the paramter space to the data space. We desire to build up a set of
samples to solve an inverse pro... |
import sys
sys.path.append('/nfs/xf05id1/src/nsls2-xf-utils')
import srxslit
import srxfe
import srxbpm
import tempdev
import srxm2
#wb=srxslit.nsls2slit(tb='XF:05IDA-OP:1{Slt:1-Ax:T}',bb='XF:05IDA-OP:1{Slt:1-Ax:B}',ib='XF:05IDA-OP:1{Slt:1-Ax:I}',ob='XF:05IDA-OP:1{Slt:1-Ax:O}')
#pb=srxslit.nsls2slit(ib='XF:05IDA-OP:1{... |
#!/usr/bin/python
# glib-client-gen.py: "I Can't Believe It's Not dbus-binding-tool"
#
# Generate GLib client wrappers from the Telepathy specification.
# The master copy of this program is in the telepathy-glib repository -
# please make any changes there.
#
# Copyright (C) 2006, 2007 Collabora Limited
#
# This libra... |
#!/usr/bin/python
# Copyright (c) 2009 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Update third_party/WebKit using git.
Under the assumption third_party/WebKit is a clone of git.webkit.org,
we can use git commands ... |
# -*- coding: utf-8 -*-
from __future__ import division
from functools import partial
import logging
from numpy import (
busday_count as original_busday_count, datetime64, logical_not as not_, logical_or as or_, maximum as max_,
minimum as min_, round as round_, timedelta64
)
from ....base import * # n... |
'''
Module of classes used to create visualizations of data produced by the experiment and learners.
'''
from __future__ import absolute_import, division, print_function
__metaclass__ = type
import mloop.utilities as mlu
import mloop.learners as mll
import mloop.controllers as mlc
import numpy as np
import logging
imp... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from django.contrib.contenttypes.models import ContentType
from django.core.urlresolvers import reverse
from django.db import models
from django.utils.translation import ugettext_lazy as _
from data_exports.compat import python_2_unicode_compatible
@python_2_unicode_com... |
__version__ = '0.5.12'
|
try:
from collections import UserDict
except ImportError:
from UserDict import UserDict
from django.db.models.fields import FieldDoesNotExist
from django.template.loader import render_to_string
from django.utils.encoding import StrAndUnicode
# Sane boundary constants
MINIMUM_PAGE_LENGTH = 5
DEFAULT_OPTIONS =... |
# Author: xiaotaw@qq.com (Any bug report is welcome)
# Time Created: Nov 2016
# Time Last Updated: Dec 2016
# Addr: Shenzhen, China
# Description:
import os
import getpass
import numpy as np
import pandas as pd
from scipy import sparse
from collections import defaultdict
data_dir = "/home/%s/Documents/chembl/data_fil... |
from __future__ import unicode_literals
from prompt_toolkit.keys import Keys
import prompt_toolkit.filters as filters
from ..input_processor import KeyPress
from .utils import create_handle_decorator
__all__ = (
'load_basic_bindings',
)
def load_basic_bindings(registry, filter=None):
handle = create_handl... |
# pylint: disable=C0111
# pylint: disable=W0621
from lettuce import world, step
from nose.tools import assert_true
from auth.authz import get_user_by_email, get_course_groupname_for_role
from selenium.webdriver.common.keys import Keys
import time
from django.contrib.auth.models import Group
from logging import getL... |
from unittest.mock import Mock
import pytest
from ...fixtures.factories import ReleaseFactory
from ..utils import send_release_webhook
def test_send_release_webhook(mocked_responses, mocker, transactional_db):
mocker.patch(
"metaci.release.utils.settings",
METACI_RELEASE_WEBHOOK_URL="https://web... |
import re
import logging
from pajbot.apiwrappers.response_cache import DateTimeSerializer
from pajbot.apiwrappers.twitch.base import BaseTwitchAPI
log = logging.getLogger(__name__)
class TwitchHelixAPI(BaseTwitchAPI):
authorization_header_prefix = "Bearer"
def __init__(self, redis, app_token_manager):
... |
#!/usr/bin/env python2.7
"""
vg_index.py: index a graph so it can be mapped to
"""
from __future__ import print_function
import argparse, sys, os, os.path, errno, random, subprocess, shutil, itertools, glob, tarfile
import doctest, re, json, collections, time, timeit
import logging, logging.handlers, SocketServer, str... |
"""Simple HTTP Server.
This module builds on BaseHTTPServer by implementing the standard GET
and HEAD requests in a fairly straightforward manner.
"""
__version__ = "0.6"
__all__ = ["SimpleHTTPRequestHandler"]
import os
import posixpath
import BaseHTTPServer
import urllib
import urlparse
import cgi
import shutil
... |
#!/usr/bin/env python
import sys; sys.path.append("..")
from lilypond.interp import parse
from midi.write_midi import SMF
from core import MIDI_PITCH, OFFSET_64
patterns = [
r"\relative c' { \acciaccatura c8 e4 \acciaccatura c8 e4 \acciaccatura c8 e4 }", #1
r"\relative c' { \acciaccatura c8 e8 f8 e4 }",
... |
# FIXME: document dependencies, expect command line `git` with support
# for shallow clones (not in old git versions)
# FIXME: I added some type annotations, but I did not use a static
# type checker. Hence, there are errors and missing definitions!
import sys
import os
import shutil
from tempfile import TemporaryDi... |
#! /usr/bin/env python
"""
Copyright [1999-2018] EMBL-European Bioinformatics Institute
Licensed under the Apache License, Version 2.0 (the "License")
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless requir... |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""A simple bot script.
This sample script leverages web.py (see http://webpy.org/). By default the
web server will be reachable at port 8080 - append a different port when
launching the script if desired. ngrok can be used to tunnel traffic back to
your server if you ... |
# -*- coding: utf-8 -*-
from __future__ import division
import csv
import codecs
import json
import logging
import pkg_resources
import sys
from numpy import array, ceil, datetime64, fromiter, int16, logical_or as or_, logical_and as and_, logical_not as not_
import openfisca_france
from openfisca_core.periods impo... |
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2020, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... |
# -*- coding: utf-8 -*-
from __future__ import division
import csv
import codecs
import json
import logging
import pkg_resources
import sys
from numpy import array, ceil, datetime64, fromiter, int16, logical_or as or_, logical_and as and_, logical_not as not_
import openfisca_france
from openfisca_core.periods impo... |
# Copyright 2001-2005 by Vinay Sajip. All Rights Reserved.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose and without fee is hereby granted,
# provided that the above copyright notice appear in all copies and that
# both that copyright notice and this permissio... |
#!/usr/bin/env python
# =============================================================================================
# MODULE DOCSTRING
# =============================================================================================
"""
Parameter handlers for the SMIRNOFF force field engine
This file contains standar... |
from __future__ import absolute_import, division, print_function, with_statement
from tornado.concurrent import Future
from tornado import gen
from tornado.escape import json_decode, utf8, to_unicode, recursive_unicode, native_str, to_basestring
from tornado.httputil import format_timestamp
from tornado.iostream import... |
import os, socket, pdb
import SocketServer, threading, BaseHTTPServer
import StanfordUtils
from stat import *
packagename = StanfordUtils.getPackageName(__name__)
basepath = ''
def SystemTestModifyConfig(env, cfgfilename):
global basepath
basepath = os.path.join(os.path.join(env['BASEOUTDIR'].Dir(env['RELTARG... |
import pyuv
import datetime
import errno
import logging
import time
import thread
from collections import deque
from tornado import stack_context
def install():
_tornado_ioloop = __import__('tornado.ioloop', fromlist=['foobar'])
_IOLoop = _tornado_ioloop.IOLoop
class Waker(object):
def __init... |
# Copyright 2022 Planet Labs, PBC.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... |
import unittest
from test import support
from contextlib import closing
import gc
import pickle
import select
import signal
import struct
import subprocess
import traceback
import sys, os, time, errno
from test.script_helper import assert_python_ok, spawn_python
try:
import threading
except ImportError:
threadi... |
import operator as op
from functools import partial
from itertools import permutations
import logging
import lib.const as C
import lib.visit as v
from ... import add_artifacts
from ... import util
from ...encoder import add_ty_map
from ...meta import class_lookup
from ...meta.template import Template
from ...meta.cla... |
from django.core.management.base import BaseCommand, CommandError
from opaque_keys import InvalidKeyError
from optparse import make_option
from student.models import CourseEnrollment, User
from opaque_keys.edx.keys import CourseKey
from opaque_keys.edx.locations import SlashSeparatedCourseKey
class Command(BaseComma... |
import gtk
import libvirt
import libvirtglib
import getopt
import sys
def eventToString(event):
eventStrings = ( "Added",
"Removed",
"Started",
"Suspended",
"Resumed",
"Stopped",
"Saved",
... |
# This file is part of Booktype.
# Copyright (c) 2012 Aleksandar Erkalovic <aleksandar.erkalovic@sourcefabric.org>
#
# Booktype 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 Li... |
"""
Encapsulates the SNAP aligner.
An important message from the fine folks at SNAP:
You may process more than one alignment without restarting SNAP, and if possible without reloading
the index. In order to do this, list on the command line all of the parameters for the first
alignment, followed by a comma (separate... |
import sys
try:
import networkx
import matplotlib.pyplot as plt
NETWORKX = True
except Exception:
print 'no networkx'
NETWORKX = False
import numpy as NP
import random
import math
import time
from tensorlog import declare
from tensorlog import matrixdb
from tensorlog import dataset
from tensorlog i... |
#!/usr/bin/env python2
import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk
import libvirt
import getopt
import sys
gi.require_version('LibvirtGLib', '1.0')
from gi.repository import LibvirtGLib
def eventToString(event):
eventStrings = ( "Added",
"Removed",
... |
import pygame
from pygame.surface import Surface
import Vector2
from Helpers.EventHelpers import EventExist
class ArrowItem:
def __init__(self, offset: Vector2, image: Surface=None, hover: Surface=None, rect=None):
self.Offset = offset
self.Image = image if image is not None else self._getTexture(... |
import csv
import datetime
import logging
import requests
import tempfile
from django.core.management.base import BaseCommand
from django.db import connection
from framework.celery_tasks import app as celery_app
from requests_oauthlib import OAuth2
from website.settings import REG_METRICS_BASE_FOLDER, REG_METRICS_OSF... |
#
# Copyright (c) 2005-2006 rPath, Inc.
# All Rights Reserved
#
import time
from mint import buildtypes
from mint.reports.mint_reports import MintReport
class SiteSummary(MintReport):
title = 'Site Summary'
headers = ('Metric', 'Answer')
def getData(self, reportTime = time.time()):
data = []
... |
#!/usr/bin/env python
"""
Import all data from **all** json files in the given path:
(1) converting them to csv files
(2) processing timestamps nested in the csv files, if necessary
(3) importing the csv files to temporary json tables
(4) write the corresponding relational tables
"""
import os
db = os.envir... |
# -*- coding: utf-8 -*-
#
# Poio Tools for Linguists
#
# Copyright (C) 2009-2013 Poio Project
# Author: António Lopes <alopes@cidles.eu>
# URL: <http://media.cidles.eu/poio/>
# For license information, see LICENSE.TXT
import sys, getopt
import poioapi.annotationgraph
def main(argv):
inputfile = ''
outputfile... |
# -*- coding: utf-8 -*-
"""Option persistence."""
import re
import collections
from threading import Lock
from functools import cmp_to_key
from ..csutil import lockme
from .. import logger
from .conf import Conf
try:
import cPickle as pickle
except:
import pickle
from ..milang import Scriptable
from .aggregativ... |
## Copyright (c) Cognitect, Inc.
## All rights reserved.
import collections
class Keyword(object):
def __init__(self, value):
assert isinstance(value, str) or isinstance(value, unicode)
self.str = value
def __hash__(self):
return hash(self.str)
def __eq__(self, other):
as... |
# -*- coding: utf-8 -*-
"""
Created on Mon Aug 14 15:11:13 2017
@author: Benjamin
"""
import numpy as np
from copy import deepcopy
from utilities import remove_all
def get_contact_bins(device, contacts, interact_mtrx):
contact_starter_atom_list = []
for contact in contacts:
contact_edge_list = []
... |
#### PATTERN | ES | RULE-BASED SHALLOW PARSER ######################################################
# -*- coding: utf-8 -*-
# Copyright (c) 2012 University of Antwerp, Belgium
# Author: Tom De Smedt <tom@organisms.be>
# License: BSD (see LICENSE.txt for details).
# http://www.clips.ua.ac.be/pages/pattern
############... |
# Copyright 2018 The TensorFlow 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 applica... |
#!/usr/bin/env python3
from utility import get_time
import argparse
import os
import sys
import subprocess
import json
import awsremote
import scheduler
# Finding files such as `this_(that)` requires `'` be placed on both
# sides of the quote so the `()` are both captured. Files such as
# `du_Parterre_d'Eau` must be ... |
{
"targets": [{
"target_name": "opencv"
, "sources": [
"src/init.cc"
, "src/Matrix.cc"
, "src/OpenCV.cc"
, "src/CascadeClassifierWrap.cc"
, "src/Contours.cc"
, "src/Point.cc"
, "src/VideoCaptureWrap.cc"
]
, "conditions": [
[... |
#!/usr/bin/python
#
# Default settings for plotarrd webapplication.
#
#-----------------------------------------------------------------------------
import os
#-----------------------------------------------------------------------------
APP_ROOT = os.path.dirname(os.path.dirname(__file__))
RRD_PATH = '/var/lib/col... |
from collections import defaultdict
import os
import argparse
import decimal
from ast import literal_eval
import tables
import numpy as np
import matplotlib.pyplot as plt
import scipy.sparse
from sympy import re, im, Float
from .tests.test_transmute import run_transmute_test
from .origen_all import TIME_STEPS
from .u... |
# -*- coding: utf-8 -*-
"""Indexing hdf5 files"""
# NOTICE: THIS FILE IS ALSO PART OF THE CLIENT. IT SHOULD NOT CONTAIN
# REFERENCES TO THE SERVER OR TWISTED PKG.
ext = '.h5'
import hashlib
import os
import cPickle as pickle
from traceback import print_exc
import sqlite3
import functools
import threading
from misura.... |
PAGE_NAME = "getnutz"
PAGE_TITLE = "Get Nutz"
BASE_TEMPLATE = "logged_in_base.html"
LAYOUTS = {
'DEFAULT' : ( ("scoreboard", "100%"),
(("upcoming_events", "40%"), ("smartgrid_game", "60%"),),
),
'PHONE_PORTRAIT' : ( ("upcoming_events", "100%"),
("sma... |
#!/usr/bin/env python
#
# local_tests.py: testing working-copy interactions with ra_local
#
# Subversion is a tool for revision control.
# See http://subversion.tigris.org for more information.
#
# ====================================================================
# Copyright (c) 2000-2001 CollabNet. All ri... |
# -*- coding: utf-8 -*-
# Copyright 2017 Eficent Business and IT Consulting Services S.L.
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
import time
from odoo import api, fields, models
from odoo.tools.translate import _
from odoo.exceptions import Warning
from odoo.exceptions import ValidationE... |
{
"targets": [
{
"target_name": "mcrypt",
"sources": [
"src/mcrypt.cc"
],
"include_dirs": [
"/usr/include/",
"/opt/local/include/",
"/usr/local/Cellar/mcrypt/",
"<!(node -e \"requi... |
{
"targets": [{
"target_name": "cares_wrap",
"include_dirs": [
"<!(node -e \"require('nan')\")",
"deps/cares/include",
"deps/cares/src"
],
"sources": [
"src/cares_wrap.cc"
],
"dependencies": [ "deps/cares/cares.gyp:cares... |
'''
(c) 2011, 2012 Georgia Tech Research Corporation
This source code is released under the New BSD license. Please see
http://wiki.quantsoftware.org/index.php?title=QSTK_License
for license details.
Created on Jan 1, 2011
@author:Drew Bratcher
@contact: dbratcher@gatech.edu
@summary: Contains tutorial for backteste... |
import math
import numpy as np
import torch
import copy
import logging
import os
import pickle as cp
# eps for numerical stability
eps = 1e-6
class YFOptimizer(object):
def __init__(self, var_list, lr=0.0001, mu=0.0, clip_thresh=None, weight_decay=0.0,
beta=0.999, curv_win_width=20, zero_debias=True, sparsity_d... |
#!/usr/bin/env python
# Copyright (c) 2013 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.
"""This module contains utilities for managing gclient checkouts."""
from common import find_depot_tools
import os
import shell_... |
##########################################################################
#
# Copyright (c) 2012, John Haddon. All rights reserved.
# Copyright (c) 2013, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that ... |
# -*- coding: utf-8 -*-
# FOGLAMP_BEGIN
# See: http://foglamp.readthedocs.io/
# FOGLAMP_END
import os
import subprocess
from pathlib import Path
from aiohttp import web
from foglamp.common import logger
from foglamp.services.core.support import SupportBuilder
__author__ = "Ashish Jabble"
__copyright__ = "Copyright (... |
import unittest
import numpy as np
import pandas as pd
import scipy.sparse
import smurff
verbose = 0
class TestPredictSession(unittest.TestCase):
# Python 2.7 @unittest.skip fix
__name__ = "TestPredictSession"
def run_train_session(self):
Ydense = np.random.normal(size = (10, 20)).reshape((10,20... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import logging
import os
import typing
from builtins import str
from typing import Any, Dict, List, Optional, Text, Tuple
from rasa_nlu.config import RasaNLUModelConfig... |
#!/usr/bin/env python3
# Copyright (c) 2018-2020 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Useful util functions for testing the wallet"""
from collections import namedtuple
from test_framework... |
# -*- test-case-name: twittytwister.test.test_streaming -*-
#
# Copyright (c) 2008 Dustin Sallings <dustin@spy.net>
# Copyright (c) 2009 Kevin Dunglas <dunglas@gmail.com>
# Copyright (c) 2010-2012 Ralph Meijer <ralphm@ik.nu>
# See LICENSE.txt for details
"""
Twisted Twitter interface.
"""
import base64
import urll... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals
__author__ = "Gina Häußge <osd@foosel.net>"
__license__ = "GNU Affero General Public License http://www.gnu.org/licenses/agpl.html"
__copyright__ = "Copyright (C) 2014 The OctoPrint Project - Released under terms... |
"""
typeschema is a wrapper for jsonschema that provides some helpers, a simpler
interface, and lets the user define its own types.
"""
import jsonschema as js
_default_types = {}
class Checker(object):
"""
A Checker wraps a jsonschema.Draft4Validator, allowing the user to define
custom types.
Some... |
#
# Collective Knowledge (platform - GPGPU)
#
# See CK LICENSE.txt for licensing details
# See CK COPYRIGHT.txt for copyright details
#
# Developer: Grigori Fursin, Grigori.Fursin@cTuning.org, http://fursin.net
#
cfg={} # Will be updated by CK (meta description of this module)
work={} # Will be updated by CK (tempora... |
from falcon import API
#after_hooks = []
before_hooks = []
# def after_request(req, resp, kwargs):
# for hook in after_hooks:
# hook(req, resp, kwargs)
def before_request(req, resp, kwargs):
for hook in before_hooks:
hook(req, resp, kwargs)
class Babelfish(API):
""" Class docs go here... |
from datetime import datetime,timedelta
from dateutil.parser import parse
from time import localtime,strftime
from django.conf import settings
from pytz import timezone
from django.utils import timezone as timezone_dt
from tzwhere import tzwhere
def get_epoch(tz=None):
"""
Return number of seconds since 1970... |
import hmac
import struct
from hashlib import sha1
from http.client import HTTPConnection
from time import time
from typing import Optional, Tuple
from .constants import ENROLL_HOSTS, PATHS
from .crypto import decrypt, encrypt, get_one_time_pad, restore_code_to_bytes
from .utils import normalize_serial
class HTTPErr... |
"""
Team Testing Module
"""
import pytest
import api.user
import api.team
import api.common
import bcrypt
from api.common import APIException
from common import clear_collections
@pytest.mark.usefixtures("db")
class TestTeams(object):
"""
API Tests for team.py
"""
base_team = {
"team_name":... |
"""
Django settings for freelancefinder application.
Requires django-environ
"""
import environ
# from . import VERSION
VERSION = '0.0.3'
root = environ.Path(__file__) - 2
env = environ.Env(DEBUG=(bool, False),)
environ.Env.read_env(root('.env'))
BASE_DIR = root()
SECRET_KEY = env('SECRET_KEY')
DEBUG = env('DEBUG... |
import pycountry
from irco import logging
_cache = {}
log = logging.get_logger()
NAMES = {c.name.lower(): c for c in pycountry.countries.objects}
SUBDIVISIONS = {s.name.lower(): s for s in pycountry.subdivisions.objects}
PREFIXES = set([
'Republic of',
])
REPLACEMENTS = {
'South Korea': 'Korea, Republic of... |
#!/usr/bin/env python
# TODO
# - validation
# - init script
# - install on server with /sbin/chkconfig so it auto-starts on boot-up
# - more fine-grained storing (integration, scaling, ...)
# - store to AutoProcStatus
# - CFE "promise" that it remains running?
#
# DONE
# - logging and error handling (including loggi... |
#!/usr/bin/env python3
# """Multi purpose script for HNC inverse methods"""
#
# Copyright 2009-2017 The VOTCA Development Team (http://www.votca.org)
#
# 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 Lice... |
#!/usr/bin/env python
"""Checks code blocks in ReStructuredText."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import argparse
import subprocess
import sys
import tempfile
from docutils import core, nodes, util... |
# Copyright (c) 2019 PaddlePaddle 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 appli... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Displays network traffic
* No extra configuration needed
contributed by `izn <https://github.com/izn>`_ - many thanks!
"""
import psutil
import netifaces
import core.module
import core.widget
import util.format
WIDGET_NAME = "network_traffic"
class Module(core... |
# -*- coding: utf-8 -*-
"""
edacc.views.frontend
--------------------
This module defines request handler functions for the main functionality
of the web application.
:copyright: (c) 2010 by Daniel Diepold.
:license: MIT, see LICENSE for details.
"""
import csv
import datetime
try:
from c... |
import os
import pickle
from indra.preassembler.hierarchy_manager import hierarchies
from indra.preassembler import Preassembler, render_stmt_graph,\
flatten_evidence
from indra.mechlinker import MechLinker
from indra.assemblers import PysbAssembler, IndexCardAssembler,\
... |
from logging import getLogger
from .autodiscover import discover
from .configuration import Configuration
from .credentials import Credentials, DELEGATE, IMPERSONATION
from .errors import ErrorFolderNotFound, ErrorAccessDenied
from .folders import Root, Calendar, Inbox, Tasks, Contacts, SHALLOW, DEEP
from .protocol im... |
# Copyright 2018 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.
"""Standalone Python script to extract an archive. Intended to be used by
the 'archive' recipe module internally. Should not be used elsewhere.
""... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.