text stringlengths 12 6.59M |
|---|
# -*- coding: utf-8 -*-
from openprocurement.tender.core.adapters import TenderConfigurator
from openprocurement.tender.belowthreshold.constants import STATUS4ROLE
class TenderBelowThersholdConfigurator(TenderConfigurator):
""" BelowThreshold Tender configuration adapter """
name = "BelowThreshold configurat... |
'''
Short URL Generator
===================
Python implementation for generating Tiny URL- and bit.ly-like URLs.
A bit-shuffling approach is used to avoid generating consecutive, predictable
URLs. However, the algorithm is deterministic and will guarantee that no
collisions will occur.
The URL alphabet is fully cus... |
"""
An implementation of :class:`XBlockUserStateClient`, which stores XBlock Scope.user_state
data in a Django ORM model.
"""
import itertools
import logging
from operator import attrgetter
from time import time
from django.contrib.auth.models import User
from django.db import transaction
from django.db.utils import ... |
#!/usr/bin/env python
"""
This file contains useful tools for dealing with NifTI files and performing
common operations. Input and output files will typically be in nifti (.nii
or .nii.gz) format.
Can be used from the command line.
"""
from __future__ import print_function
from __future__ import division
import sys
im... |
# Copyright (c) 2015 VMware, Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... |
from django.template.base import (
Template,
TemplateDoesNotExist,
TemplateEncodingError,
)
from django.template.loader import make_origin
from django.template.loaders.app_directories import Loader as AppDirectoriesLoader
from markdown import markdown
import yaml
#from BeautifulSoup import BeautifulSoup
c... |
# coding=utf-8
from django.core.management.base import BaseCommand
from registration.models import RegistrationProfile
class Command(BaseCommand):
help = 'Cleanup expired registrations'
OPT_SIMULATE = 'dry-run'
def add_arguments(self, parser):
parser.add_argument(''.join(['--', self.OPT_SIMULAT... |
#!/usr/bin/env python
''' Nose test generators
'''
from os.path import join, dirname
from glob import glob
from StringIO import StringIO
from tempfile import mkdtemp
import warnings
import shutil
import gzip
from numpy.testing import \
assert_array_almost_equal, \
assert_equal, \
assert_raises
from no... |
############################TESTS ON POTENTIALS################################
from __future__ import print_function, division
import os
import sys
import numpy
import pynbody
from galpy import potential
_TRAVIS= bool(os.getenv('TRAVIS'))
#Test whether the normalization of the potential works
def test_normalize_poten... |
import db_access
import logging
import time
import json
from logging.handlers import RotatingFileHandler
from flask import Flask, render_template, request, redirect
from minify import minify as minify_css
from time import time as current_time_epoch
app = Flask(__name__)
app_info = {
'debug': True,
'version': ... |
#!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list ... |
"""Support for Ambient Weather Station Service."""
import logging
import voluptuous as vol
from homeassistant.config_entries import SOURCE_IMPORT
from homeassistant.const import (
ATTR_NAME, ATTR_LOCATION, CONF_API_KEY, CONF_MONITORED_CONDITIONS,
EVENT_HOMEASSISTANT_STOP)
from homeassistant.core import callba... |
# -*- coding: utf-8 -*-
import pytest
from marshmallow import validate, ValidationError
def test_invalid_email():
invalid1 = "user@example"
with pytest.raises(ValidationError):
validate.email(invalid1)
invalid2 = "example.com"
with pytest.raises(ValidationError):
validate.email(invalid... |
from __future__ import unicode_literals
import datetime
import os
import sys
import time
import warnings
from xml.dom.minidom import parseString
try:
import pytz
except ImportError:
pytz = None
from django.conf import settings
from django.core import serializers
from django.core.urlresolvers import reverse
f... |
# -*- coding: utf-8 -*-
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright (C) 2015-2017 GEM Foundation
#
# OpenQuake is free software: you can redistribute it and/or modify it
# under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the Licen... |
# Copyright (C) 2004 Anthony Baxter
# The Message app. Accepts all calls, plays a message, then hangs up.
from shtoom.app.interfaces import Application
from shtoom.app.base import BaseApplication
from twisted.internet import defer
from twisted.python import log
from twisted.protocols import sip as tpsip
from shtoom.e... |
from __future__ import unicode_literals
from django import forms
from .models import Musician, NonMusician, Video, Location, Genre, InstrumentGroup, TimeFrame
from .choices_list import *
from stickyuploads.widgets import StickyUploadWidget
from geoposition.fields import GeopositionField
from PIL import Image
class P... |
#!/usr/bin/env python
''' Nose test generators
Need function load / save / roundtrip tests
'''
from os.path import join, dirname
from glob import glob
from StringIO import StringIO
from tempfile import mkdtemp
import warnings
import shutil
import gzip
from numpy.testing import \
assert_array_equal, \
asser... |
import json
import re
import pytest
import snafu.versions
version_paths = list(snafu.versions.VERSIONS_DIR_PATH.iterdir())
version_names = [p.stem for p in version_paths]
@pytest.mark.parametrize('path', version_paths, ids=version_names)
def test_version_definitions(path):
assert path.suffix == '.json', 'wron... |
# -*- coding: utf-8 -*-
# This file is part of wger Workout Manager.
#
# wger Workout Manager is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any ... |
# -*- coding: utf-8 -*-
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright (C) 2015-2022 GEM Foundation
#
# OpenQuake is free software: you can redistribute it and/or modify it
# under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the Licen... |
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
# Copyright (c) 2017 Mozilla Corporation
import os
import sys
sys.path.append(os.path.join(os.path.dirname(__file__), ".... |
from django.contrib.auth.backends import ModelBackend
from django.contrib.auth.models import User
from django.contrib.auth import signals as auth_signals
from django.test import TransactionTestCase
from djactasauth.backends import FilteredModelBackend, ActAsModelBackend
class FilteredBackendTestCase(TransactionTestC... |
import tensorflow as tf
import hyperchamber as hc
from hypergan.util.ops import *
from hypergan.util.hc_tf import *
import os
import hypergan
import hypergan.discriminators.minibatch_discriminator as minibatch
def l2_distance(a,b):
return tf.square(a-b)
def l1_distance(a,b):
return a-b
def config(
... |
# -*- coding: utf-8 -*-
"""
For interactions with Cloudbreak
Warnings:
Experimental, not extensively tested
"""
from __future__ import absolute_import
import logging
import base64
import re
import sys
import random
from datetime import datetime, timedelta
from calendar import timegm
import json
import six
from w... |
# -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of t... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from oauthlib.common import Request
from oauthlib.oauth1 import (SIGNATURE_PLAINTEXT, SIGNATURE_HMAC_SHA1,
SIGNATURE_HMAC_SHA256, SIGNATURE_RSA,
SIGNATURE_TYPE_BODY, SIGNATURE_TYPE... |
from tests import BaseTestCase
import unittest
class TestDrawing(BaseTestCase):
"""
Test container of plan
"""
@classmethod
def setUpClass(cls):
from planner.drawing import Drawing
cls.Drawing = Drawing
def setUp(self):
self.drawing = self.Drawing()
def test_for... |
import logging
import os
import sys
from os.path import join as opj
import openerp
from openerp.osv import osv
from openerp.tools import convert_file
_logger = logging.getLogger(__name__)
class view(osv.osv):
_inherit = "ir.module.module"
def import_module(self, cr, uid, module, path, context=None):
... |
"""Test textlib module."""
#
# (C) Pywikibot team, 2011-2021
#
# Distributed under the terms of the MIT license.
#
import codecs
import functools
import os
import re
import unittest
from collections import OrderedDict
from contextlib import suppress
import pywikibot
import pywikibot.textlib as textlib
from pywikibot... |
from pyrsistent import pvector, pset
#import pytest
import time
def run_big_iterator_initialization():
"""
The results are comparable to those of doing it with a list since most of the
code is shared.
"""
before = time.time()
iterator = (x for x in range(1000000))
print "Big iterator: " + ... |
# -*- coding: utf-8 -*-
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2010-2011, GEM Foundation.
#
# OpenQuake is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License version 3
# only, as published by the Free Software Foundation.
#
# OpenQuak... |
#!/usr/bin/env python3
import os
import re
import sys
import datetime
import subprocess
from widgets.widget import Widget
from widgets.config import colors, icons
class Battery(Widget):
'''
'''
def __init__(self, value=''):
'''
Params:
bg: background color
fg: for... |
# -*- coding: utf-8 -*-
import logging
import urllib.request
from configobj import ConfigObj
LOG = logging.getLogger(__name__)
class RankModelHandler(object):
def fetch_rank_model(self, rank_model_url):
try:
return urllib.request.urlopen(rank_model_url, timeout=20)
except:
... |
# -*- coding: utf-8 -*-
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2010-2011, GEM Foundation.
#
# OpenQuake is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License version 3
# only, as published by the Free Software Foundation.
#
# OpenQuak... |
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
"""
Define the abstract class component.
"""
import inspect
from abc import ABC
from scr.helpers.properties import StrRe... |
from twisted.internet.defer import inlineCallbacks, maybeDeferred
from twisted.trial import unittest
from zope.interface.verify import verifyObject
from scrapyd.interfaces import ISpiderQueue
from scrapyd import spiderqueue
class SpiderQueueTest(unittest.TestCase):
"""This test case also supports queues with def... |
from selenium.common.exceptions import NoSuchElementException
from selenium.webdriver.support.ui import Select
def new_excerpt(driver, base_url):
driver.get('{0}/'.format(base_url))
# go to new excerpt menu
new_excerpt = driver.find_element_by_link_text('⌗ New excerpt')
new_excerpt.click()
driver... |
# Copyright (c) 2014 Scopely, Inc.
# Copyright (c) 2015 Mitch Garnaat
#
# 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 accompanyin... |
"""
Unit tests for the lexer
"""
import pytest
from pypred import parser, ast
class MockPred(object):
def resolve_identifier(self, doc, ident):
if ident in doc:
return doc[ident]
else:
return ast.Undefined()
class TestAST(object):
def ast(self, inp):
lexer = pa... |
# -*- coding: utf-8 -*-
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2010-2012, GEM Foundation.
#
# OpenQuake is free software: you can redistribute it and/or modify it
# under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the Lice... |
import re
class ArtifactExtractor:
def extract(marked_tree, artifact):
data = []
reg = ArtifactExtractor._paragraph_reg(artifact['tokens'])
marked_tree = [i
for i in marked_tree
if ArtifactExtractor._filter_text_items(i, reg)]
marked_t... |
# -*- coding: utf-8 -*-
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2010-2012, GEM Foundation.
#
# OpenQuake is free software: you can redistribute it and/or modify it
# under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the Lice... |
"""
Copyright (c) 2013-2014 Heiko Strathmann
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 and th... |
import datetime
from django.db import models
from django.conf import settings
from django.db.models import Q
from django.db.models import get_model
from django.core.urlresolvers import reverse
from django.template.loader import render_to_string
from django.contrib.sites.models import Site
from django.contrib.auth.mod... |
# Copyright <2015> <Vauxoo info@vauxoo.com>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
import csv
import logging
import os
import requests
import subprocess
import time
import socket
import sys
from urllib.request import urlopen
from urllib.error import HTTPError, URLError
from odoo import field... |
# Copyright (c) 2015 Cloudera, 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 o... |
from os import path
import pytest
import re
import ntpath
from test_utils import ExampleTest
class TestPcapSearch(ExampleTest):
pytestmark = [pytest.mark.pcapsearch, pytest.mark.no_network]
@pytest.mark.parametrize(
"search_criteria,expected_packet_count",
[
pytest.param('tcp port 80', 3541, id='tcp_port_80'... |
# -*- coding: utf-8 -*-
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2010-2011, GEM Foundation.
#
# OpenQuake is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License version 3
# only, as published by the Free Software Foundation.
#
# OpenQuak... |
# -*- coding: utf-8 -*-
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2010-2012, GEM Foundation.
#
# OpenQuake is free software: you can redistribute it and/or modify it
# under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the Lice... |
# Copyright (c) 2015 Ultimaker B.V.
# Cura is released under the terms of the AGPLv3 or higher.
import configparser #For reading the legacy profile INI files.
import json #For reading the Dictionary of Doom.
import math #For mathematical operations included in the Dictionary of Doom.
import os.path #For concatenating ... |
# Copyright 2021 The Bazel 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 applicable la... |
# Copyright 2020 The Bazel 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 applicable la... |
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
import contextlib
import io
import logging
import os
from collections import defaultdict
from dataclasses import dataclass
from typing import Any, Dict, Iterable, List, Optional
from fvcore.common.file_io import PathManager
from fvcore.common.timer ... |
import re
import pytest
from marshmallow import fields, validate
from apispec import APISpec
from apispec.ext.marshmallow import MarshmallowPlugin
from .schemas import CategorySchema, CustomList, CustomStringField, CustomIntegerField
from .utils import build_ref
def test_field2choices_preserving_order(openapi):
... |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013-Today OpenERP SA (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms ... |
#!/usr/bin/env python
import os
import re
import sys
output_template = '''\
/* Automatically generated by generate_psa_constant.py. DO NOT EDIT. */
static const char *psa_strerror(psa_status_t status)
{
switch (status) {
%(status_cases)s
default: return NULL;
}
}
static const char *psa_ecc_curve_name... |
# ######################################################################################################################
# Object Database functionality
#
# ######################################################################################################################
import ZODB, ZODB.FileStorage, BTrees.OOBTr... |
import uuid
import urllib
import os
from datetime import datetime
from functools import wraps, update_wrapper
import requests
from flask import g, request, abort, make_response, Response
from flask_restplus import Resource, fields
from werkzeug.datastructures import FileStorage
from pyinfraboxutils import get_logg... |
#
# Copyright (c) 2004 Specifix, Inc.
# All rights reserved
#
import util
import re
import os
import policy
import log
"""
Module used by recipes to modify the state of the installed %(destdir)s
Classes from this module are not used directly; instead, they are used
through eponymous interfaces in recipe.
"""
class S... |
import os
import sys
from SCons.Script.SConscript import SConsEnvironment
def CheckPKGConfig(context, version):
context.Message( 'Checking for pkg-config... ' )
ret = context.TryAction('pkg-config --atleast-pkgconfig-version=%s' % version)[0]
context.Result( ret )
return ret
def CheckPKG(context, name):
context.... |
#
# Copyright (c) 2004 Specifix, Inc.
# All rights reserved
#
import util
import re
import os
import policy
"""
Module used by recipes to effect packaging policy; things like setting
hints, flags, and dependencies.
Classes from this module are not used directly; instead, they are used
through eponymous interfaces in ... |
import time
import serial
import numpy as np
from typing import Union, Tuple, List
from copy import copy, deepcopy
from collections import OrderedDict
import qcodes as qc
from qcodes import Instrument
class ArduinoSwitchControl(Instrument):
"""Class for the RT switch box that uses an Arduino
This class repr... |
#!/usr/bin/env python
"""
High temporal resolution, distributed corpus building, querying,
and testing
Built on MongoDB and Celery
"""
from collections import defaultdict
from nltk import ngrams, word_tokenize, pos_tag, SnowballStemmer, WordNetLemmatizer
from pymongo import MongoClient
c = MongoClient()
# Metaclass... |
import os
import sys
import glob
import subprocess
import shutil
import platform
import time
import re
import threading
import select
from twisted.internet import reactor
from buildtools.bt_logging import log
from subprocess import CalledProcessError
import psutil
from twisted.internet.protocol import ProcessProtocol
... |
import functools
import numpy as np
import pandas as pd
import warnings
from collections import defaultdict
from datetime import datetime
from .core import indexing, utils
from .core.variable import as_variable, Variable
from .core.pycompat import iteritems, bytes_type, unicode_type, OrderedDict
# standard calendars... |
import os, sys, glob, subprocess, shutil, platform, time
from buildtools.bt_logging import log
from compileall import expand_args
def clock():
if sys.platform == 'win32':
return time.clock()
else:
return time.time()
def getElapsed(start):
return '%d:%02d:%02d.%03d' % reduce(lambda ll, b :... |
#!/usr/bin/env python
import sys
runs = {}
for line in sys.stdin.readlines():
line = line.strip()
(run, data) = line.split('#')
run = int(run)
data = data.strip()
(key, value) = data.split(':')
key = key.strip()
value = value.strip()
if run not in runs:
runs[run] = {}
... |
import sys
import inspect
import copy
from .variable.base import (AbstractVariable, DiagnosticVariable,
VariableList, VariableGroup)
from .formatting import process_info
from .utils import AttrMapping, combomethod
_process_meta_default = {
'time_dependent': True
}
def _extract_varia... |
#!/usr/bin/env python
#
# This program returns the gray matter segmentation given anatomical, spinal cord segmentation and t2star images
#
# ---------------------------------------------------------------------------------------
# Copyright (c) 2013 Polytechnique Montreal <www.neuro.polymtl.ca>
# Authors: Sara Dupont
#... |
import socket
import errno
import json
import select
import time
import logging
TIMEOUT = 0.1
def make_json_safe(thing):
if isinstance(thing, (int, float, bool, str, type(None), unicode)):
return thing
elif isinstance(thing, list):
return map(make_json_safe, thing)
elif isinstance(thing, d... |
# -*- coding: utf-8 -*-
"""
YB table to add unique industries and occupations to DB
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This script will calculate the number of unique products (hs)
and destinations (wld) that are found in each location (state, meso,
planning region and municipa... |
import requests
import sys
import json
import os
from misc import *
def get_ruleset_version():
url = 'https://api.github.com/repos/FAANG/faang-metadata/releases'
response = requests.get(url).json()
return response[0]['tag_name']
def validate_total_sample_records(target_dict, my_type, rulesets):
"""
... |
# Copyright 2018 Reahl Software Services (Pty) Ltd. All rights reserved.
#
# This file is part of Reahl.
#
# Reahl is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation; version 3 of the License.
#... |
"""
Created on 17 Apr 2017
@author: Bruno Beloff (bruno.beloff@southcoastscience.com)
http://pythoncentral.io/hashing-strings-with-python/
"""
import hashlib
from collections import OrderedDict
from scs_core.data.json import JSONable
from scs_core.data.localized_datetime import LocalizedDatetime
# --------------... |
# -*- coding: utf-8 -*-
"""
Akvo RSR is covered by the GNU Affero General Public License.
See more details in the license.txt file located at the root folder of the Akvo RSR module.
For additional details on the GNU license please see < http://www.gnu.org/licenses/agpl.html >.
"""
from django.contrib.auth.models imp... |
#!/usr/bin/env python3
# Apache License 2.0
#
# Copyright (c) 2014, Open Source Robotics Foundation
from __future__ import print_function
import argparse
import sys
try:
from ament_package import parse_package_string
except ImportError as e:
sys.exit("ImportError: 'from ament_package import parse_package_str... |
# Copyright 2014-2015 Open Source Robotics Foundation, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... |
#!/usr/bin/env python
# Copyright (C) 2010-2013 Cuckoo Sandbox Developers.
# This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org
# See the file 'docs/LICENSE' for copying permission.
import random
import logging
from threading import Thread
from ctypes import *
from lib.common.abstracts import Auxiliar... |
from django.http import HttpResponseRedirect, Http404
from django.shortcuts import render_to_response, get_object_or_404
from django.conf import settings
from django import forms
from pygments import highlight
from pygments.lexers import get_lexer_by_name
from pygments.formatters import HtmlFormatter
from tempel.mode... |
#!/usr/bin/python
import copy
from types import *
from vmpoolstateerrors import VMPoolStateSanityError
from vmmigration import VMmigration
from pathfinder import VMPoolPathFinder
from vm import VM
class VMPoolAdamPathFinder(VMPoolPathFinder):
"""This class enables storage of the state data used during the
dis... |
# coding=utf-8
__author__ = "Daniel Arroyo <daniel@3dagogo.com>"
__license__ = 'GNU Affero General Public License http://www.gnu.org/licenses/agpl.html'
import os
import json
import uuid
from flask import request, jsonify, abort
from octoprint.settings import settings
from octoprint.server import restricted_access, ... |
#!/usr/bin/env python2.7
# -*- coding: utf-8 -*-
import socket
import colorsys # for HSV-to-RGB-conversion
from PIL import Image, GifImagePlugin, ImageSequence, ImageOps
import time
import sys
# UDP_IP = "10.0.0.200"
UDP_PORT = 1337
ROWS = 16
COLS = 40
BRIGHTNESS = 1.0
GAMMA = 1.0
def send_array(data, hostname... |
import collections
import datetime
import json
from flask import Blueprint, request, current_app
from flask_security import current_user, login_required, roles_accepted
from sqlalchemy import func, Text, DateTime, Numeric
from sqlalchemy.dialects.postgresql import JSONB
from APITaxi_models2 import db, ADS, ArchivedHa... |
"""
Django settings for searchlist project.
Generated by 'django-admin startproject' using Django 1.11.3.
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/
"""
import... |
import os
import time
import sys
import subprocess
import glob
import shutil
from distutils import dir_util
import re
import fnmatch
import Queue
import threading
import getpass
import platform
import multiprocessing
# import psutil
try:
import psutil
except:
pass
# Helpers
#########################################... |
from multiprocessing import Process, Queue, Value
import time
import math
import os
import config
class Servo(Process):
def __init__(self, servo, angle):
Process.__init__(self)
self.servo = servo
self.angle = angle
self.angle_to = None
self.daemon = True
def run(self)... |
from core.models.machine_request import MachineRequest
from core.models.user import AtmosphereUser
from core.models.instance import Instance
from core.models.provider import Provider
from core.models.machine import ProviderMachine
from rest_framework import serializers
from .new_threshold_field import NewThresholdField... |
import os
import glob
import shutil
import numpy as np
import pyfits
import scipy.linalg
import matplotlib.pyplot as plt
from pyraf import iraf
from iraf import stsdas,dither,slitless,axe
INDEF = iraf.INDEF
no = iraf.no
yes = iraf.yes
import threedhst
import threedhst.prep_flt_files
import threedhst.catIO as catIO... |
#!/Users/sma/anaconda/bin/python
"""
nrc.py is a python program designed to calculate the Nonlinear reflection
coefficient for silicon surfaces. It works in conjunction with the matrix
elements calculated umath.sing ABINIT, and open source ab initio software,
and TINIBA, our in-house optical calculation software.
The ... |
from core.models.machine_request import MachineRequest
from core.models.user import AtmosphereUser
from core.models.instance import Instance
from core.models.instance_source import InstanceSource
from core.models.provider import Provider
from core.models.machine import ProviderMachine
from rest_framework import seriali... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# libavg - Media Playback Engine.
# Copyright (C) 2003-2021 Ulrich von Zadow
#
# 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
# vers... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''Functional tests using WebTest.'''
import unittest
import os
import re
import mock
from nose.tools import * # PEP8 asserts
from modularodm import Q
from framework.auth.core import User, Auth
from tests.base import OsfTestCase, fake
from tests.factories import (UserFa... |
import glob, json, collections, re, zipfile
import os, configparser, tarfile
from PyQt5.QtCore import Qt
from PyQt5.QtGui import QStandardItemModel, QStandardItem, QFont
import ConfigViewerUi
from PyQt5.QtWidgets import QWidget, QStyle
class Widget(QWidget):
def __init__(self, config:str):
super().__in... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Transistor-level Z80 CPU simulator.
#
# Originated from the Visual 6502 and Z80 Explorer projects.
#
# https://github.com/trebonian/visual6502
# commit badcf8e40be74398ec55593e172acb287ca73e3b of 31 Mar 2020
#
# https://github.com/gdevic/Z80Explorer
# commit c11574c1d80... |
import json
import logging
import sys
import traceback
from django.core.urlresolvers import resolve
from silk import models
from silk.collector import DataCollector
from silk.config import SilkyConfig
Logger = logging.getLogger('silk')
content_types_json = ['application/json',
'application/x-... |
"""Class to run MR on SIMBAD results"""
from __future__ import division
__author__ = "Adam Simpkin"
__date__ = "09 Mar 2017"
__version__ = "1.0"
import logging
import numpy
import os
from pyjob import Job, cexec
from pyjob.misc import make_script, tmp_file
from simbad.mr import anomalous_util
from simbad.parsers i... |
#! /usr/bin/env python3
import collections
import csv
import glob
import gzip
import itertools
import jinja2
import json
import logging
import os
import pprint
import pysam
import requests
import shutil
import subprocess
import tempfile
import wand.color
import wand.image
__version__ = '0.1.0'
logger = logging.getLo... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
"""
Intro
======
Get varnas in a pratyahara:
.. code:: python
>>> from sanskrit_parser.base.maheshvara_sutra import MaheshvaraSutras
>>> MS = MaheshvaraSutras()
>>> jaS = SanskritObject('jaS', encoding=SLP1)
>>> print(MS.getPratyahara(jaS))
jabagaqada... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.