gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
import csv
import sys
import numpy as np
import itertools as it
from scipy import ndimage
############################################################################
# Helpers
############################################################################
def loop_2_1(r):
return it.product(r, r)
def loop_2_2(r1... | |
# Copyright 2012 OpenStack Foundation
# 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 requ... | |
"""James-Stein"""
import numpy as np
import pandas as pd
import scipy
from scipy import optimize
from sklearn.base import BaseEstimator
from category_encoders.ordinal import OrdinalEncoder
import category_encoders.utils as util
from sklearn.utils.random import check_random_state
__author__ = 'Jan Motl'
class JamesSt... | |
"""Support for the IBM Watson IoT Platform."""
import logging
import queue
import threading
import time
from ibmiotf import MissingMessageEncoderException
from ibmiotf.gateway import Client
import voluptuous as vol
from homeassistant.const import (
CONF_DOMAINS,
CONF_ENTITIES,
CONF_EXCLUDE,
CONF_ID,
... | |
from __future__ import unicode_literals
import uuid
from django.contrib.auth.models import User
from django.core.urlresolvers import NoReverseMatch
from django.db import models
from django.template.loader import Context, get_template
from django.utils import six
from django.utils.html import escape, format_html, form... | |
"""Support for remote Python debugging.
Some ASCII art to describe the structure:
IN PYTHON SUBPROCESS # IN IDLE PROCESS
#
# oid='gui_adapter'
+----------+ # +------------+ ... | |
# -*- coding: utf-8 -*-
"""
Newspaper treats urls for news articles as critical components.
Hence, we have an entire module dedicated to them.
"""
__title__ = 'newspaper'
__author__ = 'Lucas Ou-Yang'
__license__ = 'MIT'
__copyright__ = 'Copyright 2014, Lucas Ou-Yang'
import logging
import re
from urllib.parse import ... | |
'''
Created on Jan 25, 2011
@author: Mark V Systems Limited
(c) Copyright 2011 Mark V Systems Limited, All rights reserved.
'''
from tkinter import *
try:
from tkinter.ttk import *
from tkinter.ttk import Combobox as _Combobox
except ImportError:
from ttk import *
_Combobox = Combobox
TOPBORDER = 1
LE... | |
# Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | |
# coding: utf-8
import random
from ._cffi import C, ffi, zmq_version, new_uint64_pointer, \
new_int64_pointer, \
new_int_pointer, \
new_binary_data, \
value_u... | |
import inspect
import sys
import os
import onyxexceptions as ex
import re
from functools import wraps
import time
import random
import string
import unicodedata
def exit_with_error(error="Non Specified Error"):
"""
Terminates crawley with an error
"""
print(error)
sys.exit(1)
def search_clas... | |
# Copyright 2010 OpenStack Foundation
# Copyright 2011 Piston Cloud Computing, 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.apach... | |
# 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... | |
# -*- coding: utf-8 -*- {{{
# vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et:
# Copyright (c) 2017, SLAC National Laboratory / Kisensum 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:
#
... | |
# coding: utf-8
from __future__ import (absolute_import,
division, print_function)
import six
# TODO : make a s object for strings with split(regex|iterable),
# replace(regex|iterable)
# TODO : flags can be passed as strings. Ex: s.search('regex', flags='ig')
# TODO : make s.search(regex) retu... | |
#!/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... | |
#
# 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... | |
# 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 ... | |
"""Support for Ambient Weather Station binary sensors."""
from __future__ import annotations
from dataclasses import dataclass
from typing import Literal
from homeassistant.components.binary_sensor import (
BinarySensorDeviceClass,
BinarySensorEntity,
BinarySensorEntityDescription,
)
from homeassistant.co... | |
"""`BaseModel`, `Model`, `NotBuiltError`, `Percept`, `SpatialModel`,
`TemporalModel`"""
import sys
from abc import ABCMeta, abstractmethod
from copy import deepcopy
import numpy as np
from ..implants import ProsthesisSystem
from ..stimuli import Stimulus
from ..percepts import Percept
from ..utils import (Curcio199... | |
"""
Utils called from project_root/docs/conf.py when Sphinx
documentation is generated.
"""
from __future__ import division, print_function, unicode_literals
from future.builtins import map, open, str
from datetime import datetime
import os.path
from shutil import copyfile, move
from string import letters
from socket ... | |
from __future__ import unicode_literals
from .. import Provider as SsnProvider
import datetime
class Provider(SsnProvider):
# Extracted from
# http://www.stats.gov.cn/tjsj/tjbz/xzqhdm/201504/t20150415_712722.html
area_codes = [
"110000", "110100", "110101", "110102", "110105", "110106", "110107",
... | |
from os import path
from warnings import warn
try:
import ujson as json
except ImportError:
import json
from .tokenizer import Tokenizer
from .vocab import Vocab
from .syntax.parser import Parser
from .tagger import Tagger
from .matcher import Matcher
from .serialize.packer import Packer
from ._ml import Mode... | |
from __future__ import unicode_literals
"""
Format String 2D array
2d array for compositing term-formated strings
-autoexpanding vertically
-interesting get_item behavior (renders fmtstrs)
-caching behavior eventually
>>> a = FSArray(10, 14)
>>> a.shape
(10, 14)
>>> a[1] = 'i'
>>> a[3:4, :] = ['i' * 14]
>>> a[16:17... | |
""" Given an xform definition, storageutility generates dynamic data tables.
Given an xml instance, storeagutility populates the data tables.
Basically, storageutility abstracts away all interaction with the database,
and it only knows about the data structures in xformdef.py
"""
import re
import os
import sys
impor... | |
# Copyright 2015 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... | |
# ===============================================================================
# Copyright 2016 Jake Ross
#
# 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... | |
"""Test the Tradfri config flow."""
from unittest.mock import patch
import pytest
from homeassistant import data_entry_flow
from homeassistant.components.tradfri import config_flow
from tests.common import mock_coro, MockConfigEntry
@pytest.fixture
def mock_auth():
"""Mock authenticate."""
with patch('home... | |
# Copyright 2015 VMware.
#
# 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, sof... | |
# -*- coding: utf-8 -*-
"""
Runtime configuration and launch logic for third party tools.
This module contains logic to configure and launch third-party tools;
setting environment variables and configuration files as required to
assure interoperability with DA norms and processes.
---
type:
python_module
validat... | |
# 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 unde... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#########################################################################
# Copyright/License Notice (BSD License) #
#########################################################################
###################################################... | |
import pandas as pd
import numpy as np
import xlrd
import ceo
from ceo import data_cleaning as dc
import os
import os.path as op
import inspect
#Location for Original Data
data_path = op.join(ceo.__path__[0], 'Data')
data_path = op.join(data_path, 'Original Data')
#Input data
df = pd.read_excel(op.join(data_path, 'Stat... | |
# Copyright 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 copy
import logging
import optparse
import os
import shlex
import socket
import sys
from telemetry.core import platform
from telemetry.core import ut... | |
#
# 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... | |
# MIT License
#
# Copyright (c) 2020 Tri Minh Cao
#
# 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, merg... | |
#!/usr/bin/env python3
#
# Copyright (c) 2018-2021 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Download or build previous releases.
# Needs curl and tar to download a release, or the build depend... | |
import time
import numpy as np
import tensorflow as tf
import utils
from urllib.request import urlretrieve
from os.path import isfile, isdir
from tqdm import tqdm
import zipfile
dataset_folder_path = 'data'
dataset_filename = 'text8.zip'
dataset_name = 'Text8 Dataset'
class DLProgress(tqdm):
last_block = 0
... | |
"""
This file contains the class definition for the sampler MCMCSample classes.
"""
__author__ = 'Brandon C. Kelly'
import numpy as np
from matplotlib import pyplot as plt
import scipy.stats
import acor
class MCMCSample(object):
"""
Class for parameter samples generated by a yamcmc++ sampler. This class con... | |
#
# Copyright (c) 2001-2014, Scott D. Peckham
#
# Sept 2014. Moved some functions into outlets.py to avoid cyclic
# dependencies between BMI_base.py and basins.py.
#
# January, August 2009
# May 2010 (changes to unit_test(), initialize(), etc.)
#
############################################################... | |
"""Convert between frames and higher-level AMQP methods"""
# Copyright (C) 2007-2008 Barry Pederson <bp@barryp.org>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 ... | |
# Generated from C.bnf by ANTLR 4.5.1
from antlr4 import *
from io import StringIO
def serializedATN():
with StringIO() as buf:
buf.write("\3\u0430\ud6d1\u8206\uad2d\u4417\uaef1\u8d80\uaadd\2s")
buf.write("\u04e7\b\1\4\2\t\2\4\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7")
buf.write("\t\7\4\b\t\b\4\t... | |
#!/usr/bin/python
import sys
import time
import math
import functions
import myGui
import SocketServer
import threading
import socket
import parameters
from PyQt4 import QtGui
from PyQt4 import QtCore
import math
from collections import deque
socket.setdefaulttimeout(2)
import random
params=parameters.getParams()
... | |
# -*- coding: utf-8 -*-
"""
Tests parsers ability to read and parse non-local files
and hence require a network connection to be read.
"""
import logging
import numpy as np
import pytest
from pandas.compat import BytesIO, StringIO
import pandas.util._test_decorators as td
from pandas import DataFrame
import pandas.... | |
#
# 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
# ... | |
# -*- coding: utf-8 -*-
"""
line.client
~~~~~~~~~~~
LineClient for sending and receiving message from LINE server.
:copyright: (c) 2014 by Taehoon Kim.
:license: BSD, see LICENSE for more details.
"""
import rsa
import requests
try:
import simplejson as json
except ImportError:
import json... | |
"""
Created on March 29, 2017
@author Miguel Contreras Morales
History:
4/12/2017 - Adding more queries
"""
from pymongo import MongoClient
import cherrypy as QueryServer
import json
import os
class QueryTool(object):
"""
QueryTool will contain a subset of functions used to parse
Mongo Database
""... | |
#
# 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... | |
import arrow
import re
import feedparser
import json
import time
from hbconfig import Config
from sklearn import tree
from .pocket import Pocket
from ..slack.resource import MsgResource
from ..slack.slackbot import SlackerAdapter
from ..slack.template import MsgTemplate
from ..utils.data_handler import DataHandler
... | |
from django import forms
from django.template import loader
from django.utils.http import int_to_base36
from django.utils.translation import ugettext_lazy as _
from django.contrib.auth.models import User
from django.contrib.auth.utils import UNUSABLE_PASSWORD
from django.contrib.auth import authenticate
from django.co... | |
# GPIO Zero: a library for controlling the Raspberry Pi's GPIO pins
# Copyright (c) 2016-2019 Dave Jones <dave@waveform.org.uk>
# Copyright (c) 2019 Andrew Scheller <github@loowis.durge.org>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following ... | |
# Copyright (c) 2014 Alex Meade. All rights reserved.
# Copyright (c) 2015 Clinton Knight. All rights reserved.
# Copyright (c) 2015 Tom Barron. 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 ob... | |
# Copyright 2016-2018 Brian Warner
#
# 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... | |
import logging
import re
import sys
import html5lib
from html5lib.sanitizer import HTMLSanitizer
from html5lib.serializer.htmlserializer import HTMLSerializer
from . import callbacks as linkify_callbacks
from .encoding import force_unicode
from .sanitizer import BleachSanitizer
VERSION = (1, 2, 'dev')
__version__ =... | |
# -*- coding: utf-8 -*-
"""
Test script for reading of tsp data.
"""
import tsp_io as io
import euclidean as e
import objective as o
import init_solutions as init
from objective import SimpleTSPObjective
from bruteforce import BruteForceSolver, RandomSearch
from local_search import OrdinaryDecent, SteepestDecent
from ... | |
import operator
from functools import reduce
from django.core.exceptions import SuspiciousOperation, ImproperlyConfigured
from django.core.paginator import InvalidPage
from django.db import models
from django.db.models.fields import FieldDoesNotExist
from django.utils.datastructures import SortedDict
from django.utils... | |
# Copyright 2010 OpenStack Foundation
# Copyright 2013 NTT corp.
# 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/LIC... | |
#!/usr/bin/env python
# Written by Dhiru Kholia <dhiru at openwall.com> in July 2012 for JtR project.
# Copyright (c) 2012-2013, Dhiru Kholia.
#
# 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 thi... | |
# Copyright 2014 Amazon.com, Inc. or its affiliates. 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. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompa... | |
from __future__ import absolute_import
from __future__ import print_function
from typing import cast, Any
import sys
import unittest
try:
from tools.lib.css_parser import (
CssParserException,
CssSection,
parse,
handle_prefluff,
handle_postfluff
)
except ImportError:
... | |
"""
Binary_model - binary regression model including MBR
Developer: (James) Sung-Jin Kim, jaemssungjin.kim@gmail.com
Creation Date: July 11, 2015
Update Date: July 11, 2015
Version: ver 0.1 rev 0
"""
from sklearn import linear_model
import numpy as np
import j3x.jpyx
class BIKE_A_Ridge( linear_model.Ridge): # Later... | |
"""
TargetSelection class
"""
from itertools import chain
import numpy as np
from astropy import units as u
from astropy.coordinates import Angle, SkyCoord
from astropy.table import Table, vstack
from astropy.time import Time
from easyquery import Query, QueryMaker
from ..hosts import HostCatalog
from ..objects impor... | |
# Copyright (c) 2016, Intel Corporation.
# 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... | |
# -*- coding: utf-8 -*-
import gsxws
import phonenumbers
from django import forms
from datetime import date
from django.conf import settings
from django_countries import countries
from django.core.validators import RegexValidator
from django.utils.safestring import mark_safe
from django.utils.translation import ugett... | |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2015, Steve Gargan <steve.gargan@gmail.com>
# 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... | |
#!/usr/bin/env python
import numpy as np
import os
import shutil
import wx
import matplotlib
matplotlib.use('WXAgg')
from datetime import datetime
from matplotlib.figure import Figure
from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg as FigCanvas
from utils import take_screenshot, XboxController
SAMPLE... | |
#!/usr/bin/python
import sys
from random import shuffle, seed
from itertools import product
class Card:
FACES = {11: 'Jack', 12: 'Queen', 13: 'King', 14: 'Ace'}
SUITS = {'Hearts': 1, 'Diamonds': 2, 'Spades': 3, 'Clubs': 4}
COLORS = {'Hearts': 0, 'Diamonds': 0, 'Spades': 1, 'Clubs': 1}
def __init__(s... | |
"""Support for departure information for Rhein-Main public transport."""
import asyncio
from datetime import timedelta
import logging
from RMVtransport import RMVtransport
from RMVtransport.rmvtransport import RMVtransportApiConnectionError
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM... | |
"""Support for Nexia / Trane XL thermostats."""
import logging
from nexia.const import (
OPERATION_MODE_AUTO,
OPERATION_MODE_COOL,
OPERATION_MODE_HEAT,
OPERATION_MODE_OFF,
SYSTEM_STATUS_COOL,
SYSTEM_STATUS_HEAT,
SYSTEM_STATUS_IDLE,
UNIT_FAHRENHEIT,
)
import voluptuous as vol
from homea... | |
from __future__ import print_function
import os
import sys
import time
import requests
import pandas as pd
from googleapiclient.http import BatchHttpRequest
from googleapiclient.errors import HttpError
from .. base import ClientBase
class Client(ClientBase):
__ENDPOINT_GCE = "https://www.googleapis.com/auth/comp... | |
#!/usr/bin/env python
from __future__ import print_function
# GTK Interactive Console
# (C) 2003, Jon Anderson
# See www.python.org/2.2/license.html for
# license details.
#
import gtk
import gtk.gdk
import code
import os
import sys
import pango
import __builtin__
import __main__
banner = """GTK Interactive P... | |
# ######################################################################
# Copyright (c) 2014-2015, Brookhaven Science Associates, Brookhaven #
# National Laboratory. All rights reserved. #
# #
# Redistribution and use in ... | |
# encoding: utf-8
from south.db import db
from south.v2 import DataMigration
from django.db import models
class Migration(DataMigration):
def forwards(self, orm):
db.alter_column('auth_user', 'email', models.CharField(max_length=254, blank=True))
def backwards(self, orm):
"Write your backwar... | |
# -*- coding: utf-8 -*-
"""
tests.testing
~~~~~~~~~~~~~
Test client and more.
:copyright: (c) 2014 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import pytest
import flask
from flask._compat import text_type
def test_environ_defaults_from_config():
app = flask.Flask(_... | |
#!/usr/bin/env python3
#
# Sniffles2
# A fast structural variant caller for long-read sequencing data
#
# Created: 18.10.2021
# Author: Moritz Smolka
# Contact: moritz.g.smolka@gmail.com
#
import os
import sys
import datetime
import argparse
from sniffles import util
VERSION="Sniffles2"
BUILD="2.0.2"
SNF_VERSION="S... | |
# 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
# d... | |
"""
Contains information relevant to Instrument object
Classes and Functions
---------------------
"""
import operator
import unidecode
from nordb.core.validationTools import validateFloat
from nordb.core.validationTools import validateInteger
from nordb.core.validationTools import validateString
from nordb.core.val... | |
import pandas as pd
import os
import subprocess as sub
import re
import sys
from Bio import SeqUtils
import matplotlib.pyplot as plt
import numpy as np
from scipy import stats
from scipy import stats as st
import matplotlib as mpl
#
from matplotlib import rc
rc('font',**{'family':'sans-serif','sans-serif':['Helvetica'... | |
# Copyright 2010-2011 OpenStack Foundation
# 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 ap... | |
"""Views for the node settings page."""
# -*- coding: utf-8 -*-
import datetime
import httplib as http
from requests.exceptions import SSLError
from flask import request
from modularodm import Q
from modularodm.storage.base import KeyExistsException
from framework.auth.decorators import must_be_logged_in
from framewo... | |
from .db import db
from . import app, users
import time
import json
from flask import request, jsonify
rooms = db["rooms"]
rooms.create_index("name", unique=True)
def create_room(name, creator, publicity="public"):
room = {
"name": name,
"creator": creator["login"].lower(),
"description":... | |
"""File backend index."""
import copy
from collections import defaultdict
from blitzdb.backends.base import NotInTransaction
from blitzdb.backends.file.serializers import PickleSerializer as Serializer
from blitzdb.queryset import QuerySet
class Index(object):
"""File backend index.
An index accepts key/v... | |
#!/usr/bin/env python
import logging
import os
import inspect
import sys
from threading import Timer
from argparse import ArgumentParser
from sleekxmpp import ClientXMPP
from sleekxmpp.exceptions import XMPPError
from sleekxmpp.xmlstream.scheduler import Task, Scheduler
from base_plugin import Plugin, PluginContext
... | |
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it w... | |
# -*- coding: utf-8 -*-
import functools
import sys
from argparse import ArgumentParser
import tensorflow as tf
from pprint import pformat
from tensorflow.contrib.framework import arg_scope, add_arg_scope
import tfsnippet as spt
from tfsnippet.examples.utils import (MLResults,
sa... | |
"""Nearest Neighbor Classification"""
# Authors: Jake Vanderplas <vanderplas@astro.washington.edu>
# Fabian Pedregosa <fabian.pedregosa@inria.fr>
# Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Sparseness support by Lars Buitinck <L.J.Buitinck@uva.nl>
#
# License: BSD, (C) INRIA, Univer... | |
# Copyright (c) 2011-2015 Rackspace US, 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... | |
# -*- coding: iso-8859-15 -*-
# =================================================================
#
# Authors: Tom Kralidis <tomkralidis@gmail.com>
# Angelos Tzotsos <tzotsos@gmail.com>
#
# Copyright (c) 2011 Tom Kralidis
# Copyright (c) 2011 Angelos Tzotsos
#
# Permission is hereby granted, free of char... | |
#
# Copyright 2014 Cisco Systems,Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | |
from __future__ import print_function
old_print = print
from numpy import zeros_like, zeros
from numpy.linalg import solve
import numpy
from numba import guvectorize
from numba import double
def solve(m, sol):
# seems to segfault on windows
h, w = m.shape
for y in range(0, h):
maxrow = y
... | |
# 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 collections
import os
import cStringIO
from py_vulcanize import resource_loader
def _FindAllFilesRecursive(source_paths):
all_filenames = set()
... | |
#!/usr/bin/env python
import argparse
import json
import os
import sys
from pathlib import Path
import numpy as np
GOLDEN_ROOT = Path('ci/golden')
DEFAULT_BUILD_URL = 'https://buildkite.com/plaidml'
DEFAULT_PERF_THRESHOLD = 0.7
class RawResult:
def __init__(self, path):
self.path = path
data =... | |
#
#
#
from BCDataStream import *
from enumeration import Enumeration
from base58 import public_key_to_bc_address, hash_160_to_bc_address
import logging
import socket
import time
from util import short_hex, long_hex
def parse_CAddress(vds):
d = {}
d['nVersion'] = vds.read_int32()
d['nTime'] = vds.read_uint32()
... | |
#!/usr/bin/python
#
# Copyright (C) 2010-2011 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | |
#
# Command line tool for scoring and managing Synapse challenges
#
# To use this script, first install the Synapse Python Client
# http://python-docs.synapse.org/
#
# Log in once using your user name and password
# import synapseclient
# syn = synapseclient.Synapse()
# syn.login(<username>, <password>, rememberM... | |
#!/usr/bin/python
# -- Content-Encoding: UTF-8 --
"""
iPOPO component factories repository
:author: Thomas Calmant
:license: Apache Software License 2.0
..
Copyright 2014 isandlaTech
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the L... | |
import functools
import numpy as np
import pytest
import tensorflow as tf
from tfsnippet.utils import get_static_shape, ensure_variables_initialized
from tfsnippet.variational import *
from tfsnippet.variational.estimators import (_vimco_replace_diag,
_vimco_control_varia... | |
import re
from datetime import datetime
from django import forms
from django.conf import settings
from django.contrib.auth import authenticate, forms as auth_forms
from django.contrib.auth.forms import (PasswordResetForm as
DjangoPasswordResetForm)
from django.contrib.auth.models... | |
#!/usr/bin/python
from argparse import ArgumentParser, RawDescriptionHelpFormatter
import nuodbawsquickstart
import json
import os
import sys
import time
import unicodedata
import urllib2
INSTANCE_TYPE = "m4.xlarge"
NUODB_DOWNLOAD_URL = "http://download.nuohub.org/nuodb-%s.x86_64.rpm"
def save_config(config, file):
... | |
"""
The huginn.fdm module contains classes and functions that can be used to
initialize the flight dynamics model and create a model for a simulated
aircraft
"""
from os import path
from math import degrees
import logging
from PyJSBSim import FGFDMExec
from huginn import configuration
from huginn.unit_conversions imp... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.