text stringlengths 475 200k |
|---|
from .EnvVarCondition import *
from ....Helpers import logging_helper
from ....Helpers.pbPlist import pbItem
import objc
import re
from .EnvConstants import *
class EnvVariable(object):
def __init__(self, dictionary):
self.added_after = False;
self.mergedKeys = set();
self.parentValue... |
# F3AT - Flumotion Asynchronous Autonomous Agent Toolkit
# Copyright (C) 2010,2011 Flumotion Services, S.A.
# All rights reserved.
# 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... |
# 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 ... |
#!/usr/bin/env python3
# Copyright (c) 2014-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 re-org scenarios with a mempool that contains transactions
# that spend (directly or indirectly)... |
from fabric.api import local
from fabric.colors import blue, red
######################################################################
# FABRIC Fabfile. <http://www.fabfile.org/>
# This is the file to configure Fabric Python Library to admin tasks
# Use:
# fab <command>
# How to know the commands? :
# fab -l
# I... |
import collections
import contextlib
import dataclasses
import datetime
import json
import os
from absl.testing import absltest
from absl.testing import parameterized
import kubernetes
import tensorflow as tf
os.environ['BQ_DATASET'] = 'fake-dataset'
import handler.main
import handler.bigquery_client
from publisher i... |
# -*- coding: utf-8 -*-
"""
***************************************************************************
runtimeprofiler.py
---------------------
Date : May 2020
Copyright : (C) 2020 by Nyall Dawson
Email : nyall dot dawson at gmail dot com
*****************... |
#!/usr/bin/python
# coding=utf-8
import urllib
#import urllib2
#import cookielib
import os,time,string
import sys
import re
import random
from trade_url import *
import configparser
# from crack_vc import crack_vc
from stock_util import *
from html_parser import *
#from crack_bmp import *
from fateadm_api import *
impo... |
#!/usr/bin/env python3
"""
Please install cloudflare and requests via pip, e.g. `pip install cloudflare`
This script handles the creation and update on a given domain, subdomain and an
IP which either be the public IP by default, or an internal IP if given device
name.
It only handles the IP and everything else is de... |
""" Generic Python Character Mapping Codec.
Use this codec directly rather than through the automatic
conversion mechanisms supplied by unicode() and .encode().
Written by Marc-Andre Lemburg ([EMAIL]).
(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.
"""#"
import codecs
### Codec A... |
#!/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 "Li... |
#!/usr/bin/python
# Copyright: Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... |
"""Connection file-related utilities for the kernel
"""
# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
from __future__ import absolute_import
import json
import sys
from subprocess import Popen, PIPE
import warnings
from IPython.core.profiledir import ProfileDir
... |
"""Raspberry Pi Face Recognition Treasure Box
Face Detection Helper Functions
Copyright 2013 Tony DiCola
Functions to help with the detection and cropping of faces.
"""
import cv2
import fnmatch
import os
import re
import numpy as np
import csv
import config
haar_faces = None
MEAN_FILE = 'mean.png'
def init():
... |
import os
import tempfile
import warnings
from django.core.exceptions import ImproperlyConfigured
try:
from django.utils.image import Image
except ImproperlyConfigured:
Image = None
from django.core.files.storage import FileSystemStorage
from django.db import models
from django.db.models.fields.files import ... |
# -*- coding: utf-8 -*-
#
# LICENCE MIT
#
# DESCRIPTION Test suite for variable assigns.
#
# AUTHOR Michal Bukovsky <[EMAIL]>
#
import pytest, re
from functools import wraps
from callgraph.builder import CallGraphBuilder
from tests.helpers import dfs_node_names
def test_ops_not():
def fun():
... |
from django.urls import reverse
from rest_framework.test import APITestCase
from consents.models import Consent, Term
from workshops.models import (
Airport,
Award,
Badge,
Event,
Organization,
Person,
Role,
Task,
)
class TestAPIStructure(APITestCase):
def setUp(self):
self... |
# -*- coding: utf-8; -*-
#
# This file is part of Superdesk.
#
# Copyright 2013, 2014, 2015 Sourcefabric z.u. and contributors.
#
# For the full copyright and license information, please see the
# AUTHORS and LICENSE files distributed with this source code, or
# at https://www.sourcefabric.org/superdesk/license
from s... |
#!/usr/bin/env python
#coding:utf-8
"""
Author: Marco Mescalchin --<>
Purpose: Wrapper to telegram bot api
Created: 06/25/15
"""
import requests,json
from threading import Timer
from django.core.cache import cache
from django.conf import settings
from telegrambot.signals import message_received
DEBUG_GET_POST = ... |
# -*- coding: utf-8 -*-
'''
Mepinta
Copyright (c) 2011-2012, Joaquin G. Duo, [EMAIL]
This file is part of Mepinta.
Mepinta 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 ... |
#!/usr/bin/python
# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import os
import io
import logging
import base64
import gzip
import requests
from google.protob... |
#!/usr/bin/python
# Copyright 2013 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by a... |
"""
Support for converting a django user to an XBlock user
"""
from django.contrib.auth.models import User
from opaque_keys.edx.keys import CourseKey
from xblock.reference.user_service import XBlockUser, UserService
from student.models import anonymous_id_for_user, get_user_by_username_or_email
ATTR_KEY_IS_AUTHENTICAT... |
# Copyright 2020 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 applicable law or agre... |
from nose.tools import assert_raises
from indra.statements import *
from indra.statements.validate import *
def test_db_refs_validate():
assert validate_db_refs({'HGNC': '1234'})
assert not validate_db_refs({'XXX': '1234'})
assert not validate_db_refs({'HGNC': 'ABCD1'})
assert validate_ns('UP')
a... |
""" The MIT License (MIT)
Copyright (c) 2015 Kyle Hollins Wray, University of Massachusetts
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 ... |
#!/usr/bin/env python
#
# Copyright 2007 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 o... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# OpenFisca -- A versatile microsimulation software
# By: OpenFisca Team <[EMAIL]>
#
# Copyright (C) 2011, 2012, 2013, 2014, 2015 OpenFisca Team
# https://github.com/openfisca
#
# This file is part of OpenFisca.
#
# OpenFisca is free software; you can redistribute it and/or m... |
# -*- coding: utf-8 -*-
import pickle
from functools import reduce
import os
import errno
import EHFTimeseries
from EHFTimeseries import calcEHF
import ReadStationList
from ReadStationList import readStationList
import ListRawDataFiles
from ListRawDataFiles import listRawDataFiles
import imp
from imp import reload
im... |
# Copyright (C) 2014 Red Hat, Inc.
#
# 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 2.1 of the License, or
# (at your option) any later version.
#
# This program is distr... |
import cv2
import numpy as np
import random
drawing = False # 鼠标按下时为 True
mode = True # True 画矩形。按 m 画曲线
ix = iy = -1
b = g = r = 0
# 鼠标回调函数
def drawCircle(event, x, y, flags, param):
if event == cv2.EVENT_LBUTTONDBLCLK:
b = random.randint(0,255)
g = random.randint(0,255)
r = random.randin... |
import sys
import re
from string import strip
#sys.path.insert(0, "/home/services/software/ete3-webplugin/")
sys.path.insert(0, "/home/jhuerta/_Devel/ete/ete31-beta/")
from ete3 import WebTreeApplication # Required to use the webplugin
from ete3 import PhyloTree, TreeStyle, faces # Required by my custom
... |
"""Base and mixin classes for nearest neighbors"""
# Authors: Jake Vanderplas <[EMAIL]>
# Fabian Pedregosa <[EMAIL]>
# Alexandre Gramfort <[EMAIL]>
# Sparseness support by Lars Buitinck
# Multi-output support by Arnaud Joly <[EMAIL]>
#
# License: BSD 3 clause (C) INRIA, University of... |
# -*- coding: UTF-8 -*-
#
# Copyright (c) 2009 Ars Aperta, Itaapy, Pierlis, Talend.
#
# Authors: Hervé Cauwelier <[EMAIL]>
#
# This file is part of Lpod (see: http://lpod-project.org).
# Lpod is free software; you can redistribute it and/or modify it under
# the terms of either:
#
# a) the GNU General Public License as... |
import ddt
from django.test import TestCase as DjangoTestCase
from leaderboards.forum_leaderboard import ForumLeaderboardXBlock
from .common import LeadboardBlockTest, LeaderboardWorkbenchTest
class ForumLeaderboardTest(LeadboardBlockTest):
"""
Test the forum leaderboard XBlock
"""
BLOCK_CLASS = Forum... |
from deployer.loggers import Logger, RunCallback, ForkCallback
from deployer.utils import esc1
class OnHostLogger(Logger):
"""
Log all transactions on every host in:
~/.deployer/history
"""
def __init__(self, username):
from socket import gethostname
self.from_host = gethostname()
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2018, 2019 Pytroll developers
#
# Author(s):
#
# Adam.Dybbroe <[EMAIL]>
#
# 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... |
#!/usr/bin/env python
"""analysis_larsen.py: ..."""
import numpy as np
from . import orca_parser
from .copper_imidazole_analysis import CopperImidazoleAnalysis
import argparse
cia = CopperImidazoleAnalysis()
parser = argparse.ArgumentParser()
parser.add_argument(dest="namelist", nargs="+")
args = parser.parse_args(... |
# 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... |
import re
import os
import datetime
from fabric.api import run, env, local, sudo, put, require, cd
from fabric.operations import get
from fabric.context_managers import prefix
LUTRIS_REMOTE = '[EMAIL]:lutris/website.git'
env.project = 'lutrisweb'
env.home = '/srv'
env.name = 'lutris'
env.settings_module = 'lutriswe... |
import pytest
from math import sqrt, exp, sin, cos
from functools import lru_cache
from numpy.testing import (assert_warns, assert_,
assert_allclose,
assert_equal,
assert_array_equal,
suppress_warnings)
import ... |
# SPDX-License-Identifier: Apache-2.0
#
# Copyright (C) 2018, Arm Limited and contributors.
#
# 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
#
# ... |
import numpy as np;
import cv2
import math
def bilinearInterpolate(img, x, y):
# get the dimension of the image
height, width = img.shape
if(x < 0 or x > height - 1):
return 0;
if(y < 0 or y > width - 1):
return 0;
modX = x % 1;
modY = y % 1;
if((modX == 0) and (modY == 0)... |
########################################################################
#
# File Name: ParsedExpr.py
#
#
"""
The implementation of all of the expression pared tokens.
WWW: http://4suite.org/XPATH e-mail: [EMAIL]
Copyright (c) 2000-2001 Fourthought Inc, USA. All Rights Reserved.
See http://4suite.org/COPYR... |
# coding=utf-8
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import numpy as np
from src_legacy.fourier_series.buffer import Ringbuffer
from src_legacy.fourier_series.buffer import RingbufferOld
def tests():
m... |
# -*- coding: utf-8 -*-
"""
Compatibility code to be able to use `cookielib.CookieJar` with requests.
requests.utils imports from here, so be careful with imports.
"""
import time
import collections
from .compat import cookielib, urlparse, urlunparse, Morsel
try:
import threading
# grr, pyflakes: this fixes... |
# -*- encoding: utf-8 -*-
"""Test class for Partition table CLI
:Requirement: Partitiontable
:CaseAutomation: Automated
:CaseLevel: Acceptance
:CaseComponent: CLI
:TestType: Functional
:CaseImportance: High
:Upstream: No
"""
from random import randint
from fauxfactory import gen_string
from robottelo.datafacto... |
from django.shortcuts import render
from app.models import *
from django.http import HttpResponseRedirect
def home(request):
return render(request, 'home.html', {
'campaigns': Campaign.objects.all(),
'navoptions': [('About', '#about'), ('Campaigns', '#campaigns'), ('Contact', '#contact')]
})
d... |
import random
from collections import defaultdict
from cloudbot import hook
from cloudbot.util import formatting
table_status = defaultdict(lambda: None)
USE_FLIPPERS = True
replacements = {
'a': 'ɐ',
'b': 'q',
'c': 'ɔ',
'd': 'p',
'e': 'ǝ',
'f': 'ɟ',
'g': 'ƃ',
'h': 'ɥ',
'i': 'ᴉ',
... |
# References used:
# http://domenicosolazzo.wordpress.com/2010/09/26/heapsort-a-python-example/
# http://pravin.paratey.com/posts/binary-heaps-and-priority-queues
# And, most of all:
# https://github.com/jbbrokaw/data-structures/blob/master/binheap.py
class BinaryMaxHeap():
''' Create a binary max heap with push... |
import os
import unittest
import random
from test import test_support
thread = test_support.import_module('thread')
import time
import sys
import weakref
from test import lock_tests
NUMTASKS = 10
NUMTRIPS = 3
_print_mutex = thread.allocate_lock()
def verbose_print(arg):
"""Helper function for... |
# $Id: states.py 7072 2011-07-06 15:52:30Z milde $
# Author: David Goodger <[EMAIL]>
# Copyright: This module has been placed in the public domain.
"""
This is the ``docutils.parsers.rst.states`` module, the core of
the reStructuredText parser. It defines the following:
:Classes:
- `RSTStateMachine`: reStructure... |
from _pydevd_bundle import pydevd_constants
IS_PY3K = pydevd_constants.IS_PY3K
class IORedirector:
'''
This class works to wrap a stream (stdout/stderr) with an additional redirect.
'''
def __init__(self, original, new_redirect, wrap_buffer=False):
'''
:param stream original:
... |
# orm/state.py
# Copyright (C) 2005-2011 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
"""Defines instrumentation of instances.
This module is usually not directly visible to ... |
## This file is part of Scapy
## See http://www.secdev.org/projects/scapy for more informations
## Copyright (C) Philippe Biondi <[EMAIL]>
## This program is published under a GPLv2 license
from scapy.packet import *
from scapy.fields import *
from scapy.layers.inet import IP
if conf.ipv6_enabled:
from scapy.layer... |
"""This module contains several handy functions primarily meant for internal use."""
from __future__ import division
from datetime import date, datetime, time, timedelta, tzinfo
from calendar import timegm
import re
from functools import partial
from pytz import timezone, utc
import six
try:
from inspect import ... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2013 Tristan Fischer ([EMAIL])
#
# 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
# ... |
#
# 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
# ... |
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
import shutil
import tempfile
import unittest
from telemetry.page import page_set_archive_info
class MockPage(object):
def __init__(self, ur... |
from Menu import Menu
from Action import Action
from MPG123 import MPG123
import os
from os import popen2
from string import strip
import time
import TopMenu
class MP3Menu(Menu):
mpgPlayer = None
fileList = []
MP3DIR = "/mp3/"
STOPPED = 0
PLAYING = 1
STATE = STOPPED
SCROLLIDX = 0
... |
import numpy as np
import math
import random
import problem
def initial(p):
return problem.Solution.from_j2k(p, np.arange(p.n))
def shuffle(p):
j2k = list(range(p.n))
random.shuffle(j2k)
return problem.Solution.from_j2k(p, j2k)
def shuffle_best(p, k = 1000):
best = None
for i in range(k):
... |
import numpy as np
from sklearn import svm
import matplotlib.pyplot as plt
def getError(a,p):
return np.absolute(np.sum(a-p))
def learn_curve(train,tarin_label,valid,valid_label,rangeOf=1,degree=3,kernel="rbf",plot=False):
"""
this algorithm print the learning curve
"""
trainError=[]
validError=[]
clf=svm.SVC... |
# -*- coding: iso-8859-1 -*-
"""
This code demonstrates our reproduction of the Rugheimer et al results.
"""
########################
###Import useful libraries
########################
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
import pdb
def cm2inch(cm): #function to c... |
"""
=====================================================================
Parameter estimation using grid search with a nested cross-validation
=====================================================================
The classifier is optimized by "nested" cross-validation using the
:class:`sklearn.grid_search.GridSearch... |
from orator import DatabaseManager, Model as mod
from Model.Classifiers.FactoryClassifiers import FactoryClassifiers
from Model.Log import Log
from Model.ORM.ModelORM import ClassifierType, ClassifierInfo
class Model:
def __init__(self, config_database):
try:
self.__db = DatabaseM... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Import the stuffs!
"""`main` is the top level module for this application."""
from flask import Flask, render_template, request
from flask.ext.assets import Environment, Bundle
from rollparser import RollParser
import datetime
import json
import re
import traceback
d... |
#!/usr/bin/python
#
# Created on Aug 25, 2016
# @author: Gaurav Rastogi ([EMAIL])
# Eric Anderson ([EMAIL])
# module_check: supported
# Avi Version: 17.1.1
#
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public Licen... |
from concurrent.futures import ThreadPoolExecutor
import logging
import queue as local_queue
import threading
import time
from kombu import Queue as KombuQueue
from kombu.mixins import ConsumerMixin
from raven.contrib.django.raven_compat.models import client
from share.search.exceptions import DaemonSetupError, Daem... |
'''
Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
Created on Jun 19, 2014
@author: dfleck
'''
from zope.interface import implements
import sys, random
from twisted.python.log import startLogging
from twisted.python import log
from twisted.internet impo... |
##########################################################################
# Copyright (C) 2009 - 2014 Huygens ING & Gerbrandy S.R.L.
#
# This file is part of bioport.
#
# bioport 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 ... |
"""numerictypes: Define the numeric type objects
This module is designed so 'from numerictypes import *' is safe.
Exported symbols include:
Dictionary with all registered number types (including aliases):
typeDict
Type objects (not all will be available, depends on platform):
see variable sctypes for w... |
# ##### BEGIN GPL LICENSE BLOCK #####
#
# 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) any later version.
#
# This program is distrib... |
#!/usr/bin/python
#
# Copyright 2014 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... |
"""Python to generate build script.
/*
* 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, Ver... |
# This file is part of Buildbot. Buildbot 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, version 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without eve... |
#
# Copyright (c) 2015 nexB Inc. and others. All rights reserved.
# http://nexb.com and https://github.com/nexB/scancode-toolkit/
# The ScanCode software is licensed under the Apache License version 2.0.
# Data generated with ScanCode require an acknowledgment.
# ScanCode is a trademark of nexB Inc.
#
# You may not use... |
"""Kytos Napps Module."""
import json
import os
import re
import sys
import tarfile
import urllib
from abc import ABCMeta, abstractmethod
from pathlib import Path
from random import randint
from threading import Event, Thread
from kytos.core.logs import NAppLog
__all__ = ('KytosNApp',)
LOG = NAppLog()
class NApp:
... |
import sys
is_py3 = sys.version_info >= (3, 0)
if is_py3:
import pickle
from struct import unpack
# python3 sometimes failes to unpickle data pickled by python2, it happens
# because it is trying to decode binary data into the string and fails.
# UnicodeDecodeError exception is raised in this cas... |
#!/usr/bin/env python
#
# Copyright 2011 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio 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, or (at your option)
... |
# Copyright (C) 2006-2007 Red Hat, Inc.
# Copyright (C) 2010 Collabora Ltd. <http://www.collabora.co.uk/>
#
# 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
# ... |
# -*- encoding: utf-8 -*-
##############################################################################
#
# HR Phone module for OpenERP
# Copyright (C) 2014 Alexis de Lattre <[EMAIL]>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Pub... |
"""
OVERVIEW
This lecture starts with a brief explanation of why floating point numbers are only an approximation of the real numbers. Most of the lecture is about a systematic approach to debugging.
why base 2?
- because it is easy to build switches in eletronic hardware;
- it is easy to represent a numbe... |
# Copyright 2016 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 python
import glob
import sys
import numpy
def inflow_data(plane):
# Extract mean velocity and Reynolds stresses from ERCOFTAC data at given plane.
# Ignore file header
ignore=3
ercoftac = open('x.'+str(plane), 'r')
print "reading in data from file: x."+str(plane)
for line in range(ignore):... |
#
# tests/test_https_server.py
#
import os
import ssl
import pytest
import asyncio
import growler
SSL_KEYFILE = 'PYTEST.key'
SSL_CERFILE = 'PYTEST.crt'
@pytest.fixture # (scope='session')
def ssl_ctx(event_loop, tmpdir):
os.chdir(str(tmpdir))
os.system("openssl req -batch -newkey rsa:2048 -nodes "
... |
#-------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation
# All rights reserved.
#
# MIT License:
# 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... |
from __future__ import division, absolute_import, print_function
import operator
import warnings
import sys
import decimal
import numpy as np
from numpy.testing import (
run_module_suite, TestCase, assert_, assert_equal, assert_array_equal,
assert_almost_equal, assert_array_almost_equal, assert_raises,
as... |
#!/usr/bin/env python
# mammon - a useless ircd
#
# Copyright (c) 2015, William Pitcock <[EMAIL]>
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# ... |
#Import statements so that you will have access to the necessary functions
import numpy
from landlab import RasterModelGrid
from landlab.plot.imshow import imshow_node_grid
from pylab import show, figure
#Create a raster grid with 25 rows, 40 columns, and cell spacing of 10 m
mg = RasterModelGrid(25, 40, 10.0)
#Creat... |
# Copyright 2015 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.
from __future__ import absolute_import
import symbol
from py_utils.refactor.annotated_symbol import base_symbol
__all__ = [
'Function',
]
class Func... |
# 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 ... |
import glob
import hashlib
import os
import platform
import sysconfig
import sys
import shutil
import tarfile
import textwrap
import zipfile
from tempfile import mkstemp, gettempdir
from urllib.request import urlopen, Request
from urllib.error import HTTPError
OPENBLAS_V = '0.3.13'
OPENBLAS_LONG = 'v0.3.13-62-gaf2b0d... |
# -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2014 CERN.
#
# Invenio 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) any later... |
"""
utility function to load parcel data
"""
import numpy
def load_parcel_data(infile):
f=open(infile)
lines=f.readlines()
f.close()
# 1 DMN
# 2 Visual 2
# 3 Fronto-parietal 1
# 4.5 Visual 1
# 5 Dorsal Attention
# 7 Ventral Atte... |
import os
from setuptools import find_packages, setup
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
def requirements(fname):
for line in open(os.path.join(os.path.dirname(__file__), fname)):
yield line.strip()
setup(
name="jsonable",
version="0.2.1",
... |
"""Utility module that contains code for parsing legacy game formats"""
import itertools
import warnings
from collections import abc
import numpy as np
from gameanalysis import rsgame
from gameanalysis import utils
class GameSerializer(rsgame.StratArray):
"""An object with utilities for serializing objects with... |
import sys, copy, weakref,gc
import numpy as np
import scipy as sp
from Training import Training
from VyPy.data import IndexableBunch
from VyPy.tools import atleast_2d_col, atleast_2d_row
class Training_VF(Training):
def __init__(self,Trains=None):
if not Trains is None:
self.update(Tr... |
# -*- coding: utf-8 -*-
'''
Local settings
- Run in Debug mode
- Use console backend for emails
- Add Django Debug Toolbar
- Add django-extensions as app
'''
from .common import * # noqa
# DEBUG
# ------------------------------------------------------------------------------
DEBUG = env.bool('DJANGO_DEBUG', default... |
from django.contrib.sites.models import get_current_site
from django.core.urlresolvers import reverse
from django.http import HttpResponseForbidden
from django.shortcuts import redirect
from django.utils.translation import ugettext_lazy as _
from guardian.shortcuts import remove_perm
from organizations.backends impor... |
# Copyright 2010 Jacob Kaplan-Moss
# Copyright 2011 OpenStack LLC.
# Copyright 2011 Piston Cloud Computing, Inc.
# Copyright 2011 Nebula, Inc.
# Copyright 2012 Grid Dynamics.
# All Rights Reserved.
"""
OpenStack Client interface. Handles the REST calls and responses.
"""
import errno
import logging
import re
import ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.