src stringlengths 721 1.04M |
|---|
"""
PhysicsPlugin is planned to provide vectors and tracking necessary to implement
SMP-compliant client-side physics for entities. Primarirly this will be used to
keep update client position for gravity/knockback/water-flow etc. But it should
also eventually provide functions to track other entities affected by SMP
ph... |
import collections
import logging
import threading
import time
import pytest
import six
from kafka import SimpleClient
from kafka.conn import ConnectionStates
from kafka.consumer.group import KafkaConsumer
from kafka.structs import TopicPartition
from test.conftest import version
from test.testutil import random_str... |
import logging
import sys
import gc
import numpy
import os.path
import matplotlib.pyplot as plt
from datetime import date
from sandbox.util.PathDefaults import PathDefaults
from sandbox.util.DateUtils import DateUtils
from sandbox.util.Latex import Latex
from sandbox.util.Util import Util
from apgl.graph import *
fro... |
"""
Handles operator precedence.
"""
from jedi._compatibility import unicode
from jedi.parser import representation as pr
from jedi import debug
from jedi.common import PushBackIterator
from jedi.evaluate.compiled import CompiledObject, create, builtin
class PythonGrammar(object):
"""
Some kind of mirror of ... |
"""
sender.py
by Charles Fracchia, Copyright (c) 2013
Sender class module
This class defines data and methods for the sender in a packet
"""
import re, warnings
allowedAttributes = ["name","brand","model","modelNum"] #In future, this could be loaded dynamically from a reference JSON
class Sender(object):
"... |
"""
Some commonly employed losses for neural net training
"""
import numpy as np
# Cross- entropy for binomial distributions
def myXent(T, Y):
return -(np.multiply(T, np.log(Y)) + np.multiply(1 - T, np.log(1 - Y)))
# this function is implemented for illustrative purposes, not recommended
# logistic-xent is a bet... |
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
"""
Siesta
======
The interaction between sisl and `Siesta`_ is one of the main goals due
to the implicit relationship ... |
#!/usr/bin/env python
#
# File: mrig.py
# Version: 1.0
#
# mrig: main program
# Copyright (c) 2016 German EA4GJA
#
# 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 Licen... |
#!/usr/bin/python
from xlrd import cellname
import re
from datetime import datetime
from utils import na_check, split_str_array, get_cell, geocode
#############################
#############################
# This file parses incoming
# excell workbooks to convert
# to JSON object array for input
# into MongoDB.
##... |
from flask import (current_app, redirect, request, render_template, jsonify,
after_this_request, Blueprint)
from werkzeug import LocalProxy
from .utils import (get_post_feedback_redirect, get_message, do_flash)
_feedback = LocalProxy(lambda: current_app.extensions['feedback'])
_datastore = LocalPr... |
import numpy as np
def _clip(x, low, high):
"""Clips coordinate between high and low.
This method was created so that `hessian_det_appx` does not have to make
a Python call.
Parameters
----------
x : int
Coordinate to be clipped.
low : int
The lower bound.
high : int
... |
"""
Copyright (c) 2017 Red Hat, Inc
All rights reserved.
This software may be modified and distributed under the terms
of the BSD license. See the LICENSE file for details.
Takes a reference to a module, and looks up or triggers a compose in the on-demand compose
server (ODCS). In addition to retrieving the URL for ... |
# -*- coding: ascii -*-
#
# Copyright 2007, 2008, 2009, 2010, 2011
# Andr\xe9 Malo or his licensors, as applicable
#
# 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.or... |
#!/usr/bin/env python
import theano
import theano.tensor as T
import numpy
import numpy as np
import pickle as pkl
from collections import OrderedDict
import cPickle as pickle
from theano import config
from theano.sandbox.rng_mrg import MRG_RandomStreams as RandomStreams
floatX = config.floatX
def shared_to_cpu(sha... |
from collections import defaultdict
class Mediator(object):
"""
Mediator class as part of the Mediator design pattern.
- External Usage documentation: U{https://github.com/tylerlaberge/PyPattyrn#mediator-pattern}
- External Mediator Pattern documentation: U{https://en.wikipedia.org/wiki/Mediator_patt... |
from aux import working_dir
import os
import sys
def no_plugin_name_message():
print "No plugin name"
sys.exit(0)
def plugin_creator_routine(plugincreator, arguments):
# print plugincreator, arguments
plugin_home_directory = working_dir()
if 'service' in plugincreator:
if ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys, os, json
from twitter import Twitter, OAuth
from twitterconfig import KEY, SECRET, OAUTH_TOKEN, OAUTH_SECRET
if len(sys.argv) < 3:
sys.stderr.write("Please input both Twitter list's owner_screen_name and slug\n")
exit(1)
LIST_USER, LIST_ID = sys.argv[... |
# Copyright (c) 2015 Catalyst IT Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in w... |
#!/usr/bin/env python
# -*- coding: ascii -*-
r"""
Support routines for exhaustive equation search in curve fit routines.
Uses itertools to find all combinations.
"""
from __future__ import print_function
from builtins import str
from itertools import combinations
from math import factorial
full_funcL = ['const','... |
# Задание 1
a = 10 * 100
b = 15 * 25
c = a / b
d = a - b * 2
print (d)
# Задание 2
#plates = int(input('Количество тарелок: '))
#detergent1 = plates * 0.5
#print ('Количество требуемового моющего средства:', detergent1)
#while (plates <= detergent1):
# detergent1 = plates * 0.5
# plates1 = (d... |
# coding: utf-8
# In[1]:
import pandas as pd
import time
from sys import argv
logfile = argv[1]
filesize = argv[2]
# # Python Pandas Benchmark
# In[3]:
prefix = "file:////Users/tony/Dropbox/Projects/UW/cse599c-17sp-projects/spark-advantage/data/"
if(filesize == 'original'):
tairfname = "Tair_WA_nohead... |
###############################################################################
#
# Tests for XlsxWriter.
#
# Copyright (c), 2013-2016, John McNamara, jmcnamara@cpan.org
#
import unittest
from ...compatibility import StringIO
from ...xmlwriter import XMLwriter
class TestXMLwriter(unittest.TestCase):
"""
Test... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri May 18 17:33:27 2018
@author: Ingmar Schuster
"""
#from __future__ import division, print_function, absolute_import
import autograd.numpy as np
import autograd.scipy as sp
import autograd.scipy.stats as stats
from autograd.numpy import exp, log, sqr... |
from cfnjsontoyaml.yamlobject.base64 import Base64
from cfnjsontoyaml.yamlobject.equals import Equals
from cfnjsontoyaml.yamlobject.findinmap import FindInMap
from cfnjsontoyaml.yamlobject.fnand import And
from cfnjsontoyaml.yamlobject.fnif import If
from cfnjsontoyaml.yamlobject.fnnot import Not
from cfnjsontoyaml.yam... |
# Copyright 2014-2017 The ODL contributors
#
# This file is part of ODL.
#
# This Source Code Form is subject to the terms of the Mozilla Public License,
# v. 2.0. If a copy of the MPL was not distributed with this file, You can
# obtain one at https://mozilla.org/MPL/2.0/.
"""Utilities for internal functionality con... |
#!/usr/bin/env python
#
# Copyright 2013 The Rust Project Developers. See the COPYRIGHT
# file at the top-level directory of this distribution and at
# http://rust-lang.org/COPYRIGHT.
#
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
#... |
# here be imports
import math # for math.exp
import random # for random.randoj
# the main abstract search node class
class SearchNode:
# super init method, takes a state and stores it,
# to be called by subclass' init method
def __init__(self, state):
self.state = state # the state of the node
... |
import os
import tempfile
import numpy as np
import xarray as xr
from typhon.files import NetCDF4
class TestNetCDF4:
def test_dimension_mapping(self):
"""
If a subgroup has not defined a dimension, but its parent group has one
with the same size and name, the subgroup should use that one... |
# Code for loading and accessing binwalk settings (extraction rules,
# signature files, etc).
import os
import binwalk.core.common as common
from binwalk.core.compat import *
class Settings:
'''
Binwalk settings class, used for accessing user and system file paths and general configuration settings.
Af... |
# -*- coding: utf8 -*-
from __future__ import unicode_literals
import time
from datetime import datetime
from eulxml import xmlmap
def windows_to_unix_timestamp(windows_timestamp):
""" Converts a Windows timestamp to Unix one
:param windows_timestamp: Windows timestamp
:type windows_timestamp: int
... |
# -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Getting Things GNOME! - a personal organizer for the GNOME desktop
# Copyright (c) 2008-2012 - Lionel Dricot & Bertrand Rousseau
#
# This program is free software: you can redistribute it and/or modify it under
# t... |
from gi.repository import Gtk
class LinkedPanes(Gtk.Bin):
def __init__(self, tl, tr, bl, br):
super(LinkedPanes, self).__init__()
if 'linked-pane':
link1 = LinkedPane(
Gtk.Orientation.HORIZONTAL,
tl, tr,
(160, 90)
)
... |
##
# Copyright (C) 2018 Jessica Tallon & Matt Molyneaux
#
# This file is part of Inboxen.
#
# Inboxen 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
#... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright (C) 2017-2020 The Project X-Ray Authors.
#
# Use of this source code is governed by a ISC-style
# license that can be found in the LICENSE file or at
# https://opensource.org/licenses/ISC
#
# SPDX-License-Identifier: ISC
import os
import random
random.seed(i... |
# Copyright (C) 2010-2011 Mathijs de Bruin <mathijs@mathijsfietst.nl>
#
# This file is part of django-shopkit.
#
# django-shopkit 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 2, or (at... |
#!/usr/bin/python3
#
# create web proxy sso keytab
# thomas@linuxmuster.net
# 20200311
#
import constants
import getopt
import os
import sys
from functions import datetime
from functions import firewallApi
from functions import getSetupValue
from functions import printScript
from functions import readTextfile
# ch... |
"""
A script to demo a defect in RectMapCollider, initial report by Netanel at
https://groups.google.com/forum/#!topic/cocos-discuss/a494vcH-u3I
The defect is that the player gets stuck at some positions, and it was confirmed
for cocos master Aug 1, 2015 (292ae676) and cocos-0.6.3-release, see cocos #248
The package ... |
import unittest
import os
import whisper
import time
import random
from carbonate.sync import heal_metric
class SyncTest(unittest.TestCase):
db = "db.wsp"
@classmethod
def setUpClass(cls):
cls._removedb()
@classmethod
def _removedb(cls):
try:
if os.path.exists(cls.d... |
'''
Code for reading and managing ASTER spectral library data.
'''
from __future__ import absolute_import, division, print_function, unicode_literals
from spectral.utilities.python23 import IS_PYTHON3, tobytes, frombytes
from .spectral_database import SpectralDatabase
if IS_PYTHON3:
readline = lambda fin: fin.r... |
#!@PYTHON@
import sys
import optparse
import os
import math
import re
import cgi
## so we can call directly as scripts/build/output-distance.py
me_path = os.path.abspath (os.path.split (sys.argv[0])[0])
sys.path.insert (0, me_path + '/../python/')
sys.path.insert (0, me_path + '/../python/out/')
X_AXIS = 0
Y_AXIS =... |
import textwrap
from ...compile import elements
from ... import parse
from ... import test
#
# Tests
#
def test_compile_fn_spec_to_bash_without_args():
expected = textwrap.dedent("""
#
# usage: hello [ARGS]
#
hello() {
""").strip()
actual = elements.compile_fn_spec_to_ba... |
'''
Created on 27. okt. 2017
@author: ljb
'''
from __future__ import division
from FYS4150.FYS4150.Project_3.source.solar_systems import EarthSunJupiterSystem, SolarSystem
from FYS4150.FYS4150.Project_3.source.ode_solvers import VelocityVerlet
from FYS4150.FYS4150.Project_3.source.utilities import solve_and_plot_earth... |
from flask import Flask, render_template, request, jsonify
# Initialize the Flask application
app = Flask(__name__)
# This route will show a form to perform an AJAX request
# jQuery is loaded to execute the request and update the
# value of the operation
@app.route('/')
def index():
return render_template('index... |
import unittest
import os
from test_helper import TESTDATA
import numpy as np
import karta
import karta.vector as vector
from karta.vector.geometry import Point, Multipoint, Line, Polygon
class GPXTests(unittest.TestCase):
def setUp(self):
self.points = [vector.gpx.Point((np.random.random(), np.random.ra... |
# Copyright (c) 2016 Universidade Federal Fluminense (UFF)
# Copyright (c) 2016 Polytechnic Institute of New York University.
# This file is part of noWorkflow.
# Please, consult the license terms in the LICENSE file.
"""Commands and argument parsers for 'now'"""
from __future__ import (absolute_import, print_function,... |
from ase import Atoms
from ase.units import Bohr
from gpaw import GPAW
from gpaw.test import equal
a = 7.5 * Bohr
n = 16
atoms = Atoms('He', [(0.0, 0.0, 0.0)], cell=(a, a, a), pbc=True)
calc = GPAW(gpts=(n, n, n), nbands=1, xc='PBE')
atoms.set_calculator(calc)
e1 = atoms.get_potential_energy()
niter1 = calc.get_number... |
#!/bin/python
"""
1. Write a function called has_duplicates that takes a list and returns True if there is any
element that appears more than once. It should not modify the original list.
2. If there are 23 students in your class, what are the chances that two of you have the same
birthday? You can estimate this prob... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
import custom_email_user
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
version = custom_email_user.__version__
if sys.argv[-1] == 'publish':
os.system('python setup.py sdist upload')
print("Y... |
"""
Django settings for pickhost project.
Generated by 'django-admin startproject' using Django 1.9.2.
For more information on this file, see
https://docs.djangoproject.com/en/1.9/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.9/ref/settings/
"""
import os
i... |
class WorkUnit(object):
def __init__(self, model, required_data_sources, dependencies=None):
"""
:param model: the data structure that is being populated with data
:param required_data_sources: one of: "nd2", "imagereader"
:type required_data_sources: str
:param depen... |
from __future__ import unicode_literals
import logging
from django.utils.translation import ugettext as _
import django.views.decorators.cache
import django.views.decorators.csrf
import django.views.decorators.debug
import django.contrib.auth.decorators
import django.contrib.auth.views
import django.contrib.auth.forms... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Cheetah is a dictionary-based webshell password violent cracker
that runs like a cheetah hunt for prey as swift and violent.
Cheetah's working principle is that it can submit a large number
of detection passwords based on different web services at once,
bla... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from collections import OrderedDict
from functools import wraps
from itertools import islice, count
import textwrap
import time
import json
import pickle
import sha
import os
import re
import urllib
import sys
import traceback
import collections
import ... |
#!/usr/bin/env python
import sys
import base64
from libs.QGAConnection import QGAConnection
def fileEncode(handle):
content = handle.readlines()
return base64.encodestring(''.join(content))
def uploadFile(socketFile, filename, content):
conn = QGAConnection(socketFile)
query = {'execute' : 'guest-fil... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2015 Dirk Stöcker <trac@dstoecker.de>
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://trac.edgewall.com/license.html.
#
# This software... |
# Script to query record_history across all AmigoCloud projects and export results to a CSV
# Must have AmigoCloud Account
# All projects must have a record_history dataset (no projects older than 2017)
from amigocloud import AmigoCloud
import csv
# AmigoCloud variables - change based on user
# token found at ap... |
# Import methods of features extraction
from features_extraction.feature_extraction import FeatureExtraction
# Import methods of learning
from learning.learning import neural_network
# Import methods of classification
from classification.classification import classify, confusion_matrix, total_error, local_error
#
fr... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os.path
import sys
import logging
import getpass
import aiml
from optparse import OptionParser
import sleekxmpp
if sys.version_info < (3, 0):
from sleekxmpp.util.misc_ops import setdefaultencoding
setdefaultencoding('utf8')
else:
raw_input = input
cl... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
showtrans.py - show files` passive translator.
Copyright (C) 2008 Anatoly A. Kazantsev
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 versio... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Adds and commits a change to a local branch (but not the current one)
"""
from __future__ import absolute_import, division, print_function, unicode_literals
import git
# import sys
class CheckoutContext(object):
def __init__(self, repo):
self.repo = repo
... |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... |
# -*- coding:utf-8 -*-
## src/config.py
##
## Copyright (C) 2003-2005 Vincent Hanquez <tab AT snarc.org>
## Copyright (C) 2003-2014 Yann Leboulanger <asterix AT lagaule.org>
## Copyright (C) 2005 Alex Podaras <bigpod AT gmail.com>
## Stéphan Kochen <stephan AT kochen.nl>
## Copyright (C) 2005-2006 Di... |
from django.contrib.sessions.middleware import SessionMiddleware
from django.utils import six
from rest_framework import status
from djet import assertions, restframework
import djoser.social.views
from social_core.exceptions import AuthException
from ..common import create_user, mock
class ProviderAuthViewTestCase... |
def isPalindromicNumber(num: int) -> bool:
"""
Determina sin un numero es palindromico
:param num: Numbero entero a evaluar
:type num: int
:return: Verdadero si es numero palindromico; Falso si no es numero palindromico
:rtype: bool
"""
try:
if type(num) != int:
raise... |
# coding: utf-8
# In[1]:
#
#
# hundred_samples = np.linspace(0.05, 0.5, num=100)
#
# Planck found \Omega_CDM
# GAVO simulated map set at \Omega_CDM = 0.122
# CAMB default below at omch2=0.122
#
# In[2]:
#
# First output 200 CAMB scalar outputs
#
# 0.005 to 0.05
#
# In[3]:
from matplotlib import pyplot as plt
... |
from __future__ import division
from CoolProp.CoolProp import PropsSI
import pylab
from ACHPTools import Write2CSV
from matplotlib.pyplot import plot, show, figure, semilogy, xlim, ylim, title, xlabel, ylabel, legend
from math import pi,exp,log,sqrt,tan,cos,sin
from scipy.optimize import brentq
from scipy.constants i... |
#!/usr/bin/python3
# apt-forktracer - a utility for managing package versions
# Copyright (C) 2008,2010,2019 Marcin Owsiany <porridge@debian.org>
#
# 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... |
#!/usr/bin/env python
#/* Part of the Maestro sequencer software package.
# * Copyright (C) 2011-2015 Canadian Meteorological Centre
# * Environment Canada
# *
# * Maestro is free software; you can redistribute it and/or
# * modify it under the terms of the GNU Lesser General Public
# * Licen... |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.5 on 2016-04-10 06:32
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('user', '0007_auto_20160410_1130'),
]
operations = [... |
#!/usr/bin/python3
"""
(C) Copyright 2021 Intel Corporation.
SPDX-License-Identifier: BSD-2-Clause-Patent
"""
import time
from pool_test_base import PoolTestBase
from server_utils import ServerFailed
class PoolCreateTests(PoolTestBase):
# pylint: disable=too-many-ancestors,too-few-public-methods
"""Pool cre... |
# Copyright 2004-2008 Roman Yakovenko.
# Distributed under the Boost Software License, Version 1.0. (See
# accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
import unittest
import autoconfig
import parser_test_case
from pygccxml import utils
from pygccxml import parser
fr... |
#!/usr/bin/env python
import os
import sys
from typing import Dict
import django
from django.core.management import call_command, execute_from_command_line
import openslides
from openslides.core.apps import startup
from openslides.utils.arguments import arguments
from openslides.utils.main import (
ExceptionArgu... |
# Copyright 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.
import datetime
import hashlib
import logging
import os
import os.path
import random
import re
import shutil
import signal
import subprocess as subprocess
im... |
import numpy as np
import pandas as pd
from unittest import TestCase
from framework import draw
X = np.array([1, 2, 3, 4, 5])
class TestSimplePlots(TestCase):
def test_kinds(self):
self.assertIsNotNone(draw.draw_kinds)
def test_line(self):
draw.draw(clear=True, kind='line', x=X, y=X)
draw.draw(clear=... |
"""Migration router."""
import os
import pkgutil
import re
import sys
from importlib import import_module
from types import ModuleType
from unittest import mock
import peewee as pw
from peewee_migrate import LOGGER, MigrateHistory
from peewee_migrate.auto import diff_many, NEWLINE
from peewee_migrate.migrator import... |
# coding: utf-8
#
# 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 requi... |
# SCBdo : DISC Track Racing Management Software
# Copyright (C) 2010 Nathan Fraser
#
# 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 3 of the License, or
# (at your option) any ... |
"""
adhan.py - The main interface for using the API.
Copyright (C) 2015 Zuhair Parvez
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any... |
# Copyright 2019 Objectif Libre
#
# 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 agr... |
import functools
import numpy as np
from scipy.stats import norm as ndist
import regreg.api as rr
# load in the X matrix
from selection.tests.instance import HIV_NRTI
X_full = HIV_NRTI(datafile="NRTI_DATA.txt", standardize=False)[0]
from selection.learning.utils import full_model_inference, liu_inference, pivot_pl... |
#!/usr/bin/env python3
# Copyright (c) 2015-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test multiple RPC users."""
from test_framework.test_framework import BitcoinTestFramework
from test_f... |
#------------------------------------------------------------------------------
# Copyright (c) 2005, Enthought, Inc.
# All rights reserved.
#
# This software is provided without warranty under the terms of the BSD
# license included in enthought/LICENSE.txt and may be redistributed only
# under the conditions describe... |
#!/usr/bin/env python
import os
from neutronclient.v2_0 import client as neutron_client
from novaclient import client as nova_client
def load_config(conf, filename):
conf.read(filename)
def get_nova_client(url=None, username=None, password=None, tenant=None):
url = os.environ.get('OS_AUTH_URL', url)
u... |
"""
MongoDB/GridFS-level code for the contentstore.
"""
from __future__ import absolute_import
import json
import os
import gridfs
import pymongo
import six
from bson.son import SON
from fs.osfs import OSFS
from gridfs.errors import NoFile
from mongodb_proxy import autoretry_read
from opaque_keys.edx.keys import Asse... |
#!/usr/bin/python
import numpy as np
import libtiff as tf
import time as tm
from operator import add
import geo
fdir = "layers/"
tdir = "geometry/"
fname = "cellsN8R"
# time the code
t1 = tm.time()
# get the reduced image stack
print "load image stack"
f = tf.TIFF3D.open(fdir+fname+".tif", mode='r')
images = f.re... |
"""
Load pp, plot and save
8km difference
"""
import os, sys
#%matplotlib inline
#%pylab inline
import matplotlib
matplotlib.use('Agg')
# Must be before importing matplotlib.pyplot or pylab!
from matplotlib import rc
from matplotlib.font_manager import FontProperties
from matplotlib import rcParams
from mpl_to... |
from slacker import Slacker
from datetime import timedelta, datetime
from time import mktime
import os, argparse
slack = Slacker('YOUR_API_KEY_GOES_HERE')
parser = argparse.ArgumentParser(description='Slack direct messages, private groups and general channel export')
parser.add_argument('-g', '--groups', action='stor... |
''' mongoengine models
'''
from mongoengine import *
class User(Document):
''' some are admins some are not
'''
admin_rights = BooleanField(required=True)
api_id = StringField()
api_key = StringField()
email = EmailField(required=True, unique=True, max_length=254)
email_confirmation_code =... |
# Copyright (c) 2017 The Regents of the University of Michigan
# All rights reserved.
# This software is licensed under the BSD 3-Clause License.
import logging
from .configobj.validate import Validator
from .configobj.validate import VdtValueError
logger = logging.getLogger(__name__)
def version(value, *args, **k... |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... |
# This file is part of MyPaint.
# Copyright (C) 2013-2018 by the MyPaint Development Team
#
# 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
# (at your option)... |
import json
from ipuz.exceptions import IPUZException
from ipuz.puzzlekinds import IPUZ_PUZZLEKINDS
from ipuz.validators import (
IPUZ_FIELD_VALIDATORS,
validate_version,
get_version_number,
get_kind_version_number,
)
# The versions of the ipuz standard that this library supports
IPUZ_VERSIONS = list(... |
import logging
import traceback
import asyncio
import requests
import dickord
route = dickord.route
import config
logging.basicConfig(level=logging.DEBUG)
logger = logging.getLogger('userbot')
benis = dickord.Dicker(user_pass=('luna@localhost', 'fuck'))
@benis.sensor('READY')
async def ready_for_work(payload):
... |
import os
import socket
import fcntl
import struct
import subprocess
import logging
logger = logging.getLogger(__name__)
class CmdLine(object):
options = {}
class __metaclass__(type):
def __new__(cls, *kargs, **kwargs):
t = type.__new__(cls, *kargs, **kwargs)
with open("/proc/... |
# Set up spaCy
from scipy.stats import norm
from spacy.en import English
import sys
import matplotlib.pyplot as plt
import matplotlib.mlab as mlab
from readability.readability import Readability
# parser = English()
pipeline = English()
length_normalized_complexity = []
FKGradeLevel = []
with open('./WSJ/wsj.flat')... |
import os
from shopify_settings import *
SITE_ROOT = os.path.dirname(os.path.realpath(__file__))
try:
from djangoappengine.settings_base import *
USING_APP_ENGINE = True
except ImportError:
USING_APP_ENGINE = False
DEBUG = True
TEMPLATE_DEBUG = DEBUG
DATABASES = {
'default': {
... |
"""
Multiple servers/ports
======================
If you need to start more than one HTTP server (to serve on multiple ports, or
protocols, etc.), you can manually register each one and then start them all
with bus.transition("RUN")::
s1 = ServerPlugin(bus, MyWSGIServer(host='0.0.0.0', port=80))
s2 = ServerPl... |
# encoding: utf-8
# Copyright 2013 Red Hat, 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 applica... |
# -*- coding: utf-8 -*-
# ProjectEuler/src/python/problem112.py
#
# Bouncy numbers
# ==============
# Published on Friday, 30th December 2005, 06:00 pm
#
# Working from left-to-right if no digit is exceeded by the digit to its left
# it is called an increasing number; for example, 134468. Similarly if no digit
# is ex... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.