content stringlengths 4 20k |
|---|
import json
import logging
import os
from awscli.clidriver import CLIOperationCaller
from awscli.customizations.emr import constants
from awscli.customizations.emr import exceptions
from botocore.exceptions import WaiterError, NoCredentialsError
from botocore import xform_name
LOG = logging.getLogger(__name__)
def... |
import simuPOP as sim
import random
pop = sim.Population(size=[200, 400], loci=[30], infoFields='x')
# assign random information fields
sim.initSex(pop)
sim.initInfo(pop, lambda: random.randint(0, 3), infoFields='x')
# define a virtual splitter by sex
pop.setVirtualSplitter(sim.SexSplitter())
pop.numVirtualSubPop() ... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('auth', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='Teammate',
... |
"""
test_data
------------
Tests for `os_service_types.data` module.
"""
import json
import six
from os_service_types import data
from os_service_types.tests import base
if six.PY2:
# Python 2 has not FileNotFoundError exception
FileNotFoundError = IOError
class TestData(base.TestCase, base.TemporaryFi... |
from tempest_lib.common.utils import data_utils
from tempest_lib import exceptions as lib_exc
from tempest.api.compute import base
from tempest import test
class FlavorsExtraSpecsNegativeTestJSON(base.BaseV2ComputeAdminTest):
"""
Negative Tests Flavor Extra Spec API extension.
SET, UNSET, UPDATE Flavor ... |
import os, platform
import re
#import per il controllo dell'URL
import urllib2
import socket
#correct setup flag
f=0
news=0
#stop=0
url=""
url_checked=0 #serve?
old_hash=""
new_hash=""
old_size=0
emailNotify=0 #0: No; 1: Yes
def clear_screen():
if platform.system() == 'Linux': os.system('clear')
if platform.syst... |
# -*- coding: utf-8 -*-
"""QGIS Unit tests for QgsPalLabeling: base suite setup
From build dir, run: ctest -R PyQgsPalLabelingBase -V
See <qgis-src-dir>/tests/testdata/labeling/README.rst for description.
.. note:: This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Gen... |
# -*- coding: utf-8 -*-
"""
Created on 2017-5-5
@author: cheng.li
"""
import unittest
import numpy as np
from alphamind.portfolio.linearbuilder import linear_builder
class TestLinearBuild(unittest.TestCase):
def setUp(self):
self.er = np.random.randn(3000)
self.risk_exp = np.random.randn(3000,... |
"This module provides a set of common utility functions."
__author__ = "Anders Logg"
__copyright__ = "Copyright (C) 2009 Simula Research Laboratory and %s" % __author__
__license__ = "GNU GPL Version 3 or any later version"
from math import ceil
from numpy import linspace
from dolfin import PeriodicBoundaryComputati... |
#-*- coding: utf-8 -*-
from django.conf import settings
from filer.server.backends.default import DefaultServer
from filer.storage import PublicFileSystemStorage, PrivateFileSystemStorage
from filer.utils.loader import load_object, storage_factory
import os
import urlparse
FILER_ENABLE_PERMISSIONS = getattr(settings, ... |
from django.contrib import admin
from django.contrib.auth import get_user_model
from django.contrib.auth.admin import UserAdmin
from guardian.admin import GuardedModelAdmin
from userena.models import UserenaSignup
from .forms import ZahlungFormular
from .models import Hauptpunkt, Unterpunkt, ScholariumProfile, Mitwirk... |
import inspect
import functools
class SkipItem(Exception):
'''Methods decorated with @make_item can throw this exception
to prevent the function's output from being collected by the
iterator.
'''
def make_item(key, wrapwith=None):
'''Decorator used to mark instance methods as producing a key, va... |
from openerp.osv import orm, fields
from openerp.tools.translate import _
import base64
import unicodecsv
import StringIO
class account_fr_fec(orm.TransientModel):
_name = 'account.fr.fec'
_description = 'Ficher Echange Informatise'
_columns = {
'fiscalyear_id': fields.many2one(
'acco... |
# -*- coding: utf-8 -*-
"""
Models of ``critica.apps.users`` application.
"""
from django.db import models
from django.utils.translation import ugettext_lazy as _
class UserProfile(models.Model):
"""
User profile.
"""
user = models.ForeignKey('auth.User', verbose_name=_('user'), unique=True)
... |
import os
from datetime import datetime
import hashlib
def hash_file(fh, algorithm, blocksize=65536):
buf = fh.read(blocksize)
while len(buf) > 0:
algorithm.update(buf)
buf = fh.read(blocksize)
return algorithm.hexdigest()
def format_time_iso(date):
return datetime.strftime(date, '%Y... |
#!/usr/bin/env python
from __future__ import print_function
import sys, platform
class PrintColor(object):
"""
A class to print colorized text using ANSI escape sequences
"""
def __init__(self, tab_size=4, use_color=True, max_width=0, indentation=0):
self._color = {
'regular':'\033... |
from django.db import models
from django.contrib.auth.models import User
from django.db.models import signals
class DatedMessageManager(models.Manager):
'''
Add some convenience functions for working with messages.
'''
def post_message_to_users(self, msg_text, sender=None,
... |
# -*- coding:utf8 -*-
""" Test library for CRC16 """
# !/usr/bin/python
# Python: 3.5.2
# Platform: Windows/Linux/ARMv7
# Program: Test library CRC16 Module.
# History: 2017-08-17 Wheel Ver:0.0.3 [Heyn] Initialize
import unittest
import libscrc
from libscrc import _crc16
class TestCRC16Modbus(unittest.TestCase):... |
"""
Generator for c target.
"""
from sbpg.targets.templating import *
TEMPLATE_NAME = "sbp_messages_template.h"
def commentify(value):
"""
Builds a comment.
"""
if value is None:
return
if len(value.split('\n')) == 1:
return "* " + value
else:
return '\n'.join([' * ' + l for l in value.split(... |
import logging
import os
import string
import unicodedata
import zipfile
from golem.core.simplehash import SimpleHash
from golem.resource.dirmanager import split_path
logger = logging.getLogger(__name__)
class TaskResourceHeader(object):
def __init__(self, dir_name):
self.sub_dir_headers... |
import unittest
from opencensus.tags import TagValue
class TestTagValue(unittest.TestCase):
def test_constructor(self):
tag_value = TagValue('value')
self.assertIsNotNone(tag_value)
self.assertEqual(tag_value, 'value')
def test_check_value(self):
test_val1 = 'e9nnb1ixRnvzBH1... |
from smartbox import SmartBox
if __name__ == "__main__":
import time
port = "COM1"
SB = SmartBox(port)
SB.openConnection()
disconnected = False
outnum = 0
motornum = 0
SB.motorPower(3)
motorA = 0
while not disconnected:
if outnum > 8:
outnum = 0
if mot... |
"""
Getting Access Token via scrapping
Very unreliable, just for testing, may break easily with any format change on the official website.
No other part of the API relies on the ACCESSTOKEN you acquired here.
You probably will get a new token everytime, your old token will no longer work.
please set up your meethue_em... |
from django.test import TestCase
from django.test.client import Client
from django.contrib.auth.models import Group
from tutordb.models import Centre, Tutor
from certificates.models import Certificate
# NOTE ON CERTIFICATES:
#
# Ideally the certificate tests would be in the ce... |
from pygments.lexer import RegexLexer, bygroups
from pygments.token import *
#
# The choice of license is done for merging this to the upstream project
# in the future.
#
# Copyright (c) 2021 by Masatake YAMATO.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modificati... |
'''
A simple script that notifies the user when
a seat becomes available in a specific course.
The MIT License (MIT)
Copyright (c) 2014 Leen AlShenibr, Tara Tayba
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal... |
# coding: utf-8
from unittest import TestCase
from deworld.utils import E, prepair_to_approximation, resize2d, shift2d
class UtilsTests(TestCase):
def setUp(self):
pass
def test_prepair_to_approximation(self):
powers = prepair_to_approximation([(1, 'a'), (3, 'b'), (10, 'c')])
Q = 3.... |
#!/usr/bin/env python
"""
* =========================================================================
* This file is part of NITRO
* =========================================================================
*
* (C) Copyright 2004 - 2016, MDA Information Systems LLC
*
* NITRO is free software; you can redistribu... |
"""Compatibility fixes for older version of python, numpy and scipy
If you add content to this file, please give the version of the package
at which the fixe is no longer needed.
"""
# Authors: Emmanuelle Gouillart <<EMAIL>>
# Gael Varoquaux <<EMAIL>>
# Fabian Pedregosa <<EMAIL>>
# Lars Buit... |
from __future__ import absolute_import
from __future__ import print_function
import boto3
import argparse
import sys
import yaml
from pprint import pprint
def find_active_instances(cluster_file, region):
"""
Determines if a given cluster has at least one ASG and at least one active instance.
Input:
c... |
import psycopg2
from django.core.management.base import BaseCommand
from common import utils
class Command(BaseCommand):
def add_arguments(self, parser):
parser.add_argument('--db_name')
parser.add_argument('--db_user')
parser.add_argument('--db_pass')
def handle(self, *args, **optio... |
import logging
logging.basicConfig(level=logging.DEBUG)
import unittest
import spyne.const.xml as ns
from spyne.interface.wsdl.wsdl11 import Wsdl11
from . import build_app
from .port_service_services import TS1
from .port_service_services import TSinglePortService
from .port_service_services import TDoublePortServi... |
from core.domain import widget_domain
from extensions.value_generators.models import generators
class TextInput(widget_domain.BaseWidget):
"""Definition of a widget.
Do NOT make any changes to this widget definition while the Oppia app is
running, otherwise things will break.
This class represents a... |
"""\
===================
Checkers board game
===================
A 3D version of the checkers (draughts) boardgame.
Only basic game rules are implemented (pieces can't be put on top of
another and only on black fields). The implementation of more advanced
game rules is left up to the reader :) .
"""
import Axon
imp... |
# -*- coding: utf-8 -*-
"""
Cookie handling module.
"""
import logging
import os
import ssl
import requests
from requests.adapters import HTTPAdapter
from requests.packages.urllib3.poolmanager import PoolManager
from six.moves import StringIO
from six.moves import http_cookiejar as cookielib
from .define import CLA... |
"""
Plotter - draws plots using gnuplot.
Input: gnuplot datafile(s) created by 'tema logreader --gnuplot'
Output: command that draws a plot when given to gnuplot (via stdin)
Examples:
Help:
tema plotter -h
View default (-y=awcov, -x=kw ) graph from gnuplot file my.plotdat:
tema plotter my.plotdat | gnuplot -persist... |
from __future__ import print_function
from LogAnalyzer import Test,TestResult
import DataflashLog
class TestThrust(Test):
'''test for sufficient thrust (copter only for now)'''
def __init__(self):
Test.__init__(self)
self.name = "Thrust"
def run(self, logdata, verbose):
... |
#!/usr/bin/env python
from peyotl.phylesystem.phylesystem_umbrella import Phylesystem
from peyotl.nexson_syntax import extract_tree_nexson
import sys
try:
phylsys = Phylesystem()
except Exception as e:
sys.stderr.write('count_trees.py: Exception: {}\n'.format(e.message))
sys.exit('count_trees.py: There was ... |
import os
import ycm_core
# These are the compilation flags that will be used in case there's no
# compilation database set (by default, one is not set).
# CHANGE THIS LIST OF FLAGS. YES, THIS IS THE DROID YOU HAVE BEEN LOOKING FOR.
flags = [
'-Wall',
'-Wextra',
'-Werror',
'-fexceptions',
'-DNDEBUG',
# THIS IS IMPORTA... |
# -*- coding: utf-8 -*-
class StateBasedIncrementOnlyCounter(object):
""" Supports increments.
See: https://en.wikipedia.org/wiki/Conflict-free_replicated_data_type
"""
def __init__(self, replica_id):
self.state = {}
self.replica_id
def increment(self):
if not replica_id in self.state:
s... |
from WebsocketListener import WebsocketListener
class HalflifeListener:
def __init__(self, error_room, report_rooms, notifications=None, tags=None):
self.error_room = error_room
self.report_rooms = report_rooms
self.notifications = notifications
self.tags = tags
self.ws_lin... |
import unittest
from math import sqrt,radians,asin
from flavio.physics.bdecays.formfactors.b_p import btop, bcl_parameters, bcl, bsz_parameters
from flavio.physics.bdecays.formfactors.b_v.test_btov import test_eos_ff
import numpy as np
import copy
from flavio.parameters import default_parameters
from flavio.classes imp... |
#!/usr/bin/python
import sys,os,time,uuid,tarfile,ConfigParser
import json,couchdb,datetime,socket,random,shutil
def get_finished_calculations(db):
map_fun = ''' function(doc) { if(doc.calculation.state=='finished') { emit(doc._id); } } '''
results = db.query(map_fun)
calculations = []
for item in results:
... |
from urbansim.abstract_variables.ln_sampling_probability_for_bias_correction_mnl import ln_sampling_probability_for_bias_correction_mnl
class ln_sampling_probability_for_bias_correction_mnl_SSS(ln_sampling_probability_for_bias_correction_mnl):
def __init__(self, attribute):
ln_sampling_probability_for_... |
#!/usr/bin/env python
#
# This script completely migrates a <= 0.8.x Trac environment to use the new
# default ticket model introduced in Trac 0.9.
#
# In particular, this means that the severity field is removed (or rather
# disabled by removing all possible values), and the priority values are
# changed to the more... |
from sickbeard import logger
from sickbeard import tvcache
from sickrage.providers.nzb.NZBProvider import NZBProvider
class WombleProvider(NZBProvider):
def __init__(self):
NZBProvider.__init__(self, "Womble's Index")
self.public = True
self.cache = WombleCache(self)
self.urls = {'... |
'''
Created on 22.09.2011
@author: michi
'''
from PyQt4.QtCore import QModelIndex, Qt, pyqtSignal
from PyQt4.QtGui import QAbstractProxyModel
from ems.qt4.itemmodel.reflectable_mixin import ReflectableMixin #@UnresolvedImport
class EditableProxyModel(QAbstractProxyModel, ReflectableMixin):
#modelReset = py... |
from __future__ import print_function, division, absolute_import
import copy
import numpy as np
from msmbuilder.msm import MarkovStateModel
import functools
import multiprocessing
import os
class BACE(MarkovStateModel):
"""Bayesian Agglomerative Clustering Engine (BACE) for coarse-graining (lumping)
microsta... |
from .resource import Resource
class Registry(Resource):
"""An object that represents a container registry.
Variables are only populated by the server, and will be ignored when
sending a request.
:ivar id: The resource ID.
:vartype id: str
:ivar name: The name of the resource.
:vartype n... |
import random
from canari.maltego.transform import Transform
from canari.framework import EnableDebugWindow
from common.entities import NettackerScan
from lib.scan.viewdns_reverse_ip_lookup.engine import start
from database.db import __logs_by_scan_id as find_log
__author__ = 'Shaddy Garg'
__copyright__ = 'Copyrigh... |
import twitter
import constants
def tweet(texto):
username = constants.twitterUser
password = constants.twitterPwd
try:
api = twitter.Api(username, password)
api.PostUpdate(texto)
except:
print "Tweet: Erro"
else:
print "Tweet: Ok" |
import datetime
import functools
import socket
from unittest import mock
import uuid
import fixtures
from oslo_config import cfg
from oslo_service import loopingcall
from oslo_utils import timeutils
import oslo_versionedobjects
from cinder.common import constants
from cinder import context
from cinder import db
from ... |
from django.db import models
import os
import uuid
from django.core.files.storage import FileSystemStorage
from datetime import timedelta, datetime
from django.core import urlresolvers
class Mail(models.Model):
uuid = models.CharField(max_length = 36, verbose_name = "UUID", default = lambda:uuid.uuid4(), editable ... |
"""
The :class:`~allennlp.common.params.Params` class represents a dictionary of
parameters (e.g. for configuring a model), with added functionality around
logging and validation.
"""
from typing import Any, Dict, List
from collections import MutableMapping
import copy
import logging
import pyhocon
from overrides im... |
# -*- coding: utf-8 -*-
from rest_framework import routers, views, reverse, response
class HybridRouter(routers.DefaultRouter):
"""
Extend native REST Framework router to include also APIView classes
objects in browsable api.
"""
def __init__(self, *args, **kwargs):
super(HybridRouter, self... |
# partial Game class
from .celldefs import Cell, ObjTypes, ObjTypeDict, Building, Object
def _canBeBuilt(self, charRepr):
'''
Can the object be built
'''
if not charRepr in ObjTypeDict:
return False
objType = ObjTypeDict[charRepr]
if not objType.CanBeBuilt:
return False
... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='League',
fields=[
('id', models.AutoField(prima... |
"""Metrics for evaluating Byte models."""
import re
import string
import nltk
from nltk.translate.bleu_score import sentence_bleu
import numpy as np
from t5.evaluation import metrics as t5_metrics
def cer(targets, predictions):
"""Computes the Character Error Rate (CER).
The Character Error Rate for a (input w... |
"""
$Id$
$URL$
Copyright (C) 2004 Matteo Merli <<EMAIL>>
This code is licenced under the GPL. See LICENSE file.
"""
from pixies.reportlab.platypus import *
from pixies.elements import *
from pixies.utils import *
############################################################################
class Sequence:
name = N... |
import copy
import numpy as np
from datetime import datetime, timedelta
from multiprocessing import Process
from pythomics.proteomics.parsers import GuessIterator
from .logger import logger
class Reader(Process):
def __init__(self, incoming, outgoing, raw_file=None, spline=None, rt_window=None, timeout_minutes=5... |
import click
import logging
import sys
from .client import CloudPassageAPI
@click.group()
@click.option('--client-key',
envvar='CPAPI_CLIENT_KEY',
help='The client key for the API')
@click.option('--client-secret',
envvar='CPAPI_CLIENT_SECRET',
help='The client... |
from kmip.core import attributes
from kmip.core import enums
from kmip.core import objects
from kmip.core import primitives
from kmip.core.primitives import Struct
from kmip.core.utils import BytearrayStream
class RevokeRequestPayload(Struct):
"""
A request payload for the Revoke operation.
The payload... |
"""
django-parler uses caching to avoid fetching model data when it doesn't have to.
These functions are used internally by django-parler to fetch model data.
Since all calls to the translation table are routed through our model descriptor fields,
cache access and expiry is rather simple to implement.
"""
import djang... |
# -*- coding: utf-8 -*-
import os
import re
import sys
import subprocess
import nixops.util
import nixops.resources
import nixops.ssh_util
class MachineDefinition(nixops.resources.ResourceDefinition):
"""Base class for NixOps machine definitions."""
def __init__(self, xml):
nixops.resources.Resourc... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import socket
from pygame import mixer
import serial, threading, random
import subprocess
import sys, os
child = os.path.join(os.path.dirname(__file__), "/home/pi/r2d2/sound.py")
word = 'word'
file = ['/home/pi/r2d2/prog.py','/home/pi/r2d2/sound.py']
pipes = []
arduinoB... |
import os
from tools.resources import FileType
def find_secure_image(notify, resources, ns_image_path,
configured_s_image_filename, image_type):
""" Find secure image. """
if configured_s_image_filename is None:
return None
assert ns_image_path and configured_s_image_filename... |
"""
Helper classes for parsers.
"""
from __future__ import absolute_import, unicode_literals
import datetime
import decimal
import json # noqa
import uuid
from django.db.models.query import QuerySet
from django.utils import six, timezone
from django.utils.encoding import force_text
from django.utils.functional impor... |
"""Post database creation listener."""
from invenio.ext.sqlalchemy import db
from invenio.base.factory import with_app_context
@with_app_context(new_context=True)
def post_handler_database_create(sender, default_data='', *args, **kwargs):
"""Fill format table with new format for Communities module."""
from i... |
'''
GridMap provides wrappers that simplify submission and collection of jobs,
in a more 'pythonic' fashion.
:author: Christian Widmer
:author: Cheng Soon Ong
:author: Dan Blanchard (<EMAIL>)
:var USE_MEM_FREE: Does your cluster support specifying how much memory a job
will use via mem_free? (Defau... |
# coding=utf-8
import unittest
"""467. Unique Substrings in Wraparound String
https://leetcode.com/problems/unique-substrings-in-wraparound-string/description/
Consider the string `s` to be the infinite wraparound string of
"abcdefghijklmnopqrstuvwxyz", so `s` will look like this:
"...zabcdefghijklmnopqrstuvwxyzabcde... |
import re
from datetime import datetime
from django.utils.translation import ugettext_lazy as _
# Add-on and File statuses.
STATUS_NULL = 0 # No review type chosen yet, add-on is incomplete.
STATUS_UNREVIEWED = 1 # Waiting for prelim review.
STATUS_PENDING = 2 # Personas (lightweight themes) waiting for review.
S... |
"""Defines the Quest Model."""
import datetime
from django.conf import settings
from django.db import models
from django.contrib.auth.models import User
from apps.managers.cache_mgr import cache_mgr
from apps.managers.score_mgr import score_mgr
from apps.managers.predicate_mgr import predicate_mgr
class Quest(model... |
from tastypie.authentication import ApiKeyAuthentication
from tastypie.authorization import Authorization
from tastypie.resources import NamespacedModelResource, fields, ALL, ALL_WITH_RELATIONS
from django.contrib.auth.models import User #BUG: Import the correct user object from settings.py
from .models import Inciden... |
#!/usr/bin/python
# File created on 27 Jan 2012.
from __future__ import division
__author__ = "Kishori M Konwar"
__copyright__ = "Copyright 2013, MetaPathways"
__credits__ = ["r"]
__version__ = "1.0"
__maintainer__ = "Kishori M Konwar"
__status__ = "Release"
try:
import sys, os, re, math, scipy
import trace... |
import logging
import multiprocessing
import numpy as np
import soundfile as sf
from pybinsim.pose import Pose
from pybinsim.utility import total_size
nThreads = multiprocessing.cpu_count()
class Filter(object):
def __init__(self, inputfilter, irBlocks, block_size, filename=None):
self.IR_left_blocke... |
#!/usr/bin/env python
import os, xlrd, shutil, subprocess, time, csv
from subprocess import Popen, PIPE
from glob import glob
from threading import Timer
home_dir_list = []
home_dir_list.append(os.getcwd())
def initialization():
print("___________________________________________")
print("\n\n\n\n\n\n\n\n\n\n... |
{
"name": "Purchase Order Allowed Product With Customer Supplier Info",
"version": "1.0",
"author": "OdooMRP team,"
"AvanzOSC,"
"Serv. Tecnol. Avanzados - Pedro M. Baeza",
"website": "http://www.odoomrp.com",
"contributors": [
"Pedro M. Baeza <<EMAIL>>",
"... |
# encoding: UTF-8
import base64
import hashlib
import hmac
import urllib
from multiprocessing.dummy import Pool
from time import time
import requests
from six.moves import input
from queue import Queue, Empty
REST_HOST = 'https://api.bithumb.com'
#####################################################################... |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'runstring_dock.ui'
#
# by: pyside-uic 0.2.15 running on PySide 1.2.4
#
# WARNING! All changes made in this file will be lost!
from PySide import QtCore, QtGui
class Ui_RunStringDock(object):
def setupUi(self, RunStringDock):
... |
import os
from tethyscluster import exception
from completers import ClusterCompleter
class CmdPut(ClusterCompleter):
"""
put [options] <cluster_tag> [<local_file_or_dir> ...] <remote_destination>
Copy files to a running cluster
Examples:
# Copy a file or dir to the master as root
... |
from PyQt4.Qsci import QsciScintilla, QsciLexerCSS, QsciLexerHTML,\
QsciLexerJavaScript
from PyQt4 import QtGui, QtCore
from qgis.core import *
from settings import *
from functools import partial
CSS = 0
HTML = 1
JSON = 2
class TextEditorDialog(QtGui.QDialog):
def __init__(self, text, textType, parent = Non... |
import unittest
import beautify
class TestStringMethods(beautify.TestBeautify, unittest.TestCase):
module = 'Sample'
def test_always_fails(self):
self.assertEqual('foo'.upper(), 'FOO0')
def test_always_error(self):
"""This test will always give error
\rDon't worry
"""
... |
import itertools as it
from operator import attrgetter
from botocore.config import Config
from flask import (
Markup,
render_template,
Blueprint,
redirect,
url_for,
flash,
abort,
request,
g,
)
from sqlalchemy import desc, asc, or_
from cosmos.api import Workflow, Stage, Task, TaskS... |
from __future__ import unicode_literals
import traceback
import xbmc
import xbmcgui
import xbmcaddon
import xbmcplugin
from xbmcgui import ListItem
from requests import HTTPError
from lib import tidalapi
from lib.tidalapi.models import Album, Artist
from lib.tidalapi import Quality
from routing import Plugin
addon = ... |
from js9 import j
def input(job):
"""
create key, if it doesn't exist
"""
# THIS ONE IS FIXED
args = job.model.args
if 'key.path' in job.model.args and job.model.args['key.path'] is not None and job.model.args['key.path'] != '':
path = job.model.args['key.path']
if not j.sal.fs... |
import glob, os
from os.path import isfile
from django.shortcuts import render, render_to_response
from django.template import RequestContext
from django.http import HttpResponseRedirect
from django.core.urlresolvers import reverse
from gisweb.config import MEDIA_ROOT, MEDIA_URL
from gisweb_app.models import Document... |
"""Support for reading Samba 3 data files."""
from __future__ import absolute_import
__docformat__ = "restructuredText"
REGISTRY_VALUE_PREFIX = "SAMBA_REGVAL"
REGISTRY_DB_VERSION = 1
import os
import struct
import tdb
from . import passdb
import param as s3param
def fetch_uint32(db, key):
try:
data = ... |
__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
import os.path
import TestSCons
test = TestSCons.TestSCons()
test.subdir('install', 'repository', 'work')
install = test.workpath('install')
install_file = test.workpath('install', 'file')
opts = "-Y " + test.workpath('repository')
#
test.write(['repo... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals, absolute_import, print_function
import click
import json, os, sys, subprocess
from distutils.spawn import find_executable
import frappe
from frappe.commands import pass_context, get_site
from frappe.utils import update_progress_bar
from frappe.utils.resp... |
from temboo.core.choreography import Choreography
from temboo.core.choreography import InputSet
from temboo.core.choreography import ResultSet
from temboo.core.choreography import ChoreographyExecution
import json
class DeleteInventoryItems(Choreography):
def __init__(self, temboo_session):
"""
C... |
from __future__ import print_function
import unittest
import numpy as np
from op_test import OpTest
class TestRangeOp(OpTest):
def setUp(self):
self.op_type = "range"
self.init_config()
self.inputs = {
'Start': np.array([self.case[0]]).astype(self.dtype),
'End': np... |
import Adafruit_BBIO.GPIO as GPIO
import Adafruit_BBIO.ADC as ADC
import mplayer as mp
from time import sleep
from random import randint
from math import floor
def checkKnob(potPin):
# LOL return randint(0,1) # needs to be replaced by GPIO data
value = ADC.read(potPin)
return floor(24 * value)
def main()... |
# encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding index on 'TaggedItem', fields ['object_id']
db.create_index('taggit_taggeditem', ['object_id'])
... |
# Support Python 2 and 3
from __future__ import unicode_literals
from __future__ import absolute_import
from __future__ import print_function
import time
import sys
from copy import deepcopy
from odpslides.color_utils import getValidHexStr
class StylesXML(object):
"""
StylesXML wraps the styles.xml internal... |
"""
Author: Christopher Wyczisk
Version: 1.0
DESCRIPTION
Dieses Programm wir mit "python ex1.py filename" gestartet. Es liesst die Daten aus filename ein und berechnet
fuer dessen Werten das Geometrische Mittel, fehlerhaftewerte werden herausgefiltert.
"""
import math, types, sys
# Diesen Code hat Christopher Wyc... |
from skidl import SKIDL, TEMPLATE, Part, Pin, SchLib
SKIDL_lib_version = '0.0.1'
nordicsemi = SchLib(tool=SKIDL).add_parts(*[
Part(name='NRF8001',dest=TEMPLATE,tool=SKIDL,keywords='BLE, bluetooth',description='BLE chip from Nordic Semiconductor',ref_prefix='U',num_units=1,fplist=['QFN32'],do_erc=True,pins=[
... |
import os
import sys
import glob
import json
import subprocess
import gudev
import dbus
from hardware_kind import HardwareMonitorKind
class HardwareMonitor(HardwareMonitorKind):
"""This class implements the hardware monitor for systems in which
udev is available. Presumably that means just Linux."""
def... |
# -*- coding: utf-8 -*-
__title__ = 'latinpigsay'
__license__ = 'MIT'
__author__ = 'Steven Cutting'
__author_email__ = '<EMAIL>'
__created_on__ = '12/27/2014'
from latinpigsay.tmp.experiments import exp
from latinpigsay import generalfunctions as gfunc
from latinpigsay.tmp.experiments import expfunctions as expfunc
... |
import re
from pilasengine.interfaz import elemento
class IngresoDeTexto(elemento.Elemento):
def __init__(self, pilas=None, texto_inicial='', x=0, y=0, ancho=300, limite_de_caracteres=20, icono=None):
super(IngresoDeTexto, self).__init__(pilas, x=x, y=y)
self.texto = texto_inicial
self.cur... |
"""
"""
import os
import sys
from Tkinter import *
DIR = os.path.abspath(os.path.dirname(__file__))
sys.path.insert(0, os.path.join(DIR, '../..'))
from SEAS_Aux.Visualizer.SEAS_Visualizer import SEAS_Main_GUI
def test_visualizer():
root = Tk()
root.wm_title("Spectra Search for All Small Molecul... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.