gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
import challonge
# The rating that previously unrated players start at
_newPlayerRating = 1200
def setCredentials(username, apikey):
challonge.set_credentials(username, apikey)
def processTournament(tournamentName, dbConnection):
"""Calculate new ratings for a single tournament.
Goes through all match... | |
from jsonrpc import ServiceProxy
import sys
import string
import getpass
# ===== BEGIN USER SETTINGS =====
# if you do not set these you will be prompted for a password for every command
rpcuser = ""
rpcpass = ""
# ====== END USER SETTINGS ======
if rpcpass == "":
access = ServiceProxy("http://127.0.0.1:8332")
e... | |
# -*- coding: utf-8 -*-
"""DataFrame client for InfluxDB."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import math
from collections import defaultdict
import pandas as pd
import pandas.core.common as pdcom
impo... | |
from __future__ import unicode_literals
import time
import hmac
import hashlib
import re
from .common import InfoExtractor
from ..compat import compat_str
from ..utils import (
ExtractorError,
float_or_none,
int_or_none,
sanitized_Request,
urlencode_postdata,
xpath_text,
)
class AtresPlayerI... | |
# -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'Supervisor'
db.create_table('publications_supervisor', (
... | |
# Copyright (C) 2010 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the ... | |
<<<<<<< HEAD
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from datetime import datetime
from django.core import serializers
from django.core.serializers import SerializerDoesNotExist
from django.core.serializers.base import ProgressBar
from django.db import connection, transaction
from django.http ... | |
# Copyright 2014 Cloudbase Solutions Srl
# 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 r... | |
#!/usr/bin/env python
import argparse
import os
import bx.seq.nib
import bx.seq.twobit
from bx.intervals.io import Comment, Header
import extract_genomic_dna_utils as egdu
parser = argparse.ArgumentParser()
parser.add_argument('--input_format', dest='input_format', help="Input dataset format")
parser.add_argument('-... | |
# script gets all Australian BoM weather station observations
# ... and applies an interpolated temperature to all GNAF points in a 100m grid
# TODO:
# 1. remove temperature biases due to altitude differences
# a. Add SRTM altitudes to GNAF
# b. Add interpolated altitude from weather stations to GNAF
# ... | |
import os
import sys
import textwrap
from os.path import join
import pytest
from tests.lib import SRC_DIR
from tests.lib import (assert_all_changes, pyversion,
_create_test_package, _change_test_package_version)
from tests.lib.local_repos import local_checkout
def test_no_upgrade_unless_requ... | |
# Module 'ntpath' -- common operations on WinNT/Win95 and UEFI pathnames.
#
# Copyright (c) 2015, Daryl McDaniel. All rights reserved.<BR>
# Copyright (c) 2011 - 2012, Intel Corporation. All rights reserved.<BR>
# This program and the accompanying materials are licensed and made available under
# the terms and conditi... | |
"""A library of helper functions for the CherryPy test suite."""
import datetime
import io
import logging
import os
import re
import subprocess
import sys
import time
import unittest
import warnings
import contextlib
import portend
import pytest
from cheroot.test import webtest
import cherrypy
from cherrypy._cpcomp... | |
from webtest import TestApp as Client
import bowerstatic
import json
import mock
import os
import pytest
def test_injector_specific_path():
bower = bowerstatic.Bower()
components = bower.components('components', os.path.join(
os.path.dirname(__file__), 'bower_components'))
def wsgi(environ, star... | |
"""Collection of functions for dealing with grids.
Functions:
curvilinear_to_rectilinear -- Regrid curvilinear data to a rectilinear
grid if necessary
make_grid -- Make a dummy cube with desired grid
get_grid_spacing -- Return an array of grid spaci... | |
#!/usr/bin/python
#
# Copyright (C) 2013 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of... | |
#!/usr/bin/python
#
# Copyright: (c) 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': ['previe... | |
from __future__ import unicode_literals
import os.path
import optparse
import re
import sys
from .downloader.external import list_external_downloaders
from .compat import (
compat_expanduser,
compat_get_terminal_size,
compat_getenv,
compat_kwargs,
compat_shlex_split,
)
from .utils import (
pre... | |
"""This module sets up type classes like DictType and ListType that
define types for arbitrary objects. The main use case is to specify
the types of Zulip events that come from send_event calls for
verification in test_events.py; in most other code paths we'll want to
use a TypedDict.
This module consists of workarou... | |
# Import a whole load of stuff
from System.IO import *
from System.Drawing import *
from System.Runtime.Remoting import *
from System.Threading import *
from System.Windows.Forms import *
from System.Xml.Serialization import *
from System import *
from Analysis.EDM import *
from DAQ.Environment import *
from EDMConfig... | |
import ast
from collections import defaultdict, OrderedDict
import contextlib
import sys
from types import SimpleNamespace
import numpy as np
import operator
from numba.core import types, utils, ir, rewrites, compiler
from numba.core.typing import npydecl
from numba.np.ufunc.dufunc import DUFunc
def _is_ufunc(func)... | |
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
# Copyright 2011 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the ... | |
# 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 by applicable law or ... | |
#---------------------------------------------------------------------------
# Copyright 2013 PwC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENS... | |
from numpy import *
from util.sentiment_util import *
from util.math_util import *
from util.adagrad import Adagrad
import cPickle, time, argparse
from collections import Counter
# compute model accuracy on a given fold
def validate(data, fold, params, deep, f=relu):
correct = 0.
total = 0.
for sent, lab... | |
import ev3
from ev3.motor.lego import *
from ev3.robot.lego import *
from ev3.sensor.lego import *
import sys
import time
from threading import Timer
# TODO: there's a lot of similar code. Share as much as possible
# instead of copypasta.
class ModifiedEV3RStormRobotConfig(EV3RobotConfigurator):
_is_init = False
... | |
"""
CanvasSync by Mathias Perslev
February 2017
--------------------------------------------
settings.py, Class
The Settings object implements the functionality of setting the initial-launch
settings and later loading these settings
These settings include:
1) A path to with synchronization will occur. The path must... | |
from __future__ import print_function, division
from sympy.core.singleton import S
from sympy.core.function import Function
from sympy.core import Add
from sympy.core.evalf import get_integer_part, PrecisionExhausted
from sympy.core.numbers import Integer
from sympy.core.relational import Gt, Lt, Ge, Le
from sympy.cor... | |
from ophyd import (EpicsMotor, PseudoSingle, PseudoPositioner,
Component as Cpt)
from ophyd.pseudopos import (pseudo_position_argument, real_position_argument)
import numpy as np
from scipy import interpolate
_ivu_gap = [ 6184.0,
6368.0,
6550.0,
6730.0,
6909.0,
70... | |
#!/usr/bin/env python3
# Copyright (c) 2014-2015 The Bitcoin Core developers
# Copyright (c) 2015-2017 The Bitcoin Unlimited developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Helpful routines for regression testing
#... | |
"""
lxml-based doctest output comparison.
Note: normally, you should just import the `lxml.usedoctest` and
`lxml.html.usedoctest` modules from within a doctest, instead of this
one::
>>> import lxml.usedoctest # for XML output
>>> import lxml.html.usedoctest # for HTML output
To use this module directly, yo... | |
# -*- coding: utf-8 -*-
#
# 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
#... | |
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the... | |
# 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 unittest
class DictSetTest(unittest.TestCase):
def test_constructors_not_callable(self):
kt = type({}.keys())
self.assertRaises(TypeError, kt, {})
self.assertRaises(TypeError, kt)
it = type({}.items())
self.assertRaises(TypeError, it, {})
self.assertRaises(Ty... | |
# -*- coding: utf-8 -*-
"""Metrics for scoring H2O model predictions"""
# Author: Taylor Smith
# adapted from sklearn for use with skutil & H2OFrames
from __future__ import absolute_import, division, print_function
import abc
import warnings
import numpy as np
from sklearn.externals import six
from sklearn.metrics.ran... | |
import requests
import pprint
import jsonschema
import json
import logging
import time
import urllib.request
import urllib.parse
import urllib.error
from requests.exceptions import ReadTimeout, ConnectTimeout
from pymacaron_core.exceptions import PyMacaronCoreException, ValidationError
from pymacaron_core.utils import ... | |
#!/usr/bin/env python
import sys
import math
import time
import numpy
import scipy.optimize
import scipy.ndimage
import scipy.interpolate
from appionlib import apDisplay
### remove warning about polyfit
import warnings
warnings.simplefilter('ignore', numpy.RankWarning)
class CtfNoise(object):
#============
def __... | |
#-*- coding:utf-8 -*-
"""
This module contains main implementations that encapsulate
retrieval-related statistics about the quality of the recommender's
recommendations.
"""
# Authors: Marcel Caraciolo <marcel@muricoca.com>
# License: BSD Style.
import operator
import numpy as np
from scikits.crab.metrics.b... | |
#This program will allow interactive analysis of .tif files
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.widgets import Slider, Button, RadioButtons
from tifffile import imread
import os
fig = plt.figure(1)
# file_name = input("Please write file name: ")
file_name = 'C:/Users/Caleb/2016_summer_X... | |
#----------------------------------------------------------------------
# Copyright (c) 2013 Raytheon BBN Technologies
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and/or hardware specification (the "Work") to
# deal in the Work without restriction, including witho... | |
# 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... | |
# 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 applicable law or a... | |
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | |
"""
Implementation of Hobbs' algorithm for pronoun resolution.
Chris Ward, 2014
"""
import sys
import nltk
from nltk.corpus import names
from nltk import Tree
import Queue
# Labels for nominal heads
nominal_labels = ["NN", "NNS", "NNP", "NNPS", "PRP"]
def get_pos(tree, node):
""" Given a tree and a node, return... | |
# Copyright 2009 Shikhar Bhushan
#
# 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 writin... | |
#-*- coding:utf-8 -*-
# Copyright 2017 Xiaomi, 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... | |
# -*- coding: utf-8 -*-
#
# Copyright (c) 2014 Netheos (http://www.netheos.net)
#
# 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 req... | |
# original version from https://github.com/MostAwesomeDude/bravo
from StringIO import StringIO
from collections import namedtuple
from codecs import register
from codecs import (BufferedIncrementalDecoder, CodecInfo, IncrementalEncoder,
StreamReader, StreamWriter, utf_16_be_encode,
... | |
"""
Django settings for codeweekeu project.
"""
import sys
import os
from os.path import abspath, basename, dirname, join, normpath
########## PATH CONFIGURATION
# Absolute filesystem path to this Django project directory.
DJANGO_ROOT = dirname(dirname(abspath(__file__)))
# Site name.
# SITE_NAME = basename(DJANGO_R... | |
from model_mommy import mommy
from django.utils import timezone
from django.conf import settings
from datetime import timedelta
from django.contrib.auth.models import User
from django.test import TestCase
from survey.models import *
from survey.forms.filters import *
class QuestionFilterFormTest(TestCase):
def t... | |
# Copyright (C) 2003-2005 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
# provided that the above copyright notice and this permission notice
# appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND ... | |
"""The tests for the MQTT JSON light platform.
Configuration for RGB Version with brightness:
light:
platform: mqtt_json
name: mqtt_json_light_1
state_topic: "home/rgb1"
command_topic: "home/rgb1/set"
brightness: true
rgb: true
Config without RGB:
light:
platform: mqtt_json
name: mqtt_json_light_1
... | |
# -*- coding: utf-8 -*-
""" Simple Generic Location Tracking System
@copyright: 2011-12 (c) Sahana Software Foundation
@license: MIT
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 So... | |
#!/usr/bin/env python
# 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.
"""Triggers a Swarm request based off of a .isolated file.
This script takes a .isolated file, packages it, and sends a Swarm mani... | |
"""Tests related to the authorization of api calls.
NOTE: while all of these are conceptually authorization related, some illegal
operations will raise exceptions other than AuthorizationError. This usually
happens when the operation is illegal *in principle*, and would not be fixed by
authenticating as someone else. ... | |
"Base Cache class."
from __future__ import unicode_literals
import time
import warnings
from django.core.exceptions import DjangoRuntimeWarning, ImproperlyConfigured
from django.utils.module_loading import import_string
class InvalidCacheBackendError(ImproperlyConfigured):
pass
class CacheKeyWarning(DjangoRun... | |
#!/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.
"""Python utility to compare two CSV files and output HTML results."""
import csv
import datetime
import optparse
import os
impor... | |
#-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2018, Anaconda, Inc. All rights reserved.
#
# Powered by the Bokeh Development Team.
#
# The full license is in the file LICENSE.txt, distributed with this software.
#---------------------------------------------------... | |
# Copyright (c) 2012 Mitch Garnaat http://garnaat.org/
# Copyright (c) 2012 Amazon.com, Inc. or its affiliates.
# All Rights Reserved
#
# 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... | |
#!/usr/bin/env python
# Copyright (c) 2004 Damien Miller <djm@mindrot.org>
#
# Permission to use, copy, modify, and 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.
#
# THE SOFTWARE IS PROVIDED ... | |
# -*- coding: utf-8 -*-
"""
fungiform.widgets
~~~~~~~~~~~~~~~~~
The widgets.
:copyright: (c) 2010 by the Fungiform Team.
:license: BSD, see LICENSE for more details.
"""
from itertools import chain
from fungiform.utils import make_name, _force_dict, _make_widget,\
_val... | |
# Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the... | |
# Copyright 2014 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 json
from appengine_module.testing_utils import testing
from appengine_module.cr_rev import controller
from appengine_module.cr_rev ... | |
from airflow.models import DAG
from airflow.operators.dummy_operator import DummyOperator
from datetime import datetime, timedelta
from airflow.operators import PythonOperator
from airflow.hooks import RedisHook
from airflow.models import Variable
from airflow.hooks import MemcacheHook
from etl_tasks_functions import... | |
from jinja2 import StrictUndefined
import requests
from flask import Flask, render_template, request, jsonify, flash, redirect, session
from flask_debugtoolbar import DebugToolbarExtension
from model import connect_to_db, db, User, Cuisine, Rating, Restaurant, Comment, Bookmark, Popularity
from datetime import datetime... | |
###############################################################################
##
## Copyright (C) 2013-2014 Tavendo GmbH
##
## 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
##
## h... | |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
"""
Created on Fri Mar 4 20:44:24 2016
@author: ddboline
"""
from __future__ import (absolute_import, division, print_function, unicode_literals)
import os
import re
import datetime
from subprocess import call, Popen, PIPE
HOMEDIR = os.getenv('HOME')
HOSTNAME = os.uname... | |
# This Python module is part of the PyRate software package.
#
# Copyright 2022 Geoscience Australia
#
# 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/... | |
#!/usr/bin/env python
from os import environ
##
#### Settings:
##
TEST_MODE = False
REWARDS_ACCOUNT = environ.get('REWARDS_ACCOUNT', False)
## Just for your web node, assign special flagging visibility power to some users:
WEB_NODE_FLAG_ACCOUNTS = environ.get('WEB_NODE_FLAG_ACCOUNTS', '').split(',')
## Just for y... | |
"""Weak reference support for Python.
This module is an implementation of PEP 205:
http://www.python.org/dev/peps/pep-0205/
"""
# Naming convention: Variables named "wr" are weak reference objects;
# they are called this instead of "ref" to avoid name collisions with
# the module-global ref() function imported from ... | |
"""This module provides a number of operations to modify structured arrays
A number of functions take a parameter called "arguments" of type list of
dict. Diogenes expects these parameters to be expressed in the following
format for functions operating on columns (choose_cols_where,
remove_cols_where):
[{'func':... | |
# Copyright (c) 2015 SONATA-NFV and Paderborn University
# ALL RIGHTS RESERVED.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless re... | |
#!/usr/bin/env python3
# encoding: UTF-8
from collections import namedtuple
import datetime
import operator
import re
import sqlite3
import tempfile
import textwrap
import unittest
import unittest.mock
import uuid
import bcrypt
from pyramid import testing
from pyramid.exceptions import Forbidden
from pyramid.excepti... | |
import time
from electrum.i18n import _
from electrum.plugin import hook
from electrum.wallet import Standard_Wallet
from electrum.gui.qt.util import *
from .coldcard import ColdcardPlugin
from ..hw_wallet.qt import QtHandlerBase, QtPluginBase
from ..hw_wallet.plugin import only_hook_if_libraries_available
class Pl... | |
"""
Gathering statistics on the Cas9 mutants that were able to bind alternative PAMs
TODO:
- visualization = regions + AA class
- mutations which always co-occur (regionally? or by AA class?)
- mutations which co-occur between NGA and NGC PAMs
- mutations which differ between NGA and NGC PAMs
"""
import operator
impor... | |
"""IPython terminal interface using prompt_toolkit in place of readline"""
from __future__ import print_function
import base64
import errno
from getpass import getpass
from io import BytesIO
import os
import signal
import subprocess
import sys
import time
from warnings import warn
try:
from queue import Empty # ... | |
import json
import uuid
from django.core.urlresolvers import reverse
from models import CrowdModelSpecification
# Required implementation for a new crowd type
class CrowdInterface(object):
def __init__(self, crowd_name):
self.crowd_name = crowd_name
@staticmethod
def validate_configuration(conf... | |
from datetime import datetime
from django.conf import settings
from django.db.models import (
DateField, DateTimeField, IntegerField, TimeField, Transform,
)
from django.db.models.lookups import (
YearExact, YearGt, YearGte, YearLt, YearLte,
)
from django.utils import timezone
from django.utils.functional impo... | |
"""
NN Policy: PPO with KL Penalty (Actor)
Can save model and use it to resume training
Dinamically allocates GPU memory to avoid
memory saturation during parallel training
(otherwise tensorflow allocates all GPU memory)
"""
import numpy as np
import tensorflow as tf
import os.path
class Policy(object):
def... | |
# Copyright (C) 2015 ibu radempa <ibu@radempa.de>
#
# 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 limitation the rights to use,
# copy, modify, me... | |
"""\
Guitar
By Joe Esposito
Contains classes for storing and manipulating guitar tabs in a structured manor.
"""
from collections import OrderedDict
from itertools import product
from StringIO import StringIO
# TODO: str(song), len(song.staffs), song.song_info, song.errors
# def __str__(self):
# head = str(self.... | |
from __future__ import (absolute_import, division, print_function)
from addie.utilities.gui_handler import GuiHandler
from addie.processing.idl.export_table import ExportTable
from addie.menu.file.configuration.config_file_name_handler import ConfigFileNameHandler
from addie.utilities.file_handler import FileHandler
... | |
#!/usr/bin/env python2.7
# -*- encoding: utf-8 -*-
# Copyright 2016 Twitter. 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/LICENS... | |
# pylint: disable=g-bad-file-header
# 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/LICENS... | |
#!/usr/bin/python
# Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Unit tests for portage_utilities.py."""
import fileinput
import mox
import os
import sys
import constants
if __name__ == '__ma... | |
#!/usr/bin/env python2
# pylint: skip-file
# (c) 2012, Marco Vito Moscaritolo <marco@agavee.com>
#
# This file is part of Ansible,
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3... | |
import datetime
import logging
import collections
from .base import LitecordObject
from .member import Member
from ..snowflake import snowflake_time
from ..utils import dt_to_json
from ..enums import ChannelType
log = logging.getLogger(__name__)
BareGuild = collections.namedtuple('BareGuild', 'id')
class Guild(Lit... | |
# Copyright 2014-2016 Open Source Robotics Foundation, 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 applicabl... | |
"""Utility meter from sensors providing raw data."""
import logging
from datetime import date, timedelta
from decimal import Decimal, DecimalException
import homeassistant.util.dt as dt_util
from homeassistant.const import (
CONF_NAME,
ATTR_UNIT_OF_MEASUREMENT,
EVENT_HOMEASSISTANT_START,
STATE_UNKNOWN,... | |
#!/usr/bin/env python
#
# Copyright (C) 2013 Nippon Telegraph and Telephone Corporation.
# Copyright (C) 2013 YAMAMOTO Takashi <yamamoto at valinux co jp>
#
# 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... | |
"""Learn to estimate functions from examples. (Chapters 18-20)"""
from collections import defaultdict
from utils import *
import copy
import heapq
import math
import random
#______________________________________________________________________________
def rms_error(predictions, targets):
return math.sqrt(ms_err... | |
from __future__ import (absolute_import, division, #
print_function, unicode_literals)
exec(open("ground.py").read())
"""
sde.py
--------------
Noisy landmark image registration
Classes:
SDE, SDELin
MAP1, MAP2 (first-splitting prior with shooting and multi-shooting)
MAP3, MAP4 (second-splitting... | |
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
#
# This software is released under the MIT License.
#
# Copyright (c) 2014 Cloudwatt
#
# 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... | |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
__author__="Scott Hendrickson, Jeff Kolb, Josh Montague"
import sys
import json
import codecs
import argparse
import datetime
import time
import os
if sys.version_info.major == 2:
import ConfigParser as configparser
else:
import configparser
from search.results ... | |
# Copyright (c) 2012-2015 The GPy authors (see AUTHORS.txt)
# Licensed under the BSD 3-clause license (see LICENSE.txt)
import numpy as np
from scipy import stats,special
import scipy as sp
from . import link_functions
from ..util.misc import chain_1, chain_2, chain_3, blockify_dhess_dtheta, blockify_third, blockify_h... | |
# Copyright (C) 2015 Red Hat, Inc.
# Author: Petr Spacek <pspacek@redhat.com>
#
# Permission to use, copy, modify, and distribute this software and its
# documentation 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 usb, serial
import os, glob
import time
import random
from struct import pack
from config import * #to get DEV_ENABLE_* variables
RZ_USB_VEND_ID = 0x03EB
RZ_USB_PROD_ID = 0x210A
ZN_USB_VEND_ID = 0x04D8
ZN_USB_PROD_ID = 0x000E
#FTDI_USB_VEND_ID = 0x0403
#FTDI_USB_PROD_ID = 0x6... | |
# -*- encoding: utf-8 -*-
import abc
import base64
import json
import logging
import requests
import six
from Crypto.Hash import SHA256
from Crypto.PublicKey import RSA
from Crypto.Signature import PKCS1_v1_5
from xml.dom.minidom import parseString
try:
from urllib import urlencode
except ImportError:
from urll... | |
'''
Created on Feb 29, 2012
@author: mchrzanowski
'''
from time import time
NUMBER_LIMIT = 10
SOLUTION_SIZE = 16
GON_NUMBER = NUMBER_LIMIT / 2
def initializeSummationDict():
''' create all possible combinations of all possible totals using 3 numbers from 1..NUMBER_LIMIT'''
summationDict = {}
for i in xr... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.