text stringlengths 12 6.59M |
|---|
#!/usr/bin/env python
from subprocess import check_call,check_output
import os
import json
# TODO: make pch: `g++ -x c++-header -I ../ImageStack/src test_plugin.h`
EPSILON = 0.001
verbose = False
dry_run = False
if dry_run:
check_call = lambda c: status('run', ' '.join(c))
check_output = lambda c: status('r... |
import datetime
import hashlib
import random
import re
from django.conf import settings
from django.contrib.auth.models import User
from django.db import models
from django.db import transaction
from django.template.loader import render_to_string
from django.utils.translation import ugettext_lazy as _
try:
from d... |
#!/usr/bin/env python3
# Copyright (c) 2015-2020 The Dash Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Test deterministic masternodes
#
from test_framework.blocktools import create_block, create_coinbase, ge... |
"""Stack Plugin for EasyEngine."""
from cement.core.controller import CementBaseController, expose
from cement.core import handler, hook
from ee.cli.plugins.site_functions import *
from ee.core.variables import EEVariables
from ee.core.aptget import EEAptGet
from ee.core.download import EEDownload
from ee.core.shellex... |
try:
from django.contrib.auth import get_user_model
except ImportError: # django < 1.5
from django.contrib.auth.models import User
else:
User = get_user_model()
from django.utils import unittest
from openid.consumer.consumer import SuccessResponse
from openid.consumer.discover import OpenIDServiceEndpoint... |
import argparse
import json
import os
import requests
from itertools import cycle
from random import shuffle
from dewbrick.utils import generate_image, generate_name, generate_screenshot
BASE_URL = "https://api.majestic.com/api/json"
BASE_PARAMS = {'app_api_key': os.environ.get('MAJESTIC_API_KEY')}
DEFAULT_IMG = ('h... |
# -*- coding: utf-8 -*-
#
# Copyright © 2014 eNovance
#
# Author: Julien Danjou <julien@danjou.info>
#
# 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/LI... |
#!/usr/bin/env python
"""Module to keep track of paths and versions of other software used within the workflow at various intervals."""
import Bio
import argparse
import getpass
import logging
import os
from subprocess import Popen, PIPE
import sys
__author__ = "Tim te Beek"
__contact__ = "brs@nbic.nl"
__copyright__... |
from ceph_installer.controllers import agent
class TestAgentController(object):
def setup(self):
self.configure_data = dict(
monitor_secret="secret",
public_network="0.0.0.0/24",
host="node1",
monitor_interface="eth0",
fsid="1720107309134",
... |
"""
Copyright (c) 2008-2011, Anthony Garcia <lagg@lavabit.com>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTH... |
#!/usr/bin/python
# NATINAL
# (c) 2016-21 J. W. Crockett, Jr., josh.crockett@gmail.com
# Not
# Another
# Twit
# Issuing
# Notifications
# About the
# Lineups!
# yes, the acronym's a terrible stretch. ref: http://www.uni-watch.com/2009/04/18/natinal-joke/, and the daily race of Nationals beat writers for who tweets t... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.contrib import admin
from .models import *
# Register your models here.
class AlumniAdminSet(admin.ModelAdmin):
actions_on_top = False
actions_on_bottom = True
list_filter = ('consul', 'entrep', 'govt', 'acadm', 'research', 'finance', '... |
#!/usr/bin/env python3
# Copyright (c) 2017 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Class for bitcoind node under test"""
import decimal
import errno
import http.client
import json
import log... |
# -*- coding: utf-8 -*-
#By WILEY YU
import sys
import platform
import os.path
try:
#python2
from Queue import Queue
except ImportError:
#python3
from queue import Queue
import re
import threading
import time
import shutil
import json
import math
try:
#python2
from urlparse import urlparse
except ImportError:... |
import collections
from header_common import *
from header_operations import *
from header_triggers import *
import process_common as pc
import module_info
remove_opmask = 0xffffffff
class LocalVariables:
"""Manages local variable mapping to numbers."""
def __init__(self):
self.variables = {}
self.number... |
#
# ICRAR - International Centre for Radio Astronomy Research
# (c) UWA - The University of Western Australia, 2015
# Copyright by UWA (in the framework of the ICRAR)
# All rights reserved
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser G... |
# Copyright (c) 2017 Pieter Wuille
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, dist... |
#!/usr/bin/python2.4
#
# Copyright (c) 2005-2006 rPath, Inc.
#
# All Rights Reserved
#
import testsuite
testsuite.setup()
import cPickle
import os
import urlparse
import time
import mint_rephelp
from mint_rephelp import MINT_HOST, MINT_PROJECT_DOMAIN, MINT_DOMAIN
import rephelp
class SiteTest(mint_rephelp.WebReposi... |
import copy
import datetime
import itertools
import logging
import os
import re
import time
import requests
import json
import wikidataintegrator.wdi_property_store as wdi_property_store
from wikidataintegrator.backoff.wdi_backoff import wdi_backoff
from wikidataintegrator.wdi_fastrun import FastRunContainer
from wiki... |
import os
import sys
import distutils.spawn
from vex.run import run
from vex import exceptions
PYDOC_SCRIPT = """#!/usr/bin/env python
from pydoc import cli
cli()
""".encode('ascii')
PYDOC_BATCH = """
@python -m pydoc %*
""".encode('ascii')
def handle_make(environ, options, make_path):
if os.path.exists(make_... |
#! /usr/bin/env python
# -*- coding:utf-8 -*-
#
# Qt interface to display AVT cameras
#
#
# External dependencies
#
import sys
from PySide import QtCore, QtGui
import cv2
import Calibration
# Create an indexed color table (grayscale)
colortable=[]
for i in range( 256 ) : colortable.append( QtGui.qRgb( i, i , i )... |
import json
class StagingArea(object):
def __init__(self, subjects={}, outformat='json', subject_field='dm_subjid', event_field='redcap_event_name'):
self.subjects = subjects
self.outformat = outformat
self.subject_field = subject_field
self.event_field = event_field
def get_su... |
# You must first run "bokeh serve" to view this example
import json
from bokeh.client import push_session
from bokeh.driving import repeat
from bokeh.io import curdoc
from bokeh.models import GeoJSONDataSource
from bokeh.plotting import figure
from bokeh.sampledata.sample_geojson import geojson as original
updated =... |
# # engagements
import logging
import os
from datetime import datetime
import operator
from django.contrib.auth.models import User
from django.conf import settings
from django.contrib import messages
from django.contrib.auth.decorators import user_passes_test
from django.core.exceptions import PermissionDenied
from d... |
import json
import uuid
from datetime import datetime
import requests
from requests.exceptions import HTTPError
from django.conf import settings
from celery import chain
from celery.task import Task
from celery.utils.log import get_task_logger
from seed_services_client.identity_store import IdentityStoreApiClient
fro... |
#!/usr/bin/env python3
# Copyright (c) 2009-2019 The Bitcoin Core developers
# Copyright (c) 2014-2019 The DigiByte Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Class for digibyted node under test"""
import c... |
from datetime import datetime
import numpy as np
import pytest
import pandas.util._test_decorators as td
from pandas.core.dtypes.base import _registry as ea_registry
from pandas.core.dtypes.common import (
is_categorical_dtype,
is_interval_dtype,
is_object_dtype,
)
from pandas.core.dtypes.dtypes import (... |
"""Backport of python 3.8 functools.cached_property.
cached_property() - computed once per instance, cached as attribute
"""
__all__ = ("cached_property",)
# Standard Library
from sys import version_info
if version_info <= (3, 5):
from cached_property import cached_property
elif version_info >= (3, 8):
# St... |
"""
Handlers
========
"""
import collections
from http import HTTPStatus
from aiohttp import web, hdrs
from .common import JSONAPI_CONTENT_TYPE, Relation
from .jsonpointer import JSONPointer
from .decorators import jsonapi_handler
from .errors import InvalidType
from .helpers import get_router_resource
from .utils im... |
import fnmatch
import os
import re
import subprocess
import tempfile
from difflib import SequenceMatcher
try:
import pygments
from pygments.lexers import get_lexer_for_filename
# from pygments.lexers import guess_lexer_for_filename
from pygments.formatters import HtmlFormatter
except ImportError:
p... |
import copy
import datetime
import json
import logging
import os
import re
import time
import warnings
from collections import defaultdict
from typing import List
import pandas as pd
import requests
from pyshex import ShExEvaluator
from rdflib import Graph
from shexer.shaper import Shaper
from wikidataintegrator.wdi_... |
#!/usr/bin/env python2
import re
from sys import argv
from os import walk
EXCLUDES = ["implementation", "testbench"]
def _vhdltree(level, filepath, pattern, vhd_files):
included_entities = find_entities(filepath, pattern)
if included_entities:
for entity, name in included_entities.iteritems():
... |
from datetime import datetime
from django.db import models
from django.utils.timesince import timesince
from django.utils.translation import ugettext_lazy as _
from ella.core.models import Publishable
from ella.core.cache import get_cached_list
class InfoBox(models.Model):
"""Defines embedable text model."""
... |
'''
Implement a quadtree
'''
import geom_utils as gu
MAX = 12
class Quadtree:
def __init__(self, xmin, ymin, xmax, ymax):
self.top = Node(xmin, ymin, xmax, ymax)
def insert(self, source):
self.inserttonode(self.top, source)
def inserttonode(self, node, source):
if len(node.conten... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
from urllib.request import urlopen
from lxml import etree
import socket
import re
from peewee import *
import configparser
################################################################################
## DATA RETRIEVAL:
def getServersListFile():
return urlopen("http://gs... |
from django.db import models
from django.core.exceptions import ValidationError
class OrderedModelManager(models.Manager):
def swap(self, obj1, obj2):
tmp, obj2.order = obj2.order, 0
obj2.save(swapping=True)
obj2.order, obj1.order = obj1.order, tmp
obj1.save()
obj2.save()
... |
from main import run
if __name__ == "__main__":
run()
|
import json
import uuid
import datetime
from datetime import timedelta
import responses
try:
from StringIO import StringIO
except ImportError:
from io import StringIO
from django.contrib.auth.models import User
from django.core.management import call_command
from django.test import TestCase
from django.db.mod... |
from django.http import HttpResponse
from django.shortcuts import render
from django.http import HttpResponse
from django.core.exceptions import ObjectDoesNotExist
from django.views.decorators.csrf import csrf_exempt
from django.views.decorators.http import require_POST
from django.core import serializers
from django.c... |
import logging
import sys
DEFAULT_LEVEL = logging.DEBUG
root = logging.getLogger()
ch = logging.StreamHandler(sys.stdout)
formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
ch.setFormatter(formatter)
root.addHandler(ch)
root.setLevel(DEFAULT_LEVEL)
# Make an exception for boto and... |
from ...core.base import AbstractNamedEntity
from ...http import URL
from ..server import SocketServer
from . import access_logger
from .exceptions import HttpException
from .protocol import Protocol
class WebServer(SocketServer, AbstractNamedEntity):
def __init__(self, *args, **kwargs):
super().__init__(... |
import unittest
from should_dsl import should
from chessboard import ChessBoard
from chesstournament.piece import Rook, Pawn, Horse, Bishop
class TestBoard(unittest.TestCase):
def it_has_a_size(self):
board = ChessBoard()
board.width |should| equal_to(8)
board.height |should| equal_to(8)
... |
from __future__ import absolute_import
import sys
import traceback
import logging
LOG_LEVELS = {
"CRITICAL": logging.CRITICAL,
"ERROR": logging.ERROR,
"WARNING": logging.WARNING,
"INFO": logging.INFO,
"DEBUG": logging.DEBUG
}
def get_log_level(level):
return LOG_LEVELS.get(level, logging.INFO... |
import os, timeit, argparse
from PIL import ImageDraw
from processMaze import Maze
from binaryHeap import BinaryHeap
class mazeSolve(object):
"""Takes in a maze, makes a graph, and solves it"""
def __init__(self, filename, to_crop=False):
self.maze = Maze(filename, to_crop=to_crop)
self.nod... |
import copy
import datetime
import logging
import os
import re
import time
from collections import defaultdict
from typing import List
import warnings
import pandas as pd
import requests
import json
import jsonasobj
from pyshex import ShExEvaluator
from sparql_slurper import SlurpyGraph
from ShExJSG import ShExC
fro... |
from django.db import models
from django.conf import settings
from django.contrib.sites.models import Site
class Section(models.Model):
"""A distinct, recurring classification for a group of Stories.
It is recommended that Sections bear resemblance to internal departments
and/or beats which regularly cre... |
# coding=utf-8
class VKError(Exception):
pass
class VKParseJsonError(Exception):
pass
|
# -*- coding: utf-8 -*-
"""
test_api_request.py
Test TinEyeAPIRequest class.
Copyright (c) 2015 Idée Inc. All rights reserved worldwide.
"""
from datetime import datetime
import unittest
from pytineye.api import Backlink, Match, TinEyeResponse
from pytineye.api import TinEyeAPIRequest
class TestTinEyeAPIRequest(... |
#!/usr/bin/env python
#
# TP-Link Wi-Fi Smart Plug Protocol Client
# For use with TP-Link HS-100 or HS-110
#
# by Lubomir Stroetmann
# Copyright 2016 softScheck GmbH
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obta... |
# Filename: test_db.py
# pylint: disable=C0111,E1003,R0904,C0103,R0201,C0102
from os.path import dirname, join
from km3pipe.testing import TestCase, MagicMock, patch
from km3pipe.db import (DBManager, DOMContainer, we_are_in_lyon, read_csv,
make_empty_dataset, StreamDS)
from km3pipe.logger impo... |
# -*- coding: utf-8 -*-
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
#... |
# -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2014 Compassion CH (http://www.compassion.ch)
# Releasing children from poverty in Jesus' name
# @author: Emanuel Cino <ecino@compassion.ch>
#
# The licence is in the file __open... |
from __future__ import absolute_import
import sys
import logging
LOG_LEVELS = {
"CRITICAL": logging.CRITICAL,
"ERROR": logging.ERROR,
"WARNING": logging.WARNING,
"INFO": logging.INFO,
"DEBUG": logging.DEBUG
}
def get_log_level(level):
return LOG_LEVELS.get(level, logging.INFO)
def set_l... |
#!/bin/env python
# Copyright 2020 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agre... |
import copy
import datetime
import logging
import os
import re
import time
from collections import defaultdict
from typing import List
import pandas as pd
import requests
import json
from wikidataintegrator.backoff.wdi_backoff import wdi_backoff
from wikidataintegrator.wdi_fastrun import FastRunContainer
from wikidat... |
"""
Utilities for ILC noise, source counts and associated power spectra, etc..
"""
import glob,os,sys
import numpy as np
from scipy.interpolate import interp1d
from orphics import maps, cosmology
# Helpers from tilec/fg.py [with J. Colin Hill]
######################################
# global constants
# MKS units, ... |
# -*- coding: utf-8 -*-
# Author: Simone Marsili <simomarsili@gmail.com>
# License: BSD 3 clause
"""
Functions for entropy and information measures estimation.
"""
import logging
from itertools import combinations
import numpy
import ndd
from ndd.data import DataArray
from ndd.divergence import JSDivergence
from ndd.... |
import dedupe
import unittest
import random
import numpy
import warnings
DATA_SAMPLE = ((dedupe.core.frozendict({'age': '27', 'name': 'Kyle'}),
dedupe.core.frozendict({'age': '50', 'name': 'Bob'})),
(dedupe.core.frozendict({'age': '27', 'name': 'Kyle'}),
dedupe.core.fro... |
# -*- coding: iso8859-1 -*-
#
# Copyright (C) 2004 Edgewall Software
# Copyright (C) 2004 Daniel Lundin <daniel@edgewall.com>
#
# Trac 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 of the
# ... |
# Filename: test_db.py
# pylint: disable=C0111,E1003,R0904,C0103,R0201,C0102
from km3pipe.testing import TestCase, MagicMock, patch
from km3pipe.db import DBManager, DOMContainer, we_are_in_lyon
from km3pipe.logger import get_logger
__author__ = "Tamas Gal"
__copyright__ = "Copyright 2016, Tamas Gal and the KM3NeT c... |
{
"inbound": [
{
"cookie": 1,
"match":
{
"tcp_dst": 4321
},
"action":
{
"fwd": 0
}
},
{
"cookie": 2,
"match":
{
"tcp_dst"... |
"""Implemention of various Tractography methods
these tools are meant to be paired with diffusion reconstruction methods from
dipy.reconst
This module uses the trackvis coordinate system, for more information about
this coordinate system please see dipy.tracking.utils
The following modules also use this coordinate sy... |
###########################################################################
# (C) Vrije Universiteit, Amsterdam (the Netherlands) #
# #
# This file is part of AmCAT - The Amsterdam Content Analysis Toolkit #
# ... |
# Standard Libary
import datetime
import logging
import random
import uuid
# Third-Party
from auth0.v3.authentication import Passwordless
from django_fsm import (
RETURN_VALUE,
FSMIntegerField,
transition,
)
from django_fsm_log.decorators import fsm_log_by
from dry_rest_permissions.generics import (
al... |
"""HighThroughputExecutor builds on the Swift/T EMEWS architecture to use MPI for fast task distribution
"""
from concurrent.futures import Future
import typeguard
import logging
import threading
import queue
import pickle
from multiprocessing import Process, Queue
from typing import Any, Dict, List, Optional, Tuple, ... |
#!/usr/bin/env python
# MIT License
#
# Copyright (c) 2017 Francesco Evangelista
#
# 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 right... |
import argparse
import yaml
import json
import requests
from __builtin__ import True, exit
parser = argparse.ArgumentParser()
parser.add_argument ('-c','--configuration', help = 'important configuration inputs', nargs=3, metavar =('host','username','password'))
parser.add_argument("-df", "--drop-filter", h... |
from __future__ import print_function
import numpy as np
from sympy import Symbol,Function
import sympy
from enlib import fft as efft, enmap, bench
from orphics import maps,io,stats,cosmology,lensing
import os,sys
"""
Routines to reduce and evaluate symbolic mode coupling integrals
"""
ifft = lambda x: efft.ifft(x,ax... |
"""
phase cycling labels
====================
demonstrate automatic labeling of phase cycling (coherence) axes
"""
from pyspecdata import *
a = nddata(r_[0:90],[3,3,10],['ph1','ph2','t']).setaxis('ph1','#').setaxis('ph2','#').setaxis('t','#').set_units('t','s')
a.ft(['ph1','ph2','t'])
print(a.unitify_axis('ph1'))
prin... |
#!/usr/bin/python
import os
import sys
import argparse
import traceback
from collections import deque
from input_handling import findNumber
from group import Group,run_grouping
from heapq import heappush, heappop
class KNearGroup(Group):
def __init__(self, tup):
super(KNearGroup, self).__init__(tu... |
# -*- coding: iso8859-1 -*-
#
# Copyright (C) 2005 Edgewall Software
# Copyright (C) 2005 Christopher Lenz <cmlenz@gmx.de>
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://trac.e... |
import pytest
from PyTeX import json, lexer, bib
@pytest.fixture
def simple():
with open('data/simple.bib') as f:
return lexer.FileIn(f, bib.SUB_DICT)
def test_FileIn(f=simple):
assert f().read() == """@article{test, author = {Dillon Niederhut}, title={Structured data with PyTeX}, year=2016 }"""... |
from __future__ import division, print_function, absolute_import
import numpy as np
import amitgroup as ag
# If skimage is available, the image returned will be wrapped
# in the Image class. This is nice since it will be automatically
# displayed in an IPython notebook.
try:
from skimage.io import Image
except Imp... |
import os
import inspect
class Plugin:
def __init__(self, name, dataset_plugins=None, attribute_plugins=None,
file_plugins=None, group_plugins=None, raw_plugins=None,
write_before=None, write_after=None,
read_before=None, read_after=None):
self.name = nam... |
import json
import os
import yaml
from cached_property import cached_property
from databuild.compat import _open
class BuildFile(object):
def __init__(self, path):
self.path = os.path.abspath(path)
super(BuildFile, self).__init__()
@property
def parent_dir(self):
return os.path.d... |
import logging.config
import os
from configobj import ConfigObj
from configobj import flatten_errors
from configobj import get_extra_values
from validate import Validator
try:
import kolibri.core.analytics.pskolibri as psutil
except NotImplementedError:
# This module can't work on this OS
psutil = None
d... |
# Standard Libary
import datetime
import logging
import random
import uuid
# Third-Party
from django_fsm import (
FSMIntegerField,
transition,
)
from django_fsm_log.decorators import fsm_log_by
from dry_rest_permissions.generics import (
allow_staff_or_superuser,
authenticated_users,
)
from model_utils... |
from concurrent.futures import Future
import typeguard
import logging
import threading
import queue
import datetime
import pickle
from multiprocessing import Queue
from typing import Dict, Sequence # noqa F401 (used in type annotation)
from typing import List, Optional, Tuple, Union
import math
from parsl.serialize i... |
# Copyright 2014 Objectif Libre
# Copyright 2015 Dot Hill Systems Corp.
# Copyright 2016 Seagate Technology or one of its affiliates
#
# 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 Lic... |
from typing import Set
from django.contrib import admin
from django.contrib.auth.models import User, Group
from django.contrib.auth.admin import UserAdmin
# Unregister the default user model admin
admin.site.unregister(User)
@admin.register(User)
class CustomUserAdmin(UserAdmin):
"""A custom admin interface for... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import errno
import pandas as pd
import numpy as np
from include.likertScalePlot import compute_percentage
from include.textCleaning import wordcloud
import itertools as it
def get_answer(file_answer):
"""
"""
with open(file_answer, 'r') as f:
... |
# -*- coding: utf-8 -*-
import io
import textwrap
import click
from click.testing import CliRunner
import pytest
from profiling.__about__ import __version__
from profiling.__main__ import cli, Module, profiler_options, ProfilingCLI
from profiling.sampling import SamplingProfiler
from profiling.sampling.samplers impor... |
"""
A script to estimate the HIV epidemic model parameters using ABC.
"""
from apgl.util import *
from exp.viroscopy.model.HIVGraph import HIVGraph
from exp.viroscopy.model.HIVABCParameters import HIVABCParameters
from exp.viroscopy.model.HIVEpidemicModel import HIVEpidemicModel
from exp.viroscopy.model.HIVRates impor... |
from django.contrib import admin
from .models import FrequentItemSet, Operation
class MinerAdmin(admin.ModelAdmin):
using = 'miner'
def save_model(self, request, obj, form, change):
pass
def delete_model(self, request, obj):
pass
def get_queryset(self, request):
return supe... |
import re
from django import forms
from django.core.files.uploadedfile import InMemoryUploadedFile
from django.forms.util import flatatt
from django.forms.widgets import FileInput
from django.template import Context
from django.template.loader import render_to_string
from django.utils import formats, six
from django.ut... |
from datetime import date
from workalendar.tests import GenericCalendarTest
from workalendar.asia import (
HongKong, Japan, Qatar, Singapore,
SouthKorea, Taiwan, Malaysia, China, Israel
)
class ChinaTest(GenericCalendarTest):
cal_class = China
def test_year_2018(self):
holidays = self.cal.h... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import os
import io
import re
import six
import json
import copy
import glob
import shutil
import zipfile
import requests
import warnings
import tempfile
from copy import... |
"""
We follow semantic versioning 2.0.0 according to
`semver.org <http://semver.org/>`__ but for Python distributions and in the
internal string representation in Python, you will find a
`PEP-440 <https://www.python.org/dev/peps/pep-0440/>`__ flavor.
* ``1.1.0`` (Semver) = ``1.1`` (PEP-440).
* ``1.0.0-alpha.1`` (Se... |
#!/usr/bin/python3
#
# Copyright 2013 Sean Alexandre
#
# This program 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 later version.
#
# This ... |
import json
from contextlib import contextmanager
from django.contrib import admin
from django.contrib.admin.tests import AdminSeleniumTestCase
from django.contrib.admin.views.autocomplete import AutocompleteJsonView
from django.contrib.auth.models import Permission, User
from django.contrib.contenttypes.models import... |
#!/usr/bin/env python3
import re, numbers, collections
from .helpers import round_to_pipet, UserInputError
class Reaction:
def __init__(self, std_reagents=None):
self.reagents = collections.OrderedDict()
self._num_reactions = 1
self._extra_master_mix = 10
self.show_each_rxn = True... |
import requests
from routes import url_for
from ckan.tests.helpers import reset_db
from ckan import plugins
from ckanext.orgdashboards.tests.helpers import (id_generator,
create_mock_data,
get_site_base_url)
class Tes... |
import argparse
import glob
from datetime import datetime
import csv
import os
import shutil
import ast
import json
FIELD_DELIMITER = ',' # delimiter used in output CSV
#FOLDER_REGIONS = {'BRIT-VDB-AL':'Alabama', 'BRIT-VDB-TN':'Tennessee', 'BRIT-VDB-NA':'North America'}
DWC_TEMPLATE = {'dwc:country':'United States o... |
# test_radl - Test for module ``radl``.
# Copyright (C) 2014 - GRyCAP - Universitat Politecnica de Valencia
#
# This program 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
... |
# -*- coding: utf-8 -*-
import time
import datetime
import mock
from factory import SubFactory
from factory.fuzzy import FuzzyDateTime, FuzzyAttribute, FuzzyChoice
from mock import patch, Mock
import factory
import pytz
from factory.django import DjangoModelFactory
from django.utils import timezone
from django.contri... |
from datetime import date
from workalendar.tests import GenericCalendarTest
from workalendar.core import MON, TUE, THU, FRI
from workalendar.core import Calendar, LunarCalendar
from workalendar.core import IslamicMixin, JalaliMixin
class CalendarTest(GenericCalendarTest):
def test_private_variables(self):
... |
""" Contains Batch classes for images """
import os
from numbers import Number
from functools import wraps
try:
from imageio import imread
except ImportError:
from scipy.ndimage import imread
import numpy as np
#pylint: disable=ungrouped-imports
import scipy.ndimage
from scipy.misc import imsave, imresize
fr... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
requests_cache.core
~~~~~~~~~~~~~~~~~~~
Core functions for configuring cache and monkey patching ``requests``
"""
from datetime import datetime, timedelta
import requests
from requests import Session
from requests_cache import backends
from requests_cache... |
__author__ = 'srkiyengar'
import pygame
import logging
import logging.handlers
from datetime import datetime
import reflex
import screen_print as sp
import joystick as js
import threading
import time
import data_collect as dc
import random
import tcp_client as tc
SOME_MIN_RANDOM_NUMBER = 100001
SOME_MAX_RANDOM_NUMBE... |
#
# Konstrukteur - Static website generator
# Copyright 2013 Sebastian Fastner
#
"""
**Konstrukteur - Static website generator**
Konstrukteur is a website generator that uses a template and content files
to create static website output.
"""
__version__ = "0.1.14"
__author__ = "Sebastian Fastner <mail@sebastianfastne... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.