gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
import sys
import os
import psycopg2
import xml.etree.ElementTree as ET
from lxml import etree
import math
from collections import Counter
from operator import itemgetter
import datetime
import collections
#Intended for use with CWar
def block(ch):
'''
Return the Unicode block name for ch, or None if ch has ... | |
from __future__ import absolute_import
import multiprocessing
import ROOT
from . import log; log = log[__name__]
from .. import QROOT, asrootpy
from ..extern.six import string_types
from ..base import NamedObject
from .fit import minimize
__all__ = [
'Workspace',
]
NCPU = multiprocessing.cpu_count()
class Wo... | |
# Copyright 2020 The StackStorm Authors.
# Copyright 2019 Extreme Networks, 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 ... | |
#!/usr/bin/env python3
import fnmatch
import multiprocessing
import os
import subprocess
import signal
import sys
import time
import uuid
def main():
print_details = True
be_positive = False
create_testcase = False
tests = []
for arg in sys.argv[1:]:
if arg == '-s':
print_detai... | |
# mk_mlt.py
# Makes a .mlt file
# uses template.mlt which was created using ShotCut GUI NLE
import xml.etree.ElementTree
import copy
import pprint
def mk_mlt(template, output, params):
def set_text(node,prop_name,value=None):
print(node,prop_name,value)
p = node.find("property[@name='{}']".fo... | |
import os
import graphDrawer
import biochemistry_old
import numpy as np
from collections import Counter
class Genome():
def __init__ (self, seq, fitness):
self.seq = seq
self.fitness = fitness
self.genes = seq.split('DDAA')
self.proteins = {}
self.colour = None
def find... | |
# Copyright (c) 2012, Daniel Zerbino
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# (1) Redistributions of source code must retain the above copyright
# notice, this list of conditions an... | |
# -*- coding: utf-8 -*-
"""
Created on Thu Jul 16 15:42:56 2015
@author: ibackus
"""
import warnings
import pynbody as pb
SimArray = pb.array.SimArray
import numpy as np
from diskpy.utils import match_units
from diskpy.pdmath import binned_mean
def Q(snapshot, molecular_mass = 2.0, bins=100, use_velocity=False, \
us... | |
'''
from David Huard's scipy sandbox, also attached to a ticket and
in the matplotlib-user mailinglist (links ???)
Notes
=====
out of bounds interpolation raises exception and wouldn't be completely
defined ::
>>> scoreatpercentile(x, [0,25,50,100])
Traceback (most recent call last):
...
raise ValueError("A va... | |
"""MediaFire Client"""
from __future__ import unicode_literals
import os
import hashlib
import logging
import requests
import posixpath
from six.moves.urllib.parse import urlparse
from mediafire.api import (MediaFireApi, MediaFireApiError)
from mediafire.uploader import (MediaFireUploader, UploadSession)
# These a... | |
"""
Django settings for democracylab project.
Generated by 'django-admin startproject' using Django 1.11.1.
For more information on this file, see
https://docs.djangoproject.com/en/1.11/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.11/ref/settings/
"""
#TODO: C... | |
import json
import os
import shutil
import tempfile
from distutils.version import LooseVersion
import numpy as np
import pandas as pd
import pyproj
from pyproj import CRS
from pyproj.exceptions import CRSError
from shapely.geometry import Point, Polygon
import geopandas
import geopandas._compat as compat
from geopan... | |
#!/usr/bin/env python
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
"""Nipype : Neuroimaging in Python pipelines and interfaces package.
Nipype intends to create python interfaces to other neuroimaging
packages and create an API for specifying a full ... | |
#
# File: Heat_Impl.py
# Symbol: csdms.examples.py.Heat-v0.0
# Symbol Type: class
# Babel Version: 1.4.0 (Revision: 6607 release-1-4-0-branch)
# Description: Implementation of sidl class csdms.examples.py.Heat in Python.
#
# WARNING: Automatically generated; changes will be lost
#
#
# DO-NOT-DEL... | |
#
# Copyright (c) 2009-2015 Tom Keffer <tkeffer@gmail.com>
#
# See the file LICENSE.txt for your full rights.
#
"""Almanac data
This module can optionally use PyEphem, which offers high quality
astronomical calculations. See http://rhodesmill.org/pyephem. """
import time
import sys
import math
import copy
impo... | |
# -*- coding: utf-8 -*-
# Built-in
# Common
import numpy as np
# tofu
# from tofu import __version__ as __version__
from . import _generic_check
from ._DataCollection_class import DataCollection
from . import _mesh_checks
from . import _mesh_comp
from . import _mesh_plot
from . import _matrix_comp
from . import _... | |
# -*- coding: utf-8 -*-
'''
Module for getting information about syslog-ng
:maintainer: Tibor Benke <btibi@sch.bme.hu>
:maturity: new
:depends: cmd
:platform: all
This module is capable of managing syslog-ng instances which were installed
via a package manager or from source. Users can use a direct... | |
#!/usr/bin/env python
#
# Copyright 2013, Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can
# be found in the LICENSE file.
"""Tests the robustness and resiliency of vtworkers."""
from collections import namedtuple
import urllib
import urllib2
import logging
import... | |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright 2018-2022 F4PGA Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unl... | |
# -*- test-case-name: twisted.conch.test.test_manhole -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Line-input oriented interactive interpreter loop.
Provides classes for handling Python source input and arbitrary output
interactively from a Twisted application. Also included is syn... | |
import codecs
import contextlib
import copy
from decimal import Decimal
from django.apps.registry import Apps
from django.db.backends.base.schema import BaseDatabaseSchemaEditor
class DatabaseSchemaEditor(BaseDatabaseSchemaEditor):
sql_delete_table = "DROP TABLE %(table)s"
sql_create_inline_fk = "REFERENCES... | |
from unittest import TestCase
import six
import sqlite3
from dark.taxonomy import (
LineageElement as LE, LineageFetcher, Taxonomy, isRetrovirus, isRNAVirus)
class FakeCursor(object):
def __init__(self, results):
self._results = results
self._index = -1
def execute(self, p):
pass... | |
from __future__ import absolute_import, print_function
from django.conf.urls import include, patterns, url
from .endpoints.accept_project_transfer import AcceptProjectTransferEndpoint
from .endpoints.relay_heartbeat import RelayHeartbeatEndpoint
from .endpoints.relay_projectconfigs import RelayProjectConfigsEndpoint
... | |
# Copyright 2022 Google LLC
#
# 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, ... | |
'''
Created on Aug 2, 2015
@author: ivan
'''
import urwid
from collections import deque
from threading import Thread
import threading
class UnknownCommand(Exception):
def __init__(self,cmd):
Exception.__init__(self,'Uknown command: %s'%cmd)
class Command(object):
""" Base class to manage commands in ... | |
import os
import numpy as np
import pytest
from pandas.compat import is_platform_little_endian
from pandas import (
DataFrame,
HDFStore,
Series,
_testing as tm,
read_hdf,
)
from pandas.tests.io.pytables.common import (
_maybe_remove,
ensure_clean_path,
ensure_clean_store,
tables,
... | |
"""
Support for Denon AVR receivers using their HTTP interface.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/media_player.denon/
"""
from collections import namedtuple
import logging
import voluptuous as vol
from homeassistant.components.media_playe... | |
''' This module contains OptionsFrame class used for displaying and modifying
some of the parameters.
Attributes:
COUNT_TO_NAME_RADIO_BTN (dict of {(str, int) to str}): dictionary that
maps parameter name and count to a valid value. This structure is
used to identify parameter ... | |
import itertools
from django import forms
from django.core.exceptions import ValidationError
from django.forms.utils import ErrorList
from django.utils.functional import cached_property
from django.utils.html import format_html, format_html_join
from django.utils.translation import gettext as _
from wagtail.admin.sta... | |
"""
NetCDF reader/writer module.
This module is used to read and create NetCDF files. NetCDF files are
accessed through the `netcdf_file` object. Data written to and from NetCDF
files are contained in `netcdf_variable` objects. Attributes are given
as member variables of the `netcdf_file` and `netcdf_variable` objects... | |
# Copyright 2017 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 or agreed to in writing, ... | |
###############################################################################
#
# The MIT License (MIT)
#
# Copyright (c) Crossbar.io Technologies GmbH
#
# 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 ... | |
from __future__ import print_function, division
from sympy.core import S, Add, Mul, sympify, Symbol, Dummy
from sympy.core.compatibility import u
from sympy.core.exprtools import factor_terms
from sympy.core.function import (Function, Derivative, ArgumentIndexError,
AppliedUndef)
from sympy.core.numbers import pi
... | |
# 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... | |
from __future__ import unicode_literals
from django.contrib.auth.models import User
from django.core.files.uploadedfile import SimpleUploadedFile
from reviewboard.reviews.forms import (DefaultReviewerForm, GroupForm,
UploadDiffForm)
from reviewboard.reviews.models import Default... | |
# Copyright 2013-2016 DataStax, 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 writi... | |
# 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.
"""Utility functions (file reading, simple IDL parsing by regexes) for IDL build.
Design doc: http://www.chromium.org/developers/design-documents/idl-build
... | |
from __future__ import absolute_import, unicode_literals
from django.core.exceptions import ValidationError
from django.forms import Form
from django.forms.fields import IntegerField, BooleanField
from django.forms.util import ErrorList
from django.forms.widgets import Media, HiddenInput
from django.utils.encoding imp... | |
# util/langhelpers.py
# Copyright (C) 2005-2015 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
"""Routines to help with the creation, loading and introspection of
modules, cla... | |
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | |
import numpy as np
import torch
import os
import sys
import functools
import torch.nn as nn
from torch.autograd import Variable
from torch.nn import init
import torch.nn.functional as F
import torchvision.models as M
class GANLoss(nn.Module):
def __init__(self, target_real_label=1.0, target_fake_label=0.0,
... | |
# Copyright (c) 2012 Rackspace Hosting
# 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 req... | |
# -*- coding: utf-8 -*-
from plexapi import X_PLEX_CONTAINER_SIZE, log, utils
from plexapi.base import PlexObject
from plexapi.compat import unquote, urlencode, quote_plus
from plexapi.media import MediaTag
from plexapi.exceptions import BadRequest, NotFound
class Library(PlexObject):
""" Represents a PlexServer ... | |
# 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... | |
#!/usr/bin/env python
# GoodFET Client Library
#
# (C) 2009 Travis Goodspeed <travis at radiantmachines.com>
#
# This code is being rewritten and refactored. You've been warned!
import sys, time, string, cStringIO, struct, glob, os;
import sqlite3;
fmt = ("B", "<H", None, "<L")
def getClient(name="GoodFET"):
i... | |
# Copyright 2010 Dmitry Naumenko (dm.naumenko@gmail.com)
# Copyright 2015 Techcable
#
# 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... | |
"""
Essential parts borrowed from https://github.com/ipython/ipython/pull/1654
"""
from __future__ import print_function
from __future__ import absolute_import
from future import standard_library
standard_library.install_aliases()
from builtins import str
from builtins import range
from builtins import object
import io... | |
# coding:utf-8
import re
import string
import random
import six
from .. import *
from nose.tools import assert_equal, assert_not_equal, ok_
from nose.tools import nottest
from flanker.addresslib import validate
from flanker.addresslib import corrector
COMMENT = re.compile(r'''\s*#''')
@nottest
def generate_mut... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2008-2009 Zuza Software Foundation
#
# This file is part of translate.
#
# translate 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... | |
"""
Margin implementations for a :class:`~prompt_toolkit.layout.containers.Window`.
"""
from __future__ import unicode_literals
from abc import ABCMeta, abstractmethod
from six import with_metaclass
from six.moves import range
from prompt_toolkit.filters import to_cli_filter
from prompt_toolkit.token import Token
fro... | |
# Copyright 2013-2018 Donald Stufft and individual 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
#
# Unless required by applicabl... | |
"""
websocket - WebSocket client library for Python
Copyright (C) 2010 Hiroki Ohtani(liris)
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, ... | |
#!/usr/bin/env python
#
# Copyright (C) 2011, 2012 Google Inc.
#
# This file is part of YouCompleteMe.
#
# YouCompleteMe 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
# (... | |
#!/usr/bin/env python2.7
# encoding: 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, Vers... | |
#!/usr/bin/env python
import random
import math
import time
import copy
from pprint import pprint as pp
from .objectfns import MAPSB
import sim
debug = False
# Print the modules being used for the external simulator
if debug:
using_modules = [sim.circuit, sim.devices, sim.printing]
using_modules = ["%s %s... | |
#!/usr/bin/env python
# encoding: utf-8
import logging
import time
import os
import sys
from datetime import datetime
from contextlib import suppress
import requests
from pymongo import MongoClient
from bson.objectid import ObjectId
from steem.blockchain import Blockchain
logging.basicConfig(format='%(levelname)s: %... | |
# This file is part of beets.
# Copyright 2013, Adrian Sampson.
#
# 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, ... | |
import acq4.Manager
import numpy as np
import acq4.analysis.tools.functions as afn
import scipy
#from acq4.util.pyqtgraph.multiprocess import Parallelize
from acq4.pyqtgraph.debug import Profiler
import os, sys
try:
import cv2
HAVE_CV2 = True
except ImportError:
HAVE_CV2 = False
probabilityInputs = n... | |
# coding=utf-8
# Copyright 2022 The Google Research Authors.
#
# 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 applicab... | |
#
# Copyright (c) 2017 Intel Corporation
#
# 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... | |
# -*- coding: utf-8 -*-
import struct
import os
from collections import OrderedDict
from atomseeker import elements
ATOMS_WITH_ONLY_CHILDREN = ("trak", "edts", "mdia", "minf", "stbl")
ATOMS_WITH_VERSION = ("mvhd", "tkhd", "mdhd", "elst")
def read_num(stream, num=4):
"""return a number by 'num'-byte from 'strea... | |
"""
Tools for generating forms based on mongoengine Document schemas.
"""
import sys
import decimal
from bson import ObjectId
from operator import itemgetter
try:
from collections import OrderedDict
except ImportError:
# Use bson's SON implementation instead
from bson import SON as OrderedDict
from wtform... | |
# -*- coding: utf-8 -*-
# Copyright 2013 Takeshi KOMIYA
#
# 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 -*-
"""
Created on Sat Oct 18 17:04:44 2014
@author: Dexter Pratt
"""
network = {
"$schema": "http://www.ndexbio.org/api/schema/1.0.0/Network",
"description": "Schema for Network objects used in NDEx REST API",
"type": "object",
"required": [
"type",
"edges",
... | |
#########################################################################
# Copyright (c) 2017, NVIDIA CORPORATION. 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 c... | |
import re
import os,sys
import pdb
import numpy as np
regex_dir = os.path.dirname(os.path.abspath(__file__))
util = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
A_path = os.path.join(regex_dir,'patternA')
Atec_path = os.path.join(regex_dir,'patternAtec')
Apost_path = os.path.join(regex_dir,'pattern_post... | |
# 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... | |
# 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 2020 DeepMind Technologies Limited.
#
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agre... | |
#!/usr/bin/env python
#
# Copyright 2011 Rodrigo Ancavil del Pino
#
# 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 2017 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 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.
import datetime
import webapp2
from testing_utils import testing
from handlers import list_analyses
from model.wf_analysis import WfAnalysis
from model imp... | |
# coding: spec
from iam_syncr.errors import BadRole, BadPolicy, InvalidDocument
from iam_syncr.amazon.roles import AmazonRoles
from iam_syncr.statements import Statements
from iam_syncr.amazon.base import Amazon
from noseOfYeti.tokeniser.support import noy_sup_setUp
from textwrap import dedent
import uuid
import six
... | |
from __future__ import unicode_literals
from builtins import zip
from builtins import object
from django.contrib import admin
from django.core.exceptions import ValidationError
from django.contrib.contenttypes.admin import GenericTabularInline, GenericStackedInline
from django.contrib.contenttypes.forms import BaseGene... | |
from django.http import Http404
from rest_framework import status
from rest_framework import viewsets, mixins
from rest_framework.permissions import IsAuthenticated
from rest_framework.decorators import action
from rest_framework.response import Response
from rest_framework.pagination import PageNumberPagination, Limit... | |
# wcurve.py - basic arithmetic on elliptic curves in short Weiertsrass form.
#
# Copyright (c) 2010-2011 Sebastien Martini <seb@dbzteam.org>
#
# 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 ... | |
#!/usr/bin/env python
# Python module for photometric calibration.
# It needs the Python modules ppgplot and
# mpfit to be installed.
# 03.03.2005 Fixed a serious bug in the rejection loop. Instead
# of using the remaining points we always used all points
# and rejected points until the original... | |
# Copyright 2012 (C) Daniel Richman, Adam Greig
#
# This file is part of strict_rfc3339.
#
# strict_rfc3339 is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option... | |
from collections import deque
from src.shared.game_state import GameState
from src.shared.game_state_change import ResourceChange
from src.shared.geometry import Distance, Coord, Rect, isRectCollision
from src.shared.ident import unitToPlayer
from src.shared.logconfig import newLogger
from src.shared import messages
f... | |
from __future__ import print_function
import json
from twisted.trial import unittest
from twisted.internet.defer import gatherResults, succeed
from twisted.internet.threads import deferToThread
from ..blocking.transcribe import Wormhole, UsageError, ChannelManager
from ..blocking.eventsource import EventSourceFollower
... | |
"""Support for Generic Modbus Thermostats."""
import logging
import struct
import voluptuous as vol
from homeassistant.components.climate import PLATFORM_SCHEMA, ClimateDevice
from homeassistant.components.climate.const import (
HVAC_MODE_AUTO,
SUPPORT_TARGET_TEMPERATURE,
)
from homeassistant.const import (
... | |
import pytest
import mock
from mock import call
from django.utils import timezone
from osf.management.commands.add_notification_subscription import add_reviews_notification_setting
from osf.management.commands.populate_registration_provider_notification_subscriptions import populate_registration_provider_notification_... | |
##
## Parse MISO settings
##
import os
import sys
import misopy
from misopy.parse_csv import *
import ConfigParser
miso_path = os.path.dirname(os.path.abspath(os.path.expanduser(__file__)))
class Settings(object):
@classmethod
def load(cls, path):
"""
Reads in settings from a ConfigParser for... | |
#!/usr/bin/env python
import rospy
import math
import autobot
from autobot.msg import drive_param
from sensor_msgs.msg import LaserScan
from autobot.msg import pid_input
from autobot.msg import wall_dist
from autobot.msg import pathFinderState
from autobot.srv import *
"""
TODO:
- [x] Decide if you want to hug right/l... | |
#!/usr/bin/env python
'''
Example code for converting a book page to a text string.
'''
# OpenCV imports
import numpy as np
import cv2
# Tesseract OCR
from tesserwrap import Tesseract
import PIL as pil
import re
import os
# ----------------------------------------------------------------
SAVE_SCREENSHOTS = False
... | |
# Copyright (C) 2016 Red Hat, 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... | |
# TODO
#
# @author Oktay Acikalin <oktay.acikalin@gmail.com>
# @copyright Oktay Acikalin
# @license MIT (LICENSE.txt)
from diamond import pyglet
from diamond.node import Node
from diamond import event
from diamond.array import Array
from diamond.fbo import FBO
# Load this into our namespace for easier reference.... | |
#!/usr/bin/env python2
import argparse
import numpy as np
import os
import os.path
from os.path import join, isfile
import soundfile as sf
import sys
outdir = join(os.path.dirname(__file__), 'output')
def __exit(error_msg):
sys.exit(os.path.basename(__file__) + ": Error: " + error_msg)
def syncronize(raw_audi... | |
'''This module provides all the methods needed for data extraction, preprocessing, storing and retrieval.
A deep neural network is nothing but a bunch of random parameters without massive amounts of high quality data
to train it on, and as such a large percentage of project time was spent building the data.py methods.... | |
# 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 agreed ... | |
# 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 ... | |
from __future__ import division, print_function, absolute_import
import functools
import operator
import numpy as np
from scipy._lib.six import string_types
from scipy.linalg import (get_lapack_funcs, LinAlgError,
cholesky_banded, cho_solve_banded)
from . import _bspl
from . import _fitpack_... | |
# ----------------------------------------------------------------------------
# Copyright (c) 2013--, scikit-bio development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed with this software.
# --------------------------------------------... | |
#!/usr/bin/env python
import os
import shutil
import glob
import time
import sys
import subprocess
import string
from optparse import OptionParser, make_option
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
PKG_NAME = os.path.basename(SCRIPT_DIR)
PARAMETERS = None
#XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=... | |
from eszone_openvpn.settings import VPN_DEFAULT_VARS, VPN_PATHS, VPN_VARS, OPENVPN_COMMANDS, HELP_VARS
from rest_framework.exceptions import APIException
import os, subprocess
from exceptions import InstanceHaveNoVarsAttributesException
import os.path
from exceptions import *
import re
import time
logFileName = "open... | |
"""Provide functionality to interact with the vlc telnet interface."""
from __future__ import annotations
from datetime import datetime
from typing import Any
from aiovlc.client import Client
from aiovlc.exceptions import AuthError, CommandError, ConnectError
import voluptuous as vol
from homeassistant.components.me... | |
#!/usr/bin/env python
import random
import subprocess
import io
import os
# import sys # used to print to stderr for unit testing
import warnings
import logging
logger = logging.getLogger(__name__)
def setup_logger(fh, formatter):
logger.setLevel(logging.DEBUG)
fh = fh
# fh.setLevel(logging.DEBUG)
... | |
from django.http import HttpResponse, HttpResponseBadRequest
from django.shortcuts import render
from django.contrib.auth.decorators import login_required
from friends.models import Friend, Follow, FriendRequest
from django.db.models import Q
from django.db import IntegrityError
from user_profile.models import Profile... | |
"""Support for monitoring emoncms feeds."""
from datetime import timedelta
import logging
import voluptuous as vol
import requests
import homeassistant.helpers.config_validation as cv
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.const import (
CONF_API_KEY,
CONF_URL,
CONF... | |
import scipy, pylab
from scipy.io import wavfile
from scipy import signal
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.ticker import FuncFormatter
import os
import webbrowser
try:
from future import *
except:
pass
"""Komori visualization subpackage"""
def version():
return '0.20'
cla... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.